summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2017-05-20 19:51:00 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2017-05-20 19:51:00 -0400
commita0fb46bbb40b800af0c55366de479ca977de1aa4 (patch)
treeb98e981560bd28df49cc7f18b13d33a1c4739740
parenta9b2b463ac3842ae2d38c174f34df420b9246519 (diff)
sub_80BE23C
-rw-r--r--asm/tv.s35
-rw-r--r--include/global.h6
-rw-r--r--src/tv.c35
3 files changed, 28 insertions, 48 deletions
diff --git a/asm/tv.s b/asm/tv.s
index 97e6679a3..d5cd885a7 100644
--- a/asm/tv.s
+++ b/asm/tv.s
@@ -1341,41 +1341,6 @@ _080BE234: .4byte 0xfffffca0
_080BE238: .4byte gSaveBlock2
thumb_func_end sub_80BE188
- thumb_func_start sub_80BE23C
-sub_80BE23C: @ 80BE23C
- push {r4-r6,lr}
- lsls r0, 16
- lsrs r6, r0, 16
- ldr r4, _080BE278 @ =gSaveBlock1 + 0x2A98
- bl sub_80BF484
- ldr r0, _080BE27C @ =0xfffffca0
- adds r5, r4, r0
- adds r0, r5, 0
- bl sub_80BF720
- ldr r1, _080BE280 @ =gUnknown_03005D38
- strb r0, [r1]
- lsls r0, 24
- asrs r0, 24
- movs r1, 0x1
- negs r1, r1
- cmp r0, r1
- beq _080BE270
- adds r0, r5, 0
- movs r1, 0x18
- bl sub_80BF55C
- strh r6, [r4, 0x14]
- movs r0, 0x6
- strb r0, [r4]
-_080BE270:
- pop {r4-r6}
- pop {r0}
- bx r0
- .align 2, 0
-_080BE278: .4byte gSaveBlock1 + 0x2A98
-_080BE27C: .4byte 0xfffffca0
-_080BE280: .4byte gUnknown_03005D38
- thumb_func_end sub_80BE23C
-
.section .text_80BE8EC
thumb_func_start sub_80C04A0
diff --git a/include/global.h b/include/global.h
index 6528da35d..a0b6db39d 100644
--- a/include/global.h
+++ b/include/global.h
@@ -338,13 +338,13 @@ struct TVShowBravoTrainerPokemonProfiles {
/*0x00*/ u8 var00;
/*0x01*/ u8 var01;
/*0x02*/ u16 species;
- /*0x04*/ u8 pad04[4];
+ /*0x04*/ u16 var04[2];
/*0x08*/ u8 pokemonNickname[11];
/*0x13*/ u8 contestCategory:3;
/*0x13*/ u8 contestRank:2;
/*0x13*/ u8 var13_5:2;
/*0x13*/ u8 var13_7:1;
- /*0x14*/
+ /*0x14*/ u16 var14;
};
struct TVShowBravoTrainerBattleTowerSpotlight {
@@ -355,7 +355,7 @@ struct TVShowBravoTrainerBattleTowerSpotlight {
/*0x0C*/ u8 pokemonName[8];
/*0x14*/ u16 winningMove;
/*0x16*/ u16 var16;
- /*0x18*/ u8 pad18[2];
+ /*0x18*/ u16 var18[1];
/*0x1A*/ u8 btLevel;
/*0x1B*/ u8 var1b;
/*0x1C*/ u8 var1c;
diff --git a/src/tv.c b/src/tv.c
index a8e1714e0..e27232e38 100644
--- a/src/tv.c
+++ b/src/tv.c
@@ -104,9 +104,32 @@ extern u16 sub_8135D3C(u8);
extern u8 gScriptContestCategory;
extern u8 gScriptContestRank;
+void sub_80BF334(void);
+void sub_80BF3A4(void);
+void sub_80BF3DC(void);
+void sub_80BF46C(void);
+void sub_80BF478(void);
+void sub_80BF484(void);
+void sub_80BF4BC(void);
+
asm(".section .text_a");
s8 sub_80BF74C(TVShow tvShow[]);
+void sub_80BF55C(TVShow tvShow[], u8 showidx);
+void sub_80BEA88(void);
+
+void sub_80BE23C(u16 a0) {
+ TVShow *show;
+ show = &gSaveBlock1.tvShows.unknown_2A98;
+ sub_80BF484();
+ gUnknown_03005D38.var0 = sub_80BF720(gSaveBlock1.tvShows.shows);
+ if (gUnknown_03005D38.var0 != -1) {
+ sub_80BF55C(gSaveBlock1.tvShows.shows, 24);
+ show->bravoTrainer.var14 = a0;
+ show->bravoTrainer.var00 = TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE;
+ }
+}
+
void sub_80BE284(u8 a0) {
TVShow *show;
show = &gSaveBlock1.tvShows.unknown_2A98;
@@ -889,14 +912,6 @@ void sub_80BF25C(u8 showType)
sub_80BF6D8();
}
-void sub_80BF334(void);
-void sub_80BF3A4(void);
-void sub_80BF3DC(void);
-void sub_80BF46C(void);
-void sub_80BF478(void);
-void sub_80BF484(void);
-void sub_80BF4BC(void);
-
void sub_80BF2C4(void)
{
gScriptResult = 0;
@@ -975,7 +990,7 @@ void sub_80BF484(void)
sub_80BF25C(TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE);
if (gScriptResult == 0) {
show = &gSaveBlock1.tvShows.shows[gUnknown_03005D38.var0];
- sub_80EB6FC(show->recentHappenings.var04, 2); // wrong struct ident, fix later
+ sub_80EB6FC(show->bravoTrainer.var04, 2);
}
}
@@ -985,7 +1000,7 @@ void sub_80BF4BC(void)
sub_80BF25C(TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE);
if (gScriptResult == 0) {
show = &gSaveBlock1.tvShows.shows[gUnknown_03005D38.var0];
- sub_80EB6FC(show->fanclubOpinions.var18, 1); // wrong struct ident, fix later
+ sub_80EB6FC(show->bravoTrainerTower.var18, 1); // wrong struct ident, fix later
}
}