mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-27 05:43:51 +01:00
cleanup some m4a code (thanks to shoomer)
This commit is contained in:
parent
dfc6ee0e9e
commit
9eb5794482
19
src/m4a.c
19
src/m4a.c
@ -1616,6 +1616,9 @@ void ply_xcmd_0C(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *tra
|
|||||||
void ply_xcmd_0D(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track)
|
void ply_xcmd_0D(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track)
|
||||||
{
|
{
|
||||||
u32 unk;
|
u32 unk;
|
||||||
|
#ifdef UBFIX
|
||||||
|
unk = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
READ_XCMD_BYTE(unk, 0) // UB: uninitialized variable
|
READ_XCMD_BYTE(unk, 0) // UB: uninitialized variable
|
||||||
READ_XCMD_BYTE(unk, 1)
|
READ_XCMD_BYTE(unk, 1)
|
||||||
@ -1657,18 +1660,12 @@ start_song:
|
|||||||
mplayInfo = &gPokemonCryMusicPlayers[i];
|
mplayInfo = &gPokemonCryMusicPlayers[i];
|
||||||
mplayInfo->ident++;
|
mplayInfo->ident++;
|
||||||
|
|
||||||
#define CRY ((s32)&gPokemonCrySongs + i * sizeof(struct PokemonCrySong))
|
gPokemonCrySongs[i] = gPokemonCrySong;
|
||||||
#define CRY_OFS(field) offsetof(struct PokemonCrySong, field)
|
|
||||||
|
|
||||||
memcpy((void *)CRY, &gPokemonCrySong, sizeof(struct PokemonCrySong));
|
gPokemonCrySongs[i].tone = tone;
|
||||||
|
gPokemonCrySongs[i].part[0] = &gPokemonCrySongs[i].part0;
|
||||||
*(u32 *)(CRY + CRY_OFS(tone)) = (u32)tone;
|
gPokemonCrySongs[i].part[1] = &gPokemonCrySongs[i].part1;
|
||||||
*(u32 *)(CRY + CRY_OFS(part)) = CRY + CRY_OFS(part0);
|
gPokemonCrySongs[i].gotoTarget = (u32)&gPokemonCrySongs[i].cont;
|
||||||
*(u32 *)(CRY + CRY_OFS(part) + 4) = CRY + CRY_OFS(part1);
|
|
||||||
*(u32 *)(CRY + CRY_OFS(gotoTarget)) = CRY + CRY_OFS(cont);
|
|
||||||
|
|
||||||
#undef CRY_OFS
|
|
||||||
#undef CRY
|
|
||||||
|
|
||||||
mplayInfo->ident = ID_NUMBER;
|
mplayInfo->ident = ID_NUMBER;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user