Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synced function symbols from decomp #187

Merged
merged 3 commits into from
Sep 7, 2023

Conversation

AnonymousRandomPerson
Copy link
Contributor

  • Core functions that are standard across most DS/NitroSDK games (e.g., crt0 init functions).
  • Veneers auto-detected by Ghidra while setting up the decomp.

Comment on lines +6 to +14
void SvcWaitByLoop(void);
void SvcSoftReset(void);
void SvcCpuSet(void);
void _start(void);
void MIiUncompressBackward(void);
void do_autoload(void);
void StartAutoloadDoneCallback(void);
void OSiReferSymbol(void);
void NitroMain(void);
Copy link
Owner

Choose a reason for hiding this comment

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

Do you know if these are (mostly) the only core functions with weird naming? It seems like after these you get into the allocator functions. If these are the only exceptions maybe it might make more sense to implement an exception list for the case checker so we can use the real names.

Copy link
Contributor Author

@AnonymousRandomPerson AnonymousRandomPerson Sep 7, 2023

Choose a reason for hiding this comment

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

These are not the only ones. I've seen this naming convention in some of the library code, and the number of functions would make an exception list grow very large.

I don't personally like this naming convention of mixing case with domain_action, but it is a real naming convention used by some C programming circles (e.g., pret/pokeheartgold#213). It may be worth supporting this style outright, rather than making exceptions.

Copy link
Owner

Choose a reason for hiding this comment

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

I would need to see more examples. This kind of mixed case convention seems extremely permissive, because domain can be anything (MIi == PascalCase, SVC == SCREAMING_SNAKE_CASE, _start == snake_case), so a sufficiently flexible check would have to accept almost all names except maybe camelCase and constructs like UPPERlower. It's not something I'd really be keen on implementing checks for. You might as well just turn off naming checks at that point.

Maybe let's just leave it as the converted PascalCase names for now. You're maintaining a list if the mixed case ones, so it should be easy to revisit this if we start finding more of these.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you search for jn_spl.o in this map file, that section of the file has more examples.

I think _start_AutoloadDoneCallback is a special case because it is related to the _start function, which is hard-coded to be the entry point of the program regardless of naming convention. Ignoring that, the convention seems to be PascalCase between the underscores, allowing consecutive capitals for abbreviations. This at least allows some restrictions.

I'm good with keeping the converted names for now. I'm not very interested in the library code, but if somebody else starts extracting them then we can revisit this.

symbols/arm9.yml Outdated Show resolved Hide resolved
Copy link
Owner

@UsernameFodder UsernameFodder left a comment

Choose a reason for hiding this comment

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

LGTM

@UsernameFodder UsernameFodder merged commit 5724dec into UsernameFodder:master Sep 7, 2023
10 checks passed
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