summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorscnorton <scnorton@biociphers.org>2017-06-21 12:02:53 -0400
committerscnorton <scnorton@biociphers.org>2017-06-21 12:02:53 -0400
commit7adbee72837accea60cc3771a49ca9fb4041ebc4 (patch)
tree65eefdbfdd18dd5a3f346eb375f206ff319859a9 /src
parentfce70e6bd5c00f1557dc05a92086b1727d58bb9e (diff)
through sub_810FCE8
Diffstat (limited to 'src')
-rwxr-xr-xsrc/field_specials.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/field_specials.c b/src/field_specials.c
index 13a726ee3..8a6860e1e 100755
--- a/src/field_specials.c
+++ b/src/field_specials.c
@@ -2200,3 +2200,44 @@ int sub_810FC18(void)
}
return retval;
}
+
+u16 sub_810FCB0(void)
+{
+ u8 i;
+ u8 retval = 0;
+ for (i=0; i<8; i++)
+ {
+ if ((gSaveBlock1.vars[0x41] >> (i + 8)) & 1)
+ {
+ retval ++;
+ }
+ }
+ return retval;
+}
+
+void sub_810FCE8(void)
+{
+ u8 i = 0;
+ if (gSaveBlock2.playTimeHours < 999)
+ {
+ while (1)
+ {
+ if (sub_810FCB0() < 5)
+ {
+ gSaveBlock1.vars[0x42] = gSaveBlock2.playTimeHours;
+ break;
+ }
+ else if (i == 8)
+ {
+ break;
+ }
+ else if (gSaveBlock2.playTimeHours - gSaveBlock1.vars[0x42] < 12)
+ {
+ return;
+ }
+ sub_810FC18();
+ gSaveBlock1.vars[0x42] += 12;
+ i++;
+ }
+ }
+}