summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asm/tv.s45
-rw-r--r--include/global.h1
-rw-r--r--ld_script.txt3
-rw-r--r--src/tv.c18
4 files changed, 21 insertions, 46 deletions
diff --git a/asm/tv.s b/asm/tv.s
index ca2e5e410..58030eb88 100644
--- a/asm/tv.s
+++ b/asm/tv.s
@@ -7,51 +7,6 @@
.text
- thumb_func_start ClearTVShowData
-ClearTVShowData: @ 80BD7A8
- push {r4-r7,lr}
- movs r3, 0
- ldr r6, _080BD7F0 @ =gSaveBlock1
- movs r4, 0
- ldr r0, _080BD7F4 @ =0x0000273a
- adds r5, r6, r0
-_080BD7B4:
- lsls r2, r3, 3
- adds r2, r3
- lsls r2, 2
- adds r1, r2, r6
- ldr r7, _080BD7F8 @ =0x00002738
- adds r0, r1, r7
- strb r4, [r0]
- ldr r0, _080BD7FC @ =0x00002739
- adds r1, r0
- strb r4, [r1]
- movs r1, 0
- adds r3, 0x1
-_080BD7CC:
- adds r0, r1, r2
- adds r0, r5
- strb r4, [r0]
- adds r0, r1, 0x1
- lsls r0, 24
- lsrs r1, r0, 24
- cmp r1, 0x21
- bls _080BD7CC
- lsls r0, r3, 24
- lsrs r3, r0, 24
- cmp r3, 0x18
- bls _080BD7B4
- bl sub_80BEBF4
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_080BD7F0: .4byte gSaveBlock1
-_080BD7F4: .4byte 0x0000273a
-_080BD7F8: .4byte 0x00002738
-_080BD7FC: .4byte 0x00002739
- thumb_func_end ClearTVShowData
-
thumb_func_start special_0x44
special_0x44: @ 80BD800
push {r4-r7,lr}
diff --git a/include/global.h b/include/global.h
index 8e6be79da..4f1e189ba 100644
--- a/include/global.h
+++ b/include/global.h
@@ -194,6 +194,7 @@ struct EasyChatPair
struct TVShowCommon {
/*0x00*/ u8 var00;
/*0x01*/ u8 var01;
+ /*0x02*/ u8 pad02[34];
};
struct TVShowFanClubLetter {
diff --git a/ld_script.txt b/ld_script.txt
index 13c9b25ae..fd57b31d6 100644
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -176,8 +176,9 @@ SECTIONS {
asm/sound_check_menu.o(.text);
src/secret_base.o(.text);
asm/secret_base.o(.text_80BC1D0);
+ src/tv.o(.text);
asm/tv.o(.text);
- src/tv.o(.text);
+ src/tv.o(.text_a);
asm/tv.o(.text_80BE8EC);
src/tv.o(.text_b);
asm/tv.o(.text_80BF544);
diff --git a/src/tv.c b/src/tv.c
index c0d4bde4d..c312091e0 100644
--- a/src/tv.c
+++ b/src/tv.c
@@ -40,6 +40,24 @@ extern u8 gSpeciesNames[][11];
extern u8 *gTVPokemonOutbreakTextGroup[];
extern struct OutbreakPokemon gPokeOutbreakSpeciesList[5];
+extern void sub_80BEBF4(void);
+
+void ClearTVShowData(void)
+{
+ u8 showidx;
+ u8 extradataidx;
+ for (showidx=0; showidx<25; showidx++) {
+ gSaveBlock1.tvShows[showidx].common.var00 = 0;
+ gSaveBlock1.tvShows[showidx].common.var01 = 0;
+ for (extradataidx=0; extradataidx<34; extradataidx++) {
+ gSaveBlock1.tvShows[showidx].common.pad02[extradataidx] = 0;
+ }
+ }
+ sub_80BEBF4();
+}
+
+asm(".section .text_a");
+
void sub_80BE478(void)
{
u16 playerNameLength;