diff --git a/asm/cable_club.s b/asm/cable_club.s index 3b5c392fc..885689e85 100644 --- a/asm/cable_club.s +++ b/asm/cable_club.s @@ -2156,7 +2156,7 @@ sub_80B360C: @ 80B360C negs r1, r1 ands r0, r1 str r0, [r2] - bl call_ResetMapMusic + bl Overworld_ResetMapMusic bl copy_player_party_from_sav1 bl copy_bags_and_unk_data_to_save_blocks bl sub_813BF10 diff --git a/asm/field_screen.s b/asm/field_screen.s index 0839e4bac..0caa07a1b 100644 --- a/asm/field_screen.s +++ b/asm/field_screen.s @@ -1884,8 +1884,8 @@ _080ABEF4: .pool thumb_func_end sub_80ABE18 - thumb_func_start sub_80ABF00 -sub_80ABF00: @ 80ABF00 + thumb_func_start ApplyWeatherGammaShiftToPal +ApplyWeatherGammaShiftToPal: @ 80ABF00 push {lr} lsls r0, 24 lsrs r0, 24 @@ -1900,7 +1900,7 @@ sub_80ABF00: @ 80ABF00 pop {r0} bx r0 .pool - thumb_func_end sub_80ABF00 + thumb_func_end ApplyWeatherGammaShiftToPal thumb_func_start sub_80ABF20 sub_80ABF20: @ 80ABF20 @@ -10478,7 +10478,7 @@ sub_80B058C: @ 80B058C thumb_func_start sub_80B05B4 sub_80B05B4: @ 80B05B4 push {lr} - bl sub_80859B0 + bl Overworld_FadeOutMapMusic ldr r0, =task50_0807F0C8 movs r1, 0x50 bl CreateTask diff --git a/asm/field_tasks.s b/asm/field_tasks.s index 4befe0ca7..79980ec46 100644 --- a/asm/field_tasks.s +++ b/asm/field_tasks.s @@ -182,8 +182,8 @@ _0809D9EA: bx r0 thumb_func_end ActivatePerStepCallback - thumb_func_start wild_encounter_reset_coro_args -wild_encounter_reset_coro_args: @ 809D9F0 + thumb_func_start ResetFieldTasksArgs +ResetFieldTasksArgs: @ 809D9F0 push {lr} ldr r0, =task_per_step_callback_manager bl FindTaskIdByFunc @@ -207,7 +207,7 @@ _0809DA1A: pop {r0} bx r0 .pool - thumb_func_end wild_encounter_reset_coro_args + thumb_func_end ResetFieldTasksArgs thumb_func_start nullsub_34 nullsub_34: @ 809DA2C diff --git a/asm/map_name_popup.s b/asm/map_name_popup.s index 9802c3151..76edd1f1f 100644 --- a/asm/map_name_popup.s +++ b/asm/map_name_popup.s @@ -9,14 +9,14 @@ sub_80D47D4: @ 80D47D4 push {lr} bl sub_80A0934 - bl AddMapNamePopUpWindowTask + bl ShowMapNamePopup movs r0, 0x1 pop {r1} bx r1 thumb_func_end sub_80D47D4 - thumb_func_start AddMapNamePopUpWindowTask -AddMapNamePopUpWindowTask: @ 80D47E4 + thumb_func_start ShowMapNamePopup +ShowMapNamePopup: @ 80D47E4 push {r4,lr} movs r0, 0x80 lsls r0, 7 @@ -83,7 +83,7 @@ _080D486C: pop {r0} bx r0 .pool - thumb_func_end AddMapNamePopUpWindowTask + thumb_func_end ShowMapNamePopup thumb_func_start Task_MapNamePopUpWindow Task_MapNamePopUpWindow: @ 80D487C diff --git a/asm/overworld.s b/asm/overworld.s index 25c479c10..d74a2674b 100644 --- a/asm/overworld.s +++ b/asm/overworld.s @@ -5,1482 +5,8 @@ .text - thumb_func_start sub_8084E14 -sub_8084E14: @ 8084E14 - ldr r2, =gWarpDestination - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, [r0, 0x28] - ldr r0, [r0, 0x24] - str r0, [r2] - str r1, [r2, 0x4] - bx lr - .pool - thumb_func_end sub_8084E14 - thumb_func_start sub_8084E2C -sub_8084E2C: @ 8084E2C - push {r4-r6,lr} - sub sp, 0x8 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - ldr r1, [sp, 0x18] - ldr r0, =gUnknown_020322EC - lsls r4, 24 - asrs r4, 24 - lsls r5, 24 - asrs r5, 24 - lsls r6, 24 - asrs r6, 24 - lsls r3, 24 - asrs r3, 24 - str r3, [sp] - lsls r1, 24 - asrs r1, 24 - str r1, [sp, 0x4] - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl SetWarpData - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084E2C - thumb_func_start warp1_set_to_warp2 -warp1_set_to_warp2: @ 8084E68 - ldr r2, =gWarpDestination - ldr r0, =gUnknown_020322EC - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r2] - str r1, [r2, 0x4] - bx lr - .pool - thumb_func_end warp1_set_to_warp2 - - thumb_func_start sub_8084E80 -sub_8084E80: @ 8084E80 - push {r4-r6,lr} - sub sp, 0x8 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - ldr r1, [sp, 0x18] - ldr r0, =gUnknown_020322F4 - lsls r4, 24 - asrs r4, 24 - lsls r5, 24 - asrs r5, 24 - lsls r6, 24 - asrs r6, 24 - lsls r3, 24 - asrs r3, 24 - str r3, [sp] - lsls r1, 24 - asrs r1, 24 - str r1, [sp, 0x4] - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl SetWarpData - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084E80 - - thumb_func_start sub_8084EBC -sub_8084EBC: @ 8084EBC - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 16 - lsrs r6, r1, 16 - ldr r4, =gUnknown_020322F4 - adds r0, r4, 0 - bl warp_data_is_not_neg_1 - cmp r0, 0x1 - bne _08084EF0 - ldr r2, =gWarpDestination - ldr r0, =gUnknown_020322DC - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r2] - str r1, [r2, 0x4] - b _08084F0A - .pool -_08084EF0: - movs r0, 0 - ldrsb r0, [r4, r0] - movs r1, 0x1 - ldrsb r1, [r4, r1] - movs r2, 0x1 - negs r2, r2 - lsls r3, r5, 24 - asrs r3, 24 - lsls r4, r6, 24 - asrs r4, 24 - str r4, [sp] - bl Overworld_SetWarpDestination -_08084F0A: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8084EBC - - thumb_func_start warp1_set_to_sav1w -warp1_set_to_sav1w: @ 8084F14 - ldr r2, =gWarpDestination - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, [r0, 0x10] - ldr r0, [r0, 0xC] - str r0, [r2] - str r1, [r2, 0x4] - bx lr - .pool - thumb_func_end warp1_set_to_sav1w - - thumb_func_start sub_8084F2C -sub_8084F2C: @ 8084F2C - push {r4-r6,lr} - sub sp, 0x8 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - ldr r1, [sp, 0x18] - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - adds r0, 0xC - lsls r4, 24 - asrs r4, 24 - lsls r5, 24 - asrs r5, 24 - lsls r6, 24 - asrs r6, 24 - lsls r3, 24 - asrs r3, 24 - str r3, [sp] - lsls r1, 24 - asrs r1, 24 - str r1, [sp, 0x4] - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl SetWarpData - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084F2C - - thumb_func_start sub_8084F6C -sub_8084F6C: @ 8084F6C - push {r4,r5,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - bl GetHealLocationPointer - adds r5, r0, 0 - cmp r5, 0 - beq _08084FA0 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - adds r0, 0xC - movs r1, 0 - ldrsb r1, [r5, r1] - movs r2, 0x1 - ldrsb r2, [r5, r2] - movs r3, 0x1 - negs r3, r3 - movs r4, 0x2 - ldrsb r4, [r5, r4] - str r4, [sp] - movs r4, 0x4 - ldrsb r4, [r5, r4] - str r4, [sp, 0x4] - bl SetWarpData -_08084FA0: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084F6C - - thumb_func_start sub_8084FAC -sub_8084FAC: @ 8084FAC - ldr r0, =gSaveBlock1Ptr - ldr r2, [r0] - ldr r0, [r2, 0x14] - ldr r1, [r2, 0x18] - str r0, [r2, 0xC] - str r1, [r2, 0x10] - bx lr - .pool - thumb_func_end sub_8084FAC - - thumb_func_start sub_8084FC0 -sub_8084FC0: @ 8084FC0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gMapHeader - ldr r0, [r0, 0xC] - ldr r3, [r0] - ldr r1, [r0, 0x4] - cmp r1, 0 - bne _08084FDC - b _08084FF0 - .pool -_08084FD8: - adds r0, r1, 0 - b _08084FF2 -_08084FDC: - movs r2, 0 - cmp r2, r3 - bge _08084FF0 -_08084FE2: - ldrb r0, [r1] - cmp r0, r4 - beq _08084FD8 - adds r2, 0x1 - adds r1, 0xC - cmp r2, r3 - blt _08084FE2 -_08084FF0: - movs r0, 0 -_08084FF2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8084FC0 - - thumb_func_start sub_8084FF8 -sub_8084FF8: @ 8084FF8 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 16 - lsrs r5, r2, 16 - bl sub_8084FC0 - adds r1, r0, 0 - cmp r1, 0 - beq _08085030 - movs r0, 0x8 - ldrsb r0, [r1, r0] - ldrb r1, [r1, 0x9] - lsls r1, 24 - asrs r1, 24 - movs r2, 0x1 - negs r2, r2 - lsls r3, r4, 24 - asrs r3, 24 - lsls r4, r5, 24 - asrs r4, 24 - str r4, [sp] - bl Overworld_SetWarpDestination - b _0808504C -_08085030: - bl mapheader_run_script_with_tag_x6 - ldr r0, =gUnknown_020322EC - bl warp_data_is_not_neg_1 - cmp r0, 0 - beq _08085048 - movs r0, 0 - b _0808504E - .pool -_08085048: - bl warp1_set_to_warp2 -_0808504C: - movs r0, 0x1 -_0808504E: - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8084FF8 - - thumb_func_start sub_8085058 -sub_8085058: @ 8085058 - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - lsls r3, 16 - lsrs r3, 16 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x6 - adds r1, r3, 0 - bl sub_8084FF8 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_8085058 - - thumb_func_start sub_8085078 -sub_8085078: @ 8085078 - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - lsls r3, 16 - lsrs r3, 16 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x5 - adds r1, r3, 0 - bl sub_8084FF8 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_8085078 - - thumb_func_start mliX_load_map -mliX_load_map: @ 8085098 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r5, r1, 0 - lsls r0, r6, 24 - asrs r0, 24 - lsls r1, r5, 24 - asrs r1, 24 - movs r3, 0x1 - negs r3, r3 - str r3, [sp] - adds r2, r3, 0 - bl Overworld_SetWarpDestination - ldr r4, =gMapHeader - ldrb r0, [r4, 0x14] - cmp r0, 0x3A - beq _080850C8 - bl sub_8085810 -_080850C8: - bl ApplyCurrentWarp - bl set_current_map_header_from_sav1_save_old_name - bl LoadMapObjTemplatesFromHeader - bl TrySetMapSaveWarpStatus - bl ClearTempFieldEventData - bl ResetCyclingRoadChallengeData - bl prev_quest_postbuffer_cursor_backup_reset - adds r0, r6, 0 - adds r1, r5, 0 - bl TryUpdateRandomTrainerRematches - bl DoTimeBasedEvents - bl SetSav1WeatherFromCurrMapHeader - bl ChooseAmbientCrySpecies - bl update_sav1_flash_used_on_map - bl Overworld_ClearSavedMusic - bl mapheader_run_script_with_tag_x3 - bl not_trainer_hill_battle_pyramid - ldr r0, [r4] - bl copy_map_tileset2_to_vram_2 - ldr r0, [r4] - bl apply_map_tileset2_palette - movs r4, 0x6 -_08085116: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_80ABF00 - adds r4, 0x1 - cmp r4, 0xC - ble _08085116 - bl sub_80A0A2C - bl UpdateLocationHistoryForRoamer - bl RoamerMove - bl DoCurrentWeather - bl wild_encounter_reset_coro_args - bl mapheader_run_script_with_tag_x5 - ldr r2, =gMapHeader - ldrb r0, [r2, 0x14] - cmp r0, 0x3A - bne _0808514C - ldr r1, =gLastMapSectionId - ldrh r1, [r1] - cmp r0, r1 - beq _08085150 -_0808514C: - bl AddMapNamePopUpWindowTask -_08085150: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end mliX_load_map - - thumb_func_start mli0_load_map -mli0_load_map: @ 8085160 - push {r4-r7,lr} - adds r7, r0, 0 - bl set_current_map_header_from_sav1_save_old_name - ldr r0, =gUnknown_020322D8 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080851A2 - ldr r0, =gMapHeader - ldrh r1, [r0, 0x12] - ldr r0, =0x00000169 - cmp r1, r0 - bne _08085190 - bl sub_81AA1D8 - b _080851A2 - .pool -_08085190: - bl InTrainerHill - cmp r0, 0 - beq _0808519E - bl sub_81D5DF8 - b _080851A2 -_0808519E: - bl LoadMapObjTemplatesFromHeader -_080851A2: - ldr r4, =gMapHeader - ldrb r0, [r4, 0x17] - bl is_light_level_1_2_3_5_or_6 - lsls r0, 24 - lsrs r5, r0, 24 - ldrb r0, [r4, 0x17] - bl is_light_level_8_or_9 - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_80EB218 - bl TrySetMapSaveWarpStatus - bl ClearTempFieldEventData - bl ResetCyclingRoadChallengeData - bl prev_quest_postbuffer_cursor_backup_reset - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - movs r0, 0x4 - ldrsb r0, [r1, r0] - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x5] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl TryUpdateRandomTrainerRematches - cmp r7, 0x1 - beq _080851EE - bl DoTimeBasedEvents -_080851EE: - bl SetSav1WeatherFromCurrMapHeader - bl ChooseAmbientCrySpecies - cmp r5, 0 - beq _08085200 - ldr r0, =0x00000888 - bl FlagClear -_08085200: - bl update_sav1_flash_used_on_map - bl Overworld_ClearSavedMusic - bl mapheader_run_script_with_tag_x3 - bl UpdateLocationHistoryForRoamer - bl RoamerMoveToOtherLocationSet - ldrh r1, [r4, 0x12] - ldr r0, =0x00000169 - cmp r1, r0 - bne _08085234 - movs r0, 0 - bl battle_pyramid_map_load_related - b _08085246 - .pool -_08085234: - bl InTrainerHill - cmp r0, 0 - beq _08085242 - bl trainer_hill_map_load_related - b _08085246 -_08085242: - bl not_trainer_hill_battle_pyramid -_08085246: - cmp r7, 0x1 - beq _0808525E - cmp r6, 0 - beq _0808525E - ldr r1, =gUnknown_03005DC0 - ldr r0, [r1] - ldr r1, [r1, 0x4] - bl UpdateTVScreensOnMap - movs r0, 0x1 - bl sub_80E9238 -_0808525E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end mli0_load_map - - thumb_func_start player_avatar_init_params_reset -player_avatar_init_params_reset: @ 8085268 - ldr r1, =gUnknown_02032300 - movs r0, 0x1 - strb r0, [r1, 0x1] - strb r0, [r1] - bx lr - .pool - thumb_func_end player_avatar_init_params_reset - - thumb_func_start walkrun_find_lowest_active_bit_in_bitfield -walkrun_find_lowest_active_bit_in_bitfield: @ 8085278 - push {r4,lr} - bl player_get_direction_lower_nybble - ldr r4, =gUnknown_02032300 - strb r0, [r4, 0x1] - movs r0, 0x2 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _08085298 - movs r0, 0x2 - b _080852CA - .pool -_08085298: - movs r0, 0x4 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _080852A8 - movs r0, 0x4 - b _080852CA -_080852A8: - movs r0, 0x8 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _080852B8 - movs r0, 0x8 - b _080852CA -_080852B8: - movs r0, 0x10 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _080852C8 - movs r0, 0x10 - b _080852CA -_080852C8: - movs r0, 0x1 -_080852CA: - strb r0, [r4] - pop {r4} - pop {r0} - bx r0 - thumb_func_end walkrun_find_lowest_active_bit_in_bitfield - - thumb_func_start sub_80852D4 -sub_80852D4: @ 80852D4 - push {r4-r7,lr} - bl Overworld_GetMapTypeOfSaveblockLocation - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - bl cur_mapdata_block_role_at_screen_center_acc_to_sav1 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r6, =gUnknown_02032300 - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_808532C - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0xffffff00 - ands r7, r0 - orrs r7, r1 - adds r0, r6, 0 - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_808538C - lsls r0, 24 - lsrs r0, 16 - ldr r1, =0xffff00ff - ands r7, r1 - orrs r7, r0 - str r7, [r6] - adds r0, r6, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80852D4 - - thumb_func_start sub_808532C -sub_808532C: @ 808532C - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - lsls r2, 24 - lsrs r4, r2, 24 - cmp r4, 0x8 - beq _08085348 - ldr r0, =0x0000088d - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08085382 -_08085348: - cmp r4, 0x5 - bne _08085354 - movs r0, 0x10 - b _08085384 - .pool -_08085354: - lsls r0, r5, 24 - lsrs r0, 24 - bl MetatileBehavior_IsSurfableWaterOrUnderwater - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08085368 - movs r0, 0x8 - b _08085384 -_08085368: - bl sav1_map_is_biking_allowed - cmp r0, 0x1 - bne _08085382 - ldrb r0, [r6] - cmp r0, 0x2 - bne _0808537A - movs r0, 0x2 - b _08085384 -_0808537A: - cmp r0, 0x4 - bne _08085382 - movs r0, 0x4 - b _08085384 -_08085382: - movs r0, 0x1 -_08085384: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808532C - - thumb_func_start sub_808538C -sub_808538C: @ 808538C - push {r4-r7,lr} - adds r6, r0, 0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 16 - lsrs r4, r2, 16 - lsls r3, 24 - lsrs r5, r3, 24 - ldr r0, =0x0000088d - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080853AC - cmp r5, 0x6 - beq _0808540C -_080853AC: - lsls r4, 24 - lsrs r5, r4, 24 - adds r0, r5, 0 - bl MetatileBehavior_IsDeepSouthWarp - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080853E8 - adds r0, r5, 0 - bl MetatileBehavior_IsNonAnimDoor - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08085442 - adds r0, r5, 0 - bl MetatileBehavior_IsDoor - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08085442 - adds r0, r5, 0 - bl MetatileBehavior_IsSouthArrowWarp - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080853F0 -_080853E8: - movs r0, 0x2 - b _08085448 - .pool -_080853F0: - adds r0, r5, 0 - bl MetatileBehavior_IsNorthArrowWarp - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08085442 - adds r0, r5, 0 - bl MetatileBehavior_IsWestArrowWarp - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08085410 -_0808540C: - movs r0, 0x4 - b _08085448 -_08085410: - adds r0, r5, 0 - bl MetatileBehavior_IsEastArrowWarp - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08085422 - movs r0, 0x3 - b _08085448 -_08085422: - ldrb r0, [r6] - cmp r0, 0x10 - bne _0808542C - cmp r7, 0x8 - beq _08085446 -_0808542C: - cmp r0, 0x8 - bne _08085434 - cmp r7, 0x10 - beq _08085446 -_08085434: - lsrs r0, r4, 24 - bl MetatileBehavior_IsLadder - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08085446 -_08085442: - movs r0, 0x1 - b _08085448 -_08085446: - ldrb r0, [r6, 0x1] -_08085448: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808538C - - thumb_func_start cur_mapdata_block_role_at_screen_center_acc_to_sav1 -cur_mapdata_block_role_at_screen_center_acc_to_sav1: @ 8085450 - push {lr} - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - movs r2, 0 - ldrsh r0, [r1, r2] - adds r0, 0x7 - movs r2, 0x2 - ldrsh r1, [r1, r2] - adds r1, 0x7 - bl MapGridGetMetatileBehaviorAt - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end cur_mapdata_block_role_at_screen_center_acc_to_sav1 - - thumb_func_start sav1_map_is_biking_allowed -sav1_map_is_biking_allowed: @ 8085474 - push {lr} - ldr r0, =gMapHeader - ldrb r1, [r0, 0x1A] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0808548C - movs r0, 0x1 - b _0808548E - .pool -_0808548C: - movs r0, 0 -_0808548E: - pop {r1} - bx r1 - thumb_func_end sav1_map_is_biking_allowed - - thumb_func_start update_sav1_flash_used_on_map -update_sav1_flash_used_on_map: @ 8085494 - push {lr} - ldr r0, =gMapHeader - ldrb r1, [r0, 0x15] - cmp r1, 0 - bne _080854B0 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - adds r0, 0x30 - strb r1, [r0] - b _080854DE - .pool -_080854B0: - ldr r0, =0x00000888 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080854D0 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - adds r0, 0x30 - movs r1, 0x1 - strb r1, [r0] - b _080854DE - .pool -_080854D0: - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r0, =gUnknown_0854FE78 - ldr r0, [r0] - subs r0, 0x1 - adds r1, 0x30 - strb r0, [r1] -_080854DE: - pop {r0} - bx r0 - .pool - thumb_func_end update_sav1_flash_used_on_map - - thumb_func_start Overworld_SetFlashLevel -Overworld_SetFlashLevel: @ 80854EC - push {lr} - adds r1, r0, 0 - cmp r1, 0 - blt _080854FC - ldr r0, =gUnknown_0854FE78 - ldr r0, [r0] - cmp r1, r0 - ble _080854FE -_080854FC: - movs r1, 0 -_080854FE: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - adds r0, 0x30 - strb r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end Overworld_SetFlashLevel - - thumb_func_start Overworld_GetFlashLevel -Overworld_GetFlashLevel: @ 8085514 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - adds r0, 0x30 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end Overworld_GetFlashLevel - - thumb_func_start sub_8085524 -sub_8085524: @ 8085524 - push {lr} - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - strh r0, [r1, 0x32] - bl get_mapdata_header - ldr r1, =gMapHeader - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8085524 - - thumb_func_start sub_8085540 -sub_8085540: @ 8085540 - ldr r1, =gUnknown_020322D8 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8085540 - - thumb_func_start sub_808554C -sub_808554C: @ 808554C - ldr r0, =gUnknown_020322D8 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_808554C - - thumb_func_start sub_8085558 -sub_8085558: @ 8085558 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0000088a - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080855AC - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0 - bne _080855AC - movs r0, 0x1 - ldrsb r0, [r4, r0] - cmp r0, 0x5 - blt _08085584 - cmp r0, 0x8 - ble _0808559E - cmp r0, 0x2B - bgt _08085584 - cmp r0, 0x27 - bge _0808559E -_08085584: - ldr r0, =0x0000405e - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x3 - bls _080855AC - movs r0, 0x1 - ldrsb r0, [r4, r0] - cmp r0, 0x2E - bgt _080855AC - cmp r0, 0x2C - blt _080855AC -_0808559E: - movs r0, 0x1 - b _080855AE - .pool -_080855AC: - movs r0, 0 -_080855AE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8085558 - - thumb_func_start sub_80855B4 -sub_80855B4: @ 80855B4 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x000040ca - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _080855D6 - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0 - bne _080855D6 - movs r0, 0x1 - ldrsb r0, [r4, r0] - cmp r0, 0x7 - beq _080855E0 -_080855D6: - movs r0, 0 - b _080855E2 - .pool -_080855E0: - movs r0, 0x1 -_080855E2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80855B4 - - thumb_func_start sub_80855E8 -sub_80855E8: @ 80855E8 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x000040b3 - bl VarGet - lsls r0, 16 - cmp r0, 0 - bne _08085606 - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0x20 - bne _08085606 - ldrb r0, [r4, 0x1] - cmp r0, 0x1 - bls _08085610 -_08085606: - movs r0, 0 - b _08085612 - .pool -_08085610: - movs r0, 0x1 -_08085612: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80855E8 - - thumb_func_start sub_8085618 -sub_8085618: @ 8085618 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x0000405d - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _0808564C - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bhi _0808564C - movs r0, 0 - ldrsb r0, [r5, r0] - cmp r0, 0xE - bne _0808564C - ldrb r0, [r5, 0x1] - subs r0, 0x9 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _08085654 -_0808564C: - movs r0, 0 - b _08085656 - .pool -_08085654: - movs r0, 0x1 -_08085656: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8085618 - - thumb_func_start warp_target_get_music -warp_target_get_music: @ 808565C - push {r4,lr} - adds r4, r0, 0 - bl sub_80855B4 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _08085674 - ldr r0, =0x0000ffff - b _080856CE - .pool -_08085674: - adds r0, r4, 0 - bl sub_8085558 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _0808568C - ldr r0, =0x000001bb - b _080856CE - .pool -_0808568C: - adds r0, r4, 0 - bl sub_8085618 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _080856A4 - ldr r0, =0x000001b9 - b _080856CE - .pool -_080856A4: - adds r0, r4, 0 - bl sub_80855E8 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - beq _080856CA - movs r0, 0 - ldrsb r0, [r4, r0] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ldrsb r1, [r4, r1] - lsls r1, 16 - lsrs r1, 16 - bl Overworld_GetMapHeaderByGroupAndId - ldrh r0, [r0, 0x10] - b _080856CE -_080856CA: - movs r0, 0xCB - lsls r0, 1 -_080856CE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end warp_target_get_music - - thumb_func_start sav1_map_get_music -sav1_map_get_music: @ 80856D4 - push {r4,lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldrh r1, [r0, 0x4] - movs r0, 0xD0 - lsls r0, 5 - cmp r1, r0 - bne _080856FC - bl GetSav1Weather - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8 - bne _080856FC - ldr r0, =0x00000199 - b _08085730 - .pool -_080856FC: - ldr r4, =gSaveBlock1Ptr - ldr r0, [r4] - adds r0, 0x4 - bl warp_target_get_music - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x00007fff - cmp r1, r0 - beq _0808571C - adds r0, r1, 0 - b _08085730 - .pool -_0808571C: - ldr r0, [r4] - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x17 - ble _0808572C - movs r0, 0xC9 - lsls r0, 1 - b _08085730 -_0808572C: - movs r0, 0xB4 - lsls r0, 1 -_08085730: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sav1_map_get_music - - thumb_func_start warp1_target_get_music -warp1_target_get_music: @ 8085738 - push {lr} - ldr r0, =gWarpDestination - bl warp_target_get_music - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x00007fff - cmp r1, r0 - beq _08085758 - adds r0, r1, 0 - b _08085774 - .pool -_08085758: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldrh r1, [r0, 0x4] - movs r0, 0x80 - lsls r0, 2 - cmp r1, r0 - beq _08085770 - subs r0, 0x6E - b _08085774 - .pool -_08085770: - movs r0, 0xB4 - lsls r0, 1 -_08085774: - pop {r1} - bx r1 - thumb_func_end warp1_target_get_music - - thumb_func_start call_ResetMapMusic -call_ResetMapMusic: @ 8085778 - push {lr} - bl ResetMapMusic - pop {r0} - bx r0 - thumb_func_end call_ResetMapMusic - - thumb_func_start Overworld_PlaySpecialMapMusic -Overworld_PlaySpecialMapMusic: @ 8085784 - push {r4,lr} - bl sav1_map_get_music - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x000001bb - cmp r4, r0 - beq _080857D6 - ldr r0, =0x0000ffff - cmp r4, r0 - beq _080857D6 - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldrh r0, [r1, 0x2C] - cmp r0, 0 - beq _080857B4 - adds r4, r0, 0 - b _080857D6 - .pool -_080857B4: - bl Overworld_GetMapTypeOfSaveblockLocation - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bne _080857C8 - ldr r4, =0x0000019b - b _080857D6 - .pool -_080857C8: - movs r0, 0x8 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _080857D6 - ldr r4, =0x0000016d -_080857D6: - bl GetCurrentMapMusic - lsls r0, 16 - lsrs r0, 16 - cmp r4, r0 - beq _080857E8 - adds r0, r4, 0 - bl PlayNewMapMusic -_080857E8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end Overworld_PlaySpecialMapMusic - - thumb_func_start Overworld_SetSavedMusic -Overworld_SetSavedMusic: @ 80857F4 - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - strh r0, [r1, 0x2C] - bx lr - .pool - thumb_func_end Overworld_SetSavedMusic - - thumb_func_start Overworld_ClearSavedMusic -Overworld_ClearSavedMusic: @ 8085800 - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - movs r0, 0 - strh r0, [r1, 0x2C] - bx lr - .pool - thumb_func_end Overworld_ClearSavedMusic - - thumb_func_start sub_8085810 -sub_8085810: @ 8085810 - push {r4-r6,lr} - ldr r0, =0x00004001 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08085890 - bl warp1_target_get_music - lsls r0, 16 - lsrs r4, r0, 16 - bl GetCurrentMapMusic - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x000001bb - cmp r4, r0 - beq _08085856 - ldr r0, =0x0000ffff - cmp r4, r0 - beq _08085856 - ldr r0, =0x0000019b - cmp r5, r0 - beq _08085890 - ldr r6, =0x0000016d - cmp r5, r6 - beq _08085890 - movs r0, 0x8 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _08085856 - adds r4, r6, 0 -_08085856: - cmp r4, r5 - beq _08085890 - movs r0, 0x6 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _08085888 - adds r0, r4, 0 - movs r1, 0x4 - movs r2, 0x4 - bl FadeOutAndFadeInNewMapMusic - b _08085890 - .pool -_08085888: - adds r0, r4, 0 - movs r1, 0x8 - bl FadeOutAndPlayNewMapMusic -_08085890: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8085810 - - thumb_func_start Overworld_ChangeMusicToDefault -Overworld_ChangeMusicToDefault: @ 8085898 - push {r4,lr} - bl GetCurrentMapMusic - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sav1_map_get_music - lsls r0, 16 - lsrs r0, 16 - cmp r4, r0 - beq _080858BE - bl sav1_map_get_music - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x8 - bl FadeOutAndPlayNewMapMusic -_080858BE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end Overworld_ChangeMusicToDefault - - thumb_func_start Overworld_ChangeMusicTo -Overworld_ChangeMusicTo: @ 80858C4 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - bl GetCurrentMapMusic - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r4 - beq _080858E4 - ldr r0, =0x000001bb - cmp r1, r0 - beq _080858E4 - adds r0, r4, 0 - movs r1, 0x8 - bl FadeOutAndPlayNewMapMusic -_080858E4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end Overworld_ChangeMusicTo - - thumb_func_start is_warp1_light_level_8_or_9 -is_warp1_light_level_8_or_9: @ 80858F0 - push {lr} - bl warp1_get_mapheader - ldrb r0, [r0, 0x17] - bl is_light_level_8_or_9 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08085908 - movs r0, 0x4 - b _0808590A -_08085908: - movs r0, 0x2 -_0808590A: - pop {r1} - bx r1 - thumb_func_end is_warp1_light_level_8_or_9 - - thumb_func_start music_something -music_something: @ 8085910 - push {r4,r5,lr} - bl GetCurrentMapMusic - lsls r0, 16 - lsrs r5, r0, 16 - bl warp1_target_get_music - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x00004001 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0808597E - bl GetCurrentMapMusic - lsls r0, 16 - lsrs r0, 16 - cmp r4, r0 - beq _0808597E - ldr r0, =0x0000016d - cmp r5, r0 - bne _08085972 - ldr r0, =0x000040ca - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bne _08085972 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x0000ffff - ldrh r2, [r0, 0x4] - movs r0, 0xE0 - lsls r0, 3 - cmp r2, r0 - bne _08085972 - ldr r3, =gWarpDestination - ldrh r0, [r3] - ands r1, r0 - cmp r1, r2 - bne _08085972 - ldr r1, [r3, 0x4] - ldr r0, =0x0035001d - cmp r1, r0 - beq _0808597E -_08085972: - bl is_warp1_light_level_8_or_9 - lsls r0, 24 - lsrs r0, 24 - bl FadeOutMapMusic -_0808597E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end music_something - - thumb_func_start sub_80859A0 -sub_80859A0: @ 80859A0 - push {lr} - bl IsNotWaitingForBGMStop - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_80859A0 - - thumb_func_start sub_80859B0 -sub_80859B0: @ 80859B0 - push {lr} - movs r0, 0x4 - bl FadeOutMapMusic - pop {r0} - bx r0 - thumb_func_end sub_80859B0 thumb_func_start sub_80859BC sub_80859BC: @ 80859BC @@ -1491,7 +17,7 @@ sub_80859BC: @ 80859BC mov r0, sp adds r1, r4, 0 bl PlayerGetDestCoords - ldr r0, =gUnknown_02032306 + ldr r0, =sIsAmbientCryWaterMon ldrb r0, [r0] cmp r0, 0x1 bne _080859F0 @@ -1524,7 +50,7 @@ _080859F0: bl __umodsi3 adds r2, r0, 0 adds r2, 0x32 - ldr r0, =gUnknown_02032304 + ldr r0, =sAmbientCrySpecies ldrh r0, [r0] lsls r4, 24 asrs r4, 24 @@ -1567,7 +93,7 @@ _08085A60: .4byte _08085B0C .4byte _08085B20 _08085A74: - ldr r0, =gUnknown_02032304 + ldr r0, =sAmbientCrySpecies ldrh r0, [r0] cmp r0, 0 bne _08085A84 @@ -1673,17 +199,17 @@ ChooseAmbientCrySpecies: @ 8085B2C lsls r0, 24 cmp r0, 0 bne _08085B5C - ldr r1, =gUnknown_02032306 + ldr r1, =sIsAmbientCryWaterMon movs r0, 0x1 strb r0, [r1] bl GetLocalWaterMon b _08085B62 .pool _08085B5C: - ldr r0, =gUnknown_02032306 + ldr r0, =sIsAmbientCryWaterMon bl GetLocalWildMon _08085B62: - ldr r1, =gUnknown_02032304 + ldr r1, =sAmbientCrySpecies strh r0, [r1] pop {r0} bx r0 @@ -1796,8 +322,8 @@ _08085C10: bx r1 thumb_func_end Overworld_MapTypeAllowsTeleportAndFly - thumb_func_start is_light_level_8_or_9 -is_light_level_8_or_9: @ 8085C14 + thumb_func_start Overworld_MapTypeIsIndoors +Overworld_MapTypeIsIndoors: @ 8085C14 push {lr} lsls r0, 24 movs r1, 0xF8 @@ -1813,7 +339,7 @@ _08085C28: _08085C2A: pop {r1} bx r1 - thumb_func_end is_light_level_8_or_9 + thumb_func_end Overworld_MapTypeIsIndoors thumb_func_start sav1_saved_warp2_map_get_name sav1_saved_warp2_map_get_name: @ 8085C30 @@ -2483,7 +1009,7 @@ sub_8086204: @ 8086204 lsrs r0, 24 cmp r0, 0x1 bne _08086222 - bl AddMapNamePopUpWindowTask + bl ShowMapNamePopup _08086222: bl sub_80AF3C8 pop {r0} @@ -2899,7 +1425,7 @@ _080865F4: lsrs r0, 24 cmp r0, 0x1 bne _08086622 - bl AddMapNamePopUpWindowTask + bl ShowMapNamePopup b _08086622 .pool _08086618: diff --git a/data/field_screen.s b/data/field_screen.s index f95e7e0ec..968e2e7f3 100644 --- a/data/field_screen.s +++ b/data/field_screen.s @@ -483,7 +483,7 @@ gUnknown_0854FE64:: @ 854FE64 .2byte 0x00c8, 0x0048, 0x0040, 0x0038, 0x0030, 0x0028, 0x0020, 0x0018, 0x0000, 0x0000 .align 2 -gUnknown_0854FE78:: @ 854FE78 +gMaxFlashLevel:: @ 854FE78 .4byte 0x00000008 .align 2 diff --git a/data/scripts/maps/BattleFrontier_BattlePyramidEmptySquare.inc b/data/scripts/maps/BattleFrontier_BattlePyramidEmptySquare.inc index cff676124..c2b70944b 100644 --- a/data/scripts/maps/BattleFrontier_BattlePyramidEmptySquare.inc +++ b/data/scripts/maps/BattleFrontier_BattlePyramidEmptySquare.inc @@ -28,7 +28,7 @@ BattleFrontier_BattlePyramidEmptySquare_EventScript_252A77:: @ 8252A77 end BattleFrontier_BattlePyramidEmptySquare_EventScript_252A8F:: @ 8252A8F - special AddMapNamePopUpWindowTask + special ShowMapNamePopup setvar VAR_0x400F, 0 end diff --git a/data/scripts/maps/BattleFrontier_BattlePyramidTop.inc b/data/scripts/maps/BattleFrontier_BattlePyramidTop.inc index 6c44e0044..3ba3a5a6a 100644 --- a/data/scripts/maps/BattleFrontier_BattlePyramidTop.inc +++ b/data/scripts/maps/BattleFrontier_BattlePyramidTop.inc @@ -64,7 +64,7 @@ BattleFrontier_BattlePyramidTop_EventScript_255180:: @ 8255180 end BattleFrontier_BattlePyramidTop_EventScript_25518A:: @ 825518A - special AddMapNamePopUpWindowTask + special ShowMapNamePopup setvar VAR_0x400F, 0 end diff --git a/data/specials.inc b/data/specials.inc index a4bd17699..f9f7c97d7 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -417,8 +417,8 @@ gSpecials:: @ 81DBA64 def_special sub_813B880 def_special sub_81A085C def_special ShouldTryGetTrainerScript - def_special AddMapNamePopUpWindowTask - def_special AddMapNamePopUpWindowTask + def_special ShowMapNamePopup + def_special ShowMapNamePopup def_special sub_81BE994 def_special sub_81BE79C def_special sub_81BE7F4 diff --git a/include/constants/vars.h b/include/constants/vars.h index c0e3313b6..be21f1730 100644 --- a/include/constants/vars.h +++ b/include/constants/vars.h @@ -184,7 +184,7 @@ #define VAR_0x40B0 0x40B0 #define VAR_0x40B1 0x40B1 #define VAR_0x40B2 0x40B2 -#define VAR_0x40B3 0x40B3 +#define VAR_WEATHER_INSTITUTE_STATE 0x40B3 #define VAR_PORTHOLE 0x40B4 #define VAR_0x40B5 0x40B5 #define VAR_0x40B6 0x40B6 diff --git a/include/global.h b/include/global.h index 8913432ba..b815e1e5f 100644 --- a/include/global.h +++ b/include/global.h @@ -620,10 +620,10 @@ struct SaveBlock1 /*0x14*/ struct WarpData warp2; /*0x1C*/ struct WarpData lastHealLocation; /*0x24*/ struct WarpData warp4; - /*0x2C*/ u16 battleMusic; + /*0x2C*/ u16 savedMusic; /*0x2E*/ u8 weather; /*0x2F*/ u8 filler_2F; - /*0x30*/ u8 flashUsed; + /*0x30*/ u8 flashLevel; /*0x32*/ u16 mapDataId; /*0x34*/ u16 mapView[0x100]; /*0x234*/ u8 playerPartyCount; diff --git a/include/overworld.h b/include/overworld.h index 904f61c8e..cedad6266 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -63,6 +63,14 @@ void sub_8084D5C(s16 a1, s16 a2); void sub_8084DD4(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); // to erase later +bool32 Overworld_IsBikingAllowed(void); +u8 sub_808532C(struct UnkPlayerStruct *playerStruct, u16 a2, u8 a3); +u8 sub_808538C(struct UnkPlayerStruct *playerStruct, u8 a2, u16 a3, u8 a4); +u16 cur_mapdata_block_role_at_screen_center_acc_to_sav1(void); +bool8 Overworld_MapTypeIsIndoors(u8 mapType); +void SetDefaultFlashLevel(void); +void Overworld_ClearSavedMusic(void); +void sub_8085810(void); u8 GetMapTypeByGroupAndId(s8 mapGroup, s8 mapNum); u8 Overworld_GetMapTypeOfSaveblockLocation(void); void Overworld_SetMapObjTemplateCoords(u8, s16, s16); diff --git a/src/item_use.c b/src/item_use.c index 99dce9cbd..bc70c5884 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -45,7 +45,7 @@ extern void ItemUseOutOfBattle_EvolutionStone(u8 b); extern void bag_menu_mail_related(void); extern void OpenPokeblockCase(u8 a, void(*b)(void)); extern void overworld_free_bg_tilemaps(void); -extern bool32 sav1_map_is_biking_allowed(void); +extern bool32 Overworld_IsBikingAllowed(void); extern bool8 IsPlayerFacingSurfableFishableWater(void); extern bool8 sub_81221AC(void); extern u8 gText_ItemFinderNothing[]; @@ -236,7 +236,7 @@ void ItemUseOutOfBattle_Bike(u8 taskId) DisplayCannotDismountBikeMessage(taskId, data[3]); else { - if (sav1_map_is_biking_allowed() == TRUE && IsBikingDisallowedByPlayer() == 0) + if (Overworld_IsBikingAllowed() == TRUE && IsBikingDisallowedByPlayer() == 0) { gUnknown_0203A0F4 = ItemUseOnFieldCB_Bike; SetUpItemUseOnFieldCallback(taskId); diff --git a/src/overworld.c b/src/overworld.c index 5757ca20a..f5457242d 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -52,15 +52,16 @@ #include "wild_encounter.h" #include "bg.h" #include "money.h" +#include "save_location.h" // event scripts extern const u8 EventScript_WhiteOut[]; extern const u8 EventScript_271862[]; // vars -extern struct MapData * const gMapAttributes[]; -extern struct MapHeader * const * const gMapGroups[]; -extern s32 gMaxFlashLevel; +extern struct MapData *const gMapAttributes[]; +extern struct MapHeader *const *const gMapGroups[]; +extern const s32 gMaxFlashLevel; // functions extern void HealPlayerParty(void); @@ -71,6 +72,22 @@ extern void copy_map_tileset1_tileset2_to_vram(struct MapData *); extern void apply_map_tileset1_tileset2_palette(struct MapData *); extern void ResetCyclingRoadChallengeData(void); extern void ApplyNewEncryptionKeyToWord(u32 *word, u32 newKey); +extern void mapheader_run_script_with_tag_x5(void); +extern void ResetFieldTasksArgs(void); +extern void sub_80A0A2C(void); +extern void not_trainer_hill_battle_pyramid(void); +extern void apply_map_tileset2_palette(struct MapData *); +extern void copy_map_tileset2_to_vram_2(struct MapData *); +extern void prev_quest_postbuffer_cursor_backup_reset(void); +extern void ShowMapNamePopup(void); +extern bool32 InTrainerHill(void); +extern void sub_81AA1D8(void); +extern void sub_81D5DF8(void); +extern void sub_80EB218(void); +extern void trainer_hill_map_load_related(void); +extern void battle_pyramid_map_load_related(u8); +extern void UpdateTVScreensOnMap(u32, u32); +extern void sub_80E9238(u8); // this file's functions static void Overworld_ResetStateAfterWhiteOut(void); @@ -85,15 +102,16 @@ IWRAM_DATA u8 gUnknown_03000E19; IWRAM_DATA void *rom4_c_unused_03000e1c; // EWRAM vars +EWRAM_DATA u8 gUnknown_020322D8 = 0; EWRAM_DATA struct WarpData gUnknown_020322DC = {0}; EWRAM_DATA struct WarpData gWarpDestination = {0}; // new warp position EWRAM_DATA struct WarpData gUnknown_020322EC = {0}; EWRAM_DATA struct WarpData gUnknown_020322F4 = {0}; EWRAM_DATA u16 gLastMapSectionId = 0; -// EWRAM_DATA struct UnkPlayerStruct gUnknown_02029810 = {0}; -// EWRAM_DATA u16 sAmbientCrySpecies = 0; -// EWRAM_DATA bool8 sIsAmbientCryWaterMon = FALSE; -// EWRAM_DATA struct LinkPlayerMapObject gLinkPlayerMapObjects[4] = {0}; +EWRAM_DATA struct UnkPlayerStruct gUnknown_02032300 = {0}; +EWRAM_DATA u16 sAmbientCrySpecies = 0; +EWRAM_DATA bool8 sIsAmbientCryWaterMon = FALSE; +EWRAM_DATA struct LinkPlayerMapObject gLinkPlayerMapObjects[4] = {0}; // const rom data const struct WarpData sDummyWarpData = @@ -544,3 +562,550 @@ void sub_8084DD4(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y) { SetWarpData(&gSaveBlock1Ptr->warp4, mapGroup, mapNum, warpId, x, y); } + +void sub_8084E14(void) +{ + gWarpDestination = gSaveBlock1Ptr->warp4; +} + +void sub_8084E2C(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y) +{ + SetWarpData(&gUnknown_020322EC, mapGroup, mapNum, warpId, x, y); +} + +void warp1_set_to_warp2(void) +{ + gWarpDestination = gUnknown_020322EC; +} + +void sub_8084E80(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y) +{ + SetWarpData(&gUnknown_020322F4, mapGroup, mapNum, warpId, x, y); +} + +void sub_8084EBC(s16 x, s16 y) +{ + if (warp_data_is_not_neg_1(&gUnknown_020322F4) == TRUE) + { + gWarpDestination = gUnknown_020322DC; + } + else + { + Overworld_SetWarpDestination(gUnknown_020322F4.mapGroup, gUnknown_020322F4.mapNum, -1, x, y); + } +} + +void warp1_set_to_sav1w(void) +{ + gWarpDestination = gSaveBlock1Ptr->warp1; +} + +void sub_8084F2C(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y) +{ + SetWarpData(&gSaveBlock1Ptr->warp1, mapGroup, mapNum, warpId, x, y); +} + +void sub_8084F6C(u8 a1) +{ + const struct HealLocation *warp = GetHealLocationPointer(a1); + if (warp) + SetWarpData(&gSaveBlock1Ptr->warp1, warp->group, warp->map, -1, warp->x, warp->y); +} + +void sub_8084FAC(void) +{ + gSaveBlock1Ptr->warp1 = gSaveBlock1Ptr->warp2; +} + +struct MapConnection *GetMapConnection(u8 dir) +{ + s32 i; + s32 count = gMapHeader.connections->count; + struct MapConnection *connection = gMapHeader.connections->connections; + + if (connection == NULL) + return NULL; + + for(i = 0; i < count; i++, connection++) + if (connection->direction == dir) + return connection; + + return NULL; +} + +bool8 sub_8084FF8(u8 dir, u16 x, u16 y) +{ + struct MapConnection *connection = GetMapConnection(dir); + + if (connection != NULL) + { + Overworld_SetWarpDestination(connection->mapGroup, connection->mapNum, -1, x, y); + } + else + { + mapheader_run_script_with_tag_x6(); + if (warp_data_is_not_neg_1(&gUnknown_020322EC)) + return FALSE; + warp1_set_to_warp2(); + } + return TRUE; +} + +bool8 sub_8085058(u16 x, u16 y) +{ + return sub_8084FF8(CONNECTION_EMERGE, x, y); +} + +bool8 sub_8085078(u16 x, u16 y) +{ + return sub_8084FF8(CONNECTION_DIVE, x, y); +} + +void mliX_load_map(u8 mapGroup, u8 mapNum) +{ + s32 paletteIndex; + + Overworld_SetWarpDestination(mapGroup, mapNum, -1, -1, -1); + if (gMapHeader.regionMapSectionId != 0x3A) + sub_8085810(); + + ApplyCurrentWarp(); + set_current_map_header_from_sav1_save_old_name(); + LoadMapObjTemplatesFromHeader(); + TrySetMapSaveWarpStatus(); + ClearTempFieldEventData(); + ResetCyclingRoadChallengeData(); + prev_quest_postbuffer_cursor_backup_reset(); + TryUpdateRandomTrainerRematches(mapGroup, mapNum); + DoTimeBasedEvents(); + SetSav1WeatherFromCurrMapHeader(); + ChooseAmbientCrySpecies(); + SetDefaultFlashLevel(); + Overworld_ClearSavedMusic(); + mapheader_run_script_with_tag_x3(); + not_trainer_hill_battle_pyramid(); + copy_map_tileset2_to_vram_2(gMapHeader.mapData); + apply_map_tileset2_palette(gMapHeader.mapData); + + for (paletteIndex = 6; paletteIndex < 13; paletteIndex++) + ApplyWeatherGammaShiftToPal(paletteIndex); + + sub_80A0A2C(); + UpdateLocationHistoryForRoamer(); + RoamerMove(); + DoCurrentWeather(); + ResetFieldTasksArgs(); + mapheader_run_script_with_tag_x5(); + + if (gMapHeader.regionMapSectionId != 0x3A || gMapHeader.regionMapSectionId != gLastMapSectionId) + ShowMapNamePopup(); +} + +void mli0_load_map(u32 a1) +{ + bool8 v2; + bool8 indoors; + + set_current_map_header_from_sav1_save_old_name(); + if (!(gUnknown_020322D8 & 1)) + { + if (gMapHeader.mapDataId == 0x169) + sub_81AA1D8(); + else if (InTrainerHill()) + sub_81D5DF8(); + else + LoadMapObjTemplatesFromHeader(); + } + + v2 = is_light_level_1_2_3_5_or_6(gMapHeader.mapType); + indoors = Overworld_MapTypeIsIndoors(gMapHeader.mapType); + + sub_80EB218(); + TrySetMapSaveWarpStatus(); + ClearTempFieldEventData(); + ResetCyclingRoadChallengeData(); + prev_quest_postbuffer_cursor_backup_reset(); + TryUpdateRandomTrainerRematches(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum); + if (a1 != 1) + DoTimeBasedEvents(); + SetSav1WeatherFromCurrMapHeader(); + ChooseAmbientCrySpecies(); + if (v2) + FlagClear(FLAG_SYS_USE_FLASH); + SetDefaultFlashLevel(); + Overworld_ClearSavedMusic(); + mapheader_run_script_with_tag_x3(); + UpdateLocationHistoryForRoamer(); + RoamerMoveToOtherLocationSet(); + if (gMapHeader.mapDataId == 0x169) + battle_pyramid_map_load_related(0); + else if (InTrainerHill()) + trainer_hill_map_load_related(); + else + not_trainer_hill_battle_pyramid(); + + if (a1 != 1 && indoors) + { + UpdateTVScreensOnMap(gUnknown_03005DC0.width, gUnknown_03005DC0.height); + sub_80E9238(1); + } +} + +void player_avatar_init_params_reset(void) +{ + gUnknown_02032300.player_field_1 = 1; + gUnknown_02032300.player_field_0 = 1; +} + +void walkrun_find_lowest_active_bit_in_bitfield(void) +{ + gUnknown_02032300.player_field_1 = player_get_direction_lower_nybble(); + + if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_MACH_BIKE)) + gUnknown_02032300.player_field_0 = 2; + else if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_ACRO_BIKE)) + gUnknown_02032300.player_field_0 = 4; + else if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_SURFING)) + gUnknown_02032300.player_field_0 = 8; + else if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_4)) + gUnknown_02032300.player_field_0 = 16; + else + gUnknown_02032300.player_field_0 = 1; +} + +struct UnkPlayerStruct *sub_80852D4(void) +{ + struct UnkPlayerStruct playerStruct; + u8 mapType = Overworld_GetMapTypeOfSaveblockLocation(); + u16 v2 = cur_mapdata_block_role_at_screen_center_acc_to_sav1(); + u8 v4 = sub_808532C(&gUnknown_02032300, v2, mapType); + playerStruct.player_field_0 = v4; + playerStruct.player_field_1 = sub_808538C(&gUnknown_02032300, v4, v2, mapType); + gUnknown_02032300 = playerStruct; + return &gUnknown_02032300; +} + +u8 sub_808532C(struct UnkPlayerStruct *playerStruct, u16 a2, u8 a3) +{ + if (a3 != 8 && FlagGet(FLAG_SYS_CRUISE_MODE)) + return 1; + if (a3 == 5) + return 16; + if (MetatileBehavior_IsSurfableWaterOrUnderwater(a2) == 1) + return 8; + if (Overworld_IsBikingAllowed() != TRUE) + return 1; + if (playerStruct->player_field_0 == 2) + return 2; + if (playerStruct->player_field_0 != 4) + return 1; + return 4; +} + +u8 sub_808538C(struct UnkPlayerStruct *playerStruct, u8 a2, u16 a3, u8 a4) +{ + if (FlagGet(FLAG_SYS_CRUISE_MODE) && a4 == 6) + return 4; + if (MetatileBehavior_IsDeepSouthWarp(a3) == TRUE) + return 2; + if (MetatileBehavior_IsNonAnimDoor(a3) == TRUE || MetatileBehavior_IsDoor(a3) == TRUE) + return 1; + if (MetatileBehavior_IsSouthArrowWarp(a3) == TRUE) + return 2; + if (MetatileBehavior_IsNorthArrowWarp(a3) == TRUE) + return 1; + if (MetatileBehavior_IsWestArrowWarp(a3) == TRUE) + return 4; + if (MetatileBehavior_IsEastArrowWarp(a3) == TRUE) + return 3; + if ((playerStruct->player_field_0 == 16 && a2 == 8) + || (playerStruct->player_field_0 == 8 && a2 == 16)) + return playerStruct->player_field_1; + if (MetatileBehavior_IsLadder(a3) == TRUE) + return playerStruct->player_field_1; + return 1; +} + +u16 cur_mapdata_block_role_at_screen_center_acc_to_sav1(void) +{ + return MapGridGetMetatileBehaviorAt(gSaveBlock1Ptr->pos.x + 7, gSaveBlock1Ptr->pos.y + 7); +} + +bool32 Overworld_IsBikingAllowed(void) +{ + if (!(gMapHeader.flags & 1)) + return FALSE; + else + return TRUE; +} + +void SetDefaultFlashLevel(void) +{ + if (!gMapHeader.cave) + gSaveBlock1Ptr->flashLevel = 0; + else if (FlagGet(FLAG_SYS_USE_FLASH)) + gSaveBlock1Ptr->flashLevel = 1; + else + gSaveBlock1Ptr->flashLevel = gMaxFlashLevel - 1; +} + +void Overworld_SetFlashLevel(s32 flashLevel) +{ + if (flashLevel < 0 || flashLevel > gMaxFlashLevel) + flashLevel = 0; + gSaveBlock1Ptr->flashLevel = flashLevel; +} + +u8 Overworld_GetFlashLevel(void) +{ + return gSaveBlock1Ptr->flashLevel; +} + +void sub_8085524(u16 mapDataId) +{ + gSaveBlock1Ptr->mapDataId = mapDataId; + gMapHeader.mapData = get_mapdata_header(); +} + +void sub_8085540(u8 var) +{ + gUnknown_020322D8 = var; +} + +u8 sub_808554C(void) +{ + return gUnknown_020322D8; +} + +bool16 ShouldLegendaryMusicPlayAtLocation(struct WarpData *warp) +{ + if (!FlagGet(FLAG_SYS_WEATHER_CTRL)) + return FALSE; + if (warp->mapGroup == 0) + { + switch (warp->mapNum) + { + case MAP_NUM(LILYCOVE_CITY): + case MAP_NUM(MOSSDEEP_CITY): + case MAP_NUM(SOOTOPOLIS_CITY): + case MAP_NUM(EVER_GRANDE_CITY): + case MAP_NUM(ROUTE124): + case MAP_NUM(ROUTE125): + case MAP_NUM(ROUTE126): + case MAP_NUM(ROUTE127): + case MAP_NUM(ROUTE128): + return TRUE; + default: + if (VarGet(VAR_0x405E) < 4) + return FALSE; + switch (warp->mapNum) + { + case MAP_NUM(ROUTE129): + case MAP_NUM(ROUTE130): + case MAP_NUM(ROUTE131): + return TRUE; + } + } + } + return FALSE; +} + +bool16 NoMusicInSotopolisWithLegendaries(struct WarpData *warp) +{ + if (VarGet(VAR_0x40CA) != 1) + return FALSE; + if (warp->mapGroup != MAP_GROUP(SOOTOPOLIS_CITY)) + return FALSE; + if (warp->mapNum == MAP_NUM(SOOTOPOLIS_CITY)) + return TRUE; + return FALSE; +} + +bool16 IsInfiltratedWeatherInstitute(struct WarpData *warp) +{ + if (VarGet(VAR_WEATHER_INSTITUTE_STATE)) + return FALSE; + if (warp->mapGroup != MAP_GROUP(ROUTE119_WEATHER_INSTITUTE_1F)) + return FALSE; + if (warp->mapNum == MAP_NUM(ROUTE119_WEATHER_INSTITUTE_1F) + || warp->mapNum == MAP_NUM(ROUTE119_WEATHER_INSTITUTE_2F)) + return TRUE; + return FALSE; +} + +bool16 IsInflitratedSpaceCenter(struct WarpData *warp) +{ + if (VarGet(VAR_0x405D) == 0) + return FALSE; + if (VarGet(VAR_0x405D) > 2) + return FALSE; + if (warp->mapGroup != MAP_GROUP(MOSSDEEP_CITY_SPACE_CENTER_1F)) + return FALSE; + if (warp->mapNum == MAP_NUM(MOSSDEEP_CITY_SPACE_CENTER_1F) + || warp->mapNum == MAP_NUM(MOSSDEEP_CITY_SPACE_CENTER_2F)) + return TRUE; + return FALSE; +} + +u16 GetLocationMusic(struct WarpData *warp) +{ + if (NoMusicInSotopolisWithLegendaries(warp) == TRUE) + return 0xFFFF; + else if (ShouldLegendaryMusicPlayAtLocation(warp) == TRUE) + return MUS_OOAME; + else if (IsInflitratedSpaceCenter(warp) == TRUE) + return MUS_MGM0; + else if (IsInfiltratedWeatherInstitute(warp) == TRUE) + return MUS_TOZAN; + else + return Overworld_GetMapHeaderByGroupAndId(warp->mapGroup, warp->mapNum)->music; +} + +u16 GetCurrLocationDefaultMusic(void) +{ + u16 music; + + // Play the desert music only when the sandstorm is active on Route 111. + if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(ROUTE111) + && gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE111) + && GetSav1Weather() == 8) + return MUS_ASHROAD; + + music = GetLocationMusic(&gSaveBlock1Ptr->location); + if (music != 0x7FFF) + { + return music; + } + else + { + if (gSaveBlock1Ptr->pos.x < 24) + return MUS_DOORO_X1; + else + return MUS_GRANROAD; + } +} + +u16 GetWarpDestinationMusic(void) +{ + u16 music = GetLocationMusic(&gWarpDestination); + if (music != 0x7FFF) + { + return music; + } + else + { + if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(MAUVILLE_CITY) + && gSaveBlock1Ptr->location.mapNum == MAP_NUM(MAUVILLE_CITY)) + return MUS_DOORO_X1; + else + return MUS_GRANROAD; + } +} + +void Overworld_ResetMapMusic(void) +{ + ResetMapMusic(); +} + +void Overworld_PlaySpecialMapMusic(void) +{ + u16 music = GetCurrLocationDefaultMusic(); + + if (music != MUS_OOAME && music != 0xFFFF) + { + if (gSaveBlock1Ptr->savedMusic) + music = gSaveBlock1Ptr->savedMusic; + else if (Overworld_GetMapTypeOfSaveblockLocation() == MAP_TYPE_UNDERWATER) + music = MUS_DEEPDEEP; + else if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_SURFING)) + music = MUS_NAMINORI; + } + + if (music != GetCurrentMapMusic()) + PlayNewMapMusic(music); +} + +void Overworld_SetSavedMusic(u16 songNum) +{ + gSaveBlock1Ptr->savedMusic = songNum; +} + +void Overworld_ClearSavedMusic(void) +{ + gSaveBlock1Ptr->savedMusic = 0; +} + +void sub_8085810(void) +{ + if (FlagGet(FLAG_SPECIAL_FLAG_0x4001) != TRUE) + { + u16 newMusic = GetWarpDestinationMusic(); + u16 currentMusic = GetCurrentMapMusic(); + if (newMusic != MUS_OOAME && newMusic != 0xFFFF) + { + if (currentMusic == MUS_DEEPDEEP || currentMusic == MUS_NAMINORI) + return; + if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_SURFING)) + newMusic = MUS_NAMINORI; + } + if (newMusic != currentMusic) + { + if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_MACH_BIKE | PLAYER_AVATAR_FLAG_ACRO_BIKE)) + FadeOutAndFadeInNewMapMusic(newMusic, 4, 4); + else + FadeOutAndPlayNewMapMusic(newMusic, 8); + } + } +} + +void Overworld_ChangeMusicToDefault(void) +{ + u16 currentMusic = GetCurrentMapMusic(); + if (currentMusic != GetCurrLocationDefaultMusic()) + FadeOutAndPlayNewMapMusic(GetCurrLocationDefaultMusic(), 8); +} + +void Overworld_ChangeMusicTo(u16 newMusic) +{ + u16 currentMusic = GetCurrentMapMusic(); + if (currentMusic != newMusic && currentMusic != MUS_OOAME) + FadeOutAndPlayNewMapMusic(newMusic, 8); +} + +u8 GetMapMusicFadeoutSpeed(void) +{ + struct MapHeader *mapHeader = warp1_get_mapheader(); + if (Overworld_MapTypeIsIndoors(mapHeader->mapType) == TRUE) + return 2; + else + return 4; +} + +void music_something(void) +{ + u16 currentMusic = GetCurrentMapMusic(); + u16 warpMusic = GetWarpDestinationMusic(); + if (FlagGet(FLAG_SPECIAL_FLAG_0x4001) != TRUE && warpMusic != GetCurrentMapMusic()) + { + if (currentMusic == MUS_NAMINORI + && VarGet(VAR_0x40CA) == 2 + && gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(SOOTOPOLIS_CITY) + && gSaveBlock1Ptr->location.mapNum == MAP_NUM(SOOTOPOLIS_CITY) + && gWarpDestination.mapGroup == MAP_GROUP(SOOTOPOLIS_CITY) + && gWarpDestination.mapNum == MAP_NUM(SOOTOPOLIS_CITY) + && gWarpDestination.x == 0x1D + && gWarpDestination.y == 0x35) + return; + FadeOutMapMusic(GetMapMusicFadeoutSpeed()); + } +} + +bool8 sub_80859A0(void) +{ + return IsNotWaitingForBGMStop(); +} + +void Overworld_FadeOutMapMusic(void) +{ + FadeOutMapMusic(4); +} diff --git a/sym_ewram.txt b/sym_ewram.txt index ed231e96f..05118682e 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -211,24 +211,8 @@ gDifferentSaveFile: @ 20322D4 gUnknown_020322D5: @ 20322D5 .space 0x3 -gUnknown_020322D8: @ 20322D8 - .space 0x4 - .include "src/overworld.o" -.align 2 -gUnknown_02032300: @ 2032300 - .space 0x4 - -gUnknown_02032304: @ 2032304 - .space 0x2 - -gUnknown_02032306: @ 2032306 - .space 0x2 - -gLinkPlayerMapObjects: @ 2032308 - .space 0x10 - gUnknown_02032318: @ 2032318 .space 0x5000