Skip to content

utility: Implement ParemeterBase::createByTypeName#23

Open
german77 wants to merge 5 commits intoopen-ead:masterfrom
german77:createByTypeName
Open

utility: Implement ParemeterBase::createByTypeName#23
german77 wants to merge 5 commits intoopen-ead:masterfrom
german77:createByTypeName

Conversation

@german77
Copy link

@german77 german77 commented Feb 16, 2026

Supersedes #22 by implementing the actual function. This has the same effect as previous PR but keeps all the previous matches intact and adds 77 new matches. This also removes a hack with ParameterCurve that for some reason was added to the header.

The function itself is not matching but really close. Most differences are in ParameterCurve and ParameterBuffer initialization. The inlining here is a killer, ghidra doesn't want to assign the correct types, the branching is chaos and reading asm is not fun in a function with this size.

I will keep working on it but I don't expect any significant improvements in a few weeks.

https://decomp.me/scratch/N8MEk


This change is Reviewable

return;
this->mValue = data;
// TODO: Check this cast
this->mValue = const_cast<T*>(reinterpret_cast<const T*>(data));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inner cast can just be a static_cast, but yeah the const_cast looks a bit dodgy. Is it possible that mValue is const qualified?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AL has almost a copy paste implementation of ParameterBase. So far mValue is only const for cstrings types.
https://github.com/MonsterDruide1/OdysseyDecomp/blob/master/lib/al/Library/Yaml/ParameterBase.h#L191

@leoetlino
Copy link
Contributor

are you sure the hpp doesn't exist? I could be misremembering but I think it might have been done this way because of some asserts in Labo. though I guess it doesn't really matter

@german77
Copy link
Author

I don't have any file info. All I can see are inlined calls and it looked really weird to have the cpp directly included in the header

@german77
Copy link
Author

I reverted the ParameterCurve changes. It makes no difference for this function, if an assert says the file is this way I have no problem with that.

@leoetlino
Copy link
Contributor

yeah so I've just checked Labo and it looks like the asserts for ParameterCurve are in a file called aglParameterCurve.hpp.

note that it's .hpp, not .cpp, and we know Nintendo does this kind of thing as seadSafeString.h/hpp/cpp is a thing too

@german77
Copy link
Author

german77 commented Feb 26, 2026

The function has been matched! Please run the workflow.
There is a hack on ParameterCurve reset. Apparently it doesn't inline without doing that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants