Finish fldeff_strength.s

This commit is contained in:
KDSKardabox 2018-02-13 23:08:54 +05:30
parent e375606810
commit c959dc1174
6 changed files with 20 additions and 178 deletions

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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();
}
*/

View File

@ -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;
}