Uniformity renames

This commit is contained in:
robojumper 2024-10-25 15:30:28 +02:00
parent dfaf6296a5
commit 6fab083329
17 changed files with 62 additions and 69 deletions

View File

@ -4101,8 +4101,8 @@ unsetZoneflag__16SceneflagManagerFUsUs = .text:0x800BE3E0; // type:function size
unsetFlag__16SceneflagManagerFUsUs = .text:0x800BE490; // type:function size:0x70
unsetSceneflagGlobal__16SceneflagManagerFUsUs = .text:0x800BE500; // type:function size:0xE0
unsetTempOrSceneflag__16SceneflagManagerFUs = .text:0x800BE5E0; // type:function size:0x100
doCommit__16SceneflagManagerFv = .text:0x800BE6E0; // type:function size:0xC8
commitIfNecessary__22CommittableFlagManagerFv = .text:0x800BE7B0; // type:function size:0x58
commit__16SceneflagManagerFv = .text:0x800BE6E0; // type:function size:0xC8
commit__22CommittableFlagManagerFv = .text:0x800BE7B0; // type:function size:0x58
doCommit__15TBoxFlagManagerFv = .text:0x800BE810; // type:function size:0x58
checkUncommittedFlag__15TBoxFlagManagerFUs = .text:0x800BE870; // type:function size:0x68
__ct__15TBoxFlagManagerFv = .text:0x800BE8E0; // type:function size:0x40
@ -4143,10 +4143,10 @@ unsetFlag__17BitwiseFlagHelperFUsUsPUsUs = .text:0x800BF240; // type:function si
__ct__20ItemStoryManagerBaseFv = .text:0x800BF270; // type:function size:0x28
__dt__20ItemStoryManagerBaseFv = .text:0x800BF2A0; // type:function size:0x70
setFlagSizes__20ItemStoryManagerBaseFUsUs = .text:0x800BF310; // type:function size:0xC
setupFlagIndex__20ItemStoryManagerBaseFP14FlagDefinitionUs = .text:0x800BF320; // type:function size:0x60
copyFlagsFromSave_Priv__20ItemStoryManagerBaseFv = .text:0x800BF380; // type:function size:0x58
createFlagIndex__20ItemStoryManagerBaseFP14FlagDefinitionUs = .text:0x800BF320; // type:function size:0x60
copyFromSave__20ItemStoryManagerBaseFv = .text:0x800BF380; // type:function size:0x58
init__20ItemStoryManagerBaseFv = .text:0x800BF3E0; // type:function size:0x88
setFlagszptr__20ItemStoryManagerBaseFv = .text:0x800BF470; // type:function size:0x4
initFlagSpace__20ItemStoryManagerBaseFv = .text:0x800BF470; // type:function size:0x4
getFlag__20ItemStoryManagerBaseCFUs = .text:0x800BF480; // type:function size:0x58
getUncommittedValue_Priv__20ItemStoryManagerBaseFUs = .text:0x800BF4E0; // type:function size:0x50
setOrClearFlag__20ItemStoryManagerBaseFUsUs = .text:0x800BF530; // type:function size:0x78
@ -4162,14 +4162,14 @@ getMaskForFlag__20ItemStoryManagerBaseFUs = .text:0x800BF640; // type:function s
doCommit_Priv__20ItemStoryManagerBaseFv = .text:0x800BF650; // type:function size:0x40
postCommit__20ItemStoryManagerBaseFv = .text:0x800BF690; // type:function size:0x4
__ct__16StoryflagManagerFv = .text:0x800BF6A0; // type:function size:0x5C
copyFlagsFromSave__16StoryflagManagerFv = .text:0x800BF700; // type:function size:0x3C
setupUnkFlagsStuff__16StoryflagManagerFv = .text:0x800BF740; // type:function size:0x10
copyFlagsFromSaveFirstTime__16StoryflagManagerFv = .text:0x800BF700; // type:function size:0x3C
setupFlagIndex__16StoryflagManagerFv = .text:0x800BF740; // type:function size:0x10
onDirty__16StoryflagManagerFv = .text:0x800BF750; // type:function size:0x4
commit__16StoryflagManagerFv = .text:0x800BF760; // type:function size:0x4C
unsetFlag__16StoryflagManagerFUs = .text:0x800BF7B0; // type:function size:0x4
__ct__15ItemflagManagerFv = .text:0x800BF7C0; // type:function size:0x5C
copyFlagsFromSave__15ItemflagManagerFv = .text:0x800BF820; // type:function size:0x3C
setupUnkFlagsStuff__15ItemflagManagerFv = .text:0x800BF860; // type:function size:0x10
copyFlagsFromSaveFirstTime__15ItemflagManagerFv = .text:0x800BF820; // type:function size:0x3C
setupFlagIndex__15ItemflagManagerFv = .text:0x800BF860; // type:function size:0x10
onDirty__15ItemflagManagerFv = .text:0x800BF870; // type:function size:0x4
commit__15ItemflagManagerFv = .text:0x800BF880; // type:function size:0x4C
copyFromSave_Internal__18DungeonflagManagerFUs = .text:0x800BF8D0; // type:function size:0x54
@ -4180,12 +4180,12 @@ copyFromSave__18DungeonflagManagerFUl = .text:0x800BF9E0; // type:function size:
setToValue__18DungeonflagManagerFUsUl = .text:0x800BF9F0; // type:function size:0x6C
setFlag__18DungeonflagManagerFUs = .text:0x800BFA60; // type:function size:0x60
getDungeonFlag__18DungeonflagManagerFUs = .text:0x800BFAC0; // type:function size:0x50
doCommit__18DungeonflagManagerFv = .text:0x800BFB10; // type:function size:0x8C
copyFromSave__15SkipflagManagerFv = .text:0x800BFBA0; // type:function size:0x44
commit__18DungeonflagManagerFv = .text:0x800BFB10; // type:function size:0x8C
doCopyFromSave__15SkipflagManagerFv = .text:0x800BFBA0; // type:function size:0x44
setCommitFlag__15SkipflagManagerFUs = .text:0x800BFBF0; // type:function size:0xC
__ct__15SkipflagManagerFv = .text:0x800BFC00; // type:function size:0x2C
init__15SkipflagManagerFv = .text:0x800BFC30; // type:function size:0xC
thunk_copyFromSave__15SkipflagManagerFv = .text:0x800BFC40; // type:function size:0x4
copyFromSave__15SkipflagManagerFv = .text:0x800BFC40; // type:function size:0x4
setFlag__15SkipflagManagerFUs = .text:0x800BFC50; // type:function size:0xD0
checkFlag__15SkipflagManagerFUs = .text:0x800BFD20; // type:function size:0x68
commitFlags__15SkipflagManagerFv = .text:0x800BFD90; // type:function size:0x70
@ -4206,10 +4206,10 @@ getCounterOrFlag__15ItemflagManagerCFUs = .text:0x800C03C0; // type:function siz
setFlagOrCounterToValue__15ItemflagManagerFUsUs = .text:0x800C03D0; // type:function size:0x8
unsetFlag__15ItemflagManagerFUs = .text:0x800C03E0; // type:function size:0x8
doCommit__15ItemflagManagerFv = .text:0x800C03F0; // type:function size:0x44
setFlagszptr__15ItemflagManagerFv = .text:0x800C0440; // type:function size:0xC
initFlagSpace__15ItemflagManagerFv = .text:0x800C0440; // type:function size:0xC
getSaveFlagSpace__16StoryflagManagerCFv = .text:0x800C0450; // type:function size:0x8
doCommit__16StoryflagManagerFv = .text:0x800C0460; // type:function size:0x44
setFlagszptr__16StoryflagManagerFv = .text:0x800C04B0; // type:function size:0xC
initFlagSpace__16StoryflagManagerFv = .text:0x800C04B0; // type:function size:0xC
doCommit__18EnemyDefeatManagerFv = .text:0x800C04C0; // type:function size:0x44
__dt__32MyFlagManager<15ItemflagManager>Fv = .text:0x800C0510; // type:function size:0x5C
__dt__33MyFlagManager<16StoryflagManager>Fv = .text:0x800C0570; // type:function size:0x5C

View File

@ -9,10 +9,10 @@ public:
ItemStoryManagerBase();
/** 0x08 */ virtual ~ItemStoryManagerBase();
/** 0x0C */ virtual void setFlagszptr();
/** 0x0C */ virtual void initFlagSpace();
/** 0x10 */ virtual void onDirty();
/** 0x14 */ virtual void copyFlagsFromSave() = 0;
/** 0x18 */ virtual void setupUnkFlagsStuff() = 0;
/** 0x14 */ virtual void copyFlagsFromSaveFirstTime() = 0;
/** 0x18 */ virtual void setupFlagIndex() = 0;
/** 0x1C */ virtual void doCommit() = 0;
/** 0x20 */ virtual void setFlag(u16 flag);
/** 0x24 */ virtual void unsetFlag(u16 flag);
@ -24,8 +24,8 @@ public:
void init();
void copyFlagsFromSave_Priv();
void setupFlagIndex(FlagDefinition *def, u16 count);
void copyFromSave();
void createFlagIndex(FlagDefinition *def, u16 count);
void doCommit_Priv();
void setOrClearFlag(u16 flag, u16 value);
u16 getFlag(u16 flag) const;

View File

@ -7,7 +7,7 @@ public:
virtual void doCommit() = 0;
virtual ~CommittableFlagManager() {}
bool commitIfNecessary();
bool commit();
void setNeedsCommit(bool commit) {
mNeedsCommit = commit;
}

View File

@ -22,7 +22,7 @@ public:
void setToValue(u16 flag, u32 value);
void setFlag(u16 flag);
u16 getDungeonFlag(u16 flag);
bool doCommit();
bool commit();
/** inline shenanigans to get copyFromSave to match */
static inline u16 *saveFilePtr(u16 flagIndex) {

View File

@ -15,12 +15,12 @@ public:
bool commit();
/** 0x0C */ virtual void setFlagszptr() override {
/** 0x0C */ virtual void initFlagSpace() override {
mpFlagSpace = &mItemFlags;
}
/** 0x10 */ virtual void onDirty() override;
/** 0x14 */ virtual void copyFlagsFromSave();
/** 0x18 */ virtual void setupUnkFlagsStuff();
/** 0x14 */ virtual void copyFlagsFromSaveFirstTime();
/** 0x18 */ virtual void setupFlagIndex();
/** 0x1C */ virtual void doCommit() {
u16 sz = mFlagCount;
u16 *flags = mpFlagSpace->getFlagPtrUnchecked();

View File

@ -58,7 +58,7 @@ public:
void unsetFlag(u16 roomId, u16 flag);
void unsetSceneflagGlobal(u16 sceneIdx, u16 flag);
void unsetTempOrSceneflag(u16 flag);
s32 doCommit();
s32 commit();
bool checkBoolFlag(u16 roomid, u16 flag) {
return checkFlag(roomid, flag);

View File

@ -10,15 +10,16 @@ public:
SkipflagManager();
void init();
void copyFromSave();
void setCommitFlag(u16 flag);
void thunk_copyFromSave();
void copyFromSave();
void setFlag(u16 flag);
bool checkFlag(u16 flag);
bool commitFlags();
bool commit();
static SkipflagManager *sInstance;
private:
void doCopyFromSave();
static u16 sSkipFlags[16];
bool mShouldCommit;

View File

@ -14,12 +14,12 @@ public:
bool commit();
/** 0x0C */ virtual void setFlagszptr() override {
/** 0x0C */ virtual void initFlagSpace() override {
mpFlagSpace = &mStoryFlags;
}
/** 0x10 */ virtual void onDirty() override;
/** 0x14 */ virtual void copyFlagsFromSave() override;
/** 0x18 */ virtual void setupUnkFlagsStuff() override;
/** 0x14 */ virtual void copyFlagsFromSaveFirstTime() override;
/** 0x18 */ virtual void setupFlagIndex() override;
/** 0x1C */ virtual void doCommit() override {
u16 sz = mFlagCount;
u16 *flags = mpFlagSpace->getFlagPtrUnchecked();

View File

@ -13,12 +13,12 @@ void ItemStoryManagerBase::setFlagSizes(u16 flagCount, u16 flagSizeBytes) {
}
/** 800bf320 */
void ItemStoryManagerBase::setupFlagIndex(FlagDefinition *def, u16 count) {
void ItemStoryManagerBase::createFlagIndex(FlagDefinition *def, u16 count) {
mpFlagIndex = new FlagIndex(count, def);
}
/** 800bf380 */
void ItemStoryManagerBase::copyFlagsFromSave_Priv() {
void ItemStoryManagerBase::copyFromSave() {
FlagSpace *current = mpFlagSpace;
const u16 *saved = getSaveFlagSpace();
current->copyFromSaveFile(saved, 0, mFlagCount);
@ -28,14 +28,14 @@ void ItemStoryManagerBase::copyFlagsFromSave_Priv() {
void ItemStoryManagerBase::init() {
const u16 *space = getSaveFlagSpace();
if (space == nullptr || mpFlagIndex == nullptr) {
setFlagszptr();
copyFlagsFromSave();
setupUnkFlagsStuff();
initFlagSpace();
copyFlagsFromSaveFirstTime();
setupFlagIndex();
}
}
/** 800bf470 */
void ItemStoryManagerBase::setFlagszptr() {
void ItemStoryManagerBase::initFlagSpace() {
}

View File

@ -1,7 +1,7 @@
#include "d/flag/committable_flag_manager.h"
/* 0x800BE7B0 */
bool CommittableFlagManager::commitIfNecessary() {
bool CommittableFlagManager::commit() {
if (mNeedsCommit) {
doCommit();
mNeedsCommit = false;

View File

@ -59,7 +59,7 @@ u16 DungeonflagManager::getDungeonFlag(u16 flag) {
}
/** 800fbb10 */
bool DungeonflagManager::doCommit() {
bool DungeonflagManager::commit() {
FileManager *instance;
u16 idx = mStageIndex;
if (idx == 0xFFFF) {

View File

@ -41,10 +41,6 @@ void FlagIndex::setCounterOrFlag(u16 counterIdx, u16 *dataPtr, u32 flagCount, u3
dataPtr[index] = (u16)(value << shift) | dataPtr[index];
}
inline bool isLessThan(int a, int b) {
return a <= b;
}
u32 FlagIndex::checkFlagValid(u16 counterIdx, u32 flagCount) {
if (mpDefinitions == nullptr) {
return 0;
@ -52,10 +48,6 @@ u32 FlagIndex::checkFlagValid(u16 counterIdx, u32 flagCount) {
if (mDefinitionsCount <= counterIdx || mpDefinitions[counterIdx].mIndex == 0xFF) {
return 0;
} else {
if (isLessThan(flagCount, mpDefinitions[counterIdx].mIndex)) {
return 0;
} else {
return 1;
}
return (int)mpDefinitions[counterIdx].mIndex < (int)flagCount;
}
}

View File

@ -91,10 +91,10 @@ void copyAllFlagManagersFromSave() {
u16 flag = FileManager::sInstance->getSceneFlagIndex();
SceneflagManager::sInstance->copyFromSave(flag);
TBoxFlagManager::sInstance->copyFromSave(flag);
StoryflagManager::sInstance->copyFlagsFromSave_Priv();
ItemflagManager::sInstance->copyFlagsFromSave_Priv();
StoryflagManager::sInstance->copyFromSave();
ItemflagManager::sInstance->copyFromSave();
DungeonflagManager::sInstance->copyFromSave(flag);
SkipflagManager::sInstance->thunk_copyFromSave();
SkipflagManager::sInstance->copyFromSave();
EnemyDefeatManager::sInstance->copyFromSave(flag);
}
@ -108,11 +108,11 @@ void updateFlagForFlagIndex(u16 stage) {
void commitAllFlagManagers() {
StoryflagManager::sInstance->commit();
ItemflagManager::sInstance->commit();
DungeonflagManager::sInstance->doCommit();
SkipflagManager::sInstance->commitFlags();
SceneflagManager::sInstance->doCommit();
TBoxFlagManager::sInstance->commitIfNecessary();
EnemyDefeatManager::sInstance->commitIfNecessary();
DungeonflagManager::sInstance->commit();
SkipflagManager::sInstance->commit();
SceneflagManager::sInstance->commit();
TBoxFlagManager::sInstance->commit();
EnemyDefeatManager::sInstance->commit();
}
bool checkedMemcpy(void *dest, u32 destLen, const void *src, u32 count) {

View File

@ -6,15 +6,15 @@ ItemflagManager *ItemflagManager::sInstance = nullptr;
ItemflagManager::ItemflagManager() : mItemFlags(sFlags, 0x40) {}
void ItemflagManager::copyFlagsFromSave() {
void ItemflagManager::copyFlagsFromSaveFirstTime() {
setFlagSizes(0x40, 0x80);
ItemStoryManagerBase::copyFlagsFromSave_Priv();
ItemStoryManagerBase::copyFromSave();
}
extern "C" FlagDefinition ItemflagManager__ITEMFLAG_DEFINITIONS[];
void ItemflagManager::setupUnkFlagsStuff() {
setupFlagIndex(ItemflagManager__ITEMFLAG_DEFINITIONS, 0x1FE);
void ItemflagManager::setupFlagIndex() {
createFlagIndex(ItemflagManager__ITEMFLAG_DEFINITIONS, 0x1FE);
}
void ItemflagManager::onDirty() {}

View File

@ -249,7 +249,7 @@ void SceneflagManager::unsetTempOrSceneflag(u16 flag) {
setShouldCommit(flag);
}
}
s32 SceneflagManager::doCommit() {
s32 SceneflagManager::commit() {
if (mSceneIdx == 0xFFFF) {
return 0;
} else if (mShouldCommit) {

View File

@ -11,7 +11,7 @@ SkipflagManager *SkipflagManager::sInstance = nullptr;
u16 SkipflagManager::sSkipFlags[16] = {};
// 800bfba0
void SkipflagManager::copyFromSave() {
void SkipflagManager::doCopyFromSave() {
u16 *savedSkipflags = FileManager::sInstance->getSkipFlags();
mFlagSpace.copyFromSaveFile(savedSkipflags, 0, 0x10);
}
@ -30,8 +30,8 @@ void SkipflagManager::init() {
}
// 800bfc40
void SkipflagManager::thunk_copyFromSave() {
SkipflagManager::copyFromSave();
void SkipflagManager::copyFromSave() {
doCopyFromSave();
}
// 800bfc50
@ -53,7 +53,7 @@ bool SkipflagManager::checkFlag(u16 flag) {
}
// 800bfd90
bool SkipflagManager::commitFlags() {
bool SkipflagManager::commit() {
if (mShouldCommit) {
FileManager *instance = FileManager::sInstance;
instance->setSkipFlagsChecked(mFlagSpace.getFlagPtrUnchecked(), 0, 0x10);

View File

@ -5,15 +5,15 @@ StoryflagManager *StoryflagManager::sInstance = nullptr;
StoryflagManager::StoryflagManager() : mStoryFlags(sFlags, 0x80) {}
void StoryflagManager::copyFlagsFromSave() {
void StoryflagManager::copyFlagsFromSaveFirstTime() {
setFlagSizes(0x80, 0x100);
ItemStoryManagerBase::copyFlagsFromSave_Priv();
ItemStoryManagerBase::copyFromSave();
}
extern "C" FlagDefinition StoryflagManager__STORYFLAG_DEFINITIONS[];
void StoryflagManager::setupUnkFlagsStuff() {
setupFlagIndex(StoryflagManager__STORYFLAG_DEFINITIONS, 0x4B1);
void StoryflagManager::setupFlagIndex() {
createFlagIndex(StoryflagManager__STORYFLAG_DEFINITIONS, 0x4B1);
}
void StoryflagManager::onDirty() {}