diff --git a/asm/region_map.s b/asm/region_map.s index f144c39a21..3141d9a4f3 100644 --- a/asm/region_map.s +++ b/asm/region_map.s @@ -5,78 +5,6 @@ .text - thumb_func_start sub_8123030 -sub_8123030: @ 8123030 - push {lr} - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0xE0 - lsls r0, 2 - lsls r1, 24 - lsrs r1, 24 - bl BlendPalettes - ldr r0, =gPlttBufferFaded + 0xE0 - ldr r1, =gPlttBufferUnfaded + 0xE0 - movs r2, 0x30 - bl CpuSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_8123030 - - thumb_func_start sub_812305C -sub_812305C: @ 812305C - push {r4,lr} - ldr r4, =gUnknown_0203A144 - ldr r0, [r4] - ldr r0, [r0, 0x1C] - cmp r0, 0 - beq _08123080 - bl DestroySprite - ldr r0, [r4] - adds r0, 0x58 - ldrh r0, [r0] - bl FreeSpriteTilesByTag - ldr r0, [r4] - adds r0, 0x5A - ldrh r0, [r0] - bl FreeSpritePaletteByTag -_08123080: - ldr r0, [r4] - ldr r0, [r0, 0x20] - cmp r0, 0 - beq _081230A0 - bl DestroySprite - ldr r0, [r4] - adds r0, 0x70 - ldrh r0, [r0] - bl FreeSpriteTilesByTag - ldr r0, [r4] - adds r0, 0x72 - ldrh r0, [r0] - bl FreeSpritePaletteByTag -_081230A0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812305C - - thumb_func_start sub_81230AC -sub_81230AC: @ 81230AC - push {lr} - ldr r0, =gUnknown_0203A144 - ldr r0, [r0] - ldr r0, [r0, 0x18] - bl _call_via_r0 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81230AC - thumb_func_start sub_81230C4 sub_81230C4: @ 81230C4 push {r4,lr} diff --git a/include/region_map.h b/include/region_map.h index 316b6f3a11..dfcfbc9138 100644 --- a/include/region_map.h +++ b/include/region_map.h @@ -231,18 +231,21 @@ struct RegionMap { /*0x003*/ u8 unk_003; /*0x004*/ u8 mapSecName[0x14]; /*0x018*/ u8 (*inputCallback)(void); - /*0x01c*/ u32 unk_01c; - /*0x020*/ u32 unk_020; + /*0x01c*/ struct Sprite *unk_01c; + /*0x020*/ struct Sprite *unk_020; /*0x024*/ u8 filler_024[0x30]; /*0x054*/ u16 unk_054; /*0x056*/ u16 unk_056; - /*0x058*/ u8 filler_058[0x4]; + /*0x058*/ u16 unk_058; + /*0x05a*/ u16 unk_05a; /*0x05c*/ s16 unk_05c; /*0x05e*/ s16 unk_05e; /*0x060*/ u8 filler_060[0x4]; /*0x064*/ u16 unk_064; /*0x066*/ u16 unk_066; - /*0x068*/ u8 filler_068[0xc]; + /*0x068*/ u8 filler_068[0x8]; + /*0x070*/ u16 unk_070; + /*0x072*/ u16 unk_072; /*0x074*/ u16 unk_074; /*0x076*/ u16 unk_076; /*0x078*/ u8 unk_078; diff --git a/src/region_map.c b/src/region_map.c index dc53f1ec6b..714aa51ee7 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -140,8 +140,8 @@ bool8 sub_8122DB0(void) case 7: sub_8123FB0(); sub_81237B4(); - gUnknown_0203A144->unk_01c = 0; - gUnknown_0203A144->unk_020 = 0; + gUnknown_0203A144->unk_01c = NULL; + gUnknown_0203A144->unk_020 = NULL; gUnknown_0203A144->unk_07a = 0; gUnknown_0203A144->unk_07e = 0; if (gUnknown_0203A144->unk_083) @@ -160,3 +160,30 @@ bool8 sub_8122DB0(void) gUnknown_0203A144->unk_079 ++; return TRUE; } + +void sub_8123030(u16 a0, u32 a1) +{ + BlendPalettes(0x380, a1, a0); + CpuCopy16(gPlttBufferFaded + 0x70, gPlttBufferUnfaded + 0x70, 0x60); +} + +void sub_812305C(void) +{ + if (gUnknown_0203A144->unk_01c != NULL) + { + DestroySprite(gUnknown_0203A144->unk_01c); + FreeSpriteTilesByTag(gUnknown_0203A144->unk_058); + FreeSpritePaletteByTag(gUnknown_0203A144->unk_05a); + } + if (gUnknown_0203A144->unk_020 != NULL) + { + DestroySprite(gUnknown_0203A144->unk_020); + FreeSpriteTilesByTag(gUnknown_0203A144->unk_070); + FreeSpritePaletteByTag(gUnknown_0203A144->unk_072); + } +} + +u8 sub_81230AC(void) +{ + return gUnknown_0203A144->inputCallback(); +}