From 4db83e00971029fe97282496f76432e3c88d1ba7 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 30 Oct 2017 22:20:09 -0400 Subject: [PATCH] through sub_8123F9C --- asm/region_map.s | 37 ------------------------------------- include/region_map.h | 1 + src/region_map.c | 37 ++++++++++++++++++++++++++++--------- 3 files changed, 29 insertions(+), 46 deletions(-) diff --git a/asm/region_map.s b/asm/region_map.s index e6de2a1a25..2d5838488a 100644 --- a/asm/region_map.s +++ b/asm/region_map.s @@ -5,43 +5,6 @@ .text - thumb_func_start sub_8123F74 -sub_8123F74: @ 8123F74 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0 - ldr r3, =gUnknown_085A1BCC -_08123F7E: - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _08123F90 - movs r0, 0x1 - b _08123F98 - .pool -_08123F90: - adds r1, 0x1 - cmp r1, 0 - beq _08123F7E - movs r0, 0 -_08123F98: - pop {r1} - bx r1 - thumb_func_end sub_8123F74 - - thumb_func_start sub_8123F9C -sub_8123F9C: @ 8123F9C - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl sub_8123EB4 - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_8123F9C - thumb_func_start sub_8123FB0 sub_8123FB0: @ 8123FB0 push {r4-r6,lr} diff --git a/include/region_map.h b/include/region_map.h index cdec23e7a8..9399328b5f 100644 --- a/include/region_map.h +++ b/include/region_map.h @@ -300,6 +300,7 @@ enum { // Exported ROM declarations void sub_8122CF8(struct RegionMap *regionMap, struct BgTemplate *template, bool8 zoomed); bool8 sub_8122DB0(void); +void UpdateRegionMapVideoRegs(void); void InitRegionMap(struct RegionMap *regionMap, u8 argument); u8 sub_81230AC(void); void FreeRegionMapIconResources(void); diff --git a/src/region_map.c b/src/region_map.c index db41284afc..a5a84a187a 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -44,16 +44,15 @@ static u8 ProcessRegionMapInput_Full(void); static u8 MoveRegionMapCursor_Full(void); static u8 ProcessRegionMapInput_Zoomed(void); static u8 MoveRegionMapCursor_Zoomed(void); -void CalcZoomScrollParams(s16 scrollX, s16 scrollY, s16 c, s16 d, u16 e, u16 f, u8 rotation); -void UpdateRegionMapVideoRegs(void); +static void CalcZoomScrollParams(s16 scrollX, s16 scrollY, s16 c, s16 d, u16 e, u16 f, u8 rotation); u16 GetRegionMapSectionIdAt(u16 x, u16 y); -void sub_812378C(s16 x, s16 y); +static void sub_812378C(s16 x, s16 y); static void sub_81238AC(void); static void sub_8123C00(void); static u8 get_flagnr_blue_points(u16 mapSecId); u16 sub_8123EB4(u16 mapSecId); -u16 sub_8123F04(void); -void sub_8123F30(u16 *x, u16 *y); +static u16 sub_8123F04(void); +static void sub_8123F30(u16 *x, u16 *y); void sub_8123FB0(void); bool32 sub_8123F74(u8 mapSecId); void sub_8124238(void); @@ -73,6 +72,7 @@ extern const u16 gUnknown_085A1B24[][2]; extern const u16 gUnknown_085A1B84[]; extern const u16 gUnknown_085A1B8A[]; extern const struct UCoords16 gUnknown_085A1BAC[]; +extern const u8 gUnknown_085A1BCC[]; // .text @@ -476,7 +476,7 @@ u8 sub_8123514(void) return r4; } -void CalcZoomScrollParams(s16 scrollX, s16 scrollY, s16 c, s16 d, u16 e, u16 f, u8 rotation) +static void CalcZoomScrollParams(s16 scrollX, s16 scrollY, s16 c, s16 d, u16 e, u16 f, u8 rotation) { s32 var1; s32 var2; @@ -499,7 +499,7 @@ void CalcZoomScrollParams(s16 scrollX, s16 scrollY, s16 c, s16 d, u16 e, u16 f, gRegionMap->needUpdateVideoRegs = TRUE; } -void sub_812378C(s16 x, s16 y) +static void sub_812378C(s16 x, s16 y) { gRegionMap->bg2x = (x << 8) + 0x1c00; gRegionMap->bg2y = (y << 8) + 0x2400; @@ -844,7 +844,7 @@ u16 sub_8123EB4(u16 mapSecId) return mapSecId; } -u16 sub_8123F04(void) +static u16 sub_8123F04(void) { s16 idx; @@ -856,7 +856,7 @@ u16 sub_8123F04(void) return gUnknown_085A1B8A[idx]; } -void sub_8123F30(u16 *x, u16 *y) +static void sub_8123F30(u16 *x, u16 *y) { u16 idx; @@ -869,3 +869,22 @@ void sub_8123F30(u16 *x, u16 *y) *x = gUnknown_085A1BAC[idx].x + MAPCURSOR_X_MIN; *y = gUnknown_085A1BAC[idx].y + MAPCURSOR_Y_MIN; } + +bool32 sub_8123F74(u8 mapSecId) +{ + int i; + + for (i = 0; i == 0; i ++) + { + if (gUnknown_085A1BCC[i] == mapSecId) + { + return TRUE; + } + } + return FALSE; +} + +u16 sub_8123F9C(u16 mapSecId) +{ + return sub_8123EB4(mapSecId); +}