diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 66176267..51806392 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -343,10 +343,10 @@ setDowsingSlotIdx__11FileManagerFUc = .text:0x8000B9F0; // type:function size:0x getDowsingSlotIdx__11FileManagerFv = .text:0x8000BA20; // type:function size:0x44 setBeaconPos__11FileManagerFUlUlP7mVec3_c = .text:0x8000BA70; // type:function size:0x104 getBeaconPos__11FileManagerFUlUl = .text:0x8000BB80; // type:function size:0xEC -setEnemyKillCount__11FileManagerFUlUs = .text:0x8000BC70; // type:function size:0x70 -getEnemyKillCount__11FileManagerFUl = .text:0x8000BCE0; // type:function size:0x80 -setHitCountFromEnemy__11FileManagerFUlUs = .text:0x8000BD60; // type:function size:0x70 -getHitCountFromEnemy__11FileManagerFUl = .text:0x8000BDD0; // type:function size:0x80 +setEnemyKillCount__11FileManagerFUcUs = .text:0x8000BC70; // type:function size:0x70 +getEnemyKillCount__11FileManagerFUc = .text:0x8000BCE0; // type:function size:0x80 +setHitCountFromEnemy__11FileManagerFUcUs = .text:0x8000BD60; // type:function size:0x70 +getHitCountFromEnemy__11FileManagerFUc = .text:0x8000BDD0; // type:function size:0x80 setLoadRoomT1_FileB__11FileManagerFs = .text:0x8000BE50; // type:function size:0x30 getLoadRoomT1_FileB__11FileManagerFv = .text:0x8000BE80; // type:function size:0xC setEntranceT1_FileB__11FileManagerFUc = .text:0x8000BE90; // type:function size:0x30 @@ -10963,7 +10963,7 @@ fn_801B3720 = .text:0x801B3720; // type:function size:0x4 fn_801B3730 = .text:0x801B3730; // type:function size:0x200 fn_801B3930 = .text:0x801B3930; // type:function size:0x30 fn_801B3960 = .text:0x801B3960; // type:function size:0x10 -fn_801B3970 = .text:0x801B3970; // type:function size:0x10 +GetRoomByIndex__11RoomManagerFi = .text:0x801B3970; // type:function size:0x10 fn_801B3980 = .text:0x801B3980; // type:function size:0x114 fn_801B3AA0 = .text:0x801B3AA0; // type:function size:0x134 fn_801B3BE0 = .text:0x801B3BE0; // type:function size:0x78 @@ -10987,7 +10987,7 @@ fn_801B42D0 = .text:0x801B42D0; // type:function size:0x50 fn_801B4320 = .text:0x801B4320; // type:function size:0x54 fn_801B4380 = .text:0x801B4380; // type:function size:0xA0 fn_801B4420 = .text:0x801B4420; // type:function size:0x9C -fn_801B44C0 = .text:0x801B44C0; // type:function size:0x50 +changeLoadedEntities__11RoomManagerFP11RoomManagerUlb = .text:0x801B44C0; // type:function size:0x50 fn_801B4510 = .text:0x801B4510; // type:function size:0x3C fn_801B4550 = .text:0x801B4550; // type:function size:0x6C fn_801B45C0 = .text:0x801B45C0; // type:function size:0xAC @@ -40024,7 +40024,7 @@ lbl_80575785 = .sbss:0x80575785; // type:object size:0x1 lbl_80575786 = .sbss:0x80575786; // type:object size:0x1 data:byte lbl_80575787 = .sbss:0x80575787; // type:object size:0x1 data:byte lbl_80575788 = .sbss:0x80575788; // type:object size:0x4 data:4byte -lbl_8057578C = .sbss:0x8057578C; // type:object size:0x4 data:4byte +LINK__7dPlayer = .sbss:0x8057578C; // type:object size:0x4 data:4byte lbl_80575790 = .sbss:0x80575790; // type:object size:0x4 data:4byte lbl_80575794 = .sbss:0x80575794; // type:object size:0x4 data:4byte lbl_80575798 = .sbss:0x80575798; // type:object size:0x4 data:4byte diff --git a/include/d/a/obj/d_a_obj_base.h b/include/d/a/obj/d_a_obj_base.h index 37153e07..ed6d5abd 100644 --- a/include/d/a/obj/d_a_obj_base.h +++ b/include/d/a/obj/d_a_obj_base.h @@ -15,7 +15,7 @@ public: char _0[4]; f32 unkfloat; char _1[12]; - s16 targetFiTextId; + u16 targetFiTextId; u8 unkByteTargetFiRelated; mVec3_c poscopy1; mVec3_c poscopy2; diff --git a/include/toBeSorted/file_manager.h b/include/toBeSorted/file_manager.h index 858de5a4..ee134f89 100644 --- a/include/toBeSorted/file_manager.h +++ b/include/toBeSorted/file_manager.h @@ -162,10 +162,10 @@ public: /* 8000BA70 */ void setBeaconPos(u32 beaconArea, u32 beaconNum, mVec3_c *pos); /* 8000BB80 */ mVec3_c *getBeaconPos(u32 beaconArea, u32 beaconNum); - /* 8000BC70 */ void setEnemyKillCount(u32 enemy, u16 killCount); - /* 8000BCE0 */ s16 getEnemyKillCount(u32 enemy); - /* 8000BD60 */ void setHitCountFromEnemy(u32 enemy, u16 hitCount); - /* 8000BDD0 */ u16 getHitCountFromEnemy(u32 enemy); + /* 8000BC70 */ void setEnemyKillCount(u8 enemy, u16 killCount); + /* 8000BCE0 */ u16 getEnemyKillCount(u8 enemy); + /* 8000BD60 */ void setHitCountFromEnemy(u8 enemy, u16 hitCount); + /* 8000BDD0 */ u16 getHitCountFromEnemy(u8 enemy); /* 8000BE50 */ void setLoadRoomT1_FileB(s16 roomId); /* 8000BE80 */ s16 getLoadRoomT1_FileB(); diff --git a/src/d/a/d_a_base.cpp b/src/d/a/d_a_base.cpp index 2f74cb93..87367333 100644 --- a/src/d/a/d_a_base.cpp +++ b/src/d/a/d_a_base.cpp @@ -501,10 +501,7 @@ dAcBase_c *dAcBase_c::createActor(ProfileName actorId, u32 actorParams1, mVec3_c actorRoomid = roomid; } - u32 newParams2 = -1; - if (actorParams2 != 0) { - newParams2 = getParams2_ignoreLower(); - } + u32 newParams2 = actorParams2 != 0 ? getParams2_ignoreLower() : -1; setTempCreateParams(actorPosition, actorRotation, actorScale, actorRoomid, newParams2, (dAcBase_c *)actorRef, 0, -1, 0xFF, nullptr); @@ -532,10 +529,7 @@ dAcBase_c *dAcBase_c::createActorStage(ProfileName actorId, u32 actorParams1, mV actorRoomid = roomid; } - u32 newParams2 = -1; - if (actorParams2 != 0) { - newParams2 = getParams2_ignoreLower(); - } + u32 newParams2 = actorParams2 != 0 ? getParams2_ignoreLower() : -1; setTempCreateParams(actorPosition, actorRotation, actorScale, actorRoomid, newParams2, (dAcBase_c *)actorRef, 0, -1, 0xFF, nullptr); @@ -561,19 +555,17 @@ void dAcBase_c::doInteraction(s32 param) { // 8002dc20 void dAcBase_c::FUN_8002dc20(s16 *, s16 *) {} -// This whole function gets compiled to just a `blr` -// Not sure how to make this work as expected // 8002dc50 void dAcBase_c::incrementKillCounter() { dAcObjBase_c *object = (dAcObjBase_c *)this; // Probably wrong - FileManager *fileMgr = FileManager::sInstance; if (group_type == ACTOR && object->unkByteTargetFiRelated == 1) { - s16 killCounterId = object->targetFiTextId; + int killCounterId = object->targetFiTextId; - if (killCounterId < 91 && killCounterId & 0x300 == 0) { - s16 killCount = fileMgr->getEnemyKillCount(killCounterId & 0xFF); + if (killCounterId < 91 && (killCounterId & 0x300) == 0) { + FileManager *fileMgr = FileManager::sInstance; + u16 killCount = fileMgr->getEnemyKillCount(killCounterId) + 1; fileMgr->setEnemyKillCount(killCounterId, killCount); } } diff --git a/src/toBeSorted/file_manager.cpp b/src/toBeSorted/file_manager.cpp index d027a931..d6bbd9a9 100644 --- a/src/toBeSorted/file_manager.cpp +++ b/src/toBeSorted/file_manager.cpp @@ -210,10 +210,10 @@ inline void strnsth(char *dest, const char *src, size_t max_len) { /* 8000BA70 */ void FileManager::setBeaconPos(u32 beaconArea, u32 beaconNum, mVec3_c *pos) {} /* 8000BB80 */ mVec3_c *FileManager::getBeaconPos(u32 beaconArea, u32 beaconNum) {} -/* 8000BC70 */ void FileManager::setEnemyKillCount(u32 enemy, u16 killCount) {} -/* 8000BCE0 */ s16 FileManager::getEnemyKillCount(u32 enemy) {} -/* 8000BD60 */ void FileManager::setHitCountFromEnemy(u32 enemy, u16 hitCount) {} -/* 8000BDD0 */ u16 FileManager::getHitCountFromEnemy(u32 enemy) {} +/* 8000BC70 */ void FileManager::setEnemyKillCount(u8 enemy, u16 killCount) {} +/* 8000BCE0 */ u16 FileManager::getEnemyKillCount(u8 enemy) {} +/* 8000BD60 */ void FileManager::setHitCountFromEnemy(u8 enemy, u16 hitCount) {} +/* 8000BDD0 */ u16 FileManager::getHitCountFromEnemy(u8 enemy) {} /* 8000BE50 */ void FileManager::setLoadRoomT1_FileB(s16 roomId) {} /* 8000BE80 */ s16 FileManager::getLoadRoomT1_FileB() {}