Skip to content

Commit

Permalink
Update ui.c
Browse files Browse the repository at this point in the history
whitespace...
  • Loading branch information
ThothWhatsThis authored Jan 21, 2024
1 parent 31b6c81 commit cf72e7b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ void DrawChargeBar(void) {
u32 chargeFrame;

tmp1 = FALSE;
if (!(gHUD.hideFlags & HUD_HIDE_CHARGE_BAR))
if (!(gHUD.hideFlags & HUD_HIDE_CHARGE_BAR))
tmp1 = gPlayerState.chargeState.action != 0;
if (!tmp1) {
EraseChargeBar();
Expand All @@ -469,22 +469,22 @@ void DrawChargeBar(void) {
BufferPos = &gBG0Buffer[0x40];

chargeTime = Div(gPlayerState.chargeState.chargeTimer + 19, 20);
if (chargeTime > 40)
if (chargeTime > 40)
chargeTime = 40;

if (gHUD.unk_6 == 0 || gHUD.unk_7 != chargeTime) {
gHUD.unk_6 = 1;
gHUD.unk_7 = chargeTime;

// this calls Div and returns the result in ret.values[0] and the remainder in ret.values[1]
ret.raw = ((DivRem*)&Div)(chargeTime, 4);
ret.raw = ((DivRem*)&Div)(chargeTime, 4);
chargeState = ret.values[0];
chargeFrame = ret.values[1];

BufferPos[0] = 0xf016;
BufferPos[11] = 0xf416;
DmaSet(3, &gUnk_080C8F54[10 - chargeState], BufferPos + 1, 0x8000000a);
if (chargeFrame != 0)
if (chargeFrame != 0)
BufferPos[chargeState + 1] = ((chargeFrame + 0x17U) & 0x3ff) | 0xf000;
gScreen.bg0.updated = 1;
}
Expand All @@ -500,13 +500,13 @@ void DrawChargeBar(void) {
break;
}

if (chargeState == gHUD.unk_8)
if (chargeState == gHUD.unk_8)
return;

gHUD.unk_8 = chargeState;

BufferPos = (u16*)(VRAM + 0xc2c0);
DmaSet(3, gUnk_080C8F7C[chargeState], BufferPos, 0x84000030);
DmaSet(3, gUnk_080C8F7C[chargeState], BufferPos, 0x84000030);
}

void DrawKeys(void) {
Expand Down

0 comments on commit cf72e7b

Please sign in to comment.