diff --git a/asm/fldeff_strength.s b/asm/fldeff_strength.s deleted file mode 100644 index a0a3f932d6..0000000000 --- a/asm/fldeff_strength.s +++ /dev/null @@ -1,93 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - -// thumb_func_start hm_prepare_rocksmash -//hm_prepare_rocksmash: @ 8145DC4 -// push {r4,lr} -// movs r0, 0x57 -// bl npc_before_player_of_type -// lsls r0, 24 -// lsrs r0, 24 -// cmp r0, 0x1 -// beq _08145DD8 -// movs r0, 0 -// b _08145DF2 -//_08145DD8: -// ldr r4, =gSpecialVar_Result -// bl GetCursorSelectionMonId -// lsls r0, 24 -// lsrs r0, 24 -// strh r0, [r4] -// ldr r1, =gUnknown_03005DB0 -// ldr r0, =FieldCallback_Teleport -// str r0, [r1] -// ldr r1, =gUnknown_0203CEEC -// ldr r0, =sub_8145E0C -// str r0, [r1] -// movs r0, 0x1 -//_08145DF2: -// pop {r4} -// pop {r1} -// bx r1 -// .pool -// thumb_func_end hm_prepare_rocksmash - -// thumb_func_start sub_8145E0C -//sub_8145E0C: @ 8145E0C -// push {lr} -// bl GetCursorSelectionMonId -// ldr r1, =gFieldEffectArguments -// lsls r0, 24 -// lsrs r0, 24 -// str r0, [r1] -// ldr r0, =FieryPath_EventScript_2908FD -// bl ScriptContext1_SetupScript -// pop {r0} -// bx r0 -// .pool -// thumb_func_end sub_8145E0C - - thumb_func_start sub_8145E2C -sub_8145E2C: @ 8145E2C - push {lr} - bl oei_task_add - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =sub_8145E74 - lsrs r0, r2, 16 - strh r0, [r1, 0x18] - strh r2, [r1, 0x1A] - ldr r0, =gFieldEffectArguments - ldr r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gStringVar1 - bl GetMonNickname - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8145E2C - - thumb_func_start sub_8145E74 -sub_8145E74: @ 8145E74 - push {lr} - movs r0, 0x28 - bl FieldEffectActiveListRemove - bl EnableBothScriptContexts - pop {r0} - bx r0 - thumb_func_end sub_8145E74 - - .align 2, 0 @ Don't pad with nop. diff --git a/include/event_scripts.h b/include/event_scripts.h index a54e0e463a..1038791019 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -380,4 +380,6 @@ extern const u8 SecretBase_RedCave1_Text_274E75[]; extern const u8 SecretBase_RedCave1_Text_2751E1[]; extern const u8 SecretBase_RedCave1_Text_2754F6[]; extern const u8 SecretBase_RedCave1_Text_2758CC[]; + +extern const u8 FieryPath_EventScript_2908FD[]; #endif //GUARD_EVENT_SCRIPTS_H diff --git a/include/field_effect.h b/include/field_effect.h index 7395270f91..6f5a9886f2 100644 --- a/include/field_effect.h +++ b/include/field_effect.h @@ -79,5 +79,7 @@ u8 CreateTrainerSprite(u8 trainerSpriteID, s16 x, s16 y, u8 subpriority, u8 *buf void sub_80B7FC8(void); void FieldEffectActiveListRemove(u8 id); void MultiplyInvertedPaletteRGBComponents(u16, u8, u8, u8); +extern void (*gUnknown_0203CEEC)(void); +extern bool8 (*gUnknown_03005DB0)(void); #endif //GUARD_FIELD_EFFECTS_H diff --git a/ld_script.txt b/ld_script.txt index fcecdd4beb..386d631271 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -193,8 +193,7 @@ SECTIONS { asm/pokedex_cry_screen.o(.text); src/coins.o(.text); src/landmark.o(.text); - src/fldeff_strength.o(.text); - asm/fldeff_strength.o(.text); + src/fldeff_strength.o(.text); src/battle_transition.o(.text); src/battle_controller_link_partner.o(.text); src/battle_message.o(.text); diff --git a/src/fldeff_strength.c b/src/fldeff_strength.c index 77fa0db359..9f649f56cc 100644 --- a/src/fldeff_strength.c +++ b/src/fldeff_strength.c @@ -1,16 +1,14 @@ #include "global.h" +#include "event_data.h" +#include "event_scripts.h" #include "field_effect.h" -#include "rom6.h" #include "party_menu.h" - +#include "rom6.h" #include "script.h" +#include "task.h" -extern u16 gSpecialVar_Result; -extern void (*gUnknown_0203CEEC)(void); -extern bool8 (*gUnknown_03005DB0)(void); -static void sub_8145E0C(void); - -extern u8 FieryPath_EventScript_2908FD[]; +void sub_8145E0C(void); +void sub_8145E74(void); bool8 hm_prepare_rocksmash(void) { @@ -24,86 +22,23 @@ bool8 hm_prepare_rocksmash(void) return FALSE; } -static void sub_8145E0C(void) +void sub_8145E0C(void) { gFieldEffectArguments[0] = GetCursorSelectionMonId(); ScriptContext1_SetupScript(FieryPath_EventScript_2908FD); } -/* -#include "braille_puzzles.h" -#include "field_effect.h" -#include "party_menu.h" -#include "pokemon.h" -#include "pokemon_menu.h" - -#include "script.h" -#include "task.h" -#include "text.h" - -static void sub_811AA18(void); -static void sub_811AA38(void); -static void sub_811AA9C(void); - -extern u8 gLastFieldPokeMenuOpened; -extern u16 gSpecialVar_Result; -extern void (*gFieldCallback)(void); -extern void (*gUnknown_03005CE4)(void); - -extern u8 S_UseStrength[]; - -bool8 SetUpFieldMove_Strength(void) -{ - if (ShouldDoBrailleStrengthEffect()) - { - gSpecialVar_Result = gLastFieldPokeMenuOpened; - gFieldCallback = FieldCallback_Teleport; - gUnknown_03005CE4 = sub_811AA38; - } - else - { - if (npc_before_player_of_type(87) != TRUE) - return 0; - gSpecialVar_Result = gLastFieldPokeMenuOpened; - gFieldCallback = FieldCallback_Teleport; - gUnknown_03005CE4 = sub_811AA18; - } - - return TRUE; -} - -static void sub_811AA18(void) -{ - gFieldEffectArguments[0] = gLastFieldPokeMenuOpened; - ScriptContext1_SetupScript(S_UseStrength); -} - -static void sub_811AA38(void) -{ - gFieldEffectArguments[0] = gLastFieldPokeMenuOpened; - FieldEffectStart(FLDEFF_USE_STRENGTH); -} - -bool8 FldEff_UseStrength(void) +bool8 sub_8145E2C(void) { u8 taskId = oei_task_add(); - - gTasks[taskId].data[8] = (u32)sub_811AA9C >> 16; - gTasks[taskId].data[9] = (u32)sub_811AA9C; + gTasks[taskId].data[8] = (u32)sub_8145E74 >> 16; + gTasks[taskId].data[9] = (u32)sub_8145E74; GetMonNickname(&gPlayerParty[gFieldEffectArguments[0]], gStringVar1); return FALSE; } -static void sub_811AA9C(void) +void sub_8145E74(void) { - if (ShouldDoBrailleStrengthEffect()) - { - DoBrailleStrengthEffect(); - } - else - { - FieldEffectActiveListRemove(40); - EnableBothScriptContexts(); - } + FieldEffectActiveListRemove(40); + EnableBothScriptContexts(); } -*/ diff --git a/src/fldeff_teleport.c b/src/fldeff_teleport.c index 5b3492db03..e675ef0a58 100644 --- a/src/fldeff_teleport.c +++ b/src/fldeff_teleport.c @@ -7,17 +7,14 @@ #include "rom6.h" #include "task.h" -extern bool8 (*gUnknown_03005DB0)(void); -extern void (*gUnknown_0203CEEC)(void); - bool8 SetUpFieldMove_Teleport(void) { if (Overworld_MapTypeAllowsTeleportAndFly(gMapHeader.mapType) == TRUE) { gUnknown_03005DB0 = FieldCallback_Teleport; - gUnknown_0203CEEC = hm_teleport_run_dp02scr; + gUnknown_0203CEEC = hm_teleport_run_dp02scr; return TRUE; - } + } return FALSE; }