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

Document BDHC file loading #362

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

Kuruyia
Copy link
Contributor

@Kuruyia Kuruyia commented Feb 5, 2025

This documents the loading of BDHC files that are embedded in files of the land data NARC.

Credits goes to Mikelan98, HiroTDK and HumanGamer for their resources (listed below). It would have been a lot more painful having to reverse this file format.

Resources used:

Copy link
Collaborator

@lhearachel lhearachel left a comment

Choose a reason for hiding this comment

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

Just the two minor comments. Looks great! 🙏

BDHCLoader_LoadAccessList(narc, bdhc, bdhcHeader);

Heap_FreeToHeap(bdhcHeader);
bdhc->loaded = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

polish: Use BOOL constants for this member, even if the underlying field is not a BOOL, just for the semantics.

ctx->bdhc->stripsSize = ctx->bdhcHeader.stripsSize;
BDHCLoader_PrepareBuffers(&ctx->bdhcHeader, ctx->bdhc, (void **)&ctx->buffer);

subTaskCompleted = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

polish: Use TRUE/FALSE.

This documents the loading of BDHC files that are embedded in files of
the land data NARC.

Credits goes to Mikelan98, HiroTDK and HumanGamer for their resources
(listed below). It would have been a lot more painful having to reverse
this file format.

Resources used:
* https://hirotdk.neocities.org/FileSpecs#Terrain
* https://www.pokecommunity.com/threads/i-solved-the-final-piece-of-the-terrain-bdhc-files-in-gen-4-inclines.424428/

Signed-off-by: Kuruyia <[email protected]>
@Kuruyia Kuruyia force-pushed the feat/document-bdhc-loading branch from 7517bc7 to 3f83011 Compare February 5, 2025 18:28
@Kuruyia
Copy link
Contributor Author

Kuruyia commented Feb 5, 2025

Oopsie, looks like I got carried away while cleaning up the consts

@lhearachel lhearachel merged commit 10c283d into pret:main Feb 5, 2025
2 checks passed
@Kuruyia Kuruyia deleted the feat/document-bdhc-loading branch February 5, 2025 18:40
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