Decompile dg_object functions

This commit is contained in:
chordtoll
2024-10-13 23:47:31 -07:00
parent 3aca307783
commit f5be0f933e
5 changed files with 36 additions and 50 deletions

View File

@@ -1,9 +1,7 @@
#pragma once
.public _020A1AE8
.public abs
.public CanSeeInvisibleMonsters
.public DrawMinimapTile
.public DUNGEON_PTR
.public DrawMinimapTile
.public DungeonGetSpriteIndex
.public EntityIsValid__022E1A1C
.public EntityIsValid__022E32E8
@@ -19,6 +17,12 @@
.public IsPositionActuallyInSight
.public IsPositionInSight
.public ItemIsActive__022E330C
.public SECONDARY_TERRAIN_TYPES
.public StringFromId
.public TeamMemberHasEnabledIqSkill
.public UpdateMinimap
.public UpdateTrapsVisibility
.public abs
.public ov29_022DE954
.public ov29_022DE9F8
.public ov29_022DEA10
@@ -39,11 +43,6 @@
.public ov29_0237C754
.public ov29_0237C79C
.public ov29_0237C84C
.public SECONDARY_TERRAIN_TYPES
.public strcpy
.public StringFromId
.public sub_02009194
.public sub_020091B0
.public TeamMemberHasEnabledIqSkill
.public UpdateMinimap
.public UpdateTrapsVisibility

View File

@@ -1,48 +1,8 @@
.include "asm/macros.inc"
.include "overlay_29_022E1A40.inc"
.include "overlay_29_022E1AAC.inc"
.text
arm_func_start UpdateEntityPixelPos
UpdateEntityPixelPos: ; 0x022E1A40
cmp r1, #0
ldrne r2, [r1]
strne r2, [r0, #0xc]
ldrne r1, [r1, #4]
bne _022E1A7C
ldrsh r2, [r0, #4]
mov r1, #0x18
smulbb r2, r2, r1
add r2, r2, #0xc
mov r2, r2, lsl #8
str r2, [r0, #0xc]
ldrsh r2, [r0, #6]
smulbb r1, r2, r1
add r1, r1, #0x10
mov r1, r1, lsl #8
_022E1A7C:
str r1, [r0, #0x10]
bx lr
arm_func_end UpdateEntityPixelPos
arm_func_start ov29_022E1A84
ov29_022E1A84: ; 0x022E1A84
str r1, [r0, #0xc]
str r2, [r0, #0x10]
bx lr
arm_func_end ov29_022E1A84
arm_func_start ov29_022E1A90
ov29_022E1A90: ; 0x022E1A90
ldr r3, [r0, #0xc]
add r1, r3, r1
str r1, [r0, #0xc]
ldr r1, [r0, #0x10]
add r1, r1, r2
str r1, [r0, #0x10]
bx lr
arm_func_end ov29_022E1A90
arm_func_start ov29_022E1AAC
ov29_022E1AAC: ; 0x022E1AAC
stmdb sp!, {r3, r4, r5, lr}

View File

@@ -7,5 +7,8 @@
// entity: entity pointer
// return: bool
u8 EntityIsValid__022E1A1C(struct entity *entity);
void UpdateEntityPixelPos(struct entity *entity, struct pixel_position *pixel_pos);
void ov29_022E1A84(struct entity *entity, u32 x, u32 y);
void ov29_022E1A84(struct entity *entity, u32 x, u32 y);
#endif //PMDSKY_OVERLAY_29_022E1A1C_H

View File

@@ -187,7 +187,7 @@ Overlay OVY_29
Object src/dg.o
Object asm/overlay_29_022E0378.o
Object src/dg_object.o
Object asm/overlay_29_022E1A40.o
Object asm/overlay_29_022E1AAC.o
Object src/dg_camera.o
Object asm/overlay_29_022E330C.o
Object src/dg_effect.o

View File

@@ -10,3 +10,27 @@ u8 EntityIsValid__022E1A1C(struct entity *entity)
}
return entity->type != ENTITY_NOTHING;
}
void UpdateEntityPixelPos(struct entity *entity, struct pixel_position *pixel_pos)
{
if (pixel_pos != 0) {
entity->pixel_pos.x = pixel_pos->x;
entity->pixel_pos.y = pixel_pos->y;
}
else {
entity->pixel_pos.x = ((((entity->pos.x)*0x18)+0x0c)<<8);
entity->pixel_pos.y = ((((entity->pos.y)*0x18)+0x10)<<8);
}
}
void ov29_022E1A84(struct entity *entity, u32 x, u32 y)
{
entity->pixel_pos.x = x;
entity->pixel_pos.y = y;
}
void ov29_022E1A84(struct entity *entity, u32 x, u32 y)
{
entity->pixel_pos.x += x;
entity->pixel_pos.y += y;
}