diff --git a/asm/region_map.s b/asm/region_map.s index aa103ba78..a43dd98c2 100644 --- a/asm/region_map.s +++ b/asm/region_map.s @@ -5,52 +5,6 @@ .text - thumb_func_start sub_8124238 -sub_8124238: @ 8124238 - push {r4,lr} - ldr r4, =gRegionMap - ldr r0, [r4] - ldr r0, [r0, 0x1C] - cmp r0, 0 - beq _0812425C - bl DestroySprite - ldr r0, [r4] - adds r0, 0x58 - ldrh r0, [r0] - bl FreeSpriteTilesByTag - ldr r0, [r4] - adds r0, 0x5A - ldrh r0, [r0] - bl FreeSpritePaletteByTag -_0812425C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8124238 - - thumb_func_start sub_8124268 -sub_8124268: @ 8124268 - ldr r0, =gRegionMap - ldr r0, [r0] - ldr r1, [r0, 0x1C] - movs r0, 0x1 - strh r0, [r1, 0x34] - bx lr - .pool - thumb_func_end sub_8124268 - - thumb_func_start sub_8124278 -sub_8124278: @ 8124278 - ldr r0, =gRegionMap - ldr r0, [r0] - ldr r1, [r0, 0x1C] - movs r0, 0 - strh r0, [r1, 0x34] - bx lr - .pool - thumb_func_end sub_8124278 - thumb_func_start sub_8124288 sub_8124288: @ 8124288 push {r4-r6,lr} diff --git a/src/region_map.c b/src/region_map.c index 3c1731332..5ebffc21f 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -56,7 +56,7 @@ static void sub_8123F30(u16 *x, u16 *y); static bool32 sub_8123F74(u8 mapSecId); static void sub_8123FB0(void); static bool8 sub_8124038(u16 y); -void sub_8124238(void); +static void sub_8124238(void); void sub_81243B0(void); void sub_81243DC(void); @@ -1021,6 +1021,26 @@ void CreateRegionMapCursor(u16 tileTag, u16 paletteTag) } gRegionMap->cursorSprite->data1 = 2; gRegionMap->cursorSprite->data2 = (IndexOfSpritePaletteTag(paletteTag) << 4) + 0x101; - gRegionMap->cursorSprite->data3 = 1; + gRegionMap->cursorSprite->data3 = TRUE; } } + +static void sub_8124238(void) +{ + if (gRegionMap->cursorSprite != NULL) + { + DestroySprite(gRegionMap->cursorSprite); + FreeSpriteTilesByTag(gRegionMap->cursorTileTag); + FreeSpritePaletteByTag(gRegionMap->cursorPaletteTag); + } +} + +void sub_8124268(void) +{ + gRegionMap->cursorSprite->data3 = TRUE; +} + +void sub_8124278(void) +{ + gRegionMap->cursorSprite->data3 = FALSE; +}