summaryrefslogtreecommitdiff
path: root/src/libs
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2017-12-24 14:23:52 -0600
committerGitHub <noreply@github.com>2017-12-24 14:23:52 -0600
commite3078400bbdb3e8416806127290b9a2d68cfb3b8 (patch)
tree7ef9993608fc9c6e426ce908957ac07f72b8f650 /src/libs
parentb827bd9a5a44e17fa9fced591465fc64a619a134 (diff)
parente5c216e5066dac26fad64cb2e7bb6a5f0d40bf3f (diff)
Merge pull request #492 from PikalaxALT/decompile_data
Decompile data and abstract away some explicit memcpy calls
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/m4a_2.c2
-rw-r--r--src/libs/m4a_4.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libs/m4a_2.c b/src/libs/m4a_2.c
index 2d3c65848..2e5956ef0 100644
--- a/src/libs/m4a_2.c
+++ b/src/libs/m4a_2.c
@@ -85,7 +85,7 @@ void m4aSoundInit(void)
mplayInfo->memAccArea = gMPlayMemAccArea;
}
- memcpy(&gPokemonCrySong, &gPokemonCrySongTemplate, sizeof(struct PokemonCrySong));
+ gPokemonCrySong = gPokemonCrySongTemplate;
for (i = 0; i < MAX_POKEMON_CRIES; i++)
{
diff --git a/src/libs/m4a_4.c b/src/libs/m4a_4.c
index 2e1d140b4..da5550252 100644
--- a/src/libs/m4a_4.c
+++ b/src/libs/m4a_4.c
@@ -445,7 +445,7 @@ start_song:
#define CRY ((s32)&gPokemonCrySongs + i * sizeof(struct PokemonCrySong))
#define CRY_OFS(field) offsetof(struct PokemonCrySong, field)
- memcpy((void *)CRY, &gPokemonCrySong, sizeof(struct PokemonCrySong));
+ *(struct PokemonCrySong *)CRY = gPokemonCrySong;
*(u32 *)(CRY + CRY_OFS(tone)) = (u32)tone;
*(u32 *)(CRY + CRY_OFS(part)) = CRY + CRY_OFS(part0);