mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
Review fixes
This commit is contained in:
parent
4f726232b8
commit
e3585d7d66
@ -13641,7 +13641,7 @@ sub_8195ED8: @ 8195ED8
|
||||
push {r4,lr}
|
||||
ldr r4, =gMapHeader
|
||||
ldrb r0, [r4, 0x17]
|
||||
bl is_light_level_1_2_3_or_6
|
||||
bl Overworld_MapTypeAllowsTeleportAndFly
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _08195F30
|
||||
|
@ -591,7 +591,7 @@ sub_80FA004: @ 80FA004
|
||||
bne _080FA070
|
||||
bl sub_80F9F5C
|
||||
ldr r1, =gUnknown_03005DB0
|
||||
ldr r0, =hm_add_c3_launch_phase_2
|
||||
ldr r0, =FieldCallback_Teleport
|
||||
str r0, [r1]
|
||||
ldr r1, =gUnknown_0203CEEC
|
||||
ldr r0, =sub_80FA0DC
|
||||
@ -606,7 +606,7 @@ _080FA070:
|
||||
bne _080FA0A0
|
||||
bl sub_80F9F5C
|
||||
ldr r1, =gUnknown_03005DB0
|
||||
ldr r0, =hm_add_c3_launch_phase_2
|
||||
ldr r0, =FieldCallback_Teleport
|
||||
str r0, [r1]
|
||||
ldr r1, =gUnknown_0203CEEC
|
||||
ldr r0, =sub_80FA1E8
|
||||
@ -625,7 +625,7 @@ _080FA0AE:
|
||||
_080FA0B2:
|
||||
bl sub_80F9F5C
|
||||
ldr r1, =gUnknown_03005DB0
|
||||
ldr r0, =hm_add_c3_launch_phase_2
|
||||
ldr r0, =FieldCallback_Teleport
|
||||
str r0, [r1]
|
||||
ldr r1, =gUnknown_0203CEEC
|
||||
ldr r0, =sub_80FA34C
|
||||
|
@ -20,7 +20,7 @@ sub_80D3718: @ 80D3718
|
||||
cmp r0, 0x1
|
||||
bne _080D3754
|
||||
ldr r1, =gUnknown_03005DB0
|
||||
ldr r0, =hm_add_c3_launch_phase_2
|
||||
ldr r0, =FieldCallback_Teleport
|
||||
str r0, [r1]
|
||||
ldr r1, =gUnknown_0203CEEC
|
||||
ldr r0, =sub_80D3A9C
|
||||
@ -322,7 +322,7 @@ _080D395A:
|
||||
bne _080D39F8
|
||||
_080D39BC:
|
||||
ldr r1, =gUnknown_03005DB0
|
||||
ldr r0, =hm_add_c3_launch_phase_2
|
||||
ldr r0, =FieldCallback_Teleport
|
||||
str r0, [r1]
|
||||
ldr r1, =gUnknown_0203CEEC
|
||||
ldr r0, =hm2_ruin_valley
|
||||
@ -360,7 +360,7 @@ _080D3A18:
|
||||
bne _080D3A2A
|
||||
_080D3A1E:
|
||||
ldr r1, =gUnknown_03005DB0
|
||||
ldr r0, =hm_add_c3_launch_phase_2
|
||||
ldr r0, =FieldCallback_Teleport
|
||||
str r0, [r1]
|
||||
ldr r1, =gUnknown_0203CEEC
|
||||
ldr r0, =hm2_ruin_valley
|
||||
|
@ -18,7 +18,7 @@ SetUpFieldMove_Flash: @ 81370FC
|
||||
lsrs r0, 24
|
||||
strh r0, [r4]
|
||||
ldr r1, =gUnknown_03005DB0
|
||||
ldr r0, =hm_add_c3_launch_phase_2
|
||||
ldr r0, =FieldCallback_Teleport
|
||||
str r0, [r1]
|
||||
ldr r1, =gUnknown_0203CEEC
|
||||
ldr r0, =sub_8179918
|
||||
@ -35,7 +35,7 @@ _08137134:
|
||||
cmp r0, 0
|
||||
bne _08137170
|
||||
ldr r1, =gUnknown_03005DB0
|
||||
ldr r0, =hm_add_c3_launch_phase_2
|
||||
ldr r0, =FieldCallback_Teleport
|
||||
str r0, [r1]
|
||||
ldr r1, =gUnknown_0203CEEC
|
||||
ldr r0, =hm2_flash
|
||||
|
@ -23,7 +23,7 @@ _08145DD8:
|
||||
lsrs r0, 24
|
||||
strh r0, [r4]
|
||||
ldr r1, =gUnknown_03005DB0
|
||||
ldr r0, =hm_add_c3_launch_phase_2
|
||||
ldr r0, =FieldCallback_Teleport
|
||||
str r0, [r1]
|
||||
ldr r1, =gUnknown_0203CEEC
|
||||
ldr r0, =sub_8145E0C
|
||||
|
@ -8,7 +8,7 @@
|
||||
thumb_func_start SetUpFieldMove_SweetScent
|
||||
SetUpFieldMove_SweetScent: @ 8159EF0
|
||||
ldr r1, =gUnknown_03005DB0
|
||||
ldr r0, =hm_add_c3_launch_phase_2
|
||||
ldr r0, =FieldCallback_Teleport
|
||||
str r0, [r1]
|
||||
ldr r1, =gUnknown_0203CEEC
|
||||
ldr r0, =hm2_sweet_scent
|
||||
|
@ -50,8 +50,8 @@ flag_var_implications_of_teleport_: @ 8084660
|
||||
.pool
|
||||
thumb_func_end flag_var_implications_of_teleport_
|
||||
|
||||
thumb_func_start sub_808469C
|
||||
sub_808469C: @ 808469C
|
||||
thumb_func_start Overworld_ResetStateAfterTeleport
|
||||
Overworld_ResetStateAfterTeleport: @ 808469C
|
||||
push {lr}
|
||||
bl player_avatar_init_params_reset
|
||||
ldr r0, =0x0000088b
|
||||
@ -69,7 +69,7 @@ sub_808469C: @ 808469C
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_808469C
|
||||
thumb_func_end Overworld_ResetStateAfterTeleport
|
||||
|
||||
thumb_func_start flagmods_08054D70
|
||||
flagmods_08054D70: @ 80846E4
|
||||
@ -2772,8 +2772,8 @@ _08085BF0:
|
||||
bx r1
|
||||
thumb_func_end is_light_level_1_2_3_5_or_6
|
||||
|
||||
thumb_func_start is_light_level_1_2_3_or_6
|
||||
is_light_level_1_2_3_or_6: @ 8085BF4
|
||||
thumb_func_start Overworld_MapTypeAllowsTeleportAndFly
|
||||
Overworld_MapTypeAllowsTeleportAndFly: @ 8085BF4
|
||||
push {lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
@ -2793,7 +2793,7 @@ _08085C0E:
|
||||
_08085C10:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end is_light_level_1_2_3_or_6
|
||||
thumb_func_end Overworld_MapTypeAllowsTeleportAndFly
|
||||
|
||||
thumb_func_start is_light_level_8_or_9
|
||||
is_light_level_8_or_9: @ 8085C14
|
||||
|
@ -10027,8 +10027,8 @@ _081B572A:
|
||||
.pool
|
||||
thumb_func_end sub_81B56D8
|
||||
|
||||
thumb_func_start hm_add_c3_launch_phase_2
|
||||
hm_add_c3_launch_phase_2: @ 81B5738
|
||||
thumb_func_start FieldCallback_Teleport
|
||||
FieldCallback_Teleport: @ 81B5738
|
||||
push {lr}
|
||||
bl pal_fill_black
|
||||
ldr r0, =task_launch_hm_phase_2
|
||||
@ -10038,7 +10038,7 @@ hm_add_c3_launch_phase_2: @ 81B5738
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end hm_add_c3_launch_phase_2
|
||||
thumb_func_end FieldCallback_Teleport
|
||||
|
||||
thumb_func_start task_launch_hm_phase_2
|
||||
task_launch_hm_phase_2: @ 81B5750
|
||||
@ -10160,7 +10160,7 @@ sub_81B5820: @ 81B5820
|
||||
cmp r0, 0x1
|
||||
bne _081B585C
|
||||
ldr r1, =gUnknown_03005DB0
|
||||
ldr r0, =hm_add_c3_launch_phase_2
|
||||
ldr r0, =FieldCallback_Teleport
|
||||
str r0, [r1]
|
||||
ldr r1, =gUnknown_0203CEEC
|
||||
ldr r0, =hm_surf_run_dp02scr
|
||||
@ -10199,7 +10199,7 @@ sub_81B5884: @ 81B5884
|
||||
push {lr}
|
||||
ldr r0, =gMapHeader
|
||||
ldrb r0, [r0, 0x17]
|
||||
bl is_light_level_1_2_3_or_6
|
||||
bl Overworld_MapTypeAllowsTeleportAndFly
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
@ -10278,7 +10278,7 @@ hm_prepare_waterfall: @ 81B58F0
|
||||
cmp r0, 0x1
|
||||
bne _081B594C
|
||||
ldr r1, =gUnknown_03005DB0
|
||||
ldr r0, =hm_add_c3_launch_phase_2
|
||||
ldr r0, =FieldCallback_Teleport
|
||||
str r0, [r1]
|
||||
ldr r1, =gUnknown_0203CEEC
|
||||
ldr r0, =hm2_waterfall
|
||||
@ -10325,7 +10325,7 @@ sub_81B5974: @ 81B5974
|
||||
.pool
|
||||
_081B5990:
|
||||
ldr r1, =gUnknown_03005DB0
|
||||
ldr r0, =hm_add_c3_launch_phase_2
|
||||
ldr r0, =FieldCallback_Teleport
|
||||
str r0, [r1]
|
||||
ldr r1, =gUnknown_0203CEEC
|
||||
ldr r0, =sub_81B5958
|
||||
|
@ -7924,7 +7924,7 @@ sub_81CAF78: @ 81CAF78
|
||||
strb r0, [r6]
|
||||
ldr r0, =gMapHeader
|
||||
ldrb r0, [r0, 0x17]
|
||||
bl is_light_level_1_2_3_or_6
|
||||
bl Overworld_MapTypeAllowsTeleportAndFly
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _081CAFA4
|
||||
|
@ -268,7 +268,7 @@ sub_8135654: @ 8135654
|
||||
lsrs r0, 24
|
||||
strh r0, [r4]
|
||||
ldr r1, =gUnknown_03005DB0
|
||||
ldr r0, =hm_add_c3_launch_phase_2
|
||||
ldr r0, =FieldCallback_Teleport
|
||||
str r0, [r1]
|
||||
ldr r1, =gUnknown_0203CEEC
|
||||
ldr r0, =sub_8179834
|
||||
@ -285,7 +285,7 @@ _0813568C:
|
||||
b _081356AC
|
||||
_0813569E:
|
||||
ldr r1, =gUnknown_03005DB0
|
||||
ldr r0, =hm_add_c3_launch_phase_2
|
||||
ldr r0, =FieldCallback_Teleport
|
||||
str r0, [r1]
|
||||
ldr r1, =gUnknown_0203CEEC
|
||||
ldr r0, =sub_81356C4
|
||||
@ -361,7 +361,7 @@ sub_813572C: @ 813572C
|
||||
b _0813574C
|
||||
_0813573E:
|
||||
ldr r1, =gUnknown_03005DB0
|
||||
ldr r0, =hm_add_c3_launch_phase_2
|
||||
ldr r0, =FieldCallback_Teleport
|
||||
str r0, [r1]
|
||||
ldr r1, =gUnknown_0203CEEC
|
||||
ldr r0, =hm2_dig
|
||||
|
@ -75,5 +75,7 @@ u32 FieldEffectStart(u8);
|
||||
bool8 FieldEffectActiveListContains(u8 id);
|
||||
void sub_80B69DC(void);
|
||||
void FieldEffectStop(struct Sprite *sprite, u8 id);
|
||||
void sub_80B7FC8(void);
|
||||
void FieldEffectActiveListRemove(u8 id);
|
||||
|
||||
#endif //GUARD_FIELD_EFFECTS_H
|
||||
|
7
include/fldeff_teleport.h
Normal file
7
include/fldeff_teleport.h
Normal file
@ -0,0 +1,7 @@
|
||||
#ifndef GUARD_FLDEFF_TELEPORT_H
|
||||
#define GUARD_FLDEFF_TELEPORT_H
|
||||
|
||||
void hm_teleport_run_dp02scr(void);
|
||||
void sub_817C94C(void);
|
||||
|
||||
#endif // GUARD_FLDEFF_TELEPORT_H
|
@ -42,6 +42,9 @@ void sub_8084EBC(s16, s16);
|
||||
|
||||
void player_avatar_init_params_reset(void);
|
||||
|
||||
bool8 Overworld_MapTypeAllowsTeleportAndFly(u8 mapType);
|
||||
void Overworld_ResetStateAfterTeleport(void);
|
||||
|
||||
void Overworld_SetFlashLevel(s32 a1);
|
||||
//u8 Overworld_GetFlashLevel(void);
|
||||
void sub_8085524(u16);
|
||||
|
@ -16,5 +16,7 @@ void sub_81B58A8(void);
|
||||
void DoWallyTutorialBagMenu(void);
|
||||
u8 pokemon_ailments_get_primary(u32 status);
|
||||
u8 *GetMonNickname(struct Pokemon *mon, u8 *dst);
|
||||
u8 GetCursorSelectionMonId(void);
|
||||
bool8 FieldCallback_Teleport(void);
|
||||
|
||||
#endif // GUARD_PARTY_MENU_H
|
||||
|
@ -11,5 +11,6 @@ void UpdateBirchState(u16 days);
|
||||
void UpdateFrontierManiac(u16 days);
|
||||
void UpdateFrontierGambler(u16 days);
|
||||
void SetShoalItemFlag(u16 days);
|
||||
u8 oei_task_add(void);
|
||||
|
||||
#endif //GUARD_ROM6_H
|
||||
|
@ -1,55 +1,45 @@
|
||||
#include "global.h"
|
||||
#include "fldeff_teleport.h"
|
||||
#include "field_effect.h"
|
||||
#include "field_player_avatar.h"
|
||||
#include "party_menu.h"
|
||||
#include "overworld.h"
|
||||
#include "rom6.h"
|
||||
#include "task.h"
|
||||
|
||||
extern bool8 is_light_level_1_2_3_or_6(u8 mapType);
|
||||
extern void* hm_add_c3_launch_phase_2(void);
|
||||
extern void sub_808469C(void);
|
||||
extern u8 GetCursorSelectionMonId(void);
|
||||
extern u8 oei_task_add(void);
|
||||
extern void FieldEffectActiveListRemove(u8 id);
|
||||
extern void sub_80B7FC8(void);
|
||||
extern void SetPlayerAvatarTransitionFlags(u8);
|
||||
extern bool8 (*gUnknown_03005DB0)(void);
|
||||
extern void (*gUnknown_0203CEEC)(void);
|
||||
|
||||
extern void* gUnknown_0203CEEC;
|
||||
extern void* gUnknown_03005DB0;
|
||||
|
||||
void hm_teleport_run_dp02scr(void);
|
||||
void sub_817C94C(void);
|
||||
|
||||
// 817C8BC
|
||||
bool8 SetUpFieldMove_Teleport(void)
|
||||
{
|
||||
if (is_light_level_1_2_3_or_6(gMapHeader.mapType) == TRUE)
|
||||
if (Overworld_MapTypeAllowsTeleportAndFly(gMapHeader.mapType) == TRUE)
|
||||
{
|
||||
gUnknown_03005DB0 = hm_add_c3_launch_phase_2;
|
||||
gUnknown_03005DB0 = FieldCallback_Teleport;
|
||||
gUnknown_0203CEEC = hm_teleport_run_dp02scr;
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// 817C8FC
|
||||
void hm_teleport_run_dp02scr(void)
|
||||
{
|
||||
sub_808469C();
|
||||
FieldEffectStart(0x3F);
|
||||
Overworld_ResetStateAfterTeleport();
|
||||
FieldEffectStart(FLDEFF_USE_TELEPORT);
|
||||
gFieldEffectArguments[0] = (u32)GetCursorSelectionMonId();
|
||||
}
|
||||
|
||||
// 817C91C
|
||||
u8 FldEff_UseTeleport(void)
|
||||
bool8 FldEff_UseTeleport(void)
|
||||
{
|
||||
u8 taskID = oei_task_add();
|
||||
gTasks[taskID].data[8] = (u32)sub_817C94C >> 16;
|
||||
gTasks[taskID].data[9] = (u32)sub_817C94C;
|
||||
u8 taskId = oei_task_add();
|
||||
gTasks[taskId].data[8] = (u32)sub_817C94C >> 16;
|
||||
gTasks[taskId].data[9] = (u32)sub_817C94C;
|
||||
SetPlayerAvatarTransitionFlags(1);
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void sub_817C94C(void)
|
||||
{
|
||||
FieldEffectActiveListRemove(0x3F);
|
||||
FieldEffectActiveListRemove(FLDEFF_USE_TELEPORT);
|
||||
sub_80B7FC8();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user