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 VRAM transfer managers for sprite components #357

Merged
merged 18 commits into from
Feb 4, 2025

Conversation

lhearachel
Copy link
Collaborator

This wound up being a bigger PR than I wanted it to be, but I felt like I should just document all of these related components in one fell swoop rather than leave any of them lingering.

Copy link
Collaborator

@ravepossum ravepossum left a comment

Choose a reason for hiding this comment

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

Just a small handful of nitpicks and names I think we could refine.

include/battle/battle_context.h Outdated Show resolved Hide resolved
src/battle/ov16_0223B140.c Outdated Show resolved Hide resolved
src/overlay005/fieldmap.c Outdated Show resolved Hide resolved
src/char_transfer.c Outdated Show resolved Hide resolved
}
}

void *CharTransfer_PopTaskManager(void)
Copy link
Collaborator

Choose a reason for hiding this comment

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

question: I'm only familiar with push/pop in the context of stacks - is this another way it's used? Without looking at these functions, I would be inclined to think it's a stack, unless I'm just unfamiliar with this usage of that terminology.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Push/Pop can apply to any collection or concept where an underlying reference changes as a result of the operation. That definitely applies here (the private task manager changes pointer changes).

src/char_transfer.c Outdated Show resolved Hide resolved
break;
case GX_VRAM_OBJ_16_F:
case GX_VRAM_OBJ_16_G:
sTaskManager->vramSizeMain = 16 * 1024;
Copy link
Collaborator

Choose a reason for hiding this comment

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

question: Is there a descriptive constant we can use for the 1024s here?

Copy link
Collaborator Author

@lhearachel lhearachel Feb 4, 2025

Choose a reason for hiding this comment

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

It's just a kilobyte conversion. I don't think it's super worth a constant; this code is quite low-level, and I don't expect many users to ever look at it. 😅

src/pltt_transfer.c Outdated Show resolved Hide resolved
src/char_transfer.c Outdated Show resolved Hide resolved
src/pltt_transfer.c Outdated Show resolved Hide resolved
Copy link
Collaborator

@ravepossum ravepossum left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@lhearachel lhearachel merged commit c4675f8 into pret:main Feb 4, 2025
2 checks passed
github-actions bot pushed a commit that referenced this pull request Feb 4, 2025
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