summaryrefslogtreecommitdiff
path: root/src/region_map.c
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2020-01-07 15:37:15 -0500
committerPikalaxALT <pikalaxalt@gmail.com>2020-01-07 15:37:15 -0500
commitce44eb021c16246d2f6ff2b564b70ccc24c98e30 (patch)
tree515d13989859bd529968c38e55919c1fefb2ae9a /src/region_map.c
parentb8ec686427958353a8649ccdc39f35ab509cd532 (diff)
through sub_80C4E08
Diffstat (limited to 'src/region_map.c')
-rw-r--r--src/region_map.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/region_map.c b/src/region_map.c
index e19e8e151..6678a226a 100644
--- a/src/region_map.c
+++ b/src/region_map.c
@@ -3213,3 +3213,59 @@ void sub_80C4D30(void)
sub_80C4BB8();
sub_80C4BE4();
}
+
+bool32 sub_80C4D40(u16 a0)
+{
+ if (gUnknown_20399D4 != NULL)
+ return FALSE;
+ if (a0 != MAPSEC_CELADON_CITY)
+ return FALSE;
+ if (gSaveBlock1Ptr->location.mapGroup != MAP_GROUP(CELADON_CITY_DEPARTMENT_STORE_1F))
+ return FALSE;
+ if (gSaveBlock1Ptr->location.mapNum != MAP_NUM(CELADON_CITY_DEPARTMENT_STORE_1F)
+ && gSaveBlock1Ptr->location.mapNum != MAP_NUM(CELADON_CITY_DEPARTMENT_STORE_2F)
+ && gSaveBlock1Ptr->location.mapNum != MAP_NUM(CELADON_CITY_DEPARTMENT_STORE_3F)
+ && gSaveBlock1Ptr->location.mapNum != MAP_NUM(CELADON_CITY_DEPARTMENT_STORE_4F)
+ && gSaveBlock1Ptr->location.mapNum != MAP_NUM(CELADON_CITY_DEPARTMENT_STORE_5F)
+ && gSaveBlock1Ptr->location.mapNum != MAP_NUM(CELADON_CITY_DEPARTMENT_STORE_ROOF)
+ && gSaveBlock1Ptr->location.mapNum != MAP_NUM(CELADON_CITY_DEPARTMENT_STORE_ELEVATOR))
+ return FALSE;
+ return TRUE;
+}
+
+u8 *GetMapName(u8 *dst0, u16 mapsec, u16 fill)
+{
+ u8 *dst;
+ u16 i;
+ u16 idx;;
+ if ((idx = mapsec - MAPSECS_KANTO) <= MAPSEC_SPECIAL_AREA - MAPSECS_KANTO)
+ {
+ if (sub_80C4D40(mapsec) == TRUE)
+ dst = StringCopy(dst0, gMapSecName_CeladonDept);
+ else
+ dst = StringCopy(dst0, gUnknown_83F1CAC[idx]);
+ }
+ else
+ {
+ if (fill == 0)
+ fill = 18;
+ return StringFill(dst0, CHAR_SPACE, fill);
+ }
+ if (fill != 0)
+ {
+ for (i = dst - dst0; i < fill; i++)
+ *dst++ = CHAR_SPACE;
+ *dst = EOS;
+ }
+ return dst;
+}
+
+u8 *GetMapNameGeneric(u8 *dest, u16 mapsec)
+{
+ return GetMapName(dest, mapsec, 0);
+}
+
+u8 *sub_80C4E08(u8 *dest, u16 mapsec)
+{
+ return GetMapNameGeneric(dest, mapsec);
+}