summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2017-05-19 11:32:40 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2017-05-19 11:32:40 -0400
commit63f05cfc7c3634545a9230b0ce41259bcc61aef0 (patch)
tree821782a3d9cd90c1e5ad0f55bad54d1653ca80ca
parentbade8566271df0ef7f27370573561f4d03f2caf5 (diff)
Plug another hole in tv.c
-rw-r--r--asm/tv.s100
-rw-r--r--include/global.h4
-rw-r--r--ld_script.txt2
-rw-r--r--src/tv.c48
4 files changed, 40 insertions, 114 deletions
diff --git a/asm/tv.s b/asm/tv.s
index 2019337af..cb9b6d0d5 100644
--- a/asm/tv.s
+++ b/asm/tv.s
@@ -4925,104 +4925,4 @@ nullsub_22: @ 80C1BF4
bx lr
thumb_func_end nullsub_22
-.section .text_80C1C5C
-
- thumb_func_start DoTVShowTheWorldOfMasters
-DoTVShowTheWorldOfMasters: @ 80C1F08
- push {r4-r6,lr}
- ldr r0, _080C1F30 @ =gSpecialVar_0x8004
- ldrh r1, [r0]
- lsls r0, r1, 3
- adds r0, r1
- lsls r0, 2
- ldr r1, _080C1F34 @ =gSaveBlock1 + 0x2738
- adds r4, r0, r1
- ldr r1, _080C1F38 @ =gScriptResult
- movs r0, 0
- strh r0, [r1]
- ldr r6, _080C1F3C @ =gUnknown_020387E8
- ldrb r5, [r6]
- cmp r5, 0x1
- beq _080C1F6C
- cmp r5, 0x1
- bgt _080C1F40
- cmp r5, 0
- beq _080C1F46
- b _080C1FB6
- .align 2, 0
-_080C1F30: .4byte gSpecialVar_0x8004
-_080C1F34: .4byte gSaveBlock1 + 0x2738
-_080C1F38: .4byte gScriptResult
-_080C1F3C: .4byte gUnknown_020387E8
-_080C1F40:
- cmp r5, 0x2
- beq _080C1F8C
- b _080C1FB6
-_080C1F46:
- ldr r0, _080C1F68 @ =gStringVar1
- adds r1, r4, 0
- adds r1, 0x13
- ldrb r2, [r4, 0xB]
- bl TVShowConvertInternationalString
- ldrh r1, [r4, 0x6]
- movs r0, 0x1
- bl sub_80BF088
- ldrh r1, [r4, 0x2]
- movs r0, 0x2
- bl sub_80BF088
- movs r0, 0x1
- strb r0, [r6]
- b _080C1FB6
- .align 2, 0
-_080C1F68: .4byte gStringVar1
-_080C1F6C:
- ldr r0, _080C1F84 @ =gStringVar1
- ldrh r2, [r4, 0x8]
- movs r1, 0xB
- muls r1, r2
- ldr r2, _080C1F88 @ =gSpeciesNames
- adds r1, r2
- bl StringCopy
- movs r0, 0x2
- strb r0, [r6]
- b _080C1FB6
- .align 2, 0
-_080C1F84: .4byte gStringVar1
-_080C1F88: .4byte gSpeciesNames
-_080C1F8C:
- ldr r0, _080C1FC8 @ =gStringVar1
- adds r1, r4, 0
- adds r1, 0x13
- ldrb r2, [r4, 0xB]
- bl TVShowConvertInternationalString
- ldr r0, _080C1FCC @ =gStringVar2
- ldrb r1, [r4, 0xA]
- movs r2, 0
- bl sub_80FBFB4
- ldr r0, _080C1FD0 @ =gStringVar3
- ldrh r2, [r4, 0x4]
- movs r1, 0xB
- muls r1, r2
- ldr r2, _080C1FD4 @ =gSpeciesNames
- adds r1, r2
- bl StringCopy
- bl TVShowDone
-_080C1FB6:
- ldr r0, _080C1FD8 @ =gTVWorldOfMastersTextGroup
- lsls r1, r5, 2
- adds r1, r0
- ldr r0, [r1]
- bl ShowFieldMessage
- pop {r4-r6}
- pop {r0}
- bx r0
- .align 2, 0
-_080C1FC8: .4byte gStringVar1
-_080C1FCC: .4byte gStringVar2
-_080C1FD0: .4byte gStringVar3
-_080C1FD4: .4byte gSpeciesNames
-_080C1FD8: .4byte gTVWorldOfMastersTextGroup
- thumb_func_end DoTVShowTheWorldOfMasters
-
-
.align 2, 0 @ Don't pad with nop.
diff --git a/include/global.h b/include/global.h
index 17fd3c4a5..cd7bdcdb3 100644
--- a/include/global.h
+++ b/include/global.h
@@ -276,7 +276,7 @@ struct TVShowPokemonAngler {
/*0x13*/ u8 playerName[8];
};
-struct TVShowUnknownTVShowType2 {
+struct TVShowWorldOfMasters {
/*0x00*/ u8 var00;
/*0x01*/ u8 var01;
/*0x02*/ u16 var02;
@@ -314,7 +314,7 @@ typedef union TVShow {
struct TVShowNameRaterShow nameRaterShow;
struct TVShowMassOutbreak massOutbreak;
struct TVShowPokemonAngler pokemonAngler;
- struct TVShowUnknownTVShowType2 unknownTvShowType2;
+ struct TVShowWorldOfMasters worldOfMasters;
struct TVShowSmartShopper smartshopperShow;
struct TVShowContestWinner contestShow;
} TVShow;
diff --git a/ld_script.txt b/ld_script.txt
index 78da2ea81..4f0203800 100644
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -181,8 +181,6 @@ SECTIONS {
src/tv.o(.text_a);
asm/tv.o(.text_80BE8EC);
src/tv.o(.text_c);
- asm/tv.o(.text_80C1C5C);
- src/tv.o(.text_d);
asm/contest_link_80C2020.o(.text);
src/script_pokemon_util_80C4BF0.o(.text);
src/field_poison.o(.text);
diff --git a/src/tv.c b/src/tv.c
index 46c46965a..a371e17f7 100644
--- a/src/tv.c
+++ b/src/tv.c
@@ -54,6 +54,7 @@ extern u8 gMoveNames[][13];
extern u8 *gTVPokemonOutbreakTextGroup[];
extern u8 *gTVGabbyAndTyTextGroup[];
extern u8 *gTVFishingGuruAdviceTextGroup[];
+extern u8 *gTVWorldOfMastersTextGroup[];
extern struct OutbreakPokemon gPokeOutbreakSpeciesList[5];
extern void sub_80BEBF4(void);
@@ -428,16 +429,16 @@ void sub_80BEA88(void)
if (gUnknown_03005D38.var0 != -1 && sub_80BF1B4(0x19) != 1)
{
tvShow = &gSaveBlock1.tvShows.shows[gUnknown_03005D38.var0];
- tvShow->unknownTvShowType2.var00 = 0x19;
- tvShow->unknownTvShowType2.var01 = rval;
- tvShow->unknownTvShowType2.var02 = unk_2a98->var02;
- tvShow->unknownTvShowType2.var06 = GetGameStat(GAME_STAT_STEPS) - unk_2a98->var06;
- tvShow->unknownTvShowType2.var04 = unk_2a98->var04;
- tvShow->unknownTvShowType2.var08 = unk_2a98->var08;
- tvShow->unknownTvShowType2.var0a = unk_2a98->var0a;
- StringCopy(tvShow->unknownTvShowType2.playerName, gSaveBlock2.playerName);
+ tvShow->worldOfMasters.var00 = 0x19;
+ tvShow->worldOfMasters.var01 = rval;
+ tvShow->worldOfMasters.var02 = unk_2a98->var02;
+ tvShow->worldOfMasters.var06 = GetGameStat(GAME_STAT_STEPS) - unk_2a98->var06;
+ tvShow->worldOfMasters.var04 = unk_2a98->var04;
+ tvShow->worldOfMasters.var08 = unk_2a98->var08;
+ tvShow->worldOfMasters.var0a = unk_2a98->var0a;
+ StringCopy(tvShow->worldOfMasters.playerName, gSaveBlock2.playerName);
sub_80BE138(tvShow);
- tvShow->unknownTvShowType2.language = GAME_LANGUAGE;
+ tvShow->worldOfMasters.language = GAME_LANGUAGE;
}
}
}
@@ -1712,7 +1713,34 @@ void DoTVShowPokemonAngler(void) {
ShowFieldMessage(gTVFishingGuruAdviceTextGroup[switchval]);
}
-asm(".section .text_d");
+void DoTVShowTheWorldOfMasters(void) {
+ TVShow *tvShow;
+ u8 switchval;
+ tvShow = &gSaveBlock1.tvShows.shows[gSpecialVar_0x8004];
+ gScriptResult = 0;
+ switchval = gUnknown_020387E8;
+ switch (switchval) {
+ case 0:
+ TVShowConvertInternationalString(gStringVar1, tvShow->worldOfMasters.playerName,
+ tvShow->worldOfMasters.language);
+ sub_80BF088(1, tvShow->worldOfMasters.var06);
+ sub_80BF088(2, tvShow->worldOfMasters.var02);
+ gUnknown_020387E8 = 1;
+ break;
+ case 1:
+ StringCopy(gStringVar1, gSpeciesNames[tvShow->worldOfMasters.var08]);
+ gUnknown_020387E8 = 2;
+ break;
+ case 2:
+ TVShowConvertInternationalString(gStringVar1, tvShow->worldOfMasters.playerName,
+ tvShow->worldOfMasters.language);
+ sub_80FBFB4(gStringVar2, tvShow->worldOfMasters.var0a, 0);
+ StringCopy(gStringVar3, gSpeciesNames[tvShow->worldOfMasters.var04]);
+ TVShowDone();
+ break;
+ }
+ ShowFieldMessage(gTVWorldOfMastersTextGroup[switchval]);
+}
void TVShowDone(void)
{