Skip to content

Commit

Permalink
extend some u32 status2 to u64
Browse files Browse the repository at this point in the history
  • Loading branch information
u8-Salem committed Apr 6, 2023
1 parent ec47958 commit 32d5ccb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/battle_controllers.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ void BtlController_EmitChooseItem(u8 bufferId, u8 *battlePartyOrder);
void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 slotId, u16 abilityId, u8 *data);
void BtlController_EmitHealthBarUpdate(u8 bufferId, u16 hpValue);
void BtlController_EmitExpUpdate(u8 bufferId, u8 partyId, s32 expPoints);
void BtlController_EmitStatusIconUpdate(u8 bufferId, u32 status1, u32 status2);
void BtlController_EmitStatusIconUpdate(u8 bufferId, u32 status1, u64 status2);
void BtlController_EmitStatusAnimation(u8 bufferId, bool8 status2, u32 status);
void BtlController_EmitDataTransfer(u8 bufferId, u16 size, void *data);
void BtlController_EmitTwoReturnValues(u8 bufferId, u8 ret8, u32 ret32);
Expand Down
2 changes: 1 addition & 1 deletion include/pokemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ struct BattlePokemon
/*0x45*/ u32 experience;
/*0x49*/ u32 personality;
/*0x4D*/ u32 status1;
/*0x51*/ u32 status2;
/*0x51*/ u64 status2;
/*0x55*/ u32 otId;
/*0x59*/ u8 metLevel;
};
Expand Down
14 changes: 9 additions & 5 deletions src/battle_controllers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1230,18 +1230,22 @@ void BtlController_EmitExpUpdate(u8 bufferId, u8 partyId, s32 expPoints)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 6);
}

void BtlController_EmitStatusIconUpdate(u8 bufferId, u32 status1, u32 status2)
void BtlController_EmitStatusIconUpdate(u8 bufferId, u32 status1, u64 status2)
{
sBattleBuffersTransferData[0] = CONTROLLER_STATUSICONUPDATE;
sBattleBuffersTransferData[1] = status1;
sBattleBuffersTransferData[2] = (status1 & 0x0000FF00) >> 8;
sBattleBuffersTransferData[3] = (status1 & 0x00FF0000) >> 16;
sBattleBuffersTransferData[4] = (status1 & 0xFF000000) >> 24;
sBattleBuffersTransferData[5] = status2;
sBattleBuffersTransferData[6] = (status2 & 0x0000FF00) >> 8;
sBattleBuffersTransferData[7] = (status2 & 0x00FF0000) >> 16;
sBattleBuffersTransferData[8] = (status2 & 0xFF000000) >> 24;
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 9);
sBattleBuffersTransferData[6] = (status2 & 0x000000000000FF00) >> 8;
sBattleBuffersTransferData[7] = (status2 & 0x0000000000FF0000) >> 16;
sBattleBuffersTransferData[8] = (status2 & 0x00000000FF000000) >> 24;
sBattleBuffersTransferData[9] = (status2 & 0x000000FF00000000) >> 32;
sBattleBuffersTransferData[10] = (status2 & 0x0000FF0000000000) >> 40;
sBattleBuffersTransferData[11] = (status2 & 0x00FF000000000000) >> 48;
sBattleBuffersTransferData[12] = (status2 & 0xFF00000000000000) >> 56;
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 13);
}

void BtlController_EmitStatusAnimation(u8 bufferId, bool8 status2, u32 status)
Expand Down

0 comments on commit 32d5ccb

Please sign in to comment.