diff options
Diffstat (limited to 'src')
200 files changed, 13454 insertions, 5696 deletions
diff --git a/src/battle/anim/alert.c b/src/battle/anim/alert.c index 538008be0..7cd42c17b 100755 --- a/src/battle/anim/alert.c +++ b/src/battle/anim/alert.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // alert (red thunder from the sides of a Pokemon, simulating more alert behavior.) // Used in Kinesis. @@ -16,7 +16,7 @@ void sub_80CF610(struct Sprite* sprite) sub_8078650(sprite); sub_807867C(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; - if (GetBankSide(gBattleAnimBankAttacker) != 0) + if (GetBankSide(gAnimBankAttacker) != 0) { sprite->hFlip = 1; if (gBattleAnimArgs[2] != 0) @@ -29,5 +29,5 @@ void sub_80CF610(struct Sprite* sprite) } sprite->callback = sub_8078600; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); } diff --git a/src/battle/anim/angel.c b/src/battle/anim/angel.c index 916ebfdfd..5ec083887 100755 --- a/src/battle/anim/angel.c +++ b/src/battle/anim/angel.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // angel (a little angel descends from somewhere towards a position) // Used in Sweet Kiss. @@ -33,5 +33,5 @@ void sub_80D2938(struct Sprite* sprite) } if (sprite->data[0] > 0x64) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } diff --git a/src/battle/anim/angel_kiss.c b/src/battle/anim/angel_kiss.c index 453c4d802..d5be6e2af 100755 --- a/src/battle/anim/angel_kiss.c +++ b/src/battle/anim/angel_kiss.c @@ -6,8 +6,8 @@ #include "random.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // angel_kiss (a different variation of kiss_fountain.) // Used in Sweet Kiss. @@ -22,7 +22,7 @@ void sub_80D29CC(struct Sprite* sprite) sprite->invisible = sprite->data[5] % 2; if (sprite->data[5] > 30) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } void sub_80D2A38(struct Sprite* sprite) @@ -62,7 +62,7 @@ void sub_80D2A38(struct Sprite* sprite) sprite->pos1.x += gBattleAnimArgs[0]; sprite->pos1.y += gBattleAnimArgs[1]; StartSpriteAnim(sprite, 0); - sprite->subpriority = sub_8079E90(gBattleAnimBankTarget) - 1; + sprite->subpriority = sub_8079E90(gAnimBankTarget) - 1; sprite->data[2] = 1; } diff --git a/src/battle/anim/anger.c b/src/battle/anim/anger.c index 8962e0855..011aa68ce 100755 --- a/src/battle/anim/anger.c +++ b/src/battle/anim/anger.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // anger (anger emotes, usually above the Pokemon's head, indicating annoyed emotions.) // Used in Frustration, Rage, Swagger, Torment, and Taunt. @@ -15,17 +15,17 @@ void sub_80D09C0(struct Sprite* sprite) { u8 bank; if (gBattleAnimArgs[0] == 0) - bank = gBattleAnimBankAttacker; + bank = gAnimBankAttacker; else - bank = gBattleAnimBankTarget; + bank = gAnimBankTarget; if (GetBankSide(bank) == 1) { gBattleAnimArgs[1] *= -1; } - sprite->pos1.x = sub_8077ABC(bank, 2) + gBattleAnimArgs[1]; - sprite->pos1.y = sub_8077ABC(bank, 3) + gBattleAnimArgs[2]; + sprite->pos1.x = GetBankPosition(bank, 2) + gBattleAnimArgs[1]; + sprite->pos1.y = GetBankPosition(bank, 3) + gBattleAnimArgs[2]; if (sprite->pos1.y <= 7) sprite->pos1.y = 8; diff --git a/src/battle/anim/aurora.c b/src/battle/anim/aurora.c index 1ca5e649f..90fa5c879 100644 --- a/src/battle/anim/aurora.c +++ b/src/battle/anim/aurora.c @@ -6,8 +6,8 @@ #include "task.h" extern s16 gBattleAnimArgs[8]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80D344C(struct Sprite *); static void sub_80D34D4(u8); @@ -17,15 +17,15 @@ void sub_80D33B4(struct Sprite *sprite) s16 r6; sub_80787B0(sprite, 1); - if (GetBankSide(gBattleAnimBankAttacker) != 0) + if (GetBankSide(gAnimBankAttacker) != 0) r6 = -gBattleAnimArgs[2]; else r6 = gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[4]; sprite->data[1] = sprite->pos1.x; - sprite->data[2] = sub_8077ABC(gBattleAnimBankTarget, 2) + r6; + sprite->data[2] = GetBankPosition(gAnimBankTarget, 2) + r6; sprite->data[3] = sprite->pos1.y; - sprite->data[4] = sub_8077ABC(gBattleAnimBankTarget, 3) + gBattleAnimArgs[3]; + sprite->data[4] = GetBankPosition(gAnimBankTarget, 3) + gBattleAnimArgs[3]; obj_translate_based_on_private_1_2_3_4(sprite); sprite->callback = sub_80D344C; sprite->affineAnimPaused = TRUE; @@ -40,7 +40,7 @@ static void sub_80D344C(struct Sprite *sprite) sprite->affineAnimPaused = FALSE; } if (sub_8078B5C(sprite) != 0) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } void sub_80D3490(u8 taskId) diff --git a/src/battle/anim/beta_beat_up.c b/src/battle/anim/beta_beat_up.c index 499e52a80..3af6dd926 100644 --- a/src/battle/anim/beta_beat_up.c +++ b/src/battle/anim/beta_beat_up.c @@ -4,8 +4,8 @@ #include "trig.h" extern s16 gBattleAnimArgs[8]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80D6278(struct Sprite *); @@ -13,7 +13,7 @@ static void sub_80D6278(struct Sprite *); void sub_80D6234(struct Sprite *sprite) { - if (GetBankSide(gBattleAnimBankAttacker) != 0) + if (GetBankSide(gAnimBankAttacker) != 0) { sprite->pos1.x -= gBattleAnimArgs[0]; } diff --git a/src/battle/anim/blow_kiss.c b/src/battle/anim/blow_kiss.c index e63f7189d..e7b49471d 100755 --- a/src/battle/anim/blow_kiss.c +++ b/src/battle/anim/blow_kiss.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80D1FA4(struct Sprite* sprite); @@ -18,9 +18,9 @@ void sub_80D1F58(struct Sprite* sprite) sub_80787B0(sprite, 1); sprite->data[0] = 0x5F; sprite->data[1] = sprite->pos1.x; - sprite->data[2] = sub_8077ABC(gBattleAnimBankTarget, 2); + sprite->data[2] = GetBankPosition(gAnimBankTarget, 2); sprite->data[3] = sprite->pos1.y; - sprite->data[4] = sub_8077ABC(gBattleAnimBankTarget, 3); + sprite->data[4] = GetBankPosition(gAnimBankTarget, 3); obj_translate_based_on_private_1_2_3_4(sprite); sprite->callback = sub_80D1FA4; } @@ -34,6 +34,6 @@ void sub_80D1FA4(struct Sprite* sprite) } else { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } diff --git a/src/battle/anim/bottle.c b/src/battle/anim/bottle.c index ac5e51881..5485bcf5d 100755 --- a/src/battle/anim/bottle.c +++ b/src/battle/anim/bottle.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CCF70(struct Sprite* sprite); static void sub_80CD0CC(struct Sprite* sprite, int unk1, int unk2); @@ -16,8 +16,8 @@ static void sub_80CD0CC(struct Sprite* sprite, int unk1, int unk2); void sub_80CCF04(struct Sprite* sprite) { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankTarget, 2); - sprite->pos1.y = sub_8077ABC(gBattleAnimBankTarget, 3) + 0xFFE8; + sprite->pos1.x = GetBankPosition(gAnimBankTarget, 2); + sprite->pos1.y = GetBankPosition(gAnimBankTarget, 3) + 0xFFE8; sprite->data[0] = 0; sprite->data[1] = 0; sprite->data[2] = 0; @@ -98,7 +98,7 @@ void sub_80CCF70(struct Sprite* sprite) case 4: REG_BLDCNT = 0; REG_BLDALPHA = 0; - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); break; } } diff --git a/src/battle/anim/brace.c b/src/battle/anim/brace.c index 7b084efbb..19ea4297b 100755 --- a/src/battle/anim/brace.c +++ b/src/battle/anim/brace.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CDF70(struct Sprite* sprite); @@ -17,13 +17,13 @@ void sub_80CDF0C(struct Sprite* sprite) { if (gBattleAnimArgs[0] == 0) { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 0) + gBattleAnimArgs[1]; - sprite->pos1.y = sub_8077ABC(gBattleAnimBankAttacker, 1) + gBattleAnimArgs[2]; + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 0) + gBattleAnimArgs[1]; + sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 1) + gBattleAnimArgs[2]; } else { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankTarget, 0) + gBattleAnimArgs[1]; - sprite->pos1.y = sub_8077ABC(gBattleAnimBankTarget, 1) + gBattleAnimArgs[2]; + sprite->pos1.x = GetBankPosition(gAnimBankTarget, 0) + gBattleAnimArgs[1]; + sprite->pos1.y = GetBankPosition(gAnimBankTarget, 1) + gBattleAnimArgs[2]; } sprite->data[0] = 0; @@ -41,5 +41,5 @@ void sub_80CDF70(struct Sprite* sprite) sprite->pos1.y -= sprite->data[0]; if (sprite->animEnded) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } diff --git a/src/battle/anim/breath.c b/src/battle/anim/breath.c index 0fcc7fa08..831b222ad 100755 --- a/src/battle/anim/breath.c +++ b/src/battle/anim/breath.c @@ -5,32 +5,32 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // breath (a puff of smoke, usually from the mouth or nose of the Pokemon.) // Used in Swagger and Bulk Up. void sub_80D0930(struct Sprite* sprite) { - if (GetBankSide(gBattleAnimBankAttacker) == 0) + if (GetBankSide(gAnimBankAttacker) == 0) { StartSpriteAnim(sprite, 0); - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 2) + 32; + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2) + 32; sprite->data[1] = 0x40; } else { StartSpriteAnim(sprite, 1); - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 2) - 32; + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2) - 32; sprite->data[1] = -0x40; } - sprite->pos1.y = sub_8077ABC(gBattleAnimBankAttacker, 3); + sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 3); sprite->data[0] = 0x34; sprite->data[2] = 0; sprite->data[3] = 0; sprite->data[4] = 0; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); sprite->callback = sub_8078394; } diff --git a/src/battle/anim/bubble.c b/src/battle/anim/bubble.c index 5da0d9929..403003ce3 100644 --- a/src/battle/anim/bubble.c +++ b/src/battle/anim/bubble.c @@ -5,8 +5,8 @@ #include "util.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80D32E8(struct Sprite *sprite); static void sub_80D3370(struct Sprite *sprite); @@ -19,29 +19,29 @@ void sub_80D31C8(struct Sprite* sprite) { u8 newSpriteId; - if (GetBankSide(gBattleAnimBankAttacker) != 0) + if (GetBankSide(gAnimBankAttacker) != 0) { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 2) - gBattleAnimArgs[0]; - sprite->pos1.y = sub_8077ABC(gBattleAnimBankAttacker, 3) + gBattleAnimArgs[1]; + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2) - gBattleAnimArgs[0]; + sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 3) + gBattleAnimArgs[1]; } else { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 2) + gBattleAnimArgs[0]; - sprite->pos1.y = sub_8077ABC(gBattleAnimBankAttacker, 3) + gBattleAnimArgs[1]; + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2) + gBattleAnimArgs[0]; + sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 3) + gBattleAnimArgs[1]; } sprite->animPaused = 1; - if (GetBankSide(gBattleAnimBankAttacker) != 0) + if (GetBankSide(gAnimBankAttacker) != 0) { gBattleAnimArgs[2] = -gBattleAnimArgs[2]; } sprite->data[0] = gBattleAnimArgs[6]; sprite->data[1] = sprite->pos1.x; - sprite->data[2] = sub_8077ABC(gBattleAnimBankTarget, 2); + sprite->data[2] = GetBankPosition(gAnimBankTarget, 2); sprite->data[3] = sprite->pos1.y; - sprite->data[4] = sub_8077ABC(gBattleAnimBankTarget, 3); + sprite->data[4] = GetBankPosition(gAnimBankTarget, 3); obj_translate_based_on_private_1_2_3_4(sprite); diff --git a/src/battle/anim/bullet.c b/src/battle/anim/bullet.c index 11306873a..90b2021f1 100755 --- a/src/battle/anim/bullet.c +++ b/src/battle/anim/bullet.c @@ -6,8 +6,8 @@ #include "random.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80D0030(struct Sprite* sprite); static void sub_80D00B4(struct Sprite* sprite); @@ -19,8 +19,8 @@ void sub_80CFFD8(struct Sprite* sprite) { sub_80787B0(sprite, 1); sprite->data[0] = 20; - sprite->data[2] = sub_8077ABC(gBattleAnimBankTarget, 2); - sprite->data[4] = sub_8077ABC(gBattleAnimBankTarget, 3); + sprite->data[2] = GetBankPosition(gAnimBankTarget, 2); + sprite->data[4] = GetBankPosition(gAnimBankTarget, 3); sprite->callback = sub_8078B34; sprite->affineAnimPaused = 1; StoreSpriteCallbackInData(sprite, sub_80D0030); @@ -31,7 +31,7 @@ void sub_80D0030(struct Sprite* sprite) int i; u16 rand; s16* ptr; - PlaySE12WithPanning(0xA6, sub_8076F98(0x3F)); + PlaySE12WithPanning(0xA6, BattleAnimAdjustPanning(0x3F)); sprite->pos1.x += sprite->pos2.x; sprite->pos1.y += sprite->pos2.y; sprite->pos2.y = 0; @@ -64,6 +64,6 @@ void sub_80D00B4(struct Sprite* sprite) sprite->data[1] = 0; sprite->data[2] /= 2; if (++sprite->data[3] == 1) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } diff --git a/src/battle/anim/copy_orb.c b/src/battle/anim/copy_orb.c index 96d2910f0..4fa8ea163 100755 --- a/src/battle/anim/copy_orb.c +++ b/src/battle/anim/copy_orb.c @@ -4,8 +4,8 @@ #include "battle_anim.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // copy_orb // Used in Mimic. @@ -16,14 +16,14 @@ void sub_80CB4CC(struct Sprite* sprite) { case 0: { - if (GetBankSide(gBattleAnimBankTarget) == 0) + if (GetBankSide(gAnimBankTarget) == 0) { s16 a = gBattleAnimArgs[0]; gBattleAnimArgs[0] = -a; } - sprite->pos1.x = sub_8077ABC(gBattleAnimBankTarget, 0) + gBattleAnimArgs[0]; - sprite->pos1.y = sub_8077ABC(gBattleAnimBankTarget, 1) + gBattleAnimArgs[1]; + sprite->pos1.x = GetBankPosition(gAnimBankTarget, 0) + gBattleAnimArgs[0]; + sprite->pos1.y = GetBankPosition(gAnimBankTarget, 1) + gBattleAnimArgs[1]; sprite->invisible = 1; sprite->data[0]++; break; @@ -35,10 +35,10 @@ void sub_80CB4CC(struct Sprite* sprite) { ChangeSpriteAffineAnim(sprite, 1); sprite->data[0] = 25; - sprite->data[2] = sub_8077ABC(gBattleAnimBankAttacker, 2); - sprite->data[4] = sub_8077ABC(gBattleAnimBankAttacker, 3); + sprite->data[2] = GetBankPosition(gAnimBankAttacker, 2); + sprite->data[4] = GetBankPosition(gAnimBankAttacker, 3); sprite->callback = sub_8078CC0; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); break; } } diff --git a/src/battle/anim/cube.c b/src/battle/anim/cube.c index 07b3ea517..9adf46e32 100755 --- a/src/battle/anim/cube.c +++ b/src/battle/anim/cube.c @@ -6,8 +6,8 @@ #include "constants/songs.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CE000(struct Sprite* sprite); @@ -16,14 +16,14 @@ static void sub_80CE000(struct Sprite* sprite); void sub_80CDFB0(struct Sprite* sprite) { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 2); - sprite->pos1.y = sub_8077ABC(gBattleAnimBankAttacker, 3) - 12; + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2); + sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 3) - 12; sprite->data[0] = 0; sprite->data[1] = 2; sprite->data[2] = 0; sprite->data[3] = 0; sprite->data[4] = 0; - sprite->data[5] = sub_8076F98(-0x40); + sprite->data[5] = BattleAnimAdjustPanning(-0x40); sprite->callback = sub_80CE000; } @@ -48,5 +48,5 @@ void sub_80CE000(struct Sprite* sprite) } if (sprite->animEnded && sprite->data[1] > 16 && sprite->invisible) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } diff --git a/src/battle/anim/curtain.c b/src/battle/anim/curtain.c index 1f34cb173..3c9e4e84c 100755 --- a/src/battle/anim/curtain.c +++ b/src/battle/anim/curtain.c @@ -6,11 +6,11 @@ #include "palette.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; -extern u16 gUnknown_03004240; -extern u16 gUnknown_030042C4; +extern u16 gBattle_WIN0V; +extern u16 gBattle_WIN0H; static void sub_80D1D48(u8 taskId); static void sub_80D1D9C(u8 taskId); @@ -21,7 +21,7 @@ static void sub_80D1D9C(u8 taskId); void sub_80D1CD0(u8 taskId) { int zero; - bool8 result = NotInBattle(); + bool8 result = IsContest(); u16 var = 0xF0; if (result) { @@ -33,8 +33,8 @@ void sub_80D1CD0(u8 taskId) zero = 0; } - gUnknown_030042C4 = var; - gUnknown_03004240 = 0xA0; + gBattle_WIN0H = var; + gBattle_WIN0V = 0xA0; REG_WIN0H = var; REG_WIN0V = 0xA0; REG_WININ = 0x3F1F; @@ -52,12 +52,12 @@ void sub_80D1D48(u8 taskId) gTasks[taskId].data[1] -= 13; if (gTasks[taskId].data[0] >= gTasks[taskId].data[1]) { - gUnknown_030042C4 = 0; + gBattle_WIN0H = 0; gTasks[taskId].func = sub_80D1D9C; } else { - gUnknown_030042C4 = gTasks[taskId].data[1] | (gTasks[taskId].data[0] << 8); + gBattle_WIN0H = gTasks[taskId].data[1] | (gTasks[taskId].data[0] << 8); } } @@ -71,8 +71,8 @@ void sub_80D1D9C(u8 taskId) } else if (gTasks[taskId].data[10] > 4) { - gUnknown_030042C4 = 0; - gUnknown_03004240 = 0; + gBattle_WIN0H = 0; + gBattle_WIN0V = 0; REG_WININ = 0x3F3F; REG_WINOUT = 0x3F3F; REG_BLDCNT = 0; diff --git a/src/battle/anim/cutter.c b/src/battle/anim/cutter.c index 9859497e5..2234ebacb 100755 --- a/src/battle/anim/cutter.c +++ b/src/battle/anim/cutter.c @@ -4,8 +4,8 @@ #include "battle_anim.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CB09C(struct Sprite* sprite); static void sub_80CB1A4(struct Sprite* sprite); @@ -16,7 +16,7 @@ static void sub_80CB1A4(struct Sprite* sprite); void sub_80CAFD0(struct Sprite* sprite) { sub_80787B0(sprite, 1); - if (GetBankSide(gBattleAnimBankAttacker)) + if (GetBankSide(gAnimBankAttacker)) { gBattleAnimArgs[2] = -gBattleAnimArgs[2]; } @@ -24,19 +24,19 @@ void sub_80CAFD0(struct Sprite* sprite) sprite->data[0] = gBattleAnimArgs[4]; if (!(gBattleAnimArgs[6])) { - sprite->data[2] = sub_8077ABC(gBattleAnimBankTarget, 2) + gBattleAnimArgs[2]; - sprite->data[4] = sub_8077ABC(gBattleAnimBankTarget, 3) + gBattleAnimArgs[3]; + sprite->data[2] = GetBankPosition(gAnimBankTarget, 2) + gBattleAnimArgs[2]; + sprite->data[4] = GetBankPosition(gAnimBankTarget, 3) + gBattleAnimArgs[3]; } else { - sub_807A3FC(gBattleAnimBankTarget, 1, &sprite->data[2], &sprite->data[4]); + sub_807A3FC(gAnimBankTarget, 1, &sprite->data[2], &sprite->data[4]); sprite->data[2] += gBattleAnimArgs[2]; sprite->data[4] += gBattleAnimArgs[3]; } sprite->data[5] = gBattleAnimArgs[5]; sub_80786EC(sprite); - if (GetBankSide(gBattleAnimBankAttacker) == GetBankSide(gBattleAnimBankTarget)) + if (GetBankSide(gAnimBankAttacker) == GetBankSide(gAnimBankTarget)) { sprite->data[0] = 1; } @@ -77,14 +77,14 @@ void sub_80CB09C(struct Sprite* sprite) c = TRUE; if (c) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } void sub_80CB144(struct Sprite* sprite) { - if (!NotInBattle() && IsDoubleBattle() == TRUE) + if (!IsContest() && IsDoubleBattle() == TRUE) { - sub_807A3FC(gBattleAnimBankTarget, 1, &sprite->pos1.x, &sprite->pos1.y); + sub_807A3FC(gAnimBankTarget, 1, &sprite->pos1.x, &sprite->pos1.y); } sprite->pos1.y += 32; @@ -117,14 +117,14 @@ void sub_80CB1A4(struct Sprite* sprite) sprite->pos2.y = Sin(sprite->data[5], 5); if (sprite->data[5] <= 0x7F) { - sprite->oam.priority = sub_8079ED4(gBattleAnimBankTarget) - 1; + sprite->oam.priority = sub_8079ED4(gAnimBankTarget) - 1; } else { - sprite->oam.priority = sub_8079ED4(gBattleAnimBankTarget) + 1; + sprite->oam.priority = sub_8079ED4(gAnimBankTarget) + 1; } sprite->data[0]--; if (!sprite->data[0]) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } diff --git a/src/battle/anim/cyclone.c b/src/battle/anim/cyclone.c index b19304f17..0f83df211 100755 --- a/src/battle/anim/cyclone.c +++ b/src/battle/anim/cyclone.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // cyclone (creates a circling motion like a cyclone, usually a wind sprite.) // Used in Razor Wind. @@ -14,7 +14,7 @@ extern u8 gBattleAnimBankTarget; void sub_80D0118(struct Sprite* sprite) { sub_80787B0(sprite, 0); - if (GetBankSide(gBattleAnimBankAttacker) == 0) + if (GetBankSide(gAnimBankAttacker) == 0) sprite->pos1.y += 16; sprite->data[0] = gBattleAnimArgs[4]; @@ -23,6 +23,6 @@ void sub_80D0118(struct Sprite* sprite) sprite->data[3] = gBattleAnimArgs[6]; sprite->data[4] = gBattleAnimArgs[3]; sprite->callback = sub_8078114; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); sprite->callback(sprite); } diff --git a/src/battle/anim/devil.c b/src/battle/anim/devil.c index 345ee53ea..c628abfc0 100644 --- a/src/battle/anim/devil.c +++ b/src/battle/anim/devil.c @@ -5,7 +5,7 @@ #include "trig.h" extern s16 gBattleAnimArgs[8]; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankTarget; void sub_80D2ABC(struct Sprite *sprite) { @@ -14,7 +14,7 @@ void sub_80D2ABC(struct Sprite *sprite) sprite->pos1.x += gBattleAnimArgs[0]; sprite->pos1.y += gBattleAnimArgs[1]; StartSpriteAnim(sprite, 0); - sprite->subpriority = sub_8079E90(gBattleAnimBankTarget) - 1; + sprite->subpriority = sub_8079E90(gAnimBankTarget) - 1; sprite->data[2] = 1; } sprite->data[0] += sprite->data[2]; @@ -33,5 +33,5 @@ void sub_80D2ABC(struct Sprite *sprite) else sprite->invisible = FALSE; if (sprite->data[3] > 0x5A) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } diff --git a/src/battle/anim/draw.c b/src/battle/anim/draw.c index c075af097..3adb62e06 100755 --- a/src/battle/anim/draw.c +++ b/src/battle/anim/draw.c @@ -6,11 +6,11 @@ #include "unknown_task.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; -extern u16 gUnknown_03004288; -extern u16 gUnknown_030042C0; +extern u16 gBattle_BG2_X; +extern u16 gBattle_BG1_X; static void sub_80D0D68(u8 taskId); static void sub_80D0E8C(struct Sprite* sprite); @@ -23,21 +23,21 @@ void sub_80D0C88(u8 taskId) struct Task* task = &gTasks[taskId]; struct UnknownTaskStruct sp; s16 i; - task->data[0] = sub_8077FC0(gBattleAnimBankTarget) + 32; + task->data[0] = sub_8077FC0(gAnimBankTarget) + 32; task->data[1] = 4; task->data[2] = 0; task->data[3] = 0; task->data[4] = 0; task->data[5] = 0; - task->data[15] = sub_807A100(gBattleAnimBankTarget, 0); - if (GetBankIdentity_permutated(gBattleAnimBankTarget) == 1) + task->data[15] = sub_807A100(gAnimBankTarget, 0); + if (GetBankIdentity_permutated(gAnimBankTarget) == 1) { - task->data[6] = gUnknown_030042C0; + task->data[6] = gBattle_BG1_X; sp.dest = (u16 *)REG_ADDR_BG1HOFS; } else { - task->data[6] = gUnknown_03004288; + task->data[6] = gBattle_BG2_X; sp.dest = (u16 *)REG_ADDR_BG2HOFS; } @@ -220,15 +220,15 @@ _080D0E2C: .4byte gUnknown_03004DC0\n\ void sub_80D0E30(struct Sprite* sprite) { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankTarget, 0) - 16; - sprite->pos1.y = sub_8077FC0(gBattleAnimBankTarget) + 16; + sprite->pos1.x = GetBankPosition(gAnimBankTarget, 0) - 16; + sprite->pos1.y = sub_8077FC0(gAnimBankTarget) + 16; sprite->data[0] = 0; sprite->data[1] = 0; sprite->data[2] = 0; sprite->data[3] = 16; sprite->data[4] = 0; - sprite->data[5] = sub_807A100(gBattleAnimBankTarget, 0) + 2; - sprite->data[6] = sub_8076F98(0x3F); + sprite->data[5] = sub_807A100(gAnimBankTarget, 0) + 2; + sprite->data[6] = BattleAnimAdjustPanning(0x3F); sprite->callback = sub_80D0E8C; } @@ -285,7 +285,7 @@ void sub_80D0E8C(struct Sprite* sprite) if (++sprite->data[1] > 16) { sprite->invisible = 0; - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } break; } diff --git a/src/battle/anim/drum.c b/src/battle/anim/drum.c index 60cb2acc1..6306778ae 100755 --- a/src/battle/anim/drum.c +++ b/src/battle/anim/drum.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // drum (using hands to slap the Pokemon's belly in a rhythm.) // Used in Belly Drum. @@ -24,9 +24,9 @@ void sub_80CEDF0(struct Sprite* sprite) a = -16; } - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 2) + a; - sprite->pos1.y = sub_8077ABC(gBattleAnimBankAttacker, 3) + 8; + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2) + a; + sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 3) + 8; sprite->data[0] = 8; sprite->callback = sub_80782D8; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); } diff --git a/src/battle/anim/egg.c b/src/battle/anim/egg.c index a5bcffa6d..8004b3bf5 100755 --- a/src/battle/anim/egg.c +++ b/src/battle/anim/egg.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80D13AC(struct Sprite* sprite); static void sub_80D1424(struct Sprite* sprite); @@ -23,7 +23,7 @@ void sub_80D1368(struct Sprite* sprite) { s16 r1; sub_80787B0(sprite, 0); - r1 = (GetBankSide(gBattleAnimBankAttacker)) ? -0xA0 : 0xA0; + r1 = (GetBankSide(gAnimBankAttacker)) ? -0xA0 : 0xA0; sprite->data[0] = 0x380; sprite->data[1] = r1; sprite->data[7] = gBattleAnimArgs[2]; @@ -36,7 +36,7 @@ void sub_80D13AC(struct Sprite* sprite) sprite->pos2.y -= (sprite->data[0] >> 8); sprite->pos2.x = sprite->data[1] >> 8; sprite->data[0] -= 32; - add = (GetBankSide(gBattleAnimBankAttacker)) ? -0xA0 : 0xA0; + add = (GetBankSide(gAnimBankAttacker)) ? -0xA0 : 0xA0; sprite->data[1] += add; if (sprite->pos2.y > 0) { @@ -110,7 +110,7 @@ void sub_80D154C(struct Sprite* sprite) if (sprite->data[7] == 0) sprite->callback = sub_80D158C; else - sprite->callback = move_anim_8072740; + sprite->callback = DestroyAnimSprite; } } @@ -118,5 +118,5 @@ void sub_80D158C(struct Sprite* sprite) { REG_BLDCNT = 0; REG_BLDALPHA = 0; - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } diff --git a/src/battle/anim/energy_wave.c b/src/battle/anim/energy_wave.c index ffba5c300..15045f5bd 100644 --- a/src/battle/anim/energy_wave.c +++ b/src/battle/anim/energy_wave.c @@ -6,8 +6,8 @@ #include "trig.h" extern s16 gBattleAnimArgs[8]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern const struct SpriteTemplate gSpriteTemplate_83D9130[]; static void sub_80D35DC(struct Sprite *); @@ -24,9 +24,9 @@ void sub_80D3554(struct Sprite *sprite) sprite->data[0] = 30; sprite->data[1] = sprite->pos1.x; - sprite->data[2] = sub_8077ABC(gBattleAnimBankTarget, 2); + sprite->data[2] = GetBankPosition(gAnimBankTarget, 2); sprite->data[3] = sprite->pos1.y; - sprite->data[4] = sub_8077ABC(gBattleAnimBankTarget, 3); + sprite->data[4] = GetBankPosition(gAnimBankTarget, 3); obj_translate_based_on_private_1_2_3_4(sprite); @@ -51,7 +51,7 @@ static void sub_80D35DC(struct Sprite *sprite) { if (sub_8078B5C(sprite)) { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } sprite->pos2.y += Sin(sprite->data[6] >> 8, sprite->data[7]); @@ -86,15 +86,15 @@ void sub_80D3698(struct Sprite *sprite) { u8 subpriority; - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 0); - sprite->pos1.y = sub_8077ABC(gBattleAnimBankAttacker, 1); + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 0); + sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 1); sprite->pos2.y = -10; - subpriority = sub_8079E90(gBattleAnimBankAttacker); + subpriority = sub_8079E90(gAnimBankAttacker); - if (!NotInBattle()) + if (!IsContest()) { - if (GetBankSide(gBattleAnimBankAttacker) == 0) + if (GetBankSide(gAnimBankAttacker) == 0) { sprite->pos2.x = 10; sprite->subpriority = subpriority + 2; @@ -118,7 +118,7 @@ static void sub_80D370C(struct Sprite *sprite) { if (sprite->affineAnimEnded) { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } @@ -126,11 +126,11 @@ void sub_80D3728(struct Sprite *sprite) { int var1, var2; - if (GetBankSide(gBattleAnimBankAttacker) == GetBankSide(gBattleAnimBankTarget)) + if (GetBankSide(gAnimBankAttacker) == GetBankSide(gAnimBankTarget)) { gBattleAnimArgs[0] *= -1; - if (GetBankIdentity(gBattleAnimBankAttacker) == 0 || GetBankIdentity(gBattleAnimBankAttacker) == 1) + if (GetBankIdentity(gAnimBankAttacker) == 0 || GetBankIdentity(gAnimBankAttacker) == 1) { gBattleAnimArgs[0] *= -1; } @@ -149,14 +149,14 @@ void sub_80D3728(struct Sprite *sprite) sub_80787B0(sprite, var1); - if (GetBankSide(gBattleAnimBankAttacker) != 0) + if (GetBankSide(gAnimBankAttacker) != 0) { gBattleAnimArgs[2] = -gBattleAnimArgs[2]; } sprite->data[0] = gBattleAnimArgs[4]; - sprite->data[2] = sub_8077ABC(gBattleAnimBankTarget, 2) + gBattleAnimArgs[2]; - sprite->data[4] = sub_8077ABC(gBattleAnimBankTarget, var2) + gBattleAnimArgs[3]; + sprite->data[2] = GetBankPosition(gAnimBankTarget, 2) + gBattleAnimArgs[2]; + sprite->data[4] = GetBankPosition(gAnimBankTarget, var2) + gBattleAnimArgs[3]; sprite->callback = sub_8078B34; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); } diff --git a/src/battle/anim/espeed.c b/src/battle/anim/espeed.c index 621d386e1..469522092 100755 --- a/src/battle/anim/espeed.c +++ b/src/battle/anim/espeed.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern s8 gUnknown_083D7A00[4][2]; @@ -51,7 +51,7 @@ void sub_80D1638(u8 taskId) task->data[2] = 0; task->data[3] = 0; task->data[12] = 3; - if (GetBankSide(gBattleAnimBankTarget) == 0) + if (GetBankSide(gAnimBankTarget) == 0) { task->data[13] = 0xFFFF; task->data[14] = 8; @@ -169,8 +169,8 @@ void sub_80D18D4(u8 taskId) task->data[7] = 0; task->data[8] = 0; task->data[13] = 0; - task->data[14] = sub_8077ABC(gBattleAnimBankAttacker, 0); - task->data[15] = sub_8077ABC(gBattleAnimBankAttacker, 1); + task->data[14] = GetBankPosition(gAnimBankAttacker, 0); + task->data[15] = GetBankPosition(gAnimBankAttacker, 1); task->func = sub_80D1930; } diff --git a/src/battle/anim/evasion.c b/src/battle/anim/evasion.c index b4e81009b..ded8428d4 100755 --- a/src/battle/anim/evasion.c +++ b/src/battle/anim/evasion.c @@ -7,8 +7,8 @@ #include "blend_palette.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CE910(u8 taskId); static void sub_80CE974(struct Sprite* sprite); @@ -47,7 +47,7 @@ void sub_80CE7E0(u8 taskId) } task->func = sub_80CE910; - if (GetBankIdentity_permutated(gBattleAnimBankAttacker) == 1) + if (GetBankIdentity_permutated(gAnimBankAttacker) == 1) { REG_DISPCNT &= 0xFDFF; } @@ -62,7 +62,7 @@ void sub_80CE910(u8 taskId) struct Task* task = &gTasks[taskId]; if (!task->data[3]) { - if (GetBankIdentity_permutated(gBattleAnimBankAttacker) == 1) + if (GetBankIdentity_permutated(gAnimBankAttacker) == 1) REG_DISPCNT |= 0x200; else REG_DISPCNT |= 0x400; diff --git a/src/battle/anim/fang.c b/src/battle/anim/fang.c index 4df450691..5ed7372a8 100755 --- a/src/battle/anim/fang.c +++ b/src/battle/anim/fang.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // fang // Used by Super Fang (and probably Hyper Fang, but the actual callbacks are not in this file.) @@ -14,6 +14,6 @@ extern u8 gBattleAnimBankTarget; void sub_80CEA04(struct Sprite* sprite) { - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); sprite->callback = sub_8078600; } diff --git a/src/battle/anim/fire.c b/src/battle/anim/fire.c new file mode 100644 index 000000000..253236805 --- /dev/null +++ b/src/battle/anim/fire.c @@ -0,0 +1,146 @@ +#include "global.h" +#include "battle_anim.h" +#include "rom_8077ABC.h" +#include "trig.h" + +extern s16 gBattleAnimArgs[]; +extern u8 gAnimBankAttacker; + +void sub_80D5038(struct Sprite *); +void sub_80D50E8(struct Sprite *); + +void sub_80D4ED8(struct Sprite *sprite) +{ + sprite->data[0] = gBattleAnimArgs[0]; + sprite->data[1] = 0x3C; + sprite->data[2] = 0x9; + sprite->data[3] = 0x1E; + sprite->data[4] = 0xFE00; + + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); + + sprite->callback = sub_8078174; + sub_8078174(sprite); +} + +void sub_80D4F18(struct Sprite *sprite) +{ + sub_807867C(sprite, gBattleAnimArgs[0]); + + sprite->pos1.y += gBattleAnimArgs[1]; + sprite->data[0] = gBattleAnimArgs[4]; + sprite->data[1] = gBattleAnimArgs[2]; + sprite->data[2] = gBattleAnimArgs[3]; + + sprite->callback = sub_8078394; + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); +} + +void sub_80D4F5C(struct Sprite *sprite) +{ + sub_8078650(sprite); + + if (GetBankSide(gAnimBankAttacker)) + { + sprite->pos1.x -= gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + sprite->data[2] = -gBattleAnimArgs[4]; + } + else + { + sprite->pos1.x += gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + sprite->data[2] = gBattleAnimArgs[4]; + } + + sprite->data[1] = gBattleAnimArgs[2]; + sprite->data[4] = gBattleAnimArgs[3]; + sprite->data[3] = gBattleAnimArgs[5]; + + sprite->callback = sub_80D5038; +} + +void sub_80D4FCC(struct Sprite *sprite) +{ + if (GetBankSide(gAnimBankAttacker)) + { + sprite->pos1.x -= gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + sprite->data[2] = gBattleAnimArgs[4]; + } + else + { + sprite->pos1.x += gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + sprite->data[2] = -gBattleAnimArgs[4]; + } + + sprite->data[1] = gBattleAnimArgs[2]; + sprite->data[4] = gBattleAnimArgs[3]; + sprite->data[3] = gBattleAnimArgs[5]; + + sprite->callback = sub_80D5038; +} + +void sub_80D5038(struct Sprite *sprite) +{ + if (++sprite->data[0] < sprite->data[4]) + { + sprite->pos2.x += sprite->data[2]; + sprite->pos2.y += sprite->data[3]; + } + + if (sprite->data[0] == sprite->data[1]) + move_anim_8074EE0(sprite); +} + +void sub_80D5074(struct Sprite *sprite) +{ + sub_8078650(sprite); + + if (GetBankSide(gAnimBankAttacker)) + { + sprite->pos1.x -= gBattleAnimArgs[0]; + } + else + { + sprite->pos1.x += gBattleAnimArgs[0]; + sprite->subpriority = 8; + } + + sprite->pos1.y += gBattleAnimArgs[1]; + sprite->data[0] = gBattleAnimArgs[2]; + sprite->data[1] = gBattleAnimArgs[3]; + sprite->data[2] = gBattleAnimArgs[4]; + sprite->data[3] = gBattleAnimArgs[5]; + sprite->data[4] = gBattleAnimArgs[6]; + sprite->data[5] = 0; + + sprite->callback = sub_80D50E8; +} + +void sub_80D50E8(struct Sprite *sprite) +{ + if (sprite->data[3]) + { + if(sprite->data[5] > 10000) + sprite->subpriority = 1; + + sprite->pos2.x = Sin(sprite->data[0], sprite->data[1] + (sprite->data[5] >> 8)); + sprite->pos2.y = Cos(sprite->data[0], sprite->data[1] + (sprite->data[5] >> 8)); + + sprite->data[0] += sprite->data[2]; + sprite->data[5] += sprite->data[4]; + + if (sprite->data[0] > 255) + sprite->data[0] -= 256; + else if (sprite->data[0] < 0) + sprite->data[0] += 256; + + sprite->data[3]--; + } + else + { + move_anim_8074EE0(sprite); + } +}
\ No newline at end of file diff --git a/src/battle/anim/fire_2.c b/src/battle/anim/fire_2.c new file mode 100644 index 000000000..6dc304232 --- /dev/null +++ b/src/battle/anim/fire_2.c @@ -0,0 +1,326 @@ +#include "global.h" +#include "battle_anim.h" +#include "heated_rock.h" +#include "rom_8077ABC.h" +#include "task.h" +#include "trig.h" + +extern s16 gBattleAnimArgs[]; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; +extern struct SpriteTemplate gSpriteTemplate_83D96C4; +extern s16 gHeatedRockCoords[7][2]; + +void sub_80D5254(struct Sprite *); +void sub_80D5348(struct Sprite *); +void sub_80D52AC(struct Sprite *); +void sub_80D5324(struct Sprite *); +void sub_80D53F4(struct Sprite *); +void sub_80D541C(struct Sprite *); +void sub_80D54E0(u8 taskId); +void sub_80D57C4(u8 spriteId, u8 taskId, u8 a3); + +void sub_80D51A8(struct Sprite *sprite) +{ + if (GetBankSide(gAnimBankAttacker) == GetBankSide(gAnimBankTarget) + && (gAnimBankAttacker == GetBankByPlayerAI(2) + || gAnimBankAttacker == GetBankByPlayerAI(3))) + gBattleAnimArgs[2] = -gBattleAnimArgs[2]; + + sprite->callback = sub_8079534; + sub_8079534(sprite); +} + +struct Sprite *sub_80D5210(struct Sprite *sprite) +{ + gBattleAnimArgs[0] = -gBattleAnimArgs[0]; + gBattleAnimArgs[2] = -gBattleAnimArgs[2]; + + sprite->callback = sub_8079534; + return sprite; +} + +void sub_80D522C(struct Sprite *sprite) +{ + sub_80787B0(sprite, 1); + + sprite->data[7] = gBattleAnimArgs[2]; + sprite->data[0] = 0; + + sprite->callback = sub_80D5254; +} + +void sub_80D5254(struct Sprite *sprite) +{ + sub_80D5348(sprite); + + if (++sprite->data[0] == 0x12) + { + sprite->data[0] = 0x19; + sprite->data[1] = sprite->pos1.x; + sprite->data[2] = GetBankPosition(gAnimBankTarget, 2); + sprite->data[3] = sprite->pos1.y; + sprite->data[4] = GetBankPosition(gAnimBankTarget, 3); + + obj_translate_based_on_private_1_2_3_4(sprite); + + sprite->callback = sub_80D52AC; + } +} + +void sub_80D52AC(struct Sprite *sprite) +{ + if (sub_8078B5C(sprite)) + { + sprite->data[0] = 0; + + sprite->pos1.x = GetBankPosition(gAnimBankTarget, 2); + sprite->pos1.y = GetBankPosition(gAnimBankTarget, 3); + sprite->pos2.y = 0; + sprite->pos2.x = 0; + + sprite->callback = sub_80D5324; + sub_80D5324(sprite); + } + else + { + sprite->pos2.x += Sin(sprite->data[7], 28); + sprite->pos2.y += Cos(sprite->data[7], 28); + + sprite->data[7] = (sprite->data[7] + 20) & 0xFF; + } +} + +void sub_80D5324(struct Sprite *sprite) +{ + sub_80D5348(sprite); + + if (++sprite->data[0] == 0x1F) + DestroyAnimSprite(sprite); +} + +void sub_80D5348(struct Sprite *sprite) +{ + sprite->pos2.x = Sin(sprite->data[7], 28); + sprite->pos2.y = Cos(sprite->data[7], 28); + + sprite->data[7] = (sprite->data[7] + 20) & 0xFF; +} + +void sub_80D5374(struct Sprite *sprite) +{ + sprite->pos1.x += gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + + sprite->data[0] = gBattleAnimArgs[2]; + sprite->data[1] = gBattleAnimArgs[3]; + sprite->data[2] = gBattleAnimArgs[4]; + + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); + + sprite->callback = sub_8078364; +} + +void sub_80D53B4(struct Sprite *sprite) +{ + sub_80787B0(sprite, 1); + + sprite->data[1] = gBattleAnimArgs[2]; + sprite->data[0] = gBattleAnimArgs[3]; + + sprite->invisible = TRUE; + sprite->callback = sub_80782D8; + + StoreSpriteCallbackInData(sprite, sub_80D53F4); +} + +void sub_80D53F4(struct Sprite *sprite) +{ + sprite->invisible = FALSE; + + sprite->data[0] = sprite->data[1]; + sprite->data[1] = 0; + + sprite->callback = sub_80D541C; + sub_80D541C(sprite); +} + +void sub_80D541C(struct Sprite *sprite) +{ + sprite->pos2.x = Sin(sprite->data[1], sprite->data[2] >> 8); + sprite->pos2.y = Cos(sprite->data[1], sprite->data[2] >> 8); + + sprite->data[1] = (sprite->data[1] + 10) & 0xFF; + sprite->data[2] += 0xD0; + + if (--sprite->data[0] == -1) + DestroyAnimSprite(sprite); +} + +void sub_80D5470(u8 taskId) // initialize animation task for Move_ERUPTION? +{ + struct Task *task = &gTasks[taskId]; + + task->data[15] = GetAnimBankSpriteId(0); + + task->data[0] = 0; + task->data[1] = 0; + task->data[2] = 0; + task->data[3] = 0; + task->data[4] = gSprites[task->data[15]].pos1.y; + task->data[5] = GetBankSide(gAnimBankAttacker); + task->data[6] = 0; + + sub_8078E70(task->data[15], 0); + + task->func = sub_80D54E0; +} + +void sub_80D54E0(u8 taskId) // animate Move_ERUPTION? +{ + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + sub_8079C08(task, task->data[15], 0x100, 0x100, 0xE0, 0x200, 0x20); + + task->data[0]++; + case 1: + if (++task->data[1] > 1) + { + task->data[1] = 0; + + if (++task->data[2] & 0x1) + gSprites[task->data[15]].pos2.x = 3; + else + gSprites[task->data[15]].pos2.x = -3; + } + + if (task->data[5]) + { + if (++task->data[3] > 4) + { + task->data[3] = 0; + gSprites[task->data[15]].pos1.y++; + } + } + + if(!sub_8079C74(task)) + { + sub_8079A64(task->data[15]); + gSprites[task->data[15]].pos2.x = 0; + + task->data[1] = 0; + task->data[2] = 0; + task->data[3] = 0; + task->data[0]++; + } + break; + case 2: + if (++task->data[1] > 4) + { + if (task->data[5]) + sub_8079C08(task, task->data[15], 0xE0, 0x200, 0x180, 0xF0, 0x6); + else + sub_8079C08(task, task->data[15], 0xE0, 0x200, 0x180, 0xC0, 0x6); + + task->data[1] = 0; + task->data[0]++; + } + break; + case 3: + if (!sub_8079C74(task)) + { + sub_80D57C4(task->data[15], taskId, 6); + + task->data[0]++; + } + break; + case 4: + if (++task->data[1] > 1) + { + task->data[1] = 0; + + if (++task->data[2] & 1) + gSprites[task->data[15]].pos2.y += 3; + else + gSprites[task->data[15]].pos2.y -= 3; + } + + if (++task->data[3] > 0x18) + { + if (task->data[5]) + sub_8079C08(task, task->data[15], 0x180, 0xF0, 0x100, 0x100, 0x8); + else + sub_8079C08(task, task->data[15], 0x180, 0xC0, 0x100, 0x100, 0x8); + + if (task->data[2] & 1) + gSprites[task->data[15]].pos2.y -= 3; + + task->data[1] = 0; + task->data[2] = 0; + task->data[3] = 0; + task->data[0]++; + } + break; + case 5: + if (task->data[5]) + gSprites[task->data[15]].pos1.y--; + + if (!sub_8079C74(task)) + { + gSprites[task->data[15]].pos1.y = task->data[4]; + sub_8078F40(task->data[15]); + + task->data[2] = 0; + task->data[0]++; + } + break; + case 6: + if (!task->data[6]) + DestroyAnimVisualTask(taskId); + + break; + default: + } +} + +void sub_80D57C4(u8 spriteId, u8 taskId, u8 a3) +{ + u16 i, j; + s8 sign; + + u16 y = sub_80D5940(spriteId); + u16 x = gSprites[spriteId].pos1.x; + + if(!GetBankSide(gAnimBankAttacker)) + { + x -= 0xC; + sign = 1; + } + else + { + x += 0x10; + sign = -1; + } + + for (i = 0, j = 0; i <= 6; i++) + { + u8 spriteId = CreateSprite(&gSpriteTemplate_83D96C4, x, y, 2); + + if (spriteId != 0x40) + { + gSprites[spriteId].oam.tileNum += j * 4 + 0x40; + + if (++j >= 5) + j = 0; + + sub_80D5994(&gSprites[spriteId], gHeatedRockCoords[i][0] * sign, gHeatedRockCoords[i][1]); + gSprites[spriteId].data[6] = taskId; + gSprites[spriteId].data[7] = a3; + + gTasks[taskId].data[a3]++; + } + } +}
\ No newline at end of file diff --git a/src/battle/anim/flash.c b/src/battle/anim/flash.c index 0e087ec2d..eaa38e5b7 100755 --- a/src/battle/anim/flash.c +++ b/src/battle/anim/flash.c @@ -6,8 +6,8 @@ #include "palette.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern struct SpriteTemplate gBattleAnimSpriteTemplate_83D6FC8; extern struct SpriteTemplate gBattleAnimSpriteTemplate_83D6FF8; diff --git a/src/battle/anim/flying_hearts.c b/src/battle/anim/flying_hearts.c index 5b7d31a51..d2d22602a 100755 --- a/src/battle/anim/flying_hearts.c +++ b/src/battle/anim/flying_hearts.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80D2094(struct Sprite* sprite); @@ -35,6 +35,6 @@ void sub_80D2094(struct Sprite* sprite) { sprite->invisible = sprite->data[3] % 2; if (y <= 0x40) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } diff --git a/src/battle/anim/flying_path.c b/src/battle/anim/flying_path.c index 017f89858..441ac0e6d 100755 --- a/src/battle/anim/flying_path.c +++ b/src/battle/anim/flying_path.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern struct SpriteTemplate gSpriteTemplate_83D6884; @@ -22,12 +22,12 @@ void sub_80CBDF4(u8 taskId) { struct Task *task = &gTasks[taskId]; - task->data[4] = sub_8079E90(gBattleAnimBankTarget) - 1; - task->data[6] = sub_8077ABC(gBattleAnimBankTarget, 2); - task->data[7] = sub_8077ABC(gBattleAnimBankTarget, 3); - task->data[10] = sub_807A100(gBattleAnimBankTarget, 1); - task->data[11] = sub_807A100(gBattleAnimBankTarget, 0); - task->data[5] = (GetBankSide(gBattleAnimBankTarget) == 1) ? 1 : -1; + task->data[4] = sub_8079E90(gAnimBankTarget) - 1; + task->data[6] = GetBankPosition(gAnimBankTarget, 2); + task->data[7] = GetBankPosition(gAnimBankTarget, 3); + task->data[10] = sub_807A100(gAnimBankTarget, 1); + task->data[11] = sub_807A100(gAnimBankTarget, 0); + task->data[5] = (GetBankSide(gAnimBankTarget) == 1) ? 1 : -1; task->data[9] = 0x38 - (task->data[5] * 64); task->data[8] = task->data[7] - task->data[9] + task->data[6]; task->data[2] = CreateSprite(&gSpriteTemplate_83D6884, task->data[8], task->data[9], task->data[4]); diff --git a/src/battle/anim/flying_petals.c b/src/battle/anim/flying_petals.c index ed6497b7a..4eeaa5215 100755 --- a/src/battle/anim/flying_petals.c +++ b/src/battle/anim/flying_petals.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CC580(struct Sprite* sprite); @@ -17,9 +17,9 @@ void sub_80CC474(struct Sprite* sprite) { u8 bank; if (!gBattleAnimArgs[6]) - bank = gBattleAnimBankAttacker; + bank = gAnimBankAttacker; else - bank = gBattleAnimBankTarget; + bank = gAnimBankTarget; if (GetBankSide(bank) != 0) { @@ -48,11 +48,11 @@ void sub_80CC474(struct Sprite* sprite) sprite->oam.priority = sub_8079ED4(bank) + 1; break; case 2: - sprite->pos1.y = sub_8077ABC(bank, 3) + gBattleAnimArgs[0]; + sprite->pos1.y = GetBankPosition(bank, 3) + gBattleAnimArgs[0]; sprite->oam.priority = sub_8079ED4(bank); break; case 3: - sprite->pos1.y = sub_8077ABC(gBattleAnimBankTarget, 3) + gBattleAnimArgs[0]; + sprite->pos1.y = GetBankPosition(gAnimBankTarget, 3) + gBattleAnimArgs[0]; GetAnimBankSpriteId(1); sprite->oam.priority = sub_8079ED4(bank) + 1; break; diff --git a/src/battle/anim/fury_cutter_count.c b/src/battle/anim/fury_cutter_count.c index 17b084585..6b41055cb 100644 --- a/src/battle/anim/fury_cutter_count.c +++ b/src/battle/anim/fury_cutter_count.c @@ -1,20 +1,20 @@ #include "global.h" +#include "battle.h" #include "battle_anim.h" extern s16 gBattleAnimArgs[8]; -extern u8 *gDisableStructMoveAnim; // TODO: this is declared with a different type in different files // fury_cutter (updates the direction and count of the fury cutter animation) // Used in Fury Cutter. void UpdateFuryCutterAnimDirection(u8 taskId) { - gBattleAnimArgs[7] = gDisableStructMoveAnim[16] & 1; + gBattleAnimArgs[7] = gAnimDisableStructPtr->furyCutterCounter & 1; DestroyAnimVisualTask(taskId); } void UpdateFuryCutterAnimCount(u8 taskId) { - gBattleAnimArgs[7] = gDisableStructMoveAnim[16]; + gBattleAnimArgs[7] = gAnimDisableStructPtr->furyCutterCounter; DestroyAnimVisualTask(taskId); } diff --git a/src/battle/anim/glitter.c b/src/battle/anim/glitter.c index 548397932..e4577f1e1 100755 --- a/src/battle/anim/glitter.c +++ b/src/battle/anim/glitter.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // glitter (the sparkling effect seen on Pokemon, usually after healing or a beneficial effect.) // Used by Heal Bell, Cosmic Power, and Aromatherapy. @@ -21,7 +21,7 @@ void sub_80CD140(struct Sprite* sprite) sprite->data[0] = gBattleAnimArgs[5]; sprite->data[1] = gBattleAnimArgs[3]; sprite->data[2] = gBattleAnimArgs[4]; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); sprite->callback = sub_8078394; } @@ -29,9 +29,9 @@ void sub_80CD190(struct Sprite* sprite) { u8 bank; if (!gBattleAnimArgs[2]) - bank = gBattleAnimBankAttacker; + bank = gAnimBankAttacker; else - bank = gBattleAnimBankTarget; + bank = gAnimBankTarget; if (IsDoubleBattle() && IsAnimBankSpriteVisible(bank ^ 2)) { @@ -43,13 +43,13 @@ void sub_80CD190(struct Sprite* sprite) { if (!gBattleAnimArgs[6]) { - sprite->pos1.x = sub_8077ABC(bank, 0); - sprite->pos1.y = sub_8077ABC(bank, 1) + gBattleAnimArgs[1]; + sprite->pos1.x = GetBankPosition(bank, 0); + sprite->pos1.y = GetBankPosition(bank, 1) + gBattleAnimArgs[1]; } else { - sprite->pos1.x = sub_8077ABC(bank, 2); - sprite->pos1.y = sub_8077ABC(bank, 3) + gBattleAnimArgs[1]; + sprite->pos1.x = GetBankPosition(bank, 2); + sprite->pos1.y = GetBankPosition(bank, 3) + gBattleAnimArgs[1]; } sub_807867C(sprite, gBattleAnimArgs[0]); @@ -58,6 +58,6 @@ void sub_80CD190(struct Sprite* sprite) sprite->data[0] = gBattleAnimArgs[5]; sprite->data[1] = gBattleAnimArgs[3]; sprite->data[2] = gBattleAnimArgs[4]; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); sprite->callback = sub_8078394; } diff --git a/src/battle/anim/glow.c b/src/battle/anim/glow.c index 6038825af..63466c0ff 100755 --- a/src/battle/anim/glow.c +++ b/src/battle/anim/glow.c @@ -8,8 +8,8 @@ #include "decompress.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern u16 gUnknown_083D7A5C[5]; @@ -32,11 +32,11 @@ void sub_80D1ADC(u8 taskId) } src = &gBattleAnimSpritePalette_206; - dest = (NotInBattle()) ? gSharedMem + 0x18000 - 0x3800: gSharedMem + 0x18000; + dest = (IsContest()) ? gSharedMem + 0x18000 - 0x3800: gSharedMem + 0x18000; LZDecompressWram(src, dest); for (i = 0; i <= 4; i++) { - what = ((NotInBattle()) ? gSharedMem + 0x14800 : gSharedMem + 0x18000) + (i << 5); + what = ((IsContest()) ? gSharedMem + 0x14800 : gSharedMem + 0x18000) + (i << 5); LoadPalette(what, (u16)((sp[i] << 4) + 0x100), 32); } diff --git a/src/battle/anim/grip.c b/src/battle/anim/grip.c index 93c3dba96..c4d7b1cef 100755 --- a/src/battle/anim/grip.c +++ b/src/battle/anim/grip.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80D020C(struct Sprite* sprite); @@ -31,8 +31,8 @@ void sub_80D0178(struct Sprite* sprite) sprite->pos1.x += r7; sprite->pos1.y += r4; sprite->data[0] = 6; - sprite->data[2] = sub_8077ABC(gBattleAnimBankTarget, 2) + r8; - sprite->data[4] = sub_8077ABC(gBattleAnimBankTarget, 3) + r6; + sprite->data[2] = GetBankPosition(gAnimBankTarget, 2) + r8; + sprite->data[4] = GetBankPosition(gAnimBankTarget, 3) + r6; sprite->callback = sub_8078B34; StoreSpriteCallbackInData(sprite, sub_80D020C); } @@ -40,5 +40,5 @@ void sub_80D0178(struct Sprite* sprite) void sub_80D020C(struct Sprite* sprite) { if (sprite->animEnded == 1) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } diff --git a/src/battle/anim/grow.c b/src/battle/anim/grow.c index 35047c8b0..8788b32fe 100755 --- a/src/battle/anim/grow.c +++ b/src/battle/anim/grow.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern struct AffineAnimFrameCmd gUnknown_083D7714; diff --git a/src/battle/anim/guard.c b/src/battle/anim/guard.c index 4769db2e4..ab093eab1 100644 --- a/src/battle/anim/guard.c +++ b/src/battle/anim/guard.c @@ -3,8 +3,8 @@ #include "rom_8077ABC.h" extern s16 gBattleAnimArgs[8]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern u16 gBattleTypeFlags; // guard (moves guard rings upwards) @@ -12,17 +12,17 @@ extern u16 gBattleTypeFlags; void sub_80D3014(struct Sprite *sprite) { - if ((gBattleTypeFlags & 1) && IsAnimBankSpriteVisible(gBattleAnimBankAttacker ^ 2)) + if ((gBattleTypeFlags & 1) && IsAnimBankSpriteVisible(gAnimBankAttacker ^ 2)) { - sub_807A3FC(gBattleAnimBankAttacker, 0, &sprite->pos1.x, &sprite->pos1.y); + sub_807A3FC(gAnimBankAttacker, 0, &sprite->pos1.x, &sprite->pos1.y); sprite->pos1.y += 40; StartSpriteAffineAnim(sprite, 1); } else { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 0); - sprite->pos1.y = sub_8077ABC(gBattleAnimBankAttacker, 1) + 40; + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 0); + sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 1) + 40; } sprite->data[0] = 13; @@ -30,5 +30,5 @@ void sub_80D3014(struct Sprite *sprite) sprite->data[4] = sprite->pos1.y - 72; sprite->callback = sub_8078B34; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); } diff --git a/src/battle/anim/guillotine.c b/src/battle/anim/guillotine.c index b710f372a..b3d842cdf 100755 --- a/src/battle/anim/guillotine.c +++ b/src/battle/anim/guillotine.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80D02D0(struct Sprite* sprite); static void sub_80D0344(struct Sprite* sprite); @@ -34,9 +34,9 @@ void sub_80D0228(struct Sprite* sprite) sprite->pos1.y += r4; sprite->data[0] = 6; sprite->data[1] = sprite->pos1.x; - sprite->data[2] = sub_8077ABC(gBattleAnimBankTarget, 2) + r9; + sprite->data[2] = GetBankPosition(gAnimBankTarget, 2) + r9; sprite->data[3] = sprite->pos1.y; - sprite->data[4] = sub_8077ABC(gBattleAnimBankTarget, 3) + r6; + sprite->data[4] = GetBankPosition(gAnimBankTarget, 3) + r6; obj_translate_based_on_private_1_2_3_4(sprite); sprite->data[5] = gBattleAnimArgs[0]; sprite->data[6] = sprite->data[0]; @@ -86,5 +86,5 @@ void sub_80D0344(struct Sprite* sprite) void sub_80D03A8(struct Sprite* sprite) { if (sub_8078B5C(sprite) != 0) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } diff --git a/src/battle/anim/heal.c b/src/battle/anim/heal.c index c5950650c..a8c14ea1c 100755 --- a/src/battle/anim/heal.c +++ b/src/battle/anim/heal.c @@ -4,8 +4,8 @@ #include "battle_anim.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // heal (healing sparkles on a Pokemon) // Used in Present, if the move heals instead of damages. @@ -22,6 +22,6 @@ void sub_80CBAA4(struct Sprite* sprite) sprite->pos2.y = sprite->data[1] * sprite->data[0]; if (sprite->animEnded) { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } diff --git a/src/battle/anim/heart_1.c b/src/battle/anim/heart_1.c index 1ab83136c..5df89f929 100755 --- a/src/battle/anim/heart_1.c +++ b/src/battle/anim/heart_1.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // heart_1 (a floating heart in a wave pattern upward.) // Used in Charm, Covet, and when a Pokemon is infatuated. @@ -21,5 +21,5 @@ void sub_80D1C80(struct Sprite* sprite) sprite->data[1] = (sprite->data[1] + 7) & 0xFF; sprite->data[2] -= 0x80; if (sprite->data[0] == 0x3C) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } diff --git a/src/battle/anim/heated_rock.c b/src/battle/anim/heated_rock.c index 1d59669cf..51cfbd007 100644 --- a/src/battle/anim/heated_rock.c +++ b/src/battle/anim/heated_rock.c @@ -3,8 +3,8 @@ #include "rom_8077ABC.h" extern s16 gBattleAnimArgs[8]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern u16 gBattleTypeFlags; void sub_80D59B0(struct Sprite *); @@ -28,7 +28,7 @@ u16 sub_80D5940(u8 spriteId) { u16 var1 = gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y + gSprites[spriteId].centerToCornerVecY; - if (GetBankSide(gBattleAnimBankAttacker) == 0) + if (GetBankSide(gAnimBankAttacker) == 0) { var1 = ((var1 << 16) + 0x4A0000) >> 16; } @@ -198,7 +198,7 @@ static void sub_80D5A74(struct Sprite *sprite) if (++sprite->data[3] > 16) { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } break; } diff --git a/src/battle/anim/homing.c b/src/battle/anim/homing.c index c5e372d78..6fb4a76d8 100755 --- a/src/battle/anim/homing.c +++ b/src/battle/anim/homing.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CC7D4(struct Sprite* sprite); @@ -23,19 +23,19 @@ void sub_80CC6CC(struct Sprite* sprite) if (gBattleAnimArgs[4] == 0) { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } else { if (gBattleAnimArgs[0] == 0) { - a = sub_8077ABC(gBattleAnimBankAttacker, 2); - b = sub_8077ABC(gBattleAnimBankAttacker, 3); + a = GetBankPosition(gAnimBankAttacker, 2); + b = GetBankPosition(gAnimBankAttacker, 3); } else { - a = sub_8077ABC(gBattleAnimBankTarget, 2); - b = sub_8077ABC(gBattleAnimBankTarget, 3); + a = GetBankPosition(gAnimBankTarget, 2); + b = GetBankPosition(gAnimBankTarget, 3); } sprite->data[0] = gBattleAnimArgs[4]; @@ -61,7 +61,7 @@ void sub_80CC6CC(struct Sprite* sprite) sprite->data[3] = (sprite->data[5] - sprite->pos1.x) * 16 / gBattleAnimArgs[4]; sprite->data[4] = (sprite->data[6] - sprite->pos1.y) * 16 / gBattleAnimArgs[4]; c = sub_80790F0(sprite->data[5] - x, sprite->data[6] - y); - if (NotInBattle()) + if (IsContest()) c -= 0x8000; sub_8078FDC(sprite, 0, 0x100, 0x100, c); diff --git a/src/battle/anim/hop.c b/src/battle/anim/hop.c index 60f3b8a48..4006e2d43 100755 --- a/src/battle/anim/hop.c +++ b/src/battle/anim/hop.c @@ -4,8 +4,8 @@ #include "battle_anim.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // hop (where a sprite "hops" across the screen) // Used by Present, Trick, and the item knock off effect. @@ -65,7 +65,7 @@ void sub_80CB8B8(struct Sprite* sprite) sprite->data[0]++; if (sprite->data[0] > 50) { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } @@ -92,9 +92,9 @@ void sub_80CB94C(struct Sprite* sprite) s16 e1; s16 e2; sub_80787B0(sprite, 0); - e1 = sub_8077ABC(gBattleAnimBankTarget, 0); - e2 = sub_8077ABC(gBattleAnimBankTarget, 1); - if ((gBattleAnimBankAttacker ^ 2) == gBattleAnimBankTarget) + e1 = GetBankPosition(gAnimBankTarget, 0); + e2 = GetBankPosition(gAnimBankTarget, 1); + if ((gAnimBankAttacker ^ 2) == gAnimBankTarget) { sprite->data[6] = e1; sprite->data[7] = e2 + 10; @@ -129,14 +129,14 @@ void sub_80CB9C4(struct Sprite* sprite) { sprite->pos2.y = zero; sprite->data[0] = zero; - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } void sub_80CBA28(struct Sprite* sprite) { - s16 e = sub_8077ABC(gBattleAnimBankTarget, 1); - if (GetBankSide(gBattleAnimBankTarget) == 0) + s16 e = GetBankPosition(gAnimBankTarget, 1); + if (GetBankSide(gAnimBankTarget) == 0) { sprite->data[6] = 0; sprite->data[7] = e + 10; @@ -149,7 +149,7 @@ void sub_80CBA28(struct Sprite* sprite) { sprite->data[6] = 255; sprite->data[7] = e + 10; - if (NotInBattle()) + if (IsContest()) sprite->data[6] = 0; sub_80CB7EC(sprite, 0x28); diff --git a/src/battle/anim/hop_2.c b/src/battle/anim/hop_2.c index 5458c4599..1bc3f46af 100755 --- a/src/battle/anim/hop_2.c +++ b/src/battle/anim/hop_2.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern void sub_80CB7EC(struct Sprite* sprite, s16 c); extern bool8 sub_80CB814(struct Sprite* sprite); @@ -22,9 +22,9 @@ void sub_80CBAE8(struct Sprite* sprite) s16 p1; s16 p2; sub_8078764(sprite, 0); - p1 = sub_8077ABC(gBattleAnimBankAttacker, 0); - p2 = sub_8077ABC(gBattleAnimBankAttacker, 1); - if ((gBattleAnimBankTarget ^ 2) == gBattleAnimBankAttacker) + p1 = GetBankPosition(gAnimBankAttacker, 0); + p2 = GetBankPosition(gAnimBankAttacker, 1); + if ((gAnimBankTarget ^ 2) == gAnimBankAttacker) { sprite->data[6] = p1; sprite->data[7] = p2 + 10; @@ -57,7 +57,7 @@ void sub_80CBB60(struct Sprite* sprite) sprite->pos2.y = Sin(sprite->data[0] + 0x80, 30 - sprite->data[1] * 8); if (sprite->pos2.y == 0) { - PlaySE12WithPanning(0x7D, sub_8076F98(0x3F)); + PlaySE12WithPanning(0x7D, BattleAnimAdjustPanning(0x3F)); } if (sub_80CB814(sprite)) @@ -65,6 +65,6 @@ void sub_80CBB60(struct Sprite* sprite) sprite->pos2.y = 0; sprite->data[0] = 0; sprite->callback = sub_80CB8B8; - PlaySE12WithPanning(0x7D, sub_8076F98(-0x40)); + PlaySE12WithPanning(0x7D, BattleAnimAdjustPanning(-0x40)); } } diff --git a/src/battle/anim/kiss_fountain.c b/src/battle/anim/kiss_fountain.c index 2e7f64c11..d3270ee65 100755 --- a/src/battle/anim/kiss_fountain.c +++ b/src/battle/anim/kiss_fountain.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // kiss_fountain (a series of hearts pour out of a target Pokemon.) // Used in Attract and Sweet Kiss. @@ -32,7 +32,7 @@ void sub_80D1FDC(struct Sprite* sprite) if (sprite->data[3] > 0x78) { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } } diff --git a/src/battle/anim/leaf.c b/src/battle/anim/leaf.c index 13d1bc9f5..676734717 100755 --- a/src/battle/anim/leaf.c +++ b/src/battle/anim/leaf.c @@ -4,8 +4,8 @@ #include "battle_anim.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CAF20(struct Sprite* sprite); static void sub_80CAF6C(struct Sprite* sprite); @@ -15,8 +15,8 @@ static void sub_80CAF6C(struct Sprite* sprite); void sub_80CAED8(struct Sprite* sprite) { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 2); - sprite->pos1.y = sub_8077ABC(gBattleAnimBankAttacker, 3); + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2); + sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 3); sprite->data[0] = gBattleAnimArgs[0]; sprite->data[1] = gBattleAnimArgs[1]; sprite->data[2] = gBattleAnimArgs[2]; @@ -51,7 +51,7 @@ void sub_80CAF20(struct Sprite* sprite) void sub_80CAF6C(struct Sprite* sprite) { - if (GetBankSide(gBattleAnimBankAttacker)) + if (GetBankSide(gAnimBankAttacker)) { sprite->pos2.x = -Sin(sprite->data[0], 0x19); } @@ -69,6 +69,6 @@ void sub_80CAF6C(struct Sprite* sprite) if (sprite->data[1] > 0x50) { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } diff --git a/src/battle/anim/love_bg.c b/src/battle/anim/love_bg.c index 1e49b536c..bd3d22ca6 100755 --- a/src/battle/anim/love_bg.c +++ b/src/battle/anim/love_bg.c @@ -7,15 +7,15 @@ #include "palette.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern struct INCBIN_U8 gAttractTilemap; extern struct INCBIN_U8 gAttractGfx; extern struct INCBIN_U8 gAttractPal; -extern u16 gUnknown_030041B4; -extern u16 gUnknown_030042C0; +extern u16 gBattle_BG1_Y; +extern u16 gBattle_BG1_X; static void sub_80D21F0(u8 taskId); @@ -30,11 +30,11 @@ void sub_80D2100(u8 taskId) REG_BLDALPHA = 0x1000; REG_BG1CNT_BITFIELD.priority = 3; REG_BG1CNT_BITFIELD.screenSize = 0; - if (!NotInBattle()) + if (!IsContest()) REG_BG1CNT_BITFIELD.charBaseBlock = 1; - gUnknown_030042C0 = 0; - gUnknown_030041B4 = 0; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; REG_BG1HOFS = 0; REG_BG1VOFS = 0; sub_8078914(&subStruct); @@ -43,7 +43,7 @@ void sub_80D2100(u8 taskId) LZDecompressVram(&gAttractTilemap, tempvar); LZDecompressVram(&gAttractGfx, subStruct.field_0); LoadCompressedPalette(&gAttractPal, subStruct.field_8 << 4, 32); - if (NotInBattle()) + if (IsContest()) sub_80763FC(subStruct.field_8, (u16 *)subStruct.field_4, 0, 0); gTasks[taskId].func = sub_80D21F0; @@ -106,7 +106,7 @@ void sub_80D21F0(u8 taskId) } } DmaClear32(3, subStruct.field_4, 0x800); - if (!NotInBattle()) + if (!IsContest()) REG_BG1CNT_BITFIELD.charBaseBlock = 0; gTasks[taskId].data[12]++; diff --git a/src/battle/anim/lunge_1.c b/src/battle/anim/lunge_1.c index f1e1e35b6..d379c8f09 100755 --- a/src/battle/anim/lunge_1.c +++ b/src/battle/anim/lunge_1.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern u8 gObjectBankIDs[]; @@ -44,9 +44,9 @@ void sub_80CD774(struct Sprite* sprite) void sub_80CD7CC(struct Sprite* sprite) { sprite->data[0] = 6; - sprite->data[1] = (GetBankSide(gBattleAnimBankAttacker)) ? 2 : -2; + sprite->data[1] = (GetBankSide(gAnimBankAttacker)) ? 2 : -2; sprite->data[2] = 0; - sprite->data[3] = gObjectBankIDs[gBattleAnimBankAttacker]; + sprite->data[3] = gObjectBankIDs[gAnimBankAttacker]; StoreSpriteCallbackInData(sprite, sub_80CD81C); sprite->callback = sub_8078458; } @@ -55,9 +55,9 @@ void sub_80CD81C(struct Sprite* sprite) { if (sprite->data[0] == 0) { - sprite->data[3] = gObjectBankIDs[gBattleAnimBankAttacker]; + sprite->data[3] = gObjectBankIDs[gAnimBankAttacker]; sub_8078E70(sprite->data[3], 0); - sprite->data[4] = (sprite->data[6] = GetBankSide(gBattleAnimBankAttacker)) ? 0x300 : 0xFFFFFD00; + sprite->data[4] = (sprite->data[6] = GetBankSide(gAnimBankAttacker)) ? 0x300 : 0xFFFFFD00; sprite->data[5] = 0; } @@ -74,9 +74,9 @@ void sub_80CD81C(struct Sprite* sprite) void sub_80CD8A8(struct Sprite* sprite) { sprite->data[0] = 4; - sprite->data[1] = (GetBankSide(gBattleAnimBankAttacker)) ? -3 : 3; + sprite->data[1] = (GetBankSide(gAnimBankAttacker)) ? -3 : 3; sprite->data[2] = 0; - sprite->data[3] = gObjectBankIDs[gBattleAnimBankAttacker]; + sprite->data[3] = gObjectBankIDs[gAnimBankAttacker]; StoreSpriteCallbackInData(sprite, sub_80CD9B8); sprite->callback = sub_8078458; } @@ -94,9 +94,9 @@ void sub_80CD91C(struct Sprite* sprite) { if (sprite->data[0] == 0) { - sprite->data[3] = gObjectBankIDs[gBattleAnimBankAttacker]; - sprite->data[6] = GetBankSide(gBattleAnimBankAttacker); - if (GetBankSide(gBattleAnimBankAttacker)) + sprite->data[3] = gObjectBankIDs[gAnimBankAttacker]; + sprite->data[6] = GetBankSide(gAnimBankAttacker); + if (GetBankSide(gAnimBankAttacker)) { sprite->data[4] = 0xFC00; sprite->data[5] = 0xC00; @@ -120,5 +120,5 @@ void sub_80CD91C(struct Sprite* sprite) void sub_80CD9B8(struct Sprite* sprite) { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } diff --git a/src/battle/anim/lunge_2.c b/src/battle/anim/lunge_2.c index 3972bee59..fe2470567 100755 --- a/src/battle/anim/lunge_2.c +++ b/src/battle/anim/lunge_2.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern u8 gObjectBankIDs[]; @@ -20,8 +20,8 @@ void sub_80CDAC8(u8 taskId) { u8 a; - gTasks[taskId].data[0] = gObjectBankIDs[gBattleAnimBankAttacker]; - a = GetBankSide(gBattleAnimBankAttacker); + gTasks[taskId].data[0] = gObjectBankIDs[gAnimBankAttacker]; + a = GetBankSide(gAnimBankAttacker); gTasks[taskId].data[1] = a; gTasks[taskId].data[2] = 0; switch (gBattleAnimArgs[0]) diff --git a/src/battle/anim/money.c b/src/battle/anim/money.c index 91eaf20b1..8358d23db 100755 --- a/src/battle/anim/money.c +++ b/src/battle/anim/money.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CFF68(struct Sprite* sprite); @@ -20,9 +20,9 @@ void sub_80CFE9C(struct Sprite* sprite) u16 var; sub_80787B0(sprite, 1); - r6 = sub_8077ABC(gBattleAnimBankTarget, 2); - r7 = sub_8077ABC(gBattleAnimBankTarget, 3) + gBattleAnimArgs[3]; - if (GetBankSide(gBattleAnimBankAttacker) != 0) + r6 = GetBankPosition(gAnimBankTarget, 2); + r7 = GetBankPosition(gAnimBankTarget, 3) + gBattleAnimArgs[3]; + if (GetBankSide(gAnimBankAttacker) != 0) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; r6 += gBattleAnimArgs[2]; @@ -33,7 +33,7 @@ void sub_80CFE9C(struct Sprite* sprite) sprite->data[2] = r6; sprite->data[4] = r7; sprite->callback = sub_8078C00; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); } void sub_80CFF50(struct Sprite* sprite) @@ -47,7 +47,7 @@ void sub_80CFF68(struct Sprite* sprite) { sprite->data[0] += 0x80; sprite->pos2.x = sprite->data[0] >> 8; - if (GetBankSide(gBattleAnimBankAttacker) == 0) + if (GetBankSide(gAnimBankAttacker) == 0) sprite->pos2.x = -sprite->pos2.x; sprite->pos2.y = Sin(sprite->data[1], sprite->data[2]); @@ -57,6 +57,6 @@ void sub_80CFF68(struct Sprite* sprite) sprite->data[1] = 0; sprite->data[2] /= 2; if (++sprite->data[3] == 2) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } diff --git a/src/battle/anim/moon.c b/src/battle/anim/moon.c index e2a31d14d..c532e8057 100755 --- a/src/battle/anim/moon.c +++ b/src/battle/anim/moon.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CE354(struct Sprite* sprite); @@ -15,7 +15,7 @@ static void sub_80CE354(struct Sprite* sprite); void sub_80CE30C(struct Sprite* sprite) { - if (NotInBattle()) + if (IsContest()) { sprite->pos1.x = 0x30; sprite->pos1.y = 0x28; @@ -35,5 +35,5 @@ void sub_80CE30C(struct Sprite* sprite) void sub_80CE354(struct Sprite* sprite) { if (sprite->data[0]) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } diff --git a/src/battle/anim/noise.c b/src/battle/anim/noise.c index 78953d96a..369650d82 100644 --- a/src/battle/anim/noise.c +++ b/src/battle/anim/noise.c @@ -3,8 +3,8 @@ #include "battle_anim.h" extern s16 gBattleAnimArgs[8]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80D2E30(struct Sprite *); @@ -14,15 +14,15 @@ static void sub_80D2E30(struct Sprite *); void sub_80D2D68(struct Sprite* sprite) { int var1; - u8 slot = gBattleAnimArgs[0] == 0 ? gBattleAnimBankAttacker : gBattleAnimBankTarget; + u8 slot = gBattleAnimArgs[0] == 0 ? gAnimBankAttacker : gAnimBankTarget; if (GetBankSide(slot) == 1) { gBattleAnimArgs[1] *= -1; } - sprite->pos1.x = sub_8077ABC(slot, 2) + gBattleAnimArgs[1]; - sprite->pos1.y = sub_8077ABC(slot, 3) + gBattleAnimArgs[2]; + sprite->pos1.x = GetBankPosition(slot, 2) + gBattleAnimArgs[1]; + sprite->pos1.y = GetBankPosition(slot, 3) + gBattleAnimArgs[2]; sprite->data[0] = 0; sprite->data[1] = (u16)sprite->pos1.x << 3; sprite->data[2] = (u16)sprite->pos1.y << 3; @@ -51,6 +51,6 @@ static void sub_80D2E30(struct Sprite *sprite) if (++sprite->data[0] > 16) { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } diff --git a/src/battle/anim/note_rain.c b/src/battle/anim/note_rain.c index fd62b7176..715462d73 100755 --- a/src/battle/anim/note_rain.c +++ b/src/battle/anim/note_rain.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern u16 gUnknown_083D7A5C[5]; @@ -25,13 +25,13 @@ void sub_80D1BA8(struct Sprite* sprite, u8 a, u8 b) void sub_80D1C08(struct Sprite* sprite) { sub_80787B0(sprite, 0); - if (GetBankSide(gBattleAnimBankAttacker) != 0) + if (GetBankSide(gAnimBankAttacker) != 0) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[4]; - sprite->data[2] = sub_8077ABC(gBattleAnimBankAttacker, 0) + gBattleAnimArgs[2]; - sprite->data[4] = sub_8077ABC(gBattleAnimBankAttacker, 1) + gBattleAnimArgs[3]; + sprite->data[2] = GetBankPosition(gAnimBankAttacker, 0) + gBattleAnimArgs[2]; + sprite->data[4] = GetBankPosition(gAnimBankAttacker, 1) + gBattleAnimArgs[3]; sprite->callback = sub_8078B34; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); sub_80D1BA8(sprite, gBattleAnimArgs[5], gBattleAnimArgs[6]); } diff --git a/src/battle/anim/note_scatter.c b/src/battle/anim/note_scatter.c index 9ff49ee9d..8564c58fe 100755 --- a/src/battle/anim/note_scatter.c +++ b/src/battle/anim/note_scatter.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CED78(struct Sprite* sprite); @@ -16,14 +16,14 @@ static void sub_80CED78(struct Sprite* sprite); void sub_80CECE8(struct Sprite* sprite) { int a; - if (GetBankSide(gBattleAnimBankAttacker) == 1) + if (GetBankSide(gAnimBankAttacker) == 1) { a = gBattleAnimArgs[1]; (u16)gBattleAnimArgs[1] = -a; } - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 2) + gBattleAnimArgs[1]; - sprite->pos1.y = sub_8077ABC(gBattleAnimBankAttacker, 3) + gBattleAnimArgs[2]; + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2) + gBattleAnimArgs[1]; + sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 3) + gBattleAnimArgs[2]; StartSpriteAnim(sprite, gBattleAnimArgs[0]); sprite->data[2] = 0; sprite->data[3] = 0; diff --git a/src/battle/anim/note_scatter_2.c b/src/battle/anim/note_scatter_2.c index a163aa9a5..524c51c08 100755 --- a/src/battle/anim/note_scatter_2.c +++ b/src/battle/anim/note_scatter_2.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern u16 gUnknown_083D712C[4][6]; @@ -52,6 +52,6 @@ void sub_80CEEE8(struct Sprite* sprite) } else { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } diff --git a/src/battle/anim/note_spin.c b/src/battle/anim/note_spin.c index bdc0f4615..026ee1856 100644 --- a/src/battle/anim/note_spin.c +++ b/src/battle/anim/note_spin.c @@ -4,8 +4,8 @@ #include "trig.h" extern s16 gBattleAnimArgs[8]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80D2F80(struct Sprite *); static void sub_80D2FA4(struct Sprite *); @@ -28,7 +28,7 @@ void sub_80D2E68(struct Sprite *sprite) if (sprite->data[0] == sprite->data[1] + 80) { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } @@ -100,11 +100,11 @@ static void sub_80D2FA4(struct Sprite *sprite) { int var1 = sprite->data[2]; sprite->invisible = var1 - (((s32)(var1 + ((u32)var1 >> 31)) >> 1) << 1); - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } if (sprite->data[4] == 4) { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } diff --git a/src/battle/anim/note_wave.c b/src/battle/anim/note_wave.c index 4dc3ceb75..80ed2256f 100755 --- a/src/battle/anim/note_wave.c +++ b/src/battle/anim/note_wave.c @@ -6,8 +6,8 @@ #include "palette.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern u16 gUnknown_083D712C[4][6]; @@ -74,15 +74,15 @@ void sub_80CEB0C(struct Sprite* sprite) sprite->data[1] = gBattleAnimArgs[1]; sprite->data[2] = 0; sprite->data[3] = gBattleAnimArgs[2]; - if (NotInBattle()) + if (IsContest()) { a = 0x30; b = 0x28; } else { - a = sub_8077ABC(gBattleAnimBankTarget, 2); - b = sub_8077ABC(gBattleAnimBankTarget, 3); + a = GetBankPosition(gAnimBankTarget, 2); + b = GetBankPosition(gAnimBankTarget, 3); } sprite->data[4] = sprite->pos1.x << 4; diff --git a/src/battle/anim/orbit.c b/src/battle/anim/orbit.c index 9b77552fa..c8cf339d2 100755 --- a/src/battle/anim/orbit.c +++ b/src/battle/anim/orbit.c @@ -4,8 +4,8 @@ #include "battle_anim.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CAC44(struct Sprite* sprite); static void sub_80CADA8(struct Sprite* sprite); @@ -37,11 +37,11 @@ void sub_80CAC44(struct Sprite* sprite) sprite->pos2.y = Cos(sprite->data[1], -3) + ((sprite->data[2] += 24) >> 8); if ((u16)(sprite->data[1] - 0x40) < 0x80) { - sprite->oam.priority = (sub_8079ED4(gBattleAnimBankTarget) & 3); + sprite->oam.priority = (sub_8079ED4(gAnimBankTarget) & 3); } else { - var1 = sub_8079ED4(gBattleAnimBankTarget) + 1; + var1 = sub_8079ED4(gAnimBankTarget) + 1; if (var1 > 3) { var1 = 3; @@ -53,18 +53,18 @@ void sub_80CAC44(struct Sprite* sprite) sprite->data[1] = (sprite->data[1] + 2) & 0xFF; sprite->data[0]--; if (sprite->data[0] == -1) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } void sub_80CACEC(u8 taskId) { - if (NotInBattle() || !IsDoubleBattle()) + if (IsContest() || !IsDoubleBattle()) { DestroyAnimVisualTask(taskId); } else { - if (GetBankIdentity_permutated(gBattleAnimBankTarget) == 1) + if (GetBankIdentity_permutated(gAnimBankTarget) == 1) { REG_BG2CNT_BITFIELD.priority = 3; } @@ -84,7 +84,7 @@ void sub_80CAD54(struct Sprite* sprite) sprite->data[1] = sprite->pos1.x; sprite->data[2] = sprite->pos1.x; sprite->data[3] = sprite->pos1.y; - sprite->data[4] = sub_8077ABC(gBattleAnimBankAttacker, 3) + gBattleAnimArgs[2]; + sprite->data[4] = GetBankPosition(gAnimBankAttacker, 3) + gBattleAnimArgs[2]; obj_translate_based_on_private_1_2_3_4(sprite); sprite->data[5] = 0x40; sprite->callback = sub_80CADA8; @@ -99,18 +99,18 @@ void sub_80CADA8(struct Sprite* sprite) sprite->pos2.y += Cos(sprite->data[5], -5); if ((u16)(sprite->data[5] - 0x40) < 0x80) { - sprite->subpriority = sub_8079E90(gBattleAnimBankAttacker) - 1; + sprite->subpriority = sub_8079E90(gAnimBankAttacker) - 1; } else { - sprite->subpriority = sub_8079E90(gBattleAnimBankAttacker) + 1; + sprite->subpriority = sub_8079E90(gAnimBankAttacker) + 1; } sprite->data[5] = (sprite->data[5] + 5) & 0xFF; } else { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } @@ -121,7 +121,7 @@ void sub_80CAE20(struct Sprite* sprite) sprite->data[1] = sprite->pos1.x; sprite->data[2] = sprite->pos1.x; sprite->data[3] = sprite->pos1.y; - sprite->data[4] = sub_8077ABC(gBattleAnimBankAttacker, 3) + gBattleAnimArgs[2]; + sprite->data[4] = GetBankPosition(gAnimBankAttacker, 3) + gBattleAnimArgs[2]; obj_translate_based_on_private_1_2_3_4(sprite); sprite->data[5] = 0x40; sprite->callback = sub_80CAE74; @@ -142,6 +142,6 @@ void sub_80CAE74(struct Sprite* sprite) } else { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } diff --git a/src/battle/anim/orbit_fast.c b/src/battle/anim/orbit_fast.c index 30396f398..92b67672b 100755 --- a/src/battle/anim/orbit_fast.c +++ b/src/battle/anim/orbit_fast.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80D2704(struct Sprite* sprite); @@ -15,12 +15,12 @@ static void sub_80D2704(struct Sprite* sprite); void sub_80D26A4(struct Sprite* sprite) { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 2); - sprite->pos1.y = sub_8077ABC(gBattleAnimBankAttacker, 3); + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2); + sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 3); sprite->affineAnimPaused = 1; sprite->data[0] = gBattleAnimArgs[0]; sprite->data[1] = gBattleAnimArgs[1]; - sprite->data[7] = sub_8079E90(gBattleAnimBankAttacker); + sprite->data[7] = sub_8079E90(gAnimBankAttacker); sprite->callback = sub_80D2704; sub_80D2704(sprite); } @@ -58,5 +58,5 @@ void sub_80D2704(struct Sprite* sprite) } if ((u16)gBattleAnimArgs[7] == 0xFFFF) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } diff --git a/src/battle/anim/orbit_scatter.c b/src/battle/anim/orbit_scatter.c index 6cebc9375..54c157839 100755 --- a/src/battle/anim/orbit_scatter.c +++ b/src/battle/anim/orbit_scatter.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80D2834(struct Sprite* sprite); @@ -15,8 +15,8 @@ static void sub_80D2834(struct Sprite* sprite); void sub_80D27E0(struct Sprite* sprite) { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 2); - sprite->pos1.y = sub_8077ABC(gBattleAnimBankAttacker, 3); + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2); + sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 3); sprite->data[0] = Sin(gBattleAnimArgs[0], 10); sprite->data[1] = Cos(gBattleAnimArgs[0], 7); sprite->callback = sub_80D2834; @@ -27,5 +27,5 @@ void sub_80D2834(struct Sprite* sprite) sprite->pos2.x += sprite->data[0]; sprite->pos2.y += sprite->data[1]; if (sprite->pos1.x + sprite->pos2.x + 16 > 0x110u || sprite->pos1.y + sprite->pos2.y > 0xA0 || sprite->pos1.y + sprite->pos2.y < -16) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } diff --git a/src/battle/anim/orbs.c b/src/battle/anim/orbs.c index 22e7d3895..6ca2fa71c 100755 --- a/src/battle/anim/orbs.c +++ b/src/battle/anim/orbs.c @@ -5,8 +5,8 @@ #include "random.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CA8B4(struct Sprite* sprite); static void sub_80CA9F8(struct Sprite* sprite); @@ -21,8 +21,8 @@ void sub_80CA7B0(struct Sprite* sprite) { sub_80787B0(sprite, 1); sprite->data[0] = gBattleAnimArgs[2]; - sprite->data[2] = sub_8077ABC(gBattleAnimBankAttacker, 2); - sprite->data[4] = sub_8077ABC(gBattleAnimBankAttacker, 3); + sprite->data[2] = GetBankPosition(gAnimBankAttacker, 2); + sprite->data[4] = GetBankPosition(gAnimBankAttacker, 3); sprite->callback = sub_8078B34; StoreSpriteCallbackInData(sprite, move_anim_8074EE0); } @@ -32,10 +32,10 @@ void sub_80CA800(struct Sprite* sprite) sub_80787B0(sprite, 1); StartSpriteAnim(sprite, gBattleAnimArgs[3]); sprite->data[0] = gBattleAnimArgs[2]; - sprite->data[2] = sub_8077ABC(gBattleAnimBankTarget, 2); - sprite->data[4] = sub_8077ABC(gBattleAnimBankTarget, 3); + sprite->data[2] = GetBankPosition(gAnimBankTarget, 2); + sprite->data[4] = GetBankPosition(gAnimBankTarget, 3); sprite->callback = sub_8078B34; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); } void sub_80CA858(struct Sprite* sprite) @@ -43,9 +43,9 @@ void sub_80CA858(struct Sprite* sprite) sub_80787B0(sprite, 1); sprite->data[0] = gBattleAnimArgs[2]; sprite->data[1] = sprite->pos1.x; - sprite->data[2] = sub_8077ABC(gBattleAnimBankTarget, 2); + sprite->data[2] = GetBankPosition(gAnimBankTarget, 2); sprite->data[3] = sprite->pos1.y; - sprite->data[4] = sub_8077ABC(gBattleAnimBankTarget, 3); + sprite->data[4] = GetBankPosition(gAnimBankTarget, 3); obj_translate_based_on_private_1_2_3_4(sprite); sprite->data[5] = gBattleAnimArgs[3]; sprite->callback = sub_80CA8B4; @@ -62,11 +62,11 @@ void sub_80CA8B4(struct Sprite* sprite) { if (sprite->data[5] > 0x7F) { - sprite->subpriority = sub_8079E90(gBattleAnimBankTarget) + 1; + sprite->subpriority = sub_8079E90(gAnimBankTarget) + 1; } else { - sprite->subpriority = sub_8079E90(gBattleAnimBankTarget) + 6; + sprite->subpriority = sub_8079E90(gAnimBankTarget) + 6; } sprite->pos2.x += Sin(sprite->data[5], 5); sprite->pos2.y += Cos(sprite->data[5], 14); @@ -85,7 +85,7 @@ void sub_80CA928(u8 taskId) gBattleAnimArgs[1] = 0; gBattleAnimArgs[2] = 80; gBattleAnimArgs[3] = 0; - CreateSpriteAndAnimate(&gSpriteTemplate_83D631C, 0, 0, sub_8079E90(gBattleAnimBankTarget) + 1); + CreateSpriteAndAnimate(&gSpriteTemplate_83D631C, 0, 0, sub_8079E90(gAnimBankTarget) + 1); } if (gTasks[taskId].data[1] == 15) @@ -96,8 +96,8 @@ void sub_80CA9A8(struct Sprite* sprite) { sub_8078764(sprite, 1); sprite->data[0] = gBattleAnimArgs[3]; - sprite->data[2] = sub_8077ABC(gBattleAnimBankAttacker, 2); - sprite->data[4] = sub_8077ABC(gBattleAnimBankAttacker, 3); + sprite->data[2] = GetBankPosition(gAnimBankAttacker, 2); + sprite->data[4] = GetBankPosition(gAnimBankAttacker, 3); sprite->data[5] = gBattleAnimArgs[2]; sub_80786EC(sprite); sprite->callback = sub_80CA9F8; @@ -106,7 +106,7 @@ void sub_80CA9A8(struct Sprite* sprite) void sub_80CA9F8(struct Sprite* sprite) { if (sub_8078718(sprite)) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } void sub_80CAA14(struct Sprite* sprite) @@ -115,9 +115,9 @@ void sub_80CAA14(struct Sprite* sprite) u16 b; StartSpriteAnim(sprite, a & 7); - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 2); - sprite->pos1.y = sub_8077ABC(gBattleAnimBankAttacker, 3); - if (GetBankSide(gBattleAnimBankAttacker)) + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2); + sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 3); + if (GetBankSide(gAnimBankAttacker)) { sprite->pos1.x -= 20; } @@ -129,9 +129,9 @@ void sub_80CAA14(struct Sprite* sprite) b = Random(); sprite->data[0] = (b & 31) + 64; sprite->data[1] = sprite->pos1.x; - sprite->data[2] = sub_8077ABC(gBattleAnimBankTarget, 2); + sprite->data[2] = GetBankPosition(gAnimBankTarget, 2); sprite->data[3] = sprite->pos1.y; - sprite->data[4] = sub_8077ABC(gBattleAnimBankTarget, 3); + sprite->data[4] = GetBankPosition(gAnimBankTarget, 3); sub_8078D60(sprite); sprite->data[5] = Random() & 0xFF; sprite->data[6] = sprite->subpriority; @@ -143,7 +143,7 @@ void sub_80CAACC(struct Sprite* sprite) { if (sub_8078CE8(sprite)) { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } else { diff --git a/src/battle/anim/osmose.c b/src/battle/anim/osmose.c index f1f1b25ff..1140aa34a 100755 --- a/src/battle/anim/osmose.c +++ b/src/battle/anim/osmose.c @@ -4,8 +4,8 @@ #include "battle_anim.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // osmose (I didn't want to use "absorb" as thats confusing) // Used by Ingrain. @@ -14,8 +14,8 @@ void sub_80CB768(struct Sprite* sprite) { if (!sprite->data[0]) { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 2) + gBattleAnimArgs[0]; - sprite->pos1.y = sub_8077ABC(gBattleAnimBankAttacker, 1) + gBattleAnimArgs[1]; + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2) + gBattleAnimArgs[0]; + sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 1) + gBattleAnimArgs[1]; sprite->data[1] = gBattleAnimArgs[2]; sprite->data[2] = gBattleAnimArgs[3]; sprite->data[3] = gBattleAnimArgs[4]; @@ -25,5 +25,5 @@ void sub_80CB768(struct Sprite* sprite) sprite->pos2.x = sprite->data[1] * sprite->data[0]; sprite->pos2.y = Sin((sprite->data[0] * 20) & 0xFF, sprite->data[2]); if (sprite->data[0] > sprite->data[3]) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } diff --git a/src/battle/anim/perceive.c b/src/battle/anim/perceive.c index 27afcbc0c..3b3153428 100755 --- a/src/battle/anim/perceive.c +++ b/src/battle/anim/perceive.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // perceive (shows a sparkle in a set of eyes, usually for heightened perception.) // Used in Glare, Tickle, and Scary Face. @@ -14,7 +14,7 @@ extern u8 gBattleAnimBankTarget; void sub_80D2904(struct Sprite* sprite) { if (sprite->animEnded) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } void sub_80D2920(struct Sprite* sprite) diff --git a/src/battle/anim/powder.c b/src/battle/anim/powder.c index 178a61737..a0be20d6f 100755 --- a/src/battle/anim/powder.c +++ b/src/battle/anim/powder.c @@ -4,7 +4,7 @@ #include "battle_anim.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; +extern u8 gAnimBankAttacker; static void sub_80CA768(struct Sprite* sprite); @@ -18,7 +18,7 @@ void sub_80CA710(struct Sprite* sprite) sprite->data[0] = gBattleAnimArgs[2]; sprite->data[1] = gBattleAnimArgs[3]; - if (GetBankSide(gBattleAnimBankAttacker)) + if (GetBankSide(gAnimBankAttacker)) { sprite->data[3] = -gBattleAnimArgs[4]; } @@ -43,6 +43,6 @@ void sub_80CA768(struct Sprite* sprite) } else { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } diff --git a/src/battle/anim/ring.c b/src/battle/anim/ring.c index 0a5816b23..915cadcbc 100755 --- a/src/battle/anim/ring.c +++ b/src/battle/anim/ring.c @@ -7,8 +7,8 @@ #include "blend_palette.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern u8 gObjectBankIDs[]; @@ -25,18 +25,18 @@ void sub_80D0FD8(struct Sprite* sprite) u8 r4; if (gBattleAnimArgs[2] == 0) - bank = gBattleAnimBankAttacker; + bank = gAnimBankAttacker; else - bank = gBattleAnimBankTarget; + bank = gAnimBankTarget; r4 = gBattleAnimArgs[3] ^ 1; if (IsDoubleBattle() && IsAnimBankSpriteVisible(bank ^ 2)) { sub_807A3FC(bank, r4, &sp0, &sp1); if (r4 == 0) - r4 = sub_8077ABC(bank, 0); + r4 = GetBankPosition(bank, 0); else - r4 = sub_8077ABC(bank, 2); + r4 = GetBankPosition(bank, 2); if (GetBankSide(bank) != 0) gBattleAnimArgs[0] -= (sp0 - r4) - gBattleAnimArgs[0]; // This is weird. @@ -53,7 +53,7 @@ void sub_80D1098(struct Sprite* sprite) if (sub_8078B5C(sprite)) { FreeSpriteOamMatrix(sprite); - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } @@ -70,13 +70,13 @@ void sub_80D10B8(struct Sprite* sprite) if (gBattleAnimArgs[5] == 0) { - bankr7 = gBattleAnimBankAttacker; - bankr8 = gBattleAnimBankTarget; + bankr7 = gAnimBankAttacker; + bankr8 = gAnimBankTarget; } else { - bankr7 = gBattleAnimBankTarget; - bankr8 = gBattleAnimBankAttacker; + bankr7 = gAnimBankTarget; + bankr8 = gAnimBankAttacker; } if (gBattleAnimArgs[6] == 0) @@ -92,7 +92,7 @@ void sub_80D10B8(struct Sprite* sprite) if (GetBankSide(bankr7) != 0) { - r9 = sub_8077ABC(bankr7, r10) + gBattleAnimArgs[0]; + r9 = GetBankPosition(bankr7, r10) + gBattleAnimArgs[0]; if (IsAnimBankSpriteVisible(bankr8 ^ 2)) sprite->subpriority = gSprites[gObjectBankIDs[bankr8 ^ 2]].subpriority - 1; else @@ -100,7 +100,7 @@ void sub_80D10B8(struct Sprite* sprite) } else { - r9 = sub_8077ABC(bankr7, r10) - gBattleAnimArgs[0]; + r9 = GetBankPosition(bankr7, r10) - gBattleAnimArgs[0]; if (gMain.inBattle && IsAnimBankSpriteVisible(bankr7 ^ 2)) { if (gSprites[gObjectBankIDs[bankr7]].pos1.x < gSprites[gObjectBankIDs[bankr7 ^ 2]].pos1.x) @@ -115,15 +115,15 @@ void sub_80D10B8(struct Sprite* sprite) } - r6 = sub_8077ABC(bankr7, sp4) + gBattleAnimArgs[1]; + r6 = GetBankPosition(bankr7, sp4) + gBattleAnimArgs[1]; if (gMain.inBattle && IsAnimBankSpriteVisible(bankr8 ^ 2)) { sub_807A3FC(bankr8, gBattleAnimArgs[6], &sp0, &sp1); } else { - sp0 = sub_8077ABC(bankr8, r10); - sp1 = sub_8077ABC(bankr8, sp4); + sp0 = GetBankPosition(bankr8, r10); + sp1 = GetBankPosition(bankr8, sp4); } if (GetBankSide(bankr8)) diff --git a/src/battle/anim/roots.c b/src/battle/anim/roots.c index 40c51808a..68f8a3e2f 100755 --- a/src/battle/anim/roots.c +++ b/src/battle/anim/roots.c @@ -4,8 +4,8 @@ #include "battle_anim.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern s16 gUnknown_03000728[]; @@ -18,8 +18,8 @@ void sub_80CB59C(struct Sprite* sprite) { if (!sprite->data[0]) { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 2); - sprite->pos1.y = sub_8077ABC(gBattleAnimBankAttacker, 1); + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2); + sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 1); sprite->pos2.x = gBattleAnimArgs[0]; sprite->pos2.y = gBattleAnimArgs[1]; sprite->subpriority = gBattleAnimArgs[2] + 30; @@ -36,10 +36,10 @@ void sub_80CB59C(struct Sprite* sprite) void sub_80CB620(struct Sprite *sprite) { - s16 p1 = sub_8077ABC(gBattleAnimBankAttacker, 2); - s16 p2 = sub_8077ABC(gBattleAnimBankAttacker, 3); - s16 e1 = sub_8077ABC(gBattleAnimBankTarget, 2); - s16 e2 = sub_8077ABC(gBattleAnimBankTarget, 3); + s16 p1 = GetBankPosition(gAnimBankAttacker, 2); + s16 p2 = GetBankPosition(gAnimBankAttacker, 3); + s16 e1 = GetBankPosition(gAnimBankTarget, 2); + s16 e2 = GetBankPosition(gAnimBankTarget, 3); e1 -= p1; e2 -= p2; @@ -63,5 +63,5 @@ void sub_80CB710(struct Sprite* sprite) sprite->invisible = sprite->data[0] % 2; if (sprite->data[0] > sprite->data[2]) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } diff --git a/src/battle/anim/scan.c b/src/battle/anim/scan.c index 5573758c3..22bb26973 100755 --- a/src/battle/anim/scan.c +++ b/src/battle/anim/scan.c @@ -6,8 +6,8 @@ #include "palette.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern s8 gUnknown_083D6DDC[4][2]; @@ -50,7 +50,7 @@ void sub_80CD408(struct Sprite* sprite) sprite->callback = sub_8078B34; StoreSpriteCallbackInData(sprite, sub_80CD4B8); sprite->data[5] += 0x100; - PlaySE12WithPanning(0xD2, sub_8076F98(0x3F)); + PlaySE12WithPanning(0xD2, BattleAnimAdjustPanning(0x3F)); break; } @@ -110,8 +110,8 @@ void sub_80CD4EC(struct Sprite* sprite) sprite->pos2.y = 0; sprite->pos2.x = 0; sprite->data[0] = 6; - sprite->data[2] = sub_8077ABC(gBattleAnimBankTarget, 2) + a; - sprite->data[4] = sub_8077ABC(gBattleAnimBankTarget, 3) + b; + sprite->data[2] = GetBankPosition(gAnimBankTarget, 2) + a; + sprite->data[4] = GetBankPosition(gAnimBankTarget, 3) + b; sprite->callback = sub_8078B34; StoreSpriteCallbackInData(sprite, sub_80CD654); } @@ -136,7 +136,7 @@ void sub_80CD5A8(struct Sprite* sprite) sprite->data[2]++; pal = sprite->oam.paletteNum; LoadPalette(&gPlttBufferUnfaded[0x108 + pal * 16], pal * 16 | 0x101, 4); - PlaySE12WithPanning(0xC0, sub_8076F98(0x3F)); + PlaySE12WithPanning(0xC0, BattleAnimAdjustPanning(0x3F)); } else if (sprite->data[1] == 0) { @@ -164,7 +164,7 @@ void sub_80CD67C(struct Sprite* sprite) sprite->data[0]++; if (sprite->data[1] == 8) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } void sub_80CD6CC(struct Sprite* sprite) diff --git a/src/battle/anim/scary_face.c b/src/battle/anim/scary_face.c index 0c5056704..47776a3cb 100755 --- a/src/battle/anim/scary_face.c +++ b/src/battle/anim/scary_face.c @@ -7,8 +7,8 @@ #include "palette.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern struct INCBIN_U8 gBattleAnimBackgroundTilemap_ScaryFaceContest; extern struct INCBIN_U8 gBattleAnimBackgroundTilemap_ScaryFacePlayer; @@ -16,8 +16,8 @@ extern struct INCBIN_U8 gBattleAnimBackgroundTilemap_ScaryFaceOpponent; extern struct INCBIN_U8 gBattleAnimBackgroundImage_ScaryFace; extern struct INCBIN_U8 gBattleAnimBackgroundPalette_ScaryFace; -extern u16 gUnknown_030041B4; -extern u16 gUnknown_030042C0; +extern u16 gBattle_BG1_Y; +extern u16 gBattle_BG1_X; static void sub_80D24E0(u8 taskId); @@ -32,26 +32,26 @@ void sub_80D23B4(u8 taskId) REG_BLDALPHA = 0x1000; REG_BG1CNT_BITFIELD.priority = 1; REG_BG1CNT_BITFIELD.screenSize = 0; - if (!NotInBattle()) + if (!IsContest()) REG_BG1CNT_BITFIELD.charBaseBlock = 1; - gUnknown_030042C0 = 0; - gUnknown_030041B4 = 0; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; REG_BG1HOFS = 0; REG_BG1VOFS = 0; sub_8078914(&subStruct); tempvar = subStruct.field_4; DmaFill32(3, 0x0, tempvar, 0x1000); - if (NotInBattle()) + if (IsContest()) LZDecompressVram(&gBattleAnimBackgroundTilemap_ScaryFaceContest, subStruct.field_4); - else if (GetBankSide(gBattleAnimBankTarget) == 1) + else if (GetBankSide(gAnimBankTarget) == 1) LZDecompressVram(&gBattleAnimBackgroundTilemap_ScaryFacePlayer, subStruct.field_4); else LZDecompressVram(&gBattleAnimBackgroundTilemap_ScaryFaceOpponent, subStruct.field_4); LZDecompressVram(&gBattleAnimBackgroundImage_ScaryFace, subStruct.field_0); LoadCompressedPalette(&gBattleAnimBackgroundPalette_ScaryFace, subStruct.field_8 << 4, 32); - if (NotInBattle()) + if (IsContest()) sub_80763FC(subStruct.field_8, (u16 *)subStruct.field_4, 0, 0); gTasks[taskId].func = sub_80D24E0; @@ -114,7 +114,7 @@ void sub_80D24E0(u8 taskId) } } DmaClear32(3, subStruct.field_4, 0x800); - if (!NotInBattle()) + if (!IsContest()) REG_BG1CNT_BITFIELD.charBaseBlock = 0; gTasks[taskId].data[12]++; diff --git a/src/battle/anim/seed.c b/src/battle/anim/seed.c index bd072849a..be8613a74 100755 --- a/src/battle/anim/seed.c +++ b/src/battle/anim/seed.c @@ -4,8 +4,8 @@ #include "battle_anim.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CAB88(struct Sprite* sprite); static void sub_80CABC0(struct Sprite* sprite); @@ -16,14 +16,14 @@ static void sub_80CABC0(struct Sprite* sprite); void sub_80CAB18(struct Sprite* sprite) { sub_80787B0(sprite, 1); - if (GetBankSide(gBattleAnimBankAttacker)) + if (GetBankSide(gAnimBankAttacker)) { gBattleAnimArgs[2] = -gBattleAnimArgs[2]; } sprite->data[0] = gBattleAnimArgs[4]; - sprite->data[2] = sub_8077ABC(gBattleAnimBankTarget, 0) + gBattleAnimArgs[2]; - sprite->data[4] = sub_8077ABC(gBattleAnimBankTarget, 1) + gBattleAnimArgs[3]; + sprite->data[2] = GetBankPosition(gAnimBankTarget, 0) + gBattleAnimArgs[2]; + sprite->data[4] = GetBankPosition(gAnimBankTarget, 1) + gBattleAnimArgs[3]; sprite->data[5] = gBattleAnimArgs[5]; sub_80786EC(sprite); sprite->callback = sub_80CAB88; @@ -46,5 +46,5 @@ void sub_80CABC0(struct Sprite* sprite) StartSpriteAnim(sprite, 1); sprite->data[0] = 60; sprite->callback = sub_80782D8; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); } diff --git a/src/battle/anim/shadow_enlarge.c b/src/battle/anim/shadow_enlarge.c index bed6c7ea3..399cf1ba4 100755 --- a/src/battle/anim/shadow_enlarge.c +++ b/src/battle/anim/shadow_enlarge.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80D0428(u8 taskId); diff --git a/src/battle/anim/shadow_minimize.c b/src/battle/anim/shadow_minimize.c index 22ebeab7a..94069374f 100755 --- a/src/battle/anim/shadow_minimize.c +++ b/src/battle/anim/shadow_minimize.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80D04E0(u8 taskId); void sub_80D0614(struct Task* task, u8 taskId); @@ -27,7 +27,7 @@ void sub_80D0488(u8 taskId) task->data[4] = 0x100; task->data[5] = 0; task->data[6] = 0; - task->data[7] = sub_8079E90(gBattleAnimBankAttacker); + task->data[7] = sub_8079E90(gAnimBankAttacker); task->func = sub_80D04E0; } diff --git a/src/battle/anim/shield.c b/src/battle/anim/shield.c index 8ed4f9796..676318545 100755 --- a/src/battle/anim/shield.c +++ b/src/battle/anim/shield.c @@ -6,8 +6,8 @@ #include "palette.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CCE0C(struct Sprite* sprite); @@ -16,17 +16,17 @@ static void sub_80CCE0C(struct Sprite* sprite); void sub_80CCD24(struct Sprite* sprite) { - if (NotInBattle() != 0) + if (IsContest() != 0) { gBattleAnimArgs[1] += 8; } - sprite->pos1.x = sub_8077EE4(gBattleAnimBankAttacker, 0) + gBattleAnimArgs[0]; - sprite->pos1.y = sub_8077EE4(gBattleAnimBankAttacker, 1) + gBattleAnimArgs[1]; - if (GetBankSide(gBattleAnimBankAttacker) == 0 || NotInBattle()) - sprite->oam.priority = sub_8079ED4(gBattleAnimBankAttacker) + 1; + sprite->pos1.x = sub_8077EE4(gAnimBankAttacker, 0) + gBattleAnimArgs[0]; + sprite->pos1.y = sub_8077EE4(gAnimBankAttacker, 1) + gBattleAnimArgs[1]; + if (GetBankSide(gAnimBankAttacker) == 0 || IsContest()) + sprite->oam.priority = sub_8079ED4(gAnimBankAttacker) + 1; else - sprite->oam.priority = sub_8079ED4(gBattleAnimBankAttacker); + sprite->oam.priority = sub_8079ED4(gAnimBankAttacker); sprite->data[0] = gBattleAnimArgs[2]; sprite->data[2] = (IndexOfSpritePaletteTag(0x2828) << 4) + 0x100; diff --git a/src/battle/anim/shimmer.c b/src/battle/anim/shimmer.c index ecb3dcdf9..9e7bea1e4 100755 --- a/src/battle/anim/shimmer.c +++ b/src/battle/anim/shimmer.c @@ -6,8 +6,8 @@ #include "blend_palette.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern u16 gUnknown_083D6984[]; diff --git a/src/battle/anim/shock.c b/src/battle/anim/shock.c index 35c380f23..16e04c9db 100644 --- a/src/battle/anim/shock.c +++ b/src/battle/anim/shock.c @@ -4,8 +4,8 @@ #include "trig.h" extern s16 gBattleAnimArgs[8]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern struct OamMatrix gOamMatrices[]; extern void sub_80DA48C(struct Sprite *); @@ -15,10 +15,10 @@ extern void sub_80DA48C(struct Sprite *); void sub_80D6294(struct Sprite *sprite) { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankTarget, 2); - sprite->pos1.y = sub_8077ABC(gBattleAnimBankTarget, 3); + sprite->pos1.x = GetBankPosition(gAnimBankTarget, 2); + sprite->pos1.y = GetBankPosition(gAnimBankTarget, 3); - if (GetBankSide(gBattleAnimBankAttacker) != 0) + if (GetBankSide(gAnimBankAttacker) != 0) { sprite->pos1.x -= gBattleAnimArgs[0]; sprite->pos1.y -= gBattleAnimArgs[1]; @@ -47,43 +47,43 @@ void sub_80D6328(struct Sprite *sprite) switch (gBattleAnimArgs[4]) { case 0: - slot = gBattleAnimBankAttacker; + slot = gAnimBankAttacker; break; case 1: default: - slot = gBattleAnimBankTarget; + slot = gAnimBankTarget; break; case 2: - if (!IsAnimBankSpriteVisible(gBattleAnimBankAttacker ^ 2)) + if (!IsAnimBankSpriteVisible(gAnimBankAttacker ^ 2)) { - slot = gBattleAnimBankAttacker; + slot = gAnimBankAttacker; } else { - slot = gBattleAnimBankAttacker ^ 2; + slot = gAnimBankAttacker ^ 2; } break; case 3: - if (IsAnimBankSpriteVisible(gBattleAnimBankAttacker ^ 2)) + if (IsAnimBankSpriteVisible(gAnimBankAttacker ^ 2)) { - slot = gBattleAnimBankTarget ^ 2; + slot = gAnimBankTarget ^ 2; } else { - slot = gBattleAnimBankTarget; + slot = gAnimBankTarget; } break; } if (gBattleAnimArgs[5] == 0) { - sprite->pos1.x = sub_8077ABC(slot, 0); - sprite->pos1.y = sub_8077ABC(slot, 1); + sprite->pos1.x = GetBankPosition(slot, 0); + sprite->pos1.y = GetBankPosition(slot, 1); } else { - sprite->pos1.x = sub_8077ABC(slot, 2); - sprite->pos1.y = sub_8077ABC(slot, 3); + sprite->pos1.x = GetBankPosition(slot, 2); + sprite->pos1.y = GetBankPosition(slot, 3); } sprite->pos2.x = (gSineTable[gBattleAnimArgs[0]] * gBattleAnimArgs[1]) >> 8; diff --git a/src/battle/anim/silhouette.c b/src/battle/anim/silhouette.c index 71ff3dae2..a3147f598 100755 --- a/src/battle/anim/silhouette.c +++ b/src/battle/anim/silhouette.c @@ -4,8 +4,8 @@ #include "battle_anim.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CB3A8(u8 taskId); static void sub_80CB438(u8 taskId); @@ -35,7 +35,7 @@ void sub_80CB3A8(u8 taskId) u8 spriteId = GetAnimBankSpriteId(1); gTasks[taskId].data[10] += gTasks[taskId].data[0]; gSprites[spriteId].pos2.x = gTasks[taskId].data[10] >> 8; - if (GetBankSide(gBattleAnimBankTarget)) + if (GetBankSide(gAnimBankTarget)) { gSprites[spriteId].pos2.x = -gSprites[spriteId].pos2.x; } diff --git a/src/battle/anim/slash.c b/src/battle/anim/slash.c index c5869c4ab..6adcaf098 100755 --- a/src/battle/anim/slash.c +++ b/src/battle/anim/slash.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CDE78(struct Sprite* sprite); static void sub_80CDEB0(struct Sprite* sprite); @@ -19,13 +19,13 @@ void sub_80CDD74(struct Sprite* sprite) { if (gBattleAnimArgs[0] == 0) { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 2) + gBattleAnimArgs[1]; - sprite->pos1.y = sub_8077ABC(gBattleAnimBankAttacker, 3) + gBattleAnimArgs[2]; + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2) + gBattleAnimArgs[1]; + sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 3) + gBattleAnimArgs[2]; } else { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankTarget, 2) + gBattleAnimArgs[1]; - sprite->pos1.y = sub_8077ABC(gBattleAnimBankTarget, 3) + gBattleAnimArgs[2]; + sprite->pos1.x = GetBankPosition(gAnimBankTarget, 2) + gBattleAnimArgs[1]; + sprite->pos1.y = GetBankPosition(gAnimBankTarget, 3) + gBattleAnimArgs[2]; } sprite->data[0] = 0; @@ -36,16 +36,16 @@ void sub_80CDD74(struct Sprite* sprite) void sub_80CDDDC(struct Sprite* sprite) { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankTarget, 2) + 0xFFD0; - sprite->pos1.y = sub_8077ABC(gBattleAnimBankTarget, 3); + sprite->pos1.x = GetBankPosition(gAnimBankTarget, 2) + 0xFFD0; + sprite->pos1.y = GetBankPosition(gAnimBankTarget, 3); StoreSpriteCallbackInData(sprite, sub_80CDE78); sprite->callback = sub_8078600; } void sub_80CDE24(struct Sprite* sprite) { - sprite->pos1.x = sprite->pos1.x = sub_8077ABC(gBattleAnimBankTarget, 2) + 0xFFD0 + gBattleAnimArgs[0]; - sprite->pos1.y = sub_8077ABC(gBattleAnimBankTarget, 3); + sprite->pos1.x = sprite->pos1.x = GetBankPosition(gAnimBankTarget, 2) + 0xFFD0 + gBattleAnimArgs[0]; + sprite->pos1.y = GetBankPosition(gAnimBankTarget, 3); StartSpriteAnim(sprite, 1); sprite->data[0] = 0; sprite->data[1] = 0; @@ -78,6 +78,6 @@ void sub_80CDEC0(struct Sprite* sprite) sprite->data[0] = 0; sprite->invisible = !sprite->invisible; if (++sprite->data[1] > 8) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } diff --git a/src/battle/anim/sleep.c b/src/battle/anim/sleep.c index 58ecc702f..0f0e54f80 100755 --- a/src/battle/anim/sleep.c +++ b/src/battle/anim/sleep.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CD394(struct Sprite* sprite); @@ -16,7 +16,7 @@ static void sub_80CD394(struct Sprite* sprite); void sub_80CD328(struct Sprite* sprite) { sub_8078650(sprite); - if (GetBankSide(gBattleAnimBankAttacker) == 0) + if (GetBankSide(gAnimBankAttacker) == 0) { sprite->pos1.x += gBattleAnimArgs[0]; sprite->pos1.y += gBattleAnimArgs[1]; diff --git a/src/battle/anim/slice.c b/src/battle/anim/slice.c index 8e33dcb06..fe8745483 100755 --- a/src/battle/anim/slice.c +++ b/src/battle/anim/slice.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CCB00(struct Sprite* sprite); @@ -15,9 +15,9 @@ static void sub_80CCB00(struct Sprite* sprite); void sub_80CC914(struct Sprite* sprite) { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankTarget, 0); - sprite->pos1.y = sub_8077ABC(gBattleAnimBankTarget, 1); - if (GetBankSide(gBattleAnimBankTarget) == 0) + sprite->pos1.x = GetBankPosition(gAnimBankTarget, 0); + sprite->pos1.y = GetBankPosition(gAnimBankTarget, 1); + if (GetBankSide(gAnimBankTarget) == 0) sprite->pos1.y += 8; sprite->callback = sub_80CCB00; @@ -46,28 +46,28 @@ void sub_80CC9BC(struct Sprite* sprite) switch (gBattleAnimArgs[3]) { case 1: - a = sub_8077ABC(gBattleAnimBankTarget ^ 2, 0); - b = sub_8077ABC(gBattleAnimBankTarget ^ 2, 1); + a = GetBankPosition(gAnimBankTarget ^ 2, 0); + b = GetBankPosition(gAnimBankTarget ^ 2, 1); break; case 2: - a = sub_8077ABC(gBattleAnimBankTarget, 0); - b = sub_8077ABC(gBattleAnimBankTarget, 1); - if (IsAnimBankSpriteVisible(gBattleAnimBankTarget ^ 2)) + a = GetBankPosition(gAnimBankTarget, 0); + b = GetBankPosition(gAnimBankTarget, 1); + if (IsAnimBankSpriteVisible(gAnimBankTarget ^ 2)) { - a = (sub_8077ABC(gBattleAnimBankTarget ^ 2, 0) + a) / 2; - b = (sub_8077ABC(gBattleAnimBankTarget ^ 2, 1) + b) / 2; + a = (GetBankPosition(gAnimBankTarget ^ 2, 0) + a) / 2; + b = (GetBankPosition(gAnimBankTarget ^ 2, 1) + b) / 2; } break; case 0: default: - a = sub_8077ABC(gBattleAnimBankTarget, 0); - b = sub_8077ABC(gBattleAnimBankTarget, 1); + a = GetBankPosition(gAnimBankTarget, 0); + b = GetBankPosition(gAnimBankTarget, 1); break; } sprite->pos1.x = a; sprite->pos1.y = b; - if (GetBankSide(gBattleAnimBankTarget) == 0) + if (GetBankSide(gAnimBankTarget) == 0) sprite->pos1.y += 8; sprite->callback = sub_80CCB00; @@ -104,7 +104,7 @@ void sub_80CCB00(struct Sprite* sprite) sprite->data[0]++; if (sprite->data[0] == 20) { - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); sprite->data[0] = 3; sprite->callback = sub_80782D8; } diff --git a/src/battle/anim/smoke.c b/src/battle/anim/smoke.c index c6ce91b76..7ab873e63 100755 --- a/src/battle/anim/smoke.c +++ b/src/battle/anim/smoke.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // smoke (smoke on the ground around a sprite.) // Used in Extremespeed. diff --git a/src/battle/anim/sonic.c b/src/battle/anim/sonic.c index 684516ba7..0897ec6e3 100755 --- a/src/battle/anim/sonic.c +++ b/src/battle/anim/sonic.c @@ -6,8 +6,8 @@ #include "battle_anim_80CA710.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // sonic (shoots a projectile towards the target.) // Used in Sonic Boom and Air Cutter. @@ -18,11 +18,11 @@ void sub_80CF6DC(struct Sprite* sprite) s16 b; u16 c; - if (NotInBattle()) + if (IsContest()) { gBattleAnimArgs[2] = -gBattleAnimArgs[2]; } - else if (GetBankSide(gBattleAnimBankAttacker) != 0) + else if (GetBankSide(gAnimBankAttacker) != 0) { gBattleAnimArgs[2] = -gBattleAnimArgs[2]; gBattleAnimArgs[1] = -gBattleAnimArgs[1]; @@ -30,11 +30,11 @@ void sub_80CF6DC(struct Sprite* sprite) } sub_80787B0(sprite, 1); - a = sub_8077ABC(gBattleAnimBankTarget, 2) + gBattleAnimArgs[2]; - b = sub_8077ABC(gBattleAnimBankTarget, 3) + gBattleAnimArgs[3]; + a = GetBankPosition(gAnimBankTarget, 2) + gBattleAnimArgs[2]; + b = GetBankPosition(gAnimBankTarget, 3) + gBattleAnimArgs[3]; c = sub_80790F0(a - sprite->pos1.x, b - sprite->pos1.y); c += 0xF000; - if (NotInBattle()) + if (IsContest()) c -= 0x6000; sub_8078FDC(sprite, 0, 0x100, 0x100, c); @@ -42,7 +42,7 @@ void sub_80CF6DC(struct Sprite* sprite) sprite->data[2] = a; sprite->data[4] = b; sprite->callback = sub_8078B34; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); } void sub_80CF7E0(struct Sprite* sprite) diff --git a/src/battle/anim/sonic_task.c b/src/battle/anim/sonic_task.c index efd13dff6..924b1b568 100755 --- a/src/battle/anim/sonic_task.c +++ b/src/battle/anim/sonic_task.c @@ -7,8 +7,8 @@ #include "battle.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern u8 gBanksBySide[]; extern u16 gBattleTypeFlags; @@ -46,7 +46,7 @@ void sub_80CFA20(u8 taskId) gTasks[taskId].data[gTasks[taskId].data[1] + 13] = spriteId; gTasks[taskId].data[0] = gTasks[taskId].data[3]; gTasks[taskId].data[1]++; - PlaySE12WithPanning(0x9A, sub_8076F98(-0x3F)); + PlaySE12WithPanning(0x9A, BattleAnimAdjustPanning(-0x3F)); if (gTasks[taskId].data[1] > 2) gTasks[taskId].func = sub_80CF9F8; } @@ -60,7 +60,7 @@ void sub_80CFB04(u8 taskId) s16 sp2 = 0; s16 r4; - if (NotInBattle()) + if (IsContest()) { gTasks[taskId].data[4] = 2; gBattleAnimArgs[0] = -gBattleAnimArgs[0]; @@ -71,7 +71,7 @@ void sub_80CFB04(u8 taskId) } else { - if ((gBanksBySide[gBattleAnimBankTarget] & 1) == 0) + if ((gBanksBySide[gAnimBankTarget] & 1) == 0) { gTasks[taskId].data[4] = 1; gBattleAnimArgs[0] = -gBattleAnimArgs[0]; @@ -82,17 +82,17 @@ void sub_80CFB04(u8 taskId) gBattleAnimArgs[2] |= 1; } } - r6 = gTasks[taskId].data[9] = sub_8077ABC(gBattleAnimBankAttacker, 0); - r9 = gTasks[taskId].data[10] = sub_8077ABC(gBattleAnimBankAttacker, 1); + r6 = gTasks[taskId].data[9] = GetBankPosition(gAnimBankAttacker, 0); + r9 = gTasks[taskId].data[10] = GetBankPosition(gAnimBankAttacker, 1); if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) - && IsAnimBankSpriteVisible(gBattleAnimBankTarget ^ 2)) + && IsAnimBankSpriteVisible(gAnimBankTarget ^ 2)) { - sub_807A3FC(gBattleAnimBankTarget, 0, &sp1, &sp2); + sub_807A3FC(gAnimBankTarget, 0, &sp1, &sp2); } else { - sp1 = sub_8077ABC(gBattleAnimBankTarget, 0); - sp2 = sub_8077ABC(gBattleAnimBankTarget, 1); + sp1 = GetBankPosition(gAnimBankTarget, 0); + sp2 = GetBankPosition(gAnimBankTarget, 1); } sp1 = gTasks[taskId].data[11] = sp1 + gBattleAnimArgs[0]; @@ -122,12 +122,12 @@ void sub_80CFB04(u8 taskId) gBattleAnimArgs[4] ^= 0x80; if (gBattleAnimArgs[4] >= 64) { - u16 var = sub_8079E90(gBattleAnimBankTarget) + (gBattleAnimArgs[4] - 64); + u16 var = sub_8079E90(gAnimBankTarget) + (gBattleAnimArgs[4] - 64); gTasks[taskId].data[2] = var; } else { - u16 var = sub_8079E90(gBattleAnimBankTarget) - gBattleAnimArgs[4]; + u16 var = sub_8079E90(gAnimBankTarget) - gBattleAnimArgs[4]; gTasks[taskId].data[2] = var; } } @@ -135,12 +135,12 @@ void sub_80CFB04(u8 taskId) { if (gBattleAnimArgs[4] >= 64) { - u16 var = sub_8079E90(gBattleAnimBankTarget) + (gBattleAnimArgs[4] - 64); + u16 var = sub_8079E90(gAnimBankTarget) + (gBattleAnimArgs[4] - 64); gTasks[taskId].data[2] = var; } else { - u16 var = sub_8079E90(gBattleAnimBankTarget) - gBattleAnimArgs[4]; + u16 var = sub_8079E90(gAnimBankTarget) - gBattleAnimArgs[4]; gTasks[taskId].data[2] = var; } } diff --git a/src/battle/anim/spin_finger.c b/src/battle/anim/spin_finger.c index adf41b261..8eb060358 100755 --- a/src/battle/anim/spin_finger.c +++ b/src/battle/anim/spin_finger.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern void sub_80CF088(struct Sprite* sprite); static void sub_80CF138(struct Sprite* sprite); @@ -19,11 +19,11 @@ void sub_80CF0BC(struct Sprite* sprite) { u8 bank; if (gBattleAnimArgs[0] == 0) - bank = gBattleAnimBankAttacker; + bank = gAnimBankAttacker; else - bank = gBattleAnimBankTarget; + bank = gAnimBankTarget; - sprite->pos1.x = sub_8077ABC(bank, 0); + sprite->pos1.x = GetBankPosition(bank, 0); sprite->pos1.y = sub_807A100(bank, 2); if (sprite->pos1.y <= 9) sprite->pos1.y = 10; diff --git a/src/battle/anim/spit.c b/src/battle/anim/spit.c index f9ad462ae..1e65ba53e 100755 --- a/src/battle/anim/spit.c +++ b/src/battle/anim/spit.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // spit (hurls sprites outward from the pokemon. Similar to orbit_fast, but takes another argument.) // Used in Spit Up. @@ -16,13 +16,13 @@ void sub_80D287C(struct Sprite* sprite) sprite->pos2.x += sprite->data[0]; sprite->pos2.y += sprite->data[1]; if (sprite->data[3]++ >= sprite->data[2]) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } void sub_80D28AC(struct Sprite* sprite) { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 2); - sprite->pos1.y = sub_8077ABC(gBattleAnimBankAttacker, 3); + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2); + sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 3); sprite->data[0] = Sin(gBattleAnimArgs[0], 10); sprite->data[1] = Cos(gBattleAnimArgs[0], 7); sprite->data[2] = gBattleAnimArgs[1]; diff --git a/src/battle/anim/splash.c b/src/battle/anim/splash.c index 1b0ceba93..570ef0dca 100755 --- a/src/battle/anim/splash.c +++ b/src/battle/anim/splash.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern struct AffineAnimFrameCmd gUnknown_083D76F4; diff --git a/src/battle/anim/startle.c b/src/battle/anim/startle.c index acbf80fec..50e78af37 100755 --- a/src/battle/anim/startle.c +++ b/src/battle/anim/startle.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern struct AffineAnimFrameCmd gUnknown_083D7A98; diff --git a/src/battle/anim/strike.c b/src/battle/anim/strike.c index f2fbdb5a4..bfa1dc4f7 100755 --- a/src/battle/anim/strike.c +++ b/src/battle/anim/strike.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CE798(struct Sprite* sprite); @@ -23,11 +23,11 @@ void sub_80CE670(struct Sprite* sprite) sprite->data[0] = 0; sprite->data[1] = gBattleAnimArgs[2]; - sprite->pos1.x = sub_8077ABC(gBattleAnimBankTarget, 2) + gBattleAnimArgs[0]; - sprite->pos1.y = sub_8077ABC(gBattleAnimBankTarget, 3) + gBattleAnimArgs[1]; + sprite->pos1.x = GetBankPosition(gAnimBankTarget, 2) + gBattleAnimArgs[0]; + sprite->pos1.y = GetBankPosition(gAnimBankTarget, 3) + gBattleAnimArgs[1]; sprite->data[6] = sprite->pos1.x; sprite->data[7] = sprite->pos1.y; - if (NotInBattle() != 0) + if (IsContest() != 0) { sprite->oam.matrixNum = 8; sprite->pos1.x += 40; @@ -37,7 +37,7 @@ void sub_80CE670(struct Sprite* sprite) sprite->data[4] = sprite->pos1.y << 7; sprite->data[5] = -0xA00 / sprite->data[1]; } - else if (GetBankSide(gBattleAnimBankAttacker) == 0) + else if (GetBankSide(gAnimBankAttacker) == 0) { sprite->pos1.x -= 40; sprite->pos1.y += 20; @@ -73,5 +73,5 @@ void sub_80CE798(struct Sprite* sprite) } if (sprite->data[1] == 0) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } diff --git a/src/battle/anim/struggle.c b/src/battle/anim/struggle.c index 63a01a79e..20dbaf2dc 100644 --- a/src/battle/anim/struggle.c +++ b/src/battle/anim/struggle.c @@ -4,8 +4,8 @@ #include "sprite.h" extern s16 gBattleAnimArgs[8]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80D2CC4(struct Sprite *); @@ -13,19 +13,19 @@ void sub_80D2C38(struct Sprite *sprite) { if (gBattleAnimArgs[2] == 0) { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } else { if (gBattleAnimArgs[0] == 0) { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 2); - sprite->pos1.y = sub_8077ABC(gBattleAnimBankAttacker, 3); + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2); + sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 3); } else { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankTarget, 2); - sprite->pos1.y = sub_8077ABC(gBattleAnimBankTarget, 3); + sprite->pos1.x = GetBankPosition(gAnimBankTarget, 2); + sprite->pos1.y = GetBankPosition(gAnimBankTarget, 3); } if (gBattleAnimArgs[1] == 0) @@ -47,6 +47,6 @@ static void sub_80D2CC4(struct Sprite *sprite) if (--sprite->data[0] != 0) StartSpriteAnim(sprite, sprite->data[1]); else - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } diff --git a/src/battle/anim/sunlight.c b/src/battle/anim/sunlight.c index f6cb8a077..e6fd49a11 100644 --- a/src/battle/anim/sunlight.c +++ b/src/battle/anim/sunlight.c @@ -13,5 +13,5 @@ void sub_80D517C(struct Sprite *sprite) sprite->data[2] = 140; sprite->data[4] = 80; sprite->callback = sub_8078B34; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); } diff --git a/src/battle/anim/swipe.c b/src/battle/anim/swipe.c index 15bee06ee..922b11a5f 100644 --- a/src/battle/anim/swipe.c +++ b/src/battle/anim/swipe.c @@ -15,6 +15,6 @@ void sub_80D2BE8(struct Sprite *sprite) } else if (sprite->animEnded) { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } diff --git a/src/battle/anim/switch.c b/src/battle/anim/switch.c index a1be144df..c4082b6aa 100755 --- a/src/battle/anim/switch.c +++ b/src/battle/anim/switch.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern s8 gUnknown_083D680C[11][3]; @@ -24,7 +24,7 @@ void sub_80CBBF0(struct Sprite* sprite) if (sprite->data[0] == 0) { - if (!NotInBattle()) + if (!IsContest()) { sprite->data[1] = gBattleAnimArgs[1]; sprite->pos1.x = 0x78; @@ -101,7 +101,7 @@ void sub_80CBCF8(struct Sprite* sprite) { sprite->data[2]++; sprite->data[1] = (gUnknown_083D680C[sprite->data[0]][0] * gUnknown_083D680C[sprite->data[0]][2] + sprite->data[1]) & 0xFF; - if (!NotInBattle()) + if (!IsContest()) { if ((u16)(sprite->data[1] - 1) <= 0xBE) { @@ -121,7 +121,7 @@ void sub_80CBCF8(struct Sprite* sprite) void sub_80CBDB0(struct Sprite* sprite) { if (sprite->data[0] > 20) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); sprite->invisible = sprite->data[0] % 2; sprite->data[0]++; diff --git a/src/battle/anim/sword.c b/src/battle/anim/sword.c index 536f89b26..b46fe6759 100755 --- a/src/battle/anim/sword.c +++ b/src/battle/anim/sword.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CF6B4(struct Sprite* sprite); @@ -26,5 +26,5 @@ void sub_80CF6B4(struct Sprite* sprite) sprite->data[2] = sprite->pos1.x; sprite->data[4] = sprite->pos1.y - 32; sprite->callback = sub_8078B34; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); } diff --git a/src/battle/anim/taunt_finger.c b/src/battle/anim/taunt_finger.c index 7024f85a0..023e14e45 100755 --- a/src/battle/anim/taunt_finger.c +++ b/src/battle/anim/taunt_finger.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern void sub_80CEF44(u8 bank, struct Sprite* sprite); static void sub_80CF228(struct Sprite* sprite); @@ -19,9 +19,9 @@ void sub_80CF1C8(struct Sprite* sprite) { u8 bank; if (gBattleAnimArgs[0] == 0) - bank = gBattleAnimBankAttacker; + bank = gAnimBankAttacker; else - bank = gBattleAnimBankTarget; + bank = gAnimBankTarget; sub_80CEF44(bank, sprite); if (GetBankSide(bank) == 0) @@ -52,5 +52,5 @@ void sub_80CF228(struct Sprite* sprite) void sub_80CF264(struct Sprite* sprite) { if (++sprite->data[1] > 5) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } diff --git a/src/battle/anim/tendrils.c b/src/battle/anim/tendrils.c index ba1014d2f..9f57ffd45 100755 --- a/src/battle/anim/tendrils.c +++ b/src/battle/anim/tendrils.c @@ -4,8 +4,8 @@ #include "battle_anim.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CB298(struct Sprite* sprite); static void sub_80CB2D4(struct Sprite* sprite); @@ -61,7 +61,7 @@ void sub_80CB2D4(struct Sprite* sprite) } else { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } }
\ No newline at end of file diff --git a/src/battle/anim/thought.c b/src/battle/anim/thought.c index 9cffafe14..c3ab6f82c 100755 --- a/src/battle/anim/thought.c +++ b/src/battle/anim/thought.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CF008(struct Sprite* sprite); @@ -20,7 +20,7 @@ void sub_80CEF44(u8 bank, struct Sprite* sprite) else sprite->pos1.x = sub_807A100(bank, 4) - 8; - sprite->pos1.y = sub_8077ABC(bank, 3) - (s16)sub_807A100(bank, 0) / 4; + sprite->pos1.y = GetBankPosition(bank, 3) - (s16)sub_807A100(bank, 0) / 4; } void sub_80CEF9C(struct Sprite* sprite) @@ -28,9 +28,9 @@ void sub_80CEF9C(struct Sprite* sprite) u8 a; u8 bank; if (gBattleAnimArgs[0] == 0) - bank = gBattleAnimBankAttacker; + bank = gAnimBankAttacker; else - bank = gBattleAnimBankTarget; + bank = gAnimBankTarget; sub_80CEF44(bank, sprite); a = (GetBankSide(bank) == 0) ? 0 : 1; @@ -45,7 +45,7 @@ void sub_80CF008(struct Sprite* sprite) { if (--sprite->data[0] == 0) { - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); StartSpriteAnim(sprite, sprite->data[1]); sprite->callback = sub_8078600; } diff --git a/src/battle/anim/thrashing.c b/src/battle/anim/thrashing.c index 9811c546a..3fde815ae 100755 --- a/src/battle/anim/thrashing.c +++ b/src/battle/anim/thrashing.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern struct AffineAnimFrameCmd gUnknown_083D77B0; @@ -48,7 +48,7 @@ void sub_80D0AB8(u8 taskId) task->data[7] = 0; task->data[8] = 0; task->data[9] = 2; - if (GetBankSide(gBattleAnimBankAttacker) == 1) + if (GetBankSide(gAnimBankAttacker) == 1) task->data[2] *= -1; task->func = sub_80D0B3C; diff --git a/src/battle/anim/thunder.c b/src/battle/anim/thunder.c index 5064148ef..2ed073221 100644 --- a/src/battle/anim/thunder.c +++ b/src/battle/anim/thunder.c @@ -3,8 +3,8 @@ #include "rom_8077ABC.h" extern s16 gBattleAnimArgs[8]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern u16 gBattleTypeFlags; static void sub_80D6218(struct Sprite *); @@ -14,7 +14,7 @@ static void sub_80D6218(struct Sprite *); void sub_80D61C8(struct Sprite *sprite) { - if (GetBankSide(gBattleAnimBankAttacker) != 0) + if (GetBankSide(gAnimBankAttacker) != 0) { sprite->pos1.x -= gBattleAnimArgs[0]; } @@ -31,6 +31,6 @@ static void sub_80D6218(struct Sprite *sprite) { if (sprite->animEnded) { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } diff --git a/src/battle/anim/tile_in.c b/src/battle/anim/tile_in.c index 5fcbadbb7..a4a544a0c 100755 --- a/src/battle/anim/tile_in.c +++ b/src/battle/anim/tile_in.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // tile_in (flips a white tile from the scene into facing the player.) // Used in Conversion. @@ -15,15 +15,15 @@ void sub_80CE09C(struct Sprite* sprite) { if (sprite->data[0] == 0) { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 0) + gBattleAnimArgs[0]; - sprite->pos1.y = sub_8077ABC(gBattleAnimBankAttacker, 1) + gBattleAnimArgs[1]; - if (NotInBattle()) + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 0) + gBattleAnimArgs[0]; + sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 1) + gBattleAnimArgs[1]; + if (IsContest()) sprite->pos1.y += 10; sprite->data[0]++; } if ((u16)gBattleAnimArgs[7] == 0xFFFF) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } void sub_80CE108(u8 taskId) diff --git a/src/battle/anim/tile_out.c b/src/battle/anim/tile_out.c index 8b710268f..50468a440 100755 --- a/src/battle/anim/tile_out.c +++ b/src/battle/anim/tile_out.c @@ -6,8 +6,8 @@ #include "battle_interface.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern u8 gNoOfAllBanks; extern u8 gHealthboxIDs[]; @@ -35,10 +35,10 @@ void sub_80CE1AC(struct Sprite* sprite) { sprite->animPaused = 0; sprite->data[0] = 30; - sprite->data[2] = sub_8077ABC(gBattleAnimBankAttacker, 2); - sprite->data[4] = sub_8077ABC(gBattleAnimBankAttacker, 3); + sprite->data[2] = GetBankPosition(gAnimBankAttacker, 2); + sprite->data[4] = GetBankPosition(gAnimBankAttacker, 3); sprite->callback = sub_8078B34; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); } } diff --git a/src/battle/anim/twinkle.c b/src/battle/anim/twinkle.c index 56095c29d..e26669f63 100755 --- a/src/battle/anim/twinkle.c +++ b/src/battle/anim/twinkle.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CE3B0(struct Sprite* sprite); @@ -15,7 +15,7 @@ static void sub_80CE3B0(struct Sprite* sprite); void sub_80CE36C(struct Sprite* sprite) { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 2) + gBattleAnimArgs[0]; + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2) + gBattleAnimArgs[0]; sprite->pos1.y = gBattleAnimArgs[1]; sprite->data[0] = 0; sprite->data[1] = 0; @@ -38,5 +38,5 @@ void sub_80CE3B0(struct Sprite* sprite) } if (sprite->data[0]) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } diff --git a/src/battle/anim/unused_1.c b/src/battle/anim/unused_1.c index fdcef0de9..d7e5fbfe4 100755 --- a/src/battle/anim/unused_1.c +++ b/src/battle/anim/unused_1.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // unused effect file. // Seems to be a beta effect for Beat Up, possibly. diff --git a/src/battle/anim/unused_2.c b/src/battle/anim/unused_2.c index f7f5be88d..122f39e02 100755 --- a/src/battle/anim/unused_2.c +++ b/src/battle/anim/unused_2.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CCCB4(struct Sprite* sprite); @@ -42,14 +42,14 @@ void unref_sub_80CCB6C(struct Sprite* sprite) { DestroySprite(&gSprites[sprite->data[0]]); DestroySprite(&gSprites[sprite->data[1]]); - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } void sub_80CCC50(struct Sprite* sprite) { sprite->data[0] = gBattleAnimArgs[2]; - if (GetBankSide(gBattleAnimBankAttacker) != 0) + if (GetBankSide(gAnimBankAttacker) != 0) sprite->pos1.x -= gBattleAnimArgs[0]; else sprite->pos1.x += gBattleAnimArgs[0]; @@ -76,5 +76,5 @@ void sub_80CCCB4(struct Sprite* sprite) sprite->pos2.y += sprite->data[5] >> 8; sprite->data[2]++; if (sprite->data[2] == sprite->data[3]) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } diff --git a/src/battle/anim/unused_3.c b/src/battle/anim/unused_3.c index 049e0ca1b..6dbcbfefe 100755 --- a/src/battle/anim/unused_3.c +++ b/src/battle/anim/unused_3.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CD2D4(struct Sprite* sprite); @@ -16,7 +16,7 @@ static void sub_80CD2D4(struct Sprite* sprite); void sub_80CD274(struct Sprite* sprite) { sub_8078650(sprite); - if (GetBankSide(gBattleAnimBankAttacker) == 0) + if (GetBankSide(gAnimBankAttacker) == 0) { sprite->pos1.x += gBattleAnimArgs[0]; sprite->pos1.y += gBattleAnimArgs[1]; @@ -41,5 +41,5 @@ void sub_80CD2D4(struct Sprite* sprite) } if (sprite->animEnded) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } diff --git a/src/battle/anim/unused_4.c b/src/battle/anim/unused_4.c index 72ecde05c..bda476a0a 100755 --- a/src/battle/anim/unused_4.c +++ b/src/battle/anim/unused_4.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern u8 gObjectBankIDs[]; @@ -27,8 +27,8 @@ void sub_80CD9D4(struct Sprite* sprite) { case 0: sprite->data[1] = 0; - sprite->data[2] = gObjectBankIDs[gBattleAnimBankAttacker]; - sprite->data[3] = GetBankSide(gBattleAnimBankAttacker); + sprite->data[2] = gObjectBankIDs[gAnimBankAttacker]; + sprite->data[3] = GetBankSide(gAnimBankAttacker); sprite->data[4] = (sprite->data[3] != 0) ? 0x200 : -0x200; sprite->data[5] = 0; sub_8078E70(sprite->data[2], 0); @@ -51,7 +51,7 @@ void sub_80CD9D4(struct Sprite* sprite) if (++sprite->data[1] > 3) { sub_8078F40(sprite->data[2]); - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } break; } diff --git a/src/battle/anim/unused_5.c b/src/battle/anim/unused_5.c index 4dc2da70d..421cdd6bf 100755 --- a/src/battle/anim/unused_5.c +++ b/src/battle/anim/unused_5.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // unused_5 diff --git a/src/battle/anim/unused_6.c b/src/battle/anim/unused_6.c index f7c87647f..37e2031b0 100755 --- a/src/battle/anim/unused_6.c +++ b/src/battle/anim/unused_6.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern void sub_80CEF44(u8 bank, struct Sprite* sprite); static void sub_80CF310(struct Sprite* sprite); @@ -17,9 +17,9 @@ void sub_80CF2D0(struct Sprite* sprite) { u8 bank; if (gBattleAnimArgs[0] == 0) - bank = gBattleAnimBankAttacker; + bank = gAnimBankAttacker; else - bank = gBattleAnimBankTarget; + bank = gAnimBankTarget; sub_80CEF44(bank, sprite); sprite->data[0] = 0; @@ -43,7 +43,7 @@ void sub_80CF310(struct Sprite* sprite) break; case 2: if (++sprite->data[1] == 0x40) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); break; } } diff --git a/src/battle/anim/unused_7.c b/src/battle/anim/unused_7.c index 3a8998f1d..2be6e7633 100755 --- a/src/battle/anim/unused_7.c +++ b/src/battle/anim/unused_7.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern u8 gObjectBankIDs[]; @@ -30,10 +30,10 @@ void sub_80CF374(struct Sprite* sprite) void sub_80CF3C4(struct Sprite* sprite) { u8 a; - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 2); - sprite->pos1.y = sub_8077ABC(gBattleAnimBankAttacker, 3); - a = gObjectBankIDs[gBattleAnimBankTarget]; - if (GetBankSide(gBattleAnimBankAttacker) != 0) + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2); + sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 3); + a = gObjectBankIDs[gAnimBankTarget]; + if (GetBankSide(gAnimBankAttacker) != 0) { sprite->pos1.x -= gBattleAnimArgs[0]; } diff --git a/src/battle/anim/unused_8.c b/src/battle/anim/unused_8.c index bcebfcd2b..03772f951 100755 --- a/src/battle/anim/unused_8.c +++ b/src/battle/anim/unused_8.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80CF490(struct Sprite* sprite); static void sub_80CF4B8(struct Sprite* sprite); @@ -35,7 +35,7 @@ void sub_80CF490(struct Sprite* sprite) void sub_80CF4B8(struct Sprite* sprite) { if (sprite->data[5] == 0) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); else sprite->data[5]--; } diff --git a/src/battle/anim/unused_9.c b/src/battle/anim/unused_9.c index 579238fbc..cf3ccb0d4 100755 --- a/src/battle/anim/unused_9.c +++ b/src/battle/anim/unused_9.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern struct SpriteTemplate gSpriteTemplate_83D75AC; @@ -44,7 +44,7 @@ void sub_80CFE2C(struct Sprite* sprite) gPlttBufferFaded[sprite->data[0] + 15] = r7; if (++sprite->data[2] == 0x18) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } #else @@ -101,7 +101,7 @@ _080CFE64:\n\ cmp r0, 0x18\n\ bne _080CFE90\n\ adds r0, r4, 0\n\ - bl move_anim_8072740\n\ + bl DestroyAnimSprite\n\ _080CFE90:\n\ pop {r4-r7}\n\ pop {r0}\n\ diff --git a/src/battle/anim/water.c b/src/battle/anim/water.c index 396a4637d..4068cbe78 100644 --- a/src/battle/anim/water.c +++ b/src/battle/anim/water.c @@ -5,8 +5,8 @@ #include "util.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80D3874(struct Sprite *); @@ -19,7 +19,7 @@ void sub_80D37FC(struct Sprite *sprite) sprite->data[4] = sprite->pos1.y + gBattleAnimArgs[4]; sprite->callback = sub_8078B34; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); } void sub_80D3838(struct Sprite *sprite) @@ -47,7 +47,7 @@ static void sub_80D3874(struct Sprite *sprite) if (--sprite->data[7] == -1) { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } @@ -139,7 +139,7 @@ _080D3920:\n\ ldr r1, _080D399C @ =0x85000400\n\ str r1, [r0, 0x8]\n\ ldr r0, [r0, 0x8]\n\ - bl NotInBattle\n\ + bl IsContest\n\ lsls r0, 24\n\ cmp r0, 0\n\ bne _080D39B8\n\ @@ -151,7 +151,7 @@ _080D3920:\n\ movs r1, 0x4\n\ orrs r0, r1\n\ strb r0, [r2]\n\ - ldr r0, _080D39A0 @ =gBattleAnimBankAttacker\n\ + ldr r0, _080D39A0 @ =gAnimBankAttacker\n\ ldrb r0, [r0]\n\ bl GetBankSide\n\ lsls r0, 24\n\ @@ -166,7 +166,7 @@ _080D3990: .4byte 0x00003f42\n\ _080D3994: .4byte REG_BG1CNT\n\ _080D3998: .4byte 0x040000d4\n\ _080D399C: .4byte 0x85000400\n\ -_080D39A0: .4byte gBattleAnimBankAttacker\n\ +_080D39A0: .4byte gAnimBankAttacker\n\ _080D39A4: .4byte gUnknown_08E70968\n\ _080D39A8:\n\ ldr r0, _080D39B4 @ =gUnknown_08E70C38\n\ @@ -245,18 +245,18 @@ _080D3A0E:\n\ lsls r0, 5\n\ strh r0, [r7, 0xA]\n\ strh r0, [r7, 0xC]\n\ - bl NotInBattle\n\ + bl IsContest\n\ lsls r0, 24\n\ lsrs r4, r0, 24\n\ cmp r4, 0\n\ beq _080D3A94\n\ ldr r3, _080D3A84 @ =0x0000ffb0\n\ adds r0, r3, 0\n\ - ldr r1, _080D3A88 @ =gUnknown_030042C0\n\ + ldr r1, _080D3A88 @ =gBattle_BG1_X\n\ strh r0, [r1]\n\ ldr r2, _080D3A8C @ =0x0000ffd0\n\ adds r0, r2, 0\n\ - ldr r3, _080D3A90 @ =gUnknown_030041B4\n\ + ldr r3, _080D3A90 @ =gBattle_BG1_Y\n\ strh r0, [r3]\n\ movs r0, 0x2\n\ strh r0, [r6, 0x8]\n\ @@ -270,11 +270,11 @@ _080D3A78: .4byte gBattleAnimBackgroundImageMuddyWater_Pal\n\ _080D3A7C: .4byte sub_80D3D68\n\ _080D3A80: .4byte gTasks\n\ _080D3A84: .4byte 0x0000ffb0\n\ -_080D3A88: .4byte gUnknown_030042C0\n\ +_080D3A88: .4byte gBattle_BG1_X\n\ _080D3A8C: .4byte 0x0000ffd0\n\ -_080D3A90: .4byte gUnknown_030041B4\n\ +_080D3A90: .4byte gBattle_BG1_Y\n\ _080D3A94:\n\ - ldr r0, _080D3AC4 @ =gBattleAnimBankAttacker\n\ + ldr r0, _080D3AC4 @ =gAnimBankAttacker\n\ ldrb r0, [r0]\n\ bl GetBankSide\n\ lsls r0, 24\n\ @@ -283,12 +283,12 @@ _080D3A94:\n\ bne _080D3AD8\n\ ldr r2, _080D3AC8 @ =0x0000ff20\n\ adds r0, r2, 0\n\ - ldr r3, _080D3ACC @ =gUnknown_030042C0\n\ + ldr r3, _080D3ACC @ =gBattle_BG1_X\n\ strh r0, [r3]\n\ movs r2, 0x80\n\ lsls r2, 1\n\ adds r0, r2, 0\n\ - ldr r3, _080D3AD0 @ =gUnknown_030041B4\n\ + ldr r3, _080D3AD0 @ =gBattle_BG1_Y\n\ strh r0, [r3]\n\ movs r0, 0x2\n\ strh r0, [r6, 0x8]\n\ @@ -297,17 +297,17 @@ _080D3A94:\n\ strh r1, [r7, 0xE]\n\ b _080D3AEE\n\ .align 2, 0\n\ -_080D3AC4: .4byte gBattleAnimBankAttacker\n\ +_080D3AC4: .4byte gAnimBankAttacker\n\ _080D3AC8: .4byte 0x0000ff20\n\ -_080D3ACC: .4byte gUnknown_030042C0\n\ -_080D3AD0: .4byte gUnknown_030041B4\n\ +_080D3ACC: .4byte gBattle_BG1_X\n\ +_080D3AD0: .4byte gBattle_BG1_Y\n\ _080D3AD4: .4byte 0x0000ffff\n\ _080D3AD8:\n\ - ldr r0, _080D3B1C @ =gUnknown_030042C0\n\ + ldr r0, _080D3B1C @ =gBattle_BG1_X\n\ strh r4, [r0]\n\ ldr r1, _080D3B20 @ =0x0000ffd0\n\ adds r0, r1, 0\n\ - ldr r2, _080D3B24 @ =gUnknown_030041B4\n\ + ldr r2, _080D3B24 @ =gBattle_BG1_Y\n\ strh r0, [r2]\n\ ldr r0, _080D3B28 @ =0x0000fffe\n\ strh r0, [r6, 0x8]\n\ @@ -316,11 +316,11 @@ _080D3AD8:\n\ strh r4, [r7, 0xE]\n\ _080D3AEE:\n\ ldr r1, _080D3B2C @ =REG_BG1HOFS\n\ - ldr r3, _080D3B1C @ =gUnknown_030042C0\n\ + ldr r3, _080D3B1C @ =gBattle_BG1_X\n\ ldrh r0, [r3]\n\ strh r0, [r1]\n\ adds r1, 0x2\n\ - ldr r2, _080D3B24 @ =gUnknown_030041B4\n\ + ldr r2, _080D3B24 @ =gBattle_BG1_Y\n\ ldrh r0, [r2]\n\ strh r0, [r1]\n\ ldr r1, _080D3B30 @ =gTasks\n\ @@ -338,9 +338,9 @@ _080D3AEE:\n\ movs r0, 0x70\n\ b _080D3B38\n\ .align 2, 0\n\ -_080D3B1C: .4byte gUnknown_030042C0\n\ +_080D3B1C: .4byte gBattle_BG1_X\n\ _080D3B20: .4byte 0x0000ffd0\n\ -_080D3B24: .4byte gUnknown_030041B4\n\ +_080D3B24: .4byte gBattle_BG1_Y\n\ _080D3B28: .4byte 0x0000fffe\n\ _080D3B2C: .4byte REG_BG1HOFS\n\ _080D3B30: .4byte gTasks\n\ diff --git a/src/battle/anim/wave_finger.c b/src/battle/anim/wave_finger.c index 58f0f8778..2cf68c34c 100755 --- a/src/battle/anim/wave_finger.c +++ b/src/battle/anim/wave_finger.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern void sub_80CEF44(u8 bank, struct Sprite* sprite); void sub_80CF088(struct Sprite* sprite); @@ -18,9 +18,9 @@ void sub_80CF040(struct Sprite* sprite) { u8 bank; if (gBattleAnimArgs[0] == 0) - bank = gBattleAnimBankAttacker; + bank = gAnimBankAttacker; else - bank = gBattleAnimBankTarget; + bank = gAnimBankTarget; sub_80CEF44(bank, sprite); sprite->data[0] = 0; diff --git a/src/battle/anim/whip.c b/src/battle/anim/whip.c index 3aa0758a9..cb3ce327e 100755 --- a/src/battle/anim/whip.c +++ b/src/battle/anim/whip.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; // whip (does a hitting animation that uses a rotating sprite to invoke the sprite getting hit.) // Used by Slam and Vine Whip. @@ -14,13 +14,13 @@ extern u8 gBattleAnimBankTarget; void sub_80CC810(struct Sprite* sprite) { if (sprite->animEnded) - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } // unused, beta effect for diagonal sprite movement? void sub_80CC82C(struct Sprite* sprite) { - if (GetBankSide(gBattleAnimBankAttacker) != 0) + if (GetBankSide(gAnimBankAttacker) != 0) { sprite->pos1.x -= gBattleAnimArgs[0]; sprite->pos1.y += gBattleAnimArgs[1]; @@ -32,12 +32,12 @@ void sub_80CC82C(struct Sprite* sprite) } sprite->callback = sub_8078600; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); } void sub_80CC884(struct Sprite* sprite) { - if (GetBankSide(gBattleAnimBankAttacker) == 0) + if (GetBankSide(gAnimBankAttacker) == 0) StartSpriteAnim(sprite, 1); sprite->callback = sub_80CC810; diff --git a/src/battle/anim/wisp_orb.c b/src/battle/anim/wisp_orb.c index 0e13fa119..0cbe6eed7 100644 --- a/src/battle/anim/wisp_orb.c +++ b/src/battle/anim/wisp_orb.c @@ -6,8 +6,8 @@ #include "trig.h" extern s16 gBattleAnimArgs[8]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern u16 gBattleTypeFlags; extern u8 gUnknown_0202F7D2; @@ -25,7 +25,7 @@ void sub_80D5B0C(struct Sprite *sprite) StartSpriteAnim(sprite, gBattleAnimArgs[2]); sprite->data[7] = gBattleAnimArgs[2]; - if (GetBankSide(gBattleAnimBankAttacker) != 0) + if (GetBankSide(gAnimBankAttacker) != 0) { sprite->data[4] = 4; } @@ -34,12 +34,12 @@ void sub_80D5B0C(struct Sprite *sprite) sprite->data[4] = -4; } - sprite->oam.priority = sub_8079ED4(gBattleAnimBankTarget); + sprite->oam.priority = sub_8079ED4(gAnimBankTarget); sprite->data[0]++; break; case 1: sprite->data[1] += 192; - if (GetBankSide(gBattleAnimBankAttacker) != 0) + if (GetBankSide(gAnimBankAttacker) != 0) { sprite->pos2.y = -(sprite->data[1] >> 8); } @@ -70,9 +70,9 @@ void sub_80D5B0C(struct Sprite *sprite) sprite->data[0] = 256; sprite->data[1] = sprite->pos1.x; - sprite->data[2] = sub_8077ABC(gBattleAnimBankTarget, 2); + sprite->data[2] = GetBankPosition(gAnimBankTarget, 2); sprite->data[3] = sprite->pos1.y; - sprite->data[4] = sub_8077ABC(gBattleAnimBankTarget, 3); + sprite->data[4] = GetBankPosition(gAnimBankTarget, 3); sub_8078BD4(sprite); sprite->callback = sub_80D5C5C; @@ -100,6 +100,6 @@ static void sub_80D5C5C(struct Sprite *sprite) } else { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } diff --git a/src/battle/anim/withdraw.c b/src/battle/anim/withdraw.c index 9abcff32d..e67248b9f 100755 --- a/src/battle/anim/withdraw.c +++ b/src/battle/anim/withdraw.c @@ -5,8 +5,8 @@ #include "sound.h" extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern u8 gObjectBankIDs[]; @@ -17,15 +17,15 @@ static void sub_80CF514(u8 taskId); void sub_80CF4D8(u8 taskId) { - sub_8078E70(gObjectBankIDs[gBattleAnimBankAttacker], 0); + sub_8078E70(gObjectBankIDs[gAnimBankAttacker], 0); gTasks[taskId].func = sub_80CF514; } void sub_80CF514(u8 taskId) { - u8 a = gObjectBankIDs[gBattleAnimBankAttacker]; + u8 a = gObjectBankIDs[gAnimBankAttacker]; s16 b; - if (GetBankSide(gBattleAnimBankAttacker) == 0) + if (GetBankSide(gAnimBankAttacker) == 0) { b = -gTasks[taskId].data[0]; } diff --git a/src/battle/battle_2.c b/src/battle/battle_2.c index ff3df7235..b0654950b 100644 --- a/src/battle/battle_2.c +++ b/src/battle/battle_2.c @@ -96,21 +96,21 @@ extern u8 gActionSelectionCursor[]; extern u8 gMoveSelectionCursor[]; extern u8 gUnknown_02038470[]; extern u16 gUnknown_030041B0; -extern u16 gUnknown_030041B4; +extern u16 gBattle_BG1_Y; extern u16 gUnknown_030041B8; extern struct Window gUnknown_030041D0; -extern u16 gUnknown_03004200; +extern u16 gBattle_WIN1H; extern struct Window gUnknown_03004210; -extern u16 gUnknown_03004244; +extern u16 gBattle_WIN1V; extern struct Window gUnknown_03004250; -extern u16 gUnknown_03004240; -extern u16 gUnknown_03004280; +extern u16 gBattle_WIN0V; +extern u16 gBattle_BG2_Y; extern u32 gUnknown_03004284; -extern u16 gUnknown_03004288; +extern u16 gBattle_BG2_X; extern u16 gUnknown_030042A0; extern u16 gUnknown_030042A4; -extern u16 gUnknown_030042C0; -extern u16 gUnknown_030042C4; +extern u16 gBattle_BG1_X; +extern u16 gBattle_WIN0H; extern MainCallback gPreBattleCallback1; extern void (*gBattleMainFunc)(void); extern u8 gLeveledUpInBattle; @@ -160,8 +160,8 @@ void InitBattle(void) REG_WIN0V = 0x5051; REG_WININ = 0; REG_WINOUT = 0; - gUnknown_030042C4 = 0xF0; - gUnknown_03004240 = 0x5051; + gBattle_WIN0H = 0xF0; + gBattle_WIN0V = 0x5051; dp12_8087EA4(); for (i = 0; i < 80; i++) @@ -181,10 +181,10 @@ void InitBattle(void) ResetPaletteFade(); gUnknown_030042A4 = 0; gUnknown_030042A0 = 0; - gUnknown_030042C0 = 0; - gUnknown_030041B4 = 0; - gUnknown_03004288 = 0; - gUnknown_03004280 = 0; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + gBattle_BG2_X = 0; + gBattle_BG2_Y = 0; gUnknown_030041B0 = 0; gUnknown_030041B8 = 0; gBattleTerrain = BattleSetup_GetTerrain(); @@ -1003,16 +1003,16 @@ void sub_800FCFC(void) Random(); // unused return value REG_BG0HOFS = gUnknown_030042A4; REG_BG0VOFS = gUnknown_030042A0; - REG_BG1HOFS = gUnknown_030042C0; - REG_BG1VOFS = gUnknown_030041B4; - REG_BG2HOFS = gUnknown_03004288; - REG_BG2VOFS = gUnknown_03004280; + REG_BG1HOFS = gBattle_BG1_X; + REG_BG1VOFS = gBattle_BG1_Y; + REG_BG2HOFS = gBattle_BG2_X; + REG_BG2VOFS = gBattle_BG2_Y; REG_BG3HOFS = gUnknown_030041B0; REG_BG3VOFS = gUnknown_030041B8; - REG_WIN0H = gUnknown_030042C4; - REG_WIN0V = gUnknown_03004240; - REG_WIN1H = gUnknown_03004200; - REG_WIN1V = gUnknown_03004244; + REG_WIN0H = gBattle_WIN0H; + REG_WIN0V = gBattle_WIN0V; + REG_WIN1H = gBattle_WIN1H; + REG_WIN1V = gBattle_WIN1V; LoadOam(); ProcessSpriteCopyRequests(); TransferPlttBuffer(); @@ -1138,8 +1138,8 @@ void c2_8011A1C(void) REG_WIN0V = 0x5051; REG_WININ = 0; REG_WINOUT = 0; - gUnknown_030042C4 = 0xF0; - gUnknown_03004240 = 0x5051; + gBattle_WIN0H = 0xF0; + gBattle_WIN0V = 0x5051; dp12_8087EA4(); for (i = 0; i < 80; i++) @@ -1157,10 +1157,10 @@ void c2_8011A1C(void) ResetPaletteFade(); gUnknown_030042A4 = 0; gUnknown_030042A0 = 0; - gUnknown_030042C0 = 0; - gUnknown_030041B4 = 0; - gUnknown_03004288 = 0; - gUnknown_03004280 = 0; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + gBattle_BG2_X = 0; + gBattle_BG2_Y = 0; gUnknown_030041B0 = 0; gUnknown_030041B8 = 0; diff --git a/src/battle/battle_3.c b/src/battle/battle_3.c index f627e50f0..e5a730598 100644 --- a/src/battle/battle_3.c +++ b/src/battle/battle_3.c @@ -7,6 +7,7 @@ #include "event_data.h" #include "constants/hold_effects.h" #include "constants/species.h" +#include "constants/weather.h" #include "pokemon.h" #include "data2.h" #include "random.h" @@ -109,22 +110,22 @@ extern u8 BattleScript_WrapEnds[]; extern u8 BattleScript_DisabledNoMore[]; extern u8 BattleScript_EncoredNoMore[]; -extern u8 gUnknown_081D9030[]; -extern u8 gUnknown_081D8F62[]; -extern u8 gUnknown_081D8FFF[]; -extern u8 gUnknown_081D8F7D[]; -extern u8 gUnknown_081D9016[]; -extern u8 gUnknown_081D9008[]; -extern u8 gUnknown_081D9041[]; -extern u8 gUnknown_081D950F[]; //uproar wakeup BS -extern u8 gUnknown_081D957E[]; //uproar BS +extern u8 BattleScript_SideStatusWoreOff[]; +extern u8 BattleScript_RainContinuesOrEnds[]; +extern u8 BattleScript_SandStormHailEnds[]; +extern u8 BattleScript_DamagingWeatherContinues[]; +extern u8 BattleScript_SunlightFaded[]; +extern u8 BattleScript_SunlightContinues[]; +extern u8 BattleScript_SafeguardEnds[]; +extern u8 BattleScript_MonWokeUpInUproar[]; //uproar wakeup BS +extern u8 BattleScript_PrintUproarOverTurns[]; //uproar BS extern u8 BattleScript_ThrashConfuses[]; extern u8 BattleScript_YawnMakesAsleep[]; -extern u8 BattleScript_FutureSightHits[]; +extern u8 BattleScript_MonTookFutureAttack[]; extern u8 BattleScript_PerishSongHits[]; extern u8 BattleScript_PerishSongTimerGoesDown[]; -extern u8 gUnknown_081D8C72[]; -extern u8 gUnknown_081D8C7B[]; +extern u8 BattleScript_GiveExp[]; +extern u8 BattleScript_HandleFaintedMon[]; extern u8 BattleScript_MoveUsedIsAsleep[]; extern u8 BattleScript_MoveUsedWokeUp[]; @@ -145,7 +146,7 @@ extern u8 BattleScript_BideStoringEnergy[]; extern u8 BattleScript_BideAttack[]; extern u8 BattleScript_BideNoEnergyToAttack[]; -extern u8 gUnknown_081D901D[]; //load weather from overworld +extern u8 BattleScript_OverworldWeatherStarts[]; //load weather from overworld extern u8 BattleScript_DrizzleActivates[]; extern u8 BattleScript_SandstreamActivates[]; extern u8 BattleScript_DroughtActivates[]; @@ -164,7 +165,7 @@ extern u8 BattleScript_ColorChangeActivates[]; extern u8 BattleScript_RoughSkinActivates[]; extern u8 BattleScript_ApplySecondaryEffect[]; extern u8 BattleScript_CuteCharmActivates[]; -extern u8 gUnknown_081D9956[]; //ability status clear +extern u8 BattleScript_AbilityCuredStatus[]; //ability status clear extern u8 BattleScript_SynchronizeActivates[]; extern u8 gUnknown_081D978C[]; //intimidate1 extern u8 gUnknown_081D9795[]; //intimidate2 @@ -184,20 +185,20 @@ extern u8 BattleScript_BerryCureBrnEnd2[]; extern u8 BattleScript_BerryCureFrzEnd2[]; extern u8 BattleScript_BerryCureSlpEnd2[]; extern u8 BattleScript_BerryCureConfusionEnd2[]; -extern u8 gUnknown_081D9A44[]; //berry cure any status end2 +extern u8 BattleScript_BerryCureChosenStatusEnd2[]; //berry cure any status end2 extern u8 BattleScript_BerryCureParRet[]; extern u8 BattleScript_BerryCurePsnRet[]; extern u8 BattleScript_BerryCureBrnRet[]; extern u8 BattleScript_BerryCureFrzRet[]; extern u8 BattleScript_BerryCureSlpRet[]; extern u8 BattleScript_BerryCureConfusionRet[]; -extern u8 gUnknown_081D9A4A[]; //berry cure any status return +extern u8 BattleScript_BerryCureChosenStatusRet[]; //berry cure any status return extern u8 BattleScript_ItemHealHP_Ret[]; extern u8 gUnknown_081D995F[]; //disobedient while asleep -extern u8 gUnknown_081D996F[]; //disobedient, uses a random move -extern u8 gUnknown_081D9989[]; //disobedient, went to sleep +extern u8 BattleScript_IgnoresAndUsesRandomMove[]; //disobedient, uses a random move +extern u8 BattleScript_IgnoresAndFallsAsleep[]; //disobedient, went to sleep extern u8 gUnknown_081D99A0[]; //disobedient, hits itself //array entries for battle communication @@ -395,7 +396,7 @@ u8 UpdateTurnCounters(void) { gSideAffecting[sideBank] &= ~SIDE_STATUS_REFLECT; - b_call_bc_move_exec(gUnknown_081D9030); + b_call_bc_move_exec(BattleScript_SideStatusWoreOff); gBattleTextBuff1[0] = 0xFD; gBattleTextBuff1[1] = 2; gBattleTextBuff1[2] = MOVE_REFLECT; @@ -423,7 +424,7 @@ u8 UpdateTurnCounters(void) if (--gSideTimer[sideBank].lightscreenTimer == 0) { gSideAffecting[sideBank] &= ~SIDE_STATUS_LIGHTSCREEN; - b_call_bc_move_exec(gUnknown_081D9030); + b_call_bc_move_exec(BattleScript_SideStatusWoreOff); gBattleCommunication[MULTISTRING_CHOOSER] = sideBank; gBattleTextBuff1[0] = 0xFD; gBattleTextBuff1[1] = 2; @@ -450,7 +451,7 @@ u8 UpdateTurnCounters(void) if (gSideTimer[sideBank].mistTimer && --gSideTimer[sideBank].mistTimer == 0) { gSideAffecting[sideBank] &= ~SIDE_STATUS_MIST; - b_call_bc_move_exec(gUnknown_081D9030); + b_call_bc_move_exec(BattleScript_SideStatusWoreOff); gBattleCommunication[MULTISTRING_CHOOSER] = sideBank; gBattleTextBuff1[0] = 0xFD; gBattleTextBuff1[1] = 2; @@ -478,7 +479,7 @@ u8 UpdateTurnCounters(void) if (--gSideTimer[sideBank].safeguardTimer == 0) { gSideAffecting[sideBank] &= ~SIDE_STATUS_SAFEGUARD; - b_call_bc_move_exec(gUnknown_081D9041); + b_call_bc_move_exec(BattleScript_SafeguardEnds); effect++; } } @@ -531,7 +532,7 @@ u8 UpdateTurnCounters(void) gBattleCommunication[MULTISTRING_CHOOSER] = 1; else gBattleCommunication[MULTISTRING_CHOOSER] = 0; - b_call_bc_move_exec(gUnknown_081D8F62); + b_call_bc_move_exec(BattleScript_RainContinuesOrEnds); effect++; } BATTLE_STRUCT->turncountersTracker++; @@ -542,10 +543,10 @@ u8 UpdateTurnCounters(void) if (!(gBattleWeather & WEATHER_SANDSTORM_PERMANENT) && --gWishFutureKnock.weatherDuration == 0) { gBattleWeather &= ~WEATHER_SANDSTORM_TEMPORARY; - gBattlescriptCurrInstr = gUnknown_081D8FFF; + gBattlescriptCurrInstr = BattleScript_SandStormHailEnds; } else - gBattlescriptCurrInstr = gUnknown_081D8F7D; + gBattlescriptCurrInstr = BattleScript_DamagingWeatherContinues; BATTLE_STRUCT->animArg1 = B_ANIM_SANDSTORM_CONTINUES; gBattleCommunication[MULTISTRING_CHOOSER] = 0; @@ -560,10 +561,10 @@ u8 UpdateTurnCounters(void) if (!(gBattleWeather & WEATHER_SUN_PERMANENT) && --gWishFutureKnock.weatherDuration == 0) { gBattleWeather &= ~WEATHER_SUN_TEMPORARY; - gBattlescriptCurrInstr = gUnknown_081D9016; + gBattlescriptCurrInstr = BattleScript_SunlightFaded; } else - gBattlescriptCurrInstr = gUnknown_081D9008; + gBattlescriptCurrInstr = BattleScript_SunlightContinues; b_call_bc_move_exec(gBattlescriptCurrInstr); effect++; @@ -576,10 +577,10 @@ u8 UpdateTurnCounters(void) if (--gWishFutureKnock.weatherDuration == 0) { gBattleWeather &= ~WEATHER_HAIL; - gBattlescriptCurrInstr = gUnknown_081D8FFF; + gBattlescriptCurrInstr = BattleScript_SandStormHailEnds; } else - gBattlescriptCurrInstr = gUnknown_081D8F7D; + gBattlescriptCurrInstr = BattleScript_DamagingWeatherContinues; BATTLE_STRUCT->animArg1 = B_ANIM_HAIL_CONTINUES; gBattleCommunication[MULTISTRING_CHOOSER] = 1; @@ -759,7 +760,7 @@ u8 TurnBasedEffects(void) gBattleMons[gBankAttacker].status1 &= ~(STATUS_SLEEP); gBattleMons[gBankAttacker].status2 &= ~(STATUS2_NIGHTMARE); gBattleCommunication[MULTISTRING_CHOOSER] = 1; - b_call_bc_move_exec(gUnknown_081D950F); + b_call_bc_move_exec(BattleScript_MonWokeUpInUproar); gActiveBank = gBankAttacker; EmitSetAttributes(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBank].status1); MarkBufferBankForExecution(gActiveBank); @@ -790,7 +791,7 @@ u8 TurnBasedEffects(void) gBattleCommunication[MULTISTRING_CHOOSER] = 1; CancelMultiTurnMoves(gActiveBank); } - b_call_bc_move_exec(gUnknown_081D957E); + b_call_bc_move_exec(BattleScript_PrintUproarOverTurns); effect = 1; } } @@ -937,7 +938,7 @@ bool8 sub_80170DC(void) // handle future sight and perish song gBankAttacker = gWishFutureKnock.futureSightAttacker[gActiveBank]; gBattleMoveDamage = gWishFutureKnock.futureSightDmg[gActiveBank]; gSpecialStatuses[gBankTarget].moveturnLostHP = 0xFFFF; - b_call_bc_move_exec(BattleScript_FutureSightHits); + b_call_bc_move_exec(BattleScript_MonTookFutureAttack); return 1; } } @@ -1008,7 +1009,7 @@ bool8 sub_80173A4(void) gBank1 = gBankTarget = BATTLE_STRUCT->unk1605A; if (gBattleMons[BATTLE_STRUCT->unk1605A].hp == 0 && !(BATTLE_STRUCT->unk16113 & gBitTable[gBattlePartyID[BATTLE_STRUCT->unk1605A]]) && !(gAbsentBankFlags & gBitTable[BATTLE_STRUCT->unk1605A])) { - b_call_bc_move_exec(gUnknown_081D8C72); + b_call_bc_move_exec(BattleScript_GiveExp); BATTLE_STRUCT->sub80173A4_Tracker = 2; return 1; } @@ -1031,7 +1032,7 @@ bool8 sub_80173A4(void) gBank1 = gBankTarget = BATTLE_STRUCT->unk1605A; //or should banks be switched? if (gBattleMons[BATTLE_STRUCT->unk1605A].hp == 0 && !(gAbsentBankFlags & gBitTable[BATTLE_STRUCT->unk1605A])) { - b_call_bc_move_exec(gUnknown_081D8C7B); + b_call_bc_move_exec(BattleScript_HandleFaintedMon); BATTLE_STRUCT->sub80173A4_Tracker = 5; return 1; } @@ -1500,9 +1501,9 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg) //_08018586 switch (weather_get_current()) { - case 3: - case 5: - case 13: + case WEATHER_RAIN_LIGHT: + case WEATHER_RAIN_MED: + case WEATHER_RAIN_HEAVY: if (!(gBattleWeather & WEATHER_RAIN_ANY)) { gBattleWeather = (WEATHER_RAIN_TEMPORARY | WEATHER_RAIN_PERMANENT); @@ -1511,7 +1512,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg) effect++; } break; - case 8: + case WEATHER_SANDSTORM: if (!(gBattleWeather & WEATHER_SANDSTORM_ANY)) { gBattleWeather = (WEATHER_SANDSTORM_PERMANENT | WEATHER_SANDSTORM_TEMPORARY); @@ -1520,7 +1521,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg) effect++; } break; - case 12: + case WEATHER_DROUGHT: if (!(gBattleWeather & WEATHER_SUN_ANY)) { gBattleWeather = (WEATHER_SUN_PERMANENT | WEATHER_SUN_TEMPORARY); @@ -1533,7 +1534,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg) if (effect) { gBattleCommunication[MULTISTRING_CHOOSER] = weather_get_current(); - b_push_move_exec(gUnknown_081D901D); + b_push_move_exec(BattleScript_OverworldWeatherStarts); } break; case ABILITY_DRIZZLE: @@ -1968,7 +1969,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg) break; } b_movescr_stack_push_cursor(); - gBattlescriptCurrInstr = gUnknown_081D9956; + gBattlescriptCurrInstr = BattleScript_AbilityCuredStatus; BATTLE_STRUCT->scriptingActive = bank; gActiveBank = bank; EmitSetAttributes(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBank].status1); @@ -2767,7 +2768,7 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn) gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleMons[bank].status1 = 0; gBattleMons[bank].status2 &= ~(STATUS2_CONFUSION); - b_call_bc_move_exec(gUnknown_081D9A44); + b_call_bc_move_exec(BattleScript_BerryCureChosenStatusEnd2); effect = ITEM_STATUS_CHANGE; } break; @@ -2776,7 +2777,7 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn) { gBattleMons[bank].status2 &= ~(STATUS2_INFATUATION); StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn); - b_call_bc_move_exec(gUnknown_081D9A44); + b_call_bc_move_exec(BattleScript_BerryCureChosenStatusEnd2); gBattleCommunication[MULTISTRING_CHOOSER] = 0; effect = ITEM_EFFECT_OTHER; } @@ -2881,7 +2882,7 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn) StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn); b_movescr_stack_push_cursor(); gBattleCommunication[MULTISTRING_CHOOSER] = 0; - gBattlescriptCurrInstr = gUnknown_081D9A4A; + gBattlescriptCurrInstr = BattleScript_BerryCureChosenStatusRet; effect = ITEM_EFFECT_OTHER; } break; @@ -2917,7 +2918,7 @@ u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn) gBattleMons[bank].status2 &= ~(STATUS2_CONFUSION); b_movescr_stack_push_cursor(); gBattleCommunication[MULTISTRING_CHOOSER] = 0; - gBattlescriptCurrInstr = gUnknown_081D9A4A; + gBattlescriptCurrInstr = BattleScript_BerryCureChosenStatusRet; effect = ITEM_STATUS_CHANGE; } break; @@ -3185,7 +3186,7 @@ u8 IsPokeDisobedient(void) gBattleCommunication[3] = 0; gDynamicBasePower = 0; BATTLE_STRUCT->dynamicMoveType = 0; - gBattlescriptCurrInstr = gUnknown_081D996F; + gBattlescriptCurrInstr = BattleScript_IgnoresAndUsesRandomMove; gBankTarget = GetMoveTarget(gRandomMove, 0); gHitMarker |= HITMARKER_x200000; return 2; @@ -3207,7 +3208,7 @@ u8 IsPokeDisobedient(void) } if (i == gNoOfAllBanks) { - gBattlescriptCurrInstr = gUnknown_081D9989; + gBattlescriptCurrInstr = BattleScript_IgnoresAndFallsAsleep; return 1; } } diff --git a/src/battle/battle_4.c b/src/battle/battle_4.c index 18585cebb..0c147e471 100644 --- a/src/battle/battle_4.c +++ b/src/battle/battle_4.c @@ -87,8 +87,8 @@ extern u8 gPlayerPartyCount; extern u16 gMoveToLearn; //move to learn extern const u8 gTrainerMoney[]; extern u16 gRandomMove; -extern u8* gBattleScriptsEffectsTable[]; -extern u16 gUnknown_02024BE8; //last used move in battle +extern u8* gBattleScriptsForMoveEffects[]; +extern u16 gChosenMove; //last used move in battle extern u8 gBankInMenu; extern u8 gActionForBanks[4]; extern u16 gUnknown_02024C2C[4]; //last used moves 2, used by sketch @@ -167,7 +167,7 @@ bool8 IsLinkDoubleBattle(void); void sub_8094B6C(u8 bank, u8 partyID, u8 r2); //extern BattleScripts -extern u8 BattleScript_EndTurn[]; +extern u8 BattleScript_MoveEnd[]; extern u8 BattleScript_NoPPForMove[]; extern u8 BattleScript_MagicCoatBounce[]; extern u8 BattleScript_TookAttack[]; @@ -205,21 +205,21 @@ extern u8 BattleScript_AllStatsUp[]; extern u8 BattleScript_AtkDefDown[]; extern u8 BattleScript_SAtkDown2[]; -extern u8 gUnknown_081D919F[]; //spikes1 -extern u8 gUnknown_081D9171[]; //spikes2 -extern u8 gUnknown_081D91CD[]; //spikes3 -extern u8 BattleScript_1D6F44[]; //present dmg -extern u8 BattleScript_1D83B5[]; //present full hp -extern u8 BattleScript_1D839B[]; //present hp heal -extern u8 BattleScript_1D6F74[]; +extern u8 BattleScript_SpikesOnTarget[]; //spikes1 +extern u8 BattleScript_SpikesOnAttacker[]; //spikes2 +extern u8 BattleScript_SpikesOngBank1[]; //spikes3 +extern u8 BattleScript_HitFromCritCalc[]; //present dmg +extern u8 BattleScript_AlreadyAtFullHp[]; //present full hp +extern u8 BattleScript_PresentHealTarget[]; //present hp heal +extern u8 BattleScript_MoveMissedPause[]; extern u8 BattleScript_CastformChange[]; -extern u8 gUnknown_081D9834[]; -extern u8 gUnknown_081D90FC[]; //bs random switchout -extern u8 gUnknown_081D95DB[]; //bs payday money give -extern u8 gUnknown_081D8C58[]; -extern u8 gUnknown_081D8C65[]; -extern u8 gUnknown_081D9156[]; -extern u8 gUnknown_081D9468[]; +extern u8 BattleScript_DampStopsExplosion[]; +extern u8 BattleScript_SuccessForceOut[]; //bs random switchout +extern u8 BattleScript_PrintPayDayMoneyString[]; //bs payday money give +extern u8 BattleScript_FaintAttacker[]; +extern u8 BattleScript_FaintTarget[]; +extern u8 BattleScript_DestinyBondTakesLife[]; +extern u8 BattleScript_SelectingImprisionedMoveInPalace[]; // read via orr #define BSScriptRead32(ptr) ((ptr)[0] | (ptr)[1] << 8 | (ptr)[2] << 16 | (ptr)[3] << 24) @@ -282,41 +282,41 @@ static void atk01_accuracycheck(void); static void atk02_attackstring(void); static void atk03_ppreduce(void); static void atk04_critcalc(void); -static void atk05_damagecalc1(void); +static void atk05_damagecalc(void); static void atk06_typecalc(void); -static void atk07_dmg_adjustment(void); -static void atk08_dmg_adjustment2(void); +static void atk07_adjustnormaldamage(void); +static void atk08_adjustnormaldamage2(void); static void atk09_attackanimation(void); static void atk0A_waitanimation(void); static void atk0B_healthbarupdate(void); static void atk0C_datahpupdate(void); static void atk0D_critmessage(void); -static void atk0E_effectiveness_sound(void); +static void atk0E_effectivenesssound(void); static void atk0F_resultmessage(void); static void atk10_printstring(void); -static void atk11_printstring_playeronly(void); +static void atk11_printselectionstring(void); static void atk12_waitmessage(void); static void atk13_printfromtable(void); -static void atk14_printfromtable_playeronly(void); -static void atk15_seteffectwithchancetarget(void); +static void atk14_printselectionstringfromtable(void); +static void atk15_seteffectwithchance(void); static void atk16_seteffectprimary(void); static void atk17_seteffectsecondary(void); -static void atk18_status_effect_clear(void); -static void atk19_faint_pokemon(void); -static void atk1A_faint_animation(void); -static void atk1B_faint_effects_clear(void); +static void atk18_clearstatusfromeffect(void); +static void atk19_tryfaintmon(void); +static void atk1A_dofaintanimation(void); +static void atk1B_cleareffectsonfaint(void); static void atk1C_jumpifstatus(void); static void atk1D_jumpifstatus2(void); static void atk1E_jumpifability(void); static void atk1F_jumpifsideaffecting(void); static void atk20_jumpifstat(void); -static void atk21_jumpifstatus3(void); +static void atk21_jumpifstatus3condition(void); static void atk22_jumpiftype(void); static void atk23_getexp(void); static void atk24(void); -static void atk25_move_values_cleanup(void); -static void atk26_set_multihit(void); -static void atk27_decrement_multihit(void); +static void atk25_movevaluescleanup(void); +static void atk26_setmultihit(void); +static void atk27_decrementmultihit(void); static void atk28_goto(void); static void atk29_jumpifbyte(void); static void atk2A_jumpifhalfword(void); @@ -327,7 +327,7 @@ static void atk2E_setbyte(void); static void atk2F_addbyte(void); static void atk30_subbyte(void); static void atk31_copyarray(void); -static void atk32_copyarray_withindex(void); +static void atk32_copyarraywithindex(void); static void atk33_orbyte(void); static void atk34_orhalfword(void); static void atk35_orword(void); @@ -341,75 +341,75 @@ static void atk3C_return(void); static void atk3D_end(void); static void atk3E_end2(void); static void atk3F_end3(void); -static void atk40_jump_if_move_affected_by_protect(void); +static void atk40_jumpifaffectedbyprotect(void); static void atk41_call(void); static void atk42_jumpiftype2(void); static void atk43_jumpifabilitypresent(void); -static void atk44(void); +static void atk44_endselectionscript(void); static void atk45_playanimation(void); static void atk46_playanimation2(void); static void atk47_setgraphicalstatchangevalues(void); static void atk48_playstatchangeanimation(void); -static void atk49_moveendturn(void); +static void atk49_moveend(void); static void atk4A_typecalc2(void); -static void atk4B_return_atk_to_ball(void); -static void atk4C_copy_poke_data(void); -static void atk4D_switch_data_update(void); -static void atk4E_switchin_anim(void); -static void atk4F_jump_if_cannot_switch(void); +static void atk4B_returnatktoball(void); +static void atk4C_getswitchedmondata(void); +static void atk4D_switchindataupdate(void); +static void atk4E_switchinanim(void); +static void atk4F_jumpifcantswitch(void); static void atk50_openpartyscreen(void); -static void atk51_switch_handle_order(void); -static void atk52_switch_in_effects(void); -static void atk53_trainer_slide(void); -static void atk54_effectiveness_sound(void); -static void atk55_play_sound(void); -static void atk56_fainting_cry(void); +static void atk51_switchhandleorder(void); +static void atk52_switchineffects(void); +static void atk53_trainerslidein(void); +static void atk54_playse(void); +static void atk55_fanfare(void); +static void atk56_playfaintcry(void); static void atk57(void); -static void atk58_return_to_ball(void); -void atk59_learnmove_inbattle(void); -static void atk5A(void); -static void atk5B_80256E0(void); +static void atk58_returntoball(void); +void atk59_handlelearnnewmove(void); +static void atk5A_yesnoboxlearnmove(void); +static void atk5B_yesnoboxstoplearningmove(void); static void atk5C_hitanimation(void); static void atk5D_getmoneyreward(void); static void atk5E_8025A70(void); static void atk5F_8025B24(void); -static void atk60_increment_gamestat(void); -static void atk61_8025BA4(void); +static void atk60_incrementgamestat(void); +static void atk61_drawpartystatussummary(void); static void atk62_08025C6C(void); static void atk63_jumptorandomattack(void); static void atk64_statusanimation(void); static void atk65_status2animation(void); static void atk66_chosenstatusanimation(void); -static void atk67_8025ECC(void); -static void atk68_80246A0(void); -static void atk69_dmg_adjustment2(void); +static void atk67_yesnobox(void); +static void atk68_cancelallactions(void); +static void atk69_adjustsetdamage(void); void atk6A_removeitem(void); static void atk6B_atknameinbuff1(void); -static void atk6C_lvlbox_display(void); -static void atk6D_set_sentpokes_values(void); -static void atk6E_set_atk_to_player0(void); -static void atk6F_set_visible(void); -static void atk70_record_ability(void); -static void atk71_buffer_move_to_learn(void); -static void atk72_jump_if_can_run_frombattle(void); -static void atk73_hp_thresholds(void); -static void atk74_hp_thresholds2(void); -static void atk75_8026A58(void); +static void atk6C_drawlvlupbox(void); +static void atk6D_resetsentmonsvalue(void); +static void atk6E_setatktoplayer0(void); +static void atk6F_makevisible(void); +static void atk70_recordlastability(void); +static void atk71_buffermovetolearn(void); +static void atk72_jumpifplayerran(void); +static void atk73_hpthresholds(void); +static void atk74_hpthresholds2(void); +static void atk75_useitemonopponent(void); static void atk76_various(void); -static void atk77_setprotect(void); +static void atk77_setprotectlike(void); static void atk78_faintifabilitynotdamp(void); static void atk79_setatkhptozero(void); -static void atk7A_jumpwhiletargetvalid(void); -static void atk7B_healhalfHP_if_possible(void); -static void atk7C_8025508(void); -static void atk7D_set_rain(void); +static void atk7A_jumpifnexttargetvalid(void); +static void atk7B_tryhealhalfhealth(void); +static void atk7C_trymirrormove(void); +static void atk7D_setrain(void); static void atk7E_setreflect(void); static void atk7F_setseeded(void); static void atk80_manipulatedamage(void); -static void atk81_setrest(void); +static void atk81_trysetrest(void); static void atk82_jumpifnotfirstturn(void); static void atk83_nop(void); -static void atk84_jump_if_cant_sleep(void); +static void atk84_jumpifcantmakeasleep(void); static void atk85_stockpile(void); static void atk86_stockpiletobasedamage(void); static void atk87_stockpiletohpheal(void); @@ -419,64 +419,64 @@ static void atk89_statbuffchange(void); static void atk8A_normalisebuffs(void); static void atk8B_setbide(void); static void atk8C_confuseifrepeatingattackends(void); -static void atk8D_setmultihit_counter(void); -static void atk8E_prepare_multihit(void); +static void atk8D_setmultihitcounter(void); +static void atk8E_initmultihitstring(void); static void atk8F_forcerandomswitch(void); -static void atk90_conversion_type_change(void); +static void atk90_tryconversiontypechange(void); static void atk91_givepaydaymoney(void); static void atk92_setlightscreen(void); -static void atk93_ko_move(void); -static void atk94_gethalfcurrentenemyhp(void); +static void atk93_tryKO(void); +static void atk94_damagetohalftargethp(void); static void atk95_setsandstorm(void); static void atk96_weatherdamage(void); -static void atk97_try_infatuation(void); -static void atk98_status_icon_update(void); +static void atk97_tryinfatuating(void); +static void atk98_updatestatusicon(void); static void atk99_setmist(void); -static void atk9A_set_focusenergy(void); +static void atk9A_setfocusenergy(void); static void atk9B_transformdataexecution(void); -static void atk9C_set_substitute(void); -static void atk9D_copyattack(void); +static void atk9C_setsubstitute(void); +static void atk9D_mimicattackcopy(void); static void atk9E_metronome(void); static void atk9F_dmgtolevel(void); static void atkA0_psywavedamageeffect(void); static void atkA1_counterdamagecalculator(void); static void atkA2_mirrorcoatdamagecalculator(void); static void atkA3_disablelastusedattack(void); -static void atkA4_setencore(void); +static void atkA4_trysetencore(void); static void atkA5_painsplitdmgcalc(void); static void atkA6_settypetorandomresistance(void); static void atkA7_setalwayshitflag(void); static void atkA8_copymovepermanently(void); -static void atkA9_sleeptalk_choose_move(void); -static void atkAA_set_destinybond(void); -static void atkAB_DestinyBondFlagUpdate(void); +static void atkA9_trychoosesleeptalkmove(void); +static void atkAA_setdestinybond(void); +static void atkAB_trysetdestinybondtohappen(void); static void atkAC_remaininghptopower(void); -static void atkAD_spite_ppreduce(void); -static void atkAE_heal_party_status(void); +static void atkAD_tryspiteppreduce(void); +static void atkAE_healpartystatus(void); static void atkAF_cursetarget(void); -static void atkB0_set_spikes(void); -static void atkB1_set_foresight(void); -static void atkB2_setperishsong(void); +static void atkB0_trysetspikes(void); +static void atkB1_setforesight(void); +static void atkB2_trysetperishsong(void); static void atkB3_rolloutdamagecalculation(void); static void atkB4_jumpifconfusedandstatmaxed(void); static void atkB5_furycuttercalc(void); static void atkB6_happinesstodamagecalculation(void); static void atkB7_presentdamagecalculation(void); -static void atkB8_set_safeguard(void); +static void atkB8_setsafeguard(void); static void atkB9_magnitudedamagecalculation(void); static void atkBA_jumpifnopursuitswitchdmg(void); static void atkBB_setsunny(void); static void atkBC_maxattackhalvehp(void); static void atkBD_copyfoestats(void); -static void atkBE_breakfree(void); -static void atkBF_set_defense_curl(void); +static void atkBE_rapidspinfree(void); +static void atkBF_setdefensecurlbit(void); static void atkC0_recoverbasedonsunlight(void); -static void atkC1_hidden_power(void); -static void atkC2_selectnexttarget(void); -static void atkC3_setfutureattack(void); -static void atkC4_beat_up(void); -static void atkC5_hidepreattack(void); -static void atkC6_unhidepostattack(void); +static void atkC1_hiddenpowercalc(void); +static void atkC2_selectfirstvalidtarget(void); +static void atkC3_trysetfutureattack(void); +static void atkC4_trydobeatup(void); +static void atkC5_setsemiinvulnerablebit(void); +static void atkC6_clearsemiinvulnerablebit(void); static void atkC7_setminimize(void); static void atkC8_sethail(void); static void atkC9_jumpifattackandspecialattackcannotfall(void); @@ -487,45 +487,45 @@ static void atkCD_cureifburnedparalysedorpoisoned(void); static void atkCE_settorment(void); static void atkCF_jumpifnodamage(void); static void atkD0_settaunt(void); -static void atkD1_set_helpinghand(void); -static void atkD2_swap_items(void); -static void atkD3_copy_ability(void); -static void atkD4_wish_effect(void); -static void atkD5_setroots(void); +static void atkD1_trysethelpinghand(void); +static void atkD2_tryswapitems(void); +static void atkD3_trycopyability(void); +static void atkD4_trywish(void); +static void atkD5_trysetroots(void); static void atkD6_doubledamagedealtifdamaged(void); static void atkD7_setyawn(void); static void atkD8_setdamagetohealthdifference(void); static void atkD9_scaledamagebyhealthratio(void); -static void atkDA_abilityswap(void); -static void atkDB_imprisoneffect(void); -static void atkDC_setgrudge(void); +static void atkDA_tryswapabilities(void); +static void atkDB_tryimprision(void); +static void atkDC_trysetgrudge(void); static void atkDD_weightdamagecalculation(void); static void atkDE_asistattackselect(void); -static void atkDF_setmagiccoat(void); -static void atkE0_setstealstatchange(void); -static void atkE1_intimidate_string_loader(void); -static void atkE2_switchout_abilities(void); -static void atkE3_jumpiffainted(void); +static void atkDF_trysetmagiccoat(void); +static void atkE0_trysetsnatch(void); +static void atkE1_trygetintimidatetarget(void); +static void atkE2_switchoutabilities(void); +static void atkE3_jumpifhasnohp(void); static void atkE4_getsecretpowereffect(void); static void atkE5_pickup(void); -static void atkE6_castform_change_animation(void); -static void atkE7_castform_data_change(void); +static void atkE6_docastformchangeanimation(void); +static void atkE7_trycastformdatachange(void); static void atkE8_settypebasedhalvers(void); static void atkE9_setweatherballtype(void); -static void atkEA_recycleitem(void); +static void atkEA_tryrecycleitem(void); static void atkEB_settypetoterrain(void); -static void atkEC_pursuit_sth(void); -static void atkED_802B4B4(void); +static void atkEC_pursuitrelated(void); +static void atkED_snatchsetbanks(void); static void atkEE_removelightscreenreflect(void); -void atkEF_pokeball_catch_calculation(void); -static void atkF0_copy_caught_poke(void); -static void atkF1_setpoke_as_caught(void); -static void atkF2_display_dex_info(void); -static void atkF3_nickname_caught_poke(void); -static void atkF4_802BEF0(void); +void atkEF_handleballthrow(void); +static void atkF0_givecaughtmon(void); +static void atkF1_trysetcaughtmondexflags(void); +static void atkF2_displaydexinfo(void); +static void atkF3_trygivecaughtmonnick(void); +static void atkF4_subattackerhpbydmg(void); static void atkF5_removeattackerstatus1(void); -static void atkF6_802BF48(void); -static void atkF7_802BF54(void); +static void atkF6_finishaction(void); +static void atkF7_finishturn(void); const BattleCmdFunc gBattleScriptingCommandsTable[] = { @@ -534,41 +534,41 @@ const BattleCmdFunc gBattleScriptingCommandsTable[] = atk02_attackstring, atk03_ppreduce, atk04_critcalc, - atk05_damagecalc1, + atk05_damagecalc, atk06_typecalc, - atk07_dmg_adjustment, - atk08_dmg_adjustment2, + atk07_adjustnormaldamage, + atk08_adjustnormaldamage2, atk09_attackanimation, atk0A_waitanimation, atk0B_healthbarupdate, atk0C_datahpupdate, atk0D_critmessage, - atk0E_effectiveness_sound, + atk0E_effectivenesssound, atk0F_resultmessage, atk10_printstring, - atk11_printstring_playeronly, + atk11_printselectionstring, atk12_waitmessage, atk13_printfromtable, - atk14_printfromtable_playeronly, - atk15_seteffectwithchancetarget, + atk14_printselectionstringfromtable, + atk15_seteffectwithchance, atk16_seteffectprimary, atk17_seteffectsecondary, - atk18_status_effect_clear, - atk19_faint_pokemon, - atk1A_faint_animation, - atk1B_faint_effects_clear, + atk18_clearstatusfromeffect, + atk19_tryfaintmon, + atk1A_dofaintanimation, + atk1B_cleareffectsonfaint, atk1C_jumpifstatus, atk1D_jumpifstatus2, atk1E_jumpifability, atk1F_jumpifsideaffecting, atk20_jumpifstat, - atk21_jumpifstatus3, + atk21_jumpifstatus3condition, atk22_jumpiftype, atk23_getexp, atk24, - atk25_move_values_cleanup, - atk26_set_multihit, - atk27_decrement_multihit, + atk25_movevaluescleanup, + atk26_setmultihit, + atk27_decrementmultihit, atk28_goto, atk29_jumpifbyte, atk2A_jumpifhalfword, @@ -579,7 +579,7 @@ const BattleCmdFunc gBattleScriptingCommandsTable[] = atk2F_addbyte, atk30_subbyte, atk31_copyarray, - atk32_copyarray_withindex, + atk32_copyarraywithindex, atk33_orbyte, atk34_orhalfword, atk35_orword, @@ -593,75 +593,75 @@ const BattleCmdFunc gBattleScriptingCommandsTable[] = atk3D_end, atk3E_end2, atk3F_end3, - atk40_jump_if_move_affected_by_protect, + atk40_jumpifaffectedbyprotect, atk41_call, atk42_jumpiftype2, atk43_jumpifabilitypresent, - atk44, + atk44_endselectionscript, atk45_playanimation, atk46_playanimation2, atk47_setgraphicalstatchangevalues, atk48_playstatchangeanimation, - atk49_moveendturn, + atk49_moveend, atk4A_typecalc2, - atk4B_return_atk_to_ball, - atk4C_copy_poke_data, - atk4D_switch_data_update, - atk4E_switchin_anim, - atk4F_jump_if_cannot_switch, + atk4B_returnatktoball, + atk4C_getswitchedmondata, + atk4D_switchindataupdate, + atk4E_switchinanim, + atk4F_jumpifcantswitch, atk50_openpartyscreen, - atk51_switch_handle_order, - atk52_switch_in_effects, - atk53_trainer_slide, - atk54_effectiveness_sound, - atk55_play_sound, - atk56_fainting_cry, + atk51_switchhandleorder, + atk52_switchineffects, + atk53_trainerslidein, + atk54_playse, + atk55_fanfare, + atk56_playfaintcry, atk57, - atk58_return_to_ball, - atk59_learnmove_inbattle, - atk5A, - atk5B_80256E0, + atk58_returntoball, + atk59_handlelearnnewmove, + atk5A_yesnoboxlearnmove, + atk5B_yesnoboxstoplearningmove, atk5C_hitanimation, atk5D_getmoneyreward, atk5E_8025A70, atk5F_8025B24, - atk60_increment_gamestat, - atk61_8025BA4, + atk60_incrementgamestat, + atk61_drawpartystatussummary, atk62_08025C6C, atk63_jumptorandomattack, atk64_statusanimation, atk65_status2animation, atk66_chosenstatusanimation, - atk67_8025ECC, - atk68_80246A0, - atk69_dmg_adjustment2, + atk67_yesnobox, + atk68_cancelallactions, + atk69_adjustsetdamage, atk6A_removeitem, atk6B_atknameinbuff1, - atk6C_lvlbox_display, - atk6D_set_sentpokes_values, - atk6E_set_atk_to_player0, - atk6F_set_visible, - atk70_record_ability, - atk71_buffer_move_to_learn, - atk72_jump_if_can_run_frombattle, - atk73_hp_thresholds, - atk74_hp_thresholds2, - atk75_8026A58, + atk6C_drawlvlupbox, + atk6D_resetsentmonsvalue, + atk6E_setatktoplayer0, + atk6F_makevisible, + atk70_recordlastability, + atk71_buffermovetolearn, + atk72_jumpifplayerran, + atk73_hpthresholds, + atk74_hpthresholds2, + atk75_useitemonopponent, atk76_various, - atk77_setprotect, + atk77_setprotectlike, atk78_faintifabilitynotdamp, atk79_setatkhptozero, - atk7A_jumpwhiletargetvalid, - atk7B_healhalfHP_if_possible, - atk7C_8025508, - atk7D_set_rain, + atk7A_jumpifnexttargetvalid, + atk7B_tryhealhalfhealth, + atk7C_trymirrormove, + atk7D_setrain, atk7E_setreflect, atk7F_setseeded, atk80_manipulatedamage, - atk81_setrest, + atk81_trysetrest, atk82_jumpifnotfirstturn, atk83_nop, - atk84_jump_if_cant_sleep, + atk84_jumpifcantmakeasleep, atk85_stockpile, atk86_stockpiletobasedamage, atk87_stockpiletohpheal, @@ -670,64 +670,64 @@ const BattleCmdFunc gBattleScriptingCommandsTable[] = atk8A_normalisebuffs, atk8B_setbide, atk8C_confuseifrepeatingattackends, - atk8D_setmultihit_counter, - atk8E_prepare_multihit, + atk8D_setmultihitcounter, + atk8E_initmultihitstring, atk8F_forcerandomswitch, - atk90_conversion_type_change, + atk90_tryconversiontypechange, atk91_givepaydaymoney, atk92_setlightscreen, - atk93_ko_move, - atk94_gethalfcurrentenemyhp, + atk93_tryKO, + atk94_damagetohalftargethp, atk95_setsandstorm, atk96_weatherdamage, - atk97_try_infatuation, - atk98_status_icon_update, + atk97_tryinfatuating, + atk98_updatestatusicon, atk99_setmist, - atk9A_set_focusenergy, + atk9A_setfocusenergy, atk9B_transformdataexecution, - atk9C_set_substitute, - atk9D_copyattack, + atk9C_setsubstitute, + atk9D_mimicattackcopy, atk9E_metronome, atk9F_dmgtolevel, atkA0_psywavedamageeffect, atkA1_counterdamagecalculator, atkA2_mirrorcoatdamagecalculator, atkA3_disablelastusedattack, - atkA4_setencore, + atkA4_trysetencore, atkA5_painsplitdmgcalc, atkA6_settypetorandomresistance, atkA7_setalwayshitflag, atkA8_copymovepermanently, - atkA9_sleeptalk_choose_move, - atkAA_set_destinybond, - atkAB_DestinyBondFlagUpdate, + atkA9_trychoosesleeptalkmove, + atkAA_setdestinybond, + atkAB_trysetdestinybondtohappen, atkAC_remaininghptopower, - atkAD_spite_ppreduce, - atkAE_heal_party_status, + atkAD_tryspiteppreduce, + atkAE_healpartystatus, atkAF_cursetarget, - atkB0_set_spikes, - atkB1_set_foresight, - atkB2_setperishsong, + atkB0_trysetspikes, + atkB1_setforesight, + atkB2_trysetperishsong, atkB3_rolloutdamagecalculation, atkB4_jumpifconfusedandstatmaxed, atkB5_furycuttercalc, atkB6_happinesstodamagecalculation, atkB7_presentdamagecalculation, - atkB8_set_safeguard, + atkB8_setsafeguard, atkB9_magnitudedamagecalculation, atkBA_jumpifnopursuitswitchdmg, atkBB_setsunny, atkBC_maxattackhalvehp, atkBD_copyfoestats, - atkBE_breakfree, - atkBF_set_defense_curl, + atkBE_rapidspinfree, + atkBF_setdefensecurlbit, atkC0_recoverbasedonsunlight, - atkC1_hidden_power, - atkC2_selectnexttarget, - atkC3_setfutureattack, - atkC4_beat_up, - atkC5_hidepreattack, - atkC6_unhidepostattack, + atkC1_hiddenpowercalc, + atkC2_selectfirstvalidtarget, + atkC3_trysetfutureattack, + atkC4_trydobeatup, + atkC5_setsemiinvulnerablebit, + atkC6_clearsemiinvulnerablebit, atkC7_setminimize, atkC8_sethail, atkC9_jumpifattackandspecialattackcannotfall, @@ -738,45 +738,45 @@ const BattleCmdFunc gBattleScriptingCommandsTable[] = atkCE_settorment, atkCF_jumpifnodamage, atkD0_settaunt, - atkD1_set_helpinghand, - atkD2_swap_items, - atkD3_copy_ability, - atkD4_wish_effect, - atkD5_setroots, + atkD1_trysethelpinghand, + atkD2_tryswapitems, + atkD3_trycopyability, + atkD4_trywish, + atkD5_trysetroots, atkD6_doubledamagedealtifdamaged, atkD7_setyawn, atkD8_setdamagetohealthdifference, atkD9_scaledamagebyhealthratio, - atkDA_abilityswap, - atkDB_imprisoneffect, - atkDC_setgrudge, + atkDA_tryswapabilities, + atkDB_tryimprision, + atkDC_trysetgrudge, atkDD_weightdamagecalculation, atkDE_asistattackselect, - atkDF_setmagiccoat, - atkE0_setstealstatchange, - atkE1_intimidate_string_loader, - atkE2_switchout_abilities, - atkE3_jumpiffainted, + atkDF_trysetmagiccoat, + atkE0_trysetsnatch, + atkE1_trygetintimidatetarget, + atkE2_switchoutabilities, + atkE3_jumpifhasnohp, atkE4_getsecretpowereffect, atkE5_pickup, - atkE6_castform_change_animation, - atkE7_castform_data_change, + atkE6_docastformchangeanimation, + atkE7_trycastformdatachange, atkE8_settypebasedhalvers, atkE9_setweatherballtype, - atkEA_recycleitem, + atkEA_tryrecycleitem, atkEB_settypetoterrain, - atkEC_pursuit_sth, - atkED_802B4B4, + atkEC_pursuitrelated, + atkED_snatchsetbanks, atkEE_removelightscreenreflect, - atkEF_pokeball_catch_calculation, - atkF0_copy_caught_poke, - atkF1_setpoke_as_caught, - atkF2_display_dex_info, - atkF3_nickname_caught_poke, - atkF4_802BEF0, + atkEF_handleballthrow, + atkF0_givecaughtmon, + atkF1_trysetcaughtmondexflags, + atkF2_displaydexinfo, + atkF3_trygivecaughtmonnick, + atkF4_subattackerhpbydmg, atkF5_removeattackerstatus1, - atkF6_802BF48, - atkF7_802BF54, + atkF6_finishaction, + atkF7_finishturn, }; struct statFractions @@ -869,59 +869,59 @@ static const u32 gStatusFlagsForMoveEffects[] = 0x00000000 }; -extern u8 BattleScript_1D963E[]; -extern u8 BattleScript_1D965A[]; -extern u8 BattleScript_1D9669[]; -extern u8 BattleScript_1D9678[]; -extern u8 BattleScript_1D9687[]; -extern u8 BattleScript_1D969D[]; -extern u8 BattleScript_1D96BA[]; -extern u8 BattleScript_1D9696[]; -extern u8 BattleScript_1D96B1[]; -extern u8 BattleScript_1D96AA[]; -extern u8 BattleScript_1D96C8[]; +extern u8 BattleScript_MoveEffectSleep[]; +extern u8 BattleScript_MoveEffectPoison[]; +extern u8 BattleScript_MoveEffectBurn[]; +extern u8 BattleScript_MoveEffectFreeze[]; +extern u8 BattleScript_MoveEffectParalysis[]; +extern u8 BattleScript_MoveEffectToxic[]; +extern u8 BattleScript_MoveEffectConfusion[]; +extern u8 BattleScript_MoveEffectUproar[]; +extern u8 BattleScript_MoveEffectWrap[]; +extern u8 BattleScript_MoveEffectPayDay[]; +extern u8 BattleScript_MoveEffectRecoil33[]; u8* const gMoveEffectBS_Ptrs[] = { - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D965A, - BattleScript_1D9669, - BattleScript_1D9678, - BattleScript_1D9687, - BattleScript_1D969D, - BattleScript_1D96BA, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D9696, - BattleScript_1D96AA, - BattleScript_1D963E, - BattleScript_1D96B1, - BattleScript_1D96C8, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D963E, - BattleScript_1D96C8 + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectPoison, + BattleScript_MoveEffectBurn, + BattleScript_MoveEffectFreeze, + BattleScript_MoveEffectParalysis, + BattleScript_MoveEffectToxic, + BattleScript_MoveEffectConfusion, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectUproar, + BattleScript_MoveEffectPayDay, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectWrap, + BattleScript_MoveEffectRecoil33, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectSleep, + BattleScript_MoveEffectRecoil33 }; const u8 sUnreferencedBitMask1[] = {0, 1, 3, 7, 0xF, 0x1F, 0x3F}; @@ -1034,7 +1034,7 @@ static void atk00_attackcanceler(void) if (gBattleMons[gBankAttacker].hp == 0 && !(gHitMarker & HITMARKER_NO_ATTACKSTRING)) { gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; - gBattlescriptCurrInstr = BattleScript_EndTurn; + gBattlescriptCurrInstr = BattleScript_MoveEnd; return; } if (AtkCanceller_UnableToUseMove()) @@ -1127,7 +1127,7 @@ static void JumpIfMoveFailed(u8 adder, u16 move) gBattlescriptCurrInstr = to_store; } -static void atk40_jump_if_move_affected_by_protect(void) +static void atk40_jumpifaffectedbyprotect(void) { if (TargetProtectAffected) { @@ -1383,7 +1383,7 @@ static void atk04_critcalc(void) gBattlescriptCurrInstr++; } -static void atk05_damagecalc1(void) +static void atk05_damagecalc(void) { u16 side_hword = gSideAffecting[GetBankIdentity(gBankTarget) & 1]; gBattleMoveDamage = CalculateBaseDamage(&gBattleMons[gBankAttacker], &gBattleMons[gBankTarget], gCurrentMove, @@ -1744,7 +1744,7 @@ void Unused_ApplyRandomDmgMultiplier(void) ApplyRandomDmgMultiplier(); } -static void atk07_dmg_adjustment(void) +static void atk07_adjustnormaldamage(void) { u8 hold_effect, quality; ApplyRandomDmgMultiplier(); @@ -1791,7 +1791,7 @@ static void atk07_dmg_adjustment(void) gBattlescriptCurrInstr++; } -static void atk08_dmg_adjustment2(void) //literally the same as 0x7 except it doesn't check for false swipe move effect... +static void atk08_adjustnormaldamage2(void) //literally the same as 0x7 except it doesn't check for false swipe move effect... { u8 hold_effect, quality; ApplyRandomDmgMultiplier(); @@ -2050,7 +2050,7 @@ static void atk0D_critmessage(void) } } -static void atk0E_effectiveness_sound(void) +static void atk0E_effectivenesssound(void) { if (gBattleExecBuffer) return; @@ -2192,7 +2192,7 @@ static void atk10_printstring(void) } } -static void atk11_printstring_playeronly(void) +static void atk11_printselectionstring(void) { gActiveBank = gBankAttacker; EmitPrintStringPlayerOnly(0, T2_READ_16(gBattlescriptCurrInstr + 1)); @@ -2234,7 +2234,7 @@ static void atk13_printfromtable(void) } } -static void atk14_printfromtable_playeronly(void) +static void atk14_printselectionstringfromtable(void) { if (gBattleExecBuffer == 0) { @@ -4919,7 +4919,7 @@ _0801F610: .4byte BattleScript_SAtkDown2\n\ #endif // NONMATCHING -static void atk15_seteffectwithchancetarget(void) +static void atk15_seteffectwithchance(void) { u32 PercentChance; if (gBattleMons[gBankAttacker].ability == ABILITY_SERENE_GRACE) @@ -4954,7 +4954,7 @@ static void atk17_seteffectsecondary(void) SetMoveEffect(0, 0); } -static void atk18_status_effect_clear(void) +static void atk18_clearstatusfromeffect(void) { gActiveBank = GetBattleBank(T2_READ_8(gBattlescriptCurrInstr + 1)); if (gBattleCommunication[MOVE_EFFECT_BYTE] <= 6) @@ -4967,7 +4967,7 @@ static void atk18_status_effect_clear(void) BATTLE_STRUCT->unk16112 = 0; } -static void atk19_faint_pokemon(void) +static void atk19_tryfaintmon(void) { u8 *r4; @@ -4995,13 +4995,13 @@ static void atk19_faint_pokemon(void) { gActiveBank = gBankAttacker; bank = gBankTarget; - r4 = gUnknown_081D8C58; + r4 = BattleScript_FaintAttacker; } else { gActiveBank = gBankTarget; bank = gBankAttacker; - r4 = gUnknown_081D8C65; + r4 = BattleScript_FaintTarget; } if (!(gAbsentBankFlags & gBitTable[gActiveBank]) && gBattleMons[gActiveBank].hp == 0) @@ -5039,7 +5039,7 @@ static void atk19_faint_pokemon(void) { b_movescr_stack_push(gBattlescriptCurrInstr); gBattleMoveDamage = gBattleMons[bank].hp; - gBattlescriptCurrInstr = gUnknown_081D9156; + gBattlescriptCurrInstr = BattleScript_DestinyBondTakesLife; } if ((gStatuses3[gBankTarget] & STATUS3_GRUDGE) && !(gHitMarker & HITMARKER_GRUDGE) @@ -5051,7 +5051,7 @@ static void atk19_faint_pokemon(void) gBattleMons[gBankAttacker].pp[moveIndex] = 0; b_movescr_stack_push(gBattlescriptCurrInstr); - gBattlescriptCurrInstr = gUnknown_081D9468; + gBattlescriptCurrInstr = BattleScript_SelectingImprisionedMoveInPalace; gActiveBank = gBankAttacker; EmitSetAttributes(0, moveIndex + 9, 0, 1, &gBattleMons[gActiveBank].pp[moveIndex]); MarkBufferBankForExecution(gActiveBank); @@ -5070,7 +5070,7 @@ static void atk19_faint_pokemon(void) } } -static void atk1A_faint_animation(void) +static void atk1A_dofaintanimation(void) { if (gBattleExecBuffer == 0) { @@ -5081,7 +5081,7 @@ static void atk1A_faint_animation(void) } } -static void atk1B_faint_effects_clear(void) +static void atk1B_cleareffectsonfaint(void) { //Clears things like attraction or trapping to other banks if (gBattleExecBuffer == 0) @@ -5220,7 +5220,7 @@ static void atk20_jumpifstat(void) gBattlescriptCurrInstr += 9; } -static void atk21_jumpifstatus3(void) +static void atk21_jumpifstatus3condition(void) { u32 flags; void* jump_loc; @@ -5265,14 +5265,14 @@ static void atk23_getexp(void) u16* exp = &BATTLE_STRUCT->exp; gBank1 = GetBattleBank(T2_READ_8(gBattlescriptCurrInstr + 1)); sent_in = gSentPokesToOpponent[(gBank1 & 2) >> 1]; - switch (BATTLE_STRUCT->atk23StateTracker) + switch (BATTLE_STRUCT->getexpStateTracker) { case 0: //check if should receive exp at all if (GetBankSide(gBank1) != 1 || (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_SAFARI | BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_EREADER_TRAINER))) - BATTLE_STRUCT->atk23StateTracker = 6; //goto last case + BATTLE_STRUCT->getexpStateTracker = 6; //goto last case else { - BATTLE_STRUCT->atk23StateTracker++; + BATTLE_STRUCT->getexpStateTracker++; ((u8*)ewram)[0x16113] |= gBitTable[gBattlePartyID[gBank1]]; } break; @@ -5317,7 +5317,7 @@ static void atk23_getexp(void) *exp = 1; gExpShareExp = 0; } - BATTLE_STRUCT->atk23StateTracker++; + BATTLE_STRUCT->getexpStateTracker++; BATTLE_STRUCT->expGetterID = 0; BATTLE_STRUCT->sentInPokes = sent_in; } //no break statement @@ -5334,7 +5334,7 @@ static void atk23_getexp(void) if ((hold_effect != HOLD_EFFECT_EXP_SHARE && !(BATTLE_STRUCT->sentInPokes & 1))) { BATTLE_STRUCT->sentInPokes >>= 1; - tracker = &BATTLE_STRUCT->atk23StateTracker; + tracker = &BATTLE_STRUCT->getexpStateTracker; zero = 0; *tracker = 5; //increment looper gBattleMoveDamage = zero; //used for exp @@ -5342,7 +5342,7 @@ static void atk23_getexp(void) else if (GetMonData(&gPlayerParty[BATTLE_STRUCT->expGetterID], MON_DATA_LEVEL) == 100) { BATTLE_STRUCT->sentInPokes >>= 1; - tracker = &BATTLE_STRUCT->atk23StateTracker; + tracker = &BATTLE_STRUCT->getexpStateTracker; zero = 0; *tracker = 5; //increment looper gBattleMoveDamage = zero; //used for exp @@ -5428,7 +5428,7 @@ static void atk23_getexp(void) MonGainEVs(&gPlayerParty[BATTLE_STRUCT->expGetterID], gBattleMons[gBank1].species); } BATTLE_STRUCT->sentInPokes >>= 1; - BATTLE_STRUCT->atk23StateTracker++; + BATTLE_STRUCT->getexpStateTracker++; } } break; @@ -5450,7 +5450,7 @@ static void atk23_getexp(void) EmitExpBarUpdate(0, BATTLE_STRUCT->expGetterID, gBattleMoveDamage); MarkBufferBankForExecution(gActiveBank); } - BATTLE_STRUCT->atk23StateTracker++; + BATTLE_STRUCT->getexpStateTracker++; } break; case 4: //lvl up if necessary @@ -5508,24 +5508,24 @@ static void atk23_getexp(void) gBattleMons[2].spAttack = GetMonData(&gPlayerParty[BATTLE_STRUCT->expGetterID], MON_DATA_SPEED /*RIP*/); gBattleMons[2].spDefense = GetMonData(&gPlayerParty[BATTLE_STRUCT->expGetterID], MON_DATA_SPATK); } - BATTLE_STRUCT->atk23StateTracker = 5; + BATTLE_STRUCT->getexpStateTracker = 5; } else { gBattleMoveDamage = 0; - BATTLE_STRUCT->atk23StateTracker = 5; + BATTLE_STRUCT->getexpStateTracker = 5; } } break; case 5: //looper increment if (gBattleMoveDamage) //there is exp to give, goto case 3 that gives exp - BATTLE_STRUCT->atk23StateTracker = 3; + BATTLE_STRUCT->getexpStateTracker = 3; else { if (++BATTLE_STRUCT->expGetterID <= 5) - BATTLE_STRUCT->atk23StateTracker = 2; //loop again + BATTLE_STRUCT->getexpStateTracker = 2; //loop again else - BATTLE_STRUCT->atk23StateTracker = 6; //we're done + BATTLE_STRUCT->getexpStateTracker = 6; //we're done } break; case 6: //increment instruction @@ -6966,19 +6966,19 @@ static void MoveValuesCleanUp(void) gHitMarker &= ~(HITMARKER_SYNCHRONISE_EFFECT); } -static void atk25_move_values_cleanup(void) +static void atk25_movevaluescleanup(void) { MoveValuesCleanUp(); gBattlescriptCurrInstr += 1; } -static void atk26_set_multihit(void) +static void atk26_setmultihit(void) { gMultiHitCounter = T2_READ_8(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr += 2; } -static void atk27_decrement_multihit(void) +static void atk27_decrementmultihit(void) { if (--gMultiHitCounter == 0) gBattlescriptCurrInstr += 5; @@ -7184,7 +7184,7 @@ static void atk31_copyarray(void) gBattlescriptCurrInstr += 10; } -static void atk32_copyarray_withindex(void) +static void atk32_copyarraywithindex(void) { u8* mem1 = T2_READ_PTR(gBattlescriptCurrInstr + 1); u8* mem2 = T2_READ_PTR(gBattlescriptCurrInstr + 5); @@ -7332,7 +7332,7 @@ static void atk43_jumpifabilitypresent(void) gBattlescriptCurrInstr += 6; } -static void atk44(void) +static void atk44_endselectionscript(void) { ewram16060(gBankAttacker) = 1; } @@ -7796,7 +7796,7 @@ _080217E6:\n\ #endif // NONMATCHING #ifdef NONMATCHING -static void atk49_moveendturn(void) +static void atk49_moveend(void) { int i; int effect = 0; @@ -7831,7 +7831,7 @@ static void atk49_moveendturn(void) { gBattleMons[gBankTarget].statStages[STAT_STAGE_ATK]++; b_movescr_stack_push_cursor(); - gBattlescriptCurrInstr = gUnknown_081D9132; + gBattlescriptCurrInstr = BattleScript_RageIsBuilding; effect = 1; } BATTLE_STRUCT->cmd49StateTracker++; @@ -7847,7 +7847,7 @@ static void atk49_moveendturn(void) EmitSetAttributes(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gBankTarget].status1); MarkBufferBankForExecution(gActiveBank); b_movescr_stack_push_cursor(); - gBattlescriptCurrInstr = gUnknown_081D955D; + gBattlescriptCurrInstr = BattleScript_DefrostedViaFireMove; effect = 1; } BATTLE_STRUCT->cmd49StateTracker++; @@ -7936,7 +7936,7 @@ static void atk49_moveendturn(void) } #else __attribute__((naked)) -static void atk49_moveendturn(void) +static void atk49_moveend(void) { asm(".syntax unified\n\ push {r4-r7,lr}\n\ @@ -8008,7 +8008,7 @@ _08021874:\n\ adds r0, r3\n\ strb r4, [r0]\n\ bl MoveValuesCleanUp\n\ - ldr r2, _080218B4 @ =gBattleScriptsEffectsTable\n\ + ldr r2, _080218B4 @ =gBattleScriptsForMoveEffects\n\ mov r4, r8\n\ ldrh r1, [r4]\n\ lsls r0, r1, 1\n\ @@ -8026,7 +8026,7 @@ _08021874:\n\ .align 2, 0\n\ _080218AC: .4byte gSharedMem\n\ _080218B0: .4byte 0x0001600c\n\ -_080218B4: .4byte gBattleScriptsEffectsTable\n\ +_080218B4: .4byte gBattleScriptsForMoveEffects\n\ _080218B8: .4byte gBattlescriptCurrInstr\n\ _080218BC: .4byte gUnknown_081D9B2D\n\ _080218C0:\n\ @@ -8166,7 +8166,7 @@ _080219C8:\n\ strb r0, [r1, 0x19]\n\ bl b_movescr_stack_push_cursor\n\ ldr r1, _08021A24 @ =gBattlescriptCurrInstr\n\ - ldr r0, _08021A28 @ =gUnknown_081D9132\n\ + ldr r0, _08021A28 @ =BattleScript_RageIsBuilding\n\ str r0, [r1]\n\ movs r5, 0x1\n\ mov r10, r5\n\ @@ -8184,7 +8184,7 @@ _08021A18: .4byte gProtectStructs\n\ _08021A1C: .4byte gBattleMoves\n\ _08021A20: .4byte gCurrentMove\n\ _08021A24: .4byte gBattlescriptCurrInstr\n\ -_08021A28: .4byte gUnknown_081D9132\n\ +_08021A28: .4byte BattleScript_RageIsBuilding\n\ _08021A2C: .4byte gSharedMem\n\ _08021A30: .4byte 0x0001600c\n\ _08021A34:\n\ @@ -8264,7 +8264,7 @@ _08021A92:\n\ bl MarkBufferBankForExecution\n\ bl b_movescr_stack_push_cursor\n\ ldr r1, _08021AE8 @ =gBattlescriptCurrInstr\n\ - ldr r0, _08021AEC @ =gUnknown_081D955D\n\ + ldr r0, _08021AEC @ =BattleScript_DefrostedViaFireMove\n\ str r0, [r1]\n\ movs r2, 0x1\n\ mov r10, r2\n\ @@ -8277,7 +8277,7 @@ _08021ADC: .4byte gSpecialStatuses\n\ _08021AE0: .4byte gBattleMoveFlags\n\ _08021AE4: .4byte gActiveBank\n\ _08021AE8: .4byte gBattlescriptCurrInstr\n\ -_08021AEC: .4byte gUnknown_081D955D\n\ +_08021AEC: .4byte BattleScript_DefrostedViaFireMove\n\ _08021AF0:\n\ ldr r0, _08021B14 @ =gBankTarget\n\ ldrb r1, [r0]\n\ @@ -8376,7 +8376,7 @@ _08021B9C:\n\ ldr r4, [sp, 0x8]\n\ cmp r4, 0x1D\n\ bne _08021BE0\n\ - ldr r0, _08021C2C @ =gUnknown_02024BE8\n\ + ldr r0, _08021C2C @ =gChosenMove\n\ ldrh r2, [r0]\n\ adds r7, r0, 0\n\ cmp r2, 0xA5\n\ @@ -8444,7 +8444,7 @@ _08021C22:\n\ b _08022244\n\ .align 2, 0\n\ _08021C28: .4byte gHitMarker\n\ -_08021C2C: .4byte gUnknown_02024BE8\n\ +_08021C2C: .4byte gChosenMove\n\ _08021C30: .4byte 0x0000ffff\n\ _08021C34: .4byte gBattleMoveFlags\n\ _08021C38: .4byte gBattleMons\n\ @@ -8733,7 +8733,7 @@ _08021E70:\n\ str r3, [r5]\n\ _08021E9A:\n\ ldr r1, _08021F40 @ =gBattleMoves\n\ - ldr r2, _08021F44 @ =gUnknown_02024BE8\n\ + ldr r2, _08021F44 @ =gChosenMove\n\ ldrh r3, [r2]\n\ lsls r0, r3, 1\n\ adds r0, r3\n\ @@ -8816,7 +8816,7 @@ _08021F34: .4byte gActiveBank\n\ _08021F38: .4byte gBankTarget\n\ _08021F3C: .4byte 0xffffefff\n\ _08021F40: .4byte gBattleMoves\n\ -_08021F44: .4byte gUnknown_02024BE8\n\ +_08021F44: .4byte gChosenMove\n\ _08021F48: .4byte gBattleMoveFlags\n\ _08021F4C: .4byte gUnknown_02024C2C\n\ _08021F50: .4byte gAbsentBankFlags\n\ @@ -8967,7 +8967,7 @@ _08022082:\n\ b _08022244\n\ _08022090:\n\ ldr r1, _0802213C @ =gBattleMoves\n\ - ldr r4, _08022140 @ =gUnknown_02024BE8\n\ + ldr r4, _08022140 @ =gChosenMove\n\ ldrh r3, [r4]\n\ lsls r0, r3, 1\n\ adds r0, r3\n\ @@ -9051,7 +9051,7 @@ _08022130: .4byte gBitTable\n\ _08022134: .4byte gBankAttacker\n\ _08022138: .4byte 0x000160a6\n\ _0802213C: .4byte gBattleMoves\n\ -_08022140: .4byte gUnknown_02024BE8\n\ +_08022140: .4byte gChosenMove\n\ _08022144: .4byte gHitMarker\n\ _08022148: .4byte gBankTarget\n\ _0802214C: .4byte gBattleMoveFlags\n\ @@ -9322,7 +9322,7 @@ static void atk4A_typecalc2(void) gBattlescriptCurrInstr++; } -static void atk4B_return_atk_to_ball(void) +static void atk4B_returnatktoball(void) { gActiveBank = gBankAttacker; if (!(gHitMarker & HITMARKER_FAINTED(gActiveBank))) @@ -9333,7 +9333,7 @@ static void atk4B_return_atk_to_ball(void) gBattlescriptCurrInstr++; } -static void atk4C_copy_poke_data(void) +static void atk4C_getswitchedmondata(void) { if (gBattleExecBuffer) return; @@ -9357,7 +9357,7 @@ static inline u8 get_knocked_off_byte(u8 bank) return *cc; } -static void atk4D_switch_data_update(void) +static void atk4D_switchindataupdate(void) { struct BattlePokemon OldData; int i; @@ -9401,7 +9401,7 @@ static void atk4D_switch_data_update(void) gBattlescriptCurrInstr += 2; } -static void atk4E_switchin_anim(void) +static void atk4E_switchinanim(void) { if (gBattleExecBuffer) return; @@ -9417,7 +9417,7 @@ static void atk4E_switchin_anim(void) gBattlescriptCurrInstr += 3; } -static void atk4F_jump_if_cannot_switch(void) +static void atk4F_jumpifcantswitch(void) { int val, to_cmp; register struct Pokemon *party; @@ -10565,7 +10565,7 @@ _08023318: .4byte gBitTable\n\ .syntax divided"); } -static void atk51_switch_handle_order(void) +static void atk51_switchhandleorder(void) { int i; if (gBattleExecBuffer) @@ -10616,7 +10616,7 @@ static void atk51_switch_handle_order(void) gBattlescriptCurrInstr += 3; } -static void atk52_switch_in_effects(void) +static void atk52_switchineffects(void) { int i; @@ -10641,11 +10641,11 @@ static void atk52_switch_in_effects(void) b_movescr_stack_push_cursor(); if (T2_READ_8(gBattlescriptCurrInstr + 1) == 0) - gBattlescriptCurrInstr = gUnknown_081D919F; + gBattlescriptCurrInstr = BattleScript_SpikesOnTarget; else if (T2_READ_8(gBattlescriptCurrInstr + 1) == 1) - gBattlescriptCurrInstr = gUnknown_081D9171; + gBattlescriptCurrInstr = BattleScript_SpikesOnAttacker; else - gBattlescriptCurrInstr = gUnknown_081D91CD; + gBattlescriptCurrInstr = BattleScript_SpikesOngBank1; } else { @@ -10687,7 +10687,7 @@ static void atk52_switch_in_effects(void) } } -static void atk53_trainer_slide(void) +static void atk53_trainerslidein(void) { if (!T2_READ_8(gBattlescriptCurrInstr + 1)) gActiveBank = GetBankByPlayerAI(0); @@ -10699,7 +10699,7 @@ static void atk53_trainer_slide(void) gBattlescriptCurrInstr += 2; } -static void atk54_effectiveness_sound(void) +static void atk54_playse(void) { gActiveBank = gBankAttacker; EmitEffectivenessSound(0, T2_READ_16(gBattlescriptCurrInstr + 1)); @@ -10707,7 +10707,7 @@ static void atk54_effectiveness_sound(void) gBattlescriptCurrInstr += 3; } -static void atk55_play_sound(void) +static void atk55_fanfare(void) { gActiveBank = gBankAttacker; Emitcmd44(0, T2_READ_16(gBattlescriptCurrInstr + 1)); @@ -10715,7 +10715,7 @@ static void atk55_play_sound(void) gBattlescriptCurrInstr += 3; } -static void atk56_fainting_cry(void) +static void atk56_playfaintcry(void) { gActiveBank = GetBattleBank(T2_READ_8(gBattlescriptCurrInstr + 1)); EmitFaintingCry(0); @@ -10731,7 +10731,7 @@ static void atk57(void) gBattlescriptCurrInstr += 1; } -static void atk58_return_to_ball(void) +static void atk58_returntoball(void) { gActiveBank = GetBattleBank(T2_READ_8(gBattlescriptCurrInstr + 1)); EmitReturnPokeToBall(0, 1); @@ -10739,7 +10739,7 @@ static void atk58_return_to_ball(void) gBattlescriptCurrInstr += 2; } -void atk59_learnmove_inbattle(void) +void atk59_handlelearnnewmove(void) { u8* loc1 = T1_READ_PTR(gBattlescriptCurrInstr + 1); u8* loc2 = T1_READ_PTR(gBattlescriptCurrInstr + 5); @@ -10785,7 +10785,7 @@ void sub_8023AD8(void) DestroyMenuCursor(); } -static void atk5A(void) +static void atk5A_yesnoboxlearnmove(void) { gActiveBank = 0; switch (BATTLE_STRUCT->atk5A_StateTracker) @@ -10898,7 +10898,7 @@ static void atk5A(void) } } -static void atk5B_80256E0(void) +static void atk5B_yesnoboxstoplearningmove(void) { switch (BATTLE_STRUCT->atk5A_StateTracker) { @@ -11253,7 +11253,7 @@ static void atk5F_8025B24(void) gBattlescriptCurrInstr++; } -static void atk60_increment_gamestat(void) +static void atk60_incrementgamestat(void) { if (GetBankSide(gBankAttacker) == 0) { @@ -11262,7 +11262,7 @@ static void atk60_increment_gamestat(void) gBattlescriptCurrInstr += 2; } -static void atk61_8025BA4(void) +static void atk61_drawpartystatussummary(void) { int i; struct Pokemon* party; @@ -11307,8 +11307,8 @@ static void atk63_jumptorandomattack(void) if (T2_READ_8(gBattlescriptCurrInstr + 1)) gCurrentMove = gRandomMove; else - gUnknown_02024BE8 = gCurrentMove = gRandomMove; - gBattlescriptCurrInstr = gBattleScriptsEffectsTable[gBattleMoves[gCurrentMove].effect]; + gChosenMove = gCurrentMove = gRandomMove; + gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; } static void atk64_statusanimation(void) @@ -11357,7 +11357,7 @@ static void atk66_chosenstatusanimation(void) } } -static void atk67_8025ECC(void) +static void atk67_yesnobox(void) { switch (gBattleCommunication[0]) { @@ -11399,7 +11399,7 @@ static void atk67_8025ECC(void) } } -static void atk68_80246A0(void) +static void atk68_cancelallactions(void) { int i; for (i = 0; i < gNoOfAllBanks; i++) @@ -11409,7 +11409,7 @@ static void atk68_80246A0(void) gBattlescriptCurrInstr++; } -static void atk69_dmg_adjustment2(void) //literally a copy of atk07 except theres no rand dmg modifier... +static void atk69_adjustsetdamage(void) //literally a copy of atk07 except theres no rand dmg modifier... { u8 hold_effect, quality; if (gBattleMons[gBankTarget].item == ITEM_ENIGMA_BERRY) @@ -11474,7 +11474,7 @@ static void atk6B_atknameinbuff1(void) } #ifdef NONMATCHING -static void atk6C_lvlbox_display(void) +static void atk6C_drawlvlupbox(void) { u8 r1 = 0; u8 r7 = 0; @@ -11489,7 +11489,7 @@ static void atk6C_lvlbox_display(void) #else __attribute__((naked)) -static void atk6C_lvlbox_display(void) +static void atk6C_drawlvlupbox(void) { asm(".syntax unified\n\ push {r4-r7,lr}\n\ @@ -11899,19 +11899,19 @@ _08024C48: .4byte gBattlescriptCurrInstr\n\ #endif -static void atk6D_set_sentpokes_values(void) +static void atk6D_resetsentmonsvalue(void) { sub_80156DC(); gBattlescriptCurrInstr++; } -static void atk6E_set_atk_to_player0(void) +static void atk6E_setatktoplayer0(void) { gBankAttacker = GetBankByPlayerAI(0); gBattlescriptCurrInstr++; } -static void atk6F_set_visible(void) +static void atk6F_makevisible(void) { gActiveBank = GetBattleBank(T2_READ_8(gBattlescriptCurrInstr + 1)); EmitSpriteInvisibility(0, 0); @@ -11919,7 +11919,7 @@ static void atk6F_set_visible(void) gBattlescriptCurrInstr += 2; } -static void atk70_record_ability(void) +static void atk70_recordlastability(void) { gActiveBank = GetBattleBank(T2_READ_8(gBattlescriptCurrInstr + 1)); RecordAbilityBattle(gActiveBank, gLastUsedAbility); @@ -11935,13 +11935,13 @@ void sub_8024CEC(void) gBattleTextBuff2[4] = 0xFF; } -static void atk71_buffer_move_to_learn(void) +static void atk71_buffermovetolearn(void) { sub_8024CEC(); gBattlescriptCurrInstr++; } -static void atk72_jump_if_can_run_frombattle(void) +static void atk72_jumpifplayerran(void) { if (sub_8014AB8(gBank1)) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); @@ -11949,7 +11949,7 @@ static void atk72_jump_if_can_run_frombattle(void) gBattlescriptCurrInstr += 5; } -static void atk73_hp_thresholds(void) +static void atk73_hpthresholds(void) { u8 opposing_bank; s32 result; @@ -11975,7 +11975,7 @@ static void atk73_hp_thresholds(void) gBattlescriptCurrInstr += 2; } -static void atk74_hp_thresholds2(void) +static void atk74_hpthresholds2(void) { u8 opposing_bank; u8 hp_switchout; @@ -12000,7 +12000,7 @@ static void atk74_hp_thresholds2(void) gBattlescriptCurrInstr += 2; } -static void atk75_8026A58(void) +static void atk75_useitemonopponent(void) { gBankInMenu = gBankAttacker; sub_803E1B0(&gEnemyParty[gBattlePartyID[gBankAttacker]], gLastUsedItem, gBattlePartyID[gBankAttacker], 0, 1); @@ -12073,7 +12073,7 @@ static void atk76_various(void) gBattlescriptCurrInstr += 3; } -static void atk77_setprotect(void) //protect and endure +static void atk77_setprotectlike(void) //protect and endure { bool8 not_last_turn = 1; u16 last_move = gUnknown_02024C4C[gBankAttacker]; @@ -12138,7 +12138,7 @@ static void atk78_faintifabilitynotdamp(void) { gLastUsedAbility = ABILITY_DAMP; RecordAbilityBattle(gBankTarget, gBattleMons[gBankTarget].ability); - gBattlescriptCurrInstr = gUnknown_081D9834; + gBattlescriptCurrInstr = BattleScript_DampStopsExplosion; } } @@ -12155,7 +12155,7 @@ static void atk79_setatkhptozero(void) gBattlescriptCurrInstr++; } -static void atk7A_jumpwhiletargetvalid(void) //used by intimidate to loop through all targets +static void atk7A_jumpifnexttargetvalid(void) //used by intimidate to loop through all targets { u8* jump_loc = T1_READ_PTR(gBattlescriptCurrInstr + 1); @@ -12178,7 +12178,7 @@ static void atk7A_jumpwhiletargetvalid(void) //used by intimidate to loop throug gBattlescriptCurrInstr += 5; } -static void atk7B_healhalfHP_if_possible(void) +static void atk7B_tryhealhalfhealth(void) { u8* fail_loc = T1_READ_PTR(gBattlescriptCurrInstr + 1); @@ -12196,7 +12196,7 @@ static void atk7B_healhalfHP_if_possible(void) gBattlescriptCurrInstr += 6; } -static void atk7C_8025508(void) +static void atk7C_trymirrormove(void) { u16 r7 = ewram160ACarr2(0, gBankAttacker) | (ewram160ACarr2(1, gBankAttacker) << 8); u16 r6 = ewram16100arr2(0, gBankAttacker) | (ewram16100arr2(1, gBankAttacker) << 8); @@ -12207,7 +12207,7 @@ static void atk7C_8025508(void) gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED); gCurrentMove = r7; gBankTarget = GetMoveTarget(gCurrentMove, 0); - gBattlescriptCurrInstr = gBattleScriptsEffectsTable[gBattleMoves[gCurrentMove].effect]; + gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; } else if (r6 != 0 && r5 != 0 && r6 != 0xFFFF && r5 != 0xFFFF) { @@ -12217,21 +12217,21 @@ static void atk7C_8025508(void) else gCurrentMove = r5; gBankTarget = GetMoveTarget(gCurrentMove, 0); - gBattlescriptCurrInstr = gBattleScriptsEffectsTable[gBattleMoves[gCurrentMove].effect]; + gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; } else if (r6 != 0 && r6 != 0xFFFF) { gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED); gCurrentMove = r6; gBankTarget = GetMoveTarget(gCurrentMove, 0); - gBattlescriptCurrInstr = gBattleScriptsEffectsTable[gBattleMoves[gCurrentMove].effect]; + gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; } else if (r5 != 0 && r5 != 0xFFFF) { gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED); gCurrentMove = r5; gBankTarget = GetMoveTarget(gCurrentMove, 0); - gBattlescriptCurrInstr = gBattleScriptsEffectsTable[gBattleMoves[gCurrentMove].effect]; + gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; } else { @@ -12240,7 +12240,7 @@ static void atk7C_8025508(void) } } -static void atk7D_set_rain(void) +static void atk7D_setrain(void) { if (gBattleWeather & WEATHER_RAIN_ANY) { @@ -12319,7 +12319,7 @@ static void atk80_manipulatedamage(void) gBattlescriptCurrInstr += 2; } -static void atk81_setrest(void) +static void atk81_trysetrest(void) { u8* fail_loc = T1_READ_PTR(gBattlescriptCurrInstr + 1); gActiveBank = gBankTarget = gBankAttacker; @@ -12377,7 +12377,7 @@ bool8 UproarWakeUpCheck(u8 bank) return 1; } -static void atk84_jump_if_cant_sleep(void) +static void atk84_jumpifcantmakeasleep(void) { u8* jump_loc = T1_READ_PTR(gBattlescriptCurrInstr + 1); if (UproarWakeUpCheck(gBankTarget)) @@ -13264,7 +13264,7 @@ static void atk8C_confuseifrepeatingattackends(void) gBattlescriptCurrInstr++; } -static void atk8D_setmultihit_counter(void) +static void atk8D_setmultihitcounter(void) { if (T2_READ_8(gBattlescriptCurrInstr + 1)) gMultiHitCounter = T2_READ_8(gBattlescriptCurrInstr + 1); @@ -13279,7 +13279,7 @@ static void atk8D_setmultihit_counter(void) gBattlescriptCurrInstr += 2; } -static void atk8E_prepare_multihit(void) +static void atk8E_initmultihitstring(void) { ewram160E0(0) = 0xFD; ewram160E0(1) = 1; @@ -13306,7 +13306,7 @@ static bool8 sub_80264C0(void) } ewram16064arr(gBankTarget) = gBattlePartyID[gBankTarget]; } - gBattlescriptCurrInstr = gUnknown_081D90FC; + gBattlescriptCurrInstr = BattleScript_SuccessForceOut; return 1; } @@ -13399,7 +13399,7 @@ static void atk8F_forcerandomswitch(void) } } -static void atk90_conversion_type_change(void) +static void atk90_tryconversiontypechange(void) { //randomly changes user's type to one of its moves' type u8 valid_moves = 0; @@ -13472,7 +13472,7 @@ static void atk91_givepaydaymoney(void) gBattleTextBuff1[5] = uBYTE1_16(gPaydayMoney); gBattleTextBuff1[6] = 0xFF; b_movescr_stack_push(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = gUnknown_081D95DB; + gBattlescriptCurrInstr = BattleScript_PrintPayDayMoneyString; } else gBattlescriptCurrInstr++; @@ -13498,7 +13498,7 @@ static void atk92_setlightscreen(void) } #ifdef NOTMATCHING -static void atk93_ko_move(void) +static void atk93_tryKO(void) { if (gBattleMons[gBankTarget].item == ITEM_ENIGMA_BERRY) hold_effect = gEnigmaBerries[gBankTarget].holdEffect, quality = gEnigmaBerries[gBankTarget].holdEffectParam; @@ -13552,7 +13552,7 @@ MOVESTATUS_MISSED_LABEL: #else __attribute((naked)) -static void atk93_ko_move(void) +static void atk93_tryKO(void) { asm(".syntax unified\n\ push {r4-r7,lr}\n\ @@ -13647,7 +13647,7 @@ _08026C0C:\n\ ldr r0, _08026C60 @ =gLastUsedAbility\n\ strb r3, [r0]\n\ ldr r1, _08026C64 @ =gBattlescriptCurrInstr\n\ - ldr r0, _08026C68 @ =gUnknown_081D9826\n\ + ldr r0, _08026C68 @ =BattleScript_SturdyPreventsOHKO\n\ str r0, [r1]\n\ ldr r1, _08026C50 @ =gBankTarget\n\ ldrb r0, [r1]\n\ @@ -13662,7 +13662,7 @@ _08026C58: .4byte gBattleMons\n\ _08026C5C: .4byte gBattleMoveFlags\n\ _08026C60: .4byte gLastUsedAbility\n\ _08026C64: .4byte gBattlescriptCurrInstr\n\ -_08026C68: .4byte gUnknown_081D9826\n\ +_08026C68: .4byte BattleScript_SturdyPreventsOHKO\n\ _08026C6C:\n\ ldr r1, _08026CE0 @ =gStatuses3\n\ lsls r0, r2, 2\n\ @@ -13903,7 +13903,7 @@ _08026E54: .4byte gBattlescriptCurrInstr\n\ } #endif // NOTMATCHING -static void atk94_gethalfcurrentenemyhp(void) //super fang +static void atk94_damagetohalftargethp(void) //super fang { gBattleMoveDamage = gBattleMons[gBankTarget].hp / 2; if (gBattleMoveDamage == 0) @@ -13969,7 +13969,7 @@ static void atk96_weatherdamage(void) gBattlescriptCurrInstr++; } -static void atk97_try_infatuation(void) +static void atk97_tryinfatuating(void) { struct Pokemon *attacker, *target; u16 atk_species, def_species; @@ -14012,7 +14012,7 @@ static void atk97_try_infatuation(void) } } -static void atk98_status_icon_update(void) +static void atk98_updatestatusicon(void) { if (gBattleExecBuffer) return; @@ -14061,7 +14061,7 @@ static void atk99_setmist(void) gBattlescriptCurrInstr++; } -static void atk9A_set_focusenergy(void) +static void atk9A_setfocusenergy(void) { if (gBattleMons[gBankAttacker].status2 & STATUS2_FOCUS_ENERGY) { @@ -14078,7 +14078,7 @@ static void atk9A_set_focusenergy(void) static void atk9B_transformdataexecution(void) { - gUnknown_02024BE8 = 0xFFFF; + gChosenMove = 0xFFFF; gBattlescriptCurrInstr++; if (gBattleMons[gBankTarget].status2 & STATUS2_TRANSFORMED || gStatuses3[gBankTarget] & STATUS3_SEMI_INVULNERABLE) { @@ -14092,7 +14092,7 @@ static void atk9B_transformdataexecution(void) gBattleMons[gBankAttacker].status2 |= STATUS2_TRANSFORMED; gDisableStructs[gBankAttacker].disabledMove = 0; gDisableStructs[gBankAttacker].disableTimer1 = 0; - gDisableStructs[gBankAttacker].unk0 = gBattleMons[gBankTarget].personality; + gDisableStructs[gBankAttacker].transformedMonPersonality = gBattleMons[gBankTarget].personality; gDisableStructs[gBankAttacker].unk18_b = 0; gBattleTextBuff1[0] = 0xFD; @@ -14122,7 +14122,7 @@ static void atk9B_transformdataexecution(void) } } -static void atk9C_set_substitute(void) +static void atk9C_setsubstitute(void) { u32 hp = gBattleMons[gBankAttacker].maxHP / 4; if (gBattleMons[gBankAttacker].maxHP / 4 == 0) @@ -14153,9 +14153,9 @@ static bool8 IsMoveUncopyable(u16 move) return (sUnknown_081FACFE[i] != 0xFFFE); } -static void atk9D_copyattack(void) +static void atk9D_mimicattackcopy(void) { - gUnknown_02024BE8 = 0xFFFF; + gChosenMove = 0xFFFF; if (IsMoveUncopyable(gLastUsedMove[gBankTarget]) || gBattleMons[gBankAttacker].status2 & STATUS2_TRANSFORMED || gLastUsedMove[gBankTarget] == 0 || gLastUsedMove[gBankTarget] == 0xFFFF) { @@ -14203,7 +14203,7 @@ static void atk9E_metronome(void) } while (sUnknown_081FACFE[i] != 0xFFFF); gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED); - gBattlescriptCurrInstr = gBattleScriptsEffectsTable[gBattleMoves[gCurrentMove].effect]; + gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; gBankTarget = GetMoveTarget(gCurrentMove, 0); } @@ -14255,7 +14255,7 @@ _080278F8:\n\ ldr r1, _08027950 @ =0xfffffbff\n\ ands r0, r1\n\ str r0, [r2]\n\ - ldr r3, _08027954 @ =gBattleScriptsEffectsTable\n\ + ldr r3, _08027954 @ =gBattleScriptsForMoveEffects\n\ ldr r2, _08027958 @ =gBattleMoves\n\ ldrh r1, [r4]\n\ lsls r0, r1, 1\n\ @@ -14286,7 +14286,7 @@ _08027944: .4byte 0x000001ff\n\ _08027948: .4byte 0x0000ffff\n\ _0802794C: .4byte gHitMarker\n\ _08027950: .4byte 0xfffffbff\n\ -_08027954: .4byte gBattleScriptsEffectsTable\n\ +_08027954: .4byte gBattleScriptsForMoveEffects\n\ _08027958: .4byte gBattleMoves\n\ _0802795C: .4byte gBankTarget\n\ .syntax divided"); @@ -14375,7 +14375,7 @@ static void atkA3_disablelastusedattack(void) } } -static void atkA4_setencore(void) +static void atkA4_trysetencore(void) { int i; for (i = 0; i < 4; i++) @@ -14742,7 +14742,7 @@ struct move_pp static void atkA8_copymovepermanently(void) { - gUnknown_02024BE8 = 0xFFFF; + gChosenMove = 0xFFFF; if (!(gBattleMons[gBankAttacker].status2 & STATUS2_TRANSFORMED) && gUnknown_02024C2C[gBankTarget] != MOVE_STRUGGLE && gUnknown_02024C2C[gBankTarget] != 0 && gUnknown_02024C2C[gBankTarget] != 0xFFFF && gUnknown_02024C2C[gBankTarget] != MOVE_SKETCH) { int i; @@ -14813,7 +14813,7 @@ static u8 AttacksThisTurn(u8 bank, u16 move) //Note: returns 1 if it's a chargin return 2; } -static void atkA9_sleeptalk_choose_move(void) +static void atkA9_trychoosesleeptalkmove(void) { u8 unusable_moves = 0; int i; @@ -14843,7 +14843,7 @@ static void atkA9_sleeptalk_choose_move(void) } } -static void atkAA_set_destinybond(void) +static void atkAA_setdestinybond(void) { gBattleMons[gBankAttacker].status2 |= STATUS2_DESTINY_BOND; gBattlescriptCurrInstr++; @@ -14857,7 +14857,7 @@ static void DestinyBondFlagUpdate(void) gHitMarker |= HITMARKER_DESTINYBOND; } -static void atkAB_DestinyBondFlagUpdate(void) +static void atkAB_trysetdestinybondtohappen(void) { DestinyBondFlagUpdate(); gBattlescriptCurrInstr++; @@ -14876,7 +14876,7 @@ static void atkAC_remaininghptopower(void) gBattlescriptCurrInstr++; } -static void atkAD_spite_ppreduce(void) +static void atkAD_tryspiteppreduce(void) { if (gLastUsedMove[gBankTarget] != 0 && gLastUsedMove[gBankTarget] != 0xFFFF && !(gStatuses3[gBankTarget] & STATUS3_SEMI_INVULNERABLE)) { @@ -14922,7 +14922,7 @@ static void atkAD_spite_ppreduce(void) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } -static void atkAE_heal_party_status(void) +static void atkAE_healpartystatus(void) { register u32 zero2 asm("r4") = 0; u32 zero = zero2; @@ -15015,7 +15015,7 @@ static void atkAF_cursetarget(void) } } -static void atkB0_set_spikes(void) +static void atkB0_trysetspikes(void) { u8 side = GetBankSide(gBankAttacker) ^ 1; if (gSideTimer[side].spikesAmount == 3) @@ -15031,13 +15031,13 @@ static void atkB0_set_spikes(void) } } -static void atkB1_set_foresight(void) +static void atkB1_setforesight(void) { gBattleMons[gBankTarget].status2 |= STATUS2_FORESIGHT; gBattlescriptCurrInstr++; } -static void atkB2_setperishsong(void) +static void atkB2_trysetperishsong(void) { int not_affected_pokes = 0, i; @@ -15065,7 +15065,7 @@ static void atkB3_rolloutdamagecalculation(void) if (gBattleMoveFlags & MOVESTATUS_NOEFFECT) { CancelMultiTurnMoves(gBankAttacker); - gBattlescriptCurrInstr = BattleScript_1D6F74; + gBattlescriptCurrInstr = BattleScript_MoveMissedPause; } else { @@ -15104,7 +15104,7 @@ static void atkB5_furycuttercalc(void) if (gBattleMoveFlags & MOVESTATUS_NOEFFECT) { gDisableStructs[gBankAttacker].furyCutterCounter = 0; - gBattlescriptCurrInstr = BattleScript_1D6F74; + gBattlescriptCurrInstr = BattleScript_MoveMissedPause; } else { @@ -15147,17 +15147,17 @@ static void atkB7_presentdamagecalculation(void) gBattleMoveDamage *= -1; } if (rand < 204) - gBattlescriptCurrInstr = BattleScript_1D6F44; + gBattlescriptCurrInstr = BattleScript_HitFromCritCalc; else if (gBattleMons[gBankTarget].maxHP == gBattleMons[gBankTarget].hp) - gBattlescriptCurrInstr = BattleScript_1D83B5; + gBattlescriptCurrInstr = BattleScript_AlreadyAtFullHp; else { //gBattleMoveFlags &= ~(MOVESTATUS_NOTAFFECTED); only in Emerald - gBattlescriptCurrInstr = BattleScript_1D839B; + gBattlescriptCurrInstr = BattleScript_PresentHealTarget; } } -static void atkB8_set_safeguard(void) +static void atkB8_setsafeguard(void) { if (gSideAffecting[GetBankIdentity(gBankAttacker) & 1] & SIDE_STATUS_SAFEGUARD) { @@ -15310,7 +15310,7 @@ static void atkBD_copyfoestats(void) //psych up gBattlescriptCurrInstr += 5; //why not 1? possible unused fail possibility? } -static void atkBE_breakfree(void) //rapid spin +static void atkBE_rapidspinfree(void) //rapid spin { if (gBattleMons[gBankAttacker].status2 & STATUS2_WRAPPED) { @@ -15342,7 +15342,7 @@ static void atkBE_breakfree(void) //rapid spin gBattlescriptCurrInstr++; } -static void atkBF_set_defense_curl(void) +static void atkBF_setdefensecurlbit(void) { gBattleMons[gBankAttacker].status2 |= STATUS2_DEFENSE_CURL; gBattlescriptCurrInstr++; @@ -15371,7 +15371,7 @@ static void atkC0_recoverbasedonsunlight(void) } __attribute__((naked)) -static void atkC1_hidden_power(void) +static void atkC1_hiddenpowercalc(void) { asm(".syntax unified\n\ push {r4-r7,lr}\n\ @@ -15519,7 +15519,7 @@ _080298A8: .4byte gBattlescriptCurrInstr\n\ .syntax divided"); } -static void atkC2_selectnexttarget(void) +static void atkC2_selectfirstvalidtarget(void) { for (gBankTarget = 0; gBankTarget < gNoOfAllBanks; gBankTarget++) { @@ -15531,7 +15531,7 @@ static void atkC2_selectnexttarget(void) gBattlescriptCurrInstr++; } -static void atkC3_setfutureattack(void) +static void atkC3_trysetfutureattack(void) { if (gWishFutureKnock.futureSightCounter[gBankTarget] != 0) { @@ -15559,7 +15559,7 @@ static void atkC3_setfutureattack(void) } #ifdef NONMATCHING -static void atkC4_beat_up(void) +static void atkC4_trydobeatup(void) { register struct Pokemon* party asm("r7"); if (GetBankSide(gBankAttacker) == 0) @@ -15605,7 +15605,7 @@ static void atkC4_beat_up(void) } #else __attribute__((naked)) -static void atkC4_beat_up(void) +static void atkC4_trydobeatup(void) { asm(".syntax unified\n\ push {r4-r7,lr}\n\ @@ -15858,7 +15858,7 @@ _08029C54: .4byte gBattlescriptCurrInstr\n\ } #endif // NONMATCHING -static void atkC5_hidepreattack(void) +static void atkC5_setsemiinvulnerablebit(void) { switch (gCurrentMove) { @@ -15876,7 +15876,7 @@ static void atkC5_hidepreattack(void) gBattlescriptCurrInstr++; } -static void atkC6_unhidepostattack(void) +static void atkC6_clearsemiinvulnerablebit(void) { switch (gCurrentMove) { @@ -15953,7 +15953,7 @@ static void atkCC_callterrainattack(void) //nature power gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED); gCurrentMove = sNaturePowerMoves[gBattleTerrain]; gBankTarget = GetMoveTarget(gCurrentMove, 0); - b_movescr_stack_push(gBattleScriptsEffectsTable[gBattleMoves[gCurrentMove].effect]); + b_movescr_stack_push(gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]); gBattlescriptCurrInstr++; } @@ -16002,7 +16002,7 @@ static void atkD0_settaunt(void) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } -static void atkD1_set_helpinghand(void) +static void atkD1_trysethelpinghand(void) { gBankTarget = GetBankByPlayerAI(GetBankIdentity(gBankAttacker) ^ 2); if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && !(gAbsentBankFlags & gBitTable[gBankTarget]) @@ -16016,7 +16016,7 @@ static void atkD1_set_helpinghand(void) } #ifdef NONMATCHING -static void atkD2_swap_items(void) +static void atkD2_tryswapitems(void) { if ((GetBankSide(gBankAttacker) != 1 || gBattleTypeFlags & (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_LINK | BATTLE_TYPE_EREADER_TRAINER) || gTrainerBattleOpponent == 0x400)) { @@ -16029,7 +16029,7 @@ static void atkD2_swap_items(void) #else __attribute__((naked)) -static void atkD2_swap_items(void) +static void atkD2_tryswapitems(void) { asm(".syntax unified\n\ push {r4-r7,lr}\n\ @@ -16348,7 +16348,7 @@ _0802A4AC: .4byte gBattleCommunication\n\ } #endif // NONMATCHING -static void atkD3_copy_ability(void) //role play +static void atkD3_trycopyability(void) //role play { if (gBattleMons[gBankTarget].ability != 0 && gBattleMons[gBankTarget].ability != ABILITY_WONDER_GUARD) { @@ -16360,7 +16360,7 @@ static void atkD3_copy_ability(void) //role play gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } -static void atkD4_wish_effect(void) +static void atkD4_trywish(void) { switch (T2_READ_8(gBattlescriptCurrInstr + 1)) { @@ -16392,7 +16392,7 @@ static void atkD4_wish_effect(void) } } -static void atkD5_setroots(void) //ingrain +static void atkD5_trysetroots(void) //ingrain { if (gStatuses3[gBankAttacker] & STATUS3_ROOTED) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); @@ -16447,7 +16447,7 @@ static void atkD9_scaledamagebyhealthratio(void) gBattlescriptCurrInstr++; } -static void atkDA_abilityswap(void) +static void atkDA_tryswapabilities(void) { if ((gBattleMons[gBankAttacker].ability == 0 && gBattleMons[gBankTarget].ability == 0) || gBattleMons[gBankAttacker].ability == ABILITY_WONDER_GUARD || gBattleMons[gBankTarget].ability == ABILITY_WONDER_GUARD @@ -16462,7 +16462,7 @@ static void atkDA_abilityswap(void) } } -static void atkDB_imprisoneffect(void) +static void atkDB_tryimprision(void) { u8 r8 = 0; if ((gStatuses3[gBankAttacker] & STATUS3_IMPRISIONED)) @@ -16502,7 +16502,7 @@ static void atkDB_imprisoneffect(void) } } -static void atkDC_setgrudge(void) +static void atkDC_trysetgrudge(void) { if (gStatuses3[gBankAttacker] & STATUS3_GRUDGE) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); @@ -16770,7 +16770,7 @@ _0802ABF8: .4byte gBattlescriptCurrInstr\n\ #endif // NONMATCHING -static void atkDF_setmagiccoat(void) +static void atkDF_trysetmagiccoat(void) { gBankTarget = gBankAttacker; gSpecialStatuses[gBankAttacker].flag20 = 1; @@ -16783,7 +16783,7 @@ static void atkDF_setmagiccoat(void) } } -static void atkE0_setstealstatchange(void) +static void atkE0_trysetsnatch(void) { gSpecialStatuses[gBankAttacker].flag20 = 1; if (gCurrentMoveTurn == gNoOfAllBanks - 1) //last turn @@ -16795,7 +16795,7 @@ static void atkE0_setstealstatchange(void) } } -static void atkE1_intimidate_string_loader(void) +static void atkE1_trygetintimidatetarget(void) { u8 side; @@ -16820,7 +16820,7 @@ static void atkE1_intimidate_string_loader(void) gBattlescriptCurrInstr += 5; } -static void atkE2_switchout_abilities(void) +static void atkE2_switchoutabilities(void) { gActiveBank = GetBattleBank(T2_READ_8(gBattlescriptCurrInstr + 1)); switch (gBattleMons[gActiveBank].ability) @@ -16834,7 +16834,7 @@ static void atkE2_switchout_abilities(void) gBattlescriptCurrInstr += 2; } -static void atkE3_jumpiffainted(void) +static void atkE3_jumpifhasnohp(void) { gActiveBank = GetBattleBank(T2_READ_8(gBattlescriptCurrInstr + 1)); if (gBattleMons[gActiveBank].hp == 0) @@ -16906,7 +16906,7 @@ static void atkE5_pickup(void) gBattlescriptCurrInstr++; } -static void atkE6_castform_change_animation(void) +static void atkE6_docastformchangeanimation(void) { gActiveBank = BATTLE_STRUCT->scriptingActive; if (gBattleMons[gActiveBank].status2 & STATUS2_SUBSTITUTE) @@ -16916,7 +16916,7 @@ static void atkE6_castform_change_animation(void) gBattlescriptCurrInstr++; } -static void atkE7_castform_data_change(void) +static void atkE7_trycastformdatachange(void) { u8 form; gBattlescriptCurrInstr++; @@ -16975,7 +16975,7 @@ static void atkE9_setweatherballtype(void) gBattlescriptCurrInstr++; } -static void atkEA_recycleitem(void) +static void atkEA_tryrecycleitem(void) { u16* used_item; gActiveBank = gBankAttacker; @@ -17009,7 +17009,7 @@ static void atkEB_settypetoterrain(void) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } -static void atkEC_pursuit_sth(void) +static void atkEC_pursuitrelated(void) { gActiveBank = GetBankByPlayerAI(GetBankIdentity(gBankAttacker) ^ 2); if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && !(gAbsentBankFlags & gBitTable[gActiveBank]) && gActionForBanks[gActiveBank] == 0 && gChosenMovesByBanks[gActiveBank] == MOVE_PURSUIT) @@ -17025,7 +17025,7 @@ static void atkEC_pursuit_sth(void) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } -static void atkED_802B4B4(void) +static void atkED_snatchsetbanks(void) { gEffectBank = gBankAttacker; if (gBankAttacker == gBankTarget) @@ -17056,7 +17056,7 @@ static void atkEE_removelightscreenreflect(void) //brick break gBattlescriptCurrInstr++; } -void atkEF_pokeball_catch_calculation(void) +void atkEF_handleballthrow(void) { u8 ball_multiplier = 0; if (gBattleExecBuffer) @@ -17187,7 +17187,7 @@ void atkEF_pokeball_catch_calculation(void) } } -static void atkF0_copy_caught_poke(void) +static void atkF0_givecaughtmon(void) { GiveMonToPlayer(&gEnemyParty[gBattlePartyID[gBankAttacker ^ 1]]); gBattleResults.caughtPoke = gBattleMons[gBankAttacker ^ 1].species; @@ -17195,7 +17195,7 @@ static void atkF0_copy_caught_poke(void) gBattlescriptCurrInstr++; } -static void atkF1_setpoke_as_caught(void) +static void atkF1_trysetcaughtmondexflags(void) { if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gBankTarget].species), 1)) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); @@ -17214,7 +17214,7 @@ extern const u32 gBattleTerrainTiles_Building[]; extern const u32 gBattleTerrainTilemap_Building[]; extern const u32 gBattleTerrainPalette_BattleTower[]; -static void atkF2_display_dex_info(void) +static void atkF2_displaydexinfo(void) { switch (gBattleCommunication[0]) { @@ -17348,7 +17348,7 @@ void nullsub_6(void) return; } -static void atkF3_nickname_caught_poke(void) +static void atkF3_trygivecaughtmonnick(void) { switch (gBattleCommunication[0]) { @@ -17414,7 +17414,7 @@ static void atkF3_nickname_caught_poke(void) } } -static void atkF4_802BEF0(void) +static void atkF4_subattackerhpbydmg(void) { gBattleMons[gBankAttacker].hp -= gBattleMoveDamage; gBattlescriptCurrInstr++; @@ -17426,12 +17426,12 @@ static void atkF5_removeattackerstatus1(void) gBattlescriptCurrInstr++; } -static void atkF6_802BF48(void) +static void atkF6_finishaction(void) { gFightStateTracker = 0xC; } -static void atkF7_802BF54(void) +static void atkF7_finishturn(void) { gFightStateTracker = 0xC; gCurrentMoveTurn = gNoOfAllBanks; diff --git a/src/battle/battle_7.c b/src/battle/battle_7.c index 5a30e012d..7ca9ac3c4 100644 --- a/src/battle/battle_7.c +++ b/src/battle/battle_7.c @@ -28,7 +28,7 @@ extern u8 gBanksBySide[]; extern u8 gObjectBankIDs[]; extern u16 gUnknown_02024DE8; extern u8 gDoingBattleAnim; -extern u32 gPID_perBank[]; +extern u32 gTransformedPersonalities[]; extern struct Window gUnknown_03004210; extern void (*gBattleBankFunc[])(void); extern u8 gHealthboxIDs[]; @@ -39,8 +39,8 @@ extern struct MusicPlayerInfo gMPlay_BGM; extern u32 gBitTable[]; extern u16 gBattleTypeFlags; extern u8 gBattleMonForms[]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern void (*gAnimScriptCallback)(void); extern u8 gAnimScriptActive; extern const u8 *const gBattleAnims_General[]; @@ -66,8 +66,8 @@ extern void c3_0802FDF4(u8); extern void sub_80440EC(); extern void sub_804777C(); extern void sub_8141828(); -extern u8 sub_8077ABC(); -extern u8 AnimBankSpriteExists(u8); +extern u8 GetBankPosition(); +extern u8 IsBankSpritePresent(u8); extern u8 sub_8077F68(u8); extern u8 sub_8077F7C(u8); extern void sub_8094958(void); @@ -174,10 +174,10 @@ bool8 move_anim_start_t3(u8 a, u8 b, u8 c, u8 d, u16 e) sub_80324E0(a); return TRUE; } - gBattleAnimBankAttacker = b; - gBattleAnimBankTarget = c; + gAnimBankAttacker = b; + gAnimBankTarget = c; ewram17840.unk0 = e; - DoMoveAnim(gBattleAnims_General, d, 0); + LaunchBattleAnimation(gBattleAnims_General, d, 0); taskId = CreateTask(sub_80315E8, 10); gTasks[taskId].data[0] = a; ewram17810[gTasks[taskId].data[0]].unk0_5 = 1; @@ -214,9 +214,9 @@ void move_anim_start_t4(u8 a, u8 b, u8 c, u8 d) { u8 taskId; - gBattleAnimBankAttacker = b; - gBattleAnimBankTarget = c; - DoMoveAnim(gBattleAnims_Special, d, 0); + gAnimBankAttacker = b; + gAnimBankTarget = c; + LaunchBattleAnimation(gBattleAnims_Special, d, 0); taskId = CreateTask(sub_80316CC, 10); gTasks[taskId].data[0] = a; ewram17810[gTasks[taskId].data[0]].unk0_6 = 1; @@ -276,7 +276,7 @@ void BattleLoadOpponentMonSprite(struct Pokemon *pkmn, u8 b) else { species = ewram17800[b].transformedSpecies; - r7 = gPID_perBank[b]; + r7 = gTransformedPersonalities[b]; } otId = GetMonData(pkmn, MON_DATA_OT_ID); var = GetBankIdentity(b); @@ -328,7 +328,7 @@ void BattleLoadPlayerMonSprite(struct Pokemon *pkmn, u8 b) else { species = ewram17800[b].transformedSpecies; - r7 = gPID_perBank[b]; + r7 = gTransformedPersonalities[b]; } otId = GetMonData(pkmn, MON_DATA_OT_ID); var = GetBankIdentity(b); @@ -626,7 +626,7 @@ void sub_8031FC4(u8 a, u8 b, bool8 c) const void *src; void *dst; - if (NotInBattle()) + if (IsContest()) { r10 = 0; species = ewram19348.unk2; @@ -659,7 +659,7 @@ void sub_8031FC4(u8 a, u8 b, bool8 c) eVoidSharedArr2, gUnknown_081FAF4C[r10], species, - gPID_perBank[a]); + gTransformedPersonalities[a]); } else { @@ -672,7 +672,7 @@ void sub_8031FC4(u8 a, u8 b, bool8 c) eVoidSharedArr2, gUnknown_081FAF4C[r10], species, - gPID_perBank[a]); + gTransformedPersonalities[a]); } } src = gUnknown_081FAF4C[r10]; @@ -691,7 +691,7 @@ void sub_8031FC4(u8 a, u8 b, bool8 c) } BlendPalette(paletteOffset, 16, 6, 0x7FFF); CpuCopy32(gPlttBufferFaded + paletteOffset, gPlttBufferUnfaded + paletteOffset, 32); - if (!NotInBattle()) + if (!IsContest()) { ewram17800[a].transformedSpecies = species; gBattleMonForms[a] = gBattleMonForms[b]; @@ -711,11 +711,11 @@ void BattleLoadSubstituteSprite(u8 a, u8 b) if (b == 0) { - if (NotInBattle()) + if (IsContest()) r4 = 0; else r4 = GetBankIdentity(a); - if (NotInBattle()) + if (IsContest()) LZDecompressVram(gSubstituteDollTilemap, gUnknown_081FAF4C[r4]); else if (GetBankSide(a) != 0) LZDecompressVram(gSubstituteDollGfx, gUnknown_081FAF4C[r4]); @@ -731,7 +731,7 @@ void BattleLoadSubstituteSprite(u8 a, u8 b) } else { - if (!NotInBattle()) + if (!IsContest()) { if (GetBankSide(a) != 0) BattleLoadOpponentMonSprite(&gEnemyParty[gBattlePartyID[a]], a); @@ -835,7 +835,7 @@ void sub_80326EC(u8 a) for (i = 0; i < gNoOfAllBanks; i++) { - if (AnimBankSpriteExists(i) != 0) + if (IsBankSpritePresent(i) != 0) { gSprites[gObjectBankIDs[i]].oam.affineMode = a; if (a == 0) @@ -857,12 +857,12 @@ void sub_80327CC(void) LoadCompressedObjectPic(&gUnknown_081FAF24); r5 = GetBankByPlayerAI(1); - ewram17810[r5].unk7 = CreateSprite(&gSpriteTemplate_81FAF34, sub_8077ABC(r5, 0), sub_8077ABC(r5, 1) + 32, 0xC8); + ewram17810[r5].unk7 = CreateSprite(&gSpriteTemplate_81FAF34, GetBankPosition(r5, 0), GetBankPosition(r5, 1) + 32, 0xC8); gSprites[ewram17810[r5].unk7].data[0] = r5; if (IsDoubleBattle()) { r5 = GetBankByPlayerAI(3); - ewram17810[r5].unk7 = CreateSprite(&gSpriteTemplate_81FAF34, sub_8077ABC(r5, 0), sub_8077ABC(r5, 1) + 32, 0xC8); + ewram17810[r5].unk7 = CreateSprite(&gSpriteTemplate_81FAF34, GetBankPosition(r5, 0), GetBankPosition(r5, 1) + 32, 0xC8); gSprites[ewram17810[r5].unk7].data[0] = r5; } } @@ -873,7 +873,7 @@ void sub_80328A4(struct Sprite *sprite) u8 r4 = sprite->data[0]; struct Sprite *r7 = &gSprites[gObjectBankIDs[r4]]; - if (!r7->inUse || AnimBankSpriteExists(r4) == 0) + if (!r7->inUse || IsBankSpritePresent(r4) == 0) { sprite->callback = sub_8032978; return; diff --git a/src/battle/battle_anim.c b/src/battle/battle_anim.c index 1a78b2863..8242a1ddd 100644 --- a/src/battle/battle_anim.c +++ b/src/battle/battle_anim.c @@ -17,42 +17,45 @@ // sprites start at 10000 and thus must be subtracted of 10000 to account for the true index. #define GET_TRUE_SPRITE_INDEX(i) (i - 10000) +#define ANIM_SPRITE_INDEX_COUNT 8 +#define ANIM_ARGS_COUNT 8 + extern u16 gBattlePartyID[4]; extern u8 gObjectBankIDs[]; extern u8 gBankAttacker; extern u8 gBankTarget; -EWRAM_DATA const u8 *gBattleAnimScriptPtr = NULL; +EWRAM_DATA const u8 *sBattleAnimScriptPtr = NULL; EWRAM_DATA const u8 *gBattleAnimScriptRetAddr = NULL; EWRAM_DATA void (*gAnimScriptCallback)(void) = NULL; EWRAM_DATA s8 gAnimFramesToWait = 0; EWRAM_DATA u8 gAnimScriptActive = FALSE; EWRAM_DATA u8 gAnimVisualTaskCount = 0; EWRAM_DATA u8 gAnimSoundTaskCount = 0; -EWRAM_DATA u32 gDisableStructMoveAnim = 0; -EWRAM_DATA u32 gMoveDmgMoveAnim = 0; -EWRAM_DATA u16 gMovePowerMoveAnim = 0; -EWRAM_DATA u8 gHappinessMoveAnim = 0; +EWRAM_DATA struct DisableStruct *gAnimDisableStructPtr = NULL; +EWRAM_DATA u32 gAnimMoveDmg = 0; +EWRAM_DATA u16 gAnimMovePower = 0; +EWRAM_DATA u8 gAnimFriendship = 0; EWRAM_DATA u16 gWeatherMoveAnim = 0; EWRAM_DATA u8 gMonAnimTaskIdArray[2] = {0}; -EWRAM_DATA u8 gUnknown_0202F7C4 = 0; -EWRAM_DATA u8 gUnknown_0202F7C5 = 0; -EWRAM_DATA u16 gAnimMoveIndex = 0; // set but unused. -EWRAM_DATA u8 gBattleAnimBankAttacker = 0; -EWRAM_DATA u8 gBattleAnimBankTarget = 0; -EWRAM_DATA u16 gUnknown_0202F7CA[4] = {0}; +EWRAM_DATA u8 gAnimMoveTurn = 0; +EWRAM_DATA u8 sAnimBackgroundFadeState = 0; +EWRAM_DATA u16 sAnimMoveIndex = 0; // set but unused. +EWRAM_DATA u8 gAnimBankAttacker = 0; +EWRAM_DATA u8 gAnimBankTarget = 0; +EWRAM_DATA u16 gAnimSpeciesByBanks[4] = {0}; EWRAM_DATA u8 gUnknown_0202F7D2 = 0; -extern u16 gUnknown_030041B4; -extern u16 gUnknown_03004200; -extern u16 gUnknown_03004240; -extern u16 gUnknown_03004244; -extern u16 gUnknown_03004280; -extern u16 gUnknown_03004288; -extern u16 gUnknown_030042C0; -extern u16 gUnknown_030042C4; +extern u16 gBattle_BG1_Y; +extern u16 gBattle_WIN1H; +extern u16 gBattle_WIN0V; +extern u16 gBattle_WIN1V; +extern u16 gBattle_BG2_Y; +extern u16 gBattle_BG2_X; +extern u16 gBattle_BG1_X; +extern u16 gBattle_WIN0H; u16 gSoundAnimFramesToWait; -s16 gBattleAnimArgs[8]; -u16 gAnimSpriteIndexArray[8]; +s16 gBattleAnimArgs[ANIM_ARGS_COUNT]; +u16 gAnimSpriteIndexArray[ANIM_SPRITE_INDEX_COUNT]; extern struct MusicPlayerInfo gMPlay_BGM; extern struct MusicPlayerInfo gMPlay_SE1; @@ -65,10 +68,10 @@ extern const struct CompressedSpritePalette gBattleAnimPaletteTable[]; extern const struct BattleAnimBackground gBattleAnimBackgroundTable[]; static void RunAnimScriptCommand(void); -static void ScriptCmd_loadsprite(void); -static void ScriptCmd_unloadsprite(void); -static void ScriptCmd_sprite(void); -static void ScriptCmd_createtask(void); +static void ScriptCmd_loadspritegfx(void); +static void ScriptCmd_unloadspritegfx(void); +static void ScriptCmd_createsprite(void); +static void ScriptCmd_createvisualtask(void); static void ScriptCmd_delay(void); static void ScriptCmd_waitforvisualfinish(void); static void ScriptCmd_hang1(void); @@ -88,33 +91,33 @@ static void ScriptCmd_setbldcnt(void); static void ScriptCmd_blendoff(void); static void ScriptCmd_call(void); static void ScriptCmd_return(void); -static void ScriptCmd_setvar(void); -static void ScriptCmd_ifelse(void); -static void ScriptCmd_jumpif(void); +static void ScriptCmd_setarg(void); +static void ScriptCmd_choosetwoturnanim(void); +static void ScriptCmd_jumpifmoveturn(void); static void ScriptCmd_jump(void); static void ScriptCmd_fadetobg(void); -static void ScriptCmd_fadetobg_25(void); -static void task_p5_load_battle_screen_elements(u8); -static void sub_8076DB8(u16); -static void dp01t_11_3_message_for_player_only(void); +static void ScriptCmd_fadetobgfromset(void); +static void Task_FadeToBg(u8); +static void LoadMoveBg(u16); +static void LoadDefaultBg(void); static void ScriptCmd_restorebg(void); static void ScriptCmd_waitbgfadeout(void); static void ScriptCmd_waitbgfadein(void); static void ScriptCmd_changebg(void); -static void ScriptCmd_panse_19(void); +static void ScriptCmd_playsewithpan(void); static void ScriptCmd_setpan(void); static void ScriptCmd_panse_1B(void); -static void c3_08073CEC(u8); +static void Task_PanFromInitialToTarget(u8); static void ScriptCmd_panse_26(void); static void ScriptCmd_panse_27(void); -static void ScriptCmd_panse_1C(void); -static void sub_80774FC(u8); -static void ScriptCmd_panse_1D(void); -static void sub_80775CC(u8); -static void ScriptCmd_createtask_1F(void); +static void ScriptCmd_loopsewithpan(void); +static void Task_LoopAndPlaySE(u8); +static void ScriptCmd_waitplaysewithpan(void); +static void Task_WaitAndPlaySE(u8); +static void ScriptCmd_createsoundtask(void); static void ScriptCmd_waitsound(void); -static void ScriptCmd_jumpvareq(void); -static void ScriptCmd_jumpunkcond(void); +static void ScriptCmd_jumpargeq(void); +static void ScriptCmd_jumpifcontest(void); static void ScriptCmd_monbgprio_28(void); static void ScriptCmd_monbgprio_29(void); static void ScriptCmd_monbgprio_2A(void); @@ -125,10 +128,10 @@ static void ScriptCmd_doublebattle_2E(void); static void ScriptCmd_stopsound(void); static void (*const sScriptCmdTable[])(void) = { - ScriptCmd_loadsprite, - ScriptCmd_unloadsprite, - ScriptCmd_sprite, - ScriptCmd_createtask, + ScriptCmd_loadspritegfx, + ScriptCmd_unloadspritegfx, + ScriptCmd_createsprite, + ScriptCmd_createvisualtask, ScriptCmd_delay, ScriptCmd_waitforvisualfinish, ScriptCmd_hang1, @@ -141,28 +144,28 @@ static void (*const sScriptCmdTable[])(void) = { ScriptCmd_blendoff, ScriptCmd_call, ScriptCmd_return, - ScriptCmd_setvar, - ScriptCmd_ifelse, - ScriptCmd_jumpif, + ScriptCmd_setarg, + ScriptCmd_choosetwoturnanim, + ScriptCmd_jumpifmoveturn, ScriptCmd_jump, ScriptCmd_fadetobg, ScriptCmd_restorebg, ScriptCmd_waitbgfadeout, ScriptCmd_waitbgfadein, ScriptCmd_changebg, - ScriptCmd_panse_19, + ScriptCmd_playsewithpan, ScriptCmd_setpan, ScriptCmd_panse_1B, - ScriptCmd_panse_1C, - ScriptCmd_panse_1D, + ScriptCmd_loopsewithpan, + ScriptCmd_waitplaysewithpan, ScriptCmd_setbldcnt, - ScriptCmd_createtask_1F, + ScriptCmd_createsoundtask, ScriptCmd_waitsound, - ScriptCmd_jumpvareq, + ScriptCmd_jumpargeq, ScriptCmd_monbg_22, ScriptCmd_clearmonbg_23, - ScriptCmd_jumpunkcond, - ScriptCmd_fadetobg_25, + ScriptCmd_jumpifcontest, + ScriptCmd_fadetobgfromset, ScriptCmd_panse_26, ScriptCmd_panse_27, ScriptCmd_monbgprio_28, @@ -175,7 +178,7 @@ static void (*const sScriptCmdTable[])(void) = { ScriptCmd_stopsound, }; -void battle_anim_clear_some_data(void) +void ClearBattleAnimationVars(void) { s32 i; @@ -183,77 +186,77 @@ void battle_anim_clear_some_data(void) gAnimScriptActive = FALSE; gAnimVisualTaskCount = 0; gAnimSoundTaskCount = 0; - gDisableStructMoveAnim = 0; - gMoveDmgMoveAnim = 0; - gMovePowerMoveAnim = 0; - gHappinessMoveAnim = 0; + gAnimDisableStructPtr = NULL; + gAnimMoveDmg = 0; + gAnimMovePower = 0; + gAnimFriendship = 0; // clear index array. - for (i = 0; i < 8; i++) + for (i = 0; i < ANIM_SPRITE_INDEX_COUNT; i++) gAnimSpriteIndexArray[i] |= 0xFFFF; // clear anim args. - for (i = 0; i < 8; i++) + for (i = 0; i < ANIM_ARGS_COUNT; i++) gBattleAnimArgs[i] = 0; gMonAnimTaskIdArray[0] = 0xFF; gMonAnimTaskIdArray[1] = 0xFF; - gUnknown_0202F7C4 = 0; - gUnknown_0202F7C5 = 0; - gAnimMoveIndex = 0; - gBattleAnimBankAttacker = 0; - gBattleAnimBankTarget = 0; + gAnimMoveTurn = 0; + sAnimBackgroundFadeState = 0; + sAnimMoveIndex = 0; + gAnimBankAttacker = 0; + gAnimBankTarget = 0; gUnknown_0202F7D2 = 0; } -void ExecuteMoveAnim(u16 move) +void DoMoveAnim(u16 move) { - gBattleAnimBankAttacker = gBankAttacker; - gBattleAnimBankTarget = gBankTarget; - DoMoveAnim(gBattleAnims_Moves, move, 1); + gAnimBankAttacker = gBankAttacker; + gAnimBankTarget = gBankTarget; + LaunchBattleAnimation(gBattleAnims_Moves, move, TRUE); } -void DoMoveAnim(const u8 *const moveAnims[], u16 move, u8 c) +void LaunchBattleAnimation(const u8 *const moveAnims[], u16 move, u8 isMoveAnim) { s32 i; - if (NotInBattle() == 0) + if (!IsContest()) { sub_8079E24(); - sub_8043EB4(0); + UpdateOamPriorityInAllHealthboxes(0); for (i = 0; i < 4; i++) { if (GetBankSide(i) != 0) - gUnknown_0202F7CA[i] = GetMonData(&gEnemyParty[gBattlePartyID[i]], MON_DATA_SPECIES); + gAnimSpeciesByBanks[i] = GetMonData(&gEnemyParty[gBattlePartyID[i]], MON_DATA_SPECIES); else - gUnknown_0202F7CA[i] = GetMonData(&gPlayerParty[gBattlePartyID[i]], MON_DATA_SPECIES); + gAnimSpeciesByBanks[i] = GetMonData(&gPlayerParty[gBattlePartyID[i]], MON_DATA_SPECIES); } } else { for (i = 0; i < 4; i++) - gUnknown_0202F7CA[i] = EWRAM_19348; + gAnimSpeciesByBanks[i] = EWRAM_19348; } - if (c == 0) - gAnimMoveIndex = 0; + if (isMoveAnim == 0) + sAnimMoveIndex = 0; else - gAnimMoveIndex = move; + sAnimMoveIndex = move; - for (i = 0; i < 8; i++) + for (i = 0; i < ANIM_ARGS_COUNT; i++) gBattleAnimArgs[i] = 0; gMonAnimTaskIdArray[0] = 0xFF; gMonAnimTaskIdArray[1] = 0xFF; - gBattleAnimScriptPtr = moveAnims[move]; + sBattleAnimScriptPtr = moveAnims[move]; gAnimScriptActive = TRUE; gAnimFramesToWait = 0; gAnimScriptCallback = RunAnimScriptCommand; - for (i = 0; i < 8; i++) + for (i = 0; i < ANIM_SPRITE_INDEX_COUNT; i++) gAnimSpriteIndexArray[i] |= 0xFFFF; - if (c != 0) + if (isMoveAnim) { for (i = 0; gUnknown_081C7160[i] != 0xFFFF; i++) { @@ -265,13 +268,13 @@ void DoMoveAnim(const u8 *const moveAnims[], u16 move, u8 c) } } - gUnknown_030042C4 = 0; - gUnknown_03004240 = 0; - gUnknown_03004200 = 0; - gUnknown_03004244 = 0; + gBattle_WIN0H = 0; + gBattle_WIN0V = 0; + gBattle_WIN1H = 0; + gBattle_WIN1V = 0; } -void move_anim_8072740(struct Sprite *sprite) +void DestroyAnimSprite(struct Sprite *sprite) { FreeSpriteOamMatrix(sprite); DestroySprite(sprite); @@ -294,7 +297,7 @@ static void AddSpriteIndex(u16 index) { s32 i; - for (i = 0; i < 8; i++) + for (i = 0; i < ANIM_SPRITE_INDEX_COUNT; i++) { if (gAnimSpriteIndexArray[i] == 0xFFFF) { @@ -308,7 +311,7 @@ static void ClearSpriteIndex(u16 index) { s32 i; - for (i = 0; i < 8; i++) + for (i = 0; i < ANIM_SPRITE_INDEX_COUNT; i++) { if (gAnimSpriteIndexArray[i] == index) { @@ -335,222 +338,87 @@ static void RunAnimScriptCommand(void) { do { - sScriptCmdTable[T1_READ_8(gBattleAnimScriptPtr)](); - } while (gAnimFramesToWait == 0 && gAnimScriptActive != FALSE); + sScriptCmdTable[T1_READ_8(sBattleAnimScriptPtr)](); + } while (gAnimFramesToWait == 0 && gAnimScriptActive); } -static void ScriptCmd_loadsprite(void) +static void ScriptCmd_loadspritegfx(void) { u16 index; - gBattleAnimScriptPtr++; - index = T1_READ_16(gBattleAnimScriptPtr); + sBattleAnimScriptPtr++; + index = T1_READ_16(sBattleAnimScriptPtr); LoadCompressedObjectPic(&gBattleAnimPicTable[GET_TRUE_SPRITE_INDEX(index)]); LoadCompressedObjectPalette(&gBattleAnimPaletteTable[GET_TRUE_SPRITE_INDEX(index)]); - gBattleAnimScriptPtr += 2; + sBattleAnimScriptPtr += 2; AddSpriteIndex(GET_TRUE_SPRITE_INDEX(index)); gAnimFramesToWait = 1; gAnimScriptCallback = WaitAnimFrameCount; } -static void ScriptCmd_unloadsprite(void) +static void ScriptCmd_unloadspritegfx(void) { u16 index; - gBattleAnimScriptPtr++; - index = T1_READ_16(gBattleAnimScriptPtr); + sBattleAnimScriptPtr++; + index = T1_READ_16(sBattleAnimScriptPtr); FreeSpriteTilesByTag(gBattleAnimPicTable[GET_TRUE_SPRITE_INDEX(index)].tag); FreeSpritePaletteByTag(gBattleAnimPicTable[GET_TRUE_SPRITE_INDEX(index)].tag); - gBattleAnimScriptPtr += 2; + sBattleAnimScriptPtr += 2; ClearSpriteIndex(GET_TRUE_SPRITE_INDEX(index)); } -#ifdef NONMATCHING -static void ScriptCmd_sprite(void) +static void ScriptCmd_createsprite(void) { s32 i; - struct SpriteTemplate *r7; - u8 r4; - u8 r0; - u8 _r0; - u16 r6; - u8 r2; - s8 r1; - - gBattleAnimScriptPtr++; - r7 = (struct SpriteTemplate *)(T2_READ_32(gBattleAnimScriptPtr)); - gBattleAnimScriptPtr += 4; - r4 = T1_READ_8(gBattleAnimScriptPtr); - gBattleAnimScriptPtr++; - r0 = T1_READ_8(gBattleAnimScriptPtr); - gBattleAnimScriptPtr++; - for (i = 0; i < r0; i++) + const struct SpriteTemplate *template; + u8 argVar; + u8 argsCount; + s16 subpriority; + + sBattleAnimScriptPtr++; + template = (const struct SpriteTemplate *)(T2_READ_32(sBattleAnimScriptPtr)); + sBattleAnimScriptPtr += 4; + + argVar = T1_READ_8(sBattleAnimScriptPtr); + sBattleAnimScriptPtr++; + + argsCount = T1_READ_8(sBattleAnimScriptPtr); + sBattleAnimScriptPtr++; + for (i = 0; i < argsCount; i++) { - gBattleAnimArgs[i] = T1_READ_16(gBattleAnimScriptPtr); - gBattleAnimScriptPtr += 2; + gBattleAnimArgs[i] = T1_READ_16(sBattleAnimScriptPtr); + sBattleAnimScriptPtr += 2; } - if (r4 & 0x80) + + if (argVar & 0x80) { - r4 ^= 0x80; - if (r4 > 0x3F) - r4 -= 0x40; + argVar ^= 0x80; + if (argVar >= 0x40) + argVar -= 0x40; else - r4 = -r4; - _r0 = sub_8079E90(gBattleAnimBankTarget); - r1 = r4; + argVar *= -1; + subpriority = sub_8079E90(gAnimBankTarget) + (s8)(argVar); } else { - //_08075B44 - if (r4 > 0x3F) - r4 -= 0x40; + if (argVar >= 0x40) + argVar -= 0x40; else - r4 = -r4; - _r0 = sub_8079E90(gBattleAnimBankAttacker); - r1 = r4; + argVar *= -1; + + subpriority = sub_8079E90(gAnimBankAttacker) + (s8)(argVar); } - r6 = _r0 + r1; - if ((s16)r6 < 3) - r6 = 3; - r4 = sub_8077ABC(gBattleAnimBankTarget, 2); - r2 = sub_8077ABC(gBattleAnimBankTarget, 3); - CreateSpriteAndAnimate(r7, r4, r2, r6); + if (subpriority < 3) + subpriority = 3; + + CreateSpriteAndAnimate(template, GetBankPosition(gAnimBankTarget, 2), GetBankPosition(gAnimBankTarget, 3), subpriority); gAnimVisualTaskCount++; } -#else -__attribute__((naked)) -static void ScriptCmd_sprite(void) -{ - asm(".syntax unified\n\ - push {r4-r7,lr}\n\ - ldr r5, _08075B2C @ =gBattleAnimScriptPtr\n\ - ldr r1, [r5]\n\ - adds r3, r1, 0x1\n\ - str r3, [r5]\n\ - ldrb r2, [r1, 0x1]\n\ - ldrb r0, [r3, 0x1]\n\ - lsls r0, 8\n\ - adds r2, r0\n\ - ldrb r0, [r3, 0x2]\n\ - lsls r0, 16\n\ - adds r2, r0\n\ - ldrb r0, [r3, 0x3]\n\ - lsls r0, 24\n\ - adds r7, r2, r0\n\ - adds r0, r1, 0x5\n\ - str r0, [r5]\n\ - ldrb r4, [r1, 0x5]\n\ - adds r0, r1, 0x6\n\ - str r0, [r5]\n\ - ldrb r0, [r1, 0x6]\n\ - adds r1, 0x7\n\ - str r1, [r5]\n\ - cmp r0, 0\n\ - beq _08075B14\n\ - adds r6, r5, 0\n\ - ldr r5, _08075B30 @ =gBattleAnimArgs\n\ - adds r3, r0, 0\n\ -_08075AFC:\n\ - ldr r2, [r6]\n\ - ldrb r1, [r2]\n\ - ldrb r0, [r2, 0x1]\n\ - lsls r0, 8\n\ - orrs r1, r0\n\ - strh r1, [r5]\n\ - adds r2, 0x2\n\ - str r2, [r6]\n\ - adds r5, 0x2\n\ - subs r3, 0x1\n\ - cmp r3, 0\n\ - bne _08075AFC\n\ -_08075B14:\n\ - movs r0, 0x80\n\ - ands r0, r4\n\ - cmp r0, 0\n\ - beq _08075B44\n\ - movs r0, 0x80\n\ - eors r4, r0\n\ - cmp r4, 0x3F\n\ - bls _08075B34\n\ - adds r0, r4, 0\n\ - subs r0, 0x40\n\ - b _08075B36\n\ - .align 2, 0\n\ -_08075B2C: .4byte gBattleAnimScriptPtr\n\ -_08075B30: .4byte gBattleAnimArgs\n\ -_08075B34:\n\ - negs r0, r4\n\ -_08075B36:\n\ - lsls r0, 24\n\ - lsrs r4, r0, 24\n\ - ldr r0, _08075B40 @ =gBattleAnimBankTarget\n\ - b _08075B56\n\ - .align 2, 0\n\ -_08075B40: .4byte gBattleAnimBankTarget\n\ -_08075B44:\n\ - cmp r4, 0x3F\n\ - bls _08075B4E\n\ - adds r0, r4, 0\n\ - subs r0, 0x40\n\ - b _08075B50\n\ -_08075B4E:\n\ - negs r0, r4\n\ -_08075B50:\n\ - lsls r0, 24\n\ - lsrs r4, r0, 24\n\ - ldr r0, _08075BAC @ =gBattleAnimBankAttacker\n\ -_08075B56:\n\ - ldrb r0, [r0]\n\ - bl sub_8079E90\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - lsls r1, r4, 24\n\ - asrs r1, 24\n\ - adds r0, r1\n\ - lsls r0, 16\n\ - lsrs r6, r0, 16\n\ - lsls r0, r6, 16\n\ - asrs r0, 16\n\ - cmp r0, 0x2\n\ - bgt _08075B74\n\ - movs r6, 0x3\n\ -_08075B74:\n\ - ldr r5, _08075BB0 @ =gBattleAnimBankTarget\n\ - ldrb r0, [r5]\n\ - movs r1, 0x2\n\ - bl sub_8077ABC\n\ - adds r4, r0, 0\n\ - lsls r4, 24\n\ - lsrs r4, 24\n\ - ldrb r0, [r5]\n\ - movs r1, 0x3\n\ - bl sub_8077ABC\n\ - adds r2, r0, 0\n\ - lsls r2, 24\n\ - lsrs r2, 24\n\ - lsls r3, r6, 24\n\ - lsrs r3, 24\n\ - adds r0, r7, 0\n\ - adds r1, r4, 0\n\ - bl CreateSpriteAndAnimate\n\ - ldr r1, _08075BB4 @ =gAnimVisualTaskCount\n\ - ldrb r0, [r1]\n\ - adds r0, 0x1\n\ - strb r0, [r1]\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - .align 2, 0\n\ -_08075BAC: .4byte gBattleAnimBankAttacker\n\ -_08075BB0: .4byte gBattleAnimBankTarget\n\ -_08075BB4: .4byte gAnimVisualTaskCount\n\ - .syntax divided\n"); -} -#endif -static void ScriptCmd_createtask(void) +static void ScriptCmd_createvisualtask(void) { TaskFunc taskFunc; u8 taskPriority; @@ -558,18 +426,21 @@ static void ScriptCmd_createtask(void) u8 numArgs; s32 i; - gBattleAnimScriptPtr++; - taskFunc = (TaskFunc)T2_READ_32(gBattleAnimScriptPtr); - gBattleAnimScriptPtr += 4; - taskPriority = T1_READ_8(gBattleAnimScriptPtr); - gBattleAnimScriptPtr++; - numArgs = T1_READ_8(gBattleAnimScriptPtr); - gBattleAnimScriptPtr++; + sBattleAnimScriptPtr++; + + taskFunc = (TaskFunc)T2_READ_32(sBattleAnimScriptPtr); + sBattleAnimScriptPtr += 4; + + taskPriority = T1_READ_8(sBattleAnimScriptPtr); + sBattleAnimScriptPtr++; + + numArgs = T1_READ_8(sBattleAnimScriptPtr); + sBattleAnimScriptPtr++; for (i = 0; i < numArgs; i++) { - gBattleAnimArgs[i] = T1_READ_16(gBattleAnimScriptPtr); - gBattleAnimScriptPtr += 2; + gBattleAnimArgs[i] = T1_READ_16(sBattleAnimScriptPtr); + sBattleAnimScriptPtr += 2; } taskId = CreateTask(taskFunc, taskPriority); @@ -579,11 +450,11 @@ static void ScriptCmd_createtask(void) static void ScriptCmd_delay(void) { - gBattleAnimScriptPtr++; - gAnimFramesToWait = T1_READ_8(gBattleAnimScriptPtr); + sBattleAnimScriptPtr++; + gAnimFramesToWait = T1_READ_8(sBattleAnimScriptPtr); if (gAnimFramesToWait == 0) gAnimFramesToWait = -1; - gBattleAnimScriptPtr++; + sBattleAnimScriptPtr++; gAnimScriptCallback = WaitAnimFrameCount; } @@ -592,7 +463,7 @@ static void ScriptCmd_waitforvisualfinish(void) { if (gAnimVisualTaskCount == 0) { - gBattleAnimScriptPtr++; + sBattleAnimScriptPtr++; gAnimFramesToWait = 0; } else @@ -641,7 +512,7 @@ static void ScriptCmd_end(void) // the SE has halted, so set the SE Frame Counter to 0 and continue. gSoundAnimFramesToWait = 0; - for (i = 0; i < 8; i++) + for (i = 0; i < ANIM_SPRITE_INDEX_COUNT; i++) { if (gAnimSpriteIndexArray[i] != 0xFFFF) { @@ -651,13 +522,13 @@ static void ScriptCmd_end(void) } } - if (continuousAnim == FALSE) // may have been used for debug? + if (!continuousAnim) // may have been used for debug? { m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 256); - if (NotInBattle() == 0) + if (IsContest() == 0) { sub_8079E24(); - sub_8043EB4(1); + UpdateOamPriorityInAllHealthboxes(1); } gAnimScriptActive = FALSE; } @@ -665,178 +536,114 @@ static void ScriptCmd_end(void) static void ScriptCmd_playse(void) { - gBattleAnimScriptPtr++; - PlaySE(T1_READ_16(gBattleAnimScriptPtr)); - gBattleAnimScriptPtr += 2; + sBattleAnimScriptPtr++; + PlaySE(T1_READ_16(sBattleAnimScriptPtr)); + sBattleAnimScriptPtr += 2; } static void ScriptCmd_monbg(void) { - u8 r6; - u8 r5; - u8 r0; - u8 r7; + u8 animBank; + u8 bank; + u8 identity; + bool8 toBG_2; u16 r4; u8 taskId; - gBattleAnimScriptPtr++; - r6 = T1_READ_8(gBattleAnimScriptPtr); - if (r6 == 0) - r6 = 2; - else if (r6 == 1) - r6 = 3; - if (r6 == 0 || r6 == 2) - r5 = gBattleAnimBankAttacker; + sBattleAnimScriptPtr++; + animBank = T1_READ_8(sBattleAnimScriptPtr); + if (animBank == ANIM_BANK_ATTACKER) + animBank = ANIM_BANK_ATK_PARTNER; + else if (animBank == ANIM_BANK_TARGET) + animBank = ANIM_BANK_DEF_PARTNER; + + if (animBank == ANIM_BANK_ATTACKER || animBank == ANIM_BANK_ATK_PARTNER) + bank = gAnimBankAttacker; else - r5 = gBattleAnimBankTarget; - if (IsAnimBankSpriteVisible(r5)) + bank = gAnimBankTarget; + + if (IsAnimBankSpriteVisible(bank)) { - r0 = GetBankIdentity(r5); - r0 += 0xFF; - if (r0 <= 1 || NotInBattle() != 0) - r7 = 0; + identity = GetBankIdentity(bank); + identity += 0xFF; + if (identity <= 1 || IsContest() != 0) + toBG_2 = 0; else - r7 = 1; - sub_8076034(r5, r7); - r4 = gObjectBankIDs[r5]; + toBG_2 = 1; + + sub_8076034(bank, toBG_2); + r4 = gObjectBankIDs[bank]; taskId = CreateTask(task_pA_ma0A_obj_to_bg_pal, 10); gTasks[taskId].data[0] = r4; gTasks[taskId].data[1] = gSprites[r4].pos1.x + gSprites[r4].pos2.x; gTasks[taskId].data[2] = gSprites[r4].pos1.y + gSprites[r4].pos2.y; - if (r7 == 0) + if (toBG_2 == 0) { - gTasks[taskId].data[3] = gUnknown_030042C0; - gTasks[taskId].data[4] = gUnknown_030041B4; + gTasks[taskId].data[3] = gBattle_BG1_X; + gTasks[taskId].data[4] = gBattle_BG1_Y; } else { - gTasks[taskId].data[3] = gUnknown_03004288; - gTasks[taskId].data[4] = gUnknown_03004280; + gTasks[taskId].data[3] = gBattle_BG2_X; + gTasks[taskId].data[4] = gBattle_BG2_Y; } - gTasks[taskId].data[5] = r7; - gTasks[taskId].data[6] = r5; + gTasks[taskId].data[5] = toBG_2; + gTasks[taskId].data[6] = bank; gMonAnimTaskIdArray[0] = taskId; } - r5 ^= 2; - if (r6 > 1 && IsAnimBankSpriteVisible(r5)) + bank ^= 2; + if (animBank > 1 && IsAnimBankSpriteVisible(bank)) { - r0 = GetBankIdentity(r5); - r0 += 0xFF; - if (r0 <= 1 || NotInBattle() != 0) - r7 = 0; + identity = GetBankIdentity(bank); + identity += 0xFF; + if (identity <= 1 || IsContest() != 0) + toBG_2 = 0; else - r7 = 1; - sub_8076034(r5, r7); - r4 = gObjectBankIDs[r5]; + toBG_2 = 1; + sub_8076034(bank, toBG_2); + r4 = gObjectBankIDs[bank]; taskId = CreateTask(task_pA_ma0A_obj_to_bg_pal, 10); gTasks[taskId].data[0] = r4; gTasks[taskId].data[1] = gSprites[r4].pos1.x + gSprites[r4].pos2.x; gTasks[taskId].data[2] = gSprites[r4].pos1.y + gSprites[r4].pos2.y; - if (r7 == 0) + if (toBG_2 == 0) { - gTasks[taskId].data[3] = gUnknown_030042C0; - gTasks[taskId].data[4] = gUnknown_030041B4; + gTasks[taskId].data[3] = gBattle_BG1_X; + gTasks[taskId].data[4] = gBattle_BG1_Y; } else { - gTasks[taskId].data[3] = gUnknown_03004288; - gTasks[taskId].data[4] = gUnknown_03004280; + gTasks[taskId].data[3] = gBattle_BG2_X; + gTasks[taskId].data[4] = gBattle_BG2_Y; } - gTasks[taskId].data[5] = r7; - gTasks[taskId].data[6] = r5; + + gTasks[taskId].data[5] = toBG_2; + gTasks[taskId].data[6] = bank; gMonAnimTaskIdArray[1] = taskId; } - gBattleAnimScriptPtr++; + + sBattleAnimScriptPtr++; } -#ifdef NONMATCHING -bool8 IsAnimBankSpriteVisible(u8 a) +bool8 IsAnimBankSpriteVisible(u8 bank) { - if (NotInBattle()) + if (IsContest()) { - if (a == gBattleAnimBankAttacker) + if (bank == gAnimBankAttacker) return TRUE; else return FALSE; } - if (!AnimBankSpriteExists(a)) + if (!IsBankSpritePresent(bank)) return FALSE; - if (NotInBattle()) + if (IsContest()) return TRUE; // this line wont ever be reached. - if (!(EWRAM_17800[a].unk0 & 1)) + if (!(EWRAM_17800[bank].unk0 & 1) || !gSprites[gObjectBankIDs[bank]].invisible) return TRUE; - if (gSprites[gObjectBankIDs[a]].invisible) - return FALSE; - return TRUE; -} -#else -__attribute__((naked)) -bool8 IsAnimBankSpriteVisible(u8 a) -{ - asm(".syntax unified\n\ - push {r4,r5,lr}\n\ - lsls r0, 24\n\ - lsrs r4, r0, 24\n\ - adds r5, r4, 0\n\ - bl NotInBattle\n\ - lsls r0, 24\n\ - cmp r0, 0\n\ - beq _08075FDC\n\ - ldr r0, _08075FD8 @ =gBattleAnimBankAttacker\n\ - ldrb r0, [r0]\n\ - cmp r4, r0\n\ - beq _0807601C\n\ - b _0807602C\n\ - .align 2, 0\n\ -_08075FD8: .4byte gBattleAnimBankAttacker\n\ -_08075FDC:\n\ - adds r0, r4, 0\n\ - bl AnimBankSpriteExists\n\ - lsls r0, 24\n\ - cmp r0, 0\n\ - beq _0807602C\n\ - bl NotInBattle\n\ - lsls r0, 24\n\ - cmp r0, 0\n\ - bne _0807601C\n\ - lsls r0, r5, 2\n\ - ldr r1, _08076020 @ =gSharedMem + 0x17800\n\ - adds r0, r1\n\ - ldrb r1, [r0]\n\ - movs r0, 0x1\n\ - ands r0, r1\n\ - cmp r0, 0\n\ - beq _0807601C\n\ - ldr r2, _08076024 @ =gSprites\n\ - ldr r0, _08076028 @ =gObjectBankIDs\n\ - adds r0, r5, r0\n\ - ldrb r1, [r0]\n\ - lsls r0, r1, 4\n\ - adds r0, r1\n\ - lsls r0, 2\n\ - adds r0, r2\n\ - adds r0, 0x3E\n\ - ldrb r0, [r0]\n\ - lsls r0, 29\n\ - cmp r0, 0\n\ - blt _0807602C\n\ -_0807601C:\n\ - movs r0, 0x1\n\ - b _0807602E\n\ - .align 2, 0\n\ -_08076020: .4byte gSharedMem + 0x17800\n\ -_08076024: .4byte gSprites\n\ -_08076028: .4byte gObjectBankIDs\n\ -_0807602C:\n\ - movs r0, 0\n\ -_0807602E:\n\ - pop {r4,r5}\n\ - pop {r1}\n\ - bx r1\n\ - .syntax divided\n"); + + return FALSE; } -#endif void sub_8076034(u8 a, u8 b) { @@ -876,25 +683,25 @@ void sub_8076034(u8 a, u8 b) REG_BG1CNT_BITFIELD.areaOverflowMode = 0; spriteId = gObjectBankIDs[a]; - gUnknown_030042C0 = -(gSprites[spriteId].pos1.x + gSprites[spriteId].pos2.x) + 32; - if (NotInBattle() != 0 && sub_80AEB1C(EWRAM_19348) != 0) - gUnknown_030042C0--; - gUnknown_030041B4 = -(gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y) + 32; + gBattle_BG1_X = -(gSprites[spriteId].pos1.x + gSprites[spriteId].pos2.x) + 32; + if (IsContest() != 0 && IsSpeciesNotUnown(EWRAM_19348) != 0) + gBattle_BG1_X--; + gBattle_BG1_Y = -(gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y) + 32; gSprites[gObjectBankIDs[a]].invisible = TRUE; - REG_BG1HOFS = gUnknown_030042C0; - REG_BG1VOFS = gUnknown_030041B4; + REG_BG1HOFS = gBattle_BG1_X; + REG_BG1VOFS = gBattle_BG1_Y; LoadPalette(gPlttBufferUnfaded + 0x100 + a * 16, s.unk8 * 16, 32); addr3 = (u16 *)PLTT + s.unk8 * 16; DmaCopy32(3, gPlttBufferUnfaded + 0x100 + a * 16, addr3, 32); - if (NotInBattle() != 0) + if (IsContest() != 0) r2 = 0; else r2 = GetBankIdentity(a); sub_80E4EF8(0, 0, r2, s.unk8, (u32)s.unk0, (((s32)s.unk4 - VRAM) / 2048), REG_BG1CNT_BITFIELD.charBaseBlock); - if (NotInBattle() != 0) + if (IsContest() != 0) sub_8076380(); } else @@ -926,12 +733,12 @@ void sub_8076034(u8 a, u8 b) REG_BG2CNT_BITFIELD.areaOverflowMode = 0; spriteId = gObjectBankIDs[a]; - gUnknown_03004288 = -(gSprites[spriteId].pos1.x + gSprites[spriteId].pos2.x) + 32; - gUnknown_03004280 = -(gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y) + 32; + gBattle_BG2_X = -(gSprites[spriteId].pos1.x + gSprites[spriteId].pos2.x) + 32; + gBattle_BG2_Y = -(gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y) + 32; gSprites[gObjectBankIDs[a]].invisible = TRUE; - REG_BG2HOFS = gUnknown_03004288; - REG_BG2VOFS = gUnknown_03004280; + REG_BG2HOFS = gBattle_BG2_X; + REG_BG2VOFS = gBattle_BG2_Y; LoadPalette(gPlttBufferUnfaded + 0x100 + a * 16, 0x90, 32); addr3 = (void *)(PLTT + 0x120); @@ -948,7 +755,7 @@ static void sub_8076380(void) struct UnknownStruct2 s; u16 *ptr; - if (sub_80AEB1C(EWRAM_19348) != 0) + if (IsSpeciesNotUnown(EWRAM_19348)) { sub_8078914(&s); ptr = s.unk4; @@ -996,7 +803,7 @@ void sub_8076464(u8 a) struct UnknownStruct2 s; sub_8078914(&s); - if (a == 0 || NotInBattle() != 0) + if (a == 0 || IsContest() != 0) { u16 *addr2; @@ -1017,8 +824,8 @@ void sub_8076464(u8 a) pointlessZero = 0; addr2 = s.unk4; DmaFill32(3, 0, addr2, 0x800); - gUnknown_030042C0 = 0; - gUnknown_030041B4 = 0; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; } else { @@ -1041,32 +848,31 @@ void sub_8076464(u8 a) pointlessZero = 0; addr2 = (void *)(VRAM + 0xF000); DmaFill32(3, 0, addr2, 0x800); - gUnknown_03004288 = 0; - gUnknown_03004280 = 0; + gBattle_BG2_X = 0; + gBattle_BG2_Y = 0; } } static void task_pA_ma0A_obj_to_bg_pal(u8 taskId) { - u8 r4; - u8 r6; - s16 r3; - s16 r2; + u8 spriteId, palIndex; + s16 x, y; struct UnknownStruct2 s; - r4 = gTasks[taskId].data[0]; - r6 = gTasks[taskId].data[6]; + spriteId = gTasks[taskId].data[0]; + palIndex = gTasks[taskId].data[6]; sub_8078914(&s); - r3 = gTasks[taskId].data[1] - (gSprites[r4].pos1.x + gSprites[r4].pos2.x); - r2 = gTasks[taskId].data[2] - (gSprites[r4].pos1.y + gSprites[r4].pos2.y); + x = gTasks[taskId].data[1] - (gSprites[spriteId].pos1.x + gSprites[spriteId].pos2.x); + y = gTasks[taskId].data[2] - (gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y); + if (gTasks[taskId].data[5] == 0) { u16 *src; u16 *dst; - gUnknown_030042C0 = r3 + gTasks[taskId].data[3]; - gUnknown_030041B4 = r2 + gTasks[taskId].data[4]; - src = gPlttBufferFaded + 0x100 + r6 * 16; + gBattle_BG1_X = x + gTasks[taskId].data[3]; + gBattle_BG1_Y = y + gTasks[taskId].data[4]; + src = gPlttBufferFaded + 0x100 + palIndex * 16; dst = gPlttBufferFaded + 0x100 + s.unk8 * 16 - 256; DmaCopy32(3, src, dst, 32); } @@ -1075,9 +881,9 @@ static void task_pA_ma0A_obj_to_bg_pal(u8 taskId) u16 *src; u16 *dst; - gUnknown_03004288 = r3 + gTasks[taskId].data[3]; - gUnknown_03004280 = r2 + gTasks[taskId].data[4]; - src = gPlttBufferFaded + 0x100 + r6 * 16; + gBattle_BG2_X = x + gTasks[taskId].data[3]; + gBattle_BG2_Y = y + gTasks[taskId].data[4]; + src = gPlttBufferFaded + 0x100 + palIndex * 16; dst = gPlttBufferFaded + 0x100 - 112; DmaCopy32(3, src, dst, 32); } @@ -1085,55 +891,59 @@ static void task_pA_ma0A_obj_to_bg_pal(u8 taskId) static void ScriptCmd_clearmonbg(void) { - u8 r4; - u8 r5; + u8 animBankId; + u8 bank; u8 taskId; - gBattleAnimScriptPtr++; - r4 = T1_READ_8(gBattleAnimScriptPtr); - if (r4 == 0) - r4 = 2; - else if (r4 == 1) - r4 = 3; - if (r4 == 0 || r4 == 2) - r5 = gBattleAnimBankAttacker; + sBattleAnimScriptPtr++; + animBankId = T1_READ_8(sBattleAnimScriptPtr); + + if (animBankId == ANIM_BANK_ATTACKER) + animBankId = ANIM_BANK_ATK_PARTNER; + else if (animBankId == ANIM_BANK_TARGET) + animBankId = ANIM_BANK_DEF_PARTNER; + + if (animBankId == ANIM_BANK_ATTACKER || animBankId == ANIM_BANK_ATK_PARTNER) + bank = gAnimBankAttacker; else - r5 = gBattleAnimBankTarget; + bank = gAnimBankTarget; + if (gMonAnimTaskIdArray[0] != 0xFF) - gSprites[gObjectBankIDs[r5]].invisible = FALSE; - if (r4 > 1 && gMonAnimTaskIdArray[1] != 0xFF) - gSprites[gObjectBankIDs[r5 ^ 2]].invisible = FALSE; + gSprites[gObjectBankIDs[bank]].invisible = FALSE; + if (animBankId > 1 && gMonAnimTaskIdArray[1] != 0xFF) + gSprites[gObjectBankIDs[bank ^ 2]].invisible = FALSE; else - r4 = 0; + animBankId = 0; + taskId = CreateTask(sub_807672C, 5); - gTasks[taskId].data[0] = r4; - gTasks[taskId].data[2] = r5; - gBattleAnimScriptPtr++; + gTasks[taskId].data[0] = animBankId; + gTasks[taskId].data[2] = bank; + sBattleAnimScriptPtr++; } static void sub_807672C(u8 taskId) { - u8 var; - u8 r4; + u8 identity; + u8 to_BG2; gTasks[taskId].data[1]++; if (gTasks[taskId].data[1] != 1) { - var = GetBankIdentity(gTasks[taskId].data[2]); - var += 0xFF; - if (var <= 1 || NotInBattle() != 0) - r4 = 0; + identity = GetBankIdentity(gTasks[taskId].data[2]); + identity += 0xFF; + if (identity <= 1 || IsContest() != 0) + to_BG2 = 0; else - r4 = 1; + to_BG2 = 1; if (gMonAnimTaskIdArray[0] != 0xFF) { - sub_8076464(r4); + sub_8076464(to_BG2); DestroyTask(gMonAnimTaskIdArray[0]); gMonAnimTaskIdArray[0] = 0xFF; } if (gTasks[taskId].data[0] > 1) { - sub_8076464(r4 ^ 1); + sub_8076464(to_BG2 ^ 1); DestroyTask(gMonAnimTaskIdArray[1]); gMonAnimTaskIdArray[1] = 0xFF; } @@ -1143,187 +953,195 @@ static void sub_807672C(u8 taskId) static void ScriptCmd_monbg_22(void) { - u8 r5; - u8 r4; - u8 r0; + u8 animBankId; + u8 bank; + u8 identity; u8 r1; - gBattleAnimScriptPtr++; - r5 = T1_READ_8(gBattleAnimScriptPtr); - if (r5 == 0) - r5 = 2; - else if (r5 == 1) - r5 = 3; - if (r5 == 0 || r5 == 2) - r4 = gBattleAnimBankAttacker; + sBattleAnimScriptPtr++; + animBankId = T1_READ_8(sBattleAnimScriptPtr); + + if (animBankId == ANIM_BANK_ATTACKER) + animBankId = ANIM_BANK_ATK_PARTNER; + else if (animBankId == ANIM_BANK_TARGET) + animBankId = ANIM_BANK_DEF_PARTNER; + + if (animBankId == ANIM_BANK_ATTACKER || animBankId == ANIM_BANK_ATK_PARTNER) + bank = gAnimBankAttacker; else - r4 = gBattleAnimBankTarget; - if (IsAnimBankSpriteVisible(r4)) + bank = gAnimBankTarget; + + if (IsAnimBankSpriteVisible(bank)) { - r0 = GetBankIdentity(r4); - r0 += 0xFF; - if (r0 <= 1 || NotInBattle() != 0) + identity = GetBankIdentity(bank); + identity += 0xFF; + if (identity <= 1 || IsContest() != 0) r1 = 0; else r1 = 1; - sub_8076034(r4, r1); - gSprites[gObjectBankIDs[r4]].invisible = FALSE; + sub_8076034(bank, r1); + gSprites[gObjectBankIDs[bank]].invisible = FALSE; } - r4 ^= 2; - if (r5 > 1 && IsAnimBankSpriteVisible(r4)) + + bank ^= 2; + if (animBankId > ANIM_BANK_TARGET && IsAnimBankSpriteVisible(bank)) { - r0 = GetBankIdentity(r4); - r0 += 0xFF; - if (r0 <= 1 || NotInBattle() != 0) + identity = GetBankIdentity(bank); + identity += 0xFF; + if (identity <= 1 || IsContest() != 0) r1 = 0; else r1 = 1; - sub_8076034(r4, r1); - gSprites[gObjectBankIDs[r4]].invisible = FALSE; + sub_8076034(bank, r1); + gSprites[gObjectBankIDs[bank]].invisible = FALSE; } - gBattleAnimScriptPtr++; + sBattleAnimScriptPtr++; } static void ScriptCmd_clearmonbg_23(void) { - u8 r5; - u8 r6; + u8 animBankId; + u8 bank; u8 taskId; - gBattleAnimScriptPtr++; - r5 = T1_READ_8(gBattleAnimScriptPtr); - if (r5 == 0) - r5 = 2; - else if (r5 == 1) - r5 = 3; - if (r5 == 0 || r5 == 2) - r6 = gBattleAnimBankAttacker; + sBattleAnimScriptPtr++; + animBankId = T1_READ_8(sBattleAnimScriptPtr); + + if (animBankId == ANIM_BANK_ATTACKER) + animBankId = ANIM_BANK_ATK_PARTNER; + else if (animBankId == ANIM_BANK_TARGET) + animBankId = ANIM_BANK_DEF_PARTNER; + + if (animBankId == ANIM_BANK_ATTACKER || animBankId == ANIM_BANK_ATK_PARTNER) + bank = gAnimBankAttacker; else - r6 = gBattleAnimBankTarget; - if (IsAnimBankSpriteVisible(r6)) - gSprites[gObjectBankIDs[r6]].invisible = FALSE; - if (r5 > 1 && IsAnimBankSpriteVisible(r6 ^ 2)) - gSprites[gObjectBankIDs[r6 ^ 2]].invisible = FALSE; + bank = gAnimBankTarget; + + if (IsAnimBankSpriteVisible(bank)) + gSprites[gObjectBankIDs[bank]].invisible = FALSE; + if (animBankId > 1 && IsAnimBankSpriteVisible(bank ^ 2)) + gSprites[gObjectBankIDs[bank ^ 2]].invisible = FALSE; else - r5 = 0; + animBankId = 0; + taskId = CreateTask(sub_80769A4, 5); - gTasks[taskId].data[0] = r5; - gTasks[taskId].data[2] = r6; - gBattleAnimScriptPtr++; + gTasks[taskId].data[0] = animBankId; + gTasks[taskId].data[2] = bank; + + sBattleAnimScriptPtr++; } static void sub_80769A4(u8 taskId) { - u8 r0; - u8 r4; - u8 r5; + u8 identity; + u8 bank; + u8 toBG_2; gTasks[taskId].data[1]++; if (gTasks[taskId].data[1] != 1) { - r4 = gTasks[taskId].data[2]; - r0 = GetBankIdentity(r4); - r0 += 0xFF; - if (r0 <= 1 || NotInBattle() != 0) - r5 = 0; + bank = gTasks[taskId].data[2]; + identity = GetBankIdentity(bank); + identity += 0xFF; + if (identity <= 1 || IsContest() != 0) + toBG_2 = 0; else - r5 = 1; - if (IsAnimBankSpriteVisible(r4)) - sub_8076464(r5); - if (gTasks[taskId].data[0] > 1 && IsAnimBankSpriteVisible(r4 ^ 2)) - sub_8076464(r5 ^ 1); + toBG_2 = 1; + if (IsAnimBankSpriteVisible(bank)) + sub_8076464(toBG_2); + if (gTasks[taskId].data[0] > 1 && IsAnimBankSpriteVisible(bank ^ 2)) + sub_8076464(toBG_2 ^ 1); DestroyTask(taskId); } } static void ScriptCmd_setalpha(void) { - u16 r3; - u16 r1; + u16 half1, half2; - gBattleAnimScriptPtr++; - r3 = *(gBattleAnimScriptPtr++); - r1 = *(gBattleAnimScriptPtr++) << 8; + sBattleAnimScriptPtr++; + half1 = *(sBattleAnimScriptPtr++); + half2 = *(sBattleAnimScriptPtr++) << 8; REG_BLDCNT = 0x3F40; - REG_BLDALPHA = r3 | r1; + REG_BLDALPHA = half1 | half2; } static void ScriptCmd_setbldcnt(void) { - u16 r3; - u16 r1; + u16 half1, half2; - gBattleAnimScriptPtr++; - r3 = *(gBattleAnimScriptPtr++); - r1 = *(gBattleAnimScriptPtr++) << 8; - REG_BLDCNT = r3 | r1; + sBattleAnimScriptPtr++; + half1 = *(sBattleAnimScriptPtr++); + half2 = *(sBattleAnimScriptPtr++) << 8; + REG_BLDCNT = half1 | half2; } static void ScriptCmd_blendoff(void) { - gBattleAnimScriptPtr++; + sBattleAnimScriptPtr++; REG_BLDCNT = 0; REG_BLDALPHA = 0; } static void ScriptCmd_call(void) { - gBattleAnimScriptPtr++; - gBattleAnimScriptRetAddr = gBattleAnimScriptPtr + 4; - gBattleAnimScriptPtr = T2_READ_PTR(gBattleAnimScriptPtr); + sBattleAnimScriptPtr++; + gBattleAnimScriptRetAddr = sBattleAnimScriptPtr + 4; + sBattleAnimScriptPtr = T2_READ_PTR(sBattleAnimScriptPtr); } static void ScriptCmd_return(void) { - gBattleAnimScriptPtr = gBattleAnimScriptRetAddr; + sBattleAnimScriptPtr = gBattleAnimScriptRetAddr; } -static void ScriptCmd_setvar(void) +static void ScriptCmd_setarg(void) { - const u8 *addr = gBattleAnimScriptPtr; - u16 r4; - u8 r2; + const u8 *addr = sBattleAnimScriptPtr; + u16 value; + u8 argId; - gBattleAnimScriptPtr++; - r2 = T1_READ_8(gBattleAnimScriptPtr); - gBattleAnimScriptPtr++; - r4 = T1_READ_16(gBattleAnimScriptPtr); - gBattleAnimScriptPtr = addr + 4; - gBattleAnimArgs[r2] = r4; + sBattleAnimScriptPtr++; + argId = T1_READ_8(sBattleAnimScriptPtr); + sBattleAnimScriptPtr++; + value = T1_READ_16(sBattleAnimScriptPtr); + sBattleAnimScriptPtr = addr + 4; + gBattleAnimArgs[argId] = value; } -static void ScriptCmd_ifelse(void) +static void ScriptCmd_choosetwoturnanim(void) { - gBattleAnimScriptPtr++; - if (gUnknown_0202F7C4 & 1) - gBattleAnimScriptPtr += 4; - gBattleAnimScriptPtr = T2_READ_PTR(gBattleAnimScriptPtr); + sBattleAnimScriptPtr++; + if (gAnimMoveTurn & 1) + sBattleAnimScriptPtr += 4; + sBattleAnimScriptPtr = T2_READ_PTR(sBattleAnimScriptPtr); } -static void ScriptCmd_jumpif(void) +static void ScriptCmd_jumpifmoveturn(void) { - u8 r1; + u8 toCheck; - gBattleAnimScriptPtr++; - r1 = T1_READ_8(gBattleAnimScriptPtr); - gBattleAnimScriptPtr++; - if (r1 == gUnknown_0202F7C4) + sBattleAnimScriptPtr++; + toCheck = T1_READ_8(sBattleAnimScriptPtr); + sBattleAnimScriptPtr++; + + if (toCheck == gAnimMoveTurn) { - gBattleAnimScriptPtr = T2_READ_PTR(gBattleAnimScriptPtr); + sBattleAnimScriptPtr = T2_READ_PTR(sBattleAnimScriptPtr); } else { - gBattleAnimScriptPtr += 4; + sBattleAnimScriptPtr += 4; } } static void ScriptCmd_jump(void) { - gBattleAnimScriptPtr++; - gBattleAnimScriptPtr = T2_READ_PTR(gBattleAnimScriptPtr); + sBattleAnimScriptPtr++; + sBattleAnimScriptPtr = T2_READ_PTR(sBattleAnimScriptPtr); } -bool8 NotInBattle(void) +bool8 IsContest(void) { if (!gMain.inBattle) return TRUE; @@ -1331,124 +1149,131 @@ bool8 NotInBattle(void) return FALSE; } +#define tBackgroundId data[0] +#define tState data[10] + static void ScriptCmd_fadetobg(void) { - u8 r4; + u8 backgroundId; u8 taskId; - gBattleAnimScriptPtr++; - r4 = T1_READ_8(gBattleAnimScriptPtr); - gBattleAnimScriptPtr++; - taskId = CreateTask(task_p5_load_battle_screen_elements, 5); - gTasks[taskId].data[0] = r4; - gUnknown_0202F7C5 = 1; + sBattleAnimScriptPtr++; + backgroundId = T1_READ_8(sBattleAnimScriptPtr); + sBattleAnimScriptPtr++; + taskId = CreateTask(Task_FadeToBg, 5); + gTasks[taskId].tBackgroundId = backgroundId; + sAnimBackgroundFadeState = 1; } -static void ScriptCmd_fadetobg_25(void) +static void ScriptCmd_fadetobgfromset(void) { - u8 r8; - u8 r7; - u8 r6; + u8 bg1, bg2, bg3; u8 taskId; - gBattleAnimScriptPtr++; - r8 = gBattleAnimScriptPtr[0]; - r7 = gBattleAnimScriptPtr[1]; - r6 = gBattleAnimScriptPtr[2]; - gBattleAnimScriptPtr += 3; - taskId = CreateTask(task_p5_load_battle_screen_elements, 5); - if (NotInBattle() != 0) - gTasks[taskId].data[0] = r6; - else if (GetBankSide(gBattleAnimBankTarget) == 0) - gTasks[taskId].data[0] = r7; + sBattleAnimScriptPtr++; + bg1 = sBattleAnimScriptPtr[0]; + bg2 = sBattleAnimScriptPtr[1]; + bg3 = sBattleAnimScriptPtr[2]; + sBattleAnimScriptPtr += 3; + taskId = CreateTask(Task_FadeToBg, 5); + + if (IsContest()) + gTasks[taskId].tBackgroundId = bg3; + else if (GetBankSide(gAnimBankTarget) == 0) + gTasks[taskId].tBackgroundId = bg2; else - gTasks[taskId].data[0] = r8; - gUnknown_0202F7C5 = 1; + gTasks[taskId].tBackgroundId = bg1; + + sAnimBackgroundFadeState = 1; } -static void task_p5_load_battle_screen_elements(u8 taskId) +static void Task_FadeToBg(u8 taskId) { - if (gTasks[taskId].data[10] == 0) + if (gTasks[taskId].tState == 0) { BeginHardwarePaletteFade(0xE8, 0, 0, 16, 0); - gTasks[taskId].data[10]++; + gTasks[taskId].tState++; return; } if (gPaletteFade.active) return; - if (gTasks[taskId].data[10] == 1) + if (gTasks[taskId].tState == 1) { - gTasks[taskId].data[10]++; - gUnknown_0202F7C5 = 2; + gTasks[taskId].tState++; + sAnimBackgroundFadeState = 2; } - else if (gTasks[taskId].data[10] == 2) + else if (gTasks[taskId].tState == 2) { - s16 data0 = (u16)gTasks[taskId].data[0]; + s16 bgId = (u16)gTasks[taskId].tBackgroundId; - if (data0 == -1) - dp01t_11_3_message_for_player_only(); + if (bgId == -1) + LoadDefaultBg(); else - sub_8076DB8(data0); + LoadMoveBg(bgId); + BeginHardwarePaletteFade(0xE8, 0, 16, 0, 1); - gTasks[taskId].data[10]++; + gTasks[taskId].tState++; return; } if (gPaletteFade.active) return; - if (gTasks[taskId].data[10] == 3) + if (gTasks[taskId].tState == 3) { DestroyTask(taskId); - gUnknown_0202F7C5 = 0; + sAnimBackgroundFadeState = 0; } } -static void sub_8076DB8(u16 a) +static void LoadMoveBg(u16 bgId) { - if (NotInBattle()) + if (IsContest()) { - void *tilemap = gBattleAnimBackgroundTable[a].tilemap; + void *tilemap = gBattleAnimBackgroundTable[bgId].tilemap; void *dmaSrc; void *dmaDest; - LZDecompressWram(tilemap, NotInBattle() ? EWRAM_14800 : EWRAM_18000); - sub_80763FC(sub_80789BC(), NotInBattle() ? EWRAM_14800 : EWRAM_18000, 0x100, 0); - dmaSrc = NotInBattle() ? EWRAM_14800 : EWRAM_18000; + LZDecompressWram(tilemap, IsContest() ? EWRAM_14800 : EWRAM_18000); + sub_80763FC(sub_80789BC(), IsContest() ? EWRAM_14800 : EWRAM_18000, 0x100, 0); + dmaSrc = IsContest() ? EWRAM_14800 : EWRAM_18000; dmaDest = (void *)(VRAM + 0xD000); DmaCopy32(3, dmaSrc, dmaDest, 0x800); - LZDecompressVram(gBattleAnimBackgroundTable[a].image, (void *)(VRAM + 0x2000)); - LoadCompressedPalette(gBattleAnimBackgroundTable[a].palette, sub_80789BC() * 16, 32); + LZDecompressVram(gBattleAnimBackgroundTable[bgId].image, (void *)(VRAM + 0x2000)); + LoadCompressedPalette(gBattleAnimBackgroundTable[bgId].palette, sub_80789BC() * 16, 32); } else { - LZDecompressVram(gBattleAnimBackgroundTable[a].tilemap, (void *)(VRAM + 0xD000)); - LZDecompressVram(gBattleAnimBackgroundTable[a].image, (void *)(VRAM + 0x8000)); - LoadCompressedPalette(gBattleAnimBackgroundTable[a].palette, 32, 32); + LZDecompressVram(gBattleAnimBackgroundTable[bgId].tilemap, (void *)(VRAM + 0xD000)); + LZDecompressVram(gBattleAnimBackgroundTable[bgId].image, (void *)(VRAM + 0x8000)); + LoadCompressedPalette(gBattleAnimBackgroundTable[bgId].palette, 32, 32); } } -static void dp01t_11_3_message_for_player_only(void) +static void LoadDefaultBg(void) { - if (NotInBattle()) - sub_80AB2AC(); + if (IsContest()) + LoadContestBgAfterMoveAnim(); else - sub_800D7B8(); + DrawMainBattleBackground(); } static void ScriptCmd_restorebg(void) { u8 taskId; - gBattleAnimScriptPtr++; - taskId = CreateTask(task_p5_load_battle_screen_elements, 5); - gTasks[taskId].data[0] = 0xFFFF; - gUnknown_0202F7C5 = 1; + sBattleAnimScriptPtr++; + taskId = CreateTask(Task_FadeToBg, 5); + gTasks[taskId].tBackgroundId = 0xFFFF; + sAnimBackgroundFadeState = 1; } +#undef tBackgroundId +#undef tState + static void ScriptCmd_waitbgfadeout(void) { - if (gUnknown_0202F7C5 == 2) + if (sAnimBackgroundFadeState == 2) { - gBattleAnimScriptPtr++; + sBattleAnimScriptPtr++; gAnimFramesToWait = 0; } else @@ -1459,9 +1284,9 @@ static void ScriptCmd_waitbgfadeout(void) static void ScriptCmd_waitbgfadein(void) { - if (gUnknown_0202F7C5 == 0) + if (sAnimBackgroundFadeState == 0) { - gBattleAnimScriptPtr++; + sBattleAnimScriptPtr++; gAnimFramesToWait = 0; } else @@ -1472,25 +1297,25 @@ static void ScriptCmd_waitbgfadein(void) static void ScriptCmd_changebg(void) { - gBattleAnimScriptPtr++; - sub_8076DB8(T1_READ_8(gBattleAnimScriptPtr)); - gBattleAnimScriptPtr++; + sBattleAnimScriptPtr++; + LoadMoveBg(T1_READ_8(sBattleAnimScriptPtr)); + sBattleAnimScriptPtr++; } //Weird control flow /* -s8 sub_8076F98(s8 a) +s8 BattleAnimAdjustPanning(s8 a) { - if (!NotInBattle() && (EWRAM_17810[gBattleAnimBankAttacker].unk0 & 0x10)) + if (!IsContest() && (EWRAM_17810[gAnimBankAttacker].unk0 & 0x10)) { - a = GetBankSide(gBattleAnimBankAttacker) ? 0xC0 : 0x3F; + a = GetBankSide(gAnimBankAttacker) ? 0xC0 : 0x3F; } //_08076FDC else { - if (NotInBattle()) + if (IsContest()) { - if (gBattleAnimBankAttacker == gBattleAnimBankTarget && gBattleAnimBankAttacker == 2 + if (gAnimBankAttacker == gAnimBankTarget && gAnimBankAttacker == 2 && a == 0x3F) { //jump to _0807707A @@ -1502,9 +1327,9 @@ s8 sub_8076F98(s8 a) //_08077004 else { - if (GetBankSide(gBattleAnimBankAttacker) == 0) + if (GetBankSide(gAnimBankAttacker) == 0) { - if (GetBankSide(gBattleAnimBankTarget) == 0) + if (GetBankSide(gAnimBankTarget) == 0) } //_08077042 else @@ -1518,17 +1343,17 @@ s8 sub_8076F98(s8 a) } */ __attribute__((naked)) -s8 sub_8076F98(s8 a) +s8 BattleAnimAdjustPanning(s8 a) { asm(".syntax unified\n\ push {r4,lr}\n\ lsls r0, 24\n\ lsrs r4, r0, 24\n\ - bl NotInBattle\n\ + bl IsContest\n\ lsls r0, 24\n\ cmp r0, 0\n\ bne _08076FDC\n\ - ldr r0, _08076FD4 @ =gBattleAnimBankAttacker\n\ + ldr r0, _08076FD4 @ =gAnimBankAttacker\n\ ldrb r2, [r0]\n\ lsls r0, r2, 1\n\ adds r0, r2\n\ @@ -1549,15 +1374,15 @@ s8 sub_8076F98(s8 a) movs r4, 0x3F\n\ b _0807706E\n\ .align 2, 0\n\ -_08076FD4: .4byte gBattleAnimBankAttacker\n\ +_08076FD4: .4byte gAnimBankAttacker\n\ _08076FD8: .4byte gSharedMem + 0x17810\n\ _08076FDC:\n\ - bl NotInBattle\n\ + bl IsContest\n\ lsls r0, 24\n\ cmp r0, 0\n\ beq _08077004\n\ - ldr r0, _08076FFC @ =gBattleAnimBankAttacker\n\ - ldr r1, _08077000 @ =gBattleAnimBankTarget\n\ + ldr r0, _08076FFC @ =gAnimBankAttacker\n\ + ldr r1, _08077000 @ =gAnimBankTarget\n\ ldrb r0, [r0]\n\ ldrb r1, [r1]\n\ cmp r0, r1\n\ @@ -1568,16 +1393,16 @@ _08076FDC:\n\ beq _0807707A\n\ b _08077068\n\ .align 2, 0\n\ -_08076FFC: .4byte gBattleAnimBankAttacker\n\ -_08077000: .4byte gBattleAnimBankTarget\n\ +_08076FFC: .4byte gAnimBankAttacker\n\ +_08077000: .4byte gAnimBankTarget\n\ _08077004:\n\ - ldr r0, _0807702C @ =gBattleAnimBankAttacker\n\ + ldr r0, _0807702C @ =gAnimBankAttacker\n\ ldrb r0, [r0]\n\ bl GetBankSide\n\ lsls r0, 24\n\ cmp r0, 0\n\ bne _08077042\n\ - ldr r0, _08077030 @ =gBattleAnimBankTarget\n\ + ldr r0, _08077030 @ =gAnimBankTarget\n\ ldrb r0, [r0]\n\ bl GetBankSide\n\ lsls r0, 24\n\ @@ -1590,8 +1415,8 @@ _08077004:\n\ movs r4, 0xC0\n\ b _0807706E\n\ .align 2, 0\n\ -_0807702C: .4byte gBattleAnimBankAttacker\n\ -_08077030: .4byte gBattleAnimBankTarget\n\ +_0807702C: .4byte gAnimBankAttacker\n\ +_08077030: .4byte gAnimBankTarget\n\ _08077034:\n\ movs r0, 0x40\n\ negs r0, r0\n\ @@ -1601,7 +1426,7 @@ _08077034:\n\ lsls r0, 24\n\ b _0807706C\n\ _08077042:\n\ - ldr r0, _08077064 @ =gBattleAnimBankTarget\n\ + ldr r0, _08077064 @ =gAnimBankTarget\n\ ldrb r0, [r0]\n\ bl GetBankSide\n\ lsls r0, 24\n\ @@ -1617,7 +1442,7 @@ _08077042:\n\ movs r4, 0x3F\n\ b _0807706E\n\ .align 2, 0\n\ -_08077064: .4byte gBattleAnimBankTarget\n\ +_08077064: .4byte gAnimBankTarget\n\ _08077068:\n\ lsls r0, r4, 24\n\ negs r0, r0\n\ @@ -1647,21 +1472,21 @@ _08077088:\n\ .syntax divided\n"); } -s8 sub_8077094(s8 a) +s8 BattleAnimAdjustPanning2(s8 pan) { - if (!NotInBattle() && (EWRAM_17810[gBattleAnimBankAttacker].unk0 & 0x10)) + if (!IsContest() && (EWRAM_17810[gAnimBankAttacker].unk0 & 0x10)) { - if (GetBankSide(gBattleAnimBankAttacker) != 0) - a = 0x3F; + if (GetBankSide(gAnimBankAttacker) != 0) + pan = 0x3F; else - a = 0xC0; + pan = 0xC0; } else { - if (GetBankSide(gBattleAnimBankAttacker) != 0 || NotInBattle() != 0) - a = -a; + if (GetBankSide(gAnimBankAttacker) != 0 || IsContest() != 0) + pan = -pan; } - return a; + return pan; } s16 sub_8077104(s16 a) @@ -1675,310 +1500,232 @@ s16 sub_8077104(s16 a) return var; } -s16 sub_807712C(s16 a, s16 b, s16 c) +s16 CalculatePanIncrement(s16 sourcePan, s16 targetPan, s16 incrementPan) { - u16 var; + u16 ret; - if (a < b) - var = ((c < 0) ? -c : c); - else if (a > b) - var = -((c < 0) ? -c : c); + if (sourcePan < targetPan) + ret = ((incrementPan < 0) ? -incrementPan : incrementPan); + else if (sourcePan > targetPan) + ret = -((incrementPan < 0) ? -incrementPan : incrementPan); else - var = 0; - return var; + ret = 0; + + return ret; } -static void ScriptCmd_panse_19(void) +static void ScriptCmd_playsewithpan(void) { - u16 r4; - s8 r0; + u16 songId; + s8 pan; - gBattleAnimScriptPtr++; - r4 = T1_READ_16(gBattleAnimScriptPtr); - r0 = T1_READ_8(gBattleAnimScriptPtr + 2); - PlaySE12WithPanning(r4, sub_8076F98(r0)); - gBattleAnimScriptPtr += 3; + sBattleAnimScriptPtr++; + songId = T1_READ_16(sBattleAnimScriptPtr); + pan = T1_READ_8(sBattleAnimScriptPtr + 2); + PlaySE12WithPanning(songId, BattleAnimAdjustPanning(pan)); + sBattleAnimScriptPtr += 3; } static void ScriptCmd_setpan(void) { - s8 r0; + s8 pan; - gBattleAnimScriptPtr++; - r0 = T1_READ_8(gBattleAnimScriptPtr); - SE12PanpotControl(sub_8076F98(r0)); - gBattleAnimScriptPtr++; + sBattleAnimScriptPtr++; + pan = T1_READ_8(sBattleAnimScriptPtr); + SE12PanpotControl(BattleAnimAdjustPanning(pan)); + sBattleAnimScriptPtr++; } +#define tInitialPan data[0] +#define tTargetPan data[1] +#define tIncrementPan data[2] +#define tFramesToWait data[3] +#define tCurrentPan data[4] +#define tFrameCounter data[8] + static void ScriptCmd_panse_1B(void) { u16 songNum; - s8 r0; - s8 r4; - s8 r6; - u8 r7; - s8 panning; - s8 r8; + s8 currentPanArg, incrementPan, incrementPanArg, currentPan, targetPan; + u8 framesToWait; u8 taskId; - gBattleAnimScriptPtr++; - songNum = T1_READ_16(gBattleAnimScriptPtr); - r0 = T1_READ_8(gBattleAnimScriptPtr + 2); - r4 = T1_READ_8(gBattleAnimScriptPtr + 3); - r6 = T1_READ_8(gBattleAnimScriptPtr + 4); - r7 = T1_READ_8(gBattleAnimScriptPtr + 5); - panning = sub_8076F98(r0); - r8 = sub_8076F98(r4); - r4 = sub_807712C(panning, r8, r6); - taskId = CreateTask(c3_08073CEC, 1); - gTasks[taskId].data[0] = panning; - gTasks[taskId].data[1] = r8; - gTasks[taskId].data[2] = r4; - gTasks[taskId].data[3] = r7; - gTasks[taskId].data[4] = panning; - PlaySE12WithPanning(songNum, panning); + sBattleAnimScriptPtr++; + songNum = T1_READ_16(sBattleAnimScriptPtr); + currentPanArg = T1_READ_8(sBattleAnimScriptPtr + 2); + incrementPan = T1_READ_8(sBattleAnimScriptPtr + 3); + incrementPanArg = T1_READ_8(sBattleAnimScriptPtr + 4); + framesToWait = T1_READ_8(sBattleAnimScriptPtr + 5); + + currentPan = BattleAnimAdjustPanning(currentPanArg); + targetPan = BattleAnimAdjustPanning(incrementPan); + incrementPan = CalculatePanIncrement(currentPan, targetPan, incrementPanArg); + taskId = CreateTask(Task_PanFromInitialToTarget, 1); + gTasks[taskId].tInitialPan = currentPan; + gTasks[taskId].tTargetPan = targetPan; + gTasks[taskId].tIncrementPan = incrementPan; + gTasks[taskId].tFramesToWait = framesToWait; + gTasks[taskId].tCurrentPan = currentPan; + + PlaySE12WithPanning(songNum, currentPan); + gAnimSoundTaskCount++; - gBattleAnimScriptPtr += 6; + sBattleAnimScriptPtr += 6; } -#ifdef NONMATCHING -static void c3_08073CEC(u8 taskId) +void Task_PanFromInitialToTarget(u8 taskId) { - u16 r7 = 0; - s16 r0; - s16 r6; - s16 r3; - s16 r4; - int foo; - - r0 = gTasks[taskId].data[8]; - gTasks[taskId].data[8]++; - if (r0 >= gTasks[taskId].data[3]) + bool32 destroyTask = FALSE; + if (gTasks[taskId].tFrameCounter++ >= gTasks[taskId].tFramesToWait) { - gTasks[taskId].data[8] = r7; - r6 = gTasks[taskId].data[0]; - r3 = gTasks[taskId].data[1]; - foo = gTasks[taskId].data[4] + gTasks[taskId].data[2]; - r4 = foo; - gTasks[taskId].data[4] = r4; - if (gTasks[taskId].data[2] == 0) + s16 pan; + s16 initialPanning, targetPanning, currentPan, incrementPan; + + gTasks[taskId].tFrameCounter = 0; + initialPanning = gTasks[taskId].tInitialPan; + targetPanning = gTasks[taskId].tTargetPan; + currentPan = gTasks[taskId].tCurrentPan; + incrementPan = gTasks[taskId].tIncrementPan; + pan = currentPan + incrementPan; + gTasks[taskId].tCurrentPan = pan; + + if (incrementPan == 0) // If we're not incrementing, just cancel the task immediately { - r4 = r3; - DestroyTask(taskId); - gAnimSoundTaskCount--; + destroyTask = TRUE; } - //_080772D8 - else + else if (initialPanning < targetPanning) // Panning increasing { - if (r6 < r3) - { - if (r4 < r3) - goto check; - DestroyTask(taskId); - gAnimSoundTaskCount--; - } - else - { - if (r4 <= r3) - r7 = 1; - check: - if (r7 != 0) - { - DestroyTask(taskId); - gAnimSoundTaskCount--; - } - } + if (pan >= targetPanning) // Target reached + destroyTask = TRUE; } - //_080772F8 - SE12PanpotControl(r4); + else // Panning decreasing + { + if (pan <= targetPanning) // Target reached + destroyTask = TRUE; + } + + if (destroyTask) + { + pan = targetPanning; + DestroyTask(taskId); + gAnimSoundTaskCount--; + } + + SE12PanpotControl(pan); } - //_08077314 -} -#else -__attribute__((naked)) -static void c3_08073CEC(u8 taskId) -{ - asm(".syntax unified\n\ - push {r4-r7,lr}\n\ - lsls r0, 24\n\ - lsrs r5, r0, 24\n\ - movs r7, 0\n\ - ldr r1, _080772D4 @ =gTasks\n\ - lsls r0, r5, 2\n\ - adds r0, r5\n\ - lsls r0, 3\n\ - adds r2, r0, r1\n\ - ldrh r0, [r2, 0x18]\n\ - adds r1, r0, 0x1\n\ - strh r1, [r2, 0x18]\n\ - lsls r0, 16\n\ - asrs r0, 16\n\ - movs r3, 0xE\n\ - ldrsh r1, [r2, r3]\n\ - cmp r0, r1\n\ - blt _08077314\n\ - strh r7, [r2, 0x18]\n\ - ldrh r6, [r2, 0x8]\n\ - ldrh r3, [r2, 0xA]\n\ - movs r4, 0x10\n\ - ldrsh r0, [r2, r4]\n\ - movs r4, 0xC\n\ - ldrsh r1, [r2, r4]\n\ - adds r0, r1\n\ - lsls r0, 16\n\ - lsrs r4, r0, 16\n\ - strh r4, [r2, 0x10]\n\ - cmp r1, 0\n\ - bne _080772D8\n\ - lsls r2, r3, 16\n\ - b _080772FC\n\ - .align 2, 0\n\ -_080772D4: .4byte gTasks\n\ -_080772D8:\n\ - lsls r1, r6, 16\n\ - lsls r0, r3, 16\n\ - asrs r3, r0, 16\n\ - adds r2, r0, 0\n\ - cmp r1, r2\n\ - bge _080772EE\n\ - lsls r0, r4, 16\n\ - asrs r0, 16\n\ - cmp r0, r3\n\ - blt _080772F8\n\ - b _080772FC\n\ -_080772EE:\n\ - lsls r0, r4, 16\n\ - asrs r0, 16\n\ - cmp r0, r3\n\ - bgt _080772F8\n\ - movs r7, 0x1\n\ -_080772F8:\n\ - cmp r7, 0\n\ - beq _0807730C\n\ -_080772FC:\n\ - lsrs r4, r2, 16\n\ - adds r0, r5, 0\n\ - bl DestroyTask\n\ - ldr r1, _0807731C @ =gAnimSoundTaskCount\n\ - ldrb r0, [r1]\n\ - subs r0, 0x1\n\ - strb r0, [r1]\n\ -_0807730C:\n\ - lsls r0, r4, 24\n\ - asrs r0, 24\n\ - bl SE12PanpotControl\n\ -_08077314:\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - .align 2, 0\n\ -_0807731C: .4byte gAnimSoundTaskCount\n\ - .syntax divided\n"); } -#endif static void ScriptCmd_panse_26(void) { - u16 r8; - s8 r4; - s8 r5; - s8 r6; - u8 r10; + u16 songId; + s8 currentPan, targetPan, incrementPan; + u8 framesToWait; u8 taskId; - gBattleAnimScriptPtr++; - r8 = T1_READ_16(gBattleAnimScriptPtr); - r4 = T1_READ_8(gBattleAnimScriptPtr + 2); - r5 = T1_READ_8(gBattleAnimScriptPtr + 3); - r6 = T1_READ_8(gBattleAnimScriptPtr + 4); - r10 = T1_READ_8(gBattleAnimScriptPtr + 5); - taskId = CreateTask(c3_08073CEC, 1); - gTasks[taskId].data[0] = r4; - gTasks[taskId].data[1] = r5; - gTasks[taskId].data[2] = r6; - gTasks[taskId].data[3] = r10; - gTasks[taskId].data[4] = r4; - PlaySE12WithPanning(r8, r4); + sBattleAnimScriptPtr++; + songId = T1_READ_16(sBattleAnimScriptPtr); + currentPan = T1_READ_8(sBattleAnimScriptPtr + 2); + targetPan = T1_READ_8(sBattleAnimScriptPtr + 3); + incrementPan = T1_READ_8(sBattleAnimScriptPtr + 4); + framesToWait = T1_READ_8(sBattleAnimScriptPtr + 5); + + taskId = CreateTask(Task_PanFromInitialToTarget, 1); + gTasks[taskId].tInitialPan = currentPan; + gTasks[taskId].tTargetPan = targetPan; + gTasks[taskId].tIncrementPan = incrementPan; + gTasks[taskId].tFramesToWait = framesToWait; + gTasks[taskId].tCurrentPan = currentPan; + + PlaySE12WithPanning(songId, currentPan); + gAnimSoundTaskCount++; - gBattleAnimScriptPtr += 6; + sBattleAnimScriptPtr += 6; } static void ScriptCmd_panse_27(void) { - u16 r9; - u8 r4; - u8 r8; - u8 r7; - u8 r0; - s8 r6; - s8 r5; - s8 r4_2; + u16 songId; + u8 targetPanArg, incrementPanArg, currentPan, currentPanArg; + s8 targetPan, incrementPan, framesToWait; u8 taskId; - gBattleAnimScriptPtr++; - r9 = T1_READ_16(gBattleAnimScriptPtr); - r0 = T1_READ_8(gBattleAnimScriptPtr + 2); - r4 = T1_READ_8(gBattleAnimScriptPtr + 3); - r8 = T1_READ_8(gBattleAnimScriptPtr + 4); - r7 = T1_READ_8(gBattleAnimScriptPtr + 5); - r6 = sub_8077094(r0); - r5 = sub_8077094(r4); - r4_2 = sub_8077094(r8); - taskId = CreateTask(c3_08073CEC, 1); - gTasks[taskId].data[0] = r6; - gTasks[taskId].data[1] = r5; - gTasks[taskId].data[2] = r4_2; - gTasks[taskId].data[3] = r7; - gTasks[taskId].data[4] = r6; - PlaySE12WithPanning(r9, r6); + sBattleAnimScriptPtr++; + songId = T1_READ_16(sBattleAnimScriptPtr); + currentPanArg = T1_READ_8(sBattleAnimScriptPtr + 2); + targetPanArg = T1_READ_8(sBattleAnimScriptPtr + 3); + incrementPanArg = T1_READ_8(sBattleAnimScriptPtr + 4); + currentPan = T1_READ_8(sBattleAnimScriptPtr + 5); + + targetPan = BattleAnimAdjustPanning2(currentPanArg); + incrementPan = BattleAnimAdjustPanning2(targetPanArg); + framesToWait = BattleAnimAdjustPanning2(incrementPanArg); + + taskId = CreateTask(Task_PanFromInitialToTarget, 1); + gTasks[taskId].data[0] = targetPan; + gTasks[taskId].data[1] = incrementPan; + gTasks[taskId].data[2] = framesToWait; + gTasks[taskId].data[3] = currentPan; + gTasks[taskId].data[4] = targetPan; + + PlaySE12WithPanning(songId, targetPan); + gAnimSoundTaskCount++; - gBattleAnimScriptPtr += 6; + sBattleAnimScriptPtr += 6; } -static void ScriptCmd_panse_1C(void) +#undef tInitialPan +#undef tTargetPan +#undef tIncrementPan +#undef tFramesToWait +#undef tCurrentPan +#undef tFrameCounter + +#define tSongId data[0] +#define tPanning data[1] +#define tFramesToWait data[2] +#define tNumberOfPlays data[3] +#define tFrameCounter data[8] + +static void ScriptCmd_loopsewithpan(void) { - u16 r5; - u8 r0; - u8 r8; - u8 r9; - s8 r4; + u16 songId; + s8 panningArg, panning; + u8 framesToWait, numberOfPlays; u8 taskId; - gBattleAnimScriptPtr++; - r5 = T1_READ_16(gBattleAnimScriptPtr); - r0 = T1_READ_8(gBattleAnimScriptPtr + 2); - r8 = T1_READ_8(gBattleAnimScriptPtr + 3); - r9 = T1_READ_8(gBattleAnimScriptPtr + 4); - r4 = sub_8076F98(r0); - taskId = CreateTask(sub_80774FC, 1); - gTasks[taskId].data[0] = r5; - gTasks[taskId].data[1] = r4; - gTasks[taskId].data[2] = r8; - gTasks[taskId].data[3] = r9; - gTasks[taskId].data[8] = r8; + sBattleAnimScriptPtr++; + songId = T1_READ_16(sBattleAnimScriptPtr); + panningArg = T1_READ_8(sBattleAnimScriptPtr + 2); + framesToWait = T1_READ_8(sBattleAnimScriptPtr + 3); + numberOfPlays = T1_READ_8(sBattleAnimScriptPtr + 4); + panning = BattleAnimAdjustPanning(panningArg); + + taskId = CreateTask(Task_LoopAndPlaySE, 1); + gTasks[taskId].tSongId = songId; + gTasks[taskId].tPanning = panning; + gTasks[taskId].tFramesToWait = framesToWait; + gTasks[taskId].tNumberOfPlays = numberOfPlays; + gTasks[taskId].tFrameCounter = framesToWait; gTasks[taskId].func(taskId); + gAnimSoundTaskCount++; - gBattleAnimScriptPtr += 5; + sBattleAnimScriptPtr += 5; } -static void sub_80774FC(u8 taskId) +static void Task_LoopAndPlaySE(u8 taskId) { - s16 data8; - u16 r0; - s8 r1; - u8 r4; - - data8 = gTasks[taskId].data[8]; - gTasks[taskId].data[8]++; - if (data8 >= gTasks[taskId].data[2]) + if (gTasks[taskId].tFrameCounter++ >= gTasks[taskId].tFramesToWait) { - gTasks[taskId].data[8] = 0; - r0 = gTasks[taskId].data[0]; - r1 = gTasks[taskId].data[1]; - gTasks[taskId].data[3]--; - r4 = gTasks[taskId].data[3]; - PlaySE12WithPanning(r0, r1); - if (r4 == 0) + u16 songId; + s8 panning; + u8 numberOfPlays; + + gTasks[taskId].tFrameCounter = 0; + songId = gTasks[taskId].tSongId; + panning = gTasks[taskId].tPanning; + numberOfPlays = --gTasks[taskId].tNumberOfPlays; + PlaySE12WithPanning(songId, panning); + if (numberOfPlays == 0) { DestroyTask(taskId); gAnimSoundTaskCount--; @@ -1986,57 +1733,67 @@ static void sub_80774FC(u8 taskId) } } -static void ScriptCmd_panse_1D(void) +#undef tSongId +#undef tPanning +#undef tFramesToWait +#undef tNumberOfPlays +#undef tFrameCounter + +#define tSongId data[0] +#define tPanning data[1] +#define tFramesToWait data[2] + +static void ScriptCmd_waitplaysewithpan(void) { - u16 r5; - u8 r0; - u8 r8; - s8 r4; + u16 songId; + s8 panningArg, panning; + u8 framesToWait; u8 taskId; - gBattleAnimScriptPtr++; - r5 = T1_READ_16(gBattleAnimScriptPtr); - r0 = T1_READ_8(gBattleAnimScriptPtr + 2); - r8 = T1_READ_8(gBattleAnimScriptPtr + 3); - r4 = sub_8076F98(r0); - taskId = CreateTask(sub_80775CC, 1); - gTasks[taskId].data[0] = r5; - gTasks[taskId].data[1] = r4; - gTasks[taskId].data[2] = r8; + sBattleAnimScriptPtr++; + songId = T1_READ_16(sBattleAnimScriptPtr); + panningArg = T1_READ_8(sBattleAnimScriptPtr + 2); + framesToWait = T1_READ_8(sBattleAnimScriptPtr + 3); + panning = BattleAnimAdjustPanning(panningArg); + + taskId = CreateTask(Task_WaitAndPlaySE, 1); + gTasks[taskId].tSongId = songId; + gTasks[taskId].tPanning = panning; + gTasks[taskId].tFramesToWait = framesToWait; + gAnimSoundTaskCount++; - gBattleAnimScriptPtr += 4; + sBattleAnimScriptPtr += 4; } -static void sub_80775CC(u8 taskId) +static void Task_WaitAndPlaySE(u8 taskId) { - s16 r0; - - r0 = gTasks[taskId].data[2]; - gTasks[taskId].data[2]--; - if (r0 <= 0) + if (gTasks[taskId].tFramesToWait-- <= 0) { - PlaySE12WithPanning(gTasks[taskId].data[0], gTasks[taskId].data[1]); + PlaySE12WithPanning(gTasks[taskId].tSongId, gTasks[taskId].tPanning); DestroyTask(taskId); gAnimSoundTaskCount--; } } -static void ScriptCmd_createtask_1F(void) +#undef tSongId +#undef tPanning +#undef tFramesToWait + +static void ScriptCmd_createsoundtask(void) { TaskFunc func; - u8 numArgs; - int i; - u8 taskId; + u8 numArgs, taskId; + s32 i; - gBattleAnimScriptPtr++; - func = (TaskFunc)T2_READ_32(gBattleAnimScriptPtr); - gBattleAnimScriptPtr += 4; - numArgs = T1_READ_8(gBattleAnimScriptPtr); - gBattleAnimScriptPtr++; + sBattleAnimScriptPtr++; + func = (TaskFunc)T2_READ_32(sBattleAnimScriptPtr); + sBattleAnimScriptPtr += 4; + numArgs = T1_READ_8(sBattleAnimScriptPtr); + sBattleAnimScriptPtr++; for (i = 0; i < numArgs; i++) { - gBattleAnimArgs[i] = T1_READ_16(gBattleAnimScriptPtr); - gBattleAnimScriptPtr += 2; + gBattleAnimArgs[i] = T1_READ_16(sBattleAnimScriptPtr); + sBattleAnimScriptPtr += 2; } taskId = CreateTask(func, 1); func(taskId); @@ -2066,61 +1823,51 @@ static void ScriptCmd_waitsound(void) else { gSoundAnimFramesToWait = 0; - gBattleAnimScriptPtr++; + sBattleAnimScriptPtr++; gAnimFramesToWait = 0; } } -static void ScriptCmd_jumpvareq(void) +static void ScriptCmd_jumpargeq(void) { - u8 r2; - s16 r1; - u8 *addr; + u8 argId; + s16 valueToCheck; - gBattleAnimScriptPtr++; - r2 = T1_READ_8(gBattleAnimScriptPtr); - r1 = T1_READ_16(gBattleAnimScriptPtr + 1); - if (r1 == gBattleAnimArgs[r2]) - { - addr = T2_READ_PTR(gBattleAnimScriptPtr + 3); - gBattleAnimScriptPtr = addr; - } + sBattleAnimScriptPtr++; + argId = T1_READ_8(sBattleAnimScriptPtr); + valueToCheck = T1_READ_16(sBattleAnimScriptPtr + 1); + + if (valueToCheck == gBattleAnimArgs[argId]) + sBattleAnimScriptPtr = T2_READ_PTR(sBattleAnimScriptPtr + 3); else - { - gBattleAnimScriptPtr += 7; - } + sBattleAnimScriptPtr += 7; } -static void ScriptCmd_jumpunkcond(void) +static void ScriptCmd_jumpifcontest(void) { - u8 *addr; - - gBattleAnimScriptPtr++; - if (NotInBattle()) - { - addr = T2_READ_PTR(gBattleAnimScriptPtr); - gBattleAnimScriptPtr = addr; - } + sBattleAnimScriptPtr++; + if (IsContest()) + sBattleAnimScriptPtr = T2_READ_PTR(sBattleAnimScriptPtr); else - { - gBattleAnimScriptPtr += 4; - } + sBattleAnimScriptPtr += 4; } static void ScriptCmd_monbgprio_28(void) { - u8 r2; - u8 r0; - u8 r4; + u8 wantedBank; + u8 bank; + u8 bankIdentity; + + wantedBank = T1_READ_8(sBattleAnimScriptPtr + 1); + sBattleAnimScriptPtr += 2; - r2 = T1_READ_8(gBattleAnimScriptPtr + 1); - gBattleAnimScriptPtr += 2; - if (r2 != 0) - r0 = gBattleAnimBankTarget; + if (wantedBank != 0) + bank = gAnimBankTarget; else - r0 = gBattleAnimBankAttacker; - r4 = GetBankIdentity(r0); - if (!NotInBattle() && (r4 == 0 || r4 == 3)) + bank = gAnimBankAttacker; + + bankIdentity = GetBankIdentity(bank); + if (!IsContest() && (bankIdentity == 0 || bankIdentity == 3)) { REG_BG1CNT_BITFIELD.priority = 1; REG_BG2CNT_BITFIELD.priority = 2; @@ -2129,8 +1876,8 @@ static void ScriptCmd_monbgprio_28(void) static void ScriptCmd_monbgprio_29(void) { - gBattleAnimScriptPtr++; - if (!NotInBattle()) + sBattleAnimScriptPtr++; + if (!IsContest()) { REG_BG1CNT_BITFIELD.priority = 1; REG_BG2CNT_BITFIELD.priority = 2; @@ -2139,20 +1886,20 @@ static void ScriptCmd_monbgprio_29(void) static void ScriptCmd_monbgprio_2A(void) { - u8 r6; - u8 r4; - u8 r0; + u8 wantedBank; + u8 bankIdentity; + u8 bank; - r6 = T1_READ_8(gBattleAnimScriptPtr + 1); - gBattleAnimScriptPtr += 2; - if (GetBankSide(gBattleAnimBankAttacker) != GetBankSide(gBattleAnimBankTarget)) + wantedBank = T1_READ_8(sBattleAnimScriptPtr + 1); + sBattleAnimScriptPtr += 2; + if (GetBankSide(gAnimBankAttacker) != GetBankSide(gAnimBankTarget)) { - if (r6 != 0) - r0 = gBattleAnimBankTarget; + if (wantedBank != 0) + bank = gAnimBankTarget; else - r0 = gBattleAnimBankAttacker; - r4 = GetBankIdentity(r0); - if (!NotInBattle() && (r4 == 0 || r4 == 3)) + bank = gAnimBankAttacker; + bankIdentity = GetBankIdentity(bank); + if (!IsContest() && (bankIdentity == 0 || bankIdentity == 3)) { REG_BG1CNT_BITFIELD.priority = 1; REG_BG2CNT_BITFIELD.priority = 2; @@ -2162,51 +1909,45 @@ static void ScriptCmd_monbgprio_2A(void) static void ScriptCmd_invisible(void) { - u8 r0; u8 spriteId; - r0 = T1_READ_8(gBattleAnimScriptPtr + 1); - spriteId = GetAnimBankSpriteId(r0); + spriteId = GetAnimBankSpriteId(T1_READ_8(sBattleAnimScriptPtr + 1)); if (spriteId != 0xFF) - { gSprites[spriteId].invisible = TRUE; - } - gBattleAnimScriptPtr += 2; + + sBattleAnimScriptPtr += 2; } static void ScriptCmd_visible(void) { - u8 r0; u8 spriteId; - r0 = T1_READ_8(gBattleAnimScriptPtr + 1); - spriteId = GetAnimBankSpriteId(r0); + spriteId = GetAnimBankSpriteId(T1_READ_8(sBattleAnimScriptPtr + 1)); if (spriteId != 0xFF) - { gSprites[spriteId].invisible = FALSE; - } - gBattleAnimScriptPtr += 2; + + sBattleAnimScriptPtr += 2; } static void ScriptCmd_doublebattle_2D(void) { - u8 r7; + u8 wantedBank; u8 r4; u8 spriteId; - r7 = T1_READ_8(gBattleAnimScriptPtr + 1); - gBattleAnimScriptPtr += 2; - if (!NotInBattle() && IsDoubleBattle() - && GetBankSide(gBattleAnimBankAttacker) == GetBankSide(gBattleAnimBankTarget)) + wantedBank = T1_READ_8(sBattleAnimScriptPtr + 1); + sBattleAnimScriptPtr += 2; + if (!IsContest() && IsDoubleBattle() + && GetBankSide(gAnimBankAttacker) == GetBankSide(gAnimBankTarget)) { - if (r7 == 0) + if (wantedBank == 0) { - r4 = GetBankIdentity_permutated(gBattleAnimBankAttacker); + r4 = GetBankIdentity_permutated(gAnimBankAttacker); spriteId = GetAnimBankSpriteId(0); } else { - r4 = GetBankIdentity_permutated(gBattleAnimBankTarget); + r4 = GetBankIdentity_permutated(gAnimBankTarget); spriteId = GetAnimBankSpriteId(1); } if (spriteId != 0xFF) @@ -2224,23 +1965,23 @@ static void ScriptCmd_doublebattle_2D(void) static void ScriptCmd_doublebattle_2E(void) { - u8 r7; + u8 wantedBank; u8 r4; u8 spriteId; - r7 = T1_READ_8(gBattleAnimScriptPtr + 1); - gBattleAnimScriptPtr += 2; - if (!NotInBattle() && IsDoubleBattle() - && GetBankSide(gBattleAnimBankAttacker) == GetBankSide(gBattleAnimBankTarget)) + wantedBank = T1_READ_8(sBattleAnimScriptPtr + 1); + sBattleAnimScriptPtr += 2; + if (!IsContest() && IsDoubleBattle() + && GetBankSide(gAnimBankAttacker) == GetBankSide(gAnimBankTarget)) { - if (r7 == 0) + if (wantedBank == 0) { - r4 = GetBankIdentity_permutated(gBattleAnimBankAttacker); + r4 = GetBankIdentity_permutated(gAnimBankAttacker); spriteId = GetAnimBankSpriteId(0); } else { - r4 = GetBankIdentity_permutated(gBattleAnimBankTarget); + r4 = GetBankIdentity_permutated(gAnimBankTarget); spriteId = GetAnimBankSpriteId(1); } if (spriteId != 0xFF && r4 == 2) @@ -2254,5 +1995,5 @@ static void ScriptCmd_stopsound(void) { m4aMPlayStop(&gMPlay_SE1); m4aMPlayStop(&gMPlay_SE2); - gBattleAnimScriptPtr++; + sBattleAnimScriptPtr++; } diff --git a/src/battle/battle_anim_807B69C.c b/src/battle/battle_anim_807B69C.c index 6c35a85c9..058a45769 100644 --- a/src/battle/battle_anim_807B69C.c +++ b/src/battle/battle_anim_807B69C.c @@ -9,12 +9,12 @@ #include "trig.h" #include "ewram.h" -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern bool8 gAnimScriptActive; extern void (*gAnimScriptCallback)(void); extern s16 gBattleAnimArgs[]; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankTarget; extern u8 gObjectBankIDs[]; extern const struct CompressedSpriteSheet gBattleAnimPicTable[]; extern const struct CompressedSpritePalette gBattleAnimPaletteTable[]; @@ -22,7 +22,7 @@ extern const u8 *const gBattleAnims_StatusConditions[]; extern const struct OamData gOamData_837E05C; extern const struct OamData gOamData_837DF24; -extern u8 sub_8077ABC(u8, u8); +extern u8 GetBankPosition(u8, u8); extern void sub_80E32E0(u8); @@ -180,11 +180,11 @@ static void sub_807B8A4(struct Sprite *sprite) void sub_807B920(u8 taskId) { - s16 x = sub_8077ABC(gBattleAnimBankTarget, 2) - 32; - s16 y = sub_8077ABC(gBattleAnimBankTarget, 3) - 36; + s16 x = GetBankPosition(gAnimBankTarget, 2) - 32; + s16 y = GetBankPosition(gAnimBankTarget, 3) - 36; u8 spriteId; - if (NotInBattle()) + if (IsContest()) x -= 6; REG_BLDCNT = 0x3F40; REG_BLDALPHA = 0x1000; @@ -336,9 +336,9 @@ void move_anim_start_t2(u8 a, u8 b) { u8 taskId; - gBattleAnimBankAttacker = a; - gBattleAnimBankTarget = a; - DoMoveAnim(gBattleAnims_StatusConditions, b, 0); + gAnimBankAttacker = a; + gAnimBankTarget = a; + LaunchBattleAnimation(gBattleAnims_StatusConditions, b, 0); taskId = CreateTask(sub_807BDAC, 10); gTasks[taskId].data[0] = a; } diff --git a/src/battle/battle_anim_80A7E7C.c b/src/battle/battle_anim_80A7E7C.c index a1d916f0f..3097f1a0e 100644 --- a/src/battle/battle_anim_80A7E7C.c +++ b/src/battle/battle_anim_80A7E7C.c @@ -10,10 +10,10 @@ extern s16 gBattleAnimArgs[8]; extern u8 gObjectBankIDs[]; -extern s32 gMoveDmgMoveAnim; -extern u16 gMovePowerMoveAnim; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern s32 gAnimMoveDmg; +extern u16 gAnimMovePower; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; static void sub_80A7EF0(u8 taskId); static void sub_80A808C(u8 taskId); @@ -129,7 +129,7 @@ void sub_80A7FA0(u8 taskId) } else { - sprite = gObjectBankIDs[gBattleAnimBankAttacker]; + sprite = gObjectBankIDs[gAnimBankAttacker]; } if (r6) { @@ -328,7 +328,7 @@ static void sub_80A8488(u8 taskId) void sub_80A8500(u8 taskId) { - if (GetBankSide(gBattleAnimBankAttacker)) + if (GetBankSide(gAnimBankAttacker)) { gBattleAnimArgs[1] = -gBattleAnimArgs[1]; } @@ -338,7 +338,7 @@ void sub_80A8500(u8 taskId) void sub_80A8530(struct Sprite *sprite) { sprite->invisible = TRUE; - if (GetBankSide(gBattleAnimBankAttacker)) + if (GetBankSide(gAnimBankAttacker)) { sprite->data[1] = -gBattleAnimArgs[1]; } @@ -348,7 +348,7 @@ void sub_80A8530(struct Sprite *sprite) } sprite->data[0] = gBattleAnimArgs[0]; sprite->data[2] = 0; - sprite->data[3] = gObjectBankIDs[gBattleAnimBankAttacker]; + sprite->data[3] = gObjectBankIDs[gAnimBankAttacker]; sprite->data[4] = gBattleAnimArgs[0]; StoreSpriteCallbackInData(sprite, sub_80A85A4); sprite->callback = sub_8078458; @@ -359,7 +359,7 @@ static void sub_80A85A4(struct Sprite *sprite) sprite->data[0] = sprite->data[4]; sprite->data[1] = -sprite->data[1]; sprite->callback = sub_8078458; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); } void sub_80A85C8(struct Sprite *sprite) @@ -381,7 +381,7 @@ void sub_80A8614(struct Sprite *sprite) sprite->data[0] = sprite->data[4]; sprite->data[2] = -sprite->data[2]; sprite->callback = sub_8078458; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); } void sub_80A8638(struct Sprite *sprite) @@ -390,11 +390,11 @@ void sub_80A8638(struct Sprite *sprite) int spriteId; if (!gBattleAnimArgs[0]) { - spriteId = gObjectBankIDs[gBattleAnimBankAttacker]; + spriteId = gObjectBankIDs[gAnimBankAttacker]; } else { - spriteId = gObjectBankIDs[gBattleAnimBankTarget]; + spriteId = gObjectBankIDs[gAnimBankTarget]; } sprite->data[0] = gBattleAnimArgs[2]; sprite->data[1] = gSprites[spriteId].pos1.x + gSprites[spriteId].pos2.x; @@ -439,7 +439,7 @@ static void sub_80A86F4(struct Sprite *sprite) { sprite2->pos2.y = 0; } - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } else { @@ -457,11 +457,11 @@ void sub_80A8764(struct Sprite *sprite) u8 spriteId; if (!gBattleAnimArgs[0]) { - v1 = gBattleAnimBankAttacker; + v1 = gAnimBankAttacker; } else { - v1 = gBattleAnimBankTarget; + v1 = gAnimBankTarget; } spriteId = gObjectBankIDs[v1]; if (GetBankSide(v1)) @@ -482,7 +482,7 @@ void sub_80A8764(struct Sprite *sprite) sprite->data[4] = 0; sprite->data[5] = spriteId; sprite->invisible = TRUE; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); sprite->callback = sub_80784A8; } @@ -493,11 +493,11 @@ void sub_80A8818(struct Sprite *sprite) sprite->invisible = TRUE; if (!gBattleAnimArgs[0]) { - v1 = gBattleAnimBankAttacker; + v1 = gAnimBankAttacker; } else { - v1 = gBattleAnimBankTarget; + v1 = gAnimBankTarget; } spriteId = gObjectBankIDs[v1]; if (GetBankSide(v1)) @@ -520,7 +520,7 @@ void sub_80A8818(struct Sprite *sprite) sprite->data[6] = gBattleAnimArgs[5]; if (!gBattleAnimArgs[5]) { - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); } else { @@ -534,14 +534,14 @@ static void sub_80A88F0(struct Sprite *sprite) { gSprites[sprite->data[5]].pos2.x = 0; gSprites[sprite->data[5]].pos2.y = 0; - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } void sub_80A8920(u8 taskId) { s16 r7; r7 = 0x8000 / gBattleAnimArgs[3]; - if (GetBankSide(gBattleAnimBankAttacker)) + if (GetBankSide(gAnimBankAttacker)) { gBattleAnimArgs[1] = -gBattleAnimArgs[1]; gBattleAnimArgs[5] = -gBattleAnimArgs[5]; @@ -603,27 +603,27 @@ void sub_80A8A80(u8 taskId) spriteId = GetAnimBankSpriteId(gBattleAnimArgs[0]); break; case 2: - if (!IsAnimBankSpriteVisible(gBattleAnimBankAttacker ^ 2)) + if (!IsAnimBankSpriteVisible(gAnimBankAttacker ^ 2)) { DestroyAnimVisualTask(taskId); return; } - spriteId = gObjectBankIDs[gBattleAnimBankAttacker ^ 2]; + spriteId = gObjectBankIDs[gAnimBankAttacker ^ 2]; break; case 3: - if (!IsAnimBankSpriteVisible(gBattleAnimBankTarget ^ 2)) + if (!IsAnimBankSpriteVisible(gAnimBankTarget ^ 2)) { DestroyAnimVisualTask(taskId); return; } - spriteId = gObjectBankIDs[gBattleAnimBankTarget ^ 2]; + spriteId = gObjectBankIDs[gAnimBankTarget ^ 2]; break; default: DestroyAnimVisualTask(taskId); return; } TASK.data[0] = spriteId; - if (GetBankSide(gBattleAnimBankTarget)) + if (GetBankSide(gAnimBankTarget)) { TASK.data[1] = gBattleAnimArgs[1]; } @@ -648,7 +648,7 @@ static void sub_80A8B3C(u8 taskId) void sub_80A8B88(u8 taskId) { u8 spriteId; - if (GetBankSide(gBattleAnimBankAttacker)) + if (GetBankSide(gAnimBankAttacker)) { gBattleAnimArgs[1] = -gBattleAnimArgs[1]; } @@ -660,11 +660,11 @@ void sub_80A8B88(u8 taskId) TASK.data[4] = spriteId; if (gBattleAnimArgs[4] == 0) { - TASK.data[5] = gBattleAnimBankAttacker; + TASK.data[5] = gAnimBankAttacker; } else { - TASK.data[5] = gBattleAnimBankTarget; + TASK.data[5] = gAnimBankTarget; } TASK.data[12] = 1; TASK.func = sub_80A8C0C; @@ -769,7 +769,7 @@ void sub_80A8E04(u8 taskId) TASK.data[4] = gBattleAnimArgs[1]; TASK.data[5] = spriteId; TASK.data[6] = gBattleAnimArgs[3]; - if (NotInBattle()) + if (IsContest()) { TASK.data[7] = 1; } @@ -777,16 +777,16 @@ void sub_80A8E04(u8 taskId) { if (gBattleAnimArgs[2] == 0) { - TASK.data[7] = !GetBankSide(gBattleAnimBankAttacker); + TASK.data[7] = !GetBankSide(gAnimBankAttacker); } else { - TASK.data[7] = !GetBankSide(gBattleAnimBankTarget); + TASK.data[7] = !GetBankSide(gAnimBankTarget); } } if (TASK.data[7]) { - if (!NotInBattle()) + if (!IsContest()) { TASK.data[3] *= -1; TASK.data[4] *= -1; @@ -804,14 +804,14 @@ void sub_80A8EFC(u8 taskId) TASK.data[2] = gBattleAnimArgs[0]; if (gBattleAnimArgs[2] == 0) { - if (GetBankSide(gBattleAnimBankAttacker)) + if (GetBankSide(gAnimBankAttacker)) { gBattleAnimArgs[1] = -gBattleAnimArgs[1]; } } else { - if (GetBankSide(gBattleAnimBankTarget)) + if (GetBankSide(gAnimBankTarget)) { gBattleAnimArgs[1] = -gBattleAnimArgs[1]; } @@ -864,7 +864,7 @@ void sub_80A9058(u8 taskId) { if (!gBattleAnimArgs[0]) { - TASK.data[15] = gMovePowerMoveAnim / 12; + TASK.data[15] = gAnimMovePower / 12; if (TASK.data[15] < 1) { TASK.data[15] = 1; @@ -876,7 +876,7 @@ void sub_80A9058(u8 taskId) } else { - TASK.data[15] = gMoveDmgMoveAnim / 12; + TASK.data[15] = gAnimMoveDmg / 12; if (TASK.data[15] < 1) { TASK.data[15] = 1; diff --git a/src/battle/battle_controller_linkopponent.c b/src/battle/battle_controller_linkopponent.c index 3259fc7ee..35d8f33c8 100644 --- a/src/battle/battle_controller_linkopponent.c +++ b/src/battle/battle_controller_linkopponent.c @@ -1,5 +1,6 @@ #include "global.h" #include "battle.h" +#include "battle_anim.h" #include "battle_interface.h" #include "data2.h" #include "link.h" @@ -17,7 +18,7 @@ #include "util.h" #include "ewram.h" -struct UnknownStruct3 +struct MovePpInfo { u16 moves[4]; u8 pp[4]; @@ -32,12 +33,11 @@ extern u8 gHealthboxIDs[]; extern u16 gBattleTypeFlags; extern u8 gBattleMonForms[]; extern void (*gBattleBankFunc[])(void); -extern u32 *gDisableStructMoveAnim; -extern u32 gMoveDmgMoveAnim; -extern u16 gMovePowerMoveAnim; -extern u8 gHappinessMoveAnim; +extern u32 gAnimMoveDmg; +extern u16 gAnimMovePower; +extern u8 gAnimFriendship; extern u16 gWeatherMoveAnim; -extern u32 gPID_perBank[]; +extern u32 gTransformedPersonalities[]; extern u8 gAnimScriptActive; extern void (*gAnimScriptCallback)(void); extern u8 gDisplayedStringBattle[]; @@ -46,7 +46,7 @@ extern u8 gBattleOutcome; extern u16 gUnknown_02024DE8; extern u8 gUnknown_02024E68[]; extern struct SpriteTemplate gUnknown_02024E8C; -extern u8 gUnknown_0202F7C4; +extern u8 gAnimMoveTurn; extern struct Window gUnknown_03004210; extern u16 gUnknown_030042A0; extern u16 gUnknown_030042A4; @@ -79,7 +79,7 @@ extern void sub_8010384(struct Sprite *); extern void sub_8037B78(void); extern u8 sub_8031720(); extern bool8 mplay_80342A4(u8); -extern void ExecuteMoveAnim(); +extern void DoMoveAnim(); extern void sub_80326EC(); extern void sub_8031F24(void); extern void sub_80324BC(); @@ -100,7 +100,7 @@ extern void nullsub_47(void); extern bool8 IsDoubleBattle(void); extern void sub_8037840(void); extern void sub_8031B74(); -extern u8 AnimBankSpriteExists(); +extern u8 IsBankSpritePresent(); extern u8 move_anim_start_t3(); extern void sub_8037FD8(void); extern void sub_8037F34(void); @@ -596,7 +596,7 @@ void LinkOpponentHandleGetAttributes(void) u32 dp01_getattr_by_ch1_for_player_pokemon__(u8 a, u8 *buffer) { struct BattlePokemon battlePokemon; - struct UnknownStruct3 moveData; + struct MovePpInfo moveData; u8 nickname[20]; u8 *src; s16 data16; @@ -925,7 +925,7 @@ void LinkOpponentHandleSetAttributes(void) void sub_8038900(u8 a) { struct BattlePokemon *battlePokemon = (struct BattlePokemon *)&gBattleBufferA[gActiveBank][3]; - struct UnknownStruct3 *moveData = (struct UnknownStruct3 *)&gBattleBufferA[gActiveBank][3]; + struct MovePpInfo *moveData = (struct MovePpInfo *)&gBattleBufferA[gActiveBank][3]; s32 i; switch (gBattleBufferA[gActiveBank][1]) @@ -1157,7 +1157,7 @@ void LinkOpponentHandleLoadPokeSprite(void) GetMonSpriteTemplate_803C56C(species, GetBankIdentity(gActiveBank)); gObjectBankIDs[gActiveBank] = CreateSprite( &gUnknown_02024E8C, - sub_8077ABC(gActiveBank, 2), + GetBankPosition(gActiveBank, 2), sub_8077F68(gActiveBank), sub_8079E90(gActiveBank)); gSprites[gObjectBankIDs[gActiveBank]].pos2.x = -240; @@ -1187,7 +1187,7 @@ void sub_8039430(u8 a, u8 b) GetMonSpriteTemplate_803C56C(species, GetBankIdentity(a)); gObjectBankIDs[a] = CreateSprite( &gUnknown_02024E8C, - sub_8077ABC(a, 2), + GetBankPosition(a, 2), sub_8077F68(a), sub_8079E90(a)); gSprites[gUnknown_0300434C[a]].data[1] = gObjectBankIDs[a]; @@ -1331,21 +1331,21 @@ void LinkOpponentHandleMoveAnimation(void) u32 r0 = gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8); - gUnknown_0202F7C4 = gBattleBufferA[gActiveBank][3]; - gMovePowerMoveAnim = gBattleBufferA[gActiveBank][4] + gAnimMoveTurn = gBattleBufferA[gActiveBank][3]; + gAnimMovePower = gBattleBufferA[gActiveBank][4] | (gBattleBufferA[gActiveBank][5] << 8); - gMoveDmgMoveAnim = gBattleBufferA[gActiveBank][6] + gAnimMoveDmg = gBattleBufferA[gActiveBank][6] | (gBattleBufferA[gActiveBank][7] << 8) | (gBattleBufferA[gActiveBank][8] << 16) | (gBattleBufferA[gActiveBank][9] << 24); - gHappinessMoveAnim = gBattleBufferA[gActiveBank][10]; + gAnimFriendship = gBattleBufferA[gActiveBank][10]; gWeatherMoveAnim = gBattleBufferA[gActiveBank][12] | (gBattleBufferA[gActiveBank][13] << 8); - gDisableStructMoveAnim = (u32 *)&gBattleBufferA[gActiveBank][16]; - gPID_perBank[gActiveBank] = *gDisableStructMoveAnim; + gAnimDisableStructPtr = (struct DisableStruct *)&gBattleBufferA[gActiveBank][16]; + gTransformedPersonalities[gActiveBank] = gAnimDisableStructPtr->transformedMonPersonality; // Dead code. sub_8031720 always returns 0. - if (sub_8031720(r0, gUnknown_0202F7C4) != 0) + if (sub_8031720(r0, gAnimMoveTurn) != 0) { LinkOpponentBufferExecCompleted(); } @@ -1377,7 +1377,7 @@ void sub_8039B64(void) if (!ewram17810[gActiveBank].unk0_6) { sub_80326EC(0); - ExecuteMoveAnim(r4); + DoMoveAnim(r4); ewram17810[gActiveBank].unk4 = 2; } break; @@ -1731,7 +1731,7 @@ void LinkOpponentHandlecmd50(void) void LinkOpponentHandleSpriteInvisibility(void) { - if (AnimBankSpriteExists(gActiveBank) != 0) + if (IsBankSpritePresent(gActiveBank) != 0) { gSprites[gObjectBankIDs[gActiveBank]].invisible = gBattleBufferA[gActiveBank][1]; sub_8031F88(gActiveBank); diff --git a/src/battle/battle_controller_linkpartner.c b/src/battle/battle_controller_linkpartner.c index fc3fde661..adc3c1c85 100644 --- a/src/battle/battle_controller_linkpartner.c +++ b/src/battle/battle_controller_linkpartner.c @@ -1,5 +1,6 @@ #include "global.h" #include "battle.h" +#include "battle_anim.h" #include "battle_interface.h" #include "data2.h" #include "battle_811DA74.h" @@ -21,15 +22,7 @@ #include "util.h" #include "ewram.h" -struct UnknownStruct1 -{ - u8 unk0; - u8 unk1; - u8 unk2[0x1FE]; -}; - -//Possibly PokemonSubstruct1 -struct UnknownStruct3 +struct MovePpInfo { u16 moves[4]; u8 pp[4]; @@ -47,14 +40,13 @@ extern u8 gBattleOutcome; extern u16 gUnknown_02024DE8; extern u8 gUnknown_02024E68[]; extern u8 gDoingBattleAnim; -extern u32 gPID_perBank[]; +extern u32 gTransformedPersonalities[]; extern struct SpriteTemplate gUnknown_02024E8C; -extern u32 *gDisableStructMoveAnim; -extern u32 gMoveDmgMoveAnim; -extern u16 gMovePowerMoveAnim; -extern u8 gHappinessMoveAnim; +extern u32 gAnimMoveDmg; +extern u16 gAnimMovePower; +extern u8 gAnimFriendship; extern u16 gWeatherMoveAnim; -extern u8 gUnknown_0202F7C4; +extern u8 gAnimMoveTurn; extern struct Window gUnknown_03004210; extern u16 gUnknown_030042A0; extern u16 gUnknown_030042A4; @@ -67,7 +59,7 @@ extern u8 gAnimScriptActive; extern void (*gAnimScriptCallback)(void); extern u8 move_anim_start_t3(); -extern u8 AnimBankSpriteExists(); +extern u8 IsBankSpritePresent(); extern void sub_8044CA0(u8); extern void sub_8030E38(struct Sprite *); extern void sub_80E43C0(); @@ -78,7 +70,7 @@ extern void sub_8043D84(); extern void BufferStringBattle(); extern void sub_8031F24(void); extern void sub_80326EC(); -extern void ExecuteMoveAnim(); +extern void DoMoveAnim(); extern void sub_80324BC(); extern u8 sub_8031720(); extern u8 mplay_80342A4(); @@ -93,7 +85,7 @@ extern u8 sub_8046400(); extern void sub_80312F0(struct Sprite *); extern u8 CreateInvisibleSpriteWithCallback(); extern void BattleLoadPlayerMonSprite(); -extern u8 sub_8077ABC(); +extern u8 GetBankPosition(); extern u8 sub_8077F68(); extern u8 sub_8079E90(); extern void nullsub_10(); @@ -552,7 +544,7 @@ void LinkPartnerHandleGetAttributes(void) u32 dp01_getattr_by_ch1_for_player_pokemon(u8 a, u8 *buffer) { struct BattlePokemon battlePokemon; - struct UnknownStruct3 moveData; + struct MovePpInfo moveData; u8 nickname[20]; u8 *src; s16 data16; @@ -881,7 +873,7 @@ void LinkPartnerHandleSetAttributes(void) void sub_811EC68(u8 a) { struct BattlePokemon *battlePokemon = (struct BattlePokemon *)&gBattleBufferA[gActiveBank][3]; - struct UnknownStruct3 *moveData = (struct UnknownStruct3 *)&gBattleBufferA[gActiveBank][3]; + struct MovePpInfo *moveData = (struct MovePpInfo *)&gBattleBufferA[gActiveBank][3]; s32 i; switch (gBattleBufferA[gActiveBank][1]) @@ -1114,7 +1106,7 @@ void LinkPartnerHandleLoadPokeSprite(void) GetBankIdentity(gActiveBank)); gObjectBankIDs[gActiveBank] = CreateSprite( &gUnknown_02024E8C, - sub_8077ABC(gActiveBank, 2), + GetBankPosition(gActiveBank, 2), sub_8077F68(gActiveBank), sub_8079E90(gActiveBank)); gSprites[gObjectBankIDs[gActiveBank]].pos2.x = -240; @@ -1144,7 +1136,7 @@ void sub_811F864(u8 a, u8 b) GetMonSpriteTemplate_803C56C(species, GetBankIdentity(a)); gObjectBankIDs[a] = CreateSprite( &gUnknown_02024E8C, - sub_8077ABC(a, 2), + GetBankPosition(a, 2), sub_8077F68(a), sub_8079E90(a)); gSprites[gUnknown_0300434C[a]].data[1] = gObjectBankIDs[a]; @@ -1287,20 +1279,20 @@ void LinkPartnerHandleMoveAnimation(void) u32 r0 = gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8); - gUnknown_0202F7C4 = gBattleBufferA[gActiveBank][3]; - gMovePowerMoveAnim = gBattleBufferA[gActiveBank][4] + gAnimMoveTurn = gBattleBufferA[gActiveBank][3]; + gAnimMovePower = gBattleBufferA[gActiveBank][4] | (gBattleBufferA[gActiveBank][5] << 8); - gMoveDmgMoveAnim = gBattleBufferA[gActiveBank][6] + gAnimMoveDmg = gBattleBufferA[gActiveBank][6] | (gBattleBufferA[gActiveBank][7] << 8) | (gBattleBufferA[gActiveBank][8] << 16) | (gBattleBufferA[gActiveBank][9] << 24); - gHappinessMoveAnim = gBattleBufferA[gActiveBank][10]; + gAnimFriendship = gBattleBufferA[gActiveBank][10]; gWeatherMoveAnim = gBattleBufferA[gActiveBank][12] | (gBattleBufferA[gActiveBank][13] << 8); - gDisableStructMoveAnim = (u32 *)&gBattleBufferA[gActiveBank][16]; - gPID_perBank[gActiveBank] = *gDisableStructMoveAnim; + gAnimDisableStructPtr = (struct DisableStruct *)&gBattleBufferA[gActiveBank][16]; + gTransformedPersonalities[gActiveBank] = gAnimDisableStructPtr->transformedMonPersonality; - if (sub_8031720(r0, gUnknown_0202F7C4) != 0) + if (sub_8031720(r0, gAnimMoveTurn) != 0) LinkPartnerBufferExecCompleted(); else { @@ -1330,7 +1322,7 @@ void sub_811FF30(void) if (!ewram17810[gActiveBank].unk0_6) { sub_80326EC(0); - ExecuteMoveAnim(r4); + DoMoveAnim(r4); ewram17810[gActiveBank].unk4 = 2; } break; @@ -1679,7 +1671,7 @@ void LinkPartnerHandlecmd50(void) void LinkPartnerHandleSpriteInvisibility(void) { - if (AnimBankSpriteExists(gActiveBank) != 0) + if (IsBankSpritePresent(gActiveBank) != 0) { gSprites[gObjectBankIDs[gActiveBank]].invisible = gBattleBufferA[gActiveBank][1]; sub_8031F88(gActiveBank); diff --git a/src/battle/battle_controller_opponent.c b/src/battle/battle_controller_opponent.c index a35687796..54bb9d7f9 100644 --- a/src/battle/battle_controller_opponent.c +++ b/src/battle/battle_controller_opponent.c @@ -1,5 +1,6 @@ #include "global.h" #include "battle.h" +#include "battle_anim.h" #include "battle_interface.h" #include "data2.h" #include "battle_811DA74.h" @@ -22,7 +23,7 @@ #include "util.h" #include "ewram.h" -struct UnknownStruct3 +struct MovePpInfo { u16 moves[4]; u8 pp[4]; @@ -40,13 +41,12 @@ extern u8 gUnknown_0300434C[]; extern u8 gHealthboxIDs[]; extern u16 gBattleTypeFlags; extern u16 gTrainerBattleOpponent; -extern u32 *gDisableStructMoveAnim; -extern u32 gMoveDmgMoveAnim; -extern u16 gMovePowerMoveAnim; -extern u8 gHappinessMoveAnim; +extern u32 gAnimMoveDmg; +extern u16 gAnimMovePower; +extern u8 gAnimFriendship; extern u16 gWeatherMoveAnim; -extern u32 gPID_perBank[]; -extern u8 gUnknown_0202F7C4; +extern u32 gTransformedPersonalities[]; +extern u8 gAnimMoveTurn; extern u8 gAnimScriptActive; extern void (*gAnimScriptCallback)(void); extern struct Window gUnknown_03004210; @@ -65,7 +65,7 @@ extern struct MusicPlayerInfo gMPlay_SE2; extern struct MusicPlayerInfo gMPlay_BGM; extern u32 gBattleExecBuffer; -extern u8 sub_8077ABC(); +extern u8 GetBankPosition(); extern u8 sub_8077F68(); extern u8 sub_8079E90(); extern void sub_8033018(void); @@ -91,7 +91,7 @@ extern void sub_803311C(void); extern void sub_8010384(struct Sprite *); extern bool8 mplay_80342A4(u8); extern u8 sub_8031720(); -extern void ExecuteMoveAnim(); +extern void DoMoveAnim(); extern void sub_80326EC(); extern void sub_8031F24(void); extern void sub_80324BC(); @@ -114,7 +114,7 @@ extern void nullsub_45(void); extern void sub_8031B74(); extern bool8 IsDoubleBattle(void); extern void sub_8032E2C(void); -extern u8 AnimBankSpriteExists(); +extern u8 IsBankSpritePresent(); extern u8 move_anim_start_t3(); extern void sub_80334C0(void); @@ -560,7 +560,7 @@ void OpponentHandleGetAttributes(void) u32 sub_8033598(u8 a, u8 *buffer) { struct BattlePokemon battlePokemon; - struct UnknownStruct3 moveData; + struct MovePpInfo moveData; u8 nickname[20]; u8 *src; s16 data16; @@ -896,7 +896,7 @@ void OpponentHandleSetAttributes(void) void sub_8033E24(u8 a) { struct BattlePokemon *battlePokemon = (struct BattlePokemon *)&gBattleBufferA[gActiveBank][3]; - struct UnknownStruct3 *moveData = (struct UnknownStruct3 *)&gBattleBufferA[gActiveBank][3]; + struct MovePpInfo *moveData = (struct MovePpInfo *)&gBattleBufferA[gActiveBank][3]; s32 i; switch (gBattleBufferA[gActiveBank][1]) @@ -1127,7 +1127,7 @@ void OpponentHandleLoadPokeSprite(void) GetMonSpriteTemplate_803C56C(species, GetBankIdentity(gActiveBank)); gObjectBankIDs[gActiveBank] = CreateSprite( &gUnknown_02024E8C, - sub_8077ABC(gActiveBank, 2), + GetBankPosition(gActiveBank, 2), sub_8077F68(gActiveBank), sub_8079E90(gActiveBank)); gSprites[gObjectBankIDs[gActiveBank]].pos2.x = -240; @@ -1159,7 +1159,7 @@ void sub_803495C(u8 a, u8 b) GetMonSpriteTemplate_803C56C(species, GetBankIdentity(a)); gObjectBankIDs[a] = CreateSprite( &gUnknown_02024E8C, - sub_8077ABC(a, 2), + GetBankPosition(a, 2), sub_8077F68(a), sub_8079E90(a)); gSprites[gObjectBankIDs[a]].data[0] = a; @@ -1325,21 +1325,21 @@ void OpponentHandleMoveAnimation(void) u32 r0 = gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8); - gUnknown_0202F7C4 = gBattleBufferA[gActiveBank][3]; - gMovePowerMoveAnim = gBattleBufferA[gActiveBank][4] + gAnimMoveTurn = gBattleBufferA[gActiveBank][3]; + gAnimMovePower = gBattleBufferA[gActiveBank][4] | (gBattleBufferA[gActiveBank][5] << 8); - gMoveDmgMoveAnim = gBattleBufferA[gActiveBank][6] + gAnimMoveDmg = gBattleBufferA[gActiveBank][6] | (gBattleBufferA[gActiveBank][7] << 8) | (gBattleBufferA[gActiveBank][8] << 16) | (gBattleBufferA[gActiveBank][9] << 24); - gHappinessMoveAnim = gBattleBufferA[gActiveBank][10]; + gAnimFriendship = gBattleBufferA[gActiveBank][10]; gWeatherMoveAnim = gBattleBufferA[gActiveBank][12] | (gBattleBufferA[gActiveBank][13] << 8); - gDisableStructMoveAnim = (u32 *)&gBattleBufferA[gActiveBank][16]; - gPID_perBank[gActiveBank] = *gDisableStructMoveAnim; + gAnimDisableStructPtr = (struct DisableStruct *)&gBattleBufferA[gActiveBank][16]; + gTransformedPersonalities[gActiveBank] = gAnimDisableStructPtr->transformedMonPersonality; // Dead code. sub_8031720 always returns 0. - if (sub_8031720(r0, gUnknown_0202F7C4) != 0) + if (sub_8031720(r0, gAnimMoveTurn) != 0) { OpponentBufferExecCompleted(); } @@ -1371,7 +1371,7 @@ void sub_8035238(void) if (!ewram17810[gActiveBank].unk0_6) { sub_80326EC(0); - ExecuteMoveAnim(r4); + DoMoveAnim(r4); ewram17810[gActiveBank].unk4 = 2; } break; @@ -2003,7 +2003,7 @@ void OpponentHandlecmd50(void) void OpponentHandleSpriteInvisibility(void) { - if (AnimBankSpriteExists(gActiveBank) != 0) + if (IsBankSpritePresent(gActiveBank) != 0) { gSprites[gObjectBankIDs[gActiveBank]].invisible = gBattleBufferA[gActiveBank][1]; sub_8031F88(gActiveBank); diff --git a/src/battle/battle_controller_player.c b/src/battle/battle_controller_player.c index c2d34db0d..70773473d 100644 --- a/src/battle/battle_controller_player.c +++ b/src/battle/battle_controller_player.c @@ -1,6 +1,7 @@ #include "global.h" #include "data2.h" #include "battle.h" +#include "battle_anim.h" #include "battle_interface.h" #include "battle_message.h" #include "item.h" @@ -21,8 +22,7 @@ #include "util.h" #include "ewram.h" -//Possibly PokemonSubstruct1 -struct UnknownStruct3 +struct MovePpInfo { u16 moves[4]; u8 pp[4]; @@ -56,25 +56,24 @@ extern u16 gBattleTypeFlags; extern u8 gBattleOutcome; extern void (*gAnimScriptCallback)(void); extern bool8 gAnimScriptActive; -extern u16 gMovePowerMoveAnim; -extern u32 gMoveDmgMoveAnim; -extern u8 gHappinessMoveAnim; +extern u16 gAnimMovePower; +extern u32 gAnimMoveDmg; +extern u8 gAnimFriendship; extern u16 gWeatherMoveAnim; -extern u32 *gDisableStructMoveAnim; -extern u32 gPID_perBank[]; +extern u32 gTransformedPersonalities[]; extern u8 gBattleMonForms[]; extern u16 gUnknown_02024DE8; extern u8 gUnknown_02024E68[]; extern struct SpriteTemplate gUnknown_02024E8C; -extern u8 gUnknown_0202F7C4; +extern u8 gAnimMoveTurn; extern u8 gUnknown_02038470[]; extern u16 gUnknown_030041B0; -extern u16 gUnknown_030041B4; +extern u16 gBattle_BG1_Y; extern u16 gUnknown_030041B8; -extern u16 gUnknown_03004280; -extern u16 gUnknown_03004288; +extern u16 gBattle_BG2_Y; +extern u16 gBattle_BG2_X; extern u16 gUnknown_030042A4; -extern u16 gUnknown_030042C0; +extern u16 gBattle_BG1_X; extern u8 gUnknown_03004344; extern u8 gUnknown_0300434C[]; @@ -106,7 +105,7 @@ extern void StoreSpriteCallbackInData(); extern void BattleLoadPlayerMonSprite(); extern bool8 IsDoubleBattle(void); extern void sub_802D500(void); -extern bool8 AnimBankSpriteExists(u8); +extern bool8 IsBankSpritePresent(u8); extern bool8 move_anim_start_t3(); extern void sub_802E460(void); extern void b_link_standby_message(void); @@ -114,7 +113,7 @@ extern void sub_802D18C(void); extern void sub_802DF18(void); extern void BufferStringBattle(); extern void sub_80326EC(); -extern void ExecuteMoveAnim(); +extern void DoMoveAnim(); extern void sub_8031F24(void); extern void sub_80324BC(); extern u8 sub_8031720(); @@ -131,7 +130,7 @@ extern void sub_802D204(void); extern u8 sub_8079E90(); extern void sub_802DEAC(void); extern void sub_80312F0(struct Sprite *); -extern u8 sub_8077ABC(); +extern u8 GetBankPosition(); extern u8 sub_8077F68(); extern u8 sub_8046400(); extern void sub_802D798(void); @@ -606,7 +605,7 @@ void sub_802C2EC(void) } } -struct UnknownStruct1 +struct ChooseMoveStruct { u16 moves[4]; u8 pp[4]; @@ -621,7 +620,7 @@ const u8 gUnknown_081FAE80[] = _("{PALETTE 5}{COLOR_HIGHLIGHT_SHADOW WHITE LIGHT void sub_802C68C(void) { u32 r8 = 0; - struct UnknownStruct1 *r6 = (struct UnknownStruct1 *)(gBattleBufferA[gActiveBank] + 4); + struct ChooseMoveStruct *r6 = (struct ChooseMoveStruct *)(gBattleBufferA[gActiveBank] + 4); if (gMain.newKeys & A_BUTTON) { @@ -764,7 +763,7 @@ void sub_802CA60(void) u8 pp[4]; u8 filler18[8]; // what is this? } sp0; - //struct UnknownStruct1 sp0; + //struct ChooseMoveStruct sp0; u8 totalPPBonuses; if (gMain.newKeys & (A_BUTTON | SELECT_BUTTON)) @@ -772,7 +771,7 @@ void sub_802CA60(void) PlaySE(SE_SELECT); if (gMoveSelectionCursor[gActiveBank] != gUnknown_03004344) { - struct UnknownStruct1 *r9 = (struct UnknownStruct1 *)&gBattleBufferA[gActiveBank][4]; + struct ChooseMoveStruct *r9 = (struct ChooseMoveStruct *)&gBattleBufferA[gActiveBank][4]; s32 i; i = r9->moves[gMoveSelectionCursor[gActiveBank]]; @@ -1554,7 +1553,7 @@ void bx_blink_t1(void) void sub_802E12C(s32 a, const u8 *b) { - struct UnknownStruct1 *r4 = (struct UnknownStruct1 *)&gBattleBufferA[gActiveBank][4]; + struct ChooseMoveStruct *r4 = (struct ChooseMoveStruct *)&gBattleBufferA[gActiveBank][4]; StringCopy(gDisplayedStringBattle, b); StringAppend(gDisplayedStringBattle, gMoveNames[r4->moves[a]]); @@ -1569,7 +1568,7 @@ void sub_802E12C(s32 a, const u8 *b) void sub_802E1B0(void) { - struct UnknownStruct1 *r4 = (struct UnknownStruct1 *)&gBattleBufferA[gActiveBank][4]; + struct ChooseMoveStruct *r4 = (struct ChooseMoveStruct *)&gBattleBufferA[gActiveBank][4]; s32 i; gUnknown_03004348 = 0; @@ -1587,7 +1586,7 @@ void sub_802E220(void) { if (gBattleBufferA[gActiveBank][2] != 1) { - struct UnknownStruct1 *r4 = (struct UnknownStruct1 *)&gBattleBufferA[gActiveBank][4]; + struct ChooseMoveStruct *r4 = (struct ChooseMoveStruct *)&gBattleBufferA[gActiveBank][4]; u8 *str = gDisplayedStringBattle; str = StringCopy(str, BattleText_Format); @@ -1619,7 +1618,7 @@ void sub_802E2D4(void) } else { - struct UnknownStruct1 *r4 = (struct UnknownStruct1 *)&gBattleBufferA[gActiveBank][4]; + struct ChooseMoveStruct *r4 = (struct ChooseMoveStruct *)&gBattleBufferA[gActiveBank][4]; u8 *str = gDisplayedStringBattle; str = StringCopy(str, BattleText_Format); @@ -1731,7 +1730,7 @@ void PlayerHandleGetAttributes(void) u32 dp01_getattr_by_ch1_for_player_pokemon_(u8 a, u8 *buffer) { struct BattlePokemon battlePokemon; - struct UnknownStruct3 moveData; + struct MovePpInfo moveData; u8 nickname[20]; u8 *src; s16 data16; @@ -2068,7 +2067,7 @@ void PlayerHandleSetAttributes(void) void dp01_setattr_by_ch1_for_player_pokemon(u8 a) { struct BattlePokemon *battlePokemon = (struct BattlePokemon *)&gBattleBufferA[gActiveBank][3]; - struct UnknownStruct3 *moveData = (struct UnknownStruct3 *)&gBattleBufferA[gActiveBank][3]; + struct MovePpInfo *moveData = (struct MovePpInfo *)&gBattleBufferA[gActiveBank][3]; s32 i; switch (gBattleBufferA[gActiveBank][1]) @@ -2321,7 +2320,7 @@ void sub_802F934(u8 bank, u8 b) GetMonSpriteTemplate_803C56C(species, GetBankIdentity(bank)); gObjectBankIDs[bank] = CreateSprite( &gUnknown_02024E8C, - sub_8077ABC(bank, 2), + GetBankPosition(bank, 2), sub_8077F68(bank), sub_8079E90(bank)); gSprites[gUnknown_0300434C[bank]].data[1] = gObjectBankIDs[bank]; @@ -2490,14 +2489,14 @@ void PlayerHandleMoveAnimation(void) { u16 r0 = gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8); - gUnknown_0202F7C4 = gBattleBufferA[gActiveBank][3]; - gMovePowerMoveAnim = gBattleBufferA[gActiveBank][4] | (gBattleBufferA[gActiveBank][5] << 8); - gMoveDmgMoveAnim = gBattleBufferA[gActiveBank][6] | (gBattleBufferA[gActiveBank][7] << 8) | (gBattleBufferA[gActiveBank][8] << 16) | (gBattleBufferA[gActiveBank][9] << 24); - gHappinessMoveAnim = gBattleBufferA[gActiveBank][10]; + gAnimMoveTurn = gBattleBufferA[gActiveBank][3]; + gAnimMovePower = gBattleBufferA[gActiveBank][4] | (gBattleBufferA[gActiveBank][5] << 8); + gAnimMoveDmg = gBattleBufferA[gActiveBank][6] | (gBattleBufferA[gActiveBank][7] << 8) | (gBattleBufferA[gActiveBank][8] << 16) | (gBattleBufferA[gActiveBank][9] << 24); + gAnimFriendship = gBattleBufferA[gActiveBank][10]; gWeatherMoveAnim = gBattleBufferA[gActiveBank][12] | (gBattleBufferA[gActiveBank][13] << 8); - gDisableStructMoveAnim = (u32 *)&gBattleBufferA[gActiveBank][16]; - gPID_perBank[gActiveBank] = *gDisableStructMoveAnim; - if (sub_8031720(r0, gUnknown_0202F7C4) != 0) + gAnimDisableStructPtr = (struct DisableStruct *)&gBattleBufferA[gActiveBank][16]; + gTransformedPersonalities[gActiveBank] = gAnimDisableStructPtr->transformedMonPersonality; + if (sub_8031720(r0, gAnimMoveTurn) != 0) { // Dead code. sub_8031720 always returns 0. PlayerBufferExecCompleted(); @@ -2529,7 +2528,7 @@ void sub_8030190(void) if (ewram17810[gActiveBank].unk0_6 == 0) { sub_80326EC(0); - ExecuteMoveAnim(r4); + DoMoveAnim(r4); ewram17810[gActiveBank].unk4 = 2; } break; @@ -2990,7 +2989,7 @@ void PlayerHandlecmd50(void) void PlayerHandleSpriteInvisibility(void) { - if (AnimBankSpriteExists(gActiveBank)) + if (IsBankSpritePresent(gActiveBank)) { gSprites[gObjectBankIDs[gActiveBank]].invisible = gBattleBufferA[gActiveBank][1]; sub_8031F88(gActiveBank); diff --git a/src/battle/battle_controller_wally.c b/src/battle/battle_controller_wally.c index d81c43381..8ace11fc1 100644 --- a/src/battle/battle_controller_wally.c +++ b/src/battle/battle_controller_wally.c @@ -1,5 +1,6 @@ #include "global.h" #include "battle.h" +#include "battle_anim.h" #include "battle_interface.h" #include "battle_message.h" #include "data2.h" @@ -19,8 +20,7 @@ #include "util.h" #include "ewram.h" -//Possibly PokemonSubstruct1 -struct UnknownStruct3 +struct MovePpInfo { u16 moves[4]; u8 pp[4]; @@ -37,12 +37,11 @@ extern bool8 gDoingBattleAnim; extern u16 gBattlePartyID[]; extern u8 gHealthboxIDs[]; extern u16 gBattleTypeFlags; -extern u16 gMovePowerMoveAnim; -extern u32 gMoveDmgMoveAnim; -extern u8 gHappinessMoveAnim; +extern u16 gAnimMovePower; +extern u32 gAnimMoveDmg; +extern u8 gAnimFriendship; extern u16 gWeatherMoveAnim; -extern u32 *gDisableStructMoveAnim; -extern u32 gPID_perBank[]; +extern u32 gTransformedPersonalities[]; extern void (*gAnimScriptCallback)(void); extern bool8 gAnimScriptActive; extern u8 gDisplayedStringBattle[]; @@ -52,7 +51,7 @@ extern u8 gBattleOutcome; extern u16 gUnknown_02024DE8; extern u8 gUnknown_02024E68[]; extern struct SpriteTemplate gUnknown_02024E8C; -extern u8 gUnknown_0202F7C4; +extern u8 gAnimMoveTurn; extern struct Window gUnknown_03004210; extern u16 gUnknown_030042A0; extern u16 gUnknown_030042A4; @@ -78,7 +77,7 @@ extern u8 GetBankIdentity(u8); extern void sub_80313A0(struct Sprite *); extern u8 GetBankByPlayerAI(u8); extern u8 sub_8031720(); -extern void ExecuteMoveAnim(); +extern void DoMoveAnim(); extern void sub_80326EC(); extern void sub_8031F24(void); extern void sub_80324BC(); @@ -92,7 +91,7 @@ extern void sub_8078B34(struct Sprite *); extern void sub_8030E38(struct Sprite *); extern void StoreSpriteCallbackInData(); extern u8 sub_8046400(); -extern u8 sub_8077ABC(); +extern u8 GetBankPosition(); extern u8 sub_8077F68(); extern u8 sub_8079E90(); extern void sub_80312F0(struct Sprite *); @@ -528,7 +527,7 @@ void WallyHandleGetAttributes(void) u32 sub_8137A84(u8 a, u8 *buffer) { struct BattlePokemon battlePokemon; - struct UnknownStruct3 moveData; + struct MovePpInfo moveData; u8 nickname[20]; u8 *src; s16 data16; @@ -856,7 +855,7 @@ void WallyHandleSetAttributes(void) void sub_8138294(u8 a) { struct BattlePokemon *battlePokemon = (struct BattlePokemon *)&gBattleBufferA[gActiveBank][3]; - struct UnknownStruct3 *moveData = (struct UnknownStruct3 *)&gBattleBufferA[gActiveBank][3]; + struct MovePpInfo *moveData = (struct MovePpInfo *)&gBattleBufferA[gActiveBank][3]; s32 i; switch (gBattleBufferA[gActiveBank][1]) @@ -1171,16 +1170,16 @@ void WallyHandlePuase(void) void WallyHandleMoveAnimation(void) { - u16 r0 = gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8); + u16 move = gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8); - gUnknown_0202F7C4 = gBattleBufferA[gActiveBank][3]; - gMovePowerMoveAnim = gBattleBufferA[gActiveBank][4] | (gBattleBufferA[gActiveBank][5] << 8); - gMoveDmgMoveAnim = gBattleBufferA[gActiveBank][6] | (gBattleBufferA[gActiveBank][7] << 8) | (gBattleBufferA[gActiveBank][8] << 16) | (gBattleBufferA[gActiveBank][9] << 24); - gHappinessMoveAnim = gBattleBufferA[gActiveBank][10]; + gAnimMoveTurn = gBattleBufferA[gActiveBank][3]; + gAnimMovePower = gBattleBufferA[gActiveBank][4] | (gBattleBufferA[gActiveBank][5] << 8); + gAnimMoveDmg = gBattleBufferA[gActiveBank][6] | (gBattleBufferA[gActiveBank][7] << 8) | (gBattleBufferA[gActiveBank][8] << 16) | (gBattleBufferA[gActiveBank][9] << 24); + gAnimFriendship = gBattleBufferA[gActiveBank][10]; gWeatherMoveAnim = gBattleBufferA[gActiveBank][12] | (gBattleBufferA[gActiveBank][13] << 8); - gDisableStructMoveAnim = (u32 *)&gBattleBufferA[gActiveBank][16]; - gPID_perBank[gActiveBank] = *gDisableStructMoveAnim; - if (sub_8031720(r0, gUnknown_0202F7C4) != 0) + gAnimDisableStructPtr = (struct DisableStruct *)&gBattleBufferA[gActiveBank][16]; + gTransformedPersonalities[gActiveBank] = gAnimDisableStructPtr->transformedMonPersonality; + if (sub_8031720(move, gAnimMoveTurn) != 0) { // Dead code. sub_8031720 always returns 0. WallyBufferExecCompleted(); @@ -1211,7 +1210,7 @@ void sub_81390D0(void) if (ewram17810[gActiveBank].unk0_6 == 0) { sub_80326EC(0); - ExecuteMoveAnim(r4); + DoMoveAnim(r4); ewram17810[gActiveBank].unk4 = 2; } break; @@ -1511,7 +1510,7 @@ void sub_81398BC(u8 bank) GetMonSpriteTemplate_803C56C(species, GetBankIdentity(bank)); gObjectBankIDs[bank] = CreateSprite( &gUnknown_02024E8C, - sub_8077ABC(bank, 2), + GetBankPosition(bank, 2), sub_8077F68(bank), sub_8079E90(bank)); gSprites[gUnknown_0300434C[bank]].data[1] = gObjectBankIDs[bank]; diff --git a/src/battle/battle_interface.c b/src/battle/battle_interface.c index ea393277e..97568d254 100644 --- a/src/battle/battle_interface.c +++ b/src/battle/battle_interface.c @@ -583,7 +583,7 @@ void nullsub_11() { } -void sub_8043EB4(u8 priority) +void UpdateOamPriorityInAllHealthboxes(u8 priority) { s32 i; diff --git a/src/battle/battle_message.c b/src/battle/battle_message.c index 6faa3ace3..4ac8c7a6f 100644 --- a/src/battle/battle_message.c +++ b/src/battle/battle_message.c @@ -756,7 +756,7 @@ u32 StrCpyDecodeBattle(const u8* src, u8* dst) toCpy = gSaveBlock2.playerName; break; case 33: // ? - toCpy = sub_8082830(); + toCpy = GetTrainerLoseText(); break; case 34: // ? HANDLE_NICKNAME_STRING_CASE(BATTLE_STRUCT->scriptingActive, BATTLE_STRUCT->unk1605E) diff --git a/src/battle/battle_setup.c b/src/battle/battle_setup.c index f71aad090..b4ff407fc 100644 --- a/src/battle/battle_setup.c +++ b/src/battle/battle_setup.c @@ -802,7 +802,7 @@ static u8 GetTrainerBattleTransition(void) u8 enemyLevel; u8 playerLevel; - if (gTrainerBattleOpponent == 1024) // link battle? + if (gTrainerBattleOpponent == SECRET_BASE_OPPONENT) // link battle? return B_TRANSITION_STEVEN; trainer = gTrainers; @@ -858,7 +858,7 @@ static void CB2_GiveStarter(void) { u16 starterPoke; - *GetVarPointer(0x4023) = gSpecialVar_Result; + *GetVarPointer(VAR_STARTER_MON) = gSpecialVar_Result; starterPoke = GetStarterPokemon(gSpecialVar_Result); ScriptGiveMon(starterPoke, 5, 0, 0, 0, 0); ResetTasks(); @@ -915,20 +915,21 @@ static bool32 IsPlayerDefeated(u32 battleOutcome) { switch (battleOutcome) { - case 2: - case 3: + case BATTLE_LOST: + case BATTLE_DREW: return TRUE; - case 1: - case 4: - case 5: - case 6: - case 7: + case BATTLE_WON: + case BATTLE_RAN: + case BATTLE_PLAYER_TELEPORTED: + case BATTLE_POKE_FLED: + case BATTLE_CAUGHT: + return FALSE; + default: return FALSE; } - return FALSE; } -static void sub_80822BC(void) +static void ResetTrainerOpponentIds(void) { sTrainerBattleMode = 0; gTrainerBattleOpponent = 0; @@ -976,7 +977,7 @@ static void TrainerBattleLoadArgs(const struct TrainerBattleParameter *specs, co } } -static void battle_80801F0(void) +static void SetMapVarsToTrainer(void) { if (sTrainerMapObjectLocalId) { @@ -987,7 +988,7 @@ static void battle_80801F0(void) u8 *BattleSetup_ConfigureTrainerBattle(const u8 *data) { - sub_80822BC(); + ResetTrainerOpponentIds(); sTrainerBattleMode = TrainerBattleLoadArg8(data); switch (sTrainerBattleMode) @@ -997,31 +998,31 @@ u8 *BattleSetup_ConfigureTrainerBattle(const u8 *data) return gUnknown_0819F878; case 4: TrainerBattleLoadArgs(gTrainerBattleSpecs_2, data); - battle_80801F0(); + SetMapVarsToTrainer(); return gUnknown_0819F840; case 1: case 2: TrainerBattleLoadArgs(gTrainerBattleSpecs_1, data); - battle_80801F0(); + SetMapVarsToTrainer(); return gUnknown_0819F818; case 6: case 8: TrainerBattleLoadArgs(gTrainerBattleSpecs_4, data); - battle_80801F0(); + SetMapVarsToTrainer(); return gUnknown_0819F840; case 7: TrainerBattleLoadArgs(gTrainerBattleSpecs_2, data); - battle_80801F0(); - gTrainerBattleOpponent = sub_8082C4C(gTrainerBattleOpponent); + SetMapVarsToTrainer(); + gTrainerBattleOpponent = GetRematchTrainerId(gTrainerBattleOpponent); return gUnknown_0819F8AE; case 5: TrainerBattleLoadArgs(gTrainerBattleSpecs_0, data); - battle_80801F0(); - gTrainerBattleOpponent = sub_8082C4C(gTrainerBattleOpponent); + SetMapVarsToTrainer(); + gTrainerBattleOpponent = GetRematchTrainerId(gTrainerBattleOpponent); return gUnknown_0819F887; default: TrainerBattleLoadArgs(gTrainerBattleSpecs_0, data); - battle_80801F0(); + SetMapVarsToTrainer(); return gUnknown_0819F818; } } @@ -1073,12 +1074,12 @@ u8 HasTrainerAlreadyBeenFought(u16 flag) return FlagGet(TRAINER_FLAG_START + flag); } -void trainer_flag_set(u16 flag) +void SetTrainerFlag(u16 flag) { FlagSet(TRAINER_FLAG_START + flag); } -void trainer_flag_clear(u16 flag) +void ClearTrainerFlag(u16 flag) { FlagClear(TRAINER_FLAG_START + flag); } @@ -1086,14 +1087,14 @@ void trainer_flag_clear(u16 flag) void BattleSetup_StartTrainerBattle(void) { gBattleTypeFlags = BATTLE_TYPE_TRAINER; - gMain.savedCallback = sub_808260C; + gMain.savedCallback = CB2_EndTrainerBattle; StartTheBattle(); ScriptContext1_Stop(); } -void sub_808260C(void) +void CB2_EndTrainerBattle(void) { - if (gTrainerBattleOpponent == 1024) + if (gTrainerBattleOpponent == SECRET_BASE_OPPONENT) { SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music); // link battle? } @@ -1110,7 +1111,7 @@ void sub_808260C(void) void CB2_EndTrainerEyeRematchBattle(void) { - if (gTrainerBattleOpponent == 1024) + if (gTrainerBattleOpponent == SECRET_BASE_OPPONENT) { SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music); // link battle? } @@ -1231,12 +1232,12 @@ static const u8 *GetTrainerIntroSpeech(void) return SanitizeString(sTrainerIntroSpeech); } -u8 *sub_8082830(void) +u8 *GetTrainerLoseText(void) { const u8 *str; - if (gTrainerBattleOpponent == 1024) - str = sub_80BCCE8(); + if (gTrainerBattleOpponent == SECRET_BASE_OPPONENT) + str = GetSecretBaseTrainerLoseText(); else str = sTrainerDefeatSpeech; @@ -1254,7 +1255,7 @@ static const u8 *GetTrainerNonBattlingSpeech(void) return SanitizeString(sTrainerCannotBattleSpeech); } -s32 sub_8082894(const struct TrainerEyeTrainer *trainers, u16 opponentId) +s32 FirstBattleTrainerIdToRematchTableId(const struct TrainerEyeTrainer *trainers, u16 opponentId) { s32 i; @@ -1266,7 +1267,7 @@ s32 sub_8082894(const struct TrainerEyeTrainer *trainers, u16 opponentId) return -1; } -s32 sub_80828B8(const struct TrainerEyeTrainer *trainers, u16 opponentId) +s32 TrainerIdToRematchTableId(const struct TrainerEyeTrainer *trainers, u16 opponentId) { s32 i; s32 j; @@ -1312,7 +1313,7 @@ bool32 UpdateRandomTrainerEyeRematches(const struct TrainerEyeTrainer *trainers, return ret; } -s32 sub_80829A8(const struct TrainerEyeTrainer *trainers, u16 mapGroup, u16 mapNum) +s32 DoesSomeoneWantRematchIn_(const struct TrainerEyeTrainer *trainers, u16 mapGroup, u16 mapNum) { s32 i; @@ -1324,7 +1325,7 @@ s32 sub_80829A8(const struct TrainerEyeTrainer *trainers, u16 mapGroup, u16 mapN return 0; } -s32 sub_80829E8(const struct TrainerEyeTrainer *trainers, u16 mapGroup, u16 mapNum) +s32 IsRematchTrainerIn_(const struct TrainerEyeTrainer *trainers, u16 mapGroup, u16 mapNum) { s32 i; @@ -1336,9 +1337,9 @@ s32 sub_80829E8(const struct TrainerEyeTrainer *trainers, u16 mapGroup, u16 mapN return 0; } -bool8 sub_8082A18(const struct TrainerEyeTrainer *trainers, u16 opponentId) +bool8 IsFirstTrainerIdReadyForRematch(const struct TrainerEyeTrainer *trainers, u16 opponentId) { - s32 trainerEyeIndex = sub_8082894(trainers, opponentId); + s32 trainerEyeIndex = FirstBattleTrainerIdToRematchTableId(trainers, opponentId); if (trainerEyeIndex != -1 && trainerEyeIndex < 100 && gSaveBlock1.trainerRematches[trainerEyeIndex]) return TRUE; @@ -1348,7 +1349,7 @@ bool8 sub_8082A18(const struct TrainerEyeTrainer *trainers, u16 opponentId) bool8 GetTrainerEyeRematchFlag(const struct TrainerEyeTrainer *trainers, u16 opponentId) { - s32 trainerEyeIndex = sub_80828B8(trainers, opponentId); + s32 trainerEyeIndex = TrainerIdToRematchTableId(trainers, opponentId); if (trainerEyeIndex != -1 && trainerEyeIndex < 100 && gSaveBlock1.trainerRematches[trainerEyeIndex]) return TRUE; @@ -1356,11 +1357,11 @@ bool8 GetTrainerEyeRematchFlag(const struct TrainerEyeTrainer *trainers, u16 opp return FALSE; } -u16 sub_8082A90(const struct TrainerEyeTrainer *trainers, u16 opponentId) +u16 GetRematchTrainerIdFromTable(const struct TrainerEyeTrainer *trainers, u16 opponentId) { int i; const struct TrainerEyeTrainer *trainer; - s32 trainerEyeIndex = sub_8082894(trainers, opponentId); + s32 trainerEyeIndex = FirstBattleTrainerIdToRematchTableId(trainers, opponentId); if (trainerEyeIndex == -1) return 0; @@ -1377,15 +1378,15 @@ u16 sub_8082A90(const struct TrainerEyeTrainer *trainers, u16 opponentId) void ClearTrainerEyeRematchFlag(const struct TrainerEyeTrainer *trainers, u16 opponentId) { - s32 trainerEyeIndex = sub_80828B8(trainers, opponentId); + s32 trainerEyeIndex = TrainerIdToRematchTableId(trainers, opponentId); if (trainerEyeIndex != -1) gSaveBlock1.trainerRematches[trainerEyeIndex] = 0; } -bool8 sub_8082B10(const struct TrainerEyeTrainer *trainers, u16 opponentId) +bool8 WasSecondRematchWon(const struct TrainerEyeTrainer *trainers, u16 opponentId) { - s32 trainerEyeIndex = sub_8082894(trainers, opponentId); + s32 trainerEyeIndex = FirstBattleTrainerIdToRematchTableId(trainers, opponentId); if (trainerEyeIndex != -1 && HasTrainerAlreadyBeenFought(trainers[trainerEyeIndex].opponentIDs[1])) return TRUE; @@ -1393,7 +1394,7 @@ bool8 sub_8082B10(const struct TrainerEyeTrainer *trainers, u16 opponentId) return FALSE; } -bool32 sub_8082B44(void) +bool32 HasAtLeastFiveBadges(void) { int badgeCount = 0; u32 i; @@ -1410,9 +1411,9 @@ bool32 sub_8082B44(void) return FALSE; } -void sub_8082B78(void) +void IncrementRematchStepCounter(void) { - if (sub_8082B44()) + if (HasAtLeastFiveBadges()) { if (gSaveBlock1.trainerRematchStepCounter >= TRAINER_REMATCH_STEPS) gSaveBlock1.trainerRematchStepCounter = TRAINER_REMATCH_STEPS; @@ -1421,41 +1422,41 @@ void sub_8082B78(void) } } -bool32 sub_8082BA4(void) +bool32 IsRematchStepCounterMaxed(void) { - if (sub_8082B44() && gSaveBlock1.trainerRematchStepCounter >= TRAINER_REMATCH_STEPS) + if (HasAtLeastFiveBadges() && gSaveBlock1.trainerRematchStepCounter >= TRAINER_REMATCH_STEPS) return TRUE; else return FALSE; } -void sub_8082BD0(u16 mapGroup, u16 mapNum) +void TryUpdateRandomTrainerRematches(u16 mapGroup, u16 mapNum) { - if (sub_8082BA4() && UpdateRandomTrainerEyeRematches(gTrainerEyeTrainers, mapGroup, mapNum) == TRUE) + if (IsRematchStepCounterMaxed() && UpdateRandomTrainerEyeRematches(gTrainerEyeTrainers, mapGroup, mapNum) == TRUE) gSaveBlock1.trainerRematchStepCounter = 0; } -s32 sub_8082C0C(u16 mapGroup, u16 mapNum) +s32 DoesSomeoneWantRematchIn(u16 mapGroup, u16 mapNum) { - return sub_80829A8(gTrainerEyeTrainers, mapGroup, mapNum); + return DoesSomeoneWantRematchIn_(gTrainerEyeTrainers, mapGroup, mapNum); } -s32 unref_sub_8082C2C(u16 mapGroup, u16 mapNum) +s32 IsRematchTrainerIn(u16 mapGroup, u16 mapNum) { - return sub_80829E8(gTrainerEyeTrainers, mapGroup, mapNum); + return IsRematchTrainerIn_(gTrainerEyeTrainers, mapGroup, mapNum); } -u16 sub_8082C4C(u16 opponentId) +u16 GetRematchTrainerId(u16 opponentId) { - return sub_8082A90(gTrainerEyeTrainers, opponentId); + return GetRematchTrainerIdFromTable(gTrainerEyeTrainers, opponentId); } -s32 sub_8082C68(void) +bool8 ShouldTryRematchBattle(void) { - if (sub_8082A18(gTrainerEyeTrainers, gTrainerBattleOpponent)) + if (IsFirstTrainerIdReadyForRematch(gTrainerEyeTrainers, gTrainerBattleOpponent)) return 1; else - return sub_8082B10(gTrainerEyeTrainers, gTrainerBattleOpponent); + return WasSecondRematchWon(gTrainerEyeTrainers, gTrainerBattleOpponent); } u8 ScrSpecial_GetTrainerEyeRematchFlag(void) diff --git a/src/battle/pokeball.c b/src/battle/pokeball.c index 12fd5e5d9..bcaaebcda 100644 --- a/src/battle/pokeball.c +++ b/src/battle/pokeball.c @@ -376,8 +376,8 @@ static void sub_8046464(u8 taskId) gSprites[spriteId].callback = sub_8047074; break; case 0xFE: - gSprites[spriteId].pos1.x = sub_8077ABC(r5, 0); - gSprites[spriteId].pos1.y = sub_8077ABC(r5, 1) + 24; + gSprites[spriteId].pos1.x = GetBankPosition(r5, 0); + gSprites[spriteId].pos1.y = GetBankPosition(r5, 1) + 24; gBankTarget = r5; gSprites[spriteId].data[0] = 0; gSprites[spriteId].callback = sub_8047254; @@ -394,8 +394,8 @@ static void sub_8046464(u8 taskId) return; } gSprites[spriteId].data[0] = 0x22; - gSprites[spriteId].data[2] = sub_8077ABC(gBankTarget, 0); - gSprites[spriteId].data[4] = sub_8077ABC(gBankTarget, 1) - 16; + gSprites[spriteId].data[2] = GetBankPosition(gBankTarget, 0); + gSprites[spriteId].data[4] = GetBankPosition(gBankTarget, 1) - 16; gSprites[spriteId].data[5] = -40; sub_80786EC(&gSprites[spriteId]); gSprites[spriteId].oam.affineParam = taskId; @@ -830,8 +830,8 @@ static void sub_8046FBC(struct Sprite *sprite) static void sub_8047074(struct Sprite *sprite) { sprite->data[0] = 25; - sprite->data[2] = sub_8077ABC(sprite->data[6], 2); - sprite->data[4] = sub_8077ABC(sprite->data[6], 3) + 24; + sprite->data[2] = GetBankPosition(sprite->data[6], 2); + sprite->data[4] = GetBankPosition(sprite->data[6], 3) + 24; sprite->data[5] = -30; sprite->oam.affineParam = sprite->data[6]; sub_80786EC(sprite); diff --git a/src/battle/reshow_battle_screen.c b/src/battle/reshow_battle_screen.c index 03b5660fe..49b0854cc 100644 --- a/src/battle/reshow_battle_screen.c +++ b/src/battle/reshow_battle_screen.c @@ -11,12 +11,12 @@ extern struct SpriteTemplate gUnknown_02024E8C; extern struct Window gUnknown_03004210; -extern u16 gUnknown_03004280; -extern u16 gUnknown_03004288; +extern u16 gBattle_BG2_Y; +extern u16 gBattle_BG2_X; extern u16 gUnknown_030042A4; -extern u16 gUnknown_030042C0; +extern u16 gBattle_BG1_X; extern u16 gUnknown_030041B0; -extern u16 gUnknown_030041B4; +extern u16 gBattle_BG1_Y; extern u16 gUnknown_030041B8; extern u16 gUnknown_030042A0; extern u8 gReservedSpritePaletteCount; @@ -83,10 +83,10 @@ static void CB2_ReshowBattleScreenAfterMenu(void) InitWindowFromConfig(&gUnknown_03004210, &gWindowConfig_81E6C58); gUnknown_030042A4 = 0; gUnknown_030042A0 = 0; - gUnknown_030042C0 = 0; - gUnknown_030041B4 = 0; - gUnknown_03004288 = 0; - gUnknown_03004280 = 0; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + gBattle_BG2_X = 0; + gBattle_BG2_Y = 0; gUnknown_030041B0 = 0; gUnknown_030041B8 = 0; break; @@ -243,7 +243,7 @@ static void sub_807B184(u8 bank) if (GetMonData(&gEnemyParty[gBattlePartyID[bank]], MON_DATA_HP) == 0) return; GetMonSpriteTemplate_803C56C(GetMonData(&gEnemyParty[gBattlePartyID[bank]], MON_DATA_SPECIES), GetBankIdentity(bank)); - gObjectBankIDs[bank] = CreateSprite(&gUnknown_02024E8C, sub_8077ABC(bank, 2), posY, sub_8079E90(bank)); + gObjectBankIDs[bank] = CreateSprite(&gUnknown_02024E8C, GetBankPosition(bank, 2), posY, sub_8079E90(bank)); gSprites[gObjectBankIDs[bank]].oam.paletteNum = bank; gSprites[gObjectBankIDs[bank]].callback = SpriteCallbackDummy; gSprites[gObjectBankIDs[bank]].data[0] = bank; @@ -275,7 +275,7 @@ static void sub_807B184(u8 bank) if (GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_HP) == 0) return; GetMonSpriteTemplate_803C56C(GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_SPECIES), GetBankIdentity(bank)); - gObjectBankIDs[bank] = CreateSprite(&gUnknown_02024E8C, sub_8077ABC(bank, 2), posY, sub_8079E90(bank)); + gObjectBankIDs[bank] = CreateSprite(&gUnknown_02024E8C, GetBankPosition(bank, 2), posY, sub_8079E90(bank)); gSprites[gObjectBankIDs[bank]].oam.paletteNum = bank; gSprites[gObjectBankIDs[bank]].callback = SpriteCallbackDummy; gSprites[gObjectBankIDs[bank]].data[0] = bank; diff --git a/src/contest.c b/src/contest.c index 3aa3c8f59..f5aab709d 100644 --- a/src/contest.c +++ b/src/contest.c @@ -217,18 +217,18 @@ extern u8 gObjectBankIDs[]; extern u8 gIsLinkContest; extern u8 gContestPlayerMonIndex; extern u16 gUnknown_030041B0; -extern s16 gUnknown_030041B4; +extern s16 gBattle_BG1_Y; extern u16 gUnknown_030041B8; -extern u16 gUnknown_03004200; +extern u16 gBattle_WIN1H; extern struct Window gUnknown_03004210; -extern u16 gUnknown_03004240; -extern u16 gUnknown_03004244; -extern u16 gUnknown_03004280; -extern u16 gUnknown_03004288; +extern u16 gBattle_WIN0V; +extern u16 gBattle_WIN1V; +extern u16 gBattle_BG2_Y; +extern u16 gBattle_BG2_X; extern u16 gUnknown_030042A0; extern u16 gUnknown_030042A4; -extern u16 gUnknown_030042C0; -extern u16 gUnknown_030042C4; +extern u16 gBattle_BG1_X; +extern u16 gBattle_WIN0H; extern u32 gUnknown_03005D28; // saved RNG value extern s16 gUnknown_02038680[]; @@ -364,7 +364,7 @@ void sub_80AE6E4(u8, u8); u8 CreateJudgeSprite(void); u8 sub_80AE8B4(void); u8 sub_80AE9FC(u16, u32, u32); -bool8 sub_80AEB1C(u16); +bool8 IsSpeciesNotUnown(u16); void sub_80AEB30(void); void sub_80AEBEC(u16); void sub_80AED58(void); @@ -491,19 +491,19 @@ void ResetContestGpuRegs(void) gUnknown_030042A4 = 0; gUnknown_030042A0 = 0; - gUnknown_030042C0 = 0; - gUnknown_030041B4 = 0; - gUnknown_03004288 = 0; - gUnknown_03004280 = 0; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + gBattle_BG2_X = 0; + gBattle_BG2_Y = 0; gUnknown_030041B0 = 0; gUnknown_030041B8 = 0; - gUnknown_030042C4 = 0; - gUnknown_03004240 = 0; - gUnknown_03004200 = 0; - gUnknown_03004244 = 0; + gBattle_WIN0H = 0; + gBattle_WIN0V = 0; + gBattle_WIN1H = 0; + gBattle_WIN1V = 0; } -void sub_80AB2AC(void) +void LoadContestBgAfterMoveAnim(void) { s32 i; @@ -603,8 +603,8 @@ void CB2_StartContest(void) break; case 3: sub_80B2184(); - gUnknown_030042C0 = 0; - gUnknown_030041B4 = 0; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; BeginFastPaletteFade(2); gPaletteFade.bufferTransferDisabled = FALSE; SetVBlankCallback(ContestVBlankCallback); @@ -749,8 +749,8 @@ void sub_80AB9A0(u8 taskId) gTasks[taskId].data[0]++; break; case 1: - gUnknown_030041B4 += 7; - if (gUnknown_030041B4 <= 160) + gBattle_BG1_Y += 7; + if (gBattle_BG1_Y <= 160) break; gTasks[taskId].data[0]++; break; @@ -787,16 +787,16 @@ void ContestVBlankCallback(void) { REG_BG0HOFS = gUnknown_030042A4; REG_BG0VOFS = gUnknown_030042A0; - REG_BG1HOFS = gUnknown_030042C0; - REG_BG1VOFS = gUnknown_030041B4; - REG_BG2HOFS = gUnknown_03004288; - REG_BG2VOFS = gUnknown_03004280; + REG_BG1HOFS = gBattle_BG1_X; + REG_BG1VOFS = gBattle_BG1_Y; + REG_BG2HOFS = gBattle_BG2_X; + REG_BG2VOFS = gBattle_BG2_Y; REG_BG3HOFS = gUnknown_030041B0; REG_BG3VOFS = gUnknown_030041B8; - REG_WIN0H = gUnknown_030042C4; - REG_WIN0V = gUnknown_03004240; - REG_WIN1H = gUnknown_03004200; - REG_WIN1V = gUnknown_03004244; + REG_WIN0H = gBattle_WIN0H; + REG_WIN0V = gBattle_WIN0V; + REG_WIN1H = gBattle_WIN1H; + REG_WIN1V = gBattle_WIN1V; TransferPlttBuffer(); LoadOam(); ProcessSpriteCopyRequests(); @@ -806,7 +806,7 @@ void ContestVBlankCallback(void) void sub_80ABB70(u8 taskId) { gUnknown_030042A0 = 0; - gUnknown_03004280 = 0; + gBattle_BG2_Y = 0; sub_80B0D7C(); DmaCopy32Defvars(3, gPlttBufferUnfaded, shared18000.unk18204, 0x400); if (!Contest_IsMonsTurnDisabled(gContestPlayerMonIndex)) @@ -850,7 +850,7 @@ void sub_80ABCDC(u8 taskId) u8 sp8[32]; gUnknown_030042A0 = 0xA0; - gUnknown_03004280 = 0xA0; + gBattle_BG2_Y = 0xA0; FillWindowRect_DefaultPalette( &gUnknown_03004210, 0, @@ -938,7 +938,7 @@ void sub_80ABEA0(u8 taskId) StringExpandPlaceholders(gStringVar4, gDisplayedStringBattle); sub_8003460(&gMenuWindow, gStringVar4, 776, 1, 15); gUnknown_030042A0 = 0; - gUnknown_03004280 = 0; + gBattle_BG2_Y = 0; gTasks[taskId].func = sub_80ABC70; break; case DPAD_LEFT: @@ -1012,7 +1012,7 @@ void sub_80AC188(u8 taskId) { sub_80AF138(); gUnknown_030042A0 = 0; - gUnknown_03004280 = 0; + gBattle_BG2_Y = 0; sub_80AFFE0(FALSE); DmaCopy32Defvars(3, gPlttBufferFaded, shared18000.unk18604, 0x400); LoadPalette(shared18000.unk18204, 0, 0x400); @@ -1159,7 +1159,7 @@ void sub_80AC2CC(u8 taskId) sub_80B2790(sContest.unk19215); sub_80B28F0(sContest.unk19215); SelectContestMoveBankTarget(move); - ExecuteMoveAnim(move); + DoMoveAnim(move); gTasks[taskId].data[0] = 8; } return; @@ -1970,7 +1970,7 @@ void sub_80ADDA4(u8 taskId) s32 i; gUnknown_030042A0 = 0; - gUnknown_03004280 = 0; + gBattle_BG2_Y = 0; for (i = 0; i < 4; i++) gUnknown_02038680[i] = sContestantStatus[i].unk4; sub_80AF668(); @@ -1988,8 +1988,8 @@ void sub_80ADE54(u8 taskId) if (sub_80037A0(&gMenuWindow) == 1) { sub_80B2184(); - gUnknown_030042C0 = 0; - gUnknown_030041B4 = 160; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 160; PlaySE12WithPanning(SE_C_MAKU_D, 0); gTasks[taskId].data[0] = 0; gTasks[taskId].func = sub_80ADEAC; @@ -1998,10 +1998,10 @@ void sub_80ADE54(u8 taskId) void sub_80ADEAC(u8 taskId) { - gUnknown_030041B4 -= 7; - if (gUnknown_030041B4 < 0) - gUnknown_030041B4 = 0; - if (*(u16 *)&gUnknown_030041B4 == 0) // Why cast? + gBattle_BG1_Y -= 7; + if (gBattle_BG1_Y < 0) + gBattle_BG1_Y = 0; + if (*(u16 *)&gBattle_BG1_Y == 0) // Why cast? { gTasks[taskId].func = sub_80ADEEC; gTasks[taskId].data[0] = 0; @@ -2491,7 +2491,7 @@ u8 sub_80AE9FC(u16 species, u32 otId, u32 personality) gSprites[spriteId].callback = SpriteCallbackDummy; gSprites[spriteId].data[0] = gSprites[spriteId].oam.paletteNum; gSprites[spriteId].data[2] = species; - if (sub_80AEB1C(species)) + if (IsSpeciesNotUnown(species)) gSprites[spriteId].affineAnims = gSpriteAffineAnimTable_81E7C18; else gSprites[spriteId].affineAnims = gSpriteAffineAnimTable_81E7BEC; @@ -2499,7 +2499,7 @@ u8 sub_80AE9FC(u16 species, u32 otId, u32 personality) return spriteId; } -bool8 sub_80AEB1C(u16 species) +bool8 IsSpeciesNotUnown(u16 species) { if (species == SPECIES_UNOWN) return FALSE; @@ -3116,7 +3116,7 @@ bool8 sub_80AF828(s32 a, s32 b, struct UnknownContestStruct6 *c) void sub_80AF860(void) { gUnknown_030042A0 = 0; - gUnknown_03004280 = 0; + gBattle_BG2_Y = 0; sub_80AF138(); sub_8003460(&gMenuWindow, gUnknownText_LinkStandbyAndWinner, 776, 1, 15); } @@ -5113,8 +5113,8 @@ void sub_80B2184(void) ((vBgCnt *)®_BG1CNT)->screenSize = 1; ((vBgCnt *)®_BG1CNT)->areaOverflowMode = 0; - gUnknown_030042C0 = DISPLAY_WIDTH; - gUnknown_030041B4 = DISPLAY_HEIGHT; + gBattle_BG1_X = DISPLAY_WIDTH; + gBattle_BG1_Y = DISPLAY_HEIGHT; REG_BG1HOFS = DISPLAY_WIDTH; REG_BG1VOFS = DISPLAY_HEIGHT; @@ -5141,8 +5141,8 @@ void sub_80B2280(void) DmaClearLarge32(3, (void *)(VRAM + 0x8000), 0x2000, 0x1000); DmaClear32(3, (void *)(VRAM + 0xF000), 0x1000); - gUnknown_030042C0 = 0; - gUnknown_030041B4 = 0; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; ((vBgCnt *)®_BG1CNT)->priority = 1; ((vBgCnt *)®_BG1CNT)->screenSize = 0; @@ -5158,18 +5158,18 @@ void sub_80B2280(void) void sub_80B237C(u8 taskId) { - gUnknown_030042C0 = 0; - gUnknown_030041B4 = DISPLAY_HEIGHT; + gBattle_BG1_X = 0; + gBattle_BG1_Y = DISPLAY_HEIGHT; PlaySE12WithPanning(SE_C_MAKU_D, 0); gTasks[taskId].func = sub_80B23BC; } void sub_80B23BC(u8 taskId) { - gUnknown_030041B4 -= 7; - if (gUnknown_030041B4 < 0) - gUnknown_030041B4 = 0; - if (*(u16 *)&gUnknown_030041B4 == 0) // Why cast? + gBattle_BG1_Y -= 7; + if (gBattle_BG1_Y < 0) + gBattle_BG1_Y = 0; + if (*(u16 *)&gBattle_BG1_Y == 0) // Why cast? { gTasks[taskId].data[0] = 0; gTasks[taskId].data[1] = 0; @@ -5229,8 +5229,8 @@ void sub_80B2400(u8 taskId) void sub_80B2508(u8 taskId) { - gUnknown_030041B4 += 7; - if (gUnknown_030041B4 > DISPLAY_HEIGHT) + gBattle_BG1_Y += 7; + if (gBattle_BG1_Y > DISPLAY_HEIGHT) gTasks[taskId].func = sub_80ADCDC; } @@ -5340,16 +5340,16 @@ void sub_80B2790(u8 a) u8 r5_2; memset(&shared19348_, 0, sizeof(shared19348_)); - battle_anim_clear_some_data(); + ClearBattleAnimationVars(); for (i = 0; i < 4; i++) gBattleMonForms[i] = 0; switch (move) { case MOVE_CURSE: if (gBaseStats[species].type1 == TYPE_GHOST || gBaseStats[species].type2 == TYPE_GHOST) - gUnknown_0202F7C4 = 0; + gAnimMoveTurn = 0; else - gUnknown_0202F7C4 = 1; + gAnimMoveTurn = 1; break; case MOVE_TRANSFORM: case MOVE_ROLE_PLAY: @@ -5359,10 +5359,10 @@ void sub_80B2790(u8 a) shared19348_.unk4_0 = 1; break; case MOVE_RETURN: - gHappinessMoveAnim = 0xFF; + gAnimFriendship = 0xFF; break; case MOVE_FRUSTRATION: - gHappinessMoveAnim = 0; + gAnimFriendship = 0; break; case MOVE_SOLAR_BEAM: case MOVE_RAZOR_WIND: @@ -5371,11 +5371,11 @@ void sub_80B2790(u8 a) if (sContest.unk1925E == 0) { sContest.unk1925E = 2; - gUnknown_0202F7C4 = 0; + gAnimMoveTurn = 0; } else { - gUnknown_0202F7C4 = 1; + gAnimMoveTurn = 1; } break; } @@ -5410,8 +5410,8 @@ void sub_80B2968(void) sprite->pos2.x = 0; sprite->pos2.y = 0; - sprite->pos1.x = sub_8077ABC(3, 0); - sprite->pos1.y = sub_8077ABC(3, 1); + sprite->pos1.x = GetBankPosition(3, 0); + sprite->pos1.y = GetBankPosition(3, 1); sprite->invisible = TRUE; } @@ -5419,14 +5419,14 @@ void SelectContestMoveBankTarget(u16 move) { switch (gBattleMoves[move].target) { - case F_TARGET_UNK2: - case F_TARGET_USER: + case TARGET_UNK2: + case TARGET_USER: gBankTarget = 2; break; - case F_TARGET_SELECTED_POKEMON: - case F_TARGET_RANDOM: - case F_TARGET_BOTH_ENEMIES: - case F_TARGET_ALL_EXCEPT_USER: + case TARGET_SELECTED_POKEMON: + case TARGET_RANDOM: + case TARGET_BOTH_ENEMIES: + case TARGET_ALL_EXCEPT_USER: default: gBankTarget = 3; break; diff --git a/src/data/bard_music_de.h b/src/data/bard_music_de.h new file mode 100644 index 000000000..262fe26a3 --- /dev/null +++ b/src/data/bard_music_de.h @@ -0,0 +1,3699 @@ +#ifndef GUARD_DATA_BARD_MUSIC_H +#define GUARD_DATA_BARD_MUSIC_H + +static const struct BardSound BardMusic_POKEMON[][6] = { + { // ARMALDO + {0x02}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // BEAUTIFLY + {0x02}, {0x11}, {0x0B}, {0x02}, {0xFF}, {0xFF} + }, { // MEDITITE + {0x0B}, {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SEAKING + {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TORCHIC + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ANORITH + {0x02}, {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // ABSOL + {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SURSKIT + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // MASQUERAIN + {0x02}, {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // GEODUDE + {0x0B}, {0x11}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // ILLUMISE + {0x11}, {0x29}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // SKARMORY + {0x02}, {0x02}, {0x0B}, {0x1A}, {0xFF}, {0xFF} + }, { // SKITTY + {0x0B}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // DELCATTY + {0x0B}, {0x0B}, {0x1A}, {0x1A}, {0xFF}, {0xFF} + }, { // SWELLOW + {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GLALIE + {0x11}, {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // KYOGRE + {0x11}, {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // MACHAMP + {0x02}, {0x1A}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // PINSIR + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // KECLEON + {0x0B}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // SHUPPET + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SILCOON + {0x02}, {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // BRELOOM + {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SHROOMISH + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CARVANHA + {0x02}, {0x11}, {0x02}, {0x02}, {0xFF}, {0xFF} + }, { // TREECKO + {0x0B}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // WINGULL + {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GYARADOS + {0x02}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // NINETALES + {0x29}, {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // GIRAFARIG + {0x11}, {0x02}, {0x02}, {0x11}, {0xFF}, {0xFF} + }, { // KIRLIA + {0x11}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // BELLOSSOM + {0x29}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // KINGDRA + {0x0B}, {0x0B}, {0x02}, {0x11}, {0xFF}, {0xFF} + }, { // GLOOM + {0x29}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MAWILE + {0x29}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // GROUDON + {0x1A}, {0x29}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // MIGHTYENA + {0x02}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // CROBAT + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ABRA + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SLAKING + {0x0B}, {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // WURMPLE + {0x02}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // MAGIKARP + {0x02}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // MAGNEMITE + {0x02}, {0x0B}, {0x11}, {0x1A}, {0xFF}, {0xFF} + }, { // TORKOAL + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MACHOKE + {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GULPIN + {0x29}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ARON + {0x1A}, {0x29}, {0x11}, {0x1A}, {0xFF}, {0xFF} + }, { // PSYDUCK + {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LAIRON + {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WHISMUR + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // NUZLEAF + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // PHANPY + {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SHELGON + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GOLDUCK + {0x0B}, {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // GOLBAT + {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GOLEM + {0x0B}, {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // GRAVELER + {0x0B}, {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // GARDEVOIR + {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // RHYDON + {0x11}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // RHYHORN + {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GOREBYSS + {0x02}, {0x02}, {0x02}, {0x11}, {0xFF}, {0xFF} + }, { // CORSOLA + {0x1A}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // CACNEA + {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DUSCLOPS + {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SHARPEDO + {0x1A}, {0x02}, {0x11}, {0x1A}, {0xFF}, {0xFF} + }, { // ZANGOOSE + {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SANDSHREW + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SANDSLASH + {0x02}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SEADRA + {0x0B}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // RELICANTH + {0x0B}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // ZIGZAGOON + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CRAWDAUNT + {0x0B}, {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // SCEPTILE + {0x0B}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // GROVYLE + {0x0B}, {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // BANETTE + {0x02}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // JIRACHI + {0x11}, {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // STARMIE + {0x02}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // ZUBAT + {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TAILLOW + {0x02}, {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // WYNAUT + {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WOBBUFFET + {0x1A}, {0x11}, {0x0B}, {0x02}, {0x29}, {0xFF} + }, { // SOLROCK + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SHIFTRY + {0x0B}, {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // HORSEA + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // BAGON + {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SEEDOT + {0x02}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SPHEAL + {0x0B}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // BELDUM + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MEDICHAM + {0x0B}, {0x11}, {0x02}, {0x11}, {0xFF}, {0xFF} + }, { // CHINCHOU + {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CHIMECHO + {0x02}, {0x11}, {0x02}, {0x11}, {0xFF}, {0xFF} + }, { // ALTARIA + {0x02}, {0x02}, {0x11}, {0x02}, {0xFF}, {0xFF} + }, { // SWABLU + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // NINCADA + {0x11}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // DEOXYS + {0x0B}, {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // NINJASK + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DODUO + {0x1A}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DODRIO + {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // KOFFING + {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TENTACRUEL + {0x0B}, {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // DUSTOX + {0x29}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LOUDRED + {0x02}, {0x0B}, {0x0B}, {0x1A}, {0xFF}, {0xFF} + }, { // GOLDEEN + {0x1A}, {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // BARBOACH + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SEALEO + {0x0B}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // WALREIN + {0x02}, {0x02}, {0x11}, {0x02}, {0xFF}, {0xFF} + }, { // TROPIUS + {0x1A}, {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // DONPHAN + {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // NUMEL + {0x02}, {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // ODDISH + {0x11}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // TRAPINCH + {0x02}, {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // SLAKOTH + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WHISCASH + {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SHEDINJA + {0x11}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // MARSHTOMP + {0x1A}, {0x1A}, {0x02}, {0x0B}, {0xFF}, {0xFF} + }, { // NATU + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // XATU + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CLAYDOL + {0x0B}, {0x29}, {0x0B}, {0x02}, {0xFF}, {0xFF} + }, { // CACTURNE + {0x1A}, {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // NOSEPASS + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CLAMPERL + {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CAMERUPT + {0x02}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // EXPLOUD + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BLAZIKEN + {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LOMBRE + {0x1A}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // LOTAD + {0x1A}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SPINDA + {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SPOINK + {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SEVIPER + {0x11}, {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // HARIYAMA + {0x02}, {0x11}, {0x02}, {0x02}, {0xFF}, {0xFF} + }, { // VOLBEAT + {0x1A}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // HUNTAIL + {0x02}, {0x02}, {0x02}, {0x11}, {0xFF}, {0xFF} + }, { // PIKACHU + {0x11}, {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // PICHU + {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // STARYU + {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // VIBRAVA + {0x11}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // VOLTORB + {0x1A}, {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // FEEBAS + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ALAKAZAM + {0x11}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // GRUMPIG + {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WIGGLYTUFF + {0x29}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // IGGLYBUFF + {0x29}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // FLYGON + {0x11}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // PLUSLE + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // JIGGLYPUFF + {0x29}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // CORPHISH + {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GRIMER + {0x0B}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // MUK + {0x0B}, {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // HERACROSS + {0x02}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // PELIPPER + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // WAILORD + {0x02}, {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // WAILMER + {0x02}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SALAMENCE + {0x29}, {0x02}, {0x02}, {0x02}, {0xFF}, {0xFF} + }, { // AGGRON + {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // POOCHYENA + {0x11}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // CASTFORM + {0x1A}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // MINUN + {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MAGCARGO + {0x02}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // MAKUHITA + {0x02}, {0x29}, {0x11}, {0x02}, {0xFF}, {0xFF} + }, { // SLUGMA + {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WEEZING + {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LINOONE + {0x0B}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // CASCOON + {0x02}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // MARILL + {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AZUMARILL + {0x02}, {0x29}, {0x02}, {0x11}, {0xFF}, {0xFF} + }, { // SWALOT + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ELECTRODE + {0x0B}, {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // MUDKIP + {0x11}, {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // MILOTIC + {0x11}, {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // METAGROSS + {0x0B}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // METANG + {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TENTACOOL + {0x0B}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // BALTOY + {0x29}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SABLEYE + {0x1A}, {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // VIGOROTH + {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SNORUNT + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CRADILY + {0x11}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // KADABRA + {0x02}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // DUSKULL + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // RAICHU + {0x02}, {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // MANECTRIC + {0x1A}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // SWAMPERT + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ELECTRIKE + {0x11}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // LATIAS + {0x02}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // LATIOS + {0x02}, {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // LUVDISC + {0x11}, {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // VILEPLUME + {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // RALTS + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LANTURN + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LILEEP + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LUNATONE + {0x29}, {0x02}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // AZURILL + {0x02}, {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // LUDICOLO + {0x02}, {0x02}, {0x1A}, {0x0B}, {0xFF}, {0xFF} + }, { // MAGNETON + {0x02}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // REGICE + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // REGISTEEL + {0x0B}, {0x11}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // REGIROCK + {0x0B}, {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // RAYQUAZA + {0x02}, {0x11}, {0x02}, {0x02}, {0xFF}, {0xFF} + }, { // VULPIX + {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ROSELIA + {0x1A}, {0x0B}, {0x11}, {0x02}, {0xFF}, {0xFF} + }, { // COMBUSKEN + {0x29}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MACHOP + {0x02}, {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + } +}; + + +static const struct BardSound BardMusic_TRAINER[][6] = { + { // I CHOOSE YOU + {0x29}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // GOTCHA + {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TRADE + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SAPPHIRE + {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // EVOLVE + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // ENCYCLOPEDIA + {0x0B}, {0x11}, {0x1A}, {0x0B}, {0x11}, {0xFF} + }, { // NATURE + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CENTER + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // EGG + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LINK + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SP. ABILITY + {0x0B}, {0x11}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // TRAINER + {0x02}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // VERSION + {0x0B}, {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // POKéNAV + {0x1A}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // POKéMON + {0x1A}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // GET + {0x0B}, {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // POKéDEX + {0x1A}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // RUBY + {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LEVEL + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + } +}; + + +static const struct BardSound BardMusic_STATUS[][6] = { + { // DARK + {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // STENCH + {0x29}, {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // THICK FAT + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // RAIN DISH + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // DRIZZLE + {0x11}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // ARENA TRAP + {0x02}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // INTIMIDATE + {0x0B}, {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // ROCK HEAD + {0x0B}, {0x11}, {0x02}, {0x29}, {0xFF}, {0xFF} + }, { // COLOR + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ALT. COLOR + {0x02}, {0x0B}, {0x02}, {0x0B}, {0xFF}, {0xFF} + }, { // ROCK + {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // BEAUTIFUL + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BEAUTY + {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // AIR LOCK + {0x11}, {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // PSYCHIC + {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HYPER CUTTER + {0x0B}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // FIGHTING + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SHADOW TAG + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SMART + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SMARTNESS + {0x29}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SPEED BOOST + {0x0B}, {0x1A}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // COOL + {0x29}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // COOLNESS + {0x29}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // BATTLE ARMOR + {0x02}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // CUTE + {0x02}, {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // CUTENESS + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // STURDY + {0x1A}, {0x29}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // SUCTION CUPS + {0x02}, {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // GRASS + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CLEAR BODY + {0x0B}, {0x29}, {0x02}, {0x1A}, {0x1A}, {0xFF} + }, { // TORRENT + {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GHOST + {0x02}, {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // ICE + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GUTS + {0x02}, {0x0B}, {0x02}, {0x11}, {0xFF}, {0xFF} + }, { // ROUGH SKIN + {0x02}, {0x29}, {0x02}, {0x29}, {0xFF}, {0xFF} + }, { // SHELL ARMOR + {0x02}, {0x0B}, {0x02}, {0x29}, {0xFF}, {0xFF} + }, { // NATURAL CURE + {0x11}, {0x0B}, {0x0B}, {0x02}, {0xFF}, {0xFF} + }, { // DAMP + {0x0B}, {0x29}, {0x11}, {0x0B}, {0x11}, {0xFF} + }, { // GROUND + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LIMBER + {0x0B}, {0x11}, {0x11}, {0x11}, {0x0B}, {0xFF} + }, { // MAGNET PULL + {0x02}, {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // WHITE SMOKE + {0x29}, {0x0B}, {0x02}, {0x29}, {0xFF}, {0xFF} + }, { // SYNCHRONIZE + {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // OVERGROW + {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SWIFT SWIM + {0x02}, {0x0B}, {0x0B}, {0x1A}, {0xFF}, {0xFF} + }, { // SAND STREAM + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SAND VEIL + {0x02}, {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // KEEN EYE + {0x02}, {0x0B}, {0x02}, {0x29}, {0x0B}, {0xFF} + }, { // INNERFOCUS + {0x1A}, {0x0B}, {0x02}, {0x1A}, {0xFF}, {0xFF} + }, { // STATIC + {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TYPE + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TOUGH + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TOUGHNESS + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SHED SKIN + {0x0B}, {0x11}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // HUGE POWER + {0x02}, {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // VOLT ABSORB + {0x1A}, {0x02}, {0x1A}, {0x0B}, {0xFF}, {0xFF} + }, { // WATER ABSORB + {0x02}, {0x0B}, {0x11}, {0x1A}, {0x02}, {0x1A} + }, { // ELECTRIC + {0x0B}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // FORECAST + {0x1A}, {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SERENE GRACE + {0x0B}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // POISON + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // POISON POINT + {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DRAGON + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TRACE + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // OBLIVIOUS + {0x0B}, {0x11}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // TRUANT + {0x02}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // RUN AWAY + {0x02}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // STICKY HOLD + {0x0B}, {0x0B}, {0x02}, {0x0B}, {0xFF}, {0xFF} + }, { // CLOUD NINE + {0x1A}, {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // NORMAL + {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // STEEL + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ILLUMINATE + {0x0B}, {0x0B}, {0x29}, {0x29}, {0xFF}, {0xFF} + }, { // EARLY BIRD + {0x11}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // HUSTLE + {0x11}, {0x0B}, {0x0B}, {0x11}, {0x0B}, {0xFF} + }, { // SHINE + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // FLYING + {0x11}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // DROUGHT + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LIGHTNINGROD + {0x11}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // COMPOUNDEYES + {0x02}, {0x0B}, {0x0B}, {0x02}, {0x29}, {0xFF} + }, { // MARVEL SCALE + {0x1A}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WONDER GUARD + {0x29}, {0x0B}, {0x02}, {0x0B}, {0xFF}, {0xFF} + }, { // INSOMNIA + {0x11}, {0x1A}, {0x11}, {0x02}, {0xFF}, {0xFF} + }, { // LEVITATE + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // PLUS + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // PRESSURE + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // LIQUID OOZE + {0x1A}, {0x02}, {0x0B}, {0x1A}, {0x0B}, {0xFF} + }, { // COLOR CHANGE + {0x02}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SOUNDPROOF + {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // EFFECT SPORE + {0x1A}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // PKRS + {0x1A}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // FIRE + {0x0B}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // FLAME BODY + {0x02}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // MINUS + {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // OWN TEMPO + {0x0B}, {0x1A}, {0x02}, {0x0B}, {0xFF}, {0xFF} + }, { // MAGMA ARMOR + {0x02}, {0x02}, {0x02}, {0x0B}, {0xFF}, {0xFF} + }, { // WATER + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WATER VEIL + {0x02}, {0x02}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // BUG + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SWARM + {0x0B}, {0x02}, {0x02}, {0x02}, {0xFF}, {0xFF} + }, { // CUTE CHARM + {0x02}, {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // IMMUNITY + {0x11}, {0x29}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // BLAZE + {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // PICKUP + {0x11}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // PATTERN + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FLASH FIRE + {0x0B}, {0x29}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // VITAL SPIRIT + {0x29}, {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // CHLOROPHYLL + {0x1A}, {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // PURE POWER + {0x0B}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // SHIELD DUST + {0x29}, {0x0B}, {0x02}, {0x0B}, {0xFF}, {0xFF} + } +}; + + +static const struct BardSound BardMusic_BATTLE[][6] = { + { // MATCH UP + {0x02}, {0x1A}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // GO + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // NO. 1 + {0x29}, {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // DECIDE + {0x0B}, {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // LET ME WIN + {0x11}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // WINS + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // WIN + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // WON + {0x0B}, {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // IF I WIN + {0x0B}, {0x11}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // WHEN I WIN + {0x11}, {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // CAN’T WIN + {0x11}, {0x0B}, {0x29}, {0x0B}, {0x11}, {0xFF} + }, { // CAN WIN + {0x02}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // NO MATCH + {0x29}, {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // SPIRIT + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // DECIDED + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // TRUMP CARD + {0x29}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // TAKE THAT + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // COME ON + {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ATTACK + {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SURRENDER + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // GUTSY + {0x02}, {0x0B}, {0x02}, {0x11}, {0xFF}, {0xFF} + }, { // TALENT + {0x02}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // STRATEGY + {0x02}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SMITE + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MATCH + {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // VICTORY + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // OFFENSIVE + {0x1A}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SENSE + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // VERSUS + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FIGHTS + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // POWER + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CHALLENGE + {0x0B}, {0x02}, {0x29}, {0x1A}, {0x0B}, {0x29} + }, { // STRONG + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TOO STRONG + {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GO EASY + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FOE + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GENIUS + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LEGEND + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // ESCAPE + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AIM + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BATTLE + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FIGHT + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // RESUSCITATE + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // POINTS + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SERIOUS + {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GIVE UP + {0x02}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // LOSS + {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // IF I LOSE + {0x0B}, {0x11}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // LOST + {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LOSE + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // GUARD + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // PARTNER + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // REJECT + {0x02}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // ACCEPT + {0x02}, {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // INVINCIBLE + {0x29}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // RECEIVED + {0x0B}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // EASY + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WEAK + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TOO WEAK + {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // PUSHOVER + {0x02}, {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // LEADER + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // RULE + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MOVE + {0x02}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + } +}; + + +static const struct BardSound BardMusic_GREETINGS[][6] = { + { // THANKS + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // YES + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HERE GOES + {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HERE I COME + {0x11}, {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // HERE IT IS + {0x11}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // YEAH + {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WELCOME + {0x11}, {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // OI + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HOW DO + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CONGRATS + {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GIVE ME + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SORRY + {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // APOLOGIZE + {0x0B}, {0x0B}, {0x11}, {0x29}, {0xFF}, {0xFF} + }, { // FORGIVE + {0x1A}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HEY, THERE + {0x1A}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HELLO + {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GOOD-BYE + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THANK YOU + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // I’VE ARRIVED + {0x11}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // PARDON + {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // EXCUSE + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SEE YA + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // EXCUSE ME + {0x0B}, {0x29}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // WELL, THEN + {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GO AHEAD + {0x0B}, {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // APPRECIATE + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HEY? + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WHAT’S UP? + {0x02}, {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // HUH? + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // NO + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HI + {0x02}, {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // YEAH, YEAH + {0x0B}, {0x02}, {0x0B}, {0x02}, {0xFF}, {0xFF} + }, { // BYE-BYE + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MEET YOU + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HEY + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SMELL + {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LISTENING + {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HOO-HAH + {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // YAHOO + {0x29}, {0x29}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // YO + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // COME OVER + {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // COUNT ON + {0x0B}, {0x0B}, {0x02}, {0x29}, {0xFF}, {0xFF} + } +}; + + +static const struct BardSound BardMusic_PEOPLE[][6] = { + { // OPPONENT + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // I + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // YOU + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // YOURS + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SON + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // YOUR + {0x0B, 0xF7}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // YOU’RE + {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // YOU’VE + {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MOTHER + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GRANDFATHER + {0x1A}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // UNCLE + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FATHER + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BOY + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ADULT + {0x0B}, {0x02}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // BROTHER + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SISTER + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GRANDMOTHER + {0x1A}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // AUNT + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // PARENT + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MAN + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ME + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GIRL + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BABE + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FAMILY + {0x02}, {0x11}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // HER + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HIM + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HE + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // PLACE + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DAUGHTER + {0x1A}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // HIS + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HE’S + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AREN’T + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SIBLINGS + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // KID + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CHILDREN + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MR. + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MRS. + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MYSELF + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // I WAS + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TO ME + {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MY + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // I AM + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // I’VE + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WHO + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SOMEONE + {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WHO WAS + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // TO WHOM + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WHOSE + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WHO IS + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // IT’S + {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LADY + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FRIEND + {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ALLY + {0x0B}, {0x11}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // PERSON + {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DUDE + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THEY + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THEY WERE + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TO THEM + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THEIR + {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THEY’RE + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THEY’VE + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WE + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BEEN + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TO US + {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // OUR + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WE’RE + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // RIVAL + {0x11}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // WE’VE + {0x11}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // WOMAN + {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SHE + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SHE WAS + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TO HER + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HER’S + {0x0B}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SHE IS + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SOME + {0x11}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + } +}; + + +static const struct BardSound BardMusic_VOICES[][6] = { + { // ! + {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // !! + {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ?! + {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ? + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // … + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // …! + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // ……… + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // - + {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // - - - + {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // UH-OH + {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WAAAH + {0x02, 0x05, 0x08}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // AHAHA + {0x02}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // OH? + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // NOPE + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // URGH + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HMM + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WHOAH + {0x1A}, {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // WROOOAAR! + {0x1A}, {0x1A}, {0x1A}, {0x02}, {0xFF}, {0xFF} + }, { // WOW + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GIGGLE + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SIGH + {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // UNBELIEVABLE + {0x29}, {0x02}, {0x29}, {0x11}, {0xFF}, {0xFF} + }, { // CRIES + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AGREE + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // EH? + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CRY + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // EHEHE + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // OI, OI, OI + {0x1A}, {0x0B}, {0x1A}, {0x0B}, {0x1A}, {0x0B} + }, { // OH, YEAH + {0x1A}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // OH + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // OOPS + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SHOCKED + {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // EEK + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GRAAAH + {0x02}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // GWAHAHAHA + {0x02}, {0x02}, {0x02}, {0x02}, {0xFF}, {0xFF} + }, { // WAY + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TCH + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HEHE + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HAH + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // YUP + {0x02}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // HAHAHA + {0x02}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // AIYEEH + {0x02}, {0x11}, {0x11}, {0x0B}, {0x0B}, {0xFF} + }, { // HIYAH + {0x11}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // FUFUFU + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // LOL + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SNORT + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HUMPH + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HEHEHE + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // HEH + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HOHOHO + {0x1A}, {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // UH-HUH + {0x29}, {0x11}, {0x29}, {0x11}, {0xFF}, {0xFF} + }, { // OH, DEAR + {0x0B}, {0x11}, {0x0B}, {0x11}, {0x0B}, {0xFF} + }, { // ARRGH + {0x02}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // MUFUFU + {0x11}, {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // MMM + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // OH-KAY + {0x1A}, {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // OKAY + {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LALALA + {0x02}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // YAY + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AWW + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WOWEE + {0x29}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // GWAH + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WAHAHAHA + {0x02}, {0x02}, {0x02}, {0x02}, {0xFF}, {0xFF} + } +}; + + +static const struct BardSound BardMusic_SPEECH[][6] = { + { // LISTEN + {0x29}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // NOT VERY + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MEAN + {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // LIE + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LAY + {0x0B}, {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // RECOMMEND + {0x0B}, {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // NITWIT + {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // QUITE + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FROM + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FEELING + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BUT + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HOWEVER + {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CASE + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THE + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MISS + {0x02}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // HOW + {0x0B}, {0x02}, {0x29}, {0x11}, {0xFF}, {0xFF} + }, { // HIT + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ENOUGH + {0x0B}, {0x11}, {0x02}, {0x29}, {0xFF}, {0xFF} + }, { // A LOT + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // A LITTLE + {0x0B}, {0x11}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // ABSOLUTELY + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AND + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ONLY + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AROUND + {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // PROBABLY + {0x0B}, {0x0B}, {0x29}, {0x0B}, {0xFF}, {0xFF} + }, { // IF + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // VERY + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // A TINY BIT + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WILD + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THAT’S + {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // JUST + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // EVEN SO, {0x0C}, {0x0B}, {0x1A}, {0x33}, {0xFF}, {0xFF} + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MUST BE + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // NATURALLY + {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // FOR NOW, {0x1A}, {0x23}, {0xFF}, {0x33}, {0xFF}, {0xFF} + {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // UNDERSTOOD + {0x0B}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // JOKING + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // READY + {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SOMETHING + {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SOMEHOW + {0x11}, {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // ALTHOUGH + {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ALSO + {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // PERFECT + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AS MUCH AS + {0x1A}, {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // REALLY + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TRULY + {0x02}, {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SERIOUSLY + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TOTALLY + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // UNTIL + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AS IF + {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MOOD + {0x02}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // RATHER + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AWFULLY + {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MODE + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MORE + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TOO LATE + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FINALLY + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ANY + {0x11}, {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // INSTEAD + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FANTASTIC + {0x02}, {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF} + } +}; + + +static const struct BardSound BardMusic_ENDINGS[][6] = { + { // WILL + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WILL BE HERE + {0x11}, {0x02}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // OR + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TIMES + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // WONDER + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // IS IT? + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BE + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GIMME + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // COULD + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LIKELY TO + {0x0B}, {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // WOULD + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // IS + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ISN’T IT? + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LET’S + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // OTHER + {0x02}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // ARE + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WAS + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WERE + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THOSE + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ISN’T + {0x11}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // WON’T + {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // CAN’T + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CAN + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DON’T + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DO + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DOES + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WHOM + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WHICH + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WASN’T + {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WEREN’T + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HAVE + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HAVEN’T + {0x02}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // A + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AN + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // NOT + {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THERE + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // OK? + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SO + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MAYBE + {0x11}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // ABOUT + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // OVER + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // IT + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ALL + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FOR + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ON + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // OFF + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AS + {0x0B}, {0x02}, {0x29}, {0x1A}, {0xFF}, {0xFF} + }, { // TO + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WITH + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BETTER + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // EVER + {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SINCE + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // OF + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // BELONGS TO + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AT + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // IN + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // OUT + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TOO + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LIKE + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DID + {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DIDN’T + {0x11}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // DOESN’T + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WITHOUT + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AFTER + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BEFORE + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WHILE + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THAN + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ONCE + {0x0B}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // ANYWHERE + {0x11}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + } +}; + + +static const struct BardSound BardMusic_FEELINGS[][6] = { + { // MEET + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // PLAY + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HURRIED + {0x0B}, {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // GOES + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GIDDY + {0x11}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // HAPPY + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HAPPINESS + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // EXCITE + {0x0B}, {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // IMPORTANT + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FUNNY + {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GOT + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GO HOME + {0x0B}, {0x11}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // DISAPPOINTED + {0x0B}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // DISAPPOINTS + {0x0B}, {0x0B}, {0x29}, {0x0B}, {0xFF}, {0xFF} + }, { // SAD + {0x02}, {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // TRY + {0x29}, {0x29}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // TRIES + {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HEARS + {0x29}, {0x0B}, {0x02}, {0x29}, {0x0B}, {0xFF} + }, { // THINK + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HEAR + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WANTS + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MISHEARD + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DISLIKE + {0x11}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // ANGRY + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ANGER + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SCARY + {0x29}, {0x0B}, {0x11}, {0x11}, {0xFF}, {0xFF} + }, { // LONESOME + {0x0B}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // DISAPPOINT + {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // JOY + {0x0B}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // GETS + {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // NEVER + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DARN + {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DOWNCAST + {0x0B}, {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // INCREDIBLE + {0x02}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // LIKES + {0x1A}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // DISLIKES + {0x02}, {0x0B}, {0x11}, {0x29}, {0xFF}, {0xFF} + }, { // BORING + {0x02}, {0x0B}, {0x11}, {0x11}, {0xFF}, {0xFF} + }, { // CARE + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CARES + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ALL RIGHT + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ADORE + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // DISASTER + {0x0B}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // ENJOY + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // ENJOYS + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // EAT + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LACKING + {0x29}, {0x29}, {0x0B}, {0x11}, {0x0B}, {0xFF} + }, { // BAD + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HARD + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TERRIBLE + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SHOULD + {0x11}, {0x0B}, {0x02}, {0x29}, {0x0B}, {0xFF} + }, { // NICE + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DRINK + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SURPRISE + {0x11}, {0x0B}, {0x02}, {0x29}, {0xFF}, {0xFF} + }, { // FEAR + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WANT + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WAIT + {0x02}, {0x0B}, {0x0B}, {0x11}, {0x0B}, {0xFF} + }, { // SATISFIED + {0x29}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SEE + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // RARE + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // NEGATIVE + {0x0B}, {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // DONE + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DANGER + {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DEFEATED + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BEAT + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GREAT + {0x1A}, {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // ROMANTIC + {0x1A}, {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // QUESTION + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // UNDERSTAND + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // UNDERSTANDS + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + } +}; + + +static const struct BardSound BardMusic_CONDITIONS[][6] = { + { // HOT + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // EXISTS + {0x0B}, {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // EXCESS + {0x11}, {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // APPROVED + {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // HAS + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GOOD + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LESS + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // MOMENTUM + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GOING + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WEIRD + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BUSY + {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // TOGETHER + {0x29}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // FULL + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ABSENT + {0x02}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // BEING + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // NEED + {0x02}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // TASTY + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SKILLED + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // NOISY + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BIG + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LATE + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CLOSE + {0x02}, {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // DOCILE + {0x02}, {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // AMUSING + {0x02}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // ENTERTAINING + {0x29}, {0x0B}, {0x02}, {0x02}, {0xFF}, {0xFF} + }, { // PERFECTION + {0x0B}, {0x0B}, {0x11}, {0x1A}, {0xFF}, {0xFF} + }, { // PRETTY + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HEALTHY + {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // EXCELLENT + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // UPSIDE DOWN + {0x29}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // COLD + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // REFRESHING + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // UNAVOIDABLE + {0x29}, {0x0B}, {0x0B}, {0x11}, {0x02}, {0xFF} + }, { // MUCH + {0x11}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // OVERWHELMING + {0x11}, {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // FABULOUS + {0x02}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // ELSE + {0x02}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // EXPENSIVE + {0x0B}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // CORRECT + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // IMPOSSIBLE + {0x29}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SMALL + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DIFFERENT + {0x0B}, {0x11}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // TIRED + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SKILL + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TOP + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // NON-STOP + {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // PREPOSTEROUS + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // NONE + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // NOTHING + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // NATURAL + {0x02}, {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // BECOMES + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LUKEWARM + {0x02}, {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // FAST + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LOW + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AWFUL + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ALONE + {0x02}, {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // BORED + {0x0B}, {0x02}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // SECRET + {0x0B}, {0x0B}, {0x11}, {0x11}, {0xFF}, {0xFF} + }, { // MYSTERY + {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // LACKS + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BEST + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LOUSY + {0x02}, {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // MISTAKE + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // KIND + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WELL + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WEAKENED + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SIMPLE + {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SEEMS + {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BADLY + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + } +}; + + +static const struct BardSound BardMusic_ACTIONS[][6] = { + { // MEETS + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CONCEDE + {0x0B}, {0x11}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // GIVE + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GIVES + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // PLAYED + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // PLAYS + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // COLLECT + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WALKING + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WALKS + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SAYS + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WENT + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SAID + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WAKE UP + {0x02}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // WAKES UP + {0x02}, {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // ANGERS + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TEACH + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TEACHES + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // PLEASE + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LEARN + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CHANGE + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // STORY + {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TRUST + {0x0B}, {0x02}, {0x29}, {0x0B}, {0xFF}, {0xFF} + }, { // LAVISH + {0x1A}, {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // LISTENS + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HEARING + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TRAINS + {0x02}, {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // CHOOSE + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // COME + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CAME + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SEARCH + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MAKE + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CAUSE + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // KNOW + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // KNOWS + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // REFUSE + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // STORES + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BRAG + {0x02}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // IGNORANT + {0x11}, {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // THINKS + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BELIEVE + {0x02}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SLIDE + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // EATS + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // USE + {0x0B}, {0x02}, {0x29}, {0x0B}, {0xFF}, {0xFF} + }, { // USES + {0x0B}, {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // USING + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // COULDN’T + {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // CAPABLE + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DISAPPEAR + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // APPEAR + {0x0B}, {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // THROW + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WORRY + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SLEPT + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SLEEP + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // RELEASE + {0x0B}, {0x11}, {0x02}, {0x0B}, {0xFF}, {0xFF} + }, { // DRINKS + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // RUNS + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // RUN + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WORKS + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WORKING + {0x02}, {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // TALKING + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TALK + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SINK + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SMACK + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // PRETEND + {0x1A}, {0x0B}, {0x29}, {0x0B}, {0xFF}, {0xFF} + }, { // PRAISE + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // OVERDO + {0x11}, {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // SHOW + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // LOOKS + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SEES + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SEEK + {0x0B}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // OWN + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // TAKE + {0x0B}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // ALLOW + {0x0B}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // FORGET + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // FORGETS + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // APPEARS + {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // FAINT + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // FAINTED + {0x02}, {0x29}, {0x0B}, {0x11}, {0xFF}, {0xFF} + } +}; + + +static const struct BardSound BardMusic_LIFESTYLE[][6] = { + { // CHORES + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HOME + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MONEY + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ALLOWANCE + {0x02}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // BATH + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CONVERSATION + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SCHOOL + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // COMMEMORATE + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // HABIT + {0x0B}, {0x1A}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // GROUP + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WORD + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // STORE + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SERVICE + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WORK + {0x02}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SYSTEM + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TRAIN + {0x02}, {0x11}, {0x11}, {0x0B}, {0x0B}, {0xFF} + }, { // CLASS + {0x0B}, {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // LESSONS + {0x29}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // INFORMATION + {0x11}, {0x1A}, {0x02}, {0x11}, {0x1A}, {0xFF} + }, { // LIVING + {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // TEACHER + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TOURNAMENT + {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LETTER + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // EVENT + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // DIGITAL + {0x11}, {0x11}, {0x02}, {0x0B}, {0xFF}, {0xFF} + }, { // TEST + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DEPT. STORE + {0x02}, {0x29}, {0x02}, {0x29}, {0xFF}, {0xFF} + }, { // TELEVISION + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // PHONE + {0x0B}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // ITEM + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // NAME + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // NEWS + {0x0B}, {0x29}, {0x11}, {0x0B}, {0x11}, {0x0B} + }, { // POPULAR + {0x1A}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // PARTY + {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // STUDY + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MACHINE + {0x02}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // MAIL + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MESSAGE + {0x11}, {0x0B}, {0x11}, {0x29}, {0xFF}, {0xFF} + }, { // PROMISE + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // DREAM + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // KINDERGARTEN + {0x11}, {0x0B}, {0x02}, {0x0B}, {0xFF}, {0xFF} + }, { // LIFE + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // RADIO + {0x02}, {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // RENTAL + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WORLD + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + } +}; + + +static const struct BardSound BardMusic_HOBBIES[][6] = { + { // IDOL + {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ANIME + {0x02}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SONG + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MOVIE + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SWEETS + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CHAT + {0x02}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // CHILD’S PLAY + {0x11}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // TOYS + {0x11}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // MUSIC + {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CARDS + {0x02}, {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // SHOPPING + {0x0B}, {0x11}, {0x02}, {0x29}, {0x0B}, {0xFF} + }, { // CAMERA + {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // VIEWING + {0x0B}, {0x11}, {0x11}, {0x29}, {0xFF}, {0xFF} + }, { // SPECTATOR + {0x29}, {0x02}, {0x29}, {0x0B}, {0xFF}, {0xFF} + }, { // GOURMET + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GAME + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // RPG + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // COLLECTION + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // COMPLETE + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MAGAZINE + {0x02}, {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // WALK + {0x02}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // BIKE + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HOBBY + {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SPORTS + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SOFTWARE + {0x1A}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SONGS + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DIET + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TREASURE + {0x1A}, {0x02}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // TRAVEL + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // DANCE + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CHANNEL + {0x02}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // MAKING + {0x0B}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // FISHING + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DATE + {0x0B}, {0x02}, {0x0B}, {0x29}, {0xFF}, {0xFF} + }, { // DESIGN + {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // LOCOMOTIVE + {0x1A}, {0x1A}, {0x1A}, {0x11}, {0x0B}, {0xFF} + }, { // PLUSH DOLL + {0x11}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // PC + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FLOWERS + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HERO + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // NAP + {0x11}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // HEROINE + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FASHION + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ADVENTURE + {0x02}, {0x0B}, {0x0B}, {0x29}, {0x0B}, {0xFF} + }, { // BOARD + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // BALL + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BOOK + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FESTIVAL + {0x0B}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // COMICS + {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HOLIDAY + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // PLANS + {0x0B}, {0x02}, {0x02}, {0x0B}, {0xFF}, {0xFF} + }, { // TRENDY + {0x11}, {0x11}, {0x11}, {0x11}, {0xFF}, {0xFF} + }, { // VACATION + {0x29}, {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // LOOK + {0x02}, {0x29}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + } +}; + + +static const struct BardSound BardMusic_TIME[][6] = { + { // FALL + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MORNING + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TOMORROW + {0x11}, {0x0B}, {0x1A}, {0x0B}, {0xFF}, {0xFF} + }, { // LAST + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DAY + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SOMETIME + {0x11}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // ALWAYS + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CURRENT + {0x1A}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // FOREVER + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DAYS + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // END + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TUESDAY + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // YESTERDAY + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TODAY + {0x0B}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // FRIDAY + {0x0B}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // MONDAY + {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LATER + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // EARLIER + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ANOTHER + {0x02}, {0x02}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // TIME + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FINISH + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WEDNESDAY + {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SOON + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // START + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MONTH + {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // STOP + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // NOW + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FINAL + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // NEXT + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AGE + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SATURDAY + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SUMMER + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SUNDAY + {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BEGINNING + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SPRING + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DAYTIME + {0x02}, {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // WINTER + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DAILY + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // OLDEN + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ALMOST + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // NEARLY + {0x0B}, {0x11}, {0x02}, {0x0B}, {0xFF}, {0xFF} + }, { // THURSDAY + {0x1A}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // NIGHTTIME + {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // NIGHT + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WEEK + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + } +}; + + +static const struct BardSound BardMusic_MISC[][6] = { + { // HIGHS + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LOWS + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // UM + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // REAR + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THINGS + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THING + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BELOW + {0x29}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // ABOVE + {0x1A}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // BACK + {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HIGH + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HERE + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // INSIDE + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // OUTSIDE + {0x02}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // BESIDE + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THIS IS IT! + {0x02}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // THIS + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // EVERY + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THESE + {0x11}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // THESE WERE + {0x11}, {0x0B}, {0x02}, {0x0B}, {0xFF}, {0xFF} + }, { // DOWN + {0x11}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // THAT + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THOSE ARE + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THOSE WERE + {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THAT’S IT! + {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AM + {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THAT WAS + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FRONT + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // UP + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CHOICE + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FAR + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AWAY + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // NEAR + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WHERE + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WHEN + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WHAT + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DEEP + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SHALLOW + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WHY + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CONFUSED + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // OPPOSITE + {0x0B}, {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // LEFT + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // RIGHT + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + } +}; + + +static const struct BardSound BardMusic_ADJECTIVES[][6] = { + { // WANDERING + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // RICKETY + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ROCK-SOLID + {0x0B}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // HUNGRY + {0x02}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // TIGHT + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TICKLISH + {0x11}, {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // TWIRLING + {0x0B}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SPIRALING + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THIRSTY + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LOLLING + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SILKY + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SADLY + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HOPELESS + {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // USELESS + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DROOLING + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // EXCITING + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THICK + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SMOOTH + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SLIMY + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THIN + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BREAK + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // VORACIOUS + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SCATTER + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AWESOME + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WIMPY + {0x02}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // WOBBLY + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SHAKY + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // RIPPED + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SHREDDED + {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // INCREASING + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // YET + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // DESTROYED + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FIERY + {0x11}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // LOVEY-DOVEY + {0x29}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // HAPPILY + {0x0B}, {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // ANTICIPATION + {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + } +}; + + +static const struct BardSound BardMusic_EVENTS[][6] = { + { // APPEAL + {0x02}, {0x29}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // EVENTS + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // STAY-AT-HOME + {0x02}, {0x11}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // BERRY + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // CONTEST + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // MC + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // JUDGE + {0x29}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SUPER + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // STAGE + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HALL OF FAME + {0x29}, {0x0B}, {0x02}, {0x0B}, {0xFF}, {0xFF} + }, { // EVOLUTION + {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HYPER + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BATTLE TOWER + {0x29}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // LEADERS + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // BATTLE ROOM + {0x02}, {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // HIDDEN + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SECRET BASE + {0x0B}, {0x0B}, {0x11}, {0x02}, {0x11}, {0xFF} + }, { // BLEND + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // POKEBLOCK + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MASTER + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // RANK + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // RIBBON + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + } +}; + + +static const struct BardSound BardMusic_MOVE_1[][6] = { + { // THUNDERBOLT + {0x1A}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // IRON_TAIL + {0x0B}, {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // ICE_BALL + {0x1A}, {0x0B}, {0x29}, {0x0B}, {0xFF}, {0xFF} + }, { // YAWN + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LOVELY_KISS + {0x1A}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // NIGHTMARE + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MORNING_SUN + {0x1A}, {0x0B}, {0x02}, {0x29}, {0x0B}, {0xFF} + }, { // VITAL_THROW + {0x11}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // DIG + {0x02}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // THRASH + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SWEET_SCENT + {0x1A}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CHARM + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // RAIN_DANCE + {0x0B}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // CONFUSE_RAY + {0x1A}, {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // HAIL + {0x02}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // AROMATHERAPY + {0x02}, {0x1A}, {0x02}, {0x29}, {0xFF}, {0xFF} + }, { // BUBBLE + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ENCORE + {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CUT + {0x0B}, {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // RAGE + {0x02}, {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // SUPER_FANG + {0x29}, {0x0B}, {0x02}, {0x02}, {0xFF}, {0xFF} + }, { // PAIN_SPLIT + {0x0B}, {0x11}, {0x0B}, {0x11}, {0x0B}, {0xFF} + }, { // TORMENT + {0x1A}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // STRING_SHOT + {0x02}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // SWAGGER + {0x02}, {0x0B}, {0x0B}, {0x0B}, {0x11}, {0xFF} + }, { // SNORE + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HEAL_BELL + {0x11}, {0x02}, {0x1A}, {0x0B}, {0xFF}, {0xFF} + }, { // SCREECH + {0x0B}, {0x11}, {0x0B}, {0x0B}, {0x11}, {0xFF} + }, { // ROCK_THROW + {0x0B}, {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // ROCK_SMASH + {0x0B}, {0x11}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // ROCK_SLIDE + {0x0B}, {0x11}, {0x02}, {0x0B}, {0xFF}, {0xFF} + }, { // WEATHER_BALL + {0x0B}, {0x0B}, {0x1A}, {0x1A}, {0x1A}, {0x0B} + }, { // WHIRLPOOL + {0x11}, {0x29}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // FAKE_TEARS + {0x29}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SING + {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SPITE + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AIR_CUTTER + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AEROBLAST + {0x29}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SMOKESCREEN + {0x02}, {0x29}, {0x1A}, {0x0B}, {0xFF}, {0xFF} + }, { // PURSUIT + {0x0B}, {0x1A}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // DOUBLE_SLAP + {0x29}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // MIRROR_MOVE + {0x11}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // OVERHEAT + {0x11}, {0x0B}, {0x1A}, {0x0B}, {0xFF}, {0xFF} + }, { // AURORA_BEAM + {0x02}, {0x29}, {0x1A}, {0x02}, {0x02}, {0xFF} + }, { // MEMENTO + {0x0B}, {0x0B}, {0x1A}, {0x1A}, {0x11}, {0xFF} + }, { // OCTAZOOKA + {0x1A}, {0x02}, {0x29}, {0x29}, {0x02}, {0xFF} + }, { // FLATTER + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // ASTONISH + {0x0B}, {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // WILL_O_WISP + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // RETURN + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GRUDGE + {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // STRENGTH + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // COUNTER + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FLAME_WHEEL + {0x02}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // FLAMETHROWER + {0x02}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // ODOR_SLEUTH + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SHARPEN + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DOUBLE_TEAM + {0x1A}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // GUST + {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HARDEN + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DISABLE + {0x02}, {0x29}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // RAZOR_WIND + {0x11}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // BIDE + {0x0B}, {0x02}, {0x29}, {0x0B}, {0xFF}, {0xFF} + }, { // CRUNCH + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BITE + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THUNDER + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // THUNDER_PUNCH + {0x1A}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // ENDEAVOR + {0x1A}, {0x11}, {0x29}, {0x02}, {0x11}, {0x1A} + }, { // FACADE + {0x02}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // KARATE_CHOP + {0x02}, {0x02}, {0x0B}, {0x02}, {0xFF}, {0xFF} + }, { // CLAMP + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WITHDRAW + {0x02}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // CONSTRICT + {0x29}, {0x02}, {0x0B}, {0x29}, {0xFF}, {0xFF} + }, { // BRICK_BREAK + {0x29}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ROCK_TOMB + {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FOCUS_ENERGY + {0x0B}, {0x0B}, {0x11}, {0x1A}, {0x29}, {0xFF} + }, { // FOCUS_PUNCH + {0x02}, {0x29}, {0x0B}, {0x02}, {0xFF}, {0xFF} + }, { // GIGA_DRAIN + {0x11}, {0x02}, {0x02}, {0x29}, {0x0B}, {0xFF} + }, { // REVERSAL + {0x0B}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // SMELLING_SALT + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SPORE + {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LEECH_LIFE + {0x29}, {0x02}, {0x29}, {0x0B}, {0xFF}, {0xFF} + }, { // SLASH + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SILVER_WIND + {0x11}, {0x0B}, {0x02}, {0x29}, {0xFF}, {0xFF} + }, { // METAL_SOUND + {0x0B}, {0x02}, {0x02}, {0x29}, {0xFF}, {0xFF} + }, { // GRASS_WHISTLE + {0x02}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // TICKLE + {0x02}, {0x02}, {0x1A}, {0x0B}, {0xFF}, {0xFF} + }, { // SPIDER_WEB + {0x11}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // CRABHAMMER + {0x02}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // HAZE + {0x29}, {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // MEAN_LOOK + {0x1A}, {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // CROSS_CHOP + {0x0B}, {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // OUTRAGE + {0x29}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // LOW_KICK + {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ANCIENT_POWER + {0x02}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // SYNTHESIS + {0x11}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // AGILITY + {0x02}, {0x11}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // RAPID_SPIN + {0x29}, {0x1A}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // ICY_WIND + {0x0B}, {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // MIND_READER + {0x11}, {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // COSMIC_POWER + {0x1A}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // SKY_ATTACK + {0x11}, {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // POWDER_SNOW + {0x29}, {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // FOLLOW_ME + {0x1A}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // METEOR_MASH + {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // ENDURE + {0x02}, {0x29}, {0x02}, {0x29}, {0xFF}, {0xFF} + }, { // ROLLOUT + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SCARY_FACE + {0x11}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // PSYBEAM + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // PSYWAVE + {0x11}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // PSYCHIC + {0x11}, {0x1A}, {0x11}, {0x0B}, {0x0B}, {0xFF} + }, { // HYPNOSIS + {0x11}, {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // UPROAR + {0x02}, {0x29}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // WATER_SPOUT + {0x1A}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SIGNAL_BEAM + {0x02}, {0x0B}, {0x0B}, {0x29}, {0x0B}, {0xFF} + }, { // PSYCH_UP + {0x11}, {0x1A}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // SUBMISSION + {0x11}, {0x0B}, {0x1A}, {0x0B}, {0xFF}, {0xFF} + }, { // RECOVER + {0x0B}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // EARTHQUAKE + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // NATURE_POWER + {0x02}, {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // LICK + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FLAIL + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // TAIL_WHIP + {0x29}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // SELF_DESTRUCT + {0x11}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // STUN_SPORE + {0x02}, {0x0B}, {0x1A}, {0x0B}, {0xFF}, {0xFF} + }, { // BIND + {0x02}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SHADOW_PUNCH + {0x11}, {0x0B}, {0x02}, {0x29}, {0xFF}, {0xFF} + }, { // SHADOW_BALL + {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CHARGE + {0x02}, {0x0B}, {0x1A}, {0x02}, {0xFF}, {0xFF} + }, { // MIST + {0x0B}, {0x11}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // FISSURE + {0x0B}, {0x1A}, {0x11}, {0x29}, {0xFF}, {0xFF} + }, { // EXTREME_SPEED + {0x29}, {0x1A}, {0x0B}, {0x1A}, {0xFF}, {0xFF} + }, { // EXTRASENSORY + {0x1A}, {0x0B}, {0x0B}, {0x1A}, {0xFF}, {0xFF} + }, { // SAFEGUARD + {0x1A}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // ABSORB + {0x02}, {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SKY_UPPERCUT + {0x11}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SKILL_SWAP + {0x0B}, {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // SKETCH + {0x02}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // HEADBUTT + {0x1A}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DOUBLE_EDGE + {0x11}, {0x11}, {0x1A}, {0x02}, {0x0B}, {0xFF} + }, { // SANDSTORM + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SAND_ATTACK + {0x02}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SAND_TOMB + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SPARK + {0x29}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // SWIFT + {0x0B}, {0x02}, {0x29}, {0x0B}, {0xFF}, {0xFF} + }, { // KINESIS + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SMOG + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GROWTH + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SACRED_FIRE + {0x0B}, {0x29}, {0x0B}, {0x0B}, {0x29}, {0x0B} + }, { // SHEER_COLD + {0x0B}, {0x11}, {0x0B}, {0x0B}, {0x0B}, {0xFF} + }, { // SOLAR_BEAM + {0x1A}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // SONIC_BOOM + {0x29}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // FLY + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + } +}; + + +static const struct BardSound BardMusic_MOVE_2[][6] = { + { // TACKLE + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // EXPLOSION + {0x0B}, {0x1A}, {0x11}, {0x1A}, {0xFF}, {0xFF} + }, { // DIVE + {0x02}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // FIRE_BLAST + {0x0B}, {0x29}, {0x0B}, {0x29}, {0xFF}, {0xFF} + }, { // WATERFALL + {0x02}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // MUDDY_WATER + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // STOCKPILE + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SLAM + {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TWISTER + {0x11}, {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // BULLET_SEED + {0x29}, {0x0B}, {0x02}, {0x02}, {0xFF}, {0xFF} + }, { // TWINEEDLE + {0x29}, {0x1A}, {0x02}, {0x0B}, {0xFF}, {0xFF} + }, { // SOFT_BOILED + {0x0B}, {0x11}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // EGG_BOMB + {0x0B}, {0x11}, {0x0B}, {0x1A}, {0x0B}, {0xFF} + }, { // FAINT_ATTACK + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BARRAGE + {0x02}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // MINIMIZE + {0x1A}, {0x11}, {0x02}, {0x1A}, {0xFF}, {0xFF} + }, { // SEISMIC_TOSS + {0x0B}, {0x1A}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // SUPERSONIC + {0x29}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // TAUNT + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // MOONLIGHT + {0x1A}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // PECK + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ARM_THRUST + {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HORN_ATTACK + {0x1A}, {0x02}, {0x02}, {0x0B}, {0xFF}, {0xFF} + }, { // HORN_DRILL + {0x1A}, {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // WING_ATTACK + {0x11}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // AERIAL_ACE + {0x02}, {0x0B}, {0x1A}, {0x02}, {0xFF}, {0xFF} + }, { // SWORDS_DANCE + {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // VINE_WHIP + {0x02}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // CONVERSION + {0x29}, {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // CONVERSION_2 + {0x29}, {0x02}, {0x29}, {0x0B}, {0x11}, {0xFF} + }, { // HELPING_HAND + {0x0B}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // IRON_DEFENSE + {0x0B}, {0x11}, {0x0B}, {0x02}, {0x0B}, {0xFF} + }, { // TELEPORT + {0x0B}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // THUNDER_SHOCK + {0x1A}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // SHOCK_WAVE + {0x1A}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // QUICK_ATTACK + {0x29}, {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SWEET_KISS + {0x11}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // THUNDER_WAVE + {0x1A}, {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // ZAP_CANNON + {0x11}, {0x02}, {0x1A}, {0x0B}, {0xFF}, {0xFF} + }, { // BLOCK + {0x11}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // HOWL + {0x02}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // POISON_GAS + {0x11}, {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // TOXIC + {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // POISON_FANG + {0x11}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // POISON_POWDER + {0x11}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // POISON_STING + {0x11}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SPIKE_CANNON + {0x1A}, {0x02}, {0x1A}, {0x0B}, {0xFF}, {0xFF} + }, { // ACID_ARMOR + {0x0B}, {0x29}, {0x0B}, {0x02}, {0x0B}, {0xFF} + }, { // TAKE_DOWN + {0x1A}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // JUMP_KICK + {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BOUNCE + {0x29}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // HI_JUMP_KICK + {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TRI_ATTACK + {0x11}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // DRAGON_CLAW + {0x02}, {0x0B}, {0x02}, {0x29}, {0x0B}, {0xFF} + }, { // TRICK + {0x11}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // TRIPLE_KICK + {0x0B}, {0x11}, {0x02}, {0x11}, {0xFF}, {0xFF} + }, { // DRILL_PECK + {0x1A}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // MUD_SPORT + {0x0B}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // MUD_SLAP + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // THIEF + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AMNESIA + {0x02}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // NIGHT_SHADE + {0x02}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // GROWL + {0x0B}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SLACK_OFF + {0x02}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SURF + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ROLE_PLAY + {0x1A}, {0x0B}, {0x02}, {0x29}, {0xFF}, {0xFF} + }, { // NEEDLE_ARM + {0x11}, {0x0B}, {0x02}, {0x0B}, {0xFF}, {0xFF} + }, { // DOUBLE_KICK + {0x1A}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SUNNY_DAY + {0x1A}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // LEER + {0x11}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // WISH + {0x29}, {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // FAKE_OUT + {0x1A}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SLEEP_TALK + {0x02}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // PAY_DAY + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ASSIST + {0x29}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HEAT_WAVE + {0x11}, {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // SLEEP_POWDER + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // REST + {0x0B}, {0x1A}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // INGRAIN + {0x0B}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // CONFUSION + {0x1A}, {0x29}, {0x11}, {0x1A}, {0xFF}, {0xFF} + }, { // BODY_SLAM + {0x1A}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // SWALLOW + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // CURSE + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HYDRO_PUMP + {0x11}, {0x1A}, {0x29}, {0x0B}, {0xFF}, {0xFF} + }, { // HYPER_VOICE + {0x02}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // HYPER_BEAM + {0x11}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // SUPERPOWER + {0x02}, {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // STEEL_WING + {0x02}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SPIT_UP + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // DYNAMIC_PUNCH + {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GUILLOTINE + {0x11}, {0x1A}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // VICE_GRIP + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // KNOCK_OFF + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // POUND + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // RAZOR_LEAF + {0x02}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // BATON_PASS + {0x02}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // PETAL_DANCE + {0x0B}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // SPLASH + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BUBBLE_BEAM + {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BELLY_DRUM + {0x02}, {0x29}, {0x1A}, {0x0B}, {0xFF}, {0xFF} + }, { // BARRIER + {0x02}, {0x11}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // LIGHT_SCREEN + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SCRATCH + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HYPER_FANG + {0x11}, {0x0B}, {0x02}, {0x02}, {0xFF}, {0xFF} + }, { // EMBER + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SECRET_POWER + {0x0B}, {0x0B}, {0x11}, {0x02}, {0x29}, {0x0B} + }, { // DIZZY_PUNCH + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BULK_UP + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // IMPRISON + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // FEATHER_DANCE + {0x02}, {0x29}, {0x0B}, {0x0B}, {0x11}, {0x0B} + }, { // WHIRLWIND + {0x11}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // BEAT_UP + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BLIZZARD + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // STOMP + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FLASH + {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TEETER_DANCE + {0x02}, {0x29}, {0x0B}, {0x02}, {0xFF}, {0xFF} + }, { // CRUSH_CLAW + {0x0B}, {0x02}, {0x02}, {0x29}, {0x0B}, {0xFF} + }, { // BLAZE_KICK + {0x0B}, {0x29}, {0x0B}, {0x0B}, {0x0B}, {0xFF} + }, { // PRESENT + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ERUPTION + {0x0B}, {0x29}, {0x11}, {0x1A}, {0xFF}, {0xFF} + }, { // SLUDGE + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SLUDGE_BOMB + {0x02}, {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // GLARE + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TRANSFORM + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // POISON_TAIL + {0x11}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // ROAR + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BONE_RUSH + {0x1A}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // CAMOUFLAGE + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // COVET + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // TAIL_GLOW + {0x0B}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // BONE_CLUB + {0x1A}, {0x0B}, {0x0B}, {0x29}, {0x0B}, {0xFF} + }, { // BONEMERANG + {0x1A}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // FIRE_SPIN + {0x0B}, {0x29}, {0x0B}, {0x11}, {0x0B}, {0xFF} + }, { // FIRE_PUNCH + {0x0B}, {0x29}, {0x0B}, {0x02}, {0xFF}, {0xFF} + }, { // PERISH_SONG + {0x02}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // WRAP + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SPIKES + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MAGNITUDE + {0x11}, {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // MAGICAL_LEAF + {0x02}, {0x29}, {0x0B}, {0x02}, {0xFF}, {0xFF} + }, { // MAGIC_COAT + {0x02}, {0x11}, {0x02}, {0x0B}, {0xFF}, {0xFF} + }, { // MUD_SHOT + {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MACH_PUNCH + {0x0B}, {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // PROTECT + {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DEFENSE_CURL + {0x0B}, {0x11}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // ROLLING_KICK + {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SUBSTITUTE + {0x0B}, {0x0B}, {0x02}, {0x1A}, {0xFF}, {0xFF} + }, { // DETECT + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // PIN_MISSILE + {0x02}, {0x0B}, {0x02}, {0x0B}, {0x0B}, {0xFF} + }, { // WATER_SPORT + {0x02}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // WATER_GUN + {0x02}, {0x02}, {0x02}, {0x0B}, {0xFF}, {0xFF} + }, { // MIST_BALL + {0x0B}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // WATER_PULSE + {0x02}, {0x02}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // FURY_ATTACK + {0x29}, {0x11}, {0x0B}, {0x02}, {0xFF}, {0xFF} + }, { // FURY_SWIPES + {0x02}, {0x29}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // DESTINY_BOND + {0x02}, {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // FALSE_SWIPE + {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FORESIGHT + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // MIRROR_COAT + {0x11}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // FUTURE_SIGHT + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MILK_DRINK + {0x11}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // CALM_MIND + {0x0B}, {0x02}, {0x0B}, {0x29}, {0xFF}, {0xFF} + }, { // MEGA_DRAIN + {0x0B}, {0x02}, {0x02}, {0x29}, {0x0B}, {0xFF} + }, { // MEGA_KICK + {0x0B}, {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // MEGA_PUNCH + {0x0B}, {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // MEGAHORN + {0x11}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // HIDDEN_POWER + {0x02}, {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // METAL_CLAW + {0x0B}, {0x02}, {0x02}, {0x29}, {0x0B}, {0xFF} + }, { // ATTRACT + {0x02}, {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // MIMIC + {0x11}, {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // FRUSTRATION + {0x29}, {0x02}, {0x11}, {0x1A}, {0xFF}, {0xFF} + }, { // LEECH_SEED + {0x0B}, {0x0B}, {0x02}, {0x0B}, {0xFF}, {0xFF} + }, { // METRONOME + {0x0B}, {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // DREAM_EATER + {0x02}, {0x29}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // ACID + {0x0B}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // MEDITATE + {0x0B}, {0x11}, {0x02}, {0x11}, {0x1A}, {0xFF} + }, { // SNATCH + {0x11}, {0x0B}, {0x02}, {0x0B}, {0xFF}, {0xFF} + }, { // LUSTER_PURGE + {0x0B}, {0x11}, {0x0B}, {0x0B}, {0xFF}, {0xFF} + }, { // LEAF_BLADE + {0x02}, {0x29}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // RECYCLE + {0x02}, {0x29}, {0x0B}, {0x0B}, {0x11}, {0x29} + }, { // REFLECT + {0x0B}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // REFRESH + {0x0B}, {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // REVENGE + {0x0B}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // DRAGON_RAGE + {0x02}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // DRAGON_BREATH + {0x0B}, {0x29}, {0x1A}, {0x0B}, {0xFF}, {0xFF} + }, { // DRAGON_DANCE + {0x02}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // ICE_PUNCH + {0x0B}, {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // ICE_BEAM + {0x0B}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // FURY_CUTTER + {0x1A}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // COMET_PUNCH + {0x1A}, {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // SKULL_BASH + {0x0B}, {0x0B}, {0x29}, {0x0B}, {0xFF}, {0xFF} + }, { // LOCK_ON + {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ROCK_BLAST + {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // COTTON_SPORE + {0x02}, {0x29}, {0x1A}, {0x02}, {0x02}, {0xFF} + }, { // STRUGGLE + {0x0B}, {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF} + } +}; + + +static const struct BardSound BardMusic_TRENDY_SAYING[][6] = { + { // KTHX, BYE. + {0x1A}, {0x29}, {0x11}, {0x02}, {0xFF}, {0xFF} + }, { // YES, SIR! + {0x0B}, {0x11}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // AVANT GARDE + {0x02}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // COUPLE + {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MUCH OBLIGED + {0x11}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // YEEHAW! + {0x11}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // MEGA + {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // 1-HIT KO! + {0x29}, {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // DESTINY + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CANCEL + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // NEW + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FLATTEN + {0x0B}, {0x0B}, {0x0B}, {0x0B}, {0x0B}, {0xFF} + }, { // KIDDING + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LOSER + {0x29}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // LOSING + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HAPPENING + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HIP AND + {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SHAKE + {0x02}, {0x02}, {0x0B}, {0x02}, {0xFF}, {0xFF} + }, { // SHADY + {0x1A}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // UPBEAT + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MODERN + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SMELL YA + {0x11}, {0x0B}, {0x02}, {0x0B}, {0xFF}, {0xFF} + }, { // BANG + {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // KNOCKOUT + {0x11}, {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // HASSLE + {0x02}, {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // WINNER + {0x0B}, {0x29}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // FEVER + {0x0B}, {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // WANNABE + {0x0B}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // BABY + {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HEART + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // OLD + {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // YOUNG + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // UGLY + {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + } +}; + + +static const struct BardSound BardMusic_POKEMON_2[][6] = { + { // EKANS + {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ARBOK + {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SEAKING + {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ARIADOS + {0x02}, {0x11}, {0x02}, {0x1A}, {0xFF}, {0xFF} + }, { // CROCONAW + {0x11}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // UNOWN + {0x11}, {0x1A}, {0x11}, {0x1A}, {0xFF}, {0xFF} + }, { // EEVEE + {0x0B}, {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // GEODUDE + {0x0B}, {0x11}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // SPINARAK + {0x0B}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // PILOSWINE + {0x0B}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // ONIX + {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ARCANINE + {0x02}, {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SUDOWOODO + {0x1A}, {0x0B}, {0x02}, {0x29}, {0xFF}, {0xFF} + }, { // WEEPINBELL + {0x29}, {0x11}, {0x02}, {0x11}, {0x02}, {0xFF} + }, { // VICTREEBEL + {0x02}, {0x0B}, {0x11}, {0x02}, {0xFF}, {0xFF} + }, { // WOOPER + {0x0B}, {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // SWINUB + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SKARMORY + {0x02}, {0x02}, {0x0B}, {0x1A}, {0xFF}, {0xFF} + }, { // AIPOM + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ESPEON + {0x11}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // HITMONCHAN + {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ELEKID + {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // ELECTABUZZ + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // ENTEI + {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // FERALIGATR + {0x11}, {0x0B}, {0x02}, {0x1A}, {0xFF}, {0xFF} + }, { // FURRET + {0x11}, {0x0B}, {0x11}, {0x1A}, {0xFF}, {0xFF} + }, { // OCTILLERY + {0x1A}, {0x11}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // PRIMEAPE + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SENTRET + {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // STANTLER + {0x02}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SPEAROW + {0x02}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // FEAROW + {0x11}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // OMASTAR + {0x02}, {0x1A}, {0x1A}, {0x1A}, {0xFF}, {0xFF} + }, { // OMANYTE + {0x02}, {0x1A}, {0x11}, {0x02}, {0xFF}, {0xFF} + }, { // GROWLITHE + {0x29}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // MACHAMP + {0x02}, {0x1A}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // DRAGONITE + {0x02}, {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // PINSIR + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SNORLAX + {0x0B}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // KABUTO + {0x02}, {0x29}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // KABUTOPS + {0x02}, {0x29}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // HITMONTOP + {0x02}, {0x1A}, {0x0B}, {0x02}, {0xFF}, {0xFF} + }, { // WARTORTLE + {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BLASTOISE + {0x29}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FARFETCHD + {0x1A}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // CUBONE + {0x02}, {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // MAROWAK + {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // KANGASKHAN + {0x02}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // SUNFLORA + {0x1A}, {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // CATERPIE + {0x02}, {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // GYARADOS + {0x02}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // RAPIDASH + {0x02}, {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // NINETALES + {0x29}, {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // GIRAFARIG + {0x11}, {0x02}, {0x02}, {0x11}, {0xFF}, {0xFF} + }, { // BELLOSSOM + {0x29}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // KINGDRA + {0x0B}, {0x0B}, {0x02}, {0x11}, {0xFF}, {0xFF} + }, { // KINGLER + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GLOOM + {0x29}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // PINECO + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GLIGAR + {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // KRABBY + {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GRANBULL + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CROBAT + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ABRA + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GENGAR + {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TAUROS + {0x02}, {0x29}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // MAGIKARP + {0x02}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // MAGNEMITE + {0x02}, {0x0B}, {0x11}, {0x1A}, {0xFF}, {0xFF} + }, { // GASTLY + {0x0B}, {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // HAUNTER + {0x02}, {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // MACHOKE + {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // KAKUNA + {0x1A}, {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // PSYDUCK + {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // PHANPY + {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // RATTATA + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GOLDUCK + {0x0B}, {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // GOLBAT + {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GOLEM + {0x0B}, {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // GRAVELER + {0x0B}, {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // VENONAT + {0x29}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // RHYDON + {0x11}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // RHYHORN + {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // PUPITAR + {0x29}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // CORSOLA + {0x1A}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // HITMONLEE + {0x11}, {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // ZAPDOS + {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // JOLTEON + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SANDSHREW + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SANDSLASH + {0x02}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SEADRA + {0x0B}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // SHELLDER + {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // VAPOREON + {0x02}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // DEWGONG + {0x29}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SUICUNE + {0x29}, {0x11}, {0x29}, {0x0B}, {0xFF}, {0xFF} + }, { // STARMIE + {0x02}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SCYTHER + {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ZUBAT + {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BEEDRILL + {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HYPNO + {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DROWZEE + {0x02}, {0x29}, {0x02}, {0x1A}, {0xFF}, {0xFF} + }, { // SQUIRTLE + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CELEBI + {0x0B}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // WOBBUFFET + {0x1A}, {0x11}, {0x0B}, {0x02}, {0x29}, {0xFF} + }, { // DUGTRIO + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HORSEA + {0x0B}, {0x0B}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // EXEGGCUTE + {0x1A}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // CHIKORITA + {0x0B}, {0x11}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // CHINCHOU + {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SHUCKLE + {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DIGLETT + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // REMORAID + {0x0B}, {0x1A}, {0x02}, {0x11}, {0xFF}, {0xFF} + }, { // DELIBIRD + {0x1A}, {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // HOUNDOUR + {0x29}, {0x29}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // AMPHAROS + {0x02}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // DODUO + {0x1A}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DODRIO + {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SMEARGLE + {0x02}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // KOFFING + {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TENTACRUEL + {0x0B}, {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // TOGETIC + {0x1A}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // TOGEPI + {0x1A}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // GOLDEEN + {0x1A}, {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // METAPOD + {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DONPHAN + {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // ODDISH + {0x11}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // EXEGGUTOR + {0x1A}, {0x1A}, {0x0B}, {0x11}, {0xFF}, {0xFF} + }, { // NIDOKING + {0x11}, {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // NIDOQUEEN + {0x11}, {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // NIDORAN_F + {0x11}, {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // NIDORAN_M + {0x11}, {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // NIDORINA + {0x11}, {0x1A}, {0x11}, {0x02}, {0xFF}, {0xFF} + }, { // NIDORINO + {0x11}, {0x1A}, {0x11}, {0x1A}, {0xFF}, {0xFF} + }, { // MEOWTH + {0x02}, {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SNEASEL + {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // POLIWHIRL + {0x02}, {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // POLITOED + {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // POLIWRATH + {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // POLIWAG + {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // QUAGSIRE + {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // NATU + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // XATU + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DUNSPARCE + {0x29}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // SEEL + {0x29}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // STEELIX + {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TYPHLOSION + {0x1A}, {0x29}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // DRAGONAIR + {0x02}, {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // BUTTERFREE + {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SCIZOR + {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HOPPIP + {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BLISSEY + {0x0B}, {0x11}, {0x0B}, {0x11}, {0x02}, {0xFF} + }, { // PARAS + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // PARASECT + {0x02}, {0x02}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // QWILFISH + {0x02}, {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // MR_MIME + {0x02}, {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // TYROGUE + {0x02}, {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // CLOYSTER + {0x02}, {0x29}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // TYRANITAR + {0x0B}, {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // CLEFFA + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // WEEDLE + {0x1A}, {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // PIKACHU + {0x11}, {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // CLEFABLE + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // PIDGEOT + {0x02}, {0x29}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // PIDGEOTTO + {0x02}, {0x29}, {0x1A}, {0x02}, {0xFF}, {0xFF} + }, { // PICHU + {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CLEFAIRY + {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CHARMANDER + {0x29}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // STARYU + {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CYNDAQUIL + {0x0B}, {0x29}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // SUNKERN + {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TEDDIURSA + {0x0B}, {0x11}, {0x29}, {0x02}, {0xFF}, {0xFF} + }, { // VOLTORB + {0x1A}, {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // MOLTRES + {0x02}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // FLAREON + {0x02}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // ALAKAZAM + {0x11}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // MAGMAR + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // FORRETRESS + {0x1A}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // WIGGLYTUFF + {0x29}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // IVYSAUR + {0x11}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // BULBASAUR + {0x11}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // VENUSAUR + {0x11}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // AERODACTYL + {0x02}, {0x0B}, {0x1A}, {0x02}, {0x11}, {0xFF} + }, { // MAGBY + {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // IGGLYBUFF + {0x29}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // UMBREON + {0x02}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // ARTICUNO + {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // JIGGLYPUFF + {0x29}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // SNUBBULL + {0x29}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // BAYLEEF + {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // GRIMER + {0x0B}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // MUK + {0x0B}, {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // HERACROSS + {0x02}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // HOUNDOOM + {0x29}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // PERSIAN + {0x1A}, {0x11}, {0x11}, {0x02}, {0xFF}, {0xFF} + }, { // LICKITUNG + {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HO_OH + {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // HOOTHOOT + {0x1A}, {0x1A}, {0x1A}, {0x1A}, {0xFF}, {0xFF} + }, { // PIDGEY + {0x02}, {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // PONYTA + {0x1A}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // SKIPLOOM + {0x29}, {0x0B}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // PORYGON + {0x1A}, {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // PORYGON2 + {0x1A}, {0x11}, {0x1A}, {0x0B}, {0x11}, {0xFF} + }, { // MAGCARGO + {0x02}, {0x02}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // SLUGMA + {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // QUILAVA + {0x11}, {0x0B}, {0x02}, {0x02}, {0xFF}, {0xFF} + }, { // BELLSPROUT + {0x1A}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // WEEZING + {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MARILL + {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AZUMARILL + {0x02}, {0x29}, {0x02}, {0x11}, {0xFF}, {0xFF} + }, { // ELECTRODE + {0x0B}, {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // MANKEY + {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MANTINE + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // DRATINI + {0x02}, {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // MEW + {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MEWTWO + {0x11}, {0x29}, {0x29}, {0x29}, {0xFF}, {0xFF} + }, { // MILTANK + {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MISDREAVUS + {0x02}, {0x29}, {0x29}, {0x11}, {0xFF}, {0xFF} + }, { // SMOOCHUM + {0x29}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // MEGANIUM + {0x0B}, {0x02}, {0x11}, {0x0B}, {0xFF}, {0xFF} + }, { // DITTO + {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TENTACOOL + {0x0B}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // MAREEP + {0x1A}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // FLAAFFY + {0x02}, {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // VENOMOTH + {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // TANGELA + {0x02}, {0x0B}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // SLOWKING + {0x02}, {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SLOWBRO + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SLOWPOKE + {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MURKROW + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // YANMA + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // KADABRA + {0x02}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // LARVITAR + {0x02}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // NOCTOWL + {0x1A}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // RAIKOU + {0x02}, {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // RAICHU + {0x02}, {0x11}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // CHANSEY + {0x02}, {0x0B}, {0x11}, {0x02}, {0xFF}, {0xFF} + }, { // RATICATE + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LAPRAS + {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // VILEPLUME + {0x11}, {0x1A}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // LANTURN + {0x02}, {0x29}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CHARMELEON + {0x29}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // CHARIZARD + {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // URSARING + {0x29}, {0x02}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // JYNX + {0x1A}, {0x02}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // LUGIA + {0x29}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // MAGNETON + {0x02}, {0x0B}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // LEDIAN + {0x0B}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // LEDYBA + {0x0B}, {0x11}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // VULPIX + {0x29}, {0x11}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // JUMPLUFF + {0x02}, {0x29}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // TOTODILE + {0x02}, {0x11}, {0x02}, {0x11}, {0xFF}, {0xFF} + }, { // MACHOP + {0x02}, {0x1A}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + } +}; + +#endif //GUARD_DATA_BARD_MUSIC_H diff --git a/src/data/bard_music_en.h b/src/data/bard_music_en.h new file mode 100644 index 000000000..98f4d4def --- /dev/null +++ b/src/data/bard_music_en.h @@ -0,0 +1,3678 @@ +#ifndef GUARD_DATA_BARD_MUSIC_H +#define GUARD_DATA_BARD_MUSIC_H + +/*static*/ const struct BardSound BardMusic_POKEMON[][6] = { + { // ARMALDO + {0x1B}, {0x1B}, {0x18}, {0x33}, {0xFF}, {0xFF} + }, { // BEAUTIFLY + {0x2D}, {0x09}, {0x12}, {0x33}, {0xFF}, {0xFF} + }, { // MEDITITE + {0x09}, {0x11}, {0x12}, {0x33}, {0xFF}, {0xFF} + }, { // SEAKING + {0x0C}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TORCHIC + {0x18}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ANORITH + {0x00}, {0x18}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // ABSOL + {0x00}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SURSKIT + {0x30}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MASQUERAIN + {0x00}, {0x30}, {0x03}, {0x33}, {0xFF}, {0xFF} + }, { // GEODUDE + {0x0C}, {0x18}, {0x27}, {0xFF}, {0xFF}, {0xFF} + }, { // ILLUMISE + {0x0C}, {0x27}, {0x0C}, {0x03}, {0xFF}, {0xFF} + }, { // SKARMORY + {0x1B}, {0x1A}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // SKITTY + {0x11}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DELCATTY + {0x09}, {0x00}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // SWELLOW + {0x09}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GLALIE + {0x05}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // KYOGRE + {0x12}, {0x18}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // MACHAMP + {0x2A}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PINSIR + {0x11}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // KECLEON + {0x09}, {0x0C}, {0x1B}, {0x33}, {0xFF}, {0xFF} + }, { // SHUPPET + {0x2A}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SILCOON + {0x11}, {0x28}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BRELOOM + {0x09}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SHROOMISH + {0x27}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CARVANHA + {0x1B}, {0x01}, {0x2A}, {0xFF}, {0xFF}, {0xFF} + }, { // TREECKO + {0x0C}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WINGULL + {0x0F}, {0x24}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GYARADOS + {0x1D}, {0x09}, {0x11}, {0x1D}, {0xFF}, {0xFF} + }, { // NINETALES + {0x12}, {0x05}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GIRAFARIG + {0x30}, {0x00}, {0x2A}, {0x11}, {0xFF}, {0xFF} + }, { // KIRLIA + {0x30}, {0x0C}, {0x2A}, {0xFF}, {0xFF}, {0xFF} + }, { // BELLOSSOM + {0x09}, {0x1B}, {0x2C}, {0x33}, {0xFF}, {0xFF} + }, { // KINGDRA + {0x0C}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GLOOM + {0x27}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MAWILE + {0x1B}, {0x12}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GROUDON + {0x21}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MIGHTYENA + {0x12}, {0x0C}, {0x09}, {0x2C}, {0xFF}, {0xFF} + }, { // CROBAT + {0x18}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ABRA + {0x00}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SLAKING + {0x00}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WURMPLE + {0x30}, {0x24}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MAGIKARP + {0x00}, {0x11}, {0x1B}, {0xFF}, {0xFF}, {0xFF} + }, { // MAGNEMITE + {0x00}, {0x09}, {0x12}, {0xFF}, {0xFF}, {0xFF} + }, { // TORKOAL + {0x18}, {0x1A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MACHOKE + {0x2A}, {0x1A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GULPIN + {0x24}, {0x0F}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ARON + {0x1B}, {0x1D}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PSYDUCK + {0x12}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LAIRON + {0x05}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WHISMUR + {0x11}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NUZLEAF + {0x2C}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PHANPY + {0x00}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SHELGON + {0x09}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GOLDUCK + {0x18}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GOLBAT + {0x1A}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GOLEM + {0x18}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GRAVELER + {0x00}, {0x09}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // GARDEVOIR + {0x1B}, {0x09}, {0x1B}, {0x33}, {0xFF}, {0xFF} + }, { // RHYDON + {0x12}, {0x15}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RHYHORN + {0x14}, {0x1A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GOREBYSS + {0x1A}, {0x2C}, {0x11}, {0x33}, {0xFF}, {0xFF} + }, { // CORSOLA + {0x18}, {0x18}, {0x2A}, {0xFF}, {0xFF}, {0xFF} + }, { // CACNEA + {0x00}, {0x0C}, {0x2A}, {0xFF}, {0xFF}, {0xFF} + }, { // DUSCLOPS + {0x2A}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SHARPEDO + {0x1D}, {0x0C}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // ZANGOOSE + {0x03}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SANDSHREW + {0x00}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SANDSLASH + {0x00}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SEADRA + {0x0C}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RELICANTH + {0x09}, {0x11}, {0x00}, {0x33}, {0xFF}, {0xFF} + }, { // ZIGZAGOON + {0x11}, {0x00}, {0x27}, {0xFF}, {0xFF}, {0xFF} + }, { // CRAWDAUNT + {0x1B}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SCEPTILE + {0x09}, {0x12}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GROVYLE + {0x18}, {0x12}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BANETTE + {0x03}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // JIRACHI + {0x30}, {0x1B}, {0x0C}, {0x33}, {0xFF}, {0xFF} + }, { // STARMIE + {0x1B}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ZUBAT + {0x27}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TAILLOW + {0x03}, {0x1A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WYNAUT + {0x12}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WOBBUFFET + {0x1D}, {0x2C}, {0x09}, {0xFF}, {0xFF}, {0xFF} + }, { // SOLROCK + {0x18}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SHIFTRY + {0x11}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HORSEA + {0x1A}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BAGON + {0x05}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SEEDOT + {0x0C}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SPHEAL + {0x0E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BELDUM + {0x09}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MEDICHAM + {0x09}, {0x11}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // CHINCHOU + {0x0F}, {0x21}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CHIMECHO + {0x12}, {0x09}, {0x18}, {0x33}, {0xFF}, {0xFF} + }, { // ALTARIA + {0x06}, {0x1B}, {0x0C}, {0x2A}, {0xFF}, {0xFF} + }, { // SWABLU + {0x1B}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NINCADA + {0x0F}, {0x06}, {0x06}, {0xFF}, {0xFF}, {0xFF} + }, { // DEOXYS + {0x0C}, {0x1B}, {0x11}, {0x33}, {0xFF}, {0xFF} + }, { // NINJASK + {0x0F}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DODUO + {0x1A}, {0x27}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // DODRIO + {0x1A}, {0x0C}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // KOFFING + {0x15}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TENTACRUEL + {0x09}, {0x2A}, {0x27}, {0x33}, {0xFF}, {0xFF} + }, { // DUSTOX + {0x2C}, {0x17}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LOUDRED + {0x21}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GOLDEEN + {0x1A}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BARBOACH + {0x1B}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SEALEO + {0x0C}, {0x0C}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // WALREIN + {0x1B}, {0x03}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TROPIUS + {0x18}, {0x0C}, {0x2A}, {0x33}, {0xFF}, {0xFF} + }, { // DONPHAN + {0x1B}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NUMEL + {0x2C}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ODDISH + {0x15}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TRAPINCH + {0x00}, {0x0F}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SLAKOTH + {0x00}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WHISCASH + {0x11}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SHEDINJA + {0x09}, {0x0F}, {0x2A}, {0xFF}, {0xFF}, {0xFF} + }, { // MARSHTOMP + {0x1B}, {0x1D}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NATU + {0x00}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // XATU + {0x00}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CLAYDOL + {0x03}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CACTURNE + {0x00}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NOSEPASS + {0x18}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CLAMPERL + {0x00}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CAMERUPT + {0x00}, {0x30}, {0x2A}, {0x33}, {0xFF}, {0xFF} + }, { // EXPLOUD + {0x09}, {0x21}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BLAZIKEN + {0x03}, {0x11}, {0x0F}, {0x33}, {0xFF}, {0xFF} + }, { // LOMBRE + {0x18}, {0x03}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LOTAD + {0x18}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SPINDA + {0x0F}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SPOINK + {0x1E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SEVIPER + {0x09}, {0x12}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // HARIYAMA + {0x1B}, {0x0C}, {0x1B}, {0x2A}, {0xFF}, {0xFF} + }, { // VOLBEAT + {0x18}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HUNTAIL + {0x2A}, {0x05}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PIKACHU + {0x0C}, {0x2A}, {0x27}, {0xFF}, {0xFF}, {0xFF} + }, { // PICHU + {0x0C}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // STARYU + {0x1B}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // VIBRAVA + {0x11}, {0x1B}, {0x2A}, {0xFF}, {0xFF}, {0xFF} + }, { // VOLTORB + {0x1A}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FEEBAS + {0x0E}, {0x00}, {0x33}, {0x33}, {0xFF}, {0xFF} + }, { // ALAKAZAM + {0x00}, {0x2C}, {0x2C}, {0x00}, {0xFF}, {0xFF} + }, { // GRUMPIG + {0x2C}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WIGGLYTUFF + {0x11}, {0x27}, {0x0C}, {0x2A}, {0x33}, {0xFF} + }, { // IGGLYBUFF + {0x11}, {0x2A}, {0x0C}, {0x2A}, {0xFF}, {0xFF} + }, { // FLYGON + {0x12}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PLUSLE + {0x2A}, {0x24}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // JIGGLYPUFF + {0x11}, {0x27}, {0x0C}, {0x2A}, {0x33}, {0xFF} + }, { // CORPHISH + {0x18}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GRIMER + {0x12}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MUK + {0x2A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HERACROSS + {0x09}, {0x2A}, {0x1B}, {0x33}, {0xFF}, {0xFF} + }, { // PELIPPER + {0x09}, {0x0C}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // WAILORD + {0x03}, {0x1A}, {0x33}, {0x33}, {0xFF}, {0xFF} + }, { // WAILMER + {0x05}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SALAMENCE + {0x00}, {0x00}, {0x09}, {0x33}, {0xFF}, {0xFF} + }, { // AGGRON + {0x00}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // POOCHYENA + {0x27}, {0x0C}, {0x09}, {0x2C}, {0xFF}, {0xFF} + }, { // CASTFORM + {0x00}, {0x1A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MINUN + {0x12}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MAGCARGO + {0x00}, {0x1B}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // MAKUHITA + {0x1B}, {0x27}, {0x0C}, {0x2A}, {0xFF}, {0xFF} + }, { // SLUGMA + {0x2C}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WEEZING + {0x0C}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LINOONE + {0x14}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CASCOON + {0x00}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MARILL + {0x08}, {0x10}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AZUMARILL + {0x08}, {0x27}, {0x2C}, {0x10}, {0xFF}, {0xFF} + }, { // SWALOT + {0x1B}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ELECTRODE + {0x0C}, {0x09}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // MUDKIP + {0x2C}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MILOTIC + {0x12}, {0x18}, {0x11}, {0x33}, {0xFF}, {0xFF} + }, { // METAGROSS + {0x09}, {0x2A}, {0x18}, {0x33}, {0xFF}, {0xFF} + }, { // METANG + {0x09}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TENTACOOL + {0x09}, {0x2A}, {0x27}, {0x33}, {0xFF}, {0xFF} + }, { // BALTOY + {0x01}, {0x1E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SABLEYE + {0x03}, {0x0B}, {0x12}, {0xFF}, {0xFF}, {0xFF} + }, { // VIGOROTH + {0x11}, {0x30}, {0x1B}, {0xFF}, {0xFF}, {0xFF} + }, { // SNORUNT + {0x18}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CRADILY + {0x03}, {0x11}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // KADABRA + {0x2C}, {0x00}, {0x2C}, {0xFF}, {0xFF}, {0xFF} + }, { // DUSKULL + {0x2A}, {0x26}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RAICHU + {0x12}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MANECTRIC + {0x00}, {0x09}, {0x11}, {0x33}, {0xFF}, {0xFF} + }, { // SWAMPERT + {0x1B}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ELECTRIKE + {0x0C}, {0x09}, {0x12}, {0x33}, {0xFF}, {0xFF} + }, { // LATIAS + {0x00}, {0x0C}, {0x00}, {0x33}, {0xFF}, {0xFF} + }, { // LATIOS + {0x00}, {0x0C}, {0x18}, {0x33}, {0xFF}, {0xFF} + }, { // LUVDISC + {0x2C}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // VILEPLUME + {0x14}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RALTS + {0x07}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LANTURN + {0x00}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LILEEP + {0x11}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LUNATONE + {0x27}, {0x2C}, {0x18}, {0x33}, {0xFF}, {0xFF} + }, { // AZURILL + {0x06}, {0x27}, {0x0F}, {0x33}, {0xFF}, {0xFF} + }, { // LUDICOLO + {0x27}, {0x09}, {0x1A}, {0x1A}, {0xFF}, {0xFF} + }, { // MAGNETON + {0x00}, {0x09}, {0x2A}, {0xFF}, {0xFF}, {0xFF} + }, { // REGICE + {0x09}, {0x0C}, {0x12}, {0x33}, {0xFF}, {0xFF} + }, { // REGISTEEL + {0x09}, {0x0C}, {0x0E}, {0x33}, {0xFF}, {0xFF} + }, { // REGIROCK + {0x09}, {0x0C}, {0x1B}, {0xFF}, {0xFF}, {0xFF} + }, { // RAYQUAZA + {0x03}, {0x03}, {0x2A}, {0x33}, {0xFF}, {0xFF} + }, { // VULPIX + {0x24}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ROSELIA + {0x18}, {0x09}, {0x0C}, {0x2A}, {0xFF}, {0xFF} + }, { // COMBUSKEN + {0x2C}, {0x2C}, {0x0F}, {0x33}, {0xFF}, {0xFF} + }, { // MACHOP + {0x2A}, {0x15}, {0x33}, {0xFF}, {0xFF}, {0xFF} + } +}; + +/*static*/ const struct BardSound BardMusic_TRAINER[][6] = { + { // I CHOOSE YOU + {0x12}, {0x27}, {0x2D}, {0xFF}, {0xFF}, {0xFF} + }, { // GOTCHA + {0x15}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TRADE + {0x03}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SAPPHIRE + {0x00}, {0x12}, {0x32}, {0xFF}, {0xFF}, {0xFF} + }, { // EVOLVE + {0x0C}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ENCYCLOPEDIA + {0x09}, {0x12}, {0x18}, {0x0C}, {0x0C}, {0x06} + }, { // NATURE + {0x03}, {0x30}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // CENTER + {0x09}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EGG + {0x09}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LINK + {0x0C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SP. ABILITY + {0x09}, {0x08}, {0x06}, {0x11}, {0x11}, {0x0C} + }, { // TRAINER + {0x03}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // VERSION + {0x32}, {0x0F}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // POKéNAV + {0x18}, {0x0C}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // POKéMON + {0x18}, {0x0C}, {0x1B}, {0xFF}, {0xFF}, {0xFF} + }, { // GET + {0x09}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // POKéDEX + {0x18}, {0x0C}, {0x09}, {0xFF}, {0xFF}, {0xFF} + }, { // RUBY + {0x27}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LEVEL + {0x09}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + } +}; + +/*static*/ const struct BardSound BardMusic_STATUS[][6] = { + { // DARK + {0x08}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // STENCH + {0x09}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THICK FAT + {0x11}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RAIN DISH + {0x03}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DRIZZLE + {0x11}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ARENA TRAP + {0x06}, {0x0C}, {0x06}, {0x00}, {0xFF}, {0xFF} + }, { // INTIMIDATE + {0x0F}, {0x11}, {0x2C}, {0x03}, {0xFF}, {0xFF} + }, { // ROCK HEAD + {0x15}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // COLOR + {0x2C}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ALT. COLOR + {0x1B}, {0x32}, {0x01}, {0x2C}, {0x30}, {0xFF} + }, { // ROCK + {0x15}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BEAUTIFUL + {0x27}, {0x0C}, {0x24}, {0xFF}, {0xFF}, {0xFF} + }, { // BEAUTY + {0x27}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AIR LOCK + {0x09}, {0x15}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PSYCHIC + {0x12}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HYPER CUTTER + {0x12}, {0x30}, {0x2C}, {0x30}, {0xFF}, {0xFF} + }, { // FIGHTING + {0x12}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SHADOW TAG + {0x00}, {0x18}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // SMART + {0x06}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SMARTNESS + {0x06}, {0x32}, {0x09}, {0xFF}, {0xFF}, {0xFF} + }, { // SPEED BOOST + {0x0C}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // COOL + {0x29}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // COOLNESS + {0x29}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BATTLE ARMOR + {0x00}, {0x09}, {0x06}, {0x30}, {0xFF}, {0xFF} + }, { // CUTE + {0x2D}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CUTENESS + {0x2D}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // STURDY + {0x30}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SUCTION CUPS + {0x2A}, {0x0F}, {0x2A}, {0x33}, {0x33}, {0xFF} + }, { // GRASS + {0x00}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CLEAR BODY + {0x0E}, {0x17}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // TORRENT + {0x1A}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GHOST + {0x15}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ICE + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GUTS + {0x2C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ROUGH SKIN + {0x2C}, {0x0F}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SHELL ARMOR + {0x09}, {0x06}, {0x30}, {0x33}, {0xFF}, {0xFF} + }, { // NATURAL CURE + {0x00}, {0x32}, {0x08}, {0x30}, {0x33}, {0xFF} + }, { // DAMP + {0x00}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GROUND + {0x21}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LIMBER + {0x0F}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MAGNET PULL + {0x00}, {0x09}, {0x2C}, {0x33}, {0xFF}, {0xFF} + }, { // WHITE SMOKE + {0x12}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SYNCHRONIZE + {0x0F}, {0x18}, {0x12}, {0x33}, {0xFF}, {0xFF} + }, { // OVERGROW + {0x18}, {0x30}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // SWIFT SWIM + {0x11}, {0x0F}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SAND STREAM + {0x02}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SAND VEIL + {0x02}, {0x03}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // KEEN EYE + {0x0C}, {0x12}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // INNERFOCUS + {0x0F}, {0x30}, {0x18}, {0x2A}, {0xFF}, {0xFF} + }, { // STATIC + {0x00}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TYPE + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TOUGH + {0x2C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TOUGHNESS + {0x2C}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SHED SKIN + {0x09}, {0x0F}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HUGE POWER + {0x2D}, {0x21}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // VOLT ABSORB + {0x24}, {0x2C}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // WATER ABSORB + {0x06}, {0x30}, {0x2C}, {0x1A}, {0xFF}, {0xFF} + }, { // ELECTRIC + {0x0B}, {0x09}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // FORECAST + {0x1A}, {0x02}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SERENE GRACE + {0x30}, {0x0E}, {0x03}, {0x33}, {0xFF}, {0xFF} + }, { // POISON + {0x20}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // POISON POINT + {0x20}, {0x1B}, {0x1E}, {0xFF}, {0xFF}, {0xFF} + }, { // DRAGON + {0x01}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TRACE + {0x04}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OBLIVIOUS + {0x2C}, {0x11}, {0x0C}, {0x2C}, {0x33}, {0xFF} + }, { // TRUANT + {0x27}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RUN AWAY + {0x2A}, {0x08}, {0x05}, {0xFF}, {0xFF}, {0xFF} + }, { // STICKY HOLD + {0x11}, {0x0C}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // CLOUD NINE + {0x21}, {0x12}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NORMAL + {0x1A}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // STEEL + {0x0E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ILLUMINATE + {0x11}, {0x27}, {0x0F}, {0x03}, {0xFF}, {0xFF} + }, { // EARLY BIRD + {0x30}, {0x0C}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // HUSTLE + {0x2A}, {0x26}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SHINE + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FLYING + {0x12}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DROUGHT + {0x21}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LIGHTNINGROD + {0x12}, {0x11}, {0x15}, {0xFF}, {0xFF}, {0xFF} + }, { // COMPOUNDEYES + {0x15}, {0x21}, {0x12}, {0x33}, {0xFF}, {0xFF} + }, { // MARVEL SCALE + {0x06}, {0x24}, {0x05}, {0xFF}, {0xFF}, {0xFF} + }, { // WONDER GUARD + {0x2A}, {0x30}, {0x06}, {0xFF}, {0xFF}, {0xFF} + }, { // INSOMNIA + {0x0F}, {0x15}, {0x0C}, {0x06}, {0xFF}, {0xFF} + }, { // LEVITATE + {0x09}, {0x0C}, {0x03}, {0xFF}, {0xFF}, {0xFF} + }, { // PLUS + {0x2A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PRESSURE + {0x09}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LIQUID OOZE + {0x11}, {0x09}, {0x27}, {0xFF}, {0xFF}, {0xFF} + }, { // COLOR CHANGE + {0x17}, {0x30}, {0x03}, {0x33}, {0xFF}, {0xFF} + }, { // SOUNDPROOF + {0x21}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EFFECT SPORE + {0x0C}, {0x09}, {0x1A}, {0x33}, {0xFF}, {0xFF} + }, { // PKRS + {0x18}, {0x0C}, {0x2A}, {0xFF}, {0xFF}, {0xFF} + }, { // FIRE + {0x14}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FLAME BODY + {0x03}, {0x15}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // MINUS + {0x12}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OWN TEMPO + {0x18}, {0x09}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // MAGMA ARMOR + {0x01}, {0x2C}, {0x1B}, {0x30}, {0xFF}, {0xFF} + }, { // WATER + {0x06}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WATER VEIL + {0x06}, {0x30}, {0x04}, {0x33}, {0xFF}, {0xFF} + }, { // BUG + {0x2A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SWARM + {0x07}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CUTE CHARM + {0x2D}, {0x07}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // IMMUNITY + {0x11}, {0x27}, {0x11}, {0x0C}, {0xFF}, {0xFF} + }, { // BLAZE + {0x03}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PICKUP + {0x11}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PATTERN + {0x00}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FLASH FIRE + {0x00}, {0x14}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // VITAL SPIRIT + {0x12}, {0x1B}, {0x30}, {0x11}, {0xFF}, {0xFF} + }, { // CHLOROPHYLL + {0x1A}, {0x2C}, {0x11}, {0x33}, {0xFF}, {0xFF} + }, { // PURE POWER + {0x2D}, {0x21}, {0x30}, {0x33}, {0xFF}, {0xFF} + }, { // SHIELD DUST + {0x0E}, {0x2B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + } +}; + +/*static*/ const struct BardSound BardMusic_BATTLE[][6] = { + { // MATCH UP + {0x02}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GO + {0x18}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NO. 1 + {0x2A}, {0x30}, {0x2C}, {0xFF}, {0xFF}, {0xFF} + }, { // DECIDE + {0x0C}, {0x12}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LET ME WIN + {0x09}, {0x0C}, {0x0F}, {0xFF}, {0xFF}, {0xFF} + }, { // WINS + {0x0F}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WIN + {0x0F}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WON + {0x17}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // IF I WIN + {0x0F}, {0x12}, {0x0F}, {0xFF}, {0xFF}, {0xFF} + }, { // WHEN I WIN + {0x0F}, {0x12}, {0x0F}, {0xFF}, {0xFF}, {0xFF} + }, { // CAN’T WIN + {0x02}, {0x0F}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CAN WIN + {0x00}, {0x0F}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NO MATCH + {0x18}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SPIRIT + {0x09}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DECIDED + {0x0C}, {0x12}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // TRUMP CARD + {0x2C}, {0x08}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TAKE THAT + {0x05}, {0x01}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // COME ON + {0x2C}, {0x17}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ATTACK + {0x2A}, {0x02}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SURRENDER + {0x30}, {0x09}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // GUTSY + {0x2C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TALENT + {0x01}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // STRATEGY + {0x00}, {0x0B}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // SMITE + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MATCH + {0x00}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // VICTORY + {0x11}, {0x32}, {0x0E}, {0xFF}, {0xFF}, {0xFF} + }, { // OFFENSIVE + {0x15}, {0x0B}, {0x11}, {0x33}, {0xFF}, {0xFF} + }, { // SENSE + {0x0B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // VERSUS + {0x30}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FIGHTS + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // POWER + {0x23}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CHALLENGE + {0x01}, {0x0A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // STRONG + {0x1B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TOO STRONG + {0x29}, {0x1D}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GO EASY + {0x18}, {0x0C}, {0x0E}, {0xFF}, {0xFF}, {0xFF} + }, { // FOE + {0x1A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GENIUS + {0x0E}, {0x0E}, {0x2C}, {0xFF}, {0xFF}, {0xFF} + }, { // LEGEND + {0x09}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ESCAPE + {0x09}, {0x05}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AIM + {0x03}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BATTLE + {0x00}, {0x26}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FIGHT + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RESUSCITATE + {0x0C}, {0x09}, {0x11}, {0x05}, {0xFF}, {0xFF} + }, { // POINTS + {0x1E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SERIOUS + {0x0C}, {0x0E}, {0x2C}, {0xFF}, {0xFF}, {0xFF} + }, { // GIVE UP + {0x11}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LOSS + {0x17}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // IF I LOSE + {0x0F}, {0x12}, {0x27}, {0xFF}, {0xFF}, {0xFF} + }, { // LOST + {0x16}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LOSE + {0x27}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GUARD + {0x08}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PARTNER + {0x15}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // REJECT + {0x0C}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ACCEPT + {0x00}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // INVINCIBLE + {0x0F}, {0x11}, {0x2C}, {0x24}, {0xFF}, {0xFF} + }, { // RECEIVED + {0x0C}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EASY + {0x0C}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WEAK + {0x0C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TOO WEAK + {0x27}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PUSHOVER + {0x29}, {0x1A}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // LEADER + {0x0C}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RULE + {0x26}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MOVE + {0x29}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + } +}; + +/*static*/ const struct BardSound BardMusic_GREETINGS[][6] = { + { // THANKS + {0x03}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // YES + {0x0B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HERE GOES + {0x30}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HERE I COME + {0x30}, {0x12}, {0x17}, {0x33}, {0xFF}, {0xFF} + }, { // HERE IT IS + {0x30}, {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // YEAH + {0x02}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WELCOME + {0x09}, {0x17}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OI + {0x1E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HOW DO + {0x21}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CONGRATS + {0x2C}, {0x02}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GIVE ME + {0x11}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SORRY + {0x1B}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // APOLOGIZE + {0x2C}, {0x06}, {0x17}, {0x12}, {0x33}, {0xFF} + }, { // FORGIVE + {0x1A}, {0x10}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HEY, THERE + {0x04}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HELLO + {0x09}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GOOD-BYE + {0x26}, {0x14}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THANK YOU + {0x03}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // I’VE ARRIVED + {0x12}, {0x06}, {0x12}, {0x33}, {0xFF}, {0xFF} + }, { // PARDON + {0x1D}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EXCUSE + {0x09}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SEE YA + {0x0E}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EXCUSE ME + {0x0B}, {0x28}, {0x0D}, {0xFF}, {0xFF}, {0xFF} + }, { // WELL, THEN + {0x09}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GO AHEAD + {0x1A}, {0x2C}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // APPRECIATE + {0x00}, {0x0C}, {0x0E}, {0x05}, {0xFF}, {0xFF} + }, { // HEY? + {0x04}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WHAT’S UP? + {0x2C}, {0x2B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HUH? + {0x2C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NO + {0x18}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HI + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // YEAH, YEAH + {0x0A}, {0x0A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BYE-BYE + {0x14}, {0x12}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MEET YOU + {0x0E}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HEY + {0x05}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SMELL + {0x0D}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LISTENING + {0x11}, {0x0B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // HOO-HAH + {0x27}, {0x01}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // YAHOO + {0x00}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // YO + {0x18}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // COME OVER + {0x2C}, {0x18}, {0x32}, {0xFF}, {0xFF}, {0xFF} + }, { // COUNT ON + {0x23}, {0x17}, {0x33}, {0xFF}, {0xFF}, {0xFF} + } +}; + +/*static*/ const struct BardSound BardMusic_PEOPLE[][6] = { + { // OPPONENT + {0x2C}, {0x1A}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // I + {0x13}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // YOU + {0x2D}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // YOURS + {0x1A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SON + {0x27}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // YOUR + {0x1A, 0xF7}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // YOU’RE + {0x26}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // YOU’VE + {0x2D}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MOTHER + {0x2C}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GRANDFATHER + {0x01}, {0x08}, {0x32}, {0x33}, {0xFF}, {0xFF} + }, { // UNCLE + {0x2C}, {0x26}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FATHER + {0x08}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BOY + {0x1E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ADULT + {0x00}, {0x24}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BROTHER + {0x15}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SISTER + {0x11}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GRANDMOTHER + {0x01}, {0x2C}, {0x32}, {0x33}, {0xFF}, {0xFF} + }, { // AUNT + {0x07}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PARENT + {0x09}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MAN + {0x00}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ME + {0x0D}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GIRL + {0x30}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BABE + {0x04}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FAMILY + {0x00}, {0x11}, {0x0E}, {0xFF}, {0xFF}, {0xFF} + }, { // HER + {0x32}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HIM + {0x0F}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HE + {0x0C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PLACE + {0x03}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DAUGHTER + {0x27}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HIS + {0x10}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HE’S + {0x0C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AREN’T + {0x1C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SIBLINGS + {0x11}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // KID + {0x11}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CHILDREN + {0x11}, {0x0A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MR. + {0x11}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MRS. + {0x11}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MYSELF + {0x12}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // I WAS + {0x12}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TO ME + {0x27}, {0x0D}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MY + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // I AM + {0x12}, {0x02}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // I’VE + {0x14}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WHO + {0x29}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SOMEONE + {0x2A}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WHO WAS + {0x27}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TO WHOM + {0x27}, {0x29}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WHOSE + {0x27}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WHO IS + {0x27}, {0x10}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // IT’S + {0x10}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LADY + {0x05}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FRIEND + {0x09}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ALLY + {0x00}, {0x14}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PERSON + {0x32}, {0x1D}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DUDE + {0x28}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THEY + {0x05}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THEY WERE + {0x05}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TO THEM + {0x27}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THEIR + {0x31}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THEY’RE + {0x31}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THEY’VE + {0x03}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WE + {0x0C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BEEN + {0x0F}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TO US + {0x27}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OUR + {0x21}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WE’RE + {0x0C}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RIVAL + {0x12}, {0x24}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WE’VE + {0x0C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WOMAN + {0x26}, {0x02}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SHE + {0x0C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SHE WAS + {0x0C}, {0x2B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TO HER + {0x27}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HER’S + {0x30}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SHE IS + {0x0C}, {0x10}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SOME + {0x0C}, {0x01}, {0x33}, {0xFF}, {0xFF}, {0xFF} + } +}; + +/*static*/ const struct BardSound BardMusic_VOICES[][6] = { + { // ! + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // !! + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ?! + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ? + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // … + {0x0C}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // …! + {0x0C}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ……… + {0x0C}, {0x30}, {0x33}, {0x0C}, {0x30}, {0xFF} + }, { // - + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // - - - + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // UH-OH + {0x2C}, {0x1A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WAAAH + {0x1B, 0x05, 0x08}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AHAHA + {0x06}, {0x06}, {0x06}, {0x33}, {0x33}, {0xFF} + }, { // OH? + {0x18}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NOPE + {0x18}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // URGH + {0x31}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HMM + {0x28}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WHOAH + {0x19}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WROOOAAR! + {0x1C}, {0x31}, {0x33}, {0x33}, {0xFF}, {0xFF} + }, { // WOW + {0x23}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GIGGLE + {0x11}, {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SIGH + {0x0A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // UNBELIEVABLE + {0x2C}, {0x0E}, {0x0C}, {0x02}, {0x24}, {0xFF} + }, { // CRIES + {0x13}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AGREE + {0x06}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EH? + {0x2A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CRY + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EHEHE + {0x0C}, {0x0C}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // OI, OI, OI + {0x1E}, {0x1E}, {0x1E}, {0xFF}, {0xFF}, {0xFF} + }, { // OH, YEAH + {0x18}, {0x01}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OH + {0x18}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OOPS + {0x27}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SHOCKED + {0x17}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EEK + {0x0D}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GRAAAH + {0x06}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GWAHAHAHA + {0x06}, {0x06}, {0x06}, {0x17}, {0xFF}, {0xFF} + }, { // WAY + {0x05}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TCH + {0x09}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HEHE + {0x0C}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HAH + {0x06}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // YUP + {0x2C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HAHAHA + {0x06}, {0x06}, {0x06}, {0xFF}, {0xFF}, {0xFF} + }, { // AIYEEH + {0x13}, {0x0D}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HIYAH + {0x0C}, {0x07}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FUFUFU + {0x27}, {0x27}, {0x27}, {0xFF}, {0xFF}, {0xFF} + }, { // LOL + {0x18}, {0x1A}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // SNORT + {0x1A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HUMPH + {0x2A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HEHEHE + {0x0C}, {0x0C}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // HEH + {0x09}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HOHOHO + {0x18}, {0x18}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // UH-HUH + {0x2A}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OH, DEAR + {0x18}, {0x0E}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // ARRGH + {0x1C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MUFUFU + {0x27}, {0x27}, {0x27}, {0xFF}, {0xFF}, {0xFF} + }, { // MMM + {0x0F}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OH-KAY + {0x18}, {0x04}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OKAY + {0x18}, {0x04}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LALALA + {0x06}, {0x06}, {0x06}, {0xFF}, {0xFF}, {0xFF} + }, { // YAY + {0x04}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AWW + {0x07}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WOWEE + {0x22}, {0x0D}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GWAH + {0x07}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WAHAHAHA + {0x06}, {0x06}, {0x06}, {0x06}, {0xFF}, {0xFF} + } +}; + +/*static*/ const struct BardSound BardMusic_SPEECH[][6] = { + { // LISTEN + {0x09}, {0x10}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NOT VERY + {0x15}, {0x09}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // MEAN + {0x0E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LIE + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LAY + {0x05}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RECOMMEND + {0x09}, {0x2C}, {0x0A}, {0xFF}, {0xFF}, {0xFF} + }, { // NITWIT + {0x0F}, {0x0F}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // QUITE + {0x14}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FROM + {0x2B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FEELING + {0x0C}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BUT + {0x2C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HOWEVER + {0x21}, {0x09}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // CASE + {0x0C}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THE + {0x2B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MISS + {0x11}, {0xFF}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HOW + {0x21}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HIT + {0x11}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ENOUGH + {0x0E}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // A LOT + {0x03}, {0x17}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // A LITTLE + {0x03}, {0x11}, {0x26}, {0x33}, {0xFF}, {0xFF} + }, { // ABSOLUTELY + {0x00}, {0x2C}, {0x2D}, {0x0E}, {0x33}, {0xFF} + }, { // AND + {0x00}, {0xFF}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ONLY + {0x1A}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AROUND + {0x0A}, {0xFF}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PROBABLY + {0x15}, {0x2C}, {0x0E}, {0x33}, {0xFF}, {0xFF} + }, { // IF + {0x11}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // VERY + {0x0A}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // A TINY BIT + {0x2C}, {0x14}, {0x0C}, {0x11}, {0xFF}, {0xFF} + }, { // WILD + {0x12}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THAT’S + {0x00}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // JUST + {0x2C}, {0xFF}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EVEN SO, + {0x0C}, {0x0B}, {0x1A}, {0x33}, {0xFF}, {0xFF} + }, { // MUST BE + {0x2C}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NATURALLY + {0x01}, {0x30}, {0x06}, {0x0E}, {0x33}, {0xFF} + }, { // FOR NOW, + {0x1A}, {0x23}, {0xFF}, {0x33}, {0xFF}, {0xFF} + }, { // UNDERSTOOD + {0x2C}, {0x32}, {0x27}, {0xFF}, {0xFF}, {0xFF} + }, { // JOKING + {0x18}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // READY + {0x09}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SOMETHING + {0x1B}, {0x0E}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SOMEHOW + {0x1B}, {0x23}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ALTHOUGH + {0x06}, {0x1A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ALSO + {0x06}, {0x1A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PERFECT + {0x32}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AS MUCH AS + {0x01}, {0x2C}, {0x01}, {0xFF}, {0xFF}, {0xFF} + }, { // REALLY + {0x0C}, {0x0A}, {0x0E}, {0xFF}, {0xFF}, {0xFF} + }, { // TRULY + {0x27}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SERIOUSLY + {0x11}, {0x0E}, {0x26}, {0x0E}, {0x33}, {0xFF} + }, { // TOTALLY + {0x18}, {0x07}, {0x0E}, {0x33}, {0xFF}, {0xFF} + }, { // UNTIL + {0x2C}, {0x10}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AS IF + {0x01}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MOOD + {0x28}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RATHER + {0x00}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AWFULLY + {0x06}, {0x26}, {0x0E}, {0x33}, {0xFF}, {0xFF} + }, { // MODE + {0x1A}, {0xFF}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MORE + {0x1A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TOO LATE + {0x27}, {0x05}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FINALLY + {0x12}, {0x06}, {0x0E}, {0x33}, {0xFF}, {0xFF} + }, { // ANY + {0x08}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // INSTEAD + {0x0F}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FANTASTIC + {0x2B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + } +}; + +/*static*/ const struct BardSound BardMusic_ENDINGS[][6] = { + { // WILL + {0x10}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WILL BE HERE + {0x10}, {0x0C}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // OR + {0x1A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TIMES + {0x14}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WONDER + {0x2C}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // IS IT? + {0x11}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BE + {0x0E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GIMME + {0x11}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // COULD + {0x26}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LIKELY TO + {0x14}, {0x0E}, {0x27}, {0x33}, {0xFF}, {0xFF} + }, { // WOULD + {0x26}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // IS + {0x10}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ISN’T IT? + {0x11}, {0x09}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // LET’S + {0x0B}, {0xFF}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OTHER + {0x2C}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ARE + {0x1C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WAS + {0x2C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WERE + {0x32}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THOSE + {0x18}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ISN’T + {0x0F}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WON’T + {0x1A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CAN’T + {0x00}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CAN + {0x00}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DON’T + {0x1A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DO + {0x27}, {0xFF}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DOES + {0x2C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WHOM + {0x27}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WHICH + {0x11}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WASN’T + {0x2C}, {0x0F}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WEREN’T + {0x32}, {0x0F}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HAVE + {0x00}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HAVEN’T + {0x00}, {0x0F}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // A + {0x03}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AN + {0x02}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NOT + {0x17}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THERE + {0x0B}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OK? + {0x1A}, {0x04}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SO + {0x1A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MAYBE + {0x03}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ABOUT + {0x2A}, {0x23}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OVER + {0x18}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // IT + {0x11}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ALL + {0x06}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FOR + {0x26}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ON + {0x1C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OFF + {0x1D}, {0xFF}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AS + {0x01}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TO + {0x27}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WITH + {0x11}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BETTER + {0x09}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EVER + {0x09}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SINCE + {0x0F}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OF + {0x2A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BELONGS TO + {0x27}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AT + {0x02}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // IN + {0x0F}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OUT + {0x21}, {0xFF}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TOO + {0x27}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LIKE + {0x14}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DID + {0x11}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DIDN’T + {0x11}, {0x0F}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DOESN’T + {0x2C}, {0x0F}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WITHOUT + {0x11}, {0x23}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // AFTER + {0x00}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BEFORE + {0x0C}, {0x26}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WHILE + {0x14}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THAN + {0x02}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ONCE + {0x2C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ANYWHERE + {0x0E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + } +}; + +/*static*/ const struct BardSound BardMusic_FEELINGS[][6] = { + { // MEET + {0x0C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PLAY + {0x04}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HURRIED + {0x32}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GOES + {0x19}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GIDDY + {0x11}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HAPPY + {0x00}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HAPPINESS + {0x00}, {0x0C}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // EXCITE + {0x0B}, {0x14}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // IMPORTANT + {0x0F}, {0x1A}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // FUNNY + {0x2C}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GOT + {0x17}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GO HOME + {0x18}, {0x1A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DISAPPOINTED + {0x11}, {0x00}, {0x1E}, {0x0B}, {0xFF}, {0xFF} + }, { // DISAPPOINTS + {0x11}, {0x00}, {0x20}, {0xFF}, {0xFF}, {0xFF} + }, { // SAD + {0x02}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TRY + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TRIES + {0x14}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HEARS + {0x31}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THINK + {0x0D}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HEAR + {0x31}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WANTS + {0x08}, {0xFF}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MISHEARD + {0x11}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DISLIKE + {0x11}, {0x14}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ANGRY + {0x05}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ANGER + {0x05}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SCARY + {0x0B}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LONESOME + {0x18}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DISAPPOINT + {0x11}, {0x2A}, {0x20}, {0xFF}, {0xFF}, {0xFF} + }, { // JOY + {0x20}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GETS + {0x11}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NEVER + {0x0B}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DARN + {0x08}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DOWNCAST + {0x21}, {0x02}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // INCREDIBLE + {0x0F}, {0x0B}, {0x11}, {0x26}, {0xFF}, {0xFF} + }, { // LIKES + {0x14}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DISLIKES + {0x11}, {0x12}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BORING + {0x1A}, {0x11}, {0x33}, {0x33}, {0xFF}, {0xFF} + }, { // CARE + {0x31}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CARES + {0x31}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ALL RIGHT + {0x06}, {0x14}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ADORE + {0x2C}, {0x1A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DISASTER + {0x11}, {0x00}, {0x32}, {0xFF}, {0xFF}, {0xFF} + }, { // ENJOY + {0x11}, {0x20}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ENJOYS + {0x11}, {0x20}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EAT + {0x0E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LACKING + {0x02}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BAD + {0x02}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HARD + {0x1D}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TERRIBLE + {0x0B}, {0x2A}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // SHOULD + {0x29}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NICE + {0x14}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DRINK + {0x11}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SURPRISE + {0x32}, {0x14}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FEAR + {0x32}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WANT + {0x2C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WAIT + {0x03}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SATISFIED + {0x00}, {0x11}, {0x14}, {0x33}, {0xFF}, {0xFF} + }, { // SEE + {0x0C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RARE + {0x32}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NEGATIVE + {0x0B}, {0x2C}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // DONE + {0x2C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DANGER + {0x03}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DEFEATED + {0x0E}, {0x0E}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // BEAT + {0x0E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GREAT + {0x04}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ROMANTIC + {0x1A}, {0x00}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // QUESTION + {0x0B}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // UNDERSTAND + {0x2C}, {0x32}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // UNDERSTANDS + {0x2C}, {0x32}, {0x02}, {0x33}, {0xFF}, {0xFF} + } +}; + +/*static*/ const struct BardSound BardMusic_CONDITIONS[][6] = { + { // HOT + {0x15}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EXISTS + {0x0B}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EXCESS + {0x0B}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // APPROVED + {0x06}, {0x29}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HAS + {0x01}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GOOD + {0x26}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LESS + {0x0B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MOMENTUM + {0x1A}, {0x0B}, {0x2C}, {0x33}, {0xFF}, {0xFF} + }, { // GOING + {0x1A}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WEIRD + {0x18}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BUSY + {0x11}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TOGETHER + {0x29}, {0x0A}, {0x32}, {0xFF}, {0xFF}, {0xFF} + }, { // FULL + {0x26}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ABSENT + {0x02}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BEING + {0x0F}, {0x12}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NEED + {0x0E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TASTY + {0x05}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SKILLED + {0x11}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NOISY + {0x20}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BIG + {0x11}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LATE + {0x05}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CLOSE + {0x19}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DOCILE + {0x17}, {0x14}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AMUSING + {0x2C}, {0x27}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // ENTERTAINING + {0x09}, {0x30}, {0x03}, {0x11}, {0x33}, {0xFF} + }, { // PERFECTION + {0x32}, {0x0B}, {0x2C}, {0x33}, {0xFF}, {0xFF} + }, { // PRETTY + {0x11}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HEALTHY + {0x0A}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EXCELLENT + {0x09}, {0x2C}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // UPSIDE DOWN + {0x2C}, {0x14}, {0x23}, {0xFF}, {0xFF}, {0xFF} + }, { // COLD + {0x18}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // REFRESHING + {0x0E}, {0x0A}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // UNAVOIDABLE + {0x2C}, {0x2A}, {0x1E}, {0x2C}, {0x26}, {0xFF} + }, { // MUCH + {0x2C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OVERWHELMING + {0x1A}, {0x32}, {0x0B}, {0x11}, {0x33}, {0xFF} + }, { // FABULOUS + {0x00}, {0x27}, {0x2C}, {0xFF}, {0xFF}, {0xFF} + }, { // ELSE + {0x0A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EXPENSIVE + {0x09}, {0x0A}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // CORRECT + {0x1A}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // IMPOSSIBLE + {0x0F}, {0x1D}, {0x2A}, {0x26}, {0xFF}, {0xFF} + }, { // SMALL + {0x1D}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DIFFERENT + {0x11}, {0x30}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // TIRED + {0x14}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SKILL + {0x11}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TOP + {0x17}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NON-STOP + {0x17}, {0x16}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PREPOSTEROUS + {0x2A}, {0x16}, {0x32}, {0x2C}, {0x33}, {0xFF} + }, { // NONE + {0x2C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NOTHING + {0x2C}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NATURAL + {0x02}, {0x32}, {0x26}, {0xFF}, {0xFF}, {0xFF} + }, { // BECOMES + {0x0E}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LUKEWARM + {0x29}, {0x1C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FAST + {0x02}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LOW + {0x1A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AWFUL + {0x08}, {0x26}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ALONE + {0x2C}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BORED + {0x1A}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SECRET + {0x0E}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MYSTERY + {0x11}, {0x30}, {0x0E}, {0xFF}, {0xFF}, {0xFF} + }, { // LACKS + {0x02}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BEST + {0x0B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LOUSY + {0x21}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MISTAKE + {0x11}, {0x05}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // KIND + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WELL + {0x0B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WEAKENED + {0x0E}, {0x0B}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SIMPLE + {0x0F}, {0x26}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SEEMS + {0x0D}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BADLY + {0x00}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + } +}; + +/*static*/ const struct BardSound BardMusic_ACTIONS[][6] = { + { // MEETS + {0x0E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CONCEDE + {0x2C}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GIVE + {0x10}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GIVES + {0x10}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PLAYED + {0x04}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PLAYS + {0x05}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // COLLECT + {0x2C}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WALKING + {0x06}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WALKS + {0x08}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SAYS + {0x0B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WENT + {0x09}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SAID + {0x09}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WAKE UP + {0x05}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WAKES UP + {0x05}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ANGERS + {0x03}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TEACH + {0x0D}, {0xFF}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TEACHES + {0x0C}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PLEASE + {0x0D}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LEARN + {0x30}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CHANGE + {0x03}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // STORY + {0x1A}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TRUST + {0x0B}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LAVISH + {0x01}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LISTENS + {0x11}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HEARING + {0x11}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TRAINS + {0x03}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CHOOSE + {0x27}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // COME + {0x2C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CAME + {0x03}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SEARCH + {0x32}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MAKE + {0x05}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CAUSE + {0x1D}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // KNOW + {0x1A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // KNOWS + {0x18}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // REFUSE + {0x0C}, {0x2F}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // STORES + {0x1A}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BRAG + {0x02}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // IGNORANT + {0x11}, {0x1A}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // THINKS + {0x0E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BELIEVE + {0x0C}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SLIDE + {0x14}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EATS + {0x0E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // USE + {0x2F}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // USES + {0x2F}, {0x0A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // USING + {0x2F}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // COULDN’T + {0x26}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CAPABLE + {0x05}, {0x2C}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // DISAPPEAR + {0x11}, {0x2C}, {0x30}, {0x33}, {0xFF}, {0xFF} + }, { // APPEAR + {0x2C}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THROW + {0x1A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WORRY + {0x32}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SLEPT + {0x0B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SLEEP + {0x0E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RELEASE + {0x0C}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DRINKS + {0x0E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RUNS + {0x2C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RUN + {0x2C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WORKS + {0x32}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WORKING + {0x32}, {0x0D}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TALKING + {0x1B}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TALK + {0x1B}, {0xFF}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SINK + {0x0E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SMACK + {0x01}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PRETEND + {0x0E}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PRAISE + {0x05}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OVERDO + {0x18}, {0x30}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // SHOW + {0x1A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LOOKS + {0x26}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SEES + {0x0E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SEEK + {0x0E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OWN + {0x1A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TAKE + {0x05}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ALLOW + {0x2C}, {0x23}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FORGET + {0x1A}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FORGETS + {0x1A}, {0x0A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // APPEARS + {0x2C}, {0x0D}, {0x33}, {0x33}, {0xFF}, {0xFF} + }, { // FAINT + {0x03}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FAINTED + {0x03}, {0x0A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + } +}; + +/*static*/ const struct BardSound BardMusic_LIFESTYLE[][6] = { + { // CHORES + {0x31}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HOME + {0x1A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MONEY + {0x2C}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ALLOWANCE + {0x2A}, {0x23}, {0x02}, {0x33}, {0xFF}, {0xFF} + }, { // BATH + {0x02}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CONVERSATION + {0x2A}, {0x32}, {0x03}, {0x2C}, {0x33}, {0xFF} + }, { // SCHOOL + {0x29}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // COMMEMORATE + {0x2C}, {0x0B}, {0x32}, {0x05}, {0xFF}, {0xFF} + }, { // HABIT + {0x00}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GROUP + {0x27}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WORD + {0x30}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // STORE + {0x18}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SERVICE + {0x32}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WORK + {0x32}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SYSTEM + {0x11}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TRAIN + {0x30}, {0x03}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CLASS + {0x02}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LESSONS + {0x09}, {0x1D}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // INFORMATION + {0x0F}, {0x30}, {0x05}, {0x2C}, {0x33}, {0xFF} + }, { // LIVING + {0x11}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TEACHER + {0x0C}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TOURNAMENT + {0x32}, {0x2A}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // LETTER + {0x0B}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EVENT + {0x0C}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DIGITAL + {0x11}, {0x11}, {0x2C}, {0xFF}, {0xFF}, {0xFF} + }, { // TEST + {0x0B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DEPT. STORE + {0x0C}, {0x1B}, {0x0B}, {0x1A}, {0xFF}, {0xFF} + }, { // TELEVISION + {0x09}, {0x2C}, {0x11}, {0x1B}, {0x33}, {0xFF} + }, { // PHONE + {0x18}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ITEM + {0x12}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NAME + {0x03}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NEWS + {0x27}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // POPULAR + {0x1D}, {0x27}, {0x32}, {0xFF}, {0xFF}, {0xFF} + }, { // PARTY + {0x1C}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // STUDY + {0x2C}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MACHINE + {0x2C}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MAIL + {0x03}, {0x24}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MESSAGE + {0x0B}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PROMISE + {0x1D}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DREAM + {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // KINDERGARTEN + {0x0F}, {0x32}, {0x17}, {0x0F}, {0x33}, {0xFF} + }, { // LIFE + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RADIO + {0x03}, {0x0C}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // RENTAL + {0x0B}, {0x26}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WORLD + {0x32}, {0x24}, {0x33}, {0xFF}, {0xFF}, {0xFF} + } +}; + +/*static*/ const struct BardSound BardMusic_HOBBIES[][6] = { + { // IDOL + {0x14}, {0x1A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ANIME + {0x00}, {0x2C}, {0x05}, {0xFF}, {0xFF}, {0xFF} + }, { // SONG + {0x17}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MOVIE + {0x27}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SWEETS + {0x0E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CHAT + {0x01}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CHILD’S PLAY + {0x14}, {0x26}, {0x04}, {0xFF}, {0xFF}, {0xFF} + }, { // TOYS + {0x1E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MUSIC + {0x2F}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CARDS + {0x17}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SHOPPING + {0x15}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CAMERA + {0x00}, {0x32}, {0x2C}, {0xFF}, {0xFF}, {0xFF} + }, { // VIEWING + {0x2F}, {0x0C}, {0x33}, {0x33}, {0xFF}, {0xFF} + }, { // SPECTATOR + {0x0B}, {0x05}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // GOURMET + {0x26}, {0x05}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GAME + {0x03}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RPG + {0x1B}, {0x0C}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // COLLECTION + {0x2C}, {0x0B}, {0x1B}, {0x33}, {0x33}, {0xFF} + }, { // COMPLETE + {0x2C}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MAGAZINE + {0x02}, {0x2C}, {0x0C}, {0x33}, {0xFF}, {0xFF} + }, { // WALK + {0x1B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BIKE + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HOBBY + {0x15}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SPORTS + {0x1A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SOFTWARE + {0x17}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SONGS + {0x17}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DIET + {0x14}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TREASURE + {0x0A}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TRAVEL + {0x00}, {0x26}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DANCE + {0x00}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CHANNEL + {0x00}, {0x26}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MAKING + {0x05}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FISHING + {0x11}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DATE + {0x05}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DESIGN + {0x0E}, {0x12}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LOCOMOTIVE + {0x1A}, {0x2C}, {0x1A}, {0x11}, {0xFF}, {0xFF} + }, { // PLUSH DOLL + {0x2C}, {0x1D}, {0x33}, {0x33}, {0xFF}, {0xFF} + }, { // PC + {0x0E}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FLOWERS + {0x21}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HERO + {0x0C}, {0x1A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NAP + {0x02}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HEROINE + {0x0C}, {0x1A}, {0x0F}, {0x33}, {0xFF}, {0xFF} + }, { // FASHION + {0x01}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ADVENTURE + {0x00}, {0x0B}, {0x32}, {0xFF}, {0xFF}, {0xFF} + }, { // BOARD + {0x1A}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BALL + {0x1B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BOOK + {0x26}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FESTIVAL + {0x0B}, {0x0E}, {0x08}, {0xFF}, {0xFF}, {0xFF} + }, { // COMICS + {0x1B}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HOLIDAY + {0x1D}, {0x11}, {0x05}, {0xFF}, {0xFF}, {0xFF} + }, { // PLANS + {0x02}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TRENDY + {0x09}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // VACATION + {0x03}, {0x05}, {0x1D}, {0x33}, {0xFF}, {0xFF} + }, { // LOOK + {0x26}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + } +}; + +/*static*/ const struct BardSound BardMusic_TIME[][6] = { + { // FALL + {0x1B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MORNING + {0x1A}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TOMORROW + {0x27}, {0x1C}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // LAST + {0x02}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DAY + {0x05}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SOMETIME + {0x2C}, {0x14}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ALWAYS + {0x1B}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CURRENT + {0x09}, {0x0F}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FOREVER + {0x18}, {0x09}, {0x2C}, {0xFF}, {0xFF}, {0xFF} + }, { // DAYS + {0x05}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // END + {0x0B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TUESDAY + {0x27}, {0x05}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // YESTERDAY + {0x0B}, {0x32}, {0x05}, {0xFF}, {0xFF}, {0xFF} + }, { // TODAY + {0x27}, {0x05}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FRIDAY + {0x12}, {0x05}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MONDAY + {0x2C}, {0x05}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LATER + {0x05}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EARLIER + {0x30}, {0x0C}, {0x32}, {0xFF}, {0xFF}, {0xFF} + }, { // ANOTHER + {0x2A}, {0x2C}, {0x32}, {0xFF}, {0xFF}, {0xFF} + }, { // TIME + {0x14}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FINISH + {0x0F}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WEDNESDAY + {0x0A}, {0x05}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SOON + {0x28}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // START + {0x17}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MONTH + {0x2C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // STOP + {0x1D}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NOW + {0x21}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FINAL + {0x12}, {0x24}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NEXT + {0x09}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AGE + {0x05}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SATURDAY + {0x00}, {0x30}, {0x05}, {0xFF}, {0xFF}, {0xFF} + }, { // SUMMER + {0x2C}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SUNDAY + {0x2C}, {0x05}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BEGINNING + {0x0E}, {0x0F}, {0x0C}, {0x33}, {0xFF}, {0xFF} + }, { // SPRING + {0x0C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DAYTIME + {0x05}, {0x12}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WINTER + {0x0F}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DAILY + {0x05}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OLDEN + {0x1A}, {0x0A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ALMOST + {0x1B}, {0x1A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NEARLY + {0x0E}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THURSDAY + {0x30}, {0x05}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NIGHTTIME + {0x14}, {0x12}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NIGHT + {0x14}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WEEK + {0x0E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + } +}; + +/*static*/ const struct BardSound BardMusic_MISC[][6] = { + { // HIGHS + {0x14}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LOWS + {0x18}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // UM + {0x2B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // REAR + {0x2A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THINGS + {0x0C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THING + {0x0C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BELOW + {0x0C}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ABOVE + {0x2A}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BACK + {0x00}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HIGH + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HERE + {0x0C}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // INSIDE + {0x0F}, {0x12}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OUTSIDE + {0x21}, {0x12}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BESIDE + {0x0E}, {0x12}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THIS IS IT! + {0x11}, {0x11}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // THIS + {0x11}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EVERY + {0x09}, {0x30}, {0x0E}, {0xFF}, {0xFF}, {0xFF} + }, { // THESE + {0x0C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THESE WERE + {0x0E}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DOWN + {0x21}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THAT + {0x02}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THOSE ARE + {0x18}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THOSE WERE + {0x18}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THAT’S IT! + {0x01}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AM + {0x00}, {0x10}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THAT WAS + {0x00}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FRONT + {0x2B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // UP + {0x2A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CHOICE + {0x0F}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FAR + {0x1B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AWAY + {0x2C}, {0x04}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NEAR + {0x0C}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WHERE + {0x09}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WHEN + {0x10}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WHAT + {0x2C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DEEP + {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // SHALLOW + {0x01}, {0x1A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WHY + {0x14}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CONFUSED + {0x2A}, {0x2E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OPPOSITE + {0x1D}, {0x1A}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // LEFT + {0x09}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RIGHT + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + } +}; + +/*static*/ const struct BardSound BardMusic_ADJECTIVES[][6] = { + { // WANDERING + {0x1D}, {0x32}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // RICKETY + {0x11}, {0x09}, {0x0E}, {0xFF}, {0xFF}, {0xFF} + }, { // ROCK-SOLID + {0x1B}, {0x1B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // HUNGRY + {0x2A}, {0x30}, {0x0E}, {0xFF}, {0xFF}, {0xFF} + }, { // TIGHT + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TICKLISH + {0x11}, {0x24}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // TWIRLING + {0x30}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SPIRALING + {0x12}, {0x08}, {0x0E}, {0x33}, {0xFF}, {0xFF} + }, { // THIRSTY + {0x30}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LOLLING + {0x2C}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SILKY + {0x11}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SADLY + {0x00}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HOPELESS + {0x18}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // USELESS + {0x2D}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DROOLING + {0x27}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EXCITING + {0x09}, {0x12}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // THICK + {0x11}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SMOOTH + {0x27}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SLIMY + {0x12}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THIN + {0x0F}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BREAK + {0x05}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // VORACIOUS + {0x32}, {0x05}, {0x2C}, {0x33}, {0xFF}, {0xFF} + }, { // SCATTER + {0x00}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AWESOME + {0x1B}, {0x2C}, {0x33}, {0x33}, {0xFF}, {0xFF} + }, { // WIMPY + {0x11}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WOBBLY + {0x1D}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SHAKY + {0x03}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RIPPED + {0x11}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SHREDDED + {0x09}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // INCREASING + {0x0F}, {0x0C}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // YET + {0x09}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DESTROYED + {0x0C}, {0x1E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FIERY + {0x14}, {0x32}, {0x0E}, {0xFF}, {0xFF}, {0xFF} + }, { // LOVEY-DOVEY + {0x2C}, {0x0E}, {0x2C}, {0x0E}, {0xFF}, {0xFF} + }, { // HAPPILY + {0x00}, {0x2C}, {0x0E}, {0xFF}, {0xFF}, {0xFF} + }, { // ANTICIPATION + {0x00}, {0x11}, {0x11}, {0x03}, {0x1D}, {0x33} + } +}; + +/*static*/ const struct BardSound BardMusic_EVENTS[][6] = { + { // APPEAL + {0x2C}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EVENTS + {0x0C}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // STAY-AT-HOME + {0x03}, {0x00}, {0x18}, {0x33}, {0x33}, {0xFF} + }, { // BERRY + {0x09}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CONTEST + {0x1D}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MC + {0x09}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // JUDGE + {0x2B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SUPER + {0x27}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // STAGE + {0x05}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HALL OF FAME + {0x15}, {0x2C}, {0x04}, {0x33}, {0xFF}, {0xFF} + }, { // EVOLUTION + {0x1A}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HYPER + {0x12}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BATTLE TOWER + {0x02}, {0x2C}, {0x21}, {0x30}, {0xFF}, {0xFF} + }, { // LEADERS + {0x0C}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BATTLE ROOM + {0x00}, {0x2C}, {0x27}, {0xFF}, {0xFF}, {0xFF} + }, { // HIDDEN + {0x11}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SECRET BASE + {0x0C}, {0x09}, {0x04}, {0x33}, {0xFF}, {0xFF} + }, { // BLEND + {0x0A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // POKEBLOCK + {0x18}, {0x0C}, {0x1D}, {0x33}, {0xFF}, {0xFF} + }, { // MASTER + {0x00}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RANK + {0x03}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RIBBON + {0x11}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + } +}; + +/*static*/ const struct BardSound BardMusic_MOVE_1[][6] = { + { // THUNDERBOLT + {0x2A}, {0x30}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // IRON_TAIL + {0x12}, {0x1B}, {0x05}, {0x33}, {0xFF}, {0xFF} + }, { // ICE_BALL + {0x12}, {0x1B}, {0x33}, {0x33}, {0xFF}, {0xFF} + }, { // YAWN + {0x1B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LOVELY_KISS + {0x2C}, {0x2C}, {0x0C}, {0x11}, {0x33}, {0xFF} + }, { // NIGHTMARE + {0x12}, {0x05}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MORNING_SUN + {0x1A}, {0x0E}, {0x2C}, {0x33}, {0xFF}, {0xFF} + }, { // VITAL_THROW + {0x12}, {0x24}, {0x18}, {0x33}, {0xFF}, {0xFF} + }, { // DIG + {0x11}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THRASH + {0x30}, {0x02}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SWEET_SCENT + {0x0E}, {0x0B}, {0x33}, {0x33}, {0xFF}, {0xFF} + }, { // CHARM + {0x15}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RAIN_DANCE + {0x03}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CONFUSE_RAY + {0x1B}, {0x2D}, {0x03}, {0x33}, {0xFF}, {0xFF} + }, { // HAIL + {0x05}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AROMATHERAPY + {0x2A}, {0x18}, {0x2C}, {0x00}, {0x1B}, {0x0E} + }, { // BUBBLE + {0x2C}, {0x24}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ENCORE + {0x1B}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CUT + {0x2A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RAGE + {0x03}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SUPER_FANG + {0x27}, {0x30}, {0x01}, {0x33}, {0xFF}, {0xFF} + }, { // PAIN_SPLIT + {0x03}, {0x0F}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TORMENT + {0x18}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // STRING_SHOT + {0x32}, {0x0C}, {0x1B}, {0xFF}, {0xFF}, {0xFF} + }, { // SWAGGER + {0x02}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SNORE + {0x18}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HEAL_BELL + {0x0E}, {0x0A}, {0x33}, {0x33}, {0xFF}, {0xFF} + }, { // SCREECH + {0x30}, {0x0D}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ROCK_THROW + {0x1B}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ROCK_SMASH + {0x1B}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ROCK_SLIDE + {0x1B}, {0x12}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WEATHER_BALL + {0x09}, {0x30}, {0x1B}, {0x33}, {0xFF}, {0xFF} + }, { // WHIRLPOOL + {0x30}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FAKE_TEARS + {0x03}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SING + {0x0C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SPITE + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AIR_CUTTER + {0x05}, {0x2A}, {0x30}, {0x33}, {0xFF}, {0xFF} + }, { // AEROBLAST + {0x05}, {0x18}, {0x00}, {0x33}, {0xFF}, {0xFF} + }, { // SMOKESCREEN + {0x1A}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PURSUIT + {0x30}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DOUBLE_SLAP + {0x2A}, {0x0A}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // MIRROR_MOVE + {0x0C}, {0x32}, {0x29}, {0xFF}, {0xFF}, {0xFF} + }, { // OVERHEAT + {0x18}, {0x30}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // AURORA_BEAM + {0x1B}, {0x1A}, {0x2C}, {0x0C}, {0x33}, {0xFF} + }, { // MEMENTO + {0x2A}, {0x09}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // OCTAZOOKA + {0x1B}, {0x2C}, {0x28}, {0x2C}, {0xFF}, {0xFF} + }, { // FLATTER + {0x00}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ASTONISH + {0x2A}, {0x1B}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // WILL_O_WISP + {0x11}, {0x18}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // RETURN + {0x0C}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GRUDGE + {0x2B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // STRENGTH + {0x32}, {0x03}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // COUNTER + {0x21}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FLAME_WHEEL + {0x03}, {0x0E}, {0x33}, {0x33}, {0xFF}, {0xFF} + }, { // FLAMETHROWER + {0x00}, {0x1A}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // ODOR_SLEUTH + {0x18}, {0x30}, {0x27}, {0x33}, {0xFF}, {0xFF} + }, { // SHARPEN + {0x1B}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DOUBLE_TEAM + {0x2C}, {0x2C}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // GUST + {0x2C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HARDEN + {0x1B}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DISABLE + {0x11}, {0x03}, {0x24}, {0xFF}, {0xFF}, {0xFF} + }, { // RAZOR_WIND + {0x05}, {0x30}, {0x0F}, {0x33}, {0xFF}, {0xFF} + }, { // BIDE + {0x0B}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CRUNCH + {0x30}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BITE + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THUNDER + {0x2A}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THUNDER_PUNCH + {0x2A}, {0x30}, {0x2C}, {0xFF}, {0xFF}, {0xFF} + }, { // ENDEAVOR + {0x09}, {0x09}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // FACADE + {0x2C}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // KARATE_CHOP + {0x2C}, {0x1D}, {0x0E}, {0x1D}, {0xFF}, {0xFF} + }, { // CLAMP + {0x00}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WITHDRAW + {0x11}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CONSTRICT + {0x1B}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BRICK_BREAK + {0x11}, {0x05}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ROCK_TOMB + {0x1B}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FOCUS_ENERGY + {0x1A}, {0x2C}, {0x0B}, {0x30}, {0x0C}, {0xFF} + }, { // FOCUS_PUNCH + {0x18}, {0x2C}, {0x2C}, {0xFF}, {0xFF}, {0xFF} + }, { // GIGA_DRAIN + {0x11}, {0x2A}, {0x03}, {0x33}, {0xFF}, {0xFF} + }, { // REVERSAL + {0x0C}, {0x30}, {0x24}, {0xFF}, {0xFF}, {0xFF} + }, { // SMELLING_SALT + {0x09}, {0x0C}, {0x1B}, {0xFF}, {0xFF}, {0xFF} + }, { // SPORE + {0x1A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LEECH_LIFE + {0x0C}, {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF} + }, { // SLASH + {0x00}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SILVER_WIND + {0x11}, {0x30}, {0x0F}, {0xFF}, {0xFF}, {0xFF} + }, { // METAL_SOUND + {0x09}, {0x1B}, {0x21}, {0xFF}, {0xFF}, {0xFF} + }, { // GRASS_WHISTLE + {0x00}, {0x11}, {0x24}, {0xFF}, {0xFF}, {0xFF} + }, { // TICKLE + {0x11}, {0x24}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SPIDER_WEB + {0x12}, {0x30}, {0x09}, {0xFF}, {0xFF}, {0xFF} + }, { // CRABHAMMER + {0x02}, {0x00}, {0x30}, {0x33}, {0xFF}, {0xFF} + }, { // HAZE + {0x03}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MEAN_LOOK + {0x0C}, {0x24}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CROSS_CHOP + {0x1B}, {0x1D}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OUTRAGE + {0x21}, {0x03}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LOW_KICK + {0x18}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ANCIENT_POWER + {0x03}, {0x0C}, {0x21}, {0x32}, {0x33}, {0xFF} + }, { // SYNTHESIS + {0x0F}, {0x2A}, {0x0F}, {0xFF}, {0xFF}, {0xFF} + }, { // AGILITY + {0x2A}, {0x11}, {0x11}, {0x0E}, {0xFF}, {0xFF} + }, { // RAPID_SPIN + {0x00}, {0x0F}, {0x0F}, {0xFF}, {0xFF}, {0xFF} + }, { // ICY_WIND + {0x12}, {0x0C}, {0x0F}, {0xFF}, {0xFF}, {0xFF} + }, { // MIND_READER + {0x12}, {0x0C}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // COSMIC_POWER + {0x1B}, {0x11}, {0x21}, {0x30}, {0xFF}, {0xFF} + }, { // SKY_ATTACK + {0x12}, {0x2A}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // POWDER_SNOW + {0x21}, {0x30}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // FOLLOW_ME + {0x15}, {0x18}, {0x0C}, {0x33}, {0xFF}, {0xFF} + }, { // METEOR_MASH + {0x0C}, {0x0C}, {0x18}, {0x00}, {0x33}, {0x33} + }, { // ENDURE + {0x09}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ROLLOUT + {0x1A}, {0x21}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SCARY_FACE + {0x03}, {0x0C}, {0x03}, {0xFF}, {0xFF}, {0xFF} + }, { // PSYBEAM + {0x12}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PSYWAVE + {0x12}, {0x03}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PSYCHIC + {0x12}, {0x0F}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HYPNOSIS + {0x11}, {0x18}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // UPROAR + {0x2C}, {0x1A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WATER_SPOUT + {0x1B}, {0x30}, {0x21}, {0xFF}, {0xFF}, {0xFF} + }, { // SIGNAL_BEAM + {0x11}, {0x1B}, {0x0C}, {0x33}, {0xFF}, {0xFF} + }, { // PSYCH_UP + {0x12}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SUBMISSION + {0x2A}, {0x11}, {0x0B}, {0xFF}, {0xFF}, {0xFF} + }, { // RECOVER + {0x0C}, {0x2C}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // EARTHQUAKE + {0x30}, {0x05}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NATURE_POWER + {0x03}, {0x30}, {0x21}, {0x30}, {0xFF}, {0xFF} + }, { // LICK + {0x11}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FLAIL + {0x05}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TAIL_WHIP + {0x05}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SELF_DESTRUCT + {0x09}, {0x0C}, {0x2A}, {0x33}, {0xFF}, {0xFF} + }, { // STUN_SPORE + {0x2C}, {0x1A}, {0x33}, {0x33}, {0xFF}, {0xFF} + }, { // BIND + {0x14}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SHADOW_PUNCH + {0x00}, {0x18}, {0x2C}, {0xFF}, {0xFF}, {0xFF} + }, { // SHADOW_BALL + {0x00}, {0x18}, {0x1B}, {0xFF}, {0xFF}, {0xFF} + }, { // CHARGE + {0x1B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MIST + {0x11}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FISSURE + {0x11}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EXTREME_SPEED + {0x09}, {0x0C}, {0x0C}, {0x33}, {0xFF}, {0xFF} + }, { // EXTRASENSORY + {0x09}, {0x2A}, {0x09}, {0x18}, {0x0C}, {0xFF} + }, { // SAFEGUARD + {0x03}, {0x1B}, {0x33}, {0x33}, {0xFF}, {0xFF} + }, { // ABSORB + {0x2A}, {0x1A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SKY_UPPERCUT + {0x12}, {0x2C}, {0x30}, {0x2A}, {0xFF}, {0xFF} + }, { // SKILL_SWAP + {0x11}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SKETCH + {0x09}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HEADBUTT + {0x09}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DOUBLE_EDGE + {0x2C}, {0x24}, {0x0A}, {0xFF}, {0xFF}, {0xFF} + }, { // SANDSTORM + {0x00}, {0x1A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SAND_ATTACK + {0x00}, {0x2A}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // SAND_TOMB + {0x00}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SPARK + {0x1B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SWIFT + {0x11}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // KINESIS + {0x0F}, {0x0C}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SMOG + {0x1B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GROWTH + {0x30}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SACRED_FIRE + {0x03}, {0x11}, {0x12}, {0x30}, {0x33}, {0xFF} + }, { // SHEER_COLD + {0x0E}, {0x30}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // SOLAR_BEAM + {0x18}, {0x30}, {0x0C}, {0x33}, {0xFF}, {0xFF} + }, { // SONIC_BOOM + {0x1B}, {0x11}, {0x27}, {0x33}, {0xFF}, {0xFF} + }, { // FLY + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + } +}; + +/*static*/ const struct BardSound BardMusic_MOVE_2[][6] = { + { // TACKLE + {0x00}, {0x24}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EXPLOSION + {0x09}, {0x18}, {0x2C}, {0x33}, {0x33}, {0xFF} + }, { // DIVE + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FIRE_BLAST + {0x12}, {0x30}, {0x00}, {0x33}, {0xFF}, {0xFF} + }, { // WATERFALL + {0x1D}, {0x30}, {0x1D}, {0x33}, {0xFF}, {0xFF} + }, { // MUDDY_WATER + {0x2A}, {0x0C}, {0x1B}, {0x30}, {0xFF}, {0xFF} + }, { // STOCKPILE + {0x1B}, {0x14}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SLAM + {0x00}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TWISTER + {0x11}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BULLET_SEED + {0x2A}, {0x09}, {0x0C}, {0x33}, {0xFF}, {0xFF} + }, { // TWINEEDLE + {0x0F}, {0x0C}, {0x24}, {0xFF}, {0xFF}, {0xFF} + }, { // SOFT_BOILED + {0x1B}, {0x1E}, {0x0B}, {0x33}, {0xFF}, {0xFF} + }, { // EGG_BOMB + {0x09}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FAINT_ATTACK + {0x03}, {0x2A}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // BARRAGE + {0x30}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MINIMIZE + {0x0F}, {0x0F}, {0x12}, {0x33}, {0xFF}, {0xFF} + }, { // SEISMIC_TOSS + {0x12}, {0x11}, {0x1B}, {0x33}, {0xFF}, {0xFF} + }, { // SUPERSONIC + {0x27}, {0x30}, {0x1B}, {0x11}, {0xFF}, {0xFF} + }, { // TAUNT + {0x1B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MOONLIGHT + {0x27}, {0x12}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PECK + {0x09}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ARM_THRUST + {0x1B}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HORN_ATTACK + {0x18}, {0x2A}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // HORN_DRILL + {0x18}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WING_ATTACK + {0x0C}, {0x2A}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // AERIAL_ACE + {0x03}, {0x0C}, {0x2A}, {0x03}, {0xFF}, {0xFF} + }, { // SWORDS_DANCE + {0x1A}, {0x30}, {0x01}, {0x33}, {0xFF}, {0xFF} + }, { // VINE_WHIP + {0x12}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CONVERSION + {0x2A}, {0x30}, {0x2C}, {0x33}, {0xFF}, {0xFF} + }, { // CONVERSION_2 + {0x2A}, {0x30}, {0x2C}, {0x27}, {0x33}, {0xFF} + }, { // HELPING_HAND + {0x09}, {0x0C}, {0x00}, {0x33}, {0xFF}, {0xFF} + }, { // IRON_DEFENSE + {0x12}, {0x1B}, {0x0C}, {0x09}, {0xFF}, {0xFF} + }, { // TELEPORT + {0x09}, {0x0C}, {0x1A}, {0x33}, {0xFF}, {0xFF} + }, { // THUNDER_SHOCK + {0x2A}, {0x30}, {0x1B}, {0xFF}, {0xFF}, {0xFF} + }, { // SHOCK_WAVE + {0x1B}, {0x03}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // QUICK_ATTACK + {0x27}, {0x11}, {0x2A}, {0x00}, {0xFF}, {0xFF} + }, { // SWEET_KISS + {0x0E}, {0x11}, {0x33}, {0x33}, {0xFF}, {0xFF} + }, { // THUNDER_WAVE + {0x2A}, {0x30}, {0x05}, {0x33}, {0xFF}, {0xFF} + }, { // ZAP_CANNON + {0x00}, {0x01}, {0x2C}, {0x33}, {0xFF}, {0xFF} + }, { // BLOCK + {0x1B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HOWL + {0x21}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // POISON_GAS + {0x1E}, {0x1B}, {0x00}, {0x33}, {0xFF}, {0xFF} + }, { // TOXIC + {0x1B}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // POISON_FANG + {0x1E}, {0x2A}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // POISON_POWDER + {0x1E}, {0x2C}, {0x21}, {0x30}, {0xFF}, {0xFF} + }, { // POISON_STING + {0x1E}, {0x2C}, {0x0E}, {0x33}, {0xFF}, {0xFF} + }, { // SPIKE_CANNON + {0x14}, {0x00}, {0x1D}, {0xFF}, {0xFF}, {0xFF} + }, { // ACID_ARMOR + {0x00}, {0x11}, {0x1B}, {0x30}, {0xFF}, {0xFF} + }, { // TAKE_DOWN + {0x03}, {0x23}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // JUMP_KICK + {0x2C}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BOUNCE + {0x21}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HI_JUMP_KICK + {0x12}, {0x2C}, {0x11}, {0x33}, {0xFF}, {0xFF} + }, { // TRI_ATTACK + {0x12}, {0x2A}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // DRAGON_CLAW + {0x00}, {0x1B}, {0x1D}, {0xFF}, {0xFF}, {0xFF} + }, { // TRICK + {0x11}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TRIPLE_KICK + {0x11}, {0x24}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // DRILL_PECK + {0x11}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MUD_SPORT + {0x2A}, {0x18}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // MUD_SLAP + {0x2C}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // THIEF + {0x0C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AMNESIA + {0x02}, {0x0E}, {0x2C}, {0x33}, {0xFF}, {0xFF} + }, { // NIGHT_SHADE + {0x12}, {0x05}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GROWL + {0x21}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SLACK_OFF + {0x00}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SURF + {0x30}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ROLE_PLAY + {0x18}, {0x03}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NEEDLE_ARM + {0x0C}, {0x2A}, {0x1D}, {0xFF}, {0xFF}, {0xFF} + }, { // DOUBLE_KICK + {0x2A}, {0x2C}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SUNNY_DAY + {0x2A}, {0x0E}, {0x05}, {0xFF}, {0xFF}, {0xFF} + }, { // LEER + {0x0E}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WISH + {0x0F}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FAKE_OUT + {0x03}, {0x21}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SLEEP_TALK + {0x0E}, {0x1D}, {0x33}, {0x33}, {0xFF}, {0xFF} + }, { // PAY_DAY + {0x05}, {0x05}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ASSIST + {0x2A}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HEAT_WAVE + {0x0C}, {0x03}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SLEEP_POWDER + {0x0C}, {0x21}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // REST + {0x09}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // INGRAIN + {0x0F}, {0x03}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CONFUSION + {0x2C}, {0x29}, {0x2C}, {0x33}, {0xFF}, {0xFF} + }, { // BODY_SLAM + {0x1D}, {0x0C}, {0x02}, {0xFF}, {0xFF}, {0xFF} + }, { // SWALLOW + {0x1B}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CURSE + {0x30}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HYDRO_PUMP + {0x12}, {0x18}, {0x2A}, {0xFF}, {0xFF}, {0xFF} + }, { // HYPER_VOICE + {0x12}, {0x30}, {0x1E}, {0xFF}, {0xFF}, {0xFF} + }, { // HYPER_BEAM + {0x12}, {0x30}, {0x0C}, {0x33}, {0xFF}, {0xFF} + }, { // SUPERPOWER + {0x27}, {0x30}, {0x21}, {0x30}, {0xFF}, {0xFF} + }, { // STEEL_WING + {0x0E}, {0x0D}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SPIT_UP + {0x11}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DYNAMIC_PUNCH + {0x12}, {0x00}, {0x11}, {0x2C}, {0xFF}, {0xFF} + }, { // GUILLOTINE + {0x0C}, {0x2C}, {0x0E}, {0x33}, {0xFF}, {0xFF} + }, { // VICE_GRIP + {0x14}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // KNOCK_OFF + {0x1B}, {0x1D}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // POUND + {0x21}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RAZOR_LEAF + {0x05}, {0x30}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // BATON_PASS + {0x2A}, {0x1B}, {0x00}, {0x33}, {0xFF}, {0xFF} + }, { // PETAL_DANCE + {0x09}, {0x2C}, {0x02}, {0x33}, {0xFF}, {0xFF} + }, { // SPLASH + {0x00}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BUBBLE_BEAM + {0x2A}, {0x24}, {0x0C}, {0x33}, {0xFF}, {0xFF} + }, { // BELLY_DRUM + {0x09}, {0x0C}, {0x2A}, {0x33}, {0xFF}, {0xFF} + }, { // BARRIER + {0x05}, {0x0E}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // LIGHT_SCREEN + {0x12}, {0x0C}, {0x33}, {0x33}, {0xFF}, {0xFF} + }, { // SCRATCH + {0x00}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HYPER_FANG + {0x12}, {0x30}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // EMBER + {0x09}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SECRET_POWER + {0x0C}, {0x09}, {0x21}, {0x30}, {0xFF}, {0xFF} + }, { // DIZZY_PUNCH + {0x11}, {0x0E}, {0x2C}, {0xFF}, {0xFF}, {0xFF} + }, { // BULK_UP + {0x2C}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // IMPRISON + {0x0F}, {0x0F}, {0x2C}, {0x33}, {0xFF}, {0xFF} + }, { // FEATHER_DANCE + {0x09}, {0x30}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // WHIRLWIND + {0x2C}, {0x1D}, {0x0E}, {0x1D}, {0xFF}, {0xFF} + }, { // BEAT_UP + {0x0C}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BLIZZARD + {0x0F}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // STOMP + {0x1D}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FLASH + {0x00}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TEETER_DANCE + {0x0C}, {0x30}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // CRUSH_CLAW + {0x2C}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BLAZE_KICK + {0x05}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PRESENT + {0x09}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ERUPTION + {0x0C}, {0x2C}, {0x1D}, {0x33}, {0xFF}, {0xFF} + }, { // SLUDGE + {0x2C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SLUDGE_BOMB + {0x2B}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GLARE + {0x05}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TRANSFORM + {0x00}, {0x1A}, {0x33}, {0x33}, {0xFF}, {0xFF} + }, { // POISON_TAIL + {0x1E}, {0x2C}, {0x05}, {0x33}, {0xFF}, {0xFF} + }, { // ROAR + {0x1A}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BONE_RUSH + {0x18}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CAMOUFLAGE + {0x00}, {0x18}, {0x1B}, {0x33}, {0xFF}, {0xFF} + }, { // COVET + {0x2A}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TAIL_GLOW + {0x04}, {0x1A}, {0x33}, {0x33}, {0xFF}, {0xFF} + }, { // BONE_CLUB + {0x18}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BONEMERANG + {0x18}, {0x30}, {0x00}, {0x33}, {0xFF}, {0xFF} + }, { // FIRE_SPIN + {0x12}, {0x30}, {0x0F}, {0x33}, {0xFF}, {0xFF} + }, { // FIRE_PUNCH + {0x12}, {0x30}, {0x2A}, {0xFF}, {0xFF}, {0xFF} + }, { // PERISH_SONG + {0x09}, {0x11}, {0x1B}, {0x33}, {0xFF}, {0xFF} + }, { // WRAP + {0x00}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SPIKES + {0x12}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MAGNITUDE + {0x00}, {0x0F}, {0x27}, {0xFF}, {0xFF}, {0xFF} + }, { // MAGICAL_LEAF + {0x00}, {0x11}, {0x24}, {0x0C}, {0x33}, {0xFF} + }, { // MAGIC_COAT + {0x00}, {0x11}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // MUD_SHOT + {0x2C}, {0x1D}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MACH_PUNCH + {0x1B}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PROTECT + {0x18}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DEFENSE_CURL + {0x0E}, {0x0B}, {0x32}, {0xFF}, {0xFF}, {0xFF} + }, { // ROLLING_KICK + {0x18}, {0x0C}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SUBSTITUTE + {0x2A}, {0x11}, {0x27}, {0xFF}, {0xFF}, {0xFF} + }, { // DETECT + {0x0C}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PIN_MISSILE + {0x0F}, {0x11}, {0x24}, {0xFF}, {0xFF}, {0xFF} + }, { // WATER_SPORT + {0x1B}, {0x30}, {0x1A}, {0x33}, {0xFF}, {0xFF} + }, { // WATER_GUN + {0x1D}, {0x32}, {0x2C}, {0xFF}, {0xFF}, {0xFF} + }, { // MIST_BALL + {0x11}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WATER_PULSE + {0x1B}, {0x30}, {0x2C}, {0x33}, {0xFF}, {0xFF} + }, { // FURY_ATTACK + {0x30}, {0x0C}, {0x2A}, {0x02}, {0xFF}, {0xFF} + }, { // FURY_SWIPES + {0x30}, {0x0C}, {0x12}, {0x33}, {0xFF}, {0xFF} + }, { // DESTINY_BOND + {0x09}, {0x0F}, {0x0C}, {0x1B}, {0xFF}, {0xFF} + }, { // FALSE_SWIPE + {0x1B}, {0x12}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FORESIGHT + {0x1A}, {0x14}, {0x33}, {0x33}, {0xFF}, {0xFF} + }, { // MIRROR_COAT + {0x09}, {0x30}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // FUTURE_SIGHT + {0x27}, {0x30}, {0x12}, {0x33}, {0xFF}, {0xFF} + }, { // MILK_DRINK + {0x11}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CALM_MIND + {0x1B}, {0x12}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MEGA_DRAIN + {0x03}, {0x2C}, {0x03}, {0x33}, {0xFF}, {0xFF} + }, { // MEGA_KICK + {0x03}, {0x2A}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // MEGA_PUNCH + {0x03}, {0x2A}, {0x2C}, {0xFF}, {0xFF}, {0xFF} + }, { // MEGAHORN + {0x03}, {0x2A}, {0x1A}, {0x33}, {0xFF}, {0xFF} + }, { // HIDDEN_POWER + {0x0F}, {0x09}, {0x21}, {0x30}, {0xFF}, {0xFF} + }, { // METAL_CLAW + {0x09}, {0x24}, {0x1B}, {0x33}, {0xFF}, {0xFF} + }, { // ATTRACT + {0x2A}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MIMIC + {0x11}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FRUSTRATION + {0x2C}, {0x03}, {0x1B}, {0x33}, {0xFF}, {0xFF} + }, { // LEECH_SEED + {0x0C}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // METRONOME + {0x09}, {0x18}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // DREAM_EATER + {0x0E}, {0x0C}, {0x30}, {0x33}, {0xFF}, {0xFF} + }, { // ACID + {0x00}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MEDITATE + {0x09}, {0x11}, {0x03}, {0x33}, {0xFF}, {0xFF} + }, { // SNATCH + {0x00}, {0xFF}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LUSTER_PURGE + {0x2A}, {0x30}, {0x32}, {0xFF}, {0xFF}, {0xFF} + }, { // LEAF_BLADE + {0x0C}, {0x05}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RECYCLE + {0x0C}, {0x12}, {0x24}, {0xFF}, {0xFF}, {0xFF} + }, { // REFLECT + {0x0C}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // REFRESH + {0x0C}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // REVENGE + {0x0C}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DRAGON_RAGE + {0x00}, {0x1B}, {0x05}, {0x33}, {0x33}, {0xFF} + }, { // DRAGON_BREATH + {0x00}, {0x1B}, {0x0B}, {0x33}, {0x33}, {0xFF} + }, { // DRAGON_DANCE + {0x00}, {0x1B}, {0x00}, {0x33}, {0xFF}, {0xFF} + }, { // ICE_PUNCH + {0x2C}, {0x1D}, {0x0E}, {0x1D}, {0xFF}, {0xFF} + }, { // ICE_BEAM + {0x12}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FURY_CUTTER + {0x30}, {0x0C}, {0x2A}, {0x30}, {0xFF}, {0xFF} + }, { // COMET_PUNCH + {0x1D}, {0x0B}, {0x2C}, {0x33}, {0xFF}, {0xFF} + }, { // SKULL_BASH + {0x2A}, {0x33}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // LOCK_ON + {0x1B}, {0x1D}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ROCK_BLAST + {0x1B}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // COTTON_SPORE + {0x1D}, {0x1D}, {0x1A}, {0x33}, {0xFF}, {0xFF} + }, { // STRUGGLE + {0x2A}, {0x24}, {0x33}, {0xFF}, {0xFF}, {0xFF} + } +}; + +/*static*/ const struct BardSound BardMusic_TRENDY_SAYING[][6] = { + { // KTHX, BYE. + {0x05}, {0x02}, {0x14}, {0x33}, {0xFF}, {0xFF} + }, { // YES, SIR! + {0x0B}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AVANT GARDE + {0x1B}, {0x1B}, {0x17}, {0xFF}, {0xFF}, {0xFF} + }, { // COUPLE + {0x2C}, {0x26}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MUCH OBLIGED + {0x2C}, {0x2C}, {0x12}, {0xFF}, {0xFF}, {0xFF} + }, { // YEEHAW! + {0x0D}, {0x1D}, {0x33}, {0x33}, {0xFF}, {0xFF} + }, { // MEGA + {0x05}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // 1-HIT KO! + {0x2C}, {0x11}, {0x03}, {0x1A}, {0xFF}, {0xFF} + }, { // DESTINY + {0x0B}, {0x11}, {0x0E}, {0xFF}, {0xFF}, {0xFF} + }, { // CANCEL + {0x00}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // NEW + {0x27}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FLATTEN + {0x00}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // KIDDING + {0x11}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LOSER + {0x27}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LOSING + {0x27}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HAPPENING + {0x00}, {0x2C}, {0x0E}, {0x33}, {0xFF}, {0xFF} + }, { // HIP AND + {0x11}, {0x01}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SHAKE + {0x05}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SHADY + {0x05}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // UPBEAT + {0x2C}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MODERN + {0x1D}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SMELL YA + {0x0A}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BANG + {0x03}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // KNOCKOUT + {0x1D}, {0x23}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HASSLE + {0x2A}, {0x24}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WINNER + {0x0F}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FEVER + {0x0C}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WANNABE + {0x1D}, {0x2C}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // BABY + {0x05}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HEART + {0x1C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OLD + {0x18}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // YOUNG + {0x2B}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // UGLY + {0x2A}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + } +}; + +/*static*/ const struct BardSound BardMusic_POKEMON_2[][6] = { + { // EKANS + {0x09}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ARBOK + {0x06}, {0x17}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SEAKING + {0x0C}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ARIADOS + {0x1B}, {0x0C}, {0x2A}, {0x18}, {0xFF}, {0xFF} + }, { // CROCONAW + {0x1B}, {0x18}, {0x1B}, {0xFF}, {0xFF}, {0xFF} + }, { // UNOWN + {0x2A}, {0x1A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EEVEE + {0x0C}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GEODUDE + {0x0C}, {0x18}, {0x27}, {0xFF}, {0xFF}, {0xFF} + }, { // SPINARAK + {0x0F}, {0x30}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // PILOSWINE + {0x11}, {0x1A}, {0x12}, {0x33}, {0xFF}, {0xFF} + }, { // ONIX + {0x15}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ARCANINE + {0x06}, {0x03}, {0x12}, {0x33}, {0xFF}, {0xFF} + }, { // SUDOWOODO + {0x27}, {0x18}, {0x27}, {0x18}, {0xFF}, {0xFF} + }, { // WEEPINBELL + {0x0C}, {0x0F}, {0x0B}, {0x33}, {0xFF}, {0xFF} + }, { // VICTREEBEL + {0x11}, {0x0C}, {0x09}, {0x33}, {0xFF}, {0xFF} + }, { // WOOPER + {0x27}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SWINUB + {0x11}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SKARMORY + {0x1B}, {0x1A}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // AIPOM + {0x03}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ESPEON + {0x09}, {0x0C}, {0x1B}, {0x33}, {0xFF}, {0xFF} + }, { // HITMONCHAN + {0x11}, {0x15}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // ELEKID + {0x0B}, {0x0B}, {0x11}, {0x33}, {0xFF}, {0xFF} + }, { // ELECTABUZZ + {0x0C}, {0x09}, {0x2C}, {0x2C}, {0xFF}, {0xFF} + }, { // ENTEI + {0x09}, {0x03}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FERALIGATR + {0x30}, {0x00}, {0x0F}, {0x03}, {0x30}, {0xFF} + }, { // FURRET + {0x30}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OCTILLERY + {0x1B}, {0x11}, {0x30}, {0x0C}, {0xFF}, {0xFF} + }, { // PRIMEAPE + {0x12}, {0x03}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SENTRET + {0x09}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // STANTLER + {0x00}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SPEAROW + {0x0C}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FEAROW + {0x0C}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // OMASTAR + {0x18}, {0x00}, {0x15}, {0x33}, {0xFF}, {0xFF} + }, { // OMANYTE + {0x18}, {0x00}, {0x12}, {0x33}, {0xFF}, {0xFF} + }, { // GROWLITHE + {0x21}, {0x0F}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MACHAMP + {0x2A}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DRAGONITE + {0x00}, {0x15}, {0x12}, {0xFF}, {0xFF}, {0xFF} + }, { // PINSIR + {0x11}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SNORLAX + {0x18}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // KABUTO + {0x2A}, {0x27}, {0x1A}, {0xFF}, {0xFF}, {0xFF} + }, { // KABUTOPS + {0x2A}, {0x27}, {0x15}, {0x33}, {0xFF}, {0xFF} + }, { // HITMONTOP + {0x11}, {0x15}, {0x1D}, {0x33}, {0xFF}, {0xFF} + }, { // WARTORTLE + {0x08}, {0x30}, {0x24}, {0x33}, {0xFF}, {0xFF} + }, { // BLASTOISE + {0x00}, {0x1E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FARFETCHD + {0x06}, {0x0B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CUBONE + {0x2D}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MAROWAK + {0x00}, {0x1A}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // KANGASKHAN + {0x00}, {0x00}, {0x1B}, {0x33}, {0xFF}, {0xFF} + }, { // SUNFLORA + {0x2C}, {0x18}, {0x2C}, {0xFF}, {0xFF}, {0xFF} + }, { // CATERPIE + {0x00}, {0x30}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // GYARADOS + {0x1D}, {0x09}, {0x11}, {0x1D}, {0xFF}, {0xFF} + }, { // RAPIDASH + {0x00}, {0x11}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // NINETALES + {0x12}, {0x05}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GIRAFARIG + {0x30}, {0x00}, {0x2A}, {0x11}, {0xFF}, {0xFF} + }, { // BELLOSSOM + {0x09}, {0x1B}, {0x2C}, {0x33}, {0xFF}, {0xFF} + }, { // KINGDRA + {0x0C}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // KINGLER + {0x0C}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GLOOM + {0x27}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PINECO + {0x12}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GLIGAR + {0x12}, {0x1B}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // KRABBY + {0x00}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GRANBULL + {0x02}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CROBAT + {0x18}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ABRA + {0x00}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GENGAR + {0x09}, {0x08}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TAUROS + {0x1D}, {0x1A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MAGIKARP + {0x00}, {0x11}, {0x1B}, {0xFF}, {0xFF}, {0xFF} + }, { // MAGNEMITE + {0x00}, {0x09}, {0x12}, {0xFF}, {0xFF}, {0xFF} + }, { // GASTLY + {0x00}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HAUNTER + {0x15}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MACHOKE + {0x2A}, {0x1A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // KAKUNA + {0x2A}, {0x27}, {0x2A}, {0xFF}, {0xFF}, {0xFF} + }, { // PSYDUCK + {0x12}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PHANPY + {0x00}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RATTATA + {0x00}, {0x00}, {0x2C}, {0xFF}, {0xFF}, {0xFF} + }, { // GOLDUCK + {0x18}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GOLBAT + {0x1A}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GOLEM + {0x18}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GRAVELER + {0x00}, {0x09}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // VENONAT + {0x09}, {0x1A}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // RHYDON + {0x12}, {0x15}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RHYHORN + {0x14}, {0x1A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PUPITAR + {0x27}, {0x11}, {0x1B}, {0x33}, {0xFF}, {0xFF} + }, { // CORSOLA + {0x18}, {0x18}, {0x2A}, {0xFF}, {0xFF}, {0xFF} + }, { // HITMONLEE + {0x11}, {0x15}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // ZAPDOS + {0x00}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // JOLTEON + {0x1A}, {0x0C}, {0x15}, {0xFF}, {0xFF}, {0xFF} + }, { // SANDSHREW + {0x00}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SANDSLASH + {0x00}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SEADRA + {0x0C}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SHELLDER + {0x09}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // VAPOREON + {0x03}, {0x18}, {0x0C}, {0x15}, {0xFF}, {0xFF} + }, { // DEWGONG + {0x27}, {0x15}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SUICUNE + {0x0C}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // STARMIE + {0x1B}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SCYTHER + {0x12}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ZUBAT + {0x27}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BEEDRILL + {0x0C}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HYPNO + {0x11}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DROWZEE + {0x21}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SQUIRTLE + {0x30}, {0x24}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CELEBI + {0x09}, {0x09}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // WOBBUFFET + {0x1D}, {0x2C}, {0x09}, {0xFF}, {0xFF}, {0xFF} + }, { // DUGTRIO + {0x2C}, {0x0C}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // HORSEA + {0x1A}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EXEGGCUTE + {0x09}, {0x2C}, {0x27}, {0x33}, {0xFF}, {0xFF} + }, { // CHIKORITA + {0x11}, {0x18}, {0x0C}, {0x2A}, {0xFF}, {0xFF} + }, { // CHINCHOU + {0x0F}, {0x21}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SHUCKLE + {0x2A}, {0x26}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DIGLETT + {0x11}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // REMORAID + {0x09}, {0x18}, {0x03}, {0xFF}, {0xFF}, {0xFF} + }, { // DELIBIRD + {0x09}, {0x0C}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // HOUNDOUR + {0x23}, {0x1A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AMPHAROS + {0x00}, {0x06}, {0x18}, {0x33}, {0xFF}, {0xFF} + }, { // DODUO + {0x1A}, {0x27}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // DODRIO + {0x1A}, {0x0C}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // SMEARGLE + {0x30}, {0x26}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // KOFFING + {0x15}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TENTACRUEL + {0x09}, {0x2A}, {0x27}, {0x33}, {0xFF}, {0xFF} + }, { // TOGETIC + {0x18}, {0x09}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // TOGEPI + {0x18}, {0x09}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // GOLDEEN + {0x1A}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // METAPOD + {0x09}, {0x2A}, {0x15}, {0xFF}, {0xFF}, {0xFF} + }, { // DONPHAN + {0x1B}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // ODDISH + {0x15}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // EXEGGUTOR + {0x09}, {0x2C}, {0x09}, {0x32}, {0x33}, {0xFF} + }, { // NIDOKING + {0x12}, {0x18}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // NIDOQUEEN + {0x12}, {0x18}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // NIDORAN_F + {0x12}, {0x18}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // NIDORAN_M + {0x12}, {0x18}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // NIDORINA + {0x12}, {0x18}, {0x0C}, {0x2A}, {0xFF}, {0xFF} + }, { // NIDORINO + {0x12}, {0x18}, {0x0C}, {0x18}, {0xFF}, {0xFF} + }, { // MEOWTH + {0x0C}, {0x21}, {0x11}, {0xFF}, {0xFF}, {0xFF} + }, { // SNEASEL + {0x0C}, {0x26}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // POLIWHIRL + {0x15}, {0x0C}, {0x30}, {0xFF}, {0xFF}, {0xFF} + }, { // POLITOED + {0x1B}, {0x0C}, {0x18}, {0x33}, {0xFF}, {0xFF} + }, { // POLIWRATH + {0x15}, {0x0C}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // POLIWAG + {0x15}, {0x0C}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // QUAGSIRE + {0x00}, {0x12}, {0x32}, {0xFF}, {0xFF}, {0xFF} + }, { // NATU + {0x00}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // XATU + {0x00}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DUNSPARCE + {0x2A}, {0x1C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SEEL + {0x0E}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // STEELIX + {0x0C}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TYPHLOSION + {0x12}, {0x18}, {0x1B}, {0x33}, {0x33}, {0xFF} + }, { // DRAGONAIR + {0x00}, {0x15}, {0x0B}, {0x33}, {0xFF}, {0xFF} + }, { // BUTTERFREE + {0x2A}, {0x30}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // SCIZOR + {0x11}, {0x32}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HOPPIP + {0x1D}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BLISSEY + {0x11}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PARAS + {0x09}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PARASECT + {0x09}, {0x00}, {0x09}, {0xFF}, {0xFF}, {0xFF} + }, { // QWILFISH + {0x11}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MR_MIME + {0x11}, {0x30}, {0x12}, {0xFF}, {0xFF}, {0xFF} + }, { // TYROGUE + {0x12}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CLOYSTER + {0x1E}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TYRANITAR + {0x12}, {0x00}, {0x11}, {0x1B}, {0xFF}, {0xFF} + }, { // CLEFFA + {0x09}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WEEDLE + {0x0E}, {0x26}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PIKACHU + {0x0C}, {0x2A}, {0x27}, {0xFF}, {0xFF}, {0xFF} + }, { // CLEFABLE + {0x09}, {0x2A}, {0x24}, {0xFF}, {0xFF}, {0xFF} + }, { // PIDGEOT + {0x11}, {0x0C}, {0x15}, {0xFF}, {0xFF}, {0xFF} + }, { // PIDGEOTTO + {0x11}, {0x0C}, {0x18}, {0x18}, {0xFF}, {0xFF} + }, { // PICHU + {0x0C}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CLEFAIRY + {0x09}, {0x0B}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // CHARMANDER + {0x06}, {0x02}, {0x32}, {0x33}, {0xFF}, {0xFF} + }, { // STARYU + {0x1B}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CYNDAQUIL + {0x0F}, {0x2A}, {0x09}, {0x33}, {0xFF}, {0xFF} + }, { // SUNKERN + {0x2C}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TEDDIURSA + {0x09}, {0x0C}, {0x30}, {0x2C}, {0xFF}, {0xFF} + }, { // VOLTORB + {0x1A}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MOLTRES + {0x1A}, {0x09}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FLAREON + {0x03}, {0x0C}, {0x15}, {0xFF}, {0xFF}, {0xFF} + }, { // ALAKAZAM + {0x00}, {0x2C}, {0x2C}, {0x00}, {0xFF}, {0xFF} + }, { // MAGMAR + {0x00}, {0x1D}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FORRETRESS + {0x1A}, {0x09}, {0x09}, {0x33}, {0xFF}, {0xFF} + }, { // WIGGLYTUFF + {0x11}, {0x27}, {0x0C}, {0x2A}, {0x33}, {0xFF} + }, { // IVYSAUR + {0x14}, {0x0C}, {0x32}, {0x33}, {0xFF}, {0xFF} + }, { // BULBASAUR + {0x24}, {0x2A}, {0x30}, {0x33}, {0xFF}, {0xFF} + }, { // VENUSAUR + {0x0C}, {0x2C}, {0x30}, {0x33}, {0xFF}, {0xFF} + }, { // AERODACTYL + {0x03}, {0x18}, {0x00}, {0x18}, {0xFF}, {0xFF} + }, { // MAGBY + {0x00}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // IGGLYBUFF + {0x11}, {0x2A}, {0x0C}, {0x2A}, {0xFF}, {0xFF} + }, { // UMBREON + {0x2A}, {0x0C}, {0x1B}, {0x33}, {0xFF}, {0xFF} + }, { // ARTICUNO + {0x06}, {0x11}, {0x27}, {0x18}, {0xFF}, {0xFF} + }, { // JIGGLYPUFF + {0x11}, {0x27}, {0x0C}, {0x2A}, {0x33}, {0xFF} + }, { // SNUBBULL + {0x2C}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // BAYLEEF + {0x03}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // GRIMER + {0x12}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MUK + {0x2A}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HERACROSS + {0x09}, {0x2A}, {0x1B}, {0x33}, {0xFF}, {0xFF} + }, { // HOUNDOOM + {0x21}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PERSIAN + {0x32}, {0x11}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // LICKITUNG + {0x11}, {0x0C}, {0x2A}, {0xFF}, {0xFF}, {0xFF} + }, { // HO_OH + {0x18}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // HOOTHOOT + {0x27}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PIDGEY + {0x11}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PONYTA + {0x1A}, {0x0C}, {0x2A}, {0xFF}, {0xFF}, {0xFF} + }, { // SKIPLOOM + {0x11}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // PORYGON + {0x18}, {0x0C}, {0x15}, {0xFF}, {0xFF}, {0xFF} + }, { // PORYGON2 + {0x1A}, {0x0C}, {0x1B}, {0x27}, {0xFF}, {0xFF} + }, { // MAGCARGO + {0x00}, {0x1B}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // SLUGMA + {0x2C}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // QUILAVA + {0x11}, {0x06}, {0x08}, {0xFF}, {0xFF}, {0xFF} + }, { // BELLSPROUT + {0x0B}, {0x21}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // WEEZING + {0x0C}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MARILL + {0x08}, {0x10}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // AZUMARILL + {0x08}, {0x27}, {0x2C}, {0x10}, {0xFF}, {0xFF} + }, { // ELECTRODE + {0x0C}, {0x09}, {0x18}, {0xFF}, {0xFF}, {0xFF} + }, { // MANKEY + {0x00}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MANTINE + {0x00}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // DRATINI + {0x00}, {0x0C}, {0x0C}, {0xFF}, {0xFF}, {0xFF} + }, { // MEW + {0x2D}, {0xFF}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MEWTWO + {0x2D}, {0x27}, {0xFF}, {0xFF}, {0xFF}, {0xFF} + }, { // MILTANK + {0x11}, {0x03}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MISDREAVUS + {0x11}, {0x0C}, {0x2C}, {0x33}, {0xFF}, {0xFF} + }, { // SMOOCHUM + {0x27}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MEGANIUM + {0x03}, {0x09}, {0x0C}, {0x2A}, {0xFF}, {0xFF} + }, { // DITTO + {0x11}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TENTACOOL + {0x09}, {0x2A}, {0x27}, {0x33}, {0xFF}, {0xFF} + }, { // MAREEP + {0x1D}, {0x0E}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // FLAAFFY + {0x00}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // VENOMOTH + {0x09}, {0x1A}, {0x15}, {0xFF}, {0xFF}, {0xFF} + }, { // TANGELA + {0x02}, {0x09}, {0x2A}, {0xFF}, {0xFF}, {0xFF} + }, { // SLOWKING + {0x18}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SLOWBRO + {0x18}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // SLOWPOKE + {0x18}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // MURKROW + {0x30}, {0x18}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // YANMA + {0x00}, {0x2A}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // KADABRA + {0x2C}, {0x00}, {0x2C}, {0xFF}, {0xFF}, {0xFF} + }, { // LARVITAR + {0x15}, {0x11}, {0x15}, {0x33}, {0xFF}, {0xFF} + }, { // NOCTOWL + {0x1B}, {0x21}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RAIKOU + {0x12}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RAICHU + {0x12}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CHANSEY + {0x00}, {0x0C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // RATICATE + {0x00}, {0x0C}, {0x03}, {0xFF}, {0xFF}, {0xFF} + }, { // LAPRAS + {0x2C}, {0x00}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // VILEPLUME + {0x14}, {0x27}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LANTURN + {0x00}, {0x30}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // CHARMELEON + {0x06}, {0x0C}, {0x0C}, {0x15}, {0x33}, {0xFF} + }, { // CHARIZARD + {0x06}, {0x11}, {0x32}, {0x33}, {0x33}, {0xFF} + }, { // URSARING + {0x30}, {0x2C}, {0x0C}, {0x33}, {0xFF}, {0xFF} + }, { // JYNX + {0x0C}, {0x33}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // LUGIA + {0x27}, {0x0C}, {0x2A}, {0xFF}, {0xFF}, {0xFF} + }, { // MAGNETON + {0x00}, {0x09}, {0x2A}, {0xFF}, {0xFF}, {0xFF} + }, { // LEDIAN + {0x09}, {0x0C}, {0x00}, {0xFF}, {0xFF}, {0xFF} + }, { // LEDYBA + {0x09}, {0x0C}, {0x2A}, {0xFF}, {0xFF}, {0xFF} + }, { // VULPIX + {0x24}, {0x11}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // JUMPLUFF + {0x2C}, {0x2C}, {0x33}, {0xFF}, {0xFF}, {0xFF} + }, { // TOTODILE + {0x18}, {0x18}, {0x12}, {0xFF}, {0xFF}, {0xFF} + }, { // MACHOP + {0x2A}, {0x15}, {0x33}, {0xFF}, {0xFF}, {0xFF} + } +}; + +#endif //GUARD_DATA_BARD_MUSIC_H diff --git a/src/data/battle_strings_de.h b/src/data/battle_strings_de.h index f78d0bf14..a3d51f2a5 100755 --- a/src/data/battle_strings_de.h +++ b/src/data/battle_strings_de.h @@ -1227,7 +1227,7 @@ const u16 gMissStrings[] = BATTLE_TEXT_GroundMoveNegate, }; -const u16 BattleTextList_401512[] = +const u16 gNoEscapeStringIds[] = { BATTLE_TEXT_CantEscape2, BATTLE_TEXT_BirchDontLeaveMe, @@ -1236,7 +1236,7 @@ const u16 BattleTextList_401512[] = BATTLE_TEXT_AttackingCantEscape, }; -const u16 BattleTextList_40151C[] = +const u16 gMoveWeatherChangeStringIds[] = { BATTLE_TEXT_RainStart, BATTLE_TEXT_PourStart, @@ -1246,39 +1246,39 @@ const u16 BattleTextList_40151C[] = BATTLE_TEXT_HailStart, }; -const u16 BattleTextList_401528[] = +const u16 gSandStormHailContinuesStringIds[] = { BATTLE_TEXT_SandRages, BATTLE_TEXT_HailCont, }; -const u16 BattleTextList_40152C[] = +const u16 gSandStormHailDmgStringIds[] = { BATTLE_TEXT_SandBuffeted, BATTLE_TEXT_HailStricken, }; -const u16 BattleTextList_401530[] = +const u16 gSandStormHailEndStringIds[] = { BATTLE_TEXT_SandSubsided, BATTLE_TEXT_HailStop, }; -const u16 BattleTextList_401534[] = +const u16 gRainContinuesStringIds[] = { BATTLE_TEXT_RainCont1, BATTLE_TEXT_PourCont, BATTLE_TEXT_RainStop, }; -const u16 BattleTextList_40153A[] = +const u16 gProtectLikeUsedStringIds[] = { BATTLE_TEXT_ProtectedItself2, BATTLE_TEXT_BracedItself, BATTLE_TEXT_Failed, }; -const u16 BattleTextList_401540[] = +const u16 gReflectLightScreenSafeguardStringIds[] = { BATTLE_TEXT_Failed, BATTLE_TEXT_RaisedDefense, @@ -1288,7 +1288,7 @@ const u16 BattleTextList_401540[] = BATTLE_TEXT_CoveredVeil, }; -const u16 BattleTextList_40154C[] = +const u16 gLeechSeedStringIds[] = { BATTLE_TEXT_WasSeeded, BATTLE_TEXT_EvadedAttack, @@ -1297,44 +1297,44 @@ const u16 BattleTextList_40154C[] = BATTLE_TEXT_OozeSuckup, }; -const u16 BattleTextList_401556[] = +const u16 gRestUsedStringIds[] = { BATTLE_TEXT_WentToSleep, BATTLE_TEXT_SpeltHealthy, }; -const u16 BattleTextList_40155A[] = +const u16 gUproarOverTurnStringIds[] = { BATTLE_TEXT_UproarMaking, BATTLE_TEXT_CalmedDown, }; -const u16 BattleTextList_40155E[] = +const u16 gStockpileUsedStringIds[] = { BATTLE_TEXT_Stockpiled, BATTLE_TEXT_StockpiledCant, }; -const u16 BattleTextList_401562[] = +const u16 gWokeUpStringIds[] = { BATTLE_TEXT_WokeUp, BATTLE_TEXT_UproarWoke, }; -const u16 BattleTextList_401566[] = +const u16 gSwallowFailStringIds[] = { BATTLE_TEXT_SwallowFail, BATTLE_TEXT_HPFull, }; -const u16 BattleTextList_40156A[] = +const u16 gUproarAwakeStringIds[] = { BATTLE_TEXT_UproarCantSleep2, BATTLE_TEXT_UproarKeptAwake, BATTLE_TEXT_StayedAwake, }; -const u16 BattleTextList_401570[] = +const u16 gStatUpStringIds[] = { BATTLE_TEXT_UnknownString7, BATTLE_TEXT_UnknownString3, @@ -1344,7 +1344,7 @@ const u16 BattleTextList_401570[] = BATTLE_TEXT_HustleUse, }; -const u16 BattleTextList_40157C[] = +const u16 gStatDownStringIds[] = { BATTLE_TEXT_UnknownString5, BATTLE_TEXT_UnknownString6, @@ -1352,7 +1352,7 @@ const u16 BattleTextList_40157C[] = BATTLE_TEXT_Terminator2, }; -const u16 BattleTextList_401584[] = +const u16 gFirstTurnOfTwoStringIds[] = { BATTLE_TEXT_WhipWhirlwind, BATTLE_TEXT_TookSunlight, @@ -1364,7 +1364,7 @@ const u16 BattleTextList_401584[] = BATTLE_TEXT_SprangUp, }; -const u16 BattleTextList_401594[] = +const u16 gWrappedStringIds[] = { BATTLE_TEXT_SqueezedBind, BATTLE_TEXT_Wrapped, @@ -1374,67 +1374,67 @@ const u16 BattleTextList_401594[] = BATTLE_TEXT_SandTombTrapped, }; -const u16 BattleTextList_4015A0[] = +const u16 gMistUsedStringIds[] = { BATTLE_TEXT_MistShroud, BATTLE_TEXT_Failed, }; -const u16 BattleTextList_4015A4[] = +const u16 gFocusEnergyUsedStringIds[] = { BATTLE_TEXT_GetPumped, BATTLE_TEXT_Failed, }; -const u16 BattleTextList_4015A8[] = +const u16 gTransformUsedStringIds[] = { BATTLE_TEXT_Transformed, BATTLE_TEXT_Failed, }; -const u16 BattleTextList_4015AC[] = +const u16 gSubsituteUsedStringIds[] = { BATTLE_TEXT_SubMade, BATTLE_TEXT_SubWeak, }; -const u16 BattleTextList_4015B0[] = +const u16 gGotPoisonedStringIds[] = { BATTLE_TEXT_Poisoned, BATTLE_TEXT_Poisoned2, }; -const u16 BattleTextList_4015B4[] = +const u16 gGotParalyzedStringIds[] = { BATTLE_TEXT_Paralyzed, BATTLE_TEXT_Paralyzed2, }; -const u16 BattleTextList_4015B8[] = +const u16 gFellAsleepStringIds[] = { BATTLE_TEXT_FellAsleep, BATTLE_TEXT_MadeAsleep, }; -const u16 BattleTextList_4015BC[] = +const u16 gGotBurnedStringIds[] = { BATTLE_TEXT_Burned, BATTLE_TEXT_Burned2, }; -const u16 BattleTextList_4015C0[] = +const u16 gGotFrozenStringIds[] = { BATTLE_TEXT_Frozen, BATTLE_TEXT_Frozen2, }; -const u16 BattleTextList_4015C4[] = +const u16 gGotDefrostedStringIds[] = { BATTLE_TEXT_AttackingDefrosted, BATTLE_TEXT_Defrosted, }; -const u16 BattleTextList_4015C8[] = +const u16 gKOFailedStringIds[] = { BATTLE_TEXT_AttackMissed, BATTLE_TEXT_Unaffected, @@ -1442,19 +1442,19 @@ const u16 BattleTextList_4015C8[] = BATTLE_TEXT_InfatuatedPoke, }; -const u16 BattleTextList_4015D0[] = +const u16 gLeechSeedDrainStringIds[] = { BATTLE_TEXT_EnergyDrained, BATTLE_TEXT_OozeSuckup, }; -const u16 BattleTextList_4015D4[] = +const u16 gSportsUsedStringIds[] = { BATTLE_TEXT_ElecWeakened, BATTLE_TEXT_FireWeakened, }; -const u16 BattleTextList_4015D8[] = +const u16 gPartyStatusHealStringIds[] = { BATTLE_TEXT_BellChime, BATTLE_TEXT_BellChime, @@ -1463,13 +1463,13 @@ const u16 BattleTextList_4015D8[] = BATTLE_TEXT_SoothingAroma, }; -const u16 BattleTextList_4015E2[] = +const u16 gFutureMoveUsedStringIds[] = { BATTLE_TEXT_ForesawAttack, BATTLE_TEXT_ChoseDestiny, }; -const u16 BattleTextList_4015E6[] = +const u16 gBallEscapeStringIds[] = { BATTLE_TEXT_BallBrokeOhNo, BATTLE_TEXT_BallBrokeAppeared, @@ -1477,7 +1477,7 @@ const u16 BattleTextList_4015E6[] = BATTLE_TEXT_BallBrokeSoClose, }; -const u16 BattleTextList_4015EE[] = +const u16 gWeatherContinuesStringIds[] = { BATTLE_TEXT_Raining, BATTLE_TEXT_Raining, @@ -1497,7 +1497,7 @@ const u16 BattleTextList_4015EE[] = BATTLE_TEXT_Raining, }; -const u16 BattleTextList_40160E[] = +const u16 gInobedientStringIds[] = { BATTLE_TEXT_LoafingAround, BATTLE_TEXT_WontObey, @@ -1505,20 +1505,20 @@ const u16 BattleTextList_40160E[] = BATTLE_TEXT_NotNotice, }; -const u16 BattleTextList_401616[] = +const u16 gSafariGetNearStringIds[] = { BATTLE_TEXT_CreptCloser, BATTLE_TEXT_CantGetCloser, }; -const u16 BattleTextList_40161A[] = +const u16 gSafariPokeblockResultStringIds[] = { BATTLE_TEXT_CuriousAbout, BATTLE_TEXT_EnthralledBy, BATTLE_TEXT_IgnoredThing, }; -const u16 BattleTextList_401620[] = +const u16 gTrainerItemCuredStatusStringIds[] = { BATTLE_TEXT_CuredConfusion, BATTLE_TEXT_CuredParalysis, @@ -1528,41 +1528,41 @@ const u16 BattleTextList_401620[] = BATTLE_TEXT_CuredSleep, }; -const u16 BattleTextList_40162C[] = +const u16 gBerryEffectStringIds[] = { BATTLE_TEXT_CuredStatus, BATTLE_TEXT_NormalizedStatus, }; -const u16 BattleTextList_401630[] = +const u16 gBRNPreventionStringIds[] = { BATTLE_TEXT_PreventedBurn, BATTLE_TEXT_PreventedOther2, BATTLE_TEXT_NoEffectOn, }; -const u16 BattleTextList_401636[] = +const u16 gPRLZPreventionStringIds[] = { BATTLE_TEXT_PreventedPara, BATTLE_TEXT_PreventedOther2, BATTLE_TEXT_NoEffectOn, }; -const u16 BattleTextList_40163C[] = +const u16 gPSNPreventionStringIds[] = { BATTLE_TEXT_PreventedPoison, BATTLE_TEXT_PreventedOther2, BATTLE_TEXT_NoEffectOn, }; -const u16 BattleTextList_401642[] = +const u16 gItemSwapStringIds[] = { BATTLE_TEXT_Obtained1, BATTLE_TEXT_Obtained2, BATTLE_TEXT_Obtained3, }; -const u16 BattleTextList_401648[] = +const u16 gFlashFireStringIds[] = { BATTLE_TEXT_RaisedFirePower, BATTLE_TEXT_MadeIneffective, diff --git a/src/data/battle_strings_en.h b/src/data/battle_strings_en.h index 26523d2e0..f29e48410 100755 --- a/src/data/battle_strings_en.h +++ b/src/data/battle_strings_en.h @@ -1227,7 +1227,7 @@ const u16 gMissStrings[] = BATTLE_TEXT_GroundMoveNegate, }; -const u16 BattleTextList_401512[] = +const u16 gNoEscapeStringIds[] = { BATTLE_TEXT_CantEscape2, BATTLE_TEXT_BirchDontLeaveMe, @@ -1236,7 +1236,7 @@ const u16 BattleTextList_401512[] = BATTLE_TEXT_AttackingCantEscape, }; -const u16 BattleTextList_40151C[] = +const u16 gMoveWeatherChangeStringIds[] = { BATTLE_TEXT_RainStart, BATTLE_TEXT_PourStart, @@ -1246,39 +1246,39 @@ const u16 BattleTextList_40151C[] = BATTLE_TEXT_HailStart, }; -const u16 BattleTextList_401528[] = +const u16 gSandStormHailContinuesStringIds[] = { BATTLE_TEXT_SandRages, BATTLE_TEXT_HailCont, }; -const u16 BattleTextList_40152C[] = +const u16 gSandStormHailDmgStringIds[] = { BATTLE_TEXT_SandBuffeted, BATTLE_TEXT_HailStricken, }; -const u16 BattleTextList_401530[] = +const u16 gSandStormHailEndStringIds[] = { BATTLE_TEXT_SandSubsided, BATTLE_TEXT_HailStop, }; -const u16 BattleTextList_401534[] = +const u16 gRainContinuesStringIds[] = { BATTLE_TEXT_RainCont1, BATTLE_TEXT_PourCont, BATTLE_TEXT_RainStop, }; -const u16 BattleTextList_40153A[] = +const u16 gProtectLikeUsedStringIds[] = { BATTLE_TEXT_ProtectedItself2, BATTLE_TEXT_BracedItself, BATTLE_TEXT_Failed, }; -const u16 BattleTextList_401540[] = +const u16 gReflectLightScreenSafeguardStringIds[] = { BATTLE_TEXT_Failed, BATTLE_TEXT_RaisedDefense, @@ -1288,7 +1288,7 @@ const u16 BattleTextList_401540[] = BATTLE_TEXT_CoveredVeil, }; -const u16 BattleTextList_40154C[] = +const u16 gLeechSeedStringIds[] = { BATTLE_TEXT_WasSeeded, BATTLE_TEXT_EvadedAttack, @@ -1297,44 +1297,44 @@ const u16 BattleTextList_40154C[] = BATTLE_TEXT_OozeSuckup, }; -const u16 BattleTextList_401556[] = +const u16 gRestUsedStringIds[] = { BATTLE_TEXT_WentToSleep, BATTLE_TEXT_SpeltHealthy, }; -const u16 BattleTextList_40155A[] = +const u16 gUproarOverTurnStringIds[] = { BATTLE_TEXT_UproarMaking, BATTLE_TEXT_CalmedDown, }; -const u16 BattleTextList_40155E[] = +const u16 gStockpileUsedStringIds[] = { BATTLE_TEXT_Stockpiled, BATTLE_TEXT_StockpiledCant, }; -const u16 BattleTextList_401562[] = +const u16 gWokeUpStringIds[] = { BATTLE_TEXT_WokeUp, BATTLE_TEXT_UproarWoke, }; -const u16 BattleTextList_401566[] = +const u16 gSwallowFailStringIds[] = { BATTLE_TEXT_SwallowFail, BATTLE_TEXT_HPFull, }; -const u16 BattleTextList_40156A[] = +const u16 gUproarAwakeStringIds[] = { BATTLE_TEXT_UproarCantSleep2, BATTLE_TEXT_UproarKeptAwake, BATTLE_TEXT_StayedAwake, }; -const u16 BattleTextList_401570[] = +const u16 gStatUpStringIds[] = { BATTLE_TEXT_UnknownString7, BATTLE_TEXT_UnknownString3, @@ -1344,7 +1344,7 @@ const u16 BattleTextList_401570[] = BATTLE_TEXT_HustleUse, }; -const u16 BattleTextList_40157C[] = +const u16 gStatDownStringIds[] = { BATTLE_TEXT_UnknownString5, BATTLE_TEXT_UnknownString6, @@ -1352,7 +1352,7 @@ const u16 BattleTextList_40157C[] = BATTLE_TEXT_Terminator2, }; -const u16 BattleTextList_401584[] = +const u16 gFirstTurnOfTwoStringIds[] = { BATTLE_TEXT_WhipWhirlwind, BATTLE_TEXT_TookSunlight, @@ -1364,7 +1364,7 @@ const u16 BattleTextList_401584[] = BATTLE_TEXT_SprangUp, }; -const u16 BattleTextList_401594[] = +const u16 gWrappedStringIds[] = { BATTLE_TEXT_SqueezedBind, BATTLE_TEXT_Wrapped, @@ -1374,67 +1374,67 @@ const u16 BattleTextList_401594[] = BATTLE_TEXT_SandTombTrapped, }; -const u16 BattleTextList_4015A0[] = +const u16 gMistUsedStringIds[] = { BATTLE_TEXT_MistShroud, BATTLE_TEXT_Failed, }; -const u16 BattleTextList_4015A4[] = +const u16 gFocusEnergyUsedStringIds[] = { BATTLE_TEXT_GetPumped, BATTLE_TEXT_Failed, }; -const u16 BattleTextList_4015A8[] = +const u16 gTransformUsedStringIds[] = { BATTLE_TEXT_Transformed, BATTLE_TEXT_Failed, }; -const u16 BattleTextList_4015AC[] = +const u16 gSubsituteUsedStringIds[] = { BATTLE_TEXT_SubMade, BATTLE_TEXT_SubWeak, }; -const u16 BattleTextList_4015B0[] = +const u16 gGotPoisonedStringIds[] = { BATTLE_TEXT_Poisoned, BATTLE_TEXT_Poisoned2, }; -const u16 BattleTextList_4015B4[] = +const u16 gGotParalyzedStringIds[] = { BATTLE_TEXT_Paralyzed, BATTLE_TEXT_Paralyzed2, }; -const u16 BattleTextList_4015B8[] = +const u16 gFellAsleepStringIds[] = { BATTLE_TEXT_FellAsleep, BATTLE_TEXT_MadeAsleep, }; -const u16 BattleTextList_4015BC[] = +const u16 gGotBurnedStringIds[] = { BATTLE_TEXT_Burned, BATTLE_TEXT_Burned2, }; -const u16 BattleTextList_4015C0[] = +const u16 gGotFrozenStringIds[] = { BATTLE_TEXT_Frozen, BATTLE_TEXT_Frozen2, }; -const u16 BattleTextList_4015C4[] = +const u16 gGotDefrostedStringIds[] = { BATTLE_TEXT_AttackingDefrosted, BATTLE_TEXT_Defrosted, }; -const u16 BattleTextList_4015C8[] = +const u16 gKOFailedStringIds[] = { BATTLE_TEXT_AttackMissed, BATTLE_TEXT_Unaffected, @@ -1442,19 +1442,19 @@ const u16 BattleTextList_4015C8[] = BATTLE_TEXT_InfatuatedPoke, }; -const u16 BattleTextList_4015D0[] = +const u16 gLeechSeedDrainStringIds[] = { BATTLE_TEXT_EnergyDrained, BATTLE_TEXT_OozeSuckup, }; -const u16 BattleTextList_4015D4[] = +const u16 gSportsUsedStringIds[] = { BATTLE_TEXT_ElecWeakened, BATTLE_TEXT_FireWeakened, }; -const u16 BattleTextList_4015D8[] = +const u16 gPartyStatusHealStringIds[] = { BATTLE_TEXT_BellChime, BATTLE_TEXT_BellChime, @@ -1463,13 +1463,13 @@ const u16 BattleTextList_4015D8[] = BATTLE_TEXT_SoothingAroma, }; -const u16 BattleTextList_4015E2[] = +const u16 gFutureMoveUsedStringIds[] = { BATTLE_TEXT_ForesawAttack, BATTLE_TEXT_ChoseDestiny, }; -const u16 BattleTextList_4015E6[] = +const u16 gBallEscapeStringIds[] = { BATTLE_TEXT_BallBrokeOhNo, BATTLE_TEXT_BallBrokeAppeared, @@ -1477,7 +1477,7 @@ const u16 BattleTextList_4015E6[] = BATTLE_TEXT_BallBrokeSoClose, }; -const u16 BattleTextList_4015EE[] = +const u16 gWeatherContinuesStringIds[] = { BATTLE_TEXT_Raining, BATTLE_TEXT_Raining, @@ -1497,7 +1497,7 @@ const u16 BattleTextList_4015EE[] = BATTLE_TEXT_Raining, }; -const u16 BattleTextList_40160E[] = +const u16 gInobedientStringIds[] = { BATTLE_TEXT_LoafingAround, BATTLE_TEXT_WontObey, @@ -1505,20 +1505,20 @@ const u16 BattleTextList_40160E[] = BATTLE_TEXT_NotNotice, }; -const u16 BattleTextList_401616[] = +const u16 gSafariGetNearStringIds[] = { BATTLE_TEXT_CreptCloser, BATTLE_TEXT_CantGetCloser, }; -const u16 BattleTextList_40161A[] = +const u16 gSafariPokeblockResultStringIds[] = { BATTLE_TEXT_CuriousAbout, BATTLE_TEXT_EnthralledBy, BATTLE_TEXT_IgnoredThing, }; -const u16 BattleTextList_401620[] = +const u16 gTrainerItemCuredStatusStringIds[] = { BATTLE_TEXT_CuredConfusion, BATTLE_TEXT_CuredParalysis, @@ -1528,41 +1528,41 @@ const u16 BattleTextList_401620[] = BATTLE_TEXT_CuredSleep, }; -const u16 BattleTextList_40162C[] = +const u16 gBerryEffectStringIds[] = { BATTLE_TEXT_CuredStatus, BATTLE_TEXT_NormalizedStatus, }; -const u16 BattleTextList_401630[] = +const u16 gBRNPreventionStringIds[] = { BATTLE_TEXT_PreventedBurn, BATTLE_TEXT_PreventedOther2, BATTLE_TEXT_NoEffectOn, }; -const u16 BattleTextList_401636[] = +const u16 gPRLZPreventionStringIds[] = { BATTLE_TEXT_PreventedPara, BATTLE_TEXT_PreventedOther2, BATTLE_TEXT_NoEffectOn, }; -const u16 BattleTextList_40163C[] = +const u16 gPSNPreventionStringIds[] = { BATTLE_TEXT_PreventedPoison, BATTLE_TEXT_PreventedOther2, BATTLE_TEXT_NoEffectOn, }; -const u16 BattleTextList_401642[] = +const u16 gItemSwapStringIds[] = { BATTLE_TEXT_Obtained1, BATTLE_TEXT_Obtained2, BATTLE_TEXT_Obtained3, }; -const u16 BattleTextList_401648[] = +const u16 gFlashFireStringIds[] = { BATTLE_TEXT_RaisedFirePower, BATTLE_TEXT_MadeIneffective, diff --git a/src/data/menu_cursor_de.h b/src/data/menu_cursor_de.h new file mode 100644 index 000000000..cd56f51d9 --- /dev/null +++ b/src/data/menu_cursor_de.h @@ -0,0 +1,345 @@ +#ifndef GUARD_DATA_MENU_CURSOR_H +#define GUARD_DATA_MENU_CURSOR_H + +const u8 OutlineCursorTiles_00[] = INCBIN_U8("graphics/interface/outline_cursor_00.4bpp"); +const u8 OutlineCursorTiles_01[] = INCBIN_U8("graphics/interface/outline_cursor_01.4bpp"); +const u8 OutlineCursorTiles_02[] = INCBIN_U8("graphics/interface/outline_cursor_02.4bpp"); +const u8 OutlineCursorTiles_03[] = INCBIN_U8("graphics/interface/outline_cursor_03.4bpp"); +const u8 OutlineCursorTiles_04[] = INCBIN_U8("graphics/interface/outline_cursor_04.4bpp"); +const u8 OutlineCursorTiles_05[] = INCBIN_U8("graphics/interface/outline_cursor_05.4bpp"); +const u8 OutlineCursorTiles_06[] = INCBIN_U8("graphics/interface/outline_cursor_06.4bpp"); +const u8 OutlineCursorTiles_07[] = INCBIN_U8("graphics/interface/outline_cursor_07.4bpp"); +const u8 OutlineCursorTiles_08[] = INCBIN_U8("graphics/interface/outline_cursor_08.4bpp"); +const u8 OutlineCursorTiles_09[] = INCBIN_U8("graphics/interface/outline_cursor_09.4bpp"); +const u8 OutlineCursorTiles_10[] = INCBIN_U8("graphics/interface/outline_cursor_10.4bpp"); +const u8 OutlineCursorTiles_11[] = INCBIN_U8("graphics/interface/outline_cursor_11.4bpp"); +const u8 OutlineCursorTiles_12[] = INCBIN_U8("graphics/interface/outline_cursor_12.4bpp"); +const u8 OutlineCursorTiles_13[] = INCBIN_U8("graphics/interface/outline_cursor_13.4bpp"); +const u8 OutlineCursorTiles_14[] = INCBIN_U8("graphics/interface/outline_cursor_14.4bpp"); +const u8 OutlineCursorTiles_15[] = INCBIN_U8("graphics/interface/outline_cursor_15.4bpp"); + +const struct OamData gOamData_842F11C = { + .objMode = ST_OAM_OBJ_NORMAL, + .shape = ST_OAM_V_RECTANGLE +}; +const struct OamData gOamData_842F124 = { + .objMode = ST_OAM_OBJ_WINDOW, + .shape = ST_OAM_V_RECTANGLE +}; +const struct OamData gOamData_842F12C = { + .objMode = ST_OAM_OBJ_NORMAL, + .shape = ST_OAM_V_RECTANGLE +}; + +const union AnimCmd gSpriteAnim_842F134[] = { + ANIMCMD_FRAME(0, 63), + ANIMCMD_END +}; + +const union AnimCmd *const gSpriteAnimTable_842F13C[] = { + gSpriteAnim_842F134 +}; + +const struct SpriteSheet gUnknown_0842F140[] = { + { OutlineCursorTiles_00, 0x380, 0xFFF0 }, + { OutlineCursorTiles_01, 0x380, 0xFFF0 }, + { OutlineCursorTiles_02, 0x380, 0xFFF0 }, + { OutlineCursorTiles_03, 0x380, 0xFFF0 }, + { OutlineCursorTiles_04, 0x380, 0xFFF0 }, + { OutlineCursorTiles_05, 0x380, 0xFFF0 }, + { OutlineCursorTiles_06, 0x380, 0xFFF0 }, + { OutlineCursorTiles_07, 0x380, 0xFFF0 }, + { OutlineCursorTiles_08, 0x380, 0xFFF0 }, + { OutlineCursorTiles_09, 0x380, 0xFFF0 }, + { OutlineCursorTiles_10, 0x380, 0xFFF0 }, + { OutlineCursorTiles_11, 0x380, 0xFFF0 }, + { OutlineCursorTiles_12, 0x380, 0xFFF0 }, + { OutlineCursorTiles_13, 0x380, 0xFFF0 }, + { OutlineCursorTiles_14, 0x380, 0xFFF0 }, + { OutlineCursorTiles_15, 0x380, 0xFFF0 } +}; + +const struct SpriteSheet gUnknown_0842F1C0[] = { + { OutlineCursorTiles_00, 0x380, 0xFFF1 }, + { OutlineCursorTiles_01, 0x380, 0xFFF1 }, + { OutlineCursorTiles_02, 0x380, 0xFFF1 }, + { OutlineCursorTiles_03, 0x380, 0xFFF1 }, + { OutlineCursorTiles_04, 0x380, 0xFFF1 }, + { OutlineCursorTiles_05, 0x380, 0xFFF1 }, + { OutlineCursorTiles_06, 0x380, 0xFFF1 }, + { OutlineCursorTiles_07, 0x380, 0xFFF1 }, + { OutlineCursorTiles_08, 0x380, 0xFFF1 }, + { OutlineCursorTiles_09, 0x380, 0xFFF1 }, + { OutlineCursorTiles_10, 0x380, 0xFFF1 }, + { OutlineCursorTiles_11, 0x380, 0xFFF1 }, + { OutlineCursorTiles_12, 0x380, 0xFFF1 }, + { OutlineCursorTiles_13, 0x380, 0xFFF1 }, + { OutlineCursorTiles_14, 0x380, 0xFFF1 }, + { OutlineCursorTiles_15, 0x380, 0xFFF1 } +}; + +const struct SpritePalette gUnknown_0842F240 = { + gUnknown_0203A360, 0xfff0 +}; +const struct SpritePalette gUnknown_0842F248 = { + gUnknown_0203A360, 0xfff1 +}; + +const struct SpriteTemplate gSpriteTemplate_842F250[] = { + { + 0xfff0, 0xfff0, &gOamData_842F11C, gSpriteAnimTable_842F13C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy + }, { + 0xfff0, 0xffff, &gOamData_842F11C, gSpriteAnimTable_842F13C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy + }, { + 0xfff0, 0xffff, &gOamData_842F124, gSpriteAnimTable_842F13C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy + } +}; +const struct SpriteTemplate gSpriteTemplate_842F298[] = { + { + 0xfff1, 0xfff1, &gOamData_842F12C, gSpriteAnimTable_842F13C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy + }, { + 0xfff1, 0xffff, &gOamData_842F12C, gSpriteAnimTable_842F13C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy + } +}; + + +const struct Subsprite gSubspriteTable_842F2C8[] = { + { -1, -1, ST_OAM_V_RECTANGLE, 1, 0, 0 }, + { 1, -1, ST_OAM_V_RECTANGLE, 1, 8, 0 } +}; + +const struct Subsprite gSubspriteTable_842F2D8[] = { + { -1, -1, ST_OAM_V_RECTANGLE, 1, 0, 0 }, + { 1, -1, ST_OAM_V_RECTANGLE, 1, 4, 0 }, + { 9, -1, ST_OAM_V_RECTANGLE, 1, 8, 0 } +}; + +const struct Subsprite gSubspriteTable_842F2F0[] = { + { -1, -1, ST_OAM_V_RECTANGLE, 1, 0, 0 }, + { 1, -1, ST_OAM_V_RECTANGLE, 1, 4, 0 }, + { 9, -1, ST_OAM_V_RECTANGLE, 1, 4, 0 }, + { 17, -1, ST_OAM_V_RECTANGLE, 1, 8, 0 } +}; + +const struct Subsprite gSubspriteTable_842F310[] = { + { -1, -1, ST_OAM_V_RECTANGLE, 1, 0, 0 }, + { 1, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 25, -1, ST_OAM_V_RECTANGLE, 1, 8, 0 } +}; + +const struct Subsprite gSubspriteTable_842F328[] = { + { -1, -1, ST_OAM_V_RECTANGLE, 1, 0, 0 }, + { 1, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 33, -1, ST_OAM_V_RECTANGLE, 1, 8, 0 } +}; + +const struct Subsprite gSubspriteTable_842F340[] = { + { -1, -1, ST_OAM_V_RECTANGLE, 1, 0, 0 }, + { 1, -1, ST_OAM_V_RECTANGLE, 1, 4, 0 }, + { 9, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 41, -1, ST_OAM_V_RECTANGLE, 1, 8, 0 } +}; + +const struct Subsprite gSubspriteTable_842F360[] = { + { -1, -1, ST_OAM_V_RECTANGLE, 1, 0, 0 }, + { 1, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 17, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 49, -1, ST_OAM_V_RECTANGLE, 1, 8, 0 } +}; + +const struct Subsprite gSubspriteTable_842F380[] = { + { -1, -1, ST_OAM_V_RECTANGLE, 1, 0, 0 }, + { 1, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 25, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 57, -1, ST_OAM_V_RECTANGLE, 1, 8, 0 } +}; + +const struct Subsprite gSubspriteTable_842F3A0[] = { + { -1, -1, ST_OAM_V_RECTANGLE, 1, 0, 0 }, + { 1, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 33, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 65, -1, ST_OAM_V_RECTANGLE, 1, 8, 0 } +}; + +const struct Subsprite gSubspriteTable_842F3C0[] = { + { -1, -1, ST_OAM_V_RECTANGLE, 1, 0, 0 }, + { 1, -1, ST_OAM_V_RECTANGLE, 1, 4, 0 }, + { 9, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 41, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 73, -1, ST_OAM_V_RECTANGLE, 1, 8, 0 } +}; + +const struct Subsprite gSubspriteTable_842F3E8[] = { + { -1, -1, ST_OAM_V_RECTANGLE, 1, 0, 0 }, + { 1, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 33, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 49, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 81, -1, ST_OAM_V_RECTANGLE, 1, 8, 0 } +}; + +const struct Subsprite gSubspriteTable_842F410[] = { + { -1, -1, ST_OAM_V_RECTANGLE, 1, 0, 0 }, + { 1, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 33, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 57, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 89, -1, ST_OAM_V_RECTANGLE, 1, 8, 0 } +}; + +const struct Subsprite gSubspriteTable_842F438[] = { + { -1, -1, ST_OAM_V_RECTANGLE, 1, 0, 0 }, + { 1, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 33, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 65, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 97, -1, ST_OAM_V_RECTANGLE, 1, 8, 0 } +}; + +const struct Subsprite gSubspriteTable_842F460[] = { + { -1, -1, ST_OAM_V_RECTANGLE, 1, 0, 0 }, + { 1, -1, ST_OAM_V_RECTANGLE, 1, 4, 0 }, + { 9, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 41, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 73, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 105, -1, ST_OAM_V_RECTANGLE, 1, 8, 0 } +}; + +const struct Subsprite gSubspriteTable_842F490[] = { + { -1, -1, ST_OAM_V_RECTANGLE, 1, 0, 0 }, + { 1, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 33, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 65, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 81, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 113, -1, ST_OAM_V_RECTANGLE, 1, 8, 0 } +}; + +const struct Subsprite gSubspriteTable_842F4C0[] = { + { -1, -1, ST_OAM_V_RECTANGLE, 1, 0, 0 }, + { 1, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 33, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 65, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 89, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 121, -1, ST_OAM_V_RECTANGLE, 1, 8, 0 } +}; + +const struct Subsprite gSubspriteTable_842F4F0[] = { + { -1, -1, ST_OAM_V_RECTANGLE, 1, 0, 0 }, + { 1, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 33, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 65, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 97, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 129, -1, ST_OAM_V_RECTANGLE, 1, 8, 0 } +}; + +const struct Subsprite gSubspriteTable_842F520[] = { + { -1, -1, ST_OAM_V_RECTANGLE, 1, 0, 0 }, + { 1, -1, ST_OAM_V_RECTANGLE, 1, 4, 0 }, + { 9, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 41, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 73, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 105, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 137, -1, ST_OAM_V_RECTANGLE, 1, 8, 0 } +}; + +const struct Subsprite gSubspriteTable_842F558[] = { + { -1, -1, ST_OAM_V_RECTANGLE, 0, 0, 0 }, + { 7, -1, ST_OAM_SQUARE, 2, 12, 0 }, + { 35, -1, ST_OAM_V_RECTANGLE, 0, 8, 0 } +}; + +const struct Subsprite *const gUnknown_0842F5BC[] = { + gSubspriteTable_842F558 +}; + +const struct SubspriteTable gSubspriteTables_842F5C0[] = { + {1, gMenuCursorSubsprites}, + {1, gMenuCursorSubsprites}, + {2, gMenuCursorSubsprites}, + {3, gMenuCursorSubsprites}, + {4, gMenuCursorSubsprites}, + {5, gMenuCursorSubsprites}, + {6, gMenuCursorSubsprites}, + {7, gMenuCursorSubsprites}, + {8, gMenuCursorSubsprites}, + {9, gMenuCursorSubsprites}, + {10, gMenuCursorSubsprites}, + {11, gMenuCursorSubsprites}, + {12, gMenuCursorSubsprites}, + {13, gMenuCursorSubsprites}, + {14, gMenuCursorSubsprites}, + {15, gMenuCursorSubsprites}, + {16, gMenuCursorSubsprites}, + {17, gMenuCursorSubsprites}, + {18, gMenuCursorSubsprites}, + {19, gMenuCursorSubsprites}, + {20, gMenuCursorSubsprites}, + {21, gMenuCursorSubsprites}, + {22, gMenuCursorSubsprites}, + {23, gMenuCursorSubsprites}, + {24, gMenuCursorSubsprites}, + {25, gMenuCursorSubsprites}, + {26, gMenuCursorSubsprites}, + {27, gMenuCursorSubsprites}, + {28, gMenuCursorSubsprites}, + {29, gMenuCursorSubsprites}, + {30, gMenuCursorSubsprites}, + {31, gMenuCursorSubsprites} +}; + +const struct SubspriteTable gSubspriteTables_842F6C0[] = { + {2, gSubspriteTable_842F2C8}, + {2, gSubspriteTable_842F2C8}, + {3, gSubspriteTable_842F2D8}, + {4, gSubspriteTable_842F2F0}, + {3, gSubspriteTable_842F310}, + {3, gSubspriteTable_842F328}, + {4, gSubspriteTable_842F340}, + {4, gSubspriteTable_842F360}, + {4, gSubspriteTable_842F380}, + {4, gSubspriteTable_842F3A0}, + {5, gSubspriteTable_842F3C0}, + {5, gSubspriteTable_842F3E8}, + {5, gSubspriteTable_842F410}, + {5, gSubspriteTable_842F438}, + {6, gSubspriteTable_842F460}, + {6, gSubspriteTable_842F490}, + {6, gSubspriteTable_842F4C0}, + {6, gSubspriteTable_842F4F0}, + {7, gSubspriteTable_842F520} +}; + +const struct SubspriteTable gUnknown_0842F758[] = { + {3, gMenuCursorSubsprites} +}; + +const struct Subsprite gUnknown_0842F760 = { + .y = -1, .shape = ST_OAM_V_RECTANGLE, .size = 1 +}; + +const struct Subsprite gUnknown_0842F768 = { + .y = -1, .shape = ST_OAM_V_RECTANGLE, .size = 1, .tileOffset = 8 +}; + +const struct Subsprite gUnknown_0842F770 = { + .y = -1, .shape = ST_OAM_SQUARE, .size = 2, .tileOffset = 12 +}; + +const struct Subsprite gUnknown_0842F778 = { + .y = -1, .shape = ST_OAM_V_RECTANGLE, .size = 1, .tileOffset = 4 +}; + +const struct Subsprite gUnknown_0842F780 = { + .y = -1, .shape = ST_OAM_V_RECTANGLE, .size = 1 +}; + +const struct Subsprite gUnknown_0842F788 = { + .y = -1, .shape = ST_OAM_SQUARE, .size = 2, .tileOffset = 12 +}; + +const struct Subsprite gUnknown_0842F790 = { + .y = -1, .shape = ST_OAM_V_RECTANGLE, .size = 1, .tileOffset = 4 +}; + +const struct Subsprite gUnknown_0842F798 = { + .y = -1, .shape = ST_OAM_V_RECTANGLE, .size = 1, .tileOffset = 8 +}; + +#endif //GUARD_DATA_MENU_CURSOR_H diff --git a/src/data/menu_cursor_en.h b/src/data/menu_cursor_en.h new file mode 100644 index 000000000..a926f2629 --- /dev/null +++ b/src/data/menu_cursor_en.h @@ -0,0 +1,363 @@ +#ifndef GUARD_DATA_MENU_CURSOR_H +#define GUARD_DATA_MENU_CURSOR_H + +const u8 OutlineCursorTiles_00[] = INCBIN_U8("graphics/interface/outline_cursor_00.4bpp"); +const u8 OutlineCursorTiles_01[] = INCBIN_U8("graphics/interface/outline_cursor_01.4bpp"); +const u8 OutlineCursorTiles_02[] = INCBIN_U8("graphics/interface/outline_cursor_02.4bpp"); +const u8 OutlineCursorTiles_03[] = INCBIN_U8("graphics/interface/outline_cursor_03.4bpp"); +const u8 OutlineCursorTiles_04[] = INCBIN_U8("graphics/interface/outline_cursor_04.4bpp"); +const u8 OutlineCursorTiles_05[] = INCBIN_U8("graphics/interface/outline_cursor_05.4bpp"); +const u8 OutlineCursorTiles_06[] = INCBIN_U8("graphics/interface/outline_cursor_06.4bpp"); +const u8 OutlineCursorTiles_07[] = INCBIN_U8("graphics/interface/outline_cursor_07.4bpp"); +const u8 OutlineCursorTiles_08[] = INCBIN_U8("graphics/interface/outline_cursor_08.4bpp"); +const u8 OutlineCursorTiles_09[] = INCBIN_U8("graphics/interface/outline_cursor_09.4bpp"); +const u8 OutlineCursorTiles_10[] = INCBIN_U8("graphics/interface/outline_cursor_10.4bpp"); +const u8 OutlineCursorTiles_11[] = INCBIN_U8("graphics/interface/outline_cursor_11.4bpp"); +const u8 OutlineCursorTiles_12[] = INCBIN_U8("graphics/interface/outline_cursor_12.4bpp"); +const u8 OutlineCursorTiles_13[] = INCBIN_U8("graphics/interface/outline_cursor_13.4bpp"); +const u8 OutlineCursorTiles_14[] = INCBIN_U8("graphics/interface/outline_cursor_14.4bpp"); +const u8 OutlineCursorTiles_15[] = INCBIN_U8("graphics/interface/outline_cursor_15.4bpp"); + +const struct OamData gOamData_842F11C = { + .objMode = ST_OAM_OBJ_NORMAL, + .shape = ST_OAM_V_RECTANGLE +}; +const struct OamData gOamData_842F124 = { + .objMode = ST_OAM_OBJ_WINDOW, + .shape = ST_OAM_V_RECTANGLE +}; +const struct OamData gOamData_842F12C = { + .objMode = ST_OAM_OBJ_NORMAL, + .shape = ST_OAM_V_RECTANGLE +}; + +const union AnimCmd gSpriteAnim_842F134[] = { + ANIMCMD_FRAME(0, 63), + ANIMCMD_END +}; + +const union AnimCmd *const gSpriteAnimTable_842F13C[] = { + gSpriteAnim_842F134 +}; + +const struct SpriteSheet gUnknown_0842F140[] = { + { OutlineCursorTiles_00, 0x1C0, 0xFFF0 }, + { OutlineCursorTiles_01, 0x1C0, 0xFFF0 }, + { OutlineCursorTiles_02, 0x1C0, 0xFFF0 }, + { OutlineCursorTiles_03, 0x1C0, 0xFFF0 }, + { OutlineCursorTiles_04, 0x1C0, 0xFFF0 }, + { OutlineCursorTiles_05, 0x1C0, 0xFFF0 }, + { OutlineCursorTiles_06, 0x1C0, 0xFFF0 }, + { OutlineCursorTiles_07, 0x1C0, 0xFFF0 }, + { OutlineCursorTiles_08, 0x1C0, 0xFFF0 }, + { OutlineCursorTiles_09, 0x1C0, 0xFFF0 }, + { OutlineCursorTiles_10, 0x1C0, 0xFFF0 }, + { OutlineCursorTiles_11, 0x1C0, 0xFFF0 }, + { OutlineCursorTiles_12, 0x1C0, 0xFFF0 }, + { OutlineCursorTiles_13, 0x1C0, 0xFFF0 }, + { OutlineCursorTiles_14, 0x1C0, 0xFFF0 }, + { OutlineCursorTiles_15, 0x1C0, 0xFFF0 } +}; + +const struct SpriteSheet gUnknown_0842F1C0[] = { + { OutlineCursorTiles_00, 0x1C0, 0xFFF1 }, + { OutlineCursorTiles_01, 0x1C0, 0xFFF1 }, + { OutlineCursorTiles_02, 0x1C0, 0xFFF1 }, + { OutlineCursorTiles_03, 0x1C0, 0xFFF1 }, + { OutlineCursorTiles_04, 0x1C0, 0xFFF1 }, + { OutlineCursorTiles_05, 0x1C0, 0xFFF1 }, + { OutlineCursorTiles_06, 0x1C0, 0xFFF1 }, + { OutlineCursorTiles_07, 0x1C0, 0xFFF1 }, + { OutlineCursorTiles_08, 0x1C0, 0xFFF1 }, + { OutlineCursorTiles_09, 0x1C0, 0xFFF1 }, + { OutlineCursorTiles_10, 0x1C0, 0xFFF1 }, + { OutlineCursorTiles_11, 0x1C0, 0xFFF1 }, + { OutlineCursorTiles_12, 0x1C0, 0xFFF1 }, + { OutlineCursorTiles_13, 0x1C0, 0xFFF1 }, + { OutlineCursorTiles_14, 0x1C0, 0xFFF1 }, + { OutlineCursorTiles_15, 0x1C0, 0xFFF1 } +}; + +const struct SpritePalette gUnknown_0842F240 = { + gUnknown_0203A360, 0xfff0 +}; +const struct SpritePalette gUnknown_0842F248 = { + gUnknown_0203A360, 0xfff1 +}; + +const struct SpriteTemplate gSpriteTemplate_842F250[] = { + { + 0xfff0, 0xfff0, &gOamData_842F11C, gSpriteAnimTable_842F13C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy + }, { + 0xfff0, 0xffff, &gOamData_842F11C, gSpriteAnimTable_842F13C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy + }, { + 0xfff0, 0xffff, &gOamData_842F124, gSpriteAnimTable_842F13C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy + } +}; +const struct SpriteTemplate gSpriteTemplate_842F298[] = { + { + 0xfff1, 0xfff1, &gOamData_842F12C, gSpriteAnimTable_842F13C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy + }, { + 0xfff1, 0xffff, &gOamData_842F12C, gSpriteAnimTable_842F13C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy + } +}; + + +const struct Subsprite gSubspriteTable_842F2C8[] = { + { -1, 0, ST_OAM_V_RECTANGLE, 0, 0, 0 }, + { 1, 0, ST_OAM_V_RECTANGLE, 0, 4, 0 } +}; + +const struct Subsprite gSubspriteTable_842F2D8[] = { + { -1, 0, ST_OAM_V_RECTANGLE, 0, 0, 0 }, + { 1, 0, ST_OAM_V_RECTANGLE, 0, 2, 0 }, + { 9, 0, ST_OAM_V_RECTANGLE, 0, 4, 0 } +}; + +const struct Subsprite gSubspriteTable_842F2F0[] = { + { -1, 0, ST_OAM_V_RECTANGLE, 0, 0, 0 }, + { 1, 0, ST_OAM_V_RECTANGLE, 0, 2, 0 }, + { 9, 0, ST_OAM_V_RECTANGLE, 0, 2, 0 }, + { 17, 0, ST_OAM_V_RECTANGLE, 0, 4, 0 } +}; + +const struct Subsprite gSubspriteTable_842F310[] = { + { -1, 0, ST_OAM_V_RECTANGLE, 0, 0, 0 }, + { 1, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 25, 0, ST_OAM_V_RECTANGLE, 0, 4, 0 } +}; + +const struct Subsprite gSubspriteTable_842F328[] = { + { -1, 0, ST_OAM_V_RECTANGLE, 0, 0, 0 }, + { 1, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 33, 0, ST_OAM_V_RECTANGLE, 0, 4, 0 } +}; + +const struct Subsprite gSubspriteTable_842F340[] = { + { -1, 0, ST_OAM_V_RECTANGLE, 0, 0, 0 }, + { 1, 0, ST_OAM_V_RECTANGLE, 0, 2, 0 }, + { 9, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 41, 0, ST_OAM_V_RECTANGLE, 0, 4, 0 } +}; + +const struct Subsprite gSubspriteTable_842F360[] = { + { -1, 0, ST_OAM_V_RECTANGLE, 0, 0, 0 }, + { 1, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 17, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 49, 0, ST_OAM_V_RECTANGLE, 0, 4, 0 } +}; + +const struct Subsprite gSubspriteTable_842F380[] = { + { -1, 0, ST_OAM_V_RECTANGLE, 0, 0, 0 }, + { 1, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 25, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 57, 0, ST_OAM_V_RECTANGLE, 0, 4, 0 } +}; + +const struct Subsprite gSubspriteTable_842F3A0[] = { + { -1, 0, ST_OAM_V_RECTANGLE, 0, 0, 0 }, + { 1, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 33, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 65, 0, ST_OAM_V_RECTANGLE, 0, 4, 0 } +}; + +const struct Subsprite gSubspriteTable_842F3C0[] = { + { -1, 0, ST_OAM_V_RECTANGLE, 0, 0, 0 }, + { 1, 0, ST_OAM_V_RECTANGLE, 0, 2, 0 }, + { 9, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 41, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 73, 0, ST_OAM_V_RECTANGLE, 0, 4, 0 } +}; + +const struct Subsprite gSubspriteTable_842F3E8[] = { + { -1, 0, ST_OAM_V_RECTANGLE, 0, 0, 0 }, + { 1, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 33, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 49, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 81, 0, ST_OAM_V_RECTANGLE, 0, 4, 0 } +}; + +const struct Subsprite gSubspriteTable_842F410[] = { + { -1, 0, ST_OAM_V_RECTANGLE, 0, 0, 0 }, + { 1, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 33, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 57, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 89, 0, ST_OAM_V_RECTANGLE, 0, 4, 0 } +}; + +const struct Subsprite gSubspriteTable_842F438[] = { + { -1, 0, ST_OAM_V_RECTANGLE, 0, 0, 0 }, + { 1, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 33, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 65, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 97, 0, ST_OAM_V_RECTANGLE, 0, 4, 0 } +}; + +const struct Subsprite gSubspriteTable_842F460[] = { + { -1, 0, ST_OAM_V_RECTANGLE, 0, 0, 0 }, + { 1, 0, ST_OAM_V_RECTANGLE, 0, 2, 0 }, + { 9, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 41, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 73, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 105, 0, ST_OAM_V_RECTANGLE, 0, 4, 0 } +}; + +const struct Subsprite gSubspriteTable_842F490[] = { + { -1, 0, ST_OAM_V_RECTANGLE, 0, 0, 0 }, + { 1, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 33, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 65, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 81, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 113, 0, ST_OAM_V_RECTANGLE, 0, 4, 0 } +}; + +const struct Subsprite gSubspriteTable_842F4C0[] = { + { -1, 0, ST_OAM_V_RECTANGLE, 0, 0, 0 }, + { 1, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 33, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 65, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 89, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 121, 0, ST_OAM_V_RECTANGLE, 0, 4, 0 } +}; + +const struct Subsprite gSubspriteTable_842F4F0[] = { + { -1, 0, ST_OAM_V_RECTANGLE, 0, 0, 0 }, + { 1, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 33, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 65, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 97, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 129, 0, ST_OAM_V_RECTANGLE, 0, 4, 0 } +}; + +const struct Subsprite gSubspriteTable_842F520[] = { + { -1, 0, ST_OAM_V_RECTANGLE, 0, 0, 0 }, + { 1, 0, ST_OAM_V_RECTANGLE, 0, 2, 0 }, + { 9, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 41, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 73, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 105, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 137, 0, ST_OAM_V_RECTANGLE, 0, 4, 0 } +}; + +const struct Subsprite gSubspriteTable_842F558[] = { + { -1, 0, ST_OAM_V_RECTANGLE, 0, 0, 0 }, + { 7, 0, ST_OAM_H_RECTANGLE, 2, 6, 0 }, + { 35, 0, ST_OAM_V_RECTANGLE, 0, 4, 0 } +}; + +const struct Subsprite *const gUnknown_0842F570[] = { + gSubspriteTable_842F2C8, + gSubspriteTable_842F2C8, + gSubspriteTable_842F2D8, + gSubspriteTable_842F2F0, + gSubspriteTable_842F310, + gSubspriteTable_842F328, + gSubspriteTable_842F340, + gSubspriteTable_842F360, + gSubspriteTable_842F380, + gSubspriteTable_842F3A0, + gSubspriteTable_842F3C0, + gSubspriteTable_842F3E8, + gSubspriteTable_842F410, + gSubspriteTable_842F438, + gSubspriteTable_842F460, + gSubspriteTable_842F490, + gSubspriteTable_842F4C0, + gSubspriteTable_842F4F0, + gSubspriteTable_842F520 +}; + +const struct Subsprite *const gUnknown_0842F5BC[] = { + gSubspriteTable_842F558 +}; + +const struct SubspriteTable gSubspriteTables_842F5C0[] = { + {1, gMenuCursorSubsprites}, + {1, gMenuCursorSubsprites}, + {2, gMenuCursorSubsprites}, + {3, gMenuCursorSubsprites}, + {4, gMenuCursorSubsprites}, + {5, gMenuCursorSubsprites}, + {6, gMenuCursorSubsprites}, + {7, gMenuCursorSubsprites}, + {8, gMenuCursorSubsprites}, + {9, gMenuCursorSubsprites}, + {10, gMenuCursorSubsprites}, + {11, gMenuCursorSubsprites}, + {12, gMenuCursorSubsprites}, + {13, gMenuCursorSubsprites}, + {14, gMenuCursorSubsprites}, + {15, gMenuCursorSubsprites}, + {1, gMenuCursorSubsprites}, + {17, gMenuCursorSubsprites}, + {18, gMenuCursorSubsprites}, + {19, gMenuCursorSubsprites}, + {20, gMenuCursorSubsprites}, + {21, gMenuCursorSubsprites}, + {22, gMenuCursorSubsprites}, + {23, gMenuCursorSubsprites}, + {24, gMenuCursorSubsprites}, + {25, gMenuCursorSubsprites}, + {26, gMenuCursorSubsprites}, + {27, gMenuCursorSubsprites}, + {28, gMenuCursorSubsprites}, + {29, gMenuCursorSubsprites}, + {30, gMenuCursorSubsprites}, + {31, gMenuCursorSubsprites} +}; + +const struct SubspriteTable gSubspriteTables_842F6C0[] = { + {2, gSubspriteTable_842F2C8}, + {2, gSubspriteTable_842F2C8}, + {3, gSubspriteTable_842F2D8}, + {4, gSubspriteTable_842F2F0}, + {3, gSubspriteTable_842F310}, + {3, gSubspriteTable_842F328}, + {4, gSubspriteTable_842F340}, + {4, gSubspriteTable_842F360}, + {4, gSubspriteTable_842F380}, + {4, gSubspriteTable_842F3A0}, + {5, gSubspriteTable_842F3C0}, + {5, gSubspriteTable_842F3E8}, + {5, gSubspriteTable_842F410}, + {5, gSubspriteTable_842F438}, + {6, gSubspriteTable_842F460}, + {6, gSubspriteTable_842F490}, + {6, gSubspriteTable_842F4C0}, + {6, gSubspriteTable_842F4F0}, + {7, gSubspriteTable_842F520} +}; + +const struct SubspriteTable gUnknown_0842F758[] = { + {3, gMenuCursorSubsprites} +}; + +const struct Subsprite gUnknown_0842F760 = { + .shape = ST_OAM_V_RECTANGLE +}; + +const struct Subsprite gUnknown_0842F768 = { + .shape = ST_OAM_V_RECTANGLE, .tileOffset = 4 +}; + +const struct Subsprite gUnknown_0842F770 = { + .shape = ST_OAM_H_RECTANGLE, .size = 2, .tileOffset = 6 +}; + +const struct Subsprite gUnknown_0842F778 = { + .shape = ST_OAM_V_RECTANGLE, .tileOffset = 2 +}; + +const struct Subsprite gUnknown_0842F780 = { + .shape = ST_OAM_H_RECTANGLE, .size = 2, .tileOffset = 6 +}; + +const struct Subsprite gUnknown_0842F788 = { + .shape = ST_OAM_V_RECTANGLE, .tileOffset = 2 +}; + +const struct Subsprite gUnknown_0842F790 = { + .shape = ST_OAM_V_RECTANGLE, .tileOffset = 4 +}; + +#endif //GUARD_DATA_MENU_CURSOR_H diff --git a/src/debug/matsuda_debug_menu.c b/src/debug/matsuda_debug_menu.c index 728562b81..bb80de6fe 100644 --- a/src/debug/matsuda_debug_menu.c +++ b/src/debug/matsuda_debug_menu.c @@ -18,9 +18,9 @@ #include "ewram.h" extern u8 gUnknown_0203856C; -extern u16 gUnknown_02038670[]; -extern u16 gUnknown_02038678[]; -extern u16 gUnknown_02038680[]; +extern s16 gUnknown_02038670[]; +extern s16 gUnknown_02038678[]; +extern s16 gUnknown_02038680[]; extern u8 gContestFinalStandings[]; extern u8 gUnknown_02038694; extern u8 gIsLinkContest; @@ -31,10 +31,10 @@ extern u16 gSpecialVar_ContestRank; extern u16 gUnknown_030042A4; extern u16 gUnknown_030042A0; -extern u16 gUnknown_030042C0; -extern u16 gUnknown_030041B4; -extern u16 gUnknown_03004288; -extern u16 gUnknown_03004280; +extern u16 gBattle_BG1_X; +extern u16 gBattle_BG1_Y; +extern u16 gBattle_BG2_X; +extern u16 gBattle_BG2_Y; extern u16 gUnknown_030041B0; extern u16 gUnknown_030041B8; extern struct Window gUnknown_03004210; @@ -459,10 +459,10 @@ static void sub_80A9F50(void) REG_BG0VOFS = 0; gUnknown_030042A4 = 0; gUnknown_030042A0 = 0; - gUnknown_030042C0 = 0; - gUnknown_030041B4 = 0; - gUnknown_03004288 = 0; - gUnknown_03004280 = 0; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + gBattle_BG2_X = 0; + gBattle_BG2_Y = 0; gUnknown_030041B0 = 0; gUnknown_030041B8 = 0; } @@ -507,10 +507,10 @@ static void sub_80AA090(void) { REG_BG0HOFS = gUnknown_030042A4; REG_BG0VOFS = gUnknown_030042A0; - REG_BG1HOFS = gUnknown_030042C0; - REG_BG1VOFS = gUnknown_030041B4; - REG_BG2HOFS = gUnknown_03004288; - REG_BG2VOFS = gUnknown_03004280; + REG_BG1HOFS = gBattle_BG1_X; + REG_BG1VOFS = gBattle_BG1_Y; + REG_BG2HOFS = gBattle_BG2_X; + REG_BG2VOFS = gBattle_BG2_Y; REG_BG3HOFS = gUnknown_030041B0; REG_BG3VOFS = gUnknown_030041B8; LoadOam(); @@ -922,211 +922,40 @@ void sub_80AAD44(struct Sprite *sprite, s8 var2) } } -//Do this later -/* void sub_80AAD84(u8 *string, u8 b, u8 c, u8 d) { - u32 r5; - u16 r7; - u8 r7_2; - //u32 sp44; - //u32 sp48; - u32 sp58; + u16 len; + u8 r7; + s32 i; + u8 sp0[32]; + u8 sp20[32]; + u8 str2[2]; - gMain.state = 0; + DmaClear32(3, (void *)(VRAM + 0x18000 - (d + 1) * 256), 0x100); - r5 = d + 1; - //Could also be DmaClear32 - DmaFill32(3, 0, (u8 *)VRAM + 0x18000 - r5 * 256, 0x100); + len = StringLength(string); + if (len > 8) + len = 8; - r7 = StringLength(string); - if (r7 > 8) - r7 = 8; - sp58 = d * 2; + for (i = 0; i < len; i++) + { + str2[0] = string[i]; + str2[1] = EOS; + sub_80034D4(sp0, str2); + DmaCopy32Defvars(3, sp20, (void *)(VRAM + 0x18000 - (d + 1) * 256 + i * 32), sizeof(sp0)); + } - //More stuff + r7 = 124 - d * 2; - r7_2 = 0x7C - sp58; + gMain.oamBuffer[r7] = gUnknown_083C9400; + gMain.oamBuffer[r7].tileNum = 1024 - (d + 1) * 8; + gMain.oamBuffer[r7].x = b; + gMain.oamBuffer[r7].y = c; -} -*/ - -__attribute__((naked)) -void sub_80AAD84(u8 *string, u8 b, u8 c, u8 d) -{ - asm(".syntax unified\n\ - push {r4-r7,lr}\n\ - mov r7, r10\n\ - mov r6, r9\n\ - mov r5, r8\n\ - push {r5-r7}\n\ - sub sp, 0x64\n\ - mov r9, r0\n\ - lsls r1, 24\n\ - lsrs r1, 24\n\ - str r1, [sp, 0x48]\n\ - lsls r2, 24\n\ - lsrs r2, 24\n\ - str r2, [sp, 0x4C]\n\ - lsls r3, 24\n\ - lsrs r3, 24\n\ - mov r10, r3\n\ - mov r5, r10\n\ - adds r5, 0x1\n\ - lsls r1, r5, 8\n\ - ldr r0, _080AAEC4 @ =0x06018000\n\ - subs r1, r0, r1\n\ - movs r0, 0\n\ - str r0, [sp, 0x44]\n\ - ldr r4, _080AAEC8 @ =0x040000d4\n\ - add r0, sp, 0x44\n\ - str r0, [r4]\n\ - str r1, [r4, 0x4]\n\ - ldr r0, _080AAECC @ =0x85000040\n\ - str r0, [r4, 0x8]\n\ - ldr r0, [r4, 0x8]\n\ - mov r0, r9\n\ - bl StringLength\n\ - lsls r0, 16\n\ - lsrs r7, r0, 16\n\ - cmp r7, 0x8\n\ - bls _080AADD0\n\ - movs r7, 0x8\n\ -_080AADD0:\n\ - movs r6, 0\n\ - mov r8, r5\n\ - mov r1, r10\n\ - lsls r1, 1\n\ - str r1, [sp, 0x58]\n\ - ldr r2, [sp, 0x48]\n\ - adds r2, 0x20\n\ - str r2, [sp, 0x5C]\n\ - cmp r6, r7\n\ - bge _080AAE1E\n\ - add r5, sp, 0x40\n\ - add r0, sp, 0x20\n\ - mov r10, r0\n\ - ldr r2, _080AAEC4 @ =0x06018000\n\ -_080AADEC:\n\ - mov r1, r9\n\ - adds r0, r1, r6\n\ - ldrb r0, [r0]\n\ - strb r0, [r5]\n\ - movs r0, 0xFF\n\ - strb r0, [r5, 0x1]\n\ - mov r0, sp\n\ - adds r1, r5, 0\n\ - str r2, [sp, 0x60]\n\ - bl sub_80034D4\n\ - mov r1, r8\n\ - lsls r0, r1, 8\n\ - ldr r2, [sp, 0x60]\n\ - subs r0, r2, r0\n\ - mov r1, r10\n\ - str r1, [r4]\n\ - str r0, [r4, 0x4]\n\ - ldr r0, _080AAED0 @ =0x84000008\n\ - str r0, [r4, 0x8]\n\ - ldr r0, [r4, 0x8]\n\ - adds r2, 0x20\n\ - adds r6, 0x1\n\ - cmp r6, r7\n\ - blt _080AADEC\n\ -_080AAE1E:\n\ - movs r1, 0x7C\n\ - ldr r2, [sp, 0x58]\n\ - subs r1, r2\n\ - lsls r1, 24\n\ - lsrs r7, r1, 24\n\ - ldr r0, _080AAED4 @ =gMain\n\ - mov r9, r0\n\ - lsls r3, r7, 3\n\ - add r3, r9\n\ - ldr r0, _080AAED8 @ =gUnknown_083C9400\n\ - ldr r1, [r0]\n\ - ldr r2, [r0, 0x4]\n\ - str r1, [sp, 0x50]\n\ - str r2, [sp, 0x54]\n\ - str r1, [r3, 0x3C]\n\ - str r2, [r3, 0x40]\n\ - mov r2, r8\n\ - lsls r0, r2, 3\n\ - movs r1, 0x80\n\ - lsls r1, 3\n\ - adds r2, r1, 0\n\ - subs r2, r0\n\ - adds r6, r3, 0\n\ - adds r6, 0x40\n\ - ldr r0, _080AAEDC @ =0x000003ff\n\ - mov r8, r0\n\ - mov r1, r8\n\ - ands r2, r1\n\ - ldrh r5, [r6]\n\ - ldr r4, _080AAEE0 @ =0xfffffc00\n\ - adds r0, r4, 0\n\ - ands r0, r5\n\ - orrs r0, r2\n\ - strh r0, [r6]\n\ - ldrh r5, [r3, 0x3E]\n\ - ldr r2, _080AAEE4 @ =0xfffffe00\n\ - adds r0, r2, 0\n\ - ands r0, r5\n\ - ldr r1, [sp, 0x48]\n\ - orrs r0, r1\n\ - strh r0, [r3, 0x3E]\n\ - adds r3, 0x3C\n\ - add r0, sp, 0x4C\n\ - ldrb r0, [r0]\n\ - strb r0, [r3]\n\ - adds r1, r7, 0x1\n\ - lsls r1, 3\n\ - mov r0, r9\n\ - adds r7, r1, r0\n\ - ldr r0, [sp, 0x50]\n\ - ldr r1, [sp, 0x54]\n\ - str r0, [r7, 0x3C]\n\ - str r1, [r7, 0x40]\n\ - ldrh r0, [r6]\n\ - lsls r0, 22\n\ - lsrs r0, 22\n\ - adds r0, 0x4\n\ - adds r5, r7, 0\n\ - adds r5, 0x40\n\ - mov r1, r8\n\ - ands r0, r1\n\ - ldrh r3, [r5]\n\ - ands r4, r3\n\ - orrs r4, r0\n\ - strh r4, [r5]\n\ - ldrh r0, [r7, 0x3E]\n\ - ands r2, r0\n\ - ldr r0, [sp, 0x5C]\n\ - orrs r2, r0\n\ - strh r2, [r7, 0x3E]\n\ - adds r1, r7, 0\n\ - adds r1, 0x3C\n\ - add r2, sp, 0x4C\n\ - ldrb r2, [r2]\n\ - strb r2, [r1]\n\ - add sp, 0x64\n\ - pop {r3-r5}\n\ - mov r8, r3\n\ - mov r9, r4\n\ - mov r10, r5\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - .align 2, 0\n\ -_080AAEC4: .4byte 0x06018000\n\ -_080AAEC8: .4byte 0x040000d4\n\ -_080AAECC: .4byte 0x85000040\n\ -_080AAED0: .4byte 0x84000008\n\ -_080AAED4: .4byte gMain\n\ -_080AAED8: .4byte gUnknown_083C9400\n\ -_080AAEDC: .4byte 0x000003ff\n\ -_080AAEE0: .4byte 0xfffffc00\n\ -_080AAEE4: .4byte 0xfffffe00\n\ - .syntax divided\n"); + gMain.oamBuffer[r7 + 1] = gUnknown_083C9400; + gMain.oamBuffer[r7 + 1].tileNum = gMain.oamBuffer[r7].tileNum + 4; + gMain.oamBuffer[r7 + 1].x = b + 32; + gMain.oamBuffer[r7 + 1].y = c; } void unref_sub_80AAEE8(s32 a, u8 b, u8 c, u8 d) diff --git a/src/debug/mori_debug_menu.c b/src/debug/mori_debug_menu.c index 2c937bb28..83dba8b73 100644 --- a/src/debug/mori_debug_menu.c +++ b/src/debug/mori_debug_menu.c @@ -136,7 +136,7 @@ u8 MoriDebugMenu_10000Steps(void) u8 MoriDebugMenu_MoveTutor(void) { - sub_8132670(); + TeachMoveTutorMove(); CloseMenu(); return 1; } diff --git a/src/debug/unknown_debug_menu.c b/src/debug/unknown_debug_menu.c index 429f43766..a8c3ad16b 100644 --- a/src/debug/unknown_debug_menu.c +++ b/src/debug/unknown_debug_menu.c @@ -6,10 +6,30 @@ extern u8 gBattleCommunication[]; extern u8 (*gCallback_03004AE8)(void); -extern const struct MenuAction gUnknown_0842C29C[]; - +static u8 sub_814A4B8(void); static u8 sub_814A464(void); +const u8 UnknownString_1stRound[] = _("1st round"); +const u8 UnknownString_2ndRound[] = _("2nd round"); +const u8 UnknownString_3rdRound[] = _("3rd round"); +const u8 UnknownString_4thRound[] = _("4th round"); +const u8 UnknownString_5thRound[] = _("5th round"); +const u8 UnknownString_6thRound[] = _("6th round"); +const u8 UnknownString_7thRound[] = _("7th round"); +const u8 UnknownString_8thRound[] = _("8th round"); + + +const struct MenuAction gUnknown_0842C29C[] = { + {UnknownString_1stRound, sub_814A4B8}, + {UnknownString_2ndRound, sub_814A4B8}, + {UnknownString_3rdRound, sub_814A4B8}, + {UnknownString_4thRound, sub_814A4B8}, + {UnknownString_5thRound, sub_814A4B8}, + {UnknownString_6thRound, sub_814A4B8}, + {UnknownString_7thRound, sub_814A4B8}, + {UnknownString_8thRound, sub_814A4B8} +}; + int unref_sub_814A414(void) { MenuZeroFillScreen(); @@ -40,7 +60,7 @@ static u8 sub_814A464(void) } } -u8 sub_814A4B8(void) +static u8 sub_814A4B8(void) { gSaveBlock2.battleTower.var_4AE[0] = 3; gSaveBlock2.battleTower.var_4AE[1] = 3; diff --git a/src/engine/menu_cursor.c b/src/engine/menu_cursor.c index d43be2a2f..960d3cc87 100644 --- a/src/engine/menu_cursor.c +++ b/src/engine/menu_cursor.c @@ -3,25 +3,7 @@ #include "palette.h" #include "sprite.h" -extern const struct SpriteSheet gUnknown_0842F140[]; -extern const struct SpriteSheet gUnknown_0842F1C0[]; -extern const struct SpritePalette gUnknown_0842F240; -extern const struct SpritePalette gUnknown_0842F248; -extern const struct SpriteTemplate gSpriteTemplate_842F250[]; -extern const struct SpriteTemplate gSpriteTemplate_842F298[]; - -extern struct Subsprite *const gUnknown_0842F5BC[]; - -extern const struct SubspriteTable gSubspriteTables_842F5C0[]; -extern const struct SubspriteTable gSubspriteTables_842F6C0[]; -extern const struct SubspriteTable gUnknown_0842F758[]; - -extern const struct Subsprite gUnknown_0842F780; -extern const struct Subsprite gUnknown_0842F788; -extern const struct Subsprite gUnknown_0842F790; - -extern u16 gUnknown_0203A360[]; - +EWRAM_DATA u16 gUnknown_0203A360[0x10] = {}; EWRAM_DATA struct Subsprite gMenuCursorSubsprites[10] = {0}; EWRAM_DATA u8 gUnknown_0203A3D0 = 0; EWRAM_DATA u8 gUnknown_0203A3D1 = 0; @@ -29,6 +11,12 @@ EWRAM_DATA u8 gUnknown_0203A3D2 = 0; EWRAM_DATA u8 gUnknown_0203A3D3 = 0; EWRAM_DATA u8 gUnknown_0203A3D4 = 0; +#if ENGLISH +#include "../src/data/menu_cursor_en.h" +#elif GERMAN +#include "../src/data/menu_cursor_de.h" +#endif // ENGLISH/GERMAN + void sub_814A590(void) { gUnknown_0203A3D0 = 0x40; diff --git a/src/engine/mystery_event_msg.c b/src/engine/mystery_event_msg.c new file mode 100644 index 000000000..03ef22727 --- /dev/null +++ b/src/engine/mystery_event_msg.c @@ -0,0 +1,51 @@ +#include "global.h" + +#if ENGLISH + +const u8 gOtherText_BerryObtainedDadHasIt[] = _("Obtained a {STR_VAR_2} BERRY!\nDad has it at PETALBURG GYM."); + +const u8 gOtherText_BerryTransformed[] = _("The {STR_VAR_1} BERRY transformed into\none {STR_VAR_2} BERRY."); + +const u8 gOtherText_BerryAlreadyObtained[] = _("The {STR_VAR_1} BERRY has already been\nobtained."); + +const u8 gOtherText_SpecialRibbonReceived[] = _("A special RIBBON was awarded to your\nparty POKéMON."); + +const u8 gOtherText_DexUpgraded[] = _("The POKéDEX has been upgraded with\nthe NATIONAL MODE."); + +const u8 gOtherText_RareWordAdded[] = _("A rare word has been added."); + +const u8 gOtherText_PokeWasSentOver[] = _("{STR_VAR_1} was sent over!"); + +const u8 gOtherText_PartyIsFull[] = _("Your party is full.\n{STR_VAR_1} could not be sent over."); + +const u8 gOtherText_NewTrainerInHoenn[] = _("A new TRAINER has arrived in HOENN."); + +const u8 gOtherText_NewAdversaryInBattleTower[] = _("A new adversary has arrived in the\nBATTLE TOWER."); + +const u8 gOtherText_DataCannotUseVersion[] = _("This data cannot be used in\nthis version."); + +#elif GERMAN + +const u8 gOtherText_BerryObtainedDadHasIt[] = _("Eine {STR_VAR_2}BEERE! Vater in der \nARENA von BLÜTENBURG CITY besitzt\lauch eine."); + +const u8 gOtherText_BerryTransformed[] = _("Die {STR_VAR_1}BEERE verwandelte\nsich in eine {STR_VAR_2}BEERE!"); + +const u8 gOtherText_BerryAlreadyObtained[] = _("Du hast schon eine {STR_VAR_1}BEERE."); + +const u8 gOtherText_SpecialRibbonReceived[] = _("Ein besonderes BAND wurde deinem\nPOKéMON im Team verliehen."); + +const u8 gOtherText_DexUpgraded[] = _("Der POKéDEX wurde mit dem NATIONALEN\nMODUS ausgerüstet."); + +const u8 gOtherText_RareWordAdded[] = _("Ein seltenes Wort wurde hinzugefügt."); + +const u8 gOtherText_PokeWasSentOver[] = _("{STR_VAR_1} wurde gesendet!"); + +const u8 gOtherText_PartyIsFull[] = _("Dein Team ist bereits vollständig.\n{STR_VAR_1} kann nicht gesendet\lwerden."); + +const u8 gOtherText_NewTrainerInHoenn[] = _("Ein neuer TRAINER ist in HOENN\nangekommen."); + +const u8 gOtherText_NewAdversaryInBattleTower[] = _("Ein neuer Widersacher ist im DUELLTURM\neingetroffen."); + +const u8 gOtherText_DataCannotUseVersion[] = _("Die Daten können in dieser Edition\nnicht eingesetzt werden."); + +#endif // ENGLISH/GERMAN diff --git a/src/engine/mystery_event_script.c b/src/engine/mystery_event_script.c index 12ad329da..6fcad66ac 100644 --- a/src/engine/mystery_event_script.c +++ b/src/engine/mystery_event_script.c @@ -14,6 +14,7 @@ #include "string_util.h" #include "text.h" #include "util.h" +#include "mystery_event_msg.h" #if ENGLISH #define LANGUAGE_MASK 0x2 @@ -32,17 +33,6 @@ extern void party_compaction(void); extern ScrCmdFunc gMysteryEventScriptCmdTable[]; extern ScrCmdFunc gMysteryEventScriptCmdTableEnd[]; -extern const u8 gOtherText_BerryObtainedDadHasIt[]; -extern const u8 gOtherText_BerryTransformed[]; -extern const u8 gOtherText_BerryAlreadyObtained[]; -extern const u8 gOtherText_SpecialRibbonReceived[]; -extern const u8 gOtherText_DexUpgraded[]; -extern const u8 gOtherText_RareWordAdded[]; -extern const u8 gOtherText_PokeWasSentOver[]; -extern const u8 gOtherText_PartyIsFull[]; -extern const u8 gOtherText_NewTrainerInHoenn[]; -extern const u8 gOtherText_DataCannotUseVersion[]; - static EWRAM_DATA struct ScriptContext sMysteryEventScriptContext = {0}; static bool32 CheckCompatibility(u16 a1, u32 a2, u16 a3, u32 a4) @@ -317,7 +307,7 @@ bool8 MEScrCmd_setenigmaberry(struct ScriptContext *ctx) ctx->data[2] = 2; if (IsEnigmaBerryValid() == TRUE) - VarSet(0x402D, 1); + VarSet(VAR_ENIGMA_BERRY_AVAILABLE, 1); else ctx->data[2] = 1; diff --git a/src/engine/naming_screen.c b/src/engine/naming_screen.c index 4d2545440..440504d5a 100644 --- a/src/engine/naming_screen.c +++ b/src/engine/naming_screen.c @@ -1,6 +1,7 @@ #include "global.h" #include "naming_screen.h" #include "data2.h" +#include "graphics.h" #include "field_effect.h" #include "field_map_obj.h" #include "field_player_avatar.h" @@ -29,16 +30,11 @@ extern u16 gKeyRepeatStartDelay; extern u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u32 personality); -const u32 gSpriteImage_83CE094[] = INCBIN_U32("graphics/naming_screen/pc_icon/0.4bpp"); -const u32 gSpriteImage_83CE154[] = INCBIN_U32("graphics/naming_screen/pc_icon/1.4bpp"); +const u8 gSpriteImage_83CE094[] = INCBIN_U8("graphics/naming_screen/pc_icon/0.4bpp"); +const u8 gSpriteImage_83CE154[] = INCBIN_U8("graphics/naming_screen/pc_icon/1.4bpp"); -//Some unused pointer, perhaps. -asm(".section .rodata\n\ -@ XXX: what is this?\n\ - .align 2\n\ - .4byte 0x2000000\n"); +struct NamingScreenData *const namingScreenDataPtr = &namingScreenData; -extern u16 *const gUnknown_083CE28C[]; extern const struct SubspriteTable gSubspriteTables_83CE558[]; extern const struct SubspriteTable gSubspriteTables_83CE560[]; extern const struct SubspriteTable gSubspriteTables_83CE578[]; @@ -55,7 +51,6 @@ extern const struct SpriteTemplate gSpriteTemplate_83CE688; extern const struct SpriteSheet gUnknown_083CE6A0[]; extern const struct SpritePalette gUnknown_083CE708[]; extern const u8 gNamingScreenMenu_Gfx[]; -extern const u16 gNamingScreenPalettes[]; extern const u16 gUnknown_083CE748[]; extern const u16 gUnknown_083CEBF8[]; extern const u16 gUnknown_083CF0A8[]; @@ -198,12 +193,12 @@ static void VBlankCB_NamingScreen(void) LoadOam(); ProcessSpriteCopyRequests(); TransferPlttBuffer(); - REG_BG1VOFS = namingScreenData.bg1vOffset; - REG_BG2VOFS = namingScreenData.bg2vOffset; + REG_BG1VOFS = namingScreenDataPtr->bg1vOffset; + REG_BG2VOFS = namingScreenDataPtr->bg2vOffset; REG_BG1CNT &= 0xFFFC; - REG_BG1CNT |= namingScreenData.unk8; + REG_BG1CNT |= namingScreenDataPtr->unk8; REG_BG2CNT &= 0xFFFC; - REG_BG2CNT |= namingScreenData.unkA; + REG_BG2CNT |= namingScreenDataPtr->unkA; } static void StoreNamingScreenParameters(u8 templateNum, u8 *destBuffer, u16 c, u16 d, u32 e, MainCallback returnCallback) @@ -228,12 +223,12 @@ static void GetNamingScreenParameters(void) taskId = FindTaskIdByFunc(Task_DoNothing); task = &gTasks[taskId]; - namingScreenData.templateNum = task->data[0]; - namingScreenData.unk3E = task->data[1]; - namingScreenData.unk40 = task->data[2]; - namingScreenData.unk42 = (task->data[3] << 16) | (u16)task->data[4]; - LoadWordFromTwoHalfwords(&task->data[5], (u32 *)&namingScreenData.destBuffer); - LoadWordFromTwoHalfwords(&task->data[7], (u32 *)&namingScreenData.returnCallback); + namingScreenDataPtr->templateNum = task->data[0]; + namingScreenDataPtr->unk3E = task->data[1]; + namingScreenDataPtr->unk40 = task->data[2]; + namingScreenDataPtr->unk42 = (task->data[3] << 16) | (u16)task->data[4]; + LoadWordFromTwoHalfwords(&task->data[5], (u32 *)&namingScreenDataPtr->destBuffer); + LoadWordFromTwoHalfwords(&task->data[7], (u32 *)&namingScreenDataPtr->returnCallback); DestroyTask(taskId); } @@ -311,20 +306,20 @@ static const struct NamingScreenTemplate *const sNamingScreenTemplates[]; //for static void NamingScreen_Init(void) { GetNamingScreenParameters(); - namingScreenData.state = 0; - namingScreenData.bg1vOffset = 0; - namingScreenData.bg2vOffset = 0; - namingScreenData.unk8 = 1; - namingScreenData.unkA = 2; - namingScreenData.unkC = 0; - namingScreenData.unkD = 1; - namingScreenData.template = sNamingScreenTemplates[namingScreenData.templateNum]; - namingScreenData.currentPage = namingScreenData.template->unk4; - namingScreenData.unk2 = 14 - namingScreenData.template->maxChars / 2; - namingScreenData.unk3C = gKeyRepeatStartDelay; - memset(namingScreenData.textBuffer, 0xFF, sizeof(namingScreenData.textBuffer)); - if (namingScreenData.template->unk0 != 0) - StringCopy(namingScreenData.textBuffer, namingScreenData.destBuffer); + namingScreenDataPtr->state = 0; + namingScreenDataPtr->bg1vOffset = 0; + namingScreenDataPtr->bg2vOffset = 0; + namingScreenDataPtr->unk8 = 1; + namingScreenDataPtr->unkA = 2; + namingScreenDataPtr->unkC = 0; + namingScreenDataPtr->unkD = 1; + namingScreenDataPtr->template = sNamingScreenTemplates[namingScreenDataPtr->templateNum]; + namingScreenDataPtr->currentPage = namingScreenDataPtr->template->unk4; + namingScreenDataPtr->unk2 = 14 - namingScreenDataPtr->template->maxChars / 2; + namingScreenDataPtr->unk3C = gKeyRepeatStartDelay; + memset(namingScreenDataPtr->textBuffer, 0xFF, sizeof(namingScreenDataPtr->textBuffer)); + if (namingScreenDataPtr->template->unk0 != 0) + StringCopy(namingScreenDataPtr->textBuffer, namingScreenDataPtr->destBuffer); gKeyRepeatStartDelay = 16; } @@ -408,14 +403,14 @@ static void sub_80B5E50(void) static void Task_NamingScreenMain(u8 taskId) { - while (sMainStateFuncs[namingScreenData.state](&gTasks[taskId]) != 0) + while (sMainStateFuncs[namingScreenDataPtr->state](&gTasks[taskId]) != 0) ; } static bool8 MainState_BeginFadeIn(struct Task *task) { BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); - namingScreenData.state++; + namingScreenDataPtr->state++; return 0; } @@ -425,7 +420,7 @@ static bool8 MainState_WaitFadeIn(struct Task *task) { SetInputState(INPUT_STATE_ENABLED); sub_80B68D8(1); - namingScreenData.state++; + namingScreenDataPtr->state++; } return FALSE; } @@ -441,7 +436,7 @@ static bool8 MainState_MoveToOKButton(struct Task *task) { SetInputState(INPUT_STATE_ENABLED); MoveCursorToOKButton(); - namingScreenData.state = MAIN_STATE_HANDLE_INPUT; + namingScreenDataPtr->state = MAIN_STATE_HANDLE_INPUT; } return FALSE; } @@ -454,7 +449,7 @@ static bool8 MainState_StartPageSwap(struct Task *task) sub_80B6888(1); sub_80B6460(0, 0, 1); PlaySE(SE_WIN_OPEN); - namingScreenData.state = MAIN_STATE_WAIT_PAGE_SWAP; + namingScreenDataPtr->state = MAIN_STATE_WAIT_PAGE_SWAP; return FALSE; } @@ -465,18 +460,18 @@ static bool8 MainState_WaitPageSwap(struct Task *task) if (IsPageSwapAnimNotInProgress()) { - namingScreenData.state = MAIN_STATE_HANDLE_INPUT; - namingScreenData.currentPage++; - namingScreenData.currentPage %= 3; + namingScreenDataPtr->state = MAIN_STATE_HANDLE_INPUT; + namingScreenDataPtr->currentPage++; + namingScreenDataPtr->currentPage %= 3; sub_80B7614(); sub_80B77F8(); SetInputState(INPUT_STATE_ENABLED); GetCursorPos(&cursorX, &cursorY); #if ENGLISH - if (namingScreenData.currentPage == PAGE_OTHERS && (cursorX == 6 || cursorX == 7)) + if (namingScreenDataPtr->currentPage == PAGE_OTHERS && (cursorX == 6 || cursorX == 7)) cursorX = 5; #elif GERMAN - if (namingScreenData.currentPage == PAGE_OTHERS && (cursorX == 7 || cursorX == 8)) + if (namingScreenDataPtr->currentPage == PAGE_OTHERS && (cursorX == 7 || cursorX == 8)) cursorX = 6; #endif SetCursorPos(cursorX, cursorY); @@ -491,17 +486,17 @@ static bool8 MainState_6(struct Task *task) SetInputState(INPUT_STATE_DISABLED); sub_80B68D8(0); sub_80B6460(3, 0, 1); - gKeyRepeatStartDelay = namingScreenData.unk3C; - if (namingScreenData.templateNum == NAMING_SCREEN_TEMPLATE_MON_NAME + gKeyRepeatStartDelay = namingScreenDataPtr->unk3C; + if (namingScreenDataPtr->templateNum == NAMING_SCREEN_TEMPLATE_MON_NAME && CalculatePlayerPartyCount() >= 6) { DisplaySentToPCMessage(); - namingScreenData.state = MAIN_STATE_UPDATE_SENT_TO_PC_MESSAGE; + namingScreenDataPtr->state = MAIN_STATE_UPDATE_SENT_TO_PC_MESSAGE; return FALSE; } else { - namingScreenData.state = MAIN_STATE_BEGIN_FADE_OUT; + namingScreenDataPtr->state = MAIN_STATE_BEGIN_FADE_OUT; return TRUE; //Exit the naming screen } } @@ -509,21 +504,21 @@ static bool8 MainState_6(struct Task *task) static bool8 MainState_UpdateSentToPCMessage(struct Task *task) { if (MenuUpdateWindowText()) - namingScreenData.state++; + namingScreenDataPtr->state++; return FALSE; } static bool8 MainState_BeginFadeInOut(struct Task *task) { BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0); - namingScreenData.state++; + namingScreenDataPtr->state++; return FALSE; } static bool8 MainState_WaitFadeOutAndExit(struct Task *task) { if (!gPaletteFade.active) - SetMainCallback2(namingScreenData.returnCallback); + SetMainCallback2(namingScreenDataPtr->returnCallback); return FALSE; } @@ -584,7 +579,7 @@ static bool8 KeyboardKeyHandler_Character(u8 event) if (var) { SetInputState(INPUT_STATE_DISABLED); - namingScreenData.state = MAIN_STATE_MOVE_TO_OK_BUTTON; + namingScreenDataPtr->state = MAIN_STATE_MOVE_TO_OK_BUTTON; } } return FALSE; @@ -613,7 +608,7 @@ static bool8 KeyboardKeyHandler_OK(u8 event) if (event == KBEVENT_PRESSED_A) { PlaySE(SE_SELECT); - namingScreenData.state = MAIN_STATE_6; + namingScreenDataPtr->state = MAIN_STATE_6; return TRUE; } else @@ -622,7 +617,7 @@ static bool8 KeyboardKeyHandler_OK(u8 event) static bool8 sub_80B61C8(void) { - namingScreenData.state = MAIN_STATE_START_PAGE_SWAP; + namingScreenDataPtr->state = MAIN_STATE_START_PAGE_SWAP; return TRUE; } @@ -764,9 +759,9 @@ static void HandleDpadMovement(struct Task *task) { //The "others" page only has 5 columns #if ENGLISH - if (namingScreenData.currentPage == PAGE_OTHERS && (cursorX == 6 || cursorX == 7)) + if (namingScreenDataPtr->currentPage == PAGE_OTHERS && (cursorX == 6 || cursorX == 7)) #elif GERMAN - if (namingScreenData.currentPage == PAGE_OTHERS && (cursorX == 6 || cursorX == 7 || cursorX == 8)) + if (namingScreenDataPtr->currentPage == PAGE_OTHERS && (cursorX == 6 || cursorX == 7 || cursorX == 8)) #endif { if (sDpadDeltaX[dpadDir] > 0) @@ -948,8 +943,8 @@ static void Task_HandlePageSwapAnim(u8 taskId) static bool8 PageSwapAnimState_Init(struct Task *task) { - namingScreenData.bg1vOffset = 0; - namingScreenData.bg2vOffset = 0; + namingScreenDataPtr->bg1vOffset = 0; + namingScreenDataPtr->bg2vOffset = 0; task->tState++; return 0; } @@ -958,19 +953,19 @@ static bool8 PageSwapAnimState_1(struct Task *task) { u16 *const arr[] = { - &namingScreenData.bg2vOffset, - &namingScreenData.bg1vOffset + &namingScreenDataPtr->bg2vOffset, + &namingScreenDataPtr->bg1vOffset }; task->tFrameCount += 4; - *arr[namingScreenData.unkC] = Sin(task->tFrameCount, 40); - *arr[namingScreenData.unkD] = Sin((task->tFrameCount + 128) & 0xFF, 40); + *arr[namingScreenDataPtr->unkC] = Sin(task->tFrameCount, 40); + *arr[namingScreenDataPtr->unkD] = Sin((task->tFrameCount + 128) & 0xFF, 40); if (task->tFrameCount >= 64) { - u8 temp = namingScreenData.unk8; //Why u8 and not u16? + u8 temp = namingScreenDataPtr->unk8; //Why u8 and not u16? - namingScreenData.unk8 = namingScreenData.unkA; - namingScreenData.unkA = temp; + namingScreenDataPtr->unk8 = namingScreenDataPtr->unkA; + namingScreenDataPtr->unkA = temp; task->tState++; } return 0; @@ -978,17 +973,17 @@ static bool8 PageSwapAnimState_1(struct Task *task) static bool8 PageSwapAnimState_2(struct Task *task) { - u16 *const arr[] = {&namingScreenData.bg2vOffset, &namingScreenData.bg1vOffset}; + u16 *const arr[] = {&namingScreenDataPtr->bg2vOffset, &namingScreenDataPtr->bg1vOffset}; task->tFrameCount += 4; - *arr[namingScreenData.unkC] = Sin(task->tFrameCount, 40); - *arr[namingScreenData.unkD] = Sin((task->tFrameCount + 128) & 0xFF, 40); + *arr[namingScreenDataPtr->unkC] = Sin(task->tFrameCount, 40); + *arr[namingScreenDataPtr->unkD] = Sin((task->tFrameCount + 128) & 0xFF, 40); if (task->tFrameCount >= 128) { - u8 temp = namingScreenData.unkC; + u8 temp = namingScreenDataPtr->unkC; - namingScreenData.unkC = namingScreenData.unkD; - namingScreenData.unkD = temp; + namingScreenDataPtr->unkC = namingScreenDataPtr->unkD; + namingScreenDataPtr->unkD = temp; task->tState++; } return 0; @@ -1009,11 +1004,11 @@ static bool8 PageSwapAnimState_Done(struct Task *task) static void CursorInit(void) { - namingScreenData.cursorSpriteId = CreateSprite(&gSpriteTemplate_83CE640, 0, 0, 0); - gSprites[namingScreenData.cursorSpriteId].oam.priority = 1; - gSprites[namingScreenData.cursorSpriteId].oam.objMode = 1; - gSprites[namingScreenData.cursorSpriteId].data[6] = 1; - gSprites[namingScreenData.cursorSpriteId].data[6] = 2; + namingScreenDataPtr->cursorSpriteId = CreateSprite(&gSpriteTemplate_83CE640, 0, 0, 0); + gSprites[namingScreenDataPtr->cursorSpriteId].oam.priority = 1; + gSprites[namingScreenDataPtr->cursorSpriteId].oam.objMode = 1; + gSprites[namingScreenDataPtr->cursorSpriteId].data[6] = 1; + gSprites[namingScreenDataPtr->cursorSpriteId].data[6] = 2; SetCursorPos(0, 0); } @@ -1031,12 +1026,12 @@ static const u8 sKeyboardSymbolPositions[][COLUMN_COUNT] = { static u8 CursorColToKeyboardCol(s16 x) { - return sKeyboardSymbolPositions[namingScreenData.currentPage][x]; + return sKeyboardSymbolPositions[namingScreenDataPtr->currentPage][x]; } static void SetCursorPos(s16 x, s16 y) { - struct Sprite *cursorSprite = &gSprites[namingScreenData.cursorSpriteId]; + struct Sprite *cursorSprite = &gSprites[namingScreenDataPtr->cursorSpriteId]; cursorSprite->pos1.x = CursorColToKeyboardCol(x) * 8 + 27; cursorSprite->pos1.y = y * 16 + 80; @@ -1048,7 +1043,7 @@ static void SetCursorPos(s16 x, s16 y) static void GetCursorPos(s16 *x, s16 *y) { - struct Sprite *cursorSprite = &gSprites[namingScreenData.cursorSpriteId]; + struct Sprite *cursorSprite = &gSprites[namingScreenDataPtr->cursorSpriteId]; *x = cursorSprite->data[0]; *y = cursorSprite->data[1]; @@ -1061,25 +1056,25 @@ static void MoveCursorToOKButton(void) static void sub_80B6888(u8 a) { - gSprites[namingScreenData.cursorSpriteId].data[4] &= -256; - gSprites[namingScreenData.cursorSpriteId].data[4] |= a; - StartSpriteAnim(&gSprites[namingScreenData.cursorSpriteId], 0); + gSprites[namingScreenDataPtr->cursorSpriteId].data[4] &= -256; + gSprites[namingScreenDataPtr->cursorSpriteId].data[4] |= a; + StartSpriteAnim(&gSprites[namingScreenDataPtr->cursorSpriteId], 0); } static void sub_80B68D8(u8 a) { - gSprites[namingScreenData.cursorSpriteId].data[4] &= 0xFF; - gSprites[namingScreenData.cursorSpriteId].data[4] |= a << 8; + gSprites[namingScreenDataPtr->cursorSpriteId].data[4] &= 0xFF; + gSprites[namingScreenDataPtr->cursorSpriteId].data[4] |= a << 8; } static void sub_80B6914(void) { - StartSpriteAnim(&gSprites[namingScreenData.cursorSpriteId], 1); + StartSpriteAnim(&gSprites[namingScreenDataPtr->cursorSpriteId], 1); } static bool8 IsCursorAnimFinished(void) { - return gSprites[namingScreenData.cursorSpriteId].animEnded; + return gSprites[namingScreenDataPtr->cursorSpriteId].animEnded; } static u8 GetKeyRoleAtCursorPos(void) @@ -1134,7 +1129,7 @@ static void sub_80B6A80(void) u8 spriteId3; spriteId1 = CreateSprite(&gSpriteTemplate_83CE5C8, 0xCC, 0x50, 0); - namingScreenData.unk10 = spriteId1; + namingScreenDataPtr->unk10 = spriteId1; SetSubspriteTables(&gSprites[spriteId1], gSubspriteTables_83CE558); spriteId2 = CreateSprite(&gSpriteTemplate_83CE5F8, 0xCC, 0x4C, 1); @@ -1148,10 +1143,10 @@ static void sub_80B6A80(void) static void sub_80B6B14(void) { - struct Sprite *sprite = &gSprites[namingScreenData.unk10]; + struct Sprite *sprite = &gSprites[namingScreenDataPtr->unk10]; sprite->data[0] = 2; - sprite->data[1] = namingScreenData.currentPage; + sprite->data[1] = namingScreenDataPtr->currentPage; } static u8 sub_80B6B5C(struct Sprite *); @@ -1178,7 +1173,7 @@ static u8 sub_80B6B5C(struct Sprite *sprite) struct Sprite *sprite1 = &gSprites[sprite->data[6]]; struct Sprite *sprite2 = &gSprites[sprite->data[7]]; - sub_80B6C48(namingScreenData.currentPage, sprite1, sprite2); + sub_80B6C48(namingScreenDataPtr->currentPage, sprite1, sprite2); sprite->data[0]++; return 0; } @@ -1247,11 +1242,11 @@ static void sub_80B6D04(void) s16 r1; u8 i; - r1 = (namingScreenData.unk2 - 1) * 8 + 4; + r1 = (namingScreenDataPtr->unk2 - 1) * 8 + 4; spriteId = CreateSprite(&gSpriteTemplate_83CE658, r1, 0x28, 0); gSprites[spriteId].oam.priority = 3; - r1 = namingScreenData.unk2 * 8 + 4; - for (i = 0; i < namingScreenData.template->maxChars; i++, r1 += 8) + r1 = namingScreenDataPtr->unk2 * 8 + 4; + for (i = 0; i < namingScreenDataPtr->template->maxChars; i++, r1 += 8) { spriteId = CreateSprite(&gSpriteTemplate_83CE670, r1, 0x2C, 0); gSprites[spriteId].oam.priority = 3; @@ -1312,7 +1307,7 @@ static void (*const gUnknown_083CE2E0[])(void) = static void sub_80B6E44(void) { - gUnknown_083CE2E0[namingScreenData.template->unk2](); + gUnknown_083CE2E0[namingScreenDataPtr->template->unk2](); } static void nullsub_40(void) @@ -1324,7 +1319,7 @@ static void sub_80B6E68(void) u8 rivalGfxId; u8 spriteId; - rivalGfxId = GetRivalAvatarGraphicsIdByStateIdAndGender(0, namingScreenData.unk3E); + rivalGfxId = GetRivalAvatarGraphicsIdByStateIdAndGender(0, namingScreenDataPtr->unk3E); spriteId = AddPseudoFieldObject(rivalGfxId, SpriteCallbackDummy, 0x38, 0x18, 0); gSprites[spriteId].oam.priority = 3; StartSpriteAnim(&gSprites[spriteId], 4); @@ -1344,7 +1339,7 @@ static void sub_80B6EFC(void) u8 spriteId; sub_809D51C(); - spriteId = CreateMonIcon(namingScreenData.unk3E, SpriteCallbackDummy, 0x34, 0x18, 0, namingScreenData.unk42); + spriteId = CreateMonIcon(namingScreenDataPtr->unk3E, SpriteCallbackDummy, 0x34, 0x18, 0, namingScreenDataPtr->unk42); gSprites[spriteId].oam.priority = 3; } @@ -1352,21 +1347,21 @@ static u8 GetTextCaretPosition(void) { u8 i; - for (i = 0; i < namingScreenData.template->maxChars; i++) + for (i = 0; i < namingScreenDataPtr->template->maxChars; i++) { - if (namingScreenData.textBuffer[i] == EOS) + if (namingScreenDataPtr->textBuffer[i] == EOS) return i; } - return namingScreenData.template->maxChars - 1; + return namingScreenDataPtr->template->maxChars - 1; } static u8 GetPreviousTextCaretPosition(void) { s8 i; - for (i = namingScreenData.template->maxChars - 1; i > 0; i--) + for (i = namingScreenDataPtr->template->maxChars - 1; i > 0; i--) { - if (namingScreenData.textBuffer[i] != EOS) + if (namingScreenDataPtr->textBuffer[i] != EOS) return i; } return 0; @@ -1378,9 +1373,9 @@ static void DeleteTextCharacter(void) u8 var2; index = GetPreviousTextCaretPosition(); - namingScreenData.textBuffer[index] = 0; + namingScreenDataPtr->textBuffer[index] = 0; sub_80B7960(); - namingScreenData.textBuffer[index] = EOS; + namingScreenDataPtr->textBuffer[index] = EOS; var2 = GetKeyRoleAtCursorPos(); if (var2 == 0 || var2 == 2) sub_80B6460(1, 0, 1); @@ -1408,7 +1403,7 @@ static bool8 sub_80B7004(void) PlaySE(SE_SELECT); if (r4) { - if (GetPreviousTextCaretPosition() == namingScreenData.template->maxChars - 1) + if (GetPreviousTextCaretPosition() == namingScreenDataPtr->template->maxChars - 1) return TRUE; } return FALSE; @@ -1420,7 +1415,7 @@ static void sub_80B7090(void) // DoInput? u8 r4; r5 = GetPreviousTextCaretPosition(); - r4 = namingScreenData.textBuffer[r5]; + r4 = namingScreenDataPtr->textBuffer[r5]; if (sub_80B7198(r4)) { if (sub_80B7264(r4)) @@ -1445,7 +1440,7 @@ static bool8 sub_80B7104(void) u8 r4; r5 = GetPreviousTextCaretPosition(); - r4 = namingScreenData.textBuffer[r5]; + r4 = namingScreenDataPtr->textBuffer[r5]; if (sub_80B720C(r4)) { sub_80B72A4(r4, r5); @@ -1460,7 +1455,7 @@ static bool8 sub_80B713C(void) u8 r4; r5 = GetPreviousTextCaretPosition(); - r4 = namingScreenData.textBuffer[r5]; + r4 = namingScreenDataPtr->textBuffer[r5]; if (sub_80B7264(r4)) { sub_80B7370(r4, r5); @@ -1473,7 +1468,7 @@ static void AddTextCharacter(u8 ch) { u8 index = GetTextCaretPosition(); - namingScreenData.textBuffer[index] = ch; + namingScreenDataPtr->textBuffer[index] = ch; } static bool8 sub_80B7198(u8 a) @@ -1545,7 +1540,7 @@ static void sub_80B72A4(u8 a, u8 b) chr = a + 0x2C; else if (a >= 155 && a <= 159) chr = a + 0xFB; - namingScreenData.textBuffer[b] = chr; + namingScreenDataPtr->textBuffer[b] = chr; } static void sub_80B7370(u8 a, u8 b) @@ -1560,7 +1555,7 @@ static void sub_80B7370(u8 a, u8 b) chr = a + 0x31; else if (a >= 150 && a <= 154) chr = a + 5; - namingScreenData.textBuffer[b] = chr; + namingScreenDataPtr->textBuffer[b] = chr; } static void sub_80B73CC(u8 a, u8 b) @@ -1583,7 +1578,7 @@ static void sub_80B73CC(u8 a, u8 b) chr = a + 0xCF; else if (a >= 150 && a <= 154) chr = a + 0xD4; - namingScreenData.textBuffer[b] = chr; + namingScreenDataPtr->textBuffer[b] = chr; } static void sub_80B7474(u8 a, u8 b) @@ -1594,18 +1589,18 @@ static void sub_80B7474(u8 a, u8 b) chr = a + 0xCF; else if (a >= 155 && a <= 159) chr = a + 0xCF; - namingScreenData.textBuffer[b] = chr; + namingScreenDataPtr->textBuffer[b] = chr; } static void sub_80B74B0(void) { u8 i; - for (i = 0; i < namingScreenData.template->maxChars; i++) + for (i = 0; i < namingScreenDataPtr->template->maxChars; i++) { - if (namingScreenData.textBuffer[i] != 0 && namingScreenData.textBuffer[i] != 0xFF) + if (namingScreenDataPtr->textBuffer[i] != 0 && namingScreenDataPtr->textBuffer[i] != 0xFF) { - StringCopyN(namingScreenData.destBuffer, namingScreenData.textBuffer, namingScreenData.template->maxChars + 1); + StringCopyN(namingScreenDataPtr->destBuffer, namingScreenDataPtr->textBuffer, namingScreenDataPtr->template->maxChars + 1); break; } } @@ -1613,7 +1608,7 @@ static void sub_80B74B0(void) static void DisplaySentToPCMessage(void) { - StringCopy(gStringVar1, namingScreenData.destBuffer); + StringCopy(gStringVar1, namingScreenDataPtr->destBuffer); StringExpandPlaceholders(gStringVar4, gOtherText_SentToPC); BasicInitMenuWindow(&gWindowConfig_81E6E88); MenuDisplayMessageBox(); @@ -1670,8 +1665,8 @@ static void sub_80B75C4(void) (u16 *)(VRAM + 0xE800), }; - gUnknown_083CE2F0[namingScreenData.currentPage][0](arr[namingScreenData.unkC]); - gUnknown_083CE2F0[namingScreenData.currentPage][1](arr[namingScreenData.unkD]); + gUnknown_083CE2F0[namingScreenDataPtr->currentPage][0](arr[namingScreenDataPtr->unkC]); + gUnknown_083CE2F0[namingScreenDataPtr->currentPage][1](arr[namingScreenDataPtr->unkD]); } static void sub_80B7614(void) @@ -1682,7 +1677,7 @@ static void sub_80B7614(void) (u16 *)(VRAM + 0xE800), }; - gUnknown_083CE2F0[namingScreenData.currentPage][1](arr[namingScreenData.unkD]); + gUnknown_083CE2F0[namingScreenDataPtr->currentPage][1](arr[namingScreenDataPtr->unkD]); } static void sub_80B7650(u16 *vramBuffer) @@ -1736,12 +1731,12 @@ static void sub_80B76E0(u16 *vramBuffer, const u16 *src) static void sub_80B772C(void) { - nullsub_20(namingScreenData.currentPage, namingScreenData.unkC); + nullsub_20(namingScreenDataPtr->currentPage, namingScreenDataPtr->unkC); } static void sub_80B7740(void) { - nullsub_20((namingScreenData.currentPage + 1) % 3, namingScreenData.unkD); + nullsub_20((namingScreenDataPtr->currentPage + 1) % 3, namingScreenDataPtr->unkD); } static void nullsub_20(u8 a, u8 b) @@ -1802,23 +1797,23 @@ static const u8 sKeyboardCharacters[][4][20]; //forward declaration static u8 GetCharAtKeyboardPos(s16 a, s16 b) { - return sKeyboardCharacters[namingScreenData.currentPage][b][a]; + return sKeyboardCharacters[namingScreenDataPtr->currentPage][b][a]; } static void sub_80B7794(void) { - BasicInitMenuWindow(gUnknown_083CE328[namingScreenData.currentPage][0][namingScreenData.unkC]); - gUnknown_083CE310[namingScreenData.currentPage][0](); - BasicInitMenuWindow(gUnknown_083CE328[namingScreenData.currentPage][1][namingScreenData.unkD]); - gUnknown_083CE310[namingScreenData.currentPage][1](); + BasicInitMenuWindow(gUnknown_083CE328[namingScreenDataPtr->currentPage][0][namingScreenDataPtr->unkC]); + gUnknown_083CE310[namingScreenDataPtr->currentPage][0](); + BasicInitMenuWindow(gUnknown_083CE328[namingScreenDataPtr->currentPage][1][namingScreenDataPtr->unkD]); + gUnknown_083CE310[namingScreenDataPtr->currentPage][1](); sub_80B772C(); sub_80B7740(); } static void sub_80B77F8(void) { - BasicInitMenuWindow(gUnknown_083CE328[namingScreenData.currentPage][1][namingScreenData.unkD]); - gUnknown_083CE310[namingScreenData.currentPage][1](); + BasicInitMenuWindow(gUnknown_083CE328[namingScreenDataPtr->currentPage][1][namingScreenDataPtr->unkD]); + gUnknown_083CE310[namingScreenDataPtr->currentPage][1](); sub_80B7740(); } @@ -1849,9 +1844,9 @@ static void PrintKeyboardCharacters(u8 page) //print letters on page static void sub_80B78A8(void) { BasicInitMenuWindow(&gWindowConfig_81E6F4C); - gUnknown_083CE358[namingScreenData.templateNum](); - gUnknown_083CE368[namingScreenData.template->unk3](); - MenuPrint(namingScreenData.template->title, 9, 2); + gUnknown_083CE358[namingScreenDataPtr->templateNum](); + gUnknown_083CE368[namingScreenDataPtr->template->unk3](); + MenuPrint(namingScreenDataPtr->template->title, 9, 2); } static void nullsub_61(void) @@ -1860,7 +1855,7 @@ static void nullsub_61(void) static void sub_80B78F8(void) { - StringCopy(gStringVar1, gSpeciesNames[(s16)namingScreenData.unk3E]); + StringCopy(gStringVar1, gSpeciesNames[(s16)namingScreenDataPtr->unk3E]); } static void nullsub_62(void) @@ -1871,9 +1866,9 @@ static void sub_80B7924(void) { u8 genderSymbol[2] = _("♂"); - if ((s16)namingScreenData.unk40 != MON_GENDERLESS) + if ((s16)namingScreenDataPtr->unk40 != MON_GENDERLESS) { - if ((s16)namingScreenData.unk40 == MON_FEMALE) + if ((s16)namingScreenDataPtr->unk40 == MON_FEMALE) genderSymbol[0] = 0xB6; //female symbol MenuPrint(genderSymbol, 0x14, 4); } @@ -1890,9 +1885,9 @@ static void sub_80B7960(void) string[4] = 0x11; string[5] = 1; string += 6; - StringCopy(string, namingScreenData.textBuffer); + StringCopy(string, namingScreenDataPtr->textBuffer); BasicInitMenuWindow(&gWindowConfig_81E6F4C); - MenuPrint(gStringVar1, namingScreenData.unk2, 4); + MenuPrint(gStringVar1, namingScreenDataPtr->unk2, 4); } //-------------------------------------------------- @@ -2034,4 +2029,162 @@ const struct OamData gOamData_83CE4A8 = .affineParam = 0, }; -//TODO: dump sprite data + +const struct Subsprite gSubspriteTable_83CE4B0[] = { + { -20, -16, ST_OAM_H_RECTANGLE, 1, 0, 1 }, + { 12, -16, ST_OAM_SQUARE, 0, 4, 1 }, + { -20, -8, ST_OAM_H_RECTANGLE, 1, 5, 1 }, + { 12, -8, ST_OAM_SQUARE, 0, 9, 1 }, + { -20, 0, ST_OAM_H_RECTANGLE, 1, 10, 1 }, + { 12, 0, ST_OAM_SQUARE, 0, 14, 1 }, + { -20, 8, ST_OAM_H_RECTANGLE, 1, 15, 1 }, + { 12, 8, ST_OAM_SQUARE, 0, 19, 1 } +}; + +const struct Subsprite gSubspriteTable_83CE4F0[] = { + { -12, -4, ST_OAM_SQUARE, 0, 0, 1 }, + { 4, -4, ST_OAM_SQUARE, 0, 1, 1 } +}; + +const struct Subsprite gSubspriteTable_83CE500[] = { + { -12, -4, ST_OAM_H_RECTANGLE, 0, 0, 1 }, + { 4, -4, ST_OAM_SQUARE, 0, 2, 1 } +}; + +const struct Subsprite gSubspriteTable_83CE510[] = { + { -20, -12, ST_OAM_H_RECTANGLE, 1, 0, 1 }, + { 12, -12, ST_OAM_SQUARE, 0, 4, 1 }, + { -20, -4, ST_OAM_H_RECTANGLE, 1, 5, 1 }, + { 12, -4, ST_OAM_SQUARE, 0, 9, 1 }, + { -20, 4, ST_OAM_H_RECTANGLE, 1, 10, 1 }, + { 12, 4, ST_OAM_SQUARE, 0, 14, 1 } +}; + +const struct Subsprite gSubspriteTable_83CE540[] = { + { -8, -12, ST_OAM_H_RECTANGLE, 0, 0, 3 }, + { -8, -4, ST_OAM_H_RECTANGLE, 0, 2, 3 }, + { -8, 4, ST_OAM_H_RECTANGLE, 0, 4, 3 } +}; + +const struct SubspriteTable gSubspriteTables_83CE558[] = { + { 8, gSubspriteTable_83CE4B0 } +}; + +const struct SubspriteTable gSubspriteTables_83CE560[] = { + { 2, gSubspriteTable_83CE500 }, + { 2, gSubspriteTable_83CE500 }, + { 2, gSubspriteTable_83CE500 } +}; + +const struct SubspriteTable gSubspriteTables_83CE578[] = { + { 6, gSubspriteTable_83CE510 } +}; + +const struct SubspriteTable gSubspriteTables_83CE580[] = { + { 3, gSubspriteTable_83CE540 } +}; + +const struct SpriteFrameImage gSpriteImageTable_83CE588[] = { + { gSpriteImage_83CE094, 0xc0 }, + { gSpriteImage_83CE154, 0xc0 } +}; + +const union AnimCmd gSpriteAnim_83CE598[] = { + ANIMCMD_FRAME(0, 1), + ANIMCMD_JUMP(0) +}; + +const union AnimCmd gSpriteAnim_83CE5A0[] = { + ANIMCMD_FRAME(4, 8), + ANIMCMD_FRAME(8, 8), + ANIMCMD_END +}; + +const union AnimCmd gSpriteAnim_83CE5AC[] = { + ANIMCMD_FRAME(0, 2), + ANIMCMD_FRAME(1, 2), + ANIMCMD_JUMP(0) +}; + +const union AnimCmd *const gSpriteAnimTable_83CE5B8[] = { + gSpriteAnim_83CE598 +}; + +const union AnimCmd *const gSpriteAnimTable_83CE5BC[] = { + gSpriteAnim_83CE598, + gSpriteAnim_83CE5A0 +}; + +const union AnimCmd *const gSpriteAnimTable_83CE5C4[] = { + gSpriteAnim_83CE5AC +}; + +const struct SpriteTemplate gSpriteTemplate_83CE5C8 = { + 2, 4, &gOamData_83CE498, gSpriteAnimTable_83CE5B8, NULL, gDummySpriteAffineAnimTable, sub_80B6B34 +}; + +const struct SpriteTemplate gSpriteTemplate_83CE5E0 = { + 3, 1, &gOamData_83CE4A8, gSpriteAnimTable_83CE5B8, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy +}; + +const struct SpriteTemplate gSpriteTemplate_83CE5F8 = { + 4, 4, &gOamData_83CE498, gSpriteAnimTable_83CE5B8, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy +}; + +const struct SpriteTemplate gSpriteTemplate_83CE610 = { + 0, 6, &gOamData_83CE498, gSpriteAnimTable_83CE5B8, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy +}; + +const struct SpriteTemplate gSpriteTemplate_83CE628 = { + 1, 6, &gOamData_83CE498, gSpriteAnimTable_83CE5B8, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy +}; + +const struct SpriteTemplate gSpriteTemplate_83CE640 = { + 7, 5, &gOamData_83CE4A0, gSpriteAnimTable_83CE5BC, NULL, gDummySpriteAffineAnimTable, sub_80B6998 +}; + +const struct SpriteTemplate gSpriteTemplate_83CE658 = { + 10, 3, &gOamData_83CE498, gSpriteAnimTable_83CE5B8, NULL, gDummySpriteAffineAnimTable, sub_80B6D9C +}; + +const struct SpriteTemplate gSpriteTemplate_83CE670 = { + 11, 3, &gOamData_83CE498, gSpriteAnimTable_83CE5B8, NULL, gDummySpriteAffineAnimTable, sub_80B6DE8 +}; + +const struct SpriteTemplate gSpriteTemplate_83CE688 = { + 0xFFFF, 0, &gOamData_83CE498, gSpriteAnimTable_83CE5C4, gSpriteImageTable_83CE588, gDummySpriteAffineAnimTable, SpriteCallbackDummy +}; + +const struct SpriteSheet gUnknown_083CE6A0[] = { + { gNamingScreenBackButtonTiles, 0x1E0, 0 }, + { gNamingScreenOKButtonTiles, 0x1E0, 1 }, + { gNamingScreenChangeKeyboardBoxTiles, 0x280, 2 }, + { gNamingScreenChangeKeyboardButtonTiles, 0x100, 3 }, + { gNamingScreenLowerTextTiles, 0x60, 4 }, + { gNamingScreenUpperTextTiles, 0x60, 5 }, + { gNamingScreenOthersTextTiles, 0x60, 6 }, + { gNamingScreenCursorTiles, 0x80, 7 }, + { gNamingScreenActiveCursorSmallTiles, 0x80, 8 }, + { gNamingScreenActiveCursorBigTiles, 0x80, 9 }, + { gNamingScreenRightPointingTriangleTiles, 0x20, 10 }, + { gNamingScreenUnderscoreTiles, 0x20, 11 }, + {} +}; + +const struct SpritePalette gUnknown_083CE708[] = { + {gNamingScreenPalettes[0], 0}, + {gNamingScreenPalettes[1], 1}, + {gNamingScreenPalettes[2], 2}, + {gNamingScreenPalettes[3], 3}, + {gNamingScreenPalettes[4], 4}, + {gNamingScreenPalettes[5], 5}, + {gNamingScreenPalettes[4], 6}, + {} +}; + +const u16 gUnknown_083CE748[] = INCBIN_U16("graphics/naming_screen/lower_keyboard_map.bin"); + +const u16 gUnknown_083CEBF8[] = INCBIN_U16("graphics/naming_screen/upper_keyboard_map.bin"); + +const u16 gUnknown_083CF0A8[] = INCBIN_U16("graphics/naming_screen/others_keyboard_map.bin"); + diff --git a/src/engine/record_mixing.c b/src/engine/record_mixing.c index 6cb1e54b2..c8e2e34d5 100644 --- a/src/engine/record_mixing.c +++ b/src/engine/record_mixing.c @@ -36,7 +36,7 @@ static u8 gUnknown_0300071C[4]; void *recordMixingSecretBases = &gSaveBlock1.secretBases; void *recordMixingTvShows = &gSaveBlock1.tvShows; -void *gUnknown_083D0274 = &gSaveBlock1.unknown_2ABC; +void *gUnknown_083D0274 = &gSaveBlock1.pokeNews; void *gUnknown_083D0278 = &gSaveBlock1.mauvilleMan; void *recordMixingEasyChatPairs = &gSaveBlock1.easyChatPairs; struct RecordMixingDayCareMail *gUnknown_083D0280 = &gUnknown_02038738; @@ -119,7 +119,7 @@ void Task_RecordMixing_Main(u8 taskId) { case 0: // init sub_8007270(gSpecialVar_0x8005); - VarSet(VAR_0x4000, 1); + VarSet(VAR_TEMP_0, 1); gUnknown_03000718 = 0; RecordMixing_PrepareExchangePacket(); CreateRecordMixingSprite(); @@ -1016,26 +1016,26 @@ void sub_80B9F3C(u16 *a, u8 b) { if (!CheckBagHasItem(*a, 1) && !CheckPCHasItem(*a, 1) && AddBagItem(*a, 1)) { - VarSet(VAR_0x4001, *a); + VarSet(VAR_TEMP_1, *a); StringCopy(gStringVar1, gLinkPlayers[0].name); if (*a == ITEM_EON_TICKET) FlagSet(FLAG_SYS_HAS_EON_TICKET); } else { - VarSet(VAR_0x4001, ITEM_NONE); + VarSet(VAR_TEMP_1, ITEM_NONE); } } else { if (AddBagItem(*a, 1) == TRUE) { - VarSet(VAR_0x4001, *a); + VarSet(VAR_TEMP_1, *a); StringCopy(gStringVar1, gLinkPlayers[0].name); } else { - VarSet(VAR_0x4001, ITEM_NONE); + VarSet(VAR_TEMP_1, ITEM_NONE); } } } diff --git a/src/engine/sprite.c b/src/engine/sprite.c index c1bb36917..cf35e12a3 100644 --- a/src/engine/sprite.c +++ b/src/engine/sprite.c @@ -598,7 +598,7 @@ static u8 CreateSpriteAt(u8 index, const struct SpriteTemplate *template, s16 x, return index; } -u8 CreateSpriteAndAnimate(struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority) +u8 CreateSpriteAndAnimate(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority) { u8 i; diff --git a/src/engine/trade.c b/src/engine/trade.c index 0567b4d2f..0bc589ff4 100644 --- a/src/engine/trade.c +++ b/src/engine/trade.c @@ -5391,7 +5391,7 @@ static void sub_804D80C(struct Sprite *sprite) } } -u16 sub_804D89C(void) +u16 GetInGameTradeSpeciesInfo(void) { const struct InGameTrade *inGameTrade = &gIngameTrades[gSpecialVar_0x8004]; StringCopy(gStringVar1, gSpeciesNames[inGameTrade->playerSpecies]); @@ -5408,7 +5408,7 @@ static void sub_804D8E4(void) StringCopy(gStringVar2, gSpeciesNames[inGameTrade->species]); } -static void sub_804D948(u8 whichPlayerMon, u8 whichInGameTrade) +static void _CreateInGameTradePokemon(u8 whichPlayerMon, u8 whichInGameTrade) { const struct InGameTrade *inGameTrade = &gIngameTrades[whichInGameTrade]; u8 level = GetMonData(&gPlayerParty[whichPlayerMon], MON_DATA_LEVEL); @@ -5478,16 +5478,16 @@ static void sub_804DAD4(struct MailStruct *mail, const struct InGameTrade *trade mail->itemId = trade->heldItem; } -u16 sub_804DB2C(void) +u16 GetTradeSpecies(void) { if (GetMonData(&gPlayerParty[gSpecialVar_0x8005], MON_DATA_IS_EGG)) return SPECIES_NONE; return GetMonData(&gPlayerParty[gSpecialVar_0x8005], MON_DATA_SPECIES); } -void sub_804DB68(void) +void CreateInGameTradePokemon(void) { - sub_804D948(gSpecialVar_0x8005, gSpecialVar_0x8004); + _CreateInGameTradePokemon(gSpecialVar_0x8005, gSpecialVar_0x8004); } #ifdef NONMATCHING @@ -5670,7 +5670,7 @@ static void sub_804E144(void) UpdatePaletteFade(); } -void sub_804E174(void) +void DoInGameTradeScene(void) { ScriptContext2_Enable(); CreateTask(sub_804E1A0, 10); diff --git a/src/engine/trainer_card.c b/src/engine/trainer_card.c index 207fa5f77..ffa4cbd08 100644 --- a/src/engine/trainer_card.c +++ b/src/engine/trainer_card.c @@ -287,10 +287,7 @@ void sub_8093324(void) if (ewram0_2.var_1) { - struct TrainerCard(*trainerCards)[4] = &gTrainerCards; - s16 var = task->data[TD_1]; - struct TrainerCard *dest = &(*trainerCards)[var]; - memcpy(&ewram0_2.var_64, dest, sizeof(struct TrainerCard)); + ewram0_2.var_64 = gTrainerCards[task->data[TD_1]]; } else { @@ -324,7 +321,7 @@ void sub_8093390(struct TrainerCard *trainerCard) trainerCard->firstHallOfFameC = playTime & 0xFF; trainerCard->hasPokedex = FlagGet(FLAG_SYS_POKEDEX_GET); - trainerCard->var_3 = sub_8090FC0(); + trainerCard->var_3 = CompletedHoennPokedex(); trainerCard->pokedexSeen = GetPokedexSeenCount(); trainerCard->trainerId = (gSaveBlock2.playerTrainerId[1] << 8) | gSaveBlock2.playerTrainerId[0]; diff --git a/src/field/bard_music.c b/src/field/bard_music.c index daf003233..5c48749cf 100644 --- a/src/field/bard_music.c +++ b/src/field/bard_music.c @@ -11,29 +11,185 @@ struct BardSound /*0x06*/ u16 var06; }; -extern const struct BardSound (*const gBardMusicTable[])[][6]; -extern s16 *gUnknown_08417068[]; -extern u32 gUnknown_084170F4[]; +static const s16 Unknown_8416F08[] = {-768, 6144}; +static const s16 Unknown_8416F0C[] = {2304, 6144}; +static const s16 Unknown_8416F10[] = {256, 6144}; +static const s16 Unknown_8416F14[] = {1024, 6144}; +static const s16 Unknown_8416F18[] = {2816, 6144}; +static const s16 Unknown_8416F1C[] = {-768, -256, 6144}; +static const s16 Unknown_8416F22[] = {-768, 512, 6144}; +static const s16 Unknown_8416F28[] = {512, 1024, 6144}; +static const s16 Unknown_8416F2E[] = {1536, 2048, 6144}; +static const s16 Unknown_8416F34[] = {2304, 2048, 6144}; +static const s16 Unknown_8416F3A[] = {-768, -256, -768, 6144}; +static const s16 Unknown_8416F42[] = {1024, -768, 1024, 6144}; +static const s16 Unknown_8416F4A[] = {2304, 2048, 1536, 6144}; +static const s16 Unknown_8416F52[] = {256, 512, 1024, 6144}; +static const s16 Unknown_8416F5A[] = {1536, 4096, 3328, 6144}; +static const s16 Unknown_8416F62[] = {1024, 2304, 1024, 2304, 6144}; +static const s16 Unknown_8416F6C[] = {2304, 1024, 3328, 1024, 6144}; +static const s16 Unknown_8416F76[] = {256, 512, 1024, 1536, 6144}; +static const s16 Unknown_8416F80[] = {2048, 1536, 1024, 512, 6144}; +static const s16 Unknown_8416F8A[] = {3840, 3328, 2816, 2560, 6144}; +static const s16 Unknown_8416F94[] = {-768, -256, 256, 512, 1024, 6144}; +static const s16 Unknown_8416FA0[] = {2304, 2048, 1536, 1024, 512, 6144}; +static const s16 Unknown_8416FAC[] = {256, 1024, 2304, 1024, 256, 6144}; +static const s16 Unknown_8416FB8[] = {2304, 1024, 2304, 1024, -768, 6144}; +static const s16 Unknown_8416FC4[] = {2816, 2048, 1024, 1024, 1536, 6144}; +static const s16 Unknown_8416FD0[] = {-768, -256, 256, 512, 1024, 1536, 6144}; +static const s16 Unknown_8416FDE[] = {2048, 1536, 1024, 512, 256, -256, 6144}; +static const s16 Unknown_8416FEC[] = {256, 512, 1024, 256, 512, 4096, 6144}; +static const s16 Unknown_8416FFA[] = {1024, -768, 2304, 1024, 2304, 1024, 6144}; +static const s16 Unknown_8417008[] = {2048, 2304, 2048, 2304, 2048, 2304, 6144}; +static const s16 Unknown_8417016[] = {512, 256, 512, 256, 512, 1024, 512, 6144}; +static const s16 Unknown_8417026[] = {256, 256, -256, -256, -768, 1024, -768, 6144}; +static const s16 Unknown_8417036[] = {2048, 2304, 2816, 3328, 3584, 3328, 2816, 6144}; +static const s16 Unknown_8417046[] = {2048, 1536, 1024, 512, 3328, 2816, 2304, 6144}; +static const s16 Unknown_8417056[] = {768, 1024, 1536, 2048, 1792, 2048, 1024, 6144}; + +static const s16 *const sWordPitches[] = { + Unknown_8416F08, + Unknown_8416F0C, + Unknown_8416F10, + Unknown_8416F14, + Unknown_8416F18, + Unknown_8416F1C, + Unknown_8416F22, + Unknown_8416F28, + Unknown_8416F2E, + Unknown_8416F34, + Unknown_8416F3A, + Unknown_8416F42, + Unknown_8416F4A, + Unknown_8416F52, + Unknown_8416F5A, + Unknown_8416F62, + Unknown_8416F6C, + Unknown_8416F76, + Unknown_8416F80, + Unknown_8416F8A, + Unknown_8416F94, + Unknown_8416FA0, + Unknown_8416FAC, + Unknown_8416FB8, + Unknown_8416FC4, + Unknown_8416FD0, + Unknown_8416FDE, + Unknown_8416FEC, + Unknown_8416FFA, + Unknown_8417008, + Unknown_8417016, + Unknown_8417026, + Unknown_8417036, + Unknown_8417046, + Unknown_8417056 +}; + +static const u32 sBardSoundLengthDeltas[] = { + 9, + 22, + 15, + 16, + 39, + 21, + 9, + 30, + 24, + 15, + 25, + 12, + 22, + 45, + 24, + 15, + 40, + 9, + 21, + 42, + 18, + 9, + 22, + 15, + 27, + 48, + 18, + 27, + 33, + 24, + 25, + 39, + 19, + 16, + 54, + 18, + 9, + 45, + 15, + 12, + 39, + 23, + 5, + 45, + 12, + 21, + 48, + 12, + 21, + 69, + 18, + 15 +}; + +#if ENGLISH +#include "../src/data/bard_music_en.h" +#elif GERMAN +#include "../src/data/bard_music_de.h" +#endif // ENGLISH/GERMAN + +static const struct BardSound (*const gBardMusicTable[])[6] = { + BardMusic_POKEMON, + BardMusic_TRAINER, + BardMusic_STATUS, + BardMusic_BATTLE, + BardMusic_GREETINGS, + BardMusic_PEOPLE, + BardMusic_VOICES, + BardMusic_SPEECH, + BardMusic_ENDINGS, + BardMusic_FEELINGS, + BardMusic_CONDITIONS, + BardMusic_ACTIONS, + BardMusic_LIFESTYLE, + BardMusic_HOBBIES, + BardMusic_TIME, + BardMusic_MISC, + BardMusic_ADJECTIVES, + BardMusic_EVENTS, + BardMusic_MOVE_1, + BardMusic_MOVE_2, + BardMusic_TRENDY_SAYING, + BardMusic_POKEMON_2 +}; static s16 CalcWordPitch(u32 arg0, u32 songPos) { - return gUnknown_08417068[arg0][songPos]; + return sWordPitches[arg0][songPos]; } #if ENGLISH const struct BardSound *GetWordSounds(u16 group, u16 word) { - const struct BardSound (*sounds)[][6] = gBardMusicTable[group]; + const struct BardSound (*sounds)[6] = gBardMusicTable[group]; - return (*sounds)[word]; + return sounds[word]; } #elif GERMAN const struct BardSound *GetWordSounds(u16 group, u16 word) { - const struct BardSound (*sounds)[][6] = gBardMusicTable[group]; + const struct BardSound (*sounds)[6] = gBardMusicTable[group]; u32 index = de_sub_80EB748(group, word); - return (*sounds)[index]; + return sounds[index]; } #endif @@ -48,7 +204,7 @@ s32 GetWordPhonemes(struct BardSong *song, const struct BardSound *src, u16 arg2 song->phonemes[i].sound = src[i].var00; if (src[i].var00 != 0xFF) { - s32 length = src[i].var01 + gUnknown_084170F4[src[i].var00]; + s32 length = src[i].var01 + sBardSoundLengthDeltas[src[i].var00]; song->phonemes[i].length = length; song->phonemes[i].volume = src[i].volume; diff --git a/src/field/battle_tower.c b/src/field/battle_tower.c index 6b6064c16..caebc6a7b 100644 --- a/src/field/battle_tower.c +++ b/src/field/battle_tower.c @@ -294,24 +294,24 @@ void sub_8134548(void) ResetBattleTowerStreak(levelType); if (!var1) { - VarSet(VAR_0x4000, 5); + VarSet(VAR_TEMP_0, 5); } break; case 1: ResetBattleTowerStreak(levelType); - VarSet(VAR_0x4000, 1); + VarSet(VAR_TEMP_0, 1); var1++; break; case 4: - VarSet(VAR_0x4000, 2); + VarSet(VAR_TEMP_0, 2); var1++; break; case 5: - VarSet(VAR_0x4000, 3); + VarSet(VAR_TEMP_0, 3); var1++; break; case 2: - VarSet(VAR_0x4000, 4); + VarSet(VAR_TEMP_0, 4); var1++; break; case 3: @@ -323,7 +323,7 @@ void sub_8134548(void) if ((gSaveBlock2.battleTower.var_4AE[0] == 3 || gSaveBlock2.battleTower.var_4AE[0] == 6) && (gSaveBlock2.battleTower.var_4AE[1] == 3 || gSaveBlock2.battleTower.var_4AE[1] == 6)) { - VarSet(VAR_0x4000, 5); + VarSet(VAR_TEMP_0, 5); } ValidateBattleTowerRecordChecksums(); @@ -801,7 +801,7 @@ void SetBattleTowerTrainerGfxId(u8 trainerIndex) if (i != 30) { u8 trainerObjectGfxId = sMaleTrainerGfxIds[i]; - VarSet(0x4010, trainerObjectGfxId); + VarSet(VAR_OBJ_GFX_ID_0, trainerObjectGfxId); return; } @@ -809,11 +809,11 @@ void SetBattleTowerTrainerGfxId(u8 trainerIndex) if (i != 20) { u8 trainerObjectGfxId = sFemaleTrainerGfxIds[i]; - VarSet(0x4010, trainerObjectGfxId); + VarSet(VAR_OBJ_GFX_ID_0, trainerObjectGfxId); return; } - VarSet(0x4010, MAP_OBJ_GFX_BOY_1); + VarSet(VAR_OBJ_GFX_ID_0, MAP_OBJ_GFX_BOY_1); } void SetEReaderTrainerGfxId(void) @@ -1608,7 +1608,7 @@ void sub_8135534(u8 taskId) } } -void sub_813556C(void) +void StartSpecialBattle(void) { s32 i; u16 heldItem; @@ -1616,7 +1616,7 @@ void sub_813556C(void) switch (gSpecialVar_0x8004) { - case 0: + case 0: // battle tower battle gBattleTypeFlags = (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_TRAINER); gTrainerBattleOpponent = 0; @@ -1627,7 +1627,7 @@ void sub_813556C(void) transition = BattleSetup_GetBattleTowerBattleTransition(); BattleTransition_StartOnField(transition); break; - case 1: + case 1: // secret base battle for (i = 0; i < PARTY_SIZE; i++) { heldItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM); @@ -1639,7 +1639,7 @@ void sub_813556C(void) transition = BattleSetup_GetBattleTowerBattleTransition(); BattleTransition_StartOnField(transition); break; - case 2: + case 2: // e-reader trainer battle ZeroEnemyPartyMons(); for (i = 0; i < 3; i++) @@ -1658,7 +1658,7 @@ void sub_813556C(void) } } -void sub_8135668(void) +void SetBattleTowerProperty(void) { s32 i; u8 battleTowerLevelType = gSaveBlock2.battleTower.battleTowerLevelType; @@ -1740,7 +1740,7 @@ void sub_8135668(void) } } -void sub_81358A4(void) +void BattleTowerUtil(void) { u8 battleTowerLevelType = gSaveBlock2.battleTower.battleTowerLevelType; @@ -1789,7 +1789,7 @@ void sub_81358A4(void) } } -void sub_8135A14(void) +void SetBattleTowerParty(void) { s32 i; @@ -1954,7 +1954,7 @@ void sub_8135AC4(void) sub_8135A3C(); } -void sub_8135BA0(void) +void SaveBattleTowerProgress(void) { u8 battleTowerLevelType = gSaveBlock2.battleTower.battleTowerLevelType; @@ -1976,7 +1976,7 @@ void sub_8135BA0(void) gSaveBlock2.battleTower.var_4AE[battleTowerLevelType] = gSpecialVar_0x8004; } - VarSet(VAR_0x4000, 0); + VarSet(VAR_TEMP_0, 0); gSaveBlock2.battleTower.unk_554 = 1; TrySavingData(EREADER_SAVE); } @@ -2336,7 +2336,7 @@ void PrintEReaderTrainerFarewellMessage(void) } } -void sub_813610C(void) +void TryEnableBravoTrainerBattleTower(void) { s32 i; diff --git a/src/field/berry_tag_screen.c b/src/field/berry_tag_screen.c index 2abbac287..960a163c1 100644 --- a/src/field/berry_tag_screen.c +++ b/src/field/berry_tag_screen.c @@ -29,7 +29,7 @@ struct Struct2000000 }; extern struct Struct2000000 gSharedMem; -extern u16 gUnknown_030041B4; +extern u16 gBattle_BG1_Y; static EWRAM_DATA u8 gUnknown_0203932C = 0; static EWRAM_DATA s16 gUnknown_0203932E[5] = {0}; @@ -77,8 +77,8 @@ static void sub_8146014(void) static void sub_814602C(void) { - REG_BG0VOFS = gUnknown_030041B4; - REG_BG1VOFS = gUnknown_030041B4; + REG_BG0VOFS = gBattle_BG1_Y; + REG_BG1VOFS = gBattle_BG1_Y; LoadOam(); ProcessSpriteCopyRequests(); @@ -183,7 +183,7 @@ static void sub_8146288(void) REG_BG1CNT = BGCNT_PRIORITY(2) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(5) | BGCNT_16COLOR | BGCNT_TXT256x256; REG_BG2CNT = BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(6) | BGCNT_16COLOR | BGCNT_TXT256x256; REG_BG3CNT = BGCNT_PRIORITY(3) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(7) | BGCNT_16COLOR | BGCNT_TXT256x256; - gUnknown_030041B4 = 0; + gBattle_BG1_Y = 0; } bool8 sub_81462B8(void) @@ -394,17 +394,17 @@ static void sub_8146798(u8 taskId) { s16 *taskData = gTasks[taskId].data; - gUnknown_030041B4 = (gUnknown_030041B4 + taskData[0]) & 0xFF; - if ((taskData[0] > 0 && gUnknown_030041B4 == 144) - || (taskData[0] < 0 && gUnknown_030041B4 == 112)) + gBattle_BG1_Y = (gBattle_BG1_Y + taskData[0]) & 0xFF; + if ((taskData[0] > 0 && gBattle_BG1_Y == 144) + || (taskData[0] < 0 && gBattle_BG1_Y == 112)) { sub_8146810(gTasks[taskId].data[1]); sub_81468BC(); } - if (gUnknown_030041B4 == 0) + if (gBattle_BG1_Y == 0) { - gTasks[taskId].data[0] = gUnknown_030041B4; - gTasks[taskId].data[1] = gUnknown_030041B4; + gTasks[taskId].data[0] = gBattle_BG1_Y; + gTasks[taskId].data[1] = gBattle_BG1_Y; gTasks[taskId].func = sub_8146480; } } diff --git a/src/field/coord_event_weather.c b/src/field/coord_event_weather.c index 9c5a1ca4d..db4e9c161 100644 --- a/src/field/coord_event_weather.c +++ b/src/field/coord_event_weather.c @@ -1,115 +1,116 @@ #include "global.h" +#include "constants/weather.h" #include "coord_event_weather.h" #include "field_weather.h" struct CoordEventWeather { - u8 weather; + u8 coordEventWeather; void (*func)(void); }; -static void CoordEventWeather_Indoor(void); +static void CoordEventWeather_Clouds(void); static void CoordEventWeather_Sunny(void); -static void CoordEventWeather_Rain(void); -static void CoordEventWeather_Snowflakes(void); +static void CoordEventWeather_LightRain(void); +static void CoordEventWeather_Snow(void); static void CoordEventWeather_Thunderstorm(void); static void CoordEventWeather_Fog(void); static void CoordEventWeather_DiagonalFog(void); -static void CoordEventWeather_Snow(void); +static void CoordEventWeather_Ash(void); static void CoordEventWeather_Sandstorm(void); -static void CoordEventWeather_Cloudy(void); +static void CoordEventWeather_Dark(void); static void CoordEventWeather_Drought(void); -static void CoordEventWeather_UnderwaterFog(void); -static void CoordEventWeather_UnderwaterBubbles(void); +static void CoordEventWeather_Route119Cycle(void); +static void CoordEventWeather_Route123Cycle(void); static const struct CoordEventWeather sCoordEventWeatherFuncs[] = { - { 0x1, CoordEventWeather_Indoor }, - { 0x2, CoordEventWeather_Sunny }, - { 0x3, CoordEventWeather_Rain }, - { 0x4, CoordEventWeather_Snowflakes }, - { 0x5, CoordEventWeather_Thunderstorm }, - { 0x6, CoordEventWeather_Fog }, - { 0x7, CoordEventWeather_DiagonalFog }, - { 0x8, CoordEventWeather_Snow }, - { 0x9, CoordEventWeather_Sandstorm }, - { 0xa, CoordEventWeather_Cloudy }, - { 0xb, CoordEventWeather_Drought }, - { 0x14, CoordEventWeather_UnderwaterFog }, - { 0x15, CoordEventWeather_UnderwaterBubbles }, + { COORD_EVENT_WEATHER_CLOUDS, CoordEventWeather_Clouds }, + { COORD_EVENT_WEATHER_SUNNY, CoordEventWeather_Sunny }, + { COORD_EVENT_WEATHER_RAIN_LIGHT, CoordEventWeather_LightRain }, + { COORD_EVENT_WEATHER_SNOW, CoordEventWeather_Snow }, + { COORD_EVENT_WEATHER_RAIN_MED, CoordEventWeather_Thunderstorm }, + { COORD_EVENT_WEATHER_FOG_1, CoordEventWeather_Fog }, + { COORD_EVENT_WEATHER_FOG_2, CoordEventWeather_DiagonalFog }, + { COORD_EVENT_WEATHER_ASH, CoordEventWeather_Ash }, + { COORD_EVENT_WEATHER_SANDSTORM, CoordEventWeather_Sandstorm }, + { COORD_EVENT_WEATHER_DARK, CoordEventWeather_Dark }, + { COORD_EVENT_WEATHER_DROUGHT, CoordEventWeather_Drought }, + { COORD_EVENT_WEATHER_ROUTE119_CYCLE, CoordEventWeather_Route119Cycle }, + { COORD_EVENT_WEATHER_ROUTE123_CYCLE, CoordEventWeather_Route123Cycle }, }; -static void CoordEventWeather_Indoor(void) +static void CoordEventWeather_Clouds(void) { - SetWeather(1); + SetWeather(WEATHER_CLOUDS); } static void CoordEventWeather_Sunny(void) { - SetWeather(2); + SetWeather(WEATHER_SUNNY); } -static void CoordEventWeather_Rain(void) +static void CoordEventWeather_LightRain(void) { - SetWeather(3); + SetWeather(WEATHER_RAIN_LIGHT); } -static void CoordEventWeather_Snowflakes(void) +static void CoordEventWeather_Snow(void) { - SetWeather(4); + SetWeather(WEATHER_SNOW); } static void CoordEventWeather_Thunderstorm(void) { - SetWeather(5); + SetWeather(WEATHER_RAIN_MED); } static void CoordEventWeather_Fog(void) { - SetWeather(6); + SetWeather(WEATHER_FOG_1); } static void CoordEventWeather_DiagonalFog(void) { - SetWeather(9); + SetWeather(WEATHER_FOG_2); } -static void CoordEventWeather_Snow(void) +static void CoordEventWeather_Ash(void) { - SetWeather(7); + SetWeather(WEATHER_ASH); } static void CoordEventWeather_Sandstorm(void) { - SetWeather(8); + SetWeather(WEATHER_SANDSTORM); } -static void CoordEventWeather_Cloudy(void) +static void CoordEventWeather_Dark(void) { - SetWeather(11); + SetWeather(WEATHER_DARK); } static void CoordEventWeather_Drought(void) { - SetWeather(12); + SetWeather(WEATHER_DROUGHT); } -static void CoordEventWeather_UnderwaterFog(void) +static void CoordEventWeather_Route119Cycle(void) { - SetWeather(20); + SetWeather(WEATHER_ROUTE119_CYCLE); } -static void CoordEventWeather_UnderwaterBubbles(void) +static void CoordEventWeather_Route123Cycle(void) { - SetWeather(21); + SetWeather(WEATHER_ROUTE123_CYCLE); } -void DoCoordEventWeather(u8 n) +void DoCoordEventWeather(u8 coordEventWeather) { u8 i; for (i = 0; i < ARRAY_COUNT(sCoordEventWeatherFuncs); i++) { - if (sCoordEventWeatherFuncs[i].weather == n) + if (sCoordEventWeatherFuncs[i].coordEventWeather == coordEventWeather) { sCoordEventWeatherFuncs[i].func(); return; diff --git a/src/field/decoration.c b/src/field/decoration.c index 8b774afc3..87a9d8028 100644 --- a/src/field/decoration.c +++ b/src/field/decoration.c @@ -1426,139 +1426,6 @@ const struct YesNoFuncTable gUnknown_083EC634[] = { {sub_8109D04, sub_80FF058} }; -const u16 gUnknown_083EC654[] = {0x6318, 0x739C, 0x7FFF}; -const u8 gUnknown_083EC65A[] = _("{PALETTE 13}{STR_VAR_1}"); - -const u8 Unknown_3EC660[] = {0, 1, 2, 3}; -const u8 Unknown_3EC664[] = {0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13}; -const u8 Unknown_3EC670[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; -const u8 Unknown_3EC680[] = {0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21}; -const u8 Unknown_3EC68C[] = {0, 1, 2, 3, 4, 5, 6, 7}; -const u8 Unknown_3EC694[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; -const u8 Unknown_3EC6B4[] = {0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 29, 32, 33, 34, 35, 36, 37, 40, 41, 42, 43, 44, 45}; -const u8 Unknown_3EC6D8[] = {0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 29}; - -const u8 Unknown_3EC6F0[] = {0, 0, 0, 0}; -const u8 Unknown_3EC6F4[] = {0, 0, 1, 1, 0, 0, 1, 1}; -const u8 Unknown_3EC6FC[] = {0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2}; -const u8 Unknown_3EC708[] = {0, 0, 1, 1, 2, 2, 3, 3, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 4, 4, 5, 5, 6, 6, 7, 7}; -const u8 Unknown_3EC728[] = {0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3}; -const u8 Unknown_3EC738[] = {0, 0, 0, 0, 1, 1, 1, 1}; -const u8 Unknown_3EC740[] = {0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2}; -const u8 Unknown_3EC74C[] = {0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3, 4, 4, 5, 5, 4, 4, 5, 5, 6, 6, 7, 7, 6, 6, 7, 7}; -const u8 Unknown_3EC76C[] = {0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 6, 6, 7, 7, 8, 8}; -const u8 Unknown_3EC790[] = {0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 3, 3, 4, 4, 5, 5}; - -const u8 Unknown_3EC7A8[] = {4, 5, 6, 7}; -const u8 Unknown_3EC7AC[] = {4, 5, 4, 5, 6, 7, 6, 7}; -const u8 Unknown_3EC7B4[] = {4, 5, 4, 5, 4, 5, 6, 7, 6, 7, 6, 7}; -const u8 Unknown_3EC7C0[] = {4, 5, 4, 5, 4, 5, 4, 5, 6, 7, 6, 7, 6, 7, 6, 7, 4, 5, 4, 5, 4, 5, 4, 5, 6, 7, 6, 7, 6, 7, 6, 7}; -const u8 Unknown_3EC7E0[] = {4, 5, 4, 5, 6, 7, 6, 7, 4, 5, 4, 5, 6, 7, 6, 7}; -const u8 Unknown_3EC7F0[] = {4, 5, 6, 7, 4, 5, 6, 7}; -const u8 Unknown_3EC7F8[] = {4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7}; -const u8 Unknown_3EC804[] = {4, 5, 4, 5, 6, 7, 6, 7, 4, 5, 4, 5, 6, 7, 6, 7, 4, 5, 4, 5, 6, 7, 6, 7, 4, 5, 4, 5, 6, 7, 6, 7}; -const u8 Unknown_3EC824[] = {4, 5, 4, 5, 4, 5, 6, 7, 6, 7, 6, 7, 4, 5, 4, 5, 4, 5, 6, 7, 6, 7, 6, 7, 4, 5, 4, 5, 4, 5, 6, 7, 6, 7, 6, 7}; -const u8 Unknown_3EC848[] = {4, 5, 4, 5, 4, 5, 6, 7, 6, 7, 6, 7, 4, 5, 4, 5, 4, 5, 6, 7, 6, 7, 6, 7}; - -const struct UnkStruct_803EC860 gUnknown_083EC860[] = { - {Unknown_3EC660, Unknown_3EC6F0, Unknown_3EC7A8, 0x4}, - {Unknown_3EC68C, Unknown_3EC6F4, Unknown_3EC7AC, 0x8}, - {Unknown_3EC664, Unknown_3EC6FC, Unknown_3EC7B4, 0xc}, - {Unknown_3EC694, Unknown_3EC708, Unknown_3EC7C0, 0x20}, - {Unknown_3EC670, Unknown_3EC728, Unknown_3EC7E0, 0x10}, - {Unknown_3EC68C, Unknown_3EC738, Unknown_3EC7F0, 0x8}, - {Unknown_3EC680, Unknown_3EC740, Unknown_3EC7F8, 0xc}, - {Unknown_3EC694, Unknown_3EC74C, Unknown_3EC804, 0x20}, - {Unknown_3EC6B4, Unknown_3EC76C, Unknown_3EC824, 0x24}, - {Unknown_3EC6D8, Unknown_3EC790, Unknown_3EC848, 0x18} -}; - -const struct UnkStruct_083EC900 gUnknown_083EC900[] = { - {0, 1, 0x78, 0x4e}, - {1, 2, 0x80, 0x4e}, - {1, 3, 0x90, 0x56}, - {1, 3, 0x90, 0x46}, - {0, 2, 0x80, 0x46}, - {2, 2, 0x78, 0x46}, - {2, 3, 0x80, 0x56}, - {2, 3, 0x80, 0x36}, - {0, 3, 0x90, 0x46}, - {1, 3, 0x90, 0x46} -}; - -const union AnimCmd gSpriteAnim_83EC928[] = { - ANIMCMD_FRAME(.imageValue = 0, .duration = 0), - ANIMCMD_END -}; - -const union AnimCmd *const gSpriteAnimTable_83EC930[] = { - gSpriteAnim_83EC928 -}; - -const struct SpriteFrameImage gSpriteImageTable_83EC934[] = { - {.data = gUnknown_02038900.image, .size = sizeof(gUnknown_02038900.image)} -}; - -const struct SpriteTemplate gSpriteTemplate_83EC93C = { - .tileTag = 0xffff, - .paletteTag = 3000, - .oam = &gUnknown_020391AC, - .anims = gSpriteAnimTable_83EC930, - .images = gSpriteImageTable_83EC934, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_81009A8 -}; - -const struct SpritePalette gUnknown_083EC954 = {.data = (u16 *)&gUnknown_02038900.palette, .tag = 3000}; - -const struct YesNoFuncTable gUnknown_083EC95C = {.yesFunc = sub_81000C4, .noFunc = sub_810065C}; -const struct YesNoFuncTable gUnknown_083EC964 = {.yesFunc = sub_810026C, .noFunc = sub_810065C}; -const struct YesNoFuncTable gUnknown_083EC96C[] = { - {.yesFunc = sub_80FFAB0, .noFunc = sub_80FFB08}, - {.yesFunc = sub_8100F88, .noFunc = sub_8100FB4} -}; - -const u8 gUnknown_083EC97C[] = {4, 4, 4, 4, 0, 3, 3, 0}; -const u8 gUnknown_083EC984[] = {4, 4, 4, 4, 0, 4, 3, 0}; - -const u16 gUnknown_083EC98C[] = INCBIN_U16("graphics/unknown/83EC98C.gbapal"); -const u16 Unknown_3EC9AC[] = INCBIN_U16("graphics/unknown/83EC9AC.gbapal"); -const struct YesNoFuncTable gUnknown_083EC9CC = {.yesFunc = sub_810153C, .noFunc = sub_8100EEC}; -const struct YesNoFuncTable gUnknown_083EC9D4 = {.yesFunc = sub_8101590, .noFunc = sub_8100EEC}; -const u32 gSpriteImage_83EC9DC[] = INCBIN_U32("graphics/unknown_sprites/83EC9DC.4bpp"); -const struct SpritePalette gUnknown_083ECA5C = {.data = gUnknown_083EC98C, .tag = 8}; -const struct SpritePalette gUnknown_083ECA64 = {.data = Unknown_3EC9AC, .tag = 8}; -const struct OamData gOamData_83ECA6C = { - .size = 1, .priority = 1 -}; - -const union AnimCmd gSpriteAnim_83ECA74[] = { - ANIMCMD_FRAME(.imageValue = 0, .duration = 0), - ANIMCMD_END -}; - -const union AnimCmd *const gSpriteAnimTable_83ECA7C[] = { - gSpriteAnim_83ECA74 -}; - -const struct SpriteFrameImage gSpriteImageTable_83ECA80[] = { - obj_frame_tiles(gSpriteImage_83EC9DC) -}; - -const struct SpriteTemplate gSpriteTemplate_83ECA88 = { - .tileTag = 0xffff, - .paletteTag = 8, - .oam = &gOamData_83ECA6C, - .anims = gSpriteAnimTable_83ECA7C, - .images = gSpriteImageTable_83ECA80, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8101698 -}; - -const struct YesNoFuncTable gUnknown_083ECAA0 = {.yesFunc = sub_8101848, .noFunc = sub_80FED3C}; - -u8 *const unref_label_083ECAA8[] = {gSharedMem}; - // text extern u8 gUnknown_0815F399[]; @@ -1605,8 +1472,9 @@ void DoPlayerPCDecoration(u8 taskId) void sub_80FE2B4(void) { - u16 palettes[3]; - memcpy(palettes, gUnknown_083EC654, sizeof gUnknown_083EC654); + u16 palettes[3] = {RGB(24, 24, 24), + RGB(28, 28, 28), + RGB(31, 31, 31)}; LoadPalette(&palettes[2], 0xdf, 2); LoadPalette(&palettes[1], 0xd1, 2); LoadPalette(&palettes[0], 0xd8, 2); @@ -1908,6 +1776,8 @@ void sub_80FE948(u8 taskId) } } +const u8 gUnknown_083EC65A[] = _("{PALETTE 13}{STR_VAR_1}"); + void sub_80FEABC(u8 taskId, u8 dummy1) { u16 i; @@ -3568,6 +3438,136 @@ u16 sub_810089C(u16 a0) return ((u16 *)gMapHeader.mapData->secondaryTileset->metatiles)[a0] & 0xfff; } +const u8 Unknown_3EC660[] = {0, 1, 2, 3}; +const u8 Unknown_3EC664[] = {0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13}; +const u8 Unknown_3EC670[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; +const u8 Unknown_3EC680[] = {0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21}; +const u8 Unknown_3EC68C[] = {0, 1, 2, 3, 4, 5, 6, 7}; +const u8 Unknown_3EC694[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; +const u8 Unknown_3EC6B4[] = {0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 29, 32, 33, 34, 35, 36, 37, 40, 41, 42, 43, 44, 45}; +const u8 Unknown_3EC6D8[] = {0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 29}; + +const u8 Unknown_3EC6F0[] = {0, 0, 0, 0}; +const u8 Unknown_3EC6F4[] = {0, 0, 1, 1, 0, 0, 1, 1}; +const u8 Unknown_3EC6FC[] = {0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2}; +const u8 Unknown_3EC708[] = {0, 0, 1, 1, 2, 2, 3, 3, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 4, 4, 5, 5, 6, 6, 7, 7}; +const u8 Unknown_3EC728[] = {0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3}; +const u8 Unknown_3EC738[] = {0, 0, 0, 0, 1, 1, 1, 1}; +const u8 Unknown_3EC740[] = {0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2}; +const u8 Unknown_3EC74C[] = {0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3, 4, 4, 5, 5, 4, 4, 5, 5, 6, 6, 7, 7, 6, 6, 7, 7}; +const u8 Unknown_3EC76C[] = {0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 6, 6, 7, 7, 8, 8}; +const u8 Unknown_3EC790[] = {0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 3, 3, 4, 4, 5, 5}; + +const u8 Unknown_3EC7A8[] = {4, 5, 6, 7}; +const u8 Unknown_3EC7AC[] = {4, 5, 4, 5, 6, 7, 6, 7}; +const u8 Unknown_3EC7B4[] = {4, 5, 4, 5, 4, 5, 6, 7, 6, 7, 6, 7}; +const u8 Unknown_3EC7C0[] = {4, 5, 4, 5, 4, 5, 4, 5, 6, 7, 6, 7, 6, 7, 6, 7, 4, 5, 4, 5, 4, 5, 4, 5, 6, 7, 6, 7, 6, 7, 6, 7}; +const u8 Unknown_3EC7E0[] = {4, 5, 4, 5, 6, 7, 6, 7, 4, 5, 4, 5, 6, 7, 6, 7}; +const u8 Unknown_3EC7F0[] = {4, 5, 6, 7, 4, 5, 6, 7}; +const u8 Unknown_3EC7F8[] = {4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7}; +const u8 Unknown_3EC804[] = {4, 5, 4, 5, 6, 7, 6, 7, 4, 5, 4, 5, 6, 7, 6, 7, 4, 5, 4, 5, 6, 7, 6, 7, 4, 5, 4, 5, 6, 7, 6, 7}; +const u8 Unknown_3EC824[] = {4, 5, 4, 5, 4, 5, 6, 7, 6, 7, 6, 7, 4, 5, 4, 5, 4, 5, 6, 7, 6, 7, 6, 7, 4, 5, 4, 5, 4, 5, 6, 7, 6, 7, 6, 7}; +const u8 Unknown_3EC848[] = {4, 5, 4, 5, 4, 5, 6, 7, 6, 7, 6, 7, 4, 5, 4, 5, 4, 5, 6, 7, 6, 7, 6, 7}; + +const struct UnkStruct_803EC860 gUnknown_083EC860[] = { + {Unknown_3EC660, Unknown_3EC6F0, Unknown_3EC7A8, 0x4}, + {Unknown_3EC68C, Unknown_3EC6F4, Unknown_3EC7AC, 0x8}, + {Unknown_3EC664, Unknown_3EC6FC, Unknown_3EC7B4, 0xc}, + {Unknown_3EC694, Unknown_3EC708, Unknown_3EC7C0, 0x20}, + {Unknown_3EC670, Unknown_3EC728, Unknown_3EC7E0, 0x10}, + {Unknown_3EC68C, Unknown_3EC738, Unknown_3EC7F0, 0x8}, + {Unknown_3EC680, Unknown_3EC740, Unknown_3EC7F8, 0xc}, + {Unknown_3EC694, Unknown_3EC74C, Unknown_3EC804, 0x20}, + {Unknown_3EC6B4, Unknown_3EC76C, Unknown_3EC824, 0x24}, + {Unknown_3EC6D8, Unknown_3EC790, Unknown_3EC848, 0x18} +}; + +const struct UnkStruct_083EC900 gUnknown_083EC900[] = { + {0, 1, 0x78, 0x4e}, + {1, 2, 0x80, 0x4e}, + {1, 3, 0x90, 0x56}, + {1, 3, 0x90, 0x46}, + {0, 2, 0x80, 0x46}, + {2, 2, 0x78, 0x46}, + {2, 3, 0x80, 0x56}, + {2, 3, 0x80, 0x36}, + {0, 3, 0x90, 0x46}, + {1, 3, 0x90, 0x46} +}; + +const union AnimCmd gSpriteAnim_83EC928[] = { + ANIMCMD_FRAME(.imageValue = 0, .duration = 0), + ANIMCMD_END +}; + +const union AnimCmd *const gSpriteAnimTable_83EC930[] = { + gSpriteAnim_83EC928 +}; + +const struct SpriteFrameImage gSpriteImageTable_83EC934[] = { + {.data = gUnknown_02038900.image, .size = sizeof(gUnknown_02038900.image)} +}; + +const struct SpriteTemplate gSpriteTemplate_83EC93C = { + .tileTag = 0xffff, + .paletteTag = 3000, + .oam = &gUnknown_020391AC, + .anims = gSpriteAnimTable_83EC930, + .images = gSpriteImageTable_83EC934, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_81009A8 +}; + +const struct SpritePalette gUnknown_083EC954 = {.data = (u16 *)&gUnknown_02038900.palette, .tag = 3000}; + +const struct YesNoFuncTable gUnknown_083EC95C = {.yesFunc = sub_81000C4, .noFunc = sub_810065C}; +const struct YesNoFuncTable gUnknown_083EC964 = {.yesFunc = sub_810026C, .noFunc = sub_810065C}; +const struct YesNoFuncTable gUnknown_083EC96C[] = { + {.yesFunc = sub_80FFAB0, .noFunc = sub_80FFB08}, + {.yesFunc = sub_8100F88, .noFunc = sub_8100FB4} +}; + +const u8 gUnknown_083EC97C[] = {4, 4, 4, 4, 0, 3, 3, 0}; +const u8 gUnknown_083EC984[] = {4, 4, 4, 4, 0, 4, 3, 0}; + +const u16 gUnknown_083EC98C[] = INCBIN_U16("graphics/unknown/83EC98C.gbapal"); +const u16 Unknown_3EC9AC[] = INCBIN_U16("graphics/unknown/83EC9AC.gbapal"); +const struct YesNoFuncTable gUnknown_083EC9CC = {.yesFunc = sub_810153C, .noFunc = sub_8100EEC}; +const struct YesNoFuncTable gUnknown_083EC9D4 = {.yesFunc = sub_8101590, .noFunc = sub_8100EEC}; +const u32 gSpriteImage_83EC9DC[] = INCBIN_U32("graphics/unknown_sprites/83EC9DC.4bpp"); +const struct SpritePalette gUnknown_083ECA5C = {.data = gUnknown_083EC98C, .tag = 8}; +const struct SpritePalette gUnknown_083ECA64 = {.data = Unknown_3EC9AC, .tag = 8}; +const struct OamData gOamData_83ECA6C = { + .size = 1, .priority = 1 +}; + +const union AnimCmd gSpriteAnim_83ECA74[] = { + ANIMCMD_FRAME(.imageValue = 0, .duration = 0), + ANIMCMD_END +}; + +const union AnimCmd *const gSpriteAnimTable_83ECA7C[] = { + gSpriteAnim_83ECA74 +}; + +const struct SpriteFrameImage gSpriteImageTable_83ECA80[] = { + obj_frame_tiles(gSpriteImage_83EC9DC) +}; + +const struct SpriteTemplate gSpriteTemplate_83ECA88 = { + .tileTag = 0xffff, + .paletteTag = 8, + .oam = &gOamData_83ECA6C, + .anims = gSpriteAnimTable_83ECA7C, + .images = gSpriteImageTable_83ECA80, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8101698 +}; + +const struct YesNoFuncTable gUnknown_083ECAA0 = {.yesFunc = sub_8101848, .noFunc = sub_80FED3C}; + +u8 *const unref_label_083ECAA8[] = {gSharedMem}; + void sub_81008BC(struct UnkStruct_02038900 *unk_02038900) { u8 i; diff --git a/src/field/dewford_trend.c b/src/field/dewford_trend.c index b67f3a2bd..9afb7a16d 100644 --- a/src/field/dewford_trend.c +++ b/src/field/dewford_trend.c @@ -202,14 +202,14 @@ void sub_80FA4E4(void *a, u32 b, u8 unused) *(dst++) = *(src++); } -void sub_80FA5BC(void) +void BufferTrendyPhraseString(void) { struct EasyChatPair *s = &gSaveBlock1.easyChatPairs[gSpecialVar_0x8004]; ConvertEasyChatWordsToString(gStringVar1, s->words, 2, 1); } -void sub_80FA5E4(void) +void TrendyPhraseIsOld(void) { u16 result = 0; @@ -222,7 +222,7 @@ void sub_80FA5E4(void) gSpecialVar_Result = result; } -void sub_80FA648(void) +void GetDewfordHallPaintingNameIndex(void) { gSpecialVar_Result = (gSaveBlock1.easyChatPairs[0].words[0] + gSaveBlock1.easyChatPairs[0].words[1]) & 7; } diff --git a/src/field/easy_chat.c b/src/field/easy_chat.c index 1dce5863e..94532506f 100644 --- a/src/field/easy_chat.c +++ b/src/field/easy_chat.c @@ -314,7 +314,7 @@ void sub_80EB7C4(void) ShowFieldAutoScrollMessage(gStringVar4); } -void sub_80EB83C(void) +void BufferRandomHobbyOrLifestyleString(void) { u16 group, local2; diff --git a/src/field/event_data.c b/src/field/event_data.c index 587da8138..9d6d2372b 100644 --- a/src/field/event_data.c +++ b/src/field/event_data.c @@ -112,10 +112,10 @@ bool32 CanResetRTC(void) u16 *GetVarPointer(u16 id) { - if (id < 0x4000) + if (id < VARS_START) return NULL; if (id < 0x8000) - return &gSaveBlock1.vars[id - 0x4000]; + return &gSaveBlock1.vars[id - VARS_START]; return gSpecialVars[id - 0x8000]; } @@ -138,7 +138,7 @@ bool8 VarSet(u16 id, u16 value) u8 VarGetFieldObjectGraphicsId(u8 id) { - return VarGet(0x4010 + id); + return VarGet(VAR_OBJ_GFX_ID_0 + id); } u8 *GetFlagPointer(u16 id) diff --git a/src/field/field_control_avatar.c b/src/field/field_control_avatar.c index cd7d3a2e2..52e66f16e 100644 --- a/src/field/field_control_avatar.c +++ b/src/field/field_control_avatar.c @@ -355,7 +355,7 @@ static u8 *TryGetInvisibleMapObjectScript(struct MapPosition *position, u8 unuse case 5: case 6: case 7: - gSpecialVar_0x8004 = ((u32)bgEvent->bgUnion.script >> 16) + 0x258; + gSpecialVar_0x8004 = ((u32)bgEvent->bgUnion.script >> 16) + FLAG_HIDDEN_ITEMS_START; gSpecialVar_0x8005 = (u32)bgEvent->bgUnion.script; if (FlagGet(gSpecialVar_0x8004) == TRUE) return NULL; @@ -363,7 +363,7 @@ static u8 *TryGetInvisibleMapObjectScript(struct MapPosition *position, u8 unuse case 8: if (c == 2) { - gSpecialVar_0x8004 = (u32)bgEvent->bgUnion.script; + gSpecialVar_0x8004 = bgEvent->bgUnion.secretBaseId; if (sub_80BC050()) return gUnknown_081A2C51; } @@ -493,7 +493,7 @@ bool8 sub_8068870(u16 a) bool8 sub_8068894(void) { - sub_8082B78(); + IncrementRematchStepCounter(); happiness_algorithm_step(); if (overworld_poison_step() == TRUE) { diff --git a/src/field/field_effect.c b/src/field/field_effect.c index 4337300da..1e2aaa4ed 100644 --- a/src/field/field_effect.c +++ b/src/field/field_effect.c @@ -310,114 +310,6 @@ void (*const gUnknown_0839F378[])(struct Task *) = { sub_8087914 }; -const u8 gUnknown_0839F380[] = {1, 3, 4, 2, 1}; - -void (*const gUnknown_0839F388[])(struct Task *) = { - sub_8087AA4, - sub_8087AC8 -}; - -void (*const gUnknown_0839F390[])(struct Task *) = { - sub_8087BEC, - sub_8087C14, - sub_8087CA4, - sub_8087D78 -}; - -void (*const gUnknown_0839F3A0[])(struct Task *) = { - sub_8087E4C, - sub_8087ED8, - sub_8087FDC -}; - -void (*const gUnknown_0839F3AC[])(struct Task *) = { - sub_8088150, - sub_80881C0, - sub_8088228, - sub_80882B4, - sub_80882E4, - sub_8088338, - sub_8088380 -}; - -void (*const gUnknown_0839F3C8[])(struct Task *) = { - sub_80884AC, - sub_80884E8, - sub_8088554, - sub_80885A8, - sub_80885D8, - sub_808860C, - sub_808862C -}; - -void (*const gUnknown_0839F3E4[])(struct Task *) = { - sub_8088984, - sub_80889E4, - sub_8088A30, - sub_8088A78, - sub_8088AF4 -}; - -void (*const gUnknown_0839F3F8[])(struct Task *) = { - sub_8088CA0, - sub_8088CF8, - sub_8088D3C, - sub_8088D94, - sub_8088DD8, - sub_8088E2C, - sub_8088EB4, - sub_8088F10, - sub_8088F30 -}; - -const union AffineAnimCmd SpriteAffineAnim_839F41C[] = { - AFFINEANIMCMD_FRAME(8, 8, -30, 0), - AFFINEANIMCMD_FRAME(28, 28, 0, 30), - AFFINEANIMCMD_END -}; - -const union AffineAnimCmd SpriteAffineAnim_839F434[] = { - AFFINEANIMCMD_FRAME(256, 256, 64, 0), - AFFINEANIMCMD_FRAME(-10, -10, 0, 22), - AFFINEANIMCMD_END -}; - -const union AffineAnimCmd *const gSpriteAffineAnimTable_0839F44C[] = { - SpriteAffineAnim_839F41C, - SpriteAffineAnim_839F434 -}; - -void (*const gUnknown_0839F454[])(struct Task *) = { - sub_80892A0, - sub_8089354, - sub_80893C0, - sub_8089414, - sub_808948C, - sub_80894C4, - fishE -}; - -const s16 gUnknown_0839F470[] = { - -2, - -4, - -5, - -6, - -7, - -8, - -8, - -8, - -7, - -7, - -6, - -5, - -3, - -2, - 0, - 2, - 4, - 8 -}; - static u8 sActiveList[32]; extern u8 *gFieldEffectScriptPointers[]; @@ -2100,8 +1992,7 @@ void sub_80878F4(struct Task *task) void sub_8087914(struct Task *task) { struct MapObject *mapObject; - u8 unknown_0839F380[5]; - memcpy(unknown_0839F380, gUnknown_0839F380, sizeof gUnknown_0839F380); + u8 unknown_0839F380[5] = {1, 3, 4, 2, 1}; if (task->data[14] != 0 && (--task->data[14]) == 0) { sub_8053FF8(); @@ -2130,6 +2021,11 @@ void sub_8087914(struct Task *task) } } +void (*const gUnknown_0839F388[])(struct Task *) = { + sub_8087AA4, + sub_8087AC8 +}; + void sub_8087A74(u8); void mapldr_080859D4(void) @@ -2159,10 +2055,8 @@ void sub_8087AA4(struct Task *task) void sub_8087AC8(struct Task *task) { - struct MapObject *mapObject; - u8 unknown_0839F380[5]; - memcpy(unknown_0839F380, gUnknown_0839F380, sizeof gUnknown_0839F380); - mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + u8 unknown_0839F380[5] = {1, 3, 4, 2, 1}; + struct MapObject *mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; if (task->data[1] == 0 || (--task->data[1]) == 0) { if (FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive(mapObject) && !FieldObjectClearAnimIfSpecialAnimFinished(mapObject)) @@ -2195,6 +2089,13 @@ void sub_8087BA8(void) CreateTask(sub_8087BBC, 0); } +void (*const gUnknown_0839F390[])(struct Task *) = { + sub_8087BEC, + sub_8087C14, + sub_8087CA4, + sub_8087D78 +}; + void sub_8087BBC(u8 taskId) { gUnknown_0839F390[gTasks[taskId].data[0]](&gTasks[taskId]); @@ -2211,10 +2112,8 @@ void sub_8087BEC(struct Task *task) void sub_8087C14(struct Task *task) { - struct MapObject *mapObject; - u8 unknown_0839F380[5]; - memcpy(unknown_0839F380, gUnknown_0839F380, sizeof gUnknown_0839F380); - mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + u8 unknown_0839F380[5] = {1, 3, 4, 2, 1}; + struct MapObject *mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; if (task->data[1] == 0 || (--task->data[1]) == 0) { FieldObjectTurn(mapObject, unknown_0839F380[mapObject->mapobj_unk_18]); @@ -2233,12 +2132,9 @@ void sub_8087C14(struct Task *task) void sub_8087CA4(struct Task *task) { - struct MapObject *mapObject; - struct Sprite *sprite; - u8 unknown_0839F380[5]; - memcpy(unknown_0839F380, gUnknown_0839F380, sizeof gUnknown_0839F380); - mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; - sprite = &gSprites[gPlayerAvatar.spriteId]; + u8 unknown_0839F380[5] = {1, 3, 4, 2, 1}; + struct MapObject *mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + struct Sprite *sprite = &gSprites[gPlayerAvatar.spriteId]; if ((--task->data[1]) <= 0) { task->data[1] = 4; @@ -2288,6 +2184,12 @@ void mapldr_08085D88(void) CreateTask(sub_8087E1C, 0); } +void (*const gUnknown_0839F3A0[])(struct Task *) = { + sub_8087E4C, + sub_8087ED8, + sub_8087FDC +}; + void sub_8087E1C(u8 taskId) { gUnknown_0839F3A0[gTasks[taskId].data[0]](&gTasks[taskId]); @@ -2314,12 +2216,9 @@ void sub_8087E4C(struct Task *task) void sub_8087ED8(struct Task *task) { - u8 unknown_0839F380[5]; - struct MapObject *mapObject; - struct Sprite *sprite; - memcpy(unknown_0839F380, gUnknown_0839F380, sizeof gUnknown_0839F380); - mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; - sprite = &gSprites[gPlayerAvatar.spriteId]; + u8 unknown_0839F380[5] = {1, 3, 4, 2, 1}; + struct MapObject *mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + struct Sprite *sprite = &gSprites[gPlayerAvatar.spriteId]; if ((sprite->pos2.y += task->data[1]) >= -8) { if (task->data[13] == 0) @@ -2356,10 +2255,8 @@ void sub_8087ED8(struct Task *task) void sub_8087FDC(struct Task *task) { - u8 unknown_0839F380[5]; - struct MapObject *mapObject; - memcpy(unknown_0839F380, gUnknown_0839F380, sizeof gUnknown_0839F380); - mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + u8 unknown_0839F380[5] = {1, 3, 4, 2, 1}; + struct MapObject *mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; if ((--task->data[1]) == 0) { FieldObjectTurn(mapObject, unknown_0839F380[mapObject->mapobj_unk_18]); @@ -2409,6 +2306,16 @@ bool8 FldEff_FieldMoveShowMonInit(void) return FALSE; } +void (*const gUnknown_0839F3AC[])(struct Task *) = { + sub_8088150, + sub_80881C0, + sub_8088228, + sub_80882B4, + sub_80882E4, + sub_8088338, + sub_8088380 +}; + void sub_8088120(u8 taskId) { gUnknown_0839F3AC[gTasks[taskId].data[0]](&gTasks[taskId]); @@ -2565,6 +2472,16 @@ bool8 sub_8088708(struct Task *); void sub_80886F8(struct Task *); bool8 sub_80887C0(struct Task *); +void (*const gUnknown_0839F3C8[])(struct Task *) = { + sub_80884AC, + sub_80884E8, + sub_8088554, + sub_80885A8, + sub_80885D8, + sub_808860C, + sub_808862C +}; + void sub_808847C(u8 taskId) { gUnknown_0839F3C8[gTasks[taskId].data[0]](&gTasks[taskId]); @@ -2884,6 +2801,14 @@ u8 FldEff_UseSurf(void) return FALSE; } +void (*const gUnknown_0839F3E4[])(struct Task *) = { + sub_8088984, + sub_80889E4, + sub_8088A30, + sub_8088A78, + sub_8088AF4 +}; + void sub_8088954(u8 taskId) { gUnknown_0839F3E4[gTasks[taskId].data[0]](&gTasks[taskId]); @@ -3012,6 +2937,18 @@ u8 FldEff_UseFly(void) return 0; } +void (*const gUnknown_0839F3F8[])(struct Task *) = { + sub_8088CA0, + sub_8088CF8, + sub_8088D3C, + sub_8088D94, + sub_8088DD8, + sub_8088E2C, + sub_8088EB4, + sub_8088F10, + sub_8088F30 +}; + void sub_8088C70(u8 taskId) { gUnknown_0839F3F8[gTasks[taskId].data[0]](&gTasks[taskId]); @@ -3170,6 +3107,23 @@ void sub_8088FFC(u8 a0, u8 a1) gSprites[a0].data[6] = a1; } +const union AffineAnimCmd SpriteAffineAnim_839F41C[] = { + AFFINEANIMCMD_FRAME(8, 8, -30, 0), + AFFINEANIMCMD_FRAME(28, 28, 0, 30), + AFFINEANIMCMD_END +}; + +const union AffineAnimCmd SpriteAffineAnim_839F434[] = { + AFFINEANIMCMD_FRAME(256, 256, 64, 0), + AFFINEANIMCMD_FRAME(-10, -10, 0, 22), + AFFINEANIMCMD_END +}; + +const union AffineAnimCmd *const gSpriteAffineAnimTable_0839F44C[] = { + SpriteAffineAnim_839F41C, + SpriteAffineAnim_839F434 +}; + void sub_8089018(struct Sprite *sprite) { if (sprite->data[7] == 0) @@ -3282,6 +3236,16 @@ u8 FldEff_FlyIn(void) return 0; } +void (*const gUnknown_0839F454[])(struct Task *) = { + sub_80892A0, + sub_8089354, + sub_80893C0, + sub_8089414, + sub_808948C, + sub_80894C4, + fishE +}; + void sub_8089270(u8 taskId) { gUnknown_0839F454[gTasks[taskId].data[0]](&gTasks[taskId]); @@ -3333,10 +3297,27 @@ void sub_8089354(struct Task *task) void sub_80893C0(struct Task *task) { - s16 unknown_0839F470[18]; - struct Sprite *sprite; - memcpy(unknown_0839F470, gUnknown_0839F470, sizeof gUnknown_0839F470); - sprite = &gSprites[gPlayerAvatar.spriteId]; + s16 unknown_0839F470[18] = { + -2, + -4, + -5, + -6, + -7, + -8, + -8, + -8, + -7, + -7, + -6, + -5, + -3, + -2, + 0, + 2, + 4, + 8 + }; + struct Sprite *sprite = &gSprites[gPlayerAvatar.spriteId]; sprite->pos2.y = unknown_0839F470[task->data[2]]; if ((++task->data[2]) >= 18) { diff --git a/src/field/field_effect_helpers.c b/src/field/field_effect_helpers.c index 1d831d2e9..165829a55 100644 --- a/src/field/field_effect_helpers.c +++ b/src/field/field_effect_helpers.c @@ -31,50 +31,6 @@ static u32 ShowDisguiseFieldEffect(u8, u8, u8); const u8 UnusedEggString_8401E28[] = _("タマゴ"); -const u16 gUnknown_08401E2C[] = { - 0x0c, - 0x1c, - 0x2c -}; - -const u8 gUnknown_08401E32[] = { - 0, - 1, - 2, - 3 -}; - -const u16 gUnknown_08401E36[] = { - 4, - 4, - 4, - 16 -}; - -void (*const gUnknown_08401E40[])(struct Sprite *) = { - sub_81275A0, - sub_81275C4 -}; - -void (*const gUnknown_08401E48[])(struct Sprite *) = { - sub_8127DA0, - sub_8127DD0, - sub_8127E30 -}; - -const u8 gUnknown_08401E54[] = { - 0, - 0, - 1, - 2, - 3 -}; - -const u16 gUnknown_08401E5A[] = { - 3, - 7 -}; - void SetUpReflection(struct MapObject *mapObject, struct Sprite *sprite, bool8 flag) { struct Sprite *newSprite; @@ -107,9 +63,7 @@ static s16 sub_81268D0(struct MapObject *mapObject) static void npc_pal_op(struct MapObject *mapObject, struct Sprite *sprite) { u8 whichElement; - u16 unk_8041e2c[ARRAY_COUNT(gUnknown_08401E2C)]; - - memcpy(unk_8041e2c, gUnknown_08401E2C, sizeof gUnknown_08401E2C); + u16 unk_8041e2c[] = {0x0c, 0x1c, 0x2c}; sprite->data[2] = 0; if (!GetFieldObjectGraphicsInfo(mapObject->graphicsId)->disableReflectionPaletteLoad && ((whichElement = sub_8057450(mapObject->mapobj_unk_1F)) || (whichElement = sub_8057450(mapObject->mapobj_unk_1E)))) { @@ -237,6 +191,20 @@ void sub_8126BC4(u8 spriteId, u8 animNum, s16 x, s16 y) } } +const u8 gUnknown_08401E32[] = { + 0, + 1, + 2, + 3 +}; + +const u16 gUnknown_08401E36[] = { + 4, + 4, + 4, + 16 +}; + u32 FldEff_Shadow(void) { u8 mapObjectId; @@ -589,6 +557,11 @@ u32 FldEff_BikeTireTracks(void) return spriteId; } +void (*const gUnknown_08401E40[])(struct Sprite *) = { + sub_81275A0, + sub_81275C4 +}; + void sub_8127584(struct Sprite *sprite) { gUnknown_08401E40[sprite->data[0]](sprite); @@ -917,6 +890,12 @@ u32 FldEff_Ash(void) return 0; } +void (*const gUnknown_08401E48[])(struct Sprite *) = { + sub_8127DA0, + sub_8127DD0, + sub_8127E30 +}; + void sub_8127D84(struct Sprite *sprite) { gUnknown_08401E48[sprite->data[0]](sprite); @@ -1018,9 +997,7 @@ void sub_8127F7C(struct Sprite *sprite) static void sub_8127FD4(struct MapObject *mapObject, struct Sprite *sprite) { - u8 unk_8041E54[ARRAY_COUNT(gUnknown_08401E54)]; - - memcpy(unk_8041E54, gUnknown_08401E54, sizeof gUnknown_08401E54); + u8 unk_8041E54[] = {0, 0, 1, 2, 3}; if (sub_8127F64(sprite) == 0) { StartSpriteAnimIfDifferent(sprite, unk_8041E54[mapObject->placeholder18]); @@ -1134,11 +1111,8 @@ __attribute__((naked)) static void sub_812800C(struct MapObject *mapObject, stru static void sub_81280A0(struct MapObject *mapObject, struct Sprite *linkedSprite, struct Sprite *sprite) { - u16 unk_8401E5A[ARRAY_COUNT(gUnknown_08401E5A)]; - u8 v0; - - memcpy(unk_8401E5A, gUnknown_08401E5A, sizeof gUnknown_08401E5A); - v0 = sub_8127F5C(sprite); + u16 unk_8401E5A[] = {3, 7}; + u8 v0 = sub_8127F5C(sprite); if (v0 != 0) { if (((u16)(++ sprite->data[4]) & unk_8401E5A[sprite->data[5]]) == 0) diff --git a/src/field/field_fadetransition.c b/src/field/field_fadetransition.c index 829ce2dfa..5014e97e3 100644 --- a/src/field/field_fadetransition.c +++ b/src/field/field_fadetransition.c @@ -327,7 +327,7 @@ void sub_8080DC4(u8 taskId) } } -void atk17_seteffectuser(void) +void atk17_seteffectsecondary(void) { pal_fill_black(); CreateStartMenuTask(sub_8080DC4); diff --git a/src/field/field_map_obj.c b/src/field/field_map_obj.c index 81c0c5854..ba7c3d68e 100644 --- a/src/field/field_map_obj.c +++ b/src/field/field_map_obj.c @@ -2020,7 +2020,7 @@ u8 GetFieldObjectIdByLocalId(u8 localId) #ifdef NONMATCHING u8 InitFieldObjectStateFromTemplate(struct MapObjectTemplate *template, u8 b, u8 c) { - struct MapObject2 *mapObj; //TODO: resolve the mapobj_unk_19b weirdness + struct MapObject *mapObj; //TODO: resolve the mapobj_unk_19b weirdness u8 var; u16 r3; u16 r2; @@ -2029,8 +2029,8 @@ u8 InitFieldObjectStateFromTemplate(struct MapObjectTemplate *template, u8 b, u8 if (GetAvailableFieldObjectSlot(template->localId, b, c, &var) != 0) return 16; //_0805ACCE - mapObj = (struct MapObject2 *)&gMapObjects[var]; - npc_clear_ids_and_state((struct MapObject *)mapObj); + mapObj = &gMapObjects[var]; + npc_clear_ids_and_state(mapObj); r3 = template->x + 7; r2 = template->y + 7; mapObj->active = TRUE; @@ -2048,8 +2048,8 @@ u8 InitFieldObjectStateFromTemplate(struct MapObjectTemplate *template, u8 b, u8 mapObj->coords3.y = r2; mapObj->mapobj_unk_0B_0 = template->elevation; mapObj->elevation = template->elevation; - mapObj->mapobj_unk_19 = template->unkA_0; - mapObj->mapobj_unk_19b = template->unkA_4; + mapObj->range.as_nybbles.x = template->unkA_0; + mapObj->range.as_nybbles.y = template->unkA_4; mapObj->trainerType = template->unkC; mapObj->trainerRange_berryTreeId = template->unkE; mapObj->mapobj_unk_20 = gUnknown_0836DC09[template->movementType]; @@ -2058,10 +2058,10 @@ u8 InitFieldObjectStateFromTemplate(struct MapObjectTemplate *template, u8 b, u8 //asm("":::"r5","r6"); if (gUnknown_0836DBBC[mapObj->animPattern] != 0) { - if (mapObj->mapobj_unk_19 == 0) - mapObj->mapobj_unk_19++; - if (mapObj->mapobj_unk_19b == 0) - mapObj->mapobj_unk_19b++; + if (mapObj->range.as_nybbles.x == 0) + mapObj->range.as_nybbles.x++; + if (mapObj->range.as_nybbles.y == 0) + mapObj->range.as_nybbles.y++; } return var; } @@ -5464,7 +5464,7 @@ u8 sub_805FF20(struct MapObject *mapObject, u8 direction) return npc_block_way(mapObject, x, y, direction); } -bool8 IsCoordOutsideFieldObjectMovementRect(struct MapObject2 *mapObject, s16 x, s16 y); +bool8 IsCoordOutsideFieldObjectMovementRect(struct MapObject *mapObject, s16 x, s16 y); static bool8 DoesObjectCollideWithObjectAt(struct MapObject *mapObject, s16 x, s16 y); bool8 IsMetatileDirectionallyImpassable(struct MapObject *mapObject, s16 x, s16 y, u8 direction); @@ -5472,7 +5472,7 @@ u8 npc_block_way(struct MapObject *mapObject, s16 x, s16 y, u32 dirn) { u8 direction; direction = dirn; - if (IsCoordOutsideFieldObjectMovementRect((struct MapObject2 *)mapObject, x, y)) + if (IsCoordOutsideFieldObjectMovementRect(mapObject, x, y)) return 1; else if (MapGridIsImpassableAt(x, y) || GetMapBorderIdAt(x, y) == -1 || IsMetatileDirectionallyImpassable(mapObject, x, y, direction)) return 2; @@ -5489,7 +5489,7 @@ u8 sub_8060024(struct MapObject *mapObject, s16 x, s16 y, u8 direction) { u8 flags = 0; - if (IsCoordOutsideFieldObjectMovementRect((struct MapObject2 *)mapObject, x, y)) + if (IsCoordOutsideFieldObjectMovementRect(mapObject, x, y)) flags |= 1; if (MapGridIsImpassableAt(x, y) || GetMapBorderIdAt(x, y) == -1 || IsMetatileDirectionallyImpassable(mapObject, x, y, direction) || (mapObject->mapobj_bit_15 && !CanCameraMoveInDirection(direction))) flags |= 2; @@ -5500,22 +5500,22 @@ u8 sub_8060024(struct MapObject *mapObject, s16 x, s16 y, u8 direction) return flags; } -bool8 IsCoordOutsideFieldObjectMovementRect(struct MapObject2 *mapObject, s16 x, s16 y) +bool8 IsCoordOutsideFieldObjectMovementRect(struct MapObject *mapObject, s16 x, s16 y) { s16 minv; s16 maxv; - if (mapObject->mapobj_unk_19 != 0) + if (mapObject->range.as_nybbles.x != 0) { - minv = mapObject->coords1.x - (mapObject->mapobj_unk_19); - maxv = mapObject->coords1.x + (mapObject->mapobj_unk_19); + minv = mapObject->coords1.x - (mapObject->range.as_nybbles.x); + maxv = mapObject->coords1.x + (mapObject->range.as_nybbles.x); if (minv > x || maxv < x) return TRUE; } - if (mapObject->mapobj_unk_19b != 0) + if (mapObject->range.as_nybbles.y != 0) { - minv = mapObject->coords1.y - (mapObject->mapobj_unk_19b); - maxv = mapObject->coords1.y + (mapObject->mapobj_unk_19b); + minv = mapObject->coords1.y - (mapObject->range.as_nybbles.y); + maxv = mapObject->coords1.y + (mapObject->range.as_nybbles.y); if (minv > y || maxv < y) return TRUE; } diff --git a/src/field/field_map_obj_helpers.c b/src/field/field_map_obj_helpers.c index f1a113d44..328b66ed2 100644 --- a/src/field/field_map_obj_helpers.c +++ b/src/field/field_map_obj_helpers.c @@ -7,13 +7,92 @@ typedef void (*SpriteStepFunc)(struct Sprite *sprite, u8 dir); -extern s16 gUnknown_08376194[]; -extern SpriteStepFunc *gUnknown_08376180[]; -extern s8 *gUnknown_083761D0[]; -extern s16 gUnknown_083761DC[]; -extern u8 gUnknown_083761E2[]; -extern s16 gUnknown_083761E6[]; -extern u8 gUnknown_083761EC[]; +void Step1(struct Sprite *sprite, u8 dir); +void Step2(struct Sprite *sprite, u8 dir); +void Step3(struct Sprite *sprite, u8 dir); +void Step4(struct Sprite *sprite, u8 dir); +void Step8(struct Sprite *sprite, u8 dir); + +const SpriteStepFunc Unknown_83760F0[] = { + Step1, + Step1, + Step1, + Step1, + Step1, + Step1, + Step1, + Step1, + Step1, + Step1, + Step1, + Step1, + Step1, + Step1, + Step1, + Step1 +}; + +const SpriteStepFunc Unknown_8376130[] = { + Step2, + Step2, + Step2, + Step2, + Step2, + Step2, + Step2, + Step2 +}; + +const SpriteStepFunc Unknown_8376150[] = { + Step2, + Step3, + Step3, + Step2, + Step3, + Step3 +}; + +const SpriteStepFunc Unknown_8376168[] = { + Step4, + Step4, + Step4, + Step4 +}; + +const SpriteStepFunc Unknown_8376178[] = { + Step8, + Step8 +}; + +const SpriteStepFunc *const gUnknown_08376180[] = { + Unknown_83760F0, + Unknown_8376130, + Unknown_8376150, + Unknown_8376168, + Unknown_8376178 +}; + +const s16 gUnknown_08376194[] = { + 16, 8, 6, 4, 2 +}; + +const s8 Unknown_837619E[] = { + -4, -6, -8, -10, -11, -12, -12, -12, -11, -10, -9, -8, -6, -4, 0, 0 +}; + +const s8 Unknown_83761AE[] = { + 0, -2, -3, -4, -5, -6, -6, -6, -5, -5, -4, -3, -2, 0, 0, 0 +}; + +const s8 Unknown_83761BE[] = { + -2, -4, -6, -8, -9, -10, -10, -10, -9, -8, -6, -5, -3, -2, 0, 0 +}; + +const s8 *const gUnknown_083761D0[] = { + Unknown_837619E, + Unknown_83761AE, + Unknown_83761BE +}; bool8 FreezeMapObject(struct MapObject *mapObject) { @@ -156,14 +235,9 @@ void sub_80646E4(struct Sprite *sprite, u8 a2, u8 a3, u8 a4) u8 sub_8064704(struct Sprite *sprite) { - u8 v2; - s16 v5[3]; - u8 v6[3]; - - memcpy(v5, gUnknown_083761DC, 6); - memcpy(v6, gUnknown_083761E2, 3); - - v2 = 0; + s16 v5[3] = {0x10, 0x10, 0x20}; + u8 v6[3] = {0, 0, 1}; + u8 v2 = 0; if (sprite->data[4]) Step1(sprite, sprite->data[3]); @@ -186,14 +260,9 @@ u8 sub_8064704(struct Sprite *sprite) u8 sub_806478C(struct Sprite *sprite) { - u8 v2; - s16 v5[3]; - u8 v6[3]; - - memcpy(v5, gUnknown_083761E6, 6); - memcpy(v6, gUnknown_083761EC, 3); - - v2 = 0; + s16 v5[3] = {0x20, 0x20, 0x40}; + u8 v6[3] = {1, 1, 2}; + u8 v2 = 0; if (sprite->data[4] && !(sprite->data[6] & 1)) Step1(sprite, sprite->data[3]); diff --git a/src/field/field_special_scene.c b/src/field/field_special_scene.c index 0b7fe336e..67b652a57 100644 --- a/src/field/field_special_scene.c +++ b/src/field/field_special_scene.c @@ -291,7 +291,7 @@ bool8 sub_80C7754(void) void Task_HandlePorthole(u8 taskId) { s16 *data = gTasks[taskId].data; - u16 *var = GetVarPointer(VAR_PORTHOLE); + u16 *var = GetVarPointer(VAR_PORTHOLE_STATE); struct WarpData *location = &gSaveBlock1.location; switch (data[0]) @@ -337,8 +337,8 @@ void Task_HandlePorthole(u8 taskId) } break; case EXIT_PORTHOLE: // exit porthole. - FlagClear(0x4001); - FlagClear(0x4000); + FlagClear(FLAG_SPECIAL_FLAG_1); + FlagClear(FLAG_SPECIAL_FLAG_0); copy_saved_warp2_bank_and_enter_x_to_warp1(0); sp13E_warp_to_last_warp(); DestroyTask(taskId); @@ -352,7 +352,7 @@ void sub_80C78A0(void) gSprites[spriteId].coordOffsetEnabled = FALSE; - if (VarGet(0x40B4) == 2) + if (VarGet(VAR_PORTHOLE_STATE) == 2) { StartSpriteAnim(&gSprites[spriteId], FieldObjectDirectionToImageAnimId(4)); } @@ -374,8 +374,8 @@ void sub_80C791C(void) void sub_80C7958(void) { FlagSet(FLAG_SYS_CRUISE_MODE); - FlagSet(0x4001); - FlagSet(0x4000); + FlagSet(FLAG_SPECIAL_FLAG_1); + FlagSet(FLAG_SPECIAL_FLAG_0); saved_warp2_set(0, gSaveBlock1.location.mapGroup, gSaveBlock1.location.mapNum, -1); sub_80C7754(); sub_8080F9C(); diff --git a/src/field/field_specials.c b/src/field/field_specials.c index 87a9e2d5d..fc6f690a3 100644 --- a/src/field/field_specials.c +++ b/src/field/field_specials.c @@ -99,13 +99,13 @@ u16 GetPlayerAvatarBike(void) return 0; } -static void DetermineCyclingRoadResults(u32 arg0, u8 arg1) +static void DetermineCyclingRoadResults(u32 numFrames, u8 numBikeCollisions) { u8 result; - if (arg1 <= 99) + if (numBikeCollisions <= 99) { - ConvertIntToDecimalStringN(gStringVar1, arg1, STR_CONV_MODE_LEFT_ALIGN, 2); + ConvertIntToDecimalStringN(gStringVar1, numBikeCollisions, STR_CONV_MODE_LEFT_ALIGN, 2); StringAppend(gStringVar1, gOtherText_Times); } else @@ -113,11 +113,11 @@ static void DetermineCyclingRoadResults(u32 arg0, u8 arg1) StringCopy(gStringVar1, gOtherText_99Times); } - if (arg0 < 3600) + if (numFrames < 3600) { - ConvertIntToDecimalStringN(gStringVar2, arg0 / 60, STR_CONV_MODE_RIGHT_ALIGN, 2); + ConvertIntToDecimalStringN(gStringVar2, numFrames / 60, STR_CONV_MODE_RIGHT_ALIGN, 2); gStringVar2[2] = CHAR_DECIMAL_SEPARATOR; - ConvertIntToDecimalStringN(&gStringVar2[3], ((arg0 % 60) * 100) / 60, STR_CONV_MODE_LEADING_ZEROS, 2); + ConvertIntToDecimalStringN(&gStringVar2[3], ((numFrames % 60) * 100) / 60, STR_CONV_MODE_LEADING_ZEROS, 2); StringAppend(gStringVar2, gOtherText_Seconds); } else @@ -126,44 +126,44 @@ static void DetermineCyclingRoadResults(u32 arg0, u8 arg1) } result = 0; - if (arg1 == 0) + if (numBikeCollisions == 0) { result = 5; } - else if (arg1 < 4) + else if (numBikeCollisions < 4) { result = 4; } - else if (arg1 < 10) + else if (numBikeCollisions < 10) { result = 3; } - else if (arg1 < 20) + else if (numBikeCollisions < 20) { result = 2; } - else if (arg1 < 100) + else if (numBikeCollisions < 100) { result = 1; } - if (arg0 / 60 <= 10) + if (numFrames / 60 <= 10) { result += 5; } - else if (arg0 / 60 <= 15) + else if (numFrames / 60 <= 15) { result += 4; } - else if (arg0 / 60 <= 20) + else if (numFrames / 60 <= 20) { result += 3; } - else if (arg0 / 60 <= 40) + else if (numFrames / 60 <= 40) { result += 2; } - else if (arg0 / 60 < 60) + else if (numFrames / 60 < 60) { result += 1; } @@ -173,36 +173,36 @@ static void DetermineCyclingRoadResults(u32 arg0, u8 arg1) } void FinishCyclingRoadChallenge(void) { - const u32 time = gMain.vblankCounter1 - gBikeCyclingTimer; + const u32 numFrames = gMain.vblankCounter1 - gBikeCyclingTimer; - DetermineCyclingRoadResults(time, gBikeCollisions); - RecordCyclingRoadResults(time, gBikeCollisions); + DetermineCyclingRoadResults(numFrames, gBikeCollisions); + RecordCyclingRoadResults(numFrames, gBikeCollisions); } -static void RecordCyclingRoadResults(u32 arg0, u8 arg1) { - u16 high = VarGet(0x4028); - u16 low = VarGet(0x4029); - u32 record = high + (low << 16); +static void RecordCyclingRoadResults(u32 numFrames, u8 numBikeCollisions) { + u16 low = VarGet(VAR_CYCLING_ROAD_RECORD_TIME_L); + u16 high = VarGet(VAR_CYCLING_ROAD_RECORD_TIME_H); + u32 framesRecord = low + (high << 16); - if (record > arg0 || record == 0) + if (framesRecord > numFrames || framesRecord == 0) { - VarSet(0x4028, arg0); - VarSet(0x4029, arg0 >> 16); - VarSet(0x4027, arg1); + VarSet(VAR_CYCLING_ROAD_RECORD_TIME_L, numFrames); + VarSet(VAR_CYCLING_ROAD_RECORD_TIME_H, numFrames >> 16); + VarSet(VAR_CYCLING_ROAD_RECORD_COLLISIONS, numBikeCollisions); } } u16 GetRecordedCyclingRoadResults(void) { - u16 high = VarGet(0x4028); - u16 low = VarGet(0x4029); - u32 record = high + (low << 16); + u16 low = VarGet(VAR_CYCLING_ROAD_RECORD_TIME_L); + u16 high = VarGet(VAR_CYCLING_ROAD_RECORD_TIME_H); + u32 framesRecord = low + (high << 16); - if (record == 0) + if (framesRecord == 0) { return FALSE; } - DetermineCyclingRoadResults(record, VarGet(0x4027)); + DetermineCyclingRoadResults(framesRecord, VarGet(VAR_CYCLING_ROAD_RECORD_COLLISIONS)); return TRUE; } @@ -212,9 +212,9 @@ void UpdateCyclingRoadState(void) { return; } - if (VarGet(0x40a9) == 2 || VarGet(0x40a9) == 3) + if (VarGet(VAR_CYCLING_CHALLENGE_STATE) == 2 || VarGet(VAR_CYCLING_CHALLENGE_STATE) == 3) { - VarSet(0x40a9, 0); + VarSet(VAR_CYCLING_CHALLENGE_STATE, 0); Overworld_SetSavedMusic(SE_STOP); } } @@ -242,7 +242,7 @@ bool32 CountSSTidalStep(u16 delta) u8 GetSSTidalLocation(s8 *mapGroup, s8 *mapNum, s16 *x, s16 *y) { u16 *varCruiseStepCount = GetVarPointer(VAR_CRUISE_STEP_COUNT); - switch (*GetVarPointer(VAR_PORTHOLE)) + switch (*GetVarPointer(VAR_PORTHOLE_STATE)) { case 1: case 8: @@ -312,28 +312,23 @@ u8 GetLinkPartnerNames(void) return nLinkPlayers; } -const u8 gUnknown_083F8358[4] = {7, 9, 8, 10}; -const s8 gUnknown_083F835C[4][2] = { - { 0, 1}, - { 1, 0}, - { 0, -1}, - {-1, 0} -}; - void SpawnBerryBlenderLinkPlayerSprites(void) { - u8 unknown_083F8358[4]; - u8 unknown_083F835C[4][2]; + u8 j = 0; + s16 x = 0; + s16 y = 0; + u8 unknown_083F8358[] = {7, 9, 8, 10}; + s8 unknown_083F835C[][2] = { + { 0, 1}, + { 1, 0}, + { 0, -1}, + {-1, 0} + }; u8 myLinkPlayerNumber; u8 playerDirectionLowerNybble; u8 rivalAvatarGraphicsId; u8 i; - u8 j = 0; - s16 x = 0; - s16 y = 0; - memcpy(unknown_083F8358, gUnknown_083F8358, sizeof gUnknown_083F8358); - memcpy(unknown_083F835C, gUnknown_083F835C, sizeof gUnknown_083F835C); myLinkPlayerNumber = sub_8008218(); playerDirectionLowerNybble = player_get_direction_lower_nybble(); switch (playerDirectionLowerNybble) @@ -362,7 +357,7 @@ void SpawnBerryBlenderLinkPlayerSprites(void) if (myLinkPlayerNumber != i) { rivalAvatarGraphicsId = GetRivalAvatarGraphicsIdByStateIdAndGender(0, gLinkPlayers[i].gender); - SpawnSpecialFieldObjectParametrized(rivalAvatarGraphicsId, unknown_083F8358[j], 0xf0 - i, (s8)unknown_083F835C[j][0] + x + 7, (s8)unknown_083F835C[j][1] + y + 7, 0); + SpawnSpecialFieldObjectParametrized(rivalAvatarGraphicsId, unknown_083F8358[j], 0xf0 - i, unknown_083F835C[j][0] + x + 7, unknown_083F835C[j][1] + y + 7, 0); j++; if (j == 4) { @@ -693,7 +688,7 @@ void GetRivalSonDaughterString(void) } } -u8 sub_810E300(void) +u8 GetBattleOutcome(void) { return gBattleOutcome; } @@ -963,11 +958,11 @@ void EndLotteryCornerComputerEffect(void) } static void sub_810E874(void); -void sub_810E944(void); +void DisplayCurrentElevatorFloor(void); void sub_810E984(u8); bool8 sub_810EAC8(u8, u8); void sub_810EB90(u8, u8); -void sub_810EBEC(void); +void ShakeScreenInElevator(void); void sub_810EC34(u8); void sub_810EC9C(u8); void sub_810ECB0(void); @@ -1079,11 +1074,11 @@ static void sub_810E874(void) { MenuPrint(gUnknown_083F8380[gUnknown_03000760[i].var0], 1, 2 * i + 1); } - sub_810E944(); + DisplayCurrentElevatorFloor(); CreateTask(sub_810E984, 8); } -void sub_810E944(void) +void DisplayCurrentElevatorFloor(void) { MenuDrawTextWindow(20, 0, 29, 5); sub_8072BD8(gOtherText_NowOn, 21, 1, 64); @@ -1121,7 +1116,7 @@ void sub_810E984(u8 taskId) { gSpecialVar_Result = 1; gSpecialVar_0x8005 = gUnknown_0203925B; - sub_810EBEC(); + ShakeScreenInElevator(); FieldObjectTurnByLocalIdAndMap(gSpecialVar_LastTalked, gSaveBlock1.location.mapNum, gSaveBlock1.location.mapGroup, DIR_SOUTH); sub_810EEDC(); MenuZeroFillScreen(); @@ -1305,7 +1300,7 @@ void sub_810EB90(u8 newPos, u8 maxItems) } } -void sub_810EBEC(void) +void ShakeScreenInElevator(void) { u8 taskId = CreateTask(sub_810EC34, 9); gTasks[taskId].data[0] = 1; @@ -1784,12 +1779,12 @@ void GetSecretBaseNearbyMapName(void) GetMapSectionName(gStringVar1, VarGet(VAR_SECRET_BASE_MAP), 0); } -u16 sub_810F404(void) +u16 GetBestBattleTowerStreak(void) { return GetGameStat(GAME_STAT_BATTLE_TOWER_BEST_STREAK); } -void sub_810F414(void) +void BufferEReaderTrainerName(void) { SetEReaderTrainerName(gStringVar1); } @@ -1798,7 +1793,7 @@ const u8 gUnknown_083F83E0[] = {12, 2, 4, 5, 1, 8, 7, 11, 3, 10, 9, 6}; const u8 gUnknown_083F83EC[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5}; const u8 gUnknown_083F83F8[] = {3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5}; -u8 sub_810F424(void) +u8 GetSlotMachineId(void) { u32 v0 = gSaveBlock1.easyChatPairs[0].unk0_0 + gSaveBlock1.easyChatPairs[0].unk2 + gUnknown_083F83E0[gSpecialVar_0x8004]; if (GetPriceReduction(2)) @@ -1808,10 +1803,10 @@ u8 sub_810F424(void) return gUnknown_083F83EC[v0 % 12]; } -bool8 sub_810F488(void) +bool8 FoundAbandonedShipRoom1Key(void) { u16 *specVar = &gSpecialVar_0x8004; - u16 flag = 0x277; + u16 flag = FLAG_HIDDEN_ITEM_1F; *specVar = flag; if (!FlagGet(flag)) { @@ -1820,10 +1815,10 @@ bool8 sub_810F488(void) return TRUE; } -bool8 sub_810F4B0(void) +bool8 FoundAbandonedShipRoom2Key(void) { u16 *specVar = &gSpecialVar_0x8004; - u16 flag = 0x278; + u16 flag = FLAG_HIDDEN_ITEM_20; *specVar = flag; if (!FlagGet(flag)) { @@ -1832,10 +1827,10 @@ bool8 sub_810F4B0(void) return TRUE; } -bool8 sub_810F4D4(void) +bool8 FoundAbandonedShipRoom4Key(void) { u16 *specVar = &gSpecialVar_0x8004; - u16 flag = 0x279; + u16 flag = FLAG_HIDDEN_ITEM_21; *specVar = flag; if (!FlagGet(flag)) { @@ -1844,10 +1839,10 @@ bool8 sub_810F4D4(void) return TRUE; } -bool8 sub_810F4FC(void) +bool8 FoundAbandonedShipRoom6Key(void) { u16 *specVar = &gSpecialVar_0x8004; - u16 flag = 0x27a; + u16 flag = FLAG_HIDDEN_ITEM_22; *specVar = flag; if (!FlagGet(flag)) { @@ -1879,18 +1874,18 @@ bool8 ScrSpecial_AreLeadMonEVsMaxedOut(void) return FALSE; } -u8 sub_810F5BC(void) +u8 TryUpdateRusturfTunnelState(void) { if (!FlagGet(FLAG_RUSTURF_TUNNEL_OPENED) && gSaveBlock1.location.mapGroup == MAP_GROUP(RUSTURF_TUNNEL) && gSaveBlock1.location.mapNum == MAP_NUM(RUSTURF_TUNNEL)) { if (FlagGet(FLAG_HIDE_RUSTURF_TUNNEL_ROCK_1)) { - VarSet(VAR_0x409a, 4); + VarSet(VAR_RUSTURF_TUNNEL_STATE, 4); return TRUE; } else if (FlagGet(FLAG_HIDE_RUSTURF_TUNNEL_ROCK_2)) { - VarSet(VAR_0x409a, 5); + VarSet(VAR_RUSTURF_TUNNEL_STATE, 5); return TRUE; } } @@ -1919,7 +1914,7 @@ void PutZigzagoonInPlayerParty(void) bool8 IsStarterInParty(void) { u8 i; - u16 starter = GetStarterPokemon(VarGet(VAR_FIRST_POKE)); + u16 starter = GetStarterPokemon(VarGet(VAR_STARTER_MON)); u8 partyCount = CalculatePlayerPartyCount(); for (i = 0; i < partyCount; i++) { @@ -2000,9 +1995,9 @@ static void sub_810F814(u8 taskId) EnableBothScriptContexts(); } -bool8 sub_810F828(void) +bool8 FoundBlackGlasses(void) { - return FlagGet(FLAG_UNKNOWN_2B8); + return FlagGet(FLAG_HIDDEN_ITEM_BLACK_GLASSES); } void SetRoute119Weather(void) @@ -2045,10 +2040,10 @@ void sub_810F8FC(void) sub_805ADDC(6); } -u16 sub_810F908(void) +u16 GetDaysUntilPacifidlogTMAvailable(void) { - u16 var40c2 = VarGet(VAR_0x40C2); - if (gLocalTime.days - var40c2 >= 7) + u16 tmReceivedDay = VarGet(VAR_PACIFIDLOG_TM_RECEIVED_DAY); + if (gLocalTime.days - tmReceivedDay >= 7) { return 0; } @@ -2056,16 +2051,16 @@ u16 sub_810F908(void) { return 8; } - return 7 - (gLocalTime.days - var40c2); + return 7 - (gLocalTime.days - tmReceivedDay); } -u16 sub_810F950(void) +u16 SetPacifidlogTMReceivedDay(void) { - VarSet(VAR_0x40C2, gLocalTime.days); + VarSet(VAR_PACIFIDLOG_TM_RECEIVED_DAY, gLocalTime.days); return gLocalTime.days; } -bool8 sub_810F96C(void) +bool8 MonOTNameMatchesPlayer(void) { GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_OT_NAME, gStringVar1); if (!StringCompareWithoutExtCtrlCodes(gSaveBlock2.playerName, gStringVar1)) @@ -2075,7 +2070,7 @@ bool8 sub_810F96C(void) return TRUE; } -void sub_810F9AC(void) +void BufferLottoTicketNumber(void) { if (gSpecialVar_Result >= 10000) { @@ -2114,64 +2109,64 @@ const u8 gUnknown_083F8408[] = {8, 9, 10, 11, 12, 13, 14, 15}; const u8 gUnknown_083F8410[] = {8, 13, 14, 11, 10, 12, 15, 9}; bool8 sub_810FF30(void); -void sub_810FCE8(void); +void UpdateMovedLilycoveFanClubMembers(void); void sub_810FF48(void); void sub_810FD80(void); -u16 sub_810FCB0(void); +u16 GetNumMovedLilycoveFanClubMembers(void); int sub_810FB9C(void); void ResetFanClub(void) { - gSaveBlock1.vars[0x41] = 0; - gSaveBlock1.vars[0x42] = 0; + gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] = 0; + gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_2 - VARS_START] = 0; } void sub_810FA74(void) { if (sub_810FF30()) { - sub_810FCE8(); - gSaveBlock1.vars[0x42] = gSaveBlock2.playTimeHours; + UpdateMovedLilycoveFanClubMembers(); + gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_2 - VARS_START] = gSaveBlock2.playTimeHours; } } void sub_810FAA0(void) { - if (!((gSaveBlock1.vars[0x41] >> 7) & 1)) + if (!((gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] >> 7) & 1)) { sub_810FF48(); sub_810FD80(); - gSaveBlock1.vars[0x42] = gSaveBlock2.playTimeHours; - FlagClear(0x315); - FlagClear(0x316); - FlagClear(0x317); - FlagClear(0x318); - VarSet(VAR_0x4095, 1); + gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_2 - VARS_START] = gSaveBlock2.playTimeHours; + FlagClear(FLAG_HIDE_FANCLUB_OLD_LADY); + FlagClear(FLAG_HIDE_FANCLUB_BOY); + FlagClear(FLAG_HIDE_FANCLUB_LITTLE_BOY); + FlagClear(FLAG_HIDE_FANCLUB_LADY); + VarSet(VAR_LILYCOVE_FAN_CLUB_STATE, 1); } } u8 sub_810FB10(u8 a0) { - if (VarGet(VAR_0x4095) == 2) + if (VarGet(VAR_LILYCOVE_FAN_CLUB_STATE) == 2) { - if ((gSaveBlock1.vars[0x41] & 0x7f) + gUnknown_083F8404[a0] >= 20) + if ((gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] & 0x7f) + gUnknown_083F8404[a0] >= 20) { - if (sub_810FCB0() < 3) + if (GetNumMovedLilycoveFanClubMembers() < 3) { sub_810FB9C(); - gSaveBlock1.vars[0x41] &= 0xff80; + gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] &= 0xff80; } else { - gSaveBlock1.vars[0x41] = (gSaveBlock1.vars[0x41] & 0xff80) | 20; + gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] = (gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] & 0xff80) | 20; } } else { - gSaveBlock1.vars[0x41] += gUnknown_083F8404[a0]; + gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] += gUnknown_083F8404[a0]; } } - return gSaveBlock1.vars[0x41] & 0x7f; + return gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] & 0x7f; } int sub_810FB9C(void) @@ -2180,17 +2175,17 @@ int sub_810FB9C(void) int retval = 0; for (i=0; i<8; i++) { - if (!((gSaveBlock1.vars[0x41] >> gUnknown_083F8408[i]) & 0x01)) + if (!((gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] >> gUnknown_083F8408[i]) & 0x01)) { retval = i; if (Random() & 1) { - gSaveBlock1.vars[0x41] |= (1 << gUnknown_083F8408[i]); + gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] |= (1 << gUnknown_083F8408[i]); return retval; } } } - gSaveBlock1.vars[0x41] |= (1 << gUnknown_083F8408[retval]); + gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] |= (1 << gUnknown_083F8408[retval]); return retval; } @@ -2198,85 +2193,86 @@ int sub_810FC18(void) { u8 i; int retval = 0; - if (sub_810FCB0() == TRUE) + if (GetNumMovedLilycoveFanClubMembers() == 1) { return 0; } for (i=0; i<8; i++) { - if ((gSaveBlock1.vars[0x41] >> gUnknown_083F8410[i]) & 1) + if ((gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] >> gUnknown_083F8410[i]) & 1) { retval = i; if (Random() & 1) { - gSaveBlock1.vars[0x41] ^= (1 << gUnknown_083F8410[i]); + gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] ^= (1 << gUnknown_083F8410[i]); return retval; } } } - if ((gSaveBlock1.vars[0x41] >> gUnknown_083F8410[retval]) & 1) + if ((gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] >> gUnknown_083F8410[retval]) & 1) { - gSaveBlock1.vars[0x41] ^= (1 << gUnknown_083F8410[retval]); + gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] ^= (1 << gUnknown_083F8410[retval]); } return retval; } -u16 sub_810FCB0(void) +u16 GetNumMovedLilycoveFanClubMembers(void) { u8 i; u8 retval = 0; - for (i=0; i<8; i++) + for (i = 0; i < 8; i++) { - if ((gSaveBlock1.vars[0x41] >> (i + 8)) & 1) + if ((gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] >> (i + 8)) & 1) { - retval ++; + retval++; } } + return retval; } -void sub_810FCE8(void) +void UpdateMovedLilycoveFanClubMembers(void) { u8 i = 0; if (gSaveBlock2.playTimeHours < 999) { while (1) { - if (sub_810FCB0() < 5) + if (GetNumMovedLilycoveFanClubMembers() < 5) { - gSaveBlock1.vars[0x42] = gSaveBlock2.playTimeHours; + gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_2 - VARS_START] = gSaveBlock2.playTimeHours; break; } else if (i == 8) { break; } - else if (gSaveBlock2.playTimeHours - gSaveBlock1.vars[0x42] < 12) + else if (gSaveBlock2.playTimeHours - gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_2 - VARS_START] < 12) { return; } sub_810FC18(); - gSaveBlock1.vars[0x42] += 12; + gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_2 - VARS_START] += 12; i++; } } } -bool8 sub_810FD60(void) +bool8 ShouldMoveLilycoveFanClubMember(void) { - return (gSaveBlock1.vars[0x41] >> gSpecialVar_0x8004) & 0x01; + return (gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] >> gSpecialVar_0x8004) & 0x01; } void sub_810FD80(void) { - gSaveBlock1.vars[0x41] |= 0x2000; - gSaveBlock1.vars[0x41] |= 0x100; - gSaveBlock1.vars[0x41] |= 0x400; + gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] |= 0x2000; + gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] |= 0x100; + gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] |= 0x400; } void sub_810FE1C(void *, u8, u8); -void sub_810FDAC(void) +void BufferStreakTrainerText(void) { u8 a = 0; u8 b = 0; @@ -2355,7 +2351,7 @@ void sub_810FE1C(void *linkRecords, u8 a, u8 b) void sub_810FEFC(void) { - if (VarGet(VAR_0x4095) == 2) + if (VarGet(VAR_LILYCOVE_FAN_CLUB_STATE) == 2) { sub_810FA74(); if (gBattleOutcome == 1) @@ -2371,12 +2367,12 @@ void sub_810FEFC(void) bool8 sub_810FF30(void) { - return (gSaveBlock1.vars[0x41] >> 7) & 0x01; + return (gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] >> 7) & 0x01; } void sub_810FF48(void) { - gSaveBlock1.vars[0x41] |= 0x80; + gSaveBlock1.vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] |= 0x80; } u8 sub_810FF60(void) diff --git a/src/field/field_tasks.c b/src/field/field_tasks.c index 108ba64ba..ce5fc6c0e 100644 --- a/src/field/field_tasks.c +++ b/src/field/field_tasks.c @@ -554,20 +554,20 @@ const u16 gUnknown_083763E4[] = { 0, 0, 0, - VAR_0x4001, - VAR_0x4002, - VAR_0x4003, - VAR_0x4004, + VAR_TEMP_1, + VAR_TEMP_2, + VAR_TEMP_3, + VAR_TEMP_4, 0, 0, - VAR_0x4005, - VAR_0x4006, - VAR_0x4007, + VAR_TEMP_5, + VAR_TEMP_6, + VAR_TEMP_7, 0, 0, - VAR_0x4008, - VAR_0x4009, - VAR_0x400A, + VAR_TEMP_8, + VAR_TEMP_9, + VAR_TEMP_A, 0, 0, 0, @@ -608,14 +608,14 @@ bool32 sub_8069D34(s16 x, s16 y) return FALSE; } -void sub_8069D78(void) +void SetSootopolisGymCrackedIceMetatiles(void) { s32 x, y; s32 width = gMapHeader.mapData->width; s32 height = gMapHeader.mapData->height; - for (x=0; x<width; x++) + for (x = 0; x < width; x++) { - for (y=0; y<height; y++) + for (y = 0; y < height; y++) { if (sub_8069D34(x, y) == TRUE) { diff --git a/src/field/field_weather.c b/src/field/field_weather.c index 19ccca3bf..4a819bddf 100644 --- a/src/field/field_weather.c +++ b/src/field/field_weather.c @@ -5,6 +5,7 @@ #include "palette.h" #include "random.h" #include "script.h" +#include "constants/weather.h" #include "constants/songs.h" #include "sound.h" #include "sprite.h" @@ -397,31 +398,31 @@ void sub_807CCAC(void) case WEATHER_RAIN_MED: case WEATHER_RAIN_HEAVY: case WEATHER_SNOW: - case 11: + case WEATHER_DARK: if (sub_807CDC4() == 0) { gWeatherPtr->unknown_6C0 = 3; gWeatherPtr->unknown_6C6 = 3; } break; - case 12: + case WEATHER_DROUGHT: if (sub_807CE24() == 0) { gWeatherPtr->unknown_6C0 = -6; gWeatherPtr->unknown_6C6 = 3; } break; - case 6: + case WEATHER_FOG_1: if (sub_807CE7C() == 0) { gWeatherPtr->unknown_6C0 = 0; gWeatherPtr->unknown_6C6 = 3; } break; - case 7: - case 8: - case 9: - case 10: + case WEATHER_ASH: + case WEATHER_SANDSTORM: + case WEATHER_FOG_2: + case WEATHER_FOG_3: default: if (!gPaletteFade.active) { @@ -807,9 +808,9 @@ void fade_screen(u8 a, u8 delay) case WEATHER_RAIN_MED: case WEATHER_RAIN_HEAVY: case WEATHER_SNOW: - case 6: - case 11: - case 12: + case WEATHER_FOG_1: + case WEATHER_DARK: + case WEATHER_DROUGHT: r2 = 1; break; default: @@ -854,7 +855,7 @@ void sub_807D78C(u8 a) case 1: if (gWeatherPtr->unknown_6CA != 0) { - if (gWeatherPtr->currWeather == 6) + if (gWeatherPtr->currWeather == WEATHER_FOG_1) sub_807D540(r4); r4 *= 16; for (i = 0; i < 16; i++) @@ -867,7 +868,7 @@ void sub_807D78C(u8 a) BlendPalette(r4, 16, gPaletteFade.y, gPaletteFade.blendColor); break; default: - if (gWeatherPtr->currWeather != 6) + if (gWeatherPtr->currWeather != WEATHER_FOG_1) { sub_807CEBC(r4, 1, gWeatherPtr->unknown_6C0); } diff --git a/src/field/field_weather_effects.c b/src/field/field_weather_effects.c index 31eda4393..5a59d6c2a 100644 --- a/src/field/field_weather_effects.c +++ b/src/field/field_weather_effects.c @@ -4,6 +4,7 @@ #include "overworld.h" #include "random.h" #include "script.h" +#include "constants/weather.h" #include "constants/songs.h" #include "sound.h" #include "sprite.h" diff --git a/src/field/fldeff_secret_base_pc.c b/src/field/fldeff_secret_base_pc.c index 8d71a4fb9..394c4bc56 100644 --- a/src/field/fldeff_secret_base_pc.c +++ b/src/field/fldeff_secret_base_pc.c @@ -60,7 +60,7 @@ void DoSecretBasePCTurnOffEffect(void) GetXYCoordsOneStepInFrontOfPlayer(&x, &y); PlaySE(SE_PC_OFF); - if (!VarGet(VAR_0x4054)) + if (!VarGet(VAR_CURRENT_SECRET_BASE)) MapGridSetMetatileIdAt(x, y, 3616); else MapGridSetMetatileIdAt(x, y, 3617); diff --git a/src/field/item_menu.c b/src/field/item_menu.c index 4e283ffe9..e9b8b24d3 100644 --- a/src/field/item_menu.c +++ b/src/field/item_menu.c @@ -153,7 +153,7 @@ static const u8 *sPopupMenuActionList; // common void (*gFieldItemUseCallback)(u8) = NULL; -extern u16 gUnknown_030041B4; +extern u16 gBattle_BG1_Y; extern struct PocketScrollState gBagPocketScrollStates[]; extern struct ItemSlot *gCurrentBagPocketItemSlots; // selected pocket item slots extern const u8 Event_NoRegisteredItem[]; @@ -4499,7 +4499,7 @@ u8 CreateBerrySprite(u8 berryId, s16 x, s16 y) static void SpriteCB_BerrySprite(struct Sprite *sprite) { - sprite->pos2.y = -gUnknown_030041B4; + sprite->pos2.y = -gBattle_BG1_Y; } void sub_80A7DD4(void) diff --git a/src/field/item_use.c b/src/field/item_use.c index 37cd8ba78..e1fdddce0 100644 --- a/src/field/item_use.c +++ b/src/field/item_use.c @@ -14,6 +14,7 @@ #include "fieldmap.h" #include "item.h" #include "item_menu.h" +#include "constants/flags.h" #include "constants/items.h" #include "mail.h" #include "main.h" @@ -328,7 +329,7 @@ bool8 ItemfinderCheckForHiddenItems(struct MapEvents *events, u8 taskId) for (i = 0; i < events->bgEventCount; i++) { - if ((events -> bgEvents[i].kind == 7) && !FlagGet(events -> bgEvents[i].bgUnion.hiddenItem.hiddenItemId + 600)) + if ((events -> bgEvents[i].kind == 7) && !FlagGet(events -> bgEvents[i].bgUnion.hiddenItem.hiddenItemId + FLAG_HIDDEN_ITEMS_START)) { // do a distance lookup of each item so long as the index remains less than the objects on the current map. distanceX = (u16)events -> bgEvents[i].x + 7; @@ -360,7 +361,7 @@ bool8 HiddenItemAtPos(struct MapEvents *events, s16 x, s16 y) { if (bgEvent[i].kind == 7 && x == (u16)bgEvent[i].x && y == (u16)bgEvent[i].y) // hidden item and coordinates matches x and y passed? { - if (!FlagGet(bgEvent[i].bgUnion.hiddenItem.hiddenItemId + 600)) + if (!FlagGet(bgEvent[i].bgUnion.hiddenItem.hiddenItemId + FLAG_HIDDEN_ITEMS_START)) return TRUE; else return FALSE; @@ -921,7 +922,7 @@ static void PrepareItemUseMessage(void) void ItemUseOutOfBattle_Repel(u8 var) { - if (VarGet(VAR_REPEL_STEP_COUNT) == FALSE) + if (VarGet(VAR_REPEL_STEP_COUNT) == 0) { VarSet(VAR_REPEL_STEP_COUNT, ItemId_GetHoldEffectParam(gSpecialVar_ItemId)); PrepareItemUseMessage(); diff --git a/src/field/lottery_corner.c b/src/field/lottery_corner.c index 83febc56e..03de26054 100644 --- a/src/field/lottery_corner.c +++ b/src/field/lottery_corner.c @@ -30,7 +30,7 @@ void ResetLotteryCorner(void) u16 rand = Random(); SetLotteryNumber((Random() << 16) | rand); - VarSet(VAR_POKELOT_PRIZE, 0); + VarSet(VAR_LOTTERY_PRIZE, 0); } void SetRandomLotteryNumber(u16 i) @@ -152,19 +152,19 @@ static u8 GetMatchingDigits(u16 winNumber, u16 otId) // lottery numbers go from 0 to 99999, not 65535 (0xFFFF). interestingly enough, the function that calls GetLotteryNumber shifts to u16, so it cant be anything above 65535 anyway. void SetLotteryNumber(u32 lotteryNum) { - u16 lowNum = lotteryNum >> 16; - u16 highNum = lotteryNum; + u16 high = lotteryNum >> 16; + u16 low = lotteryNum; - VarSet(VAR_POKELOT_RND1, highNum); - VarSet(VAR_POKELOT_RND2, lowNum); + VarSet(VAR_LOTTERY_RND_L, low); + VarSet(VAR_LOTTERY_RND_H, high); } u32 GetLotteryNumber(void) { - u16 highNum = VarGet(VAR_POKELOT_RND1); - u16 lowNum = VarGet(VAR_POKELOT_RND2); + u16 low = VarGet(VAR_LOTTERY_RND_L); + u16 high = VarGet(VAR_LOTTERY_RND_H); - return (lowNum << 16) | highNum; + return (high << 16) | low; } // interestingly, this may have been the original lottery number set function, but GF tried to change it to 32-bit later but didnt finish changing all calls as one GetLotteryNumber still shifts to u16. diff --git a/src/field/map_name_popup.c b/src/field/map_name_popup.c index 01105d0db..2e2dfc72e 100644 --- a/src/field/map_name_popup.c +++ b/src/field/map_name_popup.c @@ -19,7 +19,7 @@ bool8 unref_sub_80A2F44(void) void ShowMapNamePopup(void) { - if (FlagGet(0x4000) != TRUE) + if (FlagGet(FLAG_SPECIAL_FLAG_0) != TRUE) { if (!FuncIsActiveTask(Task_MapNamePopup)) { diff --git a/src/field/mauville_man.c b/src/field/mauville_man.c index 30f6f5233..4db513f65 100644 --- a/src/field/mauville_man.c +++ b/src/field/mauville_man.c @@ -10,6 +10,7 @@ #include "overworld.h" #include "random.h" #include "script.h" +#include "constants/map_objects.h" #include "constants/songs.h" #include "sound.h" #include "string_util.h" @@ -974,7 +975,7 @@ static void Task_BardSong(u8 taskId) void sub_80F83D0(void) { - VarSet(0x4010, 0x45 + GetCurrentMauvilleOldMan()); + VarSet(VAR_OBJ_GFX_ID_0, MAP_OBJ_GFX_BARD + GetCurrentMauvilleOldMan()); } struct Story diff --git a/src/field/money.c b/src/field/money.c index f277ac905..d0f0ab1f6 100644 --- a/src/field/money.c +++ b/src/field/money.c @@ -291,12 +291,12 @@ void CloseMoneyWindow(u8 x, u8 y) MenuZeroFillWindowRect(x, y, x + 13, y + 3); } -bool8 sub_80B7CE8(void) +bool8 HasEnoughMoneyFor(void) { return IsEnoughMoney(gSaveBlock1.money, gSpecialVar_0x8005); } -void sub_80B7D0C(void) +void PayMoneyFor(void) { RemoveMoney(&gSaveBlock1.money, gSpecialVar_0x8005); } diff --git a/src/field/overworld.c b/src/field/overworld.c index 834a2afa4..e239daec7 100644 --- a/src/field/overworld.c +++ b/src/field/overworld.c @@ -287,7 +287,7 @@ void LoadMapObjTemplatesFromHeader(void) { // Clear map object templates CpuFill32(0, gSaveBlock1.mapObjectTemplates, sizeof(gSaveBlock1.mapObjectTemplates)); - + // Copy map header events to save block CpuCopy32(gMapHeader.events->mapObjects, gSaveBlock1.mapObjectTemplates, @@ -600,7 +600,7 @@ void sub_80538F0(u8 mapGroup, u8 mapNum) ClearTempFieldEventData(); ResetCyclingRoadChallengeData(); prev_quest_postbuffer_cursor_backup_reset(); - sub_8082BD0(mapGroup, mapNum); + TryUpdateRandomTrainerRematches(mapGroup, mapNum); DoTimeBasedEvents(); SetSav1WeatherFromCurrMapHeader(); ChooseAmbientCrySpecies(); @@ -635,7 +635,7 @@ void sub_8053994(u32 a1) ClearTempFieldEventData(); ResetCyclingRoadChallengeData(); prev_quest_postbuffer_cursor_backup_reset(); - sub_8082BD0(gSaveBlock1.location.mapGroup, gSaveBlock1.location.mapNum); + TryUpdateRandomTrainerRematches(gSaveBlock1.location.mapGroup, gSaveBlock1.location.mapNum); if (a1 != 1) DoTimeBasedEvents(); SetSav1WeatherFromCurrMapHeader(); @@ -816,7 +816,7 @@ static bool16 ShouldLegendaryMusicPlayAtLocation(struct WarpData *warp) static bool16 IsInfiltratedWeatherInstitute(struct WarpData *warp) { - if (VarGet(VAR_WEATHER_INSTITUTE_CLEARED)) + if (VarGet(VAR_WEATHER_INSTITUTE_STATE)) return FALSE; if (warp->mapGroup != MAP_GROUP(ROUTE119_WEATHER_INSTITUTE_1F)) return FALSE; @@ -981,7 +981,7 @@ static void PlayAmbientCry(void) s16 x, y; s8 pan; s8 volume; - + PlayerGetDestCoords(&x, &y); if (sIsAmbientCryWaterMon == TRUE && !MetatileBehavior_IsSurfableWaterOrUnderwater(MapGridGetMetatileBehaviorAt(x, y))) @@ -1158,7 +1158,7 @@ void OverworldBasic(void) sub_8072EDC(); } -// This CB2 is used when starting +// This CB2 is used when starting void CB2_OverworldBasic(void) { OverworldBasic(); @@ -1329,7 +1329,7 @@ void sub_805465C(void) void sub_805469C(void) { FieldClearVBlankHBlankCallbacks(); - gFieldCallback = atk17_seteffectuser; + gFieldCallback = atk17_seteffectsecondary; c2_exit_to_overworld_2_switch(); } @@ -2430,7 +2430,7 @@ void SpawnLinkPlayerMapObject(u8 linkPlayerId, s16 x, s16 y, u8 a4) mapObj->active = 1; mapObj->mapobj_bit_1 = a4; - mapObj->mapobj_unk_19 = 2; + mapObj->range.as_byte = 2; mapObj->spriteId = 64; InitLinkPlayerMapObjectPos(mapObj, x, y); @@ -2453,7 +2453,7 @@ void unref_sub_8055A6C(u8 linkPlayerId, u8 a2) { u8 mapObjId = gLinkPlayerMapObjects[linkPlayerId].mapObjId; struct MapObject *mapObj = &gMapObjects[mapObjId]; - mapObj->mapobj_unk_19 = a2; + mapObj->range.as_byte = a2; } } @@ -2487,7 +2487,7 @@ u8 sub_8055B30(u8 linkPlayerId) { u8 mapObjId = gLinkPlayerMapObjects[linkPlayerId].mapObjId; struct MapObject *mapObj = &gMapObjects[mapObjId]; - return mapObj->mapobj_unk_19; + return mapObj->range.as_byte; } u8 sub_8055B50(u8 linkPlayerId) @@ -2559,10 +2559,10 @@ static u8 sub_8055CB0(struct LinkPlayerMapObject *linkPlayerMapObj, struct MapOb { s16 x, y; - mapObj->mapobj_unk_19 = npc_something3(a3, mapObj->mapobj_unk_19); - FieldObjectMoveDestCoords(mapObj, mapObj->mapobj_unk_19, &x, &y); + mapObj->range.as_byte = npc_something3(a3, mapObj->range.as_byte); + FieldObjectMoveDestCoords(mapObj, mapObj->range.as_byte, &x, &y); - if (LinkPlayerDetectCollision(linkPlayerMapObj->mapObjId, mapObj->mapobj_unk_19, x, y)) + if (LinkPlayerDetectCollision(linkPlayerMapObj->mapObjId, mapObj->range.as_byte, x, y)) { return 0; } @@ -2577,7 +2577,7 @@ static u8 sub_8055CB0(struct LinkPlayerMapObject *linkPlayerMapObj, struct MapOb static u8 sub_8055D18(struct LinkPlayerMapObject *linkPlayerMapObj, struct MapObject *mapObj, u8 a3) { - mapObj->mapobj_unk_19 = npc_something3(a3, mapObj->mapobj_unk_19); + mapObj->range.as_byte = npc_something3(a3, mapObj->range.as_byte); return 0; } @@ -2590,7 +2590,7 @@ static void sub_8055D38(struct LinkPlayerMapObject *linkPlayerMapObj, struct Map { mapObj->mapobj_unk_21--; linkPlayerMapObj->mode = 1; - MoveCoords(mapObj->mapobj_unk_19, &mapObj->coords1.x, &mapObj->coords1.y); + MoveCoords(mapObj->range.as_byte, &mapObj->coords1.x, &mapObj->coords1.y); if (!mapObj->mapobj_unk_21) { npc_coords_shift_still(mapObj); @@ -2662,9 +2662,9 @@ void SpriteCB_LinkPlayer(struct Sprite *sprite) SetObjectSubpriorityByZCoord(mapObj->elevation, sprite, 1); sprite->oam.priority = ZCoordToPriority(mapObj->elevation); if (!linkPlayerMapObj->mode) - StartSpriteAnim(sprite, FieldObjectDirectionToImageAnimId(mapObj->mapobj_unk_19)); + StartSpriteAnim(sprite, FieldObjectDirectionToImageAnimId(mapObj->range.as_byte)); else - StartSpriteAnimIfDifferent(sprite, get_go_image_anim_num(mapObj->mapobj_unk_19)); + StartSpriteAnimIfDifferent(sprite, get_go_image_anim_num(mapObj->range.as_byte)); sub_806487C(sprite, 0); if (mapObj->mapobj_bit_2) { diff --git a/src/field/party_menu.c b/src/field/party_menu.c index 089f93f9e..9c1150515 100644 --- a/src/field/party_menu.c +++ b/src/field/party_menu.c @@ -436,34 +436,6 @@ static const struct PartyMenuHandlersStruct PartyMenuHandlers[] = { {HandleMoveTutorPartyMenu, SetupMoveTutorPartyMenu, 0}, // PARTY_MENU_TYPE_MOVE_TUTOR }; -static const u16 gUnknown_08376CD4[] = { - 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, - 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, -}; - -static const u16 gUnknown_08376CEC[] = { - 0x2A, 0x0B, 0x0C, 0x0D, 0x0E, 0x2F, - 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, -}; - -static const u8 *const StatNames[] = { - gOtherText_HP, - gOtherText_Attack, - gOtherText_Defense, - gOtherText_SpAtk, - gOtherText_SpDef, - gOtherText_Speed, -}; - -static const u8 StatDataTypes[] = { - MON_DATA_MAX_HP, - MON_DATA_ATK, - MON_DATA_DEF, - MON_DATA_SPATK, - MON_DATA_SPDEF, - MON_DATA_SPEED, -}; - struct Unk201C000 { /*0x00*/ struct Pokemon *pokemon; @@ -1227,12 +1199,11 @@ void sub_806BB3C(s16 a, u16 b) void sub_806BB9C(u8 a) { u8 i; - u16 *vramPtr; - const u16 arr[12]; - - memcpy(&arr, gUnknown_08376CD4, sizeof gUnknown_08376CD4); - - vramPtr = (u16 *)(BG_VRAM + 0x3C30); + u16 arr[12] = { + 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + }; + u16 *vramPtr = (u16 *)(BG_VRAM + 0x3C30); for (i = 0; i < PARTY_SIZE; i++) { vramPtr[i] = arr[i] + (a << 12); @@ -1243,12 +1214,11 @@ void sub_806BB9C(u8 a) void sub_806BBEC(u8 a) { u8 i; - u16 *vramPtr; - const u16 arr[12]; - - memcpy(&arr, gUnknown_08376CEC, sizeof gUnknown_08376CEC); - - vramPtr = (u16 *)(BG_VRAM + 0x3CB0); + u16 arr[12] = { + 0x2A, 0x0B, 0x0C, 0x0D, 0x0E, 0x2F, + 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, + }; + u16 *vramPtr = (u16 *)(BG_VRAM + 0x3CB0); for (i = 0; i < PARTY_SIZE; i++) { vramPtr[i] = arr[i] + (a << 12); @@ -4910,6 +4880,23 @@ void DoPPUpItemEffect(u8 taskId, u16 b, TaskFunc c) gMain.newKeys = 0; } +static const u8 *const StatNames[] = { + gOtherText_HP, + gOtherText_Attack, + gOtherText_Defense, + gOtherText_SpAtk, + gOtherText_SpDef, + gOtherText_Speed, +}; + +static const u8 StatDataTypes[] = { + MON_DATA_MAX_HP, + MON_DATA_ATK, + MON_DATA_DEF, + MON_DATA_SPATK, + MON_DATA_SPDEF, + MON_DATA_SPEED, +}; void DoRareCandyItemEffect(u8 taskId, u16 b, TaskFunc c) { u8 i; diff --git a/src/field/player_pc.c b/src/field/player_pc.c index d92d13ce4..4fef09386 100644 --- a/src/field/player_pc.c +++ b/src/field/player_pc.c @@ -171,15 +171,6 @@ static const u8 gNonSelectedItemQuantityFormatText[] = _("{STR_VAR_1}"); static const u8 gSelectedItemQuantityFormatText[] = _("{COLOR RED}{STR_VAR_1}"); static const u8 gUnknown_08406330[] = _("{CLEAR_TO 32}"); -static const u16 gUnknown_08406334[3] = -{ - 0x5294, - 0x6B5A, - 0x7FFF -}; - -static const u8 gHighlightedMoveToBagFormatText[] = _("{COLOR RED}{STR_VAR_1}"); - extern u8 *gUnknown_02039314; extern struct MenuAction gUnknown_08406298[]; @@ -205,8 +196,8 @@ void NewGameInitPCItems(void) u8 i; // because Game Freak don't know how to use a struct or a 2d array - for(i = 0, ClearItemSlots(gSaveBlock1.pcItems, ARRAY_COUNT(gSaveBlock1.pcItems)); NEW_GAME_PC_ITEMS(i, ITEM_ID) && NEW_GAME_PC_ITEMS(i, QUANTITY) && - AddPCItem(NEW_GAME_PC_ITEMS(i, ITEM_ID), NEW_GAME_PC_ITEMS(i, QUANTITY)) == TRUE; i++) + for(i = 0, ClearItemSlots(gSaveBlock1.pcItems, ARRAY_COUNT(gSaveBlock1.pcItems)); NEW_GAME_PC_ITEMS(i, PC_ITEM_ID) && NEW_GAME_PC_ITEMS(i, PC_QUANTITY) && + AddPCItem(NEW_GAME_PC_ITEMS(i, PC_ITEM_ID), NEW_GAME_PC_ITEMS(i, PC_QUANTITY)) == TRUE; i++) ; } @@ -1007,9 +998,12 @@ static void ItemStorage_GoBackToItemPCMenu(u8 taskId, u8 var) static void ItemStorage_LoadPalette(void) { - u16 arr[3]; + u16 arr[] = { + 0x5294, + 0x6B5A, + 0x7FFF + }; - memcpy(arr, gUnknown_08406334, sizeof(arr)); LoadPalette(&arr[2], 0xDF, 2); LoadPalette(&arr[1], 0xD1, 2); LoadPalette(&arr[0], 0xD8, 2); @@ -1261,6 +1255,8 @@ static void Mailbox_ReturnToFieldFromReadMail(void) SetMainCallback2(c2_exit_to_overworld_2_switch); } +static const u8 gHighlightedMoveToBagFormatText[] = _("{COLOR RED}{STR_VAR_1}"); + static void Mailbox_MoveToBag(u8 taskId) { HandleDestroyMenuCursors(); diff --git a/src/field/pokeblock.c b/src/field/pokeblock.c index 4a904fbb1..640d4731f 100644 --- a/src/field/pokeblock.c +++ b/src/field/pokeblock.c @@ -426,7 +426,7 @@ void sub_810BADC(void) SetMainCallback2(sub_810B96C); } -void sub_810BAF4(void) +void OpenPokeblockCaseOnFeeder(void) { sub_810BA7C(3); SetMainCallback2(sub_810B96C); @@ -1041,7 +1041,7 @@ u8 sub_810C9E8(struct Pokeblock *pokeblock) return feel; } -s8 sub_810CA00(void) +s8 GetFirstFreePokeblockSlot(void) { u8 i; for (i=0; i<ARRAY_COUNT(gSaveBlock1.pokeblocks); i++) @@ -1056,7 +1056,7 @@ s8 sub_810CA00(void) bool8 sub_810CA34(struct Pokeblock *pokeblock) { - s8 idx = sub_810CA00(); + s8 idx = GetFirstFreePokeblockSlot(); if (idx == -1) { return FALSE; diff --git a/src/field/scrcmd.c b/src/field/scrcmd.c index d5fc56e8d..05a909e81 100644 --- a/src/field/scrcmd.c +++ b/src/field/scrcmd.c @@ -1722,7 +1722,7 @@ bool8 ScrCmd_settrainerflag(struct ScriptContext *ctx) { u16 index = VarGet(ScriptReadHalfword(ctx)); - trainer_flag_set(index); + SetTrainerFlag(index); return FALSE; } @@ -1730,7 +1730,7 @@ bool8 ScrCmd_cleartrainerflag(struct ScriptContext *ctx) { u16 index = VarGet(ScriptReadHalfword(ctx)); - trainer_flag_clear(index); + ClearTrainerFlag(index); return FALSE; } diff --git a/src/field/secret_base.c b/src/field/secret_base.c index 7589ab1e3..2e4138a3b 100644 --- a/src/field/secret_base.c +++ b/src/field/secret_base.c @@ -180,7 +180,7 @@ void sub_80BB5E4(void) if (gUnknown_020387DC != gSaveBlock1.secretBases[i].secretBaseId) continue; gSpecialVar_Result = 1; - VarSet(VAR_0x4054, i); + VarSet(VAR_CURRENT_SECRET_BASE, i); break; } } @@ -284,7 +284,7 @@ void sub_80BB8CC(void) for (idx=0; idx<4; idx++) { gSaveBlock1.secretBases[0].trainerId[idx] = gSaveBlock2.playerTrainerId[idx]; } - VarSet(VAR_0x4054, 0); + VarSet(VAR_CURRENT_SECRET_BASE, 0); nameLength = sub_80BB8A8(gSaveBlock2.playerName); memset(gSaveBlock1.secretBases[0].playerName, 0xFF, OT_NAME_LENGTH); StringCopyN(gSaveBlock1.secretBases[0].playerName, gSaveBlock2.playerName, nameLength); @@ -333,7 +333,7 @@ void sub_80BBA48(u8 taskid) } break; case 2: - curbaseid = VarGet(VAR_0x4054); + curbaseid = VarGet(VAR_CURRENT_SECRET_BASE); if (gSaveBlock1.secretBases[curbaseid].sbr_field_10 < 0xff) gSaveBlock1.secretBases[curbaseid].sbr_field_10++; sub_80BBA14(); @@ -412,7 +412,7 @@ void sub_80BBCCC(u8 flagIn) u16 curBaseId; u16 x, y; if (CurrentMapIsSecretBase()) { - curBaseId = VarGet(VAR_0x4054); + curBaseId = VarGet(VAR_CURRENT_SECRET_BASE); for (x=0; x<16; x++) { if (gSaveBlock1.secretBases[curBaseId].decorations[x] > 0 && gSaveBlock1.secretBases[curBaseId].decorations[x] <= 0x78 && gDecorations[gSaveBlock1.secretBases[curBaseId].decorations[x]].permission != DECORPERM_SOLID_MAT) { sub_80FF394((gSaveBlock1.secretBases[curBaseId].decorationPos[x] >> 4) + 7, (gSaveBlock1.secretBases[curBaseId].decorationPos[x] & 0xF) + 7, gSaveBlock1.secretBases[curBaseId].decorations[x]); @@ -437,7 +437,7 @@ void sub_80BBDD0(void) u8 metatile; u8 permission; u8 ndecor; - u16 curBase = VarGet(VAR_0x4054); + u16 curBase = VarGet(VAR_CURRENT_SECRET_BASE); if (!CurrentMapIsSecretBase()) { roomdecor = gSaveBlock1.playerRoomDecor; roomdecorpos = gSaveBlock1.playerRoomDecorPos; @@ -478,8 +478,8 @@ void sub_80BBDD0(void) void sub_80BBFA4(void) { - int curBase = VarGet(VAR_0x4054); - VarSet(VAR_0x401F, gUnknown_083D13EC[sub_80BCCA4(curBase)]); + int curBase = VarGet(VAR_CURRENT_SECRET_BASE); + VarSet(VAR_OBJ_GFX_ID_F, gUnknown_083D13EC[sub_80BCCA4(curBase)]); } void sub_80BBFD8(struct MapPosition *position, struct MapEvents *events) @@ -571,12 +571,12 @@ u8 *sub_80BC190(u8 *dest, u8 arg1) { // 80bc190 } u8 *GetSecretBaseMapName(u8 *dest) { - gUnknown_020387DC = gSaveBlock1.secretBases[VarGet(VAR_0x4054)].secretBaseId; - return sub_80BC190(dest, VarGet(VAR_0x4054)); + gUnknown_020387DC = gSaveBlock1.secretBases[VarGet(VAR_CURRENT_SECRET_BASE)].secretBaseId; + return sub_80BC190(dest, VarGet(VAR_CURRENT_SECRET_BASE)); } -void sub_80BC224(void) { - u8 *var0 = gSaveBlock1.secretBases[(u8)VarGet(VAR_0x4054)].playerName; +void BufferSecretBaseOwnerName(void) { + u8 *var0 = gSaveBlock1.secretBases[(u8)VarGet(VAR_CURRENT_SECRET_BASE)].playerName; u8 *var1 = gStringVar1; u8 var2 = sub_80BB8A8(var0); u8 *var3 = StringCopyN(var1, var0, var2); @@ -830,7 +830,7 @@ void sub_80BC474(void) } } -void sub_80BC50C(void) +void MoveSecretBase(void) { u16 backupValue; sub_80BC474(); @@ -1173,7 +1173,7 @@ void sub_80BCBF8(u8 taskId) void sub_80BCC54(u8 taskId) { - u16 curBaseIndex = VarGet(VAR_0x4054); + u16 curBaseIndex = VarGet(VAR_CURRENT_SECRET_BASE); BuyMenuFreeMemory(); DestroyVerticalScrollIndicator(0); @@ -1197,9 +1197,9 @@ u8 sub_80BCCA4(u8 secretBaseIndex) + gSaveBlock1.secretBases[secretBaseIndex].gender * 5; } -const u8 *sub_80BCCE8(void) +const u8 *GetSecretBaseTrainerLoseText(void) { - u8 param = sub_80BCCA4(VarGet(VAR_0x4054)); + u8 param = sub_80BCCA4(VarGet(VAR_CURRENT_SECRET_BASE)); if (param == 0) return UnknownString_81A1BB2; if (param == 1) return UnknownString_81A1F67; if (param == 2) return UnknownString_81A2254; @@ -1229,7 +1229,7 @@ void unref_sub_80BCD7C(u8 secretBaseIndex) void sub_80BCE1C(void) { - u16 curBaseIndex = VarGet(VAR_0x4054); + u16 curBaseIndex = VarGet(VAR_CURRENT_SECRET_BASE); sub_810FB10(1); CreateSecretBaseEnemyParty(&gSaveBlock1.secretBases[curBaseIndex]); @@ -1237,12 +1237,12 @@ void sub_80BCE1C(void) void sub_80BCE4C() { - gSaveBlock1.secretBases[VarGet(VAR_0x4054)].sbr_field_1_5 = gSpecialVar_Result; + gSaveBlock1.secretBases[VarGet(VAR_CURRENT_SECRET_BASE)].sbr_field_1_5 = gSpecialVar_Result; } void sub_80BCE90() { - u16 curBaseIndex = VarGet(VAR_0x4054); + u16 curBaseIndex = VarGet(VAR_CURRENT_SECRET_BASE); if (!FlagGet(FLAG_DAILY_UNKNOWN_8C2)) { diff --git a/src/field/trainer_see.c b/src/field/trainer_see.c index 38bc6971c..3034b2b65 100644 --- a/src/field/trainer_see.c +++ b/src/field/trainer_see.c @@ -9,14 +9,22 @@ #include "task.h" #include "util.h" +static bool8 CheckTrainer(u8); +static void sub_8084894(struct Sprite *sprite, u16 a2, u8 a3); +static void objc_exclamation_mark_probably(struct Sprite *sprite); +static bool8 TrainerCanApproachPlayer(struct MapObject *); +static void sub_80842C8(struct MapObject *, u8); +static bool8 CheckPathBetweenTrainerAndPlayer(struct MapObject *trainerObj, u8 approachDistance, u8 direction); +static void RunTrainerSeeFuncList(u8 taskId); + const u8 gSpriteImage_839B308[] = INCBIN_U8("graphics/unknown_sprites/839B4E0/0.4bpp"); const u8 gSpriteImage_839B388[] = INCBIN_U8("graphics/unknown_sprites/839B4E0/1.4bpp"); const u8 gSpriteImage_839B408[] = INCBIN_U8("graphics/unknown_sprites/839B408.4bpp"); -u8 GetTrainerApproachDistanceSouth(struct MapObject *trainerObj, s16 range, s16 x, s16 y); -u8 GetTrainerApproachDistanceNorth(struct MapObject *trainerObj, s16 range, s16 x, s16 y); -u8 GetTrainerApproachDistanceWest(struct MapObject *trainerObj, s16 range, s16 x, s16 y); -u8 GetTrainerApproachDistanceEast(struct MapObject *trainerObj, s16 range, s16 x, s16 y); +static u8 GetTrainerApproachDistanceSouth(struct MapObject *trainerObj, s16 range, s16 x, s16 y); +static u8 GetTrainerApproachDistanceNorth(struct MapObject *trainerObj, s16 range, s16 x, s16 y); +static u8 GetTrainerApproachDistanceWest(struct MapObject *trainerObj, s16 range, s16 x, s16 y); +static u8 GetTrainerApproachDistanceEast(struct MapObject *trainerObj, s16 range, s16 x, s16 y); static u8 (*const sDirectionalApproachDistanceFuncs[])(struct MapObject *, s16, s16, s16) = { @@ -26,9 +34,6 @@ static u8 (*const sDirectionalApproachDistanceFuncs[])(struct MapObject *, s16, GetTrainerApproachDistanceEast, }; -extern struct SpriteTemplate gSpriteTemplate_839B510; -extern struct SpriteTemplate gSpriteTemplate_839B528; - bool8 CheckTrainers(void) { u8 mapObjId; @@ -43,7 +48,7 @@ bool8 CheckTrainers(void) return FALSE; } -bool8 CheckTrainer(u8 mapObjId) +static bool8 CheckTrainer(u8 mapObjId) { u8 *scriptPtr = GetFieldObjectScriptPointerByFieldObjectId(mapObjId); @@ -69,7 +74,7 @@ bool8 CheckTrainer(u8 mapObjId) } } -bool8 TrainerCanApproachPlayer(struct MapObject *trainerObj) +static bool8 TrainerCanApproachPlayer(struct MapObject *trainerObj) { s16 x, y; u8 i; @@ -79,14 +84,14 @@ bool8 TrainerCanApproachPlayer(struct MapObject *trainerObj) if (trainerObj->trainerType == 1) // can only see in one direction { approachDistance = sDirectionalApproachDistanceFuncs[trainerObj->mapobj_unk_18 - 1](trainerObj, trainerObj->trainerRange_berryTreeId, x, y); - return CheckPathBetweenTrainerAndPlayer((struct MapObject2 *)trainerObj, approachDistance, trainerObj->mapobj_unk_18); + return CheckPathBetweenTrainerAndPlayer(trainerObj, approachDistance, trainerObj->mapobj_unk_18); } else // can see in all directions { for (i = 0; i < 4; i++) { approachDistance = sDirectionalApproachDistanceFuncs[i](trainerObj, trainerObj->trainerRange_berryTreeId, x, y); - if (CheckPathBetweenTrainerAndPlayer((struct MapObject2 *)trainerObj, approachDistance, i + 1)) // directions are 1-4 instead of 0-3. south north west east + if (CheckPathBetweenTrainerAndPlayer(trainerObj, approachDistance, i + 1)) // directions are 1-4 instead of 0-3. south north west east return approachDistance; } } @@ -94,7 +99,7 @@ bool8 TrainerCanApproachPlayer(struct MapObject *trainerObj) } // Returns how far south the player is from trainer. 0 if out of trainer's sight. -u8 GetTrainerApproachDistanceSouth(struct MapObject *trainerObj, s16 range, s16 x, s16 y) +static u8 GetTrainerApproachDistanceSouth(struct MapObject *trainerObj, s16 range, s16 x, s16 y) { if (trainerObj->coords2.x == x && y > trainerObj->coords2.y @@ -105,7 +110,7 @@ u8 GetTrainerApproachDistanceSouth(struct MapObject *trainerObj, s16 range, s16 } // Returns how far north the player is from trainer. 0 if out of trainer's sight. -u8 GetTrainerApproachDistanceNorth(struct MapObject *trainerObj, s16 range, s16 x, s16 y) +static u8 GetTrainerApproachDistanceNorth(struct MapObject *trainerObj, s16 range, s16 x, s16 y) { if (trainerObj->coords2.x == x && y < trainerObj->coords2.y @@ -116,7 +121,7 @@ u8 GetTrainerApproachDistanceNorth(struct MapObject *trainerObj, s16 range, s16 } // Returns how far west the player is from trainer. 0 if out of trainer's sight. -u8 GetTrainerApproachDistanceWest(struct MapObject *trainerObj, s16 range, s16 x, s16 y) +static u8 GetTrainerApproachDistanceWest(struct MapObject *trainerObj, s16 range, s16 x, s16 y) { if (trainerObj->coords2.y == y && x < trainerObj->coords2.x @@ -127,7 +132,7 @@ u8 GetTrainerApproachDistanceWest(struct MapObject *trainerObj, s16 range, s16 x } // Returns how far east the player is from trainer. 0 if out of trainer's sight. -u8 GetTrainerApproachDistanceEast(struct MapObject *trainerObj, s16 range, s16 x, s16 y) +static u8 GetTrainerApproachDistanceEast(struct MapObject *trainerObj, s16 range, s16 x, s16 y) { if (trainerObj->coords2.y == y && x > trainerObj->coords2.x @@ -143,7 +148,7 @@ u8 GetTrainerApproachDistanceEast(struct MapObject *trainerObj, s16 range, s16 x #define COLLISION_MASK 1 #endif -bool8 CheckPathBetweenTrainerAndPlayer(struct MapObject2 *trainerObj, u8 approachDistance, u8 direction) +static bool8 CheckPathBetweenTrainerAndPlayer(struct MapObject *trainerObj, u8 approachDistance, u8 direction) { s16 x, y; u8 unk19_temp; @@ -159,21 +164,21 @@ bool8 CheckPathBetweenTrainerAndPlayer(struct MapObject2 *trainerObj, u8 approac for (i = 0; i <= approachDistance - 1; i++, MoveCoords(direction, &x, &y)) { - collision = sub_8060024((struct MapObject *)trainerObj, x, y, direction); + collision = sub_8060024(trainerObj, x, y, direction); if (collision != 0 && (collision & COLLISION_MASK)) return FALSE; } // preserve mapobj_unk_19 before clearing. - unk19_temp = trainerObj->mapobj_unk_19; - unk19b_temp = trainerObj->mapobj_unk_19b; - trainerObj->mapobj_unk_19 = 0; - trainerObj->mapobj_unk_19b = 0; + unk19_temp = trainerObj->range.as_nybbles.x; + unk19b_temp = trainerObj->range.as_nybbles.y; + trainerObj->range.as_nybbles.x = 0; + trainerObj->range.as_nybbles.y = 0; collision = npc_block_way((struct MapObject *)trainerObj, x, y, direction); - trainerObj->mapobj_unk_19 = unk19_temp; - trainerObj->mapobj_unk_19b = unk19b_temp; + trainerObj->range.as_nybbles.x = unk19_temp; + trainerObj->range.as_nybbles.y = unk19b_temp; if (collision == 4) return approachDistance; @@ -183,7 +188,7 @@ bool8 CheckPathBetweenTrainerAndPlayer(struct MapObject2 *trainerObj, u8 approac #define tTrainerObjHi data[1] #define tTrainerObjLo data[2] -void sub_80842C8(struct MapObject *trainerObj, u8 b) +static void sub_80842C8(struct MapObject *trainerObj, u8 b) { u8 taskId = CreateTask(RunTrainerSeeFuncList, 0x50); struct Task *task = &gTasks[taskId]; @@ -193,7 +198,7 @@ void sub_80842C8(struct MapObject *trainerObj, u8 b) task->data[3] = b; } -void sub_80842FC(TaskFunc followupFunc) +static void sub_80842FC(TaskFunc followupFunc) { TaskFunc taskFunc = RunTrainerSeeFuncList; u8 taskId = FindTaskIdByFunc(taskFunc); @@ -232,7 +237,7 @@ static bool8 (*const gTrainerSeeFuncList[])(u8 taskId, struct Task *task, struct sub_80846C8, }; -void RunTrainerSeeFuncList(u8 taskId) +static void RunTrainerSeeFuncList(u8 taskId) { struct Task *task = &gTasks[taskId]; struct MapObject *trainerObj = (struct MapObject *)((task->tTrainerObjHi << 16) | (task->tTrainerObjLo)); @@ -450,6 +455,41 @@ static void Task_DestroyTrainerApproachTask(u8 taskId) EnableBothScriptContexts(); } +static const struct OamData gOamData_839B4D8 = { + .size = 1, .priority = 1 +}; + +static const struct SpriteFrameImage gSpriteImageTable_839B4E0[] = { + { gSpriteImage_839B308, sizeof gSpriteImage_839B308 }, + { gSpriteImage_839B388, sizeof gSpriteImage_839B388 } +}; + +static const struct SpriteFrameImage gSpriteImageTable_839B4F0[] = { + { gSpriteImage_839B408, sizeof gSpriteImage_839B408 } +}; + +static const union AnimCmd gSpriteAnim_839B4F8[] = { + ANIMCMD_FRAME(0, 60), + ANIMCMD_END +}; + +static const union AnimCmd gSpriteAnim_839B500[] = { + ANIMCMD_FRAME(1, 60), + ANIMCMD_END +}; + +static const union AnimCmd *const gSpriteAnimTable_839B508[] = { + gSpriteAnim_839B4F8, + gSpriteAnim_839B500 +}; + +static const struct SpriteTemplate gSpriteTemplate_839B510 = { + 0xffff, 0xffff, &gOamData_839B4D8, gSpriteAnimTable_839B508, gSpriteImageTable_839B4E0, gDummySpriteAffineAnimTable, objc_exclamation_mark_probably +}; +static const struct SpriteTemplate gSpriteTemplate_839B528 = { + 0xffff, 4100, &gOamData_839B4D8, gSpriteAnimTable_839B508, gSpriteImageTable_839B4F0, gDummySpriteAffineAnimTable, objc_exclamation_mark_probably +}; + u8 FldEff_ExclamationMarkIcon1(void) { u8 spriteId = CreateSpriteAtEnd(&gSpriteTemplate_839B510, 0, 0, 0x53); @@ -480,7 +520,7 @@ u8 FldEff_HeartIcon(void) return 0; } -void sub_8084894(struct Sprite *sprite, u16 a2, u8 a3) +static void sub_8084894(struct Sprite *sprite, u16 a2, u8 a3) { sprite->oam.priority = 1; sprite->coordOffsetEnabled = 1; @@ -494,7 +534,7 @@ void sub_8084894(struct Sprite *sprite, u16 a2, u8 a3) StartSpriteAnim(sprite, a3); } -void objc_exclamation_mark_probably(struct Sprite *sprite) +static void objc_exclamation_mark_probably(struct Sprite *sprite) { u8 mapObjId; diff --git a/src/field/tv.c b/src/field/tv.c index 1d5bf929c..d7a75a709 100644 --- a/src/field/tv.c +++ b/src/field/tv.c @@ -80,7 +80,7 @@ extern u16 gLastUsedItem; static EWRAM_DATA u16 gUnknown_020387E0 = 0; static EWRAM_DATA u16 gUnknown_020387E2 = 0; static EWRAM_DATA u8 gUnknown_020387E4 = 0; -static EWRAM_DATA ALIGNED(4) u8 gUnknown_020387E8 = 0; // why is this aligned to a 4-byte boundary? +static EWRAM_DATA ALIGNED(4) u8 sTVShowState = 0; // why is this aligned to a 4-byte boundary? static u8 gUnknown_03000720; static u8 gUnknown_03000721; @@ -436,8 +436,8 @@ void ClearTVShowData(void) u8 showidx; u8 extradataidx; for (showidx=0; showidx<25; showidx++) { - gSaveBlock1.tvShows[showidx].common.var00 = 0; - gSaveBlock1.tvShows[showidx].common.var01 = 0; + gSaveBlock1.tvShows[showidx].common.kind = 0; + gSaveBlock1.tvShows[showidx].common.active = 0; for (extradataidx=0; extradataidx<34; extradataidx++) { gSaveBlock1.tvShows[showidx].common.pad02[extradataidx] = 0; } @@ -452,20 +452,20 @@ extern u8 gSpecialVar_ContestRank; extern u8 gUnknown_03004316[11]; extern u8 gBattleOutcome; -void sub_80BF334(void); -void sub_80BF3A4(void); -void sub_80BF3DC(void); -void sub_80BF46C(void); -void sub_80BF478(void); -void sub_80BF484(void); -void sub_80BF4BC(void); +void InterviewBefore_FanClubLetter(void); +void InterviewBefore_RecentHappenings(void); +void InterviewBefore_PkmnFanClubOpinions(void); +void InterviewBefore_Dummy(void); +void InterviewBefore_NameRater(void); +void InterviewBefore_BravoTrainerPkmnProfile(void); +void InterviewBefore_BravoTrainerBTProfile(void); void sub_80BE028(void); void sub_80BE074(void); void sub_80BE778(void); void sub_80BEB20(void); -u8 sub_80BFB54(u8); +u8 GetTVChannelByShowType(u8); s8 sub_80BF74C(TVShow tvShow[]); @@ -476,53 +476,62 @@ void sub_80BE138(TVShow *show); void sub_80BE160(TVShow *show); extern u16 gLastUsedItem; -void sub_80BE5FC(void); -void sub_80BE65C(void); -void sub_80BE6A0(void); -void nullsub_21(void); -void sub_80BE188(void); -void sub_80BE320(void); +void InterviewAfter_FanClubLetter(void); +void InterviewAfter_RecentHappenings(void); +void InterviewAfter_PkmnFanClubOpinions(void); +void InterviewAfter_DummyShow4(void); +void InterviewAfter_BravoTrainerPokemonProfile(void); +void InterviewAfter_BravoTrainerBattleTowerProfile(void); u8 special_0x44(void) { u8 i; u8 j; + u8 selIdx; + TVShow *show; -#ifndef NONMATCHING - asm("":::"r5"); -#endif - - for (i = 5; i < 24; i++) + for (i = 5; i < ARRAY_COUNT(gSaveBlock1.tvShows) - 1; i++) { - if (gSaveBlock1.tvShows[i].common.var00 == 0) + if (gSaveBlock1.tvShows[i].common.kind == 0) + { break; + } } - i = Random() % i; - j = i; + + j = Random() % i; + selIdx = j; + do { - if (sub_80BFB54(gSaveBlock1.tvShows[i].common.var00) != 4) + if (GetTVChannelByShowType(gSaveBlock1.tvShows[j].common.kind) != 4) { - if (gSaveBlock1.tvShows[i].common.var01 == 1) - return i; + if (gSaveBlock1.tvShows[j].common.active == TRUE) + { + return j; + } } else { - struct TVShowMassOutbreak *massOutbreak = &gSaveBlock1.tvShows[i].massOutbreak; - - if (massOutbreak->var16 == 0 && massOutbreak->var01 == 1) - return i; + show = &gSaveBlock1.tvShows[j]; + if (show->massOutbreak.daysLeft == 0 && show->massOutbreak.active == TRUE) + { + return j; + } + } + if (j == 0) + { + j = ARRAY_COUNT(gSaveBlock1.tvShows) - 2; } - - if (i == 0) - i = 23; else - i--; - } while (i != j); + { + j--; + } + } while (j != selIdx); + return 0xFF; } -u8 sub_80BDA30(void); +u8 FindNonMassOutbreakActiveTVShow(void); u8 sub_80BD8B8(void) { @@ -530,14 +539,14 @@ u8 sub_80BD8B8(void) if (retval == 0xff) return 0xff; - if (gSaveBlock1.outbreakPokemonSpecies != 0 && gSaveBlock1.tvShows[retval].common.var00 == TVSHOW_MASS_OUTBREAK) - return sub_80BDA30(); + if (gSaveBlock1.outbreakPokemonSpecies != 0 && gSaveBlock1.tvShows[retval].common.kind == TVSHOW_MASS_OUTBREAK) + return FindNonMassOutbreakActiveTVShow(); return retval; } u8 CheckForBigMovieOrEmergencyNewsOnTV(void); void SetTVMetatilesOnMap(int, int, u16); -bool8 sub_80BECA0(void); +bool8 FindAnyTVNewsOnTheAir(void); bool8 IsTVShowInSearchOfTrainersAiring(void); void UpdateTVScreensOnMap(int width, int height) @@ -556,7 +565,7 @@ void UpdateTVScreensOnMap(int width, int height) { SetTVMetatilesOnMap(width, height, 0x3); } - else if (FlagGet(FLAG_SYS_TV_START) && (sub_80BD8B8() != 0xff || sub_80BECA0() != 0xff || IsTVShowInSearchOfTrainersAiring())) + else if (FlagGet(FLAG_SYS_TV_START) && (sub_80BD8B8() != 0xff || FindAnyTVNewsOnTheAir() != 0xff || IsTVShowInSearchOfTrainersAiring())) { FlagClear(FLAG_SYS_TV_WATCH); SetTVMetatilesOnMap(width, height, 0x3); @@ -586,28 +595,28 @@ void TurnOffTVScreen(void) DrawWholeMapView(); } -u8 sub_80BDA0C(void) +u8 GetTVShowType(void) { - return gSaveBlock1.tvShows[gSpecialVar_0x8004].common.var00; + return gSaveBlock1.tvShows[gSpecialVar_0x8004].common.kind; } -u8 sub_80BDA30(void) +u8 FindNonMassOutbreakActiveTVShow(void) { u8 showIdx; for (showIdx=0; showIdx<24; showIdx++) { - if (gSaveBlock1.tvShows[showIdx].common.var00 != 0 && gSaveBlock1.tvShows[showIdx].common.var00 != TVSHOW_MASS_OUTBREAK && gSaveBlock1.tvShows[showIdx].common.var01 == 1) + if (gSaveBlock1.tvShows[showIdx].common.kind != 0 && gSaveBlock1.tvShows[showIdx].common.kind != TVSHOW_MASS_OUTBREAK && gSaveBlock1.tvShows[showIdx].common.active == 1) return showIdx; } return 0xff; } -u8 special_0x4a(void) +u8 GetNonMassOutbreakActiveTVShow(void) { TVShow *tvShow; tvShow = &gSaveBlock1.tvShows[gSpecialVar_0x8004]; - if (tvShow->common.var00 == TVSHOW_MASS_OUTBREAK && gSaveBlock1.outbreakPokemonSpecies) - return sub_80BDA30(); + if (tvShow->common.kind == TVSHOW_MASS_OUTBREAK && gSaveBlock1.outbreakPokemonSpecies) + return FindNonMassOutbreakActiveTVShow(); return gSpecialVar_0x8004; } @@ -677,7 +686,7 @@ void GabbyAndTyBeforeInterview(void) FlagSet(FLAG_TEMP_1); } -void sub_80BDC14(void) +void GabbyAndTyAfterInterview(void) { gSaveBlock1.gabbyAndTyData.valB_0 = gSaveBlock1.gabbyAndTyData.valA_0; gSaveBlock1.gabbyAndTyData.valB_1 = gSaveBlock1.gabbyAndTyData.valA_1; @@ -716,7 +725,7 @@ bool8 GabbyAndTyGetLastQuote(void) return TRUE; } -u8 sub_80BDD18(void) +u8 GabbyAndTyGetLastBattleTrivia(void) { if (!gSaveBlock1.gabbyAndTyData.valB_0) return 1; @@ -768,27 +777,27 @@ void GabbyAndTySetScriptVarsToFieldObjectLocalIds(void) } } -void sub_80BDE48(void) +void InterviewAfter(void) { switch (gSpecialVar_0x8005) { case TVSHOW_FAN_CLUB_LETTER: - sub_80BE5FC(); + InterviewAfter_FanClubLetter(); break; case TVSHOW_RECENT_HAPPENINGS: - sub_80BE65C(); + InterviewAfter_RecentHappenings(); break; case TVSHOW_PKMN_FAN_CLUB_OPINIONS: - sub_80BE6A0(); + InterviewAfter_PkmnFanClubOpinions(); break; case TVSHOW_UNKN_SHOWTYPE_04: - nullsub_21(); + InterviewAfter_DummyShow4(); break; case TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE: - sub_80BE188(); + InterviewAfter_BravoTrainerPokemonProfile(); break; case TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE: - sub_80BE320(); + InterviewAfter_BravoTrainerBattleTowerProfile(); break; } } @@ -832,8 +841,8 @@ void sub_80BDEC8(void) total = 0; pokemonToday = &gSaveBlock1.tvShows[gUnknown_03005D38.var0].pokemonToday; - pokemonToday->var00 = TVSHOW_POKEMON_TODAY_CAUGHT; - pokemonToday->var01 = total; + pokemonToday->kind = TVSHOW_POKEMON_TODAY_CAUGHT; + pokemonToday->active = total; if (gBattleResults.unk5_1 != 0) { total = 1; @@ -866,11 +875,11 @@ void sub_80BE028(void) { struct TVShowWorldOfMasters *worldOfMasters = &gSaveBlock1.tvShows[24].worldOfMasters; - if (worldOfMasters->var00 != TVSHOW_WORLD_OF_MASTERS) + if (worldOfMasters->kind != TVSHOW_WORLD_OF_MASTERS) { sub_80BF55C(gSaveBlock1.tvShows, 24); worldOfMasters->var06 = GetGameStat(GAME_STAT_STEPS); - worldOfMasters->var00 = TVSHOW_WORLD_OF_MASTERS; + worldOfMasters->kind = TVSHOW_WORLD_OF_MASTERS; } worldOfMasters->var02++; worldOfMasters->var04 = gBattleResults.caughtPoke; @@ -898,8 +907,8 @@ void sub_80BE074(void) struct TVShowPokemonTodayFailed *pokemonTodayFailed = &gSaveBlock1.tvShows[gUnknown_03005D38.var0].pokemonTodayFailed; zero = 0; - pokemonTodayFailed->var00 = TVSHOW_POKEMON_TODAY_FAILED; - pokemonTodayFailed->var01 = zero; + pokemonTodayFailed->kind = TVSHOW_POKEMON_TODAY_FAILED; + pokemonTodayFailed->active = zero; pokemonTodayFailed->species = gBattleResults.poke1Species; pokemonTodayFailed->species2 = gBattleResults.lastOpponentSpecies; pokemonTodayFailed->var10 = total; @@ -936,16 +945,16 @@ void sub_80BE160(TVShow *show) show->common.trainerIdHi = playerId >> 8; } -void sub_80BE188(void) +void InterviewAfter_BravoTrainerPokemonProfile(void) { struct TVShowBravoTrainerPokemonProfiles *bravoTrainerSrc = &gSaveBlock1.tvShows[24].bravoTrainer; - if (bravoTrainerSrc->var00 == TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE) + if (bravoTrainerSrc->kind == TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE) { struct TVShowBravoTrainerPokemonProfiles *bravoTrainerNew = &gSaveBlock1.tvShows[gUnknown_03005D38.var0].bravoTrainer; - bravoTrainerNew->var00 = TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE; - bravoTrainerNew->var01 = 1; + bravoTrainerNew->kind = TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE; + bravoTrainerNew->active = 1; bravoTrainerNew->species = bravoTrainerSrc->species; StringCopy(bravoTrainerNew->playerName, gSaveBlock2.playerName); StringCopy(bravoTrainerNew->pokemonNickname, bravoTrainerSrc->pokemonNickname); @@ -965,13 +974,13 @@ void sub_80BE23C(u16 a0) { struct TVShowBravoTrainerPokemonProfiles *bravoTrainer = &gSaveBlock1.tvShows[24].bravoTrainer; - sub_80BF484(); + InterviewBefore_BravoTrainerPkmnProfile(); gUnknown_03005D38.var0 = sub_80BF720(gSaveBlock1.tvShows); if (gUnknown_03005D38.var0 != -1) { sub_80BF55C(gSaveBlock1.tvShows, 24); bravoTrainer->var14 = a0; - bravoTrainer->var00 = TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE; + bravoTrainer->kind = TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE; } } @@ -990,12 +999,12 @@ void sub_80BE284(u8 a0) } } -void sub_80BE320(void) +void InterviewAfter_BravoTrainerBattleTowerProfile(void) { struct TVShowBravoTrainerBattleTowerSpotlight *bravoTrainerTower = &gSaveBlock1.tvShows[gUnknown_03005D38.var0].bravoTrainerTower; - bravoTrainerTower->var00 = TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE; - bravoTrainerTower->var01 = 1; + bravoTrainerTower->kind = TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE; + bravoTrainerTower->active = 1; StringCopy(bravoTrainerTower->trainerName, gSaveBlock2.playerName); StringCopy(bravoTrainerTower->pokemonName, gSaveBlock2.battleTower.defeatedByTrainerName); bravoTrainerTower->species = gSaveBlock2.battleTower.firstMonSpecies; @@ -1027,8 +1036,8 @@ void sub_80BE3BC(void) { struct TVShowSmartShopper *smartShopper = &gSaveBlock1.tvShows[gUnknown_03005D38.var0].smartshopperShow; - smartShopper->var00 = TVSHOW_SMART_SHOPPER; - smartShopper->var01 = rval; + smartShopper->kind = TVSHOW_SMART_SHOPPER; + smartShopper->active = rval; smartShopper->shopLocation = gMapHeader.regionMapSectionId; for (i=0; i<3; i++) { @@ -1046,7 +1055,7 @@ void sub_80BE3BC(void) void sub_80BE478(void) { - sub_80BF478(); + InterviewBefore_NameRater(); if (gSpecialVar_Result == 1) return; @@ -1055,8 +1064,8 @@ void sub_80BE478(void) { struct TVShowNameRaterShow *nameRaterShow = &gSaveBlock1.tvShows[gUnknown_03005D38.var0].nameRaterShow; - nameRaterShow->var00 = TVSHOW_NAME_RATER_SHOW; - nameRaterShow->var01 = 1; + nameRaterShow->kind = TVSHOW_NAME_RATER_SHOW; + nameRaterShow->active = 1; nameRaterShow->species = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPECIES, NULL); nameRaterShow->random = Random() % 3; nameRaterShow->random2 = Random() % 2; @@ -1089,37 +1098,37 @@ void StartMassOutbreak(void) gSaveBlock1.outbreakUnk5 = 2; } -void sub_80BE5FC(void) +void InterviewAfter_FanClubLetter(void) { struct TVShowFanClubLetter *fanclubLetter = &gSaveBlock1.tvShows[gUnknown_03005D38.var0].fanclubLetter; - fanclubLetter->var00 = TVSHOW_FAN_CLUB_LETTER; - fanclubLetter->var01 = 1; + fanclubLetter->kind = TVSHOW_FAN_CLUB_LETTER; + fanclubLetter->active = 1; StringCopy(fanclubLetter->playerName, gSaveBlock2.playerName); fanclubLetter->species = GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_SPECIES, NULL); sub_80BE160((TVShow *)fanclubLetter); fanclubLetter->language = GAME_LANGUAGE; } -void sub_80BE65C(void) +void InterviewAfter_RecentHappenings(void) { struct TVShowRecentHappenings *recentHappenings = &gSaveBlock1.tvShows[gUnknown_03005D38.var0].recentHappenings; - recentHappenings->var00 = TVSHOW_RECENT_HAPPENINGS; - recentHappenings->var01 = 1; + recentHappenings->kind = TVSHOW_RECENT_HAPPENINGS; + recentHappenings->active = 1; StringCopy(recentHappenings->playerName, gSaveBlock2.playerName); recentHappenings->var02 = 0; sub_80BE160((TVShow *)recentHappenings); recentHappenings->language = GAME_LANGUAGE; } -void sub_80BE6A0(void) +void InterviewAfter_PkmnFanClubOpinions(void) { u8 monIndex; struct TVShowFanclubOpinions *fanclubOpinions = &gSaveBlock1.tvShows[gUnknown_03005D38.var0].fanclubOpinions; - fanclubOpinions->var00 = TVSHOW_PKMN_FAN_CLUB_OPINIONS; - fanclubOpinions->var01 = 1; + fanclubOpinions->kind = TVSHOW_PKMN_FAN_CLUB_OPINIONS; + fanclubOpinions->active = 1; monIndex = GetLeadMonIndex(); fanclubOpinions->var04A = GetMonData(&gPlayerParty[monIndex], MON_DATA_FRIENDSHIP, NULL) / 16; fanclubOpinions->var04B = gSpecialVar_0x8007; @@ -1132,7 +1141,7 @@ void sub_80BE6A0(void) StripExtCtrlCodes(fanclubOpinions->var10); } -void nullsub_21(void) +void InterviewAfter_DummyShow4(void) { } @@ -1144,7 +1153,7 @@ void sub_80BE778(void) for (i = 0; i < 24; i++) { - if (gSaveBlock1.tvShows[i].massOutbreak.var00 == TVSHOW_MASS_OUTBREAK) + if (gSaveBlock1.tvShows[i].massOutbreak.kind == TVSHOW_MASS_OUTBREAK) return; } if (sub_80BF77C(0x147)) @@ -1158,8 +1167,8 @@ void sub_80BE778(void) s32 val2 = gUnknown_03005D38.var0; struct TVShowMassOutbreak *massOutbreak = &gSaveBlock1.tvShows[val2].massOutbreak; - massOutbreak->var00 = TVSHOW_MASS_OUTBREAK; - massOutbreak->var01 = 1; + massOutbreak->kind = TVSHOW_MASS_OUTBREAK; + massOutbreak->active = 1; massOutbreak->level = gPokeOutbreakSpeciesList[val].level; massOutbreak->var02 = 0; massOutbreak->var03 = 0; @@ -1174,7 +1183,7 @@ void sub_80BE778(void) massOutbreak->var12 = 0; massOutbreak->probability = 0x32; massOutbreak->var15 = 0; - massOutbreak->var16 = 0x01; + massOutbreak->daysLeft = 0x01; sub_80BE160((TVShow *)massOutbreak); massOutbreak->language = GAME_LANGUAGE; } @@ -1214,15 +1223,15 @@ void sub_80BE8EC(u16 arg0) { for (showidx=0; showidx<24; showidx++) { - if (gSaveBlock1.tvShows[showidx].massOutbreak.var00 == TVSHOW_MASS_OUTBREAK - && gSaveBlock1.tvShows[showidx].massOutbreak.var01 == 0x01) + if (gSaveBlock1.tvShows[showidx].massOutbreak.kind == TVSHOW_MASS_OUTBREAK + && gSaveBlock1.tvShows[showidx].massOutbreak.active == 0x01) { struct TVShowMassOutbreak *massOutbreak = &gSaveBlock1.tvShows[showidx].massOutbreak; - if (massOutbreak->var16 < arg0) - massOutbreak->var16 = 0; + if (massOutbreak->daysLeft < arg0) + massOutbreak->daysLeft = 0; else - massOutbreak->var16 -= arg0; + massOutbreak->daysLeft -= arg0; break; } } @@ -1272,8 +1281,8 @@ void sub_80BE9D4(void) register u8 zero asm("r1") = 0; asm(""::"r"(zero)); - pokemonAngler->var00 = TVSHOW_FISHING_ADVICE; - pokemonAngler->var01 = zero; + pokemonAngler->kind = TVSHOW_FISHING_ADVICE; + pokemonAngler->active = zero; pokemonAngler->var02 = gUnknown_020387E2 & 0xFF; pokemonAngler->var03 = gUnknown_020387E2 >> 8; pokemonAngler->var04 = gUnknown_020387E0; @@ -1294,7 +1303,7 @@ void sub_80BEA5C(u16 arg0) { struct TVShowWorldOfMasters *worldOfMasters = &gSaveBlock1.tvShows[24].worldOfMasters; - if (worldOfMasters->var00 == TVSHOW_WORLD_OF_MASTERS) + if (worldOfMasters->kind == TVSHOW_WORLD_OF_MASTERS) { if (worldOfMasters->var02 < 20) sub_80BF55C(gSaveBlock1.tvShows, 0x18); @@ -1313,8 +1322,8 @@ void sub_80BEA88(void) { struct TVShowWorldOfMasters *worldOfMastersDst = &gSaveBlock1.tvShows[gUnknown_03005D38.var0].worldOfMasters; - worldOfMastersDst->var00 = TVSHOW_WORLD_OF_MASTERS; - worldOfMastersDst->var01 = 0; + worldOfMastersDst->kind = TVSHOW_WORLD_OF_MASTERS; + worldOfMastersDst->active = 0; worldOfMastersDst->var02 = worldOfMastersSrc->var02; worldOfMastersDst->var06 = GetGameStat(GAME_STAT_STEPS) - worldOfMastersSrc->var06; worldOfMastersDst->var04 = worldOfMastersSrc->var04; @@ -1333,27 +1342,27 @@ void sub_80BEB20(void) if (FlagGet(FLAG_SYS_GAME_CLEAR) != 0) { - gUnknown_03005D38.var0 = sub_80BEBC8(gSaveBlock1.unknown_2ABC); + gUnknown_03005D38.var0 = sub_80BEBC8(gSaveBlock1.pokeNews); if (gUnknown_03005D38.var0 != -1 && sub_80BF77C(0x28f) != 1) { rval = (Random() % 3) + 1; if (sub_80BEE48(rval) != 1) { - gSaveBlock1.unknown_2ABC[gUnknown_03005D38.var0].val0 = rval; - gSaveBlock1.unknown_2ABC[gUnknown_03005D38.var0].val2 = 4; - gSaveBlock1.unknown_2ABC[gUnknown_03005D38.var0].val1 = 1; + gSaveBlock1.pokeNews[gUnknown_03005D38.var0].kind = rval; + gSaveBlock1.pokeNews[gUnknown_03005D38.var0].days = 4; + gSaveBlock1.pokeNews[gUnknown_03005D38.var0].state = 1; } } } } -int sub_80BEBC8(struct UnknownSaveStruct2ABC *arg0) +int sub_80BEBC8(struct PokeNews *pokeNews) { s8 i; for (i = 0; i < 16; i++) { - if (arg0[i].val0 == 0) + if (pokeNews[i].kind == 0) return i; } return -1; @@ -1369,9 +1378,9 @@ void sub_80BEBF4(void) void sub_80BEC10(u8 arg0) { - gSaveBlock1.unknown_2ABC[arg0].val0 = 0; - gSaveBlock1.unknown_2ABC[arg0].val1 = 0; - gSaveBlock1.unknown_2ABC[arg0].val2 = 0; + gSaveBlock1.pokeNews[arg0].kind = 0; + gSaveBlock1.pokeNews[arg0].state = 0; + gSaveBlock1.pokeNews[arg0].days = 0; } void sub_80BEC40(void) @@ -1380,13 +1389,13 @@ void sub_80BEC40(void) for (i = 0; i < 15; i++) { - if (gSaveBlock1.unknown_2ABC[i].val0 == 0) + if (gSaveBlock1.pokeNews[i].kind == 0) { for (j = i + 1; j < 16; j++) { - if (gSaveBlock1.unknown_2ABC[j].val0 != 0) + if (gSaveBlock1.pokeNews[j].kind != 0) { - gSaveBlock1.unknown_2ABC[i] = gSaveBlock1.unknown_2ABC[j]; + gSaveBlock1.pokeNews[i] = gSaveBlock1.pokeNews[j]; sub_80BEC10(j); break; } @@ -1395,43 +1404,43 @@ void sub_80BEC40(void) } } -u8 sub_80BECA0(void) +u8 FindAnyTVNewsOnTheAir(void) { u8 i; for (i = 0; i < 16; i++) { - if (gSaveBlock1.unknown_2ABC[i].val0 != 0 - && gSaveBlock1.unknown_2ABC[i].val1 == 1 - && gSaveBlock1.unknown_2ABC[i].val2 < 3) + if (gSaveBlock1.pokeNews[i].kind != 0 + && gSaveBlock1.pokeNews[i].state == 1 + && gSaveBlock1.pokeNews[i].days < 3) return i; } return 0xFF; } -void sub_80BECE8(void) +void DoPokeNews(void) { - u8 arg0; - arg0 = sub_80BECA0(); - if (arg0 == 0xff) + u8 i; + i = FindAnyTVNewsOnTheAir(); + if (i == 0xff) { gSpecialVar_Result = 0; return; } - if (gSaveBlock1.unknown_2ABC[arg0].val2 == 0) + if (gSaveBlock1.pokeNews[i].days == 0) { - gSaveBlock1.unknown_2ABC[arg0].val1 = 2; + gSaveBlock1.pokeNews[i].state = 2; if (gLocalTime.hours < 20) - ShowFieldMessage(gTVNewsTextGroup2[gSaveBlock1.unknown_2ABC[arg0].val0]); + ShowFieldMessage(gTVNewsTextGroup2[gSaveBlock1.pokeNews[i].kind]); else - ShowFieldMessage(gTVNewsTextGroup3[gSaveBlock1.unknown_2ABC[arg0].val0]); + ShowFieldMessage(gTVNewsTextGroup3[gSaveBlock1.pokeNews[i].kind]); } else { - u16 value = gSaveBlock1.unknown_2ABC[arg0].val2; + u16 value = gSaveBlock1.pokeNews[i].days; ConvertIntToDecimalStringN(gStringVar1, value, 0, 1); - gSaveBlock1.unknown_2ABC[arg0].val1 = 0; - ShowFieldMessage(gTVNewsTextGroup1[gSaveBlock1.unknown_2ABC[arg0].val0]); + gSaveBlock1.pokeNews[i].state = 0; + ShowFieldMessage(gTVNewsTextGroup1[gSaveBlock1.pokeNews[i].kind]); } gSpecialVar_Result = 1; } @@ -1444,9 +1453,9 @@ bool8 GetPriceReduction(u8 arg0) return FALSE; for (i=0; i<16; i++) { - if (gSaveBlock1.unknown_2ABC[i].val0 == arg0) + if (gSaveBlock1.pokeNews[i].kind == arg0) { - if (gSaveBlock1.unknown_2ABC[i].val1 == 2 && IsPriceDiscounted(arg0) != 0) + if (gSaveBlock1.pokeNews[i].state == 2 && IsPriceDiscounted(arg0) != 0) return TRUE; else return FALSE; @@ -1487,7 +1496,7 @@ bool8 sub_80BEE48(u8 arg0) return TRUE; for (i=0; i<16; i++) { - if (gSaveBlock1.unknown_2ABC[i].val0 == arg0) + if (gSaveBlock1.pokeNews[i].kind == arg0) return TRUE; } return FALSE; @@ -1499,17 +1508,17 @@ void sub_80BEE84(u16 var0) for (i=0; i<16; i++) { - if (gSaveBlock1.unknown_2ABC[i].val0) + if (gSaveBlock1.pokeNews[i].kind) { - if (gSaveBlock1.unknown_2ABC[i].val2 < var0) + if (gSaveBlock1.pokeNews[i].days < var0) { sub_80BEC10(i); } else { - if (!gSaveBlock1.unknown_2ABC[i].val1 && FlagGet(FLAG_SYS_GAME_CLEAR) == 1) - gSaveBlock1.unknown_2ABC[i].val1 = 1; - gSaveBlock1.unknown_2ABC[i].val2 -= var0; + if (!gSaveBlock1.pokeNews[i].state && FlagGet(FLAG_SYS_GAME_CLEAR) == 1) + gSaveBlock1.pokeNews[i].state = 1; + gSaveBlock1.pokeNews[i].days -= var0; } } } @@ -1619,7 +1628,7 @@ bool8 sub_80BF1B4(u8 showIdx) for (i = 5; i < 24; i++) { - if (tvShows[i].common.var00 == showIdx) + if (tvShows[i].common.kind == showIdx) { if ((trainerId & 0xFF) == tvShows[i].common.trainerIdLo && ((trainerId >> 8) & 0xFF) == tvShows[i].common.trainerIdHi) return TRUE; @@ -1656,9 +1665,9 @@ void sub_80BF25C(u8 showType) for (i = 0; i < 5; i++) { - if (gSaveBlock1.tvShows[i].common.var00 == showType) + if (gSaveBlock1.tvShows[i].common.kind == showType) { - if(gSaveBlock1.tvShows[i].common.var01 == 1) + if(gSaveBlock1.tvShows[i].common.active == 1) { gSpecialVar_Result = 1; } @@ -1674,36 +1683,36 @@ void sub_80BF25C(u8 showType) sub_80BF6D8(); } -void sub_80BF2C4(void) +void InterviewBefore(void) { - gSpecialVar_Result = 0; + gSpecialVar_Result = FALSE; switch (gSpecialVar_0x8005) { case TVSHOW_FAN_CLUB_LETTER: - sub_80BF334(); + InterviewBefore_FanClubLetter(); break; case TVSHOW_RECENT_HAPPENINGS: - sub_80BF3A4(); + InterviewBefore_RecentHappenings(); break; case TVSHOW_PKMN_FAN_CLUB_OPINIONS: - sub_80BF3DC(); + InterviewBefore_PkmnFanClubOpinions(); break; case TVSHOW_UNKN_SHOWTYPE_04: - sub_80BF46C(); + InterviewBefore_Dummy(); break; case TVSHOW_NAME_RATER_SHOW: - sub_80BF478(); + InterviewBefore_NameRater(); break; case TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE: - sub_80BF484(); + InterviewBefore_BravoTrainerPkmnProfile(); break; case TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE: - sub_80BF4BC(); + InterviewBefore_BravoTrainerBTProfile(); break; } } -void sub_80BF334(void) +void InterviewBefore_FanClubLetter(void) { struct TVShowFanClubLetter *fanclubLetter; @@ -1716,7 +1725,7 @@ void sub_80BF334(void) } } -void sub_80BF3A4(void) +void InterviewBefore_RecentHappenings(void) { struct TVShowRecentHappenings *recentHappenings; @@ -1728,7 +1737,7 @@ void sub_80BF3A4(void) } } -void sub_80BF3DC(void) +void InterviewBefore_PkmnFanClubOpinions(void) { struct TVShowFanclubOpinions *fanclubOpinions; @@ -1743,17 +1752,17 @@ void sub_80BF3DC(void) } } -void sub_80BF46C(void) +void InterviewBefore_Dummy(void) { gSpecialVar_Result = 1; } -void sub_80BF478(void) +void InterviewBefore_NameRater(void) { sub_80BF25C(TVSHOW_NAME_RATER_SHOW); } -void sub_80BF484(void) +void InterviewBefore_BravoTrainerPkmnProfile(void) { struct TVShowBravoTrainerPokemonProfiles *bravoTrainer; @@ -1765,7 +1774,7 @@ void sub_80BF484(void) } } -void sub_80BF4BC(void) +void InterviewBefore_BravoTrainerBTProfile(void) { struct TVShowBravoTrainerBattleTowerSpotlight *bravoTrainerTower; @@ -1778,32 +1787,32 @@ void sub_80BF4BC(void) } #if ENGLISH -u8 sub_80BF4F4(u8 arg0) +u8 NicknameDiffersFromSpeciesName(u8 monIndex) { u32 species; - GetMonData(&gPlayerParty[arg0], MON_DATA_NICKNAME, &gStringVar1); - species = GetMonData(&gPlayerParty[arg0], MON_DATA_SPECIES, NULL); - if (StringCompareWithoutExtCtrlCodes(gSpeciesNames[species], gStringVar1) == FALSE) + GetMonData(&gPlayerParty[monIndex], MON_DATA_NICKNAME, &gStringVar1); + species = GetMonData(&gPlayerParty[monIndex], MON_DATA_SPECIES, NULL); + if (StringCompareWithoutExtCtrlCodes(gSpeciesNames[species], gStringVar1) == 0) return FALSE; return TRUE; } #elif GERMAN -u8 sub_80BF4F4(u8 arg0) +u8 NicknameDiffersFromSpeciesName(u8 monIndex) { u8 langData[4]; u32 species; u8 *tmp; - GetMonData(&gPlayerParty[arg0], MON_DATA_NICKNAME, &gStringVar1); + GetMonData(&gPlayerParty[monIndex], MON_DATA_NICKNAME, &gStringVar1); tmp = langData; - tmp[0] = GetMonData(&gPlayerParty[arg0], MON_DATA_LANGUAGE, &langData); + tmp[0] = GetMonData(&gPlayerParty[monIndex], MON_DATA_LANGUAGE, &langData); if (tmp[0] != GAME_LANGUAGE) return TRUE; - species = GetMonData(&gPlayerParty[arg0], MON_DATA_SPECIES, NULL); + species = GetMonData(&gPlayerParty[monIndex], MON_DATA_SPECIES, NULL); if (StringCompareWithoutExtCtrlCodes(gSpeciesNames[species], gStringVar1)) return TRUE; @@ -1811,17 +1820,17 @@ u8 sub_80BF4F4(u8 arg0) } #endif -u8 sub_80BF544(void) +u8 LeadMonNicknamed(void) { - return sub_80BF4F4(GetLeadMonIndex()); + return NicknameDiffersFromSpeciesName(GetLeadMonIndex()); } void sub_80BF55C(TVShow tvShow[], u8 showidx) { u8 idx; - tvShow[showidx].common.var00 = 0; - tvShow[showidx].common.var01 = 0; + tvShow[showidx].common.kind = 0; + tvShow[showidx].common.active = 0; for (idx = 0; idx < 34; idx++) tvShow[showidx].common.pad02[idx] = 0; } @@ -1833,11 +1842,11 @@ void sub_80BF588(TVShow tvShow[]) for (showidx = 0; showidx < 4; showidx++) { - if (tvShow[showidx].common.var00 == 0) + if (tvShow[showidx].common.kind == 0) { for (showidx2 = showidx + 1; showidx2 < 5; showidx2++) { - if (tvShow[showidx2].common.var00 != 0) + if (tvShow[showidx2].common.kind != 0) { tvShow[showidx] = tvShow[showidx2]; sub_80BF55C(tvShow, showidx2); @@ -1848,11 +1857,11 @@ void sub_80BF588(TVShow tvShow[]) } for (showidx = 5; showidx < 24; showidx++) { - if (tvShow[showidx].common.var00 == 0) + if (tvShow[showidx].common.kind == 0) { for (showidx2 = showidx + 1; showidx2 < 24; showidx2++) { - if (tvShow[showidx2].common.var00 != 0) + if (tvShow[showidx2].common.kind != 0) { tvShow[showidx] = tvShow[showidx2]; sub_80BF55C(gSaveBlock1.tvShows, showidx2); @@ -1909,7 +1918,7 @@ s8 sub_80BF720(TVShow tvShow[]) for (idx = 0; idx < 5; idx++) { - if (tvShow[idx].common.var00 == 0) + if (tvShow[idx].common.kind == 0) return idx; } return -1; @@ -1921,7 +1930,7 @@ s8 sub_80BF74C(TVShow tvShow[]) for (idx = 5; idx < 24; idx++) { - if (tvShow[idx].common.var00 == 0) + if (tvShow[idx].common.kind == 0) return idx; } return -1; @@ -2043,19 +2052,19 @@ void sub_80BF820(u8 arg0, u8 arg1, u8 arg2, u16 arg3, u16 arg4, struct TVShowNam StringCopy(gUnknown_083D1464[arg0], flags); } -bool8 sub_80BF974(void) +bool8 TV_IsScriptShowKindAlreadyInQueue(void) { u8 i; for (i = 0; i < 5; i++) { - if (gSaveBlock1.tvShows[i].common.var00 == gSpecialVar_0x8004) + if (gSaveBlock1.tvShows[i].common.kind == gSpecialVar_0x8004) return TRUE; } return FALSE; } -bool8 sub_80BF9B4(void) +bool8 TV_PutNameRaterShowOnTheAirIfNicnkameChanged(void) { GetMonData(&(gPlayerParty[gSpecialVar_0x8004]), MON_DATA_NICKNAME, &gStringVar1); if (!StringCompareWithoutExtCtrlCodes(gStringVar3, gStringVar1)) @@ -2064,9 +2073,9 @@ bool8 sub_80BF9B4(void) return TRUE; } -void c2_080CC144(void); +void ChangePokemonNickname_CB(void); -void sub_80BF9F8(void) +void ChangePokemonNickname(void) { u16 spec; u16 gender; @@ -2077,22 +2086,22 @@ void sub_80BF9F8(void) spec = GetMonData(&(gPlayerParty[gSpecialVar_0x8004]), MON_DATA_SPECIES, 0); gender = GetMonGender(&(gPlayerParty[gSpecialVar_0x8004])); pval = GetMonData(&(gPlayerParty[gSpecialVar_0x8004]), MON_DATA_PERSONALITY, 0); - DoNamingScreen(3, gStringVar2, spec, gender, pval, c2_080CC144); + DoNamingScreen(3, gStringVar2, spec, gender, pval, ChangePokemonNickname_CB); } -void c2_080CC144(void) +void ChangePokemonNickname_CB(void) { SetMonData(&(gPlayerParty[gSpecialVar_0x8004]), MON_DATA_NICKNAME, gStringVar2); c2_exit_to_overworld_1_continue_scripts_restart_music(); } -void sub_80BFAE0(void) +void TV_CopyNicknameToStringVar1AndEnsureTerminated(void) { GetMonData(&(gPlayerParty[gSpecialVar_0x8004]), MON_DATA_NICKNAME, &gStringVar1); StringGetEnd10(gStringVar1); } -void sub_80BFB10(void) +void TV_CheckMonOTIDEqualsPlayerID(void) { if (GetPlayerTrainerId() == GetMonData(&(gPlayerParty[gSpecialVar_0x8004]), MON_DATA_OT_ID, 0)) gSpecialVar_Result = 0; @@ -2100,7 +2109,7 @@ void sub_80BFB10(void) gSpecialVar_Result = 1; } -u8 sub_80BFB54(u8 arg0) +u8 GetTVChannelByShowType(u8 arg0) { if (arg0 == 0) return 0; @@ -2149,7 +2158,7 @@ void GetMomOrDadStringForTVMessage(void) if (gSaveBlock1.location.mapNum == MAP_NUM(LITTLEROOT_TOWN_BRENDANS_HOUSE_1F)) { StringCopy(gStringVar1, gOtherText_Mom); - VarSet(VAR_0x4003, 1); + VarSet(VAR_TEMP_3, 1); } } else @@ -2157,21 +2166,21 @@ void GetMomOrDadStringForTVMessage(void) if (gSaveBlock1.location.mapNum == MAP_NUM(LITTLEROOT_TOWN_MAYS_HOUSE_1F)) { StringCopy(gStringVar1, gOtherText_Mom); - VarSet(VAR_0x4003, 1); + VarSet(VAR_TEMP_3, 1); } } } - if (VarGet(VAR_0x4003) == 1) + if (VarGet(VAR_TEMP_3) == 1) { StringCopy(gStringVar1, gOtherText_Mom); } - else if (VarGet(VAR_0x4003) == 2) + else if (VarGet(VAR_TEMP_3) == 2) { StringCopy(gStringVar1, gOtherText_Dad); } - else if (VarGet(VAR_0x4003) > 2) + else if (VarGet(VAR_TEMP_3) > 2) { - if (VarGet(VAR_0x4003) % 2 == 0) + if (VarGet(VAR_TEMP_3) % 2 == 0) StringCopy(gStringVar1, gOtherText_Mom); else StringCopy(gStringVar1, gOtherText_Dad); @@ -2181,26 +2190,26 @@ void GetMomOrDadStringForTVMessage(void) if (Random() % 2 != 0) { StringCopy(gStringVar1, gOtherText_Mom); - VarSet(VAR_0x4003, 1); + VarSet(VAR_TEMP_3, 1); } else { StringCopy(gStringVar1, gOtherText_Dad); - VarSet(VAR_0x4003, 2); + VarSet(VAR_TEMP_3, 2); } } } void sub_80BFD20(void) { - VarSet(VAR_0x40BC, 0); + VarSet(VAR_BRAVO_TRAINER_BATTLE_TOWER_ON, 0); RemoveFieldObjectByLocalIdAndMap(5, gSaveBlock1.location.mapNum, gSaveBlock1.location.mapGroup); } typedef union ewramStruct_02007000 { TVShow tvshows[4][25]; - struct UnknownSaveStruct2ABC unknown_2abc[4][16]; + struct PokeNews pokeNews[4][16]; } ewramStruct_02007000; void sub_80BFE24(TVShow arg0[25], TVShow arg1[25], TVShow arg2[25], TVShow arg3[25]); @@ -2294,7 +2303,7 @@ bool8 sub_80BFF68(TVShow * arg1[25], TVShow * arg2[25], u8 idx) tv1 = *arg1; tv2 = *arg2; value = FALSE; - switchval = sub_80BFB54(tv2[gUnknown_03000722].common.var00); + switchval = GetTVChannelByShowType(tv2[gUnknown_03000722].common.kind); switch (switchval) { case 2: @@ -2329,7 +2338,7 @@ u8 sub_80C004C(TVShow *tv1, TVShow *tv2, u8 idx) tv2->common.srcTrainerIdLo = linkTrainerId & 0xFF; tv2->common.srcTrainerIdHi = linkTrainerId >> 8; *tv1 = *tv2; - tv1->common.var01 = 1; + tv1->common.active = 1; return TRUE; } @@ -2345,7 +2354,7 @@ u8 sub_80C00B4(TVShow *tv1, TVShow *tv2, u8 idx) tv2->common.srcTrainerId2Lo = linkTrainerId & 0xFF; tv2->common.srcTrainerId2Hi = linkTrainerId >> 8; *tv1 = *tv2; - tv1->common.var01 = 1; + tv1->common.active = 1; return TRUE; } @@ -2359,7 +2368,7 @@ u8 sub_80C0134(TVShow *tv1, TVShow *tv2, u8 idx) tv2->common.srcTrainerIdLo = linkTrainerId & 0xFF; tv2->common.srcTrainerIdHi = linkTrainerId >> 8; *tv1 = *tv2; - tv1->common.var01 = 1; + tv1->common.active = 1; tv1->common.var16[0] = 1; return TRUE; } @@ -2369,7 +2378,7 @@ s8 sub_80C019C(TVShow tvShows[]) u8 i; for (i = 0; i < 24; i++) { - if (tvShows[i].common.var01 == 0 && (u8)(tvShows[i].common.var00 - 1) < 60) + if (tvShows[i].common.active == 0 && (u8)(tvShows[i].common.kind - 1) < 60) return i; } return -1; @@ -2381,7 +2390,7 @@ void sub_80C01D4(void) u16 i; for (i=0; i<24; i++) { - switch (gSaveBlock1.tvShows[i].common.var00) + switch (gSaveBlock1.tvShows[i].common.kind) { case 0: case TVSHOW_RECENT_HAPPENINGS: @@ -2637,13 +2646,13 @@ _080C03A0:\n\ void sub_80C03A8(u8 showidx) { - gSaveBlock1.tvShows[showidx].common.var01 = 0; + gSaveBlock1.tvShows[showidx].common.active = 0; } void sub_80C03C8(u16 species, u8 showidx) { if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), 0) == 0) - gSaveBlock1.tvShows[showidx].common.var01 = 0; + gSaveBlock1.tvShows[showidx].common.active = 0; } void sub_80C0408(void) @@ -2654,10 +2663,10 @@ void sub_80C0408(void) return; for (i = 0; i < 24; i++) { - if (gSaveBlock1.tvShows[i].common.var00 == TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE) - gSaveBlock1.tvShows[i].common.var01 = 0; - else if (gSaveBlock1.tvShows[i].common.var00 == TVSHOW_MASS_OUTBREAK) - gSaveBlock1.tvShows[i].common.var01 = 0; + if (gSaveBlock1.tvShows[i].common.kind == TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE) + gSaveBlock1.tvShows[i].common.active = 0; + else if (gSaveBlock1.tvShows[i].common.kind == TVSHOW_MASS_OUTBREAK) + gSaveBlock1.tvShows[i].common.active = 0; } } @@ -2667,8 +2676,8 @@ void sub_80C045C(void) for (i = 0; i < 5; i++) { - if (sub_80BFB54(gSaveBlock1.tvShows[i].common.var00) == 2) - gSaveBlock1.tvShows[i].common.var01 = 0; + if (GetTVChannelByShowType(gSaveBlock1.tvShows[i].common.kind) == 2) + gSaveBlock1.tvShows[i].common.active = 0; } } @@ -2680,18 +2689,18 @@ void sub_80C04A0(void) for (showIdx = 5; showIdx < 24; showIdx++) { - if (gSaveBlock1.tvShows[showIdx].common.var00 == 0) + if (gSaveBlock1.tvShows[showIdx].common.kind == 0) count++; } for (showIdx = 0; showIdx < 5 - count; showIdx++) sub_80BF55C(gSaveBlock1.tvShows, showIdx+5); } -void sub_80C05C4(struct UnknownSaveStruct2ABC[16], struct UnknownSaveStruct2ABC[16], struct UnknownSaveStruct2ABC[16], struct UnknownSaveStruct2ABC[16]); +void sub_80C05C4(struct PokeNews[16], struct PokeNews[16], struct PokeNews[16], struct PokeNews[16]); void sub_80C0750(void); void sub_80C0788(void); -s8 sub_80C0730(struct UnknownSaveStruct2ABC[16], u8); -void sub_80C06BC(struct UnknownSaveStruct2ABC *[16], struct UnknownSaveStruct2ABC *[16]); +s8 sub_80C0730(struct PokeNews[16], u8); +void sub_80C06BC(struct PokeNews *[16], struct PokeNews *[16]); void sub_80C0514(void *a0, u32 a1, u8 a2) { @@ -2699,33 +2708,33 @@ void sub_80C0514(void *a0, u32 a1, u8 a2) u8 i; for (i = 0; i < 4; i++) - memcpy(gUnknown_02007000.unknown_2abc[i], a0 + i * a1, 64); + memcpy(gUnknown_02007000.pokeNews[i], a0 + i * a1, 64); struct02007000 = &gUnknown_02007000; switch (a2) { case 0: - sub_80C05C4(gSaveBlock1.unknown_2ABC, struct02007000->unknown_2abc[1], struct02007000->unknown_2abc[2], struct02007000->unknown_2abc[3]); + sub_80C05C4(gSaveBlock1.pokeNews, struct02007000->pokeNews[1], struct02007000->pokeNews[2], struct02007000->pokeNews[3]); break; case 1: - sub_80C05C4(struct02007000->unknown_2abc[0], gSaveBlock1.unknown_2ABC, struct02007000->unknown_2abc[2], struct02007000->unknown_2abc[3]); + sub_80C05C4(struct02007000->pokeNews[0], gSaveBlock1.pokeNews, struct02007000->pokeNews[2], struct02007000->pokeNews[3]); break; case 2: - sub_80C05C4(struct02007000->unknown_2abc[0], struct02007000->unknown_2abc[1], gSaveBlock1.unknown_2ABC, struct02007000->unknown_2abc[3]); + sub_80C05C4(struct02007000->pokeNews[0], struct02007000->pokeNews[1], gSaveBlock1.pokeNews, struct02007000->pokeNews[3]); break; case 3: - sub_80C05C4(struct02007000->unknown_2abc[0], struct02007000->unknown_2abc[1], struct02007000->unknown_2abc[2], gSaveBlock1.unknown_2ABC); + sub_80C05C4(struct02007000->pokeNews[0], struct02007000->pokeNews[1], struct02007000->pokeNews[2], gSaveBlock1.pokeNews); break; } sub_80C0750(); sub_80C0788(); } -void sub_80C05C4(struct UnknownSaveStruct2ABC a0[16], struct UnknownSaveStruct2ABC a1[16], struct UnknownSaveStruct2ABC a2[16], struct UnknownSaveStruct2ABC a3[16]) +void sub_80C05C4(struct PokeNews a0[16], struct PokeNews a1[16], struct PokeNews a2[16], struct PokeNews a3[16]) { u8 i; u8 j; u8 k; - struct UnknownSaveStruct2ABC ** arglist[4]; + struct PokeNews ** arglist[4]; arglist[0] = &a0; arglist[1] = &a1; @@ -2750,10 +2759,10 @@ void sub_80C05C4(struct UnknownSaveStruct2ABC a0[16], struct UnknownSaveStruct2A } } -void sub_80C06BC(struct UnknownSaveStruct2ABC *arg0[16], struct UnknownSaveStruct2ABC *arg1[16]) +void sub_80C06BC(struct PokeNews *arg0[16], struct PokeNews *arg1[16]) { - struct UnknownSaveStruct2ABC *str0; - struct UnknownSaveStruct2ABC *str1; + struct PokeNews *str0; + struct PokeNews *str1; str0 = arg0[0]; str1 = arg1[0]; @@ -2761,26 +2770,26 @@ void sub_80C06BC(struct UnknownSaveStruct2ABC *arg0[16], struct UnknownSaveStruc sub_80C06E8(str0, str1, gUnknown_03005D38.var0); } -bool8 sub_80C06E8(struct UnknownSaveStruct2ABC *arg0, struct UnknownSaveStruct2ABC *arg1, s8 arg2) +bool8 sub_80C06E8(struct PokeNews *arg0, struct PokeNews *arg1, s8 arg2) { u8 i; - if (arg1->val0 == 0) + if (arg1->kind == 0) return FALSE; for (i = 0; i < 16; i++) { - if (arg0[i].val0 == arg1->val0) + if (arg0[i].kind == arg1->kind) return FALSE; } - arg0[arg2].val0 = arg1->val0; - arg0[arg2].val1 = 1; - arg0[arg2].val2 = arg1->val2; + arg0[arg2].kind = arg1->kind; + arg0[arg2].state = 1; + arg0[arg2].days = arg1->days; return TRUE; } -s8 sub_80C0730(struct UnknownSaveStruct2ABC *arg0, u8 arg1) +s8 sub_80C0730(struct PokeNews *arg0, u8 arg1) { - if (arg0[arg1].val0 == 0) + if (arg0[arg1].kind == 0) return -1; return arg1; } @@ -2791,7 +2800,7 @@ void sub_80C0750(void) for (i = 0; i < 16; i++) { - if (gSaveBlock1.unknown_2ABC[i].val0 > 3) + if (gSaveBlock1.pokeNews[i].kind > 3) sub_80BEC10(i); } sub_80BEC40(); @@ -2804,15 +2813,15 @@ void sub_80C0788(void) if (FlagGet(FLAG_SYS_GAME_CLEAR) != 1) { for (i = 0; i < 16; i++) - gSaveBlock1.unknown_2ABC[i].val1 = 0; + gSaveBlock1.pokeNews[i].state = 0; } } void DoTVShow(void) { - if (gSaveBlock1.tvShows[gSpecialVar_0x8004].common.var01 != 0) + if (gSaveBlock1.tvShows[gSpecialVar_0x8004].common.active != 0) { - switch (gSaveBlock1.tvShows[gSpecialVar_0x8004].common.var00) + switch (gSaveBlock1.tvShows[gSpecialVar_0x8004].common.kind) { case TVSHOW_FAN_CLUB_LETTER: DoTVShowPokemonFanClubLetter(); @@ -2870,7 +2879,7 @@ void DoTVShowBravoTrainerPokemonProfile(void) u8 state; gSpecialVar_Result = 0; - state = gUnknown_020387E8; + state = sTVShowState; switch(state) { case 0: @@ -2878,49 +2887,49 @@ void DoTVShowBravoTrainerPokemonProfile(void) CopyContestCategoryToStringVar(1, bravoTrainer->contestCategory); sub_80BEF10(2, bravoTrainer->contestRank); if (!StringCompareWithoutExtCtrlCodes(gSpeciesNames[bravoTrainer->species], bravoTrainer->pokemonNickname)) - gUnknown_020387E8 = 8; + sTVShowState = 8; else - gUnknown_020387E8 = 1; + sTVShowState = 1; break; case 1: StringCopy(gStringVar1, gSpeciesNames[bravoTrainer->species]); TVShowConvertInternationalString(gStringVar2, bravoTrainer->pokemonNickname, bravoTrainer->var1f); CopyContestCategoryToStringVar(2, bravoTrainer->contestCategory); - gUnknown_020387E8 = 2; + sTVShowState = 2; break; case 2: TVShowConvertInternationalString(gStringVar1, bravoTrainer->playerName, bravoTrainer->language); if (bravoTrainer->contestResult == 0) // placed first - gUnknown_020387E8 = 3; + sTVShowState = 3; else - gUnknown_020387E8 = 4; + sTVShowState = 4; break; case 3: TVShowConvertInternationalString(gStringVar1, bravoTrainer->playerName, bravoTrainer->language); EasyChat_GetWordText(gStringVar2, bravoTrainer->var04[0]); sub_80BF088(2, bravoTrainer->contestResult + 1); - gUnknown_020387E8 = 5; + sTVShowState = 5; break; case 4: TVShowConvertInternationalString(gStringVar1, bravoTrainer->playerName, bravoTrainer->language); EasyChat_GetWordText(gStringVar2, bravoTrainer->var04[0]); sub_80BF088(2, bravoTrainer->contestResult + 1); - gUnknown_020387E8 = 5; + sTVShowState = 5; break; case 5: TVShowConvertInternationalString(gStringVar1, bravoTrainer->playerName, bravoTrainer->language); CopyContestCategoryToStringVar(1, bravoTrainer->contestCategory); EasyChat_GetWordText(gStringVar3, bravoTrainer->var04[1]); if (bravoTrainer->var14) - gUnknown_020387E8 = 6; + sTVShowState = 6; else - gUnknown_020387E8 = 7; + sTVShowState = 7; break; case 6: StringCopy(gStringVar1, gSpeciesNames[bravoTrainer->species]); StringCopy(gStringVar2, gMoveNames[bravoTrainer->var14]); EasyChat_GetWordText(gStringVar3, bravoTrainer->var04[1]); - gUnknown_020387E8 = 7; + sTVShowState = 7; break; case 7: TVShowConvertInternationalString(gStringVar1, bravoTrainer->playerName, bravoTrainer->language); @@ -2929,7 +2938,7 @@ void DoTVShowBravoTrainerPokemonProfile(void) break; case 8: StringCopy(gStringVar1, gSpeciesNames[bravoTrainer->species]); - gUnknown_020387E8 = 2; + sTVShowState = 2; break; } ShowFieldMessage(gTVBravoTrainerTextGroup[state]); @@ -2941,79 +2950,79 @@ void DoTVShowBravoTrainerBattleTowerProfile(void) u8 state; gSpecialVar_Result = 0; - state = gUnknown_020387E8; + state = sTVShowState; switch(state) { case 0: TVShowConvertInternationalString(gStringVar1, bravoTrainerTower->trainerName, bravoTrainerTower->language); StringCopy(gStringVar2, gSpeciesNames[bravoTrainerTower->species]); if (bravoTrainerTower->var16 >= 7) - gUnknown_020387E8 = 1; + sTVShowState = 1; else - gUnknown_020387E8 = 2; + sTVShowState = 2; break; case 1: sub_80BF088(0, bravoTrainerTower->btLevel); sub_80BF088(1, bravoTrainerTower->var16); if (bravoTrainerTower->var1c == 1) - gUnknown_020387E8 = 3; + sTVShowState = 3; else - gUnknown_020387E8 = 4; + sTVShowState = 4; break; case 2: TVShowConvertInternationalString(gStringVar1, bravoTrainerTower->pokemonName, bravoTrainerTower->language); sub_80BF088(1, bravoTrainerTower->var16 + 1); if (bravoTrainerTower->var1b == 0) - gUnknown_020387E8 = 5; + sTVShowState = 5; else - gUnknown_020387E8 = 6; + sTVShowState = 6; break; case 3: TVShowConvertInternationalString(gStringVar1, bravoTrainerTower->pokemonName, bravoTrainerTower->language); StringCopy(gStringVar2, gSpeciesNames[bravoTrainerTower->defeatedSpecies]); if (bravoTrainerTower->var1b == 0) - gUnknown_020387E8 = 5; + sTVShowState = 5; else - gUnknown_020387E8 = 6; + sTVShowState = 6; break; case 4: TVShowConvertInternationalString(gStringVar1, bravoTrainerTower->pokemonName, bravoTrainerTower->language); StringCopy(gStringVar2, gSpeciesNames[bravoTrainerTower->defeatedSpecies]); if (bravoTrainerTower->var1b == 0) - gUnknown_020387E8 = 5; + sTVShowState = 5; else - gUnknown_020387E8 = 6; + sTVShowState = 6; break; case 5: TVShowConvertInternationalString(gStringVar1, bravoTrainerTower->pokemonName, bravoTrainerTower->language); - gUnknown_020387E8 = 11; + sTVShowState = 11; break; case 6: TVShowConvertInternationalString(gStringVar1, bravoTrainerTower->pokemonName, bravoTrainerTower->language); - gUnknown_020387E8 = 11; + sTVShowState = 11; break; case 7: - gUnknown_020387E8 = 11; + sTVShowState = 11; break; case 8: case 9: case 10: TVShowConvertInternationalString(gStringVar1, bravoTrainerTower->trainerName, bravoTrainerTower->language); - gUnknown_020387E8 = 11; + sTVShowState = 11; break; case 11: EasyChat_GetWordText(gStringVar1, bravoTrainerTower->var18[0]); if (bravoTrainerTower->var1b == 0) - gUnknown_020387E8 = 12; + sTVShowState = 12; else - gUnknown_020387E8 = 13; + sTVShowState = 13; break; case 12: case 13: EasyChat_GetWordText(gStringVar1, bravoTrainerTower->var18[0]); TVShowConvertInternationalString(gStringVar2, bravoTrainerTower->trainerName, bravoTrainerTower->language); TVShowConvertInternationalString(gStringVar3, bravoTrainerTower->pokemonName, bravoTrainerTower->language); - gUnknown_020387E8 = 14; + sTVShowState = 14; break; case 14: TVShowConvertInternationalString(gStringVar1, bravoTrainerTower->trainerName, bravoTrainerTower->language); @@ -3030,61 +3039,61 @@ void DoTVShowTodaysSmartShopper(void) u8 state; gSpecialVar_Result = 0; - state = gUnknown_020387E8; + state = sTVShowState; switch(state) { case 0: TVShowConvertInternationalString(gStringVar1, smartShopper->playerName, smartShopper->language); GetMapSectionName(gStringVar2, smartShopper->shopLocation, 0); if (smartShopper->itemAmounts[0] >= 0xff) - gUnknown_020387E8 = 11; + sTVShowState = 11; else - gUnknown_020387E8 = 1; + sTVShowState = 1; break; case 1: TVShowConvertInternationalString(gStringVar1, smartShopper->playerName, smartShopper->language); StringCopy(gStringVar2, ItemId_GetItem(smartShopper->itemIds[0])->name); sub_80BF088(2, smartShopper->itemAmounts[0]); - gUnknown_020387E8 += (Random() % 4) + 1; + sTVShowState += (Random() % 4) + 1; break; case 2: case 4: case 5: if (smartShopper->itemIds[1] != 0) - gUnknown_020387E8 = 6; + sTVShowState = 6; else - gUnknown_020387E8 = 10; + sTVShowState = 10; break; case 3: sub_80BF088(2, smartShopper->itemAmounts[0] + 1); if (smartShopper->itemIds[1] != 0) - gUnknown_020387E8 = 6; + sTVShowState = 6; else - gUnknown_020387E8 = 10; + sTVShowState = 10; break; case 6: StringCopy(gStringVar2, ItemId_GetItem(smartShopper->itemIds[1])->name); sub_80BF088(2, smartShopper->itemAmounts[1]); if (smartShopper->itemIds[2] != 0) - gUnknown_020387E8 = 7; + sTVShowState = 7; else if (smartShopper->priceReduced == 1) - gUnknown_020387E8 = 8; + sTVShowState = 8; else - gUnknown_020387E8 = 9; + sTVShowState = 9; break; case 7: StringCopy(gStringVar2, ItemId_GetItem(smartShopper->itemIds[2])->name); sub_80BF088(2, smartShopper->itemAmounts[2]); if (smartShopper->priceReduced == 1) - gUnknown_020387E8 = 8; + sTVShowState = 8; else - gUnknown_020387E8 = 9; + sTVShowState = 9; break; case 8: if (smartShopper->itemAmounts[0] < 0xff) - gUnknown_020387E8 = 9; + sTVShowState = 9; else - gUnknown_020387E8 = 12; + sTVShowState = 12; break; case 9: sub_80BF154(1, smartShopper); @@ -3092,17 +3101,17 @@ void DoTVShowTodaysSmartShopper(void) break; case 10: if (smartShopper->priceReduced == 1) - gUnknown_020387E8 = 8; + sTVShowState = 8; else - gUnknown_020387E8 = 9; + sTVShowState = 9; break; case 11: TVShowConvertInternationalString(gStringVar1, smartShopper->playerName, smartShopper->language); StringCopy(gStringVar2, ItemId_GetItem(smartShopper->itemIds[0])->name); if (smartShopper->priceReduced == 1) - gUnknown_020387E8 = 8; + sTVShowState = 8; else - gUnknown_020387E8 = 12; + sTVShowState = 12; break; case 12: TVShowConvertInternationalString(gStringVar1, smartShopper->playerName, smartShopper->language); @@ -3118,14 +3127,14 @@ void DoTVShowTheNameRaterShow(void) u8 state; gSpecialVar_Result = 0; - state = gUnknown_020387E8; + state = sTVShowState; switch (state) { case 0: TVShowConvertInternationalString(gStringVar1, nameRaterShow->trainerName, nameRaterShow->language); StringCopy(gStringVar2, gSpeciesNames[nameRaterShow->species]); TVShowConvertInternationalString(gStringVar3, nameRaterShow->pokemonName, nameRaterShow->pokemonNameLanguage); - gUnknown_020387E8 = sub_80BF7E8(nameRaterShow) + 1; + sTVShowState = sub_80BF7E8(nameRaterShow) + 1; break; case 1: case 3: @@ -3135,20 +3144,20 @@ void DoTVShowTheNameRaterShow(void) case 7: case 8: if (nameRaterShow->random == 0) - gUnknown_020387E8 = 9; + sTVShowState = 9; else if (nameRaterShow->random == 1) - gUnknown_020387E8 = 10; + sTVShowState = 10; else if (nameRaterShow->random == 2) - gUnknown_020387E8 = 11; + sTVShowState = 11; break; case 2: TVShowConvertInternationalString(gStringVar1, nameRaterShow->trainerName, nameRaterShow->language); if (nameRaterShow->random == 0) - gUnknown_020387E8 = 9; + sTVShowState = 9; else if (nameRaterShow->random == 1) - gUnknown_020387E8 = 10; + sTVShowState = 10; else if (nameRaterShow->random == 2) - gUnknown_020387E8 = 11; + sTVShowState = 11; break; case 9: case 10: @@ -3158,7 +3167,7 @@ void DoTVShowTheNameRaterShow(void) sub_80BF820(0, 0, 0, 1, 0, nameRaterShow); TVShowConvertInternationalString(gStringVar2, gStringVar1, nameRaterShow->pokemonNameLanguage); TVShowConvertInternationalString(gStringVar1, nameRaterShow->pokemonName, nameRaterShow->pokemonNameLanguage); - gUnknown_020387E8 = 12; + sTVShowState = 12; break; case 13: sub_80BF820(0, 0, 3, 1, 0, nameRaterShow); @@ -3166,7 +3175,7 @@ void DoTVShowTheNameRaterShow(void) sub_80BF820(0, 0, 2, 0, 0, nameRaterShow); TVShowConvertInternationalString(gStringVar2, gStringVar1, nameRaterShow->language); TVShowConvertInternationalString(gStringVar1, nameRaterShow->trainerName, nameRaterShow->language); - gUnknown_020387E8 = 14; + sTVShowState = 14; break; case 14: sub_80BF820(0, 0, 3, 0, 0, nameRaterShow); @@ -3174,31 +3183,31 @@ void DoTVShowTheNameRaterShow(void) sub_80BF820(0, 0, 2, 1, 0, nameRaterShow); TVShowConvertInternationalString(gStringVar2, gStringVar1, nameRaterShow->pokemonNameLanguage); TVShowConvertInternationalString(gStringVar1, nameRaterShow->trainerName, nameRaterShow->language); - gUnknown_020387E8 = 18; + sTVShowState = 18; break; case 15: sub_80BF820(1, 0, 2, 1, 0, nameRaterShow); TVShowConvertInternationalString(gStringVar1, gStringVar2, nameRaterShow->pokemonNameLanguage); StringCopy(gStringVar2, gSpeciesNames[nameRaterShow->species]); sub_80BF820(2, 0, 3, 2, nameRaterShow->species, nameRaterShow); - gUnknown_020387E8 = 16; + sTVShowState = 16; break; case 16: sub_80BF820(0, 0, 3, 1, 0, nameRaterShow); TVShowConvertInternationalString(gStringVar3, gStringVar1, nameRaterShow->pokemonNameLanguage); sub_80BF820(0, 0, 2, 2, nameRaterShow->species, nameRaterShow); - gUnknown_020387E8 = 17; + sTVShowState = 17; break; case 17: sub_80BF820(1, 0, 2, 1, 0, nameRaterShow); TVShowConvertInternationalString(gStringVar1, gStringVar2, nameRaterShow->pokemonNameLanguage); sub_80BF820(2, 0, 3, 2, nameRaterShow->var1C, nameRaterShow); StringCopy(gStringVar2, gSpeciesNames[nameRaterShow->var1C]); - gUnknown_020387E8 = 18; + sTVShowState = 18; break; case 12: state = 18; - gUnknown_020387E8 = 18; + sTVShowState = 18; case 18: TVShowConvertInternationalString(gStringVar1, nameRaterShow->pokemonName, nameRaterShow->pokemonNameLanguage); TVShowConvertInternationalString(gStringVar2, nameRaterShow->trainerName, nameRaterShow->language); @@ -3214,7 +3223,7 @@ void DoTVShowPokemonTodaySuccessfulCapture(void) u8 state; gSpecialVar_Result = 0; - state = gUnknown_020387E8; + state = sTVShowState; switch (state) { case 0: @@ -3222,53 +3231,53 @@ void DoTVShowPokemonTodaySuccessfulCapture(void) StringCopy(gStringVar2, gSpeciesNames[pokemonToday->species]); TVShowConvertInternationalString(gStringVar3, pokemonToday->nickname, pokemonToday->language2); if (pokemonToday->ball == ITEM_MASTER_BALL) - gUnknown_020387E8 = 5; + sTVShowState = 5; else - gUnknown_020387E8 = 1; + sTVShowState = 1; break; case 1: - gUnknown_020387E8 = 2; + sTVShowState = 2; break; case 2: StringCopy(gStringVar2, ItemId_GetItem(pokemonToday->ball)->name); sub_80BF088(2, pokemonToday->var12); if (pokemonToday->var12 < 4) - gUnknown_020387E8 = 3; + sTVShowState = 3; else - gUnknown_020387E8 = 4; + sTVShowState = 4; break; case 3: TVShowConvertInternationalString(gStringVar1, pokemonToday->playerName, pokemonToday->language); StringCopy(gStringVar2, gSpeciesNames[pokemonToday->species]); TVShowConvertInternationalString(gStringVar3, pokemonToday->nickname, pokemonToday->language2); - gUnknown_020387E8 = 6; + sTVShowState = 6; break; case 4: - gUnknown_020387E8 = 6; + sTVShowState = 6; break; case 5: TVShowConvertInternationalString(gStringVar1, pokemonToday->playerName, pokemonToday->language); StringCopy(gStringVar2, gSpeciesNames[pokemonToday->species]); - gUnknown_020387E8 = 6; + sTVShowState = 6; break; case 6: TVShowConvertInternationalString(gStringVar1, pokemonToday->playerName, pokemonToday->language); StringCopy(gStringVar2, gSpeciesNames[pokemonToday->species]); TVShowConvertInternationalString(gStringVar3, pokemonToday->nickname, pokemonToday->language2); - gUnknown_020387E8 += (Random() % 4) + 1; + sTVShowState += (Random() % 4) + 1; break; case 7: case 8: StringCopy(gStringVar1, gSpeciesNames[pokemonToday->species]); TVShowConvertInternationalString(gStringVar2, pokemonToday->nickname, pokemonToday->language2); sub_80BF638(2, pokemonToday->species); - gUnknown_020387E8 = 11; + sTVShowState = 11; break; case 9: case 10: StringCopy(gStringVar1, gSpeciesNames[pokemonToday->species]); TVShowConvertInternationalString(gStringVar2, pokemonToday->nickname, pokemonToday->language2); - gUnknown_020387E8 = 11; + sTVShowState = 11; break; case 11: TVShowDone(); @@ -3283,36 +3292,36 @@ void DoTVShowPokemonTodayFailedCapture(void) u8 state; gSpecialVar_Result = 0; - state = gUnknown_020387E8; + state = sTVShowState; switch (state) { case 0: TVShowConvertInternationalString(gStringVar1, pokemonTodayFailed->playerName, pokemonTodayFailed->language); StringCopy(gStringVar2, gSpeciesNames[pokemonTodayFailed->species]); - gUnknown_020387E8 = 1; + sTVShowState = 1; break; case 1: TVShowConvertInternationalString(gStringVar1, pokemonTodayFailed->playerName, pokemonTodayFailed->language); GetMapSectionName(gStringVar2, pokemonTodayFailed->var12, 0); StringCopy(gStringVar3, gSpeciesNames[pokemonTodayFailed->species2]); if (pokemonTodayFailed->var11 == 1) - gUnknown_020387E8 = 3; + sTVShowState = 3; else - gUnknown_020387E8 = 2; + sTVShowState = 2; break; case 2: case 3: TVShowConvertInternationalString(gStringVar1, pokemonTodayFailed->playerName, pokemonTodayFailed->language); sub_80BF088(1, pokemonTodayFailed->var10); if ((Random() % 3) == 0) - gUnknown_020387E8 = 5; + sTVShowState = 5; else - gUnknown_020387E8 = 4; + sTVShowState = 4; break; case 4: case 5: TVShowConvertInternationalString(gStringVar1, pokemonTodayFailed->playerName, pokemonTodayFailed->language); - gUnknown_020387E8 = 6; + sTVShowState = 6; break; case 6: TVShowDone(); @@ -3328,32 +3337,32 @@ void DoTVShowPokemonFanClubLetter(void) u16 rval; gSpecialVar_Result = 0; - state = gUnknown_020387E8; + state = sTVShowState; switch (state) { case 0: TVShowConvertInternationalString(gStringVar1, fanclubLetter->playerName, fanclubLetter->language); StringCopy(gStringVar2, gSpeciesNames[fanclubLetter->species]); - gUnknown_020387E8 = 50; + sTVShowState = 50; break; case 1: rval = (Random() % 4) + 1; if (rval == 1) - gUnknown_020387E8 = 2; + sTVShowState = 2; else - gUnknown_020387E8 = rval + 2; + sTVShowState = rval + 2; break; case 2: - gUnknown_020387E8 = 51; + sTVShowState = 51; break; case 3: - gUnknown_020387E8 += (Random() % 3) + 1; + sTVShowState += (Random() % 3) + 1; break; case 4: case 5: case 6: sub_80BF79C((TVShow *)fanclubLetter); - gUnknown_020387E8 = 7; + sTVShowState = 7; break; case 7: rval = (Random() % 0x1f) + 0x46; @@ -3363,12 +3372,12 @@ void DoTVShowPokemonFanClubLetter(void) case 50: ConvertEasyChatWordsToString(gStringVar4, fanclubLetter->pad04, 2, 2); ShowFieldMessage(gStringVar4); - gUnknown_020387E8 = 1; + sTVShowState = 1; return; case 51: ConvertEasyChatWordsToString(gStringVar4, fanclubLetter->pad04, 2, 2); ShowFieldMessage(gStringVar4); - gUnknown_020387E8 = 3; + sTVShowState = 3; return; } ShowFieldMessage(gTVFanClubTextGroup[state]); @@ -3380,21 +3389,21 @@ void DoTVShowRecentHappenings(void) u8 state; gSpecialVar_Result = 0; - state = gUnknown_020387E8; + state = sTVShowState; switch (state) { case 0: TVShowConvertInternationalString(gStringVar1, recentHappenings->playerName, recentHappenings->language); sub_80BF79C((TVShow *)recentHappenings); - gUnknown_020387E8 = 50; + sTVShowState = 50; break; case 1: - gUnknown_020387E8 += 1 + (Random() % 3); + sTVShowState += 1 + (Random() % 3); break; case 2: case 3: case 4: - gUnknown_020387E8 = 5; + sTVShowState = 5; break; case 5: TVShowDone(); @@ -3402,7 +3411,7 @@ void DoTVShowRecentHappenings(void) case 50: ConvertEasyChatWordsToString(gStringVar4, recentHappenings->var04, 2, 2); ShowFieldMessage(gStringVar4); - gUnknown_020387E8 = 1; + sTVShowState = 1; return; } ShowFieldMessage(gTVRecentHappeningsTextGroup[state]); @@ -3414,14 +3423,14 @@ void DoTVShowPokemonFanClubOpinions(void) u8 state; gSpecialVar_Result = 0; - state = gUnknown_020387E8; + state = sTVShowState; switch (state) { case 0: TVShowConvertInternationalString(gStringVar1, fanclubOpinions->playerName, fanclubOpinions->language); StringCopy(gStringVar2, gSpeciesNames[fanclubOpinions->var02]); TVShowConvertInternationalString(gStringVar3, fanclubOpinions->var10, fanclubOpinions->var0E); - gUnknown_020387E8 = fanclubOpinions->var04B + 1; + sTVShowState = fanclubOpinions->var04B + 1; break; case 1: case 2: @@ -3429,7 +3438,7 @@ void DoTVShowPokemonFanClubOpinions(void) TVShowConvertInternationalString(gStringVar1, fanclubOpinions->playerName, fanclubOpinions->language); StringCopy(gStringVar2, gSpeciesNames[fanclubOpinions->var02]); EasyChat_GetWordText(gStringVar3, fanclubOpinions->var1C[0]); - gUnknown_020387E8 = 4; + sTVShowState = 4; break; case 4: TVShowConvertInternationalString(gStringVar1, fanclubOpinions->playerName, fanclubOpinions->language); @@ -3452,7 +3461,7 @@ void DoTVShowPokemonNewsMassOutbreak(void) StringCopy(gStringVar2, gSpeciesNames[massOutbreak->species]); TVShowDone(); StartMassOutbreak(); - ShowFieldMessage(gTVPokemonOutbreakTextGroup[gUnknown_020387E8]); + ShowFieldMessage(gTVPokemonOutbreakTextGroup[sTVShowState]); } void DoTVShowInSearchOfTrainers(void) @@ -3460,49 +3469,49 @@ void DoTVShowInSearchOfTrainers(void) u8 state; gSpecialVar_Result = 0; - state = gUnknown_020387E8; + state = sTVShowState; switch (state) { case 0: GetMapSectionName(gStringVar1, gSaveBlock1.gabbyAndTyData.mapnum, 0); if (gSaveBlock1.gabbyAndTyData.battleNum > 1) - gUnknown_020387E8 = 1; + sTVShowState = 1; else - gUnknown_020387E8 = 2; + sTVShowState = 2; break; case 1: - gUnknown_020387E8 = 2; + sTVShowState = 2; break; case 2: if (gSaveBlock1.gabbyAndTyData.valA_0 == 0) - gUnknown_020387E8 = 4; + sTVShowState = 4; else if (gSaveBlock1.gabbyAndTyData.valA_3 != 0) - gUnknown_020387E8 = 5; + sTVShowState = 5; else if (gSaveBlock1.gabbyAndTyData.valA_2 != 0) - gUnknown_020387E8 = 6; + sTVShowState = 6; else if (gSaveBlock1.gabbyAndTyData.valA_1 != 0) - gUnknown_020387E8 = 7; + sTVShowState = 7; else - gUnknown_020387E8 = 3; + sTVShowState = 3; break; case 3: StringCopy(gStringVar1, gSpeciesNames[gSaveBlock1.gabbyAndTyData.mon1]); StringCopy(gStringVar2, gMoveNames[gSaveBlock1.gabbyAndTyData.lastMove]); StringCopy(gStringVar3, gSpeciesNames[gSaveBlock1.gabbyAndTyData.mon2]); - gUnknown_020387E8 = 8; + sTVShowState = 8; break; case 4: case 5: case 6: case 7: - gUnknown_020387E8 = 8; + sTVShowState = 8; break; case 8: EasyChat_GetWordText(gStringVar1, gSaveBlock1.gabbyAndTyData.quote); StringCopy(gStringVar2, gSpeciesNames[gSaveBlock1.gabbyAndTyData.mon1]); StringCopy(gStringVar3, gSpeciesNames[gSaveBlock1.gabbyAndTyData.mon2]); gSpecialVar_Result = 1; - gUnknown_020387E8 = 0;; + sTVShowState = 0;; TakeTVShowInSearchOfTrainersOffTheAir(); break; } @@ -3516,10 +3525,10 @@ void DoTVShowPokemonAngler(void) gSpecialVar_Result = 0; if (pokemonAngler->var02 < pokemonAngler->var03) - gUnknown_020387E8 = 0; + sTVShowState = 0; else - gUnknown_020387E8 = 1; - state = gUnknown_020387E8; + sTVShowState = 1; + state = sTVShowState; switch (state) { case 0: @@ -3544,7 +3553,7 @@ void DoTVShowTheWorldOfMasters(void) u8 state; gSpecialVar_Result = 0; - state = gUnknown_020387E8; + state = sTVShowState; switch (state) { case 0: @@ -3552,11 +3561,11 @@ void DoTVShowTheWorldOfMasters(void) worldOfMasters->language); sub_80BF088(1, worldOfMasters->var06); sub_80BF088(2, worldOfMasters->var02); - gUnknown_020387E8 = 1; + sTVShowState = 1; break; case 1: StringCopy(gStringVar1, gSpeciesNames[worldOfMasters->var08]); - gUnknown_020387E8 = 2; + sTVShowState = 2; break; case 2: TVShowConvertInternationalString(gStringVar1, worldOfMasters->playerName, @@ -3572,11 +3581,11 @@ void DoTVShowTheWorldOfMasters(void) void TVShowDone(void) { gSpecialVar_Result = 1; - gUnknown_020387E8 = 0; - gSaveBlock1.tvShows[gSpecialVar_0x8004].common.var01 = 0; + sTVShowState = 0; + gSaveBlock1.tvShows[gSpecialVar_0x8004].common.active = 0; } -void sub_80C2014(void) +void ResetTVShowState(void) { - gUnknown_020387E8 = 0; + sTVShowState = 0; } 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); diff --git a/src/pokemon/learn_move.c b/src/pokemon/learn_move.c index 5eee45b23..ef1d66349 100644 --- a/src/pokemon/learn_move.c +++ b/src/pokemon/learn_move.c @@ -239,7 +239,7 @@ void VBlankCB_LearnMove(void) TransferPlttBuffer(); } -void sub_8132670(void) +void TeachMoveTutorMove(void) { ScriptContext2_Enable(); CreateTask(sub_813269C, 10); diff --git a/src/pokemon/pokedex.c b/src/pokemon/pokedex.c index a4d84bebd..1c1c71454 100644 --- a/src/pokemon/pokedex.c +++ b/src/pokemon/pokedex.c @@ -4109,7 +4109,7 @@ u16 GetHoennPokedexCount(u8 caseID) return count; } -bool8 sub_8090FC0(void) +bool8 CompletedHoennPokedex(void) { u16 i; diff --git a/src/pokemon/pokemon_2.c b/src/pokemon/pokemon_2.c index 8e5d7a33f..37bc2e0ad 100644 --- a/src/pokemon/pokemon_2.c +++ b/src/pokemon/pokemon_2.c @@ -1060,7 +1060,7 @@ void CreateSecretBaseEnemyParty(struct SecretBaseRecord *secretBaseRecord) s32 i, j; ZeroEnemyPartyMons(); - memcpy(eSecretBaseRecord, secretBaseRecord, sizeof(*secretBaseRecord)); + *eSecretBaseRecord = *secretBaseRecord; for (i = 0; i < 6; i++) { diff --git a/src/pokemon/pokemon_summary_screen.c b/src/pokemon/pokemon_summary_screen.c index 4de5f5345..9563bc08f 100644 --- a/src/pokemon/pokemon_summary_screen.c +++ b/src/pokemon/pokemon_summary_screen.c @@ -124,10 +124,10 @@ extern struct MusicPlayerInfo gMPlay_BGM; extern u8 gUnknown_020384F0; extern u8 gUnknown_08208238[]; extern u16 gUnknown_030041B8; -extern u16 gUnknown_03004280; -extern u16 gUnknown_030041B4; -extern u16 gUnknown_030042C0; -extern u16 gUnknown_03004288; +extern u16 gBattle_BG2_Y; +extern u16 gBattle_BG1_Y; +extern u16 gBattle_BG1_X; +extern u16 gBattle_BG2_X; extern u16 gUnknown_030041B0; extern TaskFunc gUnknown_03005CF0; extern struct Sprite *gUnknown_020384F4; @@ -582,10 +582,10 @@ void sub_809D844(void) void sub_809D85C(void) { - REG_BG1HOFS = gUnknown_030042C0; - REG_BG1VOFS = gUnknown_030041B4; - REG_BG2HOFS = gUnknown_03004288; - REG_BG2VOFS = gUnknown_03004280; + REG_BG1HOFS = gBattle_BG1_X; + REG_BG1VOFS = gBattle_BG1_Y; + REG_BG2HOFS = gBattle_BG2_X; + REG_BG2VOFS = gBattle_BG2_Y; REG_BG3HOFS = gUnknown_030041B0; REG_BG3VOFS = gUnknown_030041B8; @@ -868,10 +868,10 @@ static void sub_809DE64(void) REG_BG2CNT = 0x4A02; REG_BG3CNT = 0x5C03; - gUnknown_030042C0 = 0; - gUnknown_030041B4 = 0; - gUnknown_03004288 = 0; - gUnknown_03004280 = 0; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + gBattle_BG2_X = 0; + gBattle_BG2_Y = 0; gUnknown_030041B0 = 0; gUnknown_030041B8 = 0; @@ -1167,13 +1167,13 @@ static void sub_809E5C4(void) struct Pokemon *pkmn = &party[pssData.monIndex]; u8 moveIndex1 = pssData.selectedMoveIndex; u8 moveIndex2 = pssData.switchMoveIndex; - + u16 move1 = GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex1); u16 move2 = GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex2); u8 move1pp = GetMonData(pkmn, MON_DATA_PP1 + moveIndex1); u8 move2pp = GetMonData(pkmn, MON_DATA_PP1 + moveIndex2); u8 ppBonuses = GetMonData(pkmn, MON_DATA_PP_BONUSES); - + // Calculate PP bonuses u8 r9 = gUnknown_08208238[moveIndex1]; u8 r2 = (ppBonuses & r9) >> (moveIndex1 * 2); @@ -1182,7 +1182,7 @@ static void sub_809E5C4(void) ppBonuses &= ~r9; ppBonuses &= ~r3; ppBonuses |= (r2 << (moveIndex2 * 2)) + (r1 << (moveIndex1 * 2)); - + // Swap the moves SetMonData(pkmn, MON_DATA_MOVE1 + moveIndex1, &move2); SetMonData(pkmn, MON_DATA_MOVE1 + moveIndex2, &move1); @@ -1197,13 +1197,13 @@ static void sub_809E6D8(void) struct BoxPokemon *pkmn = &boxMons[pssData.monIndex]; u8 moveIndex1 = pssData.selectedMoveIndex; u8 moveIndex2 = pssData.switchMoveIndex; - + u16 move1 = GetBoxMonData(pkmn, MON_DATA_MOVE1 + moveIndex1); u16 move2 = GetBoxMonData(pkmn, MON_DATA_MOVE1 + moveIndex2); u8 move1pp = GetBoxMonData(pkmn, MON_DATA_PP1 + moveIndex1); u8 move2pp = GetBoxMonData(pkmn, MON_DATA_PP1 + moveIndex2); u8 ppBonuses = GetBoxMonData(pkmn, MON_DATA_PP_BONUSES); - + // Calculate PP bonuses u8 r9 = gUnknown_08208238[moveIndex1]; u8 r2 = (ppBonuses & r9) >> (moveIndex1 * 2); @@ -1212,7 +1212,7 @@ static void sub_809E6D8(void) ppBonuses &= ~r9; ppBonuses &= ~r3; ppBonuses |= (r2 << (moveIndex2 * 2)) + (r1 << (moveIndex1 * 2)); - + // Swap the moves SetBoxMonData(pkmn, MON_DATA_MOVE1 + moveIndex1, &move2); SetBoxMonData(pkmn, MON_DATA_MOVE1 + moveIndex2, &move1); @@ -1522,7 +1522,7 @@ static void sub_809EBC4(void) if (pssData.page != PSS_PAGE_INFO) { DrawSummaryScreenNavigationDots(); - gUnknown_030042C0 = 0x100; + gBattle_BG1_X = 0x100; if (pssData.page == PSS_PAGE_SKILLS) REG_BG1CNT = (REG_BG1CNT & 0xE0FF) + 0x800; @@ -1547,7 +1547,7 @@ void sub_809EC38(u8 taskId) { if (pssData.page != PSS_PAGE_INFO) { - gUnknown_03004288 = 0x100; + gBattle_BG2_X = 0x100; } if (pssData.page == PSS_PAGE_SKILLS) @@ -1564,7 +1564,7 @@ void sub_809EC38(u8 taskId) { if (pssData.page != PSS_PAGE_INFO) { - gUnknown_030042C0 = 0x100; + gBattle_BG1_X = 0x100; } if (pssData.page == PSS_PAGE_SKILLS) @@ -1583,8 +1583,8 @@ void sub_809EC38(u8 taskId) case 1: if (pssData.bgToggle == 0) { - int var2 = gUnknown_030042C0 - 0x20; - gUnknown_030042C0 = var2; + int var2 = gBattle_BG1_X - 0x20; + gBattle_BG1_X = var2; if (var2 << 16 == 0) { REG_BG1CNT = (REG_BG1CNT & 0xFFFC) + 2; @@ -1594,8 +1594,8 @@ void sub_809EC38(u8 taskId) } else { - int var2 = gUnknown_03004288 - 0x20; - gUnknown_03004288 = var2; + int var2 = gBattle_BG2_X - 0x20; + gBattle_BG2_X = var2; if (var2 << 16 == 0) { REG_BG1CNT = (REG_BG1CNT & 0xFFFC) + 1; @@ -1663,12 +1663,12 @@ void sub_809EE74(u8 taskId) var1 = pssData.bgToggle; if (var1 == 0) { - gUnknown_03004288 = pssData.bgToggle; + gBattle_BG2_X = pssData.bgToggle; taskData[0]++; } else { - gUnknown_030042C0 = 0; + gBattle_BG1_X = 0; taskData[0]++; } break; @@ -1705,8 +1705,8 @@ void sub_809EE74(u8 taskId) case 2: if (pssData.bgToggle == 0) { - int var2 = gUnknown_03004288 + 0x20; - gUnknown_03004288 = var2; + int var2 = gBattle_BG2_X + 0x20; + gBattle_BG2_X = var2; if ((var2 << 16) == 0x1000000) { taskData[0]++; @@ -1714,8 +1714,8 @@ void sub_809EE74(u8 taskId) } else { - int var2 = gUnknown_030042C0 + 0x20; - gUnknown_030042C0 = var2; + int var2 = gBattle_BG1_X + 0x20; + gBattle_BG1_X = var2; if ((var2 << 16) == 0x1000000) { taskData[0]++; @@ -2078,7 +2078,7 @@ s8 sub_809F344(u8 partyIndex) { while (1) { - partyIndex++; + partyIndex++; if (partyIndex == PARTY_SIZE) { return -1; @@ -2100,7 +2100,7 @@ s8 sub_809F388(u8 partyIndex) return -1; } - partyIndex--; + partyIndex--; if (sub_809F310(&gPlayerParty[sDoubleBattlePartyOrder[partyIndex]]) == TRUE) { return sDoubleBattlePartyOrder[partyIndex]; @@ -2332,7 +2332,7 @@ static bool8 sub_809F7D0(u8 taskId) u16 move; sub_809F678(&mon); - move = GetMonMove(&mon, pssData.selectedMoveIndex); + move = GetMonMove(&mon, pssData.selectedMoveIndex); if (IsHMMove(move) == TRUE && pssData.mode != PSS_MODE_UNKNOWN) { return FALSE; @@ -2341,17 +2341,13 @@ static bool8 sub_809F7D0(u8 taskId) return TRUE; } -#ifdef NONMATCHING // The two "pssData.selectedMoveIndex = taskData[15];" lines have small register differences. void sub_809F814(u8 taskId) { - u16 var1; - s16 *taskData = gTasks[taskId].data; - var1 = taskData[14]; if (taskData[14] < 4) { - taskData[14] = var1 + 1; + taskData[14]++; } else if (gMain.newKeys & DPAD_UP) { @@ -2359,7 +2355,7 @@ void sub_809F814(u8 taskId) taskData[0] = 4; taskData[13] = 1; pssData.selectedMoveIndex = taskData[15]; - sub_809E8F0(taskId, -1); + sub_809E8F0(taskId, -1, &pssData.selectedMoveIndex); } else if (gMain.newKeys & DPAD_DOWN) { @@ -2367,7 +2363,7 @@ void sub_809F814(u8 taskId) taskData[0] = 4; taskData[13] = 1; pssData.selectedMoveIndex = taskData[15]; - sub_809E8F0(taskId, 1); + sub_809E8F0(taskId, 1, &pssData.selectedMoveIndex); } else if ((gMain.newKeys & DPAD_LEFT) || sub_80F9284() == 1) { @@ -2410,229 +2406,6 @@ void sub_809F814(u8 taskId) } } -#else -__attribute__((naked)) -void sub_809F814(u8 taskId) -{ - asm(".syntax unified\n\ - push {r4-r7,lr}\n\ - mov r7, r8\n\ - push {r7}\n\ - lsls r0, 24\n\ - lsrs r5, r0, 24\n\ - lsls r0, r5, 2\n\ - adds r0, r5\n\ - lsls r6, r0, 3\n\ - ldr r0, _0809F83C @ =gTasks + 0x8\n\ - mov r8, r0\n\ - adds r4, r6, r0\n\ - ldrh r1, [r4, 0x1C]\n\ - movs r2, 0x1C\n\ - ldrsh r0, [r4, r2]\n\ - cmp r0, 0x3\n\ - bgt _0809F840\n\ - adds r0, r1, 0x1\n\ - strh r0, [r4, 0x1C]\n\ - b _0809F9C0\n\ - .align 2, 0\n\ -_0809F83C: .4byte gTasks + 0x8\n\ -_0809F840:\n\ - ldr r7, _0809F874 @ =gMain\n\ - ldrh r1, [r7, 0x2E]\n\ - movs r0, 0x40\n\ - ands r0, r1\n\ - cmp r0, 0\n\ - beq _0809F880\n\ - mov r0, r8\n\ - subs r0, 0x8\n\ - adds r0, r6, r0\n\ - ldr r1, _0809F878 @ =sub_809E260\n\ - str r1, [r0]\n\ - movs r0, 0x4\n\ - strh r0, [r4]\n\ - movs r0, 0x1\n\ - strh r0, [r4, 0x1A]\n\ - ldr r2, _0809F87C @ =gSharedMem + 0x18000\n\ - ldrh r0, [r4, 0x1E]\n\ - adds r2, 0x79\n\ - strb r0, [r2]\n\ - movs r1, 0x1\n\ - negs r1, r1\n\ - adds r0, r5, 0\n\ - bl sub_809E8F0\n\ - b _0809F9C0\n\ - .align 2, 0\n\ -_0809F874: .4byte gMain\n\ -_0809F878: .4byte sub_809E260\n\ -_0809F87C: .4byte gSharedMem + 0x18000\n\ -_0809F880:\n\ - movs r0, 0x80\n\ - ands r0, r1\n\ - cmp r0, 0\n\ - beq _0809F8B4\n\ - mov r0, r8\n\ - subs r0, 0x8\n\ - adds r0, r6, r0\n\ - ldr r1, _0809F8AC @ =sub_809E260\n\ - str r1, [r0]\n\ - movs r0, 0x4\n\ - strh r0, [r4]\n\ - movs r0, 0x1\n\ - strh r0, [r4, 0x1A]\n\ - ldr r2, _0809F8B0 @ =gSharedMem + 0x18000\n\ - ldrh r0, [r4, 0x1E]\n\ - adds r2, 0x79\n\ - strb r0, [r2]\n\ - adds r0, r5, 0\n\ - movs r1, 0x1\n\ - bl sub_809E8F0\n\ - b _0809F9C0\n\ - .align 2, 0\n\ -_0809F8AC: .4byte sub_809E260\n\ -_0809F8B0: .4byte gSharedMem + 0x18000\n\ -_0809F8B4:\n\ - movs r0, 0x20\n\ - ands r0, r1\n\ - cmp r0, 0\n\ - bne _0809F8C8\n\ - bl sub_80F9284\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - cmp r0, 0x1\n\ - bne _0809F918\n\ -_0809F8C8:\n\ - ldr r1, _0809F90C @ =gSharedMem + 0x18000\n\ - ldrb r0, [r1, 0xB]\n\ - cmp r0, 0x2\n\ - beq _0809F9C0\n\ - cmp r0, 0x3\n\ - bne _0809F8F4\n\ - adds r0, r1, 0\n\ - adds r0, 0x79\n\ - ldrb r0, [r0]\n\ - cmp r0, 0x4\n\ - bne _0809F8E8\n\ - adds r0, r1, 0\n\ - adds r0, 0x7C\n\ - ldrh r0, [r0]\n\ - cmp r0, 0\n\ - beq _0809F8F4\n\ -_0809F8E8:\n\ - movs r0, 0\n\ - movs r1, 0xE\n\ - movs r2, 0x9\n\ - movs r3, 0x12\n\ - bl MenuZeroFillWindowRect\n\ -_0809F8F4:\n\ - ldr r1, _0809F910 @ =gTasks\n\ - lsls r0, r5, 2\n\ - adds r0, r5\n\ - lsls r0, 3\n\ - adds r0, r1\n\ - ldr r1, _0809F914 @ =sub_809E260\n\ - str r1, [r0]\n\ - movs r1, 0x1\n\ - negs r1, r1\n\ - adds r0, r5, 0\n\ - b _0809F972\n\ - .align 2, 0\n\ -_0809F90C: .4byte gSharedMem + 0x18000\n\ -_0809F910: .4byte gTasks\n\ -_0809F914: .4byte sub_809E260\n\ -_0809F918:\n\ - ldrh r1, [r7, 0x2E]\n\ - movs r0, 0x10\n\ - ands r0, r1\n\ - cmp r0, 0\n\ - bne _0809F92E\n\ - bl sub_80F9284\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - cmp r0, 0x2\n\ - bne _0809F994\n\ -_0809F92E:\n\ - ldr r1, _0809F988 @ =gSharedMem + 0x18000\n\ - adds r2, r1, 0\n\ - adds r2, 0x76\n\ - ldrb r0, [r1, 0xB]\n\ - ldrb r2, [r2]\n\ - cmp r0, r2\n\ - beq _0809F9C0\n\ - cmp r0, 0x2\n\ - bne _0809F960\n\ - adds r0, r1, 0\n\ - adds r0, 0x79\n\ - ldrb r0, [r0]\n\ - cmp r0, 0x4\n\ - bne _0809F954\n\ - adds r0, r1, 0\n\ - adds r0, 0x7C\n\ - ldrh r0, [r0]\n\ - cmp r0, 0\n\ - beq _0809F960\n\ -_0809F954:\n\ - movs r0, 0\n\ - movs r1, 0xE\n\ - movs r2, 0x9\n\ - movs r3, 0x12\n\ - bl MenuZeroFillWindowRect\n\ -_0809F960:\n\ - ldr r1, _0809F98C @ =gTasks\n\ - lsls r0, r5, 2\n\ - adds r0, r5\n\ - lsls r0, 3\n\ - adds r0, r1\n\ - ldr r1, _0809F990 @ =sub_809E260\n\ - str r1, [r0]\n\ - adds r0, r5, 0\n\ - movs r1, 0x1\n\ -_0809F972:\n\ - bl SummaryScreenHandleLeftRightInput\n\ - ldrb r1, [r4, 0x1E]\n\ - movs r0, 0x1\n\ - bl sub_80A1488\n\ - ldrb r1, [r4, 0x1E]\n\ - movs r0, 0x1\n\ - bl sub_80A1654\n\ - b _0809F9C0\n\ - .align 2, 0\n\ -_0809F988: .4byte gSharedMem + 0x18000\n\ -_0809F98C: .4byte gTasks\n\ -_0809F990: .4byte sub_809E260\n\ -_0809F994:\n\ - ldrh r1, [r7, 0x2E]\n\ - movs r0, 0x1\n\ - ands r0, r1\n\ - cmp r0, 0\n\ - bne _0809F9A6\n\ - movs r0, 0x2\n\ - ands r0, r1\n\ - cmp r0, 0\n\ - beq _0809F9C0\n\ -_0809F9A6:\n\ - ldrb r1, [r4, 0x1E]\n\ - movs r0, 0x2\n\ - bl sub_80A1488\n\ - ldrb r1, [r4, 0x1E]\n\ - movs r0, 0x2\n\ - bl sub_80A1654\n\ - mov r0, r8\n\ - subs r0, 0x8\n\ - adds r0, r6, r0\n\ - ldr r1, _0809F9CC @ =sub_809E260\n\ - str r1, [r0]\n\ -_0809F9C0:\n\ - pop {r3}\n\ - mov r8, r3\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - .align 2, 0\n\ -_0809F9CC: .4byte sub_809E260\n\ - .syntax divided\n"); -} -#endif // NONMATCHING - static void sub_809F9D0(u8 taskId, u8 b) { s16 *taskData = gTasks[taskId].data; @@ -3012,7 +2785,7 @@ static void sub_80A015C(struct Pokemon *mon) sub_80A1FF8(gMoveNames[move], 13, 15, (2 * i) + 4); GetStringCenterAlignXOffset(1, 24, (2 * i) + 4); - + ppBonuses = GetMonData(mon, MON_DATA_PP_BONUSES); maxPP = CalculatePPWithBonus(move, ppBonuses, i); diff --git a/src/pokenav_before.c b/src/pokenav_before.c index 6e83c6f97..7693cba7d 100644 --- a/src/pokenav_before.c +++ b/src/pokenav_before.c @@ -308,7 +308,7 @@ void sub_80EBA5C() { gMain.state++; SetMainCallback2(&sub_80EBBE8); break; - } + } break; case 1: SetVBlankCallback(NULL); @@ -331,7 +331,7 @@ void sub_80EBA5C() { case 7: sub_80F1A90(); gMain.state++; - case 8: + case 8: if (sub_80F1AC4()) return; break; case 9: @@ -535,7 +535,7 @@ void sub_80EBDD8() { sub_80EBDBC(&sub_80EC268); } return; - + } } @@ -584,7 +584,7 @@ void sub_80EC00C() { ewram0_10.var304++; return; case 9: - sub_80F2598(); + sub_80F2598(); ewram0_10.var304++; break; case 10: @@ -3479,8 +3479,6 @@ void sub_80EF840(void) } } -// The only non-matching part is the gSaveBlock2.regionMapZoom access. -#ifdef NONMATCHING bool8 sub_80EF874(void) { switch (gUnknown_083DFEC4->unkD160) @@ -3504,7 +3502,7 @@ bool8 sub_80EF874(void) MenuZeroFillScreen(); break; case 5: - sub_80FA904(&gUnknown_083DFEC4->regionMap, gSaveBlock2.regionMapZoom); + sub_80FA904(&gUnknown_083DFEC4->regionMap, gSaveBlock2.regionMapZoom ? TRUE : FALSE); break; case 6: if (sub_80FA940()) @@ -3552,501 +3550,75 @@ bool8 sub_80EF874(void) gUnknown_083DFEC4->unkD160++; return TRUE; } -#else -asm(".include \"constants/gba_constants.inc\"\n"); -__attribute__((naked)) -bool8 sub_80EF874(void) -{ - asm(".syntax unified\n\ - push {lr}\n\ - ldr r0, _080EF890 @ =gUnknown_083DFEC4\n\ - ldr r0, [r0]\n\ - ldr r1, _080EF894 @ =0x0000d160\n\ - adds r0, r1\n\ - ldrh r0, [r0]\n\ - cmp r0, 0xB\n\ - bls _080EF886\n\ - b _080EF9D8\n\ -_080EF886:\n\ - lsls r0, 2\n\ - ldr r1, _080EF898 @ =_080EF89C\n\ - adds r0, r1\n\ - ldr r0, [r0]\n\ - mov pc, r0\n\ - .align 2, 0\n\ -_080EF890: .4byte gUnknown_083DFEC4\n\ -_080EF894: .4byte 0x0000d160\n\ -_080EF898: .4byte _080EF89C\n\ - .align 2, 0\n\ -_080EF89C:\n\ - .4byte _080EF8CC\n\ - .4byte _080EF8D2\n\ - .4byte _080EF8E0\n\ - .4byte _080EF8EC\n\ - .4byte _080EF8F6\n\ - .4byte _080EF8FC\n\ - .4byte _080EF920\n\ - .4byte _080EF92C\n\ - .4byte _080EF940\n\ - .4byte _080EF954\n\ - .4byte _080EF960\n\ - .4byte _080EF972\n\ -_080EF8CC:\n\ - bl sub_80EEDE8\n\ - b _080EF9DC\n\ -_080EF8D2:\n\ - ldr r0, _080EF8DC @ =gWindowConfig_81E7224\n\ - bl SetUpWindowConfig\n\ - b _080EF9DC\n\ - .align 2, 0\n\ -_080EF8DC: .4byte gWindowConfig_81E7224\n\ -_080EF8E0:\n\ - ldr r0, _080EF8E8 @ =gWindowConfig_81E7224\n\ - bl MultistepInitMenuWindowBegin\n\ - b _080EF9DC\n\ - .align 2, 0\n\ -_080EF8E8: .4byte gWindowConfig_81E7224\n\ -_080EF8EC:\n\ - bl MultistepInitMenuWindowContinue\n\ - cmp r0, 0\n\ - bne _080EF9DC\n\ - b _080EF9EA\n\ -_080EF8F6:\n\ - bl MenuZeroFillScreen\n\ - b _080EF9DC\n\ -_080EF8FC:\n\ - ldr r0, _080EF914 @ =gUnknown_083DFEC4\n\ - ldr r0, [r0]\n\ - ldr r2, _080EF918 @ =0x00006e18\n\ - adds r0, r2\n\ - ldr r1, _080EF91C @ =gSaveBlock2\n\ - ldrb r1, [r1, 0x15]\n\ - lsrs r1, 3\n\ - movs r2, 0x1\n\ - ands r1, r2\n\ - bl sub_80FA904\n\ - b _080EF9DC\n\ - .align 2, 0\n\ -_080EF914: .4byte gUnknown_083DFEC4\n\ -_080EF918: .4byte 0x00006e18\n\ -_080EF91C: .4byte gSaveBlock2\n\ -_080EF920:\n\ - bl sub_80FA940\n\ - lsls r0, 24\n\ - cmp r0, 0\n\ - beq _080EF9DC\n\ - b _080EF9EA\n\ -_080EF92C:\n\ - ldr r0, _080EF938 @ =gPokenavHoennMapSquares_Gfx\n\ - ldr r1, _080EF93C @ =0x06005000\n\ - bl LZ77UnCompVram\n\ - b _080EF9DC\n\ - .align 2, 0\n\ -_080EF938: .4byte gPokenavHoennMapSquares_Gfx\n\ -_080EF93C: .4byte 0x06005000\n\ -_080EF940:\n\ - ldr r0, _080EF950 @ =gPokenavHoennMapSquares_Pal\n\ - movs r1, 0x30\n\ - movs r2, 0x20\n\ - bl LoadPalette\n\ - bl sub_80EFC3C\n\ - b _080EF9DC\n\ - .align 2, 0\n\ -_080EF950: .4byte gPokenavHoennMapSquares_Pal\n\ -_080EF954:\n\ - bl sub_80EFC64\n\ - lsls r0, 24\n\ - cmp r0, 0\n\ - beq _080EF9DC\n\ - b _080EF9EA\n\ -_080EF960:\n\ - movs r0, 0xD\n\ - movs r1, 0x3\n\ - movs r2, 0x1D\n\ - movs r3, 0x11\n\ - bl MenuDrawTextWindow\n\ - bl sub_80EF9F8\n\ - b _080EF9DC\n\ -_080EF972:\n\ - ldr r0, _080EF990 @ =gUnknown_083DFEC4\n\ - ldr r1, [r0]\n\ - ldr r2, _080EF994 @ =0x00006e90\n\ - adds r0, r1, r2\n\ - ldrb r0, [r0]\n\ - cmp r0, 0\n\ - bne _080EF9A0\n\ - ldr r2, _080EF998 @ =0x00007698\n\ - adds r0, r1, r2\n\ - movs r1, 0xA0\n\ - strh r1, [r0]\n\ - ldr r0, _080EF99C @ =REG_BG0VOFS\n\ - strh r1, [r0]\n\ - b _080EF9B0\n\ - .align 2, 0\n\ -_080EF990: .4byte gUnknown_083DFEC4\n\ -_080EF994: .4byte 0x00006e90\n\ -_080EF998: .4byte 0x00007698\n\ -_080EF99C: .4byte REG_BG0VOFS\n\ -_080EF9A0:\n\ - ldr r0, _080EF9C8 @ =0x00007698\n\ - adds r1, r0\n\ - movs r2, 0\n\ - movs r0, 0x80\n\ - lsls r0, 1\n\ - strh r0, [r1]\n\ - ldr r0, _080EF9CC @ =REG_BG0VOFS\n\ - strh r2, [r0]\n\ -_080EF9B0:\n\ - ldr r2, _080EF9D0 @ =REG_BG0CNT\n\ - ldrh r0, [r2]\n\ - strh r0, [r2]\n\ - ldrh r0, [r2]\n\ - movs r1, 0x1\n\ - orrs r0, r1\n\ - strh r0, [r2]\n\ - ldr r1, _080EF9D4 @ =REG_BLDCNT\n\ - movs r0, 0\n\ - strh r0, [r1]\n\ - b _080EF9DC\n\ - .align 2, 0\n\ -_080EF9C8: .4byte 0x00007698\n\ -_080EF9CC: .4byte REG_BG0VOFS\n\ -_080EF9D0: .4byte REG_BG0CNT\n\ -_080EF9D4: .4byte REG_BLDCNT\n\ -_080EF9D8:\n\ - movs r0, 0\n\ - b _080EF9EC\n\ -_080EF9DC:\n\ - ldr r0, _080EF9F0 @ =gUnknown_083DFEC4\n\ - ldr r1, [r0]\n\ - ldr r2, _080EF9F4 @ =0x0000d160\n\ - adds r1, r2\n\ - ldrh r0, [r1]\n\ - adds r0, 0x1\n\ - strh r0, [r1]\n\ -_080EF9EA:\n\ - movs r0, 0x1\n\ -_080EF9EC:\n\ - pop {r1}\n\ - bx r1\n\ - .align 2, 0\n\ -_080EF9F0: .4byte gUnknown_083DFEC4\n\ -_080EF9F4: .4byte 0x0000d160\n\ - .syntax divided\n"); -} -#endif // NONMATCHING +asm(".include \"constants/gba_constants.inc\"\n"); -#ifdef NONMATCHING void sub_80EF9F8(void) { - s32 zero; - u16 i; - u8 *mapSectionName; - u32 offset; + bool8 someBool = FALSE; + u16 top = 4; u16 mapSectionId; u8 b; - u8 **pointer; - u16 var1 = 4; - switch (gUnknown_083DFEC4->regionMap.unk16) { + case 0: + break; case 1: case 4: - sub_8072A18(gUnknown_083DFEC4->regionMap.mapSectionName, 0x70, var1 * 8, 0x78, 1); - var1 += 2; - + sub_8072A18(gUnknown_083DFEC4->regionMap.mapSectionName, 0x70, top * 8, 0x78, 1); + top += 2; if (gLinkOpen == TRUE) { sub_80F1A80(); + someBool = TRUE; } else { - i = 0; - while (i < 4 && (mapSectionName = GetLandmarkName(gUnknown_083DFEC4->regionMap.mapSectionId, gUnknown_083DFEC4->regionMap.everGrandeCityArea, i)) != NULL) - { - sub_8072A18(mapSectionName, 0x70, var1 * 8, 0x78, 1); - var1 += 2; - i++; - } - - // This check is always true, but somehow the compiler still performed it. - asm("mov %0, #0\n":"=r"(zero)); // zero = 0 - if (!zero && var1 < 16) - { - MenuFillWindowRectWithBlankTile(14, var1, 28, 15); - } + u16 i; + + for (i = 0; i < 4; i++) + { + const u8 *secName = GetLandmarkName( + gUnknown_083DFEC4->regionMap.mapSectionId, + gUnknown_083DFEC4->regionMap.everGrandeCityArea, + i); + + if (secName == NULL) + break; + sub_8072A18(secName, 0x70, top * 8, 0x78, 1); + top += 2; + } } break; case 2: - sub_8072A18(gUnknown_083DFEC4->regionMap.mapSectionName, 0x70, var1 * 8, 0x78, 1); - var1 += 2; - + sub_8072A18(gUnknown_083DFEC4->regionMap.mapSectionName, 0x70, top * 8, 0x78, 1); + top += 2; mapSectionId = gUnknown_083DFEC4->regionMap.mapSectionId; - b = gUnknown_083DFEC4->regionMap.everGrandeCityArea; - offset = (b << 2) + (mapSectionId << 3); - pointer = (u8 **)((u8 *)&gUnknown_083DFEC4->unkCDCC + offset); - if (*pointer != NULL) - { - MenuFillWindowRectWithBlankTile(14, var1, 15, 15); - MenuFillWindowRectWithBlankTile(26, var1, 28, 15); - - sub_8095C8C((void *)VRAM + 0xF800, 16, 6, *pointer, 0, 0, 10, 10, 10); - - var1 += 11; - } - - // This check is always true, but somehow the compiler still performed it. - asm("mov %0, #0\n":"=r"(zero)); // zero = 0 - if (!zero && var1 < 16) + b = gUnknown_083DFEC4->regionMap.everGrandeCityArea; + if (gUnknown_083DFEC4->unkCDCC[mapSectionId][b] != NULL) { - MenuFillWindowRectWithBlankTile(14, var1, 28, 15); + MenuFillWindowRectWithBlankTile(14, top, 15, 15); + MenuFillWindowRectWithBlankTile(26, top, 28, 15); + sub_8095C8C((void *)(VRAM + 0xF800), 16, 6, gUnknown_083DFEC4->unkCDCC[mapSectionId][b], 0, 0, 10, 10, 10); + top += 11; } break; case 3: - sub_8072A18(gUnknown_083DFEC4->regionMap.mapSectionName, 0x70, var1 * 8, 0x78, 1); - var1 += 2; - - // This check is always true, but somehow the compiler still performed it. - asm("mov %0, #0\n":"=r"(zero)); // zero = 0 - if (!zero && var1 < 16) - { - MenuFillWindowRectWithBlankTile(14, var1, 28, 15); - } - break; - case 0: - default: - // This check is always true, but somehow the compiler still performed it. - asm("mov %0, #0\n":"=r"(zero)); // zero = 0 - if (!zero && var1 < 16) - { - MenuFillWindowRectWithBlankTile(14, var1, 28, 15); - } + sub_8072A18(gUnknown_083DFEC4->regionMap.mapSectionName, 0x70, top * 8, 0x78, 1); + top += 2; break; } + // Epic fail by the compiler at optimizing this. + if (!someBool && top < 16) + MenuFillWindowRectWithBlankTile(14, top, 28, 15); + if (gUnknown_083DFEC4->regionMap.unk16 == 2) - { sub_80EFD74(); - } else - { sub_80EFDA0(); - } -} -#else -__attribute__((naked)) -void sub_80EF9F8(void) -{ - asm(".syntax unified\n\ - push {r4-r6,lr}\n\ - sub sp, 0x14\n\ - movs r5, 0x4\n\ - ldr r0, _080EFA18 @ =gUnknown_083DFEC4\n\ - ldr r0, [r0]\n\ - ldr r1, _080EFA1C @ =0x00006e2e\n\ - adds r0, r1\n\ - ldrb r0, [r0]\n\ - cmp r0, 0x4\n\ - bls _080EFA0E\n\ - b _080EFB6A\n\ -_080EFA0E:\n\ - lsls r0, 2\n\ - ldr r1, _080EFA20 @ =_080EFA24\n\ - adds r0, r1\n\ - ldr r0, [r0]\n\ - mov pc, r0\n\ - .align 2, 0\n\ -_080EFA18: .4byte gUnknown_083DFEC4\n\ -_080EFA1C: .4byte 0x00006e2e\n\ -_080EFA20: .4byte _080EFA24\n\ - .align 2, 0\n\ -_080EFA24:\n\ - .4byte _080EFB6A\n\ - .4byte _080EFA38\n\ - .4byte _080EFAC0\n\ - .4byte _080EFB4C\n\ - .4byte _080EFA38\n\ -_080EFA38:\n\ - ldr r0, _080EFA64 @ =gUnknown_083DFEC4\n\ - ldr r0, [r0]\n\ - ldr r2, _080EFA68 @ =0x00006e18\n\ - adds r0, r2\n\ - lsls r2, r5, 19\n\ - lsrs r2, 16\n\ - movs r1, 0x1\n\ - str r1, [sp]\n\ - movs r1, 0x70\n\ - movs r3, 0x78\n\ - bl sub_8072A18\n\ - adds r0, r5, 0x2\n\ - lsls r0, 16\n\ - lsrs r5, r0, 16\n\ - ldr r0, _080EFA6C @ =gLinkOpen\n\ - ldrb r0, [r0]\n\ - cmp r0, 0x1\n\ - bne _080EFA70\n\ - bl sub_80F1A80\n\ - b _080EFB82\n\ - .align 2, 0\n\ -_080EFA64: .4byte gUnknown_083DFEC4\n\ -_080EFA68: .4byte 0x00006e18\n\ -_080EFA6C: .4byte gLinkOpen\n\ -_080EFA70:\n\ - movs r4, 0\n\ - b _080EFA92\n\ -_080EFA74:\n\ - lsls r2, r5, 19\n\ - lsrs r2, 16\n\ - movs r0, 0x1\n\ - str r0, [sp]\n\ - adds r0, r1, 0\n\ - movs r1, 0x70\n\ - movs r3, 0x78\n\ - bl sub_8072A18\n\ - adds r0, r5, 0x2\n\ - lsls r0, 16\n\ - lsrs r5, r0, 16\n\ - adds r0, r4, 0x1\n\ - lsls r0, 16\n\ - lsrs r4, r0, 16\n\ -_080EFA92:\n\ - cmp r4, 0x3\n\ - bhi _080EFB6A\n\ - ldr r0, _080EFAB8 @ =gUnknown_083DFEC4\n\ - ldr r1, [r0]\n\ - ldr r2, _080EFABC @ =0x00006e2c\n\ - adds r0, r1, r2\n\ - ldrb r0, [r0]\n\ - adds r2, 0x3\n\ - adds r1, r2\n\ - ldrb r1, [r1]\n\ - lsls r2, r4, 24\n\ - lsrs r2, 24\n\ - bl GetLandmarkName\n\ - adds r1, r0, 0\n\ - cmp r1, 0\n\ - bne _080EFA74\n\ - b _080EFB6A\n\ - .align 2, 0\n\ -_080EFAB8: .4byte gUnknown_083DFEC4\n\ -_080EFABC: .4byte 0x00006e2c\n\ -_080EFAC0:\n\ - ldr r0, _080EFB38 @ =gUnknown_083DFEC4\n\ - ldr r4, [r0]\n\ - ldr r1, _080EFB3C @ =0x00006e18\n\ - adds r0, r4, r1\n\ - lsls r2, r5, 19\n\ - lsrs r2, 16\n\ - movs r1, 0x1\n\ - str r1, [sp]\n\ - movs r1, 0x70\n\ - movs r3, 0x78\n\ - bl sub_8072A18\n\ - adds r0, r5, 0x2\n\ - lsls r0, 16\n\ - lsrs r5, r0, 16\n\ - ldr r2, _080EFB40 @ =0x00006e2c\n\ - adds r0, r4, r2\n\ - ldrh r1, [r0]\n\ - adds r2, 0x3\n\ - adds r0, r4, r2\n\ - ldrb r0, [r0]\n\ - lsls r0, 2\n\ - lsls r1, 3\n\ - adds r0, r1\n\ - ldr r1, _080EFB44 @ =0x0000cdcc\n\ - adds r4, r1\n\ - adds r6, r4, r0\n\ - ldr r0, [r6]\n\ - cmp r0, 0\n\ - beq _080EFB6A\n\ - lsls r4, r5, 24\n\ - lsrs r4, 24\n\ - movs r0, 0xE\n\ - adds r1, r4, 0\n\ - movs r2, 0xF\n\ - movs r3, 0xF\n\ - bl MenuFillWindowRectWithBlankTile\n\ - movs r0, 0x1A\n\ - adds r1, r4, 0\n\ - movs r2, 0x1C\n\ - movs r3, 0xF\n\ - bl MenuFillWindowRectWithBlankTile\n\ - ldr r0, _080EFB48 @ =0x0600f800\n\ - ldr r3, [r6]\n\ - movs r1, 0\n\ - str r1, [sp]\n\ - str r1, [sp, 0x4]\n\ - movs r1, 0xA\n\ - str r1, [sp, 0x8]\n\ - str r1, [sp, 0xC]\n\ - str r1, [sp, 0x10]\n\ - movs r1, 0x10\n\ - movs r2, 0x6\n\ - bl sub_8095C8C\n\ - adds r0, r5, 0\n\ - adds r0, 0xB\n\ - b _080EFB66\n\ - .align 2, 0\n\ -_080EFB38: .4byte gUnknown_083DFEC4\n\ -_080EFB3C: .4byte 0x00006e18\n\ -_080EFB40: .4byte 0x00006e2c\n\ -_080EFB44: .4byte 0x0000cdcc\n\ -_080EFB48: .4byte 0x0600f800\n\ -_080EFB4C:\n\ - ldr r0, _080EFB98 @ =gUnknown_083DFEC4\n\ - ldr r0, [r0]\n\ - ldr r2, _080EFB9C @ =0x00006e18\n\ - adds r0, r2\n\ - lsls r2, r5, 19\n\ - lsrs r2, 16\n\ - movs r1, 0x1\n\ - str r1, [sp]\n\ - movs r1, 0x70\n\ - movs r3, 0x78\n\ - bl sub_8072A18\n\ - adds r0, r5, 0x2\n\ -_080EFB66:\n\ - lsls r0, 16\n\ - lsrs r5, r0, 16\n\ -_080EFB6A:\n\ - movs r0, 0\n\ - cmp r0, 0\n\ - bne _080EFB82\n\ - cmp r5, 0xF\n\ - bhi _080EFB82\n\ - lsls r1, r5, 24\n\ - lsrs r1, 24\n\ - movs r0, 0xE\n\ - movs r2, 0x1C\n\ - movs r3, 0xF\n\ - bl MenuFillWindowRectWithBlankTile\n\ -_080EFB82:\n\ - ldr r0, _080EFB98 @ =gUnknown_083DFEC4\n\ - ldr r0, [r0]\n\ - ldr r1, _080EFBA0 @ =0x00006e2e\n\ - adds r0, r1\n\ - ldrb r0, [r0]\n\ - cmp r0, 0x2\n\ - bne _080EFBA4\n\ - bl sub_80EFD74\n\ - b _080EFBA8\n\ - .align 2, 0\n\ -_080EFB98: .4byte gUnknown_083DFEC4\n\ -_080EFB9C: .4byte 0x00006e18\n\ -_080EFBA0: .4byte 0x00006e2e\n\ -_080EFBA4:\n\ - bl sub_80EFDA0\n\ -_080EFBA8:\n\ - add sp, 0x14\n\ - pop {r4-r6}\n\ - pop {r0}\n\ - bx r0\n\ - .syntax divided\n"); } -#endif // NONMATCHING void sub_80EFBB0(void) { @@ -4103,152 +3675,37 @@ void sub_80EFC3C(void) sub_80EFD3C(); } -#ifdef NONMATCHING // "var1 = gUnknown_083DFEC4->unkBC9A;" is the only thing that doesnt' match. bool8 sub_80EFC64(void) { u16 i; - u16 var1; + u8 var1; u16 var2; - if (gUnknown_083DFEC4->unkBC9A < 16) - { - var1 = gUnknown_083DFEC4->unkBC9A; - var2 = gUnknown_083DFEC4->unkBC9B; - for (i = 0; i < 2; i++) - { - if (gPokenavCityMaps[var1][i] != 0) - { - LZ77UnCompVram(gPokenavCityMaps[var1][i], gUnknown_083DFEC4->unkBC9C[var2]); - gUnknown_083DFEC4->unkCDCC[var1][i] = gUnknown_083DFEC4->unkBC9C[var2]; - var2++; - } - else - { - gUnknown_083DFEC4->unkCDCC[var1][i] = NULL; - } - } - - gUnknown_083DFEC4->unkBC9A++; - if (gUnknown_083DFEC4->unkBC9A < 16) - { - gUnknown_083DFEC4->unkBC9B = var2; - return TRUE; - } - } - - return FALSE; -} -#else -__attribute__((naked)) -bool8 sub_80EFC64(void) -{ - asm(".syntax unified\n\ - push {r4-r7,lr}\n\ - mov r7, r9\n\ - mov r6, r8\n\ - push {r6,r7}\n\ - sub sp, 0x8\n\ - ldr r4, _080EFCD0 @ =gUnknown_083DFEC4\n\ - ldr r2, [r4]\n\ - ldr r0, _080EFCD4 @ =0x0000bc9a\n\ - adds r1, r2, r0\n\ - ldrb r0, [r1]\n\ - cmp r0, 0xF\n\ - bhi _080EFD2C\n\ - ldrb r1, [r1]\n\ - mov r8, r1\n\ - ldr r1, _080EFCD8 @ =0x0000bc9b\n\ - adds r0, r2, r1\n\ - ldrb r7, [r0]\n\ - movs r2, 0\n\ - ldr r0, _080EFCDC @ =gPokenavCityMaps\n\ - mov r9, r0\n\ - adds r3, r4, 0\n\ -_080EFC8E:\n\ - lsls r0, r2, 2\n\ - mov r4, r8\n\ - lsls r1, r4, 3\n\ - adds r6, r0, r1\n\ - mov r1, r9\n\ - adds r0, r6, r1\n\ - ldr r1, [r0]\n\ - cmp r1, 0\n\ - beq _080EFCE8\n\ - movs r0, 0xC8\n\ - adds r5, r7, 0\n\ - muls r5, r0\n\ - ldr r4, _080EFCE0 @ =0x0000bc9c\n\ - adds r5, r4\n\ - ldr r4, [r3]\n\ - adds r5, r4, r5\n\ - adds r0, r1, 0\n\ - adds r1, r5, 0\n\ - str r2, [sp]\n\ - str r3, [sp, 0x4]\n\ - bl LZ77UnCompVram\n\ - ldr r0, _080EFCE4 @ =0x0000cdcc\n\ - adds r4, r0\n\ - adds r4, r6\n\ - str r5, [r4]\n\ - adds r0, r7, 0x1\n\ - lsls r0, 16\n\ - lsrs r7, r0, 16\n\ - ldr r2, [sp]\n\ - ldr r3, [sp, 0x4]\n\ - b _080EFCF2\n\ - .align 2, 0\n\ -_080EFCD0: .4byte gUnknown_083DFEC4\n\ -_080EFCD4: .4byte 0x0000bc9a\n\ -_080EFCD8: .4byte 0x0000bc9b\n\ -_080EFCDC: .4byte gPokenavCityMaps\n\ -_080EFCE0: .4byte 0x0000bc9c\n\ -_080EFCE4: .4byte 0x0000cdcc\n\ -_080EFCE8:\n\ - ldr r0, [r3]\n\ - ldr r4, _080EFD1C @ =0x0000cdcc\n\ - adds r0, r4\n\ - adds r0, r6\n\ - str r1, [r0]\n\ -_080EFCF2:\n\ - adds r0, r2, 0x1\n\ - lsls r0, 16\n\ - lsrs r2, r0, 16\n\ - cmp r2, 0x1\n\ - bls _080EFC8E\n\ - ldr r0, _080EFD20 @ =gUnknown_083DFEC4\n\ - ldr r2, [r0]\n\ - ldr r0, _080EFD24 @ =0x0000bc9a\n\ - adds r1, r2, r0\n\ - ldrb r0, [r1]\n\ - adds r0, 0x1\n\ - strb r0, [r1]\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - cmp r0, 0xF\n\ - bhi _080EFD2C\n\ - ldr r1, _080EFD28 @ =0x0000bc9b\n\ - adds r0, r2, r1\n\ - strb r7, [r0]\n\ - movs r0, 0x1\n\ - b _080EFD2E\n\ - .align 2, 0\n\ -_080EFD1C: .4byte 0x0000cdcc\n\ -_080EFD20: .4byte gUnknown_083DFEC4\n\ -_080EFD24: .4byte 0x0000bc9a\n\ -_080EFD28: .4byte 0x0000bc9b\n\ -_080EFD2C:\n\ - movs r0, 0\n\ -_080EFD2E:\n\ - add sp, 0x8\n\ - pop {r3,r4}\n\ - mov r8, r3\n\ - mov r9, r4\n\ - pop {r4-r7}\n\ - pop {r1}\n\ - bx r1\n\ - .syntax divided\n"); + if (gUnknown_083DFEC4->unkBC9A >= 16) + return FALSE; + + var1 = gUnknown_083DFEC4->unkBC9A; + var2 = gUnknown_083DFEC4->unkBC9B; + for (i = 0; i < 2; i++) + { + if (gPokenavCityMaps[var1][i] != 0) + { + LZ77UnCompVram(gPokenavCityMaps[var1][i], gUnknown_083DFEC4->unkBC9C[var2]); + gUnknown_083DFEC4->unkCDCC[var1][i] = gUnknown_083DFEC4->unkBC9C[var2]; + var2++; + } + else + { + gUnknown_083DFEC4->unkCDCC[var1][i] = NULL; + } + } + + if (++gUnknown_083DFEC4->unkBC9A >= 16) + return FALSE; + + gUnknown_083DFEC4->unkBC9B = var2; + return TRUE; } -#endif // NONMATCHING void sub_80EFD3C(void) { @@ -4335,7 +3792,7 @@ void sub_80EFE7C(void) case 2: sub_80EFDE4(1); gUnknown_083DFEC4->unk769D = 1; - break; + break; } } diff --git a/src/rom3.c b/src/rom3.c index dd520a839..cdc66989c 100644 --- a/src/rom3.c +++ b/src/rom3.c @@ -35,7 +35,7 @@ extern u8 gNoOfAllBanks; extern u16 gBattlePartyID[]; extern u8 gBanksBySide[]; extern u16 gCurrentMove; -extern u16 gUnknown_02024BE8; +extern u16 gChosenMove; extern u16 gLastUsedItem; extern u8 gLastUsedAbility; extern u8 gBankAttacker; @@ -80,7 +80,7 @@ void setup_poochyena_battle(void) } sub_800B858(); gBattleExecBuffer = 0; - battle_anim_clear_some_data(); + ClearBattleAnimationVars(); ClearBattleMonForms(); BattleAI_HandleItemUseBeforeAISetup(); if (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE) @@ -745,7 +745,7 @@ void EmitPrintString(u8 a, u16 stringID) stringInfo = (struct StringInfoBattle*)(&gBattleBuffersTransferData[4]); stringInfo->currentMove = gCurrentMove; - stringInfo->lastMove = gUnknown_02024BE8; + stringInfo->lastMove = gChosenMove; stringInfo->lastItem = gLastUsedItem; stringInfo->lastAbility = gLastUsedAbility; stringInfo->scrActive = BATTLE_STRUCT->scriptingActive; @@ -777,7 +777,7 @@ void EmitPrintStringPlayerOnly(u8 a, u16 stringID) stringInfo = (struct StringInfoBattle*)(&gBattleBuffersTransferData[4]); stringInfo->currentMove = gCurrentMove; - stringInfo->lastMove = gUnknown_02024BE8; + stringInfo->lastMove = gChosenMove; stringInfo->lastItem = gLastUsedItem; stringInfo->lastAbility = gLastUsedAbility; stringInfo->scrActive = BATTLE_STRUCT->scriptingActive; diff --git a/src/rom_8077ABC.c b/src/rom_8077ABC.c index 347f113c3..9cf28a111 100644 --- a/src/rom_8077ABC.c +++ b/src/rom_8077ABC.c @@ -28,7 +28,7 @@ #define gBattleMonPartyPositions gBattlePartyID #define gCastformElevations gUnknownCastformData_0837F5A8 #define gCastformBackSpriteYCoords gUnknown_0837F5AC -#define gTransformPersonalities gPID_perBank +#define gTransformPersonalities gTransformedPersonalities #define gBattleMonSprites gObjectBankIDs @@ -86,16 +86,16 @@ extern u16 gBattleMonPartyPositions[]; extern u16 gBattleTypeFlags; extern u32 gTransformPersonalities[NUM_BATTLE_SLOTS]; extern u8 gBattleMonForms[NUM_BATTLE_SLOTS]; -extern u16 gUnknown_0202F7CA[]; +extern u16 gAnimSpeciesByBanks[]; extern u8 gBattleMonSprites[NUM_BATTLE_SLOTS]; -extern u8 gBattleAnimBankAttacker; -extern u8 gBattleAnimBankTarget; +extern u8 gAnimBankAttacker; +extern u8 gAnimBankTarget; extern s16 gBattleAnimArgs[8]; extern u8 gBanksBySide[NUM_BATTLE_SLOTS]; extern u8 gNoOfAllBanks; // gNumBattleMons? extern struct OamMatrix gOamMatrices[]; extern struct Struct_2017810 unk_2017810[]; -extern u8 gHappinessMoveAnim; +extern u8 gAnimFriendship; extern u8 UpdateMonIconFrame(struct Sprite *sprite); @@ -168,12 +168,12 @@ const struct SpriteSheet gUnknown_0837F5E0[] = { }; -u8 sub_8077ABC(u8 slot, u8 a2) { +u8 GetBankPosition(u8 slot, u8 a2) { u8 var; u16 species; struct TransformStatus *transform; - if (NotInBattle()) { + if (IsContest()) { if (a2 == 3 && slot == 3) { a2 = 1; } @@ -189,7 +189,7 @@ u8 sub_8077ABC(u8 slot, u8 a2) { case 3: case 4: default: - if (NotInBattle()) { + if (IsContest()) { if (ewram19348.unk4 & 1) { species = ewram19348.unk2; } else { @@ -229,9 +229,9 @@ u8 sub_8077BFC(u8 slot, u16 species) { u8 ret; u16 var; - if (!GetBankSide(slot) || NotInBattle()) { + if (!GetBankSide(slot) || IsContest()) { if (species == SPECIES_UNOWN) { - if (NotInBattle()) { + if (IsContest()) { if (ewram19348.unk4 & 1) { personality = ewram19348.unk10; } else { @@ -288,7 +288,7 @@ u8 sub_8077BFC(u8 slot, u16 species) { u8 sub_8077DD8(u8 slot, u16 species) { u8 ret = 0; if (GetBankSide(slot) == 1) { - if (!NotInBattle()) { + if (!IsContest()) { if (species == SPECIES_CASTFORM) { ret = gCastformElevations[gBattleMonForms[slot]]; } else if (species > NUM_SPECIES) { @@ -304,7 +304,7 @@ u8 sub_8077DD8(u8 slot, u16 species) { u8 sub_8077E44(u8 slot, u16 species, u8 a3) { u16 offset; u8 y; - if (GetBankSide(slot) == 0 || NotInBattle()) { + if (GetBankSide(slot) == 0 || IsContest()) { offset = sub_8077BFC(slot, species); } else { offset = sub_8077BFC(slot, species); @@ -324,7 +324,7 @@ u8 sub_8077EE4(u8 slot, u8 a2) { u16 species; struct TransformStatus *transform; if (a2 == 3 || a2 == 4) { - if (NotInBattle()) { + if (IsContest()) { if (ewram19348.unk4 & 1) { species = ewram19348.unk2; } else { @@ -333,7 +333,7 @@ u8 sub_8077EE4(u8 slot, u8 a2) { } else { transform = &eTransformStatuses[slot]; if (!transform->species) { - species = gUnknown_0202F7CA[slot]; + species = gAnimSpeciesByBanks[slot]; } else { species = transform->species; } @@ -344,20 +344,20 @@ u8 sub_8077EE4(u8 slot, u8 a2) { return sub_8077E44(slot, species, 0); } } else { - return sub_8077ABC(slot, a2); + return GetBankPosition(slot, a2); } } u8 sub_8077F68(u8 slot) { - return sub_8077ABC(slot, 4); + return GetBankPosition(slot, 4); } u8 sub_8077F7C(u8 slot) { u16 var; if (GetBankSide(slot)) { - var = sub_8077ABC(slot, 1) + 16; + var = GetBankPosition(slot, 1) + 16; } else { - var = sub_8077ABC(slot, 1) + 17; + var = GetBankPosition(slot, 1) + 17; } return var; } @@ -366,8 +366,8 @@ u8 sub_8077FC0(u8 slot) { u16 var; u8 r6; struct TransformStatus *transform; - r6 = sub_8077ABC(slot, 1); - if (!NotInBattle()) { + r6 = GetBankPosition(slot, 1); + if (!IsContest()) { if (GetBankSide(slot)) { transform = &eTransformStatuses[slot]; if (!transform->species) { @@ -392,29 +392,29 @@ u8 sub_8077FC0(u8 slot) { u8 GetAnimBankSpriteId(u8 whichBank) { u8 *sprites; - if (whichBank == ANIM_BANK_ATK) { - if (AnimBankSpriteExists(gBattleAnimBankAttacker)) { + if (whichBank == ANIM_BANK_ATTACKER) { + if (IsBankSpritePresent(gAnimBankAttacker)) { sprites = gBattleMonSprites; - return sprites[gBattleAnimBankAttacker]; + return sprites[gAnimBankAttacker]; } else { return 0xff; } - } else if (whichBank == ANIM_BANK_DEF) { - if (AnimBankSpriteExists(gBattleAnimBankTarget)) { + } else if (whichBank == ANIM_BANK_TARGET) { + if (IsBankSpritePresent(gAnimBankTarget)) { sprites = gBattleMonSprites; - return sprites[gBattleAnimBankTarget]; + return sprites[gAnimBankTarget]; } else { return 0xff; } } else if (whichBank == ANIM_BANK_ATK_PARTNER) { - if (!IsAnimBankSpriteVisible(gBattleAnimBankAttacker ^ 2)) { + if (!IsAnimBankSpriteVisible(gAnimBankAttacker ^ 2)) { return 0xff; } else { - return gBattleMonSprites[gBattleAnimBankAttacker ^ 2]; + return gBattleMonSprites[gAnimBankAttacker ^ 2]; } } else { - if (IsAnimBankSpriteVisible(gBattleAnimBankTarget ^ 2)) { - return gBattleMonSprites[gBattleAnimBankTarget ^ 2]; + if (IsAnimBankSpriteVisible(gAnimBankTarget ^ 2)) { + return gBattleMonSprites[gAnimBankTarget ^ 2]; } else { return 0xff; } @@ -567,8 +567,8 @@ void sub_80783D0(struct Sprite *sprite) { void unref_sub_8078414(struct Sprite *sprite) { sprite->data[1] = sprite->pos1.x + sprite->pos2.x; sprite->data[3] = sprite->pos1.y + sprite->pos2.y; - sprite->data[2] = sub_8077ABC(gBattleAnimBankTarget, 2); - sprite->data[4] = sub_8077ABC(gBattleAnimBankTarget, 3); + sprite->data[2] = GetBankPosition(gAnimBankTarget, 2); + sprite->data[4] = GetBankPosition(gAnimBankTarget, 3); sprite->callback = sub_80782F8; } @@ -613,14 +613,14 @@ void sub_8078504(struct Sprite *sprite) { void move_anim_8074EE0(struct Sprite *sprite) { FreeSpriteOamMatrix(sprite); - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } void unref_sub_8078588(struct Sprite *sprite) { sprite->data[1] = sprite->pos1.x + sprite->pos2.x; sprite->data[3] = sprite->pos1.y + sprite->pos2.y; - sprite->data[2] = sub_8077ABC(gBattleAnimBankAttacker, 2); - sprite->data[4] = sub_8077ABC(gBattleAnimBankAttacker, 3); + sprite->data[2] = GetBankPosition(gAnimBankAttacker, 2); + sprite->data[4] = GetBankPosition(gAnimBankAttacker, 3); sprite->callback = sub_80782F8; } @@ -644,7 +644,7 @@ void sub_8078600(struct Sprite *sprite) { void sub_807861C(struct Sprite *sprite) { REG_BLDCNT = 0; REG_BLDALPHA = 0; - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } void sub_8078634(u8 task) { @@ -654,19 +654,19 @@ void sub_8078634(u8 task) { } void sub_8078650(struct Sprite *sprite) { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 2); - sprite->pos1.y = sub_8077ABC(gBattleAnimBankAttacker, 3); + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2); + sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 3); } void sub_807867C(struct Sprite *sprite, s16 a2) { - u16 v1 = sub_8077ABC(gBattleAnimBankAttacker, 0); - u16 v2 = sub_8077ABC(gBattleAnimBankTarget, 0); + u16 v1 = GetBankPosition(gAnimBankAttacker, 0); + u16 v2 = GetBankPosition(gAnimBankTarget, 0); if (v1 > v2) { sprite->pos1.x -= a2; } else if (v1 < v2) { sprite->pos1.x += a2; } else { - if (GetBankSide(gBattleAnimBankAttacker)) { + if (GetBankSide(gAnimBankAttacker)) { sprite->pos1.x -= a2; } else { sprite->pos1.x += a2; @@ -700,8 +700,8 @@ void oamt_add_pos2_onto_pos1(struct Sprite *sprite) { void sub_8078764(struct Sprite *sprite, u8 a2) { if (!a2) { - sprite->pos1.x = sub_8077EE4(gBattleAnimBankTarget, 0); - sprite->pos1.y = sub_8077EE4(gBattleAnimBankTarget, 1); + sprite->pos1.x = sub_8077EE4(gAnimBankTarget, 0); + sprite->pos1.y = sub_8077EE4(gAnimBankTarget, 1); } sub_807867C(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; @@ -709,11 +709,11 @@ void sub_8078764(struct Sprite *sprite, u8 a2) { void sub_80787B0(struct Sprite *sprite, u8 a2) { if (!a2) { - sprite->pos1.x = sub_8077EE4(gBattleAnimBankAttacker, 0); - sprite->pos1.y = sub_8077EE4(gBattleAnimBankAttacker, 1); + sprite->pos1.x = sub_8077EE4(gAnimBankAttacker, 0); + sprite->pos1.y = sub_8077EE4(gAnimBankAttacker, 1); } else { - sprite->pos1.x = sub_8077EE4(gBattleAnimBankAttacker, 2); - sprite->pos1.y = sub_8077EE4(gBattleAnimBankAttacker, 3); + sprite->pos1.x = sub_8077EE4(gAnimBankAttacker, 2); + sprite->pos1.y = sub_8077EE4(gAnimBankAttacker, 3); } sub_807867C(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; @@ -737,12 +737,12 @@ u8 GetBankByPlayerAI(u8 slot) { return i; } -bool8 AnimBankSpriteExists(u8 slot) { - if (NotInBattle()) { - if (gBattleAnimBankAttacker == slot) { +bool8 IsBankSpritePresent(u8 slot) { + if (IsContest()) { + if (gAnimBankAttacker == slot) { return TRUE; } - if (gBattleAnimBankTarget == slot) { + if (gAnimBankTarget == slot) { return TRUE; } return FALSE; @@ -768,7 +768,7 @@ bool8 IsDoubleBattle() { } void sub_8078914(struct Struct_sub_8078914 *unk) { - if (NotInBattle()) { + if (IsContest()) { unk->field_0 = (u8 *)0x6008000; unk->field_4 = (u8 *)0x600f000; unk->field_8 = 0xe; @@ -780,11 +780,11 @@ void sub_8078914(struct Struct_sub_8078914 *unk) { } void sub_8078954(struct Struct_sub_8078914 *unk) { - if (NotInBattle()) { + if (IsContest()) { unk->field_0 = (u8 *)0x6008000; unk->field_4 = (u8 *)0x600f000; unk->field_8 = 0xe; - } else if (GetBankIdentity_permutated(gBattleAnimBankAttacker) == 1) { + } else if (GetBankIdentity_permutated(gAnimBankAttacker) == 1) { unk->field_0 = (u8 *)0x6004000; unk->field_4 = (u8 *)0x600e000; unk->field_8 = 0x8; @@ -796,7 +796,7 @@ void sub_8078954(struct Struct_sub_8078914 *unk) { } u8 sub_80789BC() { - if (NotInBattle()) { + if (IsContest()) { return 1; } return 2; @@ -806,7 +806,7 @@ void sub_80789D4(bool8 a1) { if (!a1) { BG3CNT.size = 0; BG3CNT.overflow = 1; - } else if (NotInBattle()) { + } else if (IsContest()) { BG3CNT.size = 0; BG3CNT.overflow = 1; } else { @@ -1011,7 +1011,7 @@ void obj_id_set_rotscale(u8 sprite, s16 xScale, s16 yScale, u16 rotation) { } bool8 sub_8078E38() { - if (NotInBattle()) { + if (IsContest()) { if (gSprites[GetAnimBankSpriteId(0)].data[2] == 0xc9 /* XXX SPECIES_UNOWN? */) { return FALSE; } @@ -1022,12 +1022,12 @@ bool8 sub_8078E38() { void sub_8078E70(u8 sprite, u8 a2) { u8 r7 = gSprites[sprite].data[0]; - if (NotInBattle() || IsAnimBankSpriteVisible(r7)) { + if (IsContest() || IsAnimBankSpriteVisible(r7)) { gSprites[sprite].invisible = FALSE; } gSprites[sprite].oam.objMode = a2; gSprites[sprite].affineAnimPaused = TRUE; - if (!NotInBattle() && !gSprites[sprite].oam.affineMode) { + if (!IsContest() && !gSprites[sprite].oam.affineMode) { gSprites[sprite].oam.matrixNum = ewram17810[r7].unk6; } gSprites[sprite].oam.affineMode = 3; @@ -1119,41 +1119,41 @@ u32 sub_80791A8(u8 a1, u8 a2, u8 a3, u8 a4, u8 a5, u8 a6, u8 a7) { u32 var = 0; u32 shift; if (a1) { - if (!NotInBattle()) { + if (!IsContest()) { var = 0xe; } else { var = 1 << sub_80789BC(); } } if (a2) { - shift = gBattleAnimBankAttacker + 16; + shift = gAnimBankAttacker + 16; var |= 1 << shift; } if (a3) { - shift = gBattleAnimBankTarget + 16; + shift = gAnimBankTarget + 16; var |= 1 << shift; } if (a4) { - if (IsAnimBankSpriteVisible(gBattleAnimBankAttacker ^ 2)) { - shift = (gBattleAnimBankAttacker ^ 2) + 16; + if (IsAnimBankSpriteVisible(gAnimBankAttacker ^ 2)) { + shift = (gAnimBankAttacker ^ 2) + 16; var |= 1 << shift; } } if (a5) { - if (IsAnimBankSpriteVisible(gBattleAnimBankTarget ^ 2)) { - shift = (gBattleAnimBankTarget ^ 2) + 16; + if (IsAnimBankSpriteVisible(gAnimBankTarget ^ 2)) { + shift = (gAnimBankTarget ^ 2) + 16; var |= 1 << shift; } } if (a6) { - if (!NotInBattle()) { + if (!IsContest()) { var |= 0x100; } else { var |= 0x4000; } } if (a7) { - if (!NotInBattle()) { + if (!IsContest()) { var |= 0x200; } } @@ -1163,7 +1163,7 @@ u32 sub_80791A8(u8 a1, u8 a2, u8 a3, u8 a4, u8 a5, u8 a6, u8 a7) { u32 sub_80792C0(u8 a1, u8 a2, u8 a3, u8 a4) { u32 var = 0; u32 shift; - if (NotInBattle()) { + if (IsContest()) { if (a1) { var |= 1 << 18; return var; @@ -1238,24 +1238,24 @@ void sub_807941C(struct Sprite *sprite) { v2 = 1; } sub_80787B0(sprite, v1); - if (GetBankSide(gBattleAnimBankAttacker)) { + if (GetBankSide(gAnimBankAttacker)) { gBattleAnimArgs[2] = -gBattleAnimArgs[2]; } sprite->data[0] = gBattleAnimArgs[4]; - sprite->data[2] = sub_8077ABC(gBattleAnimBankTarget, 2) + gBattleAnimArgs[2]; - sprite->data[4] = sub_8077ABC(gBattleAnimBankTarget, v2) + gBattleAnimArgs[3]; + sprite->data[2] = GetBankPosition(gAnimBankTarget, 2) + gBattleAnimArgs[2]; + sprite->data[4] = GetBankPosition(gAnimBankTarget, v2) + gBattleAnimArgs[3]; sprite->callback = sub_8078B34; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); } void sub_80794A8(struct Sprite *sprite) { sub_80787B0(sprite, 1); - if (GetBankSide(gBattleAnimBankAttacker)) { + if (GetBankSide(gAnimBankAttacker)) { gBattleAnimArgs[2] = -gBattleAnimArgs[2]; } sprite->data[0] = gBattleAnimArgs[4]; - sprite->data[2] = sub_8077ABC(gBattleAnimBankTarget, 2) + gBattleAnimArgs[2]; - sprite->data[4] = sub_8077ABC(gBattleAnimBankTarget, 3) + gBattleAnimArgs[3]; + sprite->data[2] = GetBankPosition(gAnimBankTarget, 2) + gBattleAnimArgs[2]; + sprite->data[4] = GetBankPosition(gAnimBankTarget, 3) + gBattleAnimArgs[3]; sprite->data[5] = gBattleAnimArgs[5]; sub_80786EC(sprite); sprite->callback = sub_8079518; @@ -1263,7 +1263,7 @@ void sub_80794A8(struct Sprite *sprite) { void sub_8079518(struct Sprite *sprite) { if (sub_8078718(sprite)) { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } @@ -1278,20 +1278,20 @@ void sub_8079534(struct Sprite *sprite) { } if (!gBattleAnimArgs[5]) { sub_80787B0(sprite, r4); - slot = gBattleAnimBankAttacker; + slot = gAnimBankAttacker; } else { sub_8078764(sprite, r4); - slot = gBattleAnimBankTarget; + slot = gAnimBankTarget; } - if (GetBankSide(gBattleAnimBankAttacker)) { + if (GetBankSide(gAnimBankAttacker)) { gBattleAnimArgs[2] = -gBattleAnimArgs[2]; } sub_8078764(sprite, r4); sprite->data[0] = gBattleAnimArgs[4]; - sprite->data[2] = sub_8077ABC(slot, 2) + gBattleAnimArgs[2]; - sprite->data[4] = sub_8077ABC(slot, r7) + gBattleAnimArgs[3]; + sprite->data[2] = GetBankPosition(slot, 2) + gBattleAnimArgs[2]; + sprite->data[4] = GetBankPosition(slot, r7) + gBattleAnimArgs[3]; sprite->callback = sub_8078B34; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); } s16 duplicate_obj_of_side_rel2move_in_transparent_mode(u8 a1) { @@ -1524,7 +1524,7 @@ u16 sub_8079B10(u8 sprite) { u16 i; for (i = 0; i < (sizeof(gBattleMonSprites) / sizeof(u8)); i++) { if (gBattleMonSprites[i] == sprite) { - if (NotInBattle()) { + if (IsContest()) { species = ewram19348.unk0; return gMonBackPicCoords[species].y_offset; } else { @@ -1565,7 +1565,7 @@ void *sub_8079BFC(s16 bottom, s16 top) { void sub_8079C08(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7) { task->data[8] = a7; - task->data[15] = a2; + task->data[15] = a2; // spriteId task->data[9] = a3; task->data[10] = a4; task->data[13] = a5; @@ -1596,11 +1596,11 @@ u8 sub_8079C74(struct Task *task) { void sub_8079CEC(u8 task) { u16 v1; - if (gHappinessMoveAnim <= 30) { + if (gAnimFriendship <= 30) { v1 = 0; - } else if (gHappinessMoveAnim <= 100) { + } else if (gAnimFriendship <= 100) { v1 = 1; - } else if (gHappinessMoveAnim <= 200) { + } else if (gAnimFriendship <= 200) { v1 = 2; } else { v1 = 3; @@ -1610,17 +1610,17 @@ void sub_8079CEC(u8 task) { } void unref_sub_8079D20(u8 priority) { - if (IsAnimBankSpriteVisible(gBattleAnimBankTarget)) { - gSprites[gBattleMonSprites[gBattleAnimBankTarget]].oam.priority = priority; + if (IsAnimBankSpriteVisible(gAnimBankTarget)) { + gSprites[gBattleMonSprites[gAnimBankTarget]].oam.priority = priority; } - if (IsAnimBankSpriteVisible(gBattleAnimBankAttacker)) { - gSprites[gBattleMonSprites[gBattleAnimBankAttacker]].oam.priority = priority; + if (IsAnimBankSpriteVisible(gAnimBankAttacker)) { + gSprites[gBattleMonSprites[gAnimBankAttacker]].oam.priority = priority; } - if (IsAnimBankSpriteVisible(gBattleAnimBankTarget ^ 2)) { - gSprites[gBattleMonSprites[gBattleAnimBankTarget ^ 2]].oam.priority = priority; + if (IsAnimBankSpriteVisible(gAnimBankTarget ^ 2)) { + gSprites[gBattleMonSprites[gAnimBankTarget ^ 2]].oam.priority = priority; } - if (IsAnimBankSpriteVisible(gBattleAnimBankAttacker ^ 2)) { - gSprites[gBattleMonSprites[gBattleAnimBankAttacker ^ 2]].oam.priority = priority; + if (IsAnimBankSpriteVisible(gAnimBankAttacker ^ 2)) { + gSprites[gBattleMonSprites[gAnimBankAttacker ^ 2]].oam.priority = priority; } } @@ -1637,7 +1637,7 @@ void sub_8079E24() { u8 sub_8079E90(u8 slot) { u8 status; u8 ret; - if (NotInBattle()) { + if (IsContest()) { if (slot == 2) { return 30; } else { @@ -1660,7 +1660,7 @@ u8 sub_8079E90(u8 slot) { u8 sub_8079ED4(u8 slot) { u8 status = GetBankIdentity(slot); - if (NotInBattle()) { + if (IsContest()) { return 2; } if (status == 0 || status == 3) { @@ -1672,7 +1672,7 @@ u8 sub_8079ED4(u8 slot) { u8 GetBankIdentity_permutated(u8 slot) { u8 status; - if (!NotInBattle()) { + if (!IsContest()) { status = GetBankIdentity(slot); if (status == 0 || status == 3) { return 2; @@ -1728,7 +1728,7 @@ u8 sub_8079F44(u16 species, u8 isBackpic, u8 a3, s16 a4, s16 a5, u8 a6, u32 a7, } else { sprite = CreateSprite(&gSpriteTemplate_837F5B0[a3], a4, a5 + gMonBackPicCoords[species].y_offset, a6); } - if (NotInBattle()) { + if (IsContest()) { gSprites[sprite].affineAnims = gSpriteAffineAnimTable_81E7C18; StartSpriteAffineAnim(&gSprites[sprite], 0); } @@ -1747,7 +1747,7 @@ int sub_807A100(u8 slot, u8 a2) { int ret; const struct MonCoords *coords; struct TransformStatus *transform; - if (NotInBattle()) { + if (IsContest()) { if (ewram19348.unk4 & 1) { species = ewram19348.unk2; personality = ewram19348.unk10; @@ -1826,15 +1826,15 @@ int sub_807A100(u8 slot, u8 a2) { case 1: return (coords->coords >> 4) * 8; case 4: - return sub_8077ABC(slot, 2) - ((coords->coords >> 4) * 4); + return GetBankPosition(slot, 2) - ((coords->coords >> 4) * 4); case 5: - return sub_8077ABC(slot, 2) + ((coords->coords >> 4) * 4); + return GetBankPosition(slot, 2) + ((coords->coords >> 4) * 4); case 2: - return sub_8077ABC(slot, 3) - ((coords->coords & 0xf) * 4); + return GetBankPosition(slot, 3) - ((coords->coords & 0xf) * 4); case 3: - return sub_8077ABC(slot, 3) + ((coords->coords & 0xf) * 4); + return GetBankPosition(slot, 3) + ((coords->coords & 0xf) * 4); case 6: - ret = sub_8077ABC(slot, 1) + 0x1f; + ret = GetBankPosition(slot, 1) + 0x1f; return ret - coords->y_offset; default: return 0; @@ -1852,11 +1852,11 @@ void sub_807A3FC(u8 slot, u8 a2, s16 *a3, s16 *a4) { v1 = 2; v2 = 3; } - v3 = sub_8077ABC(slot, v1); - v4 = sub_8077ABC(slot, v2); - if (IsDoubleBattle() && !NotInBattle()) { - v5 = sub_8077ABC(slot ^ 2, v1); - v6 = sub_8077ABC(slot ^ 2, v2); + v3 = GetBankPosition(slot, v1); + v4 = GetBankPosition(slot, v2); + if (IsDoubleBattle() && !IsContest()) { + v5 = GetBankPosition(slot ^ 2, v1); + v6 = GetBankPosition(slot ^ 2, v2); } else { v5 = v3; v6 = v4; @@ -1878,7 +1878,7 @@ u8 sub_807A4A0(int a1, u8 sprite, int a3) { void sub_807A544(struct Sprite *sprite) { sub_8078650(sprite); - if (GetBankSide(gBattleAnimBankAttacker)) { + if (GetBankSide(gAnimBankAttacker)) { sprite->pos1.x -= gBattleAnimArgs[0]; gBattleAnimArgs[3] = -gBattleAnimArgs[3]; sprite->hFlip = TRUE; @@ -1895,7 +1895,7 @@ void sub_807A544(struct Sprite *sprite) { } void sub_807A5C4(struct Sprite *sprite) { - if (GetBankSide(gBattleAnimBankAttacker)) { + if (GetBankSide(gAnimBankAttacker)) { sprite->pos1.x -= gBattleAnimArgs[0]; gBattleAnimArgs[3] *= -1; } else { @@ -1913,14 +1913,14 @@ void sub_807A5C4(struct Sprite *sprite) { void sub_807A63C(struct Sprite *sprite) { sub_8078650(sprite); - if (GetBankSide(gBattleAnimBankAttacker)) { + if (GetBankSide(gAnimBankAttacker)) { sprite->pos1.x -= gBattleAnimArgs[0]; } else { sprite->pos1.x += gBattleAnimArgs[0]; } sprite->pos1.y += gBattleAnimArgs[1]; sprite->callback = sub_8078600; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); } void sub_807A69C(u8 taskId) { @@ -1928,7 +1928,7 @@ void sub_807A69C(u8 taskId) { u16 dest; struct Task *task = &gTasks[taskId]; task->data[0] = GetAnimBankSpriteId(0); - task->data[1] = (GetBankSide(gBattleAnimBankAttacker)) ? -8 : 8; + task->data[1] = (GetBankSide(gAnimBankAttacker)) ? -8 : 8; task->data[2] = 0; task->data[3] = 0; gSprites[task->data[0]].pos2.x -= task->data[0]; @@ -1937,7 +1937,7 @@ void sub_807A69C(u8 taskId) { dest = (task->data[4] + 0x10) * 0x10; src = (gSprites[task->data[0]].oam.paletteNum + 0x10) * 0x10; - task->data[6] = sub_8079E90(gBattleAnimBankAttacker); + task->data[6] = sub_8079E90(gAnimBankAttacker); if (task->data[6] == 20 || task->data[6] == 40) { task->data[6] = 2; } else { @@ -1998,9 +1998,9 @@ void sub_807A8D4(struct Sprite *sprite) { } void sub_807A908(struct Sprite *sprite) { - sprite->pos1.x = sub_8077ABC(gBattleAnimBankAttacker, 2); - sprite->pos1.y = sub_8077ABC(gBattleAnimBankAttacker, 3); - if (!GetBankSide(gBattleAnimBankAttacker)) { + sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2); + sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 3); + if (!GetBankSide(gAnimBankAttacker)) { sprite->data[0] = 5; } else { sprite->data[0] = -10; @@ -2018,7 +2018,7 @@ void sub_807A960(struct Sprite *sprite) { sprite->data[1]++; } if ((sprite->pos1.y + sprite->pos2.y) < -32) { - move_anim_8072740(sprite); + DestroyAnimSprite(sprite); } } @@ -2027,7 +2027,7 @@ void sub_807A9BC(struct Sprite *sprite) { sprite->data[0] = gBattleAnimArgs[2]; sprite->data[2] = sprite->pos1.x + gBattleAnimArgs[4]; sprite->data[4] = sprite->pos1.y + gBattleAnimArgs[5]; - if (!GetBankSide(gBattleAnimBankTarget)) { + if (!GetBankSide(gAnimBankTarget)) { x = (u16)gBattleAnimArgs[4] + 30; sprite->pos1.x += x; sprite->pos1.y = gBattleAnimArgs[5] - 20; @@ -2037,5 +2037,5 @@ void sub_807A9BC(struct Sprite *sprite) { sprite->pos1.y = gBattleAnimArgs[5] - 80; } sprite->callback = sub_8078B34; - StoreSpriteCallbackInData(sprite, move_anim_8072740); + StoreSpriteCallbackInData(sprite, DestroyAnimSprite); } diff --git a/src/scene/berry_blender.c b/src/scene/berry_blender.c index d147d11ce..53308e856 100644 --- a/src/scene/berry_blender.c +++ b/src/scene/berry_blender.c @@ -200,7 +200,7 @@ void sub_80A6978(void); u8 sub_80A7DEC(u8 berryId, u8 x, u8 y, bool8 animate); void sub_814A880(u8 a1, u8 a2); u8 sub_814A5C0(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5); -s8 sub_810CA00(void); +s8 GetFirstFreePokeblockSlot(void); bool8 sub_810CA34(struct Pokeblock *pokeblock); #ifdef GERMAN extern void de_sub_8073110(); @@ -933,7 +933,7 @@ static void sub_804E4FC(void) REG_BG1VOFS = 0; } -void sub_804E538(void) +void DoBerryBlending(void) { u8* field6F; //this temp value is needed to match @@ -2621,7 +2621,7 @@ static void sub_8050954(void) gBerryBlenderData->field_7C = 2; gSendCmd[1] = 0x9999; } - else if (sub_810CA00() == -1) + else if (GetFirstFreePokeblockSlot() == -1) { gBerryBlenderData->field_7C = 3; gSendCmd[1] = 0xAAAA; @@ -2816,7 +2816,7 @@ static void sub_8050E30(void) if (!gPaletteFade.active) { if (gBerryBlenderData->field_70[0] == 0x2222) - SetMainCallback2(sub_804E538); + SetMainCallback2(DoBerryBlending); else { gBerryBlenderData->framesToWait = 0; @@ -2880,7 +2880,7 @@ static void sub_80510E8(void) if (!gPaletteFade.active) { if (gBerryBlenderData->field_7C == 0) - SetMainCallback2(sub_804E538); + SetMainCallback2(DoBerryBlending); else SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music); } diff --git a/src/scene/credits.c b/src/scene/credits.c index 81be60c9f..17c1bf263 100644 --- a/src/scene/credits.c +++ b/src/scene/credits.c @@ -1228,9 +1228,9 @@ static bool8 sub_8144ECC(u8 data, u8 taskIdA) case 2: if (gSaveBlock2.playerGender == MALE) { - LoadCompressedObjectPic(&gIntro2BrendanSpriteSheet); - LoadCompressedObjectPic(&gUnknown_08416E34); - LoadCompressedObjectPic(&gIntro2BicycleSpriteSheet); + LoadCompressedObjectPic(gIntro2BrendanSpriteSheet); + LoadCompressedObjectPic(gUnknown_08416E34); + LoadCompressedObjectPic(gIntro2BicycleSpriteSheet); LoadSpritePalettes(gIntro2SpritePalettes); spriteId = intro_create_brendan_sprite(120, 46); @@ -1245,9 +1245,9 @@ static bool8 sub_8144ECC(u8 data, u8 taskIdA) } else { - LoadCompressedObjectPic(&gIntro2MaySpriteSheet); - LoadCompressedObjectPic(&gUnknown_08416E24); - LoadCompressedObjectPic(&gIntro2BicycleSpriteSheet); + LoadCompressedObjectPic(gIntro2MaySpriteSheet); + LoadCompressedObjectPic(gUnknown_08416E24); + LoadCompressedObjectPic(gIntro2BicycleSpriteSheet); LoadSpritePalettes(gIntro2SpritePalettes); spriteId = intro_create_may_sprite(120, 46); @@ -1606,7 +1606,7 @@ void spritecb_814580C(struct Sprite *sprite) static void sub_81458DC(void) { struct Unk201C000 *unk201C000 = &ewram1c000; - u16 starter = SpeciesToNationalPokedexNum(GetStarterPokemon(VarGet(VAR_FIRST_POKE))); + u16 starter = SpeciesToNationalPokedexNum(GetStarterPokemon(VarGet(VAR_STARTER_MON))); u16 seenTypesCount; u16 page; u16 dexNum; diff --git a/src/scene/evolution_scene.c b/src/scene/evolution_scene.c index e0b42e1c7..f307f5979 100644 --- a/src/scene/evolution_scene.c +++ b/src/scene/evolution_scene.c @@ -67,10 +67,10 @@ bool32 IsHMMove2(u16 move); extern struct Window gUnknown_03004210; extern u16 gUnknown_030042A4; extern u16 gUnknown_030042A0; -extern u16 gUnknown_030042C0; -extern u16 gUnknown_030041B4; -extern u16 gUnknown_03004288; -extern u16 gUnknown_03004280; +extern u16 gBattle_BG1_X; +extern u16 gBattle_BG1_Y; +extern u16 gBattle_BG2_X; +extern u16 gBattle_BG2_Y; extern u16 gUnknown_030041B0; extern u16 gUnknown_030041B8; extern u8 gBattleTerrain; @@ -202,10 +202,10 @@ void EvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo, gUnknown_030042A4 = 0; gUnknown_030042A0 = 0; - gUnknown_030042C0 = 0; - gUnknown_030041B4 = 0; - gUnknown_03004288 = 0; - gUnknown_03004280 = 0; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + gBattle_BG2_X = 0; + gBattle_BG2_Y = 0; gUnknown_030041B0 = 256; gUnknown_030041B8 = 0; @@ -310,10 +310,10 @@ static void CB2_EvolutionSceneLoadGraphics(void) ResetPaletteFade(); gUnknown_030042A4 = 0; gUnknown_030042A0 = 0; - gUnknown_030042C0 = 0; - gUnknown_030041B4 = 0; - gUnknown_03004288 = 0; - gUnknown_03004280 = 0; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + gBattle_BG2_X = 0; + gBattle_BG2_Y = 0; gUnknown_030041B0 = 256; gUnknown_030041B8 = 0; @@ -364,10 +364,10 @@ static void CB2_TradeEvolutionSceneLoadGraphics(void) gReservedSpritePaletteCount = 4; gUnknown_030042A4 = 0; gUnknown_030042A0 = 0; - gUnknown_030042C0 = 0; - gUnknown_030041B4 = 0; - gUnknown_03004288 = 0; - gUnknown_03004280 = 0; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + gBattle_BG2_X = 0; + gBattle_BG2_Y = 0; gUnknown_030041B0 = 256; gUnknown_030041B8 = 0; gMain.state++; @@ -3925,10 +3925,10 @@ static void VBlankCB_EvolutionScene(void) REG_BG0CNT = BGCNT_SCREENBASE(24) | BGCNT_16COLOR | BGCNT_TXT256x256 | BGCNT_AFF512x512 | BGCNT_PRIORITY(3); // 0x9803 REG_BG0HOFS = gUnknown_030042A4; REG_BG0VOFS = gUnknown_030042A0; - REG_BG1HOFS = gUnknown_030042C0; - REG_BG1VOFS = gUnknown_030041B4; - REG_BG2HOFS = gUnknown_03004288; - REG_BG2VOFS = gUnknown_03004280; + REG_BG1HOFS = gBattle_BG1_X; + REG_BG1VOFS = gBattle_BG1_Y; + REG_BG2HOFS = gBattle_BG2_X; + REG_BG2VOFS = gBattle_BG2_Y; REG_BG3HOFS = gUnknown_030041B0; REG_BG3VOFS = gUnknown_030041B8; LoadOam(); @@ -3941,10 +3941,10 @@ static void VBlankCB_TradeEvolutionScene(void) { REG_BG0HOFS = gUnknown_030042A4; REG_BG0VOFS = gUnknown_030042A0; - REG_BG1HOFS = gUnknown_030042C0; - REG_BG1VOFS = gUnknown_030041B4; - REG_BG2HOFS = gUnknown_03004288; - REG_BG2VOFS = gUnknown_03004280; + REG_BG1HOFS = gBattle_BG1_X; + REG_BG1VOFS = gBattle_BG1_Y; + REG_BG2HOFS = gBattle_BG2_X; + REG_BG2VOFS = gBattle_BG2_Y; REG_BG3HOFS = gUnknown_030041B0; REG_BG3VOFS = gUnknown_030041B8; LoadOam(); diff --git a/src/scene/intro.c b/src/scene/intro.c index 9e334d06b..4dc6cc91c 100644 --- a/src/scene/intro.c +++ b/src/scene/intro.c @@ -1087,14 +1087,14 @@ static void Task_IntroStartBikeRide(u8 taskId) u8 spriteId; if (gUnknown_02039318 == 0) - LoadCompressedObjectPic(&gIntro2BrendanSpriteSheet); + LoadCompressedObjectPic(gIntro2BrendanSpriteSheet); else - LoadCompressedObjectPic(&gIntro2MaySpriteSheet); - LoadCompressedObjectPic(&gIntro2BicycleSpriteSheet); + LoadCompressedObjectPic(gIntro2MaySpriteSheet); + LoadCompressedObjectPic(gIntro2BicycleSpriteSheet); #ifdef SAPPHIRE - LoadCompressedObjectPic(&gIntro2LatiasSpriteSheet); + LoadCompressedObjectPic(gIntro2LatiasSpriteSheet); #else - LoadCompressedObjectPic(&gIntro2LatiosSpriteSheet); + LoadCompressedObjectPic(gIntro2LatiosSpriteSheet); #endif LoadSpritePalettes(gIntro2SpritePalettes); if (gUnknown_02039318 == 0) diff --git a/src/scene/intro_credits_graphics.c b/src/scene/intro_credits_graphics.c index 05c67696a..6cee74cce 100755 --- a/src/scene/intro_credits_graphics.c +++ b/src/scene/intro_credits_graphics.c @@ -24,32 +24,282 @@ // define register constants for the inline asm asm(".include \"constants/gba_constants.inc\"\n"); -struct UnknownStruct1 +struct IntroCreditsSpriteMetadata { - u8 var0_0:4; - u8 var0_4:2; - u8 var0_6:2; - u8 var1; - u8 var2; - u8 var3; - u16 var4; -}; - -extern u8 gUnknown_0841225C; -extern u8 gUnknown_084126DC; -extern u8 gUnknown_084121FC; -extern u8 gUnknown_084128D8; -extern u8 gUnknown_08412EB4; -extern u8 gUnknown_08412818; -extern u8 gUnknown_08413184; -extern u8 gUnknown_08413340; -extern u8 gUnknown_084139C8; -extern u8 gUnknown_08413300; -extern u8 gUnknown_08413CCC; - -extern const struct SpriteTemplate gSpriteTemplate_8416B3C; -const extern struct CompressedSpriteSheet gUnknown_08416B54; -const extern struct CompressedSpriteSheet gUnknown_08416BDC; + u8 animNum:4; + u8 shape:2; + u8 size:2; + u8 x; + u8 y; + u8 subpriority; + u16 xOff; +}; + +const u16 gUnknown_084121FC[] = INCBIN_U16("graphics/intro/intro2_grass.gbapal"); +const u16 gUnknown_0841221C[] = INCBIN_U16("graphics/intro/intro2_grass_afternoon.gbapal"); +const u16 gUnknown_0841223C[] = INCBIN_U16("graphics/intro/intro2_grass_night.gbapal"); +const u8 gUnknown_0841225C[] = INCBIN_U8("graphics/intro/intro2_grass.4bpp.lz"); +const u8 gUnknown_084126DC[] = INCBIN_U8("graphics/intro/intro2_grass_map.bin.lz"); +const u16 gUnknown_08412818[] = INCBIN_U16("graphics/intro/8412818.gbapal"); +const u16 gUnknown_08412878[] = INCBIN_U16("graphics/intro/8412878.gbapal"); +const u8 gUnknown_084128D8[] = INCBIN_U8("graphics/intro/intro2_bgclouds.4bpp.lz"); +const u8 gUnknown_08412EB4[] = INCBIN_U8("graphics/intro/intro2_bgclouds_map.bin.lz"); +const u16 gUnknown_08413184[] = INCBIN_U16("graphics/intro/intro2_bgclouds.gbapal"); +const u16 gUnknown_084131A4[] = INCBIN_U16("graphics/intro/intro2_bgclouds_afternoon.gbapal"); +const u8 gUnknown_084131C4[] = INCBIN_U8("graphics/intro/intro2_bgclouds2.4bpp.lz"); +const u16 gUnknown_08413300[] = INCBIN_U16("graphics/intro/intro2_bgtrees2.gbapal"); +const u16 gUnknown_08413320[] = INCBIN_U16("graphics/intro/intro2_bgtrees2_afternoon.gbapal"); +const u8 gUnknown_08413340[] = INCBIN_U8("graphics/intro/intro2_bgtrees.4bpp.lz"); +const u8 gUnknown_084139C8[] = INCBIN_U8("graphics/intro/intro2_bgtrees_map.bin.lz"); +const u16 gUnknown_08413CCC[] = INCBIN_U16("graphics/intro/intro2_bgtrees.gbapal"); +const u8 gIntro2TreeTiles[] = INCBIN_U8("graphics/intro/intro2_bgtreessmall.4bpp.lz"); +const u16 gUnknown_08413E38[] = INCBIN_U16("graphics/intro/8413E38.gbapal"); +const u8 gUnknown_08413E78[] = INCBIN_U8("graphics/intro/intro2_bgnight.4bpp.lz"); // only used in credits, coupled with intro because bicycle sequence +const u16 gUnknown_08414064[] = INCBIN_U16("graphics/intro/intro2_bgnight.gbapal"); +const u8 gUnknown_08414084[] = INCBIN_U8("graphics/intro/intro2_bgnight_map.bin.lz"); +const u8 gIntro2NightTiles[] = INCBIN_U8("graphics/intro/intro2_night.4bpp.lz"); +const u16 gIntro2BrendanPalette[] = INCBIN_U16("graphics/intro/intro2_brendan.gbapal"); +const u8 gIntro2BrendanTiles[] = INCBIN_U8("graphics/intro/intro2_brendan.4bpp.lz"); +const u16 gIntro2MayPalette[] = INCBIN_U16("graphics/intro/intro2_may.gbapal"); +const u16 gUnknown_08414F90[0xF0] = {0}; +const u8 gIntro2MayTiles[] = INCBIN_U8("graphics/intro/intro2_may.4bpp.lz"); +const u8 gIntro2BicycleTiles[] = INCBIN_U8("graphics/intro/intro2_bicycle.4bpp.lz"); +const u16 gIntro2LatiosPalette[] = INCBIN_U16("graphics/intro/intro2_latios.gbapal"); +const u8 gIntro2LatiosTiles[] = INCBIN_U8("graphics/intro/intro2_latios.4bpp.lz"); +const u16 gIntro2LatiasPalette[] = INCBIN_U16("graphics/intro/intro2_latias.gbapal"); +const u8 gIntro2LatiasTiles[] = INCBIN_U8("graphics/intro/intro2_latias.4bpp.lz"); + +void sub_814910C(struct Sprite *sprite); +void nullsub_82(struct Sprite *sprite); +void sub_81492A0(struct Sprite *sprite); +void nullsub_83(struct Sprite *sprite); + +const struct SpriteTemplate gSpriteTemplate_8416B3C = { + 2000, 0xFFFF, &gDummyOamData, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_814910C +}; + +const struct CompressedSpriteSheet gUnknown_08416B54[] = { + { gUnknown_084131C4, 0x400, 2000 }, + {} +}; + +const union AnimCmd gSpriteAnim_8416B64[] = { + ANIMCMD_FRAME( 0, 30), + ANIMCMD_END +}; + +const union AnimCmd gSpriteAnim_8416B6C[] = { + ANIMCMD_FRAME(16, 30), + ANIMCMD_END +}; + +const union AnimCmd gSpriteAnim_8416B74[] = { + ANIMCMD_FRAME(20, 30), + ANIMCMD_END +}; + +const union AnimCmd gSpriteAnim_8416B7C[] = { + ANIMCMD_FRAME(22, 30), + ANIMCMD_END +}; + +const union AnimCmd *const gSpriteAnimTable_8416B84[] = { + gSpriteAnim_8416B64, + gSpriteAnim_8416B6C, + gSpriteAnim_8416B74, + gSpriteAnim_8416B7C +}; + +const struct IntroCreditsSpriteMetadata gUnknown_08416B94[] = { + { 0, ST_OAM_SQUARE, 2, 72, 32, 100, 0xc00 }, + { 0, ST_OAM_SQUARE, 2, 158, 32, 100, 0xc00 }, + { 1, ST_OAM_SQUARE, 1, 192, 40, 101, 0x800 }, + { 1, ST_OAM_SQUARE, 1, 56, 40, 101, 0x800 }, + { 2, ST_OAM_H_RECTANGLE, 0, 100, 44, 102, 0x400 }, + { 2, ST_OAM_H_RECTANGLE, 0, 152, 44, 102, 0x400 }, + { 3, ST_OAM_H_RECTANGLE, 0, 8, 46, 103, 0x100 }, + { 3, ST_OAM_H_RECTANGLE, 0, 56, 46, 103, 0x100 }, + { 3, ST_OAM_H_RECTANGLE, 0, 240, 46, 103, 0x100 }, +}; + +const struct CompressedSpriteSheet gUnknown_08416BDC[] = { + { gIntro2TreeTiles, 0x400, 2000 }, + {} +}; + +const union AnimCmd gSpriteAnim_8416BEC[] = { + ANIMCMD_FRAME( 0, 30), + ANIMCMD_END +}; + +const union AnimCmd gSpriteAnim_8416BF4[] = { + ANIMCMD_FRAME(16, 30), + ANIMCMD_END +}; + +const union AnimCmd gSpriteAnim_8416BFC[] = { + ANIMCMD_FRAME(24, 30), + ANIMCMD_END +}; + +const union AnimCmd *const gSpriteAnimTable_8416C04[] = { + gSpriteAnim_8416BEC, + gSpriteAnim_8416BF4, + gSpriteAnim_8416BFC +}; + +const struct IntroCreditsSpriteMetadata gUnknown_08416C10[] = { + { 0, ST_OAM_SQUARE, 2, 16, 88, 100, 0x2000 }, + { 0, ST_OAM_SQUARE, 2, 80, 88, 100, 0x2000 }, + { 0, ST_OAM_SQUARE, 2, 144, 88, 100, 0x2000 }, + { 0, ST_OAM_SQUARE, 2, 208, 88, 100, 0x2000 }, + { 1, ST_OAM_V_RECTANGLE, 2, 40, 88, 101, 0x1000 }, + { 1, ST_OAM_V_RECTANGLE, 2, 104, 88, 101, 0x1000 }, + { 1, ST_OAM_V_RECTANGLE, 2, 168, 88, 101, 0x1000 }, + { 1, ST_OAM_V_RECTANGLE, 2, 232, 88, 101, 0x1000 }, + { 2, ST_OAM_V_RECTANGLE, 2, 56, 88, 102, 0x800 }, + { 2, ST_OAM_V_RECTANGLE, 2, 120, 88, 102, 0x800 }, + { 2, ST_OAM_V_RECTANGLE, 2, 184, 88, 102, 0x800 }, + { 2, ST_OAM_V_RECTANGLE, 2, 248, 88, 102, 0x800 }, +}; + +const struct CompressedSpriteSheet gUnknown_08416C70[] = { + { gIntro2NightTiles, 0x400, 2000 }, + {} +}; + +const union AnimCmd gSpriteAnim_8416C80[] = { + ANIMCMD_FRAME(0, 30), + ANIMCMD_END +}; + +const union AnimCmd *const gSpriteAnimTable_8416C88[] = { + gSpriteAnim_8416C80 +}; + +const struct IntroCreditsSpriteMetadata gUnknown_08416C8C[] = { + { 0, ST_OAM_SQUARE, 2, 24, 88, 100, 0x1000 }, + { 0, ST_OAM_SQUARE, 2, 64, 88, 100, 0x1000 }, + { 0, ST_OAM_SQUARE, 2, 104, 88, 100, 0x1000 }, + { 0, ST_OAM_SQUARE, 2, 144, 88, 100, 0x1000 }, + { 0, ST_OAM_SQUARE, 2, 184, 88, 100, 0x1000 }, + { 0, ST_OAM_SQUARE, 2, 224, 88, 100, 0x1000 }, +}; + +const struct OamData gOamData_8416CBC = { + .y = 160, .shape = ST_OAM_SQUARE, .size = 3, .priority = 1 +}; + +const union AnimCmd gSpriteAnim_8416CC4[] = { + ANIMCMD_FRAME( 0, 8), + ANIMCMD_FRAME( 64, 8), + ANIMCMD_FRAME(128, 8), + ANIMCMD_FRAME(192, 8), + ANIMCMD_JUMP(0) +}; + +const union AnimCmd *const gSpriteAnimTable_8416CD8[] = { + gSpriteAnim_8416CC4 +}; + +const struct SpriteTemplate gSpriteTemplate_8416CDC = { + 1002, 1002, &gOamData_8416CBC, gSpriteAnimTable_8416CD8, NULL, gDummySpriteAffineAnimTable, nullsub_82 +}; + +const struct SpriteTemplate gSpriteTemplate_8416CF4 = { + 1003, 1003, &gOamData_8416CBC, gSpriteAnimTable_8416CD8, NULL, gDummySpriteAffineAnimTable, nullsub_82 +}; + +const struct OamData gOamData_8416D0C = { + .y = 160, .shape = ST_OAM_H_RECTANGLE, .size = 3, .priority = 1 +}; + +const union AnimCmd gSpriteAnim_8416D14[] = { + ANIMCMD_FRAME( 0, 8), + ANIMCMD_FRAME( 32, 8), + ANIMCMD_FRAME( 64, 8), + ANIMCMD_FRAME( 96, 8), + ANIMCMD_JUMP(0) +}; + +const union AnimCmd *const gSpriteAnimTable_8416D28[] = { + gSpriteAnim_8416D14 +}; + +const struct SpriteTemplate gSpriteTemplate_Brendan = { + 1001, 1002, &gOamData_8416D0C, gSpriteAnimTable_8416D28, NULL, gDummySpriteAffineAnimTable, sub_81492A0 +}; + +const struct SpriteTemplate gSpriteTemplate_May = { + 1001, 1003, &gOamData_8416D0C, gSpriteAnimTable_8416D28, NULL, gDummySpriteAffineAnimTable, sub_81492A0 +}; + +const struct OamData gOamData_8416D5C = { + .y = 160, .shape = ST_OAM_SQUARE, .size = 3, .priority = 1 +}; + +const union AnimCmd gSpriteAnim_8416D64[] = { + ANIMCMD_FRAME( 0, 16), + ANIMCMD_END +}; + +const union AnimCmd gSpriteAnim_8416D6C[] = { + ANIMCMD_FRAME( 64, 16), + ANIMCMD_END +}; + +const union AnimCmd *const gSpriteAnimTable_8416D74[] = { + gSpriteAnim_8416D64, + gSpriteAnim_8416D6C +}; + +const struct SpriteTemplate gSpriteTemplate_8416D7C = { + 1004, 1004, &gOamData_8416D5C, gSpriteAnimTable_8416D74, NULL, gDummySpriteAffineAnimTable, nullsub_83 +}; + +const struct SpriteTemplate gSpriteTemplate_8416D94 = { + 1005, 1005, &gOamData_8416D5C, gSpriteAnimTable_8416D74, NULL, gDummySpriteAffineAnimTable, nullsub_83 +}; + +const struct CompressedSpriteSheet gIntro2BrendanSpriteSheet[] = { + { gIntro2BrendanTiles, 0x3800, 1002 }, + {} +}; +const struct CompressedSpriteSheet gIntro2MaySpriteSheet[] = { + { gIntro2MayTiles, 0x3800, 1003 }, + {} +}; +const struct CompressedSpriteSheet gIntro2BicycleSpriteSheet[] = { + { gIntro2BicycleTiles, 0x1000, 1001 }, + {} +}; +const struct CompressedSpriteSheet gIntro2LatiosSpriteSheet[] = { + { gIntro2LatiosTiles, 0x1000, 1004 }, + {} +}; +const struct CompressedSpriteSheet gIntro2LatiasSpriteSheet[] = { + { gIntro2LatiasTiles, 0x1000, 1005 }, + {} +}; + +const struct SpritePalette gIntro2SpritePalettes[] = { + {gIntro2BrendanPalette, 1002}, + {gIntro2MayPalette, 1003}, + {gIntro2LatiosPalette, 1004}, + {gIntro2LatiasPalette, 1005}, + {} +}; + +const struct CompressedSpriteSheet gUnknown_08416E24[] = { + { gIntro2BrendanTiles, 0x2000, 1002}, + {} +}; + +const struct CompressedSpriteSheet gUnknown_08416E34[] = { + { gIntro2MayTiles, 0x2000, 1003}, + {} +}; + extern u16 gUnknown_02039358; extern s16 gUnknown_0203935A; @@ -71,7 +321,7 @@ void load_intro_part2_graphics(u8 a) LZ77UnCompVram(&gUnknown_084128D8, (void *)(VRAM)); LZ77UnCompVram(&gUnknown_08412EB4, (void *)(VRAM + 0x3000)); LoadPalette(&gUnknown_08412818, 0, 96); - LoadCompressedObjectPic(&gUnknown_08416B54); + LoadCompressedObjectPic(gUnknown_08416B54); LoadPalette(&gUnknown_08413184, 256, 32); sub_8149248(); break; @@ -79,7 +329,7 @@ void load_intro_part2_graphics(u8 a) LZ77UnCompVram(&gUnknown_08413340, (void *)(VRAM)); LZ77UnCompVram(&gUnknown_084139C8, (void *)(VRAM + 0x3000)); LoadPalette(&gUnknown_08413300, 0, 32); - LoadCompressedObjectPic(&gUnknown_08416BDC); + LoadCompressedObjectPic(gUnknown_08416BDC); LoadPalette(&gUnknown_08413CCC, 256, 32); sub_8149264(); break; @@ -106,30 +356,6 @@ void sub_8148C78(u8 a) } } -extern u8 gUnknown_084131C4; -extern u8 gUnknown_084131A4; -extern u8 gUnknown_0841221C; -extern u8 gUnknown_08412878; -extern u8 gUnknown_08413320; -extern u8 gUnknown_0841223C; -extern u8 gUnknown_08413E78; -extern u8 gUnknown_08414084; -extern u8 gUnknown_08413E38; -const extern struct CompressedSpriteSheet gUnknown_08416C70; -extern u8 gUnknown_08414064; -extern struct UnknownStruct1 gUnknown_08416B94; -extern struct UnknownStruct1 gUnknown_08416C10; -extern struct UnknownStruct1 gUnknown_08416C8C; -const extern union AnimCmd *const gSpriteAnimTable_8416B84; -const extern union AnimCmd *const gSpriteAnimTable_8416C04; -const extern union AnimCmd *const gSpriteAnimTable_8416C88; -const extern struct SpriteTemplate gSpriteTemplate_8416CDC; -const extern struct SpriteTemplate gSpriteTemplate_Brendan; -const extern struct SpriteTemplate gSpriteTemplate_8416CF4; -const extern struct SpriteTemplate gSpriteTemplate_May; -const extern struct SpriteTemplate gSpriteTemplate_8416D7C; -const extern struct SpriteTemplate gSpriteTemplate_8416D94; - void sub_8149280(); void sub_8148CB0(u8 a) @@ -144,7 +370,7 @@ void sub_8148CB0(u8 a) LZ77UnCompVram(&gUnknown_084128D8, (void *)(VRAM)); LZ77UnCompVram(&gUnknown_08412EB4, (void *)(VRAM + 0x3000)); LoadPalette(&gUnknown_08412818, 0, 96); - LoadCompressedObjectPic(&gUnknown_08416B54); + LoadCompressedObjectPic(gUnknown_08416B54); LZ77UnCompVram(&gUnknown_084131C4, (void *)(VRAM + 0x10000)); LoadPalette(&gUnknown_08413184, 256, 32); sub_8149248(); @@ -154,7 +380,7 @@ void sub_8148CB0(u8 a) LZ77UnCompVram(&gUnknown_084128D8, (void *)(VRAM)); LZ77UnCompVram(&gUnknown_08412EB4, (void *)(VRAM + 0x3000)); LoadPalette(&gUnknown_08412878, 0, 96); - LoadCompressedObjectPic(&gUnknown_08416B54); + LoadCompressedObjectPic(gUnknown_08416B54); LZ77UnCompVram(&gUnknown_084131C4, (void *)(VRAM + 0x10000)); LoadPalette(&gUnknown_084131A4, 256, 32); sub_8149248(); @@ -165,7 +391,7 @@ void sub_8148CB0(u8 a) LZ77UnCompVram(&gUnknown_08413340, (void *)(VRAM)); LZ77UnCompVram(&gUnknown_084139C8, (void *)(VRAM + 0x3000)); LoadPalette(&gUnknown_08413320, 0, 32); - LoadCompressedObjectPic(&gUnknown_08416BDC); + LoadCompressedObjectPic(gUnknown_08416BDC); LoadPalette(&gUnknown_08413320, 256, 32); sub_8149264(); break; @@ -174,7 +400,7 @@ void sub_8148CB0(u8 a) LZ77UnCompVram(&gUnknown_08413E78, (void *)(VRAM)); LZ77UnCompVram(&gUnknown_08414084, (void *)(VRAM + 0x3000)); LoadPalette(&gUnknown_08413E38, 0, 64); - LoadCompressedObjectPic(&gUnknown_08416C70); + LoadCompressedObjectPic(gUnknown_08416C70); LoadPalette(&gUnknown_08414064, 256, 32); sub_8149280(); break; @@ -367,43 +593,43 @@ _0814901C: .4byte REG_BG3VOFS\n\ void sub_8149020(u8 mode) { - u16 var1; - u16 var2; + u16 x; + u16 y; switch (mode) { case 0: default: /* stuff */ - if (gMain.vblankCounter1 & 3 || gPaletteFade.active) + if (gMain.vblankCounter1 & 3 || gPaletteFade.active) break; if (gMain.vblankCounter1 & 4) { - var1 = gPlttBufferUnfaded[9]; - var2 = gPlttBufferUnfaded[10]; + x = gPlttBufferUnfaded[9]; + y = gPlttBufferUnfaded[10]; } else { - var1 = gPlttBufferUnfaded[10]; - var2 = gPlttBufferUnfaded[9]; + x = gPlttBufferUnfaded[10]; + y = gPlttBufferUnfaded[9]; } - LoadPalette(&var1, 9, 2); - LoadPalette(&var2, 10, 2); + LoadPalette(&x, 9, 2); + LoadPalette(&y, 10, 2); break; case 2: - if (gMain.vblankCounter1 & 3 || gPaletteFade.active) + if (gMain.vblankCounter1 & 3 || gPaletteFade.active) break; if (gMain.vblankCounter1 & 4) { - var1 = 0x3D27; - var2 = 0x295; + x = 0x3D27; + y = 0x295; } else { - var1 = 0x31C; - var2 = 0x3D27; + x = 0x31C; + y = 0x3D27; } - LoadPalette(&var1, 12, 2); - LoadPalette(&var2, 13, 2); + LoadPalette(&x, 12, 2); + LoadPalette(&y, 13, 2); break; case 1: break; @@ -433,42 +659,42 @@ void sub_814910C(struct Sprite *sprite) } } -void sub_8149174(u8 a, struct UnknownStruct1 *b, const union AnimCmd *const *c, u8 d) +void sub_8149174(u8 a, const struct IntroCreditsSpriteMetadata *b, const union AnimCmd *const *c, u8 d) { u8 i; for(i = 0; i < d; i++) { - u8 sprite = CreateSprite(&gSpriteTemplate_8416B3C, b[i].var1, b[i].var2, b[i].var3); - CalcCenterToCornerVec(&gSprites[sprite], b[i].var0_4, b[i].var0_6, 0); + u8 sprite = CreateSprite(&gSpriteTemplate_8416B3C, b[i].x, b[i].y, b[i].subpriority); + CalcCenterToCornerVec(&gSprites[sprite], b[i].shape, b[i].size, 0); gSprites[sprite].oam.priority = 3; - gSprites[sprite].oam.shape = b[i].var0_4; - gSprites[sprite].oam.size = b[i].var0_6; + gSprites[sprite].oam.shape = b[i].shape; + gSprites[sprite].oam.size = b[i].size; gSprites[sprite].oam.paletteNum = 0; gSprites[sprite].anims = c; - StartSpriteAnim(&gSprites[sprite], b[i].var0_0); + StartSpriteAnim(&gSprites[sprite], b[i].animNum); gSprites[sprite].data[0] = a; - gSprites[sprite].data[1] = b[i].var4; + gSprites[sprite].data[1] = b[i].xOff; gSprites[sprite].data[2] = 0; } } void sub_8149248() { - sub_8149174(0, &gUnknown_08416B94, &gSpriteAnimTable_8416B84, 9); + sub_8149174(0, gUnknown_08416B94, gSpriteAnimTable_8416B84, 9); } void sub_8149264() { - sub_8149174(1, &gUnknown_08416C10, &gSpriteAnimTable_8416C04, 12); + sub_8149174(1, gUnknown_08416C10, gSpriteAnimTable_8416C04, 12); } void sub_8149280() { - sub_8149174(1, &gUnknown_08416C8C, &gSpriteAnimTable_8416C88, 6); + sub_8149174(1, gUnknown_08416C8C, gSpriteAnimTable_8416C88, 6); } -void nullsub_82() +void nullsub_82(struct Sprite *sprite) { } @@ -499,7 +725,7 @@ u8 intro_create_may_sprite(s16 a, s16 b) return sprite; } -void nullsub_83() +void nullsub_83(struct Sprite *sprite) { } diff --git a/src/scene/title_screen.c b/src/scene/title_screen.c index f158500fe..26fe088d5 100644 --- a/src/scene/title_screen.c +++ b/src/scene/title_screen.c @@ -41,8 +41,8 @@ extern u8 gReservedSpritePaletteCount; extern struct MusicPlayerInfo gMPlay_BGM; -extern u16 gUnknown_030041B4; -extern u16 gUnknown_030042C0; +extern u16 gBattle_BG1_Y; +extern u16 gBattle_BG1_X; extern const u8 gUnknown_08E9D8CC[]; extern const u16 gUnknown_08E9F624[]; extern const u8 gUnknown_08E9F7E4[]; @@ -602,7 +602,7 @@ static void VBlankCB(void) LoadOam(); ProcessSpriteCopyRequests(); TransferPlttBuffer(); - REG_BG1VOFS = gUnknown_030041B4; + REG_BG1VOFS = gBattle_BG1_Y; } @@ -836,8 +836,8 @@ static void Task_TitleScreenPhase3(u8 taskId) if (gTasks[taskId].tCounter & 1) { gTasks[taskId].data[4]++; - gUnknown_030041B4 = gTasks[taskId].data[4]; - gUnknown_030042C0 = 0; + gBattle_BG1_Y = gTasks[taskId].data[4]; + gBattle_BG1_X = 0; } UpdateLegendaryMarkingColor(gTasks[taskId].tCounter); if ((gMPlay_BGM.status & 0xFFFF) == 0) diff --git a/src/script_pokemon_util_80C4BF0.c b/src/script_pokemon_util_80C4BF0.c index 164d71cb5..f397e5ebb 100644 --- a/src/script_pokemon_util_80C4BF0.c +++ b/src/script_pokemon_util_80C4BF0.c @@ -24,6 +24,9 @@ #include "task.h" #include "ewram.h" +extern void sub_80C4674(); +extern void sub_80C4698(u8 *, u8); + #define CONTEST_ENTRY_PIC_LEFT 10 #define CONTEST_ENTRY_PIC_TOP 3 @@ -47,13 +50,14 @@ extern u32 gUnknown_03005D28; extern u8 gUnknown_02038694; extern u8 gUnknown_0203856C; extern u8 gContestFinalStandings[]; -extern u16 gUnknown_02038678[]; +extern s16 gUnknown_02038670[]; +extern s16 gUnknown_02038678[]; -void sub_80C4BF0(void) +void SetContestTrainerGfxIds(void) { - gSaveBlock1.vars[0x10] = gContestMons[0].trainerGfxId; - gSaveBlock1.vars[0x11] = gContestMons[1].trainerGfxId; - gSaveBlock1.vars[0x12] = gContestMons[2].trainerGfxId; + gSaveBlock1.vars[VAR_OBJ_GFX_ID_0 - VARS_START] = gContestMons[0].trainerGfxId; + gSaveBlock1.vars[VAR_OBJ_GFX_ID_1 - VARS_START] = gContestMons[1].trainerGfxId; + gSaveBlock1.vars[VAR_OBJ_GFX_ID_2 - VARS_START] = gContestMons[2].trainerGfxId; } void sub_80C4C28(void) @@ -128,7 +132,7 @@ void sub_80C4CF8(void) { if(!gContestFinalStandings[gContestPlayerMonIndex] && gSpecialVar_ContestRank == 3 - && (s16)gUnknown_02038678[gContestPlayerMonIndex] >= 800) + && gUnknown_02038678[gContestPlayerMonIndex] >= 800) { gSpecialVar_0x8004 = 1; } @@ -150,209 +154,78 @@ u8 sub_80C4D50(void) return retVar; } -// nope. too hard -__attribute__((naked)) void sub_80C4D80(void) { - asm(".syntax unified\n\ - push {r4-r7,lr}\n\ - mov r7, r10\n\ - mov r6, r9\n\ - mov r5, r8\n\ - push {r5-r7}\n\ - sub sp, 0x8\n\ - ldr r0, _080C4EA0 @ =gUnknown_02038670\n\ - mov r12, r0\n\ - ldr r1, _080C4EA4 @ =gSpecialVar_0x8006\n\ - mov r8, r1\n\ - ldr r2, _080C4EA8 @ =gStringVar1\n\ - mov r9, r2\n\ - mov r2, r12\n\ - mov r1, sp\n\ - movs r6, 0x3\n\ -_080C4D9E:\n\ - ldrh r0, [r2]\n\ - strh r0, [r1]\n\ - adds r2, 0x2\n\ - adds r1, 0x2\n\ - subs r6, 0x1\n\ - cmp r6, 0\n\ - bge _080C4D9E\n\ - movs r6, 0\n\ -_080C4DAE:\n\ - movs r1, 0x3\n\ - cmp r1, r6\n\ - ble _080C4DD8\n\ -_080C4DB4:\n\ - subs r4, r1, 0x1\n\ - lsls r0, r4, 1\n\ - mov r5, sp\n\ - adds r3, r5, r0\n\ - lsls r0, r1, 1\n\ - adds r2, r5, r0\n\ - ldrh r5, [r3]\n\ - movs r7, 0\n\ - ldrsh r1, [r3, r7]\n\ - movs r7, 0\n\ - ldrsh r0, [r2, r7]\n\ - cmp r1, r0\n\ - bge _080C4DD2\n\ - strh r5, [r2]\n\ - strh r0, [r3]\n\ -_080C4DD2:\n\ - adds r1, r4, 0\n\ - cmp r1, r6\n\ - bgt _080C4DB4\n\ -_080C4DD8:\n\ - adds r6, 0x1\n\ - cmp r6, 0x2\n\ - ble _080C4DAE\n\ - mov r2, r8\n\ - ldrh r0, [r2]\n\ - lsls r0, 1\n\ - add r0, sp\n\ - ldrh r0, [r0]\n\ - movs r2, 0\n\ - movs r7, 0\n\ - movs r6, 0\n\ - lsls r0, 16\n\ - asrs r4, r0, 16\n\ - adds r3, r0, 0\n\ - mov r1, sp\n\ -_080C4DF6:\n\ - movs r5, 0\n\ - ldrsh r0, [r1, r5]\n\ - cmp r0, r4\n\ - bne _080C4E12\n\ - lsls r0, r2, 24\n\ - movs r2, 0x80\n\ - lsls r2, 17\n\ - adds r0, r2\n\ - lsrs r2, r0, 24\n\ - mov r5, r8\n\ - ldrh r5, [r5]\n\ - cmp r6, r5\n\ - bne _080C4E12\n\ - adds r7, r2, 0\n\ -_080C4E12:\n\ - adds r1, 0x2\n\ - adds r6, 0x1\n\ - cmp r6, 0x3\n\ - ble _080C4DF6\n\ - movs r6, 0\n\ - mov r0, sp\n\ - movs r1, 0\n\ - ldrsh r0, [r0, r1]\n\ - asrs r1, r3, 16\n\ - lsls r2, 24\n\ - mov r10, r2\n\ - cmp r0, r1\n\ - beq _080C4E40\n\ - adds r2, r1, 0\n\ - mov r1, sp\n\ -_080C4E30:\n\ - adds r1, 0x2\n\ - adds r6, 0x1\n\ - cmp r6, 0x3\n\ - bgt _080C4E40\n\ - movs r4, 0\n\ - ldrsh r0, [r1, r4]\n\ - cmp r0, r2\n\ - bne _080C4E30\n\ -_080C4E40:\n\ - lsls r0, r6, 24\n\ - lsrs r4, r0, 24\n\ - adds r2, r7, 0\n\ - movs r6, 0\n\ - asrs r5, r3, 16\n\ - mov r8, r5\n\ - mov r1, r12\n\ - movs r5, 0\n\ - ldrsh r0, [r1, r5]\n\ - cmp r8, r0\n\ - bne _080C4E60\n\ - cmp r7, 0x1\n\ - beq _080C4E78\n\ -_080C4E5A:\n\ - subs r0, r2, 0x1\n\ - lsls r0, 24\n\ - lsrs r2, r0, 24\n\ -_080C4E60:\n\ - adds r6, 0x1\n\ - cmp r6, 0x3\n\ - bgt _080C4E78\n\ - lsls r0, r6, 1\n\ - add r0, r12\n\ - asrs r1, r3, 16\n\ - movs r5, 0\n\ - ldrsh r0, [r0, r5]\n\ - cmp r1, r0\n\ - bne _080C4E60\n\ - cmp r2, 0x1\n\ - bne _080C4E5A\n\ -_080C4E78:\n\ - lsls r1, r6, 24\n\ - lsrs r1, 24\n\ - mov r0, r9\n\ - bl sub_80C4698\n\ - ldr r0, _080C4EAC @ =gIsLinkContest\n\ - ldrb r1, [r0]\n\ - movs r0, 0x1\n\ - ands r0, r1\n\ - cmp r0, 0\n\ - beq _080C4EB8\n\ - ldr r0, _080C4EB0 @ =gStringVar2\n\ - lsls r1, r6, 3\n\ - subs r1, r6\n\ - lsls r1, 2\n\ - ldr r2, _080C4EB4 @ =gLinkPlayers + 0x8\n\ - adds r1, r2\n\ - bl sub_80C4674\n\ - b _080C4EC4\n\ - .align 2, 0\n\ -_080C4EA0: .4byte gUnknown_02038670\n\ -_080C4EA4: .4byte gSpecialVar_0x8006\n\ -_080C4EA8: .4byte gStringVar1\n\ -_080C4EAC: .4byte gIsLinkContest\n\ -_080C4EB0: .4byte gStringVar2\n\ -_080C4EB4: .4byte gLinkPlayers + 0x8\n\ -_080C4EB8:\n\ - ldr r0, _080C4ED8 @ =gStringVar2\n\ - lsls r1, r6, 6\n\ - ldr r2, _080C4EDC @ =gUnknown_0203857D\n\ - adds r1, r2\n\ - bl sub_80C4674\n\ -_080C4EC4:\n\ - mov r1, r10\n\ - asrs r0, r1, 24\n\ - cmp r0, 0x1\n\ - beq _080C4ED0\n\ - cmp r7, r0\n\ - bne _080C4EE4\n\ -_080C4ED0:\n\ - ldr r0, _080C4EE0 @ =gSpecialVar_0x8006\n\ - strh r4, [r0]\n\ - b _080C4EEA\n\ - .align 2, 0\n\ -_080C4ED8: .4byte gStringVar2\n\ -_080C4EDC: .4byte gUnknown_0203857D\n\ -_080C4EE0: .4byte gSpecialVar_0x8006\n\ -_080C4EE4:\n\ - ldr r1, _080C4EFC @ =gSpecialVar_0x8006\n\ - adds r0, r4, 0x4\n\ - strh r0, [r1]\n\ -_080C4EEA:\n\ - add sp, 0x8\n\ - pop {r3-r5}\n\ - mov r8, r3\n\ - mov r9, r4\n\ - mov r10, r5\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - .align 2, 0\n\ -_080C4EFC: .4byte gSpecialVar_0x8006\n\ - .syntax divided"); + s16 sp0[4]; + s32 i; + s32 j; + s16 r4; + u8 r2; + u8 r7; + s8 r10; + u8 r4_; + + for (i = 0; i < 4; i++) + sp0[i] = gUnknown_02038670[i]; + + for (i = 0; i < 3; i++) + { + for (j = 3; j > i; j--) + { + if (sp0[j - 1] < sp0[j]) + { + s32 temp = sp0[j]; + + sp0[j] = sp0[j - 1]; + sp0[j - 1] = temp; + } + } + } + + r4 = sp0[gSpecialVar_0x8006]; + r10 = 0; + r7 = 0; + + for (i = 0; i < 4; i++) + { + if (sp0[i] == r4) + { + r10++; + if (i == gSpecialVar_0x8006) + r7 = r10; + } + } + + for (i = 0; i < 4; i++) + { + if (sp0[i] == r4) + break; + } + + r4_ = i; + r2 = r7; + + for (i = 0; i < 4; i++) + { + if (r4 == gUnknown_02038670[i]) + { + if (r2 == 1) + break; + r2--; + } + } + + sub_80C4698(gStringVar1, i); + + if (gIsLinkContest & 1) + sub_80C4674(gStringVar2, gLinkPlayers[i].name); + else + sub_80C4674(gStringVar2, gContestMons[i].trainerName); + + if (r10 == 1 || r7 == r10) + gSpecialVar_0x8006 = r4_; + else + gSpecialVar_0x8006 = r4_ + 4; } void ShowContestWinnerCleanup(void) @@ -376,10 +249,10 @@ void ShowContestWinner(void) void sub_80C4F70(void) { - VarSet(0x4010, gContestMons[0].trainerGfxId); - VarSet(0x4011, gContestMons[1].trainerGfxId); - VarSet(0x4012, gContestMons[2].trainerGfxId); - VarSet(0x4013, gContestMons[3].trainerGfxId); + VarSet(VAR_OBJ_GFX_ID_0, gContestMons[0].trainerGfxId); + VarSet(VAR_OBJ_GFX_ID_1, gContestMons[1].trainerGfxId); + VarSet(VAR_OBJ_GFX_ID_2, gContestMons[2].trainerGfxId); + VarSet(VAR_OBJ_GFX_ID_3, gContestMons[3].trainerGfxId); } bool8 GiveMonArtistRibbon(void) @@ -389,7 +262,7 @@ bool8 GiveMonArtistRibbon(void) if(ribbon == FALSE && gContestFinalStandings[gContestPlayerMonIndex] == 0 && gSpecialVar_ContestRank == 3 - && (s16)gUnknown_02038678[gContestPlayerMonIndex] >= 800) + && gUnknown_02038678[gContestPlayerMonIndex] >= 800) { ribbon = TRUE; SetMonData(&gPlayerParty[gUnknown_02038694], MON_DATA_ARTIST_RIBBON, &ribbon); diff --git a/src/script_pokemon_util_80F99CC.c b/src/script_pokemon_util_80F99CC.c index 33e7620f7..df83d3e2d 100644 --- a/src/script_pokemon_util_80F99CC.c +++ b/src/script_pokemon_util_80F99CC.c @@ -19,6 +19,8 @@ #include "text.h" #include "ewram.h" +extern const u8 gUnknown_08208238[]; + extern u8 gPlayerPartyCount; extern u16 gSpecialVar_0x8004; extern u16 gSpecialVar_0x8005; @@ -37,7 +39,7 @@ void sub_80F99CC(void) BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0); } -void sub_80F9A0C(void) +void SelectMonForNPCTrade(void) { u8 taskId; @@ -47,7 +49,7 @@ void sub_80F9A0C(void) BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0); } -void sub_80F9A4C(void) +void SelectMoveTutorMon(void) { u8 taskId; @@ -270,7 +272,7 @@ void HandleMoveTutorPartyMenu(u8 var) } } -void sub_80F9EEC(void) +void SelectMove(void) { ShowSelectMovePokemonSummaryScreen(&gPlayerParty[0], gSpecialVar_0x8004, gPlayerPartyCount - 1, c2_exit_to_overworld_2_switch, 0); UNK_2018000_STRUCT.unk8 = 3; @@ -297,133 +299,29 @@ void ScrSpecial_GetPokemonNicknameAndMoveName(void) StringCopy(gStringVar2, gMoveNames[data]); } -// no. hard -__attribute__((naked)) -void sub_80F9FDC(struct Pokemon *party, u8 var, u8 var2) +void sub_80F9FDC(struct Pokemon *pkmn, u8 moveIndex1, u8 moveIndex2) { - asm(".syntax unified\n\ - push {r4-r7,lr}\n\ - mov r7, r10\n\ - mov r6, r9\n\ - mov r5, r8\n\ - push {r5-r7}\n\ - sub sp, 0x20\n\ - mov r8, r0\n\ - adds r5, r1, 0\n\ - adds r4, r2, 0\n\ - lsls r5, 24\n\ - lsrs r5, 24\n\ - lsls r4, 24\n\ - lsrs r4, 24\n\ - adds r0, r5, 0\n\ - adds r0, 0xD\n\ - str r0, [sp, 0x8]\n\ - mov r0, r8\n\ - ldr r1, [sp, 0x8]\n\ - bl GetMonData\n\ - mov r1, sp\n\ - adds r1, 0x2\n\ - str r1, [sp, 0x14]\n\ - strh r0, [r1]\n\ - adds r3, r4, 0\n\ - adds r3, 0xD\n\ - str r3, [sp, 0xC]\n\ - mov r0, r8\n\ - adds r1, r3, 0\n\ - bl GetMonData\n\ - mov r1, sp\n\ - strh r0, [r1]\n\ - adds r7, r5, 0\n\ - adds r7, 0x11\n\ - str r7, [sp, 0x10]\n\ - mov r0, r8\n\ - adds r1, r7, 0\n\ - bl GetMonData\n\ - mov r1, sp\n\ - adds r1, 0x5\n\ - str r1, [sp, 0x18]\n\ - strb r0, [r1]\n\ - adds r3, r4, 0\n\ - adds r3, 0x11\n\ - str r3, [sp, 0x1C]\n\ - mov r0, r8\n\ - adds r1, r3, 0\n\ - bl GetMonData\n\ - add r7, sp, 0x4\n\ - mov r10, r7\n\ - strb r0, [r7]\n\ - mov r0, r8\n\ - movs r1, 0x15\n\ - bl GetMonData\n\ - mov r6, sp\n\ - adds r6, 0x6\n\ - strb r0, [r6]\n\ - ldr r1, _080FA0D8 @ =gUnknown_08208238\n\ - adds r0, r5, r1\n\ - ldrb r0, [r0]\n\ - mov r9, r0\n\ - ldrb r0, [r6]\n\ - adds r2, r0, 0\n\ - mov r3, r9\n\ - ands r2, r3\n\ - lsls r5, 1\n\ - asrs r2, r5\n\ - lsls r2, 24\n\ - lsrs r2, 24\n\ - adds r1, r4, r1\n\ - ldrb r3, [r1]\n\ - adds r1, r0, 0\n\ - ands r1, r3\n\ - lsls r4, 1\n\ - asrs r1, r4\n\ - lsls r1, 24\n\ - lsrs r1, 24\n\ - mov r7, r9\n\ - bics r0, r7\n\ - strb r0, [r6]\n\ - ldrb r0, [r6]\n\ - bics r0, r3\n\ - strb r0, [r6]\n\ - lsls r2, r4\n\ - lsls r1, r5\n\ - adds r2, r1\n\ - ldrb r0, [r6]\n\ - orrs r0, r2\n\ - strb r0, [r6]\n\ - mov r0, r8\n\ - ldr r1, [sp, 0x8]\n\ - mov r2, sp\n\ - bl SetMonData\n\ - mov r0, r8\n\ - ldr r1, [sp, 0xC]\n\ - ldr r2, [sp, 0x14]\n\ - bl SetMonData\n\ - mov r0, r8\n\ - ldr r1, [sp, 0x10]\n\ - mov r2, r10\n\ - bl SetMonData\n\ - mov r0, r8\n\ - ldr r1, [sp, 0x1C]\n\ - ldr r2, [sp, 0x18]\n\ - bl SetMonData\n\ - mov r0, r8\n\ - movs r1, 0x15\n\ - adds r2, r6, 0\n\ - bl SetMonData\n\ - add sp, 0x20\n\ - pop {r3-r5}\n\ - mov r8, r3\n\ - mov r9, r4\n\ - mov r10, r5\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - .align 2, 0\n\ -_080FA0D8: .4byte gUnknown_08208238\n\ - .syntax divided"); + u16 move1 = GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex1); + u16 move2 = GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex2); + u8 pp1 = GetMonData(pkmn, MON_DATA_PP1 + moveIndex1); + u8 pp2 = GetMonData(pkmn, MON_DATA_PP1 + moveIndex2); + u8 bonuses = GetMonData(pkmn, MON_DATA_PP_BONUSES); + + u8 r2 = (bonuses & gUnknown_08208238[moveIndex1]) >> (moveIndex1 * 2); + u8 r1 = (bonuses & gUnknown_08208238[moveIndex2]) >> (moveIndex2 * 2); + + bonuses &= ~gUnknown_08208238[moveIndex1]; + bonuses &= ~gUnknown_08208238[moveIndex2]; + bonuses |= (r2 << (moveIndex2 * 2)) + (r1 << (moveIndex1 * 2)); + + SetMonData(pkmn, MON_DATA_MOVE1 + moveIndex1, &move2); + SetMonData(pkmn, MON_DATA_MOVE1 + moveIndex2, &move1); + SetMonData(pkmn, MON_DATA_PP1 + moveIndex1, &pp2); + SetMonData(pkmn, MON_DATA_PP1 + moveIndex2, &pp1); + SetMonData(pkmn, MON_DATA_PP_BONUSES, &bonuses); } -void sub_80FA0DC(void) +void DeleteMonMove(void) { u16 i; @@ -434,7 +332,7 @@ void sub_80FA0DC(void) sub_80F9FDC(&gPlayerParty[gSpecialVar_0x8004], i, i + 1); } -void sub_80FA148(void) +void IsSelectedMonEgg(void) { struct Pokemon *party = &gPlayerParty[gSpecialVar_0x8004]; gSpecialVar_Result = 0; diff --git a/src/unknown_task.c b/src/unknown_task.c index 0cc59fc66..c9ba95d42 100644 --- a/src/unknown_task.c +++ b/src/unknown_task.c @@ -8,13 +8,13 @@ static void sub_80896F4(void); static void sub_8089714(void); extern u16 gUnknown_030041B0; -extern u16 gUnknown_030041B4; +extern u16 gBattle_BG1_Y; extern u16 gUnknown_030041B8; -extern u16 gUnknown_03004280; -extern u16 gUnknown_03004288; +extern u16 gBattle_BG2_Y; +extern u16 gBattle_BG2_X; extern u16 gUnknown_030042A0; extern u16 gUnknown_030042A4; -extern u16 gUnknown_030042C0; +extern u16 gBattle_BG1_X; extern u8 gUnknown_0202FFA4; @@ -125,16 +125,16 @@ static void task00_for_dp12(u8 taskId) value = gUnknown_030042A0; break; case 0x4: - value = gUnknown_030042C0; + value = gBattle_BG1_X; break; case 0x6: - value = gUnknown_030041B4; + value = gBattle_BG1_Y; break; case 0x8: - value = gUnknown_03004288; + value = gBattle_BG2_X; break; case 0xA: - value = gUnknown_03004280; + value = gBattle_BG2_Y; break; case 0xC: value = gUnknown_030041B0; |