diff --git a/asm/overlay_29_0233836C.s b/asm/overlay_29_0233836C.s deleted file mode 100644 index 1d5ec144..00000000 --- a/asm/overlay_29_0233836C.s +++ /dev/null @@ -1,22 +0,0 @@ - .include "asm/macros.inc" - .include "overlay_29_0233836C.inc" - - .text - - arm_func_start ResetGravity -ResetGravity: ; 0x0233836C - ldr r0, _02338388 ; =DUNGEON_PTR - ldr ip, _0233838C ; =MemZero - ldr r0, [r0] - mov r1, #2 -#ifdef JAPAN - add r0, r0, #0x258 -#else - add r0, r0, #0x2fc -#endif - add r0, r0, #0x12800 - bx ip - .align 2, 0 -_02338388: .word DUNGEON_PTR -_0233838C: .word MemZero - arm_func_end ResetGravity diff --git a/asm/overlay_29_023383A8.s b/asm/overlay_29_023383A8.s index 9f41cad3..051f4d46 100644 --- a/asm/overlay_29_023383A8.s +++ b/asm/overlay_29_023383A8.s @@ -3,68 +3,6 @@ .text - arm_func_start ov29_023383A8 -ov29_023383A8: ; 0x023383A8 - ldr ip, _023383B4 ; =LogMessageByIdWithPopupCheckUser - ldr r1, _023383B8 ; =0x00000D8D - bx ip - .align 2, 0 -_023383B4: .word LogMessageByIdWithPopupCheckUser -#ifdef JAPAN -_023383B8: .word 0x00000ACD -#else -_023383B8: .word 0x00000D8D -#endif - arm_func_end ov29_023383A8 - - arm_func_start TryActivateGravity -TryActivateGravity: ; 0x023383BC - stmdb sp!, {r4, lr} - mov r4, r0 - bl EntityIsValid__02337CA8 - cmp r0, #0 - moveq r0, #0 - ldmeqia sp!, {r4, pc} - ldr r0, _02338424 ; =DUNGEON_PTR - ldr r0, [r0] - add r2, r0, #0x12000 -#ifdef JAPAN - ldrb r0, [r2, #0xa58] -#else - ldrb r0, [r2, #0xafc] -#endif - cmp r0, #0 - beq _02338400 - ldr r1, _02338428 ; =0x00000C06 - mov r0, r4 - bl LogMessageByIdWithPopupCheckUser - mov r0, #0 - ldmia sp!, {r4, pc} -_02338400: - ldr r1, _0233842C ; =0x00000C05 - mov r3, #1 - mov r0, r4 -#ifdef JAPAN - strb r3, [r2, #0xa58] -#else - strb r3, [r2, #0xafc] -#endif - bl LogMessageByIdWithPopupCheckUser - mov r0, r4 - bl ov29_02306D54 - mov r0, #1 - ldmia sp!, {r4, pc} - .align 2, 0 -_02338424: .word DUNGEON_PTR -#ifdef JAPAN -_02338428: .word 0x00000945 -_0233842C: .word 0x00000944 -#else -_02338428: .word 0x00000C06 -_0233842C: .word 0x00000C05 -#endif - arm_func_end TryActivateGravity - arm_func_start RevealAttackedTile RevealAttackedTile: ; 0x02338430 stmdb sp!, {r4, lr} diff --git a/include/overlay_29_0233836C.h b/include/overlay_29_0233836C.h new file mode 100644 index 00000000..b4ec4d7f --- /dev/null +++ b/include/overlay_29_0233836C.h @@ -0,0 +1,12 @@ +#ifndef PMDSKY_OVERLAY_29_0233836C_H +#define PMDSKY_OVERLAY_29_0233836C_H + +#include "util.h" +#include "dungeon_mode.h" + +void ResetGravity(void); +bool8 GravityIsActive(void); +void ov29_023383A8(struct entity *monster); +bool8 TryActivateGravity(struct entity *monster); + +#endif /* ifndef PMDSKY_OVERLAY_29_0233836C_H */ diff --git a/include/overlay_29_02338390.h b/include/overlay_29_02338390.h deleted file mode 100644 index d75638d1..00000000 --- a/include/overlay_29_02338390.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef PMDSKY_OVERLAY_29_02338390_H -#define PMDSKY_OVERLAY_29_02338390_H - -#include "util.h" - -bool8 GravityIsActive(); - -#endif //PMDSKY_OVERLAY_29_02338390_H diff --git a/main.lsf b/main.lsf index 8caee72e..d3a61549 100644 --- a/main.lsf +++ b/main.lsf @@ -630,8 +630,7 @@ Overlay OVY_29 Object src/dungeon_map_access_1.o Object asm/overlay_29_02337EC0.o Object src/overlay_29_02338350.o - Object asm/overlay_29_0233836C.o - Object src/overlay_29_02338390.o + Object src/overlay_29_0233836C.o Object asm/overlay_29_023383A8.o Object src/overlay_29_02338548.o Object asm/overlay_29_02338560.o diff --git a/src/dungeon_logic_3.c b/src/dungeon_logic_3.c index b31cfb4f..bf389e70 100644 --- a/src/dungeon_logic_3.c +++ b/src/dungeon_logic_3.c @@ -1,7 +1,7 @@ #include "dungeon_logic_3.h" #include "dungeon_pokemon_attributes.h" #include "dungeon_util_static.h" -#include "overlay_29_02338390.h" +#include "overlay_29_0233836C.h" bool8 LevitateIsActive(struct entity* entity) { diff --git a/src/move_checks.c b/src/move_checks.c index b3970c7b..b8d15c28 100644 --- a/src/move_checks.c +++ b/src/move_checks.c @@ -11,7 +11,7 @@ #include "math.h" #include "moves_3.h" #include "number_util.h" -#include "overlay_29_02338390.h" +#include "overlay_29_0233836C.h" #include "run_dungeon_1.h" #include "tileset.h" #include "trap.h" diff --git a/src/overlay_29_02318A4C.c b/src/overlay_29_02318A4C.c index ed93cec6..718020d9 100644 --- a/src/overlay_29_02318A4C.c +++ b/src/overlay_29_02318A4C.c @@ -1,7 +1,7 @@ #include "overlay_29_02318A4C.h" #include "dungeon_util_static.h" #include "overlay_29_02315118.h" -#include "overlay_29_02338390.h" +#include "overlay_29_0233836C.h" bool8 IsFloating(struct entity *entity) { diff --git a/src/overlay_29_0233836C.c b/src/overlay_29_0233836C.c new file mode 100644 index 00000000..3c99d670 --- /dev/null +++ b/src/overlay_29_0233836C.c @@ -0,0 +1,50 @@ +#include "overlay_29_0233836C.h" +#include "dungeon.h" +#include "main_0200330C.h" +#include "overlay_29_02337CA8.h" + +extern void LogMessageByIdWithPopupCheckUser(struct entity *user, u32 message_id); +extern void ov29_02306D54(struct entity *); + +void ResetGravity(void) +{ + MemZero(&DUNGEON_PTR[0]->gravity, 2); +} + +bool8 GravityIsActive() +{ + return DUNGEON_PTR[0]->gravity; +} + +void ov29_023383A8(struct entity *monster) +{ +#ifndef JAPAN + LogMessageByIdWithPopupCheckUser(monster, 0xD8D); +#else + LogMessageByIdWithPopupCheckUser(monster, 0xACD); +#endif +} + +bool8 TryActivateGravity(struct entity *monster) +{ + if (!EntityIsValid__02337CA8(monster)) { + return FALSE; + } + if (DUNGEON_PTR[0]->gravity) { +#ifndef JAPAN + LogMessageByIdWithPopupCheckUser(monster, 0xC06); +#else + LogMessageByIdWithPopupCheckUser(monster, 0x945); +#endif + return FALSE; + } + DUNGEON_PTR[0]->gravity = TRUE; +#ifndef JAPAN + LogMessageByIdWithPopupCheckUser(monster, 0xC05); +#else + LogMessageByIdWithPopupCheckUser(monster, 0x944); +#endif + ov29_02306D54(monster); + return TRUE; +} + diff --git a/src/overlay_29_02338390.c b/src/overlay_29_02338390.c deleted file mode 100644 index 26f40415..00000000 --- a/src/overlay_29_02338390.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "overlay_29_02338390.h" -#include "dungeon.h" - -bool8 GravityIsActive() -{ - return DUNGEON_PTR[0]->gravity; -} diff --git a/src/type_effectiveness.c b/src/type_effectiveness.c index 2565d99a..4166505f 100644 --- a/src/type_effectiveness.c +++ b/src/type_effectiveness.c @@ -2,7 +2,7 @@ #include "dungeon_util_static.h" #include "overlay_29_0230A994.h" #include "overlay_29_02318A4C.h" -#include "overlay_29_02338390.h" +#include "overlay_29_0233836C.h" #include "type_matchup_table.h" s16 GetTypeMatchup(struct entity *attacker, struct entity *defender, s16 target_type_idx, enum type_id attack_type)