some work on NerveUtil

This commit is contained in:
shibbo 2024-08-27 14:25:32 -04:00
parent f6607e0914
commit 72b0f5c8d7
9 changed files with 160 additions and 16 deletions

View File

@ -1,6 +1,6 @@
{
"schemaVersion": 1,
"label": "decompiled",
"message": "0.2661%",
"message": "0.2738%",
"color": "blue"
}

View File

@ -52755,20 +52755,20 @@ _ZN2al14NerveStateCtrl10startStateEPKNS_5NerveE=0000007100878C60=00000050=true
_ZN2al14NerveStateCtrl13findStateInfoEPKNS_5NerveE=0000007100878CB0=00000044=true
_ZNK2al14NerveStateCtrl17isCurrentStateEndEv=0000007100878D00=00000024=true
_ZN2al14NerveStateCtrl18tryEndCurrentStateEv=0000007100878D30=0000004C=true
_ZN2al8setNerveEPNS_9IUseNerveEPKNS_5NerveE=0000007100878D80=0000002C=false
_ZN2al14setNerveAtStepEPNS_9IUseNerveEPKNS_5NerveEi=0000007100878DB0=00000068=false
_ZN2al6isStepEPKNS_9IUseNerveEi=0000007100878E20=00000034=false
_ZN2al7isNerveEPKNS_9IUseNerveEPKNS_5NerveE=0000007100878E60=00000034=false
_ZN2al12getNerveStepEPKNS_9IUseNerveE=0000007100878EA0=00000020=false
_ZN2al8getNerveEPKNS_9IUseNerveE=0000007100878EC0=0000001C=false
_ZN2al11isFirstStepEPKNS_9IUseNerveE=0000007100878EE0=00000028=false
_ZN2al10isLessStepEPKNS_9IUseNerveEi=0000007100878F10=00000034=false
_ZN2al15isLessEqualStepEPKNS_9IUseNerveEi=0000007100878F50=00000034=false
_ZN2al13isGreaterStepEPKNS_9IUseNerveEi=0000007100878F90=00000034=false
_ZN2al18isGreaterEqualStepEPKNS_9IUseNerveEi=0000007100878FD0=00000034=false
_ZN2al14isIntervalStepEPKNS_9IUseNerveEii=0000007100879010=00000044=false
_ZN2al19isIntervalOnOffStepEPKNS_9IUseNerveEii=0000007100879060=00000040=false
_ZN2al10isNewNerveEPKNS_9IUseNerveE=00000071008790A0=00000024=false
_ZN2al8setNerveEPNS_9IUseNerveEPKNS_5NerveE=0000007100878D80=0000002C=true
_ZN2al14setNerveAtStepEPNS_9IUseNerveEPKNS_5NerveEi=0000007100878DB0=00000068=true
_ZN2al6isStepEPKNS_9IUseNerveEi=0000007100878E20=00000034=true
_ZN2al7isNerveEPKNS_9IUseNerveEPKNS_5NerveE=0000007100878E60=00000034=true
_ZN2al12getNerveStepEPKNS_9IUseNerveE=0000007100878EA0=00000020=true
_ZN2al8getNerveEPKNS_9IUseNerveE=0000007100878EC0=0000001C=true
_ZN2al11isFirstStepEPKNS_9IUseNerveE=0000007100878EE0=00000028=true
_ZN2al10isLessStepEPKNS_9IUseNerveEi=0000007100878F10=00000034=true
_ZN2al15isLessEqualStepEPKNS_9IUseNerveEi=0000007100878F50=00000034=true
_ZN2al13isGreaterStepEPKNS_9IUseNerveEi=0000007100878F90=00000034=true
_ZN2al18isGreaterEqualStepEPKNS_9IUseNerveEi=0000007100878FD0=00000034=true
_ZN2al14isIntervalStepEPKNS_9IUseNerveEii=0000007100879010=00000044=true
_ZN2al19isIntervalOnOffStepEPKNS_9IUseNerveEii=0000007100879060=00000040=true
_ZN2al10isNewNerveEPKNS_9IUseNerveE=00000071008790A0=00000024=true
_ZN2al13calcNerveRateEPKNS_9IUseNerveEi=00000071008790D0=00000068=false
_ZN2al13calcNerveRateEPKNS_9IUseNerveEii=0000007100879140=00000068=false
_ZN2al19calcNerveEaseInRateEPKNS_9IUseNerveEi=00000071008791B0=00000068=false
@ -60239,7 +60239,7 @@ _ZN2al21isMessageTagAlignLeftEPKNS_17IUseMessageSystemEii=00000071009B66E0=00000
_ZN2al23isMessageTagAlignCenterEPKNS_17IUseMessageSystemEii=00000071009B6790=000000A4=true
_ZN2al23replaceMessageTagStringEPN4sead22BufferedSafeStringBaseIDsEEPKNS_17IUseMessageSystemEPKDsS8_=00000071009B6840=00000070=false
_ZN2al35replaceMessageTagTimeDirectRaceTimeEPN4sead22BufferedSafeStringBaseIDsEEPKNS_17IUseMessageSystemERNS_15ReplaceTimeInfoE=00000071009B68B0=0000009C=false
_ZN2al22getSystemMessageStringEPKNS_17IUseMessageSystemEPKcS4_=00000071009B6950=00000054=false
_ZN2al22getSystemMessageStringEPKNS_17IUseMessageSystemEPKcS4_=00000071009B6950=00000054=true
_ZN2al31replaceMessageTagTimeDirectDateEPN4sead22BufferedSafeStringBaseIDsEEPKNS_17IUseMessageSystemERNS_15ReplaceTimeInfoE=00000071009B69B0=0000009C=false
_ZN2al37replaceMessageTagTimeDirectDateDetailEPN4sead22BufferedSafeStringBaseIDsEEPKNS_17IUseMessageSystemERNS_15ReplaceTimeInfoE=00000071009B6A50=0000009C=false
_ZN2al22replaceMessageTagScoreEPN4sead22BufferedSafeStringBaseIDsEEPKNS_17IUseMessageSystemEPKDsiPKc=00000071009B6AF0=00000040=false

View File

@ -0,0 +1,29 @@
#pragma once
#include <types.hpp>
namespace al {
class IUseNerve;
class NerveStateBase;
class Nerve;
void setNerve(IUseNerve*, const Nerve*);
void setNerveAtStep(IUseNerve*, const Nerve*, s32);
bool isStep(const IUseNerve*, s32);
bool isNerve(const IUseNerve*, const Nerve*);
s32 getNerveStep(const IUseNerve*);
const Nerve* getNerve(const IUseNerve*);
bool isFirstStep(const IUseNerve*);
bool isLessStep(const IUseNerve*, s32);
bool isLessEqualStep(const IUseNerve*, s32);
bool isGreaterStep(const IUseNerve*, s32);
bool isGreaterEqualStep(const IUseNerve*, s32);
bool isIntervalStep(const IUseNerve*, s32, s32);
bool isIntervalOnOffStep(const IUseNerve*, s32, s32);
bool isNewNerve(const IUseNerve*);
f32 calcNerveRate(const IUseNerve*, s32);
f32 calcNerveRate(const IUseNerve*, s32, s32);
f32 calcNerveEaseInRate(const IUseNerve*, s32);
f32 calcNerveEaseInRate(const IUseNerve*, s32, s32);
}; // namespace al

View File

@ -42,6 +42,7 @@ namespace al {
class MessageSystem {
public:
MessageProjectEx* getMessageProject() const;
MessageHolder* getSystemMessageHolder(const char*, const char*) const;
MessageProjectEx* mProject; // 0x00
u64 _8;

View File

@ -0,0 +1,65 @@
#include "Library/Nerve/NerveUtil.hpp"
#include "Library/Nerve/IUseNerve.hpp"
#include "Library/Nerve/Nerve.hpp"
#include "Library/Nerve/NerveKeeper.hpp"
namespace al {
void setNerve(IUseNerve* pUser, const Nerve* pNerve) {
pUser->getNerveKeeper()->setNerve(pNerve);
}
void setNerveAtStep(IUseNerve* pUser, const Nerve* pNerve, s32 step) {
if (getNerveStep(pUser) == step) {
pUser->getNerveKeeper()->setNerve(pNerve);
}
}
bool isStep(const IUseNerve* pUser, s32 step) {
return getNerveStep(pUser) == step;
}
bool isNerve(const IUseNerve* pUser, const Nerve* pNerve) {
return getNerve(pUser) == pNerve;
}
s32 getNerveStep(const IUseNerve* pUser) {
return pUser->getNerveKeeper()->mNerveStep;
}
const Nerve* getNerve(const IUseNerve* pUser) {
return pUser->getNerveKeeper()->getCurrentNerve();
}
bool isFirstStep(const IUseNerve* pUser) {
return getNerveStep(pUser) == 0;
}
bool isLessStep(const IUseNerve* pUser, s32 step) {
return getNerveStep(pUser) < step;
}
bool isLessEqualStep(const IUseNerve* pUser, s32 step) {
return getNerveStep(pUser) <= step;
}
bool isGreaterStep(const IUseNerve* pUser, s32 step) {
return getNerveStep(pUser) > step;
}
bool isGreaterEqualStep(const IUseNerve* pUser, s32 step) {
return getNerveStep(pUser) >= step;
}
bool isIntervalStep(const IUseNerve* pUser, s32 min, s32 max) {
return (getNerveStep(pUser) - max) % min == 0;
}
bool isIntervalOnOffStep(const IUseNerve* pUser, s32 min, s32 max) {
return (((getNerveStep(pUser) - max) / min) & 0x1) == 0;
}
bool isNewNerve(const IUseNerve* pUser) {
return getNerveStep(pUser) >> 31;
}
}; // namespace al

View File

@ -174,4 +174,13 @@ namespace al {
return !isEitherInvalid && al::isEqualString(tagGroupName, "TextAlign") &&
al::isEqualString(tagName, "AlignCenter");
}
// ...
const char* getSystemMessageString(const IUseMessageSystem* pMsg, const char* a2,
const char* a3) {
auto messageHolder = pMsg->getMessageSystem()->getSystemMessageHolder(a2, a3);
return (messageHolder != nullptr) ? messageHolder->getText(a3) : "NULL";
}
}; // namespace al

View File

@ -0,0 +1,13 @@
#pragma once
namespace sead {
class FreeList {
public:
struct Node {
Node* mNextFree;
};
Node* mFree = nullptr;
void* mWork = nullptr;
};
}; // namespace sead

View File

@ -0,0 +1,15 @@
#pragma once
#include "container/seadFreeList.hpp"
#include "container/seadTreeMap.hpp"
#include "prim/seadSafeString.hpp"
namespace sead {
template <size_t KeyLength, typename V>
class StrTreeMap : public TreeMapImpl<SafeString> {
public:
FreeList mFreeList;
s32 mSize = 0;
s32 mMaxSize = 0;
};
}; // namespace sead

View File

@ -0,0 +1,12 @@
#pragma once
namespace sead {
template <typename K>
class TreeMapNode;
template <typename K>
class TreeMapImpl {
public:
TreeMapNode<K>* mRoot = nullptr;
};
}; // namespace sead