Skip to content

Commit

Permalink
more work
Browse files Browse the repository at this point in the history
  • Loading branch information
red031000 committed Apr 4, 2024
1 parent f91a7dc commit 794b302
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 85 deletions.
4 changes: 2 additions & 2 deletions asm/include/overlay_01_021F1AFC.inc
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
.public MapObject_GetID
.public sub_0205F254
.public MapObject_GetGfxID
.public MapObject_GetFlagId
.public MapObject_GetNextFacing
.public MapObject_GetFlagID
.public MapObject_GetNextFacingDirection
.public MapObject_GetManager
.public sub_0205F484
.public sub_0205F504
Expand Down
2 changes: 1 addition & 1 deletion asm/include/unk_0205CB48.inc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
.public MapObject_SetFacingDirection
.public MapObject_GetFacingDirection
.public MapObject_SetNextFacing
.public MapObject_GetNextFacing
.public MapObject_GetNextFacingDirection
.public sub_0205F328
.public MapObject_GetMovementCommand
.public sub_0205F504
Expand Down
4 changes: 2 additions & 2 deletions asm/include/unk_02061284.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
.public MapObject_GetFlagsBits
.public MapObject_GetMovement
.public MapObject_GetType
.public MapObject_GetInitialFacing
.public MapObject_GetInitialFacingDirection
.public MapObject_SetFacingDirection
.public MapObject_GetFacingDirection
.public MapObject_SetNextFacing
.public MapObject_GetNextFacing
.public MapObject_GetNextFacingDirection
.public MapObject_SetOrQueueFacing
.public MapObject_GetParam
.public MapObject_GetXRange
Expand Down
6 changes: 3 additions & 3 deletions asm/overlay_01_021F1AFC.s
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ _021F1F96:
cmp r1, r0
bne _021F1FF4
add r0, r5, #0
bl MapObject_GetFlagId
bl MapObject_GetFlagID
add r1, r0, #0
lsl r1, r1, #0x10
add r0, r7, #0
Expand Down Expand Up @@ -1718,7 +1718,7 @@ ov01_021F2830: ; 0x021F2830
pop {r3, r4, r5, pc}
_021F2842:
ldr r0, [r5, #0x14]
bl MapObject_GetNextFacing
bl MapObject_GetNextFacingDirection
add r4, r0, #0
ldr r0, [r5, #0x14]
add r1, r4, #0
Expand Down Expand Up @@ -2568,7 +2568,7 @@ ov01_021F2E94: ; 0x021F2E94
pop {r4, pc}
_021F2EA6:
ldr r0, [r4, #0x3c]
bl MapObject_GetNextFacing
bl MapObject_GetNextFacingDirection
ldr r0, [r4, #0x3c]
bl sub_0205F504
lsl r0, r0, #0x18
Expand Down
4 changes: 2 additions & 2 deletions asm/unk_0205CB48.s
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ sub_0205D0A8: ; 0x0205D0A8
add r5, r0, #0
bl PlayerAvatar_GetMapObject
add r4, r0, #0
bl MapObject_GetNextFacing
bl MapObject_GetNextFacingDirection
add r6, r0, #0
add r0, r5, #0
add r1, r6, #0
Expand Down Expand Up @@ -1745,7 +1745,7 @@ _0205D8C0:
tst r0, r4
beq _0205D8F2
add r0, r7, #0
bl MapObject_GetNextFacing
bl MapObject_GetNextFacingDirection
add r4, r0, #0
mov r1, #0
bl sub_0206234C
Expand Down
8 changes: 4 additions & 4 deletions asm/unk_02061284.s
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ _02061942:
bl MapObject_GetFacingDirection
add r4, r0, #0
add r0, r7, #0
bl MapObject_GetInitialFacing
bl MapObject_GetInitialFacingDirection
cmp r4, r0
bne _02061968
mov r0, #0
Expand Down Expand Up @@ -1062,7 +1062,7 @@ sub_020619C0: ; 0x020619C0
push {r4, r5, r6, lr}
add r5, r0, #0
add r4, r1, #0
bl MapObject_GetInitialFacing
bl MapObject_GetInitialFacingDirection
mov r1, #2
ldrsh r1, [r4, r1]
add r6, r0, #0
Expand Down Expand Up @@ -1113,7 +1113,7 @@ sub_020619FC: ; 0x020619FC
cmp r1, r0
bne _02061A5A
add r0, r5, #0
bl MapObject_GetNextFacing
bl MapObject_GetNextFacingDirection
bl sub_020611F4
add r4, r0, #0
add r0, r5, #0
Expand All @@ -1131,7 +1131,7 @@ _02061A56:
strh r0, [r6, #2]
_02061A5A:
add r0, r5, #0
bl MapObject_GetNextFacing
bl MapObject_GetNextFacingDirection
add r4, r0, #0
add r0, r5, #0
add r1, r4, #0
Expand Down
19 changes: 8 additions & 11 deletions include/map_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include "script.h"

typedef struct SavedMapObject {
u32 unk0;
u32 unk4;
u32 flags;
u32 flags2;
u8 objId;
u8 movement;
s8 xRange;
Expand All @@ -18,16 +18,14 @@ typedef struct SavedMapObject {
u16 type;
u16 flagId;
u16 script;
s16 unk1A;
s16 unk1C;
s16 unk1E;
s16 param[3];
s16 initialX;
s16 initialHeight;
s16 initialY;
s16 currentX;
s16 currentHeight;
s16 currentY;
fx32 unk2C;
fx32 vecY;
u8 unk30[16];
u8 unk40[16];
} SavedMapObject;
Expand Down Expand Up @@ -173,8 +171,7 @@ void sub_0205E4C8(MapObjectManager *manager);
void sub_0205E520(MapObjectManager *manager);
void sub_0205E580(MapObjectManager *manager);
void FieldSystem_SyncMapObjectsToSaveEx(FieldSystem *fieldSystem, MapObjectManager *manager, SavedMapObject *savedObjects, s32 count);
void MapObjectManager_RestoreFromSave(MapObjectManager *mapObjectManager, SavedMapObject *list, u32 numObj);
void sub_0205E680(FieldSystem* fieldSystem, LocalMapObject* local_object, SavedMapObject* saved_object);
void MapObjectManager_RestoreFromSave(MapObjectManager *mapObjectManager, SavedMapObject *savedObjects, u32 objectCount);
void sub_0205E7C4(LocalMapObject* local_object, SavedMapObject* saved_object);
void sub_0205E8EC(MapObjectManager* manager, LocalMapObject* object);
void InitMapObjectsFromEventTemplates(MapObjectManager* man, u32 mapId, u32 nObjs, ObjectEvent* dest);
Expand Down Expand Up @@ -247,17 +244,17 @@ u32 MapObject_GetMovement(LocalMapObject *mapObject);
void MapObject_SetType(LocalMapObject *mapObject, u32 type);
u32 MapObject_GetType(LocalMapObject *mapObject);
void MapObject_SetFlagID(LocalMapObject *mapObject, u32 flagId);
u32 MapObject_GetFlagId(LocalMapObject* object);
u32 MapObject_GetFlagID(LocalMapObject* object);
void MapObject_SetScript(LocalMapObject *mapObject, u32 script);
u32 MapObject_GetScript(LocalMapObject *mapObject);
void MapObject_SetInitialFacing(LocalMapObject* object, u32 initial_facing);
u32 MapObject_GetInitialFacing(LocalMapObject* object);
u32 MapObject_GetInitialFacingDirection(LocalMapObject* object);
void MapObject_ForceSetFacingDirection(LocalMapObject* object, u32 direction);
void MapObject_SetFacingDirection(LocalMapObject* object, u32 direction);
u32 MapObject_GetFacingDirection(LocalMapObject *object);
u32 MapObject_GetPreviousFacing(LocalMapObject* object);
void MapObject_SetNextFacing(LocalMapObject* object, u32 direction);
u32 MapObject_GetNextFacing(LocalMapObject* object);
u32 MapObject_GetNextFacingDirection(LocalMapObject* object);
void MapObject_SetOrQueueFacing(LocalMapObject* object, u32 direction);
void MapObject_SetParam(LocalMapObject *mapObject, u32 value, int which);
int MapObject_GetParam(LocalMapObject *mapObject, int which);
Expand Down
2 changes: 1 addition & 1 deletion src/field_player_avatar.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ void PlayerAvatar_SetFacingDirection(PlayerAvatar* avatar, int direction) {
}

u32 PlayerAvatar_GetNextFacing(PlayerAvatar* avatar) {
return MapObject_GetNextFacing(PlayerAvatar_GetMapObject(avatar));
return MapObject_GetNextFacingDirection(PlayerAvatar_GetMapObject(avatar));
}

int GetPlayerXCoord(PlayerAvatar* avatar) {
Expand Down
Loading

0 comments on commit 794b302

Please sign in to comment.