diff options
Diffstat (limited to 'src')
33 files changed, 392 insertions, 240 deletions
diff --git a/src/battle_anim_sound_tasks.c b/src/battle_anim_sound_tasks.c index 6068b0f33..6b14d3863 100644 --- a/src/battle_anim_sound_tasks.c +++ b/src/battle_anim_sound_tasks.c @@ -168,7 +168,7 @@ void SoundTask_PlayCryHighPitch(u8 taskId) } if (species != SPECIES_NONE) - PlayCry3(species, pan, 3); + PlayCry_ByMode(species, pan, CRY_MODE_HIGH_PITCH); DestroyAnimVisualTask(taskId); } @@ -219,10 +219,10 @@ void SoundTask_PlayDoubleCry(u8 taskId) if (species != SPECIES_NONE) { - if (gBattleAnimArgs[1] == 0xFF) - PlayCry3(species, pan, 9); - else - PlayCry3(species, pan, 7); + if (gBattleAnimArgs[1] == DOUBLE_CRY_GROWL) + PlayCry_ByMode(species, pan, CRY_MODE_GROWL_1); + else // DOUBLE_CRY_ROAR + PlayCry_ByMode(species, pan, CRY_MODE_ROAR_1); gTasks[taskId].func = SoundTask_PlayDoubleCry_Step; } @@ -243,19 +243,19 @@ static void SoundTask_PlayDoubleCry_Step(u8 taskId) } else { - if (gTasks[taskId].data[0] == 0xFF) + if (gTasks[taskId].data[0] == DOUBLE_CRY_GROWL) { if (!IsCryPlaying()) { - PlayCry3(species, pan, 10); + PlayCry_ByMode(species, pan, CRY_MODE_GROWL_2); DestroyAnimVisualTask(taskId); } } - else + else // DOUBLE_CRY_ROAR { if (!IsCryPlaying()) { - PlayCry3(species, pan, 8); + PlayCry_ByMode(species, pan, CRY_MODE_ROAR_2); DestroyAnimVisualTask(taskId); } } @@ -275,12 +275,18 @@ void SoundTask_WaitForCry(u8 taskId) } } + +#define tSpecies data[1] +#define tPan data[2] +#define tState data[9] +#define tLastCry data[10] // If it's not the last cry, don't try to restore the BGM, because another is coming + void SoundTask_PlayCryWithEcho(u8 taskId) { u16 species; s8 pan; - gTasks[taskId].data[10] = gBattleAnimArgs[0]; + gTasks[taskId].tLastCry = gBattleAnimArgs[0]; pan = BattleAnimAdjustPanning(SOUND_PAN_ATTACKER); if (IsContest()) @@ -288,8 +294,8 @@ void SoundTask_PlayCryWithEcho(u8 taskId) else species = gAnimBattlerSpecies[gBattleAnimAttacker]; - gTasks[taskId].data[1] = species; - gTasks[taskId].data[2] = pan; + gTasks[taskId].tSpecies = species; + gTasks[taskId].tPan = pan; if (species != SPECIES_NONE) gTasks[taskId].func = SoundTask_PlayCryWithEcho_Step; @@ -299,38 +305,44 @@ void SoundTask_PlayCryWithEcho(u8 taskId) static void SoundTask_PlayCryWithEcho_Step(u8 taskId) { - u16 species = gTasks[taskId].data[1]; - s8 pan = gTasks[taskId].data[2]; + u16 species = gTasks[taskId].tSpecies; + s8 pan = gTasks[taskId].tPan; - switch (gTasks[taskId].data[9]) + // Note the cases are not in order of execution + switch (gTasks[taskId].tState) { case 2: - PlayCry6(species, pan, 4); - gTasks[taskId].data[9]++; + PlayCry_DuckNoRestore(species, pan, CRY_MODE_ECHO_START); + gTasks[taskId].tState++; break; case 1: case 3: case 4: - gTasks[taskId].data[9]++; + gTasks[taskId].tState++; break; case 5: if (IsCryPlaying()) break; case 0: StopCryAndClearCrySongs(); - gTasks[taskId].data[9]++; + gTasks[taskId].tState++; break; default: - if (gTasks[taskId].data[10] == 0) - PlayCry6(species, pan, 6); + if (!gTasks[taskId].tLastCry) + PlayCry_DuckNoRestore(species, pan, CRY_MODE_ECHO_END); else - PlayCry3(species, pan, 6); + PlayCry_ByMode(species, pan, CRY_MODE_ECHO_END); DestroyAnimVisualTask(taskId); break; } } +#undef tSpecies +#undef tPan +#undef tState +#undef tLastCry + void SoundTask_PlaySE1WithPanning(u8 taskId) { u16 songId = gBattleAnimArgs[0]; diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index 1660f6ec1..efc327091 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -1681,7 +1681,7 @@ static void LinkOpponentHandleFaintingCry(void) { u16 species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES); - PlayCry3(species, 25, 5); + PlayCry_ByMode(species, 25, CRY_MODE_FAINT); LinkOpponentBufferExecCompleted(); } diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index a9240b0ac..682618c07 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -1513,7 +1513,7 @@ static void LinkPartnerHandleFaintingCry(void) { u16 species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES); - PlayCry3(species, -25, 5); + PlayCry_ByMode(species, -25, CRY_MODE_FAINT); LinkPartnerBufferExecCompleted(); } diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index ac330be76..2bea4183b 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1847,7 +1847,7 @@ static void OpponentHandleFaintingCry(void) { u16 species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES); - PlayCry3(species, 25, 5); + PlayCry_ByMode(species, 25, CRY_MODE_FAINT); OpponentBufferExecCompleted(); } diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index f4e47b434..02dc7ce29 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -2926,7 +2926,7 @@ static void PlayerHandleFaintingCry(void) { u16 species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES); - PlayCry3(species, -25, 5); + PlayCry_ByMode(species, -25, CRY_MODE_FAINT); PlayerBufferExecCompleted(); } diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index 91fea6cde..745354795 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -1763,7 +1763,7 @@ static void PlayerPartnerHandleFaintingCry(void) { u16 species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES); - PlayCry3(species, -25, 5); + PlayCry_ByMode(species, -25, CRY_MODE_FAINT); PlayerPartnerBufferExecCompleted(); } diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index c6e649508..0af395693 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -1621,7 +1621,7 @@ static void RecordedOpponentHandleFaintingCry(void) { u16 species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES); - PlayCry3(species, 25, 5); + PlayCry_ByMode(species, 25, CRY_MODE_FAINT); RecordedOpponentBufferExecCompleted(); } diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index 93d059fe9..264e27344 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -1644,7 +1644,7 @@ static void RecordedPlayerHandleFaintingCry(void) { u16 species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES); - PlayCry3(species, -25, 5); + PlayCry_ByMode(species, -25, CRY_MODE_FAINT); RecordedPlayerBufferExecCompleted(); } diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c index a26f31b92..78a57a0f7 100644 --- a/src/battle_controller_safari.c +++ b/src/battle_controller_safari.c @@ -616,7 +616,7 @@ static void SafariHandleFaintingCry(void) { u16 species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES); - PlayCry1(species, 25); + PlayCry_Normal(species, 25); SafariBufferExecCompleted(); } diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index d018fe1c0..29e8d2b7d 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -1415,7 +1415,9 @@ static void WallyHandleFaintingCry(void) { u16 species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES); - PlayCry1(species, 25); + // Seems that it doesn't bother using CRY_MODE_FAINT because + // Wally's Pokémon during the tutorial is never intended to faint. + PlayCry_Normal(species, 25); WallyBufferExecCompleted(); } diff --git a/src/contest_util.c b/src/contest_util.c index 37a5dedcd..6fd74a68a 100644 --- a/src/contest_util.c +++ b/src/contest_util.c @@ -1578,7 +1578,7 @@ static void SpriteCB_WinnerMonSlideIn(struct Sprite *sprite) { if (++sprite->data[0] == 10) { - PlayCry1(sprite->data[1], 0); + PlayCry_Normal(sprite->data[1], 0); sprite->data[1] = 0; } } diff --git a/src/crt0.s b/src/crt0.s index 672fc94f2..7c679c13b 100644 --- a/src/crt0.s +++ b/src/crt0.s @@ -1,108 +1,9 @@ -#include "constants/global.h" .include "constants/gba_constants.inc" .syntax unified - .global Start - - .text - .arm -Start: @ 8000000 - b Init - - .include "asm/rom_header.inc" - -@ 80000C0 - .word 0 - - .global GPIOPortData -GPIOPortData: @ 80000C4 - .2byte 0 - - .global GPIOPortDirection -GPIOPortDirection: @ 80000C6 - .2byte 0 - - .global GPIOPortReadEnable -GPIOPortReadEnable: @ 80000C8 - .2byte 0 - -@ 80000CA - .2byte 0 - -@ 80000CC - .space 0x34 - - .4byte GAME_VERSION - .4byte GAME_LANGUAGE - - .ascii "pokemon emerald version" - .space 9 - - .4byte gMonFrontPicTable - .4byte gMonBackPicTable - .4byte gMonPaletteTable - .4byte gMonShinyPaletteTable - .4byte gMonIconTable - .4byte gMonIconPaletteIndices - .4byte gMonIconPaletteTable - .4byte gSpeciesNames - .4byte gMoveNames - .4byte gDecorations - - .4byte 0x00001270 @ offsetof(struct SaveBlock1, flags) - .4byte 0x0000139c @ offsetof(struct SaveBlock1, vars) - .4byte 0x00000018 @ offsetof(struct SaveBlock2, pokedex) - .4byte 0x00000988 @ offsetof(struct SaveBlock1, seen1) - .4byte 0x00003b24 @ offsetof(struct SaveBlock1, seen2) - .4byte 0x00000046 @ ? - .4byte 0x000008e4 @ ? - .4byte 0x000008ac @ ? - .4byte 0x00000182 @ NATIONAL_DEX_COUNT? - - .byte 0x07, 0x0a, 0x0a, 0x0a, 0x0c, 0x0c, 0x06, 0x0c - .byte 0x06, 0x10, 0x12, 0x0c, 0x0f, 0x0b, 0x01, 0x08 - - .4byte 0x0000000c @ ? - .4byte 0x00000f2c @ sizeof(struct SaveBlock2) - .4byte 0x00003d88 @ sizeof(struct SaveBlock1) - .4byte 0x00000234 @ offsetof(struct SaveBlock1, playerPartyCount) - .4byte 0x00000238 @ offsetof(struct SaveBlock1, playerParty) - .4byte 0x00000009 @ offsetof(struct SaveBlock2, specialSaveWarpFlags) - .4byte 0x0000000a @ offsetof(struct SaveBlock2, playerTrainerId) - .4byte 0x00000000 @ offsetof(struct SaveBlock2, playerName) - .4byte 0x00000008 @ offsetof(struct SaveBlock2, playerGender) - .4byte 0x00000ca8 @ offsetof(struct SaveBlock2, frontier.challengeStatus) - .4byte 0x00000ca8 @ offsetof(struct SaveBlock2, frontier.challengeStatus) - .4byte 0x000031c7 @ offsetof(struct SaveBlock1, externalEventFlags) - .4byte 0x000031b3 @ offsetof(struct SaveBlock1, externalEventData) - .4byte 0x00000000 - - .4byte gBaseStats - .4byte gAbilityNames - .4byte gAbilityDescriptionPointers - .4byte gItems - .4byte gBattleMoves - .4byte gBallSpriteSheets - .4byte gBallSpritePalettes - - .4byte 0x000000a8 @ offsetof(struct SaveBlock2, gcnLinkFlags) - .4byte 0x00000864 @ ? - .4byte 0x0000089b @ ? - - .byte 0x1e, 0x1e, 0x10, 0x40 - - .4byte 0x0000322e @ offsetof(struct SaveBlock1, ? part-way into mysteryGift) - .4byte 0x00000498 @ offsetof(struct SaveBlock1, pcItems) - .4byte 0x000031a8 @ offsetof(struct SaveBlock1, giftRibbons) - .4byte 0x000031f8 @ offsetof(struct SaveBlock1, enigmaBerry) - .4byte 0x00000034 @ offsetof(struct SaveBlock1, mapView) - .4byte 0x00000000 - .4byte 0x00000000 - - .arm .align 2, 0 .global Init Init: @ 8000204 diff --git a/src/dodrio_berry_picking.c b/src/dodrio_berry_picking.c index 26e796cf6..691ca6b2a 100644 --- a/src/dodrio_berry_picking.c +++ b/src/dodrio_berry_picking.c @@ -3056,16 +3056,16 @@ static const u16 sDebug_BerryResults[MAX_RFU_PLAYERS][4] = }; static const u8 sJPText_Vowels[] = _("あいうえおかき"); -static const u8 sText_ABCDEFG[] = _("ABCDEFG"); -static const u8 sText_0123456[] = _("0123456"); +static const u8 sText_Letters[] = _("ABCDEFG"); +static const u8 sText_Digits[] = _("0123456"); static const u8 *const sDebug_PlayerNames[] = { sJPText_Vowels, sJPText_Vowels, sJPText_Vowels, - sText_ABCDEFG, - sText_0123456 + sText_Letters, + sText_Digits }; static void Debug_UpdateNumPlayers(void) diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 1d583343f..99ff26821 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -1094,7 +1094,7 @@ static void Task_TradeEvolutionScene(u8 taskId) case T_EVOSTATE_INTRO_CRY: if (!IsTextPrinterActive(0)) { - PlayCry1(gTasks[taskId].tPreEvoSpecies, 0); + PlayCry_Normal(gTasks[taskId].tPreEvoSpecies, 0); gTasks[taskId].tState++; } break; diff --git a/src/field_effect.c b/src/field_effect.c index 574bec879..3f0ba2455 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -2565,15 +2565,17 @@ bool8 FldEff_FieldMoveShowMon(void) return FALSE; } +#define SHOW_MON_CRY_NO_DUCKING (1 << 31) + bool8 FldEff_FieldMoveShowMonInit(void) { struct Pokemon *pokemon; - u32 flag = gFieldEffectArguments[0] & 0x80000000; + bool32 noDucking = gFieldEffectArguments[0] & SHOW_MON_CRY_NO_DUCKING; pokemon = &gPlayerParty[(u8)gFieldEffectArguments[0]]; gFieldEffectArguments[0] = GetMonData(pokemon, MON_DATA_SPECIES); gFieldEffectArguments[1] = GetMonData(pokemon, MON_DATA_OT_ID); gFieldEffectArguments[2] = GetMonData(pokemon, MON_DATA_PERSONALITY); - gFieldEffectArguments[0] |= flag; + gFieldEffectArguments[0] |= noDucking; FieldEffectStart(FLDEFF_FIELD_MOVE_SHOW_MON); FieldEffectActiveListRemove(FLDEFF_FIELD_MOVE_SHOW_MON_INIT); return FALSE; @@ -2913,17 +2915,17 @@ static bool8 SlideIndoorBannerOffscreen(struct Task *task) static u8 InitFieldMoveMonSprite(u32 species, u32 otId, u32 personality) { - u16 v0; + bool16 noDucking; u8 monSprite; struct Sprite *sprite; - v0 = (species & 0x80000000) >> 16; - species &= 0x7fffffff; + noDucking = (species & SHOW_MON_CRY_NO_DUCKING) >> 16; + species &= ~SHOW_MON_CRY_NO_DUCKING; monSprite = CreateMonSprite_FieldMove(species, otId, personality, 320, 80, 0); sprite = &gSprites[monSprite]; sprite->callback = SpriteCallbackDummy; sprite->oam.priority = 0; sprite->sSpecies = species; - sprite->data[6] = v0; + sprite->data[6] = noDucking; return monSprite; } @@ -2935,13 +2937,9 @@ static void SpriteCB_FieldMoveMonSlideOnscreen(struct Sprite *sprite) sprite->sOnscreenTimer = 30; sprite->callback = SpriteCB_FieldMoveMonWaitAfterCry; if (sprite->data[6]) - { - PlayCry2(sprite->sSpecies, 0, 0x7d, 0xa); - } + PlayCry_NormalNoDucking(sprite->sSpecies, 0, CRY_VOLUME_RS, CRY_PRIORITY_NORMAL); else - { - PlayCry1(sprite->sSpecies, 0); - } + PlayCry_Normal(sprite->sSpecies, 0); } } @@ -3021,7 +3019,7 @@ static void SurfFieldEffect_ShowMon(struct Task *task) objectEvent = &gObjectEvents[gPlayerAvatar.objectEventId]; if (ObjectEventCheckHeldMovementStatus(objectEvent)) { - gFieldEffectArguments[0] = task->tMonId | 0x80000000; + gFieldEffectArguments[0] = task->tMonId | SHOW_MON_CRY_NO_DUCKING; FieldEffectStart(FLDEFF_FIELD_MOVE_SHOW_MON_INIT); task->tState++; } diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index 8d53c9c65..d134f2265 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -982,7 +982,7 @@ static void Task_HofPC_PrintMonInfo(u8 taskId) if (currMon->species != SPECIES_EGG) { StopCryAndClearCrySongs(); - PlayCry1(currMon->species, 0); + PlayCry_Normal(currMon->species, 0); } HallOfFame_PrintMonInfo(currMon, 0, 14); diff --git a/src/intro.c b/src/intro.c index 0f044c642..418e143cf 100644 --- a/src/intro.c +++ b/src/intro.c @@ -1925,7 +1925,7 @@ static void Task_Scene3_Groudon(u8 taskId) tScreenX = 80; tScreenY = 41; tDelay = 16; - PlayCryInternal(SPECIES_GROUDON, 0, 100, 10, 0); + PlayCryInternal(SPECIES_GROUDON, 0, 100, CRY_PRIORITY_NORMAL, CRY_MODE_NORMAL); tState++; } break; @@ -2127,7 +2127,7 @@ static void Task_Scene3_Kyogre(u8 taskId) { tDelay = 1; tState++; - PlayCryInternal(SPECIES_KYOGRE, 0, 120, 10, 0); + PlayCryInternal(SPECIES_KYOGRE, 0, 120, CRY_PRIORITY_NORMAL, CRY_MODE_NORMAL); } } break; diff --git a/src/m4a_1.s b/src/m4a_1.s index 62b913c86..f71a5546e 100644 --- a/src/m4a_1.s +++ b/src/m4a_1.s @@ -302,7 +302,7 @@ _081DD044: ldrb r0, [r4, o_SoundChannel_type] tst r0, TONEDATA_TYPE_CMP | TONEDATA_TYPE_REV beq _081DD068 - bl sub_82DF49C + bl SoundMainRAM_Unk1 b _081DD228 _081DD068: mov r10, r10, lsl 16 @@ -465,8 +465,9 @@ _081DD25E: .pool thumb_func_end SoundMainRAM - arm_func_start sub_82DF49C -sub_82DF49C: +@ Not present in GBA SDK 3.0 + arm_func_start SoundMainRAM_Unk1 +SoundMainRAM_Unk1: ldr r6, [r4, o_SoundChannel_wav] ldrb r0, [r4, o_SoundChannel_statusFlags] tst r0, SOUND_CHANNEL_SF_SPECIAL @@ -505,10 +506,10 @@ _081DD2B4: ldrb r0, [r4, o_SoundChannel_type] tst r0, TONEDATA_TYPE_REV bne _081DD3C0 - bl sub_82DF758 + bl SoundMainRAM_Unk2 mov r0, r1 add r3, r3, 0x1 - bl sub_82DF758 + bl SoundMainRAM_Unk2 sub r1, r1, r0 _081DD308: ldr r6, [r5] @@ -534,11 +535,11 @@ _081DD310: b _081DD364 _081DD358: add r3, r3, lr - bl sub_82DF758 + bl SoundMainRAM_Unk2 mov r0, r1 _081DD364: add r3, r3, 0x1 - bl sub_82DF758 + bl SoundMainRAM_Unk2 sub r1, r1, r0 _081DD370: adds r5, r5, 0x40000000 @@ -565,10 +566,10 @@ _081DD3B0: b _081DD3B0 _081DD3C0: sub r3, r3, 0x1 - bl sub_82DF758 + bl SoundMainRAM_Unk2 mov r0, r1 sub r3, r3, 0x1 - bl sub_82DF758 + bl SoundMainRAM_Unk2 sub r1, r1, r0 _081DD3D8: ldr r6, [r5] @@ -594,11 +595,11 @@ _081DD3E0: b _081DD434 _081DD428: sub r3, r3, lr - bl sub_82DF758 + bl SoundMainRAM_Unk2 mov r0, r1 _081DD434: sub r3, r3, 0x1 - bl sub_82DF758 + bl SoundMainRAM_Unk2 sub r1, r1, r0 _081DD440: adds r5, r5, 0x40000000 @@ -663,10 +664,11 @@ _081DD4F4: str r7, [r5, 0x630] str r6, [r5], 0x4 pop {r8,r12,pc} - arm_func_end sub_82DF49C + arm_func_end SoundMainRAM_Unk1 - arm_func_start sub_82DF758 -sub_82DF758: +@ Not present in GBA SDK 3.0 + arm_func_start SoundMainRAM_Unk2 +SoundMainRAM_Unk2: push {r0,r2,r5-r7,lr} mov r0, r3, lsr 6 ldr r1, [r4, o_SoundChannel_xpi] @@ -704,7 +706,7 @@ _081DD594: ldrsb r1, [r5, r0] pop {r0,r2,r5-r7,pc} .pool - arm_func_end sub_82DF758 + arm_func_end SoundMainRAM_Unk2 thumb_func_start SoundMainBTM SoundMainBTM: diff --git a/src/overworld.c b/src/overworld.c index 9a5c41a7f..a44d3c050 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1254,7 +1254,7 @@ static void PlayAmbientCry(void) return; pan = (Random() % 88) + 212; volume = (Random() % 30) + 50; - PlayCry2(sAmbientCrySpecies, pan, volume, 1); + PlayCry_NormalNoDucking(sAmbientCrySpecies, pan, volume, CRY_PRIORITY_AMBIENT); } void UpdateAmbientCry(s16 *state, u16 *delayCounter) diff --git a/src/pokeball.c b/src/pokeball.c index 11f03eefe..a0800d38f 100644 --- a/src/pokeball.c +++ b/src/pokeball.c @@ -641,7 +641,7 @@ static void SpriteCB_BallThrow_Shake(struct Sprite *sprite) #define tCryTaskSpecies data[0] #define tCryTaskPan data[1] #define tCryTaskWantedCry data[2] -#define tCryTaskBattler data[3] +#define tCryTaskBattler data[3] #define tCryTaskMonSpriteId data[4] #define tCryTaskMonPtr1 data[5] #define tCryTaskMonPtr2 data[6] @@ -665,10 +665,11 @@ static void Task_PlayCryWhenReleasedFromBall(u8 taskId) gTasks[taskId].tCryTaskState = wantedCry + 1; break; case 1: + // Play single cry if (ShouldPlayNormalMonCry(mon) == TRUE) - PlayCry3(species, pan, 0); + PlayCry_ByMode(species, pan, CRY_MODE_NORMAL); else - PlayCry3(species, pan, 11); + PlayCry_ByMode(species, pan, CRY_MODE_WEAK); gBattleSpritesDataPtr->healthBoxesData[battlerId].waitForCry = FALSE; DestroyTask(taskId); break; @@ -680,10 +681,11 @@ static void Task_PlayCryWhenReleasedFromBall(u8 taskId) case 20: if (gTasks[taskId].tCryTaskFrames == 0) { + // Play first doubles cry if (ShouldPlayNormalMonCry(mon) == TRUE) - PlayCry4(species, pan, 1); + PlayCry_ReleaseDouble(species, pan, CRY_MODE_DOUBLES); else - PlayCry4(species, pan, 12); + PlayCry_ReleaseDouble(species, pan, CRY_MODE_WEAK_DOUBLES); gBattleSpritesDataPtr->healthBoxesData[battlerId].waitForCry = FALSE; DestroyTask(taskId); @@ -719,10 +721,11 @@ static void Task_PlayCryWhenReleasedFromBall(u8 taskId) gTasks[taskId].tCryTaskFrames--; break; } + // Play second doubles cry if (ShouldPlayNormalMonCry(mon) == TRUE) - PlayCry4(species, pan, 0); + PlayCry_ReleaseDouble(species, pan, CRY_MODE_NORMAL); else - PlayCry4(species, pan, 11); + PlayCry_ReleaseDouble(species, pan, CRY_MODE_WEAK); gBattleSpritesDataPtr->healthBoxesData[battlerId].waitForCry = FALSE; DestroyTask(taskId); diff --git a/src/pokeblock_feed.c b/src/pokeblock_feed.c index da9b7767c..98a76421c 100644 --- a/src/pokeblock_feed.c +++ b/src/pokeblock_feed.c @@ -945,7 +945,7 @@ static void SpriteCB_MonJumpForPokeblock(struct Sprite* sprite) // Play cry at jump peak if (sprite->sSpeed == 0) - PlayCry1(sprite->sSpecies, 0); + PlayCry_Normal(sprite->sSpecies, 0); if (sprite->sSpeed == 9) sprite->callback = SpriteCallbackDummy; diff --git a/src/pokedex.c b/src/pokedex.c index 58676b215..b41937302 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -3309,7 +3309,7 @@ static void Task_LoadInfoScreen(u8 taskId) if (!gTasks[taskId].tSkipCry) { StopCryAndClearCrySongs(); - PlayCry2(NationalPokedexNumToSpecies(sPokedexListItem->dexNum), 0, 125, 10); + PlayCry_NormalNoDucking(NationalPokedexNumToSpecies(sPokedexListItem->dexNum), 0, CRY_VOLUME_RS, CRY_PRIORITY_NORMAL); } else { @@ -4010,7 +4010,7 @@ static void Task_DisplayCaughtMonDexPage(u8 taskId) case 6: if (!gPaletteFade.active) { - PlayCry1(NationalPokedexNumToSpecies(dexNum), 0); + PlayCry_Normal(NationalPokedexNumToSpecies(dexNum), 0); gTasks[taskId].tPalTimer = 0; gTasks[taskId].func = Task_HandleCaughtMonPageInput; } diff --git a/src/pokedex_cry_screen.c b/src/pokedex_cry_screen.c index 4c9bfe15c..28e2bd163 100644 --- a/src/pokedex_cry_screen.c +++ b/src/pokedex_cry_screen.c @@ -345,7 +345,7 @@ void CryScreenPlayButton(u16 species) static void PlayCryScreenCry(u16 species) { - PlayCry2(species, 0, 125, 10); + PlayCry_NormalNoDucking(species, 0, CRY_VOLUME_RS, CRY_PRIORITY_NORMAL); sDexCryScreen->cryState = 1; } diff --git a/src/pokemon.c b/src/pokemon.c index 0f943734b..1607e1a40 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -6690,14 +6690,14 @@ void DoMonFrontSpriteAnimation(struct Sprite* sprite, u16 species, bool8 noCry, { // No animation, only check if cry needs to be played if (!noCry) - PlayCry1(species, pan); + PlayCry_Normal(species, pan); sprite->callback = SpriteCallbackDummy; } else { if (!noCry) { - PlayCry1(species, pan); + PlayCry_Normal(species, pan); if (HasTwoFramesAnimation(species)) StartSpriteAnim(sprite, 1); } diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 82c173413..c5aeb6b47 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -3929,9 +3929,9 @@ static void PlayMonCry(void) if (!summary->isEgg) { if (ShouldPlayNormalMonCry(&sMonSummaryScreen->currentMon) == TRUE) - PlayCry3(summary->species2, 0, 0); + PlayCry_ByMode(summary->species2, 0, CRY_MODE_NORMAL); else - PlayCry3(summary->species2, 0, 11); + PlayCry_ByMode(summary->species2, 0, CRY_MODE_WEAK); } } diff --git a/src/rayquaza_scene.c b/src/rayquaza_scene.c index 51498fa1d..634b0651a 100644 --- a/src/rayquaza_scene.c +++ b/src/rayquaza_scene.c @@ -3064,7 +3064,7 @@ static void SpriteCB_ChasesAway_Rayquaza(struct Sprite *sprite) ChasesAway_SetRayquazaAnim(sprite, 3, 48, 16); sprite->x2 = 1; gSprites[sprite->sTailSpriteId].x2 = 1; - PlayCry1(SPECIES_RAYQUAZA, 0); + PlayCry_Normal(SPECIES_RAYQUAZA, 0); CreateTask(Task_ChasesAway_AnimateRing, 0); } else diff --git a/src/rom_header.s b/src/rom_header.s new file mode 100644 index 000000000..5ed45124d --- /dev/null +++ b/src/rom_header.s @@ -0,0 +1,63 @@ +@ Note: ROM header data is empty space here. +@ It's populated by gbafix using data provided in the Makefile. + + .global Start +Start: @ 8000000 + b Init + + .global RomHeaderNintendoLogo +RomHeaderNintendoLogo: + .space 156 + +RomHeaderGameTitle: + .space 12 + + .global RomHeaderGameCode +RomHeaderGameCode: + .space 4 + +RomHeaderMakerCode: + .space 2 + +RomHeaderMagic: + .byte 0 + +RomHeaderMainUnitCode: + .byte 0 + +RomHeaderDeviceType: + .byte 0 + +RomHeaderReserved1: + .space 7 + + .global RomHeaderSoftwareVersion +RomHeaderSoftwareVersion: + .byte 0 + +RomHeaderChecksum: + .byte 0 + +RomHeaderReserved2: + .space 2 + +@ 80000C0 + .word 0 + + .global GPIOPortData +GPIOPortData: @ 80000C4 + .2byte 0 + + .global GPIOPortDirection +GPIOPortDirection: @ 80000C6 + .2byte 0 + + .global GPIOPortReadEnable +GPIOPortReadEnable: @ 80000C8 + .2byte 0 + +@ 80000CA + .2byte 0 + +@ 80000CC + .space 0x34 diff --git a/src/rom_header_gf.c b/src/rom_header_gf.c new file mode 100644 index 000000000..782a05c75 --- /dev/null +++ b/src/rom_header_gf.c @@ -0,0 +1,165 @@ +#include "global.h" +#include "data.h" +#include "pokemon_icon.h" +#include "decoration.h" +#include "battle_main.h" +#include "item.h" +#include "pokeball.h" + +struct GFRomHeader +{ + u32 version; + u32 language; + u8 gameName[32]; + const struct CompressedSpriteSheet * monFrontPics; + const struct CompressedSpriteSheet * monBackPics; + const struct CompressedSpritePalette * monNormalPalettes; + const struct CompressedSpritePalette * monShinyPalettes; + const u8 * const * monIcons; + const u8 * monIconPaletteIds; + const struct SpritePalette * monIconPalettes; + const u8 (* monSpeciesNames)[]; + const u8 (* moveNames)[]; + const struct Decoration * decorations; + u32 flagsOffset; + u32 varsOffset; + u32 pokedexOffset; + u32 seen1Offset; + u32 seen2Offset; + u32 pokedexVar; + u32 pokedexFlag; + u32 mysteryEventFlag; + u32 pokedexCount; + u8 unk1; + u8 unk2; + u8 unk3; + u8 unk4; + u8 unk5; + u8 unk6; + u8 unk7; + u8 unk8; + u8 unk9; + u8 unk10; + u8 unk11; + u8 unk12; + u8 unk13; + u8 unk14; + u8 unk15; + u8 unk16; + u8 unk17; + u32 saveBlock2Size; + u32 saveBlock1Size; + u32 partyCountOffset; + u32 partyOffset; + u32 warpFlagsOffset; + u32 trainerIdOffset; + u32 playerNameOffset; + u32 playerGenderOffset; + u32 frontierStatusOffset; + u32 frontierStatusOffset2; + u32 externalEventFlagsOffset; + u32 externalEventDataOffset; + u32 unk18; + const struct BaseStats * baseStats; + const u8 (* abilityNames)[]; + const u8 * const * abilityDescriptions; + const struct Item * items; + const struct BattleMove * moves; + const struct CompressedSpriteSheet * ballGfx; + const struct CompressedSpritePalette * ballPalettes; + u32 gcnLinkFlagsOffset; + u32 gameClearFlag; + u32 ribbonFlag; + u8 bagCountItems; + u8 bagCountKeyItems; + u8 bagCountPokeballs; + u8 bagCountTMHMs; + u8 bagCountBerries; + u8 pcItemsCount; + u32 pcItemsOffset; + u32 giftRibbonsOffset; + u32 enigmaBerryOffset; + u32 mapViewOffset; + u32 unk19; + u32 unk20; +}; + +// This seems to need to be in the text section for some reason. +// To avoid a changed section attributes warning it's put in a special .text.consts section. +__attribute__((section(".text.consts"))) +static const struct GFRomHeader sGFRomHeader = { + .version = GAME_VERSION, + .language = GAME_LANGUAGE, + .gameName = "pokemon emerald version", + .monFrontPics = gMonFrontPicTable, + .monBackPics = gMonBackPicTable, + .monNormalPalettes = gMonPaletteTable, + .monShinyPalettes = gMonShinyPaletteTable, + .monIcons = gMonIconTable, + .monIconPaletteIds = gMonIconPaletteIndices, + .monIconPalettes = gMonIconPaletteTable, + .monSpeciesNames = gSpeciesNames, + .moveNames = gMoveNames, + .decorations = gDecorations, + .flagsOffset = offsetof(struct SaveBlock1, flags), + .varsOffset = offsetof(struct SaveBlock1, vars), + .pokedexOffset = offsetof(struct SaveBlock2, pokedex), + .seen1Offset = offsetof(struct SaveBlock1, seen1), + .seen2Offset = offsetof(struct SaveBlock1, seen2), + .pokedexVar = VAR_NATIONAL_DEX - VARS_START, + .pokedexFlag = FLAG_RECEIVED_POKEDEX_FROM_BIRCH, + .mysteryEventFlag = FLAG_SYS_MYSTERY_EVENT_ENABLE, + .pokedexCount = NATIONAL_DEX_COUNT, + .unk1 = 0x07, + .unk2 = 0x0a, + .unk3 = 0x0a, + .unk4 = 0x0a, + .unk5 = 0x0c, + .unk6 = 0x0c, + .unk7 = 0x06, + .unk8 = 0x0c, + .unk9 = 0x06, + .unk10 = 0x10, + .unk11 = 0x12, + .unk12 = 0x0c, + .unk13 = 0x0f, + .unk14 = 0x0b, + .unk15 = 0x01, + .unk16 = 0x08, + .unk17 = 0x0c, + .saveBlock2Size = sizeof(struct SaveBlock2), + .saveBlock1Size = sizeof(struct SaveBlock1), + .partyCountOffset = offsetof(struct SaveBlock1, playerPartyCount), + .partyOffset = offsetof(struct SaveBlock1, playerParty), + .warpFlagsOffset = offsetof(struct SaveBlock2, specialSaveWarpFlags), + .trainerIdOffset = offsetof(struct SaveBlock2, playerTrainerId), + .playerNameOffset = offsetof(struct SaveBlock2, playerName), + .playerGenderOffset = offsetof(struct SaveBlock2, playerGender), + .frontierStatusOffset = offsetof(struct SaveBlock2, frontier.challengeStatus), + .frontierStatusOffset2 = offsetof(struct SaveBlock2, frontier.challengeStatus), + .externalEventFlagsOffset = offsetof(struct SaveBlock1, externalEventFlags), + .externalEventDataOffset = offsetof(struct SaveBlock1, externalEventData), + .unk18 = 0x00000000, + .baseStats = gBaseStats, + .abilityNames = gAbilityNames, + .abilityDescriptions = gAbilityDescriptionPointers, + .items = gItems, + .moves = gBattleMoves, + .ballGfx = gBallSpriteSheets, + .ballPalettes = gBallSpritePalettes, + .gcnLinkFlagsOffset = offsetof(struct SaveBlock2, gcnLinkFlags), + .gameClearFlag = FLAG_SYS_GAME_CLEAR, + .ribbonFlag = FLAG_SYS_RIBBON_GET, + .bagCountItems = BAG_ITEMS_COUNT, + .bagCountKeyItems = BAG_KEYITEMS_COUNT, + .bagCountPokeballs = BAG_POKEBALLS_COUNT, + .bagCountTMHMs = BAG_TMHM_COUNT, + .bagCountBerries = BAG_BERRIES_COUNT, + .pcItemsCount = PC_ITEMS_COUNT, + .pcItemsOffset = offsetof(struct SaveBlock1, pcItems), + .giftRibbonsOffset = offsetof(struct SaveBlock1, giftRibbons), + .enigmaBerryOffset = offsetof(struct SaveBlock1, enigmaBerry), + .mapViewOffset = offsetof(struct SaveBlock1, mapView), + .unk19 = 0x00000000, + .unk20 = 0x00000000, // 0xFFFFFFFF in FRLG +}; diff --git a/src/roulette.c b/src/roulette.c index ac4212d47..5b870fb60 100644 --- a/src/roulette.c +++ b/src/roulette.c @@ -4449,13 +4449,13 @@ static void SetBallStuck(struct Sprite *sprite) if (sRoulette->useTaillow) { if (sprite->sStuckOnWheelLeft) - PlayCry1(SPECIES_TAILLOW, -63); + PlayCry_Normal(SPECIES_TAILLOW, -63); else - PlayCry1(SPECIES_TAILLOW, 63); + PlayCry_Normal(SPECIES_TAILLOW, 63); } else { - PlayCry1(SPECIES_SHROOMISH, -63); + PlayCry_Normal(SPECIES_SHROOMISH, -63); } slotsToSkip = 2; @@ -4719,9 +4719,9 @@ static void SpriteCB_Taillow_FlyIn(struct Sprite *sprite) { m4aSongNumStartOrChange(SE_TAILLOW_WING_FLAP); if (sRoulette->ball->sStuckOnWheelLeft == 0) - PlayCry1(SPECIES_TAILLOW, 63); + PlayCry_Normal(SPECIES_TAILLOW, 63); else - PlayCry1(SPECIES_TAILLOW, -63); + PlayCry_Normal(SPECIES_TAILLOW, -63); StartSpriteAnim(sprite, sRoulette->ball->sStuckOnWheelLeft + 2); sprite->data[1] = 45; sprite->callback = SpriteCB_Taillow_PickUpBall; diff --git a/src/scrcmd.c b/src/scrcmd.c index 144712860..6007fb493 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -2027,7 +2027,7 @@ bool8 ScrCmd_playmoncry(struct ScriptContext *ctx) u16 species = VarGet(ScriptReadHalfword(ctx)); u16 mode = VarGet(ScriptReadHalfword(ctx)); - PlayCry5(species, mode); + PlayCry_Script(species, mode); return FALSE; } diff --git a/src/sound.c b/src/sound.c index 8c3cd3997..ad9993b54 100644 --- a/src/sound.c +++ b/src/sound.c @@ -26,7 +26,7 @@ static u16 sFanfareCounter; bool8 gDisableMusic; extern struct ToneData gCryTable[]; -extern struct ToneData gCryTable2[]; +extern struct ToneData gCryTable_Reverse[]; static void Task_Fanfare(u8 taskId); static void CreateFanfareTask(void); @@ -54,8 +54,6 @@ static const struct Fanfare sFanfares[] = { [FANFARE_REGISTER_MATCH_CALL] = { MUS_REGISTER_MATCH_CALL, 135 }, }; -#define CRY_VOLUME 120 // was 125 in R/S - void InitMapMusic(void) { gDisableMusic = FALSE; @@ -300,73 +298,76 @@ bool8 IsBGMStopped(void) return FALSE; } -void PlayCry1(u16 species, s8 pan) +void PlayCry_Normal(u16 species, s8 pan) { m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 85); - PlayCryInternal(species, pan, CRY_VOLUME, 10, 0); + PlayCryInternal(species, pan, CRY_VOLUME, CRY_PRIORITY_NORMAL, CRY_MODE_NORMAL); gPokemonCryBGMDuckingCounter = 2; RestoreBGMVolumeAfterPokemonCry(); } -void PlayCry2(u16 species, s8 pan, s8 volume, u8 priority) +void PlayCry_NormalNoDucking(u16 species, s8 pan, s8 volume, u8 priority) { - PlayCryInternal(species, pan, volume, priority, 0); + PlayCryInternal(species, pan, volume, priority, CRY_MODE_NORMAL); } -void PlayCry3(u16 species, s8 pan, u8 mode) +// Assuming it's not CRY_MODE_DOUBLES, this is equivalent to PlayCry_Normal except it allows other modes. +void PlayCry_ByMode(u16 species, s8 pan, u8 mode) { - if (mode == 1) + if (mode == CRY_MODE_DOUBLES) { - PlayCryInternal(species, pan, CRY_VOLUME, 10, 1); + PlayCryInternal(species, pan, CRY_VOLUME, CRY_PRIORITY_NORMAL, mode); } else { m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 85); - PlayCryInternal(species, pan, CRY_VOLUME, 10, mode); + PlayCryInternal(species, pan, CRY_VOLUME, CRY_PRIORITY_NORMAL, mode); gPokemonCryBGMDuckingCounter = 2; RestoreBGMVolumeAfterPokemonCry(); } } -void PlayCry4(u16 species, s8 pan, u8 mode) +// Used when releasing multiple Pokémon at once in battle. +void PlayCry_ReleaseDouble(u16 species, s8 pan, u8 mode) { - if (mode == 1) + if (mode == CRY_MODE_DOUBLES) { - PlayCryInternal(species, pan, CRY_VOLUME, 10, 1); + PlayCryInternal(species, pan, CRY_VOLUME, CRY_PRIORITY_NORMAL, mode); } else { if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI)) m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 85); - PlayCryInternal(species, pan, CRY_VOLUME, 10, mode); + PlayCryInternal(species, pan, CRY_VOLUME, CRY_PRIORITY_NORMAL, mode); } } -void PlayCry6(u16 species, s8 pan, u8 mode) // not present in R/S +// Duck the BGM but don't restore it. Not present in R/S +void PlayCry_DuckNoRestore(u16 species, s8 pan, u8 mode) { - if (mode == 1) + if (mode == CRY_MODE_DOUBLES) { - PlayCryInternal(species, pan, CRY_VOLUME, 10, 1); + PlayCryInternal(species, pan, CRY_VOLUME, CRY_PRIORITY_NORMAL, mode); } else { m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 85); - PlayCryInternal(species, pan, CRY_VOLUME, 10, mode); + PlayCryInternal(species, pan, CRY_VOLUME, CRY_PRIORITY_NORMAL, mode); gPokemonCryBGMDuckingCounter = 2; } } -void PlayCry5(u16 species, u8 mode) +void PlayCry_Script(u16 species, u8 mode) { m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 85); - PlayCryInternal(species, 0, CRY_VOLUME, 10, mode); + PlayCryInternal(species, 0, CRY_VOLUME, CRY_PRIORITY_NORMAL, mode); gPokemonCryBGMDuckingCounter = 2; RestoreBGMVolumeAfterPokemonCry(); } void PlayCryInternal(u16 species, s8 pan, s8 volume, u8 priority, u8 mode) { - bool32 v0; + bool32 reverse; u32 release; u32 length; u32 pitch; @@ -375,76 +376,80 @@ void PlayCryInternal(u16 species, s8 pan, s8 volume, u8 priority, u8 mode) u8 table; species--; + + // Set default values + // May be overridden depending on mode. length = 140; - v0 = FALSE; + reverse = FALSE; release = 0; pitch = 15360; chorus = 0; switch (mode) { - case 0: + case CRY_MODE_NORMAL: break; - case 1: + case CRY_MODE_DOUBLES: length = 20; release = 225; break; - case 2: + case CRY_MODE_ENCOUNTER: release = 225; pitch = 15600; chorus = 20; volume = 90; break; - case 3: + case CRY_MODE_HIGH_PITCH: length = 50; release = 200; pitch = 15800; chorus = 20; volume = 90; break; - case 4: + case CRY_MODE_ECHO_START: length = 25; - v0 = TRUE; + reverse = TRUE; release = 100; pitch = 15600; chorus = 192; volume = 90; break; - case 5: + case CRY_MODE_FAINT: release = 200; pitch = 14440; break; - case 6: + case CRY_MODE_ECHO_END: release = 220; pitch = 15555; chorus = 192; volume = 70; break; - case 7: + case CRY_MODE_ROAR_1: length = 10; release = 100; pitch = 14848; break; - case 8: + case CRY_MODE_ROAR_2: length = 60; release = 225; pitch = 15616; break; - case 9: + case CRY_MODE_GROWL_1: length = 15; - v0 = TRUE; + reverse = TRUE; release = 125; pitch = 15200; break; - case 10: + case CRY_MODE_GROWL_2: length = 100; release = 225; pitch = 15200; break; - case 12: + case CRY_MODE_WEAK_DOUBLES: length = 20; release = 225; - case 11: + // fallthrough + case CRY_MODE_WEAK: pitch = 15000; break; } @@ -463,28 +468,29 @@ void PlayCryInternal(u16 species, s8 pan, s8 volume, u8 priority, u8 mode) // If you wish to expand pokemon, you need to // append new cases to the switch. species = SpeciesToCryId(species); - index = species & 0x7F; + index = species % 128; table = species / 128; + #define GET_CRY(speciesIndex, tableId, reversed) \ + ((reversed) ? &gCryTable_Reverse[(128 * (tableId)) + (speciesIndex)] : &gCryTable[(128 * (tableId)) + (speciesIndex)]) + switch (table) { case 0: - gMPlay_PokemonCry = SetPokemonCryTone( - v0 ? &gCryTable2[(128 * 0) + index] : &gCryTable[(128 * 0) + index]); + gMPlay_PokemonCry = SetPokemonCryTone(GET_CRY(index, 0, reverse)); break; case 1: - gMPlay_PokemonCry = SetPokemonCryTone( - v0 ? &gCryTable2[(128 * 1) + index] : &gCryTable[(128 * 1) + index]); + gMPlay_PokemonCry = SetPokemonCryTone(GET_CRY(index, 1, reverse)); break; case 2: - gMPlay_PokemonCry = SetPokemonCryTone( - v0 ? &gCryTable2[(128 * 2) + index] : &gCryTable[(128 * 2) + index]); + gMPlay_PokemonCry = SetPokemonCryTone(GET_CRY(index, 2, reverse)); break; case 3: - gMPlay_PokemonCry = SetPokemonCryTone( - v0 ? &gCryTable2[(128 * 3) + index] : &gCryTable[(128 * 3) + index]); + gMPlay_PokemonCry = SetPokemonCryTone(GET_CRY(index, 3, reverse)); break; } + + #undef GET_CRY } bool8 IsCryFinished(void) diff --git a/src/starter_choose.c b/src/starter_choose.c index 403964684..ca393c4d8 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -532,7 +532,7 @@ static void Task_WaitForStarterSprite(u8 taskId) static void Task_AskConfirmStarter(u8 taskId) { - PlayCry1(GetStarterPokemon(gTasks[taskId].tStarterSelection), 0); + PlayCry_Normal(GetStarterPokemon(gTasks[taskId].tStarterSelection), 0); FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized(0, FONT_NORMAL, gText_ConfirmStarterChoice, 0, 1, 0, NULL); ScheduleBgCopyTilemapToVram(0); diff --git a/src/trade.c b/src/trade.c index 6e76506cd..a1e4f7094 100644 --- a/src/trade.c +++ b/src/trade.c @@ -3398,7 +3398,7 @@ static bool8 AnimateTradeSequenceCable(void) DrawTextOnTradeWindow(0, gStringVar4, 0); if (sTradeData->monSpecies[TRADE_PLAYER] != SPECIES_EGG) - PlayCry1(sTradeData->monSpecies[TRADE_PLAYER], 0); + PlayCry_Normal(sTradeData->monSpecies[TRADE_PLAYER], 0); sTradeData->state = TS_STATE_BYE_BYE; sTradeData->timer = 0; @@ -3869,7 +3869,7 @@ static bool8 AnimateTradeSequenceWireless(void) DrawTextOnTradeWindow(0, gStringVar4, 0); if (sTradeData->monSpecies[TRADE_PLAYER] != SPECIES_EGG) - PlayCry1(sTradeData->monSpecies[TRADE_PLAYER], 0); + PlayCry_Normal(sTradeData->monSpecies[TRADE_PLAYER], 0); sTradeData->state = TS_STATE_BYE_BYE; sTradeData->timer = 0; |