mirror of
https://github.com/pret/pmd-sky.git
synced 2026-04-26 08:35:04 -05:00
Decomped GetVisibilityRange
This commit is contained in:
parent
6e0a890e51
commit
8305ee8a40
|
|
@ -1,25 +1,8 @@
|
||||||
.include "asm/macros.inc"
|
.include "asm/macros.inc"
|
||||||
.include "overlay_29_022E333C.inc"
|
.include "overlay_29_022E335C.inc"
|
||||||
|
|
||||||
.text
|
.text
|
||||||
|
|
||||||
arm_func_start GetVisibilityRange
|
|
||||||
GetVisibilityRange: ; 0x022E333C
|
|
||||||
ldr r0, _022E3358 ; =DUNGEON_PTR
|
|
||||||
ldr r0, [r0]
|
|
||||||
add r0, r0, #0x1a000
|
|
||||||
#ifdef JAPAN
|
|
||||||
ldrb r0, [r0, #0x199]
|
|
||||||
#else
|
|
||||||
ldrb r0, [r0, #0x23d]
|
|
||||||
#endif
|
|
||||||
cmp r0, #0
|
|
||||||
moveq r0, #2
|
|
||||||
bx lr
|
|
||||||
.align 2, 0
|
|
||||||
_022E3358: .word DUNGEON_PTR
|
|
||||||
arm_func_end GetVisibilityRange
|
|
||||||
|
|
||||||
arm_func_start ov29_022E335C
|
arm_func_start ov29_022E335C
|
||||||
ov29_022E335C: ; 0x022E335C
|
ov29_022E335C: ; 0x022E335C
|
||||||
#ifdef JAPAN
|
#ifdef JAPAN
|
||||||
|
|
@ -7,5 +7,6 @@
|
||||||
bool8 EntityIsValid__022E32E8(struct entity *entity);
|
bool8 EntityIsValid__022E32E8(struct entity *entity);
|
||||||
// Checks if a monster is holding a certain item that isn't disabled by Klutz.
|
// Checks if a monster is holding a certain item that isn't disabled by Klutz.
|
||||||
bool8 ItemIsActive__022E330C(struct entity *entity, enum item_id item_id);
|
bool8 ItemIsActive__022E330C(struct entity *entity, enum item_id item_id);
|
||||||
|
s16 GetVisibilityRange();
|
||||||
|
|
||||||
#endif //PMDSKY_OVERLAY_29_022E32E8_H
|
#endif //PMDSKY_OVERLAY_29_022E32E8_H
|
||||||
|
|
|
||||||
2
main.lsf
2
main.lsf
|
|
@ -240,7 +240,7 @@ Overlay OVY_29
|
||||||
Object src/dungeon_visibility.o
|
Object src/dungeon_visibility.o
|
||||||
Object asm/overlay_29_022E2810.o
|
Object asm/overlay_29_022E2810.o
|
||||||
Object src/dg_camera.o
|
Object src/dg_camera.o
|
||||||
Object asm/overlay_29_022E333C.o
|
Object asm/overlay_29_022E335C.o
|
||||||
Object src/dg_effect.o
|
Object src/dg_effect.o
|
||||||
Object asm/overlay_29_022E37DC.o
|
Object asm/overlay_29_022E37DC.o
|
||||||
Object src/dungeon_range.o
|
Object src/dungeon_range.o
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
#include "dg_camera.h"
|
#include "dg_camera.h"
|
||||||
|
#include "dungeon.h"
|
||||||
#include "dungeon_items.h"
|
#include "dungeon_items.h"
|
||||||
#include "dungeon_pokemon_attributes.h"
|
#include "dungeon_pokemon_attributes.h"
|
||||||
|
|
||||||
|
extern struct dungeon *DUNGEON_PTR[];
|
||||||
|
|
||||||
// file starts at 0x022e26b68
|
// file starts at 0x022e26b68
|
||||||
|
|
||||||
bool8 EntityIsValid__022E32E8(struct entity *entity)
|
bool8 EntityIsValid__022E32E8(struct entity *entity)
|
||||||
|
|
@ -19,3 +22,12 @@ bool8 ItemIsActive__022E330C(struct entity *entity, enum item_id item_id)
|
||||||
|
|
||||||
return HasHeldItem(entity, item_id);
|
return HasHeldItem(entity, item_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s16 GetVisibilityRange()
|
||||||
|
{
|
||||||
|
s16 visibility_range = DUNGEON_PTR[0]->display_data.visibility_range;
|
||||||
|
if (visibility_range == 0)
|
||||||
|
return 2;
|
||||||
|
|
||||||
|
return visibility_range;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
#include "dungeon_range.h"
|
#include "dungeon_range.h"
|
||||||
|
#include "dg_camera.h"
|
||||||
#include "dungeon.h"
|
#include "dungeon.h"
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
|
|
||||||
extern struct dungeon *DUNGEON_PTR[];
|
extern struct dungeon *DUNGEON_PTR[];
|
||||||
|
|
||||||
extern s16 GetVisibilityRange();
|
|
||||||
extern struct tile* GetTile(int x, int y);
|
extern struct tile* GetTile(int x, int y);
|
||||||
extern s32 abs(s32 value);
|
extern s32 abs(s32 value);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user