diff options
-rw-r--r-- | asm/code_8044CC8.s (renamed from asm/code_804ACA0.s) | 32 | ||||
-rw-r--r-- | include/dungeon_action.h | 2 | ||||
-rwxr-xr-x | ld_script.txt | 2 | ||||
-rw-r--r-- | src/dungeon_action.c | 17 | ||||
-rw-r--r-- | src/dungeon_movement.c | 8 | ||||
-rw-r--r-- | src/status_checks.c | 3 |
6 files changed, 29 insertions, 35 deletions
diff --git a/asm/code_804ACA0.s b/asm/code_8044CC8.s index 7e25d6d..f5a3aca 100644 --- a/asm/code_804ACA0.s +++ b/asm/code_8044CC8.s @@ -1,34 +1,10 @@ #include "asm/constants/gba_constants.inc" - #include "asm/macros.inc" + #include "asm/macros.inc" - .syntax unified - - .text - - thumb_func_start SetWalkAction -SetWalkAction: - push {r4,lr} - adds r4, r0, 0 - lsls r0, r1, 16 - asrs r0, 16 - bl GetIsMoving - lsls r0, 24 - cmp r0, 0 - beq _08044CB6 - movs r0, 0x2 - b _08044CB8 -_08044CB6: - movs r0, 0x1 -_08044CB8: - strh r0, [r4] - movs r0, 0 - strb r0, [r4, 0x4] - strb r0, [r4, 0xC] - pop {r4} - pop {r0} - bx r0 - thumb_func_end SetWalkAction + .syntax unified + .text + thumb_func_start sub_8044CC8 sub_8044CC8: push {lr} diff --git a/include/dungeon_action.h b/include/dungeon_action.h index c3631f7..48f81d5 100644 --- a/include/dungeon_action.h +++ b/include/dungeon_action.h @@ -5,5 +5,7 @@ // 0x44C94 void SetAction(struct DungeonActionContainer *actionPointer, u16 action); +// 0x44CA0 +void SetWalkAction(struct DungeonActionContainer *actionPointer, s16 species); #endif diff --git a/ld_script.txt b/ld_script.txt index 80f8a64..8bf1b5c 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -187,7 +187,7 @@ SECTIONS { src/code_80428A0.o(.text); asm/code_80428A0.o(.text); src/dungeon_action.o(.text); - asm/code_804ACA0.o(.text); + asm/code_8044CC8.o(.text); src/dungeon_util.o(.text); asm/code_80450F8.o(.text); src/dungeon_visibility.o(.text); diff --git a/src/dungeon_action.c b/src/dungeon_action.c index 6d8fcb3..9034e4c 100644 --- a/src/dungeon_action.c +++ b/src/dungeon_action.c @@ -1,6 +1,9 @@ #include "global.h" #include "dungeon_action.h" + +#include "constants/dungeon_action.h" #include "dungeon_entity.h" +#include "pokemon.h" void SetAction(struct DungeonActionContainer *actionPointer, u16 action) { @@ -8,3 +11,17 @@ void SetAction(struct DungeonActionContainer *actionPointer, u16 action) actionPointer->actionUseIndex = 0; actionPointer->unkC = 0; } + +void SetWalkAction(struct DungeonActionContainer *actionPointer, s16 species) +{ + if (GetIsMoving(species)) + { + actionPointer->action = DUNGEON_ACTION_WALK; + } + else + { + actionPointer->action = DUNGEON_ACTION_WAIT; + } + actionPointer->actionUseIndex = 0; + actionPointer->unkC = 0; +} diff --git a/src/dungeon_movement.c b/src/dungeon_movement.c index 3df74ee..d342262 100644 --- a/src/dungeon_movement.c +++ b/src/dungeon_movement.c @@ -7,6 +7,7 @@ #include "constants/status.h" #include "constants/targeting.h" #include "code_80521D0.h" +#include "dungeon_action.h" #include "dungeon_ai_items.h" #include "dungeon_capabilities_1.h" #include "dungeon_global_data.h" @@ -26,7 +27,6 @@ extern char *gPtrItsaMonsterHouseMessage; extern void SendImmobilizeEndMessage(struct DungeonEntity*, struct DungeonEntity*); extern void SetMessageArgument(char[], struct DungeonEntity*, u32); extern void ResetAction(u16*); -extern void SetWalkAction(u16*, s16); extern void DecideAttack(struct DungeonEntity*); extern void MoveIfPossible(struct DungeonEntity*, bool8); extern u8 sub_8044B28(void); @@ -209,7 +209,7 @@ void DecideAction(struct DungeonEntity *pokemon) ResetAction(&pokemonData->action.action); if (pokemonData->clientType == CLIENT_TYPE_CLIENT) { - SetWalkAction(&pokemonData->action.action, pokemonData->entityID); + SetWalkAction(&pokemonData->action, pokemonData->entityID); pokemonData->action.facingDir = DungeonRandomCapped(NUM_DIRECTIONS); pokemonData->targetPosition.x = pokemon->posWorld.x; pokemonData->targetPosition.y = pokemon->posWorld.y - 1; @@ -228,7 +228,7 @@ void DecideAction(struct DungeonEntity *pokemon) } if (pokemonData->volatileStatus == VOLATILE_STATUS_CONFUSED) { - SetWalkAction(&pokemonData->action.action, pokemonData->entityID); + SetWalkAction(&pokemonData->action, pokemonData->entityID); } else { @@ -243,7 +243,7 @@ void DecideAction(struct DungeonEntity *pokemon) { if (pokemonData->volatileStatus == VOLATILE_STATUS_CONFUSED) { - SetWalkAction(&pokemonData->action.action, pokemonData->entityID); + SetWalkAction(&pokemonData->action, pokemonData->entityID); } else { diff --git a/src/status_checks.c b/src/status_checks.c index 5abb0fe..ed39e99 100644 --- a/src/status_checks.c +++ b/src/status_checks.c @@ -14,10 +14,9 @@ extern char *gPtrWrappedByMessage; extern char *gPtrBideMessage; extern char *gPtrPausedMessage; extern char *gPtrInfatuatedMessage; - extern char gAvailablePokemonNames[]; + extern void SetMessageArgument(char[], struct DungeonEntity*, u32); -extern void SetWalkAction(struct DungeonActionContainer*, s16); extern bool8 CanMoveForward2(struct DungeonEntity*, u8); extern void DecideAttack(struct DungeonEntity*); |