summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2017-05-20 11:41:21 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2017-05-20 11:41:21 -0400
commit4cdeb15831cde9e02b8e3cdcf8496316d666f26f (patch)
treeb360d44c0ab7f6b8c6030b9660a01bbb1eaefe30
parent37e3c21eb38449690f995b7e5258bf00ce9a77c2 (diff)
sub_80C019C
-rw-r--r--asm/tv.s35
-rw-r--r--src/tv.c10
2 files changed, 10 insertions, 35 deletions
diff --git a/asm/tv.s b/asm/tv.s
index b6f05fb4d..49842e24c 100644
--- a/asm/tv.s
+++ b/asm/tv.s
@@ -1613,41 +1613,6 @@ _080BE474: .4byte gSaveBlock2
.section .text_80BE8EC
- thumb_func_start sub_80C019C
-sub_80C019C: @ 80C019C
- push {lr}
- adds r3, r0, 0
- movs r2, 0
-_080C01A2:
- lsls r0, r2, 3
- adds r0, r2
- lsls r0, 2
- adds r1, r0, r3
- ldrb r0, [r1, 0x1]
- cmp r0, 0
- bne _080C01C2
- ldrb r0, [r1]
- subs r0, 0x1
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0x3B
- bhi _080C01C2
- lsls r0, r2, 24
- asrs r0, 24
- b _080C01D0
-_080C01C2:
- adds r0, r2, 0x1
- lsls r0, 24
- lsrs r2, r0, 24
- cmp r2, 0x17
- bls _080C01A2
- movs r0, 0x1
- negs r0, r0
-_080C01D0:
- pop {r1}
- bx r1
- thumb_func_end sub_80C019C
-
thumb_func_start sub_80C01D4
sub_80C01D4: @ 80C01D4
push {r4-r6,lr}
diff --git a/src/tv.c b/src/tv.c
index 2784b0cd1..3777bd33a 100644
--- a/src/tv.c
+++ b/src/tv.c
@@ -1659,6 +1659,16 @@ u8 sub_80C0134(TVShow *tv1, TVShow *tv2, u8 idx) {
return TRUE;
}
+s8 sub_80C019C(TVShow tvShows[]) {
+ u8 i;
+ for (i=0; i<24; i++) {
+ if (tvShows[i].common.var01 == 0 && (u8)(tvShows[i].common.var00 - 1) < 60) {
+ return i;
+ }
+ }
+ return -1;
+}
+
asm(".section .dotvshow\n");
void DoTVShowPokemonFanClubLetter(void);