Skip to content

Conversation

@PikalaxALT
Copy link
Collaborator

No description provided.

@PikalaxALT PikalaxALT changed the title Sync documentation from speedchoice Battle HP Bar and related code Sep 25, 2024
@PikalaxALT PikalaxALT marked this pull request as ready for review October 2, 2024 00:13
Copy link
Collaborator

@adrienntindall adrienntindall left a comment

Choose a reason for hiding this comment

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

Would prefer more documentation but I don't think that's feasible as of right now

u8 script;
void *unk4;
void *unk8;
struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

using pokeplatinum/retsam to try and match stuff, they did something similar on their end. didn't help the three affected functions tho.

void ov12_0226498C(BattleHpBar *hpBar, u32 num, u32 flag) {
GF_ASSERT(hpBar->unk4 != NULL);
if (hpBar->type == HP_BAR_TYPE_SAFARI) {
flag &= 0xC00;
Copy link
Collaborator

Choose a reason for hiding this comment

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

would prefer some consts here even if theyre all unown, ie #def HP_BAR_FLAG_4 (1 << 4) type things


narc = NARC_New(NARC_a_0_0_8, HEAP_ID_BATTLE);

renderer = ov12_0223A8E4(hpBar->bsys);
Copy link
Collaborator

Choose a reason for hiding this comment

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

ov12_0223A8E4 -> BattleSystem_GetSpriteRenderer

narc = NARC_New(NARC_a_0_0_8, HEAP_ID_BATTLE);

renderer = ov12_0223A8E4(hpBar->bsys);
gfxHandler = ov12_0223A8EC(hpBar->bsys);
Copy link
Collaborator

Choose a reason for hiding this comment

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

ov12_0223A8EC -> BattleSystem_GetGfxHandler

Sprite_SetPositionXY(hpBar->unk4->sprite, r4->x + x, r4->y + y);
if (hpBar->unk8 != NULL) {
Sprite_SetPositionXY(hpBar->unk8->sprite,
r4->x + x - ov12_0226D368[hpBar->type],
Copy link
Collaborator

Choose a reason for hiding this comment

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

ov12_0226D368 -> sHpBarXOffsets

Copy link
Collaborator

Choose a reason for hiding this comment

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

or sHpBoxXOffsets, etc, whatever you want

AddTextPrinterParameterizedWithColorAndSpacing(&window, 0, string, 0, 0, TEXT_SPEED_NOTRANSFER, MAKE_TEXT_COLOR(14, 2, 15), 0, 0, NULL);
srcBuf = window.pixelBuffer;

{
Copy link
Collaborator

Choose a reason for hiding this comment

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

brackets required to match?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

iirc yes

#ifdef NONMATCHING
static void ov12_02264F44(BattleHpBar *hpBar, int x, int y) {
const UnkTemplate_0200D748 *r4;
const UnkTemplate_0200D748 *tmplate;
Copy link
Collaborator

Choose a reason for hiding this comment

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

tmplate -> template

@PikalaxALT PikalaxALT merged commit bec92f1 into pret:master Oct 7, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants