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

RFC: Naming Conventions #6

Open
LunarLambda opened this issue Apr 12, 2021 · 13 comments
Open

RFC: Naming Conventions #6

LunarLambda opened this issue Apr 12, 2021 · 13 comments
Labels

Comments

@LunarLambda
Copy link

This was something discussed in the Discord yesterday, and there seemed to be a lot of differing opinions on it so I think it's good to decide on it ahead of time

What Naming Conventions (Registers, Functions, Hardware), Should We Use?

There's a couple options that were discussed

  • Follow the "official" names, as used by GBAtek, libgba, etc.
  • Create new names.
    • What should the focus be?
    • Can we ensure people who don't know the new names can find them using the old ones?
  • Use anglicized names such as "Display Control", "Keypad Input", etc, and only use shortened names where brevity is required, i.e. links, or code.

Personally I don't have significant gripes with the official names, although there's a couple undescriptive names and misnomers.

Additionally, we would need to come up with new names for undocumented registers, although this can be decided on a case by case basis.

@Lokathor
Copy link
Contributor

even if we use official names, there's no reason to not also spell out the pronounceable name

0x04000000 - DISPCNT - Display Control

However I think the main place where we can get an advantage in having a differing name is if we're splitting or combining registers from the way that GBATEK/CowBite/Whatever already describe them.

If we're simply going to use the same widths for each address that already exist in another document, we can just use what that document says.

@notyourav
Copy link

More important than compatibility with other documentation is compatibility with existing header files, sdks, etc. like tonc and dkp.

It might be frustrating for people if that is strayed from.

@Lokathor
Copy link
Contributor

Lokathor commented Apr 12, 2021

Yes, I think it's entirely reasonable that if we provide alternate names that we'd require of ourselves to also provide a matching alternate header file to go with it.

@LunarLambda
Copy link
Author

even if we use official names, there's no reason to not also spell out the pronounceable name

0x04000000 - DISPCNT - Display Control

That's what I meant with the third point, although preferably in for example listings or table of contents, I would list them by their "full" name, i.e.

  1. LCD Screen
    1.5 Display Control Register

However I think the main place where we can get an advantage in having a differing name is if we're splitting or combining registers from the way that GBATEK/CowBite/Whatever already describe them.

That's true, although I'm not sure how often this will come up other than fusing _L and _H registers

If we're simply going to use the same widths for each address that already exist in another document, we can just use what that document says.

I think that's slightly beyond the scope of this, but yes, register width will get its own discussion soon, since that was a similarly discussed topic

@notyourav
Copy link

notyourav commented Apr 12, 2021

Yes, I think it's entirely reasonable that if we provide alternate names that we'd require of ourselves to also provide a matching alternate header file to go with it.

Unless dkp folks are on board, that would require people to drop the headers in themselves.

@LunarLambda
Copy link
Author

More important than compatibility with other documentation is compatibility with existing header files, sdks, etc. like tonc and dkp.

It might be frustrating for people if that is strayed from.

Sure, but tonc as an example already uses some different names.

@Lokathor
Copy link
Contributor

That's true, although I'm not sure how often this will come up other than fusing _L and _H registers

I tried to visualize some of it today. There are some registers that you'd reasonably want to split into their individual bytes in some situations.

I think that's slightly beyond the scope of this, but yes, register width will get its own discussion soon, since that was a similarly discussed topic

I strongly disagree. You can't really talk about if the names should be kept / split / fused if you're not going to discuss the splitting / fusing part of things.

Unless dkp folks are on board, that would require people to drop the headers in themselves.

I genuinely have no knowledge of how hard that would make things for people. If it's it's just a 1 line fix that seems fine. If it's a huge honkin' deal then yeah we're basically stuck with what the DKP folks have decided on.

@AntonioND
Copy link
Member

AntonioND commented Apr 12, 2021

I think that the GBATEK names are the ones that should be used. In practice, they are the ones used everywhere. Not just documentation, but pretty much every project that has been created since GBATEK became a thing:

And, while Tonc uses different names for the PSG sound channels, most people don't even use them, so that's not a real problem.

Also, the aim of devkitPro is "we want to unify everything and have the standard homebrew toolchains and libraries", so I really doubt they'd like this initiative of renaming everything when there is already a well-established convention. There's nothing stopping others from doing what they want in their own projects, but I am 100% sure that it would be impossible to get them to agree to change the names in the libgba and libtonc included in devkitPro.

@LunarLambda
Copy link
Author

This seems to be agreed upon pretty unanimously, will close this if there's nothing else anyone would like to add

@Lokathor
Copy link
Contributor

well, not exactly :/ but whatever

@LunarLambda
Copy link
Author

everyone seemed to be largely on the side of "stick to gbatek/libgba names"

I guess the question of fusing/splitting remains but I didn't see much input on that aside from you :s

@Lokathor
Copy link
Contributor

Yeah, and we also don't need to resolve it immediately. There's quite a bit to describe without mentioning a single IO register

@LunarLambda
Copy link
Author

That's fair

@avivace avivace added the meta label Apr 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants