-
Notifications
You must be signed in to change notification settings - Fork 22
Add sgb.inc #77
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
base: master
Are you sure you want to change the base?
Add sgb.inc #77
Conversation
Closes gbdev#76
Oh, thanks! Good idea to make this a third .inc file, given all those super-specific but official SGB values ( It will need comments briefly mentioning what all these things are, like hardware.inc's heading/subheading/description structure, and to follow the formatting conventions (e.g. lowercase Also, Anyway, this is good reference to expand off of! |
Sure thing, I just had to get something out there quickly.
I'll have a look. Also, I just noticed that the actual |
Add header Add include guard Add comments Lowercase DEFs and EQUs Rename SGB_SOUND_ATTRS to SGB_SOUND_FLAGS
Having seen the I'm OK with changing the names, but not with hardcoding the values in binary form. |
May I suggest |
Sounds like a good compromise; I could accept an |
I understand the convention of using the I am wondering whether |
Again, turning it into a prefix seems appropriate:
|
As said in #76 I don't like the name I also have some issues with the semantics how things are used in pokered.
These constants actually have different meanings, despite being the same value. The first one is a mask to isolate the two lowest bits. The second is the ID for player 1. What the code does is to check if the player ID ever changes from the value for player 1, which also (by design) happens to be the same value that a non-SGB would return when no buttons are selected.
This does not actually represent what that code is doing. It's not sending the SGB data at this point, but rather doing a "regular" read of the joypad, which also increments the player index at some stage, maybe when the selected button group changes from Using the data transfer constants is obscuring what the code actually does. (The added delays also obscure what the code does. They shouldn't be needed, although that's Nintendo's fault and a disassembly can't do much about that.) I'd suggest using the regular For hardware.inc, I'd suggest constants with names along these lines:
|
TODO: once this is merged, replace |
Now that I'm thinking about it, I believe this warrants a separate repo. |
I think this topically belongs with |
It is a companion, but should it be mandatory? The correct way of adding hardware.inc to one's repo is via a submodule. Most users will probably never use sgb.inc, so it will end up just sitting there, polluting their file system. |
Arguably, using a submodule is not great, since it introduces an additional point of failure over just vendoring the file. (I prefer it for my own use, but it's less obvious for libraries and such.) Also, using a submodule also unnecessarily imports the Meanwhile, centralising the resources improves their discoverability. |
I never actually used submodules so far, so I'm wondering what you mean by them being a point of failure. As for README and LICENSE, those are necessary evils. I'd actually put the mandatory part in |
They require special Git flags to operate (
It's unfortunately not possible. Submodules are always entire repos (and you can't have sparse submodules, either). Subtrees might solve the issue, but I've never experimented with them. |
Anyone whose game has an SGB border would have a use for sgb.inc. As for "polluting" the file system with unused files, the same is also true of hardware_compat.inc (and for that matter, README.md, .github/workflows/testing.yml, etc) when using a submodule. The benefit of keeping sgb.inc in the same repo as hardware.inc is making them discoverable together, maintaining the same naming/formatting conventions for both, and keeping them in sync for releases. |
Which is probably 5% of projects, or even less until they reach advanced stages in their development?
Already addressed above.
Hidden directories don't count ;)
I'd argue that that should actually be a separate repo as well.
Agreed.
No reason not to, regardless of how they are organised.
That's precisely my point. You don't want them in sync! |
Closes #76