Skip to content

3D palette, button input info#368

Merged
UsernameFodder merged 235 commits intoUsernameFodder:masterfrom
assidion2:sep14
Mar 15, 2026
Merged

3D palette, button input info#368
UsernameFodder merged 235 commits intoUsernameFodder:masterfrom
assidion2:sep14

Conversation

@assidion2
Copy link
Contributor

No description provided.

@assidion2
Copy link
Contributor Author

@UsernameFodder The symbols check is giving me an error for the ram symbol being in the wrong place, but I'm not sure if the place it's suggesting is the correct one.

ASSERT_SIZE(struct message_log_info, 12);

// Contains information about the user's current button input in dungeon mode.
// For a mapping of keys <-> bits, see https://problemkaputt.de/gbatek.htm#gbakeypadinput
Copy link
Owner

Choose a reason for hiding this comment

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

Would it make sense to define a struct encoding the mapping in bitfields? Especially since multiple fields seem to use the same mapping

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was actually proposed by @Chesyon a while ago but it seems he never got around to it. I'll add it to this PR.

ASSERT_SIZE(struct options, 10);

// This is the layout of all button bitflags in the input/controller structs. This is present only
// for analysis purposes, as internally the code does not seem to actually store these as a struct.
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
// for analysis purposes, as internally the code does not seem to actually store these as a struct.

This is unnecessary, the code never uses bitfields anywhere and this repo is about documentation, not code matching accuracy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Chesyon pinging you just so you see since you were the one who originally wrote this

bool unk14 : 1;
bool unk15 : 1;
};
ASSERT_SIZE(struct buttons, 0x2);
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
ASSERT_SIZE(struct buttons, 0x2);
ASSERT_SIZE(struct buttons, 2);

};
ASSERT_SIZE(struct options, 10);

// This is the layout of all button bitflags in the input/controller structs. This is present only
Copy link
Owner

Choose a reason for hiding this comment

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

Let's keep the gbatek reference link. Also, if I read the reference correctly, we should probably add a note that false means a button is pressed, since that's pretty unintuitive

ASSERT_SIZE(struct message_log_info, 12);

// Contains information about the user's current button input in dungeon mode.
// For a mapping of keys <-> bits, see the buttons struct in common.h.
Copy link
Owner

Choose a reason for hiding this comment

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

Just use the struct as the type for the fields that use the mapping

@UsernameFodder
Copy link
Owner

@UsernameFodder The symbols check is giving me an error for the ram symbol being in the wrong place, but I'm not sure if the place it's suggesting is the correct one.

It's "correct" given the available info.

It's ordering the new symbol (which has only the EU address labeled) before the ones with only NA addresses labeled. Addresses across versions aren't really comparable, so the sorting puts the EU-only address first.

@UsernameFodder UsernameFodder merged commit 0c34708 into UsernameFodder:master Mar 15, 2026
12 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