summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2019-04-02 18:29:51 -0500
committerMarcus Huderle <huderlem@gmail.com>2019-04-02 18:29:51 -0500
commit181baf9fe561e893023f71a5793a8b1ac6d644d6 (patch)
tree8ac4906fc6f70fb000fc3fbcd73a325dc6114d20
parent1241700b204b9f450221299c6e837c0f522f60b2 (diff)
parentd8c9f1b30fb92289e7aa4d44dfcf1b2120bea8d6 (diff)
Merge remote-tracking branch 'upstream/master' into misc_docs
# Conflicts: # src/field_weather_effect.c
-rwxr-xr-xasm/dodrio_berry_picking.s2
-rw-r--r--asm/macros/battle_anim_script.inc14
-rwxr-xr-xasm/mevent_server.s8
-rwxr-xr-xasm/mevent_server_ish.s56
-rwxr-xr-xasm/pokemon_jump.s12
-rw-r--r--asm/pokenav.s4
-rwxr-xr-xasm/union_room.s5306
-rw-r--r--data/battle_anim_scripts.s86
-rw-r--r--data/contest.s412
-rw-r--r--data/contest_opponents.inc2114
-rw-r--r--data/maps/AbandonedShip_CaptainsOffice/map.json2
-rw-r--r--data/scripts/cable_club.inc2
-rw-r--r--data/specials.inc2
-rw-r--r--data/text/contest_text_pointers.inc78
-rwxr-xr-xdata/union_room.s246
-rw-r--r--include/battle_setup.h6
-rwxr-xr-xinclude/constants/event_object_movement_constants.h2
-rw-r--r--include/constants/flags.h15
-rw-r--r--include/constants/game_stat.h2
-rw-r--r--include/constants/maps.h6
-rw-r--r--include/contest.h30
-rwxr-xr-xinclude/ereader_screen.h2
-rw-r--r--include/event_object_movement.h5
-rw-r--r--include/field_player_avatar.h12
-rw-r--r--include/fieldmap.h1
-rw-r--r--include/fldeff.h1
-rw-r--r--include/global.fieldmap.h27
-rw-r--r--include/graphics.h8
-rw-r--r--include/gym_leader_rematch.h8
-rw-r--r--include/international_string_util.h2
-rw-r--r--include/link.h2
-rw-r--r--include/link_rfu.h2
-rw-r--r--include/list_menu.h2
-rw-r--r--include/main.h2
-rw-r--r--include/menu.h6
-rwxr-xr-xinclude/mevent.h18
-rw-r--r--include/mevent2.h6
-rw-r--r--include/mevent_801BAAC.h16
-rwxr-xr-xinclude/mevent_news.h1
-rw-r--r--include/mevent_server.h8
-rw-r--r--include/mevent_server_ish.h10
-rw-r--r--include/mystery_gift.h16
-rw-r--r--include/rom_8011DC0.h171
-rw-r--r--include/script_menu.h2
-rw-r--r--include/strings.h74
-rw-r--r--include/text_window.h4
-rw-r--r--include/union_room.h169
-rw-r--r--include/union_room_battle.h7
-rw-r--r--include/union_room_player_avatar.h14
-rw-r--r--ld_script.txt10
-rw-r--r--src/battle_anim.c362
-rw-r--r--src/battle_anim_effects_1.c16
-rwxr-xr-xsrc/battle_anim_effects_2.c4
-rw-r--r--src/battle_bg.c2
-rw-r--r--src/battle_main.c22
-rw-r--r--src/battle_setup.c160
-rw-r--r--src/berry_blender.c2
-rwxr-xr-xsrc/berry_crush.c2
-rw-r--r--src/bug.c19
-rw-r--r--[-rwxr-xr-x]src/cable_car.c34
-rw-r--r--src/cable_club.c3
-rw-r--r--src/contest.c633
-rw-r--r--src/contest_link_80F57C4.c2
-rw-r--r--src/contest_painting.c5
-rw-r--r--src/dark.c44
-rw-r--r--src/data/contest_opponents.h3066
-rw-r--r--src/data/contest_text_tables.h414
-rw-r--r--src/decoration.c13
-rw-r--r--src/easy_chat.c2
-rwxr-xr-xsrc/ereader_helpers.c2
-rwxr-xr-xsrc/ereader_screen.c34
-rw-r--r--src/evolution_scene.c2
-rw-r--r--src/field_effect.c41
-rw-r--r--src/field_weather_effect.c27
-rw-r--r--src/fldeff_misc.c2
-rw-r--r--src/fldeff_rocksmash.c3
-rw-r--r--src/ghost.c106
-rw-r--r--src/international_string_util.c2
-rw-r--r--src/link_rfu.c24
-rw-r--r--src/list_menu.c4
-rw-r--r--src/main_menu.c3
-rw-r--r--src/mauville_old_man.c4
-rw-r--r--src/menu.c68
-rwxr-xr-xsrc/mevent2.c46
-rw-r--r--src/mevent_801BAAC.c381
-rw-r--r--src/mevent_news.c4
-rw-r--r--src/mystery_event_menu.c2
-rw-r--r--src/mystery_gift.c1703
-rw-r--r--src/naming_screen.c29
-rwxr-xr-xsrc/party_menu.c2
-rwxr-xr-xsrc/pokedex_area_screen.c226
-rw-r--r--[-rwxr-xr-x]src/pokedex_cry_screen.c8
-rw-r--r--src/pokemon.c360
-rw-r--r--src/pokemon_icon.c893
-rw-r--r--src/pokemon_storage_system.c2
-rw-r--r--src/pokenav_match_call.c260
-rw-r--r--src/script.c2
-rw-r--r--src/script_menu.c107
-rwxr-xr-xsrc/script_pokemon_util_80F87D8.c4
-rw-r--r--src/start_menu.c5
-rw-r--r--src/text_window.c4
-rw-r--r--src/trade.c13
-rw-r--r--src/union_room.c103
-rw-r--r--src/union_room_battle.c631
-rwxr-xr-xsrc/union_room_chat.c8
-rw-r--r--src/union_room_player_avatar.c611
-rw-r--r--src/use_pokeblock.c6
-rw-r--r--sym_bss.txt1
-rw-r--r--sym_ewram.txt35
-rw-r--r--tools/gbafix/gbafix.c2
110 files changed, 9478 insertions, 10108 deletions
diff --git a/asm/dodrio_berry_picking.s b/asm/dodrio_berry_picking.s
index e52e7a347..505f305b9 100755
--- a/asm/dodrio_berry_picking.s
+++ b/asm/dodrio_berry_picking.s
@@ -6401,7 +6401,7 @@ sub_8027BEC: @ 8027BEC
adds r0, r7, 0
adds r1, r4, 0
movs r2, 0xD
- bl sub_8098858
+ bl DrawTextBorderOuter
adds r0, r7, 0
movs r1, 0x11
bl FillWindowPixelBuffer
diff --git a/asm/macros/battle_anim_script.inc b/asm/macros/battle_anim_script.inc
index 6ccd8d505..32d9de82c 100644
--- a/asm/macros/battle_anim_script.inc
+++ b/asm/macros/battle_anim_script.inc
@@ -153,19 +153,19 @@
.byte \param4
.endm
- .macro loopsewithpan se:req, param1:req, param2:req, param3:req
+ .macro loopsewithpan se:req, pan:req, wait:req, times:req
.byte 0x1c
.2byte \se
- .byte \param1
- .byte \param2
- .byte \param3
+ .byte \pan
+ .byte \wait
+ .byte \times
.endm
- .macro waitplaysewithpan se:req, param1:req, param2:req
+ .macro waitplaysewithpan se:req, pan:req, wait:req
.byte 0x1d
.2byte \se
- .byte \param1
- .byte \param2
+ .byte \pan
+ .byte \wait
.endm
.macro setbldcnt param0:req
diff --git a/asm/mevent_server.s b/asm/mevent_server.s
index c89867474..8c76e2d0d 100755
--- a/asm/mevent_server.s
+++ b/asm/mevent_server.s
@@ -39,8 +39,8 @@ mevent_srv_new_wcard: @ 801D0A0
.pool
thumb_func_end mevent_srv_new_wcard
- thumb_func_start sub_801D0C4
-sub_801D0C4: @ 801D0C4
+ thumb_func_start mevent_srv_common_do_exec
+mevent_srv_common_do_exec: @ 801D0C4
push {r4-r6,lr}
adds r6, r0, 0
ldr r4, =gUnknown_02022C7C
@@ -69,7 +69,7 @@ _0801D0F8:
pop {r4-r6}
pop {r1}
bx r1
- thumb_func_end sub_801D0C4
+ thumb_func_end mevent_srv_common_do_exec
thumb_func_start mevent_srv_init_common
mevent_srv_init_common: @ 801D100
@@ -493,7 +493,7 @@ _0801D422:
b _0801D464
_0801D43C:
ldr r4, [r5, 0x1C]
- bl sub_801B00C
+ bl sav1_get_mevent_buffer_0
adds r1, r0, 0
movs r2, 0xDE
lsls r2, 1
diff --git a/asm/mevent_server_ish.s b/asm/mevent_server_ish.s
index 0d2db68c2..f61666982 100755
--- a/asm/mevent_server_ish.s
+++ b/asm/mevent_server_ish.s
@@ -5,11 +5,11 @@
.text
- thumb_func_start sub_801D484
-sub_801D484: @ 801D484
+ thumb_func_start mevent_srv_ish_do_init
+mevent_srv_ish_do_init: @ 801D484
push {r4,r5,lr}
adds r5, r0, 0
- ldr r4, =gUnknown_02022C80
+ ldr r4, =s_mevent_srv_ish_ptr
movs r0, 0x50
bl AllocZeroed
str r0, [r4]
@@ -22,13 +22,13 @@ sub_801D484: @ 801D484
pop {r0}
bx r0
.pool
- thumb_func_end sub_801D484
+ thumb_func_end mevent_srv_ish_do_init
- thumb_func_start sub_801D4A8
-sub_801D4A8: @ 801D4A8
+ thumb_func_start mevent_srv_ish_do_exec
+mevent_srv_ish_do_exec: @ 801D4A8
push {r4-r6,lr}
adds r6, r0, 0
- ldr r4, =gUnknown_02022C80
+ ldr r4, =s_mevent_srv_ish_ptr
ldr r0, [r4]
cmp r0, 0
bne _0801D4BC
@@ -43,7 +43,7 @@ _0801D4BC:
ldr r0, [r4]
ldr r1, [r0, 0x4]
strh r1, [r6]
- bl sub_801D55C
+ bl mevent_srv_ish_free_resources
ldr r0, [r4]
bl Free
movs r0, 0
@@ -54,36 +54,36 @@ _0801D4DC:
pop {r4-r6}
pop {r1}
bx r1
- thumb_func_end sub_801D4A8
+ thumb_func_end mevent_srv_ish_do_exec
- thumb_func_start sub_801D4E4
-sub_801D4E4: @ 801D4E4
- ldr r0, =gUnknown_02022C80
+ thumb_func_start mevent_srv_ish_inc_flag
+mevent_srv_ish_inc_flag: @ 801D4E4
+ ldr r0, =s_mevent_srv_ish_ptr
ldr r1, [r0]
ldr r0, [r1, 0xC]
adds r0, 0x1
str r0, [r1, 0xC]
bx lr
.pool
- thumb_func_end sub_801D4E4
+ thumb_func_end mevent_srv_ish_inc_flag
- thumb_func_start sub_801D4F4
-sub_801D4F4: @ 801D4F4
- ldr r0, =gUnknown_02022C80
+ thumb_func_start mevent_srv_ish_get_buffer
+mevent_srv_ish_get_buffer: @ 801D4F4
+ ldr r0, =s_mevent_srv_ish_ptr
ldr r0, [r0]
ldr r0, [r0, 0x20]
bx lr
.pool
- thumb_func_end sub_801D4F4
+ thumb_func_end mevent_srv_ish_get_buffer
- thumb_func_start sub_801D500
-sub_801D500: @ 801D500
- ldr r1, =gUnknown_02022C80
+ thumb_func_start mevent_srv_ish_set_param
+mevent_srv_ish_set_param: @ 801D500
+ ldr r1, =s_mevent_srv_ish_ptr
ldr r1, [r1]
str r0, [r1, 0x4]
bx lr
.pool
- thumb_func_end sub_801D500
+ thumb_func_end mevent_srv_ish_set_param
thumb_func_start mevent_srv_ish_init
mevent_srv_ish_init: @ 801D50C
@@ -123,8 +123,8 @@ mevent_srv_ish_init: @ 801D50C
bx r0
thumb_func_end mevent_srv_ish_init
- thumb_func_start sub_801D55C
-sub_801D55C: @ 801D55C
+ thumb_func_start mevent_srv_ish_free_resources
+mevent_srv_ish_free_resources: @ 801D55C
push {r4,lr}
adds r4, r0, 0
ldr r0, [r4, 0x14]
@@ -138,10 +138,10 @@ sub_801D55C: @ 801D55C
pop {r4}
pop {r0}
bx r0
- thumb_func_end sub_801D55C
+ thumb_func_end mevent_srv_ish_free_resources
- thumb_func_start sub_801D580
-sub_801D580: @ 801D580
+ thumb_func_start mevent_srv_ish_jmp_buffer
+mevent_srv_ish_jmp_buffer: @ 801D580
push {r4,lr}
adds r4, r0, 0
ldr r0, [r4, 0x1C]
@@ -154,7 +154,7 @@ sub_801D580: @ 801D580
pop {r4}
pop {r0}
bx r0
- thumb_func_end sub_801D580
+ thumb_func_end mevent_srv_ish_jmp_buffer
thumb_func_start sub_801D59C
sub_801D59C: @ 801D59C
@@ -340,7 +340,7 @@ _0801D708:
bne _0801D804
_0801D70E:
adds r0, r4, 0
- bl sub_801D580
+ bl mevent_srv_ish_jmp_buffer
b _0801D804
_0801D716:
ldr r0, [r4, 0x20]
diff --git a/asm/pokemon_jump.s b/asm/pokemon_jump.s
index 19d6622a3..e9aa9089d 100755
--- a/asm/pokemon_jump.s
+++ b/asm/pokemon_jump.s
@@ -5491,7 +5491,7 @@ _0802D4A4:
ldrb r0, [r0, 0x12]
movs r1, 0x1
movs r2, 0xE
- bl sub_8098858
+ bl DrawTextBorderOuter
movs r0, 0x17
movs r1, 0x7
movs r2, 0
@@ -5575,7 +5575,7 @@ _0802D550:
ldrb r0, [r0, 0x12]
movs r1, 0x1
movs r2, 0xE
- bl sub_8098858
+ bl DrawTextBorderOuter
movs r0, 0
bl CopyBgTilemapBufferToVram
_0802D574:
@@ -5693,7 +5693,7 @@ _0802D640:
ldrb r0, [r0, 0x12]
movs r1, 0x1
movs r2, 0xE
- bl sub_8098858
+ bl DrawTextBorderOuter
movs r0, 0
bl CopyBgTilemapBufferToVram
_0802D664:
@@ -5773,7 +5773,7 @@ _0802D6E4:
ldrb r0, [r0, 0x12]
movs r1, 0x1
movs r2, 0xE
- bl sub_8098858
+ bl DrawTextBorderOuter
movs r0, 0
bl CopyBgTilemapBufferToVram
_0802D708:
@@ -6107,7 +6107,7 @@ _0802D99A:
ldrb r0, [r0, 0x12]
movs r1, 0x1
movs r2, 0xE
- bl sub_8098858
+ bl DrawTextBorderOuter
movs r0, 0
bl CopyBgTilemapBufferToVram
ldr r1, [r4]
@@ -7596,7 +7596,7 @@ sub_802E500: @ 802E500
adds r0, r4, 0
adds r1, r5, 0
movs r2, 0xD
- bl sub_8098858
+ bl DrawTextBorderOuter
adds r0, r4, 0
movs r1, 0x11
bl FillWindowPixelBuffer
diff --git a/asm/pokenav.s b/asm/pokenav.s
index f575c9aa8..8b082c2ae 100644
--- a/asm/pokenav.s
+++ b/asm/pokenav.s
@@ -8104,7 +8104,7 @@ sub_81CC09C: @ 81CC09C
ldrb r0, [r4, 0x14]
movs r1, 0x1
movs r2, 0x4
- bl sub_8098858
+ bl DrawTextBorderOuter
ldrb r0, [r4, 0x14]
movs r1, 0x11
bl FillWindowPixelBuffer
@@ -9354,7 +9354,7 @@ sub_81CCA1C: @ 81CCA1C
ldrb r0, [r5, 0x8]
movs r1, 0x42
movs r2, 0x4
- bl sub_8098858
+ bl DrawTextBorderOuter
ldr r1, =gUnknown_08622888
str r4, [sp]
movs r0, 0x1
diff --git a/asm/union_room.s b/asm/union_room.s
deleted file mode 100755
index ca5ad6853..000000000
--- a/asm/union_room.s
+++ /dev/null
@@ -1,5306 +0,0 @@
- .include "asm/macros.inc"
- .include "constants/constants.inc"
-
- .syntax unified
-
- .text
-
- thumb_func_start sub_8018424
-sub_8018424: @ 8018424
- push {lr}
- bl ProcessSpriteCopyRequests
- bl LoadOam
- bl TransferPlttBuffer
- pop {r0}
- bx r0
- thumb_func_end sub_8018424
-
- thumb_func_start sub_8018438
-sub_8018438: @ 8018438
- push {lr}
- bl RunTasks
- bl RunTextPrinters
- bl AnimateSprites
- bl BuildOamBuffer
- pop {r0}
- bx r0
- thumb_func_end sub_8018438
-
- thumb_func_start sub_8018450
-sub_8018450: @ 8018450
- push {r4-r7,lr}
- sub sp, 0xC
- adds r7, r0, 0
- ldr r0, =gMain
- movs r1, 0x87
- lsls r1, 3
- adds r6, r0, r1
- ldrb r0, [r6]
- cmp r0, 0x1
- bne _08018466
- b _08018574
-_08018466:
- cmp r0, 0x1
- bgt _08018474
- cmp r0, 0
- beq _08018482
- b _08018644
- .pool
-_08018474:
- cmp r0, 0x2
- bne _0801847A
- b _080185F8
-_0801847A:
- cmp r0, 0x3
- bne _08018480
- b _08018618
-_08018480:
- b _08018644
-_08018482:
- movs r0, 0
- bl SetVBlankCallback
- bl ResetPaletteFade
- bl ResetSpriteData
- bl FreeAllSpritePalettes
- bl ResetTasks
- bl ScanlineEffect_Stop
- movs r0, 0
- bl ResetBgsAndClearDma3BusyFlags
- ldr r1, =gUnknown_082F0598
- movs r0, 0
- movs r2, 0x4
- bl InitBgsFromTemplates
- movs r0, 0
- movs r1, 0
- movs r2, 0
- bl ChangeBgX
- movs r0, 0
- movs r1, 0
- movs r2, 0
- bl ChangeBgY
- movs r0, 0x1
- movs r1, 0
- movs r2, 0
- bl ChangeBgX
- movs r0, 0x1
- movs r1, 0
- movs r2, 0
- bl ChangeBgY
- movs r0, 0x2
- movs r1, 0
- movs r2, 0
- bl ChangeBgX
- movs r0, 0x2
- movs r1, 0
- movs r2, 0
- bl ChangeBgY
- movs r0, 0x3
- movs r1, 0
- movs r2, 0
- bl ChangeBgX
- movs r0, 0x3
- movs r1, 0
- movs r2, 0
- bl ChangeBgY
- movs r4, 0x80
- lsls r4, 4
- adds r0, r4, 0
- bl Alloc
- adds r1, r0, 0
- movs r0, 0x3
- bl SetBgTilemapBuffer
- adds r0, r4, 0
- bl Alloc
- adds r1, r0, 0
- movs r0, 0x2
- bl SetBgTilemapBuffer
- adds r0, r4, 0
- bl Alloc
- adds r1, r0, 0
- movs r0, 0x1
- bl SetBgTilemapBuffer
- adds r0, r4, 0
- bl Alloc
- adds r1, r0, 0
- movs r0, 0
- bl SetBgTilemapBuffer
- movs r0, 0x3
- bl bgid_upload_textbox_1
- ldr r0, =gUnknown_082F05A8
- bl InitWindows
- bl DeactivateAllTextPrinters
- movs r1, 0xC0
- lsls r1, 7
- movs r0, 0
- bl ClearGpuRegBits
- movs r0, 0x50
- movs r1, 0
- bl SetGpuReg
- movs r0, 0x52
- movs r1, 0
- bl SetGpuReg
- movs r0, 0x54
- movs r1, 0
- bl SetGpuReg
- b _08018610
- .pool
-_08018574:
- ldr r0, =gUnkTextboxBorderPal
- movs r1, 0
- movs r2, 0x20
- bl LoadPalette
- movs r0, 0x2
- bl stdpal_get
- movs r1, 0xD0
- movs r2, 0x20
- bl LoadPalette
- movs r0, 0xC0
- bl sub_81978B0
- movs r0, 0
- movs r1, 0xA
- movs r2, 0xE0
- bl LoadUserWindowBorderGfx
- movs r0, 0
- movs r1, 0x1
- movs r2, 0xF0
- bl LoadUserWindowBorderGfx_
- movs r4, 0x20
- str r4, [sp]
- str r4, [sp, 0x4]
- movs r5, 0x11
- str r5, [sp, 0x8]
- movs r0, 0
- movs r1, 0
- movs r2, 0
- movs r3, 0
- bl FillBgTilemapBufferRect
- str r4, [sp]
- str r4, [sp, 0x4]
- str r5, [sp, 0x8]
- movs r0, 0x1
- movs r1, 0
- movs r2, 0
- movs r3, 0
- bl FillBgTilemapBufferRect
- str r4, [sp]
- str r4, [sp, 0x4]
- str r5, [sp, 0x8]
- movs r0, 0x2
- movs r1, 0
- movs r2, 0
- movs r3, 0
- bl FillBgTilemapBufferRect
- movs r0, 0x3
- bl sub_8018798
- lsls r0, r7, 24
- lsrs r0, 24
- movs r1, 0
- bl sub_80186EC
- b _08018610
- .pool
-_080185F8:
- movs r0, 0x3
- bl CopyBgTilemapBufferToVram
- movs r0, 0x2
- bl CopyBgTilemapBufferToVram
- movs r0, 0x1
- bl CopyBgTilemapBufferToVram
- movs r0, 0
- bl CopyBgTilemapBufferToVram
-_08018610:
- ldrb r0, [r6]
- adds r0, 0x1
- strb r0, [r6]
- b _08018644
-_08018618:
- movs r0, 0
- bl ShowBg
- movs r0, 0x3
- bl ShowBg
- ldr r0, =0x0000021d
- bl PlayBGM
- ldr r0, =sub_8018424
- bl SetVBlankCallback
- movs r0, 0xC5
- bl EnableInterrupts
- movs r0, 0x1
- b _08018646
- .pool
-_08018644:
- movs r0, 0
-_08018646:
- add sp, 0xC
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end sub_8018450
-
- thumb_func_start c2_mystery_gift
-c2_mystery_gift: @ 8018650
- push {lr}
- movs r0, 0
- bl sub_8018450
- cmp r0, 0
- beq _0801866C
- ldr r0, =sub_8018438
- bl SetMainCallback2
- ldr r1, =gUnknown_02022C60
- movs r0, 0
- strb r0, [r1]
- bl task_add_00_mystery_gift
-_0801866C:
- bl RunTasks
- pop {r0}
- bx r0
- .pool
- thumb_func_end c2_mystery_gift
-
- thumb_func_start sub_801867C
-sub_801867C: @ 801867C
- push {lr}
- movs r0, 0x1
- bl sub_8018450
- cmp r0, 0
- beq _08018698
- ldr r0, =sub_8018438
- bl SetMainCallback2
- ldr r1, =gUnknown_02022C60
- movs r0, 0x1
- strb r0, [r1]
- bl sub_81D5014
-_08018698:
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_801867C
-
- thumb_func_start sub_80186A4
-sub_80186A4: @ 80186A4
- push {lr}
- ldr r1, =gUnknown_02022C60
- movs r0, 0
- strb r0, [r1]
- bl FreeAllWindowBuffers
- movs r0, 0
- bl GetBgTilemapBuffer
- bl Free
- movs r0, 0x1
- bl GetBgTilemapBuffer
- bl Free
- movs r0, 0x2
- bl GetBgTilemapBuffer
- bl Free
- movs r0, 0x3
- bl GetBgTilemapBuffer
- bl Free
- ldr r0, =CB2_InitTitleScreen
- bl SetMainCallback2
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_80186A4
-
- thumb_func_start sub_80186EC
-sub_80186EC: @ 80186EC
- push {r4-r7,lr}
- sub sp, 0x14
- adds r4, r0, 0
- adds r5, r1, 0
- lsls r4, 24
- lsrs r4, 24
- movs r0, 0
- movs r1, 0
- bl FillWindowPixelBuffer
- cmp r4, 0
- bne _0801871C
- ldr r0, =gText_MysteryGift
- ldr r7, =gText_PickOKCancel
- cmp r5, 0
- bne _08018720
- ldr r7, =gText_PickOKExit
- b _08018720
- .pool
-_0801871C:
- ldr r0, =gJPText_MysteryGift
- ldr r7, =gJPText_DecideStop
-_08018720:
- movs r4, 0
- str r4, [sp]
- str r4, [sp, 0x4]
- ldr r6, =gUnknown_082F0720
- str r6, [sp, 0x8]
- movs r5, 0x1
- negs r5, r5
- str r5, [sp, 0xC]
- str r0, [sp, 0x10]
- movs r0, 0
- movs r1, 0x1
- movs r2, 0x4
- movs r3, 0x1
- bl AddTextPrinterParameterized4
- movs r0, 0
- adds r1, r7, 0
- movs r2, 0xDE
- bl GetStringRightAlignXOffset
- adds r2, r0, 0
- lsls r2, 24
- lsrs r2, 24
- str r4, [sp]
- str r4, [sp, 0x4]
- str r6, [sp, 0x8]
- str r5, [sp, 0xC]
- str r7, [sp, 0x10]
- movs r0, 0
- movs r1, 0
- movs r3, 0x1
- bl AddTextPrinterParameterized4
- movs r0, 0
- movs r1, 0x2
- bl CopyWindowToVram
- movs r0, 0
- bl PutWindowTilemap
- add sp, 0x14
- pop {r4-r7}
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_80186EC
-
- thumb_func_start sub_8018784
-sub_8018784: @ 8018784
- push {lr}
- lsls r0, 24
- lsrs r0, 24
- movs r1, 0x1
- movs r2, 0xF
- bl sub_8098858
- pop {r0}
- bx r0
- thumb_func_end sub_8018784
-
- thumb_func_start sub_8018798
-sub_8018798: @ 8018798
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0xC
- adds r4, r0, 0
- movs r0, 0
- mov r9, r0
- lsls r4, 24
- lsrs r0, r4, 24
- movs r1, 0x20
- str r1, [sp]
- movs r1, 0x2
- str r1, [sp, 0x4]
- movs r1, 0x11
- str r1, [sp, 0x8]
- movs r1, 0x3
- movs r2, 0
- movs r3, 0
- bl FillBgTilemapBufferRect
- mov r8, r4
- movs r4, 0x1
-_080187C8:
- movs r7, 0
- mov r0, r9
- adds r0, 0x2
- movs r1, 0x1
- add r1, r9
- mov r10, r1
- lsls r5, r0, 24
- movs r6, 0
-_080187D8:
- mov r1, r9
- ands r1, r4
- adds r0, r7, 0
- ands r0, r4
- cmp r1, r0
- beq _080187FC
- lsrs r2, r6, 24
- str r4, [sp]
- str r4, [sp, 0x4]
- movs r0, 0x11
- str r0, [sp, 0x8]
- mov r1, r8
- lsrs r0, r1, 24
- movs r1, 0x1
- lsrs r3, r5, 24
- bl FillBgTilemapBufferRect
- b _08018812
-_080187FC:
- lsrs r2, r6, 24
- str r4, [sp]
- str r4, [sp, 0x4]
- movs r0, 0x11
- str r0, [sp, 0x8]
- mov r1, r8
- lsrs r0, r1, 24
- movs r1, 0x2
- lsrs r3, r5, 24
- bl FillBgTilemapBufferRect
-_08018812:
- movs r0, 0x80
- lsls r0, 17
- adds r6, r0
- adds r7, 0x1
- cmp r7, 0x1F
- ble _080187D8
- mov r9, r10
- mov r1, r9
- cmp r1, 0x11
- ble _080187C8
- add sp, 0xC
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r0}
- bx r0
- thumb_func_end sub_8018798
-
- thumb_func_start sub_8018838
-sub_8018838: @ 8018838
- push {lr}
- sub sp, 0xC
- cmp r0, 0
- beq _08018846
- cmp r0, 0x1
- beq _0801885E
- b _08018876
-_08018846:
- movs r0, 0x20
- str r0, [sp]
- str r0, [sp, 0x4]
- movs r0, 0x11
- str r0, [sp, 0x8]
- movs r0, 0
- movs r1, 0
- movs r2, 0
- movs r3, 0
- bl FillBgTilemapBufferRect
- b _08018876
-_0801885E:
- movs r0, 0x20
- str r0, [sp]
- movs r0, 0x1E
- str r0, [sp, 0x4]
- movs r0, 0x11
- str r0, [sp, 0x8]
- movs r0, 0
- movs r1, 0
- movs r2, 0
- movs r3, 0x2
- bl FillBgTilemapBufferRect
-_08018876:
- movs r0, 0
- bl CopyBgTilemapBufferToVram
- add sp, 0xC
- pop {r0}
- bx r0
- thumb_func_end sub_8018838
-
- thumb_func_start sub_8018884
-sub_8018884: @ 8018884
- push {r4,lr}
- sub sp, 0x14
- adds r1, r0, 0
- ldr r4, =gStringVar4
- adds r0, r4, 0
- bl StringExpandPlaceholders
- movs r0, 0x1
- movs r1, 0x11
- bl FillWindowPixelBuffer
- movs r1, 0
- str r1, [sp]
- str r1, [sp, 0x4]
- ldr r0, =gUnknown_082F0728
- str r0, [sp, 0x8]
- str r1, [sp, 0xC]
- str r4, [sp, 0x10]
- movs r0, 0x1
- movs r1, 0x1
- movs r2, 0
- movs r3, 0x1
- bl AddTextPrinterParameterized4
- movs r0, 0x1
- movs r1, 0x1
- movs r2, 0xF
- bl sub_8098858
- movs r0, 0x1
- bl PutWindowTilemap
- movs r0, 0x1
- movs r1, 0x3
- bl CopyWindowToVram
- add sp, 0x14
- pop {r4}
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_8018884
-
- thumb_func_start sub_80188DC
-sub_80188DC: @ 80188DC
- push {lr}
- movs r0, 0x1
- bl rbox_fill_rectangle
- movs r0, 0x1
- bl ClearWindowTilemap
- movs r0, 0x1
- movs r1, 0x1
- bl CopyWindowToVram
- pop {r0}
- bx r0
- thumb_func_end sub_80188DC
-
- thumb_func_start mevent_0814257C
-mevent_0814257C: @ 80188F8
- push {r4,lr}
- sub sp, 0xC
- adds r4, r0, 0
- adds r0, r1, 0
- ldrb r2, [r4]
- cmp r2, 0x1
- beq _08018920
- cmp r2, 0x1
- bgt _08018910
- cmp r2, 0
- beq _0801891A
- b _08018980
-_08018910:
- cmp r2, 0x2
- beq _08018954
- cmp r2, 0xFF
- beq _0801897C
- b _08018980
-_0801891A:
- bl sub_8018884
- b _08018944
-_08018920:
- movs r0, 0
- str r0, [sp]
- ldr r0, =gUnknown_02022C58
- str r0, [sp, 0x4]
- adds r0, 0x1
- str r0, [sp, 0x8]
- movs r0, 0x1
- movs r1, 0xD0
- movs r2, 0x14
- movs r3, 0x1
- bl DrawDownArrow
- ldr r0, =gMain
- ldrh r1, [r0, 0x2E]
- movs r0, 0x3
- ands r0, r1
- cmp r0, 0
- beq _08018980
-_08018944:
- ldrb r0, [r4]
- adds r0, 0x1
- b _0801897E
- .pool
-_08018954:
- movs r0, 0x1
- str r0, [sp]
- ldr r0, =gUnknown_02022C58
- str r0, [sp, 0x4]
- adds r0, 0x1
- str r0, [sp, 0x8]
- movs r0, 0x1
- movs r1, 0xD0
- movs r2, 0x14
- movs r3, 0x1
- bl DrawDownArrow
- movs r0, 0
- strb r0, [r4]
- bl sub_80188DC
- movs r0, 0x1
- b _08018982
- .pool
-_0801897C:
- movs r0, 0x2
-_0801897E:
- strb r0, [r4]
-_08018980:
- movs r0, 0
-_08018982:
- add sp, 0xC
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end mevent_0814257C
-
- thumb_func_start sub_801898C
-sub_801898C: @ 801898C
- push {lr}
- sub sp, 0xC
- movs r0, 0
- str r0, [sp]
- ldr r0, =gUnknown_02022C58
- str r0, [sp, 0x4]
- adds r0, 0x1
- str r0, [sp, 0x8]
- movs r0, 0x1
- movs r1, 0xD0
- movs r2, 0x14
- movs r3, 0x1
- bl DrawDownArrow
- add sp, 0xC
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_801898C
-
- thumb_func_start sub_80189B4
-sub_80189B4: @ 80189B4
- push {lr}
- sub sp, 0xC
- movs r0, 0x1
- str r0, [sp]
- ldr r0, =gUnknown_02022C58
- str r0, [sp, 0x4]
- adds r0, 0x1
- str r0, [sp, 0x8]
- movs r0, 0x1
- movs r1, 0xD0
- movs r2, 0x14
- movs r3, 0x1
- bl DrawDownArrow
- add sp, 0xC
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_80189B4
-
- thumb_func_start sub_80189DC
-sub_80189DC: @ 80189DC
- push {r4,lr}
- adds r4, r0, 0
- ldrb r0, [r4]
- cmp r0, 0
- beq _080189EC
- cmp r0, 0x1
- beq _08018A08
- b _08018A14
-_080189EC:
- bl sub_801898C
- ldr r0, =gMain
- ldrh r1, [r0, 0x2E]
- movs r0, 0x3
- ands r0, r1
- cmp r0, 0
- beq _08018A14
- ldrb r0, [r4]
- adds r0, 0x1
- strb r0, [r4]
- b _08018A14
- .pool
-_08018A08:
- bl sub_80189B4
- movs r0, 0
- strb r0, [r4]
- movs r0, 0x1
- b _08018A16
-_08018A14:
- movs r0, 0
-_08018A16:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end sub_80189DC
-
- thumb_func_start sub_8018A1C
-sub_8018A1C: @ 8018A1C
- push {r4,lr}
- adds r4, r0, 0
- ldrb r0, [r4]
- cmp r0, 0
- bne _08018A2C
- adds r0, r1, 0
- bl sub_8018884
-_08018A2C:
- ldrb r0, [r4]
- adds r0, 0x1
- strb r0, [r4]
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0x78
- bhi _08018A3E
- movs r0, 0
- b _08018A48
-_08018A3E:
- movs r0, 0
- strb r0, [r4]
- bl sub_80188DC
- movs r0, 0x1
-_08018A48:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end sub_8018A1C
-
- thumb_func_start sub_8018A50
-sub_8018A50: @ 8018A50
- push {r4,r5,lr}
- sub sp, 0x24
- lsls r2, 24
- add r1, sp, 0x4
- ldr r0, =gUnknown_082F0638
- ldm r0!, {r3-r5}
- stm r1!, {r3-r5}
- ldm r0!, {r3-r5}
- stm r1!, {r3-r5}
- ldr r0, =gUnknown_082F05E0
- ldr r1, [r0, 0x4]
- ldr r0, [r0]
- str r0, [sp, 0x1C]
- str r1, [sp, 0x20]
- cmp r2, 0
- bne _08018A80
- ldr r0, =gUnknown_082F0608
- b _08018A82
- .pool
-_08018A80:
- ldr r0, =gUnknown_082F0620
-_08018A82:
- str r0, [sp, 0x4]
- add r0, sp, 0x4
- bl sub_81DB41C
- adds r3, r0, 0
- movs r0, 0x1
- ands r0, r3
- cmp r0, 0
- beq _08018A96
- adds r3, 0x1
-_08018A96:
- lsls r1, r3, 24
- ldr r0, =0x00ffffff
- ldr r2, [sp, 0x1C]
- ands r2, r0
- orrs r2, r1
- str r2, [sp, 0x1C]
- cmp r3, 0x1D
- bgt _08018ACC
- movs r0, 0x1E
- subs r0, r3
- lsrs r1, r0, 31
- adds r0, r1
- asrs r0, 1
- lsls r0, 24
- lsrs r0, 16
- ldr r1, =0xffff00ff
- ands r1, r2
- orrs r1, r0
- str r1, [sp, 0x1C]
- b _08018AD2
- .pool
-_08018ACC:
- ldr r0, =0xffff00ff
- ands r2, r0
- str r2, [sp, 0x1C]
-_08018AD2:
- add r0, sp, 0x1C
- movs r1, 0xE0
- str r1, [sp]
- add r1, sp, 0x4
- movs r2, 0x1
- movs r3, 0xA
- bl DoMysteryGiftListMenu
- adds r4, r0, 0
- movs r0, 0x1
- negs r0, r0
- cmp r4, r0
- beq _08018AFA
- movs r0, 0x2
- bl ClearWindowTilemap
- movs r0, 0x2
- movs r1, 0x1
- bl CopyWindowToVram
-_08018AFA:
- adds r0, r4, 0
- add sp, 0x24
- pop {r4,r5}
- pop {r1}
- bx r1
- .pool
- thumb_func_end sub_8018A50
-
- thumb_func_start sub_8018B08
-sub_8018B08: @ 8018B08
- push {r4-r6,lr}
- sub sp, 0x1C
- adds r5, r0, 0
- adds r4, r1, 0
- adds r1, r3, 0
- lsls r2, 24
- lsrs r6, r2, 24
- ldrb r0, [r5]
- cmp r0, 0x1
- beq _08018B98
- cmp r0, 0x1
- bgt _08018B26
- cmp r0, 0
- beq _08018B30
- b _08018C3E
-_08018B26:
- cmp r0, 0x2
- beq _08018BE4
- cmp r0, 0xFF
- beq _08018C1A
- b _08018C3E
-_08018B30:
- ldr r0, =gStringVar4
- bl StringExpandPlaceholders
- cmp r6, 0
- bne _08018B48
- ldr r0, =gUnknown_082F05C8
- b _08018B4A
- .pool
-_08018B48:
- ldr r0, =gUnknown_082F05D0
-_08018B4A:
- bl AddWindow
- strh r0, [r4]
- ldrb r0, [r4]
- movs r1, 0x11
- bl FillWindowPixelBuffer
- ldrb r0, [r4]
- movs r2, 0
- str r2, [sp]
- str r2, [sp, 0x4]
- ldr r1, =gUnknown_082F0728
- str r1, [sp, 0x8]
- str r2, [sp, 0xC]
- ldr r1, =gStringVar4
- str r1, [sp, 0x10]
- movs r1, 0x1
- movs r3, 0x1
- bl AddTextPrinterParameterized4
- ldrb r0, [r4]
- movs r1, 0x1
- movs r2, 0xF
- bl sub_8098858
- ldrb r0, [r4]
- movs r1, 0x2
- bl CopyWindowToVram
- ldrb r0, [r4]
- bl PutWindowTilemap
- b _08018BD6
- .pool
-_08018B98:
- ldr r0, =gUnknown_082F05E8
- ldr r1, [r0, 0x4]
- ldr r0, [r0]
- str r0, [sp, 0x14]
- str r1, [sp, 0x18]
- cmp r6, 0
- bne _08018BBC
- ldr r0, =0xff00ffff
- ldr r1, [sp, 0x14]
- ands r1, r0
- movs r0, 0x90
- lsls r0, 12
- b _08018BC6
- .pool
-_08018BBC:
- ldr r0, =0xff00ffff
- ldr r1, [sp, 0x14]
- ands r1, r0
- movs r0, 0xF0
- lsls r0, 12
-_08018BC6:
- orrs r1, r0
- str r1, [sp, 0x14]
- add r0, sp, 0x14
- movs r1, 0xA
- movs r2, 0xE
- movs r3, 0
- bl CreateYesNoMenu
-_08018BD6:
- ldrb r0, [r5]
- adds r0, 0x1
- strb r0, [r5]
- b _08018C3E
- .pool
-_08018BE4:
- bl Menu_ProcessInputNoWrapClearOnChoose
- lsls r0, 24
- asrs r6, r0, 24
- movs r1, 0x80
- lsls r1, 17
- adds r0, r1
- lsrs r0, 24
- cmp r0, 0x2
- bhi _08018C3E
- movs r0, 0
- strb r0, [r5]
- ldrb r0, [r4]
- bl rbox_fill_rectangle
- ldrb r0, [r4]
- bl ClearWindowTilemap
- ldrb r0, [r4]
- movs r1, 0x1
- bl CopyWindowToVram
- ldrb r0, [r4]
- bl RemoveWindow
- adds r0, r6, 0
- b _08018C42
-_08018C1A:
- movs r0, 0
- strb r0, [r5]
- ldrb r0, [r4]
- bl rbox_fill_rectangle
- ldrb r0, [r4]
- bl ClearWindowTilemap
- ldrb r0, [r4]
- movs r1, 0x1
- bl CopyWindowToVram
- ldrb r0, [r4]
- bl RemoveWindow
- movs r0, 0x1
- negs r0, r0
- b _08018C42
-_08018C3E:
- movs r0, 0x2
- negs r0, r0
-_08018C42:
- add sp, 0x1C
- pop {r4-r6}
- pop {r1}
- bx r1
- thumb_func_end sub_8018B08
-
- thumb_func_start sub_8018C4C
-sub_8018C4C: @ 8018C4C
- push {r4-r6,lr}
- sub sp, 0x14
- adds r6, r0, 0
- adds r5, r1, 0
- ldrb r0, [r6]
- cmp r0, 0x1
- beq _08018CE8
- cmp r0, 0x1
- bgt _08018C64
- cmp r0, 0
- beq _08018C6C
- b _08018D8C
-_08018C64:
- cmp r0, 0xFF
- bne _08018C6A
- b _08018D68
-_08018C6A:
- b _08018D8C
-_08018C6C:
- cmp r2, 0
- bne _08018C84
- ldr r0, =gStringVar4
- ldr r1, =gText_WhatToDoWithCards
- bl StringExpandPlaceholders
- b _08018C8C
- .pool
-_08018C84:
- ldr r0, =gStringVar4
- ldr r1, =gText_WhatToDoWithNews
- bl StringExpandPlaceholders
-_08018C8C:
- ldr r0, =gUnknown_082F05D8
- bl AddWindow
- strh r0, [r5]
- lsls r0, 24
- lsrs r0, 24
- movs r1, 0x11
- bl FillWindowPixelBuffer
- ldrb r0, [r5]
- movs r2, 0
- str r2, [sp]
- str r2, [sp, 0x4]
- ldr r1, =gUnknown_082F0728
- str r1, [sp, 0x8]
- str r2, [sp, 0xC]
- ldr r1, =gStringVar4
- str r1, [sp, 0x10]
- movs r1, 0x1
- movs r3, 0x1
- bl AddTextPrinterParameterized4
- ldrb r0, [r5]
- movs r1, 0x1
- movs r2, 0xF
- bl sub_8098858
- ldrb r0, [r5]
- movs r1, 0x2
- bl CopyWindowToVram
- ldrb r0, [r5]
- bl PutWindowTilemap
- ldrb r0, [r6]
- adds r0, 0x1
- strb r0, [r6]
- b _08018D8C
- .pool
-_08018CE8:
- cmp r3, 0
- beq _08018D10
- cmp r2, 0
- bne _08018D00
- ldr r0, =gUnknown_082F05F8
- ldr r1, =gUnknown_082F06C8
- b _08018D28
- .pool
-_08018D00:
- ldr r0, =gUnknown_082F0600
- ldr r1, =gUnknown_082F06F8
- b _08018D28
- .pool
-_08018D10:
- cmp r2, 0
- bne _08018D24
- ldr r0, =gUnknown_082F05F0
- ldr r1, =gUnknown_082F06B0
- b _08018D28
- .pool
-_08018D24:
- ldr r0, =gUnknown_082F05F8
- ldr r1, =gUnknown_082F06E0
-_08018D28:
- movs r2, 0xE0
- str r2, [sp]
- movs r2, 0x1
- movs r3, 0xA
- bl DoMysteryGiftListMenu
- adds r4, r0, 0
- movs r0, 0x1
- negs r0, r0
- cmp r4, r0
- beq _08018D8C
- movs r0, 0
- strb r0, [r6]
- ldrb r0, [r5]
- bl rbox_fill_rectangle
- ldrb r0, [r5]
- bl ClearWindowTilemap
- ldrb r0, [r5]
- movs r1, 0x1
- bl CopyWindowToVram
- ldrb r0, [r5]
- bl RemoveWindow
- adds r0, r4, 0
- b _08018D90
- .pool
-_08018D68:
- movs r0, 0
- strb r0, [r6]
- ldrb r0, [r5]
- bl rbox_fill_rectangle
- ldrb r0, [r5]
- bl ClearWindowTilemap
- ldrb r0, [r5]
- movs r1, 0x1
- bl CopyWindowToVram
- ldrb r0, [r5]
- bl RemoveWindow
- movs r0, 0x2
- negs r0, r0
- b _08018D90
-_08018D8C:
- movs r0, 0x1
- negs r0, r0
-_08018D90:
- add sp, 0x14
- pop {r4-r6}
- pop {r1}
- bx r1
- thumb_func_end sub_8018C4C
-
- thumb_func_start sub_8018D98
-sub_8018D98: @ 8018D98
- push {lr}
- cmp r0, 0
- beq _08018DA4
- bl sub_801B0CC
- b _08018DA8
-_08018DA4:
- bl sub_801B27C
-_08018DA8:
- pop {r1}
- bx r1
- thumb_func_end sub_8018D98
-
- thumb_func_start sub_8018DAC
-sub_8018DAC: @ 8018DAC
- push {r4,r5,lr}
- adds r5, r0, 0
- ldrb r0, [r5]
- cmp r0, 0
- beq _08018DBC
- cmp r0, 0x1
- beq _08018DE4
- b _08018E00
-_08018DBC:
- cmp r1, 0
- bne _08018DD4
- bl sav1_get_mevent_buffer_1
- adds r4, r0, 0
- bl sav1_get_mevent_buffer_2
- adds r1, r0, 0
- adds r0, r4, 0
- bl sub_801BAAC
- b _08018DDC
-_08018DD4:
- bl sub_801B00C
- bl sub_801C6C8
-_08018DDC:
- ldrb r0, [r5]
- adds r0, 0x1
- strb r0, [r5]
- b _08018E00
-_08018DE4:
- cmp r1, 0
- bne _08018DF2
- bl sub_801BB74
-_08018DEC:
- cmp r0, 0
- bne _08018DF8
- b _08018E00
-_08018DF2:
- bl sub_801C758
- b _08018DEC
-_08018DF8:
- movs r0, 0
- strb r0, [r5]
- movs r0, 0x1
- b _08018E02
-_08018E00:
- movs r0, 0
-_08018E02:
- pop {r4,r5}
- pop {r1}
- bx r1
- thumb_func_end sub_8018DAC
-
- thumb_func_start sub_8018E08
-sub_8018E08: @ 8018E08
- push {lr}
- cmp r0, 0
- bne _08018E14
- bl sub_801B1E8
- b _08018E18
-_08018E14:
- bl sub_801B06C
-_08018E18:
- movs r0, 0x1
- pop {r1}
- bx r1
- thumb_func_end sub_8018E08
-
- thumb_func_start sub_8018E20
-sub_8018E20: @ 8018E20
- push {lr}
- cmp r0, 0
- bne _08018E36
- adds r0, r1, 0
- bl sub_801BDA4
- cmp r0, 0
- beq _08018E40
- bl sub_801BB48
- b _08018E48
-_08018E36:
- adds r0, r1, 0
- bl sub_801CA50
- cmp r0, 0
- bne _08018E44
-_08018E40:
- movs r0, 0
- b _08018E4A
-_08018E44:
- bl sub_801C72C
-_08018E48:
- movs r0, 0x1
-_08018E4A:
- pop {r1}
- bx r1
- thumb_func_end sub_8018E20
-
- thumb_func_start sub_8018E50
-sub_8018E50: @ 8018E50
- push {lr}
- cmp r2, 0
- beq _08018E60
- ldr r3, =gText_OkayToDiscardNews
- b _08018E62
- .pool
-_08018E60:
- ldr r3, =gText_IfThrowAwayCardEventWontHappen
-_08018E62:
- movs r2, 0x1
- bl sub_8018B08
- lsls r0, 24
- asrs r0, 24
- pop {r1}
- bx r1
- .pool
- thumb_func_end sub_8018E50
-
- thumb_func_start mevent_message_was_thrown_away
-mevent_message_was_thrown_away: @ 8018E74
- push {lr}
- cmp r1, 0
- beq _08018E84
- ldr r1, =gText_WonderNewsThrownAway
- b _08018E86
- .pool
-_08018E84:
- ldr r1, =gText_WonderCardThrownAway
-_08018E86:
- bl mevent_0814257C
- pop {r1}
- bx r1
- .pool
- thumb_func_end mevent_message_was_thrown_away
-
- thumb_func_start mevent_save_game
-mevent_save_game: @ 8018E94
- push {r4,lr}
- adds r4, r0, 0
- ldrb r0, [r4]
- cmp r0, 0x4
- bhi _08018F04
- lsls r0, 2
- ldr r1, =_08018EAC
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .pool
- .align 2, 0
-_08018EAC:
- .4byte _08018EC0
- .4byte _08018ECC
- .4byte _08018ED4
- .4byte _08018EE0
- .4byte _08018EF8
-_08018EC0:
- ldr r0, =gText_DataWillBeSaved
- bl sub_8018884
- b _08018EEC
- .pool
-_08018ECC:
- movs r0, 0
- bl TrySavingData
- b _08018EEC
-_08018ED4:
- ldr r0, =gText_SaveCompletedPressA
- bl sub_8018884
- b _08018EEC
- .pool
-_08018EE0:
- ldr r0, =gMain
- ldrh r1, [r0, 0x2E]
- movs r0, 0x3
- ands r0, r1
- cmp r0, 0
- beq _08018F04
-_08018EEC:
- ldrb r0, [r4]
- adds r0, 0x1
- strb r0, [r4]
- b _08018F04
- .pool
-_08018EF8:
- movs r0, 0
- strb r0, [r4]
- bl sub_80188DC
- movs r0, 0x1
- b _08018F06
-_08018F04:
- movs r0, 0
-_08018F06:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end mevent_save_game
-
- thumb_func_start mevent_message
-mevent_message: @ 8018F0C
- push {r4-r6,lr}
- adds r4, r0, 0
- lsls r1, 24
- lsrs r6, r1, 24
- lsls r2, 24
- lsrs r5, r2, 24
- movs r2, 0
- str r2, [r4]
- cmp r3, 0xE
- bls _08018F22
- b _08019034
-_08018F22:
- lsls r0, r3, 2
- ldr r1, =_08018F30
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .pool
- .align 2, 0
-_08018F30:
- .4byte _08018F6C
- .4byte _08018F78
- .4byte _08018F84
- .4byte _08018F9C
- .4byte _08018FB4
- .4byte _08018FC0
- .4byte _08018FCC
- .4byte _08018FD8
- .4byte _08018FE4
- .4byte _08018FF0
- .4byte _08018FFC
- .4byte _08019014
- .4byte _08019020
- .4byte _0801902C
- .4byte _08019030
-_08018F6C:
- movs r0, 0
- str r0, [r4]
- ldr r2, =gText_NothingSentOver
- b _08019034
- .pool
-_08018F78:
- movs r0, 0
- str r0, [r4]
- ldr r2, =gText_RecordUploadedViaWireless
- b _08019034
- .pool
-_08018F84:
- movs r0, 0x1
- str r0, [r4]
- ldr r2, =gText_WonderCardReceivedFrom
- cmp r5, 0
- bne _08019034
- ldr r2, =gText_WonderCardReceived
- b _08019034
- .pool
-_08018F9C:
- movs r0, 0x1
- str r0, [r4]
- ldr r2, =gText_WonderNewsReceivedFrom
- cmp r5, 0
- bne _08019034
- ldr r2, =gText_WonderNewsReceived
- b _08019034
- .pool
-_08018FB4:
- movs r0, 0x1
- str r0, [r4]
- ldr r2, =gText_NewStampReceived
- b _08019034
- .pool
-_08018FC0:
- movs r0, 0
- str r0, [r4]
- ldr r2, =gText_AlreadyHadCard
- b _08019034
- .pool
-_08018FCC:
- movs r0, 0
- str r0, [r4]
- ldr r2, =gText_AlreadyHadStamp
- b _08019034
- .pool
-_08018FD8:
- movs r0, 0
- str r0, [r4]
- ldr r2, =gText_AlreadyHadNews
- b _08019034
- .pool
-_08018FE4:
- movs r0, 0
- str r0, [r4]
- ldr r2, =gText_NoMoreRoomForStamps
- b _08019034
- .pool
-_08018FF0:
- movs r0, 0
- str r0, [r4]
- ldr r2, =gText_CommunicationCanceled
- b _08019034
- .pool
-_08018FFC:
- movs r0, 0
- str r0, [r4]
- ldr r2, =gText_CantAcceptNewsFromTrainer
- cmp r6, 0
- bne _08019034
- ldr r2, =gText_CantAcceptCardFromTrainer
- b _08019034
- .pool
-_08019014:
- movs r0, 0
- str r0, [r4]
- ldr r2, =gText_CommunicationError
- b _08019034
- .pool
-_08019020:
- movs r0, 0x1
- str r0, [r4]
- ldr r2, =gText_NewTrainerReceived
- b _08019034
- .pool
-_0801902C:
- movs r0, 0x1
- b _08019032
-_08019030:
- movs r0, 0
-_08019032:
- str r0, [r4]
-_08019034:
- adds r0, r2, 0
- pop {r4-r6}
- pop {r1}
- bx r1
- thumb_func_end mevent_message
-
- thumb_func_start mevent_08142CE8
-mevent_08142CE8: @ 801903C
- push {r4-r6,lr}
- adds r6, r0, 0
- adds r0, r1, 0
- adds r5, r2, 0
- ldrb r4, [r6]
- cmp r4, 0x1
- beq _0801906E
- cmp r4, 0x1
- bgt _08019054
- cmp r4, 0
- beq _0801905A
- b _0801909A
-_08019054:
- cmp r4, 0x2
- beq _08019084
- b _0801909A
-_0801905A:
- cmp r0, 0
- beq _08019062
- bl sub_8018884
-_08019062:
- movs r0, 0xB9
- lsls r0, 1
- bl PlayFanfare
- strh r4, [r5]
- b _0801907C
-_0801906E:
- ldrh r0, [r5]
- adds r0, 0x1
- strh r0, [r5]
- lsls r0, 16
- lsrs r0, 16
- cmp r0, 0xF0
- bls _0801909A
-_0801907C:
- ldrb r0, [r6]
- adds r0, 0x1
- strb r0, [r6]
- b _0801909A
-_08019084:
- bl IsFanfareTaskInactive
- lsls r0, 24
- cmp r0, 0
- beq _0801909A
- movs r0, 0
- strb r0, [r6]
- bl sub_80188DC
- movs r0, 0x1
- b _0801909C
-_0801909A:
- movs r0, 0
-_0801909C:
- pop {r4-r6}
- pop {r1}
- bx r1
- thumb_func_end mevent_08142CE8
-
- thumb_func_start mevent_message_stamp_card_etc_send_status
-mevent_message_stamp_card_etc_send_status: @ 80190A4
- push {r4,lr}
- adds r3, r0, 0
- ldr r1, =gText_CommunicationError
- movs r0, 0
- str r0, [r3]
- adds r4, r1, 0
- cmp r2, 0xE
- bhi _08019166
- lsls r0, r2, 2
- ldr r1, =_080190C8
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .pool
- .align 2, 0
-_080190C8:
- .4byte _08019104
- .4byte _0801910C
- .4byte _08019114
- .4byte _0801911C
- .4byte _08019128
- .4byte _08019130
- .4byte _08019138
- .4byte _08019140
- .4byte _08019148
- .4byte _08019150
- .4byte _08019164
- .4byte _08019158
- .4byte _0801915C
- .4byte _0801915C
- .4byte _08019164
-_08019104:
- ldr r1, =gText_NothingSentOver
- b _08019166
- .pool
-_0801910C:
- ldr r1, =gText_RecordUploadedViaWireless
- b _08019166
- .pool
-_08019114:
- ldr r1, =gText_WonderCardSentTo
- b _0801911E
- .pool
-_0801911C:
- ldr r1, =gText_WonderNewsSentTo
-_0801911E:
- movs r0, 0x1
- str r0, [r3]
- b _08019166
- .pool
-_08019128:
- ldr r1, =gText_StampSentTo
- b _08019166
- .pool
-_08019130:
- ldr r1, =gText_OtherTrainerHasCard
- b _08019166
- .pool
-_08019138:
- ldr r1, =gText_OtherTrainerHasStamp
- b _08019166
- .pool
-_08019140:
- ldr r1, =gText_OtherTrainerHasNews
- b _08019166
- .pool
-_08019148:
- ldr r1, =gText_NoMoreRoomForStamps
- b _08019166
- .pool
-_08019150:
- ldr r1, =gText_OtherTrainerCanceled
- b _08019166
- .pool
-_08019158:
- adds r1, r4, 0
- b _08019166
-_0801915C:
- ldr r1, =gText_GiftSentTo
- b _08019166
- .pool
-_08019164:
- ldr r1, =gText_CantSendGiftToTrainer
-_08019166:
- adds r0, r1, 0
- pop {r4}
- pop {r1}
- bx r1
- .pool
- thumb_func_end mevent_message_stamp_card_etc_send_status
-
- thumb_func_start sub_8019174
-sub_8019174: @ 8019174
- push {r4,r5,lr}
- sub sp, 0x4
- adds r4, r0, 0
- adds r5, r1, 0
- adds r1, r2, 0
- adds r2, r3, 0
- lsls r1, 24
- lsrs r1, 24
- mov r0, sp
- bl mevent_message_stamp_card_etc_send_status
- adds r1, r0, 0
- ldr r0, [sp]
- cmp r0, 0
- bne _0801919A
- adds r0, r4, 0
- bl mevent_0814257C
- b _080191A2
-_0801919A:
- adds r0, r4, 0
- adds r2, r5, 0
- bl mevent_08142CE8
-_080191A2:
- add sp, 0x4
- pop {r4,r5}
- pop {r1}
- bx r1
- thumb_func_end sub_8019174
-
- thumb_func_start task_add_00_mystery_gift
-task_add_00_mystery_gift: @ 80191AC
- push {r4,lr}
- ldr r0, =task00_mystery_gift
- movs r1, 0
- bl CreateTask
- lsls r0, 24
- lsrs r0, 24
- lsls r4, r0, 2
- adds r4, r0
- lsls r4, 3
- ldr r0, =gTasks + 0x8
- adds r4, r0
- movs r0, 0
- strb r0, [r4, 0x8]
- strb r0, [r4, 0x9]
- strb r0, [r4, 0xA]
- strb r0, [r4, 0xB]
- strb r0, [r4, 0xC]
- strb r0, [r4, 0xD]
- movs r1, 0
- strh r0, [r4]
- strh r0, [r4, 0x2]
- strh r0, [r4, 0x4]
- strh r0, [r4, 0x6]
- strb r1, [r4, 0xE]
- movs r0, 0x40
- bl AllocZeroed
- str r0, [r4, 0x10]
- pop {r4}
- pop {r0}
- bx r0
- .pool
- thumb_func_end task_add_00_mystery_gift
-
- thumb_func_start task00_mystery_gift
-task00_mystery_gift: @ 80191F4
- push {r4,r5,lr}
- sub sp, 0x4
- lsls r0, 24
- lsrs r4, r0, 24
- lsls r0, r4, 2
- adds r0, r4
- lsls r0, 3
- ldr r1, =gTasks + 0x8
- adds r5, r0, r1
- ldrb r0, [r5, 0x8]
- cmp r0, 0x25
- bls _0801920E
- b _08019922
-_0801920E:
- lsls r0, 2
- ldr r1, =_08019220
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .pool
- .align 2, 0
-_08019220:
- .4byte _080192B8
- .4byte _080192BE
- .4byte _08019300
- .4byte _08019338
- .4byte _0801935C
- .4byte _080193AC
- .4byte _0801940C
- .4byte _08019444
- .4byte _08019454
- .4byte _080194CC
- .4byte _080194F0
- .4byte _08019508
- .4byte _08019538
- .4byte _08019574
- .4byte _0801958C
- .4byte _080195BC
- .4byte _080198EC
- .4byte _0801961A
- .4byte _0801962A
- .4byte _08019922
- .4byte _0801963C
- .4byte _08019688
- .4byte _080196FE
- .4byte _0801972E
- .4byte _08019764
- .4byte _0801977E
- .4byte _08019792
- .4byte _0801979E
- .4byte _080197B2
- .4byte _080197C6
- .4byte _080197F8
- .4byte _0801982C
- .4byte _08019870
- .4byte _08019884
- .4byte _080198A0
- .4byte _080198B8
- .4byte _080198EC
- .4byte _0801990C
-_080192B8:
- movs r0, 0x1
- strb r0, [r5, 0x8]
- b _08019922
-_080192BE:
- adds r0, r5, 0
- adds r0, 0x9
- adds r1, r5, 0
- movs r2, 0
- bl sub_8018A50
- adds r1, r0, 0
- cmp r1, 0x1
- beq _080192E8
- cmp r1, 0x1
- bcc _080192DE
- movs r0, 0x2
- negs r0, r0
- cmp r1, r0
- beq _080192FA
- b _08019922
-_080192DE:
- movs r0, 0
- strb r0, [r5, 0xC]
- bl sub_801B27C
- b _080192EE
-_080192E8:
- strb r1, [r5, 0xC]
- bl sub_801B0CC
-_080192EE:
- cmp r0, 0x1
- bne _080192F4
- b _08019820
-_080192F4:
- movs r0, 0x2
- strb r0, [r5, 0x8]
- b _08019922
-_080192FA:
- movs r0, 0x25
- strb r0, [r5, 0x8]
- b _08019922
-_08019300:
- ldrb r0, [r5, 0xC]
- cmp r0, 0
- bne _08019314
- adds r0, r5, 0
- adds r0, 0x9
- ldr r1, =gText_DontHaveCardNewOneInput
- b _0801931A
- .pool
-_08019314:
- adds r0, r5, 0
- adds r0, 0x9
- ldr r1, =gText_DontHaveNewsNewOneInput
-_0801931A:
- bl mevent_0814257C
- cmp r0, 0
- bne _08019324
- b _08019922
-_08019324:
- movs r0, 0x3
- strb r0, [r5, 0x8]
- movs r0, 0
- movs r1, 0x1
- bl sub_80186EC
- b _08019922
- .pool
-_08019338:
- ldrb r0, [r5, 0xC]
- cmp r0, 0
- bne _0801934C
- ldr r0, =gText_WhereShouldCardBeAccessed
- bl sub_8018884
- b _08019352
- .pool
-_0801934C:
- ldr r0, =gText_WhereShouldNewsBeAccessed
- bl sub_8018884
-_08019352:
- movs r0, 0x4
- strb r0, [r5, 0x8]
- b _08019922
- .pool
-_0801935C:
- adds r0, r5, 0
- adds r0, 0x9
- adds r1, r5, 0
- movs r2, 0x1
- bl sub_8018A50
- adds r4, r0, 0
- cmp r4, 0x1
- beq _0801938A
- cmp r4, 0x1
- bcc _0801937C
- movs r0, 0x2
- negs r0, r0
- cmp r4, r0
- beq _08019396
- b _08019922
-_0801937C:
- bl sub_80188DC
- movs r1, 0
- movs r0, 0x5
- strb r0, [r5, 0x8]
- strb r1, [r5, 0xD]
- b _08019922
-_0801938A:
- bl sub_80188DC
- movs r0, 0x5
- strb r0, [r5, 0x8]
- strb r4, [r5, 0xD]
- b _08019922
-_08019396:
- bl sub_80188DC
- ldrb r0, [r5, 0xC]
- bl sub_8018D98
- cmp r0, 0
- beq _080193A6
- b _08019820
-_080193A6:
- strb r0, [r5, 0x8]
- movs r0, 0
- b _080198FE
-_080193AC:
- ldr r0, =gStringVar1
- movs r1, 0xFF
- strb r1, [r0]
- ldr r0, =gStringVar2
- strb r1, [r0]
- ldr r0, =gStringVar3
- strb r1, [r0]
- ldrb r0, [r5, 0xC]
- cmp r0, 0
- beq _080193D4
- cmp r0, 0x1
- beq _080193EE
- b _08019406
- .pool
-_080193D4:
- ldrb r0, [r5, 0xD]
- cmp r0, 0x1
- bne _080193E2
- movs r0, 0x15
- bl sub_8014EFC
- b _08019406
-_080193E2:
- cmp r0, 0
- bne _08019406
- movs r0, 0x15
- bl sub_80152A8
- b _08019406
-_080193EE:
- ldrb r0, [r5, 0xD]
- cmp r0, 0x1
- bne _080193FC
- movs r0, 0x16
- bl sub_8014EFC
- b _08019406
-_080193FC:
- cmp r0, 0
- bne _08019406
- movs r0, 0x16
- bl sub_80152A8
-_08019406:
- movs r0, 0x6
- strb r0, [r5, 0x8]
- b _08019922
-_0801940C:
- ldr r0, =gReceivedRemoteLinkPlayers
- ldrb r0, [r0]
- cmp r0, 0
- beq _0801942C
- movs r0, 0x1
- bl sub_8018838
- movs r0, 0x7
- strb r0, [r5, 0x8]
- ldrb r0, [r5, 0xC]
- bl sub_801D484
- b _08019922
- .pool
-_0801942C:
- ldr r0, =gSpecialVar_Result
- ldrh r0, [r0]
- cmp r0, 0x5
- beq _08019436
- b _08019922
-_08019436:
- movs r0, 0x1
- bl sub_8018838
- b _080197C0
- .pool
-_08019444:
- ldr r0, =gText_Communicating
- bl sub_8018884
- movs r0, 0x8
- strb r0, [r5, 0x8]
- b _08019922
- .pool
-_08019454:
- adds r0, r5, 0
- bl sub_801D4A8
- subs r0, 0x2
- cmp r0, 0x4
- bls _08019462
- b _08019922
-_08019462:
- lsls r0, 2
- ldr r1, =_08019470
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .pool
- .align 2, 0
-_08019470:
- .4byte _080194AE
- .4byte _080194A8
- .4byte _080194B4
- .4byte _08019492
- .4byte _08019484
-_08019484:
- bl task_add_05_task_del_08FA224_when_no_RfuFunc
- ldrh r0, [r5]
- strb r0, [r5, 0xE]
- movs r0, 0xD
- strb r0, [r5, 0x8]
- b _08019922
-_08019492:
- ldr r4, [r5, 0x10]
- bl sub_801D4F4
- adds r1, r0, 0
- adds r0, r4, 0
- movs r2, 0x40
- bl memcpy
- bl sub_801D4E4
- b _08019922
-_080194A8:
- movs r0, 0xA
- strb r0, [r5, 0x8]
- b _08019922
-_080194AE:
- movs r0, 0x9
- strb r0, [r5, 0x8]
- b _08019922
-_080194B4:
- movs r0, 0xB
- strb r0, [r5, 0x8]
- ldr r0, =gStringVar1
- ldr r1, =gLinkPlayers + 8
- bl StringCopy
- b _08019922
- .pool
-_080194CC:
- adds r4, r5, 0
- adds r4, 0x9
- bl sub_801D4F4
- adds r3, r0, 0
- adds r0, r4, 0
- adds r1, r5, 0
- movs r2, 0
- bl sub_8018B08
- lsls r0, 24
- asrs r1, r0, 24
- cmp r1, 0x1
- beq _08019564
- cmp r1, 0x1
- bcs _08019552
- movs r0, 0
- b _08019566
-_080194F0:
- adds r4, r5, 0
- adds r4, 0x9
- bl sub_801D4F4
- adds r1, r0, 0
- adds r0, r4, 0
- bl mevent_0814257C
- cmp r0, 0
- bne _08019506
- b _08019922
-_08019506:
- b _0801956A
-_08019508:
- adds r0, r5, 0
- adds r0, 0x9
- ldr r3, =gText_ThrowAwayWonderCard
- adds r1, r5, 0
- movs r2, 0
- bl sub_8018B08
- lsls r0, 24
- asrs r1, r0, 24
- cmp r1, 0x1
- beq _08019564
- cmp r1, 0x1
- bcs _08019552
- bl sub_801B3F8
- cmp r0, 0x1
- bne _08019534
- movs r0, 0xC
- strb r0, [r5, 0x8]
- b _08019922
- .pool
-_08019534:
- movs r0, 0
- b _08019566
-_08019538:
- adds r0, r5, 0
- adds r0, 0x9
- ldr r3, =gText_HaventReceivedCardsGift
- adds r1, r5, 0
- movs r2, 0
- bl sub_8018B08
- lsls r0, 24
- asrs r1, r0, 24
- cmp r1, 0x1
- beq _08019564
- cmp r1, 0x1
- bcc _08019560
-_08019552:
- movs r0, 0x1
- negs r0, r0
- cmp r1, r0
- beq _08019564
- b _08019922
- .pool
-_08019560:
- movs r0, 0
- b _08019566
-_08019564:
- movs r0, 0x1
-_08019566:
- bl sub_801D500
-_0801956A:
- bl sub_801D4E4
- movs r0, 0x7
- strb r0, [r5, 0x8]
- b _08019922
-_08019574:
- ldr r0, =gReceivedRemoteLinkPlayers
- ldrb r0, [r0]
- cmp r0, 0
- beq _0801957E
- b _08019922
-_0801957E:
- bl sub_800E084
- movs r0, 0xE
- strb r0, [r5, 0x8]
- b _08019922
- .pool
-_0801958C:
- adds r0, r5, 0
- adds r0, 0x9
- ldr r1, =gText_CommunicationCompleted
- bl sub_8018A1C
- cmp r0, 0
- bne _0801959C
- b _08019922
-_0801959C:
- ldrb r0, [r5, 0xD]
- cmp r0, 0x1
- bne _080195AA
- ldr r0, =gStringVar1
- ldr r1, =gLinkPlayers + 8
- bl StringCopy
-_080195AA:
- movs r0, 0xF
- strb r0, [r5, 0x8]
- b _08019922
- .pool
-_080195BC:
- ldrb r1, [r5, 0xC]
- ldrb r2, [r5, 0xD]
- ldrb r3, [r5, 0xE]
- mov r0, sp
- bl mevent_message
- adds r1, r0, 0
- cmp r1, 0
- bne _080195D0
- ldr r1, [r5, 0x10]
-_080195D0:
- ldr r0, [sp]
- cmp r0, 0
- beq _080195E2
- adds r0, r5, 0
- adds r0, 0x9
- adds r2, r5, 0
- bl mevent_08142CE8
- b _080195EA
-_080195E2:
- adds r0, r5, 0
- adds r0, 0x9
- bl mevent_0814257C
-_080195EA:
- adds r1, r0, 0
- cmp r1, 0
- bne _080195F2
- b _08019922
-_080195F2:
- ldrb r0, [r5, 0xE]
- cmp r0, 0x3
- bne _0801960C
- ldrb r0, [r5, 0xD]
- cmp r0, 0x1
- bne _08019606
- movs r0, 0x1
- bl sub_801DB68
- b _0801960C
-_08019606:
- movs r0, 0x2
- bl sub_801DB68
-_0801960C:
- ldr r0, [sp]
- cmp r0, 0
- beq _08019614
- b _080198DC
-_08019614:
- strb r0, [r5, 0x8]
- movs r0, 0
- b _080198FE
-_0801961A:
- adds r0, r5, 0
- adds r0, 0x9
- bl mevent_save_game
- cmp r0, 0
- bne _08019628
- b _08019922
-_08019628:
- b _08019820
-_0801962A:
- adds r0, r5, 0
- adds r0, 0x9
- ldrb r1, [r5, 0xC]
- bl sub_8018DAC
- cmp r0, 0
- bne _0801963A
- b _08019922
-_0801963A:
- b _080196F8
-_0801963C:
- ldrb r0, [r5, 0xC]
- cmp r0, 0
- bne _08019664
- ldr r2, =gMain
- ldrh r1, [r2, 0x2E]
- movs r0, 0x1
- ands r0, r1
- cmp r0, 0
- beq _08019652
- movs r0, 0x15
- strb r0, [r5, 0x8]
-_08019652:
- ldrh r1, [r2, 0x2E]
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- bne _0801965E
- b _08019922
-_0801965E:
- b _08019682
- .pool
-_08019664:
- ldr r0, =gMain
- ldrh r0, [r0, 0x2E]
- bl sub_801CCD0
- cmp r0, 0
- beq _0801967C
- cmp r0, 0x1
- beq _08019682
- b _08019922
- .pool
-_0801967C:
- bl sub_801CC38
- b _0801975E
-_08019682:
- movs r0, 0x1B
- strb r0, [r5, 0x8]
- b _08019922
-_08019688:
- ldrb r0, [r5, 0xC]
- cmp r0, 0
- bne _080196A2
- bl sub_801B308
- cmp r0, 0
- beq _080196B6
- adds r0, r5, 0
- adds r0, 0x9
- ldrb r2, [r5, 0xC]
- adds r1, r5, 0
- movs r3, 0
- b _080196C0
-_080196A2:
- bl sub_801B128
- cmp r0, 0
- beq _080196B6
- adds r0, r5, 0
- adds r0, 0x9
- ldrb r2, [r5, 0xC]
- adds r1, r5, 0
- movs r3, 0
- b _080196C0
-_080196B6:
- adds r0, r5, 0
- adds r0, 0x9
- ldrb r2, [r5, 0xC]
- adds r1, r5, 0
- movs r3, 0x1
-_080196C0:
- bl sub_8018C4C
- adds r1, r0, 0
- cmp r1, 0x1
- beq _080196E2
- cmp r1, 0x1
- bcc _080196DC
- cmp r1, 0x2
- beq _080196E8
- movs r0, 0x2
- negs r0, r0
- cmp r1, r0
- beq _080196EE
- b _08019922
-_080196DC:
- movs r0, 0x1C
- strb r0, [r5, 0x8]
- b _08019922
-_080196E2:
- movs r0, 0x1D
- strb r0, [r5, 0x8]
- b _08019922
-_080196E8:
- movs r0, 0x16
- strb r0, [r5, 0x8]
- b _08019922
-_080196EE:
- ldrb r0, [r5, 0xC]
- cmp r0, 0x1
- bne _080196F8
- bl sub_801CC80
-_080196F8:
- movs r0, 0x14
- strb r0, [r5, 0x8]
- b _08019922
-_080196FE:
- adds r0, r5, 0
- adds r0, 0x9
- ldrb r2, [r5, 0xC]
- adds r1, r5, 0
- bl sub_8018E50
- adds r1, r0, 0
- cmp r1, 0
- beq _0801971A
- cmp r1, 0
- ble _08019748
- cmp r1, 0x1
- beq _0801975E
- b _08019922
-_0801971A:
- ldrb r0, [r5, 0xC]
- cmp r0, 0
- bne _08019758
- bl sub_801B3F8
- cmp r0, 0x1
- bne _08019758
- movs r0, 0x17
- strb r0, [r5, 0x8]
- b _08019922
-_0801972E:
- adds r0, r5, 0
- adds r0, 0x9
- ldr r3, =gText_HaventReceivedGiftOkayToDiscard
- adds r1, r5, 0
- movs r2, 0x1
- bl sub_8018B08
- lsls r0, 24
- asrs r1, r0, 24
- cmp r1, 0x1
- beq _0801975E
- cmp r1, 0x1
- bcc _08019758
-_08019748:
- movs r0, 0x1
- negs r0, r0
- cmp r1, r0
- beq _0801975E
- b _08019922
- .pool
-_08019758:
- movs r0, 0x18
- strb r0, [r5, 0x8]
- b _08019922
-_0801975E:
- movs r0, 0x15
- strb r0, [r5, 0x8]
- b _08019922
-_08019764:
- ldrb r0, [r5, 0xC]
- movs r1, 0x1
- bl sub_8018E20
- cmp r0, 0
- bne _08019772
- b _08019922
-_08019772:
- ldrb r0, [r5, 0xC]
- bl sub_8018E08
- movs r0, 0x19
- strb r0, [r5, 0x8]
- b _08019922
-_0801977E:
- adds r0, r5, 0
- adds r0, 0x9
- bl mevent_save_game
- cmp r0, 0
- bne _0801978C
- b _08019922
-_0801978C:
- movs r0, 0x1A
- strb r0, [r5, 0x8]
- b _08019922
-_08019792:
- adds r0, r5, 0
- adds r0, 0x9
- ldrb r1, [r5, 0xC]
- bl mevent_message_was_thrown_away
- b _080198F6
-_0801979E:
- ldrb r0, [r5, 0xC]
- movs r1, 0
- bl sub_8018E20
- cmp r0, 0
- bne _080197AC
- b _08019922
-_080197AC:
- movs r0, 0
- strb r0, [r5, 0x8]
- b _08019922
-_080197B2:
- ldrb r0, [r5, 0xC]
- movs r1, 0x1
- bl sub_8018E20
- cmp r0, 0
- bne _080197C0
- b _08019922
-_080197C0:
- movs r0, 0x3
- strb r0, [r5, 0x8]
- b _08019922
-_080197C6:
- ldrb r0, [r5, 0xC]
- movs r1, 0x1
- bl sub_8018E20
- cmp r0, 0
- bne _080197D4
- b _08019922
-_080197D4:
- ldrb r0, [r5, 0xC]
- cmp r0, 0
- beq _080197E0
- cmp r0, 0x1
- beq _080197E8
- b _080197EE
-_080197E0:
- movs r0, 0x15
- bl sub_8014A00
- b _080197EE
-_080197E8:
- movs r0, 0x16
- bl sub_8014A00
-_080197EE:
- movs r0, 0x1
- strb r0, [r5, 0xD]
- movs r0, 0x1E
- strb r0, [r5, 0x8]
- b _08019922
-_080197F8:
- ldr r0, =gReceivedRemoteLinkPlayers
- ldrb r0, [r0]
- cmp r0, 0
- beq _08019810
- movs r0, 0x1
- bl sub_8018838
- movs r0, 0x1F
- strb r0, [r5, 0x8]
- b _08019922
- .pool
-_08019810:
- ldr r0, =gSpecialVar_Result
- ldrh r0, [r0]
- cmp r0, 0x5
- beq _0801981A
- b _08019922
-_0801981A:
- movs r0, 0x1
- bl sub_8018838
-_08019820:
- movs r0, 0x12
- strb r0, [r5, 0x8]
- b _08019922
- .pool
-_0801982C:
- ldr r0, =gStringVar1
- movs r1, 0xFF
- strb r1, [r0]
- ldr r0, =gStringVar2
- strb r1, [r0]
- ldr r0, =gStringVar3
- strb r1, [r0]
- ldrb r0, [r5, 0xC]
- cmp r0, 0
- bne _0801985C
- ldr r0, =gText_SendingWonderCard
- bl sub_8018884
- bl mevent_srv_new_wcard
- b _08019866
- .pool
-_0801985C:
- ldr r0, =gText_SendingWonderNews
- bl sub_8018884
- bl mevent_srv_init_wnews
-_08019866:
- movs r0, 0x20
- strb r0, [r5, 0x8]
- b _08019922
- .pool
-_08019870:
- adds r0, r5, 0
- bl sub_801D0C4
- cmp r0, 0x3
- bne _08019922
- ldrh r0, [r5]
- strb r0, [r5, 0xE]
- movs r0, 0x21
- strb r0, [r5, 0x8]
- b _08019922
-_08019884:
- bl task_add_05_task_del_08FA224_when_no_RfuFunc
- ldr r0, =gStringVar1
- ldr r1, =gLinkPlayers + 0x1C + 0x08 @ &gLinkPlayers[1].name
- bl StringCopy
- movs r0, 0x22
- strb r0, [r5, 0x8]
- b _08019922
- .pool
-_080198A0:
- ldr r0, =gReceivedRemoteLinkPlayers
- ldrb r0, [r0]
- cmp r0, 0
- bne _08019922
- bl sub_800E084
- movs r0, 0x23
- strb r0, [r5, 0x8]
- b _08019922
- .pool
-_080198B8:
- adds r0, r5, 0
- adds r0, 0x9
- ldrb r2, [r5, 0xD]
- ldrb r3, [r5, 0xE]
- adds r1, r5, 0
- bl sub_8019174
- cmp r0, 0
- beq _08019922
- ldr r0, [r5, 0xC]
- ldr r1, =0x00ffff00
- ands r0, r1
- ldr r1, =0x00030100
- cmp r0, r1
- bne _080198FA
- movs r0, 0x3
- bl sub_801DB68
-_080198DC:
- movs r0, 0x11
- strb r0, [r5, 0x8]
- b _08019922
- .pool
-_080198EC:
- adds r0, r5, 0
- adds r0, 0x9
- ldr r1, =gText_CommunicationError
- bl mevent_0814257C
-_080198F6:
- cmp r0, 0
- beq _08019922
-_080198FA:
- movs r0, 0
- strb r0, [r5, 0x8]
-_080198FE:
- movs r1, 0
- bl sub_80186EC
- b _08019922
- .pool
-_0801990C:
- bl CloseLink
- ldr r0, [r5, 0x10]
- bl Free
- adds r0, r4, 0
- bl DestroyTask
- ldr r0, =sub_80186A4
- bl SetMainCallback2
-_08019922:
- add sp, 0x4
- pop {r4,r5}
- pop {r0}
- bx r0
- .pool
- thumb_func_end task00_mystery_gift
-
- thumb_func_start sub_8019930
-sub_8019930: @ 8019930
- ldr r0, =0x000001a9
- bx lr
- .pool
- thumb_func_end sub_8019930
-
- thumb_func_start bgid_upload_textbox_1
-bgid_upload_textbox_1: @ 8019938
- push {lr}
- sub sp, 0x4
- lsls r0, 24
- lsrs r0, 24
- ldr r1, =gUnkTextboxBorderGfx
- movs r2, 0x80
- lsls r2, 1
- movs r3, 0
- str r3, [sp]
- bl DecompressAndLoadBgGfxUsingHeap
- add sp, 0x4
- pop {r0}
- bx r0
- .pool
- thumb_func_end bgid_upload_textbox_1
-
- thumb_func_start is_walking_or_running
-is_walking_or_running: @ 8019958
- push {lr}
- ldr r0, =gPlayerAvatar
- ldrb r0, [r0, 0x3]
- cmp r0, 0x2
- beq _08019966
- cmp r0, 0
- bne _08019970
-_08019966:
- movs r0, 0x1
- b _08019972
- .pool
-_08019970:
- movs r0, 0
-_08019972:
- pop {r1}
- bx r1
- thumb_func_end is_walking_or_running
-
- thumb_func_start sub_8019978
-sub_8019978: @ 8019978
- ldr r3, =gUnknown_082F072C
- movs r2, 0x7
- ands r2, r1
- lsls r1, r0, 2
- adds r1, r0
- lsls r1, 1
- adds r2, r1
- adds r2, r3
- ldrb r0, [r2]
- bx lr
- .pool
- thumb_func_end sub_8019978
-
- thumb_func_start sub_8019990
-sub_8019990: @ 8019990
- push {r4-r6,lr}
- mov r6, r8
- push {r6}
- ldr r4, =gUnknown_082F0740
- mov r8, r4
- lsls r0, 2
- adds r4, r0, r4
- movs r6, 0
- ldrsh r5, [r4, r6]
- ldr r6, =gUnknown_082F0760
- lsls r1, 1
- adds r4, r1, r6
- ldrb r4, [r4]
- lsls r4, 24
- asrs r4, 24
- adds r5, r4
- adds r5, 0x7
- str r5, [r2]
- movs r2, 0x2
- add r8, r2
- add r0, r8
- movs r4, 0
- ldrsh r0, [r0, r4]
- adds r6, 0x1
- adds r1, r6
- ldrb r1, [r1]
- lsls r1, 24
- asrs r1, 24
- adds r0, r1
- adds r0, 0x7
- str r0, [r3]
- pop {r3}
- mov r8, r3
- pop {r4-r6}
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_8019990
-
- thumb_func_start sub_80199E0
-sub_80199E0: @ 80199E0
- push {r4-r7,lr}
- mov r12, r3
- ldr r7, =gUnknown_082F0740
- lsls r5, r0, 2
- adds r0, r5, r7
- movs r4, 0
- ldrsh r3, [r0, r4]
- ldr r6, =gUnknown_082F0760
- lsls r4, r1, 1
- adds r0, r4, r6
- ldrb r0, [r0]
- lsls r0, 24
- asrs r0, 24
- adds r3, r0
- adds r3, 0x7
- cmp r3, r2
- bne _08019A28
- adds r0, r7, 0x2
- adds r0, r5, r0
- movs r2, 0
- ldrsh r1, [r0, r2]
- adds r0, r6, 0x1
- adds r0, r4, r0
- ldrb r0, [r0]
- lsls r0, 24
- asrs r0, 24
- adds r1, r0
- adds r1, 0x7
- cmp r1, r12
- bne _08019A28
- movs r0, 0x1
- b _08019A2A
- .pool
-_08019A28:
- movs r0, 0
-_08019A2A:
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end sub_80199E0
-
- thumb_func_start IsUnionRoomPlayerHidden
-IsUnionRoomPlayerHidden: @ 8019A30
- push {lr}
- ldr r1, =0x000002bf
- adds r0, r1
- lsls r0, 16
- lsrs r0, 16
- bl FlagGet
- lsls r0, 24
- lsrs r0, 24
- pop {r1}
- bx r1
- .pool
- thumb_func_end IsUnionRoomPlayerHidden
-
- thumb_func_start HideUnionRoomPlayer
-HideUnionRoomPlayer: @ 8019A4C
- push {lr}
- ldr r1, =0x000002bf
- adds r0, r1
- lsls r0, 16
- lsrs r0, 16
- bl FlagSet
- pop {r0}
- bx r0
- .pool
- thumb_func_end HideUnionRoomPlayer
-
- thumb_func_start ShowUnionRoomPlayer
-ShowUnionRoomPlayer: @ 8019A64
- push {lr}
- ldr r1, =0x000002bf
- adds r0, r1
- lsls r0, 16
- lsrs r0, 16
- bl FlagClear
- pop {r0}
- bx r0
- .pool
- thumb_func_end ShowUnionRoomPlayer
-
- thumb_func_start SetUnionRoomPlayerGfx
-SetUnionRoomPlayerGfx: @ 8019A7C
- push {lr}
- ldr r2, =0x00004010
- adds r0, r2
- lsls r0, 16
- lsrs r0, 16
- lsls r1, 16
- lsrs r1, 16
- bl VarSet
- pop {r0}
- bx r0
- .pool
- thumb_func_end SetUnionRoomPlayerGfx
-
- thumb_func_start CreateUnionRoomPlayerEventObject
-CreateUnionRoomPlayerEventObject: @ 8019A98
- push {lr}
- ldr r1, =gUnknown_082F0774
- adds r0, r1
- ldrb r0, [r0]
- ldr r1, =gSaveBlock1Ptr
- ldr r2, [r1]
- ldrb r1, [r2, 0x5]
- ldrb r2, [r2, 0x4]
- bl show_sprite
- pop {r0}
- bx r0
- .pool
- thumb_func_end CreateUnionRoomPlayerEventObject
-
- thumb_func_start RemoveUnionRoomPlayerEventObject
-RemoveUnionRoomPlayerEventObject: @ 8019AB8
- push {lr}
- ldr r1, =gUnknown_082F0774
- adds r0, r1
- ldrb r0, [r0]
- ldr r1, =gSaveBlock1Ptr
- ldr r2, [r1]
- ldrb r1, [r2, 0x5]
- ldrb r2, [r2, 0x4]
- bl RemoveEventObjectByLocalIdAndMap
- pop {r0}
- bx r0
- .pool
- thumb_func_end RemoveUnionRoomPlayerEventObject
-
- thumb_func_start SetUnionRoomPlayerEnterExitMovement
-SetUnionRoomPlayerEnterExitMovement: @ 8019AD8
- push {r4,r5,lr}
- sub sp, 0x4
- adds r5, r1, 0
- ldr r1, =gUnknown_082F0774
- adds r0, r1
- ldrb r0, [r0]
- ldr r1, =gSaveBlock1Ptr
- ldr r2, [r1]
- ldrb r1, [r2, 0x5]
- ldrb r2, [r2, 0x4]
- mov r3, sp
- bl TryGetEventObjectIdByLocalIdAndMap
- lsls r0, 24
- cmp r0, 0
- bne _08019B30
- mov r0, sp
- ldrb r1, [r0]
- lsls r0, r1, 3
- adds r0, r1
- lsls r0, 2
- ldr r1, =gEventObjects
- adds r4, r0, r1
- adds r0, r4, 0
- bl EventObjectIsMovementOverridden
- lsls r0, 24
- cmp r0, 0
- bne _08019B30
- ldrb r1, [r5]
- adds r0, r4, 0
- bl EventObjectSetHeldMovement
- lsls r0, 24
- cmp r0, 0
- bne _08019B30
- movs r0, 0x1
- b _08019B32
- .pool
-_08019B30:
- movs r0, 0
-_08019B32:
- add sp, 0x4
- pop {r4,r5}
- pop {r1}
- bx r1
- thumb_func_end SetUnionRoomPlayerEnterExitMovement
-
- thumb_func_start sub_8019B3C
-sub_8019B3C: @ 8019B3C
- push {r4,lr}
- sub sp, 0x4
- ldr r1, =gUnknown_082F0774
- adds r0, r1
- ldrb r0, [r0]
- ldr r1, =gSaveBlock1Ptr
- ldr r2, [r1]
- ldrb r1, [r2, 0x5]
- ldrb r2, [r2, 0x4]
- mov r3, sp
- bl TryGetEventObjectIdByLocalIdAndMap
- lsls r0, 24
- cmp r0, 0
- bne _08019B9C
- mov r0, sp
- ldrb r1, [r0]
- lsls r0, r1, 3
- adds r0, r1
- lsls r0, 2
- ldr r1, =gEventObjects
- adds r4, r0, r1
- adds r0, r4, 0
- bl EventObjectClearHeldMovementIfFinished
- lsls r0, 24
- cmp r0, 0
- bne _08019B84
- movs r0, 0
- b _08019B9E
- .pool
-_08019B84:
- bl ScriptContext2_IsEnabled
- lsls r0, 24
- cmp r0, 0
- bne _08019B96
- adds r0, r4, 0
- bl UnfreezeEventObject
- b _08019B9C
-_08019B96:
- adds r0, r4, 0
- bl FreezeEventObject
-_08019B9C:
- movs r0, 0x1
-_08019B9E:
- add sp, 0x4
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end sub_8019B3C
-
- thumb_func_start sub_8019BA8
-sub_8019BA8: @ 8019BA8
- push {lr}
- ldr r2, =gUnknown_02022C68
- movs r1, 0
- str r1, [r2]
- ldr r1, =gUnknown_02022C64
- str r0, [r1]
- movs r1, 0
- movs r2, 0x7
-_08019BB8:
- strb r1, [r0]
- strb r1, [r0, 0x1]
- strb r1, [r0, 0x2]
- strb r1, [r0, 0x3]
- adds r0, 0x4
- subs r2, 0x1
- cmp r2, 0
- bge _08019BB8
- bl sub_8019DF4
- lsls r0, 24
- lsrs r0, 24
- pop {r1}
- bx r1
- .pool
- thumb_func_end sub_8019BA8
-
- thumb_func_start sub_8019BDC
-sub_8019BDC: @ 8019BDC
- push {r4,r5,lr}
- adds r5, r0, 0
- adds r4, r1, 0
- movs r0, 0
- ldrsb r0, [r5, r0]
- cmp r0, 0
- beq _08019BF0
- cmp r0, 0x1
- beq _08019C10
- b _08019C2E
-_08019BF0:
- ldr r1, =gUnknown_082F078C
- adds r0, r4, 0
- bl SetUnionRoomPlayerEnterExitMovement
- cmp r0, 0x1
- bne _08019C2E
- adds r0, r4, 0
- bl HideUnionRoomPlayer
- ldrb r0, [r5]
- adds r0, 0x1
- strb r0, [r5]
- b _08019C2E
- .pool
-_08019C10:
- adds r0, r4, 0
- bl sub_8019B3C
- cmp r0, 0
- beq _08019C2E
- adds r0, r4, 0
- bl RemoveUnionRoomPlayerEventObject
- adds r0, r4, 0
- bl HideUnionRoomPlayer
- movs r0, 0
- strb r0, [r5]
- movs r0, 0x1
- b _08019C30
-_08019C2E:
- movs r0, 0
-_08019C30:
- pop {r4,r5}
- pop {r1}
- bx r1
- thumb_func_end sub_8019BDC
-
- thumb_func_start sub_8019C38
-sub_8019C38: @ 8019C38
- push {r4-r7,lr}
- sub sp, 0x4
- adds r6, r0, 0
- adds r5, r1, 0
- adds r7, r2, 0
- movs r0, 0
- ldrsb r0, [r6, r0]
- cmp r0, 0x2
- beq _08019CD4
- cmp r0, 0x2
- bgt _08019C54
- cmp r0, 0
- beq _08019C5A
- b _08019CE6
-_08019C54:
- cmp r0, 0x3
- beq _08019CBC
- b _08019CE6
-_08019C5A:
- bl is_walking_or_running
- cmp r0, 0
- beq _08019CE6
- mov r4, sp
- adds r4, 0x2
- mov r0, sp
- adds r1, r4, 0
- bl PlayerGetDestCoords
- mov r0, sp
- movs r1, 0
- ldrsh r2, [r0, r1]
- movs r0, 0
- ldrsh r3, [r4, r0]
- adds r0, r5, 0
- movs r1, 0
- bl sub_80199E0
- cmp r0, 0x1
- beq _08019CE6
- mov r0, sp
- adds r1, r4, 0
- bl player_get_pos_including_state_based_drift
- mov r0, sp
- movs r1, 0
- ldrsh r2, [r0, r1]
- movs r0, 0
- ldrsh r3, [r4, r0]
- adds r0, r5, 0
- movs r1, 0
- bl sub_80199E0
- cmp r0, 0x1
- beq _08019CE6
- ldrb r1, [r7, 0x1]
- adds r0, r5, 0
- bl SetUnionRoomPlayerGfx
- adds r0, r5, 0
- bl CreateUnionRoomPlayerEventObject
- adds r0, r5, 0
- bl ShowUnionRoomPlayer
- ldrb r0, [r6]
- adds r0, 0x1
- strb r0, [r6]
-_08019CBC:
- ldr r1, =gUnknown_082F078E
- adds r0, r5, 0
- bl SetUnionRoomPlayerEnterExitMovement
- cmp r0, 0x1
- bne _08019CE6
- ldrb r0, [r6]
- adds r0, 0x1
- strb r0, [r6]
- b _08019CE6
- .pool
-_08019CD4:
- adds r0, r5, 0
- bl sub_8019B3C
- cmp r0, 0
- beq _08019CE6
- movs r0, 0
- strb r0, [r6]
- movs r0, 0x1
- b _08019CE8
-_08019CE6:
- movs r0, 0
-_08019CE8:
- add sp, 0x4
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end sub_8019C38
-
- thumb_func_start sub_8019CF0
-sub_8019CF0: @ 8019CF0
- push {r4,lr}
- ldr r3, =gUnknown_02022C64
- lsls r0, 2
- ldr r4, [r3]
- adds r4, r0
- movs r0, 0x1
- strb r0, [r4, 0x3]
- adds r0, r1, 0
- adds r1, r2, 0
- bl sub_8019978
- strb r0, [r4, 0x1]
- ldrb r0, [r4]
- cmp r0, 0
- beq _08019D18
- movs r0, 0
- b _08019D1A
- .pool
-_08019D18:
- movs r0, 0x1
-_08019D1A:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end sub_8019CF0
-
- thumb_func_start AGBAssert
-AGBAssert: @ 8019D20
- push {lr}
- ldr r1, =gUnknown_02022C64
- lsls r0, 2
- ldr r1, [r1]
- adds r1, r0
- movs r0, 0x2
- strb r0, [r1, 0x3]
- ldrb r0, [r1]
- cmp r0, 0x1
- beq _08019D3C
- movs r0, 0
- b _08019D3E
- .pool
-_08019D3C:
- movs r0, 0x1
-_08019D3E:
- pop {r1}
- bx r1
- thumb_func_end AGBAssert
-
- thumb_func_start sub_8019D44
-sub_8019D44: @ 8019D44
- push {r4,r5,lr}
- adds r5, r0, 0
- adds r4, r1, 0
- ldrb r1, [r4]
- cmp r1, 0x1
- beq _08019DA6
- cmp r1, 0x1
- bgt _08019D5A
- cmp r1, 0
- beq _08019D64
- b _08019DC6
-_08019D5A:
- cmp r1, 0x2
- beq _08019D70
- cmp r1, 0x3
- beq _08019DB4
- b _08019DC6
-_08019D64:
- ldrb r0, [r4, 0x3]
- cmp r0, 0x1
- bne _08019DC6
- movs r0, 0x2
- strb r0, [r4]
- strb r1, [r4, 0x2]
-_08019D70:
- adds r0, r5, 0
- movs r1, 0
- bl sub_8019F8C
- adds r1, r0, 0
- cmp r1, 0
- bne _08019D96
- ldrb r0, [r4, 0x3]
- cmp r0, 0x2
- bne _08019D96
- strb r1, [r4]
- strb r1, [r4, 0x2]
- adds r0, r5, 0
- bl RemoveUnionRoomPlayerEventObject
- adds r0, r5, 0
- bl HideUnionRoomPlayer
- b _08019DC6
-_08019D96:
- adds r0, r4, 0x2
- adds r1, r5, 0
- adds r2, r4, 0
- bl sub_8019C38
- cmp r0, 0x1
- bne _08019DC6
- b _08019DC4
-_08019DA6:
- ldrb r0, [r4, 0x3]
- cmp r0, 0x2
- bne _08019DC6
- movs r1, 0
- movs r0, 0x3
- strb r0, [r4]
- strb r1, [r4, 0x2]
-_08019DB4:
- adds r0, r4, 0x2
- adds r1, r5, 0
- adds r2, r4, 0
- bl sub_8019BDC
- cmp r0, 0x1
- bne _08019DC6
- movs r0, 0
-_08019DC4:
- strb r0, [r4]
-_08019DC6:
- movs r0, 0
- strb r0, [r4, 0x3]
- pop {r4,r5}
- pop {r0}
- bx r0
- thumb_func_end sub_8019D44
-
- thumb_func_start sub_8019DD0
-sub_8019DD0: @ 8019DD0
- push {r4,r5,lr}
- movs r4, 0
- ldr r5, =gUnknown_02022C64
-_08019DD6:
- lsls r0, r4, 2
- ldr r1, [r5]
- adds r1, r0
- adds r0, r4, 0
- bl sub_8019D44
- adds r4, 0x1
- cmp r4, 0x7
- ble _08019DD6
- pop {r4,r5}
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_8019DD0
-
- thumb_func_start sub_8019DF4
-sub_8019DF4: @ 8019DF4
- push {r4,lr}
- ldr r4, =sub_8019DD0
- adds r0, r4, 0
- bl FuncIsActiveTask
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0x1
- beq _08019E18
- adds r0, r4, 0
- movs r1, 0x5
- bl CreateTask
- lsls r0, 24
- lsrs r0, 24
- b _08019E1A
- .pool
-_08019E18:
- movs r0, 0x10
-_08019E1A:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end sub_8019DF4
-
- thumb_func_start sub_8019E20
-sub_8019E20: @ 8019E20
- push {lr}
- ldr r0, =sub_8019DD0
- bl FindTaskIdByFunc
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0xF
- bhi _08019E34
- bl DestroyTask
-_08019E34:
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_8019E20
-
- thumb_func_start sub_8019E3C
-sub_8019E3C: @ 8019E3C
- push {r4,lr}
- movs r4, 0
-_08019E40:
- adds r0, r4, 0
- bl IsUnionRoomPlayerHidden
- cmp r0, 0
- bne _08019E56
- adds r0, r4, 0
- bl RemoveUnionRoomPlayerEventObject
- adds r0, r4, 0
- bl HideUnionRoomPlayer
-_08019E56:
- adds r4, 0x1
- cmp r4, 0x7
- ble _08019E40
- ldr r1, =gUnknown_02022C64
- movs r0, 0
- str r0, [r1]
- bl sub_8019E20
- pop {r4}
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_8019E3C
-
- thumb_func_start sub_8019E70
-sub_8019E70: @ 8019E70
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x10
- str r0, [sp, 0x8]
- mov r9, r1
- movs r7, 0
- mov r0, r9
- lsls r0, 2
- mov r8, r0
- ldr r0, =gUnknown_082F0740
- mov r2, r8
- adds r1, r2, r0
- ldrh r1, [r1]
- mov r2, sp
- strh r1, [r2, 0xC]
- adds r0, 0x2
- add r0, r8
- ldrh r0, [r0]
- mov r10, r0
- ldr r6, =gUnknown_082F0760
-_08019E9E:
- mov r5, r8
- add r5, r9
- adds r5, r7
- adds r4, r5, 0
- subs r4, 0x38
- lsls r4, 24
- lsrs r4, 24
- movs r2, 0
- ldrsb r2, [r6, r2]
- mov r0, sp
- ldrh r0, [r0, 0xC]
- adds r2, r0, r2
- lsls r2, 16
- asrs r2, 16
- movs r3, 0x1
- ldrsb r3, [r6, r3]
- add r3, r10
- lsls r3, 16
- asrs r3, 16
- movs r0, 0x3
- str r0, [sp]
- movs r0, 0x1
- str r0, [sp, 0x4]
- movs r0, 0x41
- adds r1, r4, 0
- bl sprite_new
- ldr r1, [sp, 0x8]
- adds r5, r1, r5
- strb r0, [r5]
- adds r0, r4, 0
- movs r1, 0x1
- bl sub_8097C44
- adds r6, 0x2
- adds r7, 0x1
- cmp r7, 0x4
- ble _08019E9E
- add sp, 0x10
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_8019E70
-
- thumb_func_start sub_8019F04
-sub_8019F04: @ 8019F04
- push {r4-r6,lr}
- adds r5, r0, 0
- movs r4, 0
- ldr r6, =gSprites
-_08019F0C:
- adds r0, r5, r4
- ldrb r1, [r0]
- lsls r0, r1, 4
- adds r0, r1
- lsls r0, 2
- adds r0, r6
- bl DestroySprite
- adds r4, 0x1
- cmp r4, 0x27
- ble _08019F0C
- pop {r4-r6}
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_8019F04
-
- thumb_func_start sub_8019F2C
-sub_8019F2C: @ 8019F2C
- push {r4-r7,lr}
- sub sp, 0x8
- movs r5, 0
- add r7, sp, 0x4
-_08019F34:
- movs r4, 0
- adds r6, r5, 0x1
-_08019F38:
- adds r0, r5, 0
- adds r1, r4, 0
- mov r2, sp
- adds r3, r7, 0
- bl sub_8019990
- ldr r0, [sp]
- ldr r1, [sp, 0x4]
- movs r2, 0
- bl sub_8088B94
- adds r4, 0x1
- cmp r4, 0x4
- ble _08019F38
- adds r5, r6, 0
- cmp r5, 0x7
- ble _08019F34
- add sp, 0x8
- pop {r4-r7}
- pop {r0}
- bx r0
- thumb_func_end sub_8019F2C
-
- thumb_func_start sub_8019F64
-sub_8019F64: @ 8019F64
- push {lr}
- adds r1, r0, 0
- cmp r1, 0
- beq _08019F78
- ldr r0, =gUnknown_082F076F
- adds r0, r1, r0
- ldrb r0, [r0]
- b _08019F88
- .pool
-_08019F78:
- ldrb r1, [r2, 0xA]
- movs r0, 0x7F
- ands r0, r1
- cmp r0, 0x45
- beq _08019F86
- movs r0, 0x4
- b _08019F88
-_08019F86:
- movs r0, 0x1
-_08019F88:
- pop {r1}
- bx r1
- thumb_func_end sub_8019F64
-
- thumb_func_start sub_8019F8C
-sub_8019F8C: @ 8019F8C
- push {lr}
- adds r2, r0, 0
- lsls r0, r2, 2
- adds r0, r2
- adds r0, r1
- subs r0, 0x38
- lsls r0, 24
- lsrs r0, 24
- bl sub_8097C8C
- pop {r1}
- bx r1
- thumb_func_end sub_8019F8C
-
- thumb_func_start sub_8019FA4
-sub_8019FA4: @ 8019FA4
- push {r4-r7,lr}
- mov r7, r9
- mov r6, r8
- push {r6,r7}
- sub sp, 0x8
- adds r5, r0, 0
- adds r6, r1, 0
- mov r9, r3
- lsls r2, 24
- lsrs r2, 24
- mov r8, r2
- lsls r0, r5, 2
- adds r0, r5
- adds r7, r0, r6
- adds r0, r5, 0
- bl sub_8019F8C
- cmp r0, 0x1
- bne _08019FE2
- adds r4, r7, 0
- subs r4, 0x38
- lsls r4, 24
- lsrs r4, 24
- adds r0, r4, 0
- movs r1, 0
- bl sub_8097C44
- adds r0, r4, 0
- movs r1, 0x1
- bl sub_8097CC4
-_08019FE2:
- adds r0, r7, 0
- subs r0, 0x38
- lsls r0, 24
- lsrs r0, 24
- mov r1, r8
- bl sub_8097BB4
- adds r0, r6, 0
- adds r1, r5, 0
- mov r2, r9
- bl sub_8019F64
- adds r2, r0, 0
- lsls r2, 24
- lsrs r2, 24
- adds r0, r6, 0
- adds r1, r5, 0
- bl sub_801A3B0
- add r3, sp, 0x4
- adds r0, r5, 0
- adds r1, r6, 0
- mov r2, sp
- bl sub_8019990
- ldr r0, [sp]
- ldr r1, [sp, 0x4]
- movs r2, 0x1
- bl sub_8088B94
- add sp, 0x8
- pop {r3,r4}
- mov r8, r3
- mov r9, r4
- pop {r4-r7}
- pop {r0}
- bx r0
- thumb_func_end sub_8019FA4
-
- thumb_func_start sub_801A02C
-sub_801A02C: @ 801A02C
- push {r4,r5,lr}
- sub sp, 0x8
- adds r4, r0, 0
- adds r5, r1, 0
- lsls r0, r4, 2
- adds r0, r4
- adds r0, r5
- subs r0, 0x38
- lsls r0, 24
- lsrs r0, 24
- movs r1, 0x2
- bl sub_8097CC4
- add r3, sp, 0x4
- adds r0, r4, 0
- adds r1, r5, 0
- mov r2, sp
- bl sub_8019990
- ldr r0, [sp]
- ldr r1, [sp, 0x4]
- movs r2, 0
- bl sub_8088B94
- add sp, 0x8
- pop {r4,r5}
- pop {r0}
- bx r0
- thumb_func_end sub_801A02C
-
- thumb_func_start sub_801A064
-sub_801A064: @ 801A064
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x8
- adds r7, r0, 0
- mov r8, r1
- mov r6, sp
- adds r6, 0x2
- mov r0, sp
- adds r1, r6, 0
- bl PlayerGetDestCoords
- add r4, sp, 0x4
- mov r5, sp
- adds r5, 0x6
- adds r0, r4, 0
- adds r1, r5, 0
- bl player_get_pos_including_state_based_drift
- lsls r0, r7, 2
- adds r0, r7
- subs r0, 0x38
- lsls r0, 24
- lsrs r0, 24
- bl sub_8097C8C
- mov r10, r6
- mov r9, r4
- adds r6, r5, 0
- cmp r0, 0x1
- bne _0801A0F0
- mov r0, sp
- movs r1, 0
- ldrsh r2, [r0, r1]
- mov r0, r10
- movs r1, 0
- ldrsh r3, [r0, r1]
- adds r0, r7, 0
- movs r1, 0
- bl sub_80199E0
- cmp r0, 0x1
- beq _0801A15C
- movs r0, 0
- ldrsh r2, [r4, r0]
- movs r1, 0
- ldrsh r3, [r6, r1]
- adds r0, r7, 0
- movs r1, 0
- bl sub_80199E0
- cmp r0, 0x1
- beq _0801A15C
- mov r2, r8
- ldrb r0, [r2, 0xB]
- lsls r0, 31
- lsrs r0, 31
- ldrb r1, [r2, 0x2]
- bl sub_8019978
- adds r2, r0, 0
- lsls r2, 24
- lsrs r2, 24
- adds r0, r7, 0
- movs r1, 0
- mov r3, r8
- bl sub_8019FA4
-_0801A0F0:
- movs r5, 0x1
- mov r4, r8
- adds r4, 0x4
-_0801A0F6:
- ldrb r0, [r4]
- cmp r0, 0
- bne _0801A106
- adds r0, r7, 0
- adds r1, r5, 0
- bl sub_801A02C
- b _0801A154
-_0801A106:
- mov r0, sp
- movs r1, 0
- ldrsh r2, [r0, r1]
- mov r0, r10
- movs r1, 0
- ldrsh r3, [r0, r1]
- adds r0, r7, 0
- adds r1, r5, 0
- bl sub_80199E0
- cmp r0, 0
- bne _0801A154
- mov r0, r9
- movs r1, 0
- ldrsh r2, [r0, r1]
- movs r0, 0
- ldrsh r3, [r6, r0]
- adds r0, r7, 0
- adds r1, r5, 0
- bl sub_80199E0
- cmp r0, 0
- bne _0801A154
- ldrb r2, [r4]
- lsrs r0, r2, 3
- movs r1, 0x1
- ands r0, r1
- movs r1, 0x7
- ands r1, r2
- bl sub_8019978
- adds r2, r0, 0
- lsls r2, 24
- lsrs r2, 24
- adds r0, r7, 0
- adds r1, r5, 0
- mov r3, r8
- bl sub_8019FA4
-_0801A154:
- adds r4, 0x1
- adds r5, 0x1
- cmp r5, 0x4
- ble _0801A0F6
-_0801A15C:
- add sp, 0x8
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r0}
- bx r0
- thumb_func_end sub_801A064
-
- thumb_func_start sub_801A16C
-sub_801A16C: @ 801A16C
- push {r4,r5,lr}
- adds r5, r0, 0
- adds r4, r1, 0
- ldrb r0, [r4, 0xA]
- lsls r0, 25
- lsrs r0, 25
- subs r0, 0x40
- cmp r0, 0x14
- bhi _0801A20E
- lsls r0, 2
- ldr r1, =_0801A18C
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .pool
- .align 2, 0
-_0801A18C:
- .4byte _0801A1E0
- .4byte _0801A200
- .4byte _0801A20E
- .4byte _0801A20E
- .4byte _0801A200
- .4byte _0801A200
- .4byte _0801A20E
- .4byte _0801A20E
- .4byte _0801A200
- .4byte _0801A20E
- .4byte _0801A20E
- .4byte _0801A20E
- .4byte _0801A20E
- .4byte _0801A20E
- .4byte _0801A20E
- .4byte _0801A20E
- .4byte _0801A20E
- .4byte _0801A200
- .4byte _0801A200
- .4byte _0801A200
- .4byte _0801A1E0
-_0801A1E0:
- ldrb r1, [r4, 0xB]
- lsls r1, 31
- lsrs r1, 31
- ldrb r2, [r4, 0x2]
- adds r0, r5, 0
- bl sub_8019CF0
- movs r4, 0
-_0801A1F0:
- adds r0, r5, 0
- adds r1, r4, 0
- bl sub_801A02C
- adds r4, 0x1
- cmp r4, 0x4
- bls _0801A1F0
- b _0801A20E
-_0801A200:
- adds r0, r5, 0
- bl AGBAssert
- adds r0, r5, 0
- adds r1, r4, 0
- bl sub_801A064
-_0801A20E:
- pop {r4,r5}
- pop {r0}
- bx r0
- thumb_func_end sub_801A16C
-
- thumb_func_start sub_801A214
-sub_801A214: @ 801A214
- push {r4,r5,lr}
- adds r5, r0, 0
- bl AGBAssert
- movs r4, 0
-_0801A21E:
- adds r0, r5, 0
- adds r1, r4, 0
- bl sub_801A02C
- adds r4, 0x1
- cmp r4, 0x4
- ble _0801A21E
- pop {r4,r5}
- pop {r0}
- bx r0
- thumb_func_end sub_801A214
-
- thumb_func_start sub_801A234
-sub_801A234: @ 801A234
- push {r4,r5,lr}
- ldr r2, =gUnknown_02022C68
- movs r1, 0
- str r1, [r2]
- movs r5, 0
- ldr r4, [r0]
-_0801A240:
- ldrb r0, [r4, 0x1A]
- movs r1, 0x3
- ands r1, r0
- cmp r1, 0x1
- bne _0801A258
- adds r0, r5, 0
- adds r1, r4, 0
- bl sub_801A16C
- b _0801A264
- .pool
-_0801A258:
- cmp r1, 0x2
- bne _0801A264
- adds r0, r5, 0
- adds r1, r4, 0
- bl sub_801A214
-_0801A264:
- adds r4, 0x20
- adds r5, 0x1
- cmp r5, 0x7
- ble _0801A240
- pop {r4,r5}
- pop {r0}
- bx r0
- thumb_func_end sub_801A234
-
- thumb_func_start sub_801A274
-sub_801A274: @ 801A274
- ldr r1, =gUnknown_02022C68
- movs r0, 0x96
- lsls r0, 1
- str r0, [r1]
- bx lr
- .pool
- thumb_func_end sub_801A274
-
- thumb_func_start sub_801A284
-sub_801A284: @ 801A284
- push {lr}
- adds r2, r0, 0
- ldr r0, =gUnknown_02022C68
- ldr r1, [r0]
- adds r1, 0x1
- str r1, [r0]
- movs r0, 0x96
- lsls r0, 1
- cmp r1, r0
- bls _0801A29E
- adds r0, r2, 0
- bl sub_801A234
-_0801A29E:
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_801A284
-
- thumb_func_start sub_801A2A8
-sub_801A2A8: @ 801A2A8
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x18
- adds r5, r0, 0
- str r1, [sp, 0x4]
- str r2, [sp, 0x8]
- bl is_walking_or_running
- cmp r0, 0
- bne _0801A2F0
- b _0801A396
-_0801A2C4:
- ldr r4, =gUnknown_082F076A
- bl GetPlayerFacingDirection
- lsls r0, 24
- lsrs r0, 24
- adds r0, r4
- ldrb r2, [r0]
- adds r0, r6, 0
- ldr r1, [sp, 0xC]
- bl sub_801A3B0
- ldr r0, [sp, 0x4]
- strh r6, [r0]
- mov r1, sp
- ldrh r2, [r1, 0xC]
- ldr r1, [sp, 0x8]
- strh r2, [r1]
- movs r0, 0x1
- b _0801A398
- .pool
-_0801A2F0:
- mov r4, sp
- adds r4, 0x2
- mov r0, sp
- adds r1, r4, 0
- bl GetXYCoordsOneStepInFrontOfPlayer
- movs r0, 0
- str r0, [sp, 0xC]
- ldr r0, =gUnknown_082F0740
- adds r7, r5, 0
- movs r1, 0
- mov r10, r1
- adds r2, r0, 0x2
- str r2, [sp, 0x10]
- str r0, [sp, 0x14]
-_0801A30E:
- movs r6, 0
- ldr r4, [sp, 0x14]
- movs r0, 0
- ldrsh r4, [r4, r0]
- mov r9, r4
- ldr r1, [sp, 0x10]
- mov r8, r1
- ldr r5, =gUnknown_082F0760
-_0801A31E:
- mov r2, r10
- adds r3, r2, r6
- mov r0, sp
- movs r4, 0
- ldrsh r1, [r0, r4]
- movs r0, 0
- ldrsb r0, [r5, r0]
- add r0, r9
- adds r0, 0x7
- cmp r1, r0
- bne _0801A372
- mov r1, sp
- movs r2, 0x2
- ldrsh r0, [r1, r2]
- mov r4, r8
- movs r2, 0
- ldrsh r1, [r4, r2]
- movs r2, 0x1
- ldrsb r2, [r5, r2]
- adds r1, r2
- adds r1, 0x7
- cmp r0, r1
- bne _0801A372
- adds r0, r3, 0
- subs r0, 0x38
- lsls r0, 24
- lsrs r4, r0, 24
- adds r0, r4, 0
- bl sub_8097C8C
- cmp r0, 0
- bne _0801A372
- adds r0, r4, 0
- bl sub_8097D9C
- cmp r0, 0
- bne _0801A372
- ldrb r1, [r7, 0x1A]
- movs r0, 0x3
- ands r0, r1
- cmp r0, 0x1
- beq _0801A2C4
-_0801A372:
- adds r5, 0x2
- adds r6, 0x1
- cmp r6, 0x4
- ble _0801A31E
- adds r7, 0x20
- movs r4, 0x5
- add r10, r4
- ldr r0, [sp, 0x10]
- adds r0, 0x4
- str r0, [sp, 0x10]
- ldr r1, [sp, 0x14]
- adds r1, 0x4
- str r1, [sp, 0x14]
- ldr r2, [sp, 0xC]
- adds r2, 0x1
- str r2, [sp, 0xC]
- cmp r2, 0x7
- ble _0801A30E
-_0801A396:
- movs r0, 0
-_0801A398:
- add sp, 0x18
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r1}
- bx r1
- .pool
- thumb_func_end sub_801A2A8
-
- thumb_func_start sub_801A3B0
-sub_801A3B0: @ 801A3B0
- push {r4,lr}
- adds r4, r0, 0
- adds r3, r1, 0
- lsls r1, r2, 24
- lsrs r1, 24
- lsls r0, r3, 2
- adds r0, r3
- subs r0, 0x38
- adds r0, r4
- lsls r0, 24
- lsrs r0, 24
- bl sub_8097B78
- pop {r4}
- pop {r0}
- bx r0
- thumb_func_end sub_801A3B0
-
- thumb_func_start sub_801A3D0
-sub_801A3D0: @ 801A3D0
- push {r4,r5,lr}
- adds r5, r0, 0
- adds r4, r1, 0
- lsls r3, r4, 5
- adds r3, r2
- adds r2, r3, 0
- bl sub_8019F64
- adds r2, r0, 0
- lsls r2, 24
- lsrs r2, 24
- adds r0, r5, 0
- adds r1, r4, 0
- bl sub_801A3B0
- pop {r4,r5}
- pop {r0}
- bx r0
- thumb_func_end sub_801A3D0
-
- thumb_func_start sub_801A3F4
-sub_801A3F4: @ 801A3F4
- push {lr}
- bl IsDma3ManagerBusyWithBgCopy
- lsls r0, 24
- cmp r0, 0
- bne _0801A414
- bl RunTasks
- bl RunTextPrinters
- bl AnimateSprites
- bl BuildOamBuffer
- bl UpdatePaletteFade
-_0801A414:
- pop {r0}
- bx r0
- thumb_func_end sub_801A3F4
-
- thumb_func_start sub_801A418
-sub_801A418: @ 801A418
- push {lr}
- bl LoadOam
- bl ProcessSpriteCopyRequests
- bl TransferPlttBuffer
- pop {r0}
- bx r0
- thumb_func_end sub_801A418
-
- thumb_func_start sub_801A42C
-sub_801A42C: @ 801A42C
- push {lr}
- ldr r0, =sub_801A43C
- bl SetMainCallback2
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_801A42C
-
- thumb_func_start sub_801A43C
-sub_801A43C: @ 801A43C
- push {r4,r5,lr}
- sub sp, 0xC
- movs r0, 0
- movs r1, 0
- bl SetGpuReg
- ldr r5, =gUnknown_03000DAC
- movs r0, 0x6C
- bl AllocZeroed
- str r0, [r5]
- movs r0, 0
- bl SetVBlankCallback
- movs r0, 0
- bl ResetBgsAndClearDma3BusyFlags
- ldr r1, =gUnknown_082F0D34
- movs r0, 0
- movs r2, 0x2
- bl InitBgsFromTemplates
- movs r4, 0x80
- lsls r4, 4
- adds r0, r4, 0
- bl Alloc
- adds r1, r0, 0
- movs r0, 0x1
- bl SetBgTilemapBuffer
- adds r0, r4, 0
- bl Alloc
- adds r1, r0, 0
- movs r0, 0
- bl SetBgTilemapBuffer
- ldr r1, =gWirelessInfoScreenGfx
- movs r0, 0
- str r0, [sp]
- movs r0, 0x1
- movs r2, 0
- movs r3, 0
- bl DecompressAndLoadBgGfxUsingHeap
- ldr r1, =gWirelessInfoScreenTilemap
- movs r0, 0x1
- movs r2, 0
- movs r3, 0
- bl CopyToBgTilemapBuffer
- ldr r0, =gUnknown_082F0D3C
- bl InitWindows
- bl DeactivateAllTextPrinters
- bl ResetPaletteFade
- bl ResetSpriteData
- bl ResetTasks
- bl ScanlineEffect_Stop
- bl m4aSoundVSyncOn
- ldr r0, =sub_801A418
- bl SetVBlankCallback
- ldr r0, =sub_801A6C0
- movs r1, 0
- bl CreateTask
- ldr r1, [r5]
- adds r1, 0x60
- strb r0, [r1]
- bl sub_8013C40
- ldr r1, [r5]
- adds r1, 0x61
- strb r0, [r1]
- ldr r1, [r5]
- movs r0, 0x1
- str r0, [r1, 0x1C]
- movs r0, 0
- movs r1, 0
- movs r2, 0
- bl ChangeBgX
- movs r0, 0
- movs r1, 0
- movs r2, 0
- bl ChangeBgY
- movs r0, 0x1
- movs r1, 0
- movs r2, 0
- bl ChangeBgX
- movs r0, 0x1
- movs r1, 0
- movs r2, 0
- bl ChangeBgY
- ldr r0, =gWirelessInfoScreenPal
- movs r1, 0
- movs r2, 0x20
- bl LoadPalette
- movs r0, 0xF0
- bl sub_81978B0
- bl DynamicPlaceholderTextUtil_Reset
- movs r0, 0x20
- str r0, [sp]
- str r0, [sp, 0x4]
- movs r0, 0xF
- str r0, [sp, 0x8]
- movs r0, 0
- movs r1, 0
- movs r2, 0
- movs r3, 0
- bl FillBgTilemapBufferRect
- movs r0, 0x1
- bl CopyBgTilemapBufferToVram
- ldr r0, =sub_801A3F4
- bl SetMainCallback2
- bl RunTasks
- bl RunTextPrinters
- bl AnimateSprites
- bl BuildOamBuffer
- bl UpdatePaletteFade
- add sp, 0xC
- pop {r4,r5}
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_801A43C
-
- thumb_func_start sub_801A584
-sub_801A584: @ 801A584
- push {r4,lr}
- bl FreeAllWindowBuffers
- movs r4, 0
-_0801A58C:
- lsls r0, r4, 24
- lsrs r0, 24
- bl GetBgTilemapBuffer
- bl Free
- adds r4, 0x1
- cmp r4, 0x1
- ble _0801A58C
- ldr r0, =gUnknown_03000DAC
- ldr r0, [r0]
- bl Free
- ldr r0, =CB2_ReturnToFieldContinueScriptPlayMapMusic
- bl SetMainCallback2
- pop {r4}
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_801A584
-
- thumb_func_start sub_801A5BC
-sub_801A5BC: @ 801A5BC
- push {lr}
- adds r2, r0, 0
- ldrh r0, [r2]
- adds r0, 0x1
- strh r0, [r2]
- lsls r0, 16
- asrs r0, 16
- cmp r0, 0x5
- ble _0801A5E4
- ldrh r0, [r1]
- adds r0, 0x1
- strh r0, [r1]
- lsls r0, 16
- asrs r0, 16
- cmp r0, 0xE
- bne _0801A5E0
- movs r0, 0
- strh r0, [r1]
-_0801A5E0:
- movs r0, 0
- strh r0, [r2]
-_0801A5E4:
- movs r2, 0
- ldrsh r0, [r1, r2]
- adds r0, 0x2
- lsls r0, 5
- ldr r1, =gWirelessInfoScreenPal
- adds r0, r1
- movs r1, 0
- movs r2, 0x10
- bl LoadPalette
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_801A5BC
-
- thumb_func_start sub_801A600
-sub_801A600: @ 801A600
- push {r4,r5,lr}
- sub sp, 0x8
- movs r0, 0
- movs r1, 0
- bl FillWindowPixelBuffer
- movs r0, 0x1
- movs r1, 0
- bl FillWindowPixelBuffer
- movs r0, 0x2
- movs r1, 0
- bl FillWindowPixelBuffer
- ldr r5, =gUnknown_082F0D5C
- ldr r4, [r5]
- movs r0, 0x1
- adds r1, r4, 0
- movs r2, 0xC0
- bl GetStringCenterAlignXOffset
- adds r3, r0, 0
- lsls r3, 24
- lsrs r3, 24
- movs r0, 0x6
- str r0, [sp]
- movs r0, 0x3
- str r0, [sp, 0x4]
- movs r0, 0
- movs r1, 0x1
- adds r2, r4, 0
- bl sub_801A8B0
- movs r1, 0
-_0801A644:
- adds r4, r1, 0x1
- lsls r0, r4, 2
- adds r0, r5
- ldr r2, [r0]
- lsls r0, r1, 4
- subs r0, r1
- lsls r0, 25
- movs r1, 0x80
- lsls r1, 20
- adds r0, r1
- lsrs r0, 24
- str r0, [sp]
- movs r0, 0x1
- str r0, [sp, 0x4]
- movs r1, 0x1
- movs r3, 0
- bl sub_801A8B0
- adds r1, r4, 0
- cmp r4, 0x2
- ble _0801A644
- ldr r1, =gUnknown_082F0D5C
- adds r0, r4, 0x1
- lsls r0, 2
- adds r0, r1
- ldr r2, [r0]
- lsls r0, r4, 4
- subs r0, r4
- lsls r0, 25
- movs r1, 0x80
- lsls r1, 20
- adds r0, r1
- lsrs r0, 24
- str r0, [sp]
- movs r0, 0x2
- str r0, [sp, 0x4]
- movs r0, 0x1
- movs r1, 0x1
- movs r3, 0
- bl sub_801A8B0
- movs r0, 0
- bl PutWindowTilemap
- movs r0, 0
- movs r1, 0x2
- bl CopyWindowToVram
- movs r0, 0x1
- bl PutWindowTilemap
- movs r0, 0x1
- movs r1, 0x2
- bl CopyWindowToVram
- add sp, 0x8
- pop {r4,r5}
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_801A600
-
- thumb_func_start sub_801A6C0
-sub_801A6C0: @ 801A6C0
- push {r4-r7,lr}
- mov r7, r8
- push {r7}
- sub sp, 0x8
- lsls r0, 24
- lsrs r5, r0, 24
- ldr r1, =gTasks
- lsls r0, r5, 2
- adds r0, r5
- lsls r0, 3
- adds r0, r1
- movs r2, 0x8
- ldrsh r0, [r0, r2]
- adds r2, r1, 0
- cmp r0, 0x5
- bls _0801A6E2
- b _0801A89C
-_0801A6E2:
- lsls r0, 2
- ldr r1, =_0801A6F4
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .pool
- .align 2, 0
-_0801A6F4:
- .4byte _0801A70C
- .4byte _0801A728
- .4byte _0801A74C
- .4byte _0801A768
- .4byte _0801A85C
- .4byte _0801A884
-_0801A70C:
- bl sub_801A600
- ldr r0, =gTasks
- lsls r1, r5, 2
- adds r1, r5
- lsls r1, 3
- adds r1, r0
- ldrh r0, [r1, 0x8]
- adds r0, 0x1
- strh r0, [r1, 0x8]
- b _0801A89C
- .pool
-_0801A728:
- movs r0, 0x1
- negs r0, r0
- movs r1, 0
- str r1, [sp]
- movs r2, 0x10
- movs r3, 0
- bl BeginNormalPaletteFade
- movs r0, 0x1
- bl ShowBg
- movs r0, 0
- bl CopyBgTilemapBufferToVram
- movs r0, 0
- bl ShowBg
- b _0801A86C
-_0801A74C:
- ldr r0, =gPaletteFade
- ldrb r1, [r0, 0x7]
- movs r0, 0x80
- ands r0, r1
- cmp r0, 0
- beq _0801A75A
- b _0801A89C
-_0801A75A:
- lsls r0, r5, 2
- adds r0, r5
- lsls r0, 3
- adds r0, r2
- b _0801A876
- .pool
-_0801A768:
- ldr r0, =gUnknown_03000DAC
- ldr r0, [r0]
- adds r1, r0, 0
- adds r1, 0x10
- adds r2, r0, 0
- adds r2, 0x20
- adds r3, r0, 0
- adds r3, 0x61
- ldrb r3, [r3]
- bl sub_801AA30
- lsls r1, r5, 2
- mov r8, r1
- cmp r0, 0
- beq _0801A7F8
- movs r0, 0x2
- movs r1, 0
- bl FillWindowPixelBuffer
- movs r4, 0
- ldr r6, =gStringVar4
- movs r7, 0x80
- lsls r7, 20
-_0801A796:
- ldr r0, =gUnknown_03000DAC
- ldr r0, [r0]
- lsls r1, r4, 2
- adds r0, r1
- ldr r1, [r0]
- adds r0, r6, 0
- movs r2, 0x1
- movs r3, 0x2
- bl ConvertIntToDecimalStringN
- cmp r4, 0x3
- beq _0801A7CC
- lsrs r0, r7, 24
- str r0, [sp]
- movs r0, 0x1
- str r0, [sp, 0x4]
- movs r0, 0x2
- movs r1, 0x1
- adds r2, r6, 0
- movs r3, 0xC
- bl sub_801A8B0
- b _0801A7DE
- .pool
-_0801A7CC:
- movs r0, 0x62
- str r0, [sp]
- movs r0, 0x2
- str r0, [sp, 0x4]
- movs r1, 0x1
- adds r2, r6, 0
- movs r3, 0xC
- bl sub_801A8B0
-_0801A7DE:
- movs r2, 0xF0
- lsls r2, 21
- adds r7, r2
- adds r4, 0x1
- cmp r4, 0x3
- ble _0801A796
- movs r0, 0x2
- bl PutWindowTilemap
- movs r0, 0x2
- movs r1, 0x3
- bl CopyWindowToVram
-_0801A7F8:
- ldr r0, =gMain
- ldrh r1, [r0, 0x2E]
- movs r0, 0x1
- ands r0, r1
- cmp r0, 0
- bne _0801A80C
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- beq _0801A836
-_0801A80C:
- movs r0, 0x5
- bl PlaySE
- ldr r2, =gTasks
- ldr r0, =gUnknown_03000DAC
- ldr r0, [r0]
- adds r0, 0x61
- ldrb r1, [r0]
- lsls r0, r1, 2
- adds r0, r1
- lsls r0, 3
- adds r0, r2
- movs r1, 0xFF
- strh r1, [r0, 0x26]
- mov r0, r8
- adds r1, r0, r5
- lsls r1, 3
- adds r1, r2
- ldrh r0, [r1, 0x8]
- adds r0, 0x1
- strh r0, [r1, 0x8]
-_0801A836:
- mov r2, r8
- adds r1, r2, r5
- lsls r1, 3
- ldr r0, =gTasks + 0x8
- adds r1, r0
- adds r0, r1, 0
- adds r0, 0xE
- adds r1, 0x10
- bl sub_801A5BC
- b _0801A89C
- .pool
-_0801A85C:
- movs r0, 0x1
- negs r0, r0
- movs r1, 0
- str r1, [sp]
- movs r2, 0
- movs r3, 0x10
- bl BeginNormalPaletteFade
-_0801A86C:
- ldr r1, =gTasks
- lsls r0, r5, 2
- adds r0, r5
- lsls r0, 3
- adds r0, r1
-_0801A876:
- ldrh r1, [r0, 0x8]
- adds r1, 0x1
- strh r1, [r0, 0x8]
- b _0801A89C
- .pool
-_0801A884:
- ldr r0, =gPaletteFade
- ldrb r1, [r0, 0x7]
- movs r0, 0x80
- ands r0, r1
- cmp r0, 0
- bne _0801A89C
- ldr r0, =sub_801A584
- bl SetMainCallback2
- adds r0, r5, 0
- bl DestroyTask
-_0801A89C:
- add sp, 0x8
- pop {r3}
- mov r8, r3
- pop {r4-r7}
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_801A6C0
-
- thumb_func_start sub_801A8B0
-sub_801A8B0: @ 801A8B0
- push {r4-r7,lr}
- sub sp, 0x18
- mov r12, r2
- ldr r2, [sp, 0x2C]
- ldr r4, [sp, 0x30]
- lsls r0, 24
- lsrs r7, r0, 24
- lsls r1, 24
- lsrs r6, r1, 24
- lsls r3, 24
- lsrs r5, r3, 24
- lsls r2, 24
- lsrs r3, r2, 24
- lsls r4, 24
- lsrs r0, r4, 24
- cmp r0, 0x4
- bhi _0801A93A
- lsls r0, 2
- ldr r1, =_0801A8E0
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .pool
- .align 2, 0
-_0801A8E0:
- .4byte _0801A8F4
- .4byte _0801A902
- .4byte _0801A910
- .4byte _0801A91E
- .4byte _0801A92C
-_0801A8F4:
- add r1, sp, 0x14
- movs r0, 0
- strb r0, [r1]
- movs r0, 0x2
- strb r0, [r1, 0x1]
- movs r0, 0x3
- b _0801A938
-_0801A902:
- add r1, sp, 0x14
- movs r0, 0
- strb r0, [r1]
- movs r0, 0x1
- strb r0, [r1, 0x1]
- movs r0, 0x3
- b _0801A938
-_0801A910:
- add r1, sp, 0x14
- movs r0, 0
- strb r0, [r1]
- movs r0, 0x4
- strb r0, [r1, 0x1]
- movs r0, 0x5
- b _0801A938
-_0801A91E:
- add r1, sp, 0x14
- movs r0, 0
- strb r0, [r1]
- movs r0, 0x7
- strb r0, [r1, 0x1]
- movs r0, 0x6
- b _0801A938
-_0801A92C:
- add r1, sp, 0x14
- movs r0, 0
- strb r0, [r1]
- movs r0, 0x1
- strb r0, [r1, 0x1]
- movs r0, 0x2
-_0801A938:
- strb r0, [r1, 0x2]
-_0801A93A:
- movs r0, 0
- str r0, [sp]
- str r0, [sp, 0x4]
- add r0, sp, 0x14
- str r0, [sp, 0x8]
- movs r0, 0x1
- negs r0, r0
- str r0, [sp, 0xC]
- mov r0, r12
- str r0, [sp, 0x10]
- adds r0, r7, 0
- adds r1, r6, 0
- adds r2, r5, 0
- bl AddTextPrinterParameterized4
- add sp, 0x18
- pop {r4-r7}
- pop {r0}
- bx r0
- thumb_func_end sub_801A8B0
-
- thumb_func_start sub_801A960
-sub_801A960: @ 801A960
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x4
- mov r12, r0
- adds r7, r1, 0
- ldrb r0, [r0, 0xA]
- lsls r0, 25
- lsrs r0, 25
- mov r8, r0
- movs r4, 0
- ldr r0, =gUnknown_082F0D70
- mov r9, r0
- movs r1, 0x1
- add r1, r9
- mov r10, r1
- mov r3, r12
- adds r3, 0x4
- str r3, [sp]
-_0801A98A:
- lsls r0, r4, 1
- adds r2, r0, r4
- mov r3, r9
- adds r1, r2, r3
- adds r5, r0, 0
- adds r6, r4, 0x1
- ldrb r1, [r1]
- cmp r8, r1
- bne _0801A9EE
- mov r0, r12
- ldrb r1, [r0, 0x1A]
- movs r0, 0x3
- ands r0, r1
- cmp r0, 0x1
- bne _0801A9EE
- mov r0, r9
- adds r0, 0x2
- adds r3, r2, r0
- ldrb r0, [r3]
- cmp r0, 0
- bne _0801A9DC
- movs r2, 0
- movs r1, 0
- ldr r3, [sp]
-_0801A9BA:
- adds r0, r3, r1
- ldrb r0, [r0]
- cmp r0, 0
- beq _0801A9C4
- adds r2, 0x1
-_0801A9C4:
- adds r1, 0x1
- cmp r1, 0x3
- ble _0801A9BA
- adds r2, 0x1
- adds r0, r5, r4
- add r0, r10
- ldrb r1, [r0]
- lsls r1, 2
- adds r1, r7
- b _0801A9E8
- .pool
-_0801A9DC:
- mov r1, r10
- adds r0, r2, r1
- ldrb r1, [r0]
- lsls r1, 2
- adds r1, r7
- ldrb r2, [r3]
-_0801A9E8:
- ldr r0, [r1]
- adds r0, r2
- str r0, [r1]
-_0801A9EE:
- adds r4, r6, 0
- cmp r4, 0x1E
- bls _0801A98A
- mov r0, r8
- add sp, 0x4
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end sub_801A960
-
- thumb_func_start sub_801AA08
-sub_801AA08: @ 801AA08
- push {r4,lr}
- movs r4, 0
- adds r3, r1, 0
- adds r2, r0, 0
-_0801AA10:
- ldr r1, [r2]
- ldr r0, [r3]
- cmp r1, r0
- beq _0801AA1C
- movs r0, 0x1
- b _0801AA28
-_0801AA1C:
- adds r3, 0x4
- adds r2, 0x4
- adds r4, 0x1
- cmp r4, 0x3
- ble _0801AA10
- movs r0, 0
-_0801AA28:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end sub_801AA08
-
- thumb_func_start sub_801AA30
-sub_801AA30: @ 801AA30
- push {r4-r7,lr}
- mov r7, r9
- mov r6, r8
- push {r6,r7}
- sub sp, 0x10
- adds r6, r0, 0
- mov r9, r1
- adds r5, r2, 0
- lsls r4, r3, 24
- lsrs r4, 24
- movs r0, 0
- mov r8, r0
- mov r0, sp
- movs r1, 0
- movs r2, 0x10
- bl memset
- lsls r0, r4, 2
- adds r0, r4
- lsls r0, 3
- ldr r1, =gTasks + 0x8
- adds r7, r0, r1
- movs r4, 0
-_0801AA5E:
- lsls r1, r4, 5
- ldr r0, [r7]
- adds r0, r1
- mov r1, sp
- bl sub_801A960
- adds r1, r0, 0
- ldr r0, [r5]
- cmp r1, r0
- beq _0801AA78
- str r1, [r5]
- movs r2, 0x1
- mov r8, r2
-_0801AA78:
- adds r5, 0x4
- adds r4, 0x1
- cmp r4, 0xF
- ble _0801AA5E
- mov r0, sp
- mov r1, r9
- bl sub_801AA08
- cmp r0, 0
- bne _0801AA9C
- mov r3, r8
- cmp r3, 0x1
- beq _0801AAC4
- movs r0, 0
- b _0801AAC6
- .pool
-_0801AA9C:
- adds r1, r6, 0
- mov r0, sp
- ldm r0!, {r2-r4}
- stm r1!, {r2-r4}
- ldr r0, [r0]
- str r0, [r1]
- mov r1, r9
- mov r0, sp
- ldm r0!, {r2-r4}
- stm r1!, {r2-r4}
- ldr r0, [r0]
- str r0, [r1]
- ldr r0, [r6]
- ldr r1, [r6, 0x4]
- adds r0, r1
- ldr r1, [r6, 0x8]
- adds r0, r1
- ldr r1, [r6, 0xC]
- adds r0, r1
- str r0, [r6, 0xC]
-_0801AAC4:
- movs r0, 0x1
-_0801AAC6:
- add sp, 0x10
- pop {r3,r4}
- mov r8, r3
- mov r9, r4
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end sub_801AA30
-
- thumb_func_start sub_801AAD4
-sub_801AAD4: @ 801AAD4
- push {r4-r7,lr}
- movs r0, 0xA
- bl sub_8014210
- movs r4, 0
- movs r7, 0x64
- ldr r6, =gPlayerParty
- ldr r5, =gEnemyParty
-_0801AAE4:
- ldr r0, =gSelectedOrderFromParty
- adds r0, r4, r0
- ldrb r0, [r0]
- subs r0, 0x1
- adds r1, r0, 0
- muls r1, r7
- adds r1, r6
- adds r0, r5, 0
- movs r2, 0x64
- bl memcpy
- adds r5, 0x64
- adds r4, 0x1
- cmp r4, 0x1
- ble _0801AAE4
- ldr r4, =gPlayerParty
- movs r0, 0xFA
- lsls r0, 1
- adds r5, r4, r0
-_0801AB0A:
- adds r0, r4, 0
- bl ZeroMonData
- adds r4, 0x64
- cmp r4, r5
- ble _0801AB0A
- ldr r4, =gPlayerParty
- movs r5, 0
- adds r6, r4, 0
- adds r6, 0x64
-_0801AB1E:
- ldr r1, =gEnemyParty
- adds r1, r5, r1
- adds r0, r4, 0
- movs r2, 0x64
- bl memcpy
- adds r4, 0x64
- adds r5, 0x64
- cmp r4, r6
- ble _0801AB1E
- movs r0, 0x32
- bl IncrementGameStat
- bl CalculatePlayerPartyCount
- ldr r0, =gTrainerBattleOpponent_A
- movs r2, 0xC0
- lsls r2, 4
- adds r1, r2, 0
- strh r1, [r0]
- ldr r0, =CB2_InitBattle
- bl SetMainCallback2
- pop {r4-r7}
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_801AAD4
-
- thumb_func_start sub_801AB68
-sub_801AB68: @ 801AB68
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x18
- adds r5, r0, 0
- adds r7, r1, 0
- adds r6, r2, 0
- ldr r4, [sp, 0x38]
- lsls r5, 24
- lsrs r5, 24
- lsls r6, 24
- lsrs r6, 24
- lsls r3, 24
- lsrs r3, 24
- movs r0, 0
- mov r9, r0
- movs r1, 0x1
- mov r10, r1
- ldr r0, =gUnknown_082F0DE4
- mov r8, r0
- ldrb r0, [r0]
- lsls r1, r0, 4
- orrs r1, r0
- lsls r1, 24
- lsrs r1, 24
- adds r0, r5, 0
- str r3, [sp, 0x14]
- bl FillWindowPixelBuffer
- mov r1, r9
- str r1, [sp]
- mov r0, r10
- str r0, [sp, 0x4]
- mov r1, r8
- str r1, [sp, 0x8]
- lsls r4, 24
- asrs r4, 24
- str r4, [sp, 0xC]
- str r7, [sp, 0x10]
- adds r0, r5, 0
- movs r1, 0x1
- adds r2, r6, 0
- ldr r3, [sp, 0x14]
- bl AddTextPrinterParameterized4
- add sp, 0x18
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_801AB68
-
- thumb_func_start sub_801ABDC
-sub_801ABDC: @ 801ABDC
- push {r4-r6,lr}
- sub sp, 0x4
- adds r4, r0, 0
- adds r6, r1, 0
- adds r5, r2, 0
- movs r1, 0
- ldrsh r0, [r4, r1]
- cmp r0, 0
- beq _0801ABF4
- cmp r0, 0x1
- beq _0801AC22
- b _0801AC36
-_0801ABF4:
- movs r0, 0
- movs r1, 0x1
- movs r2, 0xD
- bl sub_8098858
- str r5, [sp]
- movs r0, 0
- adds r1, r6, 0
- movs r2, 0
- movs r3, 0x1
- bl sub_801AB68
- movs r0, 0
- bl PutWindowTilemap
- movs r0, 0
- movs r1, 0x3
- bl CopyWindowToVram
- ldrh r0, [r4]
- adds r0, 0x1
- strh r0, [r4]
- b _0801AC36
-_0801AC22:
- movs r0, 0
- bl IsTextPrinterActive
- lsls r0, 16
- lsrs r0, 16
- cmp r0, 0
- bne _0801AC36
- strh r0, [r4]
- movs r0, 0x1
- b _0801AC38
-_0801AC36:
- movs r0, 0
-_0801AC38:
- add sp, 0x4
- pop {r4-r6}
- pop {r1}
- bx r1
- thumb_func_end sub_801ABDC
-
- thumb_func_start sub_801AC40
-sub_801AC40: @ 801AC40
- push {lr}
- bl LoadOam
- bl ProcessSpriteCopyRequests
- bl TransferPlttBuffer
- pop {r0}
- bx r0
- thumb_func_end sub_801AC40
-
- thumb_func_start sub_801AC54
-sub_801AC54: @ 801AC54
- push {r4,lr}
- sub sp, 0xC
- ldr r1, =gMain
- movs r2, 0x87
- lsls r2, 3
- adds r0, r1, r2
- ldrb r0, [r0]
- adds r2, r1, 0
- cmp r0, 0x33
- bls _0801AC6A
- b _0801AFAE
-_0801AC6A:
- lsls r0, 2
- ldr r1, =_0801AC7C
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .pool
- .align 2, 0
-_0801AC7C:
- .4byte _0801AD4C
- .4byte _0801ADFC
- .4byte _0801AE24
- .4byte _0801AE48
- .4byte _0801AE98
- .4byte _0801AFAE
- .4byte _0801AF7C
- .4byte _0801AF58
- .4byte _0801AF7C
- .4byte _0801AF98
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AFAE
- .4byte _0801AF24
- .4byte _0801AF40
-_0801AD4C:
- movs r0, 0
- movs r1, 0
- bl SetGpuReg
- ldr r4, =gUnknown_02022C6C
- movs r0, 0x4
- bl AllocZeroed
- str r0, [r4]
- bl ResetSpriteData
- bl FreeAllSpritePalettes
- bl ResetTasks
- movs r0, 0
- bl ResetBgsAndClearDma3BusyFlags
- ldr r1, =gUnknown_082F0DD0
- movs r0, 0
- movs r2, 0x1
- bl InitBgsFromTemplates
- bl reset_temp_tile_data_buffers
- ldr r0, =gUnknown_082F0DD4
- bl InitWindows
- lsls r0, 16
- cmp r0, 0
- bne _0801AD8C
- b _0801AFC2
-_0801AD8C:
- bl DeactivateAllTextPrinters
- movs r0, 0
- bl ClearWindowTilemap
- movs r0, 0
- movs r1, 0
- bl FillWindowPixelBuffer
- movs r0, 0
- movs r1, 0x11
- bl FillWindowPixelBuffer
- movs r0, 0x1E
- str r0, [sp]
- movs r0, 0x14
- str r0, [sp, 0x4]
- movs r0, 0xF
- str r0, [sp, 0x8]
- movs r0, 0
- movs r1, 0
- movs r2, 0
- movs r3, 0
- bl FillBgTilemapBufferRect
- movs r0, 0
- movs r1, 0x1
- movs r2, 0xD0
- bl LoadUserWindowBorderGfx
- movs r0, 0
- movs r1, 0x1
- movs r2, 0xD0
- bl LoadUserWindowBorderGfx_
- bl sub_819789C
- ldr r0, =sub_801AC40
- bl SetVBlankCallback
- ldr r1, =gMain
- movs r0, 0x87
- lsls r0, 3
- adds r1, r0
- b _0801AF8A
- .pool
-_0801ADFC:
- ldr r0, =gUnknown_02022C6C
- ldr r0, [r0]
- ldr r1, =gText_CommStandbyAwaitingOtherPlayer
- movs r2, 0
- bl sub_801ABDC
- cmp r0, 0
- bne _0801AE0E
- b _0801AFAE
-_0801AE0E:
- ldr r1, =gMain
- movs r2, 0x87
- lsls r2, 3
- adds r1, r2
- b _0801AF8A
- .pool
-_0801AE24:
- movs r0, 0x1
- negs r0, r0
- movs r1, 0
- str r1, [sp]
- movs r2, 0x10
- movs r3, 0
- bl BeginNormalPaletteFade
- movs r0, 0
- bl ShowBg
- ldr r1, =gMain
- movs r0, 0x87
- lsls r0, 3
- adds r1, r0
- b _0801AF8A
- .pool
-_0801AE48:
- bl UpdatePaletteFade
- lsls r0, 24
- cmp r0, 0
- beq _0801AE54
- b _0801AFAE
-_0801AE54:
- ldr r4, =gBlockSendBuffer
- adds r0, r4, 0
- movs r1, 0
- movs r2, 0x20
- bl memset
- ldr r0, =gSelectedOrderFromParty
- ldrb r1, [r0]
- ldrb r0, [r0, 0x1]
- cmn r1, r0
- bne _0801AE78
- movs r0, 0x52
- b _0801AE7A
- .pool
-_0801AE78:
- movs r0, 0x51
-_0801AE7A:
- strb r0, [r4]
- ldr r1, =gBlockSendBuffer
- movs r0, 0
- movs r2, 0x20
- bl SendBlock
- ldr r1, =gMain
- movs r2, 0x87
- lsls r2, 3
- adds r1, r2
- b _0801AF8A
- .pool
-_0801AE98:
- bl GetBlockReceivedStatus
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0x3
- beq _0801AEA6
- b _0801AFAE
-_0801AEA6:
- ldr r1, =gBlockRecvBuffer
- ldrh r0, [r1]
- cmp r0, 0x51
- bne _0801AEE0
- movs r2, 0x80
- lsls r2, 1
- adds r0, r1, r2
- ldrh r0, [r0]
- cmp r0, 0x51
- bne _0801AEE0
- movs r0, 0x1
- negs r0, r0
- movs r1, 0
- str r1, [sp]
- movs r2, 0
- movs r3, 0x10
- bl BeginNormalPaletteFade
- ldr r0, =gMain
- movs r1, 0x87
- lsls r1, 3
- adds r0, r1
- movs r1, 0x32
- b _0801AF16
- .pool
-_0801AEE0:
- bl sub_800AC34
- ldr r4, =gBlockRecvBuffer
- bl GetMultiplayerId
- lsls r0, 24
- lsrs r0, 16
- adds r0, r4
- ldrh r0, [r0]
- cmp r0, 0x52
- bne _0801AF0C
- ldr r0, =gMain
- movs r2, 0x87
- lsls r2, 3
- adds r0, r2
- movs r1, 0x6
- b _0801AF16
- .pool
-_0801AF0C:
- ldr r0, =gMain
- movs r1, 0x87
- lsls r1, 3
- adds r0, r1
- movs r1, 0x8
-_0801AF16:
- strb r1, [r0]
- bl ResetBlockReceivedFlags
- b _0801AFAE
- .pool
-_0801AF24:
- bl UpdatePaletteFade
- lsls r0, 24
- cmp r0, 0
- bne _0801AFAE
- bl sub_800ADF8
- ldr r1, =gMain
- movs r2, 0x87
- lsls r2, 3
- adds r1, r2
- b _0801AF8A
- .pool
-_0801AF40:
- bl IsLinkTaskFinished
- lsls r0, 24
- cmp r0, 0
- beq _0801AFAE
- ldr r0, =sub_801AAD4
- bl SetMainCallback2
- b _0801AFAE
- .pool
-_0801AF58:
- ldr r0, =gUnknown_02022C6C
- ldr r0, [r0]
- ldr r1, =gText_RefusedBattle
- movs r2, 0x1
- bl sub_801ABDC
- cmp r0, 0
- beq _0801AFAE
- ldr r0, =CB2_ReturnToField
- bl SetMainCallback2
- b _0801AFAE
- .pool
-_0801AF7C:
- ldr r0, =gReceivedRemoteLinkPlayers
- ldrb r0, [r0]
- cmp r0, 0
- bne _0801AFAE
- movs r0, 0x87
- lsls r0, 3
- adds r1, r2, r0
-_0801AF8A:
- ldrb r0, [r1]
- adds r0, 0x1
- strb r0, [r1]
- b _0801AFAE
- .pool
-_0801AF98:
- ldr r0, =gUnknown_02022C6C
- ldr r0, [r0]
- ldr r1, =gText_BattleWasRefused
- movs r2, 0x1
- bl sub_801ABDC
- cmp r0, 0
- beq _0801AFAE
- ldr r0, =CB2_ReturnToField
- bl SetMainCallback2
-_0801AFAE:
- bl RunTasks
- bl RunTextPrinters
- bl AnimateSprites
- bl BuildOamBuffer
- bl UpdatePaletteFade
-_0801AFC2:
- add sp, 0xC
- pop {r4}
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_801AC54
diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s
index e7a7e89b6..8655d9bc3 100644
--- a/data/battle_anim_scripts.s
+++ b/data/battle_anim_scripts.s
@@ -1515,7 +1515,7 @@ Move_VINE_WHIP:
createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 4, 6
delay 6
playsewithpan SE_W010, SOUND_PAN_TARGET
- createsprite gUnknown_085928E8, ANIM_TARGET, 2, 0, 0
+ createsprite gVineWhipSpriteTemplate, ANIM_TARGET, 2, 0, 0
delay 6
createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 6, 1
end
@@ -1656,12 +1656,12 @@ Explosion1:
Move_DEFENSE_CURL:
loadspritegfx ANIM_TAG_ECLIPSING_ORB
loopsewithpan SE_W161, SOUND_PAN_ATTACKER, 18, 3
- createvisualtask sub_811489C, 5, 0, 0
+ createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, ANIM_ATTACKER, 0
createvisualtask sub_815B338, 5
waitforvisualfinish
createsprite gUnknown_085CE338, ANIM_ATTACKER, 2, 0, 6, 0, 1
waitforvisualfinish
- createvisualtask sub_811489C, 5, 0, 1
+ createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, ANIM_ATTACKER, 1
waitforvisualfinish
end
@@ -2003,7 +2003,7 @@ Move_ATTRACT:
createsprite gBattleAnimSpriteTemplate_85939B8, ANIM_TARGET, 3, -384, -31
waitforvisualfinish
waitplaysewithpan SE_W213B, 0, 15
- createvisualtask sub_81062E8, 5
+ createvisualtask AnimTask_HeartsBackground, 5
createsprite gUnknown_085939D0, ANIM_ATTACKER, 40, 16, 256, 0
createsprite gUnknown_085939D0, ANIM_ATTACKER, 40, 224, 240, 15
createsprite gUnknown_085939D0, ANIM_ATTACKER, 40, 126, 272, 30
@@ -2012,7 +2012,7 @@ Move_ATTRACT:
createsprite gUnknown_085939D0, ANIM_ATTACKER, 40, 40, 256, 75
createsprite gUnknown_085939D0, ANIM_ATTACKER, 40, 112, 256, 90
createsprite gUnknown_085939D0, ANIM_ATTACKER, 40, 200, 272, 90
- delay 0x4B
+ delay 75
createvisualtask sub_8115A04, 2, 4, 4, 4, 0, 10, RGB(31, 25, 27)
end
@@ -3220,13 +3220,13 @@ EndureEffect:
Move_CHARM:
loadspritegfx ANIM_TAG_MAGENTA_HEART
createvisualtask AnimTask_RockMonBackAndForth, 5, ANIM_ATTACKER, 2, 0
- createsprite gUnknown_08593970, ANIM_ATTACKER, 3, 0, 20
+ createsprite gMagentaHeartSpriteTemplate, ANIM_ATTACKER, 3, 0, 20
playsewithpan SE_W204, SOUND_PAN_ATTACKER
delay 15
- createsprite gUnknown_08593970, ANIM_ATTACKER, 3, -20, 20
+ createsprite gMagentaHeartSpriteTemplate, ANIM_ATTACKER, 3, -20, 20
playsewithpan SE_W204, SOUND_PAN_ATTACKER
delay 15
- createsprite gUnknown_08593970, ANIM_ATTACKER, 3, 20, 20
+ createsprite gMagentaHeartSpriteTemplate, ANIM_ATTACKER, 3, 20, 20
playsewithpan SE_W204, SOUND_PAN_ATTACKER
waitforvisualfinish
end
@@ -4358,7 +4358,7 @@ Move_AERIAL_ACE:
Move_IRON_DEFENSE:
loopsewithpan SE_REAPOKE, SOUND_PAN_ATTACKER, 28, 2
- createvisualtask sub_81144F8, 5, 0, 0, 0
+ createvisualtask AnimTask_MetallicShine, 5, 0, 0, 0
createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 8, 2, RGB_WHITEALPHA, 14, -1, 0
waitforvisualfinish
end
@@ -4393,13 +4393,13 @@ Move_COVET:
loadspritegfx ANIM_TAG_MAGENTA_HEART
loadspritegfx ANIM_TAG_ITEM_BAG
createvisualtask AnimTask_RockMonBackAndForth, 5, ANIM_ATTACKER, 2, 0
- createsprite gUnknown_08593970, ANIM_ATTACKER, 3, 0, 20
+ createsprite gMagentaHeartSpriteTemplate, ANIM_ATTACKER, 3, 0, 20
playsewithpan SE_W204, SOUND_PAN_ATTACKER
delay 15
- createsprite gUnknown_08593970, ANIM_ATTACKER, 3, -20, 20
+ createsprite gMagentaHeartSpriteTemplate, ANIM_ATTACKER, 3, -20, 20
playsewithpan SE_W204, SOUND_PAN_ATTACKER
delay 15
- createsprite gUnknown_08593970, ANIM_ATTACKER, 3, 20, 20
+ createsprite gMagentaHeartSpriteTemplate, ANIM_ATTACKER, 3, 20, 20
playsewithpan SE_W204, SOUND_PAN_ATTACKER
waitforvisualfinish
createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 8, 1
@@ -4570,7 +4570,7 @@ Move_SHOCK_WAVE:
Move_HARDEN:
loopsewithpan SE_W231, SOUND_PAN_ATTACKER, 28, 2
- createvisualtask sub_81144F8, 5, 0, 0, 0
+ createvisualtask AnimTask_MetallicShine, 5, 0, 0, 0
waitforvisualfinish
end
@@ -5347,7 +5347,7 @@ Move_ICE_BEAM:
loadspritegfx ANIM_TAG_ICE_CRYSTALS
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 7, RGB_BLACK
waitforvisualfinish
- createsoundtask sub_8158C58, 183, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 4, 4, 0, 10
+ createsoundtask sub_8158C58, SE_W062B, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 4, 4, 0, 10
createsprite gUnknown_08595B2C, ANIM_ATTACKER, 2, 20, 12, 0, 12, 20
createsprite gUnknown_08595B2C, ANIM_ATTACKER, 2, 20, -12, 0, -12, 20
delay 1
@@ -5403,7 +5403,7 @@ Move_AURORA_BEAM:
call AuroraBeam1
call AuroraBeam1
setarg 7, -1
- createsoundtask sub_8158C58, 183, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 3, 6, 0, 10
+ createsoundtask sub_8158C58, SE_W062B, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 3, 6, 0, 10
createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 2, 0, 40, 1
call AuroraBeam1
call AuroraBeam1
@@ -7123,7 +7123,7 @@ Move_PSYBEAM:
loadspritegfx ANIM_TAG_GOLD_RING
playsewithpan SE_W060, SOUND_PAN_ATTACKER
call SetPsychicBackground
- createsoundtask sub_8158C58, 200, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 3, 4, 0, 15
+ createsoundtask sub_8158C58, SE_W060B, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 3, 4, 0, 15
call Psybeam1
call Psybeam1
createvisualtask AnimTask_SwayMon, 5, 0, 6, 2048, 4, ANIM_TARGET
@@ -7169,7 +7169,7 @@ Move_PSYWAVE:
playsewithpan SE_W060, SOUND_PAN_ATTACKER
call SetPsychicBackground
createvisualtask sub_81076C8, 5, 100
- createsoundtask sub_8158C58, 203, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 2, 9, 0, 10
+ createsoundtask sub_8158C58, SE_W100, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 2, 9, 0, 10
call Psywave1
call Psywave1
createvisualtask sub_8115A04, 2, 4, 1, 4, 0, 12, RGB(31, 18, 31)
@@ -7213,7 +7213,7 @@ Move_STEEL_WING:
loadspritegfx ANIM_TAG_GUST
loadspritegfx ANIM_TAG_IMPACT
loopsewithpan SE_W231, SOUND_PAN_ATTACKER, 28, 2
- createvisualtask sub_81144F8, 5, 0, 0, 0
+ createvisualtask AnimTask_MetallicShine, 5, 0, 0, 0
waitforvisualfinish
monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET
@@ -7239,7 +7239,7 @@ Move_STEEL_WING:
Move_IRON_TAIL:
loadspritegfx ANIM_TAG_IMPACT
loopsewithpan SE_W231, SOUND_PAN_ATTACKER, 28, 2
- createvisualtask sub_81144F8, 5, 1, 0, 0
+ createvisualtask AnimTask_MetallicShine, 5, 1, 0, 0
waitforvisualfinish
monbg ANIM_TARGET
setalpha 12, 8
@@ -7249,7 +7249,7 @@ Move_IRON_TAIL:
createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1
playsewithpan SE_W233B, SOUND_PAN_TARGET
waitforvisualfinish
- createvisualtask sub_811489C, 5, 0, 1
+ createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, ANIM_ATTACKER, 1
clearmonbg ANIM_TARGET
blendoff
waitforvisualfinish
@@ -7259,7 +7259,7 @@ Move_POISON_TAIL:
loadspritegfx ANIM_TAG_IMPACT
loadspritegfx ANIM_TAG_POISON_BUBBLE
loopsewithpan SE_W231, SOUND_PAN_ATTACKER, 28, 2
- createvisualtask sub_81144F8, 5, 1, 1, RGB(24, 6, 23)
+ createvisualtask AnimTask_MetallicShine, 5, 1, 1, RGB(24, 6, 23)
waitforvisualfinish
monbg ANIM_TARGET
setalpha 12, 8
@@ -7269,7 +7269,7 @@ Move_POISON_TAIL:
createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1
playsewithpan SE_W233B, SOUND_PAN_TARGET
waitforvisualfinish
- createvisualtask sub_811489C, 5, 0, 1
+ createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, ANIM_ATTACKER, 1
clearmonbg ANIM_TARGET
blendoff
call PoisonBubblesEffect
@@ -7279,7 +7279,7 @@ Move_POISON_TAIL:
Move_METAL_CLAW:
loadspritegfx ANIM_TAG_CLAW_SLASH
loopsewithpan SE_W231, SOUND_PAN_ATTACKER, 28, 2
- createvisualtask sub_81144F8, 5, 0, 0, 0
+ createvisualtask AnimTask_MetallicShine, 5, 0, 0, 0
waitforvisualfinish
createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 6, 4
delay 2
@@ -7346,8 +7346,8 @@ Move_SHADOW_BALL:
fadetobg BG_GHOST
waitbgfadein
delay 15
- createsoundtask sub_8158C58, 168, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 5, 5, 0, 5
- createsprite gUnknown_08596D58, ANIM_TARGET, 2, 16, 16, 8
+ createsoundtask sub_8158C58, SE_W054, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 5, 5, 0, 5
+ createsprite gShadowBallSpriteTemplate, ANIM_TARGET, 2, 16, 16, 8
waitforvisualfinish
playsewithpan SE_W028, SOUND_PAN_TARGET
createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 8, 1
@@ -7459,7 +7459,7 @@ Move_STRING_SHOT:
end
StringShot1:
- createsprite gUnknown_085969E0, ANIM_TARGET, 2, 20, 0, 512, 20, 1
+ createsprite gWebThreadSpriteTemplate, ANIM_TARGET, 2, 20, 0, 512, 20, 1
delay 1
return
@@ -7488,7 +7488,7 @@ Move_SPIDER_WEB:
call SpiderWeb1
waitforvisualfinish
playsewithpan SE_W081B, SOUND_PAN_TARGET
- createsprite gUnknown_08596A2C, ANIM_ATTACKER, 2
+ createsprite gSpiderWebSpriteTemplate, ANIM_ATTACKER, 2
waitforvisualfinish
clearmonbg ANIM_DEF_PARTNER
delay 1
@@ -7496,7 +7496,7 @@ Move_SPIDER_WEB:
end
SpiderWeb1:
- createsprite gUnknown_085969E0, ANIM_TARGET, 2, 20, 0, 512, 20, 0
+ createsprite gWebThreadSpriteTemplate, ANIM_TARGET, 2, 20, 0, 512, 20, 0
delay 1
return
@@ -7941,16 +7941,16 @@ Move_PERISH_SONG:
panse_1B SE_W195, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0
delay 80
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 0, 16, RGB_BLACK
- createvisualtask sub_811489C, 5, 4, 0
- createvisualtask sub_811489C, 5, 5, 0
- createvisualtask sub_811489C, 5, 6, 0
- createvisualtask sub_811489C, 5, 7, 0
+ createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, 4, 0
+ createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, 5, 0
+ createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, 6, 0
+ createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, 7, 0
delay 100
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 16, 0, RGB_BLACK
- createvisualtask sub_811489C, 5, 4, 1
- createvisualtask sub_811489C, 5, 5, 1
- createvisualtask sub_811489C, 5, 6, 1
- createvisualtask sub_811489C, 5, 7, 1
+ createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, 4, 1
+ createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, 5, 1
+ createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, 6, 1
+ createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, 7, 1
waitforvisualfinish
end
@@ -8019,7 +8019,7 @@ Move_TRI_ATTACK:
delay 20
playsewithpan SE_W161, SOUND_PAN_ATTACKER
delay 20
- createsoundtask sub_8158C58, 220, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 5, 6, 0, 7
+ createsoundtask sub_8158C58, SE_W161, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 5, 6, 0, 7
waitforvisualfinish
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 16, RGB_BLACK
delay 16
@@ -8356,7 +8356,7 @@ Move_HYPER_BEAM:
createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 4, 1
waitforvisualfinish
delay 30
- createsoundtask sub_8158C58, 247, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 1, 15, 0, 5
+ createsoundtask sub_8158C58, SE_W063B, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 1, 15, 0, 5
createvisualtask AnimTask_ShakeMon, 2, ANIM_ATTACKER, 0, 4, 50, 1
createvisualtask sub_8115D94, 2, ANIM_TAG_ORBS, 1, 12, 31, 16, 0, 0
call HyperBeam1
@@ -9570,7 +9570,7 @@ Move_DOOM_DESIRE:
createvisualtask sub_8114960, 2
delay 1
monbg ANIM_ATK_PARTNER
- createvisualtask sub_811489C, 5, 1, 0
+ createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, ANIM_TARGET, 0
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 4, RGB_BLACK
waitforvisualfinish
setalpha 8, 8
@@ -9578,7 +9578,7 @@ Move_DOOM_DESIRE:
createvisualtask AnimTask_ScaleMonAndRestore, 5, -4, -4, 15, ANIM_ATTACKER, 1
waitforvisualfinish
delay 20
- createvisualtask sub_811489C, 5, 1, 1
+ createvisualtask AnimTask_SetGreyscaleOrOriginalPal, 5, ANIM_TARGET, 1
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 4, 0, RGB_BLACK
waitforvisualfinish
clearmonbg ANIM_ATK_PARTNER
@@ -10237,13 +10237,13 @@ Burn1:
Status_Infatuation:
loadspritegfx ANIM_TAG_MAGENTA_HEART
playsewithpan SE_W204, SOUND_PAN_ATTACKER
- createsprite gUnknown_08593970, ANIM_ATTACKER, 3, 0, 20
+ createsprite gMagentaHeartSpriteTemplate, ANIM_ATTACKER, 3, 0, 20
delay 15
playsewithpan SE_W204, SOUND_PAN_ATTACKER
- createsprite gUnknown_08593970, ANIM_ATTACKER, 3, -20, 20
+ createsprite gMagentaHeartSpriteTemplate, ANIM_ATTACKER, 3, -20, 20
delay 15
playsewithpan SE_W204, SOUND_PAN_ATTACKER
- createsprite gUnknown_08593970, ANIM_ATTACKER, 3, 20, 20
+ createsprite gMagentaHeartSpriteTemplate, ANIM_ATTACKER, 3, 20, 20
end
Status_Sleep:
diff --git a/data/contest.s b/data/contest.s
deleted file mode 100644
index 48bfa1080..000000000
--- a/data/contest.s
+++ /dev/null
@@ -1,412 +0,0 @@
-#include "constants/species.h"
-#include "constants/moves.h"
- .include "asm/macros.inc"
- .include "constants/constants.inc"
-
- .section .rodata
- .align 2, 0
-
-gUnknown_08587A6C:: @ 8587A6C
- .byte 0x24, 0x4c, 0x74, 0x9c
-
-gUnknown_08587A70:: @ 8587A70
- .byte 0x24, 0x4c, 0x74, 0x9c
-
- .align 2
-gUnknown_08587A74:: @ 8587A74
- obj_tiles gTiles_8C19450, 0x0020, 0x4e20
-
- .align 2
-gOamData_8587A7C:: @ 8587A7C
- .2byte 0x0000
- .2byte 0x0000
- .2byte 0x0000
-
- .align 2
-gSpriteAffineAnim_8587A84:: @ 8587A84
- obj_rot_scal_anim_frame 0x100, 0x100, 0, 0
- obj_rot_scal_anim_end
-
- .align 2
-gSpriteAffineAnim_8587A94:: @ 8587A94
- obj_rot_scal_anim_frame 0x100, 0x100, 0, 0
- obj_rot_scal_anim_frame 0xFFF6, 0xFFF6, -20, 20
- obj_rot_scal_anim_end
-
- .align 2
-gSpriteAffineAnim_8587AAC:: @ 8587AAC
- obj_rot_scal_anim_frame 0x38, 0x38, 0, 0
- obj_rot_scal_anim_frame 0xA, 0xA, 20, 20
- obj_rot_scal_anim_end
-
- .align 2
-gSpriteAffineAnimTable_8587AC4:: @ 8587AC4
- .4byte gSpriteAffineAnim_8587A84
- .4byte gSpriteAffineAnim_8587A94
- .4byte gSpriteAffineAnim_8587AAC
-
- .align 2
-gSpriteTemplate_8587AD0:: @ 8587AD0
- spr_template 0x4e20, 0xabe0, gOamData_8587A7C, gDummySpriteAnimTable, NULL, gSpriteAffineAnimTable_8587AC4, SpriteCallbackDummy
-
- .align 2
-gUnknown_08587AE8:: @ 8587AE8
- obj_tiles gContestNextTurnGfx, 0x0100, 0x4e22
- obj_tiles gContestNextTurnGfx, 0x0100, 0x4e23
- obj_tiles gContestNextTurnGfx, 0x0100, 0x4e24
- obj_tiles gContestNextTurnGfx, 0x0100, 0x4e25
-
- .align 2
-gUnknown_08587B08:: @ 8587B08
- obj_pal gContestPal, 0x4e22
-
- .align 2
-gOamData_8587B10:: @ 8587B10
- .2byte 0x4000
- .2byte 0x4000
- .2byte 0x0000
-
- .align 2
-gSpriteTemplate_8587B18:: @ 8587B18
- spr_template 0x4e22, 0x4e22, gOamData_8587B10, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
- spr_template 0x4e23, 0x4e22, gOamData_8587B10, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
- spr_template 0x4e24, 0x4e22, gOamData_8587B10, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
- spr_template 0x4e25, 0x4e22, gOamData_8587B10, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
-
- .align 2
-gSubspriteTable_8587B78:: @ 8587B78
- subsprite -28, -4, 0, 0, 32x8
- subsprite 4, -4, 0, 4, 32x8
-
- .align 2
-gSubspriteTables_8587B80:: @ 8587B80
- .4byte 2, gSubspriteTable_8587B78
-
- .align 2
-gUnknown_08587B88:: @ 8587B88
- obj_tiles gUnknown_08C19168, 0x0180, 0xabe1
-
- .align 2
-gOamData_8587B90:: @ 8587B90
- .2byte 0x0000
- .2byte 0x4000
- .2byte 0x0000
-
- .align 2
-gSpriteTemplate_8587B98:: @ 8587B98
- spr_template 0xabe1, 0xabe0, gOamData_8587B90, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
-
- .align 2
-gUnknown_08587BB0:: @ 8587BB0
- obj_tiles gContestApplauseGfx, 0x0400, 0xabe2
-
- .align 2
-gUnknown_08587BB8:: @ 8587BB8
- obj_pal gContestPal, 0xabe2
-
- .align 2
-gOamData_8587BC0:: @ 8587BC0
- .2byte 0x4000
- .2byte 0xC000
- .2byte 0x0000
-
- .align 2
-gSpriteTemplate_8587BC8:: @ 8587BC8
- spr_template 0xabe2, 0xabe2, gOamData_8587BC0, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
-
- .align 2
-gOamData_8587BE0:: @ 8587BE0
- .2byte 0x0000
- .2byte 0xC000
- .2byte 0x2C00
-
- .align 2
-gSpriteTemplate_8587BE8:: @ 8587BE8
- spr_template 0x4e21, 0x4e21, gOamData_8587BE0, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
-
- .align 2
-gUnknown_08587C00:: @ 8587C00
- obj_tiles gContestJudgeGfx, 0x0800, 0x4e21
-
- .align 2
-gUnknown_08587C08:: @ 8587C08
- obj_tiles gContestJudgeSymbolsGfx, 0x0380, 0xabe0
-
- .align 2
-gUnknown_08587C10:: @ 8587C10
- obj_pal gContest3Pal, 0xabe0
-
- .align 2
-gSpriteTemplate_8587C18:: @ 8587C18
- spr_template 0xabe0, 0xabe0, gUnknown_0852490C, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
-
- .align 2
-gUnknown_08587C30:: @ 8587C30
- .incbin "graphics/unknown/unknown_587C30.gbapal"
-
-@ 8587C50
- .include "data/text/contest_text_pointers.inc"
-
- .align 2
-gUnknown_08587D5C:: @ 8587D5C
- .4byte gText_0827D5C1
- .4byte gText_0827D5DC
- .4byte gText_0827D600
- .4byte gText_0827D612
- .4byte gText_0827D612
- .4byte gText_0827D62D
- .4byte gText_0827D654
- .4byte gText_0827D67E
- .4byte gText_0827D69C
- .4byte gText_0827D6BA
- .4byte gText_0827D6E5
- .4byte gText_0827D706
- .4byte gText_0827D71D
-
- .align 2
-gUnknown_08587D90:: @ 8587D90
- .4byte gText_0827D743
- .4byte gText_0827D764
- .4byte gText_0827D785
- .4byte gText_0827D7A5
- .4byte gText_0827D7C8
- .4byte gText_0827D7E8
- .4byte gText_0827D831
- .4byte gText_0827D855
- .4byte gText_0827D830
- .4byte gText_0827D872
- .4byte gText_0827D88F
- .4byte gText_0827D8B5
- .4byte gText_0827D8E4
- .4byte gText_0827D8FE
- .4byte gText_0827D926
- .4byte gText_0827D947
- .4byte gText_0827D961
- .4byte gText_0827D986
- .4byte gText_0827D9B1
- .4byte gText_0827D9D9
- .4byte gText_0827DA03
- .4byte gText_0827DA31
- .4byte gText_0827DA5B
- .4byte gText_0827DA85
- .4byte gText_0827DAB2
- .4byte gText_0827DADA
- .4byte gText_0827DB03
- .4byte gText_0827D830
- .4byte gText_0827D830
- .4byte gText_0827D830
- .4byte gText_0827DB1F
- .4byte gText_0827DB4E
-
- .align 2
-gUnknown_08587E10:: @ 8587E10
- .4byte gText_827DB75
- .4byte gText_827DBB0
- .4byte gText_827DBE0
- .4byte gText_827DC0F
- .4byte gText_827DC45
- .4byte gText_827DC7C
- .4byte gText_827DCB4
- .4byte gText_827DCE7
- .4byte gText_827DD12
- .4byte gText_827DD3D
- .4byte gText_827DD6F
- .4byte gText_827DD8E
- .4byte gText_827DDC7
- .4byte gText_827DDF2
- .4byte gText_827DE14
- .4byte gText_827DE44
- .4byte gText_827DE73
- .4byte gText_827DEA5
- .4byte gText_827DED9
- .4byte gText_827DF02
- .4byte gText_827DF3A
- .4byte gText_827DF63
- .4byte gText_827DF8C
- .4byte gText_827DFB8
- .4byte gText_827DFE2
- .4byte gText_827E00C
- .4byte gText_827E02F
- .4byte gText_827E05F
- .4byte gText_827E08B
- .4byte gText_827E0B5
- .4byte gText_827E0DD
- .4byte gText_827E107
- .4byte gText_827E143
- .4byte gText_827E17F
- .4byte gText_827E1BB
- .4byte gText_827E1F3
- .4byte gText_827E220
- .4byte gText_827E254
- .4byte gText_827E289
- .4byte gText_827E2C5
- .4byte gText_0827E2FE
- .4byte gText_0827E32E
- .4byte gText_0827E35B
- .4byte gText_0827E38D
- .4byte gText_0827E3C1
- .4byte gText_0827E3EB
- .4byte gText_0827E416
- .4byte gText_0827E448
- .4byte gText_0827E473
- .4byte gText_0827E4A6
- .4byte gText_0827E4D5
- .4byte gText_0827E504
- .4byte gText_0827E531
- .4byte gText_0827E55A
- .4byte gText_0827E5B2
- .4byte gText_0827E5D0
- .4byte gText_0827E606
- .4byte gText_0827E638
- .4byte gText_0827E658
- .4byte gText_0827E68B
- .4byte gText_0827E6C4
- .4byte gText_0827E7BA
-
- .align 2
-gUnknown_08587F08:: @ 8587F08
- .4byte gText_0827E85F
- .4byte gText_0827E868
- .4byte gText_0827E86F
- .4byte gText_0827E878
- .4byte gText_0827E882
-
- .align 2
-gUnknown_08587F1C:: @ 8587F1C
- .4byte gText_0827E894
- .4byte gText_0827E89E
- .4byte gText_0827E8AA
- .4byte gText_0827E8B4
- .4byte gText_0827E8BF
- .4byte gText_0827E8CA
-
- .align 2
-gUnknown_08587F34:: @ 8587F34
- .4byte 0x00000580, 0x000015e9, 0x000005c2, 0x000031a3
-
- .align 2
-gUnknown_08587F44:: @ 8587F44
- window_template 0x00, 0x12, 0x00, 0x0c, 0x02, 0x0f, 0x0200
- window_template 0x00, 0x12, 0x05, 0x0c, 0x02, 0x0f, 0x0218
- window_template 0x00, 0x12, 0x0a, 0x0c, 0x02, 0x0f, 0x0230
- window_template 0x00, 0x12, 0x0f, 0x0c, 0x02, 0x0f, 0x0248
- window_template 0x00, 0x01, 0x0f, 0x11, 0x04, 0x0f, 0x0260
- window_template 0x00, 0x01, 0x1f, 0x09, 0x02, 0x0f, 0x02a4
- window_template 0x00, 0x01, 0x21, 0x09, 0x02, 0x0f, 0x02b6
- window_template 0x00, 0x01, 0x23, 0x09, 0x02, 0x0f, 0x02c8
- window_template 0x00, 0x01, 0x25, 0x09, 0x02, 0x0f, 0x02da
- window_template 0x00, 0x10, 0x1f, 0x01, 0x02, 0x0f, 0x02ec
- window_template 0x00, 0x0b, 0x23, 0x12, 0x04, 0x0f, 0x02ee
- null_window_template
-
- .align 2
-gUnknown_08587FA4:: @ 8587FA4
- .4byte NULL, 0xFFFF
- .2byte SPECIES_ELECTRIKE
- .byte 2
- .string "ELECTER$", 11
- .string "EZRA$", 8
- .2byte 0
- .4byte NULL, 0xFFFF
- .2byte SPECIES_TROPIUS
- .byte 0
- .string "TROPO$", 11
- .string "ALLAN$", 8
- .2byte 2
- .4byte NULL, 0xFFFF
- .2byte SPECIES_XATU
- .byte 1
- .string "TUXA$", 11
- .string "JULIET$", 8
- .2byte 0
- .4byte NULL, 0xFFFF
- .2byte SPECIES_PLUSLE
- .byte 4
- .string "PULSE$", 11
- .string "BAILY$", 8
- .2byte 3
- .4byte NULL, 0xFFFF
- .2byte SPECIES_SHUPPET
- .byte 3
- .string "SHUPUP$", 11
- .string "MELANY$", 8
- .2byte 1
- .4byte NULL, 0xFFFF
- .2byte SPECIES_ZANGOOSE
- .byte 0
- .string "GOOZAN$", 11
- .string "HANA$", 8
- .2byte 2
- .4byte NULL, 0xFFFF
- .2byte SPECIES_LOUDRED
- .byte 1
- .string "LOUDED$", 11
- .string "BRYANT$", 8
- .2byte 2
- .4byte NULL, 0xFFFF
- .2byte SPECIES_DELCATTY
- .byte 2
- .string "KITSY$", 11
- .string "OMAR$", 8
- .2byte 3
-
-
- .align 2
-gContestOpponents:: @ 85880A4
- .include "data/contest_opponents.inc"
-
-gUnknown_085898A4:: @ 85898A4
- .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02
- .byte 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02
-
- .align 2
-gUnknown_08589904:: @ 8589904
- obj_tiles gBlankGfxCompressed, 0x1000, 0x80e8
- obj_tiles gBlankGfxCompressed, 0x1000, 0x80e9
- obj_tiles gBlankGfxCompressed, 0x1000, 0x80ea
- obj_tiles gBlankGfxCompressed, 0x1000, 0x80eb
-
- .align 2
-gUnknown_08589924:: @ 8589924 Yup this is super dangerous but that's how it is here
- obj_pal gHeap + 0x1A0A4, 0x80e8
- obj_pal gHeap + 0x1A0C4, 0x80e9
- obj_pal gHeap + 0x1A0E4, 0x80ea
- obj_pal gHeap + 0x1A104, 0x80eb
-
- .align 2
-gOamData_8589944:: @ 8589944
- .2byte 0x0700
- .2byte 0xC000
- .2byte 0x0000
-
- .align 2
-gSpriteAffineAnim_858994C:: @ 858994C
- obj_rot_scal_anim_frame 0x100, 0x100, 0, 0
- obj_rot_scal_anim_end
-
- .align 2
-gSpriteAffineAnim_858995C:: @ 858995C
- obj_rot_scal_anim_frame 0x3, 0x3, 0, 15
- obj_rot_scal_anim_frame 0xFFFD, 0xFFFD, 0, 15
- obj_rot_scal_anim_frame 0x3, 0x3, 0, 15
- obj_rot_scal_anim_frame 0xFFFD, 0xFFFD, 0, 15
- obj_rot_scal_anim_end
-
- .align 2
-gSpriteAffineAnimTable_8589984:: @ 8589984
- .4byte gSpriteAffineAnim_858994C
- .4byte gSpriteAffineAnim_858995C
-
- .align 2
-gSpriteTemplate_858998C:: @ 858998C
- spr_template 0x80e8, 0x80e8, gOamData_8589944, gDummySpriteAnimTable, NULL, gSpriteAffineAnimTable_8589984, SpriteCallbackDummy
- spr_template 0x80e9, 0x80e9, gOamData_8589944, gDummySpriteAnimTable, NULL, gSpriteAffineAnimTable_8589984, SpriteCallbackDummy
- spr_template 0x80ea, 0x80ea, gOamData_8589944, gDummySpriteAnimTable, NULL, gSpriteAffineAnimTable_8589984, SpriteCallbackDummy
- spr_template 0x80eb, 0x80eb, gOamData_8589944, gDummySpriteAnimTable, NULL, gSpriteAffineAnimTable_8589984, SpriteCallbackDummy
-
- .align 2
-gContestExcitementTable:: @ 85899EC
- .2byte 0x0001, 0xffff, 0x0000, 0x0001, 0xffff, 0x00ff, 0x0001, 0xffff, 0x00ff, 0x0001, 0xff00, 0x00ff, 0x0001, 0x0000
-
-
diff --git a/data/contest_opponents.inc b/data/contest_opponents.inc
deleted file mode 100644
index 9246bac21..000000000
--- a/data/contest_opponents.inc
+++ /dev/null
@@ -1,2114 +0,0 @@
-@todo: cleanup
- .2byte SPECIES_POOCHYENA
- .string "POOCHY$ "
- .string "JIMMY$ "
- .byte 7
- .2byte 0
- .4byte 0xc000fff
- .2byte 68
- .2byte 46
- .2byte 44
- .2byte 36
- .2byte 336
- .byte 10
- .byte 4
- .byte 10
- .byte 3
- .byte 4
- .byte 50
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_ILLUMISE
- .string "MUSILLE$ "
- .string "EDITH$ "
- .byte 8
- .2byte 0
- .4byte 0x82000fff
- .2byte 16
- .2byte 156
- .2byte 263
- .2byte 33
- .2byte 343
- .byte 10
- .byte 10
- .byte 6
- .byte 1
- .byte 2
- .byte 60
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_DUSTOX
- .string "DUSTER$ "
- .string "EVAN$ "
- .byte 11
- .2byte 0
- .4byte 0x21000fff
- .2byte 8
- .2byte 318
- .2byte 236
- .2byte 113
- .2byte 16
- .byte 2
- .byte 10
- .byte 10
- .byte 12
- .byte 4
- .byte 70
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_SEEDOT
- .string "DOTS$ "
- .string "KELSEY$ "
- .byte 16
- .2byte 0
- .4byte 0x20800fff
- .2byte 96
- .2byte 117
- .2byte 235
- .2byte 331
- .2byte 74
- .byte 3
- .byte 3
- .byte 5
- .byte 2
- .byte 7
- .byte 80
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_TAILLOW
- .string "TATAY$ "
- .string "MADISON$"
- .byte 18
- .2byte 0
- .4byte 0x80400fff
- .2byte 4
- .2byte 17
- .2byte 97
- .2byte 332
- .2byte 45
- .byte 1
- .byte 3
- .byte 3
- .byte 5
- .byte 4
- .byte 90
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_NINCADA
- .string "NINDA$ "
- .string "RAYMOND$"
- .byte 44
- .2byte 0
- .4byte 0x10200fff
- .2byte 32
- .2byte 141
- .2byte 206
- .2byte 154
- .2byte 170
- .byte 5
- .byte 2
- .byte 10
- .byte 7
- .byte 8
- .byte 100
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_SHROOMISH
- .string "SMISH$ "
- .string "GRANT$ "
- .byte 35
- .2byte 0
- .4byte 0x20100fff
- .2byte 32
- .2byte 78
- .2byte 73
- .2byte 72
- .2byte 213
- .byte 3
- .byte 3
- .byte 10
- .byte 2
- .byte 2
- .byte 50
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_SPHEAL
- .string "SLEAL$ "
- .string "PAIGE$ "
- .byte 26
- .2byte 0
- .4byte 0x8080fff
- .2byte 24
- .2byte 62
- .2byte 55
- .2byte 45
- .2byte 317
- .byte 3
- .byte 5
- .byte 1
- .byte 10
- .byte 10
- .byte 60
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_SLAKOTH
- .string "SLOKTH$ "
- .string "ALEC$ "
- .byte 31
- .2byte 0
- .4byte 0x40040fff
- .2byte 88
- .2byte 70
- .2byte 68
- .2byte 281
- .2byte 227
- .byte 10
- .byte 4
- .byte 4
- .byte 5
- .byte 18
- .byte 70
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_WHISMUR
- .string "WHIRIS$ "
- .string "SYDNEY$ "
- .byte 47
- .2byte 0
- .4byte 0x80020fff
- .2byte 36
- .2byte 310
- .2byte 103
- .2byte 253
- .2byte 304
- .byte 2
- .byte 2
- .byte 7
- .byte 2
- .byte 7
- .byte 80
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_MAKUHITA
- .string "MAHITA$ "
- .string "MORRIS$ "
- .byte 38
- .2byte 0
- .4byte 0x8010fff
- .2byte 68
- .2byte 69
- .2byte 233
- .2byte 33
- .2byte 179
- .byte 9
- .byte 1
- .byte 1
- .byte 8
- .byte 1
- .byte 90
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_ARON
- .string "RONAR$ "
- .string "MARIAH$ "
- .byte 10
- .2byte 0
- .4byte 0x8008fff
- .2byte 68
- .2byte 232
- .2byte 334
- .2byte 29
- .2byte 36
- .byte 5
- .byte 10
- .byte 2
- .byte 10
- .byte 2
- .byte 100
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_CROBAT
- .string "BATRO$ "
- .string "RUSSELL$"
- .byte 33
- .2byte 0
- .4byte 0x90004fff
- .2byte 56
- .2byte 114
- .2byte 212
- .2byte 109
- .2byte 141
- .byte 4
- .byte 2
- .byte 2
- .byte 2
- .byte 10
- .byte 50
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_GULPIN
- .string "GULIN$ "
- .string "MELANIE$"
- .byte 6
- .2byte 0
- .4byte 0x40002fff
- .2byte 16
- .2byte 124
- .2byte 133
- .2byte 92
- .2byte 281
- .byte 1
- .byte 10
- .byte 1
- .byte 10
- .byte 5
- .byte 60
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_MANECTRIC
- .string "RIKELEC$ "
- .string "CHANCE$ "
- .byte 15
- .2byte 0
- .4byte 0x80001fff
- .2byte 12
- .2byte 209
- .2byte 86
- .2byte 87
- .2byte 46
- .byte 20
- .byte 10
- .byte 1
- .byte 1
- .byte 1
- .byte 70
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_BULBASAUR
- .string "BULBY$ "
- .string "AGATHA$ "
- .byte 20
- .2byte 0
- .4byte 0xc000fff
- .2byte 48
- .2byte 45
- .2byte 73
- .2byte 33
- .2byte 230
- .byte 5
- .byte 3
- .byte 10
- .byte 10
- .byte 4
- .byte 50
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_BUTTERFREE
- .string "FUTTERBE$ "
- .string "BEAU$ "
- .byte 40
- .2byte 0
- .4byte 0x82000fff
- .2byte 40
- .2byte 48
- .2byte 18
- .2byte 318
- .2byte 219
- .byte 3
- .byte 10
- .byte 2
- .byte 10
- .byte 4
- .byte 60
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_PIDGEOTTO
- .string "PIDEOT$ "
- .string "KAY$ "
- .byte 34
- .2byte 0
- .4byte 0x21000fff
- .2byte 12
- .2byte 119
- .2byte 98
- .2byte 332
- .2byte 297
- .byte 10
- .byte 8
- .byte 4
- .byte 2
- .byte 3
- .byte 70
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_DIGLETT
- .string "DIGLE$ "
- .string "CALE$ "
- .byte 55
- .2byte 0
- .4byte 0x20800fff
- .2byte 96
- .2byte 91
- .2byte 89
- .2byte 90
- .2byte 222
- .byte 4
- .byte 2
- .byte 3
- .byte 5
- .byte 10
- .byte 80
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_POLIWAG
- .string "WAGIL$ "
- .string "CAITLIN$"
- .byte 53
- .2byte 0
- .4byte 0x80400fff
- .2byte 72
- .2byte 56
- .2byte 240
- .2byte 34
- .2byte 58
- .byte 2
- .byte 10
- .byte 5
- .byte 3
- .byte 10
- .byte 90
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_TOTODILE
- .string "TOTDIL$ "
- .string "COLBY$ "
- .byte 5
- .2byte 0
- .4byte 0x10200fff
- .2byte 12
- .2byte 99
- .2byte 103
- .2byte 57
- .2byte 59
- .byte 6
- .byte 10
- .byte 2
- .byte 1
- .byte 5
- .byte 100
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_LEDYBA
- .string "BALEDY$ "
- .string "KYLIE$ "
- .byte 45
- .2byte 0
- .4byte 0x20100fff
- .2byte 20
- .2byte 226
- .2byte 97
- .2byte 129
- .2byte 213
- .byte 8
- .byte 6
- .byte 8
- .byte 6
- .byte 2
- .byte 90
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_DELIBIRD
- .string "BIRDLY$ "
- .string "LIAM$ "
- .byte 66
- .2byte 0
- .4byte 0x8080fff
- .2byte 112
- .2byte 217
- .2byte 263
- .2byte 264
- .2byte 216
- .byte 4
- .byte 3
- .byte 10
- .byte 5
- .byte 3
- .byte 80
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_LARVITAR
- .string "TARVITAR$ "
- .string "MILO$ "
- .byte 39
- .2byte 0
- .4byte 0x40040fff
- .2byte 64
- .2byte 37
- .2byte 259
- .2byte 242
- .2byte 91
- .byte 8
- .byte 5
- .byte 5
- .byte 8
- .byte 10
- .byte 70
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_ROSELIA
- .string "RELIA$ "
- .string "KARINA$ "
- .byte 32
- .2byte 0
- .4byte 0x24000fff
- .2byte 41
- .2byte 80
- .2byte 345
- .2byte 320
- .2byte 275
- .byte 50
- .byte 15
- .byte 75
- .byte 10
- .byte 20
- .byte 100
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_DODRIO
- .string "DUODO$ "
- .string "BOBBY$ "
- .byte 51
- .2byte 0
- .4byte 0x82000fff
- .2byte 125
- .2byte 64
- .2byte 31
- .2byte 216
- .2byte 45
- .byte 15
- .byte 21
- .byte 15
- .byte 85
- .byte 35
- .byte 110
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_TRAPINCH
- .string "PINCHIN$ "
- .string "CLAIRE$ "
- .byte 8
- .2byte 0
- .4byte 0x81000fff
- .2byte 113
- .2byte 44
- .2byte 28
- .2byte 91
- .2byte 185
- .byte 75
- .byte 25
- .byte 25
- .byte 10
- .byte 25
- .byte 120
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_CACNEA
- .string "NACAC$ "
- .string "WILLIE$ "
- .byte 11
- .2byte 0
- .4byte 0x80800fff
- .2byte 37
- .2byte 191
- .2byte 43
- .2byte 40
- .2byte 28
- .byte 10
- .byte 30
- .byte 25
- .byte 65
- .byte 25
- .byte 130
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_SANDSLASH
- .string "SHRAND$ "
- .string "CASSIDY$"
- .byte 18
- .2byte 0
- .4byte 0x10400fff
- .2byte 69
- .2byte 163
- .2byte 111
- .2byte 129
- .2byte 154
- .byte 30
- .byte 90
- .byte 30
- .byte 10
- .byte 100
- .byte 140
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_BALTOY
- .string "TOYBAL$ "
- .string "MORGAN$ "
- .byte 44
- .2byte 0
- .4byte 0x8200fff
- .2byte 41
- .2byte 120
- .2byte 317
- .2byte 60
- .2byte 93
- .byte 50
- .byte 40
- .byte 10
- .byte 35
- .byte 35
- .byte 150
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_MEDICHAM
- .string "CHAMCHAM$ "
- .string "SUMMER$ "
- .byte 26
- .2byte 0
- .4byte 0x10100fff
- .2byte 77
- .2byte 179
- .2byte 9
- .2byte 7
- .2byte 8
- .byte 40
- .byte 20
- .byte 40
- .byte 40
- .byte 40
- .byte 100
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_SPINDA
- .string "SPININ$ "
- .string "MILES$ "
- .byte 31
- .2byte 0
- .4byte 0x80080fff
- .2byte 49
- .2byte 298
- .2byte 244
- .2byte 95
- .2byte 253
- .byte 25
- .byte 75
- .byte 25
- .byte 10
- .byte 25
- .byte 110
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_SWABLU
- .string "SWABY$ "
- .string "AUDREY$ "
- .byte 47
- .2byte 0
- .4byte 0xa0040fff
- .2byte 41
- .2byte 119
- .2byte 195
- .2byte 219
- .2byte 54
- .byte 30
- .byte 30
- .byte 40
- .byte 30
- .byte 25
- .byte 120
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_SPOINK
- .string "POINKER$ "
- .string "AVERY$ "
- .byte 38
- .2byte 0
- .4byte 0x80020fff
- .2byte 49
- .2byte 150
- .2byte 109
- .2byte 173
- .2byte 156
- .byte 40
- .byte 10
- .byte 30
- .byte 40
- .byte 30
- .byte 130
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_KECLEON
- .string "KECON$ "
- .string "ARIANA$ "
- .byte 10
- .2byte 0
- .4byte 0x80010fff
- .2byte 97
- .2byte 168
- .2byte 103
- .2byte 246
- .2byte 20
- .byte 10
- .byte 10
- .byte 40
- .byte 75
- .byte 35
- .byte 140
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_GOLDEEN
- .string "GOLDEN$ "
- .string "ASHTON$ "
- .byte 33
- .2byte 0
- .4byte 0x80008fff
- .2byte 13
- .2byte 30
- .2byte 31
- .2byte 32
- .2byte 39
- .byte 70
- .byte 30
- .byte 5
- .byte 30
- .byte 25
- .byte 150
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_BARBOACH
- .string "BOBOACH$ "
- .string "SANDRA$ "
- .byte 6
- .2byte 0
- .4byte 0x80004fff
- .2byte 113
- .2byte 300
- .2byte 346
- .2byte 89
- .2byte 248
- .byte 45
- .byte 45
- .byte 60
- .byte 25
- .byte 15
- .byte 100
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_SKARMORY
- .string "CORPY$ "
- .string "CARSON$ "
- .byte 35
- .2byte 0
- .4byte 0x8002fff
- .2byte 77
- .2byte 129
- .2byte 104
- .2byte 97
- .2byte 15
- .byte 40
- .byte 30
- .byte 25
- .byte 60
- .byte 20
- .byte 110
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_LOTAD
- .string "TADO$ "
- .string "KATRINA$"
- .byte 16
- .2byte 0
- .4byte 0x8001fff
- .2byte 57
- .2byte 310
- .2byte 45
- .2byte 240
- .2byte 352
- .byte 15
- .byte 15
- .byte 30
- .byte 15
- .byte 75
- .byte 120
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_SLOWBRO
- .string "BROWLO$ "
- .string "LUKE$ "
- .byte 17
- .2byte 0
- .4byte 0xc000fff
- .2byte 49
- .2byte 281
- .2byte 50
- .2byte 45
- .2byte 93
- .byte 20
- .byte 40
- .byte 40
- .byte 30
- .byte 20
- .byte 100
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_FARFETCHD
- .string "FETCHIN$ "
- .string "RAUL$ "
- .byte 66
- .2byte 0
- .4byte 0x82000fff
- .2byte 21
- .2byte 263
- .2byte 210
- .2byte 19
- .2byte 216
- .byte 40
- .byte 10
- .byte 40
- .byte 20
- .byte 20
- .byte 110
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_SEEL
- .string "SEELEY$ "
- .string "JADA$ "
- .byte 20
- .2byte 0
- .4byte 0x21000fff
- .2byte 25
- .2byte 213
- .2byte 58
- .2byte 219
- .2byte 45
- .byte 10
- .byte 30
- .byte 40
- .byte 20
- .byte 20
- .byte 120
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_DROWZEE
- .string "DROWZIN$ "
- .string "ZEEK$ "
- .byte 37
- .2byte 0
- .4byte 0x20800fff
- .2byte 121
- .2byte 50
- .2byte 248
- .2byte 237
- .2byte 216
- .byte 10
- .byte 40
- .byte 50
- .byte 30
- .byte 45
- .byte 130
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_HITMONCHAN
- .string "HITEMON$ "
- .string "DIEGO$ "
- .byte 21
- .2byte 0
- .4byte 0x80400fff
- .2byte 69
- .2byte 327
- .2byte 197
- .2byte 279
- .2byte 5
- .byte 45
- .byte 20
- .byte 10
- .byte 20
- .byte 45
- .byte 140
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_BLISSEY
- .string "BLISS$ "
- .string "ALIYAH$ "
- .byte 85
- .2byte 0
- .4byte 0x10200fff
- .2byte 89
- .2byte 47
- .2byte 135
- .2byte 121
- .2byte 38
- .byte 20
- .byte 35
- .byte 40
- .byte 20
- .byte 20
- .byte 150
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_ELEKID
- .string "KIDLEK$ "
- .string "NATALIA$"
- .byte 18
- .2byte 0
- .4byte 0x20100fff
- .2byte 21
- .2byte 351
- .2byte 98
- .2byte 103
- .2byte 213
- .byte 40
- .byte 10
- .byte 40
- .byte 25
- .byte 25
- .byte 140
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_SNUBBULL
- .string "SNUBBINS$ "
- .string "DEVIN$ "
- .byte 48
- .2byte 0
- .4byte 0x8080fff
- .2byte 81
- .2byte 184
- .2byte 269
- .2byte 39
- .2byte 44
- .byte 20
- .byte 20
- .byte 20
- .byte 20
- .byte 20
- .byte 130
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_MISDREAVUS
- .string "DREAVIS$ "
- .string "TYLOR$ "
- .byte 40
- .2byte 0
- .4byte 0x40040fff
- .2byte 41
- .2byte 195
- .2byte 212
- .2byte 109
- .2byte 220
- .byte 10
- .byte 35
- .byte 10
- .byte 45
- .byte 20
- .byte 120
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_LAIRON
- .string "LAIRN$ "
- .string "RONNIE$ "
- .byte 55
- .2byte 0
- .4byte 0x84000fff
- .2byte 98
- .2byte 319
- .2byte 232
- .2byte 106
- .2byte 36
- .byte 30
- .byte 50
- .byte 35
- .byte 100
- .byte 90
- .byte 200
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_SHIFTRY
- .string "SHIFTY$ "
- .string "CLAUDIA$"
- .byte 8
- .2byte 0
- .4byte 0x82000fff
- .2byte 14
- .2byte 74
- .2byte 13
- .2byte 153
- .2byte 326
- .byte 75
- .byte 75
- .byte 65
- .byte 35
- .byte 70
- .byte 210
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_NINJASK
- .string "NINAS$ "
- .string "ELIAS$ "
- .byte 11
- .2byte 0
- .4byte 0x81000fff
- .2byte 114
- .2byte 103
- .2byte 154
- .2byte 28
- .2byte 226
- .byte 30
- .byte 50
- .byte 95
- .byte 70
- .byte 70
- .byte 220
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_SWELLOW
- .string "WELOW$ "
- .string "JADE$ "
- .byte 18
- .2byte 0
- .4byte 0x80800fff
- .2byte 14
- .2byte 97
- .2byte 332
- .2byte 17
- .2byte 19
- .byte 65
- .byte 85
- .byte 35
- .byte 75
- .byte 40
- .byte 230
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_MIGHTYENA
- .string "YENA$ "
- .string "FRANCIS$"
- .byte 44
- .2byte 0
- .4byte 0x80400fff
- .2byte 98
- .2byte 269
- .2byte 168
- .2byte 316
- .2byte 36
- .byte 40
- .byte 80
- .byte 35
- .byte 70
- .byte 70
- .byte 240
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_BEAUTIFLY
- .string "TIFLY$ "
- .string "ALISHA$ "
- .byte 26
- .2byte 0
- .4byte 0x80200fff
- .2byte 42
- .2byte 234
- .2byte 318
- .2byte 78
- .2byte 290
- .byte 40
- .byte 70
- .byte 25
- .byte 80
- .byte 100
- .byte 250
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_SEAKING
- .string "KINGSEA$ "
- .string "SAUL$ "
- .byte 31
- .2byte 0
- .4byte 0x80100fff
- .2byte 118
- .2byte 175
- .2byte 48
- .2byte 30
- .2byte 31
- .byte 80
- .byte 60
- .byte 30
- .byte 70
- .byte 90
- .byte 200
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_CASTFORM
- .string "CASTER$ "
- .string "FELICIA$"
- .byte 47
- .2byte 0
- .4byte 0x80080fff
- .2byte 126
- .2byte 241
- .2byte 311
- .2byte 201
- .2byte 216
- .byte 70
- .byte 80
- .byte 80
- .byte 50
- .byte 65
- .byte 210
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_MACHOKE
- .string "CHOKEM$ "
- .string "EMILIO$ "
- .byte 38
- .2byte 0
- .4byte 0x80040fff
- .2byte 70
- .2byte 69
- .2byte 116
- .2byte 2
- .2byte 184
- .byte 70
- .byte 85
- .byte 25
- .byte 60
- .byte 50
- .byte 220
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_LOMBRE
- .string "LOMBE$ "
- .string "KARLA$ "
- .byte 10
- .2byte 0
- .4byte 0x80020fff
- .2byte 58
- .2byte 213
- .2byte 148
- .2byte 253
- .2byte 45
- .byte 40
- .byte 60
- .byte 90
- .byte 45
- .byte 70
- .byte 230
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_SEVIPER
- .string "VIPES$ "
- .string "DARRYL$ "
- .byte 33
- .2byte 0
- .4byte 0x80010fff
- .2byte 98
- .2byte 305
- .2byte 137
- .2byte 35
- .2byte 103
- .byte 35
- .byte 50
- .byte 90
- .byte 40
- .byte 100
- .byte 240
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_WAILMER
- .string "MERAIL$ "
- .string "SELENA$ "
- .byte 22
- .2byte 0
- .4byte 0x80008fff
- .2byte 26
- .2byte 352
- .2byte 156
- .2byte 323
- .2byte 150
- .byte 30
- .byte 100
- .byte 100
- .byte 50
- .byte 30
- .byte 250
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_MAGIKARP
- .string "KARPAG$ "
- .string "NOEL$ "
- .byte 35
- .2byte 0
- .4byte 0x80004fff
- .2byte 82
- .2byte 33
- .2byte 150
- .2byte 175
- .2byte 33
- .byte 30
- .byte 30
- .byte 160
- .byte 50
- .byte 160
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_LUNATONE
- .string "LUNONE$ "
- .string "LACEY$ "
- .byte 16
- .2byte 0
- .4byte 0x80002fff
- .2byte 42
- .2byte 153
- .2byte 248
- .2byte 94
- .2byte 93
- .byte 50
- .byte 70
- .byte 60
- .byte 70
- .byte 50
- .byte 210
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_ABSOL
- .string "ABSO$ "
- .string "CORBIN$ "
- .byte 39
- .2byte 0
- .4byte 0x80001fff
- .2byte 14
- .2byte 195
- .2byte 258
- .2byte 63
- .2byte 163
- .byte 95
- .byte 80
- .byte 85
- .byte 35
- .byte 35
- .byte 220
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_EXEGGUTOR
- .string "EGGSOR$ "
- .string "GRACIE$ "
- .byte 32
- .2byte 0
- .4byte 0xc000fff
- .2byte 98
- .2byte 23
- .2byte 95
- .2byte 121
- .2byte 285
- .byte 40
- .byte 50
- .byte 60
- .byte 100
- .byte 80
- .byte 200
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_CUBONE
- .string "CUBIN$ "
- .string "COLTIN$ "
- .byte 65
- .2byte 0
- .4byte 0x82000fff
- .2byte 82
- .2byte 125
- .2byte 155
- .2byte 198
- .2byte 45
- .byte 40
- .byte 35
- .byte 85
- .byte 35
- .byte 100
- .byte 210
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_HITMONLEE
- .string "HITMON$ "
- .string "ELLIE$ "
- .byte 22
- .2byte 0
- .4byte 0x21000fff
- .2byte 70
- .2byte 179
- .2byte 279
- .2byte 116
- .2byte 25
- .byte 85
- .byte 30
- .byte 25
- .byte 50
- .byte 100
- .byte 220
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_SQUIRTLE
- .string "SURTLE$ "
- .string "MARCUS$ "
- .byte 49
- .2byte 0
- .4byte 0x20800fff
- .2byte 82
- .2byte 39
- .2byte 145
- .2byte 264
- .2byte 110
- .byte 30
- .byte 35
- .byte 100
- .byte 40
- .byte 95
- .byte 230
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_KANGASKHAN
- .string "KHANKAN$ "
- .string "KIARA$ "
- .byte 14
- .2byte 0
- .4byte 0x80400fff
- .2byte 70
- .2byte 5
- .2byte 99
- .2byte 264
- .2byte 39
- .byte 100
- .byte 50
- .byte 30
- .byte 50
- .byte 100
- .byte 240
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_PINECO
- .string "PINOC$ "
- .string "BRYCE$ "
- .byte 36
- .2byte 0
- .4byte 0x10200fff
- .2byte 42
- .2byte 153
- .2byte 191
- .2byte 113
- .2byte 202
- .byte 80
- .byte 80
- .byte 80
- .byte 80
- .byte 80
- .byte 250
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_DUNSPARCE
- .string "DILTOT$ "
- .string "JAMIE$ "
- .byte 34
- .2byte 0
- .4byte 0x20100fff
- .2byte 82
- .2byte 180
- .2byte 281
- .2byte 111
- .2byte 36
- .byte 40
- .byte 35
- .byte 100
- .byte 40
- .byte 110
- .byte 240
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_HOUNDOOM
- .string "DOOMOND$ "
- .string "JORGE$ "
- .byte 48
- .2byte 0
- .4byte 0x8080fff
- .2byte 14
- .2byte 46
- .2byte 53
- .2byte 185
- .2byte 241
- .byte 100
- .byte 100
- .byte 30
- .byte 25
- .byte 80
- .byte 230
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_MILTANK
- .string "MILKAN$ "
- .string "DEVON$ "
- .byte 25
- .2byte 0
- .4byte 0x40040fff
- .2byte 26
- .2byte 208
- .2byte 215
- .2byte 111
- .2byte 59
- .byte 50
- .byte 110
- .byte 100
- .byte 35
- .byte 40
- .byte 220
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_GYARADOS
- .string "RADOS$ "
- .string "JUSTINA$"
- .byte 32
- .2byte 0
- .4byte 0x84000fff
- .2byte 79
- .2byte 63
- .2byte 56
- .2byte 240
- .2byte 44
- .byte 160
- .byte 200
- .byte 20
- .byte 40
- .byte 160
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_LOUDRED
- .string "LOUDERD$ "
- .string "RALPH$ "
- .byte 21
- .2byte 0
- .4byte 0x82000fff
- .2byte 71
- .2byte 304
- .2byte 23
- .2byte 46
- .2byte 336
- .byte 170
- .byte 50
- .byte 55
- .byte 150
- .byte 160
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_SKITTY
- .string "SITTY$ "
- .string "ROSA$ "
- .byte 8
- .2byte 0
- .4byte 0x81000fff
- .2byte 59
- .2byte 213
- .2byte 274
- .2byte 185
- .2byte 39
- .byte 40
- .byte 200
- .byte 150
- .byte 185
- .byte 60
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_SLAKING
- .string "SLING$ "
- .string "KEATON$ "
- .byte 11
- .2byte 0
- .4byte 0x80800fff
- .2byte 115
- .2byte 343
- .2byte 68
- .2byte 227
- .2byte 303
- .byte 85
- .byte 85
- .byte 170
- .byte 110
- .byte 150
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_ALTARIA
- .string "TARIA$ "
- .string "MAYRA$ "
- .byte 18
- .2byte 0
- .4byte 0x80400fff
- .2byte 15
- .2byte 349
- .2byte 63
- .2byte 195
- .2byte 219
- .byte 170
- .byte 150
- .byte 30
- .byte 30
- .byte 90
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_KIRLIA
- .string "LIRKI$ "
- .string "LAMAR$ "
- .byte 15
- .2byte 0
- .4byte 0x80200fff
- .2byte 39
- .2byte 351
- .2byte 247
- .2byte 285
- .2byte 216
- .byte 230
- .byte 60
- .byte 60
- .byte 230
- .byte 80
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_BELLOSSOM
- .string "BLOSSOM$ "
- .string "AUBREY$ "
- .byte 26
- .2byte 0
- .4byte 0x80100fff
- .2byte 59
- .2byte 80
- .2byte 230
- .2byte 78
- .2byte 148
- .byte 35
- .byte 200
- .byte 150
- .byte 130
- .byte 40
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_SABLEYE
- .string "EYESAB$ "
- .string "NIGEL$ "
- .byte 31
- .2byte 0
- .4byte 0x80080fff
- .2byte 115
- .2byte 212
- .2byte 185
- .2byte 282
- .2byte 109
- .byte 25
- .byte 35
- .byte 230
- .byte 150
- .byte 160
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_NATU
- .string "UTAN$ "
- .string "CAMILLE$"
- .byte 47
- .2byte 0
- .4byte 0x80040fff
- .2byte 115
- .2byte 101
- .2byte 248
- .2byte 109
- .2byte 94
- .byte 35
- .byte 35
- .byte 150
- .byte 130
- .byte 170
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_SHARPEDO
- .string "PEDOS$ "
- .string "DEON$ "
- .byte 38
- .2byte 0
- .4byte 0x80020fff
- .2byte 87
- .2byte 97
- .2byte 207
- .2byte 269
- .2byte 36
- .byte 140
- .byte 70
- .byte 140
- .byte 75
- .byte 100
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_LUVDISC
- .string "LUVIS$ "
- .string "JANELLE$"
- .byte 10
- .2byte 0
- .4byte 0x80010fff
- .2byte 83
- .2byte 186
- .2byte 213
- .2byte 36
- .2byte 204
- .byte 50
- .byte 100
- .byte 220
- .byte 40
- .byte 190
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_HERACROSS
- .string "HEROSS$ "
- .string "HEATH$ "
- .byte 33
- .2byte 0
- .4byte 0x80008fff
- .2byte 71
- .2byte 70
- .2byte 203
- .2byte 179
- .2byte 317
- .byte 170
- .byte 70
- .byte 110
- .byte 240
- .byte 140
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_ELECTRODE
- .string "RODLECT$ "
- .string "SASHA$ "
- .byte 6
- .2byte 0
- .4byte 0x80004fff
- .2byte 15
- .2byte 153
- .2byte 113
- .2byte 129
- .2byte 148
- .byte 200
- .byte 200
- .byte 30
- .byte 35
- .byte 50
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_PICHU
- .string "CHUPY$ "
- .string "FRANKIE$"
- .byte 35
- .2byte 0
- .4byte 0x80002fff
- .2byte 59
- .2byte 186
- .2byte 213
- .2byte 156
- .2byte 39
- .byte 25
- .byte 150
- .byte 180
- .byte 115
- .byte 120
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_WOBBUFFET
- .string "WOBET$ "
- .string "HELEN$ "
- .byte 16
- .2byte 0
- .4byte 0x80001fff
- .2byte 111
- .2byte 68
- .2byte 243
- .2byte 219
- .2byte 194
- .byte 60
- .byte 230
- .byte 50
- .byte 220
- .byte 210
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_GENGAR
- .string "GAREN$ "
- .string "CAMILE$ "
- .byte 40
- .2byte 0
- .4byte 0xc000fff
- .2byte 71
- .2byte 194
- .2byte 109
- .2byte 122
- .2byte 188
- .byte 200
- .byte 100
- .byte 50
- .byte 80
- .byte 180
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_PORYGON
- .string "GONPOR$ "
- .string "MARTIN$ "
- .byte 46
- .2byte 0
- .4byte 0x82000fff
- .2byte 127
- .2byte 176
- .2byte 160
- .2byte 216
- .2byte 278
- .byte 130
- .byte 130
- .byte 130
- .byte 130
- .byte 130
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_DRAGONITE
- .string "DRITE$ "
- .string "SERGIO$ "
- .byte 7
- .2byte 0
- .4byte 0x21000fff
- .2byte 71
- .2byte 200
- .2byte 21
- .2byte 239
- .2byte 89
- .byte 150
- .byte 140
- .byte 50
- .byte 120
- .byte 150
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_MEOWTH
- .string "MEOWY$ "
- .string "KAILEY$ "
- .byte 6
- .2byte 0
- .4byte 0x20800fff
- .2byte 51
- .2byte 45
- .2byte 269
- .2byte 6
- .2byte 44
- .byte 125
- .byte 110
- .byte 180
- .byte 170
- .byte 80
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_JYNX
- .string "NYX$ "
- .string "PERLA$ "
- .byte 45
- .2byte 0
- .4byte 0x80400fff
- .2byte 43
- .2byte 195
- .2byte 212
- .2byte 142
- .2byte 313
- .byte 100
- .byte 150
- .byte 100
- .byte 150
- .byte 120
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_TOGEPI
- .string "GEPITO$ "
- .string "CLARA$ "
- .byte 20
- .2byte 0
- .4byte 0x10200fff
- .2byte 19
- .2byte 45
- .2byte 281
- .2byte 227
- .2byte 266
- .byte 80
- .byte 120
- .byte 200
- .byte 120
- .byte 80
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_ESPEON
- .string "SPEON$ "
- .string "JAKOB$ "
- .byte 37
- .2byte 0
- .4byte 0x20100fff
- .2byte 15
- .2byte 129
- .2byte 98
- .2byte 234
- .2byte 39
- .byte 180
- .byte 150
- .byte 100
- .byte 80
- .byte 150
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_SLOWKING
- .string "SLOWGO$ "
- .string "TREY$ "
- .byte 49
- .2byte 0
- .4byte 0x8080fff
- .2byte 83
- .2byte 263
- .2byte 174
- .2byte 281
- .2byte 264
- .byte 100
- .byte 80
- .byte 200
- .byte 110
- .byte 170
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
- .2byte SPECIES_URSARING
- .string "URSING$ "
- .string "LANE$ "
- .byte 44
- .2byte 0
- .4byte 0x40040fff
- .2byte 71
- .2byte 37
- .2byte 332
- .2byte 313
- .2byte 43
- .byte 180
- .byte 140
- .byte 30
- .byte 80
- .byte 190
- .byte 255
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0x0
- .4byte 0xffff
-
diff --git a/data/maps/AbandonedShip_CaptainsOffice/map.json b/data/maps/AbandonedShip_CaptainsOffice/map.json
index c88afc806..a78d433b6 100644
--- a/data/maps/AbandonedShip_CaptainsOffice/map.json
+++ b/data/maps/AbandonedShip_CaptainsOffice/map.json
@@ -59,4 +59,4 @@
],
"coord_events": [],
"bg_events": []
-} \ No newline at end of file
+}
diff --git a/data/scripts/cable_club.inc b/data/scripts/cable_club.inc
index 1914fee4f..e0b289899 100644
--- a/data/scripts/cable_club.inc
+++ b/data/scripts/cable_club.inc
@@ -22,7 +22,7 @@ OldaleTown_PokemonCenter_2F_EventScript_276AD5:: @ 8276AD5
specialvar VAR_RESULT, sub_813B514
compare VAR_RESULT, 1
goto_if_eq OldaleTown_PokemonCenter_2F_EventScript_276AFB
- specialvar VAR_RESULT, sub_801B27C
+ specialvar VAR_RESULT, ValidateReceivedWonderCard
compare VAR_RESULT, 0
goto_if_eq OldaleTown_PokemonCenter_2F_EventScript_276AFF
goto OldaleTown_PokemonCenter_2F_EventScript_276AFB
diff --git a/data/specials.inc b/data/specials.inc
index af69b51a1..e16b2753d 100644
--- a/data/specials.inc
+++ b/data/specials.inc
@@ -434,7 +434,7 @@ gSpecials:: @ 81DBA64
def_special sub_81B8958
def_special sub_8018090
def_special sub_813990C
- def_special sub_801B27C
+ def_special ValidateReceivedWonderCard
def_special HasAtLeastOneBerry
def_special sub_802C920
def_special sub_802E3C4
diff --git a/data/text/contest_text_pointers.inc b/data/text/contest_text_pointers.inc
deleted file mode 100644
index f9cf4b70e..000000000
--- a/data/text/contest_text_pointers.inc
+++ /dev/null
@@ -1,78 +0,0 @@
- .align 2
-gContestEffectDescriptionPointers:: @ 8587C50
- .4byte gContestEffect00hDescription
- .4byte gContestEffect01hDescription
- .4byte gContestEffect02hDescription
- .4byte gContestEffect03hDescription
- .4byte gContestEffect04hDescription
- .4byte gContestEffect05hDescription
- .4byte gContestEffect06hDescription
- .4byte gContestEffect07hDescription
- .4byte gContestEffect08hDescription
- .4byte gContestEffect09hDescription
- .4byte gContestEffect0AhDescription
- .4byte gContestEffect0BhDescription
- .4byte gContestEffect0ChDescription
- .4byte gContestEffect0DhDescription
- .4byte gContestEffect0EhDescription
- .4byte gContestEffect0FhDescription
- .4byte gContestEffect10hDescription
- .4byte gContestEffect11hDescription
- .4byte gContestEffect12hDescription
- .4byte gContestEffect13hDescription
- .4byte gContestEffect14hDescription
- .4byte gContestEffect15hDescription
- .4byte gContestEffect16hDescription
- .4byte gContestEffect17hDescription
- .4byte gContestEffect18hDescription
- .4byte gContestEffect19hDescription
- .4byte gContestEffect1AhDescription
- .4byte gContestEffect1BhDescription
- .4byte gContestEffect1ChDescription
- .4byte gContestEffect1DhDescription
- .4byte gContestEffect1EhDescription
- .4byte gContestEffect1FhDescription
- .4byte gContestEffect20hDescription
- .4byte gContestEffect21hDescription
- .4byte gContestEffect22hDescription
- .4byte gContestEffect23hDescription
- .4byte gContestEffect24hDescription
- .4byte gContestEffect25hDescription
- .4byte gContestEffect26hDescription
- .4byte gContestEffect27hDescription
- .4byte gContestEffect28hDescription
- .4byte gContestEffect29hDescription
- .4byte gContestEffect2AhDescription
- .4byte gContestEffect2BhDescription
- .4byte gContestEffect2ChDescription
- .4byte gContestEffect2DhDescription
- .4byte gContestEffect2EhDescription
- .4byte gContestEffect2FhDescription
-
-@ 8587D10
-@ Unreferenced array of pointers to move names.
-@ All of the moves except Conversion are combo starters, so this may have
-@ been an early list of combo starters.
- .align 2
- .4byte gUnusedContestMoveName0
- .4byte gUnusedContestMoveName0
- .4byte gUnusedContestMoveName1
- .4byte gUnusedContestMoveName2
- .4byte gUnusedContestMoveName3
- .4byte gUnusedContestMoveName4
- .4byte gUnusedContestMoveName5
- .4byte gUnusedContestMoveName6
- .4byte gUnusedContestMoveName7
- .4byte gUnusedContestMoveName8
- .4byte gUnusedContestMoveName9
- .4byte gUnusedContestMoveName10
- .4byte gUnusedContestMoveName11
- .4byte gUnusedContestMoveName12
-
- .align 2
-gContestMoveTypeTextPointers:: @ 8587D48
- .4byte gContestMoveTypeCoolText
- .4byte gContestMoveTypeBeautyText
- .4byte gContestMoveTypeCuteText
- .4byte gContestMoveTypeSmartText
- .4byte gContestMoveTypeToughText
diff --git a/data/union_room.s b/data/union_room.s
deleted file mode 100755
index 6934f0fd8..000000000
--- a/data/union_room.s
+++ /dev/null
@@ -1,246 +0,0 @@
- .include "asm/macros.inc"
- .include "constants/constants.inc"
-
- .section .rodata
-
- .align 2
-gUnkTextboxBorderPal:: @ 82F0548
- .incbin "graphics/interface/unk_textbox_border.gbapal"
-
- .align 2
-gUnkTextboxBorderGfx:: @ 82F0568
- .incbin "graphics/interface/unk_textbox_border.4bpp.lz"
-
- .align 2
-gUnknown_082F0598:: @ 82F0598 struct BgTemplate
- .4byte 0x000000f8
- .4byte 0x000010e1
- .4byte 0x000020d2
- .4byte 0x000030c3
-
- .align 2
-gUnknown_082F05A8:: @ 82F05A8
- window_template 0x00, 0x00, 0x00, 0x1e, 0x02, 0x0c, 0x0013
- window_template 0x00, 0x01, 0x0f, 0x1c, 0x04, 0x0c, 0x004f
- window_template 0x00, 0x00, 0x0f, 0x1e, 0x05, 0x0d, 0x004f
- null_window_template
-
- .align 2
-gUnknown_082F05C8:: @ 82F05C8
- window_template 0x00, 0x01, 0x0f, 0x1c, 0x04, 0x0c, 0x00e5
-
- .align 2
-gUnknown_082F05D0:: @ 82F05D0
- window_template 0x00, 0x01, 0x0f, 0x14, 0x04, 0x0c, 0x00e5
-
- .align 2
-gUnknown_082F05D8:: @ 82F05D8
- window_template 0x00, 0x01, 0x0f, 0x13, 0x04, 0x0c, 0x00e5
-
- .align 2
-gUnknown_082F05E0:: @ 82F05E0
- window_template 0x00, 0x08, 0x06, 0x0e, 0x06, 0x0c, 0x0155
-
- .align 2
-gUnknown_082F05E8:: @ 82F05E8
- window_template 0x00, 0x17, 0x0f, 0x06, 0x04, 0x0c, 0x0155
-
- .align 2
-gUnknown_082F05F0:: @ 82F05F0
- window_template 0x00, 0x16, 0x0b, 0x07, 0x08, 0x0c, 0x0155
-
- .align 2
-gUnknown_082F05F8:: @ 82F05F8
- window_template 0x00, 0x16, 0x0d, 0x07, 0x06, 0x0c, 0x0155
-
- .align 2
-gUnknown_082F0600:: @ 82F0600
- window_template 0x00, 0x16, 0x0f, 0x07, 0x04, 0x0c, 0x0155
-
- .align 2
-gUnknown_082F0608:: @ 82F0608
- .4byte gText_WonderCards, 0x00000000
- .4byte gText_WonderNews, 0x00000001
- .4byte gText_Exit3, 0xfffffffe
-
- .align 2
-gUnknown_082F0620:: @ 82F0620
- .4byte gText_WirelessCommunication, 0x00000000
- .4byte gText_Friend2, 0x00000001
- .4byte gText_Cancel2, 0xfffffffe
-
- .align 2
-gUnknown_082F0638:: @ 82F0638 struct ListMenuTemplate
- .4byte NULL
- .4byte ListMenuDefaultCursorMoveFunc
- .4byte NULL
- .byte 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00
- .byte 0x21, 0x31, 0x00, 0x01
-
- .align 2
-gUnknown_082F0650:: @ 82F0650
- .4byte gText_Receive, 0x00000000
- .4byte gText_Send, 0x00000001
- .4byte gText_Toss, 0x00000002
- .4byte gText_Cancel2, 0xfffffffe
-
- .align 2
-gUnknown_082F0670:: @ 82F0670
- .4byte gText_Receive, 0x00000000
- .4byte gText_Toss, 0x00000002
- .4byte gText_Cancel2, 0xfffffffe
-
- .align 2
-gUnknown_082F0688:: @ 82F0688
- .4byte gText_Receive, 0x00000000
- .4byte gText_Send, 0x00000001
- .4byte gText_Cancel2, 0xfffffffe
-
- .align 2
-gUnknown_082F06A0:: @ 82F06A0
- .4byte gText_Receive, 0x00000000
- .4byte gText_Cancel2, 0xfffffffe
-
- .align 2
-gUnknown_082F06B0:: @ 82F06B0 struct ListMenuTemplate
- .4byte gUnknown_082F0650
- .4byte ListMenuDefaultCursorMoveFunc
- .4byte NULL
- .byte 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00
- .byte 0x21, 0x31, 0x00, 0x01
-
- .align 2
-gUnknown_082F06C8:: @ 82F06C8
- .4byte gUnknown_082F0670
- .4byte ListMenuDefaultCursorMoveFunc
- .4byte NULL
- .byte 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00
- .byte 0x21, 0x31, 0x00, 0x01
-
- .align 2
-gUnknown_082F06E0:: @ 82F06E0
- .4byte gUnknown_082F0688
- .4byte ListMenuDefaultCursorMoveFunc
- .4byte NULL
- .byte 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00
- .byte 0x21, 0x31, 0x00, 0x01
-
- .align 2
-gUnknown_082F06F8:: @ 82F06F8
- .4byte gUnknown_082F06A0
- .4byte ListMenuDefaultCursorMoveFunc
- .4byte NULL
- .byte 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00
- .byte 0x21, 0x31, 0x00, 0x01
-
- .align 2
- .4byte gText_VarietyOfEventsImportedWireless
- .4byte gText_WonderCardsInPossession
- .4byte gText_ReadNewsThatArrived
- .4byte gText_ReturnToTitle
-
- .align 2
-gUnknown_082F0720:: @ 82F0720
- .byte 0x00, 0x01, 0x02
-
- .align 2
- .byte 0x00, 0x01, 0x02
-
- .align 2
-gUnknown_082F0728:: @ 82F0728
- .byte 0x01, 0x02, 0x03
-
- .align 2
-gUnknown_082F072C:: @ 82F072C
- .byte 0x21, 0x2c, 0x1f, 0x23, 0x25, 0x24, 0x41, 0x42
- .byte 0x00, 0x00, 0x22, 0x28, 0x20, 0x2f, 0x2f, 0x0e
- .byte 0x14, 0x2d, 0x00, 0x00
-
- .align 2
-gUnknown_082F0740:: @ 82F0740
- .2byte 0x0004, 0x0006, 0x000d, 0x0008
- .2byte 0x000a, 0x0006, 0x0001, 0x0008
- .2byte 0x000d, 0x0004, 0x0007, 0x0004
- .2byte 0x0001, 0x0004, 0x0007, 0x0008
-
- .align 2
-gUnknown_082F0760:: @ 82F0760
- .byte 0x00, 0x00, 0x01, 0x00, 0x00, 0xff, 0xff, 0x00
- .byte 0x00, 0x01
-
-gUnknown_082F076A:: @ 82F076A
- .byte 0x00, 0x02, 0x01, 0x04, 0x03
-
-gUnknown_082F076F:: @ 82F076F
- .byte 0x01, 0x03, 0x01, 0x04, 0x02
-
-gUnknown_082F0774:: @ 82F0774
- .byte 0x09, 0x08, 0x07, 0x02, 0x06, 0x05, 0x04, 0x03
- .byte 0xbf, 0x02, 0xc0, 0x02, 0xc1, 0x02, 0xc2, 0x02
- .byte 0xc3, 0x02, 0xc4, 0x02, 0xc5, 0x02, 0xc6, 0x02
-
-gUnknown_082F078C:: @ 82F078C
- .byte 0x9c, 0xfe
-
-gUnknown_082F078E:: @ 82F078E
- .byte 0x9d, 0xfe
-
- .align 2
-gWirelessInfoScreenPal:: @ 82F0790
- .incbin "graphics/interface/wireless_info_screen.gbapal"
-
- .align 2
-gWirelessInfoScreenGfx:: @ 82F0990
- .incbin "graphics/interface/wireless_info_screen.4bpp.lz"
-
- .align 2
-gWirelessInfoScreenTilemap:: @ 82F0BA0
- .incbin "graphics/interface/wireless_info_screen.bin.lz"
-
- .align 2
-gUnknown_082F0D34:: @ 82F0D34
- .4byte 0x000001f8
- .4byte 0x00001081
-
- .align 2
-gUnknown_082F0D3C:: @ 82F0D3C
- window_template 0x00, 0x03, 0x00, 0x18, 0x03, 0x0f, 0x0001
- window_template 0x00, 0x03, 0x04, 0x15, 0x0f, 0x0f, 0x0049
- window_template 0x00, 0x18, 0x04, 0x03, 0x0f, 0x0f, 0x0184
- null_window_template
-
- .align 2
-gUnknown_082F0D5C:: @ 82F0D5C
- .4byte gText_WirelessCommStatus
- .4byte gText_PeopleTrading
- .4byte gText_PeopleBattling
- .4byte gText_PeopleInUnionRoom
- .4byte gText_PeopleCommunicating
-
- .align 2
-gUnknown_082F0D70:: @ 82F0D70
- .byte 0x01, 0x01, 0x02, 0x02, 0x01, 0x02, 0x03, 0x01
- .byte 0x04, 0x04, 0x00, 0x02, 0x06, 0x03, 0x02, 0x07
- .byte 0x03, 0x02, 0x09, 0x03, 0x00, 0x0a, 0x03, 0x00
- .byte 0x0b, 0x03, 0x00, 0x0c, 0xff, 0x00, 0x0d, 0x00
- .byte 0x00, 0x10, 0x03, 0x00, 0x0f, 0x03, 0x00, 0x40
- .byte 0x02, 0x01, 0x41, 0x02, 0x02, 0x44, 0x02, 0x02
- .byte 0x45, 0x02, 0x00, 0x48, 0x02, 0x02, 0x54, 0x02
- .byte 0x01, 0x53, 0x02, 0x02, 0x51, 0x02, 0x01, 0x52
- .byte 0x02, 0x01, 0x15, 0x03, 0x02, 0x16, 0x03, 0x02
- .byte 0x17, 0x03, 0x00, 0x18, 0x03, 0x00, 0x19, 0x03
- .byte 0x00, 0x1a, 0x03, 0x00, 0x1b, 0x03, 0x00, 0x1c
- .byte 0x01, 0x02, 0x0e, 0x01, 0x02, 0x00, 0x00, 0x00
-
- .align 2
-gUnknown_082F0DD0:: @ 82F0DD0
- .4byte 0x000001FC
-
- .align 2
-gUnknown_082F0DD4:: @ 82F0DD4
- window_template 0x00, 0x03, 0x0f, 0x18, 0x04, 0x0e, 0x0014
- null_window_template
-
- .align 2
-gUnknown_082F0DE4:: @ 82F0DE4
- .byte 0x01, 0x02, 0x03
diff --git a/include/battle_setup.h b/include/battle_setup.h
index 3b327e3f7..984c820bb 100644
--- a/include/battle_setup.h
+++ b/include/battle_setup.h
@@ -1,10 +1,10 @@
#ifndef GUARD_BATTLE_SETUP_H
#define GUARD_BATTLE_SETUP_H
+#include "gym_leader_rematch.h"
+
#define REMATCHES_COUNT 5
-#define REMATCH_TABLE_ENTRIES 78
-#define REMATCH_WALLY_ENTRY 64
-#define REMATCH_ELITE_FOUR_ENTRIES 73
+#define REMATCH_ELITE_FOUR_ENTRIES REMATCH_SIDNEY
struct RematchTrainer
{
diff --git a/include/constants/event_object_movement_constants.h b/include/constants/event_object_movement_constants.h
index 2a80f9a09..b1f9b4cb5 100755
--- a/include/constants/event_object_movement_constants.h
+++ b/include/constants/event_object_movement_constants.h
@@ -242,4 +242,6 @@
#define MOVEMENT_ACTION_FLY_UP 0x9C
#define MOVEMENT_ACTION_FLY_DOWN 0x9D
+#define MOVEMENT_ACTION_STEP_END 0xFE
+
#endif // GUARD_CONSTANTS_EVENTOBJMV_H
diff --git a/include/constants/flags.h b/include/constants/flags.h
index f28af3278..0450e988d 100644
--- a/include/constants/flags.h
+++ b/include/constants/flags.h
@@ -445,13 +445,14 @@
#define FLAG_REMATCH_NORMAN 0x1A2
#define FLAG_REMATCH_WINONA 0x1A3
#define FLAG_REMATCH_TATE_AND_LIZA 0x1A4
-#define FLAG_REMATCH_JUAN 0x1A5
-#define FLAG_REMATCH_SIDNEY 0x1A6
-#define FLAG_REMATCH_PHOEBE 0x1A7
-#define FLAG_REMATCH_GLACIA 0x1A8
-#define FLAG_REMATCH_DRAKE 0x1A9
-#define FLAG_REMATCH_WALLACE 0x1AA
-
+// Note: FLAG_REMATCH_JUAN is handled by FLAG_ENABLE_JUAN_MATCH_CALL instead.
+#define FLAG_REMATCH_SIDNEY 0x1A5
+#define FLAG_REMATCH_PHOEBE 0x1A6
+#define FLAG_REMATCH_GLACIA 0x1A7
+#define FLAG_REMATCH_DRAKE 0x1A8
+#define FLAG_REMATCH_WALLACE 0x1A9
+
+#define FLAG_UNUSED_0x1AA 0x1AA // Unused Flag
#define FLAG_UNUSED_0x1AB 0x1AB // Unused Flag
#define FLAG_DEFEATED_DEOXYS 0x1AC
diff --git a/include/constants/game_stat.h b/include/constants/game_stat.h
index 7ebf3501b..e302f1345 100644
--- a/include/constants/game_stat.h
+++ b/include/constants/game_stat.h
@@ -51,7 +51,7 @@
#define GAME_STAT_USED_DAYCARE 47
#define GAME_STAT_RODE_CABLE_CAR 48
#define GAME_STAT_ENTERED_HOT_SPRINGS 49
-#define GAME_STAT_50 50
+#define GAME_STAT_NUM_UNION_ROOM_BATTLES 50
#define GAME_STAT_51 51
#define NUM_USED_GAME_STATS 52
diff --git a/include/constants/maps.h b/include/constants/maps.h
index e1e2da992..b849749a9 100644
--- a/include/constants/maps.h
+++ b/include/constants/maps.h
@@ -9,4 +9,10 @@
#define MAP_GROUP(map) (MAP_##map >> 8)
#define MAP_NUM(map) (MAP_##map & 0xFF)
+// These groups are used by pokedex_area_screen.c to find wild
+// pokemon locations.
+#define MAP_GROUP_OVERWORLD_MONS MAP_GROUP(PETALBURG_CITY)
+#define MAP_GROUP_SPECIAL_MONS_1 MAP_GROUP(METEOR_FALLS_1F_1R)
+#define MAP_GROUP_SPECIAL_MONS_2 MAP_GROUP(SAFARI_ZONE_NORTHWEST)
+
#endif // GUARD_CONSTANTS_MAPS_H
diff --git a/include/contest.h b/include/contest.h
index 8146486cb..a0b1a6b34 100644
--- a/include/contest.h
+++ b/include/contest.h
@@ -196,19 +196,33 @@ enum
CONTEST_STRING_NONE = 255
};
+enum {
+ CONTEST_RANK_NORMAL,
+ CONTEST_RANK_SUPER,
+ CONTEST_RANK_HYPER,
+ CONTEST_RANK_MASTER,
+ CONTEST_RANK_LINK
+};
+
+enum {
+ CONTEST_FILTER_NONE,
+ CONTEST_FILTER_NO_POSTGAME,
+ CONTEST_FILTER_ONLY_POSTGAME
+};
+
struct ContestPokemon
{
/*0x00*/ u16 species;
/*0x02*/ u8 nickname[POKEMON_NAME_LENGTH + 1];
- /*0x0D*/ u8 trainerName[8];
+ /*0x0D*/ u8 trainerName[PLAYER_NAME_LENGTH + 1];
/*0x15*/ u8 trainerGfxId;
/*0x18*/ u32 flags;
- /*0x1C*/ u8 whichRank:2;
- u8 aiPool_Cool:1;
- u8 aiPool_Beauty:1;
- u8 aiPool_Cute:1;
- u8 aiPool_Smart:1;
- u8 aiPool_Tough:1;
+ /*0x1C*/ u8 whichRank:2; // 0x1 0x2
+ u8 aiPool_Cool:1; // 0x4
+ u8 aiPool_Beauty:1; // 0x8
+ u8 aiPool_Cute:1; // 0x10
+ u8 aiPool_Smart:1; // 0x20
+ u8 aiPool_Tough:1; // 0x40
/*0x1E*/ u16 moves[4]; // moves
/*0x26*/ u8 cool; // cool
/*0x27*/ u8 beauty; // beauty
@@ -219,7 +233,7 @@ struct ContestPokemon
/*0x2C*/ u8 unk2C[12];
/*0x38*/ u32 personality; // personality
/*0x3C*/ u32 otId; // otId
-}; // wow
+};
struct Shared18000
{
diff --git a/include/ereader_screen.h b/include/ereader_screen.h
index 0e3e51c76..1daea4be0 100755
--- a/include/ereader_screen.h
+++ b/include/ereader_screen.h
@@ -1,6 +1,6 @@
#ifndef GUARD_EREADER_SCREEN_H
#define GUARD_EREADER_SCREEN_H
-void sub_81D5014(void);
+void task_add_00_ereader(void);
#endif // GUARD_EREADER_SCREEN_H
diff --git a/include/event_object_movement.h b/include/event_object_movement.h
index 23a3ffa49..ab555fda0 100644
--- a/include/event_object_movement.h
+++ b/include/event_object_movement.h
@@ -413,5 +413,10 @@ u8 MovementType_RunInPlace_Step0(struct EventObject *, struct Sprite *);
u8 MovementType_Invisible_Step0(struct EventObject *, struct Sprite *);
u8 MovementType_Invisible_Step1(struct EventObject *, struct Sprite *);
u8 MovementType_Invisible_Step2(struct EventObject *, struct Sprite *);
+void sub_8097C44(u8 var, bool32 var2);
+bool32 sub_8097C8C(u8 var);
+void sub_8097BB4(u8 var1, u8 graphicsId);
+void sub_8097CC4(u8 var1, u8 var2);
+bool32 sub_8097D9C(u8 var);
#endif //GUARD_FIELD_EVENT_OBJ_H
diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h
index ca3d41546..8d87779e6 100644
--- a/include/field_player_avatar.h
+++ b/include/field_player_avatar.h
@@ -1,17 +1,6 @@
#ifndef GUARD_FIELD_PLAYER_AVATAR_H
#define GUARD_FIELD_PLAYER_AVATAR_H
-enum {
- PLAYER_AVATAR_STATE_NORMAL,
- PLAYER_AVATAR_STATE_MACH_BIKE,
- PLAYER_AVATAR_STATE_ACRO_BIKE,
- PLAYER_AVATAR_STATE_SURFING,
- PLAYER_AVATAR_STATE_UNDERWATER,
- PLAYER_AVATAR_STATE_FIELD_MOVE,
- PLAYER_AVATAR_STATE_FISHING,
- PLAYER_AVATAR_STATE_WATERING,
-};
-
void player_step(u8 a, u16 b, u16 c);
void ClearPlayerAvatarInfo(void);
void SetPlayerAvatarExtraStateTransition(u8, u8);
@@ -73,5 +62,6 @@ void sub_808D1C8(void);
bool32 sub_808D1B4(void);
bool32 sub_808D1E8(void);
void sub_808C0A8(u8 a);
+u8 player_get_pos_including_state_based_drift(s16 *x, s16 *y);
#endif // GUARD_FIELD_PLAYER_AVATAR_H
diff --git a/include/fieldmap.h b/include/fieldmap.h
index bb5b0e290..2384ed46a 100644
--- a/include/fieldmap.h
+++ b/include/fieldmap.h
@@ -50,5 +50,6 @@ void SpriteCB_HallOfFameMonitor(struct Sprite *);
// field_region_map.c
void FieldInitRegionMap(MainCallback callback);
+void sub_8088B94(int x, int y, int a2);
#endif //GUARD_FIELDMAP_H
diff --git a/include/fldeff.h b/include/fldeff.h
index e095396a4..ff6c9823f 100644
--- a/include/fldeff.h
+++ b/include/fldeff.h
@@ -10,6 +10,7 @@ void FixLongGrassMetatilesWindowTop(s16 x, s16 y);
void FixLongGrassMetatilesWindowBottom(s16 x, s16 y);
extern const struct SpritePalette gFieldEffectObjectPaletteInfo6;
+extern struct MapPosition gPlayerFacingPosition;
// groundshake
bool8 sub_81BE66C(void);
diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h
index e35d900d8..3aa44ec9a 100644
--- a/include/global.fieldmap.h
+++ b/include/global.fieldmap.h
@@ -232,14 +232,25 @@ struct EventObjectGraphicsInfo
/*0x20*/ const union AffineAnimCmd *const *affineAnims;
};
-#define PLAYER_AVATAR_FLAG_ON_FOOT (1 << 0)
-#define PLAYER_AVATAR_FLAG_MACH_BIKE (1 << 1)
-#define PLAYER_AVATAR_FLAG_ACRO_BIKE (1 << 2)
-#define PLAYER_AVATAR_FLAG_SURFING (1 << 3)
-#define PLAYER_AVATAR_FLAG_UNDERWATER (1 << 4)
-#define PLAYER_AVATAR_FLAG_5 (1 << 5)
-#define PLAYER_AVATAR_FLAG_6 (1 << 6)
-#define PLAYER_AVATAR_FLAG_DASH (1 << 7)
+enum {
+ PLAYER_AVATAR_STATE_NORMAL,
+ PLAYER_AVATAR_STATE_MACH_BIKE,
+ PLAYER_AVATAR_STATE_ACRO_BIKE,
+ PLAYER_AVATAR_STATE_SURFING,
+ PLAYER_AVATAR_STATE_UNDERWATER,
+ PLAYER_AVATAR_STATE_FIELD_MOVE,
+ PLAYER_AVATAR_STATE_FISHING,
+ PLAYER_AVATAR_STATE_WATERING,
+};
+
+#define PLAYER_AVATAR_FLAG_ON_FOOT (1 << PLAYER_AVATAR_STATE_NORMAL)
+#define PLAYER_AVATAR_FLAG_MACH_BIKE (1 << PLAYER_AVATAR_STATE_MACH_BIKE)
+#define PLAYER_AVATAR_FLAG_ACRO_BIKE (1 << PLAYER_AVATAR_STATE_ACRO_BIKE)
+#define PLAYER_AVATAR_FLAG_SURFING (1 << PLAYER_AVATAR_STATE_SURFING)
+#define PLAYER_AVATAR_FLAG_UNDERWATER (1 << PLAYER_AVATAR_STATE_UNDERWATER)
+#define PLAYER_AVATAR_FLAG_5 (1 << PLAYER_AVATAR_STATE_FIELD_MOVE)
+#define PLAYER_AVATAR_FLAG_6 (1 << PLAYER_AVATAR_STATE_FISHING)
+#define PLAYER_AVATAR_FLAG_DASH (1 << PLAYER_AVATAR_STATE_WATERING)
enum
{
diff --git a/include/graphics.h b/include/graphics.h
index e6d6ae350..2584e713e 100644
--- a/include/graphics.h
+++ b/include/graphics.h
@@ -4765,6 +4765,14 @@ extern const u32 gUnknown_08C16FA8[];
extern const u32 gUnknown_08C16E90[];
extern const u32 gUnknown_08C17170[];
extern const u32 gUnknown_08C17980[];
+extern const u32 gTiles_8C19450[];
+extern const u32 gContestNextTurnGfx[];
+extern const u16 gContestPal[];
+extern const u32 gUnknown_08C19168[];
+extern const u32 gContestApplauseGfx[];
+extern const u32 gContestJudgeGfx[];
+extern const u32 gContestJudgeSymbolsGfx[];
+extern const u32 gContest3Pal[];
extern const u32 gUnknown_08D95E00[];
extern const u32 gUnknown_08D960D0[];
diff --git a/include/gym_leader_rematch.h b/include/gym_leader_rematch.h
index ef0e5fef1..778d7a1e8 100644
--- a/include/gym_leader_rematch.h
+++ b/include/gym_leader_rematch.h
@@ -75,11 +75,17 @@ enum {
REMATCH_WINONA,
REMATCH_TATE_AND_LIZA,
REMATCH_JUAN,
+
+ // Entries below SIDNEY are considered part of REMATCH_ELITE_FOUR_ENTRIES.
REMATCH_SIDNEY,
REMATCH_PHOEBE,
REMATCH_GLACIA,
REMATCH_DRAKE,
- REMATCH_WALLACE
+ REMATCH_WALLACE,
+
+ // The total number of rematch entries. This must be the last element
+ // in the enum.
+ REMATCH_TABLE_ENTRIES
};
void UpdateGymLeaderRematch(void);
diff --git a/include/international_string_util.h b/include/international_string_util.h
index 2d5b1c871..911cd6935 100644
--- a/include/international_string_util.h
+++ b/include/international_string_util.h
@@ -12,7 +12,7 @@ int GetStringCenterAlignXOffsetWithLetterSpacing(int fontId, const u8 *str, int
int GetStringWidthDifference(int fontId, const u8 *str, int totalWidth, int letterSpacing);
int GetMaxWidthInMenuTable(const struct MenuAction *str, int arg1);
int sub_81DB3D8(const struct MenuAction *str, const u8* arg1, int arg2);
-int sub_81DB41C(const struct ListMenuTemplate *listMenu);
+int Intl_GetListMenuWidth(const struct ListMenuTemplate *listMenu);
void CopyMonCategoryText(int dexNum, u8 *dest);
u8 *sub_81DB494(u8 *str, int fontId, u8 *str2, int totalStringWidth);
void PadNameString(u8 *dest, u8 padChar);
diff --git a/include/link.h b/include/link.h
index 719b0f067..62ae7761c 100644
--- a/include/link.h
+++ b/include/link.h
@@ -200,8 +200,6 @@ extern bool8 gLinkVSyncDisabled;
extern u32 gLinkStatus;
-void c2_mystery_gift(void);
-void sub_801867C(void);
bool8 IsWirelessAdapterConnected(void);
void Task_DestroySelf(u8 taskId);
void OpenLink(void);
diff --git a/include/link_rfu.h b/include/link_rfu.h
index d8f374ff9..b8ba1a927 100644
--- a/include/link_rfu.h
+++ b/include/link_rfu.h
@@ -260,7 +260,7 @@ u32 sub_8010714(u16 a0, const u8 *a1);
void sub_8011DC0(const u8 *a0, u16 a1);
bool8 sub_800EF1C(void);
bool32 sub_800EF58(bool32 a0);
-void sub_800E084(void);
+void DestroyWirelessStatusIndicatorSprite(void);
void sub_801103C(void);
void sub_8011C5C(void);
void sub_80106D4(void);
diff --git a/include/list_menu.h b/include/list_menu.h
index a301e5b32..0a54a069a 100644
--- a/include/list_menu.h
+++ b/include/list_menu.h
@@ -98,7 +98,7 @@ struct CursorStruct
extern struct ScrollArrowsTemplate gTempScrollArrowTemplate;
extern struct ListMenuTemplate gMultiuseListMenuTemplate;
-s32 DoMysteryGiftListMenu(struct WindowTemplate *windowTemplate, struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum);
+s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum);
u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow);
u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenuWindowRect *arg1, u16 scrollOffset, u16 selectedRow);
s32 ListMenu_ProcessInput(u8 listTaskId);
diff --git a/include/main.h b/include/main.h
index 6c67fbe9f..16ac31df2 100644
--- a/include/main.h
+++ b/include/main.h
@@ -71,6 +71,6 @@ void RestoreSerialTimer3IntrHandlers(void);
void StartTimer1(void);
void SeedRngAndSetTrainerId(void);
u16 GetGeneratedTrainerIdLower(void);
-
+void sub_819789C(void);
#endif // GUARD_MAIN_H
diff --git a/include/menu.h b/include/menu.h
index b4c3cb2b5..4d55fc955 100644
--- a/include/menu.h
+++ b/include/menu.h
@@ -35,7 +35,7 @@ void SetStandardWindowBorderStyle(u8 windowId, bool8 copyToVram);
void DisplayYesNoMenuDefaultYes(void);
u32 GetPlayerTextSpeed(void);
u8 GetPlayerTextSpeedDelay(void);
-void sub_81978B0(u16 arg0);
+void Menu_LoadStdPalAt(u16 arg0);
void AddTextPrinterWithCallbackForMessage(bool8 a1, void (*callback)(struct TextPrinterTemplate *, u16));
void sub_8199DF0(u32 bg, u8 a1, int a2, int a3);
void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 left, u8 top, const u8 *color, s8 speed, const u8 *str);
@@ -69,7 +69,7 @@ u16 copy_decompressed_tile_data_to_vram(u8 bgId, const void *src, u16 size, u16
void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress);
void AddItemMenuActionTextPrinters(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineHeight, u8 itemCount, const struct MenuAction *strs, const u8 *a8);
void sub_8198DBC(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 itemCount, u8 itemCount2, const struct MenuAction *strs, const u8 *a8);
-u8 sub_8199944(u8 windowId, u8 optionWidth, u8 horizontalCount, u8 verticalCount, u8 initialCursorPos);
+u8 sub_8199944(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initialCursorPos);
u8 sub_8199134(s8, s8);
u8 GetStartMenuWindowId(void);
void sub_819A2BC(u8, u8);
@@ -91,7 +91,7 @@ void sub_8199C30(u8 bgId, u8 left, u8 top, u8 width, u8 height, u8 palette);
void sub_8199D3C(void *ptr, int delta, int width, int height, bool32 is8BPP);
void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyToVram);
void sub_8197AE8(bool8 copyToVram);
-void sub_81997AC(u8 windowId, u8 a4, u8 a6, u8 a7, const struct MenuAction *strs);
+void PrintMenuGridTable(u8 windowId, u8 optionWidth, u8 columns, u8 rows, const struct MenuAction *strs);
s8 Menu_ProcessInputGridLayout(void);
u8 InitMenuInUpperLeftCorner(u8 windowId, u8 itemCount, u8 initialCursorPos, bool8 APressMuted);
s8 Menu_ProcessInputNoWrapAround_other(void);
diff --git a/include/mevent.h b/include/mevent.h
index 7f12f3501..9c5d559bf 100755
--- a/include/mevent.h
+++ b/include/mevent.h
@@ -32,23 +32,23 @@ struct MEventStruct_Unk1442CC
};
void sub_801AFD8(void);
-struct MEventBuffer_3120_Sub *sub_801B00C(void);
+struct MEventBuffer_3120_Sub *sav1_get_mevent_buffer_0(void);
struct MEventBuffer_32E0_Sub *sav1_get_mevent_buffer_1(void);
struct MEventBuffer_3430_Sub *sav1_get_mevent_buffer_2(void);
struct MysteryEventStruct *sub_801B044(void);
u16 *sub_801B058(void);
-void sub_801B06C(void);
+void DestroyWonderNews(void);
bool32 sub_801B078(const struct MEventBuffer_3120_Sub *src);
-bool32 sub_801B0CC(void);
-bool32 sub_801B128(void);
+bool32 ValidateReceivedWonderNews(void);
+bool32 WonderNews_Test_Unk_02(void);
bool32 sub_801B1A4(const u8 *src);
-void sub_801B1E8(void);
+void DestroyWonderCard(void);
bool32 sub_801B21C(const struct MEventBuffer_32E0_Sub *data);
-bool32 sub_801B27C(void);
-bool32 sub_801B308(void);
-u16 sub_801B39C(void);
+bool32 ValidateReceivedWonderCard(void);
+bool32 WonderCard_Test_Unk_08_6(void);
+u16 GetWonderCardFlagID(void);
void sub_801B3C0(struct MEventBuffer_32E0_Sub *buffer);
-bool32 sub_801B3F8(void);
+bool32 CheckReceivedGiftFromWonderCard(void);
bool32 sub_801B508(const u16 *data);
void sub_801B580(struct MEventStruct_Unk1442CC *data, bool32 a1);
bool32 sub_801B6A0(const struct MEventStruct_Unk1442CC *data, bool32 a1);
diff --git a/include/mevent2.h b/include/mevent2.h
new file mode 100644
index 000000000..80b1fd51b
--- /dev/null
+++ b/include/mevent2.h
@@ -0,0 +1,6 @@
+#ifndef GUARD_MEVENT2_H
+#define GUARD_MEVENT2_H
+
+void sub_801B990(u32, u32);
+
+#endif //GUARD_MEVENT2_H
diff --git a/include/mevent_801BAAC.h b/include/mevent_801BAAC.h
new file mode 100644
index 000000000..547d5237b
--- /dev/null
+++ b/include/mevent_801BAAC.h
@@ -0,0 +1,16 @@
+#ifndef GUARD_MEVENT_801BAAC_H
+#define GUARD_MEVENT_801BAAC_H
+
+bool32 InitWonderCardResources(struct MEventBuffer_32E0_Sub * r5, struct MEventBuffer_3430_Sub * r6);
+bool32 InitWonderNewsResources(const struct MEventBuffer_3120_Sub * a0);
+s32 FadeToWonderCardMenu(void);
+s32 FadeToWonderNewsMenu(void);
+s32 FadeOutFromWonderCard(bool32 flag);
+void DestroyWonderCardResources(void);
+s32 FadeOutFromWonderNews(bool32 flag);
+void DestroyWonderNewsResources(void);
+u32 MENews_GetInput(u16 input);
+void MENews_AddScrollIndicatorArrowPair(void);
+void MENews_RemoveScrollIndicatorArrowPair(void);
+
+#endif //GUARD_MEVENT_801BAAC_H
diff --git a/include/mevent_news.h b/include/mevent_news.h
index 698d7148c..5fa009499 100755
--- a/include/mevent_news.h
+++ b/include/mevent_news.h
@@ -2,5 +2,6 @@
#define GUARD_MEVENT_NEWS_H
void sub_801DBC0(void);
+void GenerateRandomNews(u32 a0);
#endif //GUARD_MEVENT_NEWS_H
diff --git a/include/mevent_server.h b/include/mevent_server.h
new file mode 100644
index 000000000..d7657b270
--- /dev/null
+++ b/include/mevent_server.h
@@ -0,0 +1,8 @@
+#ifndef GUARD_MEVENT_SERVER_H
+#define GUARD_MEVENT_SERVER_H
+
+void mevent_srv_new_wcard();
+void mevent_srv_init_wnews();
+u32 mevent_srv_common_do_exec(u16 * a0);
+
+#endif //GUARD_MEVENT_SERVER_H
diff --git a/include/mevent_server_ish.h b/include/mevent_server_ish.h
new file mode 100644
index 000000000..31f98ed52
--- /dev/null
+++ b/include/mevent_server_ish.h
@@ -0,0 +1,10 @@
+#ifndef GUARD_MEVENT_SERVER_ISH_H
+#define GUARD_MEVENT_SERVER_ISH_H
+
+void mevent_srv_ish_do_init(u32 arg);
+u32 mevent_srv_ish_do_exec(u16 * a0);
+void mevent_srv_ish_inc_flag(void);
+void * mevent_srv_ish_get_buffer(void);
+void mevent_srv_ish_set_param(u32 a0);
+
+#endif //GUARD_MEVENT_SERVER_ISH_H
diff --git a/include/mystery_gift.h b/include/mystery_gift.h
new file mode 100644
index 000000000..243895a67
--- /dev/null
+++ b/include/mystery_gift.h
@@ -0,0 +1,16 @@
+#ifndef GUARD_MYSTERY_GIFT_H
+#define GUARD_MYSTERY_GIFT_H
+
+extern bool8 gGiftIsFromEReader;
+
+u16 GetMysteryGiftBaseBlock(void);
+void c2_mystery_gift_e_reader_run(void);
+void PrintMysteryGiftOrEReaderTopMenu(bool8 isJapanese, bool32 usePickOkCancel);
+void MG_DrawCheckerboardPattern(u32 bg);
+void MainCB_FreeAllBuffersAndReturnToInitTitleScreen(void);
+bool32 MG_PrintTextOnWindow1AndWaitButton(u8 *textState, const u8 *str);
+void AddTextPrinterToWindow1(const u8 *src);
+void c2_ereader(void);
+void c2_mystery_gift(void);
+
+#endif //GUARD_MYSTERY_GIFT_H
diff --git a/include/rom_8011DC0.h b/include/rom_8011DC0.h
index fa54fca66..ee7397320 100644
--- a/include/rom_8011DC0.h
+++ b/include/rom_8011DC0.h
@@ -1,175 +1,4 @@
#ifndef GUARD_rom_8011DC0_H
#define GUARD_rom_8011DC0_H
-#include "librfu.h"
-
-// Exported type declarations
-
-struct UnkStruct_Shared
-{
- struct UnkLinkRfuStruct_02022B14 field_0;
- u8 ALIGNED(4) playerName[PLAYER_NAME_LENGTH + 1];
-};
-
-struct UnkStruct_x1C
-{
- struct UnkStruct_Shared unk0;
- u8 unk18:1;
-};
-
-struct UnkStruct_x20
-{
- struct UnkStruct_Shared unk;
- u16 field_18;
- u8 field_1A_0:2;
- u8 field_1A_1:1;
- u8 field_1B;
- u8 field_1D;
- u8 field_1E;
- u8 field_1F;
-};
-
-struct UnkStruct_Main0
-{
- struct UnkStruct_x20 arr[8];
-};
-
-struct UnkStruct_Main4
-{
- struct UnkStruct_x1C arr[5];
-};
-
-struct UnkStruct_Main8
-{
- struct UnkStruct_x20 arr[5];
-};
-
-struct UnkStruct_Leader
-{
- struct UnkStruct_Main0 *field_0;
- struct UnkStruct_Main4 *field_4;
- struct UnkStruct_Main8 *field_8;
- u8 state;
- u8 textState;
- u8 field_E;
- u8 listWindowId;
- u8 field_10;
- u8 field_11;
- u8 listTaskId;
- u8 field_13;
- u8 field_14;
- u8 field_15;
- u8 field_16;
- u8 field_17;
- u8 field_18;
- u8 field_19;
- u16 field_1A;
-};
-
-struct UnkStruct_Group
-{
- struct UnkStruct_Main0 *field_0;
- struct UnkStruct_Main4 *field_4;
- u8 state;
- u8 textState;
- u8 field_A;
- u8 listWindowId;
- u8 field_C;
- u8 field_D;
- u8 listTaskId;
- u8 field_F;
- u8 field_10;
- u8 field_11;
- u8 field_12;
- u8 field_13;
- u8 field_14;
- u8 field_15;
-};
-
-struct UnkStruct_8019BA8
-{
- u8 field_0;
- u8 field_1;
- u8 field_2;
- u8 field_3;
-};
-
-struct UnkStruct_URoom
-{
- struct UnkStruct_Main0 *field_0;
- struct UnkStruct_Main4 *field_4;
- struct UnkStruct_Main0 *field_8;
- struct UnkStruct_Main4 *field_C;
- u16 field_10;
- u16 field_12;
- u8 state;
- u8 stateAfterPrint;
- u8 textState;
- u8 field_17;
- u8 field_18;
- u8 field_19;
- u8 field_1A;
- u8 field_1B;
- u8 field_1C;
- u8 field_1D;
- u8 field_1E;
- u8 field_1F;
- u8 field_20;
- u8 spriteIds[40];
- u8 field_49;
- u8 field_4A;
- u16 field_4C[6];
- u8 field_58[0x98 - 0x58];
- u16 field_98;
- u16 field_9A[3];
- struct UnkStruct_8019BA8 field_A0[8];
- u8 field_C0[12][15];
- u8 field_174[48];
- u8 field_1A4[200];
-};
-
-union UnkUnion_Main
-{
- struct UnkStruct_Leader *leader;
- struct UnkStruct_Group *group;
- struct UnkStruct_URoom *uRoom;
-};
-
-struct TradeUnkStruct
-{
- u16 field_0;
- u16 type;
- u32 playerPersonality;
- u8 field_8;
- u8 field_9;
- u16 playerSpecies;
- u16 playerLevel;
- u16 species;
- u16 level;
- u16 field_12;
- u32 personality;
-};
-
-// Exported RAM declarations
-
-extern u8 gUnknown_02022C2C;
-extern union UnkUnion_Main gUnknown_02022C30;
-extern struct UnkLinkRfuStruct_02022B14Substruct gUnknown_02022C38;
-
-extern u16 gUnknown_02022C3C;
-extern u8 gUnknown_02022C3E;
-
-// Exported ROM declarations
-
-void sub_8018438(void);
-void sub_801B990(u32, u32);
-u8 sub_8013F78(void);
-bool32 sub_802C908(u16);
-void nullsub_89(u8 taskId);
-void var_800D_set_xB(void);
-
-bool32 mevent_0814257C(u8 *textState, const u8 *str);
-void sub_8018884(const u8 *src);
-void sub_80186A4(void);
-
#endif //GUARD_rom_8011DC0_H
diff --git a/include/script_menu.h b/include/script_menu.h
index 1f4e549fe..efb51870b 100644
--- a/include/script_menu.h
+++ b/include/script_menu.h
@@ -11,7 +11,7 @@ bool8 ScriptMenu_ShowPokemonPic(u16 var1, u8 var2, u8 var3);
bool8 (*ScriptMenu_GetPicboxWaitFunc(void))(void);
int convert_pixel_width_to_tile_width(int);
u8 CreateWindowFromRect(u8, u8, u8, u8);
-void sub_80E2A78(u8);
+void ClearToTransparentAndRemoveWindow(u8);
int display_text_and_get_width(const u8*, int);
int sub_80E2D5C(int arg0, int tileWidth);
bool16 ScrSpecial_CreatePCMenu(void);
diff --git a/include/strings.h b/include/strings.h
index c762ebd45..8aa296eb1 100644
--- a/include/strings.h
+++ b/include/strings.h
@@ -2607,4 +2607,78 @@ extern const u8 gText_YayUnkF9F9[];
extern const u8 gText_ThankYou[];
extern const u8 gText_ByeBye[];
+// Mystery Gift
+extern const u8 gText_MysteryGift[];
+extern const u8 gText_PickOKCancel[];
+extern const u8 gText_PickOKExit[];
+extern const u8 gJPText_MysteryGift[];
+extern const u8 gJPText_DecideStop[];
+extern const u8 gText_WonderCards[];
+extern const u8 gText_WonderNews[];
+extern const u8 gText_Exit3[];
+extern const u8 gText_WirelessCommunication[];
+extern const u8 gText_Friend2[];
+extern const u8 gText_Cancel2[];
+extern const u8 gText_Receive[];
+extern const u8 gText_Send[];
+extern const u8 gText_Toss[];
+extern const u8 gText_VarietyOfEventsImportedWireless[];
+extern const u8 gText_WonderCardsInPossession[];
+extern const u8 gText_ReadNewsThatArrived[];
+extern const u8 gText_ReturnToTitle[];
+extern const u8 gText_WhatToDoWithCards[];
+extern const u8 gText_WhatToDoWithNews[];
+extern const u8 gText_IfThrowAwayCardEventWontHappen[];
+extern const u8 gText_OkayToDiscardNews[];
+extern const u8 gText_WonderNewsThrownAway[];
+extern const u8 gText_WonderCardThrownAway[];
+extern const u8 gText_DataWillBeSaved[];
+extern const u8 gText_SaveCompletedPressA[];
+extern const u8 gText_NothingSentOver[];
+extern const u8 gText_RecordUploadedViaWireless[];
+extern const u8 gText_WonderCardReceivedFrom[];
+extern const u8 gText_WonderCardReceived[];
+extern const u8 gText_WonderNewsReceivedFrom[];
+extern const u8 gText_WonderNewsReceived[];
+extern const u8 gText_NewStampReceived[];
+extern const u8 gText_AlreadyHadCard[];
+extern const u8 gText_AlreadyHadStamp[];
+extern const u8 gText_AlreadyHadNews[];
+extern const u8 gText_NoMoreRoomForStamps[];
+extern const u8 gText_CommunicationCanceled[];
+extern const u8 gText_CantAcceptNewsFromTrainer[];
+extern const u8 gText_CantAcceptCardFromTrainer[];
+extern const u8 gText_CommunicationError[];
+extern const u8 gText_NewTrainerReceived[];
+extern const u8 gText_RecordUploadedViaWireless[];
+extern const u8 gText_WonderCardSentTo[];
+extern const u8 gText_WonderNewsSentTo[];
+extern const u8 gText_StampSentTo[];
+extern const u8 gText_OtherTrainerHasCard[];
+extern const u8 gText_OtherTrainerHasStamp[];
+extern const u8 gText_OtherTrainerHasNews[];
+extern const u8 gText_NoMoreRoomForStamps[];
+extern const u8 gText_OtherTrainerCanceled[];
+extern const u8 gText_GiftSentTo[];
+extern const u8 gText_CantSendGiftToTrainer[];
+extern const u8 gText_DontHaveCardNewOneInput[];
+extern const u8 gText_DontHaveNewsNewOneInput[];
+extern const u8 gText_WhereShouldCardBeAccessed[];
+extern const u8 gText_WhereShouldNewsBeAccessed[];
+extern const u8 gText_Communicating[];
+extern const u8 gText_ThrowAwayWonderCard[];
+extern const u8 gText_HaventReceivedCardsGift[];
+extern const u8 gText_CommunicationCompleted[];
+extern const u8 gText_HaventReceivedGiftOkayToDiscard[];
+extern const u8 gText_SendingWonderCard[];
+extern const u8 gText_SendingWonderNews[];
+extern const u8 gText_WirelessCommStatus[];
+extern const u8 gText_PeopleTrading[];
+extern const u8 gText_PeopleBattling[];
+extern const u8 gText_PeopleInUnionRoom[];
+extern const u8 gText_PeopleCommunicating[];
+extern const u8 gText_CommStandbyAwaitingOtherPlayer[];
+extern const u8 gText_RefusedBattle[];
+extern const u8 gText_BattleWasRefused[];
+
#endif // GUARD_STRINGS_H
diff --git a/include/text_window.h b/include/text_window.h
index 53a6df2e9..501597aa2 100644
--- a/include/text_window.h
+++ b/include/text_window.h
@@ -17,8 +17,8 @@ void LoadMessageBoxGfx(u8 windowId, u16 destOffset, u8 palOffset);
void LoadUserWindowBorderGfx(u8 windowId, u16 destOffset, u8 palOffset);
void LoadWindowGfx(u8 windowId, u8 frameId, u16 destOffset, u8 palOffset);
void LoadUserWindowBorderGfx_(u8 windowId, u16 destOffset, u8 palOffset);
-void sub_8098858(u8 windowId, u16 tileNum, u8 palNum);
-void sub_80989E0(u8 windowId, u16 tileNum, u8 palNum);
+void DrawTextBorderOuter(u8 windowId, u16 tileNum, u8 palNum);
+void DrawTextBorderInner(u8 windowId, u16 tileNum, u8 palNum);
void rbox_fill_rectangle(u8 windowId);
const u16 *stdpal_get(u8 id);
const u16 *GetOverworldTextboxPalettePtr(void);
diff --git a/include/union_room.h b/include/union_room.h
index 7634e4763..538d37716 100644
--- a/include/union_room.h
+++ b/include/union_room.h
@@ -1,9 +1,172 @@
#ifndef GUARD_UNION_ROOM_H
#define GUARD_UNION_ROOM_H
-extern bool8 gUnknown_02022C60;
+#include "librfu.h"
-void sub_8018798(u8);
-void sub_80186EC(bool8, bool32);
+// Exported type declarations
+
+struct UnkStruct_Shared
+{
+ struct UnkLinkRfuStruct_02022B14 field_0;
+ u8 ALIGNED(4) playerName[PLAYER_NAME_LENGTH + 1];
+};
+
+struct UnkStruct_x1C
+{
+ struct UnkStruct_Shared unk0;
+ u8 unk18:1;
+};
+
+struct UnkStruct_x20
+{
+ struct UnkStruct_Shared unk;
+ u16 field_18;
+ u8 field_1A_0:2;
+ u8 field_1A_1:1;
+ u8 field_1B;
+ u8 field_1D;
+ u8 field_1E;
+ u8 field_1F;
+};
+
+struct UnkStruct_Main0
+{
+ struct UnkStruct_x20 arr[8];
+};
+
+struct UnkStruct_Main4
+{
+ struct UnkStruct_x1C arr[5];
+};
+
+struct UnkStruct_Main8
+{
+ struct UnkStruct_x20 arr[5];
+};
+
+struct UnkStruct_Leader
+{
+ struct UnkStruct_Main0 *field_0;
+ struct UnkStruct_Main4 *field_4;
+ struct UnkStruct_Main8 *field_8;
+ u8 state;
+ u8 textState;
+ u8 field_E;
+ u8 listWindowId;
+ u8 field_10;
+ u8 field_11;
+ u8 listTaskId;
+ u8 field_13;
+ u8 field_14;
+ u8 field_15;
+ u8 field_16;
+ u8 field_17;
+ u8 field_18;
+ u8 field_19;
+ u16 field_1A;
+};
+
+struct UnkStruct_Group
+{
+ struct UnkStruct_Main0 *field_0;
+ struct UnkStruct_Main4 *field_4;
+ u8 state;
+ u8 textState;
+ u8 field_A;
+ u8 listWindowId;
+ u8 field_C;
+ u8 field_D;
+ u8 listTaskId;
+ u8 field_F;
+ u8 field_10;
+ u8 field_11;
+ u8 field_12;
+ u8 field_13;
+ u8 field_14;
+ u8 field_15;
+};
+
+struct UnkStruct_8019BA8
+{
+ u8 field_0;
+ u8 field_1;
+ s8 field_2;
+ u8 field_3;
+};
+
+struct UnkStruct_URoom
+{
+ struct UnkStruct_Main0 *field_0;
+ struct UnkStruct_Main4 *field_4;
+ struct UnkStruct_Main0 *field_8;
+ struct UnkStruct_Main4 *field_C;
+ u16 field_10;
+ u16 field_12;
+ u8 state;
+ u8 stateAfterPrint;
+ u8 textState;
+ u8 field_17;
+ u8 field_18;
+ u8 field_19;
+ u8 field_1A;
+ u8 field_1B;
+ u8 field_1C;
+ u8 field_1D;
+ u8 field_1E;
+ u8 field_1F;
+ u8 field_20;
+ u8 spriteIds[40];
+ u8 field_49;
+ u8 field_4A;
+ u16 field_4C[6];
+ u8 field_58[0x98 - 0x58];
+ u16 field_98;
+ u16 field_9A[3];
+ struct UnkStruct_8019BA8 field_A0[8];
+ u8 field_C0[12][15];
+ u8 field_174[48];
+ u8 field_1A4[200];
+};
+
+union UnkUnion_Main
+{
+ struct UnkStruct_Leader *leader;
+ struct UnkStruct_Group *group;
+ struct UnkStruct_URoom *uRoom;
+};
+
+struct TradeUnkStruct
+{
+ u16 field_0;
+ u16 type;
+ u32 playerPersonality;
+ u8 field_8;
+ u8 field_9;
+ u16 playerSpecies;
+ u16 playerLevel;
+ u16 species;
+ u16 level;
+ u16 field_12;
+ u32 personality;
+};
+
+// Exported RAM declarations
+
+extern u8 gUnknown_02022C2C;
+extern union UnkUnion_Main gUnknown_02022C30;
+extern struct UnkLinkRfuStruct_02022B14Substruct gUnknown_02022C38;
+
+extern u16 gUnknown_02022C3C;
+extern u8 gUnknown_02022C3E;
+
+// Exported ROM declarations
+
+u8 sub_8013F78(void);
+bool32 sub_802C908(u16);
+void nullsub_89(u8 taskId);
+void var_800D_set_xB(void);
+void MEvent_CreateTask_CardOrNewsWithFriend(u32 arg0);
+void MEvent_CreateTask_CardOrNewsOverWireless(u32 arg0);
+void MEvent_CreateTask_Leader(u32 arg0);
#endif //GUARD_UNION_ROOM_H
diff --git a/include/union_room_battle.h b/include/union_room_battle.h
new file mode 100644
index 000000000..2f5086008
--- /dev/null
+++ b/include/union_room_battle.h
@@ -0,0 +1,7 @@
+#ifndef GUARD_UNION_ROOM_BATTLE_H
+#define GUARD_UNION_ROOM_BATTLE_H
+
+u8 sub_8013C40(void);
+void sub_8014210(u16 battleFlags);
+
+#endif //GUARD_UNION_ROOM_BATTLE_H
diff --git a/include/union_room_player_avatar.h b/include/union_room_player_avatar.h
new file mode 100644
index 000000000..9870d0981
--- /dev/null
+++ b/include/union_room_player_avatar.h
@@ -0,0 +1,14 @@
+#ifndef GUARD_UNION_ROOM_PLAYER_AVATAR_H
+#define GUARD_UNION_ROOM_PLAYER_AVATAR_H
+
+u8 sub_8019BA8(struct UnkStruct_8019BA8 * ptr);
+void sub_8019E3C(void);
+void sub_8019E70(u8 *arg0, s32 arg1);
+void sub_8019F04(u8 *spriteIds);
+void sub_8019F2C(void);
+void sub_801A274(struct UnkStruct_URoom *arg0);
+void sub_801A284(struct UnkStruct_URoom *arg0);
+bool32 sub_801A2A8(struct UnkStruct_Main0 *arg0, s16 *arg1, s16 *arg2, u8 *arg3);
+void sub_801A3D0(u32 arg0, u32 arg1, struct UnkStruct_Main0 *arg2);
+
+#endif //GUARD_UNION_ROOM_PLAYER_AVATAR_H
diff --git a/ld_script.txt b/ld_script.txt
index 746fd4bd0..619abfce1 100644
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -55,7 +55,9 @@ SECTIONS {
src/link.o(.text);
src/link_rfu.o(.text);
src/union_room.o(.text);
- asm/union_room.o(.text);
+ src/mystery_gift.o(.text);
+ src/union_room_player_avatar.o(.text);
+ src/union_room_battle.o(.text);
src/mevent2.o(.text);
src/mevent_801BAAC.o(.text);
asm/mevent_server.o(.text);
@@ -409,7 +411,9 @@ SECTIONS {
src/link.o(.rodata);
src/link_rfu.o(.rodata);
src/union_room.o(.rodata);
- data/union_room.o(.rodata);
+ src/mystery_gift.o(.rodata);
+ src/union_room_player_avatar.o(.rodata);
+ src/union_room_battle.o(.rodata);
src/mevent2.o(.rodata);
src/mevent_801BAAC.o(.rodata);
data/mevent_server.o(.rodata);
@@ -484,7 +488,7 @@ SECTIONS {
src/item_menu_icons.o(.rodata);
src/battle_anim_mon_movement.o(.rodata);
src/item.o(.rodata);
- data/contest.o(.rodata);
+ src/contest.o(.rodata);
src/shop.o(.rodata);
src/fldeff_escalator.o(.rodata);
src/berry.o(.rodata);
diff --git a/src/battle_anim.c b/src/battle_anim.c
index 31ff11ee8..88de3ee88 100644
--- a/src/battle_anim.c
+++ b/src/battle_anim.c
@@ -117,651 +117,1011 @@ EWRAM_DATA u8 gUnknown_02038440 = 0;
const struct OamData gUnknown_08524904 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x8),
+ .x = 0,
.size = SPRITE_SIZE(8x8),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_0852490C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x16),
+ .x = 0,
.size = SPRITE_SIZE(16x16),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524914 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x32),
+ .x = 0,
.size = SPRITE_SIZE(32x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_0852491C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x64),
+ .x = 0,
.size = SPRITE_SIZE(64x64),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524924 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x8),
+ .x = 0,
.size = SPRITE_SIZE(16x8),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_0852492C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x8),
+ .x = 0,
.size = SPRITE_SIZE(32x8),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524934 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x16),
+ .x = 0,
.size = SPRITE_SIZE(32x16),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_0852493C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x32),
+ .x = 0,
.size = SPRITE_SIZE(64x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524944 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x16),
+ .x = 0,
.size = SPRITE_SIZE(8x16),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_0852494C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x32),
+ .x = 0,
.size = SPRITE_SIZE(8x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524954 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x32),
+ .x = 0,
.size = SPRITE_SIZE(16x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_0852495C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x64),
+ .x = 0,
.size = SPRITE_SIZE(32x64),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524964 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x8),
+ .x = 0,
.size = SPRITE_SIZE(8x8),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_0852496C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x16),
+ .x = 0,
.size = SPRITE_SIZE(16x16),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524974 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x32),
+ .x = 0,
.size = SPRITE_SIZE(32x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_0852497C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x64),
+ .x = 0,
.size = SPRITE_SIZE(64x64),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524984 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x8),
+ .x = 0,
.size = SPRITE_SIZE(16x8),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_0852498C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x8),
+ .x = 0,
.size = SPRITE_SIZE(32x8),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524994 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x16),
+ .x = 0,
.size = SPRITE_SIZE(32x16),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_0852499C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x32),
+ .x = 0,
.size = SPRITE_SIZE(64x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_085249A4 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x16),
+ .x = 0,
.size = SPRITE_SIZE(8x16),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_085249AC =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x32),
+ .x = 0,
.size = SPRITE_SIZE(8x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_085249B4 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x32),
+ .x = 0,
.size = SPRITE_SIZE(16x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_085249BC =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x64),
+ .x = 0,
.size = SPRITE_SIZE(32x64),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_085249C4 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x8),
+ .x = 0,
.size = SPRITE_SIZE(8x8),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_085249CC =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x16),
+ .x = 0,
.size = SPRITE_SIZE(16x16),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_085249D4 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x32),
+ .x = 0,
.size = SPRITE_SIZE(32x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_085249DC =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x64),
+ .x = 0,
.size = SPRITE_SIZE(64x64),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_085249E4 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x8),
+ .x = 0,
.size = SPRITE_SIZE(16x8),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_085249EC =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x8),
+ .x = 0,
.size = SPRITE_SIZE(32x8),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_085249F4 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x16),
+ .x = 0,
.size = SPRITE_SIZE(32x16),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_085249FC =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x32),
+ .x = 0,
.size = SPRITE_SIZE(64x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524A04 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x16),
+ .x = 0,
.size = SPRITE_SIZE(8x16),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524A0C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x32),
+ .x = 0,
.size = SPRITE_SIZE(8x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524A14 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x32),
+ .x = 0,
.size = SPRITE_SIZE(16x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524A1C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x64),
+ .x = 0,
.size = SPRITE_SIZE(32x64),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524A24 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x8),
+ .x = 0,
.size = SPRITE_SIZE(8x8),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524A2C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x16),
+ .x = 0,
.size = SPRITE_SIZE(16x16),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524A34 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x32),
+ .x = 0,
.size = SPRITE_SIZE(32x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524A3C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x64),
+ .x = 0,
.size = SPRITE_SIZE(64x64),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524A44 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x8),
+ .x = 0,
.size = SPRITE_SIZE(16x8),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524A4C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x8),
+ .x = 0,
.size = SPRITE_SIZE(32x8),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524A54 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x16),
+ .x = 0,
.size = SPRITE_SIZE(32x16),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524A5C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x32),
+ .x = 0,
.size = SPRITE_SIZE(64x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524A64 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x16),
+ .x = 0,
.size = SPRITE_SIZE(8x16),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524A6C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x32),
+ .x = 0,
.size = SPRITE_SIZE(8x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524A74 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x32),
+ .x = 0,
.size = SPRITE_SIZE(16x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524A7C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x64),
+ .x = 0,
.size = SPRITE_SIZE(32x64),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524A84 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x8),
+ .x = 0,
.size = SPRITE_SIZE(8x8),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524A8C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x16),
+ .x = 0,
.size = SPRITE_SIZE(16x16),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524A94 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x32),
+ .x = 0,
.size = SPRITE_SIZE(32x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524A9C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x64),
+ .x = 0,
.size = SPRITE_SIZE(64x64),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524AA4 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x8),
+ .x = 0,
.size = SPRITE_SIZE(16x8),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524AAC =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x8),
+ .x = 0,
.size = SPRITE_SIZE(32x8),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524AB4 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x16),
+ .x = 0,
.size = SPRITE_SIZE(32x16),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524ABC =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x32),
+ .x = 0,
.size = SPRITE_SIZE(64x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524AC4 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x16),
+ .x = 0,
.size = SPRITE_SIZE(8x16),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524ACC =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x32),
+ .x = 0,
.size = SPRITE_SIZE(8x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524AD4 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x32),
+ .x = 0,
.size = SPRITE_SIZE(16x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524ADC =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x64),
+ .x = 0,
.size = SPRITE_SIZE(32x64),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524AE4 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x8),
+ .x = 0,
.size = SPRITE_SIZE(8x8),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524AEC =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x16),
+ .x = 0,
.size = SPRITE_SIZE(16x16),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524AF4 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x32),
+ .x = 0,
.size = SPRITE_SIZE(32x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524AFC =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x64),
+ .x = 0,
.size = SPRITE_SIZE(64x64),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524B04 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x8),
+ .x = 0,
.size = SPRITE_SIZE(16x8),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524B0C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x8),
+ .x = 0,
.size = SPRITE_SIZE(32x8),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524B14 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x16),
+ .x = 0,
.size = SPRITE_SIZE(32x16),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524B1C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x32),
+ .x = 0,
.size = SPRITE_SIZE(64x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524B24 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x16),
+ .x = 0,
.size = SPRITE_SIZE(8x16),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524B2C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x32),
+ .x = 0,
.size = SPRITE_SIZE(8x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524B34 =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x32),
+ .x = 0,
.size = SPRITE_SIZE(16x32),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct OamData gUnknown_08524B3C =
{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x64),
+ .x = 0,
.size = SPRITE_SIZE(32x64),
+ .tileNum = 0,
.priority = 2,
+ .paletteNum = 0,
};
const struct CompressedSpriteSheet gBattleAnimPicTable[] =
@@ -3088,3 +3448,5 @@ static void ScriptCmd_stopsound(void)
m4aMPlayStop(&gMPlayInfo_SE2);
sBattleAnimScriptPtr++;
}
+
+
diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c
index f14e502f3..af4bc19ec 100644
--- a/src/battle_anim_effects_1.c
+++ b/src/battle_anim_effects_1.c
@@ -1093,7 +1093,7 @@ const struct SpriteTemplate gUnknown_085928D0 =
.callback = sub_8100A50,
};
-const struct SpriteTemplate gUnknown_085928E8 =
+const struct SpriteTemplate gVineWhipSpriteTemplate =
{
.tileTag = ANIM_TAG_WHIP_HIT,
.paletteTag = ANIM_TAG_WHIP_HIT,
@@ -2336,7 +2336,7 @@ void AnimHyperBeamOrb(struct Sprite* sprite)
{
u16 speed;
u16 animNum = Random2();
-
+
StartSpriteAnim(sprite, animNum % 8);
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2);
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET);
@@ -2660,7 +2660,7 @@ static void AnimTranslateLinearSingleSineWaveStep(struct Sprite* sprite)
s16 a = sprite->data[0];
s16 b = sprite->data[7];
s16 r0;
-
+
sprite->data[0] = 1;
TranslateAnimHorizontalArc(sprite);
r0 = sprite->data[7];
@@ -2675,7 +2675,7 @@ static void AnimTranslateLinearSingleSineWaveStep(struct Sprite* sprite)
if (sprite->oam.affineParam == 30)
destroy = TRUE;
}
-
+
if (sprite->pos1.x + sprite->pos2.x > 256
|| sprite->pos1.x + sprite->pos2.x < -16
|| sprite->pos1.y + sprite->pos2.y > 160
@@ -3748,7 +3748,7 @@ void sub_81009F8(struct Sprite* sprite)
void sub_8100A50(struct Sprite* sprite)
{
- if (GetBattlerSide(gBattleAnimAttacker) == 0)
+ if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
StartSpriteAnim(sprite, 1);
sprite->callback = sub_81009DC;
@@ -3770,7 +3770,7 @@ void sub_8100A94(struct Sprite* sprite)
}
// Moves the sprite in a diagonally slashing motion across the target mon.
-// Used by moves such as MOVE_CUT and MOVE_AERIAL_ACE.
+// Used by moves such as MOVE_CUT and MOVE_AERIAL_ACE.
// arg 0: initial x pixel offset
// arg 1: initial y pixel offset
// arg 2: slice direction; 0 = right-to-left, 1 = left-to-right
@@ -5350,10 +5350,10 @@ static void sub_8102DE4(struct Sprite* sprite)
void sub_8102EB0(struct Sprite* sprite)
{
- int a;
+ int a;
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT)
{
- a = gBattleAnimArgs[1];
+ a = gBattleAnimArgs[1];
(u16)gBattleAnimArgs[1] = -a;
}
diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c
index 80b3258b4..e3295acb8 100755
--- a/src/battle_anim_effects_2.c
+++ b/src/battle_anim_effects_2.c
@@ -889,7 +889,7 @@ const struct SpriteTemplate gUnknown_08593958 =
.callback = sub_8105DE8,
};
-const struct SpriteTemplate gUnknown_08593970 =
+const struct SpriteTemplate gMagentaHeartSpriteTemplate =
{
.tileTag = ANIM_TAG_MAGENTA_HEART,
.paletteTag = ANIM_TAG_MAGENTA_HEART,
@@ -3286,7 +3286,7 @@ static void sub_810627C(struct Sprite *sprite)
}
}
-void sub_81062E8(u8 taskId)
+void AnimTask_HeartsBackground(u8 taskId)
{
struct BattleAnimBgData animBg;
diff --git a/src/battle_bg.c b/src/battle_bg.c
index 524f73abf..814e8dad9 100644
--- a/src/battle_bg.c
+++ b/src/battle_bg.c
@@ -709,7 +709,7 @@ void LoadBattleMenuWindowGfx(void)
if (gBattleTypeFlags & BATTLE_TYPE_ARENA)
{
- sub_81978B0(0x70);
+ Menu_LoadStdPalAt(0x70);
LoadMessageBoxGfx(0, 0x30, 0x70);
gPlttBufferUnfaded[0x76] = 0;
CpuCopy16(&gPlttBufferUnfaded[0x76], &gPlttBufferFaded[0x76], 2);
diff --git a/src/battle_main.c b/src/battle_main.c
index 19fd01e3c..92f12636d 100644
--- a/src/battle_main.c
+++ b/src/battle_main.c
@@ -293,35 +293,31 @@ static const u8 sText_ShedinjaJpnName[] = _("ヌケニン"); // Nukenin
const struct OamData gOamData_831ACA8 =
{
.y = 0,
- .affineMode = 1,
- .objMode = 0,
- .mosaic = 0,
- .bpp = 0,
+ .affineMode = ST_OAM_AFFINE_NORMAL,
+ .objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x64),
.x = 0,
- .matrixNum = 0,
.size = SPRITE_SIZE(64x64),
.tileNum = 0,
.priority = 2,
.paletteNum = 0,
- .affineParam = 0
+ .affineParam = 0,
};
const struct OamData gOamData_831ACB0 =
{
.y = 0,
- .affineMode = 1,
- .objMode = 0,
- .mosaic = 0,
- .bpp = 0,
+ .affineMode = ST_OAM_AFFINE_NORMAL,
+ .objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x64),
.x = 0,
- .matrixNum = 0,
.size = SPRITE_SIZE(64x64),
.tileNum = 0,
.priority = 2,
.paletteNum = 2,
- .affineParam = 0
+ .affineParam = 0,
};
// Unknown and unused data. Feel free to remove.
@@ -5891,3 +5887,5 @@ static void HandleAction_ActionFinished(void)
gBattleScripting.multihitMoveEffect = 0;
gBattleResources->battleScriptsStack->size = 0;
}
+
+
diff --git a/src/battle_setup.c b/src/battle_setup.c
index 347486a0b..7395c175b 100644
--- a/src/battle_setup.c
+++ b/src/battle_setup.c
@@ -232,84 +232,84 @@ static const struct TrainerBattleParameter sTrainerBContinueScriptBattleParams[]
const struct RematchTrainer gRematchTable[REMATCH_TABLE_ENTRIES] =
{
- {{TRAINER_ROSE_1, TRAINER_ROSE_2, TRAINER_ROSE_3, TRAINER_ROSE_4, TRAINER_ROSE_5}, 0x0, 0x21},
- {{TRAINER_ANDRES_1, TRAINER_ANDRES_2, TRAINER_ANDRES_3, TRAINER_ANDRES_4, TRAINER_ANDRES_5}, 0x0, 0x14},
- {{TRAINER_DUSTY_1, TRAINER_DUSTY_2, TRAINER_DUSTY_3, TRAINER_DUSTY_4, TRAINER_DUSTY_5}, 0x0, 0x1a},
- {{TRAINER_LOLA_1, TRAINER_LOLA_2, TRAINER_LOLA_3, TRAINER_LOLA_4, TRAINER_LOLA_5}, 0x0, 0x18},
- {{TRAINER_RICKY_1, TRAINER_RICKY_2, TRAINER_RICKY_3, TRAINER_RICKY_4, TRAINER_RICKY_5}, 0x0, 0x18},
- {{TRAINER_LILA_AND_ROY_1, TRAINER_LILA_AND_ROY_2, TRAINER_LILA_AND_ROY_3, TRAINER_LILA_AND_ROY_4, TRAINER_LILA_AND_ROY_5}, 0x0, 0x27},
- {{TRAINER_CRISTIN_1, TRAINER_CRISTIN_2, TRAINER_CRISTIN_3, TRAINER_CRISTIN_4, TRAINER_CRISTIN_5}, 0x0, 0x24},
- {{TRAINER_BROOKE_1, TRAINER_BROOKE_2, TRAINER_BROOKE_3, TRAINER_BROOKE_4, TRAINER_BROOKE_5}, 0x0, 0x1a},
- {{TRAINER_WILTON_1, TRAINER_WILTON_2, TRAINER_WILTON_3, TRAINER_WILTON_4, TRAINER_WILTON_5}, 0x0, 0x1a},
- {{TRAINER_VALERIE_1, TRAINER_VALERIE_2, TRAINER_VALERIE_3, TRAINER_VALERIE_4, TRAINER_VALERIE_5}, 0x18, 0x14},
- {{TRAINER_CINDY_1, TRAINER_CINDY_3, TRAINER_CINDY_4, TRAINER_CINDY_5, TRAINER_CINDY_6}, 0x0, 0x13},
- {{TRAINER_THALIA_1, TRAINER_THALIA_2, TRAINER_THALIA_3, TRAINER_THALIA_4, TRAINER_THALIA_5}, 0x18, 0x38},
- {{TRAINER_JESSICA_1, TRAINER_JESSICA_2, TRAINER_JESSICA_3, TRAINER_JESSICA_4, TRAINER_JESSICA_5}, 0x0, 0x24},
- {{TRAINER_WINSTON_1, TRAINER_WINSTON_2, TRAINER_WINSTON_3, TRAINER_WINSTON_4, TRAINER_WINSTON_5}, 0x0, 0x13},
- {{TRAINER_STEVE_1, TRAINER_STEVE_2, TRAINER_STEVE_3, TRAINER_STEVE_4, TRAINER_STEVE_5}, 0x0, 0x1d},
- {{TRAINER_TONY_1, TRAINER_TONY_2, TRAINER_TONY_3, TRAINER_TONY_4, TRAINER_TONY_5}, 0x0, 0x16},
- {{TRAINER_NOB_1, TRAINER_NOB_2, TRAINER_NOB_3, TRAINER_NOB_4, TRAINER_NOB_5}, 0x0, 0x1e},
- {{TRAINER_KOJI_1, TRAINER_KOJI_2, TRAINER_KOJI_3, TRAINER_KOJI_4, TRAINER_KOJI_5}, 0x0, 0x2a},
- {{TRAINER_FERNANDO_1, TRAINER_FERNANDO_2, TRAINER_FERNANDO_3, TRAINER_FERNANDO_4, TRAINER_FERNANDO_5}, 0x0, 0x26},
- {{TRAINER_DALTON_1, TRAINER_DALTON_2, TRAINER_DALTON_3, TRAINER_DALTON_4, TRAINER_DALTON_5}, 0x0, 0x21},
- {{TRAINER_BERNIE_1, TRAINER_BERNIE_2, TRAINER_BERNIE_3, TRAINER_BERNIE_4, TRAINER_BERNIE_5}, 0x0, 0x1d},
- {{TRAINER_ETHAN_1, TRAINER_ETHAN_2, TRAINER_ETHAN_3, TRAINER_ETHAN_4, TRAINER_ETHAN_5}, 0x18, 0xd},
- {{TRAINER_JOHN_AND_JAY_1, TRAINER_JOHN_AND_JAY_2, TRAINER_JOHN_AND_JAY_3, TRAINER_JOHN_AND_JAY_4, TRAINER_JOHN_AND_JAY_5}, 0x18, 0x1},
- {{TRAINER_JEFFREY_1, TRAINER_JEFFREY_2, TRAINER_JEFFREY_3, TRAINER_JEFFREY_4, TRAINER_JEFFREY_5}, 0x0, 0x23},
- {{TRAINER_CAMERON_1, TRAINER_CAMERON_2, TRAINER_CAMERON_3, TRAINER_CAMERON_4, TRAINER_CAMERON_5}, 0x0, 0x26},
- {{TRAINER_JACKI_1, TRAINER_JACKI_2, TRAINER_JACKI_3, TRAINER_JACKI_4, TRAINER_JACKI_5}, 0x0, 0x26},
- {{TRAINER_WALTER_1, TRAINER_WALTER_2, TRAINER_WALTER_3, TRAINER_WALTER_4, TRAINER_WALTER_5}, 0x0, 0x24},
- {{TRAINER_KAREN_1, TRAINER_KAREN_2, TRAINER_KAREN_3, TRAINER_KAREN_4, TRAINER_KAREN_5}, 0x0, 0x1f},
- {{TRAINER_JERRY_1, TRAINER_JERRY_2, TRAINER_JERRY_3, TRAINER_JERRY_4, TRAINER_JERRY_5}, 0x0, 0x1f},
- {{TRAINER_ANNA_AND_MEG_1, TRAINER_ANNA_AND_MEG_2, TRAINER_ANNA_AND_MEG_3, TRAINER_ANNA_AND_MEG_4, TRAINER_ANNA_AND_MEG_5}, 0x0, 0x20},
- {{TRAINER_ISABEL_1, TRAINER_ISABEL_2, TRAINER_ISABEL_3, TRAINER_ISABEL_4, TRAINER_ISABEL_5}, 0x0, 0x19},
- {{TRAINER_MIGUEL_1, TRAINER_MIGUEL_2, TRAINER_MIGUEL_3, TRAINER_MIGUEL_4, TRAINER_MIGUEL_5}, 0x0, 0x12},
- {{TRAINER_TIMOTHY_1, TRAINER_TIMOTHY_2, TRAINER_TIMOTHY_3, TRAINER_TIMOTHY_4, TRAINER_TIMOTHY_5}, 0x0, 0x1e},
- {{TRAINER_SHELBY_1, TRAINER_SHELBY_2, TRAINER_SHELBY_3, TRAINER_SHELBY_4, TRAINER_SHELBY_5}, 0x18, 0xc},
- {{TRAINER_CALVIN_1, TRAINER_CALVIN_2, TRAINER_CALVIN_3, TRAINER_CALVIN_4, TRAINER_CALVIN_5}, 0x0, 0x11},
- {{TRAINER_ELLIOT_1, TRAINER_ELLIOT_2, TRAINER_ELLIOT_3, TRAINER_ELLIOT_4, TRAINER_ELLIOT_5}, 0x0, 0x15},
- {{TRAINER_ISAIAH_1, TRAINER_ISAIAH_2, TRAINER_ISAIAH_3, TRAINER_ISAIAH_4, TRAINER_ISAIAH_5}, 0x0, 0x2b},
- {{TRAINER_MARIA_1, TRAINER_MARIA_2, TRAINER_MARIA_3, TRAINER_MARIA_4, TRAINER_MARIA_5}, 0x0, 0x20},
- {{TRAINER_ABIGAIL_1, TRAINER_ABIGAIL_2, TRAINER_ABIGAIL_3, TRAINER_ABIGAIL_4, TRAINER_ABIGAIL_5}, 0x0, 0x19},
- {{TRAINER_DYLAN_1, TRAINER_DYLAN_2, TRAINER_DYLAN_3, TRAINER_DYLAN_4, TRAINER_DYLAN_5}, 0x0, 0x20},
- {{TRAINER_KATELYN_1, TRAINER_KATELYN_2, TRAINER_KATELYN_3, TRAINER_KATELYN_4, TRAINER_KATELYN_5}, 0x0, 0x2b},
- {{TRAINER_BENJAMIN_1, TRAINER_BENJAMIN_2, TRAINER_BENJAMIN_3, TRAINER_BENJAMIN_4, TRAINER_BENJAMIN_5}, 0x0, 0x19},
- {{TRAINER_PABLO_1, TRAINER_PABLO_2, TRAINER_PABLO_3, TRAINER_PABLO_4, TRAINER_PABLO_5}, 0x0, 0x29},
- {{TRAINER_NICOLAS_1, TRAINER_NICOLAS_2, TRAINER_NICOLAS_3, TRAINER_NICOLAS_4, TRAINER_NICOLAS_5}, 0x18, 0x1},
- {{TRAINER_ROBERT_1, TRAINER_ROBERT_2, TRAINER_ROBERT_3, TRAINER_ROBERT_4, TRAINER_ROBERT_5}, 0x0, 0x23},
- {{TRAINER_LAO_1, TRAINER_LAO_2, TRAINER_LAO_3, TRAINER_LAO_4, TRAINER_LAO_5}, 0x0, 0x1c},
- {{TRAINER_CYNDY_1, TRAINER_CYNDY_2, TRAINER_CYNDY_3, TRAINER_CYNDY_4, TRAINER_CYNDY_5}, 0x0, 0x1e},
- {{TRAINER_MADELINE_1, TRAINER_MADELINE_2, TRAINER_MADELINE_3, TRAINER_MADELINE_4, TRAINER_MADELINE_5}, 0x0, 0x1c},
- {{TRAINER_JENNY_1, TRAINER_JENNY_2, TRAINER_JENNY_3, TRAINER_JENNY_4, TRAINER_JENNY_5}, 0x0, 0x27},
- {{TRAINER_DIANA_1, TRAINER_DIANA_2, TRAINER_DIANA_3, TRAINER_DIANA_4, TRAINER_DIANA_5}, 0x18, 0xd},
- {{TRAINER_AMY_AND_LIV_1, TRAINER_AMY_AND_LIV_2, TRAINER_AMY_AND_LIV_4, TRAINER_AMY_AND_LIV_5, TRAINER_AMY_AND_LIV_6}, 0x0, 0x12},
- {{TRAINER_ERNEST_1, TRAINER_ERNEST_2, TRAINER_ERNEST_3, TRAINER_ERNEST_4, TRAINER_ERNEST_5}, 0x0, 0x28},
- {{TRAINER_CORY_1, TRAINER_CORY_2, TRAINER_CORY_3, TRAINER_CORY_4, TRAINER_CORY_5}, 0x0, 0x17},
- {{TRAINER_EDWIN_1, TRAINER_EDWIN_2, TRAINER_EDWIN_3, TRAINER_EDWIN_4, TRAINER_EDWIN_5}, 0x0, 0x19},
- {{TRAINER_LYDIA_1, TRAINER_LYDIA_2, TRAINER_LYDIA_3, TRAINER_LYDIA_4, TRAINER_LYDIA_5}, 0x0, 0x20},
- {{TRAINER_ISAAC_1, TRAINER_ISAAC_2, TRAINER_ISAAC_3, TRAINER_ISAAC_4, TRAINER_ISAAC_5}, 0x0, 0x20},
- {{TRAINER_GABRIELLE_1, TRAINER_GABRIELLE_2, TRAINER_GABRIELLE_3, TRAINER_GABRIELLE_4, TRAINER_GABRIELLE_5}, 0x18, 0x11},
- {{TRAINER_CATHERINE_1, TRAINER_CATHERINE_2, TRAINER_CATHERINE_3, TRAINER_CATHERINE_4, TRAINER_CATHERINE_5}, 0x0, 0x22},
- {{TRAINER_JACKSON_1, TRAINER_JACKSON_2, TRAINER_JACKSON_3, TRAINER_JACKSON_4, TRAINER_JACKSON_5}, 0x0, 0x22},
- {{TRAINER_HALEY_1, TRAINER_HALEY_2, TRAINER_HALEY_3, TRAINER_HALEY_4, TRAINER_HALEY_5}, 0x0, 0x13},
- {{TRAINER_JAMES_1, TRAINER_JAMES_2, TRAINER_JAMES_3, TRAINER_JAMES_4, TRAINER_JAMES_5}, 0x18, 0xb},
- {{TRAINER_TRENT_1, TRAINER_TRENT_2, TRAINER_TRENT_3, TRAINER_TRENT_4, TRAINER_TRENT_5}, 0x0, 0x1b},
- {{TRAINER_SAWYER_1, TRAINER_SAWYER_2, TRAINER_SAWYER_3, TRAINER_SAWYER_4, TRAINER_SAWYER_5}, 0x18, 0xc},
- {{TRAINER_KIRA_AND_DAN_1, TRAINER_KIRA_AND_DAN_2, TRAINER_KIRA_AND_DAN_3, TRAINER_KIRA_AND_DAN_4, TRAINER_KIRA_AND_DAN_5}, 0x18, 0x3e},
- {{TRAINER_WALLY_3, TRAINER_WALLY_4, TRAINER_WALLY_5, TRAINER_WALLY_6, TRAINER_WALLY_6}, 0x18, 0x2b},
- {{TRAINER_ROXANNE_1, TRAINER_ROXANNE_2, TRAINER_ROXANNE_3, TRAINER_ROXANNE_4, TRAINER_ROXANNE_5}, 0x0, 0x3},
- {{TRAINER_BRAWLY_1, TRAINER_BRAWLY_2, TRAINER_BRAWLY_3, TRAINER_BRAWLY_4, TRAINER_BRAWLY_5}, 0x0, 0xb},
- {{TRAINER_WATTSON_1, TRAINER_WATTSON_2, TRAINER_WATTSON_3, TRAINER_WATTSON_4, TRAINER_WATTSON_5}, 0x0, 0x2},
- {{TRAINER_FLANNERY_1, TRAINER_FLANNERY_2, TRAINER_FLANNERY_3, TRAINER_FLANNERY_4, TRAINER_FLANNERY_5}, 0x0, 0xc},
- {{TRAINER_NORMAN_1, TRAINER_NORMAN_2, TRAINER_NORMAN_3, TRAINER_NORMAN_4, TRAINER_NORMAN_5}, 0x0, 0x0},
- {{TRAINER_WINONA_1, TRAINER_WINONA_2, TRAINER_WINONA_3, TRAINER_WINONA_4, TRAINER_WINONA_5}, 0x0, 0x4},
- {{TRAINER_TATE_AND_LIZA_1, TRAINER_TATE_AND_LIZA_2, TRAINER_TATE_AND_LIZA_3, TRAINER_TATE_AND_LIZA_4, TRAINER_TATE_AND_LIZA_5}, 0x0, 0x6},
- {{TRAINER_JUAN_1, TRAINER_JUAN_2, TRAINER_JUAN_3, TRAINER_JUAN_4, TRAINER_JUAN_5}, 0x0, 0x7},
- {{TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY}, 0x0, 0x8},
- {{TRAINER_PHOEBE, TRAINER_PHOEBE, TRAINER_PHOEBE, TRAINER_PHOEBE, TRAINER_PHOEBE}, 0x0, 0x8},
- {{TRAINER_GLACIA, TRAINER_GLACIA, TRAINER_GLACIA, TRAINER_GLACIA, TRAINER_GLACIA}, 0x0, 0x8},
- {{TRAINER_DRAKE, TRAINER_DRAKE, TRAINER_DRAKE, TRAINER_DRAKE, TRAINER_DRAKE}, 0x0, 0x8},
- {{TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE}, 0x0, 0x8},
+ [REMATCH_ROSE] = {{TRAINER_ROSE_1, TRAINER_ROSE_2, TRAINER_ROSE_3, TRAINER_ROSE_4, TRAINER_ROSE_5}, 0x0, 0x21},
+ [REMATCH_ANDRES] = {{TRAINER_ANDRES_1, TRAINER_ANDRES_2, TRAINER_ANDRES_3, TRAINER_ANDRES_4, TRAINER_ANDRES_5}, 0x0, 0x14},
+ [REMATCH_DUSTY] = {{TRAINER_DUSTY_1, TRAINER_DUSTY_2, TRAINER_DUSTY_3, TRAINER_DUSTY_4, TRAINER_DUSTY_5}, 0x0, 0x1a},
+ [REMATCH_LOLA] = {{TRAINER_LOLA_1, TRAINER_LOLA_2, TRAINER_LOLA_3, TRAINER_LOLA_4, TRAINER_LOLA_5}, 0x0, 0x18},
+ [REMATCH_RICKY] = {{TRAINER_RICKY_1, TRAINER_RICKY_2, TRAINER_RICKY_3, TRAINER_RICKY_4, TRAINER_RICKY_5}, 0x0, 0x18},
+ [REMATCH_LILA_AND_ROY] = {{TRAINER_LILA_AND_ROY_1, TRAINER_LILA_AND_ROY_2, TRAINER_LILA_AND_ROY_3, TRAINER_LILA_AND_ROY_4, TRAINER_LILA_AND_ROY_5}, 0x0, 0x27},
+ [REMATCH_CRISTIN] = {{TRAINER_CRISTIN_1, TRAINER_CRISTIN_2, TRAINER_CRISTIN_3, TRAINER_CRISTIN_4, TRAINER_CRISTIN_5}, 0x0, 0x24},
+ [REMATCH_BROOKE] = {{TRAINER_BROOKE_1, TRAINER_BROOKE_2, TRAINER_BROOKE_3, TRAINER_BROOKE_4, TRAINER_BROOKE_5}, 0x0, 0x1a},
+ [REMATCH_WILTON] = {{TRAINER_WILTON_1, TRAINER_WILTON_2, TRAINER_WILTON_3, TRAINER_WILTON_4, TRAINER_WILTON_5}, 0x0, 0x1a},
+ [REMATCH_VALERIE] = {{TRAINER_VALERIE_1, TRAINER_VALERIE_2, TRAINER_VALERIE_3, TRAINER_VALERIE_4, TRAINER_VALERIE_5}, 0x18, 0x14},
+ [REMATCH_CINDY] = {{TRAINER_CINDY_1, TRAINER_CINDY_3, TRAINER_CINDY_4, TRAINER_CINDY_5, TRAINER_CINDY_6}, 0x0, 0x13},
+ [REMATCH_THALIA] = {{TRAINER_THALIA_1, TRAINER_THALIA_2, TRAINER_THALIA_3, TRAINER_THALIA_4, TRAINER_THALIA_5}, 0x18, 0x38},
+ [REMATCH_JESSICA] = {{TRAINER_JESSICA_1, TRAINER_JESSICA_2, TRAINER_JESSICA_3, TRAINER_JESSICA_4, TRAINER_JESSICA_5}, 0x0, 0x24},
+ [REMATCH_WINSTON] = {{TRAINER_WINSTON_1, TRAINER_WINSTON_2, TRAINER_WINSTON_3, TRAINER_WINSTON_4, TRAINER_WINSTON_5}, 0x0, 0x13},
+ [REMATCH_STEVE] = {{TRAINER_STEVE_1, TRAINER_STEVE_2, TRAINER_STEVE_3, TRAINER_STEVE_4, TRAINER_STEVE_5}, 0x0, 0x1d},
+ [REMATCH_TONY] = {{TRAINER_TONY_1, TRAINER_TONY_2, TRAINER_TONY_3, TRAINER_TONY_4, TRAINER_TONY_5}, 0x0, 0x16},
+ [REMATCH_NOB] = {{TRAINER_NOB_1, TRAINER_NOB_2, TRAINER_NOB_3, TRAINER_NOB_4, TRAINER_NOB_5}, 0x0, 0x1e},
+ [REMATCH_KOJI] = {{TRAINER_KOJI_1, TRAINER_KOJI_2, TRAINER_KOJI_3, TRAINER_KOJI_4, TRAINER_KOJI_5}, 0x0, 0x2a},
+ [REMATCH_FERNANDO] = {{TRAINER_FERNANDO_1, TRAINER_FERNANDO_2, TRAINER_FERNANDO_3, TRAINER_FERNANDO_4, TRAINER_FERNANDO_5}, 0x0, 0x26},
+ [REMATCH_DALTON] = {{TRAINER_DALTON_1, TRAINER_DALTON_2, TRAINER_DALTON_3, TRAINER_DALTON_4, TRAINER_DALTON_5}, 0x0, 0x21},
+ [REMATCH_BERNIE] = {{TRAINER_BERNIE_1, TRAINER_BERNIE_2, TRAINER_BERNIE_3, TRAINER_BERNIE_4, TRAINER_BERNIE_5}, 0x0, 0x1d},
+ [REMATCH_ETHAN] = {{TRAINER_ETHAN_1, TRAINER_ETHAN_2, TRAINER_ETHAN_3, TRAINER_ETHAN_4, TRAINER_ETHAN_5}, 0x18, 0xd},
+ [REMATCH_JOHN_AND_JAY] = {{TRAINER_JOHN_AND_JAY_1, TRAINER_JOHN_AND_JAY_2, TRAINER_JOHN_AND_JAY_3, TRAINER_JOHN_AND_JAY_4, TRAINER_JOHN_AND_JAY_5}, 0x18, 0x1},
+ [REMATCH_JEFFREY] = {{TRAINER_JEFFREY_1, TRAINER_JEFFREY_2, TRAINER_JEFFREY_3, TRAINER_JEFFREY_4, TRAINER_JEFFREY_5}, 0x0, 0x23},
+ [REMATCH_CAMERON] = {{TRAINER_CAMERON_1, TRAINER_CAMERON_2, TRAINER_CAMERON_3, TRAINER_CAMERON_4, TRAINER_CAMERON_5}, 0x0, 0x26},
+ [REMATCH_JACKI] = {{TRAINER_JACKI_1, TRAINER_JACKI_2, TRAINER_JACKI_3, TRAINER_JACKI_4, TRAINER_JACKI_5}, 0x0, 0x26},
+ [REMATCH_WALTER] = {{TRAINER_WALTER_1, TRAINER_WALTER_2, TRAINER_WALTER_3, TRAINER_WALTER_4, TRAINER_WALTER_5}, 0x0, 0x24},
+ [REMATCH_KAREN] = {{TRAINER_KAREN_1, TRAINER_KAREN_2, TRAINER_KAREN_3, TRAINER_KAREN_4, TRAINER_KAREN_5}, 0x0, 0x1f},
+ [REMATCH_JERRY] = {{TRAINER_JERRY_1, TRAINER_JERRY_2, TRAINER_JERRY_3, TRAINER_JERRY_4, TRAINER_JERRY_5}, 0x0, 0x1f},
+ [REMATCH_ANNA_AND_MEG] = {{TRAINER_ANNA_AND_MEG_1, TRAINER_ANNA_AND_MEG_2, TRAINER_ANNA_AND_MEG_3, TRAINER_ANNA_AND_MEG_4, TRAINER_ANNA_AND_MEG_5}, 0x0, 0x20},
+ [REMATCH_ISABEL] = {{TRAINER_ISABEL_1, TRAINER_ISABEL_2, TRAINER_ISABEL_3, TRAINER_ISABEL_4, TRAINER_ISABEL_5}, 0x0, 0x19},
+ [REMATCH_MIGUEL] = {{TRAINER_MIGUEL_1, TRAINER_MIGUEL_2, TRAINER_MIGUEL_3, TRAINER_MIGUEL_4, TRAINER_MIGUEL_5}, 0x0, 0x12},
+ [REMATCH_TIMOTHY] = {{TRAINER_TIMOTHY_1, TRAINER_TIMOTHY_2, TRAINER_TIMOTHY_3, TRAINER_TIMOTHY_4, TRAINER_TIMOTHY_5}, 0x0, 0x1e},
+ [REMATCH_SHELBY] = {{TRAINER_SHELBY_1, TRAINER_SHELBY_2, TRAINER_SHELBY_3, TRAINER_SHELBY_4, TRAINER_SHELBY_5}, 0x18, 0xc},
+ [REMATCH_CALVIN] = {{TRAINER_CALVIN_1, TRAINER_CALVIN_2, TRAINER_CALVIN_3, TRAINER_CALVIN_4, TRAINER_CALVIN_5}, 0x0, 0x11},
+ [REMATCH_ELLIOT] = {{TRAINER_ELLIOT_1, TRAINER_ELLIOT_2, TRAINER_ELLIOT_3, TRAINER_ELLIOT_4, TRAINER_ELLIOT_5}, 0x0, 0x15},
+ [REMATCH_ISAIAH] = {{TRAINER_ISAIAH_1, TRAINER_ISAIAH_2, TRAINER_ISAIAH_3, TRAINER_ISAIAH_4, TRAINER_ISAIAH_5}, 0x0, 0x2b},
+ [REMATCH_MARIA] = {{TRAINER_MARIA_1, TRAINER_MARIA_2, TRAINER_MARIA_3, TRAINER_MARIA_4, TRAINER_MARIA_5}, 0x0, 0x20},
+ [REMATCH_ABIGAIL] = {{TRAINER_ABIGAIL_1, TRAINER_ABIGAIL_2, TRAINER_ABIGAIL_3, TRAINER_ABIGAIL_4, TRAINER_ABIGAIL_5}, 0x0, 0x19},
+ [REMATCH_DYLAN] = {{TRAINER_DYLAN_1, TRAINER_DYLAN_2, TRAINER_DYLAN_3, TRAINER_DYLAN_4, TRAINER_DYLAN_5}, 0x0, 0x20},
+ [REMATCH_KATELYN] = {{TRAINER_KATELYN_1, TRAINER_KATELYN_2, TRAINER_KATELYN_3, TRAINER_KATELYN_4, TRAINER_KATELYN_5}, 0x0, 0x2b},
+ [REMATCH_BENJAMIN] = {{TRAINER_BENJAMIN_1, TRAINER_BENJAMIN_2, TRAINER_BENJAMIN_3, TRAINER_BENJAMIN_4, TRAINER_BENJAMIN_5}, 0x0, 0x19},
+ [REMATCH_PABLO] = {{TRAINER_PABLO_1, TRAINER_PABLO_2, TRAINER_PABLO_3, TRAINER_PABLO_4, TRAINER_PABLO_5}, 0x0, 0x29},
+ [REMATCH_NICOLAS] = {{TRAINER_NICOLAS_1, TRAINER_NICOLAS_2, TRAINER_NICOLAS_3, TRAINER_NICOLAS_4, TRAINER_NICOLAS_5}, 0x18, 0x1},
+ [REMATCH_ROBERT] = {{TRAINER_ROBERT_1, TRAINER_ROBERT_2, TRAINER_ROBERT_3, TRAINER_ROBERT_4, TRAINER_ROBERT_5}, 0x0, 0x23},
+ [REMATCH_LAO] = {{TRAINER_LAO_1, TRAINER_LAO_2, TRAINER_LAO_3, TRAINER_LAO_4, TRAINER_LAO_5}, 0x0, 0x1c},
+ [REMATCH_CYNDY] = {{TRAINER_CYNDY_1, TRAINER_CYNDY_2, TRAINER_CYNDY_3, TRAINER_CYNDY_4, TRAINER_CYNDY_5}, 0x0, 0x1e},
+ [REMATCH_MADELINE] = {{TRAINER_MADELINE_1, TRAINER_MADELINE_2, TRAINER_MADELINE_3, TRAINER_MADELINE_4, TRAINER_MADELINE_5}, 0x0, 0x1c},
+ [REMATCH_JENNY] = {{TRAINER_JENNY_1, TRAINER_JENNY_2, TRAINER_JENNY_3, TRAINER_JENNY_4, TRAINER_JENNY_5}, 0x0, 0x27},
+ [REMATCH_DIANA] = {{TRAINER_DIANA_1, TRAINER_DIANA_2, TRAINER_DIANA_3, TRAINER_DIANA_4, TRAINER_DIANA_5}, 0x18, 0xd},
+ [REMATCH_AMY_AND_LIV] = {{TRAINER_AMY_AND_LIV_1, TRAINER_AMY_AND_LIV_2, TRAINER_AMY_AND_LIV_4, TRAINER_AMY_AND_LIV_5, TRAINER_AMY_AND_LIV_6}, 0x0, 0x12},
+ [REMATCH_ERNEST] = {{TRAINER_ERNEST_1, TRAINER_ERNEST_2, TRAINER_ERNEST_3, TRAINER_ERNEST_4, TRAINER_ERNEST_5}, 0x0, 0x28},
+ [REMATCH_CORY] = {{TRAINER_CORY_1, TRAINER_CORY_2, TRAINER_CORY_3, TRAINER_CORY_4, TRAINER_CORY_5}, 0x0, 0x17},
+ [REMATCH_EDWIN] = {{TRAINER_EDWIN_1, TRAINER_EDWIN_2, TRAINER_EDWIN_3, TRAINER_EDWIN_4, TRAINER_EDWIN_5}, 0x0, 0x19},
+ [REMATCH_LYDIA] = {{TRAINER_LYDIA_1, TRAINER_LYDIA_2, TRAINER_LYDIA_3, TRAINER_LYDIA_4, TRAINER_LYDIA_5}, 0x0, 0x20},
+ [REMATCH_ISAAC] = {{TRAINER_ISAAC_1, TRAINER_ISAAC_2, TRAINER_ISAAC_3, TRAINER_ISAAC_4, TRAINER_ISAAC_5}, 0x0, 0x20},
+ [REMATCH_GABRIELLE] = {{TRAINER_GABRIELLE_1, TRAINER_GABRIELLE_2, TRAINER_GABRIELLE_3, TRAINER_GABRIELLE_4, TRAINER_GABRIELLE_5}, 0x18, 0x11},
+ [REMATCH_CATHERINE] = {{TRAINER_CATHERINE_1, TRAINER_CATHERINE_2, TRAINER_CATHERINE_3, TRAINER_CATHERINE_4, TRAINER_CATHERINE_5}, 0x0, 0x22},
+ [REMATCH_JACKSON] = {{TRAINER_JACKSON_1, TRAINER_JACKSON_2, TRAINER_JACKSON_3, TRAINER_JACKSON_4, TRAINER_JACKSON_5}, 0x0, 0x22},
+ [REMATCH_HALEY] = {{TRAINER_HALEY_1, TRAINER_HALEY_2, TRAINER_HALEY_3, TRAINER_HALEY_4, TRAINER_HALEY_5}, 0x0, 0x13},
+ [REMATCH_JAMES] = {{TRAINER_JAMES_1, TRAINER_JAMES_2, TRAINER_JAMES_3, TRAINER_JAMES_4, TRAINER_JAMES_5}, 0x18, 0xb},
+ [REMATCH_TRENT] = {{TRAINER_TRENT_1, TRAINER_TRENT_2, TRAINER_TRENT_3, TRAINER_TRENT_4, TRAINER_TRENT_5}, 0x0, 0x1b},
+ [REMATCH_SAWYER] = {{TRAINER_SAWYER_1, TRAINER_SAWYER_2, TRAINER_SAWYER_3, TRAINER_SAWYER_4, TRAINER_SAWYER_5}, 0x18, 0xc},
+ [REMATCH_KIRA_AND_DAN] = {{TRAINER_KIRA_AND_DAN_1, TRAINER_KIRA_AND_DAN_2, TRAINER_KIRA_AND_DAN_3, TRAINER_KIRA_AND_DAN_4, TRAINER_KIRA_AND_DAN_5}, 0x18, 0x3e},
+ [REMATCH_WALLY_3] = {{TRAINER_WALLY_3, TRAINER_WALLY_4, TRAINER_WALLY_5, TRAINER_WALLY_6, TRAINER_WALLY_6}, 0x18, 0x2b},
+ [REMATCH_ROXANNE] = {{TRAINER_ROXANNE_1, TRAINER_ROXANNE_2, TRAINER_ROXANNE_3, TRAINER_ROXANNE_4, TRAINER_ROXANNE_5}, 0x0, 0x3},
+ [REMATCH_BRAWLY] = {{TRAINER_BRAWLY_1, TRAINER_BRAWLY_2, TRAINER_BRAWLY_3, TRAINER_BRAWLY_4, TRAINER_BRAWLY_5}, 0x0, 0xb},
+ [REMATCH_WATTSON] = {{TRAINER_WATTSON_1, TRAINER_WATTSON_2, TRAINER_WATTSON_3, TRAINER_WATTSON_4, TRAINER_WATTSON_5}, 0x0, 0x2},
+ [REMATCH_FLANNERY] = {{TRAINER_FLANNERY_1, TRAINER_FLANNERY_2, TRAINER_FLANNERY_3, TRAINER_FLANNERY_4, TRAINER_FLANNERY_5}, 0x0, 0xc},
+ [REMATCH_NORMAN] = {{TRAINER_NORMAN_1, TRAINER_NORMAN_2, TRAINER_NORMAN_3, TRAINER_NORMAN_4, TRAINER_NORMAN_5}, 0x0, 0x0},
+ [REMATCH_WINONA] = {{TRAINER_WINONA_1, TRAINER_WINONA_2, TRAINER_WINONA_3, TRAINER_WINONA_4, TRAINER_WINONA_5}, 0x0, 0x4},
+ [REMATCH_TATE_AND_LIZA] = {{TRAINER_TATE_AND_LIZA_1, TRAINER_TATE_AND_LIZA_2, TRAINER_TATE_AND_LIZA_3, TRAINER_TATE_AND_LIZA_4, TRAINER_TATE_AND_LIZA_5}, 0x0, 0x6},
+ [REMATCH_JUAN] = {{TRAINER_JUAN_1, TRAINER_JUAN_2, TRAINER_JUAN_3, TRAINER_JUAN_4, TRAINER_JUAN_5}, 0x0, 0x7},
+ [REMATCH_SIDNEY] = {{TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY}, 0x0, 0x8},
+ [REMATCH_PHOEBE] = {{TRAINER_PHOEBE, TRAINER_PHOEBE, TRAINER_PHOEBE, TRAINER_PHOEBE, TRAINER_PHOEBE}, 0x0, 0x8},
+ [REMATCH_GLACIA] = {{TRAINER_GLACIA, TRAINER_GLACIA, TRAINER_GLACIA, TRAINER_GLACIA, TRAINER_GLACIA}, 0x0, 0x8},
+ [REMATCH_DRAKE] = {{TRAINER_DRAKE, TRAINER_DRAKE, TRAINER_DRAKE, TRAINER_DRAKE, TRAINER_DRAKE}, 0x0, 0x8},
+ [REMATCH_WALLACE] = {{TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE}, 0x0, 0x8},
};
static const u16 sBadgeFlags[8] =
@@ -1545,7 +1545,7 @@ static bool32 sub_80B1D94(s32 rematchTableId)
{
if (rematchTableId >= REMATCH_ELITE_FOUR_ENTRIES)
return TRUE;
- else if (rematchTableId == REMATCH_WALLY_ENTRY)
+ else if (rematchTableId == REMATCH_WALLY_3)
return (FlagGet(FLAG_DEFEATED_WALLY_VICTORY_ROAD) == FALSE);
else
return FALSE;
@@ -1573,7 +1573,7 @@ static bool32 UpdateRandomTrainerRematches(const struct RematchTrainer *table, u
s32 i;
bool32 ret = FALSE;
- for (i = 0; i <= REMATCH_WALLY_ENTRY; i++)
+ for (i = 0; i <= REMATCH_WALLY_3; i++)
{
if (table[i].mapGroup == mapGroup && table[i].mapNum == mapNum && !sub_80B1D94(i))
{
diff --git a/src/berry_blender.c b/src/berry_blender.c
index c792b9b40..26327a634 100644
--- a/src/berry_blender.c
+++ b/src/berry_blender.c
@@ -940,7 +940,7 @@ static void InitBerryBlenderWindows(void)
FillWindowPixelBuffer(i, PIXEL_FILL(0));
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x1E, 0x14);
- sub_81978B0(0xE0);
+ Menu_LoadStdPalAt(0xE0);
}
}
diff --git a/src/berry_crush.c b/src/berry_crush.c
index dc4c546b0..51dbe8203 100755
--- a/src/berry_crush.c
+++ b/src/berry_crush.c
@@ -582,7 +582,7 @@ int sub_802130C(void)
ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP);
break;
case 6:
- sub_800E084();
+ DestroyWirelessStatusIndicatorSprite();
sub_8022960(var0);
sub_8034CC8();
break;
diff --git a/src/bug.c b/src/bug.c
index 88f93a3d5..4fa6a5bb6 100644
--- a/src/bug.c
+++ b/src/bug.c
@@ -6,7 +6,7 @@
void sub_8110368(struct Sprite *);
void sub_8110438(struct Sprite *);
-void sub_81104E4(struct Sprite *);
+void AnimTranslateWebThread(struct Sprite *);
void sub_81105B4(struct Sprite *);
void sub_811067C(struct Sprite *);
void AnimTranslateStinger(struct Sprite *);
@@ -90,7 +90,7 @@ const struct SpriteTemplate gUnknown_085969C8 =
.callback = sub_8110438,
};
-const struct SpriteTemplate gUnknown_085969E0 =
+const struct SpriteTemplate gWebThreadSpriteTemplate =
{
.tileTag = ANIM_TAG_WEB_THREAD,
.paletteTag = ANIM_TAG_WEB_THREAD,
@@ -98,7 +98,7 @@ const struct SpriteTemplate gUnknown_085969E0 =
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
- .callback = sub_81104E4,
+ .callback = AnimTranslateWebThread,
};
const struct SpriteTemplate gUnknown_085969F8 =
@@ -124,7 +124,7 @@ const union AffineAnimCmd *const gUnknown_08596A28[] =
gUnknown_08596A10,
};
-const struct SpriteTemplate gUnknown_08596A2C =
+const struct SpriteTemplate gSpiderWebSpriteTemplate =
{
.tileTag = ANIM_TAG_SPIDER_WEB,
.paletteTag = ANIM_TAG_SPIDER_WEB,
@@ -247,12 +247,19 @@ void sub_8110438(struct Sprite *sprite)
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
}
-void sub_81104E4(struct Sprite *sprite)
+// Creates a single web thread that travels from attacker to target.
+// Used by MOVE_STRING_SHOT and MOVE_SPIDER_WEB in their first move phase.
+// arg 0: x
+// arg 1: y
+// arg 2: controls the left-to-right movement
+// arg 3: amplitude
+// arg 4: if targets both opponents
+void AnimTranslateWebThread(struct Sprite *sprite)
{
if (IsContest())
gBattleAnimArgs[2] /= 2;
- InitSpritePosToAnimAttacker(sprite, 1);
+ InitSpritePosToAnimAttacker(sprite, TRUE);
sprite->data[0] = gBattleAnimArgs[2];
sprite->data[1] = sprite->pos1.x;
sprite->data[3] = sprite->pos1.y;
diff --git a/src/cable_car.c b/src/cable_car.c
index 42137e804..d44c9a241 100755..100644
--- a/src/cable_car.c
+++ b/src/cable_car.c
@@ -151,25 +151,46 @@ const struct SpritePalette gUnknown_085CDB74[] = {
{ }
};
-const struct OamData gOamData_85CDB84 = {
+const struct OamData gOamData_85CDB84 =
+{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
+ .objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x64),
+ .x = 0,
.size = SPRITE_SIZE(64x64),
- .priority = 2
+ .tileNum = 0,
+ .priority = 2,
+ .paletteNum = 0,
};
-const struct OamData gOamData_85CDB8C = {
+const struct OamData gOamData_85CDB8C =
+{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
+ .objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x8),
+ .x = 0,
.size = SPRITE_SIZE(16x8),
- .priority = 2
+ .tileNum = 0,
+ .priority = 2,
+ .paletteNum = 0,
};
-const struct OamData gOamData_85CDB94 = {
+const struct OamData gOamData_85CDB94 =
+{
+ .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
+ .objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x16),
+ .x = 0,
.size = SPRITE_SIZE(16x16),
- .priority = 2
+ .tileNum = 0,
+ .priority = 2,
+ .paletteNum = 0,
};
const struct SpriteTemplate gSpriteTemplate_85CDB9C[] =
@@ -1002,3 +1023,4 @@ static void sub_81514C8(u8 arg0)
sCableCar->unk1C = 0;
}
+
diff --git a/src/cable_club.c b/src/cable_club.c
index b80e76e99..fab187b07 100644
--- a/src/cable_club.c
+++ b/src/cable_club.c
@@ -17,7 +17,8 @@
#include "menu.h"
#include "overworld.h"
#include "palette.h"
-#include "rom_8011DC0.h"
+#include "union_room.h"
+#include "mevent2.h"
#include "script.h"
#include "script_pokemon_util_80F87D8.h"
#include "sound.h"
diff --git a/src/contest.c b/src/contest.c
index 114a1fb69..02d7038cf 100644
--- a/src/contest.c
+++ b/src/contest.c
@@ -218,12 +218,6 @@ EWRAM_DATA u8 gUnknown_02039F5D = 0;
// IWRAM common vars.
u32 gContestRngValue;
-extern const u16 gUnknown_08587C30[];
-extern const struct BgTemplate gUnknown_08587F34[4];
-extern const struct WindowTemplate gUnknown_08587F44[];
-extern const u8 *const gUnknown_08587D90[];
-extern const u8 *const gUnknown_08587F08[];
-extern const u8 *const gUnknown_08587F1C[];
extern const u8 *const gUnknown_0827E8DA[];
extern const u8 gText_0827D55A[];
extern const u8 gText_0827E793[];
@@ -248,33 +242,604 @@ extern const u8 gText_Contest_Fear[];
extern const u8 gText_BDot[];
extern const u8 gText_CDot[];
extern const u8 *const gUnknown_08587E10[];
-extern const struct ContestPokemon gContestOpponents[96];
-extern const u8 gUnknown_085898A4[96];
-extern const struct CompressedSpriteSheet gUnknown_08587C00;
-extern const struct SpriteTemplate gSpriteTemplate_8587BE8;
-extern const struct CompressedSpriteSheet gUnknown_08587C08;
-extern const struct CompressedSpritePalette gUnknown_08587C10;
-extern const struct SpriteTemplate gSpriteTemplate_8587C18;
extern const union AffineAnimCmd *const gUnknown_082FF6C0[];
extern const union AffineAnimCmd *const gUnknown_082FF694[];
-extern const u8 *const gContestEffectDescriptionPointers[];
-extern const struct SpriteSheet gUnknown_08587A74;
-extern const u8 gUnknown_08587A6C[];
extern const struct SpriteTemplate gSpriteTemplate_8587AD0;
-extern const struct SpritePalette gUnknown_08587B08;
-extern const struct CompressedSpriteSheet gUnknown_08587AE8[];
extern const struct SpriteTemplate gSpriteTemplate_8587B18[];
-extern const u8 gUnknown_08587A70[];
-extern const struct SubspriteTable gSubspriteTables_8587B80[];
-extern const struct CompressedSpriteSheet gUnknown_08587BB0;
-extern const struct SpritePalette gUnknown_08587BB8;
-extern const struct SpriteTemplate gSpriteTemplate_8587BC8;
extern void (*const gContestEffectFuncs[])(void);
-extern const s8 gContestExcitementTable[][5];
-extern const struct ContestWinner gUnknown_08587FA4[];
-extern const struct CompressedSpriteSheet gUnknown_08589904[];
-extern const struct SpritePalette gUnknown_08589924[];
-extern const struct SpriteTemplate gSpriteTemplate_858998C[];
+
+static const u8 gUnknown_08587A6C[] =
+{
+ 0x24, 0x4C, 0x74, 0x9C
+};
+
+static const u8 gUnknown_08587A70[] =
+{
+ 0x24, 0x4C, 0x74, 0x9C
+};
+
+static const struct SpriteSheet gUnknown_08587A74 =
+{
+ .data = gTiles_8C19450,
+ .size = 0x20,
+ .tag = 0x4E20
+};
+
+static const struct OamData gOamData_8587A7C =
+{
+ .y = 0,
+ .affineMode = 0,
+ .objMode = 0,
+ .mosaic = 0,
+ .bpp = 0,
+ .shape = SPRITE_SHAPE(8x8),
+ .x = 0,
+ .matrixNum = 0,
+ .size = SPRITE_SIZE(8x8),
+ .tileNum = 0,
+ .priority = 0,
+ .paletteNum = 0,
+ .affineParam = 0
+};
+
+static const union AffineAnimCmd gSpriteAffineAnim_8587A84[] =
+{
+ AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0),
+ AFFINEANIMCMD_END,
+};
+
+static const union AffineAnimCmd gSpriteAffineAnim_8587A94[] =
+{
+ AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0),
+ AFFINEANIMCMD_FRAME(0xFFF6, 0xFFF6, -20, 20),
+ AFFINEANIMCMD_END
+};
+
+static const union AffineAnimCmd gSpriteAffineAnim_8587AAC[] =
+{
+ AFFINEANIMCMD_FRAME(0x38, 0x38, 0, 0),
+ AFFINEANIMCMD_FRAME(10, 10, 20, 20),
+ AFFINEANIMCMD_END
+};
+
+static const union AffineAnimCmd* const gSpriteAffineAnimTable_8587AC4[] =
+{
+ gSpriteAffineAnim_8587A84,
+ gSpriteAffineAnim_8587A94,
+ gSpriteAffineAnim_8587AAC
+};
+
+static const struct SpriteTemplate gSpriteTemplate_8587AD0 =
+{
+ .tileTag = 0x4E20,
+ .paletteTag = 0xABE0,
+ .oam = &gOamData_8587A7C,
+ .anims = gDummySpriteAnimTable,
+ .images = NULL,
+ .affineAnims = gSpriteAffineAnimTable_8587AC4,
+ .callback = SpriteCallbackDummy
+};
+
+static const struct CompressedSpriteSheet gUnknown_08587AE8[] =
+{
+ {
+ .data = gContestNextTurnGfx,
+ .size = 0x100,
+ .tag = 0x4E22
+ },
+ {
+ .data = gContestNextTurnGfx,
+ .size = 0x100,
+ .tag = 0x4E23
+ },
+ {
+ .data = gContestNextTurnGfx,
+ .size = 0x100,
+ .tag = 0x4E24
+ },
+ {
+ .data = gContestNextTurnGfx,
+ .size = 0x100,
+ .tag = 0x4E25
+ }
+};
+
+static const struct SpritePalette gUnknown_08587B08 =
+{
+ .data = gContestPal,
+ .tag = 0x4E22
+};
+
+static const struct OamData gOamData_8587B10 =
+{
+ .y = 0,
+ .affineMode = 0,
+ .objMode = 0,
+ .mosaic = 0,
+ .bpp = 0,
+ .shape = SPRITE_SHAPE(32x8),
+ .x = 0,
+ .matrixNum = 0,
+ .size = SPRITE_SIZE(32x8),
+ .tileNum = 0,
+ .priority = 0,
+ .paletteNum = 0,
+ .affineParam = 0
+};
+
+static const struct SpriteTemplate gSpriteTemplate_8587B18[] =
+{
+ {
+ .tileTag = 0x4E22,
+ .paletteTag = 0x4E22,
+ .oam = &gOamData_8587B10,
+ .anims = gDummySpriteAnimTable,
+ .images = NULL,
+ .affineAnims = gDummySpriteAffineAnimTable,
+ .callback = SpriteCallbackDummy,
+ },
+ {
+ .tileTag = 0x4E23,
+ .paletteTag = 0x4E22,
+ .oam = &gOamData_8587B10,
+ .anims = gDummySpriteAnimTable,
+ .images = NULL,
+ .affineAnims = gDummySpriteAffineAnimTable,
+ .callback = SpriteCallbackDummy,
+ },
+ {
+ .tileTag = 0x4E24,
+ .paletteTag = 0x4E22,
+ .oam = &gOamData_8587B10,
+ .anims = gDummySpriteAnimTable,
+ .images = NULL,
+ .affineAnims = gDummySpriteAffineAnimTable,
+ .callback = SpriteCallbackDummy,
+ },
+ {
+ .tileTag = 0x4E25,
+ .paletteTag = 0x4E22,
+ .oam = &gOamData_8587B10,
+ .anims = gDummySpriteAnimTable,
+ .images = NULL,
+ .affineAnims = gDummySpriteAffineAnimTable,
+ .callback = SpriteCallbackDummy,
+ }
+};
+
+const struct Subsprite gSubspriteTable_8587B78[] =
+{
+ {
+ .x = -28,
+ .y = -4,
+ .shape = ST_OAM_H_RECTANGLE,
+ .size = 1,
+ .tileOffset = 0,
+ .priority = 0
+ },
+ {
+ .x = 4,
+ .y = -4,
+ .shape = ST_OAM_H_RECTANGLE,
+ .size = 1,
+ .tileOffset = 4,
+ .priority = 0
+ }
+};
+
+const struct SubspriteTable gSubspriteTables_8587B80[] =
+{
+ {
+ .subspriteCount = 2,
+ .subsprites = gSubspriteTable_8587B78
+ }
+};
+
+const struct CompressedSpriteSheet gUnknown_08587B88 =
+{
+ .data = gUnknown_08C19168,
+ .size = 0x180,
+ .tag = 0xABE1
+};
+
+const struct OamData gOamData_8587B90 =
+{
+ .y = 0,
+ .affineMode = ST_OAM_AFFINE_OFF,
+ .objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
+ .shape = SPRITE_SHAPE(16x16),
+ .x = 0,
+ .size = SPRITE_SIZE(16x16),
+ .tileNum = 0,
+ .priority = 0,
+ .paletteNum = 0,
+};
+
+const struct SpriteTemplate gSpriteTemplate_8587B98 =
+{
+ .tileTag = 0xABE1,
+ .paletteTag = 0xABE0,
+ .oam = &gOamData_8587B90,
+ .anims = gDummySpriteAnimTable,
+ .images = NULL,
+ .affineAnims = gDummySpriteAffineAnimTable,
+ .callback = SpriteCallbackDummy
+};
+
+const struct CompressedSpriteSheet gUnknown_08587BB0 =
+{
+ .data = gContestApplauseGfx,
+ .size = 0x400,
+ .tag = 0xABE2
+};
+
+const struct SpritePalette gUnknown_08587BB8 =
+{
+ .data = gContestPal,
+ .tag = 0xABE2
+};
+
+const struct OamData gOamData_8587BC0 =
+{
+ .y = 0,
+ .affineMode = ST_OAM_AFFINE_OFF,
+ .objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
+ .shape = SPRITE_SHAPE(64x32),
+ .x = 0,
+ .size = SPRITE_SIZE(64x32),
+ .tileNum = 0,
+ .priority = 0,
+ .paletteNum = 0,
+};
+
+const struct SpriteTemplate gSpriteTemplate_8587BC8 =
+{
+ .tileTag = 0xABE2,
+ .paletteTag = 0xABE2,
+ .oam = &gOamData_8587BC0,
+ .anims = gDummySpriteAnimTable,
+ .images = NULL,
+ .affineAnims = gDummySpriteAffineAnimTable,
+ .callback = SpriteCallbackDummy
+};
+
+const struct OamData gOamData_8587BE0 =
+{
+ .y = 0,
+ .affineMode = ST_OAM_AFFINE_OFF,
+ .objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
+ .shape = SPRITE_SHAPE(64x64),
+ .x = 0,
+ .size = SPRITE_SIZE(64x64),
+ .tileNum = 0,
+ .priority = 3,
+ .paletteNum = 2,
+};
+
+const struct SpriteTemplate gSpriteTemplate_8587BE8 =
+{
+ .tileTag = 0x4E21,
+ .paletteTag = 0x4E21,
+ .oam = &gOamData_8587BE0,
+ .anims = gDummySpriteAnimTable,
+ .images = NULL,
+ .affineAnims = gDummySpriteAffineAnimTable,
+ .callback = SpriteCallbackDummy
+};
+
+const struct CompressedSpriteSheet gUnknown_08587C00 =
+{
+ .data = gContestJudgeGfx,
+ .size = 0x800,
+ .tag = 0x4E21
+};
+
+const struct CompressedSpriteSheet gUnknown_08587C08 =
+{
+ .data = gContestJudgeSymbolsGfx,
+ .size = 0x380,
+ .tag = 0xABE0
+};
+
+const struct CompressedSpritePalette gUnknown_08587C10 =
+{
+ .data = gContest3Pal,
+ .tag = 0xABE0
+};
+
+const struct SpriteTemplate gSpriteTemplate_8587C18 =
+{
+ .tileTag = 0xABE0,
+ .paletteTag = 0xABE0,
+ .oam = &gUnknown_0852490C,
+ .anims = gDummySpriteAnimTable,
+ .images = NULL,
+ .affineAnims = gDummySpriteAffineAnimTable,
+ .callback = SpriteCallbackDummy
+};
+
+const u16 gUnknown_08587C30[] = INCBIN_U16("graphics/unknown/unknown_587C30.gbapal");
+
+#include "data/contest_text_tables.h"
+
+const struct BgTemplate gUnknown_08587F34[] =
+{
+ {
+ .bg = 0,
+ .charBaseIndex = 0,
+ .mapBaseIndex = 0x18,
+ .screenSize = 2,
+ .paletteMode = 0,
+ .priority = 0,
+ .baseTile = 0
+ },
+ {
+ .bg = 1,
+ .charBaseIndex = 2,
+ .mapBaseIndex = 0x1E,
+ .screenSize = 2,
+ .paletteMode = 0,
+ .priority = 1,
+ .baseTile = 0
+ },
+ {
+ .bg = 2,
+ .charBaseIndex = 0,
+ .mapBaseIndex = 0x1C,
+ .screenSize = 2,
+ .paletteMode = 0,
+ .priority = 0,
+ .baseTile = 0
+ },
+ {
+ .bg = 3,
+ .charBaseIndex = 0,
+ .mapBaseIndex = 0x1A,
+ .screenSize = 0,
+ .paletteMode = 0,
+ .priority = 3,
+ .baseTile = 0
+ }
+};
+
+const struct WindowTemplate gUnknown_08587F44[] =
+{
+ {
+ .bg = 0,
+ .tilemapLeft = 18,
+ .tilemapTop = 0,
+ .width = 12,
+ .height = 2,
+ .paletteNum = 0xF,
+ .baseBlock = 0x200
+ },
+ {
+ .bg = 0,
+ .tilemapLeft = 18,
+ .tilemapTop = 5,
+ .width = 12,
+ .height = 2,
+ .paletteNum = 0xF,
+ .baseBlock = 0x218
+ },
+ {
+ .bg = 0,
+ .tilemapLeft = 18,
+ .tilemapTop = 10,
+ .width = 12,
+ .height = 2,
+ .paletteNum = 0xF,
+ .baseBlock = 0x230
+ },
+ {
+ .bg = 0,
+ .tilemapLeft = 18,
+ .tilemapTop = 15,
+ .width = 12,
+ .height = 2,
+ .paletteNum = 0xF,
+ .baseBlock = 0x248
+ },
+ {
+ .bg = 0,
+ .tilemapLeft = 1,
+ .tilemapTop = 15,
+ .width = 17,
+ .height = 4,
+ .paletteNum = 0xF,
+ .baseBlock = 0x260
+ },
+ {
+ .bg = 0,
+ .tilemapLeft = 1,
+ .tilemapTop = 0x1F,
+ .width = 9,
+ .height = 2,
+ .paletteNum = 0xF,
+ .baseBlock = 0x2A4
+ },
+ {
+ .bg = 0,
+ .tilemapLeft = 1,
+ .tilemapTop = 0x21,
+ .width = 9,
+ .height = 2,
+ .paletteNum = 0xF,
+ .baseBlock = 0x2B6
+ },
+ {
+ .bg = 0,
+ .tilemapLeft = 1,
+ .tilemapTop = 0x23,
+ .width = 9,
+ .height = 2,
+ .paletteNum = 0xF,
+ .baseBlock = 0x2C8
+ },
+ {
+ .bg = 0,
+ .tilemapLeft = 1,
+ .tilemapTop = 0x25,
+ .width = 9,
+ .height = 2,
+ .paletteNum = 0xF,
+ .baseBlock = 0x2DA
+ },
+ {
+ .bg = 0,
+ .tilemapLeft = 16,
+ .tilemapTop = 0x1F,
+ .width = 1,
+ .height = 2,
+ .paletteNum = 0xF,
+ .baseBlock = 0x2EC
+ },
+ {
+ .bg = 0,
+ .tilemapLeft = 11,
+ .tilemapTop = 0x23,
+ .width = 18,
+ .height = 4,
+ .paletteNum = 0xF,
+ .baseBlock = 0x2EE
+ },
+ DUMMY_WIN_TEMPLATE
+};
+
+#include "data/contest_opponents.h"
+
+static const struct CompressedSpriteSheet sUnknown_08589904[] =
+{
+ {
+ .data = gBlankGfxCompressed,
+ .size = 0x1000,
+ .tag = 0x80E8
+ },
+ {
+ .data = gBlankGfxCompressed,
+ .size = 0x1000,
+ .tag = 0x80E9
+ },
+ {
+ .data = gBlankGfxCompressed,
+ .size = 0x1000,
+ .tag = 0x80EA
+ },
+ {
+ .data = gBlankGfxCompressed,
+ .size = 0x1000,
+ .tag = 0x80EB
+ }
+};
+
+// Yup this is super dangerous but that's how it is here
+static const struct SpritePalette sUnknown_08589924[] =
+{
+ {
+ .data = (u16*)(gHeap + 0x1A0A4),
+ .tag = 0x80E8
+ },
+ {
+ .data = (u16*)(gHeap + 0x1A0C4),
+ .tag = 0x80E9
+ },
+ {
+ .data = (u16*)(gHeap + 0x1A0E4),
+ .tag = 0x80EA
+ },
+ {
+ .data = (u16*)(gHeap + 0x1A104),
+ .tag = 0x80EB
+ }
+};
+
+const struct OamData gOamData_8589944 =
+{
+ .y = 0,
+ .affineMode = ST_OAM_AFFINE_DOUBLE,
+ .objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
+ .shape = SPRITE_SHAPE(64x64),
+ .x = 0,
+ .size = SPRITE_SIZE(64x64),
+ .tileNum = 0,
+ .priority = 0,
+ .paletteNum = 0,
+ .affineParam = 0,
+};
+
+const union AffineAnimCmd gSpriteAffineAnim_858994C[] =
+{
+ AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0),
+ AFFINEANIMCMD_END
+};
+
+const union AffineAnimCmd gSpriteAffineAnim_858995C[] =
+{
+ AFFINEANIMCMD_FRAME(3, 3, 0, 15),
+ AFFINEANIMCMD_FRAME(-3, -3, 0, 15),
+ AFFINEANIMCMD_FRAME(3, 3, 0, 15),
+ AFFINEANIMCMD_FRAME(-3, -3, 0, 15),
+ AFFINEANIMCMD_END
+};
+
+const union AffineAnimCmd *const gSpriteAffineAnimTable_8589984[] =
+{
+ gSpriteAffineAnim_858994C,
+ gSpriteAffineAnim_858995C
+};
+
+const struct SpriteTemplate gSpriteTemplate_858998C[] =
+{
+ {
+ .tileTag = 0x80E8,
+ .paletteTag = 0x80E8,
+ .oam = &gOamData_8589944,
+ .anims = gDummySpriteAnimTable,
+ .images = NULL,
+ .affineAnims = gSpriteAffineAnimTable_8589984,
+ .callback = SpriteCallbackDummy
+ },
+ {
+ .tileTag = 0x80E9,
+ .paletteTag = 0x80E9,
+ .oam = &gOamData_8589944,
+ .anims = gDummySpriteAnimTable,
+ .images = NULL,
+ .affineAnims = gSpriteAffineAnimTable_8589984,
+ .callback = SpriteCallbackDummy
+ },
+ {
+ .tileTag = 0x80EA,
+ .paletteTag = 0x80EA,
+ .oam = &gOamData_8589944,
+ .anims = gDummySpriteAnimTable,
+ .images = NULL,
+ .affineAnims = gSpriteAffineAnimTable_8589984,
+ .callback = SpriteCallbackDummy
+ },
+ {
+ .tileTag = 0x80EB,
+ .paletteTag = 0x80EB,
+ .oam = &gOamData_8589944,
+ .anims = gDummySpriteAnimTable,
+ .images = NULL,
+ .affineAnims = gSpriteAffineAnimTable_8589984,
+ .callback = SpriteCallbackDummy
+ }
+};
+
+const s8 gContestExcitementTable[][5] =
+{
+ { 1, 0, -1, -1, 0},
+ { 0, 1, 0, -1, -1},
+ {-1, 0, 1, 0, -1},
+ {-1, -1, 0, 1, 0},
+ { 0, -1, -1, 0, 1}
+};
static void TaskDummy1(u8 taskId)
{
@@ -2118,7 +2683,7 @@ void sub_80DAB8C(u8 contestType, u8 rank)
r7 = TRUE;
// Find all suitable opponents
- r3 = gUnknown_085898A4;
+ r3 = gPostgameContestOpponentFilter;
for (i = 0; i < ARRAY_COUNT(gContestOpponents); i++)
{
if (rank == gContestOpponents[i].whichRank)
@@ -2178,12 +2743,12 @@ void sub_80DACBC(u8 contestType, u8 rank, bool32 isPostgame)
if (isPostgame == TRUE)
{
- if (gUnknown_085898A4[i] == 1)
+ if (gPostgameContestOpponentFilter[i] == CONTEST_FILTER_NO_POSTGAME)
continue;
}
else
{
- if (gUnknown_085898A4[i] == 2)
+ if (gPostgameContestOpponentFilter[i] == CONTEST_FILTER_ONLY_POSTGAME)
continue;
}
if ((contestType == CONTEST_CATEGORY_COOL && gContestOpponents[i].aiPool_Cool)
@@ -3317,8 +3882,8 @@ static u8 sub_80DC9EC(u8 a)
u8 spriteId1, spriteId2;
u8 x = gUnknown_02039F26[a] * 40 + 32;
- LoadCompressedSpriteSheet(&gUnknown_08589904[a]);
- LoadSpritePalette(&gUnknown_08589924[a]);
+ LoadCompressedSpriteSheet(&sUnknown_08589904[a]);
+ LoadSpritePalette(&sUnknown_08589924[a]);
spriteId1 = CreateSprite(&gSpriteTemplate_858998C[a], 184, x, 29);
spriteId2 = CreateSprite(&gSpriteTemplate_858998C[a], 248, x, 29);
gSprites[spriteId2].oam.tileNum += 64;
@@ -5186,3 +5751,5 @@ void sub_80DFA08(struct ContestPokemon *mon, s32 language)
name[PLAYER_NAME_LENGTH] = EOS;
}
}
+
+
diff --git a/src/contest_link_80F57C4.c b/src/contest_link_80F57C4.c
index a4b88c074..59f41d72a 100644
--- a/src/contest_link_80F57C4.c
+++ b/src/contest_link_80F57C4.c
@@ -778,7 +778,7 @@ static void sub_80F677C(u8 taskId)
if (!gReceivedRemoteLinkPlayers)
{
if (gIsLinkContest & 0x2)
- sub_800E084();
+ DestroyWirelessStatusIndicatorSprite();
sub_80F7144();
gTasks[taskId].func = sub_80F67C4;
diff --git a/src/contest_painting.c b/src/contest_painting.c
index 29f3c871d..87598f2bd 100644
--- a/src/contest_painting.c
+++ b/src/contest_painting.c
@@ -152,16 +152,14 @@ const struct OamData gUnknown_085B0830 =
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
- .mosaic = 1,
+ .mosaic = TRUE,
.bpp = ST_OAM_8BPP,
.shape = SPRITE_SHAPE(64x64),
.x = 0,
- .matrixNum = 0,
.size = SPRITE_SIZE(64x64),
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
- .affineParam = 0,
};
const u16 gUnknown_085B0838[] = {RGB(0, 0, 0), RGB(0, 0, 0)};
@@ -705,3 +703,4 @@ static void sub_8130884(u8 arg0, u8 arg1)
sub_8130688(arg0);
sub_8130430(arg0, arg1);
}
+
diff --git a/src/dark.c b/src/dark.c
index 80ce61800..482c09c04 100644
--- a/src/dark.c
+++ b/src/dark.c
@@ -803,17 +803,23 @@ void sub_81144BC(struct Sprite *sprite)
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
}
-void sub_81144F8(u8 taskId)
+// Makes the attacker metallic and shining.
+// Used by MOVE_HARDEN and MOVE_IRON_DEFENSE.
+// arg0: if true won't change battler's palette back
+// arg1: if true, use custom color
+// arg2: custom color
+// Custom color argument is used in MOVE_POISON_TAIL to make the mon turn purplish/pinkish as if became cloaked in poison.
+void AnimTask_MetallicShine(u8 taskId)
{
u16 species;
u8 spriteId;
u8 newSpriteId;
u16 paletteNum;
struct BattleAnimBgData animBg;
- int var0 = 0;
+ bool32 priorityChanged = FALSE;
- gBattle_WIN0H = var0;
- gBattle_WIN0V = var0;
+ gBattle_WIN0H = 0;
+ gBattle_WIN0V = 0;
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR);
SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR | WINOUT_WIN01_BG0 | WINOUT_WIN01_BG2 | WINOUT_WIN01_BG3 | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR);
SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_OBJWIN_ON);
@@ -832,7 +838,7 @@ void sub_81144F8(u8 taskId)
{
gSprites[gBattlerSpriteIds[BATTLE_PARTNER(gBattleAnimAttacker)]].oam.priority--;
SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1);
- var0 = 1;
+ priorityChanged = TRUE;
}
}
}
@@ -861,7 +867,7 @@ void sub_81144F8(u8 taskId)
gBattle_BG1_Y = -gSprites[spriteId].pos1.y + 32;
paletteNum = 16 + gSprites[spriteId].oam.paletteNum;
- if (gBattleAnimArgs[1] == 0)
+ if (gBattleAnimArgs[1] == 0)
SetGreyscaleOrOriginalPalette(paletteNum, FALSE);
else
BlendPalette(paletteNum * 16, 16, 11, gBattleAnimArgs[2]);
@@ -870,7 +876,7 @@ void sub_81144F8(u8 taskId)
gTasks[taskId].data[1] = gBattleAnimArgs[0];
gTasks[taskId].data[2] = gBattleAnimArgs[1];
gTasks[taskId].data[3] = gBattleAnimArgs[2];
- gTasks[taskId].data[6] = var0;
+ gTasks[taskId].data[6] = priorityChanged;
gTasks[taskId].func = sub_8114748;
}
@@ -879,29 +885,28 @@ static void sub_8114748(u8 taskId)
struct BattleAnimBgData animBg;
u16 paletteNum;
u8 spriteId;
- u8 taskIdCopy = taskId;
- gTasks[taskIdCopy].data[10] += 4;
+ gTasks[taskId].data[10] += 4;
gBattle_BG1_X -= 4;
- if (gTasks[taskIdCopy].data[10] == 128)
+ if (gTasks[taskId].data[10] == 128)
{
- gTasks[taskIdCopy].data[10] = 0;
+ gTasks[taskId].data[10] = 0;
gBattle_BG1_X += 128;
- gTasks[taskIdCopy].data[11]++;
- if (gTasks[taskIdCopy].data[11] == 2)
+ gTasks[taskId].data[11]++;
+ if (gTasks[taskId].data[11] == 2)
{
spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
paletteNum = 16 + gSprites[spriteId].oam.paletteNum;
- if (gTasks[taskIdCopy].data[1] == 0)
+ if (gTasks[taskId].data[1] == 0)
SetGreyscaleOrOriginalPalette(paletteNum, 1);
- DestroySprite(&gSprites[gTasks[taskIdCopy].data[0]]);
+ DestroySprite(&gSprites[gTasks[taskId].data[0]]);
sub_80A6B30(&animBg);
sub_80A6C68(animBg.bgId);
- if (gTasks[taskIdCopy].data[6] == 1)
+ if (gTasks[taskId].data[6] == 1)
gSprites[gBattlerSpriteIds[BATTLE_PARTNER(gBattleAnimAttacker)]].oam.priority++;
}
- else if (gTasks[taskIdCopy].data[11] == 3)
+ else if (gTasks[taskId].data[11] == 3)
{
gBattle_WIN0H = 0;
gBattle_WIN0V = 0;
@@ -918,7 +923,10 @@ static void sub_8114748(u8 taskId)
}
}
-void sub_811489C(u8 taskId)
+// Changes battler's palette to either greyscale or original.
+// arg0: which battler
+// arg1: 0 grayscale, 1 original
+void AnimTask_SetGreyscaleOrOriginalPal(u8 taskId)
{
u8 spriteId;
u8 battler;
diff --git a/src/data/contest_opponents.h b/src/data/contest_opponents.h
new file mode 100644
index 000000000..ef1fdba9f
--- /dev/null
+++ b/src/data/contest_opponents.h
@@ -0,0 +1,3066 @@
+
+#include "global.h"
+#include "contest.h"
+#include "constants/species.h"
+
+#define CONTEST_OPPONENT_JIMMY 0
+#define CONTEST_OPPONENT_EDITH 1
+#define CONTEST_OPPONENT_EVAN 2
+#define CONTEST_OPPONENT_KELSEY 3
+#define CONTEST_OPPONENT_MADISON 4
+#define CONTEST_OPPONENT_RAYMOND 5
+#define CONTEST_OPPONENT_GRANT 6
+#define CONTEST_OPPONENT_PAIGE 7
+#define CONTEST_OPPONENT_ALEC 8
+#define CONTEST_OPPONENT_SYDNEY 9
+#define CONTEST_OPPONENT_MORRIS 10
+#define CONTEST_OPPONENT_MARIAH 11
+#define CONTEST_OPPONENT_RUSSELL 12
+#define CONTEST_OPPONENT_MELANIE 13
+#define CONTEST_OPPONENT_CHANCE 14
+#define CONTEST_OPPONENT_AGATHA 15
+#define CONTEST_OPPONENT_BEAU 16
+#define CONTEST_OPPONENT_KAY 17
+#define CONTEST_OPPONENT_CALE 18
+#define CONTEST_OPPONENT_CAITLIN 19
+#define CONTEST_OPPONENT_COLBY 20
+#define CONTEST_OPPONENT_KYLIE 21
+#define CONTEST_OPPONENT_LIAM 22
+#define CONTEST_OPPONENT_MILO 23
+#define CONTEST_OPPONENT_KARINA 24
+#define CONTEST_OPPONENT_BOBBY 25
+#define CONTEST_OPPONENT_CLAIRE 26
+#define CONTEST_OPPONENT_WILLIE 27
+#define CONTEST_OPPONENT_CASSIDY 28
+#define CONTEST_OPPONENT_MORGAN 29
+#define CONTEST_OPPONENT_SUMMER 30
+#define CONTEST_OPPONENT_MILES 31
+#define CONTEST_OPPONENT_AUDREY 32
+#define CONTEST_OPPONENT_AVERY 33
+#define CONTEST_OPPONENT_ARIANA 34
+#define CONTEST_OPPONENT_ASHTON 35
+#define CONTEST_OPPONENT_SANDRA 36
+#define CONTEST_OPPONENT_CARSON 37
+#define CONTEST_OPPONENT_KATRINA 38
+#define CONTEST_OPPONENT_LUKE 39
+#define CONTEST_OPPONENT_RAUL 40
+#define CONTEST_OPPONENT_JADA 41
+#define CONTEST_OPPONENT_ZEEK 42
+#define CONTEST_OPPONENT_DIEGO 43
+#define CONTEST_OPPONENT_ALIYAH 44
+#define CONTEST_OPPONENT_NATALIA 45
+#define CONTEST_OPPONENT_DEVIN 46
+#define CONTEST_OPPONENT_TYLOR 47
+#define CONTEST_OPPONENT_RONNIE 48
+#define CONTEST_OPPONENT_CLAUDIA 49
+#define CONTEST_OPPONENT_ELIAS 50
+#define CONTEST_OPPONENT_JADE 51
+#define CONTEST_OPPONENT_FRANCIS 52
+#define CONTEST_OPPONENT_ALISHA 53
+#define CONTEST_OPPONENT_SAUL 54
+#define CONTEST_OPPONENT_FELICIA 55
+#define CONTEST_OPPONENT_EMILIO 56
+#define CONTEST_OPPONENT_KARLA 57
+#define CONTEST_OPPONENT_DARRYL 58
+#define CONTEST_OPPONENT_SELENA 59
+#define CONTEST_OPPONENT_NOEL 60
+#define CONTEST_OPPONENT_LACEY 61
+#define CONTEST_OPPONENT_CORBIN 62
+#define CONTEST_OPPONENT_GRACIE 63
+#define CONTEST_OPPONENT_COLTIN 64
+#define CONTEST_OPPONENT_ELLIE 65
+#define CONTEST_OPPONENT_MARCUS 66
+#define CONTEST_OPPONENT_KIARA 67
+#define CONTEST_OPPONENT_BRYCE 68
+#define CONTEST_OPPONENT_JAMIE 69
+#define CONTEST_OPPONENT_JORGE 70
+#define CONTEST_OPPONENT_DEVON 71
+#define CONTEST_OPPONENT_JUSTINA 72
+#define CONTEST_OPPONENT_RALPH 73
+#define CONTEST_OPPONENT_ROSA 74
+#define CONTEST_OPPONENT_KEATON 75
+#define CONTEST_OPPONENT_MAYRA 76
+#define CONTEST_OPPONENT_LAMAR 77
+#define CONTEST_OPPONENT_AUBREY 78
+#define CONTEST_OPPONENT_NIGEL 79
+#define CONTEST_OPPONENT_CAMILLE 80
+#define CONTEST_OPPONENT_DEON 81
+#define CONTEST_OPPONENT_JANELLE 82
+#define CONTEST_OPPONENT_HEATH 83
+#define CONTEST_OPPONENT_SASHA 84
+#define CONTEST_OPPONENT_FRANKIE 85
+#define CONTEST_OPPONENT_HELEN 86
+#define CONTEST_OPPONENT_CAMILE 87
+#define CONTEST_OPPONENT_MARTIN 88
+#define CONTEST_OPPONENT_SERGIO 89
+#define CONTEST_OPPONENT_KAILEY 90
+#define CONTEST_OPPONENT_PERLA 91
+#define CONTEST_OPPONENT_CLARA 92
+#define CONTEST_OPPONENT_JAKOB 93
+#define CONTEST_OPPONENT_TREY 94
+#define CONTEST_OPPONENT_LANE 95
+
+const struct ContestWinner gUnknown_08587FA4[] =
+{
+ {
+ .personality = 0,
+ .trainerId = 0xFFFF,
+ .species = SPECIES_ELECTRIKE,
+ .contestCategory = CONTEST_CATEGORY_CUTE,
+ .monName = _("ELECTER"),
+ .trainerName = _("EZRA"),
+ .contestRank = CONTEST_RANK_NORMAL
+ },
+ {
+ .personality = 0,
+ .trainerId = 0xFFFF,
+ .species = SPECIES_TROPIUS,
+ .contestCategory = CONTEST_CATEGORY_COOL,
+ .monName = _("TROPO"),
+ .trainerName = _("ALLAN"),
+ .contestRank = CONTEST_RANK_HYPER
+ },
+ {
+ .personality = 0,
+ .trainerId = 0xFFFF,
+ .species = SPECIES_XATU,
+ .contestCategory = CONTEST_CATEGORY_BEAUTY,
+ .monName = _("TUXA"),
+ .trainerName = _("JULIET"),
+ .contestRank = CONTEST_RANK_NORMAL
+ },
+ {
+ .personality = 0,
+ .trainerId = 0xFFFF,
+ .species = SPECIES_PLUSLE,
+ .contestCategory = CONTEST_CATEGORY_TOUGH,
+ .monName = _("PULSE"),
+ .trainerName = _("BAILY"),
+ .contestRank = CONTEST_RANK_MASTER
+ },
+ {
+ .personality = 0,
+ .trainerId = 0xFFFF,
+ .species = SPECIES_SHUPPET,
+ .contestCategory = CONTEST_CATEGORY_SMART,
+ .monName = _("SHUPUP"),
+ .trainerName = _("MELANY"),
+ .contestRank = CONTEST_RANK_SUPER
+ },
+ {
+ .personality = 0,
+ .trainerId = 0xFFFF,
+ .species = SPECIES_ZANGOOSE,
+ .contestCategory = CONTEST_CATEGORY_COOL,
+ .monName = _("GOOZAN"),
+ .trainerName = _("HANA"),
+ .contestRank = CONTEST_RANK_HYPER
+ },
+ {
+ .personality = 0,
+ .trainerId = 0xFFFF,
+ .species = SPECIES_LOUDRED,
+ .contestCategory = CONTEST_CATEGORY_BEAUTY,
+ .monName = _("LOUDED"),
+ .trainerName = _("BRYANT"),
+ .contestRank = CONTEST_RANK_HYPER
+ },
+ {
+ .personality = 0,
+ .trainerId = 0xFFFF,
+ .species = SPECIES_DELCATTY,
+ .contestCategory = CONTEST_CATEGORY_CUTE,
+ .monName = _("KITSY"),
+ .trainerName = _("OMAR"),
+ .contestRank = CONTEST_RANK_MASTER
+ }
+};
+
+const struct ContestPokemon gContestOpponents[] =
+{
+ [CONTEST_OPPONENT_JIMMY] = {
+ .species = SPECIES_POOCHYENA,
+ .nickname = _("POOCHY"),
+ .trainerName = _("JIMMY"),
+ .trainerGfxId = EVENT_OBJ_GFX_BOY_1,
+ .flags = 0xC000FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_ROAR,
+ MOVE_BITE,
+ MOVE_TAKE_DOWN,
+ MOVE_HOWL
+ },
+ .cool = 10,
+ .beauty = 4,
+ .cute = 10,
+ .smart = 3,
+ .tough = 4,
+ .sheen = 50,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_EDITH] = {
+ .species = SPECIES_ILLUMISE,
+ .nickname = _("MUSILLE"),
+ .trainerName = _("EDITH"),
+ .trainerGfxId = EVENT_OBJ_GFX_GIRL_1,
+ .flags = 0x82000FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_REST,
+ MOVE_FACADE,
+ MOVE_TACKLE,
+ MOVE_COVET
+ },
+ .cool = 10,
+ .beauty = 10,
+ .cute = 6,
+ .smart = 1,
+ .tough = 2,
+ .sheen = 60,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_EVAN] = {
+ .species = SPECIES_DUSTOX,
+ .nickname = _("DUSTER"),
+ .trainerName = _("EVAN"),
+ .trainerGfxId = EVENT_OBJ_GFX_LITTLE_BOY,
+ .flags = 0x21000FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_SILVER_WIND,
+ MOVE_MOONLIGHT,
+ MOVE_LIGHT_SCREEN,
+ MOVE_GUST
+ },
+ .cool = 2,
+ .beauty = 10,
+ .cute = 10,
+ .smart = 12,
+ .tough = 4,
+ .sheen = 70,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_KELSEY] = {
+ .species = SPECIES_SEEDOT,
+ .nickname = _("DOTS"),
+ .trainerName = _("KELSEY"),
+ .trainerGfxId = EVENT_OBJ_GFX_WOMAN_1,
+ .flags = 0x20800FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_BIDE,
+ MOVE_SYNTHESIS,
+ MOVE_BULLET_SEED,
+ MOVE_GROWTH
+ },
+ .cool = 3,
+ .beauty = 3,
+ .cute = 5,
+ .smart = 2,
+ .tough = 7,
+ .sheen = 80,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_MADISON] = {
+ .species = SPECIES_TAILLOW,
+ .nickname = _("TATAY"),
+ .trainerName = _("MADISON"),
+ .trainerGfxId = EVENT_OBJ_GFX_POKEFAN_F,
+ .flags = 0x80400FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_WING_ATTACK,
+ MOVE_AGILITY,
+ MOVE_AERIAL_ACE,
+ MOVE_GROWL
+ },
+ .cool = 1,
+ .beauty = 3,
+ .cute = 3,
+ .smart = 5,
+ .tough = 4,
+ .sheen = 90,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_RAYMOND] = {
+ .species = SPECIES_NINCADA,
+ .nickname = _("NINDA"),
+ .trainerName = _("RAYMOND"),
+ .trainerGfxId = EVENT_OBJ_GFX_BLACK_BELT,
+ .flags = 0x10200FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_LEECH_LIFE,
+ MOVE_FALSE_SWIPE,
+ MOVE_FURY_SWIPES,
+ MOVE_MIND_READER
+ },
+ .cool = 5,
+ .beauty = 2,
+ .cute = 10,
+ .smart = 7,
+ .tough = 8,
+ .sheen = 100,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_GRANT] = {
+ .species = SPECIES_SHROOMISH,
+ .nickname = _("SMISH"),
+ .trainerName = _("GRANT"),
+ .trainerGfxId = EVENT_OBJ_GFX_YOUNGSTER,
+ .flags = 0x20100FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_STUN_SPORE,
+ MOVE_LEECH_SEED,
+ MOVE_MEGA_DRAIN,
+ MOVE_ATTRACT
+ },
+ .cool = 3,
+ .beauty = 3,
+ .cute = 10,
+ .smart = 2,
+ .tough = 2,
+ .sheen = 50,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_PAIGE] = {
+ .species = SPECIES_SPHEAL,
+ .nickname = _("SLEAL"),
+ .trainerName = _("PAIGE"),
+ .trainerGfxId = EVENT_OBJ_GFX_WOMAN_4,
+ .flags = 0x8080FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_AURORA_BEAM,
+ MOVE_WATER_GUN,
+ MOVE_GROWL,
+ MOVE_ROCK_TOMB
+ },
+ .cool = 3,
+ .beauty = 5,
+ .cute = 1,
+ .smart = 10,
+ .tough = 10,
+ .sheen = 60,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_ALEC] = {
+ .species = SPECIES_SLAKOTH,
+ .nickname = _("SLOKTH"),
+ .trainerName = _("ALEC"),
+ .trainerGfxId = EVENT_OBJ_GFX_CAMPER,
+ .flags = 0x40040FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_STRENGTH,
+ MOVE_COUNTER,
+ MOVE_YAWN,
+ MOVE_ENCORE
+ },
+ .cool = 10,
+ .beauty = 4,
+ .cute = 4,
+ .smart = 5,
+ .tough = 18,
+ .sheen = 70,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_SYDNEY] = {
+ .species = SPECIES_WHISMUR,
+ .nickname = _("WHIRIS"),
+ .trainerName = _("SYDNEY"),
+ .trainerGfxId = EVENT_OBJ_GFX_LASS,
+ .flags = 0x80020FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_ASTONISH,
+ MOVE_SCREECH,
+ MOVE_UPROAR,
+ MOVE_HYPER_VOICE
+ },
+ .cool = 2,
+ .beauty = 2,
+ .cute = 7,
+ .smart = 2,
+ .tough = 7,
+ .sheen = 80,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_MORRIS] = {
+ .species = SPECIES_MAKUHITA,
+ .nickname = _("MAHITA"),
+ .trainerName = _("MORRIS"),
+ .trainerGfxId = EVENT_OBJ_GFX_SCHOOL_KID_M,
+ .flags = 0x8010FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_SEISMIC_TOSS,
+ MOVE_VITAL_THROW,
+ MOVE_TACKLE,
+ MOVE_REVERSAL
+ },
+ .cool = 9,
+ .beauty = 1,
+ .cute = 1,
+ .smart = 8,
+ .tough = 1,
+ .sheen = 90,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_MARIAH] = {
+ .species = SPECIES_ARON,
+ .nickname = _("RONAR"),
+ .trainerName = _("MARIAH"),
+ .trainerGfxId = EVENT_OBJ_GFX_GIRL_2,
+ .flags = 0x8008FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_METAL_CLAW,
+ MOVE_IRON_DEFENSE,
+ MOVE_HEADBUTT,
+ MOVE_TAKE_DOWN
+ },
+ .cool = 5,
+ .beauty = 10,
+ .cute = 2,
+ .smart = 10,
+ .tough = 2,
+ .sheen = 100,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_RUSSELL] = {
+ .species = SPECIES_CROBAT,
+ .nickname = _("BATRO"),
+ .trainerName = _("RUSSELL"),
+ .trainerGfxId = EVENT_OBJ_GFX_MAN_3,
+ .flags = 0x90004FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_HAZE,
+ MOVE_MEAN_LOOK,
+ MOVE_CONFUSE_RAY,
+ MOVE_LEECH_LIFE
+ },
+ .cool = 4,
+ .beauty = 2,
+ .cute = 2,
+ .smart = 2,
+ .tough = 10,
+ .sheen = 50,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_MELANIE] = {
+ .species = SPECIES_GULPIN,
+ .nickname = _("GULIN"),
+ .trainerName = _("MELANIE"),
+ .trainerGfxId = EVENT_OBJ_GFX_TWIN,
+ .flags = 0x40002FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_SLUDGE,
+ MOVE_AMNESIA,
+ MOVE_TOXIC,
+ MOVE_YAWN
+ },
+ .cool = 1,
+ .beauty = 10,
+ .cute = 1,
+ .smart = 10,
+ .tough = 5,
+ .sheen = 60,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_CHANCE] = {
+ .species = SPECIES_MANECTRIC,
+ .nickname = _("RIKELEC"),
+ .trainerName = _("CHANCE"),
+ .trainerGfxId = EVENT_OBJ_GFX_RICH_BOY,
+ .flags = 0x80001FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_SPARK,
+ MOVE_THUNDER_WAVE,
+ MOVE_THUNDER,
+ MOVE_ROAR
+ },
+ .cool = 20,
+ .beauty = 10,
+ .cute = 1,
+ .smart = 1,
+ .tough = 1,
+ .sheen = 70,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_AGATHA] = {
+ .species = SPECIES_BULBASAUR,
+ .nickname = _("BULBY"),
+ .trainerName = _("AGATHA"),
+ .trainerGfxId = EVENT_OBJ_GFX_WOMAN_2,
+ .flags = 0xC000FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_GROWL,
+ MOVE_LEECH_SEED,
+ MOVE_TACKLE,
+ MOVE_SWEET_SCENT
+ },
+ .cool = 5,
+ .beauty = 3,
+ .cute = 10,
+ .smart = 10,
+ .tough = 4,
+ .sheen = 50,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_BEAU] = {
+ .species = SPECIES_BUTTERFREE,
+ .nickname = _("FUTTERBE"),
+ .trainerName = _("BEAU"),
+ .trainerGfxId = EVENT_OBJ_GFX_HEX_MANIAC,
+ .flags = 0x82000FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_SUPERSONIC,
+ MOVE_WHIRLWIND,
+ MOVE_SILVER_WIND,
+ MOVE_SAFEGUARD
+ },
+ .cool = 3,
+ .beauty = 10,
+ .cute = 2,
+ .smart = 10,
+ .tough = 4,
+ .sheen = 60,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_KAY] = {
+ .species = SPECIES_PIDGEOTTO,
+ .nickname = _("PIDEOT"),
+ .trainerName = _("KAY"),
+ .trainerGfxId = EVENT_OBJ_GFX_WOMAN_5,
+ .flags = 0x21000FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_MIRROR_MOVE,
+ MOVE_QUICK_ATTACK,
+ MOVE_AERIAL_ACE,
+ MOVE_FEATHER_DANCE
+ },
+ .cool = 10,
+ .beauty = 8,
+ .cute = 4,
+ .smart = 2,
+ .tough = 3,
+ .sheen = 70,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_CALE] = {
+ .species = SPECIES_DIGLETT,
+ .nickname = _("DIGLE"),
+ .trainerName = _("CALE"),
+ .trainerGfxId = EVENT_OBJ_GFX_HIKER,
+ .flags = 0x20800FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_DIG,
+ MOVE_EARTHQUAKE,
+ MOVE_FISSURE,
+ MOVE_MAGNITUDE
+ },
+ .cool = 4,
+ .beauty = 2,
+ .cute = 3,
+ .smart = 5,
+ .tough = 10,
+ .sheen = 80,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_CAITLIN] = {
+ .species = SPECIES_POLIWAG,
+ .nickname = _("WAGIL"),
+ .trainerName = _("CAITLIN"),
+ .trainerGfxId = EVENT_OBJ_GFX_TUBER_F,
+ .flags = 0x80400FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_HYDRO_PUMP,
+ MOVE_RAIN_DANCE,
+ MOVE_BODY_SLAM,
+ MOVE_ICE_BEAM
+ },
+ .cool = 2,
+ .beauty = 10,
+ .cute = 5,
+ .smart = 3,
+ .tough = 10,
+ .sheen = 90,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_COLBY] = {
+ .species = SPECIES_TOTODILE,
+ .nickname = _("TOTDIL"),
+ .trainerName = _("COLBY"),
+ .trainerGfxId = EVENT_OBJ_GFX_NINJA_BOY,
+ .flags = 0x10200FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_RAGE,
+ MOVE_SCREECH,
+ MOVE_SURF,
+ MOVE_BLIZZARD
+ },
+ .cool = 6,
+ .beauty = 10,
+ .cute = 2,
+ .smart = 1,
+ .tough = 5,
+ .sheen = 100,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_KYLIE] = {
+ .species = SPECIES_LEDYBA,
+ .nickname = _("BALEDY"),
+ .trainerName = _("KYLIE"),
+ .trainerGfxId = EVENT_OBJ_GFX_BEAUTY,
+ .flags = 0x20100FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_BATON_PASS,
+ MOVE_AGILITY,
+ MOVE_SWIFT,
+ MOVE_ATTRACT
+ },
+ .cool = 8,
+ .beauty = 6,
+ .cute = 8,
+ .smart = 6,
+ .tough = 2,
+ .sheen = 90,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_LIAM] = {
+ .species = SPECIES_DELIBIRD,
+ .nickname = _("BIRDLY"),
+ .trainerName = _("LIAM"),
+ .trainerGfxId = EVENT_OBJ_GFX_MAN_5,
+ .flags = 0x8080FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_PRESENT,
+ MOVE_FACADE,
+ MOVE_FOCUS_PUNCH,
+ MOVE_RETURN
+ },
+ .cool = 4,
+ .beauty = 3,
+ .cute = 10,
+ .smart = 5,
+ .tough = 3,
+ .sheen = 80,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_MILO] = {
+ .species = SPECIES_LARVITAR,
+ .nickname = _("TARVITAR"),
+ .trainerName = _("MILO"),
+ .trainerGfxId = EVENT_OBJ_GFX_MANIAC,
+ .flags = 0x40040FFF,
+ .whichRank = CONTEST_RANK_NORMAL,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_THRASH,
+ MOVE_TORMENT,
+ MOVE_CRUNCH,
+ MOVE_DIG
+ },
+ .cool = 8,
+ .beauty = 5,
+ .cute = 5,
+ .smart = 8,
+ .tough = 10,
+ .sheen = 70,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_KARINA] = {
+ .species = SPECIES_ROSELIA,
+ .nickname = _("RELIA"),
+ .trainerName = _("KARINA"),
+ .trainerGfxId = EVENT_OBJ_GFX_PICNICKER,
+ .flags = 0x24000FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_PETAL_DANCE,
+ MOVE_MAGICAL_LEAF,
+ MOVE_GRASS_WHISTLE,
+ MOVE_INGRAIN
+ },
+ .cool = 50,
+ .beauty = 15,
+ .cute = 75,
+ .smart = 10,
+ .tough = 20,
+ .sheen = 100,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_BOBBY] = {
+ .species = SPECIES_DODRIO,
+ .nickname = _("DUODO"),
+ .trainerName = _("BOBBY"),
+ .trainerGfxId = EVENT_OBJ_GFX_RUNNING_TRIATHLETE_M,
+ .flags = 0x82000FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_PECK,
+ MOVE_FURY_ATTACK,
+ MOVE_RETURN,
+ MOVE_GROWL
+ },
+ .cool = 15,
+ .beauty = 21,
+ .cute = 15,
+ .smart = 85,
+ .tough = 35,
+ .sheen = 110,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_CLAIRE] = {
+ .species = SPECIES_TRAPINCH,
+ .nickname = _("PINCHIN"),
+ .trainerName = _("CLAIRE"),
+ .trainerGfxId = EVENT_OBJ_GFX_GIRL_1,
+ .flags = 0x81000FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_BITE,
+ MOVE_SAND_ATTACK,
+ MOVE_DIG,
+ MOVE_FAINT_ATTACK
+ },
+ .cool = 75,
+ .beauty = 25,
+ .cute = 25,
+ .smart = 10,
+ .tough = 25,
+ .sheen = 120,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_WILLIE] = {
+ .species = SPECIES_CACNEA,
+ .nickname = _("NACAC"),
+ .trainerName = _("WILLIE"),
+ .trainerGfxId = EVENT_OBJ_GFX_LITTLE_BOY,
+ .flags = 0x80800FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_SPIKES,
+ MOVE_LEER,
+ MOVE_POISON_STING,
+ MOVE_SAND_ATTACK
+ },
+ .cool = 10,
+ .beauty = 30,
+ .cute = 25,
+ .smart = 65,
+ .tough = 25,
+ .sheen = 130,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_CASSIDY] = {
+ .species = SPECIES_SANDSLASH,
+ .nickname = _("SHRAND"),
+ .trainerName = _("CASSIDY"),
+ .trainerGfxId = EVENT_OBJ_GFX_POKEFAN_F,
+ .flags = 0x10400FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_SLASH,
+ MOVE_DEFENSE_CURL,
+ MOVE_SWIFT,
+ MOVE_FURY_SWIPES
+ },
+ .cool = 30,
+ .beauty = 90,
+ .cute = 30,
+ .smart = 10,
+ .tough = 100,
+ .sheen = 140,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_MORGAN] = {
+ .species = SPECIES_BALTOY,
+ .nickname = _("TOYBAL"),
+ .trainerName = _("MORGAN"),
+ .trainerGfxId = EVENT_OBJ_GFX_BLACK_BELT,
+ .flags = 0x8200FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_SELF_DESTRUCT,
+ MOVE_ROCK_TOMB,
+ MOVE_PSYBEAM,
+ MOVE_CONFUSION
+ },
+ .cool = 50,
+ .beauty = 40,
+ .cute = 10,
+ .smart = 35,
+ .tough = 35,
+ .sheen = 150,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_SUMMER] = {
+ .species = SPECIES_MEDICHAM,
+ .nickname = _("CHAMCHAM"),
+ .trainerName = _("SUMMER"),
+ .trainerGfxId = EVENT_OBJ_GFX_WOMAN_4,
+ .flags = 0x10100FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_REVERSAL,
+ MOVE_THUNDER_PUNCH,
+ MOVE_FIRE_PUNCH,
+ MOVE_ICE_PUNCH
+ },
+ .cool = 40,
+ .beauty = 20,
+ .cute = 40,
+ .smart = 40,
+ .tough = 40,
+ .sheen = 100,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_MILES] = {
+ .species = SPECIES_SPINDA,
+ .nickname = _("SPININ"),
+ .trainerName = _("MILES"),
+ .trainerGfxId = EVENT_OBJ_GFX_CAMPER,
+ .flags = 0x80080FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_TEETER_DANCE,
+ MOVE_PSYCH_UP,
+ MOVE_HYPNOSIS,
+ MOVE_UPROAR
+ },
+ .cool = 25,
+ .beauty = 75,
+ .cute = 25,
+ .smart = 10,
+ .tough = 25,
+ .sheen = 110,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_AUDREY] = {
+ .species = SPECIES_SWABLU,
+ .nickname = _("SWABY"),
+ .trainerName = _("AUDREY"),
+ .trainerGfxId = EVENT_OBJ_GFX_LASS,
+ .flags = 0xA0040FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_MIRROR_MOVE,
+ MOVE_PERISH_SONG,
+ MOVE_SAFEGUARD,
+ MOVE_MIST
+ },
+ .cool = 30,
+ .beauty = 30,
+ .cute = 40,
+ .smart = 30,
+ .tough = 25,
+ .sheen = 120,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_AVERY] = {
+ .species = SPECIES_SPOINK,
+ .nickname = _("POINKER"),
+ .trainerName = _("AVERY"),
+ .trainerGfxId = EVENT_OBJ_GFX_SCHOOL_KID_M,
+ .flags = 0x80020FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_SPLASH,
+ MOVE_CONFUSE_RAY,
+ MOVE_SNORE,
+ MOVE_REST
+ },
+ .cool = 40,
+ .beauty = 10,
+ .cute = 30,
+ .smart = 40,
+ .tough = 30,
+ .sheen = 130,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_ARIANA] = {
+ .species = SPECIES_KECLEON,
+ .nickname = _("KECON"),
+ .trainerName = _("ARIANA"),
+ .trainerGfxId = EVENT_OBJ_GFX_GIRL_2,
+ .flags = 0x80010FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_THIEF,
+ MOVE_SCREECH,
+ MOVE_ANCIENT_POWER,
+ MOVE_BIND
+ },
+ .cool = 10,
+ .beauty = 10,
+ .cute = 40,
+ .smart = 75,
+ .tough = 35,
+ .sheen = 140,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_ASHTON] = {
+ .species = SPECIES_GOLDEEN,
+ .nickname = _("GOLDEN"),
+ .trainerName = _("ASHTON"),
+ .trainerGfxId = EVENT_OBJ_GFX_MAN_3,
+ .flags = 0x80008FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_HORN_ATTACK,
+ MOVE_FURY_ATTACK,
+ MOVE_HORN_DRILL,
+ MOVE_TAIL_WHIP
+ },
+ .cool = 70,
+ .beauty = 30,
+ .cute = 5,
+ .smart = 30,
+ .tough = 25,
+ .sheen = 150,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_SANDRA] = {
+ .species = SPECIES_BARBOACH,
+ .nickname = _("BOBOACH"),
+ .trainerName = _("SANDRA"),
+ .trainerGfxId = EVENT_OBJ_GFX_TWIN,
+ .flags = 0x80004FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_MUD_SPORT,
+ MOVE_WATER_SPORT,
+ MOVE_EARTHQUAKE,
+ MOVE_FUTURE_SIGHT
+ },
+ .cool = 45,
+ .beauty = 45,
+ .cute = 60,
+ .smart = 25,
+ .tough = 15,
+ .sheen = 100,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_CARSON] = {
+ .species = SPECIES_SKARMORY,
+ .nickname = _("CORPY"),
+ .trainerName = _("CARSON"),
+ .trainerGfxId = EVENT_OBJ_GFX_YOUNGSTER,
+ .flags = 0x8002FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_SWIFT,
+ MOVE_DOUBLE_TEAM,
+ MOVE_AGILITY,
+ MOVE_CUT
+ },
+ .cool = 40,
+ .beauty = 30,
+ .cute = 25,
+ .smart = 60,
+ .tough = 20,
+ .sheen = 110,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_KATRINA] = {
+ .species = SPECIES_LOTAD,
+ .nickname = _("TADO"),
+ .trainerName = _("KATRINA"),
+ .trainerGfxId = EVENT_OBJ_GFX_WOMAN_1,
+ .flags = 0x8001FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_ASTONISH,
+ MOVE_GROWL,
+ MOVE_RAIN_DANCE,
+ MOVE_WATER_PULSE
+ },
+ .cool = 15,
+ .beauty = 15,
+ .cute = 30,
+ .smart = 15,
+ .tough = 75,
+ .sheen = 120,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_LUKE] = {
+ .species = SPECIES_SLOWBRO,
+ .nickname = _("BROWLO"),
+ .trainerName = _("LUKE"),
+ .trainerGfxId = EVENT_OBJ_GFX_FAT_MAN,
+ .flags = 0xC000FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_YAWN,
+ MOVE_DISABLE,
+ MOVE_GROWL,
+ MOVE_CONFUSION
+ },
+ .cool = 20,
+ .beauty = 40,
+ .cute = 40,
+ .smart = 30,
+ .tough = 20,
+ .sheen = 100,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_RAUL] = {
+ .species = SPECIES_FARFETCHD,
+ .nickname = _("FETCHIN"),
+ .trainerName = _("RAUL"),
+ .trainerGfxId = EVENT_OBJ_GFX_MAN_5,
+ .flags = 0x82000FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_FACADE,
+ MOVE_FURY_CUTTER,
+ MOVE_FLY,
+ MOVE_RETURN
+ },
+ .cool = 40,
+ .beauty = 10,
+ .cute = 40,
+ .smart = 20,
+ .tough = 20,
+ .sheen = 110,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_JADA] = {
+ .species = SPECIES_SEEL,
+ .nickname = _("SEELEY"),
+ .trainerName = _("JADA"),
+ .trainerGfxId = EVENT_OBJ_GFX_WOMAN_2,
+ .flags = 0x21000FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_ATTRACT,
+ MOVE_ICE_BEAM,
+ MOVE_SAFEGUARD,
+ MOVE_GROWL
+ },
+ .cool = 10,
+ .beauty = 30,
+ .cute = 40,
+ .smart = 20,
+ .tough = 20,
+ .sheen = 120,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_ZEEK] = {
+ .species = SPECIES_DROWZEE,
+ .nickname = _("DROWZIN"),
+ .trainerName = _("ZEEK"),
+ .trainerGfxId = EVENT_OBJ_GFX_PSYCHIC_M,
+ .flags = 0x20800FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_DISABLE,
+ MOVE_FUTURE_SIGHT,
+ MOVE_HIDDEN_POWER,
+ MOVE_RETURN
+ },
+ .cool = 10,
+ .beauty = 40,
+ .cute = 50,
+ .smart = 30,
+ .tough = 45,
+ .sheen = 130,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_DIEGO] = {
+ .species = SPECIES_HITMONCHAN,
+ .nickname = _("HITEMON"),
+ .trainerName = _("DIEGO"),
+ .trainerGfxId = EVENT_OBJ_GFX_EXPERT_M,
+ .flags = 0x80400FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_SKY_UPPERCUT,
+ MOVE_DETECT,
+ MOVE_REVENGE,
+ MOVE_MEGA_PUNCH
+ },
+ .cool = 45,
+ .beauty = 20,
+ .cute = 10,
+ .smart = 20,
+ .tough = 45,
+ .sheen = 140,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_ALIYAH] = {
+ .species = SPECIES_BLISSEY,
+ .nickname = _("BLISS"),
+ .trainerName = _("ALIYAH"),
+ .trainerGfxId = EVENT_OBJ_GFX_TEALA,
+ .flags = 0x10200FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_SING,
+ MOVE_SOFT_BOILED,
+ MOVE_EGG_BOMB,
+ MOVE_DOUBLE_EDGE
+ },
+ .cool = 20,
+ .beauty = 35,
+ .cute = 40,
+ .smart = 20,
+ .tough = 20,
+ .sheen = 150,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_NATALIA] = {
+ .species = SPECIES_ELEKID,
+ .nickname = _("KIDLEK"),
+ .trainerName = _("NATALIA"),
+ .trainerGfxId = EVENT_OBJ_GFX_POKEFAN_F,
+ .flags = 0x20100FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_SHOCK_WAVE,
+ MOVE_QUICK_ATTACK,
+ MOVE_SCREECH,
+ MOVE_ATTRACT
+ },
+ .cool = 40,
+ .beauty = 10,
+ .cute = 40,
+ .smart = 25,
+ .tough = 25,
+ .sheen = 140,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_DEVIN] = {
+ .species = SPECIES_SNUBBULL,
+ .nickname = _("SNUBBINS"),
+ .trainerName = _("DEVIN"),
+ .trainerGfxId = EVENT_OBJ_GFX_GENTLEMAN,
+ .flags = 0x8080FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_SCARY_FACE,
+ MOVE_TAUNT,
+ MOVE_TAIL_WHIP,
+ MOVE_BITE
+ },
+ .cool = 20,
+ .beauty = 20,
+ .cute = 20,
+ .smart = 20,
+ .tough = 20,
+ .sheen = 130,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_TYLOR] = {
+ .species = SPECIES_MISDREAVUS,
+ .nickname = _("DREAVIS"),
+ .trainerName = _("TYLOR"),
+ .trainerGfxId = EVENT_OBJ_GFX_HEX_MANIAC,
+ .flags = 0x40040FFF,
+ .whichRank = CONTEST_RANK_SUPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_PERISH_SONG,
+ MOVE_MEAN_LOOK,
+ MOVE_CONFUSE_RAY,
+ MOVE_PAIN_SPLIT
+ },
+ .cool = 10,
+ .beauty = 35,
+ .cute = 10,
+ .smart = 45,
+ .tough = 20,
+ .sheen = 120,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_RONNIE] = {
+ .species = SPECIES_LAIRON,
+ .nickname = _("LAIRN"),
+ .trainerName = _("RONNIE"),
+ .trainerGfxId = EVENT_OBJ_GFX_HIKER,
+ .flags = 0x84000FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_METAL_SOUND,
+ MOVE_METAL_CLAW,
+ MOVE_HARDEN,
+ MOVE_TAKE_DOWN
+ },
+ .cool = 30,
+ .beauty = 50,
+ .cute = 35,
+ .smart = 100,
+ .tough = 90,
+ .sheen = 200,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_CLAUDIA] = {
+ .species = SPECIES_SHIFTRY,
+ .nickname = _("SHIFTY"),
+ .trainerName = _("CLAUDIA"),
+ .trainerGfxId = EVENT_OBJ_GFX_GIRL_1,
+ .flags = 0x82000FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_GROWTH,
+ MOVE_RAZOR_WIND,
+ MOVE_EXPLOSION,
+ MOVE_EXTRASENSORY
+ },
+ .cool = 75,
+ .beauty = 75,
+ .cute = 65,
+ .smart = 35,
+ .tough = 70,
+ .sheen = 210,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_ELIAS] = {
+ .species = SPECIES_NINJASK,
+ .nickname = _("NINAS"),
+ .trainerName = _("ELIAS"),
+ .trainerGfxId = EVENT_OBJ_GFX_LITTLE_BOY,
+ .flags = 0x81000FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_SCREECH,
+ MOVE_FURY_SWIPES,
+ MOVE_SAND_ATTACK,
+ MOVE_BATON_PASS
+ },
+ .cool = 30,
+ .beauty = 50,
+ .cute = 95,
+ .smart = 70,
+ .tough = 70,
+ .sheen = 220,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_JADE] = {
+ .species = SPECIES_SWELLOW,
+ .nickname = _("WELOW"),
+ .trainerName = _("JADE"),
+ .trainerGfxId = EVENT_OBJ_GFX_POKEFAN_F,
+ .flags = 0x80800FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_AGILITY,
+ MOVE_AERIAL_ACE,
+ MOVE_WING_ATTACK,
+ MOVE_FLY
+ },
+ .cool = 65,
+ .beauty = 85,
+ .cute = 35,
+ .smart = 75,
+ .tough = 40,
+ .sheen = 230,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_FRANCIS] = {
+ .species = SPECIES_MIGHTYENA,
+ .nickname = _("YENA"),
+ .trainerName = _("FRANCIS"),
+ .trainerGfxId = EVENT_OBJ_GFX_BLACK_BELT,
+ .flags = 0x80400FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_TAUNT,
+ MOVE_THIEF,
+ MOVE_ODOR_SLEUTH,
+ MOVE_TAKE_DOWN
+ },
+ .cool = 40,
+ .beauty = 80,
+ .cute = 35,
+ .smart = 70,
+ .tough = 70,
+ .sheen = 240,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_ALISHA] = {
+ .species = SPECIES_BEAUTIFLY,
+ .nickname = _("TIFLY"),
+ .trainerName = _("ALISHA"),
+ .trainerGfxId = EVENT_OBJ_GFX_WOMAN_4,
+ .flags = 0x80200FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_MORNING_SUN,
+ MOVE_SILVER_WIND,
+ MOVE_STUN_SPORE,
+ MOVE_SECRET_POWER
+ },
+ .cool = 40,
+ .beauty = 70,
+ .cute = 25,
+ .smart = 80,
+ .tough = 100,
+ .sheen = 250,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_SAUL] = {
+ .species = SPECIES_SEAKING,
+ .nickname = _("KINGSEA"),
+ .trainerName = _("SAUL"),
+ .trainerGfxId = EVENT_OBJ_GFX_CAMPER,
+ .flags = 0x80100FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_FLAIL,
+ MOVE_SUPERSONIC,
+ MOVE_HORN_ATTACK,
+ MOVE_FURY_ATTACK
+ },
+ .cool = 80,
+ .beauty = 60,
+ .cute = 30,
+ .smart = 70,
+ .tough = 90,
+ .sheen = 200,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_FELICIA] = {
+ .species = SPECIES_CASTFORM,
+ .nickname = _("CASTER"),
+ .trainerName = _("FELICIA"),
+ .trainerGfxId = EVENT_OBJ_GFX_LASS,
+ .flags = 0x80080FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_SUNNY_DAY,
+ MOVE_WEATHER_BALL,
+ MOVE_SANDSTORM,
+ MOVE_RETURN
+ },
+ .cool = 70,
+ .beauty = 80,
+ .cute = 80,
+ .smart = 50,
+ .tough = 65,
+ .sheen = 210,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_EMILIO] = {
+ .species = SPECIES_MACHOKE,
+ .nickname = _("CHOKEM"),
+ .trainerName = _("EMILIO"),
+ .trainerGfxId = EVENT_OBJ_GFX_SCHOOL_KID_M,
+ .flags = 0x80040FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_SEISMIC_TOSS,
+ MOVE_FOCUS_ENERGY,
+ MOVE_KARATE_CHOP,
+ MOVE_SCARY_FACE
+ },
+ .cool = 70,
+ .beauty = 85,
+ .cute = 25,
+ .smart = 60,
+ .tough = 50,
+ .sheen = 220,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_KARLA] = {
+ .species = SPECIES_LOMBRE,
+ .nickname = _("LOMBE"),
+ .trainerName = _("KARLA"),
+ .trainerGfxId = EVENT_OBJ_GFX_GIRL_2,
+ .flags = 0x80020FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_ATTRACT,
+ MOVE_FLASH,
+ MOVE_UPROAR,
+ MOVE_GROWL
+ },
+ .cool = 40,
+ .beauty = 60,
+ .cute = 90,
+ .smart = 45,
+ .tough = 70,
+ .sheen = 230,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_DARRYL] = {
+ .species = SPECIES_SEVIPER,
+ .nickname = _("VIPES"),
+ .trainerName = _("DARRYL"),
+ .trainerGfxId = EVENT_OBJ_GFX_MAN_3,
+ .flags = 0x80010FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_POISON_FANG,
+ MOVE_GLARE,
+ MOVE_WRAP,
+ MOVE_SCREECH
+ },
+ .cool = 35,
+ .beauty = 50,
+ .cute = 90,
+ .smart = 40,
+ .tough = 100,
+ .sheen = 240,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_SELENA] = {
+ .species = SPECIES_WAILMER,
+ .nickname = _("MERAIL"),
+ .trainerName = _("SELENA"),
+ .trainerGfxId = EVENT_OBJ_GFX_EXPERT_F,
+ .flags = 0x80008FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_WATER_PULSE,
+ MOVE_REST,
+ MOVE_WATER_SPOUT,
+ MOVE_SPLASH
+ },
+ .cool = 30,
+ .beauty = 100,
+ .cute = 100,
+ .smart = 50,
+ .tough = 30,
+ .sheen = 250,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_NOEL] = {
+ .species = SPECIES_MAGIKARP,
+ .nickname = _("KARPAG"),
+ .trainerName = _("NOEL"),
+ .trainerGfxId = EVENT_OBJ_GFX_YOUNGSTER,
+ .flags = 0x80004FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_TACKLE,
+ MOVE_SPLASH,
+ MOVE_FLAIL,
+ MOVE_TACKLE
+ },
+ .cool = 30,
+ .beauty = 30,
+ .cute = 160,
+ .smart = 50,
+ .tough = 160,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_LACEY] = {
+ .species = SPECIES_LUNATONE,
+ .nickname = _("LUNONE"),
+ .trainerName = _("LACEY"),
+ .trainerGfxId = EVENT_OBJ_GFX_WOMAN_1,
+ .flags = 0x80002FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_EXPLOSION,
+ MOVE_FUTURE_SIGHT,
+ MOVE_PSYCHIC,
+ MOVE_CONFUSION
+ },
+ .cool = 50,
+ .beauty = 70,
+ .cute = 60,
+ .smart = 70,
+ .tough = 50,
+ .sheen = 210,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_CORBIN] = {
+ .species = SPECIES_ABSOL,
+ .nickname = _("ABSO"),
+ .trainerName = _("CORBIN"),
+ .trainerGfxId = EVENT_OBJ_GFX_MANIAC,
+ .flags = 0x80001FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_PERISH_SONG,
+ MOVE_HAIL,
+ MOVE_HYPER_BEAM,
+ MOVE_SLASH
+ },
+ .cool = 95,
+ .beauty = 80,
+ .cute = 85,
+ .smart = 35,
+ .tough = 35,
+ .sheen = 220,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_GRACIE] = {
+ .species = SPECIES_EXEGGUTOR,
+ .nickname = _("EGGSOR"),
+ .trainerName = _("GRACIE"),
+ .trainerGfxId = EVENT_OBJ_GFX_PICNICKER,
+ .flags = 0xC000FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_STOMP,
+ MOVE_HYPNOSIS,
+ MOVE_EGG_BOMB,
+ MOVE_SKILL_SWAP
+ },
+ .cool = 40,
+ .beauty = 50,
+ .cute = 60,
+ .smart = 100,
+ .tough = 80,
+ .sheen = 200,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_COLTIN] = {
+ .species = SPECIES_CUBONE,
+ .nickname = _("CUBIN"),
+ .trainerName = _("COLTIN"),
+ .trainerGfxId = EVENT_OBJ_GFX_MAN_4,
+ .flags = 0x82000FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_BONE_CLUB,
+ MOVE_BONEMERANG,
+ MOVE_BONE_RUSH,
+ MOVE_GROWL
+ },
+ .cool = 40,
+ .beauty = 35,
+ .cute = 85,
+ .smart = 35,
+ .tough = 100,
+ .sheen = 210,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_ELLIE] = {
+ .species = SPECIES_HITMONLEE,
+ .nickname = _("HITMON"),
+ .trainerName = _("ELLIE"),
+ .trainerGfxId = EVENT_OBJ_GFX_EXPERT_F,
+ .flags = 0x21000FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_REVERSAL,
+ MOVE_REVENGE,
+ MOVE_FOCUS_ENERGY,
+ MOVE_MEGA_KICK
+ },
+ .cool = 85,
+ .beauty = 30,
+ .cute = 25,
+ .smart = 50,
+ .tough = 100,
+ .sheen = 220,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_MARCUS] = {
+ .species = SPECIES_SQUIRTLE,
+ .nickname = _("SURTLE"),
+ .trainerName = _("MARCUS"),
+ .trainerGfxId = EVENT_OBJ_GFX_SAILOR,
+ .flags = 0x20800FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_TAIL_WHIP,
+ MOVE_BUBBLE,
+ MOVE_FOCUS_PUNCH,
+ MOVE_WITHDRAW
+ },
+ .cool = 30,
+ .beauty = 35,
+ .cute = 100,
+ .smart = 40,
+ .tough = 95,
+ .sheen = 230,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_KIARA] = {
+ .species = SPECIES_KANGASKHAN,
+ .nickname = _("KHANKAN"),
+ .trainerName = _("KIARA"),
+ .trainerGfxId = EVENT_OBJ_GFX_GIRL_3,
+ .flags = 0x80400FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_MEGA_PUNCH,
+ MOVE_RAGE,
+ MOVE_FOCUS_PUNCH,
+ MOVE_TAIL_WHIP
+ },
+ .cool = 100,
+ .beauty = 50,
+ .cute = 30,
+ .smart = 50,
+ .tough = 100,
+ .sheen = 240,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_BRYCE] = {
+ .species = SPECIES_PINECO,
+ .nickname = _("PINOC"),
+ .trainerName = _("BRYCE"),
+ .trainerGfxId = EVENT_OBJ_GFX_BUG_CATCHER,
+ .flags = 0x10200FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_EXPLOSION,
+ MOVE_SPIKES,
+ MOVE_LIGHT_SCREEN,
+ MOVE_GIGA_DRAIN
+ },
+ .cool = 80,
+ .beauty = 80,
+ .cute = 80,
+ .smart = 80,
+ .tough = 80,
+ .sheen = 250,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_JAMIE] = {
+ .species = SPECIES_DUNSPARCE,
+ .nickname = _("DILTOT"),
+ .trainerName = _("JAMIE"),
+ .trainerGfxId = EVENT_OBJ_GFX_WOMAN_5,
+ .flags = 0x20100FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_SPITE,
+ MOVE_YAWN,
+ MOVE_DEFENSE_CURL,
+ MOVE_TAKE_DOWN
+ },
+ .cool = 40,
+ .beauty = 35,
+ .cute = 100,
+ .smart = 40,
+ .tough = 110,
+ .sheen = 240,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_JORGE] = {
+ .species = SPECIES_HOUNDOOM,
+ .nickname = _("DOOMOND"),
+ .trainerName = _("JORGE"),
+ .trainerGfxId = EVENT_OBJ_GFX_GENTLEMAN,
+ .flags = 0x8080FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_ROAR,
+ MOVE_FLAMETHROWER,
+ MOVE_FAINT_ATTACK,
+ MOVE_SUNNY_DAY
+ },
+ .cool = 100,
+ .beauty = 100,
+ .cute = 30,
+ .smart = 25,
+ .tough = 80,
+ .sheen = 230,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_DEVON] = {
+ .species = SPECIES_MILTANK,
+ .nickname = _("MILKAN"),
+ .trainerName = _("DEVON"),
+ .trainerGfxId = EVENT_OBJ_GFX_POKEFAN_M,
+ .flags = 0x40040FFF,
+ .whichRank = CONTEST_RANK_HYPER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_MILK_DRINK,
+ MOVE_HEAL_BELL,
+ MOVE_DEFENSE_CURL,
+ MOVE_BLIZZARD
+ },
+ .cool = 50,
+ .beauty = 110,
+ .cute = 100,
+ .smart = 35,
+ .tough = 40,
+ .sheen = 220,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_JUSTINA] = {
+ .species = SPECIES_GYARADOS,
+ .nickname = _("RADOS"),
+ .trainerName = _("JUSTINA"),
+ .trainerGfxId = EVENT_OBJ_GFX_PICNICKER,
+ .flags = 0x84000FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_HYPER_BEAM,
+ MOVE_HYDRO_PUMP,
+ MOVE_RAIN_DANCE,
+ MOVE_BITE
+ },
+ .cool = 160,
+ .beauty = 200,
+ .cute = 20,
+ .smart = 40,
+ .tough = 160,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_RALPH] = {
+ .species = SPECIES_LOUDRED,
+ .nickname = _("LOUDERD"),
+ .trainerName = _("RALPH"),
+ .trainerGfxId = EVENT_OBJ_GFX_EXPERT_M,
+ .flags = 0x82000FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_HYPER_VOICE,
+ MOVE_STOMP,
+ MOVE_ROAR,
+ MOVE_HOWL
+ },
+ .cool = 170,
+ .beauty = 50,
+ .cute = 55,
+ .smart = 150,
+ .tough = 160,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_ROSA] = {
+ .species = SPECIES_SKITTY,
+ .nickname = _("SITTY"),
+ .trainerName = _("ROSA"),
+ .trainerGfxId = EVENT_OBJ_GFX_GIRL_1,
+ .flags = 0x81000FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_ATTRACT,
+ MOVE_ASSIST,
+ MOVE_FAINT_ATTACK,
+ MOVE_TAIL_WHIP
+ },
+ .cool = 40,
+ .beauty = 200,
+ .cute = 150,
+ .smart = 185,
+ .tough = 60,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_KEATON] = {
+ .species = SPECIES_SLAKING,
+ .nickname = _("SLING"),
+ .trainerName = _("KEATON"),
+ .trainerGfxId = EVENT_OBJ_GFX_LITTLE_BOY,
+ .flags = 0x80800FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_COVET,
+ MOVE_COUNTER,
+ MOVE_ENCORE,
+ MOVE_SLACK_OFF
+ },
+ .cool = 85,
+ .beauty = 85,
+ .cute = 170,
+ .smart = 110,
+ .tough = 150,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_MAYRA] = {
+ .species = SPECIES_ALTARIA,
+ .nickname = _("TARIA"),
+ .trainerName = _("MAYRA"),
+ .trainerGfxId = EVENT_OBJ_GFX_POKEFAN_F,
+ .flags = 0x80400FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_DRAGON_DANCE,
+ MOVE_HYPER_BEAM,
+ MOVE_PERISH_SONG,
+ MOVE_SAFEGUARD
+ },
+ .cool = 170,
+ .beauty = 150,
+ .cute = 30,
+ .smart = 30,
+ .tough = 90,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_LAMAR] = {
+ .species = SPECIES_KIRLIA,
+ .nickname = _("LIRKI"),
+ .trainerName = _("LAMAR"),
+ .trainerGfxId = EVENT_OBJ_GFX_RICH_BOY,
+ .flags = 0x80200FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_SHOCK_WAVE,
+ MOVE_SHADOW_BALL,
+ MOVE_SKILL_SWAP,
+ MOVE_RETURN
+ },
+ .cool = 230,
+ .beauty = 60,
+ .cute = 60,
+ .smart = 230,
+ .tough = 80,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_AUBREY] = {
+ .species = SPECIES_BELLOSSOM,
+ .nickname = _("BLOSSOM"),
+ .trainerName = _("AUBREY"),
+ .trainerGfxId = EVENT_OBJ_GFX_WOMAN_4,
+ .flags = 0x80100FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_PETAL_DANCE,
+ MOVE_SWEET_SCENT,
+ MOVE_STUN_SPORE,
+ MOVE_FLASH
+ },
+ .cool = 35,
+ .beauty = 200,
+ .cute = 150,
+ .smart = 130,
+ .tough = 40,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_NIGEL] = {
+ .species = SPECIES_SABLEYE,
+ .nickname = _("EYESAB"),
+ .trainerName = _("NIGEL"),
+ .trainerGfxId = EVENT_OBJ_GFX_CAMPER,
+ .flags = 0x80080FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_MEAN_LOOK,
+ MOVE_FAINT_ATTACK,
+ MOVE_KNOCK_OFF,
+ MOVE_CONFUSE_RAY
+ },
+ .cool = 25,
+ .beauty = 35,
+ .cute = 230,
+ .smart = 150,
+ .tough = 160,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_CAMILLE] = {
+ .species = SPECIES_NATU,
+ .nickname = _("UTAN"),
+ .trainerName = _("CAMILLE"),
+ .trainerGfxId = EVENT_OBJ_GFX_LASS,
+ .flags = 0x80040FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_NIGHT_SHADE,
+ MOVE_FUTURE_SIGHT,
+ MOVE_CONFUSE_RAY,
+ MOVE_PSYCHIC
+ },
+ .cool = 35,
+ .beauty = 35,
+ .cute = 150,
+ .smart = 130,
+ .tough = 170,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_DEON] = {
+ .species = SPECIES_SHARPEDO,
+ .nickname = _("PEDOS"),
+ .trainerName = _("DEON"),
+ .trainerGfxId = EVENT_OBJ_GFX_SCHOOL_KID_M,
+ .flags = 0x80020FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_AGILITY,
+ MOVE_SWAGGER,
+ MOVE_TAUNT,
+ MOVE_TAKE_DOWN
+ },
+ .cool = 140,
+ .beauty = 70,
+ .cute = 140,
+ .smart = 75,
+ .tough = 100,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_JANELLE] = {
+ .species = SPECIES_LUVDISC,
+ .nickname = _("LUVIS"),
+ .trainerName = _("JANELLE"),
+ .trainerGfxId = EVENT_OBJ_GFX_GIRL_2,
+ .flags = 0x80010FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_SWEET_KISS,
+ MOVE_ATTRACT,
+ MOVE_TAKE_DOWN,
+ MOVE_CHARM
+ },
+ .cool = 50,
+ .beauty = 100,
+ .cute = 220,
+ .smart = 40,
+ .tough = 190,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_HEATH] = {
+ .species = SPECIES_HERACROSS,
+ .nickname = _("HEROSS"),
+ .trainerName = _("HEATH"),
+ .trainerGfxId = EVENT_OBJ_GFX_MAN_3,
+ .flags = 0x80008FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_STRENGTH,
+ MOVE_ENDURE,
+ MOVE_REVERSAL,
+ MOVE_ROCK_TOMB
+ },
+ .cool = 170,
+ .beauty = 70,
+ .cute = 110,
+ .smart = 240,
+ .tough = 140,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_SASHA] = {
+ .species = SPECIES_ELECTRODE,
+ .nickname = _("RODLECT"),
+ .trainerName = _("SASHA"),
+ .trainerGfxId = EVENT_OBJ_GFX_TWIN,
+ .flags = 0x80004FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_EXPLOSION,
+ MOVE_LIGHT_SCREEN,
+ MOVE_SWIFT,
+ MOVE_FLASH
+ },
+ .cool = 200,
+ .beauty = 200,
+ .cute = 30,
+ .smart = 35,
+ .tough = 50,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_FRANKIE] = {
+ .species = SPECIES_PICHU,
+ .nickname = _("CHUPY"),
+ .trainerName = _("FRANKIE"),
+ .trainerGfxId = EVENT_OBJ_GFX_YOUNGSTER,
+ .flags = 0x80002FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_SWEET_KISS,
+ MOVE_ATTRACT,
+ MOVE_REST,
+ MOVE_TAIL_WHIP
+ },
+ .cool = 25,
+ .beauty = 150,
+ .cute = 180,
+ .smart = 115,
+ .tough = 120,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_HELEN] = {
+ .species = SPECIES_WOBBUFFET,
+ .nickname = _("WOBET"),
+ .trainerName = _("HELEN"),
+ .trainerGfxId = EVENT_OBJ_GFX_WOMAN_1,
+ .flags = 0x80001FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_COUNTER,
+ MOVE_MIRROR_COAT,
+ MOVE_SAFEGUARD,
+ MOVE_DESTINY_BOND
+ },
+ .cool = 60,
+ .beauty = 230,
+ .cute = 50,
+ .smart = 220,
+ .tough = 210,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_CAMILE] = {
+ .species = SPECIES_GENGAR,
+ .nickname = _("GAREN"),
+ .trainerName = _("CAMILE"),
+ .trainerGfxId = EVENT_OBJ_GFX_HEX_MANIAC,
+ .flags = 0xC000FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_DESTINY_BOND,
+ MOVE_CONFUSE_RAY,
+ MOVE_LICK,
+ MOVE_SLUDGE_BOMB
+ },
+ .cool = 200,
+ .beauty = 100,
+ .cute = 50,
+ .smart = 80,
+ .tough = 180,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_MARTIN] = {
+ .species = SPECIES_PORYGON,
+ .nickname = _("GONPOR"),
+ .trainerName = _("MARTIN"),
+ .trainerGfxId = EVENT_OBJ_GFX_SCIENTIST_1,
+ .flags = 0x82000FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_CONVERSION_2,
+ MOVE_CONVERSION,
+ MOVE_RETURN,
+ MOVE_RECYCLE
+ },
+ .cool = 130,
+ .beauty = 130,
+ .cute = 130,
+ .smart = 130,
+ .tough = 130,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_SERGIO] = {
+ .species = SPECIES_DRAGONITE,
+ .nickname = _("DRITE"),
+ .trainerName = _("SERGIO"),
+ .trainerGfxId = EVENT_OBJ_GFX_BOY_1,
+ .flags = 0x21000FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_OUTRAGE,
+ MOVE_SLAM,
+ MOVE_TWISTER,
+ MOVE_EARTHQUAKE
+ },
+ .cool = 150,
+ .beauty = 140,
+ .cute = 50,
+ .smart = 120,
+ .tough = 150,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_KAILEY] = {
+ .species = SPECIES_MEOWTH,
+ .nickname = _("MEOWY"),
+ .trainerName = _("KAILEY"),
+ .trainerGfxId = EVENT_OBJ_GFX_TWIN,
+ .flags = 0x20800FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_GROWL,
+ MOVE_TAUNT,
+ MOVE_PAY_DAY,
+ MOVE_BITE
+ },
+ .cool = 125,
+ .beauty = 110,
+ .cute = 180,
+ .smart = 170,
+ .tough = 80,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_PERLA] = {
+ .species = SPECIES_JYNX,
+ .nickname = _("NYX"),
+ .trainerName = _("PERLA"),
+ .trainerGfxId = EVENT_OBJ_GFX_BEAUTY,
+ .flags = 0x80400FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = TRUE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_PERISH_SONG,
+ MOVE_MEAN_LOOK,
+ MOVE_LOVELY_KISS,
+ MOVE_FAKE_TEARS
+ },
+ .cool = 100,
+ .beauty = 150,
+ .cute = 100,
+ .smart = 150,
+ .tough = 120,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_CLARA] = {
+ .species = SPECIES_TOGEPI,
+ .nickname = _("GEPITO"),
+ .trainerName = _("CLARA"),
+ .trainerGfxId = EVENT_OBJ_GFX_WOMAN_2,
+ .flags = 0x10200FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_GROWL,
+ MOVE_YAWN,
+ MOVE_ENCORE,
+ MOVE_FOLLOW_ME
+ },
+ .cool = 80,
+ .beauty = 120,
+ .cute = 200,
+ .smart = 120,
+ .tough = 80,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_JAKOB] = {
+ .species = SPECIES_ESPEON,
+ .nickname = _("SPEON"),
+ .trainerName = _("JAKOB"),
+ .trainerGfxId = EVENT_OBJ_GFX_PSYCHIC_M,
+ .flags = 0x20100FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = TRUE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = FALSE,
+ .moves =
+ {
+ MOVE_SWIFT,
+ MOVE_QUICK_ATTACK,
+ MOVE_MORNING_SUN,
+ MOVE_TAIL_WHIP
+ },
+ .cool = 180,
+ .beauty = 150,
+ .cute = 100,
+ .smart = 80,
+ .tough = 150,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_TREY] = {
+ .species = SPECIES_SLOWKING,
+ .nickname = _("SLOWGO"),
+ .trainerName = _("TREY"),
+ .trainerGfxId = EVENT_OBJ_GFX_SAILOR,
+ .flags = 0x8080FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = FALSE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = TRUE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_FACADE,
+ MOVE_CURSE,
+ MOVE_YAWN,
+ MOVE_FOCUS_PUNCH
+ },
+ .cool = 100,
+ .beauty = 80,
+ .cute = 200,
+ .smart = 110,
+ .tough = 170,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ },
+ [CONTEST_OPPONENT_LANE] = {
+ .species = SPECIES_URSARING,
+ .nickname = _("URSING"),
+ .trainerName = _("LANE"),
+ .trainerGfxId = EVENT_OBJ_GFX_BLACK_BELT,
+ .flags = 0x40040FFF,
+ .whichRank = CONTEST_RANK_MASTER,
+ .aiPool_Cool = TRUE,
+ .aiPool_Beauty = FALSE,
+ .aiPool_Cute = FALSE,
+ .aiPool_Smart = FALSE,
+ .aiPool_Tough = TRUE,
+ .moves =
+ {
+ MOVE_THRASH,
+ MOVE_AERIAL_ACE,
+ MOVE_FAKE_TEARS,
+ MOVE_LEER
+ },
+ .cool = 180,
+ .beauty = 140,
+ .cute = 30,
+ .smart = 80,
+ .tough = 190,
+ .sheen = 255,
+ .unk2C = {0},
+ .personality = 0,
+ .otId = 0xFFFF
+ }
+};
+
+
+const u8 gPostgameContestOpponentFilter[] =
+{
+ [CONTEST_OPPONENT_JIMMY] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_EDITH] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_EVAN] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_KELSEY] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_MADISON] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_RAYMOND] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_GRANT] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_PAIGE] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_ALEC] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_SYDNEY] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_MORRIS] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_MARIAH] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_RUSSELL] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_MELANIE] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_CHANCE] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_AGATHA] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_BEAU] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_KAY] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_CALE] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_CAITLIN] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_COLBY] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_KYLIE] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_LIAM] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_MILO] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_KARINA] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_BOBBY] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_CLAIRE] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_WILLIE] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_CASSIDY] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_MORGAN] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_SUMMER] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_MILES] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_AUDREY] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_AVERY] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_ARIANA] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_ASHTON] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_SANDRA] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_CARSON] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_KATRINA] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_LUKE] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_RAUL] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_JADA] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_ZEEK] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_DIEGO] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_ALIYAH] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_NATALIA] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_DEVIN] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_TYLOR] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_RONNIE] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_CLAUDIA] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_ELIAS] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_JADE] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_FRANCIS] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_ALISHA] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_SAUL] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_FELICIA] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_EMILIO] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_KARLA] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_DARRYL] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_SELENA] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_NOEL] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_LACEY] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_CORBIN] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_GRACIE] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_COLTIN] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_ELLIE] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_MARCUS] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_KIARA] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_BRYCE] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_JAMIE] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_JORGE] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_DEVON] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_JUSTINA] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_RALPH] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_ROSA] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_KEATON] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_MAYRA] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_LAMAR] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_AUBREY] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_NIGEL] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_CAMILLE] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_DEON] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_JANELLE] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_HEATH] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_SASHA] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_FRANKIE] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_HELEN] = CONTEST_FILTER_NONE,
+ [CONTEST_OPPONENT_CAMILE] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_MARTIN] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_SERGIO] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_KAILEY] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_PERLA] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_CLARA] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_JAKOB] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_TREY] = CONTEST_FILTER_ONLY_POSTGAME,
+ [CONTEST_OPPONENT_LANE] = CONTEST_FILTER_ONLY_POSTGAME
+};
diff --git a/src/data/contest_text_tables.h b/src/data/contest_text_tables.h
new file mode 100644
index 000000000..8375520d1
--- /dev/null
+++ b/src/data/contest_text_tables.h
@@ -0,0 +1,414 @@
+
+#include "global.h"
+
+extern const u8 gContestEffect00hDescription[];
+extern const u8 gContestEffect01hDescription[];
+extern const u8 gContestEffect02hDescription[];
+extern const u8 gContestEffect03hDescription[];
+extern const u8 gContestEffect04hDescription[];
+extern const u8 gContestEffect05hDescription[];
+extern const u8 gContestEffect06hDescription[];
+extern const u8 gContestEffect07hDescription[];
+extern const u8 gContestEffect08hDescription[];
+extern const u8 gContestEffect09hDescription[];
+extern const u8 gContestEffect0AhDescription[];
+extern const u8 gContestEffect0BhDescription[];
+extern const u8 gContestEffect0ChDescription[];
+extern const u8 gContestEffect0DhDescription[];
+extern const u8 gContestEffect0EhDescription[];
+extern const u8 gContestEffect0FhDescription[];
+extern const u8 gContestEffect10hDescription[];
+extern const u8 gContestEffect11hDescription[];
+extern const u8 gContestEffect12hDescription[];
+extern const u8 gContestEffect13hDescription[];
+extern const u8 gContestEffect14hDescription[];
+extern const u8 gContestEffect15hDescription[];
+extern const u8 gContestEffect16hDescription[];
+extern const u8 gContestEffect17hDescription[];
+extern const u8 gContestEffect18hDescription[];
+extern const u8 gContestEffect19hDescription[];
+extern const u8 gContestEffect1AhDescription[];
+extern const u8 gContestEffect1BhDescription[];
+extern const u8 gContestEffect1ChDescription[];
+extern const u8 gContestEffect1DhDescription[];
+extern const u8 gContestEffect1EhDescription[];
+extern const u8 gContestEffect1FhDescription[];
+extern const u8 gContestEffect20hDescription[];
+extern const u8 gContestEffect21hDescription[];
+extern const u8 gContestEffect22hDescription[];
+extern const u8 gContestEffect23hDescription[];
+extern const u8 gContestEffect24hDescription[];
+extern const u8 gContestEffect25hDescription[];
+extern const u8 gContestEffect26hDescription[];
+extern const u8 gContestEffect27hDescription[];
+extern const u8 gContestEffect28hDescription[];
+extern const u8 gContestEffect29hDescription[];
+extern const u8 gContestEffect2AhDescription[];
+extern const u8 gContestEffect2BhDescription[];
+extern const u8 gContestEffect2ChDescription[];
+extern const u8 gContestEffect2DhDescription[];
+extern const u8 gContestEffect2EhDescription[];
+extern const u8 gContestEffect2FhDescription[];
+
+extern const u8 gUnusedContestMoveName0[];
+extern const u8 gUnusedContestMoveName1[];
+extern const u8 gUnusedContestMoveName2[];
+extern const u8 gUnusedContestMoveName3[];
+extern const u8 gUnusedContestMoveName4[];
+extern const u8 gUnusedContestMoveName5[];
+extern const u8 gUnusedContestMoveName6[];
+extern const u8 gUnusedContestMoveName7[];
+extern const u8 gUnusedContestMoveName8[];
+extern const u8 gUnusedContestMoveName9[];
+extern const u8 gUnusedContestMoveName10[];
+extern const u8 gUnusedContestMoveName11[];
+extern const u8 gUnusedContestMoveName12[];
+
+extern const u8 gContestMoveTypeCoolText[];
+extern const u8 gContestMoveTypeBeautyText[];
+extern const u8 gContestMoveTypeCuteText[];
+extern const u8 gContestMoveTypeSmartText[];
+extern const u8 gContestMoveTypeToughText[];
+
+extern const u8 gText_0827D5C1[];
+extern const u8 gText_0827D5DC[];
+extern const u8 gText_0827D600[];
+extern const u8 gText_0827D612[];
+extern const u8 gText_0827D612[];
+extern const u8 gText_0827D62D[];
+extern const u8 gText_0827D654[];
+extern const u8 gText_0827D67E[];
+extern const u8 gText_0827D69C[];
+extern const u8 gText_0827D6BA[];
+extern const u8 gText_0827D6E5[];
+extern const u8 gText_0827D706[];
+extern const u8 gText_0827D71D[];
+
+extern const u8 gText_0827D743[];
+extern const u8 gText_0827D764[];
+extern const u8 gText_0827D785[];
+extern const u8 gText_0827D7A5[];
+extern const u8 gText_0827D7C8[];
+extern const u8 gText_0827D7E8[];
+extern const u8 gText_0827D831[];
+extern const u8 gText_0827D855[];
+extern const u8 gText_0827D830[];
+extern const u8 gText_0827D872[];
+extern const u8 gText_0827D88F[];
+extern const u8 gText_0827D8B5[];
+extern const u8 gText_0827D8E4[];
+extern const u8 gText_0827D8FE[];
+extern const u8 gText_0827D926[];
+extern const u8 gText_0827D947[];
+extern const u8 gText_0827D961[];
+extern const u8 gText_0827D986[];
+extern const u8 gText_0827D9B1[];
+extern const u8 gText_0827D9D9[];
+extern const u8 gText_0827DA03[];
+extern const u8 gText_0827DA31[];
+extern const u8 gText_0827DA5B[];
+extern const u8 gText_0827DA85[];
+extern const u8 gText_0827DAB2[];
+extern const u8 gText_0827DADA[];
+extern const u8 gText_0827DB03[];
+extern const u8 gText_0827D830[];
+extern const u8 gText_0827D830[];
+extern const u8 gText_0827D830[];
+extern const u8 gText_0827DB1F[];
+extern const u8 gText_0827DB4E[];
+
+extern const u8 gText_827DB75[];
+extern const u8 gText_827DBB0[];
+extern const u8 gText_827DBE0[];
+extern const u8 gText_827DC0F[];
+extern const u8 gText_827DC45[];
+extern const u8 gText_827DC7C[];
+extern const u8 gText_827DCB4[];
+extern const u8 gText_827DCE7[];
+extern const u8 gText_827DD12[];
+extern const u8 gText_827DD3D[];
+extern const u8 gText_827DD6F[];
+extern const u8 gText_827DD8E[];
+extern const u8 gText_827DDC7[];
+extern const u8 gText_827DDF2[];
+extern const u8 gText_827DE14[];
+extern const u8 gText_827DE44[];
+extern const u8 gText_827DE73[];
+extern const u8 gText_827DEA5[];
+extern const u8 gText_827DED9[];
+extern const u8 gText_827DF02[];
+extern const u8 gText_827DF3A[];
+extern const u8 gText_827DF63[];
+extern const u8 gText_827DF8C[];
+extern const u8 gText_827DFB8[];
+extern const u8 gText_827DFE2[];
+extern const u8 gText_827E00C[];
+extern const u8 gText_827E02F[];
+extern const u8 gText_827E05F[];
+extern const u8 gText_827E08B[];
+extern const u8 gText_827E0B5[];
+extern const u8 gText_827E0DD[];
+extern const u8 gText_827E107[];
+extern const u8 gText_827E143[];
+extern const u8 gText_827E17F[];
+extern const u8 gText_827E1BB[];
+extern const u8 gText_827E1F3[];
+extern const u8 gText_827E220[];
+extern const u8 gText_827E254[];
+extern const u8 gText_827E289[];
+extern const u8 gText_827E2C5[];
+extern const u8 gText_0827E2FE[];
+extern const u8 gText_0827E32E[];
+extern const u8 gText_0827E35B[];
+extern const u8 gText_0827E38D[];
+extern const u8 gText_0827E3C1[];
+extern const u8 gText_0827E3EB[];
+extern const u8 gText_0827E416[];
+extern const u8 gText_0827E448[];
+extern const u8 gText_0827E473[];
+extern const u8 gText_0827E4A6[];
+extern const u8 gText_0827E4D5[];
+extern const u8 gText_0827E504[];
+extern const u8 gText_0827E531[];
+extern const u8 gText_0827E55A[];
+extern const u8 gText_0827E5B2[];
+extern const u8 gText_0827E5D0[];
+extern const u8 gText_0827E606[];
+extern const u8 gText_0827E638[];
+extern const u8 gText_0827E658[];
+extern const u8 gText_0827E68B[];
+extern const u8 gText_0827E6C4[];
+extern const u8 gText_0827E7BA[];
+
+extern const u8 gText_0827E85F[];
+extern const u8 gText_0827E868[];
+extern const u8 gText_0827E86F[];
+extern const u8 gText_0827E878[];
+extern const u8 gText_0827E882[];
+
+extern const u8 gText_0827E894[];
+extern const u8 gText_0827E89E[];
+extern const u8 gText_0827E8AA[];
+extern const u8 gText_0827E8B4[];
+extern const u8 gText_0827E8BF[];
+extern const u8 gText_0827E8CA[];
+
+const u8 *const gContestEffectDescriptionPointers[] =
+{
+ gContestEffect00hDescription,
+ gContestEffect01hDescription,
+ gContestEffect02hDescription,
+ gContestEffect03hDescription,
+ gContestEffect04hDescription,
+ gContestEffect05hDescription,
+ gContestEffect06hDescription,
+ gContestEffect07hDescription,
+ gContestEffect08hDescription,
+ gContestEffect09hDescription,
+ gContestEffect0AhDescription,
+ gContestEffect0BhDescription,
+ gContestEffect0ChDescription,
+ gContestEffect0DhDescription,
+ gContestEffect0EhDescription,
+ gContestEffect0FhDescription,
+ gContestEffect10hDescription,
+ gContestEffect11hDescription,
+ gContestEffect12hDescription,
+ gContestEffect13hDescription,
+ gContestEffect14hDescription,
+ gContestEffect15hDescription,
+ gContestEffect16hDescription,
+ gContestEffect17hDescription,
+ gContestEffect18hDescription,
+ gContestEffect19hDescription,
+ gContestEffect1AhDescription,
+ gContestEffect1BhDescription,
+ gContestEffect1ChDescription,
+ gContestEffect1DhDescription,
+ gContestEffect1EhDescription,
+ gContestEffect1FhDescription,
+ gContestEffect20hDescription,
+ gContestEffect21hDescription,
+ gContestEffect22hDescription,
+ gContestEffect23hDescription,
+ gContestEffect24hDescription,
+ gContestEffect25hDescription,
+ gContestEffect26hDescription,
+ gContestEffect27hDescription,
+ gContestEffect28hDescription,
+ gContestEffect29hDescription,
+ gContestEffect2AhDescription,
+ gContestEffect2BhDescription,
+ gContestEffect2ChDescription,
+ gContestEffect2DhDescription,
+ gContestEffect2EhDescription,
+ gContestEffect2FhDescription
+};
+
+// Unreferenced array of pointers to move names.
+// All of the moves except Conversion are combo starters, so this may have
+// been an early list of combo starters.
+const u8 *const gUnknown_8587D10[] =
+{
+ gUnusedContestMoveName0,
+ gUnusedContestMoveName0,
+ gUnusedContestMoveName1,
+ gUnusedContestMoveName2,
+ gUnusedContestMoveName3,
+ gUnusedContestMoveName4,
+ gUnusedContestMoveName5,
+ gUnusedContestMoveName6,
+ gUnusedContestMoveName7,
+ gUnusedContestMoveName8,
+ gUnusedContestMoveName9,
+ gUnusedContestMoveName10,
+ gUnusedContestMoveName11,
+ gUnusedContestMoveName12
+};
+
+const u8 *const gContestMoveTypeTextPointers[] =
+{
+ gContestMoveTypeCoolText,
+ gContestMoveTypeBeautyText,
+ gContestMoveTypeCuteText,
+ gContestMoveTypeSmartText,
+ gContestMoveTypeToughText
+};
+
+const u8 *const gUnknown_08587D5C[] =
+{
+ gText_0827D5C1,
+ gText_0827D5DC,
+ gText_0827D600,
+ gText_0827D612,
+ gText_0827D612,
+ gText_0827D62D,
+ gText_0827D654,
+ gText_0827D67E,
+ gText_0827D69C,
+ gText_0827D6BA,
+ gText_0827D6E5,
+ gText_0827D706,
+ gText_0827D71D
+};
+
+const u8 *const gUnknown_08587D90[] =
+{
+ gText_0827D743,
+ gText_0827D764,
+ gText_0827D785,
+ gText_0827D7A5,
+ gText_0827D7C8,
+ gText_0827D7E8,
+ gText_0827D831,
+ gText_0827D855,
+ gText_0827D830,
+ gText_0827D872,
+ gText_0827D88F,
+ gText_0827D8B5,
+ gText_0827D8E4,
+ gText_0827D8FE,
+ gText_0827D926,
+ gText_0827D947,
+ gText_0827D961,
+ gText_0827D986,
+ gText_0827D9B1,
+ gText_0827D9D9,
+ gText_0827DA03,
+ gText_0827DA31,
+ gText_0827DA5B,
+ gText_0827DA85,
+ gText_0827DAB2,
+ gText_0827DADA,
+ gText_0827DB03,
+ gText_0827D830,
+ gText_0827D830,
+ gText_0827D830,
+ gText_0827DB1F,
+ gText_0827DB4E
+};
+
+const u8 *const gUnknown_08587E10[] =
+{
+ gText_827DB75,
+ gText_827DBB0,
+ gText_827DBE0,
+ gText_827DC0F,
+ gText_827DC45,
+ gText_827DC7C,
+ gText_827DCB4,
+ gText_827DCE7,
+ gText_827DD12,
+ gText_827DD3D,
+ gText_827DD6F,
+ gText_827DD8E,
+ gText_827DDC7,
+ gText_827DDF2,
+ gText_827DE14,
+ gText_827DE44,
+ gText_827DE73,
+ gText_827DEA5,
+ gText_827DED9,
+ gText_827DF02,
+ gText_827DF3A,
+ gText_827DF63,
+ gText_827DF8C,
+ gText_827DFB8,
+ gText_827DFE2,
+ gText_827E00C,
+ gText_827E02F,
+ gText_827E05F,
+ gText_827E08B,
+ gText_827E0B5,
+ gText_827E0DD,
+ gText_827E107,
+ gText_827E143,
+ gText_827E17F,
+ gText_827E1BB,
+ gText_827E1F3,
+ gText_827E220,
+ gText_827E254,
+ gText_827E289,
+ gText_827E2C5,
+ gText_0827E2FE,
+ gText_0827E32E,
+ gText_0827E35B,
+ gText_0827E38D,
+ gText_0827E3C1,
+ gText_0827E3EB,
+ gText_0827E416,
+ gText_0827E448,
+ gText_0827E473,
+ gText_0827E4A6,
+ gText_0827E4D5,
+ gText_0827E504,
+ gText_0827E531,
+ gText_0827E55A,
+ gText_0827E5B2,
+ gText_0827E5D0,
+ gText_0827E606,
+ gText_0827E638,
+ gText_0827E658,
+ gText_0827E68B,
+ gText_0827E6C4,
+ gText_0827E7BA
+};
+
+const u8 *const gUnknown_08587F08[] =
+{
+ gText_0827E85F,
+ gText_0827E868,
+ gText_0827E86F,
+ gText_0827E878,
+ gText_0827E882
+};
+
+const u8 *const gUnknown_08587F1C[] =
+{
+ gText_0827E894,
+ gText_0827E89E,
+ gText_0827E8AA,
+ gText_0827E8B4,
+ gText_0827E8BF,
+ gText_0827E8CA
+};
diff --git a/src/decoration.c b/src/decoration.c
index 3c8809c6a..4baa6d4c8 100644
--- a/src/decoration.c
+++ b/src/decoration.c
@@ -391,10 +391,18 @@ const struct SpritePalette gUnknown_085A73E0 = {
Unknown_085A7328, OVERWORLD_PLACE_DECOR_PLAYER_PAL_TAG
};
-const struct OamData Unknown_085A73E8 = {
+const struct OamData Unknown_085A73E8 =
+{
+ .y = 0,
+ .affineMode = ST_OAM_AFFINE_OFF,
+ .objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x16),
+ .x = 0,
.size = SPRITE_SIZE(16x16),
- .priority = 1
+ .tileNum = 0,
+ .priority = 1,
+ .paletteNum = 0,
};
const union AnimCmd Unknown_085A73F0[] = {
@@ -2740,3 +2748,4 @@ void sub_812A478(u8 taskId)
StringExpandPlaceholders(gStringVar4, gText_DecorationThrownAway);
DisplayItemMessageOnField(taskId, gStringVar4, sub_8127A5C);
}
+
diff --git a/src/easy_chat.c b/src/easy_chat.c
index 2e384de6e..1cb7b0fe8 100644
--- a/src/easy_chat.c
+++ b/src/easy_chat.c
@@ -3721,7 +3721,7 @@ static void sub_811D0BC(void)
{
FillBgTilemapBufferRect(0, 0, 0, 0, 32, 20, 17);
LoadUserWindowBorderGfx(1, 1, 0xE0);
- sub_8098858(1, 1, 14);
+ DrawTextBorderOuter(1, 1, 14);
sub_811D104(0);
PutWindowTilemap(1);
CopyBgTilemapBufferToVram(0);
diff --git a/src/ereader_helpers.c b/src/ereader_helpers.c
index 6c92b676f..cdb829ac8 100755
--- a/src/ereader_helpers.c
+++ b/src/ereader_helpers.c
@@ -4,7 +4,7 @@
#include "ereader_helpers.h"
#include "link.h"
#include "main.h"
-#include "rom_8011DC0.h"
+#include "union_room.h"
#include "save.h"
#include "sprite.h"
#include "task.h"
diff --git a/src/ereader_screen.c b/src/ereader_screen.c
index b15c1fd0c..bac29cd42 100755
--- a/src/ereader_screen.c
+++ b/src/ereader_screen.c
@@ -4,7 +4,7 @@
#include "ereader_helpers.h"
#include "link.h"
#include "main.h"
-#include "rom_8011DC0.h"
+#include "mystery_gift.h"
#include "save.h"
#include "sound.h"
#include "sprite.h"
@@ -209,7 +209,7 @@ static u32 sub_81D4EE4(u8 *arg0, u16 *arg1)
return 0;
}
-void sub_81D5014(void)
+void task_add_00_ereader(void)
{
int value;
struct Unk81D5014 *data;
@@ -251,7 +251,7 @@ static void sub_81D5084(u8 taskId)
switch (data->unk8)
{
case 0:
- if (mevent_0814257C(&data->unk9, gUnknown_085EDFD6))
+ if (MG_PrintTextOnWindow1AndWaitButton(&data->unk9, gUnknown_085EDFD6))
data->unk8 = 1;
break;
case 1:
@@ -275,9 +275,9 @@ static void sub_81D5084(u8 taskId)
}
break;
case 4:
- if (mevent_0814257C(&data->unk9, gUnknown_085EDFF5))
+ if (MG_PrintTextOnWindow1AndWaitButton(&data->unk9, gUnknown_085EDFF5))
{
- sub_8018884(gUnknown_085EE014);
+ AddTextPrinterToWindow1(gUnknown_085EE014);
sub_81D505C(&data->unk0);
data->unk8 = 5;
}
@@ -324,11 +324,11 @@ static void sub_81D5084(u8 taskId)
}
break;
case 7:
- if (mevent_0814257C(&data->unk9, gUnknown_085EE05C))
+ if (MG_PrintTextOnWindow1AndWaitButton(&data->unk9, gUnknown_085EE05C))
data->unk8 = 4;
break;
case 8:
- sub_8018884(gUnknown_085EE097);
+ AddTextPrinterToWindow1(gUnknown_085EE097);
// XXX: This (u32*) cast is discarding the const qualifier from gUnknown_089A3470
sub_81D4D50(&gUnknown_03006370, gMultiBootProgram_BerryGlitchFix_Start - gUnknown_089A3470, (u32*)gUnknown_089A3470);
data->unk8 = 9;
@@ -347,7 +347,7 @@ static void sub_81D5084(u8 taskId)
else if (data->unkE == 1)
{
sub_81D505C(&data->unk0);
- sub_8018884(gUnknown_085EE120);
+ AddTextPrinterToWindow1(gUnknown_085EE120);
data->unk8 = 11;
}
else
@@ -361,7 +361,7 @@ static void sub_81D5084(u8 taskId)
break;
case 12:
sub_81D4E30();
- sub_8018884(gUnknown_085EE0DC);
+ AddTextPrinterToWindow1(gUnknown_085EE0DC);
data->unk8 = 13;
break;
case 13:
@@ -370,7 +370,7 @@ static void sub_81D5084(u8 taskId)
case 0:
break;
case 2:
- sub_8018884(gUnknown_085EE097);
+ AddTextPrinterToWindow1(gUnknown_085EE097);
data->unk8 = 14;
break;
case 1:
@@ -418,7 +418,7 @@ static void sub_81D5084(u8 taskId)
case 17:
if (sub_81D3AB0((struct Unk81D38FC *)&gDecompressionBuffer))
{
- sub_8018884(gUnknown_085EE0FA);
+ AddTextPrinterToWindow1(gUnknown_085EE0FA);
sub_81D505C(&data->unk0);
data->unk8 = 18;
}
@@ -430,7 +430,7 @@ static void sub_81D5084(u8 taskId)
case 18:
if (sub_81D5064(&data->unk0, 120))
{
- sub_8018884(gUnknown_085EE107);
+ AddTextPrinterToWindow1(gUnknown_085EE107);
PlayFanfare(MUS_FANFA4);
data->unk8 = 19;
}
@@ -440,25 +440,25 @@ static void sub_81D5084(u8 taskId)
data->unk8 = 26;
break;
case 23:
- if (mevent_0814257C(&data->unk9,gUnknown_085EE06B))
+ if (MG_PrintTextOnWindow1AndWaitButton(&data->unk9,gUnknown_085EE06B))
data->unk8 = 26;
break;
case 20:
- if (mevent_0814257C(&data->unk9, gUnknown_085EE0A3))
+ if (MG_PrintTextOnWindow1AndWaitButton(&data->unk9, gUnknown_085EE0A3))
data->unk8 = 0;
break;
case 21:
- if (mevent_0814257C(&data->unk9, gUnknown_085EE0BF))
+ if (MG_PrintTextOnWindow1AndWaitButton(&data->unk9, gUnknown_085EE0BF))
data->unk8 = 0;
break;
case 22:
- if (mevent_0814257C(&data->unk9, gUnknown_085EE12D))
+ if (MG_PrintTextOnWindow1AndWaitButton(&data->unk9, gUnknown_085EE12D))
data->unk8 = 0;
break;
case 26:
Free(data->unk10);
DestroyTask(taskId);
- SetMainCallback2(sub_80186A4);
+ SetMainCallback2(MainCB_FreeAllBuffersAndReturnToInitTitleScreen);
break;
}
}
diff --git a/src/evolution_scene.c b/src/evolution_scene.c
index 4bf7701be..8c4847b8d 100644
--- a/src/evolution_scene.c
+++ b/src/evolution_scene.c
@@ -1228,7 +1228,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
if (!gPaletteFade.active)
{
if (gWirelessCommType)
- sub_800E084();
+ DestroyWirelessStatusIndicatorSprite();
Free(GetBgTilemapBuffer(3));
Free(GetBgTilemapBuffer(1));
diff --git a/src/field_effect.c b/src/field_effect.c
index 825efc380..93d7e5ef8 100644
--- a/src/field_effect.c
+++ b/src/field_effect.c
@@ -284,20 +284,44 @@ bool8 (*const gFieldEffectScriptFuncs[])(u8 **, u32 *) =
const struct OamData gNewGameBirchOamAttributes =
{
+ .y = 0,
+ .affineMode = ST_OAM_AFFINE_OFF,
+ .objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x64),
- .size = SPRITE_SIZE(64x64)
+ .x = 0,
+ .size = SPRITE_SIZE(64x64),
+ .tileNum = 0,
+ .priority = 0,
+ .paletteNum = 0,
};
const struct OamData gOamData_855C218 =
{
+ .y = 0,
+ .affineMode = ST_OAM_AFFINE_OFF,
+ .objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x8),
- .size = SPRITE_SIZE(8x8)
+ .x = 0,
+ .size = SPRITE_SIZE(8x8),
+ .tileNum = 0,
+ .priority = 0,
+ .paletteNum = 0,
};
const struct OamData gOamData_855C220 =
{
+ .y = 0,
+ .affineMode = ST_OAM_AFFINE_OFF,
+ .objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x16),
- .size = SPRITE_SIZE(16x16)
+ .x = 0,
+ .size = SPRITE_SIZE(16x16),
+ .tileNum = 0,
+ .priority = 0,
+ .paletteNum = 0,
};
const struct SpriteFrameImage gNewGameBirchPicTable[] =
@@ -347,8 +371,16 @@ const struct SpritePalette gFieldEffectObjectPaletteInfo5 =
const struct OamData gOamData_855C26C =
{
+ .y = 0,
+ .affineMode = ST_OAM_AFFINE_OFF,
+ .objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x16),
- .size = SPRITE_SIZE(32x16)
+ .x = 0,
+ .size = SPRITE_SIZE(32x16),
+ .tileNum = 0,
+ .priority = 0,
+ .paletteNum = 0,
};
const struct SpriteFrameImage gSpriteImageTable_855C274[] =
@@ -3759,3 +3791,4 @@ static void Fldeff_MoveDeoxysRock_Step(u8 taskId)
break;
}
}
+
diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c
index eac434983..8fca02707 100644
--- a/src/field_weather_effect.c
+++ b/src/field_weather_effect.c
@@ -1579,18 +1579,15 @@ static void LoadAshSpriteSheet(void)
static const struct OamData sAshSpriteOamData =
{
.y = 0,
- .affineMode = 0,
+ .affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_BLEND,
- .mosaic = 0,
- .bpp = 0,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x64),
.x = 0,
- .matrixNum = 0,
.size = SPRITE_SIZE(64x64),
.tileNum = 0,
.priority = 1,
.paletteNum = 15,
- .affineParam = 0,
};
static const union AnimCmd sAshSpriteAnimCmd0[] =
@@ -1800,18 +1797,15 @@ static const struct SpriteSheet gFog2SpriteSheet =
static const struct OamData sFog2SpriteOamData =
{
.y = 0,
- .affineMode = 0,
- .objMode = 1,
- .mosaic = 0,
- .bpp = 0,
+ .affineMode = ST_OAM_AFFINE_OFF,
+ .objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x64),
.x = 0,
- .matrixNum = 0,
.size = SPRITE_SIZE(64x64),
.tileNum = 0,
.priority = 2,
.paletteNum = 0,
- .affineParam = 0,
};
static const union AnimCmd sFog2SpriteAnimCmd0[] =
@@ -2043,18 +2037,15 @@ static void DestroySandstormSprites(void)
static const struct OamData sSandstormSpriteOamData =
{
.y = 0,
- .affineMode = 0,
- .objMode = 1,
- .mosaic = 0,
- .bpp = 0,
+ .affineMode = ST_OAM_AFFINE_OFF,
+ .objMode = ST_OAM_OBJ_BLEND,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x64),
.x = 0,
- .matrixNum = 0,
.size = SPRITE_SIZE(64x64),
.tileNum = 0,
.priority = 1,
.paletteNum = 0,
- .affineParam = 0,
};
static const union AnimCmd sSandstormSpriteAnimCmd0[] =
@@ -2591,3 +2582,5 @@ static void UpdateRainCounter(u8 newWeather, u8 oldWeather)
&& (newWeather == WEATHER_RAIN_LIGHT || newWeather == WEATHER_RAIN_MED))
IncrementGameStat(GAME_STAT_GOT_RAINED_ON);
}
+
+
diff --git a/src/fldeff_misc.c b/src/fldeff_misc.c
index 5d1920aac..efde43b76 100644
--- a/src/fldeff_misc.c
+++ b/src/fldeff_misc.c
@@ -23,7 +23,7 @@
#include "constants/songs.h"
#include "constants/vars.h"
-extern struct MapPosition gPlayerFacingPosition;
+EWRAM_DATA struct MapPosition gPlayerFacingPosition = {0};
static void sub_80F9C90(u8);
static void sub_80F9DFC(u8);
diff --git a/src/fldeff_rocksmash.c b/src/fldeff_rocksmash.c
index 86df8e943..a9077f2ff 100644
--- a/src/fldeff_rocksmash.c
+++ b/src/fldeff_rocksmash.c
@@ -27,9 +27,6 @@ static void sub_813561C(u8 taskId);
static void sub_81356C4(void);
static void sub_8135714(void);
-// extern RAM loc
-extern struct MapPosition gPlayerFacingPosition;
-
// text
bool8 CheckObjectGraphicsInFrontOfPlayer(u8 graphicsId)
{
diff --git a/src/ghost.c b/src/ghost.c
index 998be0caa..97b86aa76 100644
--- a/src/ghost.c
+++ b/src/ghost.c
@@ -87,7 +87,7 @@ const union AffineAnimCmd *const gUnknown_08596D54[] =
gUnknown_08596D44,
};
-const struct SpriteTemplate gUnknown_08596D58 =
+const struct SpriteTemplate gShadowBallSpriteTemplate =
{
.tileTag = ANIM_TAG_SHADOW_BALL,
.paletteTag = ANIM_TAG_SHADOW_BALL,
@@ -261,20 +261,20 @@ static void sub_81116E8(struct Sprite *sprite)
AnimTranslateLinear(sprite);
sprite->pos2.x += Sin(sprite->data[5], 10);
sprite->pos2.y += Cos(sprite->data[5], 15);
-
+
r2 = sprite->data[5];
sprite->data[5] = (sprite->data[5] + 5) & 0xFF;
r0 = sprite->data[5];
-
+
if (r2 == 0 || r2 > 196)
{
if (r0 > 0)
PlaySE(SE_W109);
}
-
+
if (sprite->data[6] == 0)
{
- sprite->invisible = TRUE;
+ sprite->invisible = TRUE;
sprite->callback = DestroyAnimSpriteAndDisableBlend;
}
else
@@ -283,18 +283,18 @@ static void sub_81116E8(struct Sprite *sprite)
static void sub_8111764(struct Sprite *sprite)
{
-
- s16 r0;
+
+ s16 r0;
if (sprite->data[6] > 0xFF)
{
if (++sprite->data[6] == 0x10d)
sprite->data[6] = 0;
return;
}
-
+
r0 = sprite->data[7];
sprite->data[7]++;
-
+
if ((r0 & 0xFF) == 0)
{
sprite->data[7] &= 0xff00;
@@ -392,16 +392,16 @@ static void sub_811196C(u8 taskId)
}
}
-// Spins a sprite towards the target, pausing in the middle.
-// Used in Shadow Ball.
+// Spins a sprite towards the target, pausing in the middle.
+// Used in Shadow Ball.
// arg 0: duration step 1 (attacker -> center)
// arg 1: duration step 2 (spin center)
// arg 2: duration step 3 (center -> target)
static void InitAnimShadowBall(struct Sprite *sprite)
{
- u16 r5, r6;
- r5 = sprite->pos1.x;
- r6 = sprite->pos1.y;
+ s16 oldPosX = sprite->pos1.x;
+ s16 oldPosY = sprite->pos1.y;
+
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3);
sprite->data[0] = 0;
@@ -410,8 +410,8 @@ static void InitAnimShadowBall(struct Sprite *sprite)
sprite->data[3] = gBattleAnimArgs[2];
sprite->data[4] = sprite->pos1.x << 4;
sprite->data[5] = sprite->pos1.y << 4;
- sprite->data[6] = (((s16)r5 - sprite->pos1.x) << 4) / (gBattleAnimArgs[0] << 1);
- sprite->data[7] = (((s16)r6 - sprite->pos1.y) << 4) / (gBattleAnimArgs[0] << 1);
+ sprite->data[6] = ((oldPosX - sprite->pos1.x) << 4) / (gBattleAnimArgs[0] << 1);
+ sprite->data[7] = ((oldPosY - sprite->pos1.y) << 4) / (gBattleAnimArgs[0] << 1);
sprite->callback = AnimShadowBallStep;
}
@@ -465,50 +465,57 @@ static void sub_8111B9C(struct Sprite *sprite)
sprite->callback = sub_8111BB4;
}
-static void sub_8111BB4(struct Sprite *sprite) {
-
- s8 r5 = FALSE;
+static void sub_8111BB4(struct Sprite *sprite)
+{
+ bool8 r5 = FALSE;
bool8 r6 = FALSE;
- if(sprite->animEnded)
+
+ if (sprite->animEnded)
{
- if(!(sprite->invisible))
- sprite->invisible=TRUE;
- switch(sprite->data[0])
+ if (!sprite->invisible)
+ sprite->invisible = TRUE;
+
+ switch (sprite->data[0])
{
- case 0:
- if((sprite->data[1]) != 2)
- break;
- goto loc_08111C06;
- case 1:
- if((sprite->data[1]) == 4)
- r5 = TRUE;
- break;
- default:
- r6 = TRUE;
+ default:
+ r6 = TRUE;
+ break;
+ case 0:
+ if (sprite->data[1] == 2)
+ r5 = TRUE;
+ break;
+ case 1:
+ if (sprite->data[1] == 4)
+ r5 = TRUE;
+ break;
}
- if(r5)
+
+ if (r5)
{
- loc_08111C06:
sprite->invisible ^= 1;
sprite->data[2]++;
sprite->data[1] = 0;
- if(sprite->data[2] == 5)
+ if (sprite->data[2] == 5)
{
sprite->data[2] = 0;
sprite->data[0]++;
}
}
- else if(r6)
+ else if (r6)
+ {
DestroyAnimSprite(sprite);
+ }
else
+ {
sprite->data[1]++;
+ }
}
}
void sub_8111C50(u8 taskId)
{
struct Task *task;
-
+
task = &gTasks[taskId];
task->data[0] = CloneBattlerSpriteWithBlend(1);
if (task->data[0] < 0)
@@ -523,7 +530,7 @@ void sub_8111C50(u8 taskId)
SetGpuReg(REG_OFFSET_BLDCNT, (BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL));
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(task->data[2], task->data[3]));
gSprites[task->data[0]].data[0] = 80;
- if (GetBattlerSide(gBattleAnimTarget) == 0)
+ if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER)
{
gSprites[task->data[0]].data[1] = -144;
gSprites[task->data[0]].data[2] = 112;
@@ -573,6 +580,7 @@ static void sub_8111D78(u8 taskId)
break;
case 2:
DestroyAnimVisualTask(taskId);
+ break;
}
}
@@ -595,7 +603,7 @@ static void sub_8111E78(u8 taskId)
switch (task->data[15])
{
case 0:
- task->data[14] = AllocSpritePalette(0x2771);
+ task->data[14] = AllocSpritePalette(ANIM_TAG_BENT_SPOON);
if (task->data[14] == 0xFF || task->data[14] == 0xF)
{
DestroyAnimVisualTask(taskId);
@@ -605,7 +613,7 @@ static void sub_8111E78(u8 taskId)
task->data[0] = CloneBattlerSpriteWithBlend(1);
if (task->data[0] < 0)
{
- FreeSpritePaletteByTag(0x2771);
+ FreeSpritePaletteByTag(ANIM_TAG_BENT_SPOON);
DestroyAnimVisualTask(taskId);
}
else
@@ -698,14 +706,14 @@ static void sub_81120DC(u8 taskId)
static void sub_8112170(u8 taskId)
{
struct Task *task = &gTasks[taskId];
- u8 position = GetBattlerSpriteBGPriorityRank(gBattleAnimTarget);
+ u8 rank = GetBattlerSpriteBGPriorityRank(gBattleAnimTarget);
switch (task->data[15])
{
case 0:
gScanlineEffect.state = 3;
task->data[14] = GetAnimBattlerSpriteId(1);
- if (position == 1)
+ if (rank == 1)
ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG1_ON);
else
ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG2_ON);
@@ -714,12 +722,12 @@ static void sub_8112170(u8 taskId)
BlendPalette(task->data[4], 16, 0, RGB(13, 0, 15));
break;
case 2:
- gSprites[task->data[14]].invisible = 1;
+ gSprites[task->data[14]].invisible = TRUE;
obj_delete_but_dont_free_vram(&gSprites[task->data[0]]);
- FreeSpritePaletteByTag(0x2771);
+ FreeSpritePaletteByTag(ANIM_TAG_BENT_SPOON);
SetGpuReg(REG_OFFSET_BLDCNT, 0);
SetGpuReg(REG_OFFSET_BLDALPHA, 0);
- if (position == 1)
+ if (rank == 1)
SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG1_ON);
else
SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG2_ON);
@@ -886,7 +894,7 @@ static void sub_81125E0(u8 taskId)
}
}
}
-
+
if (task->data[10])
task->data[10]--;
else if (task->data[6])
@@ -1081,7 +1089,7 @@ static void sub_8112ACC(struct Sprite *sprite)
if (sprite->data[0] == 0)
{
SetGpuReg(REG_OFFSET_BLDCNT, (BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL));
- SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0x10, 0));
+ SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(16, 0));
sprite->data[0]++;
sprite->data[1] = 0;
sprite->data[2] = 0;
@@ -1120,7 +1128,7 @@ static void sub_8112B78(struct Sprite *sprite)
sprite->pos2.x = Sin(sprite->data[0], 12);
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
sprite->pos2.x = -sprite->pos2.x;
-
+
sprite->data[0] = (sprite->data[0] + 6) & 0xFF;
sprite->data[1] += 0x100;
sprite->pos2.y = -(sprite->data[1] >> 8);
diff --git a/src/international_string_util.c b/src/international_string_util.c
index a7c42c39e..dfeda49e3 100644
--- a/src/international_string_util.c
+++ b/src/international_string_util.c
@@ -62,7 +62,7 @@ int sub_81DB3D8(const struct MenuAction *str, const u8* arg1, int arg2)
return convert_pixel_width_to_tile_width(var);
}
-int sub_81DB41C(const struct ListMenuTemplate *listMenu)
+int Intl_GetListMenuWidth(const struct ListMenuTemplate *listMenu)
{
int i, maxWidth, finalWidth;
const struct ListMenuItem *items = listMenu->items;
diff --git a/src/link_rfu.c b/src/link_rfu.c
index 945806459..1e4c9c7e6 100644
--- a/src/link_rfu.c
+++ b/src/link_rfu.c
@@ -11,13 +11,13 @@
#include "overworld.h"
#include "random.h"
#include "palette.h"
-#include "rom_8011DC0.h"
+#include "union_room.h"
#include "string_util.h"
#include "task.h"
#include "text.h"
#include "constants/species.h"
#include "save.h"
-#include "rom_8011DC0.h"
+#include "mystery_gift.h"
extern u16 gHeldKeyCodeToSend;
@@ -154,9 +154,18 @@ const u8 sWireless_RSEtoASCIITable[] = {
0x20, 0x2b, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00
};
-const struct OamData sWirelessStatusIndicatorOamData = {
+const struct OamData sWirelessStatusIndicatorOamData =
+{
+ .y = 0,
+ .affineMode = ST_OAM_AFFINE_OFF,
+ .objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x16),
- .size = SPRITE_SIZE(16x16)
+ .x = 0,
+ .size = SPRITE_SIZE(16x16),
+ .tileNum = 0,
+ .priority = 0,
+ .paletteNum = 0,
};
static const union AnimCmd sWirelessStatusIndicatorAnim0[] = {
// 3 bars
@@ -2243,7 +2252,7 @@ void CreateWirelessStatusIndicatorSprite(u8 x, u8 y)
}
}
-void sub_800E084(void)
+void DestroyWirelessStatusIndicatorSprite(void)
{
if (gSprites[gWirelessStatusIndicatorSpriteId].data[7] == 0x1234)
{
@@ -2356,7 +2365,7 @@ void sub_800E174(void)
CpuCopy16(gMain.oamBuffer + 125, (struct OamData *)OAM + 125, sizeof(struct OamData));
if (sub_8011A74() == 1)
{
- sub_800E084();
+ DestroyWirelessStatusIndicatorSprite();
}
}
}
@@ -4209,7 +4218,7 @@ void sub_8010DB4(void)
{
if (gUnknown_03005000.unk_ee == 1 && gUnknown_03004140.unk_02 == 0)
{
- if (gMain.callback2 == sub_8018438 || gUnknown_03004140.unk_3c->unk_04)
+ if (gMain.callback2 == c2_mystery_gift_e_reader_run || gUnknown_03004140.unk_3c->unk_04)
gWirelessCommType = 2;
SetMainCallback2(CB2_LinkError);
gMain.savedCallback = CB2_LinkError;
@@ -5182,3 +5191,4 @@ u32 GetRfuRecvQueueLength(void)
{
return gUnknown_03005000.unk_124.unk_8c2;
}
+
diff --git a/src/list_menu.c b/src/list_menu.c
index 57bcc5c4f..6d51559f7 100644
--- a/src/list_menu.c
+++ b/src/list_menu.c
@@ -312,7 +312,7 @@ static void ListMenuDummyTask(u8 taskId)
}
-s32 DoMysteryGiftListMenu(struct WindowTemplate *windowTemplate, struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum)
+s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum)
{
switch (sMysteryGiftLinkMenu.state)
{
@@ -324,7 +324,7 @@ s32 DoMysteryGiftListMenu(struct WindowTemplate *windowTemplate, struct ListMenu
case 2:
LoadUserWindowBorderGfx(sMysteryGiftLinkMenu.windowId, tileNum, palNum);
case 1:
- sub_8098858(sMysteryGiftLinkMenu.windowId, tileNum, palNum / 16);
+ DrawTextBorderOuter(sMysteryGiftLinkMenu.windowId, tileNum, palNum / 16);
break;
}
gMultiuseListMenuTemplate = *listMenuTemplate;
diff --git a/src/main_menu.c b/src/main_menu.c
index cbd257cb1..8c9612c24 100644
--- a/src/main_menu.c
+++ b/src/main_menu.c
@@ -38,6 +38,7 @@
#include "text_window.h"
#include "title_screen.h"
#include "window.h"
+#include "mystery_gift.h"
/*
* Main menu state machine
@@ -1083,7 +1084,7 @@ static void Task_HandleMainMenuAPressed(u8 taskId)
DestroyTask(taskId);
break;
case ACTION_EREADER:
- SetMainCallback2(sub_801867C);
+ SetMainCallback2(c2_ereader);
DestroyTask(taskId);
break;
case ACTION_INVALID:
diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c
index ec5cb238b..8bb9cb6e4 100644
--- a/src/mauville_old_man.c
+++ b/src/mauville_old_man.c
@@ -914,7 +914,7 @@ struct Story
};
static const struct Story sStorytellerStories[] = {
- {GAME_STAT_50, 1, MauvilleCity_PokemonCenter_1F_Text_28E930, MauvilleCity_PokemonCenter_1F_Text_28E947, MauvilleCity_PokemonCenter_1F_Text_28E956},
+ {GAME_STAT_NUM_UNION_ROOM_BATTLES, 1, MauvilleCity_PokemonCenter_1F_Text_28E930, MauvilleCity_PokemonCenter_1F_Text_28E947, MauvilleCity_PokemonCenter_1F_Text_28E956},
{GAME_STAT_STARTED_TRENDS, 1, MauvilleCity_PokemonCenter_1F_Text_28E9D7, MauvilleCity_PokemonCenter_1F_Text_28E9EF, MauvilleCity_PokemonCenter_1F_Text_28E9FE},
{GAME_STAT_PLANTED_BERRIES, 1, MauvilleCity_PokemonCenter_1F_Text_28EA7D, MauvilleCity_PokemonCenter_1F_Text_28EA98, MauvilleCity_PokemonCenter_1F_Text_28EAA8},
{GAME_STAT_TRADED_BIKES, 1, MauvilleCity_PokemonCenter_1F_Text_28EB19, MauvilleCity_PokemonCenter_1F_Text_28EB31, MauvilleCity_PokemonCenter_1F_Text_28EB3E},
@@ -1193,7 +1193,7 @@ static void Task_StoryListMenu(u8 taskId) // Task_StoryListMenu
gSpecialVar_Result = 1;
sSelectedStory = selection;
}
- sub_80E2A78(sStorytellerWindowId);
+ ClearToTransparentAndRemoveWindow(sStorytellerWindowId);
DestroyTask(taskId);
EnableBothScriptContexts();
break;
diff --git a/src/menu.c b/src/menu.c
index b04572b81..b766b1b86 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -43,8 +43,8 @@ struct Menu
u8 fontId;
u8 optionWidth;
u8 optionHeight;
- u8 horizontalCount;
- u8 verticalCount;
+ u8 columns;
+ u8 rows;
bool8 APressMuted;
};
@@ -432,7 +432,7 @@ void sub_819789C(void)
LoadPalette(gUnknown_0860F074, STD_WINDOW_PALETTE_NUM * 0x10, 0x14);
}
-void sub_81978B0(u16 offset)
+void Menu_LoadStdPalAt(u16 offset)
{
LoadPalette(gUnknown_0860F074, offset, 0x14);
}
@@ -1283,8 +1283,8 @@ u8 sub_8198F58(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 cursorHeight,
sMenu.fontId = fontId;
sMenu.optionWidth = a4;
sMenu.optionHeight = cursorHeight;
- sMenu.horizontalCount = a6;
- sMenu.verticalCount = a7;
+ sMenu.columns = a6;
+ sMenu.rows = a7;
pos = a9;
@@ -1308,16 +1308,16 @@ void sub_8199060(u8 oldCursorPos, u8 newCursorPos)
{
u8 cursorWidth = GetMenuCursorDimensionByFont(sMenu.fontId, 0);
u8 cursorHeight = GetMenuCursorDimensionByFont(sMenu.fontId, 1);
- u8 xPos = (oldCursorPos % sMenu.horizontalCount) * sMenu.optionWidth + sMenu.left;
- u8 yPos = (oldCursorPos / sMenu.horizontalCount) * sMenu.optionHeight + sMenu.top;
+ u8 xPos = (oldCursorPos % sMenu.columns) * sMenu.optionWidth + sMenu.left;
+ u8 yPos = (oldCursorPos / sMenu.columns) * sMenu.optionHeight + sMenu.top;
FillWindowPixelRect(sMenu.windowId,
PIXEL_FILL(1),
xPos,
yPos,
cursorWidth,
cursorHeight);
- xPos = (newCursorPos % sMenu.horizontalCount) * sMenu.optionWidth + sMenu.left;
- yPos = (newCursorPos / sMenu.horizontalCount) * sMenu.optionHeight + sMenu.top;
+ xPos = (newCursorPos % sMenu.columns) * sMenu.optionWidth + sMenu.left;
+ yPos = (newCursorPos / sMenu.columns) * sMenu.optionHeight + sMenu.top;
AddTextPrinterParameterized(sMenu.windowId,
sMenu.fontId,
gText_SelectorArrow3,
@@ -1333,13 +1333,13 @@ u8 sub_8199134(s8 deltaX, s8 deltaY)
if (deltaX != 0)
{
- if ((sMenu.cursorPos % sMenu.horizontalCount) + deltaX < 0)
+ if ((sMenu.cursorPos % sMenu.columns) + deltaX < 0)
{
- sMenu.cursorPos += sMenu.horizontalCount - 1;
+ sMenu.cursorPos += sMenu.columns - 1;
}
- else if ((sMenu.cursorPos % sMenu.horizontalCount) + deltaX >= sMenu.horizontalCount)
+ else if ((sMenu.cursorPos % sMenu.columns) + deltaX >= sMenu.columns)
{
- sMenu.cursorPos = (sMenu.cursorPos / sMenu.horizontalCount) * sMenu.horizontalCount;
+ sMenu.cursorPos = (sMenu.cursorPos / sMenu.columns) * sMenu.columns;
}
else
{
@@ -1349,17 +1349,17 @@ u8 sub_8199134(s8 deltaX, s8 deltaY)
if (deltaY != 0)
{
- if ((sMenu.cursorPos / sMenu.horizontalCount) + deltaY < 0)
+ if ((sMenu.cursorPos / sMenu.columns) + deltaY < 0)
{
- sMenu.cursorPos += sMenu.horizontalCount * (sMenu.verticalCount - 1);
+ sMenu.cursorPos += sMenu.columns * (sMenu.rows - 1);
}
- else if ((sMenu.cursorPos / sMenu.horizontalCount) + deltaY >= sMenu.verticalCount)
+ else if ((sMenu.cursorPos / sMenu.columns) + deltaY >= sMenu.rows)
{
- sMenu.cursorPos -= sMenu.horizontalCount * (sMenu.verticalCount - 1);
+ sMenu.cursorPos -= sMenu.columns * (sMenu.rows - 1);
}
else
{
- sMenu.cursorPos += (sMenu.horizontalCount * deltaY);
+ sMenu.cursorPos += (sMenu.columns * deltaY);
}
}
@@ -1381,8 +1381,8 @@ u8 sub_81991F8(s8 deltaX, s8 deltaY)
if (deltaX != 0)
{
- if (((sMenu.cursorPos % sMenu.horizontalCount) + deltaX >= 0) &&
- ((sMenu.cursorPos % sMenu.horizontalCount) + deltaX < sMenu.horizontalCount))
+ if (((sMenu.cursorPos % sMenu.columns) + deltaX >= 0) &&
+ ((sMenu.cursorPos % sMenu.columns) + deltaX < sMenu.columns))
{
sMenu.cursorPos += deltaX;
}
@@ -1390,10 +1390,10 @@ u8 sub_81991F8(s8 deltaX, s8 deltaY)
if (deltaY != 0)
{
- if (((sMenu.cursorPos / sMenu.horizontalCount) + deltaY >= 0) &&
- ((sMenu.cursorPos / sMenu.horizontalCount) + deltaY < sMenu.verticalCount))
+ if (((sMenu.cursorPos / sMenu.columns) + deltaY >= 0) &&
+ ((sMenu.cursorPos / sMenu.columns) + deltaY < sMenu.rows))
{
- sMenu.cursorPos += (sMenu.horizontalCount * deltaY);
+ sMenu.cursorPos += (sMenu.columns * deltaY);
}
}
@@ -1661,16 +1661,14 @@ void CreateYesNoMenu(const struct WindowTemplate *window, u16 baseTileNum, u8 pa
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sYesNoWindowId, 2, initialCursorPos);
}
-void sub_81997AC(u8 windowId, u8 a4, u8 a6, u8 a7, const struct MenuAction *strs)
+void PrintMenuGridTable(u8 windowId, u8 optionWidth, u8 columns, u8 rows, const struct MenuAction *strs)
{
- u32 i;
- u32 j;
- for (i = 0; i < a7; i++)
+ u32 i, j;
+
+ for (i = 0; i < rows; i++)
{
- for (j = 0; j < a6; j++)
- {
- AddTextPrinterParameterized(windowId, 1, strs[(i * a6) + j].text, (a4 * j) + 8, (i * 16) + 1, 0xFF, NULL);
- }
+ for (j = 0; j < columns; j++)
+ AddTextPrinterParameterized(windowId, 1, strs[(i * columns) + j].text, (optionWidth * j) + 8, (i * 16) + 1, 0xFF, NULL);
}
CopyWindowToVram(windowId, 2);
}
@@ -1706,20 +1704,20 @@ void sub_819983C(u8 windowId, u8 a4, u8 itemCount, u8 itemCount2, const struct M
CopyWindowToVram(windowId, 2);
}
-u8 sub_8199944(u8 windowId, u8 optionWidth, u8 horizontalCount, u8 verticalCount, u8 initialCursorPos)
+u8 sub_8199944(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initialCursorPos)
{
s32 pos;
sMenu.left = 0;
sMenu.top = 1;
sMenu.minCursorPos = 0;
- sMenu.maxCursorPos = (horizontalCount * verticalCount) - 1;
+ sMenu.maxCursorPos = (columns * rows) - 1;
sMenu.windowId = windowId;
sMenu.fontId = 1;
sMenu.optionWidth = optionWidth;
sMenu.optionHeight = 16;
- sMenu.horizontalCount = horizontalCount;
- sMenu.verticalCount = verticalCount;
+ sMenu.columns = columns;
+ sMenu.rows = rows;
pos = initialCursorPos;
diff --git a/src/mevent2.c b/src/mevent2.c
index 8a6bd9faa..4174c4055 100755
--- a/src/mevent2.c
+++ b/src/mevent2.c
@@ -14,7 +14,7 @@
static EWRAM_DATA bool32 gUnknown_02022C70 = FALSE;
static void sub_801B180(void);
-static void sub_801B14C(void);
+static void s_DestroyWonderNews(void);
static bool32 sub_801B114(const struct MEventBuffer_3120_Sub *data);
static bool32 sub_801B2CC(const struct MEventBuffer_32E0_Sub *data);
static void sub_801B330(void);
@@ -29,7 +29,7 @@ void sub_801AFD8(void)
sub_811F8BC();
}
-struct MEventBuffer_3120_Sub *sub_801B00C(void)
+struct MEventBuffer_3120_Sub *sav1_get_mevent_buffer_0(void)
{
return &gSaveBlock1Ptr->unk_322C.buffer_000.data;
}
@@ -54,9 +54,9 @@ u16 *sub_801B058(void)
return gSaveBlock1Ptr->unk_322C.unk_338;
}
-void sub_801B06C(void)
+void DestroyWonderNews(void)
{
- sub_801B14C();
+ s_DestroyWonderNews();
}
bool32 sub_801B078(const struct MEventBuffer_3120_Sub *src)
@@ -64,13 +64,13 @@ bool32 sub_801B078(const struct MEventBuffer_3120_Sub *src)
if (!sub_801B114(src))
return FALSE;
- sub_801B14C();
+ s_DestroyWonderNews();
gSaveBlock1Ptr->unk_322C.buffer_000.data = *src;
gSaveBlock1Ptr->unk_322C.buffer_000.crc = CalcCRC16WithTable((void *)&gSaveBlock1Ptr->unk_322C.buffer_000.data, sizeof(struct MEventBuffer_3120_Sub));
return TRUE;
}
-bool32 sub_801B0CC(void)
+bool32 ValidateReceivedWonderNews(void)
{
if (CalcCRC16WithTable((void *)&gSaveBlock1Ptr->unk_322C.buffer_000.data, sizeof(struct MEventBuffer_3120_Sub)) != gSaveBlock1Ptr->unk_322C.buffer_000.crc)
return FALSE;
@@ -88,7 +88,7 @@ static bool32 sub_801B114(const struct MEventBuffer_3120_Sub *data)
return TRUE;
}
-bool32 sub_801B128(void)
+bool32 WonderNews_Test_Unk_02(void)
{
const struct MEventBuffer_3120_Sub *data = &gSaveBlock1Ptr->unk_322C.buffer_000.data;
if (data->unk_02 == 0)
@@ -97,9 +97,9 @@ bool32 sub_801B128(void)
return TRUE;
}
-static void sub_801B14C(void)
+static void s_DestroyWonderNews(void)
{
- CpuFill32(0, sub_801B00C(), sizeof(gSaveBlock1Ptr->unk_322C.buffer_000.data));
+ CpuFill32(0, sav1_get_mevent_buffer_0(), sizeof(gSaveBlock1Ptr->unk_322C.buffer_000.data));
gSaveBlock1Ptr->unk_322C.buffer_000.crc = 0;
}
@@ -113,7 +113,7 @@ bool32 sub_801B1A4(const u8 *src)
{
const u8 *r5 = (const u8 *)&gSaveBlock1Ptr->unk_322C.buffer_000.data;
u32 i;
- if (!sub_801B0CC())
+ if (!ValidateReceivedWonderNews())
return FALSE;
for (i = 0; i < sizeof(struct MEventBuffer_3120_Sub); i++)
@@ -125,7 +125,7 @@ bool32 sub_801B1A4(const u8 *src)
return TRUE;
}
-void sub_801B1E8(void)
+void DestroyWonderCard(void)
{
sub_801B330();
sub_801B368();
@@ -143,7 +143,7 @@ bool32 sub_801B21C(const struct MEventBuffer_32E0_Sub *data)
if (!sub_801B2CC(data))
return FALSE;
- sub_801B1E8();
+ DestroyWonderCard();
memcpy(&gSaveBlock1Ptr->unk_322C.buffer_1c0.data, data, sizeof(struct MEventBuffer_32E0_Sub));
gSaveBlock1Ptr->unk_322C.buffer_1c0.crc = CalcCRC16WithTable((void *)&gSaveBlock1Ptr->unk_322C.buffer_1c0.data, sizeof(struct MEventBuffer_32E0_Sub));
r2 = &gSaveBlock1Ptr->unk_322C.buffer_310.data;
@@ -152,7 +152,7 @@ bool32 sub_801B21C(const struct MEventBuffer_32E0_Sub *data)
return TRUE;
}
-bool32 sub_801B27C(void)
+bool32 ValidateReceivedWonderCard(void)
{
if (gSaveBlock1Ptr->unk_322C.buffer_1c0.crc != CalcCRC16WithTable((void *)&gSaveBlock1Ptr->unk_322C.buffer_1c0.data, sizeof(struct MEventBuffer_32E0_Sub)))
return FALSE;
@@ -180,7 +180,7 @@ static bool32 sub_801B2CC(const struct MEventBuffer_32E0_Sub *data)
return TRUE;
}
-bool32 sub_801B308(void)
+bool32 WonderCard_Test_Unk_08_6(void)
{
const struct MEventBuffer_32E0_Sub *data = &gSaveBlock1Ptr->unk_322C.buffer_1c0.data;
if (data->unk_08_6 == 0)
@@ -201,9 +201,9 @@ static void sub_801B368(void)
gSaveBlock1Ptr->unk_322C.buffer_310.crc = 0;
}
-u16 sub_801B39C(void)
+u16 GetWonderCardFlagID(void)
{
- if (sub_801B27C())
+ if (ValidateReceivedWonderCard())
return gSaveBlock1Ptr->unk_322C.buffer_1c0.data.unk_00;
return 0;
@@ -215,7 +215,7 @@ void sub_801B3C0(struct MEventBuffer_32E0_Sub *buffer)
buffer->unk_08_6 = 0;
}
-static bool32 sub_801B3D8(u16 a0)
+static bool32 IsWonderCardFlagIDInValidRange(u16 a0)
{
if (a0 >= 1000 && a0 < 1020)
return TRUE;
@@ -247,10 +247,10 @@ static const u16 sMysteryGiftFlags[] =
FLAG_UNUSED_MYSTERY_GIFT_0x14D,
};
-bool32 sub_801B3F8(void)
+bool32 CheckReceivedGiftFromWonderCard(void)
{
- u16 value = sub_801B39C();
- if (!sub_801B3D8(value))
+ u16 value = GetWonderCardFlagID();
+ if (!IsWonderCardFlagIDInValidRange(value))
return FALSE;
if (FlagGet(sMysteryGiftFlags[value - 1000]) == TRUE)
@@ -300,7 +300,7 @@ static bool32 sub_801B4A4(const u16 *data)
static int sub_801B4CC(void)
{
struct MEventBuffer_32E0_Sub *data;
- if (!sub_801B27C())
+ if (!ValidateReceivedWonderCard())
return 0;
data = &gSaveBlock1Ptr->unk_322C.buffer_1c0.data;
@@ -353,7 +353,7 @@ void sub_801B580(struct MEventStruct_Unk1442CC *data, bool32 a1)
data->unk_10 = 0x0200;
}
- if (sub_801B27C())
+ if (ValidateReceivedWonderCard())
{
data->unk_14 = sav1_get_mevent_buffer_1()->unk_00;
data->unk_20 = *sav1_get_mevent_buffer_2();
@@ -554,7 +554,7 @@ bool32 sub_801B94C(u16 a0)
if (a0 == 0)
return FALSE;
- if (!sub_801B27C())
+ if (!ValidateReceivedWonderCard())
return FALSE;
if (gSaveBlock1Ptr->unk_322C.buffer_1c0.data.unk_00 != a0)
diff --git a/src/mevent_801BAAC.c b/src/mevent_801BAAC.c
index 857ca3fde..24a999f69 100644
--- a/src/mevent_801BAAC.c
+++ b/src/mevent_801BAAC.c
@@ -13,6 +13,7 @@
#include "string_util.h"
#include "link_rfu.h"
#include "mevent.h"
+#include "mystery_gift.h"
struct UnkStruct_8467FB8
{
@@ -52,7 +53,7 @@ struct UnkStruct_203F3C8
/*045C*/ u8 buffer_045C[0x1000];
};
-EWRAM_DATA struct UnkStruct_203F3C8 * gUnknown_02022C74 = NULL;
+EWRAM_DATA struct UnkStruct_203F3C8 * sWonderCardData = NULL;
void sub_801BEF8(void);
void sub_801C178(u8 whichWindow);
@@ -149,40 +150,40 @@ const struct UnkStruct_8467FB8 gUnknown_082F1D60[8] = {
{1, 0, 0, 7, gWonderCardBgGfx8, gWonderCardBgTilemap8, gWonderCardBgPal8}
};
-bool32 sub_801BAAC(struct MEventBuffer_32E0_Sub * r5, struct MEventBuffer_3430_Sub * r6)
+bool32 InitWonderCardResources(struct MEventBuffer_32E0_Sub * r5, struct MEventBuffer_3430_Sub * r6)
{
if (r5 == NULL || r6 == NULL)
return FALSE;
- gUnknown_02022C74 = AllocZeroed(sizeof(struct UnkStruct_203F3C8));
- if (gUnknown_02022C74 == NULL)
+ sWonderCardData = AllocZeroed(sizeof(struct UnkStruct_203F3C8));
+ if (sWonderCardData == NULL)
return FALSE;
- gUnknown_02022C74->unk_0000 = *r5;
- gUnknown_02022C74->unk_014C = *r6;
- if (gUnknown_02022C74->unk_0000.unk_08_2 >= ARRAY_COUNT(gUnknown_082F1D60))
- gUnknown_02022C74->unk_0000.unk_08_2 = 0;
- if (gUnknown_02022C74->unk_0000.unk_08_0 >= ARRAY_COUNT(gUnknown_082F0E18))
- gUnknown_02022C74->unk_0000.unk_08_0 = 0;
- if (gUnknown_02022C74->unk_0000.unk_09 > ARRAY_COUNT(gUnknown_02022C74->unk_017D))
- gUnknown_02022C74->unk_0000.unk_09 = 0;
- gUnknown_02022C74->unk_0170 = &gUnknown_082F1D60[gUnknown_02022C74->unk_0000.unk_08_2];
+ sWonderCardData->unk_0000 = *r5;
+ sWonderCardData->unk_014C = *r6;
+ if (sWonderCardData->unk_0000.unk_08_2 >= ARRAY_COUNT(gUnknown_082F1D60))
+ sWonderCardData->unk_0000.unk_08_2 = 0;
+ if (sWonderCardData->unk_0000.unk_08_0 >= ARRAY_COUNT(gUnknown_082F0E18))
+ sWonderCardData->unk_0000.unk_08_0 = 0;
+ if (sWonderCardData->unk_0000.unk_09 > ARRAY_COUNT(sWonderCardData->unk_017D))
+ sWonderCardData->unk_0000.unk_09 = 0;
+ sWonderCardData->unk_0170 = &gUnknown_082F1D60[sWonderCardData->unk_0000.unk_08_2];
return TRUE;
}
-void sub_801BB48(void)
+void DestroyWonderCardResources(void)
{
- if (gUnknown_02022C74 != NULL)
+ if (sWonderCardData != NULL)
{
- *gUnknown_02022C74 = (struct UnkStruct_203F3C8){};
- Free(gUnknown_02022C74);
- gUnknown_02022C74 = NULL;
+ *sWonderCardData = (struct UnkStruct_203F3C8){};
+ Free(sWonderCardData);
+ sWonderCardData = NULL;
}
}
-s32 sub_801BB74(void)
+s32 FadeToWonderCardMenu(void)
{
- if (gUnknown_02022C74 == NULL)
+ if (sWonderCardData == NULL)
return -1;
- switch(gUnknown_02022C74->unk_0174)
+ switch(sWonderCardData->unk_0174)
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
@@ -198,19 +199,19 @@ s32 sub_801BB74(void)
CopyBgTilemapBufferToVram(0);
CopyBgTilemapBufferToVram(1);
CopyBgTilemapBufferToVram(2);
- decompress_and_copy_tile_data_to_vram(2, gUnknown_02022C74->unk_0170->tiles, 0, 0x008, 0);
- gUnknown_02022C74->unk_0176[0] = AddWindow(&gUnknown_082F0E1C[0]);
- gUnknown_02022C74->unk_0176[1] = AddWindow(&gUnknown_082F0E1C[1]);
- gUnknown_02022C74->unk_0176[2] = AddWindow(&gUnknown_082F0E1C[2]);
+ decompress_and_copy_tile_data_to_vram(2, sWonderCardData->unk_0170->tiles, 0, 0x008, 0);
+ sWonderCardData->unk_0176[0] = AddWindow(&gUnknown_082F0E1C[0]);
+ sWonderCardData->unk_0176[1] = AddWindow(&gUnknown_082F0E1C[1]);
+ sWonderCardData->unk_0176[2] = AddWindow(&gUnknown_082F0E1C[2]);
break;
case 3:
if (free_temp_tile_data_buffers_if_possible())
return 0;
LoadPalette(stdpal_get(1), 0x20, 0x20);
gPaletteFade.bufferTransferDisabled = TRUE;
- LoadPalette(gUnknown_02022C74->unk_0170->pal, 0x10, 0x20);
- LZ77UnCompWram(gUnknown_02022C74->unk_0170->map, gUnknown_02022C74->buffer_045C);
- CopyRectToBgTilemapBufferRect(2, gUnknown_02022C74->buffer_045C, 0, 0, 30, 20, 0, 0, 30, 20, 1, 0x008, 0);
+ LoadPalette(sWonderCardData->unk_0170->pal, 0x10, 0x20);
+ LZ77UnCompWram(sWonderCardData->unk_0170->map, sWonderCardData->buffer_045C);
+ CopyRectToBgTilemapBufferRect(2, sWonderCardData->buffer_045C, 0, 0, 30, 20, 0, 0, 30, 20, 1, 0x008, 0);
CopyBgTilemapBufferToVram(2);
break;
case 4:
@@ -236,18 +237,18 @@ s32 sub_801BB74(void)
default:
if (UpdatePaletteFade())
return 0;
- gUnknown_02022C74->unk_0174 = 0;
+ sWonderCardData->unk_0174 = 0;
return 1;
}
- ++gUnknown_02022C74->unk_0174;
+ ++sWonderCardData->unk_0174;
return 0;
}
-s32 sub_801BDA4(bool32 flag)
+s32 FadeOutFromWonderCard(bool32 flag)
{
- if (gUnknown_02022C74 == NULL)
+ if (sWonderCardData == NULL)
return -1;
- switch (gUnknown_02022C74->unk_0174)
+ switch (sWonderCardData->unk_0174)
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
@@ -267,26 +268,26 @@ s32 sub_801BDA4(bool32 flag)
case 3:
HideBg(1);
HideBg(2);
- RemoveWindow(gUnknown_02022C74->unk_0176[2]);
- RemoveWindow(gUnknown_02022C74->unk_0176[1]);
- RemoveWindow(gUnknown_02022C74->unk_0176[0]);
+ RemoveWindow(sWonderCardData->unk_0176[2]);
+ RemoveWindow(sWonderCardData->unk_0176[1]);
+ RemoveWindow(sWonderCardData->unk_0176[0]);
break;
case 4:
sub_801C61C();
FreeMonIconPalettes();
break;
case 5:
- sub_80186EC(gUnknown_02022C60, flag);
+ PrintMysteryGiftOrEReaderTopMenu(gGiftIsFromEReader, flag);
CopyBgTilemapBufferToVram(0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
break;
default:
if (UpdatePaletteFade())
return 0;
- gUnknown_02022C74->unk_0174 = 0;
+ sWonderCardData->unk_0174 = 0;
return 1;
}
- ++gUnknown_02022C74->unk_0174;
+ ++sWonderCardData->unk_0174;
return 0;
}
@@ -296,59 +297,59 @@ void sub_801BEF8(void)
u16 r6;
u16 sp0[3] = {0, 0, 0};
- memcpy(gUnknown_02022C74->unk_018B, gUnknown_02022C74->unk_0000.unk_0A, 40);
- gUnknown_02022C74->unk_018B[40] = EOS;
- memcpy(gUnknown_02022C74->unk_01B4, gUnknown_02022C74->unk_0000.unk_32, 40);
- gUnknown_02022C74->unk_01B4[40] = EOS;
- if (gUnknown_02022C74->unk_0000.unk_04 > 999999)
- gUnknown_02022C74->unk_0000.unk_04 = 999999;
- ConvertIntToDecimalStringN(gUnknown_02022C74->unk_01DD, gUnknown_02022C74->unk_0000.unk_04, STR_CONV_MODE_LEFT_ALIGN, 6);
+ memcpy(sWonderCardData->unk_018B, sWonderCardData->unk_0000.unk_0A, 40);
+ sWonderCardData->unk_018B[40] = EOS;
+ memcpy(sWonderCardData->unk_01B4, sWonderCardData->unk_0000.unk_32, 40);
+ sWonderCardData->unk_01B4[40] = EOS;
+ if (sWonderCardData->unk_0000.unk_04 > 999999)
+ sWonderCardData->unk_0000.unk_04 = 999999;
+ ConvertIntToDecimalStringN(sWonderCardData->unk_01DD, sWonderCardData->unk_0000.unk_04, STR_CONV_MODE_LEFT_ALIGN, 6);
for (i = 0; i < 4; i++)
{
- memcpy(gUnknown_02022C74->unk_01E4[i], gUnknown_02022C74->unk_0000.unk_5A[i], 40);
- gUnknown_02022C74->unk_01E4[i][40] = EOS;
+ memcpy(sWonderCardData->unk_01E4[i], sWonderCardData->unk_0000.unk_5A[i], 40);
+ sWonderCardData->unk_01E4[i][40] = EOS;
}
- memcpy(gUnknown_02022C74->unk_0288, gUnknown_02022C74->unk_0000.unk_FA, 40);
- gUnknown_02022C74->unk_0288[40] = EOS;
- switch (gUnknown_02022C74->unk_0000.unk_08_0)
+ memcpy(sWonderCardData->unk_0288, sWonderCardData->unk_0000.unk_FA, 40);
+ sWonderCardData->unk_0288[40] = EOS;
+ switch (sWonderCardData->unk_0000.unk_08_0)
{
case 0:
- memcpy(gUnknown_02022C74->unk_02B1, gUnknown_02022C74->unk_0000.unk_122, 40);
- gUnknown_02022C74->unk_02B1[40] = EOS;
+ memcpy(sWonderCardData->unk_02B1, sWonderCardData->unk_0000.unk_122, 40);
+ sWonderCardData->unk_02B1[40] = EOS;
break;
case 1:
- gUnknown_02022C74->unk_02B1[00] = EOS;
+ sWonderCardData->unk_02B1[00] = EOS;
break;
case 2:
- gUnknown_02022C74->unk_02B1[00] = EOS;
- sp0[0] = gUnknown_02022C74->unk_014C.unk_00 < 999 ? gUnknown_02022C74->unk_014C.unk_00 : 999;
- sp0[1] = gUnknown_02022C74->unk_014C.unk_02 < 999 ? gUnknown_02022C74->unk_014C.unk_02 : 999;
- sp0[2] = gUnknown_02022C74->unk_014C.unk_04 < 999 ? gUnknown_02022C74->unk_014C.unk_04 : 999;
+ sWonderCardData->unk_02B1[00] = EOS;
+ sp0[0] = sWonderCardData->unk_014C.unk_00 < 999 ? sWonderCardData->unk_014C.unk_00 : 999;
+ sp0[1] = sWonderCardData->unk_014C.unk_02 < 999 ? sWonderCardData->unk_014C.unk_02 : 999;
+ sp0[2] = sWonderCardData->unk_014C.unk_04 < 999 ? sWonderCardData->unk_014C.unk_04 : 999;
for (i = 0; i < 8; i++)
{
- memset(gUnknown_02022C74->unk_02DC[i].unk_42, EOS, 4);
- memset(gUnknown_02022C74->unk_02DC[i].unk_01, EOS, 41);
+ memset(sWonderCardData->unk_02DC[i].unk_42, EOS, 4);
+ memset(sWonderCardData->unk_02DC[i].unk_01, EOS, 41);
}
for (i = 0, r6 = 0; i < 40; i++)
{
- if (gUnknown_02022C74->unk_0000.unk_122[i] != 0xF7)
+ if (sWonderCardData->unk_0000.unk_122[i] != 0xF7)
{
- gUnknown_02022C74->unk_02DC[gUnknown_02022C74->unk_0175].unk_01[r6] = gUnknown_02022C74->unk_0000.unk_122[i];
+ sWonderCardData->unk_02DC[sWonderCardData->unk_0175].unk_01[r6] = sWonderCardData->unk_0000.unk_122[i];
r6++;
}
else
{
- u8 r3 = gUnknown_02022C74->unk_0000.unk_122[i + 1];
+ u8 r3 = sWonderCardData->unk_0000.unk_122[i + 1];
if (r3 > 2)
{
i += 2;
}
else
{
- ConvertIntToDecimalStringN(gUnknown_02022C74->unk_02DC[gUnknown_02022C74->unk_0175].unk_42, sp0[r3], STR_CONV_MODE_LEADING_ZEROS, 3);
- gUnknown_02022C74->unk_02DC[gUnknown_02022C74->unk_0175].unk_00 = gUnknown_02022C74->unk_0000.unk_122[i + 2];
- gUnknown_02022C74->unk_0175++;
- if (gUnknown_02022C74->unk_0175 > 7)
+ ConvertIntToDecimalStringN(sWonderCardData->unk_02DC[sWonderCardData->unk_0175].unk_42, sp0[r3], STR_CONV_MODE_LEADING_ZEROS, 3);
+ sWonderCardData->unk_02DC[sWonderCardData->unk_0175].unk_00 = sWonderCardData->unk_0000.unk_122[i + 2];
+ sWonderCardData->unk_0175++;
+ if (sWonderCardData->unk_0175 > 7)
break;
r6 = 0;
i += 2;
@@ -361,7 +362,7 @@ void sub_801BEF8(void)
void sub_801C178(u8 whichWindow)
{
s8 sp0C = 0;
- s32 windowId = gUnknown_02022C74->unk_0176[whichWindow];
+ s32 windowId = sWonderCardData->unk_0176[whichWindow];
PutWindowTilemap(windowId);
FillWindowPixelBuffer(windowId, 0);
switch (whichWindow)
@@ -369,42 +370,42 @@ void sub_801C178(u8 whichWindow)
case 0:
{
s32 x;
- AddTextPrinterParameterized3(windowId, 3, 0, 1, gUnknown_082F0E10[gUnknown_02022C74->unk_0170->textPal1], 0, gUnknown_02022C74->unk_018B);
- x = 160 - GetStringWidth(3, gUnknown_02022C74->unk_01B4, GetFontAttribute(3, 2));
+ AddTextPrinterParameterized3(windowId, 3, 0, 1, gUnknown_082F0E10[sWonderCardData->unk_0170->textPal1], 0, sWonderCardData->unk_018B);
+ x = 160 - GetStringWidth(3, sWonderCardData->unk_01B4, GetFontAttribute(3, 2));
if (x < 0)
x = 0;
- AddTextPrinterParameterized3(windowId, 3, x, 17, gUnknown_082F0E10[gUnknown_02022C74->unk_0170->textPal1], 0, gUnknown_02022C74->unk_01B4);
- if (gUnknown_02022C74->unk_0000.unk_04 != 0)
+ AddTextPrinterParameterized3(windowId, 3, x, 17, gUnknown_082F0E10[sWonderCardData->unk_0170->textPal1], 0, sWonderCardData->unk_01B4);
+ if (sWonderCardData->unk_0000.unk_04 != 0)
{
- AddTextPrinterParameterized3(windowId, 1, 166, 17, gUnknown_082F0E10[gUnknown_02022C74->unk_0170->textPal1], 0, gUnknown_02022C74->unk_01DD);
+ AddTextPrinterParameterized3(windowId, 1, 166, 17, gUnknown_082F0E10[sWonderCardData->unk_0170->textPal1], 0, sWonderCardData->unk_01DD);
}
break;
}
case 1:
for (; sp0C < 4; sp0C++)
{
- AddTextPrinterParameterized3(windowId, 3, 0, 16 * sp0C + 2, gUnknown_082F0E10[gUnknown_02022C74->unk_0170->textPal2], 0, gUnknown_02022C74->unk_01E4[sp0C]);
+ AddTextPrinterParameterized3(windowId, 3, 0, 16 * sp0C + 2, gUnknown_082F0E10[sWonderCardData->unk_0170->textPal2], 0, sWonderCardData->unk_01E4[sp0C]);
}
break;
case 2:
- AddTextPrinterParameterized3(windowId, 3, 0, gUnknown_082F0E18[gUnknown_02022C74->unk_0000.unk_08_0], gUnknown_082F0E10[gUnknown_02022C74->unk_0170->textPal3], 0, gUnknown_02022C74->unk_0288);
- if (gUnknown_02022C74->unk_0000.unk_08_0 != 2)
+ AddTextPrinterParameterized3(windowId, 3, 0, gUnknown_082F0E18[sWonderCardData->unk_0000.unk_08_0], gUnknown_082F0E10[sWonderCardData->unk_0170->textPal3], 0, sWonderCardData->unk_0288);
+ if (sWonderCardData->unk_0000.unk_08_0 != 2)
{
- AddTextPrinterParameterized3(windowId, 3, 0, 16 + gUnknown_082F0E18[gUnknown_02022C74->unk_0000.unk_08_0], gUnknown_082F0E10[gUnknown_02022C74->unk_0170->textPal3], 0, gUnknown_02022C74->unk_02B1);
+ AddTextPrinterParameterized3(windowId, 3, 0, 16 + gUnknown_082F0E18[sWonderCardData->unk_0000.unk_08_0], gUnknown_082F0E10[sWonderCardData->unk_0170->textPal3], 0, sWonderCardData->unk_02B1);
}
else
{
s32 x = 0;
- s32 y = gUnknown_082F0E18[gUnknown_02022C74->unk_0000.unk_08_0] + 16;
+ s32 y = gUnknown_082F0E18[sWonderCardData->unk_0000.unk_08_0] + 16;
s32 spacing = GetFontAttribute(3, 2);
- for (; sp0C < gUnknown_02022C74->unk_0175; sp0C++)
+ for (; sp0C < sWonderCardData->unk_0175; sp0C++)
{
- AddTextPrinterParameterized3(windowId, 3, x, y, gUnknown_082F0E10[gUnknown_02022C74->unk_0170->textPal3], 0, gUnknown_02022C74->unk_02DC[sp0C].unk_01);
- if (gUnknown_02022C74->unk_02DC[sp0C].unk_42[0] != EOS)
+ AddTextPrinterParameterized3(windowId, 3, x, y, gUnknown_082F0E10[sWonderCardData->unk_0170->textPal3], 0, sWonderCardData->unk_02DC[sp0C].unk_01);
+ if (sWonderCardData->unk_02DC[sp0C].unk_42[0] != EOS)
{
- x += GetStringWidth(3, gUnknown_02022C74->unk_02DC[sp0C].unk_01, spacing);
- AddTextPrinterParameterized3(windowId, 3, x, y, gUnknown_082F0E10[gUnknown_02022C74->unk_0170->textPal3], 0, gUnknown_02022C74->unk_02DC[sp0C].unk_42);
- x += GetStringWidth(3, gUnknown_02022C74->unk_02DC[sp0C].unk_42, spacing) + gUnknown_02022C74->unk_02DC[sp0C].unk_00;
+ x += GetStringWidth(3, sWonderCardData->unk_02DC[sp0C].unk_01, spacing);
+ AddTextPrinterParameterized3(windowId, 3, x, y, gUnknown_082F0E10[sWonderCardData->unk_0170->textPal3], 0, sWonderCardData->unk_02DC[sp0C].unk_42);
+ x += GetStringWidth(3, sWonderCardData->unk_02DC[sp0C].unk_42, spacing) + sWonderCardData->unk_02DC[sp0C].unk_00;
}
}
}
@@ -416,24 +417,24 @@ void sub_801C178(u8 whichWindow)
void sub_801C4C0(void)
{
u8 r7 = 0;
- gUnknown_02022C74->unk_017C = 0xFF;
- if (gUnknown_02022C74->unk_014C.unk_06 != SPECIES_NONE)
+ sWonderCardData->unk_017C = 0xFF;
+ if (sWonderCardData->unk_014C.unk_06 != SPECIES_NONE)
{
- gUnknown_02022C74->unk_017C = sub_80D2D78(sub_80D2E84(gUnknown_02022C74->unk_014C.unk_06), SpriteCallbackDummy, 0xDC, 0x14, 0, FALSE);
- gSprites[gUnknown_02022C74->unk_017C].oam.priority = 2;
+ sWonderCardData->unk_017C = sub_80D2D78(sub_80D2E84(sWonderCardData->unk_014C.unk_06), SpriteCallbackDummy, 0xDC, 0x14, 0, FALSE);
+ gSprites[sWonderCardData->unk_017C].oam.priority = 2;
}
- if (gUnknown_02022C74->unk_0000.unk_09 != 0 && gUnknown_02022C74->unk_0000.unk_08_0 == 1)
+ if (sWonderCardData->unk_0000.unk_09 != 0 && sWonderCardData->unk_0000.unk_08_0 == 1)
{
LoadCompressedSpriteSheetUsingHeap(&gUnknown_082F1D00);
- LoadSpritePalette(&gUnknown_082F1D08[gUnknown_02022C74->unk_0170->textPal4]);
- for (; r7 < gUnknown_02022C74->unk_0000.unk_09; r7++)
+ LoadSpritePalette(&gUnknown_082F1D08[sWonderCardData->unk_0170->textPal4]);
+ for (; r7 < sWonderCardData->unk_0000.unk_09; r7++)
{
- gUnknown_02022C74->unk_017D[r7][0] = 0xFF;
- gUnknown_02022C74->unk_017D[r7][1] = 0xFF;
- gUnknown_02022C74->unk_017D[r7][0] = CreateSprite(&gUnknown_082F1D48, 0xd8 - 32 * r7, 0x90, 8);
- if (gUnknown_02022C74->unk_014C.unk_08[0][r7] != 0)
+ sWonderCardData->unk_017D[r7][0] = 0xFF;
+ sWonderCardData->unk_017D[r7][1] = 0xFF;
+ sWonderCardData->unk_017D[r7][0] = CreateSprite(&gUnknown_082F1D48, 0xd8 - 32 * r7, 0x90, 8);
+ if (sWonderCardData->unk_014C.unk_08[0][r7] != 0)
{
- gUnknown_02022C74->unk_017D[r7][1] = sub_80D2D78(sub_80D2E84(gUnknown_02022C74->unk_014C.unk_08[0][r7]), SpriteCallbackDummy, 0xd8 - 32 * r7, 0x88, 0, 0);
+ sWonderCardData->unk_017D[r7][1] = sub_80D2D78(sub_80D2E84(sWonderCardData->unk_014C.unk_08[0][r7]), SpriteCallbackDummy, 0xd8 - 32 * r7, 0x88, 0, 0);
}
}
}
@@ -442,19 +443,19 @@ void sub_801C4C0(void)
void sub_801C61C(void)
{
u8 r6 = 0;
- if (gUnknown_02022C74->unk_017C != 0xFF)
- sub_80D2EF8(&gSprites[gUnknown_02022C74->unk_017C]);
- if (gUnknown_02022C74->unk_0000.unk_09 != 0 && gUnknown_02022C74->unk_0000.unk_08_0 == 1)
+ if (sWonderCardData->unk_017C != 0xFF)
+ sub_80D2EF8(&gSprites[sWonderCardData->unk_017C]);
+ if (sWonderCardData->unk_0000.unk_09 != 0 && sWonderCardData->unk_0000.unk_08_0 == 1)
{
- for (; r6 < gUnknown_02022C74->unk_0000.unk_09; r6++)
+ for (; r6 < sWonderCardData->unk_0000.unk_09; r6++)
{
- if (gUnknown_02022C74->unk_017D[r6][0] != 0xFF)
+ if (sWonderCardData->unk_017D[r6][0] != 0xFF)
{
- DestroySprite(&gSprites[gUnknown_02022C74->unk_017D[r6][0]]);
+ DestroySprite(&gSprites[sWonderCardData->unk_017D[r6][0]]);
}
- if (gUnknown_02022C74->unk_017D[r6][1] != 0xFF)
+ if (sWonderCardData->unk_017D[r6][1] != 0xFF)
{
- sub_80D2EF8(&gSprites[gUnknown_02022C74->unk_017D[r6][1]]);
+ sub_80D2EF8(&gSprites[sWonderCardData->unk_017D[r6][1]]);
}
}
FreeSpriteTilesByTag(0x8000);
@@ -483,7 +484,7 @@ struct UnkStruct_203F3CC
/*03a4*/ u8 buffer_03A4[0x1000];
};
-EWRAM_DATA struct UnkStruct_203F3CC * gUnknown_02022C78 = NULL;
+EWRAM_DATA struct UnkStruct_203F3CC * sWonderNewsData = NULL;
void sub_801CDCC(void);
void sub_801CE7C(void);
@@ -541,37 +542,37 @@ const struct UnkStruct_8467FB8 gUnknown_082F24C8[] = {
{1, 0, 0, 0, gWonderNewsGfx8, gWonderNewsTilemap8, gWonderNewsPal8}
};
-bool32 sub_801C6C8(const struct MEventBuffer_3120_Sub * a0)
+bool32 InitWonderNewsResources(const struct MEventBuffer_3120_Sub * a0)
{
if (a0 == NULL)
return FALSE;
- gUnknown_02022C78 = AllocZeroed(sizeof(struct UnkStruct_203F3CC));
- if (gUnknown_02022C78 == NULL)
+ sWonderNewsData = AllocZeroed(sizeof(struct UnkStruct_203F3CC));
+ if (sWonderNewsData == NULL)
return FALSE;
- gUnknown_02022C78->unk_0000 = *a0;
- if (gUnknown_02022C78->unk_0000.unk_03 >= ARRAY_COUNT(gUnknown_082F24C8))
- gUnknown_02022C78->unk_0000.unk_03 = 0;
- gUnknown_02022C78->unk_01BC = &gUnknown_082F24C8[gUnknown_02022C78->unk_0000.unk_03];
- gUnknown_02022C78->unk_01C1 = 0xFF;
+ sWonderNewsData->unk_0000 = *a0;
+ if (sWonderNewsData->unk_0000.unk_03 >= ARRAY_COUNT(gUnknown_082F24C8))
+ sWonderNewsData->unk_0000.unk_03 = 0;
+ sWonderNewsData->unk_01BC = &gUnknown_082F24C8[sWonderNewsData->unk_0000.unk_03];
+ sWonderNewsData->unk_01C1 = 0xFF;
return TRUE;
}
-void sub_801C72C(void)
+void DestroyWonderNewsResources(void)
{
- if (gUnknown_02022C78 != NULL)
+ if (sWonderNewsData != NULL)
{
- *gUnknown_02022C78 = (struct UnkStruct_203F3CC){};
- Free(gUnknown_02022C78);
- gUnknown_02022C78 = NULL;
+ *sWonderNewsData = (struct UnkStruct_203F3CC){};
+ Free(sWonderNewsData);
+ sWonderNewsData = NULL;
}
}
-s32 sub_801C758(void)
+s32 FadeToWonderNewsMenu(void)
{
- if (gUnknown_02022C78 == NULL)
+ if (sWonderNewsData == NULL)
return -1;
- switch (gUnknown_02022C78->unk_01C0_1)
+ switch (sWonderNewsData->unk_01C0_1)
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
@@ -598,19 +599,19 @@ s32 sub_801C758(void)
CopyBgTilemapBufferToVram(1);
CopyBgTilemapBufferToVram(2);
CopyBgTilemapBufferToVram(3);
- decompress_and_copy_tile_data_to_vram(3, gUnknown_02022C78->unk_01BC->tiles, 0, 8, 0);
- gUnknown_02022C78->unk_01C8[0] = AddWindow(&gUnknown_082F1DE8[0]);
- gUnknown_02022C78->unk_01C8[1] = AddWindow(&gUnknown_082F1DE8[1]);
+ decompress_and_copy_tile_data_to_vram(3, sWonderNewsData->unk_01BC->tiles, 0, 8, 0);
+ sWonderNewsData->unk_01C8[0] = AddWindow(&gUnknown_082F1DE8[0]);
+ sWonderNewsData->unk_01C8[1] = AddWindow(&gUnknown_082F1DE8[1]);
break;
case 3:
if (free_temp_tile_data_buffers_if_possible())
return 0;
LoadPalette(stdpal_get(1), 0x20, 0x20);
gPaletteFade.bufferTransferDisabled = TRUE;
- LoadPalette(gUnknown_02022C78->unk_01BC->pal, 0x10, 0x20);
- LZ77UnCompWram(gUnknown_02022C78->unk_01BC->map, gUnknown_02022C78->buffer_03A4);
- CopyRectToBgTilemapBufferRect(1, gUnknown_02022C78->buffer_03A4, 0, 0, 30, 3, 0, 0, 30, 3, 1, 8, 0);
- CopyRectToBgTilemapBufferRect(3, gUnknown_02022C78->buffer_03A4, 0, 3, 30, 23, 0, 3, 30, 23, 1, 8, 0);
+ LoadPalette(sWonderNewsData->unk_01BC->pal, 0x10, 0x20);
+ LZ77UnCompWram(sWonderNewsData->unk_01BC->map, sWonderNewsData->buffer_03A4);
+ CopyRectToBgTilemapBufferRect(1, sWonderNewsData->buffer_03A4, 0, 0, 30, 3, 0, 0, 30, 3, 1, 8, 0);
+ CopyRectToBgTilemapBufferRect(3, sWonderNewsData->buffer_03A4, 0, 3, 30, 23, 0, 3, 30, 23, 1, 8, 0);
CopyBgTilemapBufferToVram(1);
CopyBgTilemapBufferToVram(3);
break;
@@ -627,26 +628,26 @@ s32 sub_801C758(void)
ShowBg(2);
ShowBg(3);
gPaletteFade.bufferTransferDisabled = FALSE;
- gUnknown_02022C78->unk_01C1 = AddScrollIndicatorArrowPair(&gUnknown_02022C78->unk_0394, &gUnknown_02022C78->unk_01C6);
+ sWonderNewsData->unk_01C1 = AddScrollIndicatorArrowPair(&sWonderNewsData->unk_0394, &sWonderNewsData->unk_01C6);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
UpdatePaletteFade();
break;
default:
if (UpdatePaletteFade())
return 0;
- gUnknown_02022C78->unk_01C0_1 = 0;
+ sWonderNewsData->unk_01C0_1 = 0;
return 1;
}
- ++gUnknown_02022C78->unk_01C0_1;
+ ++sWonderNewsData->unk_01C0_1;
return 0;
}
-s32 sub_801CA50(bool32 flag)
+s32 FadeOutFromWonderNews(bool32 flag)
{
- if (gUnknown_02022C78 == NULL)
+ if (sWonderNewsData == NULL)
return -1;
- switch (gUnknown_02022C78->unk_01C0_1)
+ switch (sWonderNewsData->unk_01C0_1)
{
case 0:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
@@ -674,21 +675,21 @@ s32 sub_801CA50(bool32 flag)
case 3:
HideBg(1);
HideBg(2);
- RemoveWindow(gUnknown_02022C78->unk_01C8[1]);
- RemoveWindow(gUnknown_02022C78->unk_01C8[0]);
+ RemoveWindow(sWonderNewsData->unk_01C8[1]);
+ RemoveWindow(sWonderNewsData->unk_01C8[0]);
break;
case 4:
ChangeBgY(2, 0, 0);
ChangeBgY(3, 0, 0);
- if (gUnknown_02022C78->unk_01C1 != 0xFF)
+ if (sWonderNewsData->unk_01C1 != 0xFF)
{
- RemoveScrollIndicatorArrowPair(gUnknown_02022C78->unk_01C1);
- gUnknown_02022C78->unk_01C1 = 0xFF;
+ RemoveScrollIndicatorArrowPair(sWonderNewsData->unk_01C1);
+ sWonderNewsData->unk_01C1 = 0xFF;
}
break;
case 5:
- sub_80186EC(gUnknown_02022C60, flag);
- sub_8018798(3);
+ PrintMysteryGiftOrEReaderTopMenu(gGiftIsFromEReader, flag);
+ MG_DrawCheckerboardPattern(3);
CopyBgTilemapBufferToVram(0);
CopyBgTilemapBufferToVram(3);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
@@ -696,36 +697,36 @@ s32 sub_801CA50(bool32 flag)
default:
if (UpdatePaletteFade())
return 0;
- gUnknown_02022C78->unk_01C0_1 = 0;
+ sWonderNewsData->unk_01C0_1 = 0;
return 1;
}
- ++gUnknown_02022C78->unk_01C0_1;
+ ++sWonderNewsData->unk_01C0_1;
return 0;
}
-void sub_801CC38(void)
+void MENews_RemoveScrollIndicatorArrowPair(void)
{
- if (!gUnknown_02022C78->unk_01C0_0 && gUnknown_02022C78->unk_01C1 != 0xFF)
+ if (!sWonderNewsData->unk_01C0_0 && sWonderNewsData->unk_01C1 != 0xFF)
{
- RemoveScrollIndicatorArrowPair(gUnknown_02022C78->unk_01C1);
- gUnknown_02022C78->unk_01C1 = 0xFF;
- gUnknown_02022C78->unk_01C0_0 = TRUE;
+ RemoveScrollIndicatorArrowPair(sWonderNewsData->unk_01C1);
+ sWonderNewsData->unk_01C1 = 0xFF;
+ sWonderNewsData->unk_01C0_0 = TRUE;
}
}
-void sub_801CC80(void)
+void MENews_AddScrollIndicatorArrowPair(void)
{
- if (gUnknown_02022C78->unk_01C0_0)
+ if (sWonderNewsData->unk_01C0_0)
{
- gUnknown_02022C78->unk_01C1 = AddScrollIndicatorArrowPair(&gUnknown_02022C78->unk_0394, &gUnknown_02022C78->unk_01C6);
- gUnknown_02022C78->unk_01C0_0 = FALSE;
+ sWonderNewsData->unk_01C1 = AddScrollIndicatorArrowPair(&sWonderNewsData->unk_0394, &sWonderNewsData->unk_01C6);
+ sWonderNewsData->unk_01C0_0 = FALSE;
}
}
-u8 sub_801CCD0(u16 input)
+u32 MENews_GetInput(u16 input)
{
- if (gUnknown_02022C78->unk_01C2_0)
+ if (sWonderNewsData->unk_01C2_0)
{
sub_801CFA4();
return 0xFF;
@@ -737,26 +738,26 @@ u8 sub_801CCD0(u16 input)
case B_BUTTON:
return 1;
case DPAD_UP:
- if (gUnknown_02022C78->unk_01C6 == 0)
+ if (sWonderNewsData->unk_01C6 == 0)
return 0xFF;
- if (gUnknown_02022C78->unk_01C0_0)
+ if (sWonderNewsData->unk_01C0_0)
return 0xFF;
- gUnknown_02022C78->unk_01C3_0 = FALSE;
+ sWonderNewsData->unk_01C3_0 = FALSE;
break;
case DPAD_DOWN:
- if (gUnknown_02022C78->unk_01C6 == gUnknown_02022C78->unk_01C4)
+ if (sWonderNewsData->unk_01C6 == sWonderNewsData->unk_01C4)
return 0xFF;
- if (gUnknown_02022C78->unk_01C0_0)
+ if (sWonderNewsData->unk_01C0_0)
return 0xFF;
- gUnknown_02022C78->unk_01C3_0 = TRUE;
+ sWonderNewsData->unk_01C3_0 = TRUE;
break;
default:
return 0xFF;
}
- gUnknown_02022C78->unk_01C2_0 = TRUE;
- gUnknown_02022C78->unk_01C2_1 = 2;
- gUnknown_02022C78->unk_01C3_1 = 0;
- if (gUnknown_02022C78->unk_01C3_0 == FALSE)
+ sWonderNewsData->unk_01C2_0 = TRUE;
+ sWonderNewsData->unk_01C2_1 = 2;
+ sWonderNewsData->unk_01C3_1 = 0;
+ if (sWonderNewsData->unk_01C3_0 == FALSE)
return 2;
else
return 3;
@@ -765,44 +766,44 @@ u8 sub_801CCD0(u16 input)
void sub_801CDCC(void)
{
u8 i = 0;
- memcpy(gUnknown_02022C78->unk_01CE, gUnknown_02022C78->unk_0000.unk_04, 40);
- gUnknown_02022C78->unk_01CE[40] = EOS;
+ memcpy(sWonderNewsData->unk_01CE, sWonderNewsData->unk_0000.unk_04, 40);
+ sWonderNewsData->unk_01CE[40] = EOS;
for (; i < 10; ++i)
{
- memcpy(gUnknown_02022C78->unk_01F7[i], gUnknown_02022C78->unk_0000.unk_2C[i], 40);
- gUnknown_02022C78->unk_01F7[i][40] = EOS;
- if (i > 7 && gUnknown_02022C78->unk_01F7[i][0] != EOS)
- ++gUnknown_02022C78->unk_01C4;
+ memcpy(sWonderNewsData->unk_01F7[i], sWonderNewsData->unk_0000.unk_2C[i], 40);
+ sWonderNewsData->unk_01F7[i][40] = EOS;
+ if (i > 7 && sWonderNewsData->unk_01F7[i][0] != EOS)
+ ++sWonderNewsData->unk_01C4;
}
- gUnknown_02022C78->unk_0394 = gUnknown_082F1DF8;
- gUnknown_02022C78->unk_0394.fullyDownThreshold = gUnknown_02022C78->unk_01C4;
+ sWonderNewsData->unk_0394 = gUnknown_082F1DF8;
+ sWonderNewsData->unk_0394.fullyDownThreshold = sWonderNewsData->unk_01C4;
}
void sub_801CE7C(void)
{
u8 i = 0;
s32 x;
- PutWindowTilemap(gUnknown_02022C78->unk_01C8[0]);
- PutWindowTilemap(gUnknown_02022C78->unk_01C8[1]);
- FillWindowPixelBuffer(gUnknown_02022C78->unk_01C8[0], 0);
- FillWindowPixelBuffer(gUnknown_02022C78->unk_01C8[1], 0);
- x = (0xe0 - GetStringWidth(3, gUnknown_02022C78->unk_01CE, GetFontAttribute(3, 2))) / 2;
+ PutWindowTilemap(sWonderNewsData->unk_01C8[0]);
+ PutWindowTilemap(sWonderNewsData->unk_01C8[1]);
+ FillWindowPixelBuffer(sWonderNewsData->unk_01C8[0], 0);
+ FillWindowPixelBuffer(sWonderNewsData->unk_01C8[1], 0);
+ x = (0xe0 - GetStringWidth(3, sWonderNewsData->unk_01CE, GetFontAttribute(3, 2))) / 2;
if (x < 0)
x = 0;
- AddTextPrinterParameterized3(gUnknown_02022C78->unk_01C8[0], 3, x, 6, gUnknown_082F1DE0[gUnknown_02022C78->unk_01BC->textPal1], 0, gUnknown_02022C78->unk_01CE);
+ AddTextPrinterParameterized3(sWonderNewsData->unk_01C8[0], 3, x, 6, gUnknown_082F1DE0[sWonderNewsData->unk_01BC->textPal1], 0, sWonderNewsData->unk_01CE);
for (; i < 10; ++i)
{
- AddTextPrinterParameterized3(gUnknown_02022C78->unk_01C8[1], 3, 0, 16 * i + 2, gUnknown_082F1DE0[gUnknown_02022C78->unk_01BC->textPal2], 0, gUnknown_02022C78->unk_01F7[i]);
+ AddTextPrinterParameterized3(sWonderNewsData->unk_01C8[1], 3, 0, 16 * i + 2, gUnknown_082F1DE0[sWonderNewsData->unk_01BC->textPal2], 0, sWonderNewsData->unk_01F7[i]);
}
- CopyWindowToVram(gUnknown_02022C78->unk_01C8[0], 3);
- CopyWindowToVram(gUnknown_02022C78->unk_01C8[1], 3);
+ CopyWindowToVram(sWonderNewsData->unk_01C8[0], 3);
+ CopyWindowToVram(sWonderNewsData->unk_01C8[1], 3);
}
void sub_801CFA4(void)
{
- u16 r4 = gUnknown_02022C78->unk_01C2_1;
+ u16 r4 = sWonderNewsData->unk_01C2_1;
r4 <<= 8;
- if (gUnknown_02022C78->unk_01C3_0)
+ if (sWonderNewsData->unk_01C3_0)
{
ChangeBgY(2, r4, 1);
ChangeBgY(3, r4, 1);
@@ -812,14 +813,14 @@ void sub_801CFA4(void)
ChangeBgY(2, r4, 2);
ChangeBgY(3, r4, 2);
}
- gUnknown_02022C78->unk_01C3_1 += gUnknown_02022C78->unk_01C2_1;
- if (gUnknown_02022C78->unk_01C3_1 > 15)
+ sWonderNewsData->unk_01C3_1 += sWonderNewsData->unk_01C2_1;
+ if (sWonderNewsData->unk_01C3_1 > 15)
{
- if (gUnknown_02022C78->unk_01C3_0)
- ++gUnknown_02022C78->unk_01C6;
+ if (sWonderNewsData->unk_01C3_0)
+ ++sWonderNewsData->unk_01C6;
else
- --gUnknown_02022C78->unk_01C6;
- gUnknown_02022C78->unk_01C2_0 = FALSE;
- gUnknown_02022C78->unk_01C3_1 = 0;
+ --sWonderNewsData->unk_01C6;
+ sWonderNewsData->unk_01C2_0 = FALSE;
+ sWonderNewsData->unk_01C3_1 = 0;
}
}
diff --git a/src/mevent_news.c b/src/mevent_news.c
index f5a061c84..192bb0fc7 100644
--- a/src/mevent_news.c
+++ b/src/mevent_news.c
@@ -10,7 +10,7 @@ static u32 sub_801DD44(struct MysteryEventStruct *);
static void sub_801DCD8(struct MysteryEventStruct *);
static void sub_801DCCC(struct MysteryEventStruct *);
-void sub_801DB68(u32 a0)
+void GenerateRandomNews(u32 a0)
{
struct MysteryEventStruct *r5 = sub_801B044();
@@ -59,7 +59,7 @@ u16 sub_801DC20(void)
struct MysteryEventStruct *r4 = sub_801B044();
u16 r5;
- if (!IsMysteryEventEnabled() || !sub_801B0CC())
+ if (!IsMysteryEventEnabled() || !ValidateReceivedWonderNews())
return 0;
r5 = sub_801DD44(r4);
diff --git a/src/mystery_event_menu.c b/src/mystery_event_menu.c
index ad4a2e692..850b22d5b 100644
--- a/src/mystery_event_menu.c
+++ b/src/mystery_event_menu.c
@@ -94,7 +94,7 @@ void CB2_InitMysteryEventMenu(void)
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x1E, 0x14);
LoadUserWindowBorderGfx(0, 1u, 0xD0u);
- sub_81978B0(0xE0);
+ Menu_LoadStdPalAt(0xE0);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON);
SetGpuReg(REG_OFFSET_BLDCNT, 0);
CreateTask(Task_DestroySelf, 0);
diff --git a/src/mystery_gift.c b/src/mystery_gift.c
new file mode 100644
index 000000000..c8b3a9060
--- /dev/null
+++ b/src/mystery_gift.c
@@ -0,0 +1,1703 @@
+#include "global.h"
+#include "main.h"
+#include "text.h"
+#include "task.h"
+#include "alloc.h"
+#include "gpu_regs.h"
+#include "scanline_effect.h"
+#include "text_window.h"
+#include "bg.h"
+#include "window.h"
+#include "strings.h"
+#include "text_window.h"
+#include "menu.h"
+#include "palette.h"
+#include "constants/songs.h"
+#include "sound.h"
+#include "mystery_gift.h"
+#include "union_room.h"
+#include "title_screen.h"
+#include "ereader_screen.h"
+#include "international_string_util.h"
+#include "list_menu.h"
+#include "string_util.h"
+#include "mevent.h"
+#include "mevent_801BAAC.h"
+#include "save.h"
+#include "link.h"
+#include "mevent_server_ish.h"
+#include "event_data.h"
+#include "link_rfu.h"
+#include "mevent_news.h"
+#include "mevent_server.h"
+
+void bgid_upload_textbox_1(u8 bgId);
+void task_add_00_mystery_gift(void);
+void task00_mystery_gift(u8 taskId);
+
+EWRAM_DATA u8 sDownArrowCounterAndYCoordIdx[8] = {};
+EWRAM_DATA bool8 gGiftIsFromEReader = FALSE;
+
+static const u16 gUnkTextboxBorderPal[] = INCBIN_U16("graphics/interface/unk_textbox_border.gbapal");
+static const u32 gUnkTextboxBorderGfx[] = INCBIN_U32("graphics/interface/unk_textbox_border.4bpp.lz");
+
+struct MysteryGiftTaskData
+{
+ u16 curPromptWindowId;
+ u16 unk2;
+ u16 unk4;
+ u16 unk6;
+ u8 state;
+ u8 textState;
+ u8 unkA;
+ u8 unkB;
+ u8 IsCardOrNews;
+ u8 source;
+ u8 prevPromptWindowId;
+ u8 * buffer;
+};
+
+static const struct BgTemplate sBGTemplates[] = {
+ {
+ .bg = 0,
+ .charBaseIndex = 2,
+ .mapBaseIndex = 15,
+ .screenSize = 0,
+ .paletteMode = 0,
+ .priority = 0,
+ .baseTile = 0x000
+ }, {
+ .bg = 1,
+ .charBaseIndex = 0,
+ .mapBaseIndex = 14,
+ .screenSize = 0,
+ .paletteMode = 0,
+ .priority = 1,
+ .baseTile = 0x000
+ }, {
+ .bg = 2,
+ .charBaseIndex = 0,
+ .mapBaseIndex = 13,
+ .screenSize = 0,
+ .paletteMode = 0,
+ .priority = 2,
+ .baseTile = 0x000
+ }, {
+ .bg = 3,
+ .charBaseIndex = 0,
+ .mapBaseIndex = 12,
+ .screenSize = 0,
+ .paletteMode = 0,
+ .priority = 3,
+ .baseTile = 0x000
+ }
+};
+
+static const struct WindowTemplate sMainWindows[] = {
+ {
+ .bg = 0x00,
+ .tilemapLeft = 0x00,
+ .tilemapTop = 0x00,
+ .width = 0x1e,
+ .height = 0x02,
+ .paletteNum = 0x0c,
+ .baseBlock = 0x0013
+ }, {
+ .bg = 0x00,
+ .tilemapLeft = 0x01,
+ .tilemapTop = 0x0f,
+ .width = 0x1c,
+ .height = 0x04,
+ .paletteNum = 0x0c,
+ .baseBlock = 0x004f
+ }, {
+ .bg = 0x00,
+ .tilemapLeft = 0x00,
+ .tilemapTop = 0x0f,
+ .width = 0x1e,
+ .height = 0x05,
+ .paletteNum = 0x0d,
+ .baseBlock = 0x004f
+ }, {
+ 0xFF
+ }
+};
+
+static const struct WindowTemplate sWindowTemplate_PromptYesOrNo_Width28 = {
+ .bg = 0x00,
+ .tilemapLeft = 0x01,
+ .tilemapTop = 0x0f,
+ .width = 0x1c,
+ .height = 0x04,
+ .paletteNum = 0x0c,
+ .baseBlock = 0x00e5
+};
+
+static const struct WindowTemplate sWindowTemplate_PromptYesOrNo_Width20 = {
+ .bg = 0x00,
+ .tilemapLeft = 0x01,
+ .tilemapTop = 0x0f,
+ .width = 0x14,
+ .height = 0x04,
+ .paletteNum = 0x0c,
+ .baseBlock = 0x00e5
+};
+
+static const struct WindowTemplate sMysteryGiftMenuWindowTemplate = {
+ .bg = 0x00,
+ .tilemapLeft = 0x01,
+ .tilemapTop = 0x0f,
+ .width = 0x13,
+ .height = 0x04,
+ .paletteNum = 0x0c,
+ .baseBlock = 0x00e5
+};
+
+static const struct WindowTemplate sWindowTemplate_ThreeOptions = {
+ .bg = 0x00,
+ .tilemapLeft = 0x08,
+ .tilemapTop = 0x06,
+ .width = 0x0e,
+ .height = 0x06,
+ .paletteNum = 0x0c,
+ .baseBlock = 0x0155
+};
+
+static const struct WindowTemplate sWindowTemplate_YesNoBox = {
+ .bg = 0x00,
+ .tilemapLeft = 0x17,
+ .tilemapTop = 0x0f,
+ .width = 0x06,
+ .height = 0x04,
+ .paletteNum = 0x0c,
+ .baseBlock = 0x0155
+};
+
+static const struct WindowTemplate sWindowTemplate_7by8 = {
+ .bg = 0x00,
+ .tilemapLeft = 0x16,
+ .tilemapTop = 0x0b,
+ .width = 0x07,
+ .height = 0x08,
+ .paletteNum = 0x0c,
+ .baseBlock = 0x0155
+};
+
+static const struct WindowTemplate sWindowTemplate_7by6 = {
+ .bg = 0x00,
+ .tilemapLeft = 0x16,
+ .tilemapTop = 0x0d,
+ .width = 0x07,
+ .height = 0x06,
+ .paletteNum = 0x0c,
+ .baseBlock = 0x0155
+};
+
+static const struct WindowTemplate sWindowTemplate_7by4 = {
+ .bg = 0x00,
+ .tilemapLeft = 0x16,
+ .tilemapTop = 0x0f,
+ .width = 0x07,
+ .height = 0x04,
+ .paletteNum = 0x0c,
+ .baseBlock = 0x0155
+};
+
+static const struct ListMenuItem sListMenuItems_CardsOrNews[] = {
+ { gText_WonderCards, 0 },
+ { gText_WonderNews, 1 },
+ { gText_Exit3, -2 }
+};
+
+static const struct ListMenuItem sListMenuItems_WirelessOrFriend[] = {
+ { gText_WirelessCommunication, 0 },
+ { gText_Friend2, 1 },
+ { gText_Cancel2, -2 }
+};
+
+static const struct ListMenuTemplate sListMenuTemplate_ThreeOptions = {
+ .items = NULL,
+ .moveCursorFunc = ListMenuDefaultCursorMoveFunc,
+ .itemPrintFunc = NULL,
+ .totalItems = 3,
+ .maxShowed = 3,
+ .windowId = 0,
+ .header_X = 0,
+ .item_X = 8,
+ .cursor_X = 0,
+ .upText_Y = 1,
+ .cursorPal = 2,
+ .fillValue = 1,
+ .cursorShadowPal = 3,
+ .lettersSpacing = 0,
+ .itemVerticalPadding = 0,
+ .scrollMultiple = 0,
+ .fontId = 1,
+ .cursorKind = 0
+};
+
+static const struct ListMenuItem sListMenuItems_ReceiveSendToss[] = {
+ { gText_Receive, 0 },
+ { gText_Send, 1 },
+ { gText_Toss, 2 },
+ { gText_Cancel2, -2 }
+};
+
+static const struct ListMenuItem sListMenuItems_ReceiveToss[] = {
+ { gText_Receive, 0 },
+ { gText_Toss, 2 },
+ { gText_Cancel2, -2 }
+};
+
+static const struct ListMenuItem sListMenuItems_ReceiveSend[] = {
+ { gText_Receive, 0 },
+ { gText_Send, 1 },
+ { gText_Cancel2, -2 }
+};
+
+static const struct ListMenuItem sListMenuItems_Receive[] = {
+ { gText_Receive, 0 },
+ { gText_Cancel2, -2 }
+};
+
+static const struct ListMenuTemplate sListMenu_ReceiveSendToss = {
+ .items = sListMenuItems_ReceiveSendToss,
+ .moveCursorFunc = ListMenuDefaultCursorMoveFunc,
+ .itemPrintFunc = NULL,
+ .totalItems = 4,
+ .maxShowed = 4,
+ .windowId = 0,
+ .header_X = 0,
+ .item_X = 8,
+ .cursor_X = 0,
+ .upText_Y = 1,
+ .cursorPal = 2,
+ .fillValue = 1,
+ .cursorShadowPal = 3,
+ .lettersSpacing = 0,
+ .itemVerticalPadding = 0,
+ .scrollMultiple = 0,
+ .fontId = 1,
+ .cursorKind = 0
+};
+
+static const struct ListMenuTemplate sListMenu_ReceiveToss = {
+ .items = sListMenuItems_ReceiveToss,
+ .moveCursorFunc = ListMenuDefaultCursorMoveFunc,
+ .itemPrintFunc = NULL,
+ .totalItems = 3,
+ .maxShowed = 3,
+ .windowId = 0,
+ .header_X = 0,
+ .item_X = 8,
+ .cursor_X = 0,
+ .upText_Y = 1,
+ .cursorPal = 2,
+ .fillValue = 1,
+ .cursorShadowPal = 3,
+ .lettersSpacing = 0,
+ .itemVerticalPadding = 0,
+ .scrollMultiple = 0,
+ .fontId = 1,
+ .cursorKind = 0
+};
+
+static const struct ListMenuTemplate sListMenu_ReceiveSend = {
+ .items = sListMenuItems_ReceiveSend,
+ .moveCursorFunc = ListMenuDefaultCursorMoveFunc,
+ .itemPrintFunc = NULL,
+ .totalItems = 3,
+ .maxShowed = 3,
+ .windowId = 0,
+ .header_X = 0,
+ .item_X = 8,
+ .cursor_X = 0,
+ .upText_Y = 1,
+ .cursorPal = 2,
+ .fillValue = 1,
+ .cursorShadowPal = 3,
+ .lettersSpacing = 0,
+ .itemVerticalPadding = 0,
+ .scrollMultiple = 0,
+ .fontId = 1,
+ .cursorKind = 0
+};
+
+static const struct ListMenuTemplate sListMenu_Receive = {
+ .items = sListMenuItems_Receive,
+ .moveCursorFunc = ListMenuDefaultCursorMoveFunc,
+ .itemPrintFunc = NULL,
+ .totalItems = 2,
+ .maxShowed = 2,
+ .windowId = 0,
+ .header_X = 0,
+ .item_X = 8,
+ .cursor_X = 0,
+ .upText_Y = 1,
+ .cursorPal = 2,
+ .fillValue = 1,
+ .cursorShadowPal = 3,
+ .lettersSpacing = 0,
+ .itemVerticalPadding = 0,
+ .scrollMultiple = 0,
+ .fontId = 1,
+ .cursorKind = 0
+};
+
+static const u8 *const Unref_082F0710[] = {
+ gText_VarietyOfEventsImportedWireless,
+ gText_WonderCardsInPossession,
+ gText_ReadNewsThatArrived,
+ gText_ReturnToTitle
+};
+
+ALIGNED(2) const u8 sMG_Ereader_TextColor_1[] = { 0, 1, 2 };
+ALIGNED(2) const u8 sMG_Ereader_TextColor_1_Copy[] = { 0, 1, 2 };
+ALIGNED(2) const u8 sMG_Ereader_TextColor_2[] = { 1, 2, 3 };
+
+void vblankcb_mystery_gift_e_reader_run(void)
+{
+ ProcessSpriteCopyRequests();
+ LoadOam();
+ TransferPlttBuffer();
+}
+
+void c2_mystery_gift_e_reader_run(void)
+{
+ RunTasks();
+ RunTextPrinters();
+ AnimateSprites();
+ BuildOamBuffer();
+}
+
+bool32 HandleMysteryGiftOrEReaderSetup(s32 mg_or_ereader)
+{
+ switch (gMain.state)
+ {
+ case 0:
+ SetVBlankCallback(NULL);
+ ResetPaletteFade();
+ ResetSpriteData();
+ FreeAllSpritePalettes();
+ ResetTasks();
+ ScanlineEffect_Stop();
+ ResetBgsAndClearDma3BusyFlags(0);
+
+ InitBgsFromTemplates(0, sBGTemplates, ARRAY_COUNT(sBGTemplates));
+ ChangeBgX(0, 0, 0);
+ ChangeBgY(0, 0, 0);
+ ChangeBgX(1, 0, 0);
+ ChangeBgY(1, 0, 0);
+ ChangeBgX(2, 0, 0);
+ ChangeBgY(2, 0, 0);
+ ChangeBgX(3, 0, 0);
+ ChangeBgY(3, 0, 0);
+
+ SetBgTilemapBuffer(3, Alloc(0x800));
+ SetBgTilemapBuffer(2, Alloc(0x800));
+ SetBgTilemapBuffer(1, Alloc(0x800));
+ SetBgTilemapBuffer(0, Alloc(0x800));
+
+ bgid_upload_textbox_1(3);
+ InitWindows(sMainWindows);
+ DeactivateAllTextPrinters();
+ ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON | DISPCNT_WIN1_ON);
+ SetGpuReg(REG_OFFSET_BLDCNT, 0);
+ SetGpuReg(REG_OFFSET_BLDALPHA, 0);
+ SetGpuReg(REG_OFFSET_BLDY, 0);
+ gMain.state++;
+ break;
+ case 1:
+ LoadPalette(gUnkTextboxBorderPal, 0, 0x20);
+ LoadPalette(stdpal_get(2), 0xd0, 0x20);
+ Menu_LoadStdPalAt(0xC0);
+ LoadUserWindowBorderGfx(0, 0xA, 0xE0);
+ LoadUserWindowBorderGfx_(0, 0x1, 0xF0);
+ FillBgTilemapBufferRect(0, 0x000, 0, 0, 32, 32, 0x11);
+ FillBgTilemapBufferRect(1, 0x000, 0, 0, 32, 32, 0x11);
+ FillBgTilemapBufferRect(2, 0x000, 0, 0, 32, 32, 0x11);
+ MG_DrawCheckerboardPattern(3);
+ PrintMysteryGiftOrEReaderTopMenu(mg_or_ereader, 0);
+ gMain.state++;
+ break;
+ case 2:
+ CopyBgTilemapBufferToVram(3);
+ CopyBgTilemapBufferToVram(2);
+ CopyBgTilemapBufferToVram(1);
+ CopyBgTilemapBufferToVram(0);
+ gMain.state++;
+ break;
+ case 3:
+ ShowBg(0);
+ ShowBg(3);
+ PlayBGM(MUS_RG_OKURIMONO);
+ SetVBlankCallback(vblankcb_mystery_gift_e_reader_run);
+ EnableInterrupts(INTR_FLAG_VBLANK | INTR_FLAG_VCOUNT | INTR_FLAG_TIMER3 | INTR_FLAG_SERIAL);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+void c2_mystery_gift(void)
+{
+ if (HandleMysteryGiftOrEReaderSetup(0))
+ {
+ SetMainCallback2(c2_mystery_gift_e_reader_run);
+ gGiftIsFromEReader = FALSE;
+ task_add_00_mystery_gift();
+ }
+ RunTasks();
+}
+
+void c2_ereader(void)
+{
+ if (HandleMysteryGiftOrEReaderSetup(1))
+ {
+ SetMainCallback2(c2_mystery_gift_e_reader_run);
+ gGiftIsFromEReader = TRUE;
+ task_add_00_ereader();
+ }
+}
+
+void MainCB_FreeAllBuffersAndReturnToInitTitleScreen(void)
+{
+ gGiftIsFromEReader = FALSE;
+ FreeAllWindowBuffers();
+ Free(GetBgTilemapBuffer(0));
+ Free(GetBgTilemapBuffer(1));
+ Free(GetBgTilemapBuffer(2));
+ Free(GetBgTilemapBuffer(3));
+ SetMainCallback2(CB2_InitTitleScreen);
+}
+
+void PrintMysteryGiftOrEReaderTopMenu(bool8 mg_or_ereader, bool32 usePickOkCancel)
+{
+ const u8 * header;
+ const u8 * options;
+ FillWindowPixelBuffer(0, 0);
+ if (mg_or_ereader == 0)
+ {
+ header = gText_MysteryGift;
+ options = !usePickOkCancel ? gText_PickOKExit : gText_PickOKCancel;
+ }
+ else
+ {
+ header = gJPText_MysteryGift;
+ options = gJPText_DecideStop;
+ }
+
+ AddTextPrinterParameterized4(0, 1, 4, 1, 0, 0, sMG_Ereader_TextColor_1, -1, header);
+ AddTextPrinterParameterized4(0, 0, GetStringRightAlignXOffset(0, options, 0xDE), 1, 0, 0, sMG_Ereader_TextColor_1, -1, options);
+ CopyWindowToVram(0, 2);
+ PutWindowTilemap(0);
+}
+
+void MG_DrawTextBorder(u8 windowId)
+{
+ DrawTextBorderOuter(windowId, 0x01, 0xF);
+}
+
+void MG_DrawCheckerboardPattern(u32 bg)
+{
+ s32 i = 0, j;
+
+ FillBgTilemapBufferRect(bg, 0x003, 0, 0, 32, 2, 0x11);
+
+ for (i = 0; i < 18; i++)
+ {
+ for (j = 0; j < 32; j++)
+ {
+ if ((i & 1) != (j & 1))
+ {
+ FillBgTilemapBufferRect(bg, 1, j, i + 2, 1, 1, 0x11);
+ }
+ else
+ {
+ FillBgTilemapBufferRect(bg, 2, j, i + 2, 1, 1, 0x11);
+ }
+ }
+ }
+}
+
+void ClearScreenInBg0(bool32 ignoreTopTwoRows)
+{
+ switch (ignoreTopTwoRows)
+ {
+ case 0:
+ FillBgTilemapBufferRect(0, 0, 0, 0, 32, 32, 0x11);
+ break;
+ case 1:
+ FillBgTilemapBufferRect(0, 0, 0, 2, 32, 30, 0x11);
+ break;
+ }
+ CopyBgTilemapBufferToVram(0);
+}
+
+void AddTextPrinterToWindow1(const u8 *str)
+{
+ StringExpandPlaceholders(gStringVar4, str);
+ FillWindowPixelBuffer(1, 0x11);
+ AddTextPrinterParameterized4(1, 1, 0, 1, 0, 0, sMG_Ereader_TextColor_2, 0, gStringVar4);
+ DrawTextBorderOuter(1, 0x001, 0xF);
+ PutWindowTilemap(1);
+ CopyWindowToVram(1, 3);
+}
+
+static void ClearTextWindow(void)
+{
+ rbox_fill_rectangle(1);
+ ClearWindowTilemap(1);
+ CopyWindowToVram(1, 1);
+}
+
+bool32 MG_PrintTextOnWindow1AndWaitButton(u8 *textState, const u8 *str)
+{
+ switch (*textState)
+ {
+ case 0:
+ AddTextPrinterToWindow1(str);
+ goto inc;
+ case 1:
+ DrawDownArrow(1, 0xD0, 0x14, 1, FALSE, &sDownArrowCounterAndYCoordIdx[0], &sDownArrowCounterAndYCoordIdx[1]);
+ if (({gMain.newKeys & (A_BUTTON | B_BUTTON);}))
+ {
+ inc:
+ (*textState)++;
+ }
+ break;
+ case 2:
+ DrawDownArrow(1, 0xD0, 0x14, 1, TRUE, &sDownArrowCounterAndYCoordIdx[0], &sDownArrowCounterAndYCoordIdx[1]);
+ *textState = 0;
+ ClearTextWindow();
+ return TRUE;
+ case 0xFF:
+ *textState = 2;
+ break;
+ }
+ return FALSE;
+}
+
+static void HideDownArrow(void)
+{
+ DrawDownArrow(1, 0xD0, 0x14, 1, FALSE, &sDownArrowCounterAndYCoordIdx[0], &sDownArrowCounterAndYCoordIdx[1]);
+}
+
+static void ShowDownArrow(void)
+{
+ DrawDownArrow(1, 0xD0, 0x14, 1, TRUE, &sDownArrowCounterAndYCoordIdx[0], &sDownArrowCounterAndYCoordIdx[1]);
+}
+
+bool32 unref_HideDownArrowAndWaitButton(u8 * textState)
+{
+ switch (*textState)
+ {
+ case 0:
+ HideDownArrow();
+ if (({gMain.newKeys & (A_BUTTON | B_BUTTON);}))
+ {
+ (*textState)++;
+ }
+ break;
+ case 1:
+ ShowDownArrow();
+ *textState = 0;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static bool32 PrintStringAndWait2Seconds(u8 * counter, const u8 * str)
+{
+ if (*counter == 0)
+ {
+ AddTextPrinterToWindow1(str);
+ }
+ if (++(*counter) > 120)
+ {
+ *counter = 0;
+ ClearTextWindow();
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+}
+
+static u32 MysteryGift_HandleThreeOptionMenu(u8 * unused0, u16 * unused1, u8 whichMenu)
+{
+ struct ListMenuTemplate listMenuTemplate = sListMenuTemplate_ThreeOptions;
+ struct WindowTemplate windowTemplate = sWindowTemplate_ThreeOptions;
+ s32 width;
+ s32 response;
+
+ if (whichMenu == 0)
+ {
+ listMenuTemplate.items = sListMenuItems_CardsOrNews;
+ }
+ else
+ {
+ listMenuTemplate.items = sListMenuItems_WirelessOrFriend;
+ }
+ width = Intl_GetListMenuWidth(&listMenuTemplate);
+ if (width & 1)
+ {
+ width++;
+ }
+ windowTemplate.width = width;
+ if (width < 30)
+ {
+ windowTemplate.tilemapLeft = (30 - width) / 2;
+ }
+ else
+ {
+ windowTemplate.tilemapLeft = 0;
+ }
+ response = DoMysteryGiftListMenu(&windowTemplate, &listMenuTemplate, 1, 0x00A, 0xE0);
+ if (response != -1)
+ {
+ ClearWindowTilemap(2);
+ CopyWindowToVram(2, 1);
+ }
+ return response;
+}
+
+s8 mevent_message_print_and_prompt_yes_no(u8 * textState, u16 * windowId, bool8 yesNoBoxPlacement, const u8 * str)
+{
+ struct WindowTemplate windowTemplate;
+ s8 input;
+
+ switch (*textState)
+ {
+ case 0:
+ StringExpandPlaceholders(gStringVar4, str);
+ if (yesNoBoxPlacement == 0)
+ {
+ *windowId = AddWindow(&sWindowTemplate_PromptYesOrNo_Width28);
+ }
+ else
+ {
+ *windowId = AddWindow(&sWindowTemplate_PromptYesOrNo_Width20);
+ }
+ FillWindowPixelBuffer(*windowId, 0x11);
+ AddTextPrinterParameterized4(*windowId, 1, 0, 1, 0, 0, sMG_Ereader_TextColor_2, 0, gStringVar4);
+ DrawTextBorderOuter(*windowId, 0x001, 0x0F);
+ CopyWindowToVram(*windowId, 2);
+ PutWindowTilemap(*windowId);
+ (*textState)++;
+ break;
+ case 1:
+ windowTemplate = sWindowTemplate_YesNoBox;
+ if (yesNoBoxPlacement == 0)
+ {
+ windowTemplate.tilemapTop = 9;
+ }
+ else
+ {
+ windowTemplate.tilemapTop = 15;
+ }
+ CreateYesNoMenu(&windowTemplate, 10, 14, 0);
+ (*textState)++;
+ break;
+ case 2:
+ input = Menu_ProcessInputNoWrapClearOnChoose();
+ if (input == -1 || input == 0 || input == 1)
+ {
+ *textState = 0;
+ rbox_fill_rectangle(*windowId);
+ ClearWindowTilemap(*windowId);
+ CopyWindowToVram(*windowId, 1);
+ RemoveWindow(*windowId);
+ return input;
+ }
+ break;
+ case 0xFF:
+ *textState = 0;
+ rbox_fill_rectangle(*windowId);
+ ClearWindowTilemap(*windowId);
+ CopyWindowToVram(*windowId, 1);
+ RemoveWindow(*windowId);
+ return -1;
+ }
+
+ return -2;
+}
+
+static s32 HandleMysteryGiftListMenu(u8 * textState, u16 * windowId, bool32 cannotToss, bool32 cannotSend)
+{
+ struct WindowTemplate windowTemplate;
+ s32 input;
+
+ switch (*textState)
+ {
+ case 0:
+ if (cannotToss == 0)
+ {
+ StringExpandPlaceholders(gStringVar4, gText_WhatToDoWithCards);
+ }
+ else
+ {
+ StringExpandPlaceholders(gStringVar4, gText_WhatToDoWithNews);
+ }
+ *windowId = AddWindow(&sMysteryGiftMenuWindowTemplate);
+ FillWindowPixelBuffer(*windowId, 0x11);
+ AddTextPrinterParameterized4(*windowId, 1, 0, 1, 0, 0, sMG_Ereader_TextColor_2, 0, gStringVar4);
+ DrawTextBorderOuter(*windowId, 0x001, 0x0F);
+ CopyWindowToVram(*windowId, 2);
+ PutWindowTilemap(*windowId);
+ (*textState)++;
+ break;
+ case 1:
+ windowTemplate = sWindowTemplate_YesNoBox;
+ if (cannotSend)
+ {
+ if (cannotToss == 0)
+ {
+ input = DoMysteryGiftListMenu(&sWindowTemplate_7by6, &sListMenu_ReceiveToss, 1, 0x00A, 0xE0);
+ }
+ else
+ {
+ input = DoMysteryGiftListMenu(&sWindowTemplate_7by4, &sListMenu_Receive, 1, 0x00A, 0xE0);
+ }
+ }
+ else
+ {
+ if (cannotToss == 0)
+ {
+ input = DoMysteryGiftListMenu(&sWindowTemplate_7by8, &sListMenu_ReceiveSendToss, 1, 0x00A, 0xE0);
+ }
+ else
+ {
+ input = DoMysteryGiftListMenu(&sWindowTemplate_7by6, &sListMenu_ReceiveSend, 1, 0x00A, 0xE0);
+ }
+ }
+ if (input != -1)
+ {
+ *textState = 0;
+ rbox_fill_rectangle(*windowId);
+ ClearWindowTilemap(*windowId);
+ CopyWindowToVram(*windowId, 1);
+ RemoveWindow(*windowId);
+ return input;
+ }
+ break;
+ case 0xFF:
+ *textState = 0;
+ rbox_fill_rectangle(*windowId);
+ ClearWindowTilemap(*windowId);
+ CopyWindowToVram(*windowId, 1);
+ RemoveWindow(*windowId);
+ return -2;
+ }
+
+ return -1;
+}
+
+static bool32 ValidateCardOrNews(bool32 cardOrNews)
+{
+ if (cardOrNews == 0)
+ {
+ return ValidateReceivedWonderCard();
+ }
+ else
+ {
+ return ValidateReceivedWonderNews();
+ }
+}
+
+static bool32 HandleLoadWonderCardOrNews(u8 * state, bool32 cardOrNews)
+{
+ s32 v0;
+
+ switch (*state)
+ {
+ case 0:
+ if (cardOrNews == 0)
+ {
+ InitWonderCardResources(sav1_get_mevent_buffer_1(), sav1_get_mevent_buffer_2());
+ }
+ else
+ {
+ InitWonderNewsResources(sav1_get_mevent_buffer_0());
+ }
+ (*state)++;
+ break;
+ case 1:
+ if (cardOrNews == 0)
+ {
+ v0 = FadeToWonderCardMenu();
+ check:
+ if (v0 != 0)
+ {
+ goto done;
+ }
+ break;
+ }
+ else
+ {
+ v0 = FadeToWonderNewsMenu();
+ goto check;
+ }
+ done:
+ *state = 0;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static bool32 DestroyNewsOrCard(bool32 cardOrNews)
+{
+ if (cardOrNews == 0)
+ {
+ DestroyWonderCard();
+ }
+ else
+ {
+ DestroyWonderNews();
+ }
+ return TRUE;
+}
+
+static bool32 TearDownCardOrNews_ReturnToTopMenu(bool32 cardOrNews, bool32 arg1)
+{
+ if (cardOrNews == 0)
+ {
+ if (FadeOutFromWonderCard(arg1) != 0)
+ {
+ DestroyWonderCardResources();
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+ }
+ else
+ {
+ if (FadeOutFromWonderNews(arg1) != 0)
+ {
+ DestroyWonderNewsResources();
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+ }
+}
+
+static s32 mevent_message_prompt_discard(u8 * textState, u16 * windowId, bool32 cardOrNews)
+{
+ if (cardOrNews == 0)
+ {
+ return mevent_message_print_and_prompt_yes_no(textState, windowId, TRUE, gText_IfThrowAwayCardEventWontHappen);
+ }
+ else
+ {
+ return mevent_message_print_and_prompt_yes_no(textState, windowId, TRUE, gText_OkayToDiscardNews);
+ }
+}
+
+static bool32 mevent_message_was_thrown_away(u8 * textState, bool32 cardOrNews)
+{
+ if (cardOrNews == 0)
+ {
+ return MG_PrintTextOnWindow1AndWaitButton(textState, gText_WonderCardThrownAway);
+ }
+ else
+ {
+ return MG_PrintTextOnWindow1AndWaitButton(textState, gText_WonderNewsThrownAway);
+ }
+}
+
+static bool32 mevent_save_game(u8 * state)
+{
+ switch (*state)
+ {
+ case 0:
+ AddTextPrinterToWindow1(gText_DataWillBeSaved);
+ (*state)++;
+ break;
+ case 1:
+ TrySavingData(0);
+ (*state)++;
+ break;
+ case 2:
+ AddTextPrinterToWindow1(gText_SaveCompletedPressA);
+ (*state)++;
+ break;
+ case 3:
+ if (({gMain.newKeys & (A_BUTTON | B_BUTTON);}))
+ {
+ (*state)++;
+ }
+ break;
+ case 4:
+ *state = 0;
+ ClearTextWindow();
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static const u8 * mevent_message(u32 * a0, u8 a1, u8 cardOrNews, u32 msgId)
+{
+ const u8 * msg = NULL;
+ *a0 = 0;
+
+ switch (msgId)
+ {
+ case 0:
+ *a0 = 0;
+ msg = gText_NothingSentOver;
+ break;
+ case 1:
+ *a0 = 0;
+ msg = gText_RecordUploadedViaWireless;
+ break;
+ case 2:
+ *a0 = 1;
+ msg = cardOrNews == 0 ? gText_WonderCardReceived : gText_WonderCardReceivedFrom;
+ break;
+ case 3:
+ *a0 = 1;
+ msg = cardOrNews == 0 ? gText_WonderNewsReceived : gText_WonderNewsReceivedFrom;
+ break;
+ case 4:
+ *a0 = 1;
+ msg = gText_NewStampReceived;
+ break;
+ case 5:
+ *a0 = 0;
+ msg = gText_AlreadyHadCard;
+ break;
+ case 6:
+ *a0 = 0;
+ msg = gText_AlreadyHadStamp;
+ break;
+ case 7:
+ *a0 = 0;
+ msg = gText_AlreadyHadNews;
+ break;
+ case 8:
+ *a0 = 0;
+ msg = gText_NoMoreRoomForStamps;
+ break;
+ case 9:
+ *a0 = 0;
+ msg = gText_CommunicationCanceled;
+ break;
+ case 10:
+ *a0 = 0;
+ msg = a1 == 0 ? gText_CantAcceptCardFromTrainer : gText_CantAcceptNewsFromTrainer;
+ break;
+ case 11:
+ *a0 = 0;
+ msg = gText_CommunicationError;
+ break;
+ case 12:
+ *a0 = 1;
+ msg = gText_NewTrainerReceived;
+ break;
+ case 13:
+ *a0 = 1;
+ break;
+ case 14:
+ *a0 = 0;
+ break;
+ }
+
+ return msg;
+}
+
+static bool32 PrintMGSuccessMessage(u8 * state, const u8 * arg1, u16 * arg2)
+{
+ switch (*state)
+ {
+ case 0:
+ if (arg1 != NULL)
+ {
+ AddTextPrinterToWindow1(arg1);
+ }
+ PlayFanfare(MUS_FANFA4);
+ *arg2 = 0;
+ (*state)++;
+ break;
+ case 1:
+ if (++(*arg2) > 0xF0)
+ {
+ (*state)++;
+ }
+ break;
+ case 2:
+ if (IsFanfareTaskInactive())
+ {
+ *state = 0;
+ ClearTextWindow();
+ return TRUE;
+ }
+ break;
+ }
+ return FALSE;
+}
+
+static const u8 * mevent_message_stamp_card_etc_send_status(u32 * a0, u8 unused, u32 msgId)
+{
+ const u8 * result = gText_CommunicationError;
+ *a0 = 0;
+ switch (msgId)
+ {
+ case 0:
+ result = gText_NothingSentOver;
+ break;
+ case 1:
+ result = gText_RecordUploadedViaWireless;
+ break;
+ case 2:
+ result = gText_WonderCardSentTo;
+ *a0 = 1;
+ break;
+ case 3:
+ result = gText_WonderNewsSentTo;
+ *a0 = 1;
+ break;
+ case 4:
+ result = gText_StampSentTo;
+ break;
+ case 5:
+ result = gText_OtherTrainerHasCard;
+ break;
+ case 6:
+ result = gText_OtherTrainerHasStamp;
+ break;
+ case 7:
+ result = gText_OtherTrainerHasNews;
+ break;
+ case 8:
+ result = gText_NoMoreRoomForStamps;
+ break;
+ case 9:
+ result = gText_OtherTrainerCanceled;
+ break;
+ case 10:
+ result = gText_CantSendGiftToTrainer;
+ break;
+ case 11:
+ result = gText_CommunicationError;
+ break;
+ case 12:
+ result = gText_GiftSentTo;
+ break;
+ case 13:
+ result = gText_GiftSentTo;
+ break;
+ case 14:
+ result = gText_CantSendGiftToTrainer;
+ break;
+ }
+ return result;
+}
+
+static bool32 PrintMGSendStatus(u8 * state, u16 * arg1, u8 arg2, u32 msgId)
+{
+ u32 flag;
+ const u8 * str = mevent_message_stamp_card_etc_send_status(&flag, arg2, msgId);
+ if (flag)
+ {
+ return PrintMGSuccessMessage(state, str, arg1);
+ }
+ else
+ {
+ return MG_PrintTextOnWindow1AndWaitButton(state, str);
+ }
+}
+
+void task_add_00_mystery_gift(void)
+{
+ u8 taskId = CreateTask(task00_mystery_gift, 0);
+ struct MysteryGiftTaskData * data = (void *)gTasks[taskId].data;
+ data->state = 0;
+ data->textState = 0;
+ data->unkA = 0;
+ data->unkB = 0;
+ data->IsCardOrNews = 0;
+ data->source = 0;
+ data->curPromptWindowId = 0;
+ data->unk2 = 0;
+ data->unk4 = 0;
+ data->unk6 = 0;
+ data->prevPromptWindowId = 0;
+ data->buffer = AllocZeroed(0x40);
+}
+
+void task00_mystery_gift(u8 taskId)
+{
+ struct MysteryGiftTaskData * data = (void *)gTasks[taskId].data;
+ u32 sp0;
+ const u8 * r1;
+
+ switch (data->state)
+ {
+ case 0:
+ data->state = 1;
+ break;
+ case 1:
+ switch (MysteryGift_HandleThreeOptionMenu(&data->textState, &data->curPromptWindowId, FALSE))
+ {
+ case 0:
+ data->IsCardOrNews = 0;
+ if (ValidateReceivedWonderCard() == TRUE)
+ {
+ data->state = 18;
+ }
+ else
+ {
+ data->state = 2;
+ }
+ break;
+ case 1:
+ data->IsCardOrNews = 1;
+ if (ValidateReceivedWonderNews() == TRUE)
+ {
+ data->state = 18;
+ }
+ else
+ {
+ data->state = 2;
+ }
+ break;
+ case -2u:
+ data->state = 37;
+ break;
+ }
+ break;
+ case 2:
+ {
+ if (data->IsCardOrNews == 0)
+ {
+ if (MG_PrintTextOnWindow1AndWaitButton(&data->textState, gText_DontHaveCardNewOneInput))
+ {
+ data->state = 3;
+ PrintMysteryGiftOrEReaderTopMenu(0, 1);
+ }
+ }
+ else
+ {
+ if (MG_PrintTextOnWindow1AndWaitButton(&data->textState, gText_DontHaveNewsNewOneInput))
+ {
+ data->state = 3;
+ PrintMysteryGiftOrEReaderTopMenu(0, 1);
+ }
+ }
+ break;
+ }
+ case 3:
+ if (data->IsCardOrNews == 0)
+ {
+ AddTextPrinterToWindow1(gText_WhereShouldCardBeAccessed);
+ }
+ else
+ {
+ AddTextPrinterToWindow1(gText_WhereShouldNewsBeAccessed);
+ }
+ data->state = 4;
+ break;
+ case 4:
+ switch (MysteryGift_HandleThreeOptionMenu(&data->textState, &data->curPromptWindowId, TRUE))
+ {
+ case 0:
+ ClearTextWindow();
+ data->state = 5;
+ data->source = 0;
+ break;
+ case 1:
+ ClearTextWindow();
+ data->state = 5;
+ data->source = 1;
+ break;
+ case -2u:
+ ClearTextWindow();
+ if (ValidateCardOrNews(data->IsCardOrNews))
+ {
+ data->state = 18;
+ }
+ else
+ {
+ data->state = 0;
+ PrintMysteryGiftOrEReaderTopMenu(0, 0);
+ }
+ break;
+ }
+ break;
+ case 5:
+ {
+ register u8 eos asm("r1");
+ gStringVar1[0] = (eos = EOS);
+ gStringVar2[0] = eos;
+ gStringVar3[0] = eos;
+ }
+ switch (data->IsCardOrNews)
+ {
+ case 0:
+ if (data->source == 1)
+ {
+ MEvent_CreateTask_CardOrNewsWithFriend(0x15);
+ }
+ else if (data->source == 0)
+ {
+ MEvent_CreateTask_CardOrNewsOverWireless(0x15);
+ }
+ break;
+ case 1:
+ if (data->source == 1)
+ {
+ MEvent_CreateTask_CardOrNewsWithFriend(0x16);
+ }
+ else if (data->source == 0)
+ {
+ MEvent_CreateTask_CardOrNewsOverWireless(0x16);
+ }
+ break;
+ }
+ data->state = 6;
+ break;
+ case 6:
+ if (gReceivedRemoteLinkPlayers != 0)
+ {
+ ClearScreenInBg0(TRUE);
+ data->state = 7;
+ mevent_srv_ish_do_init(data->IsCardOrNews);
+ }
+ else if (gSpecialVar_Result == 5)
+ {
+ ClearScreenInBg0(TRUE);
+ data->state = 3;
+ }
+ break;
+ case 7:
+ AddTextPrinterToWindow1(gText_Communicating);
+ data->state = 8;
+ break;
+ case 8:
+ switch (mevent_srv_ish_do_exec(&data->curPromptWindowId))
+ {
+ case 6:
+ task_add_05_task_del_08FA224_when_no_RfuFunc();
+ data->prevPromptWindowId = data->curPromptWindowId;
+ data->state = 13;
+ break;
+ case 5:
+ memcpy(data->buffer, mevent_srv_ish_get_buffer(), 0x40);
+ mevent_srv_ish_inc_flag();
+ break;
+ case 3:
+ data->state = 10;
+ break;
+ case 2:
+ data->state = 9;
+ break;
+ case 4:
+ data->state = 11;
+ StringCopy(gStringVar1, gLinkPlayers[0].name);
+ break;
+ }
+ break;
+ case 9:
+ switch ((u32)mevent_message_print_and_prompt_yes_no(&data->textState, &data->curPromptWindowId, FALSE, mevent_srv_ish_get_buffer()))
+ {
+ case 0:
+ mevent_srv_ish_set_param(0);
+ mevent_srv_ish_inc_flag();
+ data->state = 7;
+ break;
+ case 1:
+ mevent_srv_ish_set_param(1);
+ mevent_srv_ish_inc_flag();
+ data->state = 7;
+ break;
+ case -1u:
+ mevent_srv_ish_set_param(1);
+ mevent_srv_ish_inc_flag();
+ data->state = 7;
+ break;
+ }
+ break;
+ case 10:
+ if (MG_PrintTextOnWindow1AndWaitButton(&data->textState, mevent_srv_ish_get_buffer()))
+ {
+ mevent_srv_ish_inc_flag();
+ data->state = 7;
+ }
+ break;
+ case 11:
+ switch ((u32)mevent_message_print_and_prompt_yes_no(&data->textState, &data->curPromptWindowId, FALSE, gText_ThrowAwayWonderCard))
+ {
+ case 0:
+ if (CheckReceivedGiftFromWonderCard() == TRUE)
+ {
+ data->state = 12;
+ }
+ else
+ {
+ mevent_srv_ish_set_param(0);
+ mevent_srv_ish_inc_flag();
+ data->state = 7;
+ }
+ break;
+ case 1:
+ mevent_srv_ish_set_param(1);
+ mevent_srv_ish_inc_flag();
+ data->state = 7;
+ break;
+ case -1u:
+ mevent_srv_ish_set_param(1);
+ mevent_srv_ish_inc_flag();
+ data->state = 7;
+ break;
+ }
+ break;
+ case 12:
+ switch ((u32)mevent_message_print_and_prompt_yes_no(&data->textState, &data->curPromptWindowId, FALSE, gText_HaventReceivedCardsGift))
+ {
+ case 0:
+ mevent_srv_ish_set_param(0);
+ mevent_srv_ish_inc_flag();
+ data->state = 7;
+ break;
+ case 1:
+ mevent_srv_ish_set_param(1);
+ mevent_srv_ish_inc_flag();
+ data->state = 7;
+ break;
+ case -1u:
+ mevent_srv_ish_set_param(1);
+ mevent_srv_ish_inc_flag();
+ data->state = 7;
+ break;
+ }
+ break;
+ case 13:
+ if (gReceivedRemoteLinkPlayers == 0)
+ {
+ DestroyWirelessStatusIndicatorSprite();
+ data->state = 14;
+ }
+ break;
+ case 14:
+ if (PrintStringAndWait2Seconds(&data->textState, gText_CommunicationCompleted))
+ {
+ if (data->source == 1)
+ {
+ StringCopy(gStringVar1, gLinkPlayers[0].name);
+ }
+ data->state = 15;
+ }
+ break;
+ case 15:
+ {
+ register bool32 flag asm("r1");
+ r1 = mevent_message(&sp0, data->IsCardOrNews, data->source, data->prevPromptWindowId);
+ if (r1 == NULL)
+ {
+ r1 = data->buffer;
+ }
+ if (sp0)
+ {
+ flag = PrintMGSuccessMessage(&data->textState, r1, &data->curPromptWindowId);
+ }
+ else
+ {
+ flag = MG_PrintTextOnWindow1AndWaitButton(&data->textState, r1);
+ }
+ if (flag)
+ {
+ if (data->prevPromptWindowId == 3)
+ {
+ if (data->source == 1)
+ {
+ GenerateRandomNews(1);
+ }
+ else
+ {
+ GenerateRandomNews(2);
+ }
+ }
+ if (sp0 == 0)
+ {
+ data->state = 0;
+ PrintMysteryGiftOrEReaderTopMenu(0, 0);
+ }
+ else
+ {
+ data->state = 17;
+ }
+ }
+ break;
+ }
+ case 16:
+ if (MG_PrintTextOnWindow1AndWaitButton(&data->textState, gText_CommunicationError))
+ {
+ data->state = 0;
+ PrintMysteryGiftOrEReaderTopMenu(0, 0);
+ }
+ break;
+ case 17:
+ if (mevent_save_game(&data->textState))
+ {
+ data->state = 18;
+ }
+ break;
+ case 18:
+ if (HandleLoadWonderCardOrNews(&data->textState, data->IsCardOrNews))
+ {
+ data->state = 20;
+ }
+ break;
+ case 20:
+ if (data->IsCardOrNews == 0)
+ {
+ if (({gMain.newKeys & A_BUTTON;}))
+ {
+ data->state = 21;
+ }
+ if (({gMain.newKeys & B_BUTTON;}))
+ {
+ data->state = 27;
+ }
+ }
+ else
+ {
+ switch (MENews_GetInput(gMain.newKeys))
+ {
+ case 0:
+ MENews_RemoveScrollIndicatorArrowPair();
+ data->state = 21;
+ break;
+ case 1:
+ data->state = 27;
+ break;
+ }
+ }
+ break;
+ case 21:
+ {
+ u32 result;
+ if (data->IsCardOrNews == 0)
+ {
+ if (WonderCard_Test_Unk_08_6())
+ {
+ result = HandleMysteryGiftListMenu(&data->textState, &data->curPromptWindowId, data->IsCardOrNews, FALSE);
+ }
+ else
+ {
+ result = HandleMysteryGiftListMenu(&data->textState, &data->curPromptWindowId, data->IsCardOrNews, TRUE);
+ }
+ }
+ else
+ {
+ if (WonderNews_Test_Unk_02())
+ {
+ result = HandleMysteryGiftListMenu(&data->textState, &data->curPromptWindowId, data->IsCardOrNews, FALSE);
+ }
+ else
+ {
+ result = HandleMysteryGiftListMenu(&data->textState, &data->curPromptWindowId, data->IsCardOrNews, TRUE);
+ }
+ }
+ switch (result)
+ {
+ case 0:
+ data->state = 28;
+ break;
+ case 1:
+ data->state = 29;
+ break;
+ case 2:
+ data->state = 22;
+ break;
+ case -2u:
+ if (data->IsCardOrNews == 1)
+ {
+ MENews_AddScrollIndicatorArrowPair();
+ }
+ data->state = 20;
+ break;
+ }
+ break;
+ }
+ case 22:
+ switch (mevent_message_prompt_discard(&data->textState, &data->curPromptWindowId, data->IsCardOrNews))
+ {
+ case 0:
+ if (data->IsCardOrNews == 0 && CheckReceivedGiftFromWonderCard() == TRUE)
+ {
+ data->state = 23;
+ }
+ else
+ {
+ data->state = 24;
+ }
+ break;
+ case 1:
+ data->state = 21;
+ break;
+ case -1:
+ data->state = 21;
+ break;
+ }
+ break;
+ case 23:
+ switch ((u32)mevent_message_print_and_prompt_yes_no(&data->textState, &data->curPromptWindowId, TRUE, gText_HaventReceivedGiftOkayToDiscard))
+ {
+ case 0:
+ data->state = 24;
+ break;
+ case 1:
+ data->state = 21;
+ break;
+ case -1u:
+ data->state = 21;
+ break;
+ }
+ break;
+ case 24:
+ if (TearDownCardOrNews_ReturnToTopMenu(data->IsCardOrNews, 1))
+ {
+ DestroyNewsOrCard(data->IsCardOrNews);
+ data->state = 25;
+ }
+ break;
+ case 25:
+ if (mevent_save_game(&data->textState))
+ {
+ data->state = 26;
+ }
+ break;
+ case 26:
+ if (mevent_message_was_thrown_away(&data->textState, data->IsCardOrNews))
+ {
+ data->state = 0;
+ PrintMysteryGiftOrEReaderTopMenu(0, 0);
+ }
+ break;
+ case 27:
+ if (TearDownCardOrNews_ReturnToTopMenu(data->IsCardOrNews, 0))
+ {
+ data->state = 0;
+ }
+ break;
+ case 28:
+ if (TearDownCardOrNews_ReturnToTopMenu(data->IsCardOrNews, 1))
+ {
+ data->state = 3;
+ }
+ break;
+ case 29:
+ if (TearDownCardOrNews_ReturnToTopMenu(data->IsCardOrNews, 1))
+ {
+ switch (data->IsCardOrNews)
+ {
+ case 0:
+ MEvent_CreateTask_Leader(21);
+ break;
+ case 1:
+ MEvent_CreateTask_Leader(22);
+ break;
+ }
+ data->source = 1;
+ data->state = 30;
+ }
+ break;
+ case 30:
+ if (gReceivedRemoteLinkPlayers != 0)
+ {
+ ClearScreenInBg0(1);
+ data->state = 31;
+ }
+ else if (gSpecialVar_Result == 5)
+ {
+ ClearScreenInBg0(1);
+ data->state = 18;
+ }
+ break;
+ case 31:
+ {
+ register u8 eos asm("r1");
+ gStringVar1[0] = (eos = EOS);
+ gStringVar2[0] = eos;
+ gStringVar3[0] = eos;
+ }
+ if (data->IsCardOrNews == 0)
+ {
+ AddTextPrinterToWindow1(gText_SendingWonderCard);
+ mevent_srv_new_wcard();
+ }
+ else
+ {
+ AddTextPrinterToWindow1(gText_SendingWonderNews);
+ mevent_srv_init_wnews();
+ }
+ data->state = 32;
+ break;
+ case 32:
+ if (mevent_srv_common_do_exec(&data->curPromptWindowId) == 3)
+ {
+ data->prevPromptWindowId = data->curPromptWindowId;
+ data->state = 33;
+ }
+ break;
+ case 33:
+ task_add_05_task_del_08FA224_when_no_RfuFunc();
+ StringCopy(gStringVar1, gLinkPlayers[1].name);
+ data->state = 34;
+ break;
+ case 34:
+ if (gReceivedRemoteLinkPlayers == 0)
+ {
+ DestroyWirelessStatusIndicatorSprite();
+ data->state = 35;
+ }
+ break;
+ case 35:
+ if (PrintMGSendStatus(&data->textState, &data->curPromptWindowId, data->source, data->prevPromptWindowId))
+ {
+ if (data->source == 1 && data->prevPromptWindowId == 3)
+ {
+ GenerateRandomNews(3);
+ data->state = 17;
+ }
+ else
+ {
+ data->state = 0;
+ PrintMysteryGiftOrEReaderTopMenu(0, 0);
+ }
+ }
+ break;
+ case 36:
+ if (MG_PrintTextOnWindow1AndWaitButton(&data->textState, gText_CommunicationError))
+ {
+ data->state = 0;
+ PrintMysteryGiftOrEReaderTopMenu(0, 0);
+ }
+ break;
+ case 37:
+ CloseLink();
+ Free(data->buffer);
+ DestroyTask(taskId);
+ SetMainCallback2(MainCB_FreeAllBuffersAndReturnToInitTitleScreen);
+ break;
+ }
+}
+
+u16 GetMysteryGiftBaseBlock(void)
+{
+ return 0x1A9;
+}
+
+void bgid_upload_textbox_1(u8 bgId)
+{
+ DecompressAndLoadBgGfxUsingHeap(bgId, gUnkTextboxBorderGfx, 0x100, 0, 0);
+}
diff --git a/src/naming_screen.c b/src/naming_screen.c
index 75b7c8566..3b8ba037c 100644
--- a/src/naming_screen.c
+++ b/src/naming_screen.c
@@ -1906,52 +1906,43 @@ static const struct NamingScreenTemplate *const sNamingScreenTemplates[] =
const struct OamData gOamData_858BFEC =
{
.y = 0,
- .affineMode = 0,
- .objMode = 0,
- .mosaic = 0,
- .bpp = 0,
+ .affineMode = ST_OAM_AFFINE_OFF,
+ .objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x8),
.x = 0,
- .matrixNum = 0,
.size = SPRITE_SIZE(8x8),
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
- .affineParam = 0,
};
const struct OamData gOamData_858BFF4 =
{
.y = 0,
- .affineMode = 0,
- .objMode = 0,
- .mosaic = 0,
- .bpp = 0,
+ .affineMode = ST_OAM_AFFINE_OFF,
+ .objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x16),
.x = 0,
- .matrixNum = 0,
.size = SPRITE_SIZE(16x16),
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
- .affineParam = 0,
};
const struct OamData gOamData_858BFFC =
{
.y = 0,
- .affineMode = 0,
- .objMode = 0,
- .mosaic = 0,
- .bpp = 0,
+ .affineMode = ST_OAM_AFFINE_OFF,
+ .objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x16),
.x = 0,
- .matrixNum = 0,
.size = SPRITE_SIZE(32x16),
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
- .affineParam = 0,
};
static const struct Subsprite gUnknown_0858C004[] =
@@ -2203,3 +2194,5 @@ static const struct SpritePalette gUnknown_0858C230[] =
{gNamingScreenMenu_Pal + 0x40, 0x0007},
{NULL}
};
+
+
diff --git a/src/party_menu.c b/src/party_menu.c
index 7db24b6ca..6233558ff 100755
--- a/src/party_menu.c
+++ b/src/party_menu.c
@@ -49,7 +49,7 @@
#include "pokemon_summary_screen.h"
#include "region_map.h"
#include "reshow_battle_screen.h"
-#include "rom_8011DC0.h"
+#include "union_room.h"
#include "scanline_effect.h"
#include "script.h"
#include "sound.h"
diff --git a/src/pokedex_area_screen.c b/src/pokedex_area_screen.c
index 00fe9ab82..1eb8c0953 100755
--- a/src/pokedex_area_screen.c
+++ b/src/pokedex_area_screen.c
@@ -23,6 +23,19 @@
#include "constants/species.h"
#include "constants/vars.h"
+#define AREA_SCREEN_WIDTH 32
+#define AREA_SCREEN_HEIGHT 20
+
+#define GLOW_TILE_FULL 0xFFFF
+#define GLOW_TILE_LEFT (1 << 0)
+#define GLOW_TILE_RIGHT (1 << 1)
+#define GLOW_TILE_TOP (1 << 2)
+#define GLOW_TILE_BOTTOM (1 << 3)
+#define GLOW_TILE_BOTTOM_RIGHT (1 << 4)
+#define GLOW_TILE_TOP_RIGHT (1 << 5)
+#define GLOW_TILE_BOTTOM_LEFT (1 << 6)
+#define GLOW_TILE_TOP_LEFT (1 << 7)
+
struct PokeDexAreaScreenMapIdentity
{
u8 mapGroup;
@@ -107,24 +120,114 @@ static const u16 sLandmarkData[][2] =
{MAPSEC_NONE}
};
-static const u8 sAreaGlowTilemapMapping[] =
-{
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x11, 0x20, 0x02, 0x03, 0x27, 0x2d, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x12, 0x21, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x2a, 0x2e, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x13, 0x22, 0x02, 0x03, 0x27, 0x2d, 0x06, 0x07, 0x2a, 0x2e, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x14, 0x01, 0x23, 0x03, 0x26, 0x05, 0x2c, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x15, 0x20, 0x23, 0x03, 0x28, 0x2d, 0x2c, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x16, 0x21, 0x23, 0x03, 0x26, 0x05, 0x2c, 0x07, 0x2a, 0x2e, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x17, 0x22, 0x23, 0x03, 0x28, 0x2d, 0x2c, 0x07, 0x2a, 0x2e, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x18, 0x01, 0x24, 0x03, 0x04, 0x05, 0x06, 0x07, 0x29, 0x09, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x19, 0x20, 0x24, 0x03, 0x27, 0x2d, 0x06, 0x07, 0x29, 0x09, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x1a, 0x21, 0x24, 0x03, 0x04, 0x05, 0x06, 0x07, 0x2b, 0x2e, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x1b, 0x22, 0x24, 0x03, 0x27, 0x2d, 0x06, 0x07, 0x2b, 0x2e, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x1c, 0x01, 0x25, 0x03, 0x26, 0x05, 0x2c, 0x07, 0x29, 0x09, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x1d, 0x20, 0x25, 0x03, 0x28, 0x2d, 0x2c, 0x07, 0x29, 0x09, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x1e, 0x21, 0x25, 0x03, 0x26, 0x05, 0x2c, 0x07, 0x2b, 0x2e, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x1f, 0x22, 0x25, 0x03, 0x28, 0x2d, 0x2c, 0x07, 0x2b, 0x2e, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+// Only some parts of this array are acutally used, because corner flags that overlap
+// with edge flags are cancelled out before lookup. For example, GLOW_TILE_BOTTOM_RIGHT | GLOW_TILE_RIGHT
+// will never be read.
+//
+// The rest of the bytes seem to be old data from before the cancellation was implemented.
+// Most of them line up as you would expect ([BOTTOM_RIGHT | RIGHT] has the same value as [RIGHT]).
+//
+// Any unreachable entries are simply listed in order, without the fancy "[FLAGS] = 0xXX" notation.
+static const u8 sAreaGlowTilemapMapping[] = {
+ [0] = 0x00,
+ [GLOW_TILE_LEFT] = 0x01,
+ [GLOW_TILE_RIGHT] = 0x02,
+ [GLOW_TILE_RIGHT | GLOW_TILE_LEFT] = 0x03,
+ [GLOW_TILE_TOP] = 0x04,
+ [GLOW_TILE_TOP | GLOW_TILE_LEFT] = 0x05,
+ [GLOW_TILE_TOP | GLOW_TILE_RIGHT] = 0x06,
+ [GLOW_TILE_TOP | GLOW_TILE_RIGHT | GLOW_TILE_LEFT] = 0x07,
+ [GLOW_TILE_BOTTOM] = 0x08,
+ [GLOW_TILE_BOTTOM | GLOW_TILE_LEFT] = 0x09,
+ [GLOW_TILE_BOTTOM | GLOW_TILE_RIGHT] = 0x0a,
+ [GLOW_TILE_BOTTOM | GLOW_TILE_RIGHT | GLOW_TILE_LEFT] = 0x0b,
+ [GLOW_TILE_BOTTOM | GLOW_TILE_TOP] = 0x0c,
+ [GLOW_TILE_BOTTOM | GLOW_TILE_TOP | GLOW_TILE_LEFT] = 0x0d,
+ [GLOW_TILE_BOTTOM | GLOW_TILE_TOP | GLOW_TILE_RIGHT] = 0x0e,
+ [GLOW_TILE_BOTTOM | GLOW_TILE_TOP | GLOW_TILE_RIGHT | GLOW_TILE_LEFT] = 0x0f,
+ [GLOW_TILE_BOTTOM_RIGHT] = 0x11,
+ [GLOW_TILE_BOTTOM_RIGHT | GLOW_TILE_LEFT] = 0x20,
+ 0x02, 0x03,
+ [GLOW_TILE_BOTTOM_RIGHT | GLOW_TILE_TOP] = 0x27,
+ [GLOW_TILE_BOTTOM_RIGHT | GLOW_TILE_TOP | GLOW_TILE_LEFT] = 0x2d,
+ 0x06, 0x07, 0x08, 0x09, 0x0a,
+ 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ [GLOW_TILE_TOP_RIGHT] = 0x12,
+ [GLOW_TILE_TOP_RIGHT | GLOW_TILE_LEFT] = 0x21,
+ 0x02, 0x03, 0x04, 0x05, 0x06,
+ 0x07,
+ [GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM] = 0x2a,
+ [GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM | GLOW_TILE_LEFT] = 0x2e,
+ 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
+ 0x0f,
+ [GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM_RIGHT] = 0x13,
+ [GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM_RIGHT | GLOW_TILE_LEFT] = 0x22,
+ 0x02, 0x03, 0x27, 0x2d, 0x06,
+ 0x07, 0x2a, 0x2e, 0x0a, 0x0b,
+ 0x0c, 0x0d, 0x0e, 0x0f,
+ [GLOW_TILE_BOTTOM_LEFT] = 0x14,
+ 0x01,
+ [GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_RIGHT] = 0x23,
+ 0x03,
+ [GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_TOP] = 0x26,
+ 0x05,
+ [GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_TOP | GLOW_TILE_RIGHT] = 0x2c,
+ 0x07, 0x08, 0x09, 0x0a, 0x0b,
+ 0x0c, 0x0d, 0x0e, 0x0f,
+ [GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_BOTTOM_RIGHT] = 0x15,
+ 0x20, 0x23, 0x03,
+ [GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_BOTTOM_RIGHT | GLOW_TILE_TOP] = 0x28,
+ 0x2d, 0x2c, 0x07, 0x08, 0x09,
+ 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
+ 0x0f,
+ [GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_TOP_RIGHT] = 0x16,
+ 0x21, 0x23, 0x03, 0x26, 0x05,
+ 0x2c, 0x07, 0x2a, 0x2e, 0x0a,
+ 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ [GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM_RIGHT] = 0x17,
+ 0x22, 0x23, 0x03, 0x28, 0x2d,
+ 0x2c, 0x07, 0x2a, 0x2e, 0x0a,
+ 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ [GLOW_TILE_TOP_LEFT] = 0x18,
+ 0x01,
+ [GLOW_TILE_TOP_LEFT | GLOW_TILE_RIGHT] = 0x24,
+ 0x03, 0x04, 0x05, 0x06, 0x07,
+ [GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM] = 0x29,
+ 0x09,
+ [GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM | GLOW_TILE_RIGHT] = 0x2f,
+ 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ [GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM_RIGHT] = 0x19,
+ 0x20, 0x24, 0x03, 0x27, 0x2d,
+ 0x06, 0x07, 0x29, 0x09, 0x2f,
+ 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ [GLOW_TILE_TOP_LEFT | GLOW_TILE_TOP_RIGHT] = 0x1a,
+ 0x21, 0x24, 0x03, 0x04, 0x05,
+ 0x06, 0x07,
+ [GLOW_TILE_TOP_LEFT | GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM] = 0x2b,
+ 0x2e, 0x2f, 0x0b, 0x0c, 0x0d,
+ 0x0e, 0x0f,
+ [GLOW_TILE_TOP_LEFT | GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM_RIGHT] = 0x1b,
+ 0x22, 0x24, 0x03, 0x27, 0x2d,
+ 0x06, 0x07, 0x2b, 0x2e, 0x2f,
+ 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ [GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM_LEFT] = 0x1c,
+ 0x01,
+ [GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_RIGHT] = 0x25,
+ 0x03, 0x26, 0x05, 0x2c, 0x07,
+ 0x29, 0x09, 0x2f, 0x0b, 0x0c,
+ 0x0d, 0x0e, 0x0f,
+ [GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_BOTTOM_RIGHT] = 0x1d,
+ 0x20, 0x25, 0x03, 0x28, 0x2d,
+ 0x2c, 0x07, 0x29, 0x09, 0x2f,
+ 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ [GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_TOP_RIGHT] = 0x1e,
+ 0x21, 0x25, 0x03, 0x26, 0x05,
+ 0x2c, 0x07, 0x2b, 0x2e, 0x2f,
+ 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ [GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM_RIGHT] = 0x1f,
+ 0x22, 0x25, 0x03, 0x28, 0x2d,
+ 0x2c, 0x07, 0x2b, 0x2e, 0x2f,
+ 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
};
static const struct UnkStruct_1C4D70 sUnknown_085B4018 =
@@ -255,11 +358,11 @@ static void FindMapsWithMon(u16 species)
{
switch (sFeebasData[i][1])
{
- case MAP_GROUP(PETALBURG_CITY):
+ case MAP_GROUP_OVERWORLD_MONS:
SetAreaHasMon(sFeebasData[i][1], sFeebasData[i][2]);
break;
- case MAP_GROUP(METEOR_FALLS_1F_1R):
- case MAP_GROUP(SAFARI_ZONE_NORTHWEST):
+ case MAP_GROUP_SPECIAL_MONS_1:
+ case MAP_GROUP_SPECIAL_MONS_2:
SetSpecialMapHasMon(sFeebasData[i][1], sFeebasData[i][2]);
break;
}
@@ -268,15 +371,15 @@ static void FindMapsWithMon(u16 species)
for (i = 0; gWildMonHeaders[i].mapGroup != 0xFF; i++)
{
- if (MapHasMon(gWildMonHeaders + i, species))
+ if (MapHasMon(&gWildMonHeaders[i], species))
{
switch (gWildMonHeaders[i].mapGroup)
{
- case MAP_GROUP(PETALBURG_CITY):
+ case MAP_GROUP_OVERWORLD_MONS:
SetAreaHasMon(gWildMonHeaders[i].mapGroup, gWildMonHeaders[i].mapNum);
break;
- case MAP_GROUP(METEOR_FALLS_1F_1R):
- case MAP_GROUP(SAFARI_ZONE_NORTHWEST):
+ case MAP_GROUP_SPECIAL_MONS_1:
+ case MAP_GROUP_SPECIAL_MONS_2:
SetSpecialMapHasMon(gWildMonHeaders[i].mapGroup, gWildMonHeaders[i].mapNum);
break;
}
@@ -390,18 +493,18 @@ static void BuildAreaGlowTilemap(void)
u16 i, y, x, j;
u16 val;
- for (i = 0; i < 0x280; i++)
+ for (i = 0; i < ARRAY_COUNT(sPokedexAreaScreen->areaGlowTilemap); i++)
sPokedexAreaScreen->areaGlowTilemap[i] = 0;
for (i = 0; i < sPokedexAreaScreen->numOverworldAreas; i++)
{
j = 0;
- for (y = 0; y < 20; y++)
+ for (y = 0; y < AREA_SCREEN_HEIGHT; y++)
{
- for (x = 0; x < 32; x++)
+ for (x = 0; x < AREA_SCREEN_WIDTH; x++)
{
if (GetRegionMapSectionIdAt(x, y) == sPokedexAreaScreen->overworldAreasWithMons[i].regionMapSectionId)
- sPokedexAreaScreen->areaGlowTilemap[j] = 0xFFFF;
+ sPokedexAreaScreen->areaGlowTilemap[j] = GLOW_TILE_FULL;
j++;
}
@@ -409,51 +512,58 @@ static void BuildAreaGlowTilemap(void)
}
j = 0;
- for (y = 0; y < 20; y++)
+ for (y = 0; y < AREA_SCREEN_HEIGHT; y++)
{
- for (x = 0; x < 32; x++)
+ for (x = 0; x < AREA_SCREEN_WIDTH; x++)
{
- if (sPokedexAreaScreen->areaGlowTilemap[j] == 0xFFFF)
+ if (sPokedexAreaScreen->areaGlowTilemap[j] == GLOW_TILE_FULL)
{
- if (x != 0 && sPokedexAreaScreen->areaGlowTilemap[j - 1] != 0xFFFF)
- sPokedexAreaScreen->areaGlowTilemap[j - 1] |= 0x02;
- if (x != 31 && sPokedexAreaScreen->areaGlowTilemap[j + 1] != 0xFFFF)
- sPokedexAreaScreen->areaGlowTilemap[j + 1] |= 0x01;
- if (y != 0 && sPokedexAreaScreen->areaGlowTilemap[j - 32] != 0xFFFF)
- sPokedexAreaScreen->areaGlowTilemap[j - 32] |= 0x08;
- if (y != 19 && sPokedexAreaScreen->areaGlowTilemap[j + 32] != 0xFFFF)
- sPokedexAreaScreen->areaGlowTilemap[j + 32] |= 0x04;
- if (x != 0 && y != 0 && sPokedexAreaScreen->areaGlowTilemap[j - 33] != 0xFFFF)
- sPokedexAreaScreen->areaGlowTilemap[j - 33] |= 0x10;
- if (x != 31 && y != 0 && sPokedexAreaScreen->areaGlowTilemap[j - 31] != 0xFFFF)
- sPokedexAreaScreen->areaGlowTilemap[j - 31] |= 0x40;
- if (x != 0 && y != 19 && sPokedexAreaScreen->areaGlowTilemap[j + 31] != 0xFFFF)
- sPokedexAreaScreen->areaGlowTilemap[j + 31] |= 0x20;
- if (x != 31 && y != 19 && sPokedexAreaScreen->areaGlowTilemap[j + 33] != 0xFFFF)
- sPokedexAreaScreen->areaGlowTilemap[j + 33] |= 0x80;
+ // The "tile != GLOW_TILE_FULL" check is pointless in all of these conditionals,
+ // since there's no harm in OR'ing 0xFFFF with anything else.
+
+ // Edges
+ if (x != 0 && sPokedexAreaScreen->areaGlowTilemap[j - 1] != GLOW_TILE_FULL)
+ sPokedexAreaScreen->areaGlowTilemap[j - 1] |= GLOW_TILE_RIGHT;
+ if (x != AREA_SCREEN_WIDTH - 1 && sPokedexAreaScreen->areaGlowTilemap[j + 1] != GLOW_TILE_FULL)
+ sPokedexAreaScreen->areaGlowTilemap[j + 1] |= GLOW_TILE_LEFT;
+ if (y != 0 && sPokedexAreaScreen->areaGlowTilemap[j - AREA_SCREEN_WIDTH] != GLOW_TILE_FULL)
+ sPokedexAreaScreen->areaGlowTilemap[j - AREA_SCREEN_WIDTH] |= GLOW_TILE_BOTTOM;
+ if (y != AREA_SCREEN_HEIGHT - 1 && sPokedexAreaScreen->areaGlowTilemap[j + AREA_SCREEN_WIDTH] != GLOW_TILE_FULL)
+ sPokedexAreaScreen->areaGlowTilemap[j + AREA_SCREEN_WIDTH] |= GLOW_TILE_TOP;
+
+ // Diagonals
+ if (x != 0 && y != 0 && sPokedexAreaScreen->areaGlowTilemap[j - AREA_SCREEN_WIDTH - 1] != GLOW_TILE_FULL)
+ sPokedexAreaScreen->areaGlowTilemap[j - AREA_SCREEN_WIDTH - 1] |= GLOW_TILE_BOTTOM_RIGHT;
+ if (x != AREA_SCREEN_WIDTH - 1 && y != 0 && sPokedexAreaScreen->areaGlowTilemap[j - AREA_SCREEN_WIDTH + 1] != GLOW_TILE_FULL)
+ sPokedexAreaScreen->areaGlowTilemap[j - AREA_SCREEN_WIDTH + 1] |= GLOW_TILE_BOTTOM_LEFT;
+ if (x != 0 && y != AREA_SCREEN_HEIGHT - 1 && sPokedexAreaScreen->areaGlowTilemap[j + AREA_SCREEN_WIDTH - 1] != GLOW_TILE_FULL)
+ sPokedexAreaScreen->areaGlowTilemap[j + AREA_SCREEN_WIDTH - 1] |= GLOW_TILE_TOP_RIGHT;
+ if (x != AREA_SCREEN_WIDTH - 1 && y != AREA_SCREEN_HEIGHT - 1 && sPokedexAreaScreen->areaGlowTilemap[j + AREA_SCREEN_WIDTH + 1] != GLOW_TILE_FULL)
+ sPokedexAreaScreen->areaGlowTilemap[j + AREA_SCREEN_WIDTH + 1] |= GLOW_TILE_TOP_LEFT;
}
j++;
}
}
- for (i = 0; i < 0x280; i++)
+ for (i = 0; i < ARRAY_COUNT(sPokedexAreaScreen->areaGlowTilemap); i++)
{
- if (sPokedexAreaScreen->areaGlowTilemap[i] == 0xFFFF)
+ if (sPokedexAreaScreen->areaGlowTilemap[i] == GLOW_TILE_FULL)
{
sPokedexAreaScreen->areaGlowTilemap[i] = 0x10;
sPokedexAreaScreen->areaGlowTilemap[i] |= 0xA000;
}
else if (sPokedexAreaScreen->areaGlowTilemap[i])
{
- if (sPokedexAreaScreen->areaGlowTilemap[i] & 0x02)
- sPokedexAreaScreen->areaGlowTilemap[i] &= 0xFFCF;
- if (sPokedexAreaScreen->areaGlowTilemap[i] & 0x01)
- sPokedexAreaScreen->areaGlowTilemap[i] &= 0xFF3F;
- if (sPokedexAreaScreen->areaGlowTilemap[i] & 0x08)
- sPokedexAreaScreen->areaGlowTilemap[i] &= 0xFFAF;
- if (sPokedexAreaScreen->areaGlowTilemap[i] & 0x04)
- sPokedexAreaScreen->areaGlowTilemap[i] &= 0xFF5F;
+ // Get rid of overlapping flags
+ if (sPokedexAreaScreen->areaGlowTilemap[i] & GLOW_TILE_RIGHT)
+ sPokedexAreaScreen->areaGlowTilemap[i] &= ~(GLOW_TILE_BOTTOM_RIGHT | GLOW_TILE_TOP_RIGHT);
+ if (sPokedexAreaScreen->areaGlowTilemap[i] & GLOW_TILE_LEFT)
+ sPokedexAreaScreen->areaGlowTilemap[i] &= ~(GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_TOP_LEFT);
+ if (sPokedexAreaScreen->areaGlowTilemap[i] & GLOW_TILE_BOTTOM)
+ sPokedexAreaScreen->areaGlowTilemap[i] &= ~(GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_BOTTOM_RIGHT);
+ if (sPokedexAreaScreen->areaGlowTilemap[i] & GLOW_TILE_TOP)
+ sPokedexAreaScreen->areaGlowTilemap[i] &= ~(GLOW_TILE_TOP_LEFT | GLOW_TILE_TOP_RIGHT);
sPokedexAreaScreen->areaGlowTilemap[i] = sAreaGlowTilemapMapping[sPokedexAreaScreen->areaGlowTilemap[i]];
sPokedexAreaScreen->areaGlowTilemap[i] |= 0xA000;
diff --git a/src/pokedex_cry_screen.c b/src/pokedex_cry_screen.c
index 8ca0c8d6e..487db6d58 100755..100644
--- a/src/pokedex_cry_screen.c
+++ b/src/pokedex_cry_screen.c
@@ -169,9 +169,14 @@ const struct OamData gOamData_85B8C60 =
{
.y = 160,
.affineMode = ST_OAM_AFFINE_NORMAL,
+ .objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x64),
+ .x = 0,
.size = SPRITE_SIZE(64x64),
- .priority = 1
+ .tileNum = 0,
+ .priority = 1,
+ .paletteNum = 0,
};
const struct SpriteTemplate gUnknown_085B8C68 =
@@ -521,3 +526,4 @@ static void sub_8145B24(s8 a0)
sCryVolumeMeter->unk1 = r2;
sCryVolumeMeter->unk2 = 5;
}
+
diff --git a/src/pokemon.c b/src/pokemon.c
index 7c26b4c22..984c484a2 100644
--- a/src/pokemon.c
+++ b/src/pokemon.c
@@ -1810,419 +1810,63 @@ static const u8 sMonFrontAnimIdsTable[] =
[SPECIES_CHIMECHO - 1] = 0x1d,
};
-static const u8 sMonAnimationDelayTable[] =
-{
- [SPECIES_BULBASAUR - 1] = 0x00,
- [SPECIES_IVYSAUR - 1] = 0x00,
- [SPECIES_VENUSAUR - 1] = 0x00,
- [SPECIES_CHARMANDER - 1] = 0x00,
- [SPECIES_CHARMELEON - 1] = 0x00,
- [SPECIES_CHARIZARD - 1] = 0x00,
- [SPECIES_SQUIRTLE - 1] = 0x00,
- [SPECIES_WARTORTLE - 1] = 0x00,
+static const u8 sMonAnimationDelayTable[NUM_SPECIES - 1] =
+{
[SPECIES_BLASTOISE - 1] = 0x32,
- [SPECIES_CATERPIE - 1] = 0x00,
- [SPECIES_METAPOD - 1] = 0x00,
- [SPECIES_BUTTERFREE - 1] = 0x00,
[SPECIES_WEEDLE - 1] = 0x0a,
[SPECIES_KAKUNA - 1] = 0x14,
[SPECIES_BEEDRILL - 1] = 0x23,
- [SPECIES_PIDGEY - 1] = 0x00,
[SPECIES_PIDGEOTTO - 1] = 0x19,
- [SPECIES_PIDGEOT - 1] = 0x00,
- [SPECIES_RATTATA - 1] = 0x00,
- [SPECIES_RATICATE - 1] = 0x00,
- [SPECIES_SPEAROW - 1] = 0x00,
[SPECIES_FEAROW - 1] = 0x02,
[SPECIES_EKANS - 1] = 0x1e,
- [SPECIES_ARBOK - 1] = 0x00,
- [SPECIES_PIKACHU - 1] = 0x00,
- [SPECIES_RAICHU - 1] = 0x00,
- [SPECIES_SANDSHREW - 1] = 0x00,
- [SPECIES_SANDSLASH - 1] = 0x00,
[SPECIES_NIDORAN_F - 1] = 0x1c,
- [SPECIES_NIDORINA - 1] = 0x00,
- [SPECIES_NIDOQUEEN - 1] = 0x00,
- [SPECIES_NIDORAN_M - 1] = 0x00,
- [SPECIES_NIDORINO - 1] = 0x00,
[SPECIES_NIDOKING - 1] = 0x19,
- [SPECIES_CLEFAIRY - 1] = 0x00,
- [SPECIES_CLEFABLE - 1] = 0x00,
- [SPECIES_VULPIX - 1] = 0x00,
- [SPECIES_NINETALES - 1] = 0x00,
- [SPECIES_JIGGLYPUFF - 1] = 0x00,
- [SPECIES_WIGGLYTUFF - 1] = 0x00,
- [SPECIES_ZUBAT - 1] = 0x00,
- [SPECIES_GOLBAT - 1] = 0x00,
- [SPECIES_ODDISH - 1] = 0x00,
- [SPECIES_GLOOM - 1] = 0x00,
- [SPECIES_VILEPLUME - 1] = 0x00,
[SPECIES_PARAS - 1] = 0x0a,
[SPECIES_PARASECT - 1] = 0x2d,
[SPECIES_VENONAT - 1] = 0x14,
- [SPECIES_VENOMOTH - 1] = 0x00,
[SPECIES_DIGLETT - 1] = 0x19,
[SPECIES_DUGTRIO - 1] = 0x23,
[SPECIES_MEOWTH - 1] = 0x28,
[SPECIES_PERSIAN - 1] = 0x14,
- [SPECIES_PSYDUCK - 1] = 0x00,
- [SPECIES_GOLDUCK - 1] = 0x00,
[SPECIES_MANKEY - 1] = 0x14,
- [SPECIES_PRIMEAPE - 1] = 0x00,
[SPECIES_GROWLITHE - 1] = 0x1e,
[SPECIES_ARCANINE - 1] = 0x28,
- [SPECIES_POLIWAG - 1] = 0x00,
[SPECIES_POLIWHIRL - 1] = 0x05,
- [SPECIES_POLIWRATH - 1] = 0x00,
- [SPECIES_ABRA - 1] = 0x00,
- [SPECIES_KADABRA - 1] = 0x00,
- [SPECIES_ALAKAZAM - 1] = 0x00,
- [SPECIES_MACHOP - 1] = 0x00,
- [SPECIES_MACHOKE - 1] = 0x00,
- [SPECIES_MACHAMP - 1] = 0x00,
- [SPECIES_BELLSPROUT - 1] = 0x00,
[SPECIES_WEEPINBELL - 1] = 0x03,
- [SPECIES_VICTREEBEL - 1] = 0x00,
- [SPECIES_TENTACOOL - 1] = 0x00,
- [SPECIES_TENTACRUEL - 1] = 0x00,
- [SPECIES_GEODUDE - 1] = 0x00,
- [SPECIES_GRAVELER - 1] = 0x00,
- [SPECIES_GOLEM - 1] = 0x00,
- [SPECIES_PONYTA - 1] = 0x00,
- [SPECIES_RAPIDASH - 1] = 0x00,
- [SPECIES_SLOWPOKE - 1] = 0x00,
- [SPECIES_SLOWBRO - 1] = 0x00,
- [SPECIES_MAGNEMITE - 1] = 0x00,
- [SPECIES_MAGNETON - 1] = 0x00,
- [SPECIES_FARFETCHD - 1] = 0x00,
- [SPECIES_DODUO - 1] = 0x00,
- [SPECIES_DODRIO - 1] = 0x00,
- [SPECIES_SEEL - 1] = 0x00,
- [SPECIES_DEWGONG - 1] = 0x00,
- [SPECIES_GRIMER - 1] = 0x00,
[SPECIES_MUK - 1] = 0x2d,
[SPECIES_SHELLDER - 1] = 0x14,
- [SPECIES_CLOYSTER - 1] = 0x00,
- [SPECIES_GASTLY - 1] = 0x00,
[SPECIES_HAUNTER - 1] = 0x17,
- [SPECIES_GENGAR - 1] = 0x00,
- [SPECIES_ONIX - 1] = 0x00,
[SPECIES_DROWZEE - 1] = 0x30,
[SPECIES_HYPNO - 1] = 0x28,
- [SPECIES_KRABBY - 1] = 0x00,
- [SPECIES_KINGLER - 1] = 0x00,
- [SPECIES_VOLTORB - 1] = 0x00,
- [SPECIES_ELECTRODE - 1] = 0x00,
- [SPECIES_EXEGGCUTE - 1] = 0x00,
- [SPECIES_EXEGGUTOR - 1] = 0x00,
- [SPECIES_CUBONE - 1] = 0x00,
- [SPECIES_MAROWAK - 1] = 0x00,
- [SPECIES_HITMONLEE - 1] = 0x00,
[SPECIES_HITMONCHAN - 1] = 0x19,
- [SPECIES_LICKITUNG - 1] = 0x00,
- [SPECIES_KOFFING - 1] = 0x00,
- [SPECIES_WEEZING - 1] = 0x00,
- [SPECIES_RHYHORN - 1] = 0x00,
- [SPECIES_RHYDON - 1] = 0x00,
- [SPECIES_CHANSEY - 1] = 0x00,
- [SPECIES_TANGELA - 1] = 0x00,
- [SPECIES_KANGASKHAN - 1] = 0x00,
- [SPECIES_HORSEA - 1] = 0x00,
- [SPECIES_SEADRA - 1] = 0x00,
- [SPECIES_GOLDEEN - 1] = 0x00,
- [SPECIES_SEAKING - 1] = 0x00,
- [SPECIES_STARYU - 1] = 0x00,
- [SPECIES_STARMIE - 1] = 0x00,
- [SPECIES_MR_MIME - 1] = 0x00,
[SPECIES_SCYTHER - 1] = 0x0a,
- [SPECIES_JYNX - 1] = 0x00,
- [SPECIES_ELECTABUZZ - 1] = 0x00,
- [SPECIES_MAGMAR - 1] = 0x00,
- [SPECIES_PINSIR - 1] = 0x00,
[SPECIES_TAUROS - 1] = 0x0a,
- [SPECIES_MAGIKARP - 1] = 0x00,
- [SPECIES_GYARADOS - 1] = 0x00,
- [SPECIES_LAPRAS - 1] = 0x00,
- [SPECIES_DITTO - 1] = 0x00,
- [SPECIES_EEVEE - 1] = 0x00,
- [SPECIES_VAPOREON - 1] = 0x00,
- [SPECIES_JOLTEON - 1] = 0x00,
- [SPECIES_FLAREON - 1] = 0x00,
- [SPECIES_PORYGON - 1] = 0x00,
- [SPECIES_OMANYTE - 1] = 0x00,
- [SPECIES_OMASTAR - 1] = 0x00,
- [SPECIES_KABUTO - 1] = 0x00,
- [SPECIES_KABUTOPS - 1] = 0x00,
- [SPECIES_AERODACTYL - 1] = 0x00,
- [SPECIES_SNORLAX - 1] = 0x00,
- [SPECIES_ARTICUNO - 1] = 0x00,
- [SPECIES_ZAPDOS - 1] = 0x00,
- [SPECIES_MOLTRES - 1] = 0x00,
- [SPECIES_DRATINI - 1] = 0x00,
- [SPECIES_DRAGONAIR - 1] = 0x00,
- [SPECIES_DRAGONITE - 1] = 0x00,
- [SPECIES_MEWTWO - 1] = 0x00,
- [SPECIES_MEW - 1] = 0x00,
- [SPECIES_CHIKORITA - 1] = 0x00,
- [SPECIES_BAYLEEF - 1] = 0x00,
- [SPECIES_MEGANIUM - 1] = 0x00,
- [SPECIES_CYNDAQUIL - 1] = 0x00,
- [SPECIES_QUILAVA - 1] = 0x00,
[SPECIES_TYPHLOSION - 1] = 0x14,
- [SPECIES_TOTODILE - 1] = 0x00,
- [SPECIES_CROCONAW - 1] = 0x00,
[SPECIES_FERALIGATR - 1] = 0x05,
- [SPECIES_SENTRET - 1] = 0x00,
- [SPECIES_FURRET - 1] = 0x00,
- [SPECIES_HOOTHOOT - 1] = 0x00,
- [SPECIES_NOCTOWL - 1] = 0x00,
- [SPECIES_LEDYBA - 1] = 0x00,
- [SPECIES_LEDIAN - 1] = 0x00,
- [SPECIES_SPINARAK - 1] = 0x00,
- [SPECIES_ARIADOS - 1] = 0x00,
- [SPECIES_CROBAT - 1] = 0x00,
- [SPECIES_CHINCHOU - 1] = 0x00,
- [SPECIES_LANTURN - 1] = 0x00,
- [SPECIES_PICHU - 1] = 0x00,
- [SPECIES_CLEFFA - 1] = 0x00,
- [SPECIES_IGGLYBUFF - 1] = 0x00,
- [SPECIES_TOGEPI - 1] = 0x00,
- [SPECIES_TOGETIC - 1] = 0x00,
[SPECIES_NATU - 1] = 0x1e,
- [SPECIES_XATU - 1] = 0x00,
[SPECIES_MAREEP - 1] = 0x32,
- [SPECIES_FLAAFFY - 1] = 0x00,
[SPECIES_AMPHAROS - 1] = 0x0a,
- [SPECIES_BELLOSSOM - 1] = 0x00,
- [SPECIES_MARILL - 1] = 0x00,
- [SPECIES_AZUMARILL - 1] = 0x00,
- [SPECIES_SUDOWOODO - 1] = 0x00,
[SPECIES_POLITOED - 1] = 0x28,
- [SPECIES_HOPPIP - 1] = 0x00,
- [SPECIES_SKIPLOOM - 1] = 0x00,
- [SPECIES_JUMPLUFF - 1] = 0x00,
- [SPECIES_AIPOM - 1] = 0x00,
- [SPECIES_SUNKERN - 1] = 0x00,
- [SPECIES_SUNFLORA - 1] = 0x00,
- [SPECIES_YANMA - 1] = 0x00,
- [SPECIES_WOOPER - 1] = 0x00,
- [SPECIES_QUAGSIRE - 1] = 0x00,
- [SPECIES_ESPEON - 1] = 0x00,
- [SPECIES_UMBREON - 1] = 0x00,
- [SPECIES_MURKROW - 1] = 0x00,
- [SPECIES_SLOWKING - 1] = 0x00,
- [SPECIES_MISDREAVUS - 1] = 0x00,
- [SPECIES_UNOWN - 1] = 0x00,
- [SPECIES_WOBBUFFET - 1] = 0x00,
- [SPECIES_GIRAFARIG - 1] = 0x00,
- [SPECIES_PINECO - 1] = 0x00,
- [SPECIES_FORRETRESS - 1] = 0x00,
[SPECIES_DUNSPARCE - 1] = 0x0a,
- [SPECIES_GLIGAR - 1] = 0x00,
[SPECIES_STEELIX - 1] = 0x2d,
- [SPECIES_SNUBBULL - 1] = 0x00,
- [SPECIES_GRANBULL - 1] = 0x00,
[SPECIES_QWILFISH - 1] = 0x27,
[SPECIES_SCIZOR - 1] = 0x13,
- [SPECIES_SHUCKLE - 1] = 0x00,
- [SPECIES_HERACROSS - 1] = 0x00,
- [SPECIES_SNEASEL - 1] = 0x00,
- [SPECIES_TEDDIURSA - 1] = 0x00,
- [SPECIES_URSARING - 1] = 0x00,
- [SPECIES_SLUGMA - 1] = 0x00,
- [SPECIES_MAGCARGO - 1] = 0x00,
- [SPECIES_SWINUB - 1] = 0x00,
- [SPECIES_PILOSWINE - 1] = 0x00,
- [SPECIES_CORSOLA - 1] = 0x00,
- [SPECIES_REMORAID - 1] = 0x00,
[SPECIES_OCTILLERY - 1] = 0x14,
- [SPECIES_DELIBIRD - 1] = 0x00,
- [SPECIES_MANTINE - 1] = 0x00,
- [SPECIES_SKARMORY - 1] = 0x00,
- [SPECIES_HOUNDOUR - 1] = 0x00,
- [SPECIES_HOUNDOOM - 1] = 0x00,
- [SPECIES_KINGDRA - 1] = 0x00,
- [SPECIES_PHANPY - 1] = 0x00,
- [SPECIES_DONPHAN - 1] = 0x00,
- [SPECIES_PORYGON2 - 1] = 0x00,
- [SPECIES_STANTLER - 1] = 0x00,
- [SPECIES_SMEARGLE - 1] = 0x00,
- [SPECIES_TYROGUE - 1] = 0x00,
- [SPECIES_HITMONTOP - 1] = 0x00,
[SPECIES_SMOOCHUM - 1] = 0x28,
- [SPECIES_ELEKID - 1] = 0x00,
- [SPECIES_MAGBY - 1] = 0x00,
- [SPECIES_MILTANK - 1] = 0x00,
- [SPECIES_BLISSEY - 1] = 0x00,
- [SPECIES_RAIKOU - 1] = 0x00,
- [SPECIES_ENTEI - 1] = 0x00,
- [SPECIES_SUICUNE - 1] = 0x00,
- [SPECIES_LARVITAR - 1] = 0x00,
- [SPECIES_PUPITAR - 1] = 0x00,
[SPECIES_TYRANITAR - 1] = 0x0a,
[SPECIES_LUGIA - 1] = 0x14,
- [SPECIES_HO_OH - 1] = 0x00,
- [SPECIES_CELEBI - 1] = 0x00,
- [SPECIES_OLD_UNOWN_B - 1] = 0x00,
- [SPECIES_OLD_UNOWN_C - 1] = 0x00,
- [SPECIES_OLD_UNOWN_D - 1] = 0x00,
- [SPECIES_OLD_UNOWN_E - 1] = 0x00,
- [SPECIES_OLD_UNOWN_F - 1] = 0x00,
- [SPECIES_OLD_UNOWN_G - 1] = 0x00,
- [SPECIES_OLD_UNOWN_H - 1] = 0x00,
- [SPECIES_OLD_UNOWN_I - 1] = 0x00,
- [SPECIES_OLD_UNOWN_J - 1] = 0x00,
- [SPECIES_OLD_UNOWN_K - 1] = 0x00,
- [SPECIES_OLD_UNOWN_L - 1] = 0x00,
- [SPECIES_OLD_UNOWN_M - 1] = 0x00,
- [SPECIES_OLD_UNOWN_N - 1] = 0x00,
- [SPECIES_OLD_UNOWN_O - 1] = 0x00,
- [SPECIES_OLD_UNOWN_P - 1] = 0x00,
- [SPECIES_OLD_UNOWN_Q - 1] = 0x00,
- [SPECIES_OLD_UNOWN_R - 1] = 0x00,
- [SPECIES_OLD_UNOWN_S - 1] = 0x00,
- [SPECIES_OLD_UNOWN_T - 1] = 0x00,
- [SPECIES_OLD_UNOWN_U - 1] = 0x00,
- [SPECIES_OLD_UNOWN_V - 1] = 0x00,
- [SPECIES_OLD_UNOWN_W - 1] = 0x00,
- [SPECIES_OLD_UNOWN_X - 1] = 0x00,
- [SPECIES_OLD_UNOWN_Y - 1] = 0x00,
- [SPECIES_OLD_UNOWN_Z - 1] = 0x00,
- [SPECIES_TREECKO - 1] = 0x00,
- [SPECIES_GROVYLE - 1] = 0x00,
- [SPECIES_SCEPTILE - 1] = 0x00,
- [SPECIES_TORCHIC - 1] = 0x00,
- [SPECIES_COMBUSKEN - 1] = 0x00,
- [SPECIES_BLAZIKEN - 1] = 0x00,
- [SPECIES_MUDKIP - 1] = 0x00,
- [SPECIES_MARSHTOMP - 1] = 0x00,
- [SPECIES_SWAMPERT - 1] = 0x00,
- [SPECIES_POOCHYENA - 1] = 0x00,
- [SPECIES_MIGHTYENA - 1] = 0x00,
- [SPECIES_ZIGZAGOON - 1] = 0x00,
- [SPECIES_LINOONE - 1] = 0x00,
- [SPECIES_WURMPLE - 1] = 0x00,
- [SPECIES_SILCOON - 1] = 0x00,
- [SPECIES_BEAUTIFLY - 1] = 0x00,
- [SPECIES_CASCOON - 1] = 0x00,
- [SPECIES_DUSTOX - 1] = 0x00,
- [SPECIES_LOTAD - 1] = 0x00,
- [SPECIES_LOMBRE - 1] = 0x00,
- [SPECIES_LUDICOLO - 1] = 0x00,
- [SPECIES_SEEDOT - 1] = 0x00,
- [SPECIES_NUZLEAF - 1] = 0x00,
- [SPECIES_SHIFTRY - 1] = 0x00,
- [SPECIES_NINCADA - 1] = 0x00,
- [SPECIES_NINJASK - 1] = 0x00,
- [SPECIES_SHEDINJA - 1] = 0x00,
- [SPECIES_TAILLOW - 1] = 0x00,
- [SPECIES_SWELLOW - 1] = 0x00,
- [SPECIES_SHROOMISH - 1] = 0x00,
- [SPECIES_BRELOOM - 1] = 0x00,
- [SPECIES_SPINDA - 1] = 0x00,
- [SPECIES_WINGULL - 1] = 0x00,
- [SPECIES_PELIPPER - 1] = 0x00,
- [SPECIES_SURSKIT - 1] = 0x00,
- [SPECIES_MASQUERAIN - 1] = 0x00,
- [SPECIES_WAILMER - 1] = 0x00,
[SPECIES_WAILORD - 1] = 0x0a,
- [SPECIES_SKITTY - 1] = 0x00,
- [SPECIES_DELCATTY - 1] = 0x00,
[SPECIES_KECLEON - 1] = 0x1e,
- [SPECIES_BALTOY - 1] = 0x00,
- [SPECIES_CLAYDOL - 1] = 0x00,
- [SPECIES_NOSEPASS - 1] = 0x00,
- [SPECIES_TORKOAL - 1] = 0x00,
- [SPECIES_SABLEYE - 1] = 0x00,
- [SPECIES_BARBOACH - 1] = 0x00,
- [SPECIES_WHISCASH - 1] = 0x00,
- [SPECIES_LUVDISC - 1] = 0x00,
- [SPECIES_CORPHISH - 1] = 0x00,
- [SPECIES_CRAWDAUNT - 1] = 0x00,
- [SPECIES_FEEBAS - 1] = 0x00,
[SPECIES_MILOTIC - 1] = 0x2d,
- [SPECIES_CARVANHA - 1] = 0x00,
- [SPECIES_SHARPEDO - 1] = 0x00,
- [SPECIES_TRAPINCH - 1] = 0x00,
- [SPECIES_VIBRAVA - 1] = 0x00,
- [SPECIES_FLYGON - 1] = 0x00,
- [SPECIES_MAKUHITA - 1] = 0x00,
- [SPECIES_HARIYAMA - 1] = 0x00,
- [SPECIES_ELECTRIKE - 1] = 0x00,
- [SPECIES_MANECTRIC - 1] = 0x00,
- [SPECIES_NUMEL - 1] = 0x00,
- [SPECIES_CAMERUPT - 1] = 0x00,
[SPECIES_SPHEAL - 1] = 0x0f,
- [SPECIES_SEALEO - 1] = 0x00,
- [SPECIES_WALREIN - 1] = 0x00,
- [SPECIES_CACNEA - 1] = 0x00,
- [SPECIES_CACTURNE - 1] = 0x00,
[SPECIES_SNORUNT - 1] = 0x14,
- [SPECIES_GLALIE - 1] = 0x00,
- [SPECIES_LUNATONE - 1] = 0x00,
- [SPECIES_SOLROCK - 1] = 0x00,
- [SPECIES_AZURILL - 1] = 0x00,
- [SPECIES_SPOINK - 1] = 0x00,
[SPECIES_GRUMPIG - 1] = 0x0f,
- [SPECIES_PLUSLE - 1] = 0x00,
- [SPECIES_MINUN - 1] = 0x00,
- [SPECIES_MAWILE - 1] = 0x00,
- [SPECIES_MEDITITE - 1] = 0x00,
- [SPECIES_MEDICHAM - 1] = 0x00,
- [SPECIES_SWABLU - 1] = 0x00,
- [SPECIES_ALTARIA - 1] = 0x00,
[SPECIES_WYNAUT - 1] = 0x0f,
- [SPECIES_DUSKULL - 1] = 0x00,
[SPECIES_DUSCLOPS - 1] = 0x1e,
- [SPECIES_ROSELIA - 1] = 0x00,
- [SPECIES_SLAKOTH - 1] = 0x00,
- [SPECIES_VIGOROTH - 1] = 0x00,
- [SPECIES_SLAKING - 1] = 0x00,
- [SPECIES_GULPIN - 1] = 0x00,
- [SPECIES_SWALOT - 1] = 0x00,
- [SPECIES_TROPIUS - 1] = 0x00,
- [SPECIES_WHISMUR - 1] = 0x00,
- [SPECIES_LOUDRED - 1] = 0x00,
- [SPECIES_EXPLOUD - 1] = 0x00,
- [SPECIES_CLAMPERL - 1] = 0x00,
- [SPECIES_HUNTAIL - 1] = 0x00,
- [SPECIES_GOREBYSS - 1] = 0x00,
[SPECIES_ABSOL - 1] = 0x2d,
- [SPECIES_SHUPPET - 1] = 0x00,
- [SPECIES_BANETTE - 1] = 0x00,
- [SPECIES_SEVIPER - 1] = 0x00,
- [SPECIES_ZANGOOSE - 1] = 0x00,
- [SPECIES_RELICANTH - 1] = 0x00,
- [SPECIES_ARON - 1] = 0x00,
- [SPECIES_LAIRON - 1] = 0x00,
- [SPECIES_AGGRON - 1] = 0x00,
- [SPECIES_CASTFORM - 1] = 0x00,
- [SPECIES_VOLBEAT - 1] = 0x00,
- [SPECIES_ILLUMISE - 1] = 0x00,
- [SPECIES_LILEEP - 1] = 0x00,
- [SPECIES_CRADILY - 1] = 0x00,
- [SPECIES_ANORITH - 1] = 0x00,
- [SPECIES_ARMALDO - 1] = 0x00,
- [SPECIES_RALTS - 1] = 0x00,
- [SPECIES_KIRLIA - 1] = 0x00,
- [SPECIES_GARDEVOIR - 1] = 0x00,
- [SPECIES_BAGON - 1] = 0x00,
- [SPECIES_SHELGON - 1] = 0x00,
[SPECIES_SALAMENCE - 1] = 0x46,
- [SPECIES_BELDUM - 1] = 0x00,
- [SPECIES_METANG - 1] = 0x00,
- [SPECIES_METAGROSS - 1] = 0x00,
- [SPECIES_REGIROCK - 1] = 0x00,
- [SPECIES_REGICE - 1] = 0x00,
- [SPECIES_REGISTEEL - 1] = 0x00,
[SPECIES_KYOGRE - 1] = 0x3c,
- [SPECIES_GROUDON - 1] = 0x00,
[SPECIES_RAYQUAZA - 1] = 0x3c,
- [SPECIES_LATIAS - 1] = 0x00,
- [SPECIES_LATIOS - 1] = 0x00,
- [SPECIES_JIRACHI - 1] = 0x00,
- [SPECIES_DEOXYS - 1] = 0x00,
- [SPECIES_CHIMECHO - 1] = 0x00,
};
const u8 gPPUpGetMask[] = {0x03, 0x0c, 0x30, 0xc0}; // Masks for getting PP Up count, also PP Max values
diff --git a/src/pokemon_icon.c b/src/pokemon_icon.c
index 4ff182a0e..6a135875e 100644
--- a/src/pokemon_icon.c
+++ b/src/pokemon_icon.c
@@ -25,446 +25,446 @@ static u8 CreateMonIconSprite(struct MonIconSpriteTemplate *, s16, s16, u8);
const u8 *const gMonIconTable[] =
{
- gMonIcon_Bulbasaur,
- gMonIcon_Bulbasaur,
- gMonIcon_Ivysaur,
- gMonIcon_Venusaur,
- gMonIcon_Charmander,
- gMonIcon_Charmeleon,
- gMonIcon_Charizard,
- gMonIcon_Squirtle,
- gMonIcon_Wartortle,
- gMonIcon_Blastoise,
- gMonIcon_Caterpie,
- gMonIcon_Metapod,
- gMonIcon_Butterfree,
- gMonIcon_Weedle,
- gMonIcon_Kakuna,
- gMonIcon_Beedrill,
- gMonIcon_Pidgey,
- gMonIcon_Pidgeotto,
- gMonIcon_Pidgeot,
- gMonIcon_Rattata,
- gMonIcon_Raticate,
- gMonIcon_Spearow,
- gMonIcon_Fearow,
- gMonIcon_Ekans,
- gMonIcon_Arbok,
- gMonIcon_Pikachu,
- gMonIcon_Raichu,
- gMonIcon_Sandshrew,
- gMonIcon_Sandslash,
- gMonIcon_NidoranF,
- gMonIcon_Nidorina,
- gMonIcon_Nidoqueen,
- gMonIcon_NidoranM,
- gMonIcon_Nidorino,
- gMonIcon_Nidoking,
- gMonIcon_Clefairy,
- gMonIcon_Clefable,
- gMonIcon_Vulpix,
- gMonIcon_Ninetales,
- gMonIcon_Jigglypuff,
- gMonIcon_Wigglytuff,
- gMonIcon_Zubat,
- gMonIcon_Golbat,
- gMonIcon_Oddish,
- gMonIcon_Gloom,
- gMonIcon_Vileplume,
- gMonIcon_Paras,
- gMonIcon_Parasect,
- gMonIcon_Venonat,
- gMonIcon_Venomoth,
- gMonIcon_Diglett,
- gMonIcon_Dugtrio,
- gMonIcon_Meowth,
- gMonIcon_Persian,
- gMonIcon_Psyduck,
- gMonIcon_Golduck,
- gMonIcon_Mankey,
- gMonIcon_Primeape,
- gMonIcon_Growlithe,
- gMonIcon_Arcanine,
- gMonIcon_Poliwag,
- gMonIcon_Poliwhirl,
- gMonIcon_Poliwrath,
- gMonIcon_Abra,
- gMonIcon_Kadabra,
- gMonIcon_Alakazam,
- gMonIcon_Machop,
- gMonIcon_Machoke,
- gMonIcon_Machamp,
- gMonIcon_Bellsprout,
- gMonIcon_Weepinbell,
- gMonIcon_Victreebel,
- gMonIcon_Tentacool,
- gMonIcon_Tentacruel,
- gMonIcon_Geodude,
- gMonIcon_Graveler,
- gMonIcon_Golem,
- gMonIcon_Ponyta,
- gMonIcon_Rapidash,
- gMonIcon_Slowpoke,
- gMonIcon_Slowbro,
- gMonIcon_Magnemite,
- gMonIcon_Magneton,
- gMonIcon_Farfetchd,
- gMonIcon_Doduo,
- gMonIcon_Dodrio,
- gMonIcon_Seel,
- gMonIcon_Dewgong,
- gMonIcon_Grimer,
- gMonIcon_Muk,
- gMonIcon_Shellder,
- gMonIcon_Cloyster,
- gMonIcon_Gastly,
- gMonIcon_Haunter,
- gMonIcon_Gengar,
- gMonIcon_Onix,
- gMonIcon_Drowzee,
- gMonIcon_Hypno,
- gMonIcon_Krabby,
- gMonIcon_Kingler,
- gMonIcon_Voltorb,
- gMonIcon_Electrode,
- gMonIcon_Exeggcute,
- gMonIcon_Exeggutor,
- gMonIcon_Cubone,
- gMonIcon_Marowak,
- gMonIcon_Hitmonlee,
- gMonIcon_Hitmonchan,
- gMonIcon_Lickitung,
- gMonIcon_Koffing,
- gMonIcon_Weezing,
- gMonIcon_Rhyhorn,
- gMonIcon_Rhydon,
- gMonIcon_Chansey,
- gMonIcon_Tangela,
- gMonIcon_Kangaskhan,
- gMonIcon_Horsea,
- gMonIcon_Seadra,
- gMonIcon_Goldeen,
- gMonIcon_Seaking,
- gMonIcon_Staryu,
- gMonIcon_Starmie,
- gMonIcon_Mrmime,
- gMonIcon_Scyther,
- gMonIcon_Jynx,
- gMonIcon_Electabuzz,
- gMonIcon_Magmar,
- gMonIcon_Pinsir,
- gMonIcon_Tauros,
- gMonIcon_Magikarp,
- gMonIcon_Gyarados,
- gMonIcon_Lapras,
- gMonIcon_Ditto,
- gMonIcon_Eevee,
- gMonIcon_Vaporeon,
- gMonIcon_Jolteon,
- gMonIcon_Flareon,
- gMonIcon_Porygon,
- gMonIcon_Omanyte,
- gMonIcon_Omastar,
- gMonIcon_Kabuto,
- gMonIcon_Kabutops,
- gMonIcon_Aerodactyl,
- gMonIcon_Snorlax,
- gMonIcon_Articuno,
- gMonIcon_Zapdos,
- gMonIcon_Moltres,
- gMonIcon_Dratini,
- gMonIcon_Dragonair,
- gMonIcon_Dragonite,
- gMonIcon_Mewtwo,
- gMonIcon_Mew,
- gMonIcon_Chikorita,
- gMonIcon_Bayleef,
- gMonIcon_Meganium,
- gMonIcon_Cyndaquil,
- gMonIcon_Quilava,
- gMonIcon_Typhlosion,
- gMonIcon_Totodile,
- gMonIcon_Croconaw,
- gMonIcon_Feraligatr,
- gMonIcon_Sentret,
- gMonIcon_Furret,
- gMonIcon_Hoothoot,
- gMonIcon_Noctowl,
- gMonIcon_Ledyba,
- gMonIcon_Ledian,
- gMonIcon_Spinarak,
- gMonIcon_Ariados,
- gMonIcon_Crobat,
- gMonIcon_Chinchou,
- gMonIcon_Lanturn,
- gMonIcon_Pichu,
- gMonIcon_Cleffa,
- gMonIcon_Igglybuff,
- gMonIcon_Togepi,
- gMonIcon_Togetic,
- gMonIcon_Natu,
- gMonIcon_Xatu,
- gMonIcon_Mareep,
- gMonIcon_Flaaffy,
- gMonIcon_Ampharos,
- gMonIcon_Bellossom,
- gMonIcon_Marill,
- gMonIcon_Azumarill,
- gMonIcon_Sudowoodo,
- gMonIcon_Politoed,
- gMonIcon_Hoppip,
- gMonIcon_Skiploom,
- gMonIcon_Jumpluff,
- gMonIcon_Aipom,
- gMonIcon_Sunkern,
- gMonIcon_Sunflora,
- gMonIcon_Yanma,
- gMonIcon_Wooper,
- gMonIcon_Quagsire,
- gMonIcon_Espeon,
- gMonIcon_Umbreon,
- gMonIcon_Murkrow,
- gMonIcon_Slowking,
- gMonIcon_Misdreavus,
- gMonIcon_UnownA,
- gMonIcon_Wobbuffet,
- gMonIcon_Girafarig,
- gMonIcon_Pineco,
- gMonIcon_Forretress,
- gMonIcon_Dunsparce,
- gMonIcon_Gligar,
- gMonIcon_Steelix,
- gMonIcon_Snubbull,
- gMonIcon_Granbull,
- gMonIcon_Qwilfish,
- gMonIcon_Scizor,
- gMonIcon_Shuckle,
- gMonIcon_Heracross,
- gMonIcon_Sneasel,
- gMonIcon_Teddiursa,
- gMonIcon_Ursaring,
- gMonIcon_Slugma,
- gMonIcon_Magcargo,
- gMonIcon_Swinub,
- gMonIcon_Piloswine,
- gMonIcon_Corsola,
- gMonIcon_Remoraid,
- gMonIcon_Octillery,
- gMonIcon_Delibird,
- gMonIcon_Mantine,
- gMonIcon_Skarmory,
- gMonIcon_Houndour,
- gMonIcon_Houndoom,
- gMonIcon_Kingdra,
- gMonIcon_Phanpy,
- gMonIcon_Donphan,
- gMonIcon_Porygon2,
- gMonIcon_Stantler,
- gMonIcon_Smeargle,
- gMonIcon_Tyrogue,
- gMonIcon_Hitmontop,
- gMonIcon_Smoochum,
- gMonIcon_Elekid,
- gMonIcon_Magby,
- gMonIcon_Miltank,
- gMonIcon_Blissey,
- gMonIcon_Raikou,
- gMonIcon_Entei,
- gMonIcon_Suicune,
- gMonIcon_Larvitar,
- gMonIcon_Pupitar,
- gMonIcon_Tyranitar,
- gMonIcon_Lugia,
- gMonIcon_HoOh,
- gMonIcon_Celebi,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_QuestionMark,
- gMonIcon_Treecko,
- gMonIcon_Grovyle,
- gMonIcon_Sceptile,
- gMonIcon_Torchic,
- gMonIcon_Combusken,
- gMonIcon_Blaziken,
- gMonIcon_Mudkip,
- gMonIcon_Marshtomp,
- gMonIcon_Swampert,
- gMonIcon_Poochyena,
- gMonIcon_Mightyena,
- gMonIcon_Zigzagoon,
- gMonIcon_Linoone,
- gMonIcon_Wurmple,
- gMonIcon_Silcoon,
- gMonIcon_Beautifly,
- gMonIcon_Cascoon,
- gMonIcon_Dustox,
- gMonIcon_Lotad,
- gMonIcon_Lombre,
- gMonIcon_Ludicolo,
- gMonIcon_Seedot,
- gMonIcon_Nuzleaf,
- gMonIcon_Shiftry,
- gMonIcon_Nincada,
- gMonIcon_Ninjask,
- gMonIcon_Shedinja,
- gMonIcon_Taillow,
- gMonIcon_Swellow,
- gMonIcon_Shroomish,
- gMonIcon_Breloom,
- gMonIcon_Spinda,
- gMonIcon_Wingull,
- gMonIcon_Pelipper,
- gMonIcon_Surskit,
- gMonIcon_Masquerain,
- gMonIcon_Wailmer,
- gMonIcon_Wailord,
- gMonIcon_Skitty,
- gMonIcon_Delcatty,
- gMonIcon_Kecleon,
- gMonIcon_Baltoy,
- gMonIcon_Claydol,
- gMonIcon_Nosepass,
- gMonIcon_Torkoal,
- gMonIcon_Sableye,
- gMonIcon_Barboach,
- gMonIcon_Whiscash,
- gMonIcon_Luvdisc,
- gMonIcon_Corphish,
- gMonIcon_Crawdaunt,
- gMonIcon_Feebas,
- gMonIcon_Milotic,
- gMonIcon_Carvanha,
- gMonIcon_Sharpedo,
- gMonIcon_Trapinch,
- gMonIcon_Vibrava,
- gMonIcon_Flygon,
- gMonIcon_Makuhita,
- gMonIcon_Hariyama,
- gMonIcon_Electrike,
- gMonIcon_Manectric,
- gMonIcon_Numel,
- gMonIcon_Camerupt,
- gMonIcon_Spheal,
- gMonIcon_Sealeo,
- gMonIcon_Walrein,
- gMonIcon_Cacnea,
- gMonIcon_Cacturne,
- gMonIcon_Snorunt,
- gMonIcon_Glalie,
- gMonIcon_Lunatone,
- gMonIcon_Solrock,
- gMonIcon_Azurill,
- gMonIcon_Spoink,
- gMonIcon_Grumpig,
- gMonIcon_Plusle,
- gMonIcon_Minun,
- gMonIcon_Mawile,
- gMonIcon_Meditite,
- gMonIcon_Medicham,
- gMonIcon_Swablu,
- gMonIcon_Altaria,
- gMonIcon_Wynaut,
- gMonIcon_Duskull,
- gMonIcon_Dusclops,
- gMonIcon_Roselia,
- gMonIcon_Slakoth,
- gMonIcon_Vigoroth,
- gMonIcon_Slaking,
- gMonIcon_Gulpin,
- gMonIcon_Swalot,
- gMonIcon_Tropius,
- gMonIcon_Whismur,
- gMonIcon_Loudred,
- gMonIcon_Exploud,
- gMonIcon_Clamperl,
- gMonIcon_Huntail,
- gMonIcon_Gorebyss,
- gMonIcon_Absol,
- gMonIcon_Shuppet,
- gMonIcon_Banette,
- gMonIcon_Seviper,
- gMonIcon_Zangoose,
- gMonIcon_Relicanth,
- gMonIcon_Aron,
- gMonIcon_Lairon,
- gMonIcon_Aggron,
- gMonIcon_Castform,
- gMonIcon_Volbeat,
- gMonIcon_Illumise,
- gMonIcon_Lileep,
- gMonIcon_Cradily,
- gMonIcon_Anorith,
- gMonIcon_Armaldo,
- gMonIcon_Ralts,
- gMonIcon_Kirlia,
- gMonIcon_Gardevoir,
- gMonIcon_Bagon,
- gMonIcon_Shelgon,
- gMonIcon_Salamence,
- gMonIcon_Beldum,
- gMonIcon_Metang,
- gMonIcon_Metagross,
- gMonIcon_Regirock,
- gMonIcon_Regice,
- gMonIcon_Registeel,
- gMonIcon_Kyogre,
- gMonIcon_Groudon,
- gMonIcon_Rayquaza,
- gMonIcon_Latias,
- gMonIcon_Latios,
- gMonIcon_Jirachi,
- gMonIcon_Deoxys,
- gMonIcon_Chimecho,
- gMonIcon_Egg,
- gMonIcon_UnownB,
- gMonIcon_UnownC,
- gMonIcon_UnownD,
- gMonIcon_UnownE,
- gMonIcon_UnownF,
- gMonIcon_UnownG,
- gMonIcon_UnownH,
- gMonIcon_UnownI,
- gMonIcon_UnownJ,
- gMonIcon_UnownK,
- gMonIcon_UnownL,
- gMonIcon_UnownM,
- gMonIcon_UnownN,
- gMonIcon_UnownO,
- gMonIcon_UnownP,
- gMonIcon_UnownQ,
- gMonIcon_UnownR,
- gMonIcon_UnownS,
- gMonIcon_UnownT,
- gMonIcon_UnownU,
- gMonIcon_UnownV,
- gMonIcon_UnownW,
- gMonIcon_UnownX,
- gMonIcon_UnownY,
- gMonIcon_UnownZ,
- gMonIcon_UnownExclamationMark,
- gMonIcon_UnownQuestionMark,
+ [SPECIES_NONE] = gMonIcon_Bulbasaur,
+ [SPECIES_BULBASAUR] = gMonIcon_Bulbasaur,
+ [SPECIES_IVYSAUR] = gMonIcon_Ivysaur,
+ [SPECIES_VENUSAUR] = gMonIcon_Venusaur,
+ [SPECIES_CHARMANDER] = gMonIcon_Charmander,
+ [SPECIES_CHARMELEON] = gMonIcon_Charmeleon,
+ [SPECIES_CHARIZARD] = gMonIcon_Charizard,
+ [SPECIES_SQUIRTLE] = gMonIcon_Squirtle,
+ [SPECIES_WARTORTLE] = gMonIcon_Wartortle,
+ [SPECIES_BLASTOISE] = gMonIcon_Blastoise,
+ [SPECIES_CATERPIE] = gMonIcon_Caterpie,
+ [SPECIES_METAPOD] = gMonIcon_Metapod,
+ [SPECIES_BUTTERFREE] = gMonIcon_Butterfree,
+ [SPECIES_WEEDLE] = gMonIcon_Weedle,
+ [SPECIES_KAKUNA] = gMonIcon_Kakuna,
+ [SPECIES_BEEDRILL] = gMonIcon_Beedrill,
+ [SPECIES_PIDGEY] = gMonIcon_Pidgey,
+ [SPECIES_PIDGEOTTO] = gMonIcon_Pidgeotto,
+ [SPECIES_PIDGEOT] = gMonIcon_Pidgeot,
+ [SPECIES_RATTATA] = gMonIcon_Rattata,
+ [SPECIES_RATICATE] = gMonIcon_Raticate,
+ [SPECIES_SPEAROW] = gMonIcon_Spearow,
+ [SPECIES_FEAROW] = gMonIcon_Fearow,
+ [SPECIES_EKANS] = gMonIcon_Ekans,
+ [SPECIES_ARBOK] = gMonIcon_Arbok,
+ [SPECIES_PIKACHU] = gMonIcon_Pikachu,
+ [SPECIES_RAICHU] = gMonIcon_Raichu,
+ [SPECIES_SANDSHREW] = gMonIcon_Sandshrew,
+ [SPECIES_SANDSLASH] = gMonIcon_Sandslash,
+ [SPECIES_NIDORAN_F] = gMonIcon_NidoranF,
+ [SPECIES_NIDORINA] = gMonIcon_Nidorina,
+ [SPECIES_NIDOQUEEN] = gMonIcon_Nidoqueen,
+ [SPECIES_NIDORAN_M] = gMonIcon_NidoranM,
+ [SPECIES_NIDORINO] = gMonIcon_Nidorino,
+ [SPECIES_NIDOKING] = gMonIcon_Nidoking,
+ [SPECIES_CLEFAIRY] = gMonIcon_Clefairy,
+ [SPECIES_CLEFABLE] = gMonIcon_Clefable,
+ [SPECIES_VULPIX] = gMonIcon_Vulpix,
+ [SPECIES_NINETALES] = gMonIcon_Ninetales,
+ [SPECIES_JIGGLYPUFF] = gMonIcon_Jigglypuff,
+ [SPECIES_WIGGLYTUFF] = gMonIcon_Wigglytuff,
+ [SPECIES_ZUBAT] = gMonIcon_Zubat,
+ [SPECIES_GOLBAT] = gMonIcon_Golbat,
+ [SPECIES_ODDISH] = gMonIcon_Oddish,
+ [SPECIES_GLOOM] = gMonIcon_Gloom,
+ [SPECIES_VILEPLUME] = gMonIcon_Vileplume,
+ [SPECIES_PARAS] = gMonIcon_Paras,
+ [SPECIES_PARASECT] = gMonIcon_Parasect,
+ [SPECIES_VENONAT] = gMonIcon_Venonat,
+ [SPECIES_VENOMOTH] = gMonIcon_Venomoth,
+ [SPECIES_DIGLETT] = gMonIcon_Diglett,
+ [SPECIES_DUGTRIO] = gMonIcon_Dugtrio,
+ [SPECIES_MEOWTH] = gMonIcon_Meowth,
+ [SPECIES_PERSIAN] = gMonIcon_Persian,
+ [SPECIES_PSYDUCK] = gMonIcon_Psyduck,
+ [SPECIES_GOLDUCK] = gMonIcon_Golduck,
+ [SPECIES_MANKEY] = gMonIcon_Mankey,
+ [SPECIES_PRIMEAPE] = gMonIcon_Primeape,
+ [SPECIES_GROWLITHE] = gMonIcon_Growlithe,
+ [SPECIES_ARCANINE] = gMonIcon_Arcanine,
+ [SPECIES_POLIWAG] = gMonIcon_Poliwag,
+ [SPECIES_POLIWHIRL] = gMonIcon_Poliwhirl,
+ [SPECIES_POLIWRATH] = gMonIcon_Poliwrath,
+ [SPECIES_ABRA] = gMonIcon_Abra,
+ [SPECIES_KADABRA] = gMonIcon_Kadabra,
+ [SPECIES_ALAKAZAM] = gMonIcon_Alakazam,
+ [SPECIES_MACHOP] = gMonIcon_Machop,
+ [SPECIES_MACHOKE] = gMonIcon_Machoke,
+ [SPECIES_MACHAMP] = gMonIcon_Machamp,
+ [SPECIES_BELLSPROUT] = gMonIcon_Bellsprout,
+ [SPECIES_WEEPINBELL] = gMonIcon_Weepinbell,
+ [SPECIES_VICTREEBEL] = gMonIcon_Victreebel,
+ [SPECIES_TENTACOOL] = gMonIcon_Tentacool,
+ [SPECIES_TENTACRUEL] = gMonIcon_Tentacruel,
+ [SPECIES_GEODUDE] = gMonIcon_Geodude,
+ [SPECIES_GRAVELER] = gMonIcon_Graveler,
+ [SPECIES_GOLEM] = gMonIcon_Golem,
+ [SPECIES_PONYTA] = gMonIcon_Ponyta,
+ [SPECIES_RAPIDASH] = gMonIcon_Rapidash,
+ [SPECIES_SLOWPOKE] = gMonIcon_Slowpoke,
+ [SPECIES_SLOWBRO] = gMonIcon_Slowbro,
+ [SPECIES_MAGNEMITE] = gMonIcon_Magnemite,
+ [SPECIES_MAGNETON] = gMonIcon_Magneton,
+ [SPECIES_FARFETCHD] = gMonIcon_Farfetchd,
+ [SPECIES_DODUO] = gMonIcon_Doduo,
+ [SPECIES_DODRIO] = gMonIcon_Dodrio,
+ [SPECIES_SEEL] = gMonIcon_Seel,
+ [SPECIES_DEWGONG] = gMonIcon_Dewgong,
+ [SPECIES_GRIMER] = gMonIcon_Grimer,
+ [SPECIES_MUK] = gMonIcon_Muk,
+ [SPECIES_SHELLDER] = gMonIcon_Shellder,
+ [SPECIES_CLOYSTER] = gMonIcon_Cloyster,
+ [SPECIES_GASTLY] = gMonIcon_Gastly,
+ [SPECIES_HAUNTER] = gMonIcon_Haunter,
+ [SPECIES_GENGAR] = gMonIcon_Gengar,
+ [SPECIES_ONIX] = gMonIcon_Onix,
+ [SPECIES_DROWZEE] = gMonIcon_Drowzee,
+ [SPECIES_HYPNO] = gMonIcon_Hypno,
+ [SPECIES_KRABBY] = gMonIcon_Krabby,
+ [SPECIES_KINGLER] = gMonIcon_Kingler,
+ [SPECIES_VOLTORB] = gMonIcon_Voltorb,
+ [SPECIES_ELECTRODE] = gMonIcon_Electrode,
+ [SPECIES_EXEGGCUTE] = gMonIcon_Exeggcute,
+ [SPECIES_EXEGGUTOR] = gMonIcon_Exeggutor,
+ [SPECIES_CUBONE] = gMonIcon_Cubone,
+ [SPECIES_MAROWAK] = gMonIcon_Marowak,
+ [SPECIES_HITMONLEE] = gMonIcon_Hitmonlee,
+ [SPECIES_HITMONCHAN] = gMonIcon_Hitmonchan,
+ [SPECIES_LICKITUNG] = gMonIcon_Lickitung,
+ [SPECIES_KOFFING] = gMonIcon_Koffing,
+ [SPECIES_WEEZING] = gMonIcon_Weezing,
+ [SPECIES_RHYHORN] = gMonIcon_Rhyhorn,
+ [SPECIES_RHYDON] = gMonIcon_Rhydon,
+ [SPECIES_CHANSEY] = gMonIcon_Chansey,
+ [SPECIES_TANGELA] = gMonIcon_Tangela,
+ [SPECIES_KANGASKHAN] = gMonIcon_Kangaskhan,
+ [SPECIES_HORSEA] = gMonIcon_Horsea,
+ [SPECIES_SEADRA] = gMonIcon_Seadra,
+ [SPECIES_GOLDEEN] = gMonIcon_Goldeen,
+ [SPECIES_SEAKING] = gMonIcon_Seaking,
+ [SPECIES_STARYU] = gMonIcon_Staryu,
+ [SPECIES_STARMIE] = gMonIcon_Starmie,
+ [SPECIES_MR_MIME] = gMonIcon_Mrmime,
+ [SPECIES_SCYTHER] = gMonIcon_Scyther,
+ [SPECIES_JYNX] = gMonIcon_Jynx,
+ [SPECIES_ELECTABUZZ] = gMonIcon_Electabuzz,
+ [SPECIES_MAGMAR] = gMonIcon_Magmar,
+ [SPECIES_PINSIR] = gMonIcon_Pinsir,
+ [SPECIES_TAUROS] = gMonIcon_Tauros,
+ [SPECIES_MAGIKARP] = gMonIcon_Magikarp,
+ [SPECIES_GYARADOS] = gMonIcon_Gyarados,
+ [SPECIES_LAPRAS] = gMonIcon_Lapras,
+ [SPECIES_DITTO] = gMonIcon_Ditto,
+ [SPECIES_EEVEE] = gMonIcon_Eevee,
+ [SPECIES_VAPOREON] = gMonIcon_Vaporeon,
+ [SPECIES_JOLTEON] = gMonIcon_Jolteon,
+ [SPECIES_FLAREON] = gMonIcon_Flareon,
+ [SPECIES_PORYGON] = gMonIcon_Porygon,
+ [SPECIES_OMANYTE] = gMonIcon_Omanyte,
+ [SPECIES_OMASTAR] = gMonIcon_Omastar,
+ [SPECIES_KABUTO] = gMonIcon_Kabuto,
+ [SPECIES_KABUTOPS] = gMonIcon_Kabutops,
+ [SPECIES_AERODACTYL] = gMonIcon_Aerodactyl,
+ [SPECIES_SNORLAX] = gMonIcon_Snorlax,
+ [SPECIES_ARTICUNO] = gMonIcon_Articuno,
+ [SPECIES_ZAPDOS] = gMonIcon_Zapdos,
+ [SPECIES_MOLTRES] = gMonIcon_Moltres,
+ [SPECIES_DRATINI] = gMonIcon_Dratini,
+ [SPECIES_DRAGONAIR] = gMonIcon_Dragonair,
+ [SPECIES_DRAGONITE] = gMonIcon_Dragonite,
+ [SPECIES_MEWTWO] = gMonIcon_Mewtwo,
+ [SPECIES_MEW] = gMonIcon_Mew,
+ [SPECIES_CHIKORITA] = gMonIcon_Chikorita,
+ [SPECIES_BAYLEEF] = gMonIcon_Bayleef,
+ [SPECIES_MEGANIUM] = gMonIcon_Meganium,
+ [SPECIES_CYNDAQUIL] = gMonIcon_Cyndaquil,
+ [SPECIES_QUILAVA] = gMonIcon_Quilava,
+ [SPECIES_TYPHLOSION] = gMonIcon_Typhlosion,
+ [SPECIES_TOTODILE] = gMonIcon_Totodile,
+ [SPECIES_CROCONAW] = gMonIcon_Croconaw,
+ [SPECIES_FERALIGATR] = gMonIcon_Feraligatr,
+ [SPECIES_SENTRET] = gMonIcon_Sentret,
+ [SPECIES_FURRET] = gMonIcon_Furret,
+ [SPECIES_HOOTHOOT] = gMonIcon_Hoothoot,
+ [SPECIES_NOCTOWL] = gMonIcon_Noctowl,
+ [SPECIES_LEDYBA] = gMonIcon_Ledyba,
+ [SPECIES_LEDIAN] = gMonIcon_Ledian,
+ [SPECIES_SPINARAK] = gMonIcon_Spinarak,
+ [SPECIES_ARIADOS] = gMonIcon_Ariados,
+ [SPECIES_CROBAT] = gMonIcon_Crobat,
+ [SPECIES_CHINCHOU] = gMonIcon_Chinchou,
+ [SPECIES_LANTURN] = gMonIcon_Lanturn,
+ [SPECIES_PICHU] = gMonIcon_Pichu,
+ [SPECIES_CLEFFA] = gMonIcon_Cleffa,
+ [SPECIES_IGGLYBUFF] = gMonIcon_Igglybuff,
+ [SPECIES_TOGEPI] = gMonIcon_Togepi,
+ [SPECIES_TOGETIC] = gMonIcon_Togetic,
+ [SPECIES_NATU] = gMonIcon_Natu,
+ [SPECIES_XATU] = gMonIcon_Xatu,
+ [SPECIES_MAREEP] = gMonIcon_Mareep,
+ [SPECIES_FLAAFFY] = gMonIcon_Flaaffy,
+ [SPECIES_AMPHAROS] = gMonIcon_Ampharos,
+ [SPECIES_BELLOSSOM] = gMonIcon_Bellossom,
+ [SPECIES_MARILL] = gMonIcon_Marill,
+ [SPECIES_AZUMARILL] = gMonIcon_Azumarill,
+ [SPECIES_SUDOWOODO] = gMonIcon_Sudowoodo,
+ [SPECIES_POLITOED] = gMonIcon_Politoed,
+ [SPECIES_HOPPIP] = gMonIcon_Hoppip,
+ [SPECIES_SKIPLOOM] = gMonIcon_Skiploom,
+ [SPECIES_JUMPLUFF] = gMonIcon_Jumpluff,
+ [SPECIES_AIPOM] = gMonIcon_Aipom,
+ [SPECIES_SUNKERN] = gMonIcon_Sunkern,
+ [SPECIES_SUNFLORA] = gMonIcon_Sunflora,
+ [SPECIES_YANMA] = gMonIcon_Yanma,
+ [SPECIES_WOOPER] = gMonIcon_Wooper,
+ [SPECIES_QUAGSIRE] = gMonIcon_Quagsire,
+ [SPECIES_ESPEON] = gMonIcon_Espeon,
+ [SPECIES_UMBREON] = gMonIcon_Umbreon,
+ [SPECIES_MURKROW] = gMonIcon_Murkrow,
+ [SPECIES_SLOWKING] = gMonIcon_Slowking,
+ [SPECIES_MISDREAVUS] = gMonIcon_Misdreavus,
+ [SPECIES_UNOWN] = gMonIcon_UnownA,
+ [SPECIES_WOBBUFFET] = gMonIcon_Wobbuffet,
+ [SPECIES_GIRAFARIG] = gMonIcon_Girafarig,
+ [SPECIES_PINECO] = gMonIcon_Pineco,
+ [SPECIES_FORRETRESS] = gMonIcon_Forretress,
+ [SPECIES_DUNSPARCE] = gMonIcon_Dunsparce,
+ [SPECIES_GLIGAR] = gMonIcon_Gligar,
+ [SPECIES_STEELIX] = gMonIcon_Steelix,
+ [SPECIES_SNUBBULL] = gMonIcon_Snubbull,
+ [SPECIES_GRANBULL] = gMonIcon_Granbull,
+ [SPECIES_QWILFISH] = gMonIcon_Qwilfish,
+ [SPECIES_SCIZOR] = gMonIcon_Scizor,
+ [SPECIES_SHUCKLE] = gMonIcon_Shuckle,
+ [SPECIES_HERACROSS] = gMonIcon_Heracross,
+ [SPECIES_SNEASEL] = gMonIcon_Sneasel,
+ [SPECIES_TEDDIURSA] = gMonIcon_Teddiursa,
+ [SPECIES_URSARING] = gMonIcon_Ursaring,
+ [SPECIES_SLUGMA] = gMonIcon_Slugma,
+ [SPECIES_MAGCARGO] = gMonIcon_Magcargo,
+ [SPECIES_SWINUB] = gMonIcon_Swinub,
+ [SPECIES_PILOSWINE] = gMonIcon_Piloswine,
+ [SPECIES_CORSOLA] = gMonIcon_Corsola,
+ [SPECIES_REMORAID] = gMonIcon_Remoraid,
+ [SPECIES_OCTILLERY] = gMonIcon_Octillery,
+ [SPECIES_DELIBIRD] = gMonIcon_Delibird,
+ [SPECIES_MANTINE] = gMonIcon_Mantine,
+ [SPECIES_SKARMORY] = gMonIcon_Skarmory,
+ [SPECIES_HOUNDOUR] = gMonIcon_Houndour,
+ [SPECIES_HOUNDOOM] = gMonIcon_Houndoom,
+ [SPECIES_KINGDRA] = gMonIcon_Kingdra,
+ [SPECIES_PHANPY] = gMonIcon_Phanpy,
+ [SPECIES_DONPHAN] = gMonIcon_Donphan,
+ [SPECIES_PORYGON2] = gMonIcon_Porygon2,
+ [SPECIES_STANTLER] = gMonIcon_Stantler,
+ [SPECIES_SMEARGLE] = gMonIcon_Smeargle,
+ [SPECIES_TYROGUE] = gMonIcon_Tyrogue,
+ [SPECIES_HITMONTOP] = gMonIcon_Hitmontop,
+ [SPECIES_SMOOCHUM] = gMonIcon_Smoochum,
+ [SPECIES_ELEKID] = gMonIcon_Elekid,
+ [SPECIES_MAGBY] = gMonIcon_Magby,
+ [SPECIES_MILTANK] = gMonIcon_Miltank,
+ [SPECIES_BLISSEY] = gMonIcon_Blissey,
+ [SPECIES_RAIKOU] = gMonIcon_Raikou,
+ [SPECIES_ENTEI] = gMonIcon_Entei,
+ [SPECIES_SUICUNE] = gMonIcon_Suicune,
+ [SPECIES_LARVITAR] = gMonIcon_Larvitar,
+ [SPECIES_PUPITAR] = gMonIcon_Pupitar,
+ [SPECIES_TYRANITAR] = gMonIcon_Tyranitar,
+ [SPECIES_LUGIA] = gMonIcon_Lugia,
+ [SPECIES_HO_OH] = gMonIcon_HoOh,
+ [SPECIES_CELEBI] = gMonIcon_Celebi,
+ [SPECIES_OLD_UNOWN_B] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_C] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_D] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_E] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_F] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_G] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_H] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_I] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_J] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_K] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_L] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_M] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_N] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_O] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_P] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_Q] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_R] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_S] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_T] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_U] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_V] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_W] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_X] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_Y] = gMonIcon_QuestionMark,
+ [SPECIES_OLD_UNOWN_Z] = gMonIcon_QuestionMark,
+ [SPECIES_TREECKO] = gMonIcon_Treecko,
+ [SPECIES_GROVYLE] = gMonIcon_Grovyle,
+ [SPECIES_SCEPTILE] = gMonIcon_Sceptile,
+ [SPECIES_TORCHIC] = gMonIcon_Torchic,
+ [SPECIES_COMBUSKEN] = gMonIcon_Combusken,
+ [SPECIES_BLAZIKEN] = gMonIcon_Blaziken,
+ [SPECIES_MUDKIP] = gMonIcon_Mudkip,
+ [SPECIES_MARSHTOMP] = gMonIcon_Marshtomp,
+ [SPECIES_SWAMPERT] = gMonIcon_Swampert,
+ [SPECIES_POOCHYENA] = gMonIcon_Poochyena,
+ [SPECIES_MIGHTYENA] = gMonIcon_Mightyena,
+ [SPECIES_ZIGZAGOON] = gMonIcon_Zigzagoon,
+ [SPECIES_LINOONE] = gMonIcon_Linoone,
+ [SPECIES_WURMPLE] = gMonIcon_Wurmple,
+ [SPECIES_SILCOON] = gMonIcon_Silcoon,
+ [SPECIES_BEAUTIFLY] = gMonIcon_Beautifly,
+ [SPECIES_CASCOON] = gMonIcon_Cascoon,
+ [SPECIES_DUSTOX] = gMonIcon_Dustox,
+ [SPECIES_LOTAD] = gMonIcon_Lotad,
+ [SPECIES_LOMBRE] = gMonIcon_Lombre,
+ [SPECIES_LUDICOLO] = gMonIcon_Ludicolo,
+ [SPECIES_SEEDOT] = gMonIcon_Seedot,
+ [SPECIES_NUZLEAF] = gMonIcon_Nuzleaf,
+ [SPECIES_SHIFTRY] = gMonIcon_Shiftry,
+ [SPECIES_NINCADA] = gMonIcon_Nincada,
+ [SPECIES_NINJASK] = gMonIcon_Ninjask,
+ [SPECIES_SHEDINJA] = gMonIcon_Shedinja,
+ [SPECIES_TAILLOW] = gMonIcon_Taillow,
+ [SPECIES_SWELLOW] = gMonIcon_Swellow,
+ [SPECIES_SHROOMISH] = gMonIcon_Shroomish,
+ [SPECIES_BRELOOM] = gMonIcon_Breloom,
+ [SPECIES_SPINDA] = gMonIcon_Spinda,
+ [SPECIES_WINGULL] = gMonIcon_Wingull,
+ [SPECIES_PELIPPER] = gMonIcon_Pelipper,
+ [SPECIES_SURSKIT] = gMonIcon_Surskit,
+ [SPECIES_MASQUERAIN] = gMonIcon_Masquerain,
+ [SPECIES_WAILMER] = gMonIcon_Wailmer,
+ [SPECIES_WAILORD] = gMonIcon_Wailord,
+ [SPECIES_SKITTY] = gMonIcon_Skitty,
+ [SPECIES_DELCATTY] = gMonIcon_Delcatty,
+ [SPECIES_KECLEON] = gMonIcon_Kecleon,
+ [SPECIES_BALTOY] = gMonIcon_Baltoy,
+ [SPECIES_CLAYDOL] = gMonIcon_Claydol,
+ [SPECIES_NOSEPASS] = gMonIcon_Nosepass,
+ [SPECIES_TORKOAL] = gMonIcon_Torkoal,
+ [SPECIES_SABLEYE] = gMonIcon_Sableye,
+ [SPECIES_BARBOACH] = gMonIcon_Barboach,
+ [SPECIES_WHISCASH] = gMonIcon_Whiscash,
+ [SPECIES_LUVDISC] = gMonIcon_Luvdisc,
+ [SPECIES_CORPHISH] = gMonIcon_Corphish,
+ [SPECIES_CRAWDAUNT] = gMonIcon_Crawdaunt,
+ [SPECIES_FEEBAS] = gMonIcon_Feebas,
+ [SPECIES_MILOTIC] = gMonIcon_Milotic,
+ [SPECIES_CARVANHA] = gMonIcon_Carvanha,
+ [SPECIES_SHARPEDO] = gMonIcon_Sharpedo,
+ [SPECIES_TRAPINCH] = gMonIcon_Trapinch,
+ [SPECIES_VIBRAVA] = gMonIcon_Vibrava,
+ [SPECIES_FLYGON] = gMonIcon_Flygon,
+ [SPECIES_MAKUHITA] = gMonIcon_Makuhita,
+ [SPECIES_HARIYAMA] = gMonIcon_Hariyama,
+ [SPECIES_ELECTRIKE] = gMonIcon_Electrike,
+ [SPECIES_MANECTRIC] = gMonIcon_Manectric,
+ [SPECIES_NUMEL] = gMonIcon_Numel,
+ [SPECIES_CAMERUPT] = gMonIcon_Camerupt,
+ [SPECIES_SPHEAL] = gMonIcon_Spheal,
+ [SPECIES_SEALEO] = gMonIcon_Sealeo,
+ [SPECIES_WALREIN] = gMonIcon_Walrein,
+ [SPECIES_CACNEA] = gMonIcon_Cacnea,
+ [SPECIES_CACTURNE] = gMonIcon_Cacturne,
+ [SPECIES_SNORUNT] = gMonIcon_Snorunt,
+ [SPECIES_GLALIE] = gMonIcon_Glalie,
+ [SPECIES_LUNATONE] = gMonIcon_Lunatone,
+ [SPECIES_SOLROCK] = gMonIcon_Solrock,
+ [SPECIES_AZURILL] = gMonIcon_Azurill,
+ [SPECIES_SPOINK] = gMonIcon_Spoink,
+ [SPECIES_GRUMPIG] = gMonIcon_Grumpig,
+ [SPECIES_PLUSLE] = gMonIcon_Plusle,
+ [SPECIES_MINUN] = gMonIcon_Minun,
+ [SPECIES_MAWILE] = gMonIcon_Mawile,
+ [SPECIES_MEDITITE] = gMonIcon_Meditite,
+ [SPECIES_MEDICHAM] = gMonIcon_Medicham,
+ [SPECIES_SWABLU] = gMonIcon_Swablu,
+ [SPECIES_ALTARIA] = gMonIcon_Altaria,
+ [SPECIES_WYNAUT] = gMonIcon_Wynaut,
+ [SPECIES_DUSKULL] = gMonIcon_Duskull,
+ [SPECIES_DUSCLOPS] = gMonIcon_Dusclops,
+ [SPECIES_ROSELIA] = gMonIcon_Roselia,
+ [SPECIES_SLAKOTH] = gMonIcon_Slakoth,
+ [SPECIES_VIGOROTH] = gMonIcon_Vigoroth,
+ [SPECIES_SLAKING] = gMonIcon_Slaking,
+ [SPECIES_GULPIN] = gMonIcon_Gulpin,
+ [SPECIES_SWALOT] = gMonIcon_Swalot,
+ [SPECIES_TROPIUS] = gMonIcon_Tropius,
+ [SPECIES_WHISMUR] = gMonIcon_Whismur,
+ [SPECIES_LOUDRED] = gMonIcon_Loudred,
+ [SPECIES_EXPLOUD] = gMonIcon_Exploud,
+ [SPECIES_CLAMPERL] = gMonIcon_Clamperl,
+ [SPECIES_HUNTAIL] = gMonIcon_Huntail,
+ [SPECIES_GOREBYSS] = gMonIcon_Gorebyss,
+ [SPECIES_ABSOL] = gMonIcon_Absol,
+ [SPECIES_SHUPPET] = gMonIcon_Shuppet,
+ [SPECIES_BANETTE] = gMonIcon_Banette,
+ [SPECIES_SEVIPER] = gMonIcon_Seviper,
+ [SPECIES_ZANGOOSE] = gMonIcon_Zangoose,
+ [SPECIES_RELICANTH] = gMonIcon_Relicanth,
+ [SPECIES_ARON] = gMonIcon_Aron,
+ [SPECIES_LAIRON] = gMonIcon_Lairon,
+ [SPECIES_AGGRON] = gMonIcon_Aggron,
+ [SPECIES_CASTFORM] = gMonIcon_Castform,
+ [SPECIES_VOLBEAT] = gMonIcon_Volbeat,
+ [SPECIES_ILLUMISE] = gMonIcon_Illumise,
+ [SPECIES_LILEEP] = gMonIcon_Lileep,
+ [SPECIES_CRADILY] = gMonIcon_Cradily,
+ [SPECIES_ANORITH] = gMonIcon_Anorith,
+ [SPECIES_ARMALDO] = gMonIcon_Armaldo,
+ [SPECIES_RALTS] = gMonIcon_Ralts,
+ [SPECIES_KIRLIA] = gMonIcon_Kirlia,
+ [SPECIES_GARDEVOIR] = gMonIcon_Gardevoir,
+ [SPECIES_BAGON] = gMonIcon_Bagon,
+ [SPECIES_SHELGON] = gMonIcon_Shelgon,
+ [SPECIES_SALAMENCE] = gMonIcon_Salamence,
+ [SPECIES_BELDUM] = gMonIcon_Beldum,
+ [SPECIES_METANG] = gMonIcon_Metang,
+ [SPECIES_METAGROSS] = gMonIcon_Metagross,
+ [SPECIES_REGIROCK] = gMonIcon_Regirock,
+ [SPECIES_REGICE] = gMonIcon_Regice,
+ [SPECIES_REGISTEEL] = gMonIcon_Registeel,
+ [SPECIES_KYOGRE] = gMonIcon_Kyogre,
+ [SPECIES_GROUDON] = gMonIcon_Groudon,
+ [SPECIES_RAYQUAZA] = gMonIcon_Rayquaza,
+ [SPECIES_LATIAS] = gMonIcon_Latias,
+ [SPECIES_LATIOS] = gMonIcon_Latios,
+ [SPECIES_JIRACHI] = gMonIcon_Jirachi,
+ [SPECIES_DEOXYS] = gMonIcon_Deoxys,
+ [SPECIES_CHIMECHO] = gMonIcon_Chimecho,
+ [SPECIES_EGG] = gMonIcon_Egg,
+ [SPECIES_UNOWN_B] = gMonIcon_UnownB,
+ [SPECIES_UNOWN_C] = gMonIcon_UnownC,
+ [SPECIES_UNOWN_D] = gMonIcon_UnownD,
+ [SPECIES_UNOWN_E] = gMonIcon_UnownE,
+ [SPECIES_UNOWN_F] = gMonIcon_UnownF,
+ [SPECIES_UNOWN_G] = gMonIcon_UnownG,
+ [SPECIES_UNOWN_H] = gMonIcon_UnownH,
+ [SPECIES_UNOWN_I] = gMonIcon_UnownI,
+ [SPECIES_UNOWN_J] = gMonIcon_UnownJ,
+ [SPECIES_UNOWN_K] = gMonIcon_UnownK,
+ [SPECIES_UNOWN_L] = gMonIcon_UnownL,
+ [SPECIES_UNOWN_M] = gMonIcon_UnownM,
+ [SPECIES_UNOWN_N] = gMonIcon_UnownN,
+ [SPECIES_UNOWN_O] = gMonIcon_UnownO,
+ [SPECIES_UNOWN_P] = gMonIcon_UnownP,
+ [SPECIES_UNOWN_Q] = gMonIcon_UnownQ,
+ [SPECIES_UNOWN_R] = gMonIcon_UnownR,
+ [SPECIES_UNOWN_S] = gMonIcon_UnownS,
+ [SPECIES_UNOWN_T] = gMonIcon_UnownT,
+ [SPECIES_UNOWN_U] = gMonIcon_UnownU,
+ [SPECIES_UNOWN_V] = gMonIcon_UnownV,
+ [SPECIES_UNOWN_W] = gMonIcon_UnownW,
+ [SPECIES_UNOWN_X] = gMonIcon_UnownX,
+ [SPECIES_UNOWN_Y] = gMonIcon_UnownY,
+ [SPECIES_UNOWN_Z] = gMonIcon_UnownZ,
+ [SPECIES_UNOWN_EMARK] = gMonIcon_UnownExclamationMark,
+ [SPECIES_UNOWN_QMARK] = gMonIcon_UnownQuestionMark,
};
const u8 gMonIconPaletteIndices[] =
@@ -927,18 +927,15 @@ const struct SpritePalette gMonIconPaletteTable[] =
const struct OamData sMonIconOamData =
{
.y = 0,
- .affineMode = 0,
- .objMode = 0,
- .mosaic = 0,
- .bpp = 0,
+ .affineMode = ST_OAM_AFFINE_OFF,
+ .objMode = ST_OAM_OBJ_NORMAL,
+ .bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x32),
.x = 0,
- .matrixNum = 0,
.size = SPRITE_SIZE(32x32),
.tileNum = 0,
.priority = 1,
.paletteNum = 0,
- .affineParam = 0
};
// fastest to slowest
@@ -1141,7 +1138,7 @@ void sub_80D2EF8(struct Sprite *sprite)
void LoadMonIconPalettes(void)
{
u8 i;
- for (i = 0; i < 6; i++)
+ for (i = 0; i < ARRAY_COUNT(gMonIconPaletteTable); i++)
LoadSpritePalette(&gMonIconPaletteTable[i]);
}
@@ -1195,7 +1192,7 @@ void sub_80D3014(struct Sprite *sprite)
const u8* GetMonIconTiles(u16 species, bool32 extra)
{
const u8* iconSprite = gMonIconTable[species];
- if(species == SPECIES_DEOXYS && extra == TRUE)
+ if (species == SPECIES_DEOXYS && extra == TRUE)
{
iconSprite = (const u8*)(0x400 + (u32)iconSprite); //WTF?
}
diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c
index 30f5af14c..fb1be0698 100644
--- a/src/pokemon_storage_system.c
+++ b/src/pokemon_storage_system.c
@@ -4419,7 +4419,7 @@ static void PrintStorageActionText(u8 id)
DynamicPlaceholderTextUtil_ExpandPlaceholders(sPSSData->field_2190, gPCStorageActionTexts[id].text);
FillWindowPixelBuffer(1, PIXEL_FILL(1));
AddTextPrinterParameterized(1, 1, sPSSData->field_2190, 0, 1, TEXT_SPEED_FF, NULL);
- sub_8098858(1, 2, 14);
+ DrawTextBorderOuter(1, 2, 14);
PutWindowTilemap(1);
CopyWindowToVram(1, 2);
schedule_bg_copy_tilemap_to_vram(0);
diff --git a/src/pokenav_match_call.c b/src/pokenav_match_call.c
index b775ed10e..ce00401a9 100644
--- a/src/pokenav_match_call.c
+++ b/src/pokenav_match_call.c
@@ -73,22 +73,17 @@ struct MatchCallStruct4 {
const match_call_text_data_t *textData;
};
+// Note: Type1 and Type5 have identical struct layouts.
struct MatchCallStruct5 {
u8 type;
u8 v1;
u16 flag;
- u16 v4;
+ u16 rematchTableIdx;
const u8 *desc;
const u8 *name;
const match_call_text_data_t *textData;
};
-#define MATCHCALLDEF(name, type_, ...) \
-static const struct MatchCallStruct##type_ name = { \
- .type = type_, \
- __VA_ARGS__ \
-};
-
typedef union {
const struct MatchCallStructCommon *common;
const struct MatchCallStruct0 *type0;
@@ -328,7 +323,15 @@ static const match_call_text_data_t sMrStoneTextScripts[] = {
{ NULL, 0xFFFF, 0xFFFF }
};
-MATCHCALLDEF(sMrStoneMatchCallHeader, 0, 10, 0xffff, gMrStoneMatchCallDesc, gMrStoneMatchCallName, sMrStoneTextScripts);
+static const struct MatchCallStruct0 sMrStoneMatchCallHeader =
+{
+ .type = 0,
+ .v1 = 10,
+ .flag = 0xFFFF,
+ .desc = gMrStoneMatchCallDesc,
+ .name = gMrStoneMatchCallName,
+ .textData = sMrStoneTextScripts
+};
static const match_call_text_data_t sNormanTextScripts[] = {
{ gText_Norman_Pokenav_2B5719, FLAG_ENABLE_NORMAN_MATCH_CALL, 0xFFFF },
@@ -343,9 +346,25 @@ static const match_call_text_data_t sNormanTextScripts[] = {
{ NULL, 0xFFFF, 0xFFFF }
};
-MATCHCALLDEF(sNormanMatchCallHeader, 5, 7, FLAG_ENABLE_NORMAN_MATCH_CALL, 0x45, gNormanMatchCallDesc, gNormanMatchCallName, sNormanTextScripts);
+static const struct MatchCallStruct5 sNormanMatchCallHeader =
+{
+ .type = 5,
+ .v1 = 7,
+ .flag = FLAG_ENABLE_NORMAN_MATCH_CALL,
+ .rematchTableIdx = REMATCH_NORMAN,
+ .desc = gNormanMatchCallDesc,
+ .name = gNormanMatchCallName,
+ .textData = sNormanTextScripts
+};
-MATCHCALLDEF(sProfBirchMatchCallHeader, 3, 0, FLAG_ENABLE_PROF_BIRCH_MATCH_CALL, gProfBirchMatchCallDesc, gProfBirchMatchCallName)
+static const struct MatchCallStruct3 sProfBirchMatchCallHeader =
+{
+ .type = 3,
+ .v1 = 0,
+ .flag = FLAG_ENABLE_PROF_BIRCH_MATCH_CALL,
+ .desc = gProfBirchMatchCallDesc,
+ .name = gProfBirchMatchCallName
+};
static const match_call_text_data_t sMomTextScripts[] = {
{ gText_Mom_Pokenav_2B227B, 0xffff, 0xffff },
@@ -354,7 +373,15 @@ static const match_call_text_data_t sMomTextScripts[] = {
{ NULL, 0xffff, 0xffff }
};
-MATCHCALLDEF(sMomMatchCallHeader, 0, 0, FLAG_ENABLE_MOM_MATCH_CALL, gMomMatchCallDesc, gMomMatchCallName, sMomTextScripts);
+static const struct MatchCallStruct0 sMomMatchCallHeader =
+{
+ .type = 0,
+ .v1 = 0,
+ .flag = FLAG_ENABLE_MOM_MATCH_CALL,
+ .desc = gMomMatchCallDesc,
+ .name = gMomMatchCallName,
+ .textData = sMomTextScripts
+};
static const match_call_text_data_t sStevenTextScripts[] = {
{ gText_Steven_Pokenav_2B5B95, 0xffff, 0xffff },
@@ -367,7 +394,15 @@ static const match_call_text_data_t sStevenTextScripts[] = {
{ NULL, 0xffff, 0xffff },
};
-MATCHCALLDEF(sStevenMatchCallHeader, 0, 0xd5, FLAG_REGISTERED_STEVEN_POKENAV, gStevenMatchCallDesc, gStevenMatchCallName, sStevenTextScripts);
+static const struct MatchCallStruct0 sStevenMatchCallHeader =
+{
+ .type = 0,
+ .v1 = 0xD5,
+ .flag = FLAG_REGISTERED_STEVEN_POKENAV,
+ .desc = gStevenMatchCallDesc,
+ .name = gStevenMatchCallName,
+ .textData = sStevenTextScripts
+};
static const match_call_text_data_t sMayTextScripts[] = {
{ gText_May_Pokenav_2B3AB3, 0xFFFF, 0xFFFF },
@@ -388,7 +423,15 @@ static const match_call_text_data_t sMayTextScripts[] = {
{ NULL, 0xFFFF, 0xFFFF }
};
-MATCHCALLDEF(sMayMatchCallHeader, 4, MALE, FLAG_ENABLE_RIVAL_MATCH_CALL, gMayBrendanMatchCallDesc, gExpandedPlaceholder_May, sMayTextScripts);
+static const struct MatchCallStruct4 sMayMatchCallHeader =
+{
+ .type = 4,
+ .gender = MALE,
+ .flag = FLAG_ENABLE_RIVAL_MATCH_CALL,
+ .desc = gMayBrendanMatchCallDesc,
+ .name = gExpandedPlaceholder_May,
+ .textData = sMayTextScripts
+};
static const match_call_text_data_t sBrendanTextScripts[] = {
{ gText_Brendan_Pokenav_2B43EF, 0xFFFF, 0xFFFF },
@@ -409,7 +452,15 @@ static const match_call_text_data_t sBrendanTextScripts[] = {
{ NULL, 0xFFFF, 0xFFFF }
};
-MATCHCALLDEF(sBrendanMatchCallHeader, 4, FEMALE, FLAG_ENABLE_RIVAL_MATCH_CALL, gMayBrendanMatchCallDesc, gExpandedPlaceholder_Brendan, sBrendanTextScripts);
+static const struct MatchCallStruct4 sBrendanMatchCallHeader =
+{
+ .type = 4,
+ .gender = FEMALE,
+ .flag = FLAG_ENABLE_RIVAL_MATCH_CALL,
+ .desc = gMayBrendanMatchCallDesc,
+ .name = gExpandedPlaceholder_Brendan,
+ .textData = sBrendanTextScripts
+};
static const match_call_text_data_t sWallyTextScripts[] = {
{ gText_Wally_Pokenav_2B4DE2, 0xFFFF, 0xFFFF },
@@ -429,7 +480,16 @@ const struct MatchCallSubstruct2 sWallyAdditionalData[] = {
{ 0xFFFF, 0xD5 }
};
-MATCHCALLDEF(sWallyMatchCallHeader, 2, 0, FLAG_ENABLE_WALLY_MATCH_CALL, REMATCH_WALLY_3, gWallyMatchCallDesc, sWallyTextScripts, sWallyAdditionalData);
+static const struct MatchCallStruct2 sWallyMatchCallHeader =
+{
+ .type = 2,
+ .v1 = 0,
+ .flag = FLAG_ENABLE_WALLY_MATCH_CALL,
+ .rematchTableIdx = REMATCH_WALLY_3,
+ .desc = gWallyMatchCallDesc,
+ .textData = sWallyTextScripts,
+ .v10 = sWallyAdditionalData
+};
static const match_call_text_data_t sScottTextScripts[] = {
{ gText_Scott_Pokenav_2B5184, 0xFFFF, 0xFFFF },
@@ -443,7 +503,15 @@ static const match_call_text_data_t sScottTextScripts[] = {
};
-MATCHCALLDEF(sScottMatchCallHeader, 0, 0xD5, FLAG_ENABLE_SCOTT_MATCH_CALL, gScottMatchCallDesc, gScottMatchCallName, sScottTextScripts);
+static const struct MatchCallStruct0 sScottMatchCallHeader =
+{
+ .type = 0,
+ .v1 = 0xD5,
+ .flag = FLAG_ENABLE_SCOTT_MATCH_CALL,
+ .desc = gScottMatchCallDesc,
+ .name = gScottMatchCallName,
+ .textData = sScottTextScripts
+};
static const match_call_text_data_t sRoxanneTextScripts[] = {
{ gText_Roxanne_Pokenav_2B2456, 0xFFFE, 0xFFFF },
@@ -453,7 +521,16 @@ static const match_call_text_data_t sRoxanneTextScripts[] = {
{ NULL, 0xFFFF, 0xFFFF }
};
-MATCHCALLDEF(sRoxanneMatchCallHeader, 5, 10, FLAG_ENABLE_ROXANNE_MATCH_CALL, 0x41, gRoxanneMatchCallDesc, NULL, sRoxanneTextScripts);
+static const struct MatchCallStruct5 sRoxanneMatchCallHeader =
+{
+ .type = 5,
+ .v1 = 10,
+ .flag = FLAG_ENABLE_ROXANNE_MATCH_CALL,
+ .rematchTableIdx = REMATCH_ROXANNE,
+ .desc = gRoxanneMatchCallDesc,
+ .name = NULL,
+ .textData = sRoxanneTextScripts
+};
static const match_call_text_data_t sBrawlyTextScripts[] = {
{ gText_Brawly_Pokenav_2B2659, 0xFFFE, 0xFFFF },
@@ -463,7 +540,16 @@ static const match_call_text_data_t sBrawlyTextScripts[] = {
{ NULL, 0xFFFF, 0xFFFF }
};
-MATCHCALLDEF(sBrawlyMatchCallHeader, 5, 2, FLAG_ENABLE_BRAWLY_MATCH_CALL, 0x42, gBrawlyMatchCallDesc, NULL, sBrawlyTextScripts);
+static const struct MatchCallStruct5 sBrawlyMatchCallHeader =
+{
+ .type = 5,
+ .v1 = 2,
+ .flag = FLAG_ENABLE_BRAWLY_MATCH_CALL,
+ .rematchTableIdx = REMATCH_BRAWLY,
+ .desc = gBrawlyMatchCallDesc,
+ .name = NULL,
+ .textData = sBrawlyTextScripts
+};
static const match_call_text_data_t sWattsonTextScripts[] = {
{ gText_Wattson_Pokenav_2B2912, 0xFFFE, 0xFFFF },
@@ -473,7 +559,16 @@ static const match_call_text_data_t sWattsonTextScripts[] = {
{ NULL, 0xFFFF, 0xFFFF }
};
-MATCHCALLDEF(sWattsonMatchCallHeader, 5, 9, FLAG_ENABLE_WATTSON_MATCH_CALL, 0x43, gWattsonMatchCallDesc, NULL, sWattsonTextScripts);
+static const struct MatchCallStruct5 sWattsonMatchCallHeader =
+{
+ .type = 5,
+ .v1 = 9,
+ .flag = FLAG_ENABLE_WATTSON_MATCH_CALL,
+ .rematchTableIdx = REMATCH_WATTSON,
+ .desc = gWattsonMatchCallDesc,
+ .name = NULL,
+ .textData = sWattsonTextScripts
+};
static const match_call_text_data_t sFlanneryTextScripts[] = {
{ gText_Flannery_Pokenav_2B2B4D, 0xFFFE, 0xFFFF },
@@ -483,7 +578,16 @@ static const match_call_text_data_t sFlanneryTextScripts[] = {
{ NULL, 0xFFFF, 0xFFFF }
};
-MATCHCALLDEF(sFlanneryMatchCallHeader, 5, 3, FLAG_ENABLE_FLANNERY_MATCH_CALL, 0x44, gFlanneryMatchCallDesc, NULL, sFlanneryTextScripts);
+static const struct MatchCallStruct5 sFlanneryMatchCallHeader =
+{
+ .type = 5,
+ .v1 = 3,
+ .flag = FLAG_ENABLE_FLANNERY_MATCH_CALL,
+ .rematchTableIdx = REMATCH_FLANNERY,
+ .desc = gFlanneryMatchCallDesc,
+ .name = NULL,
+ .textData = sFlanneryTextScripts
+};
static const match_call_text_data_t sWinonaTextScripts[] = {
{ gText_Winona_Pokenav_2B2DA4, 0xFFFE, 0xFFFF },
@@ -493,7 +597,16 @@ static const match_call_text_data_t sWinonaTextScripts[] = {
{ NULL, 0xFFFF, 0xFFFF }
};
-MATCHCALLDEF(sWinonaMatchCallHeader, 5, 11, FLAG_ENABLE_WINONA_MATCH_CALL, 0x46, gWinonaMatchCallDesc, NULL, sWinonaTextScripts);
+static const struct MatchCallStruct5 sWinonaMatchCallHeader =
+{
+ .type = 5,
+ .v1 = 11,
+ .flag = FLAG_ENABLE_WINONA_MATCH_CALL,
+ .rematchTableIdx = REMATCH_WINONA,
+ .desc = gWinonaMatchCallDesc,
+ .name = NULL,
+ .textData = sWinonaTextScripts
+};
static const match_call_text_data_t sTateLizaTextScripts[] = {
{ gText_TateLiza_Pokenav_2B2F97, 0xFFFE, 0xFFFF },
@@ -503,7 +616,16 @@ static const match_call_text_data_t sTateLizaTextScripts[] = {
{ NULL, 0xFFFF, 0xFFFF }
};
-MATCHCALLDEF(sTateLizaMatchCallHeader, 5, 13, FLAG_ENABLE_TATE_AND_LIZA_MATCH_CALL, 0x47, gTateLizaMatchCallDesc, NULL, sTateLizaTextScripts);
+static const struct MatchCallStruct5 sTateLizaMatchCallHeader =
+{
+ .type = 5,
+ .v1 = 13,
+ .flag = FLAG_ENABLE_TATE_AND_LIZA_MATCH_CALL,
+ .rematchTableIdx = REMATCH_TATE_AND_LIZA,
+ .desc = gTateLizaMatchCallDesc,
+ .name = NULL,
+ .textData = sTateLizaTextScripts
+};
static const match_call_text_data_t sJuanTextScripts[] = {
{ gText_Juan_Pokenav_2B3249, 0xFFFE, 0xFFFF },
@@ -513,42 +635,96 @@ static const match_call_text_data_t sJuanTextScripts[] = {
{ NULL, 0xFFFF, 0xFFFF }
};
-MATCHCALLDEF(sJuanMatchCallHeader, 5, 14, FLAG_ENABLE_JUAN_MATCH_CALL, 0x48, gJuanMatchCallDesc, NULL, sJuanTextScripts);
+static const struct MatchCallStruct5 sJuanMatchCallHeader =
+{
+ .type = 5,
+ .v1 = 14,
+ .flag = FLAG_ENABLE_JUAN_MATCH_CALL,
+ .rematchTableIdx = REMATCH_JUAN,
+ .desc = gJuanMatchCallDesc,
+ .name = NULL,
+ .textData = sJuanTextScripts
+};
static const match_call_text_data_t sSidneyTextScripts[] = {
{ gText_Sidney_Pokenav_2B34CC, 0xFFFF, 0xFFFF },
{ NULL, 0xFFFF, 0xFFFF }
};
-MATCHCALLDEF(sSidneyMatchCallHeader, 5, 15, FLAG_REMATCH_JUAN, 0x49, gEliteFourMatchCallDesc, NULL, sSidneyTextScripts);
+static const struct MatchCallStruct5 sSidneyMatchCallHeader =
+{
+ .type = 5,
+ .v1 = 15,
+ .flag = FLAG_REMATCH_SIDNEY,
+ .rematchTableIdx = REMATCH_SIDNEY,
+ .desc = gEliteFourMatchCallDesc,
+ .name = NULL,
+ .textData = sSidneyTextScripts
+};
static const match_call_text_data_t sPhoebeTextScripts[] = {
{ gText_Phoebe_Pokenav_2B3561, 0xFFFF, 0xFFFF },
{ NULL, 0xFFFF, 0xFFFF }
};
-MATCHCALLDEF(sPhoebeMatchCallHeader, 5, 15, FLAG_REMATCH_SIDNEY, 0x4A, gEliteFourMatchCallDesc, NULL, sPhoebeTextScripts);
+static const struct MatchCallStruct5 sPhoebeMatchCallHeader =
+{
+ .type = 5,
+ .v1 = 15,
+ .flag = FLAG_REMATCH_PHOEBE,
+ .rematchTableIdx = REMATCH_PHOEBE,
+ .desc = gEliteFourMatchCallDesc,
+ .name = NULL,
+ .textData = sPhoebeTextScripts
+};
static const match_call_text_data_t sGlaciaTextScripts[] = {
{ gText_Glacia_Pokenav_2B35E4, 0xFFFF, 0xFFFF },
{ NULL, 0xFFFF, 0xFFFF }
};
-MATCHCALLDEF(sGlaciaMatchCallHeader, 5, 15, FLAG_REMATCH_PHOEBE, 0x4B, gEliteFourMatchCallDesc, NULL, sGlaciaTextScripts);
+static const struct MatchCallStruct5 sGlaciaMatchCallHeader =
+{
+ .type = 5,
+ .v1 = 15,
+ .flag = FLAG_REMATCH_GLACIA,
+ .rematchTableIdx = REMATCH_GLACIA,
+ .desc = gEliteFourMatchCallDesc,
+ .name = NULL,
+ .textData = sGlaciaTextScripts
+};
static const match_call_text_data_t sDrakeTextScripts[] = {
{ gText_Drake_Pokenav_2B368B, 0xFFFF, 0xFFFF },
{ NULL, 0xFFFF, 0xFFFF }
};
-MATCHCALLDEF(sDrakeMatchCallHeader, 5, 15, FLAG_REMATCH_GLACIA, 0x4C, gEliteFourMatchCallDesc, NULL, sDrakeTextScripts);
+static const struct MatchCallStruct5 sDrakeMatchCallHeader =
+{
+ .type = 5,
+ .v1 = 15,
+ .flag = FLAG_REMATCH_DRAKE,
+ .rematchTableIdx = REMATCH_DRAKE,
+ .desc = gEliteFourMatchCallDesc,
+ .name = NULL,
+ .textData = sDrakeTextScripts
+};
static const match_call_text_data_t sWallaceTextScripts[] = {
{ gText_Wallace_Pokenav_2B3790, 0xFFFF, 0xFFFF },
{ NULL, 0xFFFF, 0xFFFF }
};
-MATCHCALLDEF(sWallaceMatchCallHeader, 5, 15, FLAG_REMATCH_DRAKE, 0x4D, gChampionMatchCallDesc, NULL, sWallaceTextScripts);
+static const struct MatchCallStruct5 sWallaceMatchCallHeader =
+{
+ .type = 5,
+ .v1 = 15,
+ .flag = FLAG_REMATCH_WALLACE,
+ .rematchTableIdx = REMATCH_WALLACE,
+ .desc = gChampionMatchCallDesc,
+ .name = NULL,
+ .textData = sWallaceTextScripts
+};
static const match_call_t sMatchCallHeaders[] = {
{.type0 = &sMrStoneMatchCallHeader},
@@ -680,7 +856,7 @@ bool32 MatchCallFlagGetByIndex(u32 idx)
match_call_t matchCall;
u32 i;
- if (idx > 20)
+ if (idx > ARRAY_COUNT(sMatchCallHeaders) - 1)
return FALSE;
matchCall = sMatchCallHeaders[idx];
i = MatchCallGetFunctionIndex(matchCall);
@@ -727,7 +903,7 @@ u8 sub_81D16DC(u32 idx)
match_call_t matchCall;
u32 i;
- if (idx > 20)
+ if (idx > ARRAY_COUNT(sMatchCallHeaders) - 1)
return 0;
matchCall = sMatchCallHeaders[idx];
i = MatchCallGetFunctionIndex(matchCall);
@@ -771,7 +947,7 @@ bool32 MatchCall_IsRematchable(u32 idx)
match_call_t matchCall;
u32 i;
- if (idx > 20)
+ if (idx > ARRAY_COUNT(sMatchCallHeaders) - 1)
return 0;
matchCall = sMatchCallHeaders[idx];
i = MatchCallGetFunctionIndex(matchCall);
@@ -810,13 +986,13 @@ bool32 sub_81D17E8(u32 idx)
match_call_t matchCall;
u32 i;
- if (idx > 20)
+ if (idx > ARRAY_COUNT(sMatchCallHeaders) - 1)
return FALSE;
matchCall = sMatchCallHeaders[idx];
i = MatchCallGetFunctionIndex(matchCall);
if (gUnknown_08625338[i](matchCall))
return TRUE;
- for (i = 0; i < 4; i++)
+ for (i = 0; i < ARRAY_COUNT(sMatchCallCheckPageOverrides); i++)
{
if (sMatchCallCheckPageOverrides[i].idx == idx)
return TRUE;
@@ -854,7 +1030,7 @@ u32 MatchCall_GetRematchTableIdx(u32 idx)
match_call_t matchCall;
u32 i;
- if (idx > 20)
+ if (idx > ARRAY_COUNT(sMatchCallHeaders) - 1)
return REMATCH_TABLE_ENTRIES;
matchCall = sMatchCallHeaders[idx];
i = MatchCallGetFunctionIndex(matchCall);
@@ -891,7 +1067,7 @@ void MatchCall_GetMessage(u32 idx, u8 *dest)
match_call_t matchCall;
u32 i;
- if (idx > 20)
+ if (idx > ARRAY_COUNT(sMatchCallHeaders) - 1)
return;
matchCall = sMatchCallHeaders[idx];
i = MatchCallGetFunctionIndex(matchCall);
@@ -906,9 +1082,9 @@ static void MatchCall_GetMessage_Type0(match_call_t matchCall, u8 *dest)
static void MatchCall_GetMessage_Type1(match_call_t matchCall, u8 *dest)
{
if (matchCall.common->type != 5)
- sub_81D1920(matchCall.type5->textData, dest);
+ sub_81D1920(matchCall.type1->textData, dest);
else
- sub_81D199C(matchCall.type1->textData, matchCall.type1->rematchTableIdx, dest);
+ sub_81D199C(matchCall.type5->textData, matchCall.type5->rematchTableIdx, dest);
}
static void MatchCall_GetMessage_Type2(match_call_t matchCall, u8 *dest)
@@ -1093,7 +1269,7 @@ void sub_81D1A78(u32 idx, const u8 **desc, const u8 **name)
match_call_t matchCall;
u32 i;
- if (idx > 20)
+ if (idx > ARRAY_COUNT(sMatchCallHeaders) - 1)
return;
matchCall = sMatchCallHeaders[idx];
i = MatchCallGetFunctionIndex(matchCall);
@@ -1146,11 +1322,11 @@ const u8 *sub_81D1B40(u32 idx, u32 offset)
{
u32 i;
- for (i = 0; i < 4; i++)
+ for (i = 0; i < ARRAY_COUNT(sMatchCallCheckPageOverrides); i++)
{
if (sMatchCallCheckPageOverrides[i].idx == idx)
{
- for (; i + 1 < 4 && sMatchCallCheckPageOverrides[i + 1].idx == idx; i++)
+ for (; i + 1 < ARRAY_COUNT(sMatchCallCheckPageOverrides) && sMatchCallCheckPageOverrides[i + 1].idx == idx; i++)
{
if (!FlagGet(sMatchCallCheckPageOverrides[i + 1].v4))
break;
@@ -1244,7 +1420,7 @@ s32 sub_81D1BD0(u32 idx)
{
u32 i;
- for (i = 0; i < 4; i++)
+ for (i = 0; i < ARRAY_COUNT(sMatchCallCheckPageOverrides); i++)
{
if (sMatchCallCheckPageOverrides[i].idx == idx)
return sMatchCallCheckPageOverrides[i].v2;
@@ -1256,7 +1432,7 @@ bool32 sub_81D1BF8(u32 idx)
{
s32 i;
- for (i = 0; i < 21; i++)
+ for (i = 0; i < (s32)ARRAY_COUNT(sMatchCallHeaders); i++)
{
u32 r0 = MatchCall_GetRematchTableIdx(i);
if (r0 != REMATCH_TABLE_ENTRIES && r0 == idx)
diff --git a/src/script.c b/src/script.c
index 91690dd33..cb06300bf 100644
--- a/src/script.c
+++ b/src/script.c
@@ -405,7 +405,7 @@ bool32 sub_80991F8(void)
u8 *sub_8099244(void)
{
struct RamScriptData *scriptData = &gSaveBlock1Ptr->ramScript.data;
- if (!sub_801B27C())
+ if (!ValidateReceivedWonderCard())
return NULL;
if (scriptData->magic != RAM_SCRIPT_MAGIC)
return NULL;
diff --git a/src/script_menu.c b/src/script_menu.c
index c7523a370..082253e35 100644
--- a/src/script_menu.c
+++ b/src/script_menu.c
@@ -1183,7 +1183,7 @@ static void Task_HandleMultichoiceInput(u8 taskId)
{
gSpecialVar_Result = selection;
}
- sub_80E2A78(tWindowId);
+ ClearToTransparentAndRemoveWindow(tWindowId);
DestroyTask(taskId);
EnableBothScriptContexts();
}
@@ -1219,8 +1219,6 @@ bool8 IsScriptActive(void)
static void Task_HandleYesNoInput(u8 taskId)
{
- u8 left, top;
-
if (gTasks[taskId].tRight < 5)
{
gTasks[taskId].tRight++;
@@ -1229,9 +1227,9 @@ static void Task_HandleYesNoInput(u8 taskId)
switch (Menu_ProcessInputNoWrapClearOnChoose())
{
- case -2:
+ case MENU_NOTHING_CHOSEN:
return;
- case -1:
+ case MENU_B_PRESSED:
case 1:
PlaySE(SE_SELECT);
gSpecialVar_Result = 0;
@@ -1247,8 +1245,6 @@ static void Task_HandleYesNoInput(u8 taskId)
bool8 ScriptMenu_MultichoiceGrid(u8 left, u8 top, u8 multichoiceId, u8 ignoreBPress, u8 columnCount)
{
- u8 bottom = 0;
-
if (FuncIsActiveTask(Task_HandleMultichoiceGridInput) == TRUE)
{
return FALSE;
@@ -1256,10 +1252,8 @@ bool8 ScriptMenu_MultichoiceGrid(u8 left, u8 top, u8 multichoiceId, u8 ignoreBPr
else
{
u8 taskId;
- u8 unk2;
- int width;
- int i;
- u8 newWidth;
+ u8 rowCount, newWidth;
+ int i, width;
gSpecialVar_Result = 0xFF;
width = 0;
@@ -1272,15 +1266,15 @@ bool8 ScriptMenu_MultichoiceGrid(u8 left, u8 top, u8 multichoiceId, u8 ignoreBPr
newWidth = convert_pixel_width_to_tile_width(width);
left = sub_80E2D5C(left, columnCount * newWidth);
- unk2 = gMultichoiceLists[multichoiceId].count / columnCount;
+ rowCount = gMultichoiceLists[multichoiceId].count / columnCount;
taskId = CreateTask(Task_HandleMultichoiceGridInput, 80);
gTasks[taskId].tIgnoreBPress = ignoreBPress;
- gTasks[taskId].tWindowId = CreateWindowFromRect(left, top, columnCount * newWidth, unk2 * 2);
+ gTasks[taskId].tWindowId = CreateWindowFromRect(left, top, columnCount * newWidth, rowCount * 2);
SetStandardWindowBorderStyle(gTasks[taskId].tWindowId, 0);
- sub_81997AC(gTasks[taskId].tWindowId, newWidth * 8, columnCount, unk2, gMultichoiceLists[multichoiceId].list);
- sub_8199944(gTasks[taskId].tWindowId, newWidth * 8, columnCount, unk2, 0);
+ PrintMenuGridTable(gTasks[taskId].tWindowId, newWidth * 8, columnCount, rowCount, gMultichoiceLists[multichoiceId].list);
+ sub_8199944(gTasks[taskId].tWindowId, newWidth * 8, columnCount, rowCount, 0);
CopyWindowToVram(gTasks[taskId].tWindowId, 3);
return TRUE;
}
@@ -1291,23 +1285,24 @@ static void Task_HandleMultichoiceGridInput(u8 taskId)
s16 *data = gTasks[taskId].data;
s8 selection = Menu_ProcessInputGridLayout();
- if (selection != -2)
+ switch (selection)
{
- if (selection == -1)
- {
- if (tIgnoreBPress)
- return;
- PlaySE(SE_SELECT);
- gSpecialVar_Result = 0x7F;
- }
- else
- {
- gSpecialVar_Result = selection;
- }
- sub_80E2A78(tWindowId);
- DestroyTask(taskId);
- EnableBothScriptContexts();
+ case MENU_NOTHING_CHOSEN:
+ return;
+ case MENU_B_PRESSED:
+ if (tIgnoreBPress)
+ return;
+ PlaySE(SE_SELECT);
+ gSpecialVar_Result = 0x7F;
+ break;
+ default:
+ gSpecialVar_Result = selection;
+ break;
}
+
+ ClearToTransparentAndRemoveWindow(tWindowId);
+ DestroyTask(taskId);
+ EnableBothScriptContexts();
}
#undef tWindowId
@@ -1564,7 +1559,7 @@ static void Task_PokemonPicWindow(u8 taskId)
task->tState++;
break;
case 3:
- sub_80E2A78(task->tWindowId);
+ ClearToTransparentAndRemoveWindow(task->tWindowId);
DestroyTask(taskId);
break;
}
@@ -1628,7 +1623,7 @@ u8 CreateWindowFromRect(u8 x, u8 y, u8 width, u8 height)
return windowId;
}
-void sub_80E2A78(u8 windowId)
+void ClearToTransparentAndRemoveWindow(u8 windowId)
{
ClearStdWindowAndFrameToTransparent(windowId, TRUE);
RemoveWindow(windowId);
@@ -1638,30 +1633,30 @@ static void sub_80E2A94(u8 multichoiceId)
{
switch (multichoiceId)
{
- case 77:
- FillWindowPixelBuffer(0, PIXEL_FILL(1));
- AddTextPrinterParameterized2(0, 1, gUnknown_0858BBAC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
- break;
- case 76:
- FillWindowPixelBuffer(0, PIXEL_FILL(1));
- AddTextPrinterParameterized2(0, 1, gUnknown_0858BB9C[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
- break;
- case 78:
- FillWindowPixelBuffer(0, PIXEL_FILL(1));
- AddTextPrinterParameterized2(0, 1, gUnknown_0858BBBC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
- break;
- case 79:
- FillWindowPixelBuffer(0, PIXEL_FILL(1));
- AddTextPrinterParameterized2(0, 1, gUnknown_0858BBCC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
- break;
- case 75:
- FillWindowPixelBuffer(0, PIXEL_FILL(1));
- AddTextPrinterParameterized2(0, 1, gUnknown_0858BBEC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
- break;
- case 74:
- FillWindowPixelBuffer(0, PIXEL_FILL(1));
- AddTextPrinterParameterized2(0, 1, gUnknown_0858BBE0[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
- break;
+ case 77:
+ FillWindowPixelBuffer(0, PIXEL_FILL(1));
+ AddTextPrinterParameterized2(0, 1, gUnknown_0858BBAC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
+ break;
+ case 76:
+ FillWindowPixelBuffer(0, PIXEL_FILL(1));
+ AddTextPrinterParameterized2(0, 1, gUnknown_0858BB9C[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
+ break;
+ case 78:
+ FillWindowPixelBuffer(0, PIXEL_FILL(1));
+ AddTextPrinterParameterized2(0, 1, gUnknown_0858BBBC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
+ break;
+ case 79:
+ FillWindowPixelBuffer(0, PIXEL_FILL(1));
+ AddTextPrinterParameterized2(0, 1, gUnknown_0858BBCC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
+ break;
+ case 75:
+ FillWindowPixelBuffer(0, PIXEL_FILL(1));
+ AddTextPrinterParameterized2(0, 1, gUnknown_0858BBEC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
+ break;
+ case 74:
+ FillWindowPixelBuffer(0, PIXEL_FILL(1));
+ AddTextPrinterParameterized2(0, 1, gUnknown_0858BBE0[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
+ break;
}
}
diff --git a/src/script_pokemon_util_80F87D8.c b/src/script_pokemon_util_80F87D8.c
index 7d6020c7a..ece030395 100755
--- a/src/script_pokemon_util_80F87D8.c
+++ b/src/script_pokemon_util_80F87D8.c
@@ -395,7 +395,7 @@ static void sub_80F8EE8(u8 taskId)
task->data[0]++;
break;
case 4:
- sub_80E2A78(gTasks[taskId].data[5]);
+ ClearToTransparentAndRemoveWindow(gTasks[taskId].data[5]);
DestroyTask(taskId);
break;
}
@@ -488,7 +488,7 @@ void sub_80F910C(void)
if (gIsLinkContest & 2)
{
if (gReceivedRemoteLinkPlayers)
- sub_800E084();
+ DestroyWirelessStatusIndicatorSprite();
}
}
diff --git a/src/start_menu.c b/src/start_menu.c
index 4822c12e6..5b527e15e 100644
--- a/src/start_menu.c
+++ b/src/start_menu.c
@@ -44,6 +44,7 @@
#include "window.h"
#include "constants/songs.h"
#include "rom_8011DC0.h"
+#include "union_room.h"
// Menu actions
enum
@@ -1184,7 +1185,7 @@ static bool32 sub_80A03E4(u8 *par1)
InitBgsFromTemplates(0, sUnknown_085105A8, ARRAY_COUNT(sUnknown_085105A8));
InitWindows(sUnknown_085105AC);
LoadUserWindowBorderGfx_(0, 8, 224);
- sub_81978B0(240);
+ Menu_LoadStdPalAt(240);
break;
case 3:
ShowBg(0);
@@ -1233,7 +1234,7 @@ static void sub_80A0550(u8 taskId)
2,
1,
3);
- sub_8098858(0, 8, 14);
+ DrawTextBorderOuter(0, 8, 14);
PutWindowTilemap(0);
CopyWindowToVram(0, 3);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
diff --git a/src/text_window.c b/src/text_window.c
index 517f4bdb9..98fc09e87 100644
--- a/src/text_window.c
+++ b/src/text_window.c
@@ -113,7 +113,7 @@ void LoadUserWindowBorderGfx(u8 windowId, u16 destOffset, u8 palOffset)
LoadWindowGfx(windowId, gSaveBlock2Ptr->optionsWindowFrameType, destOffset, palOffset);
}
-void sub_8098858(u8 windowId, u16 tileNum, u8 palNum)
+void DrawTextBorderOuter(u8 windowId, u16 tileNum, u8 palNum)
{
u8 bgLayer = GetWindowAttribute(windowId, WINDOW_BG);
u16 tilemapLeft = GetWindowAttribute(windowId, WINDOW_TILEMAP_LEFT);
@@ -131,7 +131,7 @@ void sub_8098858(u8 windowId, u16 tileNum, u8 palNum)
FillBgTilemapBufferRect(bgLayer, tileNum + 8, tilemapLeft + width, tilemapTop + height, 1, 1, palNum);
}
-void sub_80989E0(u8 windowId, u16 tileNum, u8 palNum)
+void DrawTextBorderInner(u8 windowId, u16 tileNum, u8 palNum)
{
u8 bgLayer = GetWindowAttribute(windowId, WINDOW_BG);
u16 tilemapLeft = GetWindowAttribute(windowId, WINDOW_TILEMAP_LEFT);
diff --git a/src/trade.c b/src/trade.c
index df8f493f1..80c74d2cd 100644
--- a/src/trade.c
+++ b/src/trade.c
@@ -19,6 +19,8 @@
#include "load_save.h"
#include "mail.h"
#include "main.h"
+#include "mevent2.h"
+#include "mystery_gift.h"
#include "overworld.h"
#include "palette.h"
#include "party_menu.h"
@@ -39,6 +41,7 @@
#include "text_window.h"
#include "trainer_card.h"
#include "trade.h"
+#include "union_room.h"
#include "util.h"
#include "window.h"
#include "constants/easy_chat.h"
@@ -2011,7 +2014,7 @@ static void sub_80781C8(void)
FreeAllWindowBuffers();
Free(gUnknown_0203229C);
gMain.callback1 = NULL;
- sub_800E084();
+ DestroyWirelessStatusIndicatorSprite();
SetMainCallback2(sub_807AE50);
}
}
@@ -2540,7 +2543,7 @@ static void sub_8078DBC(void)
if (gUnknown_0203229C->tradeMenuCursorPosition < 6)
{
- sub_8098858(1, 1, 14);
+ DrawTextBorderOuter(1, 1, 14);
FillWindowPixelBuffer(1, PIXEL_FILL(1));
PrintMenuTable(1, 2, gUnknown_0832DEAC);
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(1, 2, 0);
@@ -2841,7 +2844,7 @@ static void sub_80794CC(void)
Free(gUnknown_02032184);
Free(gUnknown_0203229C);
FreeAllWindowBuffers();
- sub_800E084();
+ DestroyWirelessStatusIndicatorSprite();
SetMainCallback2(CB2_ReturnToFieldFromMultiplayer);
}
}
@@ -3338,7 +3341,7 @@ static void sub_807A19C(u8 a0)
{
FillWindowPixelBuffer(0, PIXEL_FILL(1));
AddTextPrinterParameterized(0, 1, gUnknown_0832DEBC[a0], 0, 1, TEXT_SPEED_FF, NULL);
- sub_8098858(0, 20, 12);
+ DrawTextBorderOuter(0, 20, 12);
PutWindowTilemap(0);
CopyWindowToVram(0, 3);
}
@@ -6120,7 +6123,7 @@ static void c2_080543C4(void)
FreeMonSpritesGfx();
FREE_AND_SET_NULL(gUnknown_020322A0);
if (gWirelessCommType)
- sub_800E084();
+ DestroyWirelessStatusIndicatorSprite();
SetMainCallback2(gMain.savedCallback);
}
RunTasks();
diff --git a/src/union_room.c b/src/union_room.c
index 5050b04f1..ea3658903 100644
--- a/src/union_room.c
+++ b/src/union_room.c
@@ -40,11 +40,13 @@
#include "strings.h"
#include "mevent.h"
#include "dynamic_placeholder_text_util.h"
-#include "rom_8011DC0.h"
+#include "union_room.h"
#include "easy_chat.h"
#include "event_obj_lock.h"
#include "union_room_chat.h"
#include "berry_crush.h"
+#include "mystery_gift.h"
+#include "union_room_player_avatar.h"
EWRAM_DATA u8 gUnknown_02022C20[12] = {};
EWRAM_DATA u8 gUnknown_02022C2C = 0;
@@ -60,8 +62,6 @@ EWRAM_DATA struct TradeUnkStruct gUnknown_02022C40 = {};
IWRAM_DATA struct UnkStruct_Leader *gUnknown_03000DA0;
IWRAM_DATA struct UnkStruct_Group *gUnknown_03000DA4;
IWRAM_DATA struct UnkStruct_URoom *gUnknown_03000DA8;
-IWRAM_DATA void *gUnknown_03000DAC;
-IWRAM_DATA bool32 gUnknown_03000DB0;
// this file's functions
void sub_80173E0(u8 windowId, u8 arg1, const u8 *str, u8 arg3, u8 arg4, u8 arg5);
@@ -100,23 +100,17 @@ void sub_801AC54(void);
void sub_802A9A8(u8 monId, MainCallback callback);
void sub_802493C(u8 monId, MainCallback callback);
void sub_80149D8(void);
-u16 sub_8019930(void);
-void sub_8018784(u8 windowId);
-void sub_8018884(const u8 *src);
-bool32 mevent_0814257C(u8 *textState, const u8 *str);
-s8 sub_8018B08(u8 *textState, u8 *arg1, u8 arg2, const u8 *str);
+void MG_DrawTextBorder(u8 windowId);
+s8 mevent_message_print_and_prompt_yes_no(u8 *textState, u8 *arg1, u8 arg2, const u8 *str);
bool32 sub_8016F1C(struct UnkLinkRfuStruct_02022B14 *arg0, s16 arg1);
u8 sub_8016DF0(struct UnkStruct_Main4 *arg0, struct UnkStruct_Main4 *arg1, u32 arg2);
void sub_8019F2C(void);
-void sub_8019E70(u8 *arg0, s32 arg1);
bool32 sub_80180A0(u32 monId, struct TradeUnkStruct *arg1);
void sub_80180E8(u32 monId, struct TradeUnkStruct *arg1);
-bool32 sub_801A2A8(struct UnkStruct_Main0 *arg0, s16 *arg1, s16 *arg2, u8 *arg3);
void sub_80181CC(void);
bool32 sub_8017940(void);
u8 sub_8016B00(void);
void sub_801A274(struct UnkStruct_URoom *arg0);
-void sub_801A284(struct UnkStruct_URoom *arg0);
bool32 sub_8017FD8(struct UnkStruct_URoom *arg0);
void sub_801689C(struct UnkStruct_URoom *arg0);
u8 sub_80181DC(struct UnkStruct_URoom *arg0);
@@ -125,7 +119,6 @@ bool32 sub_801704C(void);
s32 sub_8017CF8(s32 arg1, struct UnkStruct_Main0 *arg0);
s32 sub_80179D4(struct UnkStruct_Main0 *arg0, u8 arg1, u8 arg2, u32 playerGender);
void sub_801818C(bool32 arg0);
-void sub_801A3D0(u32 arg0, u32 arg1, struct UnkStruct_Main0 *arg2);
s32 sub_8017178(u8 *arg0, u8 *arg1, u8 *arg2, const struct WindowTemplate *winTemplate, const struct ListMenuTemplate *menuTemplate);
s32 sub_80172A0(u8 *arg0, u8 *arg1, u8 *arg2, u8 *arg3, const struct WindowTemplate *winTemplate, const struct ListMenuTemplate *menuTemplate, struct UnkStruct_Main0 *arg6);
s32 sub_8017CB0(struct UnkStruct_x20 * arg, s32 arg1);
@@ -135,12 +128,10 @@ void sub_8018220(u8 *unused, struct UnkStruct_URoom *arg1, bool8 arg2);
void sub_8017D9C(u8 *dst, s32 arg1, u32 playerGender);
u32 sub_80179AC(struct UnkStruct_x20 *arg0);
void sub_8017E00(u8 *dst, u8 arg1);
-void sub_8019F04(u8 *spriteIds);
-void sub_8019E3C(void);
void sub_80173B0(void);
s32 sub_8017D04(u32 type, u32 species);
bool32 sub_8017020(const u8 *src);
-void sub_8019BA8(void *);
+u8 sub_8019BA8(struct UnkStruct_8019BA8 * );
s32 sub_8017EA0(u8 *dst, u32 gender, u16 *arg2, struct UnkStruct_URoom *arg3);
void sub_801697C(u8 taskId);
bool8 sub_8017630(struct UnkStruct_Shared* arg0, const struct UnkStruct_Shared* arg1);
@@ -1557,7 +1548,7 @@ void sub_8012780(u8 taskId)
break;
case 21:
case 23:
- sub_800E084();
+ DestroyWirelessStatusIndicatorSprite();
sub_800EDD4();
sub_8012F64(data);
data->state++;
@@ -2078,7 +2069,7 @@ void sub_80134E8(u8 taskId)
data->state++;
break;
case 13:
- sub_800E084();
+ DestroyWirelessStatusIndicatorSprite();
if (PrintOnTextbox(&data->textState, gUnknown_082EDE9C[sub_8011A74()]))
{
gSpecialVar_Result = 6;
@@ -2086,12 +2077,12 @@ void sub_80134E8(u8 taskId)
}
break;
case 11:
- sub_800E084();
+ DestroyWirelessStatusIndicatorSprite();
gSpecialVar_Result = 5;
data->state = 23;
break;
case 15:
- sub_800E084();
+ DestroyWirelessStatusIndicatorSprite();
if (PrintOnTextbox(&data->textState, gUnknown_082EDE9C[sub_8011A74()]))
{
gSpecialVar_Result = 8;
@@ -2341,7 +2332,7 @@ void sub_8013F90(u8 taskId)
if (GetBlockReceivedStatus() == 3)
{
gEnemyParty[0] = *(struct Pokemon*)(gBlockRecvBuffer[GetMultiplayerId() ^ 1]);
- IncrementGameStat(GAME_STAT_50);
+ IncrementGameStat(GAME_STAT_NUM_UNION_ROOM_BATTLES);
ResetBlockReceivedFlags();
gTasks[taskId].data[0]++;
}
@@ -2483,7 +2474,7 @@ void sub_80143E4(void *arg0, bool32 arg1)
TrainerCard_GenerateCardForPlayer((struct TrainerCard *)argAsU16Ptr);
if (arg1)
- argAsU16Ptr[48] = sub_801B39C();
+ argAsU16Ptr[48] = GetWonderCardFlagID();
else
argAsU16Ptr[48] = 0;
}
@@ -2682,7 +2673,7 @@ void sub_8014790(u8 taskId)
case 8:
if (gReceivedRemoteLinkPlayers == 0)
{
- sub_800E084();
+ DestroyWirelessStatusIndicatorSprite();
EnableBothScriptContexts();
DestroyTask(taskId);
}
@@ -2701,7 +2692,7 @@ void sub_80149D8(void)
gTasks[taskId].data[0] = 0;
}
-void sub_8014A00(u32 arg0)
+void MEvent_CreateTask_Leader(u32 arg0)
{
u8 taskId;
struct UnkStruct_Leader *dataPtr;
@@ -2747,10 +2738,10 @@ void sub_8014A40(u8 taskId)
data->field_17 = sub_8016FC0(data->field_4, 0xFF);
winTemplate = gUnknown_082F011C;
- winTemplate.baseBlock = sub_8019930();
+ winTemplate.baseBlock = GetMysteryGiftBaseBlock();
winTemplate.paletteNum = 0xC;
data->listWindowId = AddWindow(&winTemplate);
- sub_8018784(data->listWindowId);
+ MG_DrawTextBorder(data->listWindowId);
gMultiuseListMenuTemplate = gUnknown_082F015C;
gMultiuseListMenuTemplate.windowId = data->listWindowId;
data->listTaskId = ListMenuInit(&gMultiuseListMenuTemplate, 0, 0);
@@ -2765,7 +2756,7 @@ void sub_8014A40(u8 taskId)
data->state = 3;
break;
case 3:
- sub_8018884(gStringVar4);
+ AddTextPrinterToWindow1(gStringVar4);
data->state = 4;
break;
case 4:
@@ -2773,11 +2764,11 @@ void sub_8014A40(u8 taskId)
if (gMain.newKeys & B_BUTTON)
{
data->state = 13;
- sub_800E084();
+ DestroyWirelessStatusIndicatorSprite();
}
break;
case 6:
- if (mevent_0814257C(&data->textState, gUnknown_082EDF40))
+ if (MG_PrintTextOnWindow1AndWaitButton(&data->textState, gUnknown_082EDF40))
{
data->field_13 = sub_8013398(data->field_0);
RedrawListMenu(data->listTaskId);
@@ -2788,7 +2779,7 @@ void sub_8014A40(u8 taskId)
data->state = 7;
break;
case 7:
- switch (sub_8018B08(&data->textState, &data->field_14, 0, gStringVar4))
+ switch (mevent_message_print_and_prompt_yes_no(&data->textState, &data->field_14, 0, gStringVar4))
{
case 0:
sub_800E0E8();
@@ -2839,7 +2830,7 @@ void sub_8014A40(u8 taskId)
}
break;
case 9:
- sub_8018884(gStringVar4);
+ AddTextPrinterToWindow1(gStringVar4);
data->state = 10;
break;
case 10:
@@ -2862,7 +2853,7 @@ void sub_8014A40(u8 taskId)
}
break;
case 13:
- sub_800E084();
+ DestroyWirelessStatusIndicatorSprite();
sub_800EDD4();
DestroyListMenuTask(data->listTaskId, 0, 0);
CopyBgTilemapBufferToVram(0);
@@ -2874,7 +2865,7 @@ void sub_8014A40(u8 taskId)
data->state++;
break;
case 14:
- if (mevent_0814257C(&data->textState, gText_PleaseStartOver))
+ if (MG_PrintTextOnWindow1AndWaitButton(&data->textState, gText_PleaseStartOver))
{
DestroyTask(taskId);
gSpecialVar_Result = 5;
@@ -2909,7 +2900,7 @@ void sub_8014A40(u8 taskId)
}
}
-void sub_8014EFC(u32 arg0)
+void MEvent_CreateTask_CardOrNewsWithFriend(u32 arg0)
{
u8 taskId;
struct UnkStruct_Group *dataPtr;
@@ -2942,7 +2933,7 @@ void sub_8014F48(u8 taskId)
data->state = 1;
break;
case 1:
- sub_8018884(gUnknown_082EF7F8);
+ AddTextPrinterToWindow1(gUnknown_082EF7F8);
data->state = 2;
break;
case 2:
@@ -2951,7 +2942,7 @@ void sub_8014F48(u8 taskId)
data->field_11 = sub_8016FC0(data->field_4, data->field_12 + 7);
winTemplate1 = gUnknown_082F0174;
- winTemplate1.baseBlock = sub_8019930();
+ winTemplate1.baseBlock = GetMysteryGiftBaseBlock();
winTemplate1.paletteNum = 0xC;
data->listWindowId = AddWindow(&winTemplate1);
@@ -2959,12 +2950,12 @@ void sub_8014F48(u8 taskId)
winTemplate2.paletteNum = 0xC;
data->field_D = AddWindow(&winTemplate2);
- sub_8018784(data->listWindowId);
+ MG_DrawTextBorder(data->listWindowId);
gMultiuseListMenuTemplate = gUnknown_082F0204;
gMultiuseListMenuTemplate.windowId = data->listWindowId;
data->listTaskId = ListMenuInit(&gMultiuseListMenuTemplate, 0, 0);
- sub_8018784(data->field_D);
+ MG_DrawTextBorder(data->field_D);
FillWindowPixelBuffer(data->field_D, PIXEL_FILL(1));
PutWindowTilemap(data->field_D);
sub_80125BC(data->field_D);
@@ -3015,7 +3006,7 @@ void sub_8014F48(u8 taskId)
}
break;
case 4:
- sub_8018884(gUnknown_082EFC3C);
+ AddTextPrinterToWindow1(gUnknown_082EFC3C);
sub_8018404(gStringVar1, &data->field_0->arr[data->field_F]);
data->state = 5;
break;
@@ -3034,7 +3025,7 @@ void sub_8014F48(u8 taskId)
data->state = 8;
break;
case 5:
- sub_8018884(gUnknown_082EDDF4);
+ AddTextPrinterToWindow1(gUnknown_082EDDF4);
sub_8011A64(0, 0);
break;
}
@@ -3052,17 +3043,17 @@ void sub_8014F48(u8 taskId)
data->state++;
break;
case 9:
- if (mevent_0814257C(&data->textState, gUnknown_082EDF80[sub_8011A74()]))
+ if (MG_PrintTextOnWindow1AndWaitButton(&data->textState, gUnknown_082EDF80[sub_8011A74()]))
{
- sub_800E084();
+ DestroyWirelessStatusIndicatorSprite();
DestroyTask(taskId);
sub_800EDD4();
gSpecialVar_Result = 5;
}
break;
case 7:
- sub_800E084();
- sub_8018884(gText_PleaseStartOver);
+ DestroyWirelessStatusIndicatorSprite();
+ AddTextPrinterToWindow1(gText_PleaseStartOver);
DestroyTask(taskId);
sub_800EDD4();
gSpecialVar_Result = 5;
@@ -3078,7 +3069,7 @@ void sub_8014F48(u8 taskId)
}
}
-void sub_80152A8(u32 arg0)
+void MEvent_CreateTask_CardOrNewsOverWireless(u32 arg0)
{
u8 taskId;
struct UnkStruct_Group *dataPtr;
@@ -3111,7 +3102,7 @@ void sub_80152F4(u8 taskId)
data->state = 1;
break;
case 1:
- sub_8018884(gUnknown_082EFBC8);
+ AddTextPrinterToWindow1(gUnknown_082EFBC8);
data->state = 2;
break;
case 2:
@@ -3122,10 +3113,10 @@ void sub_80152F4(u8 taskId)
if (data->field_13 != 0)
{
winTemplate = gUnknown_082F0174;
- winTemplate.baseBlock = sub_8019930();
+ winTemplate.baseBlock = GetMysteryGiftBaseBlock();
data->listWindowId = AddWindow(&winTemplate);
- sub_8018784(data->listWindowId);
+ MG_DrawTextBorder(data->listWindowId);
gMultiuseListMenuTemplate = gUnknown_082F0204;
gMultiuseListMenuTemplate.windowId = data->listWindowId;
data->listTaskId = ListMenuInit(&gMultiuseListMenuTemplate, 0, 0);
@@ -3180,7 +3171,7 @@ void sub_80152F4(u8 taskId)
}
break;
case 4:
- sub_8018884(gUnknown_082EFC90);
+ AddTextPrinterToWindow1(gUnknown_082EFC90);
sub_8018404(gStringVar1, &data->field_0->arr[data->field_F]);
data->state = 5;
break;
@@ -3199,7 +3190,7 @@ void sub_80152F4(u8 taskId)
data->state = 8;
break;
case 5:
- sub_8018884(gUnknown_082EDEC4);
+ AddTextPrinterToWindow1(gUnknown_082EDEC4);
sub_8011A64(0, 0);
break;
}
@@ -3220,27 +3211,27 @@ void sub_80152F4(u8 taskId)
data->state++;
break;
case 9:
- if (mevent_0814257C(&data->textState, gUnknown_082EDF04))
+ if (MG_PrintTextOnWindow1AndWaitButton(&data->textState, gUnknown_082EDF04))
{
- sub_800E084();
+ DestroyWirelessStatusIndicatorSprite();
DestroyTask(taskId);
sub_800EDD4();
gSpecialVar_Result = 5;
}
break;
case 7:
- if (mevent_0814257C(&data->textState, gText_WirelessSearchCanceled))
+ if (MG_PrintTextOnWindow1AndWaitButton(&data->textState, gText_WirelessSearchCanceled))
{
- sub_800E084();
+ DestroyWirelessStatusIndicatorSprite();
DestroyTask(taskId);
sub_800EDD4();
gSpecialVar_Result = 5;
}
break;
case 11:
- if (mevent_0814257C(&data->textState, gUnknown_082EFD58[data->field_12]))
+ if (MG_PrintTextOnWindow1AndWaitButton(&data->textState, gUnknown_082EFD58[data->field_12]))
{
- sub_800E084();
+ DestroyWirelessStatusIndicatorSprite();
DestroyTask(taskId);
sub_800EDD4();
gSpecialVar_Result = 5;
@@ -4515,7 +4506,7 @@ s32 sub_8017178(u8 *arg0, u8 *arg1, u8 *arg2, const struct WindowTemplate *winTe
{
case 0:
winTemplateCopy = *winTemplate;
- r1 = sub_81DB41C(menuTemplate);
+ r1 = Intl_GetListMenuWidth(menuTemplate);
if (winTemplateCopy.width > r1)
{
winTemplateCopy.width = r1;
diff --git a/src/union_room_battle.c b/src/union_room_battle.c
new file mode 100644
index 000000000..9d9f9dcf3
--- /dev/null
+++ b/src/union_room_battle.c
@@ -0,0 +1,631 @@
+#include "global.h"
+#include "battle.h"
+#include "task.h"
+#include "text.h"
+#include "main.h"
+#include "bg.h"
+#include "palette.h"
+#include "gpu_regs.h"
+#include "alloc.h"
+#include "menu.h"
+#include "window.h"
+#include "text_window.h"
+#include "scanline_effect.h"
+#include "m4a.h"
+#include "dynamic_placeholder_text_util.h"
+#include "overworld.h"
+#include "strings.h"
+#include "string_util.h"
+#include "international_string_util.h"
+#include "sound.h"
+#include "constants/songs.h"
+#include "party_menu.h"
+#include "battle_setup.h"
+#include "link.h"
+#include "union_room.h"
+#include "union_room_battle.h"
+
+struct UnkStruct_3000DAC
+{
+ /*0x00*/ u32 unk00[4];
+ /*0x10*/ u32 unk10[4];
+ /*0x20*/ u32 unk20[16];
+ /*0x60*/ u8 taskId;
+ /*0x61*/ u8 unk61;
+ /*0x62*/ u8 filler_62[10];
+};
+
+struct UnkStruct_2022C6C
+{
+ s16 a0;
+};
+
+IWRAM_DATA struct UnkStruct_3000DAC * gUnknown_03000DAC;
+IWRAM_DATA bool32 gUnknown_03000DB0;
+
+EWRAM_DATA struct UnkStruct_2022C6C * gUnknown_02022C6C = NULL;
+
+void sub_801A43C(void);
+void sub_801A6C0(u8 taskId);
+static void sub_801A8B0(u8 windowId, u8 fontId, const u8 * str, u8 x, u8 y, u8 mode);
+bool32 sub_801AA30(u32 * a0, u32 * a1, u32 * a2, u8 taskId);
+
+const u16 gWirelessInfoScreenPal[] = INCBIN_U16("graphics/interface/wireless_info_screen.gbapal");
+const u32 gWirelessInfoScreenGfx[] = INCBIN_U32("graphics/interface/wireless_info_screen.4bpp.lz");
+const u32 gWirelessInfoScreenTilemap[] = INCBIN_U32("graphics/interface/wireless_info_screen.bin.lz");
+
+const struct BgTemplate gUnknown_082F0D34[] = {
+ {
+ .bg = 0,
+ .charBaseIndex = 2,
+ .mapBaseIndex = 0x1F,
+ .priority = 0
+ }, {
+ .bg = 1,
+ .charBaseIndex = 0,
+ .mapBaseIndex = 0x08,
+ .priority = 1
+ }
+};
+
+const struct WindowTemplate gUnknown_082F0D3C[] = {
+ {
+ .bg = 0x00,
+ .tilemapLeft = 0x03,
+ .tilemapTop = 0x00,
+ .width = 0x18,
+ .height = 0x03,
+ .paletteNum = 0x0f,
+ .baseBlock = 0x0001
+ }, {
+ .bg = 0x00,
+ .tilemapLeft = 0x03,
+ .tilemapTop = 0x04,
+ .width = 0x15,
+ .height = 0x0f,
+ .paletteNum = 0x0f,
+ .baseBlock = 0x0049
+ }, {
+ .bg = 0x00,
+ .tilemapLeft = 0x18,
+ .tilemapTop = 0x04,
+ .width = 0x03,
+ .height = 0x0f,
+ .paletteNum = 0x0f,
+ .baseBlock = 0x0184
+ },
+ { 0xFF }
+};
+
+const u8 *const gUnknown_082F0D5C[] = {
+ gText_WirelessCommStatus,
+ gText_PeopleTrading,
+ gText_PeopleBattling,
+ gText_PeopleInUnionRoom,
+ gText_PeopleCommunicating
+};
+
+const u8 gUnknown_082F0D70[][3] = {
+ {0x01, 0x01, 0x02},
+ {0x02, 0x01, 0x02},
+ {0x03, 0x01, 0x04},
+ {0x04, 0x00, 0x02},
+ {0x06, 0x03, 0x02},
+ {0x07, 0x03, 0x02},
+ {0x09, 0x03, 0x00},
+ {0x0a, 0x03, 0x00},
+ {0x0b, 0x03, 0x00},
+ {0x0c, 0xff, 0x00},
+ {0x0d, 0x00, 0x00},
+ {0x10, 0x03, 0x00},
+ {0x0f, 0x03, 0x00},
+ {0x40, 0x02, 0x01},
+ {0x41, 0x02, 0x02},
+ {0x44, 0x02, 0x02},
+ {0x45, 0x02, 0x00},
+ {0x48, 0x02, 0x02},
+ {0x54, 0x02, 0x01},
+ {0x53, 0x02, 0x02},
+ {0x51, 0x02, 0x01},
+ {0x52, 0x02, 0x01},
+ {0x15, 0x03, 0x02},
+ {0x16, 0x03, 0x02},
+ {0x17, 0x03, 0x00},
+ {0x18, 0x03, 0x00},
+ {0x19, 0x03, 0x00},
+ {0x1a, 0x03, 0x00},
+ {0x1b, 0x03, 0x00},
+ {0x1c, 0x01, 0x02},
+ {0x0e, 0x01, 0x02}
+};
+
+const struct BgTemplate gUnknown_082F0DD0[] = {
+ {
+ .bg = 0,
+ .charBaseIndex = 3,
+ .mapBaseIndex = 31
+ }
+};
+
+const struct WindowTemplate gUnknown_082F0DD4[] = {
+ {
+ .bg = 0,
+ .tilemapLeft = 3,
+ .tilemapTop = 15,
+ .width = 24,
+ .height = 4,
+ .paletteNum = 0xE,
+ .baseBlock = 0x014
+ },
+ { 0xFF }
+};
+
+const u8 gUnknown_082F0DE4[] = { 1, 2, 3 };
+
+void sub_801A3F4(void)
+{
+ if (!IsDma3ManagerBusyWithBgCopy())
+ {
+ RunTasks();
+ RunTextPrinters();
+ AnimateSprites();
+ BuildOamBuffer();
+ UpdatePaletteFade();
+ }
+}
+
+void sub_801A418(void)
+{
+ LoadOam();
+ ProcessSpriteCopyRequests();
+ TransferPlttBuffer();
+}
+
+void sub_801A42C(void)
+{
+ SetMainCallback2(sub_801A43C);
+}
+
+void sub_801A43C(void)
+{
+ SetGpuReg(REG_OFFSET_DISPCNT, 0x0000);
+ gUnknown_03000DAC = AllocZeroed(sizeof(struct UnkStruct_3000DAC));
+ SetVBlankCallback(NULL);
+ ResetBgsAndClearDma3BusyFlags(0);
+ InitBgsFromTemplates(0, gUnknown_082F0D34, ARRAY_COUNT(gUnknown_082F0D34));
+ SetBgTilemapBuffer(1, Alloc(0x800));
+ SetBgTilemapBuffer(0, Alloc(0x800));
+ DecompressAndLoadBgGfxUsingHeap(1, gWirelessInfoScreenGfx, 0, 0, 0);
+ CopyToBgTilemapBuffer(1, gWirelessInfoScreenTilemap, 0, 0);
+ InitWindows(gUnknown_082F0D3C);
+ DeactivateAllTextPrinters();
+ ResetPaletteFade();
+ ResetSpriteData();
+ ResetTasks();
+ ScanlineEffect_Stop();
+ m4aSoundVSyncOn();
+ SetVBlankCallback(sub_801A418);
+ gUnknown_03000DAC->taskId = CreateTask(sub_801A6C0, 0);
+ gUnknown_03000DAC->unk61 = sub_8013C40();
+ gUnknown_03000DAC->unk10[3] = 1;
+ ChangeBgX(0, 0, 0);
+ ChangeBgY(0, 0, 0);
+ ChangeBgX(1, 0, 0);
+ ChangeBgY(1, 0, 0);
+ LoadPalette(gWirelessInfoScreenPal, 0x00, 0x20);
+ Menu_LoadStdPalAt(0xF0);
+ DynamicPlaceholderTextUtil_Reset();
+ FillBgTilemapBufferRect(0, 0, 0, 0, 32, 32, 0x0F);
+ CopyBgTilemapBufferToVram(1);
+ SetMainCallback2(sub_801A3F4);
+ RunTasks();
+ RunTextPrinters();
+ AnimateSprites();
+ BuildOamBuffer();
+ UpdatePaletteFade();
+}
+
+void sub_801A584(void)
+{
+ s32 i;
+ FreeAllWindowBuffers();
+ for (i = 0; i < 2; i++)
+ {
+ Free(GetBgTilemapBuffer(i));
+ }
+ Free(gUnknown_03000DAC);
+ SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic);
+}
+
+void sub_801A5BC(s16 * a0, s16 * a1)
+{
+ if (++(*a0) > 5)
+ {
+ if (++(*a1) == 14)
+ {
+ *a1 = 0;
+ }
+ *a0 = 0;
+ }
+ LoadPalette(gWirelessInfoScreenPal + 16 * (*a1 + 2), 0, 0x10);
+}
+
+void sub_801A600(void)
+{
+ s32 i;
+ FillWindowPixelBuffer(0, 0);
+ FillWindowPixelBuffer(1, 0);
+ FillWindowPixelBuffer(2, 0);
+ sub_801A8B0(0, 1, gUnknown_082F0D5C[0], GetStringCenterAlignXOffset(1, gUnknown_082F0D5C[0], 0xC0), 6, 3);
+ for (i = 0; i < 3; i++)
+ {
+ sub_801A8B0(1, 1, gUnknown_082F0D5C[i + 1], 0, 30 * i + 8, 1);
+ }
+ sub_801A8B0(1, 1, gUnknown_082F0D5C[i + 1], 0, 30 * i + 8, 2);
+ PutWindowTilemap(0);
+ CopyWindowToVram(0, 2);
+ PutWindowTilemap(1);
+ CopyWindowToVram(1, 2);
+}
+
+void sub_801A6C0(u8 taskId)
+{
+ s32 i;
+ switch (gTasks[taskId].data[0])
+ {
+ case 0:
+ sub_801A600();
+ gTasks[taskId].data[0]++;
+ break;
+ case 1:
+ BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
+ ShowBg(1);
+ CopyBgTilemapBufferToVram(0);
+ ShowBg(0);
+ gTasks[taskId].data[0]++;
+ break;
+ case 2:
+ if (!gPaletteFade.active)
+ {
+ gTasks[taskId].data[0]++;
+ }
+ break;
+ case 3:
+ if (sub_801AA30(gUnknown_03000DAC->unk00, gUnknown_03000DAC->unk10, gUnknown_03000DAC->unk20, gUnknown_03000DAC->unk61))
+ {
+ FillWindowPixelBuffer(2, 0);
+ for (i = 0; i < 4; i++)
+ {
+ ConvertIntToDecimalStringN(gStringVar4, gUnknown_03000DAC->unk00[i], STR_CONV_MODE_RIGHT_ALIGN, 2);
+ if (i != 3)
+ {
+ sub_801A8B0(2, 1, gStringVar4, 12, 30 * i + 8, 1);
+ }
+ else
+ {
+ sub_801A8B0(2, 1, gStringVar4, 12, 98, 2);
+ }
+ }
+ PutWindowTilemap(2);
+ CopyWindowToVram(2, 3);
+ }
+ if (({gMain.newKeys & A_BUTTON;}) || ({gMain.newKeys & B_BUTTON;}))
+ {
+ PlaySE(SE_SELECT);
+ gTasks[gUnknown_03000DAC->unk61].data[15] = 0xFF;
+ gTasks[taskId].data[0]++;
+ }
+ sub_801A5BC(&gTasks[taskId].data[7], &gTasks[taskId].data[8]);
+ break;
+ case 4:
+ BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
+ gTasks[taskId].data[0]++;
+ break;
+ case 5:
+ if (!gPaletteFade.active)
+ {
+ SetMainCallback2(sub_801A584);
+ DestroyTask(taskId);
+ }
+ break;
+ }
+}
+
+static void sub_801A8B0(u8 windowId, u8 fontId, const u8 * str, u8 x, u8 y, u8 mode)
+{
+ u8 color[3];
+
+ switch (mode)
+ {
+ case 0:
+ color[0] = 0;
+ color[1] = 2;
+ color[2] = 3;
+ break;
+ case 1:
+ color[0] = 0;
+ color[1] = 1;
+ color[2] = 3;
+ break;
+ case 2:
+ color[0] = 0;
+ color[1] = 4;
+ color[2] = 5;
+ break;
+ case 3:
+ color[0] = 0;
+ color[1] = 7;
+ color[2] = 6;
+ break;
+ case 4:
+ color[0] = 0;
+ color[1] = 1;
+ color[2] = 2;
+ break;
+ }
+
+ AddTextPrinterParameterized4(windowId, fontId, x, y, 0, 0, color, -1, str);
+}
+
+u32 sub_801A960(struct UnkStruct_x20 * a0, u32 * a1)
+{
+ s32 i, j, r2;
+ u32 result = a0->unk.field_0.unk_0a_0;
+
+ for (i = 0; i < (unsigned)ARRAY_COUNT(gUnknown_082F0D70); i++)
+ {
+ if (result != gUnknown_082F0D70[i][0])
+ {
+ continue;
+ }
+ if (a0->field_1A_0 != 1)
+ {
+ continue;
+ }
+ if (gUnknown_082F0D70[i][2] == 0)
+ {
+ r2 = 0;
+ for (j = 0; j < 4; j++)
+ {
+ if (a0->unk.field_0.unk_04[j] != 0)
+ {
+ r2++;
+ }
+ }
+ r2++;
+ a1[gUnknown_082F0D70[i][1]] += r2;
+ }
+ else
+ {
+ a1[gUnknown_082F0D70[i][1]] += gUnknown_082F0D70[i][2];
+ }
+ }
+ return result;
+}
+
+bool32 sub_801AA08(u32 * a0, u32 * a1)
+{
+ s32 i;
+ for (i = 0; i < 4; i++)
+ {
+ if (a0[i] != a1[i])
+ {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+bool32 sub_801AA30(u32 * a0, u32 * a1, u32 * a2, u8 taskId)
+{
+ bool32 r8 = FALSE;
+ u32 sp0[4] = {0, 0, 0, 0};
+ struct UnkStruct_x20 ** data = (void *)gTasks[taskId].data;
+ s32 i;
+
+ for (i = 0; i < 16; i++)
+ {
+ u32 r1 = sub_801A960(&(*data)[i], sp0);
+ if (r1 != a2[i])
+ {
+ a2[i] = r1;
+ r8 = TRUE;
+ }
+ }
+ if (sub_801AA08(sp0, a1) == 0)
+ {
+ if (r8 != TRUE)
+ {
+ return FALSE;
+ }
+ }
+ else
+ {
+ memcpy(a0, sp0, sizeof(sp0));
+ memcpy(a1, sp0, sizeof(sp0));
+ a0[3] = a0[0] + a0[1] + a0[2] + a0[3];
+ }
+ return TRUE;
+}
+
+void sub_801AAD4(void)
+{
+ s32 i;
+ sub_8014210(10);
+ for (i = 0; i < 2; i++)
+ {
+ gEnemyParty[i] = gPlayerParty[gSelectedOrderFromParty[i] - 1];
+ }
+ for (i = 0; i < 6; i++)
+ {
+ ZeroMonData(&gPlayerParty[i]);
+ }
+ for (i = 0; i < 2; i++)
+ {
+ gPlayerParty[i] = gEnemyParty[i];
+ }
+ IncrementGameStat(GAME_STAT_NUM_UNION_ROOM_BATTLES);
+ CalculatePlayerPartyCount();
+ gTrainerBattleOpponent_A = 0xC00;
+ SetMainCallback2(CB2_InitBattle);
+}
+
+void sub_801AB68(u8 windowId, const u8 * str, u8 x, u8 y, s32 speed)
+{
+ s32 letterSpacing = 0;
+ s32 lineSpacing = 1;
+ FillWindowPixelBuffer(windowId, (gUnknown_082F0DE4[0] << 4) | gUnknown_082F0DE4[0]);
+ AddTextPrinterParameterized4(windowId, 1, x, y, letterSpacing, lineSpacing, gUnknown_082F0DE4, speed, str);
+}
+
+bool32 sub_801ABDC(s16 * state, const u8 * str, s32 speed)
+{
+ switch (*state)
+ {
+ case 0:
+ DrawTextBorderOuter(0, 0x001, 0xD);
+ sub_801AB68(0, str, 0, 1, speed);
+ PutWindowTilemap(0);
+ CopyWindowToVram(0, 3);
+ (*state)++;
+ break;
+ case 1:
+ if (!IsTextPrinterActive(0))
+ {
+ *state = 0;
+ return TRUE;
+ }
+ break;
+ }
+ return FALSE;
+}
+
+void sub_801AC40(void)
+{
+ LoadOam();
+ ProcessSpriteCopyRequests();
+ TransferPlttBuffer();
+}
+
+void sub_801AC54(void)
+{
+ switch (gMain.state)
+ {
+ case 0:
+ SetGpuReg(REG_OFFSET_DISPCNT, 0x0000);
+ gUnknown_02022C6C = AllocZeroed(4);
+ ResetSpriteData();
+ FreeAllSpritePalettes();
+ ResetTasks();
+ ResetBgsAndClearDma3BusyFlags(0);
+ InitBgsFromTemplates(0, gUnknown_082F0DD0, 1);
+ reset_temp_tile_data_buffers();
+ if (!InitWindows(gUnknown_082F0DD4))
+ {
+ return;
+ }
+ DeactivateAllTextPrinters();
+ ClearWindowTilemap(0);
+ FillWindowPixelBuffer(0, 0x00);
+ FillWindowPixelBuffer(0, 0x11);
+ FillBgTilemapBufferRect(0, 0, 0, 0, 30, 20, 0xF);
+ LoadUserWindowBorderGfx(0, 1, 0xD0);
+ LoadUserWindowBorderGfx_(0, 1, 0xD0);
+ sub_819789C();
+ SetVBlankCallback(sub_801AC40);
+ gMain.state++;
+ break;
+ case 1:
+ if (sub_801ABDC(&gUnknown_02022C6C->a0, gText_CommStandbyAwaitingOtherPlayer, 0))
+ {
+ gMain.state++;
+ }
+ break;
+ case 2:
+ BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
+ ShowBg(0);
+ gMain.state++;
+ break;
+ case 3:
+ if (!UpdatePaletteFade())
+ {
+ memset(gBlockSendBuffer, 0, 0x20);
+ if (gSelectedOrderFromParty[0] == -gSelectedOrderFromParty[1])
+ {
+ gBlockSendBuffer[0] = 0x52;
+ }
+ else
+ {
+ gBlockSendBuffer[0] = 0x51;
+ }
+ SendBlock(0, gBlockSendBuffer, 0x20);
+ gMain.state++;
+ }
+ break;
+ case 4:
+ if (GetBlockReceivedStatus() == 3)
+ {
+ if (gBlockRecvBuffer[0][0] == 0x51 && gBlockRecvBuffer[1][0] == 0x51)
+ {
+ BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
+ gMain.state = 50;
+ }
+ else
+ {
+ sub_800AC34();
+ if (gBlockRecvBuffer[GetMultiplayerId()][0] == 0x52)
+ {
+ gMain.state = 6;
+ }
+ else
+ {
+ gMain.state = 8;
+ }
+ }
+ ResetBlockReceivedFlags();
+ }
+ break;
+ case 50:
+ if (!UpdatePaletteFade())
+ {
+ sub_800ADF8();
+ gMain.state++;
+ }
+ break;
+ case 51:
+ if (IsLinkTaskFinished())
+ {
+ SetMainCallback2(sub_801AAD4);
+ }
+ break;
+ case 6:
+ if (gReceivedRemoteLinkPlayers == 0)
+ {
+ gMain.state++;
+ }
+ break;
+ case 7:
+ if (sub_801ABDC(&gUnknown_02022C6C->a0, gText_RefusedBattle, 1))
+ {
+ SetMainCallback2(CB2_ReturnToField);
+ }
+ break;
+ case 8:
+ if (gReceivedRemoteLinkPlayers == 0)
+ {
+ gMain.state++;
+ }
+ break;
+ case 9:
+ if (sub_801ABDC(&gUnknown_02022C6C->a0, gText_BattleWasRefused, 1))
+ {
+ SetMainCallback2(CB2_ReturnToField);
+ }
+ break;
+ }
+ RunTasks();
+ RunTextPrinters();
+ AnimateSprites();
+ BuildOamBuffer();
+ UpdatePaletteFade();
+}
diff --git a/src/union_room_chat.c b/src/union_room_chat.c
index 85cfa6e2e..120252d36 100755
--- a/src/union_room_chat.c
+++ b/src/union_room_chat.c
@@ -2074,7 +2074,7 @@ static void sub_801FDDC(u8 left, u8 top, u8 initialCursorPos)
PutWindowTilemap(gUnknown_02022C88->unk18);
AddTextPrinterParameterized(gUnknown_02022C88->unk18, 1, gText_Yes, 8, 1, TEXT_SPEED_FF, NULL);
AddTextPrinterParameterized(gUnknown_02022C88->unk18, 1, gText_No, 8, 17, TEXT_SPEED_FF, NULL);
- sub_8098858(gUnknown_02022C88->unk18, 1, 13);
+ DrawTextBorderOuter(gUnknown_02022C88->unk18, 1, 13);
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(gUnknown_02022C88->unk18, 2, initialCursorPos);
}
}
@@ -2140,7 +2140,7 @@ static void sub_801FF18(int arg0, u16 arg1)
PutWindowTilemap(windowId);
if (gUnknown_082F2D40[arg0].unk4 == 1)
{
- sub_80989E0(windowId, 0xA, 2);
+ DrawTextBorderInner(windowId, 0xA, 2);
AddTextPrinterParameterized5(
windowId,
1,
@@ -2154,7 +2154,7 @@ static void sub_801FF18(int arg0, u16 arg1)
}
else
{
- sub_8098858(windowId, 0xA, 2);
+ DrawTextBorderOuter(windowId, 0xA, 2);
AddTextPrinterParameterized5(
windowId,
1,
@@ -2316,7 +2316,7 @@ static bool32 sub_8020368(void)
static void sub_80203B0(void)
{
FillWindowPixelBuffer(3, PIXEL_FILL(1));
- sub_8098858(3, 1, 13);
+ DrawTextBorderOuter(3, 1, 13);
PrintTextArray(3, 2, 8, 1, 14, 5, gUnknown_082F2DC8);
sub_81983AC(3, 2, 0, 1, 14, 5, sub_801F0B0());
PutWindowTilemap(3);
diff --git a/src/union_room_player_avatar.c b/src/union_room_player_avatar.c
new file mode 100644
index 000000000..61be86a37
--- /dev/null
+++ b/src/union_room_player_avatar.c
@@ -0,0 +1,611 @@
+#include "global.h"
+#include "constants/flags.h"
+#include "constants/event_object_movement_constants.h"
+#include "event_data.h"
+#include "event_object_movement.h"
+#include "script.h"
+#include "field_player_avatar.h"
+#include "fieldmap.h"
+#include "union_room.h"
+#include "task.h"
+
+EWRAM_DATA struct UnkStruct_8019BA8 * gUnknown_02022C64 = NULL;
+EWRAM_DATA u32 gUnknown_02022C68 = 0;
+
+static u8 sub_8019DF4(void);
+static u32 sub_8019F8C(u32 playerIdx, u32 arg1);
+static void sub_801A3B0(s32 arg0, s32 arg1, u8 arg2);
+
+ALIGNED(4) const u8 gUnknown_082F072C[][10] = {
+ {0x21, 0x2c, 0x1f, 0x23, 0x25, 0x24, 0x41, 0x42},
+ {0x22, 0x28, 0x20, 0x2f, 0x2f, 0x0e, 0x14, 0x2d}
+};
+
+static const s16 gUnknown_082F0740[][2] = {
+ {0x4, 0x6},
+ {0xd, 0x8},
+ {0xa, 0x6},
+ {0x1, 0x8},
+ {0xd, 0x4},
+ {0x7, 0x4},
+ {0x1, 0x4},
+ {0x7, 0x8}
+};
+
+static const s8 gUnknown_082F0760[][2] = {
+ { 0, 0},
+ { 1, 0},
+ { 0, -1},
+ {-1, 0},
+ { 0, 1}
+};
+
+static const u8 gUnknown_082F076A[] = {
+ 0x00, 0x02, 0x01, 0x04, 0x03
+};
+
+static const u8 gUnknown_082F076F[] = {
+ 0x01, 0x03, 0x01, 0x04, 0x02
+};
+
+static const u8 gUnknown_082F0774[] = {
+ 0x09, 0x08, 0x07, 0x02, 0x06, 0x05, 0x04, 0x03,
+ 0xbf, 0x02, 0xc0, 0x02, 0xc1, 0x02, 0xc2, 0x02,
+ 0xc3, 0x02, 0xc4, 0x02, 0xc5, 0x02, 0xc6, 0x02
+};
+
+static const u8 gUnknown_082F078C[2] = {
+ MOVEMENT_ACTION_FLY_UP,
+ MOVEMENT_ACTION_STEP_END
+};
+
+static const u8 gUnknown_082F078E[2] = {
+ MOVEMENT_ACTION_FLY_DOWN,
+ MOVEMENT_ACTION_STEP_END
+};
+
+static bool32 is_walking_or_running(void)
+{
+ if (gPlayerAvatar.tileTransitionState == 2 || gPlayerAvatar.tileTransitionState == 0)
+ {
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+}
+
+static u8 sub_8019978(u32 a0, u32 a1)
+{
+ return gUnknown_082F072C[a0][a1 % 8];
+}
+
+static void sub_8019990(u32 a0, u32 a1, s32 * a2, s32 * a3)
+{
+ *a2 = gUnknown_082F0740[a0][0] + gUnknown_082F0760[a1][0] + 7;
+ *a3 = gUnknown_082F0740[a0][1] + gUnknown_082F0760[a1][1] + 7;
+}
+
+static bool32 sub_80199E0(u32 a0, u32 a1, s32 a2, s32 a3)
+{
+ if (gUnknown_082F0740[a0][0] + gUnknown_082F0760[a1][0] + 7 != a2)
+ {
+ return FALSE;
+ }
+ else if (gUnknown_082F0740[a0][1] + gUnknown_082F0760[a1][1] + 7 != a3)
+ {
+ return FALSE;
+ }
+ else
+ {
+ return TRUE;
+ }
+}
+
+static bool32 IsUnionRoomPlayerHidden(u32 player_idx)
+{
+ return FlagGet(FLAG_HIDE_UNION_ROOM_PLAYER_1 + player_idx);
+}
+
+static void HideUnionRoomPlayer(u32 player_idx)
+{
+ FlagSet(FLAG_HIDE_UNION_ROOM_PLAYER_1 + player_idx);
+}
+
+static void ShowUnionRoomPlayer(u32 player_idx)
+{
+ FlagClear(FLAG_HIDE_UNION_ROOM_PLAYER_1 + player_idx);
+}
+
+static void SetUnionRoomPlayerGfx(u32 playerIdx, u32 gfxId)
+{
+ VarSet(VAR_OBJ_GFX_ID_0 + playerIdx, gfxId);
+}
+
+static void CreateUnionRoomPlayerEventObject(u32 playerIdx)
+{
+ show_sprite(gUnknown_082F0774[playerIdx], gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
+}
+
+static void RemoveUnionRoomPlayerEventObject(u32 playerIdx)
+{
+ RemoveEventObjectByLocalIdAndMap(gUnknown_082F0774[playerIdx], gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
+}
+
+static bool32 SetUnionRoomPlayerEnterExitMovement(u32 playerIdx, const u8 * movement)
+{
+ u8 objectId;
+ struct EventObject * object;
+ if (TryGetEventObjectIdByLocalIdAndMap(gUnknown_082F0774[playerIdx], gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &objectId))
+ {
+ return FALSE;
+ }
+ object = &gEventObjects[objectId];
+ if (EventObjectIsMovementOverridden(object))
+ {
+ return FALSE;
+ }
+ if (EventObjectSetHeldMovement(object, *movement))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+static bool32 sub_8019B3C(u32 playerIdx)
+{
+ u8 objectId;
+ struct EventObject * object;
+ if (TryGetEventObjectIdByLocalIdAndMap(gUnknown_082F0774[playerIdx], gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &objectId))
+ {
+ return TRUE;
+ }
+ object = &gEventObjects[objectId];
+ if (!EventObjectClearHeldMovementIfFinished(object))
+ {
+ return FALSE;
+ }
+ if (!ScriptContext2_IsEnabled())
+ {
+ UnfreezeEventObject(object);
+ }
+ else
+ {
+ FreezeEventObject(object);
+ }
+ return TRUE;
+}
+
+u8 sub_8019BA8(struct UnkStruct_8019BA8 * ptr)
+{
+ s32 i;
+
+ gUnknown_02022C68 = 0;
+ gUnknown_02022C64 = ptr;
+ for (i = 0; i < 8; i++)
+ {
+ ptr[i].field_0 = 0;
+ ptr[i].field_1 = 0;
+ ptr[i].field_2 = 0;
+ ptr[i].field_3 = 0;
+ }
+ return sub_8019DF4();
+}
+
+static bool32 sub_8019BDC(s8 * a0, u32 playerIdx, struct UnkStruct_8019BA8 * ptr)
+{
+ switch (*a0)
+ {
+ case 0:
+ if (SetUnionRoomPlayerEnterExitMovement(playerIdx, gUnknown_082F078C) == TRUE)
+ {
+ HideUnionRoomPlayer(playerIdx);
+ (*a0)++;
+ }
+ break;
+ case 1:
+ if (sub_8019B3C(playerIdx))
+ {
+ RemoveUnionRoomPlayerEventObject(playerIdx);
+ HideUnionRoomPlayer(playerIdx);
+ *a0 = 0;
+ return TRUE;
+ }
+ break;
+ }
+ return FALSE;
+}
+
+static bool32 sub_8019C38(s8 * a0, u32 playerIdx, struct UnkStruct_8019BA8 * ptr)
+{
+ s16 x, y;
+
+ switch (*a0)
+ {
+ case 0:
+ if (!is_walking_or_running())
+ {
+ break;
+ }
+ PlayerGetDestCoords(&x, &y);
+ if (sub_80199E0(playerIdx, 0, x, y) == 1)
+ {
+ break;
+ }
+ player_get_pos_including_state_based_drift(&x, &y);
+ if (sub_80199E0(playerIdx, 0, x, y) == 1)
+ {
+ break;
+ }
+ SetUnionRoomPlayerGfx(playerIdx, ptr->field_1);
+ CreateUnionRoomPlayerEventObject(playerIdx);
+ ShowUnionRoomPlayer(playerIdx);
+ (*a0)++;
+ // fallthrough
+ case 3: // incorrect?
+ if (SetUnionRoomPlayerEnterExitMovement(playerIdx, gUnknown_082F078E) == 1)
+ {
+ (*a0)++;
+ }
+ break;
+ case 2:
+ if (sub_8019B3C(playerIdx))
+ {
+ *a0 = 0;
+ return TRUE;
+ }
+ break;
+ }
+ return FALSE;
+}
+
+static bool32 sub_8019CF0(u32 playerIdx, u32 a1, u32 a2)
+{
+ struct UnkStruct_8019BA8 * ptr = &gUnknown_02022C64[playerIdx];
+ ptr->field_3 = 1;
+ ptr->field_1 = sub_8019978(a1, a2);
+ if (ptr->field_0 == 0)
+ {
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+}
+
+static bool32 sub_8019D20(u32 playerIdx)
+{
+ struct UnkStruct_8019BA8 * ptr = &gUnknown_02022C64[playerIdx];
+ ptr->field_3 = 2;
+ if (ptr->field_0 == 1)
+ {
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+}
+
+static void sub_8019D44(u32 playerIdx, struct UnkStruct_8019BA8 * ptr)
+{
+ switch (ptr->field_0)
+ {
+ case 0:
+ if (ptr->field_3 == 1)
+ {
+ ptr->field_0 = 2;
+ ptr->field_2 = 0;
+ }
+ else
+ {
+ break;
+ }
+ // fallthrough
+ case 2:
+ if (!sub_8019F8C(playerIdx, 0) && ptr->field_3 == 2)
+ {
+ ptr->field_0 = 0;
+ ptr->field_2 = 0;
+ RemoveUnionRoomPlayerEventObject(playerIdx);
+ HideUnionRoomPlayer(playerIdx);
+ }
+ else if (sub_8019C38(&ptr->field_2, playerIdx, ptr) == 1)
+ {
+ ptr->field_0 = 1;
+ }
+ break;
+ case 1:
+ if (ptr->field_3 == 2)
+ {
+ ptr->field_0 = 3;
+ ptr->field_2 = 0;
+ }
+ else
+ {
+ break;
+ }
+ // fallthrough
+ case 3:
+ if (sub_8019BDC(&ptr->field_2, playerIdx, ptr) == 1)
+ {
+ ptr->field_0 = 0;
+ }
+ break;
+ }
+ ptr->field_3 = 0;
+}
+
+static void sub_8019DD0(u8 taskId)
+{
+ s32 i;
+ for (i = 0; i < 8; i++)
+ {
+ sub_8019D44(i, &gUnknown_02022C64[i]);
+ }
+}
+
+static u8 sub_8019DF4(void)
+{
+ if (FuncIsActiveTask(sub_8019DD0) == 1)
+ {
+ return NUM_TASKS;
+ }
+ else
+ {
+ return CreateTask(sub_8019DD0, 5);
+ }
+}
+
+static void sub_8019E20(void)
+{
+ u8 taskId = FindTaskIdByFunc(sub_8019DD0);
+ if (taskId < NUM_TASKS)
+ {
+ DestroyTask(taskId);
+ }
+}
+
+void sub_8019E3C(void)
+{
+ s32 i;
+ for (i = 0; i < 8; i++)
+ {
+ if (!IsUnionRoomPlayerHidden(i))
+ {
+ RemoveUnionRoomPlayerEventObject(i);
+ HideUnionRoomPlayer(i);
+ }
+ }
+ gUnknown_02022C64 = NULL;
+ sub_8019E20();
+}
+
+void sub_8019E70(u8 * sp8, s32 r9)
+{
+ s32 r7;
+
+ for (r7 = 0; r7 < 5; r7++)
+ {
+ s32 r5 = 5 * r9 + r7;
+ sp8[r5] = sprite_new(0x41, r5 - 0x38, gUnknown_082F0740[r9][0] + gUnknown_082F0760[r7][0], gUnknown_082F0740[r9][1] + gUnknown_082F0760[r7][1], 3, 1);
+ sub_8097C44(r5 - 0x38, TRUE);
+ }
+}
+
+void sub_8019F04(u8 * r5)
+{
+ s32 i;
+ for (i = 0; i < 40; i++)
+ {
+ DestroySprite(&gSprites[r5[i]]);
+ }
+}
+
+void sub_8019F2C(void)
+{
+ s32 i, j, x, y;
+ for (i = 0; i < 8; i++)
+ {
+ for (j = 0; j < 5; j++)
+ {
+ sub_8019990(i, j, &x, &y);
+ sub_8088B94(x, y, 0);
+ }
+ }
+}
+
+static u8 sub_8019F64(u32 r1, u32 unused, struct UnkLinkRfuStruct_02022B14 * r2)
+{
+ if (r1 != 0)
+ {
+ return gUnknown_082F076F[r1];
+ }
+ else if (r2->unk_0a_0 == 0x45)
+ {
+ return 1;
+ }
+ else
+ {
+ return 4;
+ }
+}
+
+static u32 sub_8019F8C(u32 a0, u32 a1)
+{
+ return sub_8097C8C(5 * a0 + a1 - 0x38);
+}
+
+static void sub_8019FA4(u32 r5, u32 r6, u8 r8, struct UnkLinkRfuStruct_02022B14 * r9)
+{
+ s32 x, y;
+ s32 r7 = 5 * r5 + r6;
+ if (sub_8019F8C(r5, r6) == 1)
+ {
+ sub_8097C44(r7 - 0x38, FALSE);
+ sub_8097CC4(r7 - 0x38, 1);
+ }
+ sub_8097BB4(r7 - 0x38, r8);
+ sub_801A3B0(r6, r5, sub_8019F64(r6, r5, r9));
+ sub_8019990(r5, r6, &x, &y);
+ sub_8088B94(x, y, 1);
+}
+
+static void sub_801A02C(u32 a0, u32 a1)
+{
+ s32 x, y;
+ sub_8097CC4(5 * a0 + a1 - 0x38, 2);
+ sub_8019990(a0, a1, &x, &y);
+ sub_8088B94(x, y, 0);
+}
+
+static void sub_801A064(u32 r7, struct UnkLinkRfuStruct_02022B14 * r8)
+{
+ s16 x, y, x2, y2;
+ s32 i;
+
+ PlayerGetDestCoords(&x, &y);
+ player_get_pos_including_state_based_drift(&x2, &y2);
+ if (sub_8097C8C(5 * r7 - 0x38) == 1)
+ {
+ if (sub_80199E0(r7, 0, x, y) == 1 || sub_80199E0(r7, 0, x2, y2) == 1)
+ {
+ return;
+ }
+ sub_8019FA4(r7, 0, sub_8019978(r8->playerGender, r8->unk_00.playerTrainerId[0]), r8);
+ }
+ for (i = 1; i < 5; i++)
+ {
+ if (r8->unk_04[i - 1] == 0)
+ {
+ sub_801A02C(r7, i);
+ }
+ else if (sub_80199E0(r7, i, x, y) == 0 && sub_80199E0(r7, i, x2, y2) == 0)
+ {
+ sub_8019FA4(r7, i, sub_8019978((r8->unk_04[i - 1] >> 3) & 1, r8->unk_04[i - 1] & 7), r8);
+ }
+ }
+}
+
+static void sub_801A16C(u32 r5, struct UnkLinkRfuStruct_02022B14 * r4)
+{
+ u32 i;
+ switch (r4->unk_0a_0)
+ {
+ case 0x40:
+ case 0x54:
+ sub_8019CF0(r5, r4->playerGender, r4->unk_00.playerTrainerId[0]);
+ for (i = 0; i < 5; i++)
+ {
+ sub_801A02C(r5, i);
+ }
+ break;
+ case 0x41:
+ case 0x44:
+ case 0x45:
+ case 0x48:
+ case 0x51:
+ case 0x52:
+ case 0x53:
+ sub_8019D20(r5);
+ sub_801A064(r5, r4);
+ break;
+ }
+}
+
+static void sub_801A214(u32 r5, struct UnkLinkRfuStruct_02022B14 * unused)
+{
+ s32 i;
+ sub_8019D20(r5);
+ for (i = 0; i < 5; i++)
+ {
+ sub_801A02C(r5, i);
+ }
+}
+
+static void sub_801A234(struct UnkStruct_URoom *r0)
+{
+ s32 i;
+ struct UnkStruct_x20 * r4;
+ gUnknown_02022C68 = 0;
+ for (i = 0, r4 = r0->field_0->arr; i < 8; i++)
+ {
+ if (r4[i].field_1A_0 == 1)
+ {
+ sub_801A16C(i, &r4[i].unk.field_0);
+ }
+ else if (r4[i].field_1A_0 == 2)
+ {
+ sub_801A214(i, &r4[i].unk.field_0);
+ }
+ }
+}
+
+void sub_801A274(struct UnkStruct_URoom *unused)
+{
+ gUnknown_02022C68 = 300;
+}
+
+void sub_801A284(struct UnkStruct_URoom *r2)
+{
+ if (++gUnknown_02022C68 > 300)
+ {
+ sub_801A234(r2);
+ }
+}
+
+bool32 sub_801A2A8(struct UnkStruct_Main0 *arg0, s16 *arg1, s16 *arg2, u8 *arg3)
+{
+ s16 x, y;
+ s32 i, j;
+ struct UnkStruct_x20 * r4;
+ if (!is_walking_or_running())
+ {
+ return FALSE;
+ }
+ GetXYCoordsOneStepInFrontOfPlayer(&x, &y);
+ for (i = 0, r4 = arg0->arr; i < 8; i++)
+ {
+ for (j = 0; j < 5; j++)
+ {
+ s32 r3 = 5 * i + j;
+ if (x != gUnknown_082F0740[i][0] + gUnknown_082F0760[j][0] + 7)
+ {
+ continue;
+ }
+ if (y != gUnknown_082F0740[i][1] + gUnknown_082F0760[j][1] + 7)
+ {
+ continue;
+ }
+ if (sub_8097C8C(r3 - 0x38) != 0)
+ {
+ continue;
+ }
+ if (sub_8097D9C(r3 - 0x38) != 0)
+ {
+ continue;
+ }
+ if (r4[i].field_1A_0 != 1)
+ {
+ continue;
+ }
+ sub_801A3B0(j, i, gUnknown_082F076A[GetPlayerFacingDirection()]);
+ *arg1 = j;
+ *arg2 = i;
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+static void sub_801A3B0(s32 arg0, s32 arg1, u8 arg2)
+{
+ sub_8097B78(5 * arg1 - 0x38 + arg0, arg2);
+}
+
+void sub_801A3D0(u32 arg0, u32 arg1, struct UnkStruct_Main0 *arg2)
+{
+ return sub_801A3B0(arg0, arg1, sub_8019F64(arg0, arg1, &arg2->arr[arg1].unk.field_0));
+}
diff --git a/src/use_pokeblock.c b/src/use_pokeblock.c
index 6df826214..4eaf60be4 100644
--- a/src/use_pokeblock.c
+++ b/src/use_pokeblock.c
@@ -617,7 +617,7 @@ void sub_8166D44(void)
StringAppend(stringBuffer, gText_GetsAPokeBlockQuestion);
StringCopy(gStringVar4, stringBuffer);
FillWindowPixelBuffer(2, 17);
- sub_8098858(2, 151, 14);
+ DrawTextBorderOuter(2, 151, 14);
AddTextPrinterParameterized(2, 1, gStringVar4, 0, 1, 0, NULL);
PutWindowTilemap(2);
CopyWindowToVram(2, 3);
@@ -645,7 +645,7 @@ s8 sub_8166DE4(void)
void sub_8166E24(void)
{
- sub_8098858(2, 151, 14);
+ DrawTextBorderOuter(2, 151, 14);
FillWindowPixelBuffer(2, 17);
for (gUnknown_0203BC90->field_53 = 0; gUnknown_0203BC90->field_53 < 5; gUnknown_0203BC90->field_53++)
@@ -693,7 +693,7 @@ bool8 sub_8166EDC(void)
void sub_8166F50(void)
{
FillWindowPixelBuffer(2, 17);
- sub_8098858(2, 151, 14);
+ DrawTextBorderOuter(2, 151, 14);
AddTextPrinterParameterized(2, 1, gText_WontEatAnymore, 0, 1, 0, NULL);
PutWindowTilemap(2);
CopyWindowToVram(2, 3);
diff --git a/sym_bss.txt b/sym_bss.txt
index 25ca7c625..58b1312dc 100644
--- a/sym_bss.txt
+++ b/sym_bss.txt
@@ -8,6 +8,7 @@
.include "src/link.o"
.include "src/link_rfu.o"
.include "src/union_room.o"
+ .include "src/union_room_battle.o"
.include "src/rtc.o"
.include "src/main_menu.o"
.include "src/rom_8034C54.o"
diff --git a/sym_ewram.txt b/sym_ewram.txt
index 50235ee72..fa0306b1e 100644
--- a/sym_ewram.txt
+++ b/sym_ewram.txt
@@ -7,34 +7,17 @@
.include "src/link.o"
.include "src/link_rfu.o"
.include "src/union_room.o"
-
-gUnknown_02022C58: @ 2022C58
- .space 0x8
-
-gUnknown_02022C60: @ 2022C60
- .space 0x4
-
-gUnknown_02022C64: @ 2022C64
- .space 0x4
-
-gUnknown_02022C68: @ 2022C68
- .space 0x4
-
-gUnknown_02022C6C: @ 2022C6C
- .space 0x4
-
+ .include "src/mystery_gift.o"
+ .include "src/union_room_player_avatar.o"
+ .include "src/union_room_battle.o"
.include "src/mevent2.o"
+ .include "src/mevent_801BAAC.o"
-gUnknown_02022C74: @ 2022C74
- .space 0x4
-
-gUnknown_02022C78: @ 2022C78
- .space 0x4
-
+ @ mevent_server
gUnknown_02022C7C: @ 2022C7C
.space 0x4
-gUnknown_02022C80: @ 2022C80
+s_mevent_srv_ish_ptr: @ 2022C80
.space 0x4
gUnknown_02022C84: @ 2022C84
@@ -149,11 +132,7 @@ gUnknown_02022D00: @ 2022D00
.include "src/decoration.o"
.include "src/slot_machine.o"
.include "src/battle_ai_script_commands.o"
-
-.align 2
-gPlayerFacingPosition: @ 203AB40
- .space 0x8
-
+ .include "src/fldeff_misc.o"
.include "src/pokeblock.o"
.include "src/field_specials.o"
.include "src/battle_records.o"
diff --git a/tools/gbafix/gbafix.c b/tools/gbafix/gbafix.c
index d5e2f62ab..81c8c04c0 100644
--- a/tools/gbafix/gbafix.c
+++ b/tools/gbafix/gbafix.c
@@ -160,7 +160,7 @@ int main(int argc, char *argv[])
// get filename
for (arg=1; arg<argc; arg++)
{
- if ((ARGV[0] != '-')) { argfile=ARGV; }
+ if (ARGV[0] != '-') { argfile=ARGV; }
if (strncmp("--silent", &ARGV[0], 7) == 0) { silent = 1; }
}