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

Clean up lib imported data #2235

Merged
merged 3 commits into from
Feb 20, 2025
Merged

Conversation

gamezter
Copy link
Contributor

Data seems to be aligned to a 4 byte boundary, so a lot of imported data has trailing zeros that are actually padding between data. Here I mostly remove trailing zeros from u8[]s passed to AnimateEntity since that function ignores everything after a -1, 0 or a 0, 0.

I also adjusted some imported arrays so their size matches what the code expects their size to be. I had to add a STATIC_PAD_DATA(4); but perhaps that could be a clue to adjust the file boundary.

static u8 D_us_8018283C[] = {20, 1, 20, 2, 20, 3, 20, 2, 0, 0};
static u8 D_us_80182848[] = {24, 4, 24, 5, 24, 6, 24, 5, 0, 0};
static u8 D_us_80182854[] = {24, 7, 24, 8, 24, 9, 24, 8, 0, 0};
static u8 D_us_80182860[] = {18, 8, 18, 9, -1, 0};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

notice I split D_us_80182854 in two here since 0,0 signals the end of this data

Copy link
Contributor

Choose a reason for hiding this comment

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

I found a few of these when importing PSP data, since the unused symbols get stripped there, but it causes a mismatch if they're part of a data address that is actually used. Nice work

#else
static u16 D_us_80181A78[] = {0x0903, 0x0A03, 0x0B03, 0x0C03, 0x0D03, 0x0E03,
0xF03, 0x1003, 0x0000, 0x0000, 0x0003, 0x0000};
static s32 D_us_80181A8C = 3;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These were actually u8[]s since they are passed to AnimateEntity with an unused s32 at the end

@sozud sozud merged commit 0eac1dd into Xeeynamo:master Feb 20, 2025
26 checks passed
sozud pushed a commit that referenced this pull request Feb 20, 2025
Similar to #2235
Remove trailing zeros from data where it makes sense
@gamezter gamezter deleted the Refactor/lib/data branch February 20, 2025 14:37
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.

3 participants