From ac4ca95a7bcf05482add953aafa081df824fc954 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Fri, 5 May 2017 00:43:55 -0400 Subject: use macros and defines for save.c making it easier to add new sections --- src/save.c | 191 +++++++++++++++++++++++++++++++------------------------------ 1 file changed, 97 insertions(+), 94 deletions(-) (limited to 'src') diff --git a/src/save.c b/src/save.c index 72ec3b251..ce1ee3089 100644 --- a/src/save.c +++ b/src/save.c @@ -7,6 +7,11 @@ #include "rom4.h" #include "save_failed_screen.h" +#define GETVALIDSTATUSBITFIELD ((1 << ARRAY_COUNT(gSaveSectionLocations)) - 1) +#define GETCHUNKSIZE(chunk, n) ((sizeof(chunk) - (0xF80 * (n - 1))) >= 0xF80 ? 0xF80 : (sizeof(chunk) - (0xF80 * (n - 1)))) +#define GETBLOCKOFFSET(n) (0xF80 * (n - 1)) +#define TOTALNUMSECTORS ((ARRAY_COUNT(gSaveSectionLocations) * 2) + (ARRAY_COUNT(gHallOfFameSaveSectionLocations) * 2)) // there are 2 slots, so double each array count and get the sum. + extern u32 gLastSaveSectorStatus; // used but in an unferenced function, so unused extern u16 gLastWrittenSector; extern u32 gLastSaveCounter; @@ -24,26 +29,26 @@ extern struct HallOfFame gHallOfFame; const struct SaveSectionLocation gSaveSectionLocations[] = { - {((u8 *) &gSaveBlock2), 0x890}, - {((u8 *) &gSaveBlock1) + 0xF80 * 0, 0xF80}, - {((u8 *) &gSaveBlock1) + 0xF80 * 1, 0xF80}, - {((u8 *) &gSaveBlock1) + 0xF80 * 2, 0xF80}, - {((u8 *) &gSaveBlock1) + 0xF80 * 3, 0xC40}, - {((u8 *) &gPokemonStorage) + 0xF80 * 0, 0xF80}, - {((u8 *) &gPokemonStorage) + 0xF80 * 1, 0xF80}, - {((u8 *) &gPokemonStorage) + 0xF80 * 2, 0xF80}, - {((u8 *) &gPokemonStorage) + 0xF80 * 3, 0xF80}, - {((u8 *) &gPokemonStorage) + 0xF80 * 4, 0xF80}, - {((u8 *) &gPokemonStorage) + 0xF80 * 5, 0xF80}, - {((u8 *) &gPokemonStorage) + 0xF80 * 6, 0xF80}, - {((u8 *) &gPokemonStorage) + 0xF80 * 7, 0xF80}, - {((u8 *) &gPokemonStorage) + 0xF80 * 8, 0x7D0} + {((u8 *) &gSaveBlock2) + GETBLOCKOFFSET(1), GETCHUNKSIZE(gSaveBlock2, 1)}, + {((u8 *) &gSaveBlock1) + GETBLOCKOFFSET(1), GETCHUNKSIZE(gSaveBlock1, 1)}, + {((u8 *) &gSaveBlock1) + GETBLOCKOFFSET(2), GETCHUNKSIZE(gSaveBlock1, 2)}, + {((u8 *) &gSaveBlock1) + GETBLOCKOFFSET(3), GETCHUNKSIZE(gSaveBlock1, 3)}, + {((u8 *) &gSaveBlock1) + GETBLOCKOFFSET(4), GETCHUNKSIZE(gSaveBlock1, 4)}, + {((u8 *) &gPokemonStorage) + GETBLOCKOFFSET(1), GETCHUNKSIZE(gPokemonStorage, 1)}, + {((u8 *) &gPokemonStorage) + GETBLOCKOFFSET(2), GETCHUNKSIZE(gPokemonStorage, 2)}, + {((u8 *) &gPokemonStorage) + GETBLOCKOFFSET(3), GETCHUNKSIZE(gPokemonStorage, 3)}, + {((u8 *) &gPokemonStorage) + GETBLOCKOFFSET(4), GETCHUNKSIZE(gPokemonStorage, 4)}, + {((u8 *) &gPokemonStorage) + GETBLOCKOFFSET(5), GETCHUNKSIZE(gPokemonStorage, 5)}, + {((u8 *) &gPokemonStorage) + GETBLOCKOFFSET(6), GETCHUNKSIZE(gPokemonStorage, 6)}, + {((u8 *) &gPokemonStorage) + GETBLOCKOFFSET(7), GETCHUNKSIZE(gPokemonStorage, 7)}, + {((u8 *) &gPokemonStorage) + GETBLOCKOFFSET(8), GETCHUNKSIZE(gPokemonStorage, 8)}, + {((u8 *) &gPokemonStorage) + GETBLOCKOFFSET(9), GETCHUNKSIZE(gPokemonStorage, 9)} }; const struct SaveSectionLocation gHallOfFameSaveSectionLocations[] = { - {((u8 *) &gHallOfFame) + 0xF80 * 0, 0xF80}, - {((u8 *) &gHallOfFame) + 0xF80 * 1, 0xF80} + {((u8 *) &gHallOfFame) + GETBLOCKOFFSET(1), GETCHUNKSIZE(struct HallOfFame, 1)}, // gHallOfFame is not a proper sym, so the struct must be used. + {((u8 *) &gHallOfFame) + GETBLOCKOFFSET(2), GETCHUNKSIZE(struct HallOfFame, 2)} }; const u8 gFlashSectors[] = { 0x1E, 0x1F }; @@ -56,7 +61,6 @@ void ClearSaveData(void) EraseFlashSector(i); } -// ResetSaveCounters void ResetSaveCounters(void) { gSaveCounter = 0; @@ -101,11 +105,11 @@ u8 save_write_to_flash(u16 a1, const struct SaveSectionLocation *location) gLastKnownGoodSector = gLastWrittenSector; // backup the current written sector before attempting to write. gLastSaveCounter = gSaveCounter; gLastWrittenSector++; - gLastWrittenSector = gLastWrittenSector % 14; + gLastWrittenSector = gLastWrittenSector % ARRAY_COUNT(gSaveSectionLocations); gSaveCounter++; retVal = 1; - for (i = 0; i < 14; i++) + for (i = 0; i < ARRAY_COUNT(gSaveSectionLocations); i++) HandleWriteSector(i, location); if (gDamagedSaveSectors != 0) // skip the damaged sector. @@ -127,8 +131,8 @@ u8 HandleWriteSector(u16 a1, const struct SaveSectionLocation *location) u16 size; sector = a1 + gLastWrittenSector; - sector %= 14; - sector += 14 * (gSaveCounter % 2); + sector %= ARRAY_COUNT(gSaveSectionLocations); + sector += ARRAY_COUNT(gSaveSectionLocations) * (gSaveCounter % 2); data = location[a1].data; size = location[a1].size; @@ -185,7 +189,7 @@ u32 RestoreSaveBackupVarsAndIncrement(const struct SaveSectionLocation *location gLastKnownGoodSector = gLastWrittenSector; gLastSaveCounter = gSaveCounter; gLastWrittenSector++; - gLastWrittenSector = gLastWrittenSector % 14; + gLastWrittenSector = gLastWrittenSector % ARRAY_COUNT(gSaveSectionLocations); gSaveCounter++; gUnknown_03005EB4 = 0; gDamagedSaveSectors = 0; @@ -250,8 +254,8 @@ u8 sub_81255B8(u16 a1, const struct SaveSectionLocation *location) u8 status; sector = a1 + gLastWrittenSector; - sector %= 14; - sector += 14 * (gSaveCounter % 2); + sector %= ARRAY_COUNT(gSaveSectionLocations); + sector += ARRAY_COUNT(gSaveSectionLocations) * (gSaveCounter % 2); data = location[a1].data; size = location[a1].size; @@ -320,8 +324,8 @@ u8 sub_8125758(u16 a1, const struct SaveSectionLocation *location) u16 sector; sector = a1 + gLastWrittenSector - 1; - sector %= 14; - sector += 14 * (gSaveCounter % 2); + sector %= ARRAY_COUNT(gSaveSectionLocations); + sector += ARRAY_COUNT(gSaveSectionLocations) * (gSaveCounter % 2); if (ProgramFlashByte(sector, sizeof(struct UnkSaveSection), ((u8 *)gFastSaveSection)[sizeof(struct UnkSaveSection)])) { @@ -343,8 +347,8 @@ u8 sub_81257F0(u16 a1, const struct SaveSectionLocation *location) u16 sector; sector = a1 + gLastWrittenSector - 1; - sector %= 14; - sector += 14 * (gSaveCounter % 2); + sector %= ARRAY_COUNT(gSaveSectionLocations); + sector += ARRAY_COUNT(gSaveSectionLocations) * (gSaveCounter % 2); if (ProgramFlashByte(sector, sizeof(struct UnkSaveSection), 0x25)) { @@ -371,7 +375,7 @@ u8 sub_812587C(u16 a1, const struct SaveSectionLocation *location) } else { - retVal = sub_8125974(location); + retVal = GetSaveValidStatus(location); sub_81258BC(0xFFFF, location); } @@ -382,12 +386,12 @@ u8 sub_81258BC(u16 a1, const struct SaveSectionLocation *location) { u16 i; u16 checksum; - u16 v3 = 14 * (gSaveCounter % 2); + u16 v3 = ARRAY_COUNT(gSaveSectionLocations) * (gSaveCounter % 2); u16 id; - for (i = 0; i < 14; i++) + for (i = 0; i < ARRAY_COUNT(gSaveSectionLocations); i++) { - sub_8125BF8(i + v3, gFastSaveSection); + DoReadFlashWholeSection(i + v3, gFastSaveSection); id = gFastSaveSection->id; if (id == 0) gLastWrittenSector = i; @@ -404,121 +408,120 @@ u8 sub_81258BC(u16 a1, const struct SaveSectionLocation *location) return 1; } -u8 sub_8125974(const struct SaveSectionLocation *location) +u8 GetSaveValidStatus(const struct SaveSectionLocation *location) { u16 i; u16 checksum; - u32 v2 = 0; - u32 v3 = 0; - u32 v4; - bool8 v5; - u8 v14; - u8 v10; - - v4 = 0; - v5 = FALSE; + u32 saveSlot1Counter = 0; + u32 saveSlot2Counter = 0; + u32 slotCheckField = 0; + bool8 securityPassed = FALSE; + u8 saveSlot1Status; + u8 saveSlot2Status; - for (i = 0; i < 14; i++) + // check save slot 1. + for (i = 0; i < ARRAY_COUNT(gSaveSectionLocations); i++) { - sub_8125BF8(i, gFastSaveSection); + DoReadFlashWholeSection(i, gFastSaveSection); if (gFastSaveSection->security == UNKNOWN_CHECK_VALUE) { - v5 = TRUE; + securityPassed = TRUE; checksum = CalculateChecksum(gFastSaveSection->data, location[gFastSaveSection->id].size); if (gFastSaveSection->checksum == checksum) { - v2 = gFastSaveSection->counter; - v4 |= 1 << gFastSaveSection->id; + saveSlot1Counter = gFastSaveSection->counter; + slotCheckField |= 1 << gFastSaveSection->id; } } } - if (v5) + if (securityPassed) { - if (v4 == 0x3FFF) - v14 = 1; + if (slotCheckField == GETVALIDSTATUSBITFIELD) + saveSlot1Status = 1; else - v14 = 255; + saveSlot1Status = 255; } else { - v14 = 0; + saveSlot1Status = 0; } - v4 = 0; - v5 = FALSE; + slotCheckField = 0; + securityPassed = FALSE; - for (i = 0; i < 14; i++) + // check save slot 2. + for (i = 0; i < ARRAY_COUNT(gSaveSectionLocations); i++) { - sub_8125BF8(i + 14, gFastSaveSection); + DoReadFlashWholeSection(i + ARRAY_COUNT(gSaveSectionLocations), gFastSaveSection); if (gFastSaveSection->security == UNKNOWN_CHECK_VALUE) { - v5 = TRUE; + securityPassed = TRUE; checksum = CalculateChecksum(gFastSaveSection->data, location[gFastSaveSection->id].size); if (gFastSaveSection->checksum == checksum) { - v3 = gFastSaveSection->counter; - v4 |= 1 << gFastSaveSection->id; + saveSlot2Counter = gFastSaveSection->counter; + slotCheckField |= 1 << gFastSaveSection->id; } } } - if (v5) + if (securityPassed) { - if (v4 == 0x3FFF) - v10 = 1; + if (slotCheckField == GETVALIDSTATUSBITFIELD) + saveSlot2Status = 1; else - v10 = 255; + saveSlot2Status = 255; } else { - v10 = 0; + saveSlot2Status = 0; } - if (v14 == 1 && v10 == 1) + if (saveSlot1Status == 1 && saveSlot2Status == 1) { - if ((v2 == -1 && v3 == 0) || (v2 == 0 && v3 == -1)) + if ((saveSlot1Counter == -1 && saveSlot2Counter == 0) || (saveSlot1Counter == 0 && saveSlot2Counter == -1)) { - if ((unsigned)(v2 + 1) < (unsigned)(v3 + 1)) + if ((unsigned)(saveSlot1Counter + 1) < (unsigned)(saveSlot2Counter + 1)) { - gSaveCounter = v3; + gSaveCounter = saveSlot2Counter; } else { - gSaveCounter = v2; + gSaveCounter = saveSlot1Counter; } } else { - if (v2 < v3) + if (saveSlot1Counter < saveSlot2Counter) { - gSaveCounter = v3; + gSaveCounter = saveSlot2Counter; } else { - gSaveCounter = v2; + gSaveCounter = saveSlot1Counter; } } return 1; } - if (v14 == 1) + if (saveSlot1Status == 1) { - gSaveCounter = v2; - if (v10 == 255) + gSaveCounter = saveSlot1Counter; + if (saveSlot2Status == 255) return 255; return 1; } - if (v10 == 1) + if (saveSlot2Status == 1) { - gSaveCounter = v3; - if (v14 == 255) + gSaveCounter = saveSlot2Counter; + if (saveSlot1Status == 255) return 255; return 1; } - if (v14 == 0 && v10 == 0) + if (saveSlot1Status == 0 && saveSlot2Status == 0) { gSaveCounter = 0; gLastWrittenSector = 0; @@ -534,7 +537,7 @@ u8 sub_8125B88(u8 a1, u8 *data, u16 size) { u16 i; struct SaveSection *section = &unk_2000000; - sub_8125BF8(a1, section); + DoReadFlashWholeSection(a1, section); if (section->security == UNKNOWN_CHECK_VALUE) { u16 checksum = CalculateChecksum(section->data, size); @@ -555,7 +558,7 @@ u8 sub_8125B88(u8 a1, u8 *data, u16 size) } } -u8 sub_8125BF8(u8 sector, struct SaveSection *section) +u8 DoReadFlashWholeSection(u8 sector, struct SaveSection *section) { ReadFlash(sector, 0, section->data, sizeof(struct SaveSection)); return 1; @@ -577,23 +580,23 @@ u8 HandleSavingData(u8 saveType) u8 i; switch (saveType) { - case HOF_DELETE_SAVE: // deletes save before HOF case. unused - for (i = 28; i < 32; i++) + case HOF_DELETE_SAVE: // deletes HOF before overwriting HOF completely. unused + for (i = (ARRAY_COUNT(gSaveSectionLocations) * 2 + 0); i < TOTALNUMSECTORS; i++) EraseFlashSector(i); case HOF_SAVE: // hall of fame. if (GetGameStat(10) < 999) IncrementGameStat(10); - for (i = 0; i < 2; i++) - HandleWriteSectorNBytes(28 + i, gHallOfFameSaveSectionLocations[i].data, gHallOfFameSaveSectionLocations[i].size); + for (i = 0; i < ARRAY_COUNT(gHallOfFameSaveSectionLocations); i++) + HandleWriteSectorNBytes((ARRAY_COUNT(gSaveSectionLocations) * 2 + 0) + i, gHallOfFameSaveSectionLocations[i].data, gHallOfFameSaveSectionLocations[i].size); SaveSerializedGame(); save_write_to_flash(0xFFFF, gSaveSectionLocations); break; - case NORMAL_SAVE: // normal save. + case NORMAL_SAVE: // normal save. also called by overwriting your own save. default: SaveSerializedGame(); save_write_to_flash(0xFFFF, gSaveSectionLocations); break; - case LINK_SAVE: // link save. update only the pokemon, i think. + case LINK_SAVE: // link save. updates only gSaveBlock1 and gSaveBlock2. SaveSerializedGame(); for (i = 0; i < 5; i++) save_write_to_flash(i, gSaveSectionLocations); @@ -603,8 +606,8 @@ u8 HandleSavingData(u8 saveType) save_write_to_flash(0, gSaveSectionLocations); break; case DIFFERENT_FILE_SAVE: // there is a different file, so erase the file and overwrite it completely. - for (i = 28; i < 32; i++) - EraseFlashSector(i); + for (i = (ARRAY_COUNT(gSaveSectionLocations) * 2 + 0); i < TOTALNUMSECTORS; i++) + EraseFlashSector(i); // erase HOF. SaveSerializedGame(); save_write_to_flash(0xFFFF, gSaveSectionLocations); break; @@ -634,7 +637,7 @@ u8 sub_8125D80(void) // trade.s save bool8 sub_8125DA8(void) // trade.s save { - u8 retVal = sub_812550C(14, gSaveSectionLocations); + u8 retVal = sub_812550C(ARRAY_COUNT(gSaveSectionLocations), gSaveSectionLocations); if (gDamagedSaveSectors) DoSaveFailedScreen(0); if (retVal == 0xFF) @@ -645,7 +648,7 @@ bool8 sub_8125DA8(void) // trade.s save u8 sub_8125DDC(void) // trade.s save { - sub_812556C(14, gSaveSectionLocations); + sub_812556C(ARRAY_COUNT(gSaveSectionLocations), gSaveSectionLocations); if (gDamagedSaveSectors) DoSaveFailedScreen(0); return 0; @@ -653,7 +656,7 @@ u8 sub_8125DDC(void) // trade.s save u8 sub_8125E04(void) // trade.s save { - sub_8125758(14, gSaveSectionLocations); + sub_8125758(ARRAY_COUNT(gSaveSectionLocations), gSaveSectionLocations); if (gDamagedSaveSectors) DoSaveFailedScreen(0); return 0; @@ -709,9 +712,9 @@ u8 sub_8125EC8(u8 a1) gGameContinueCallback = 0; break; case 3: - result = sub_8125B88(28, gHallOfFameSaveSectionLocations[0].data, gHallOfFameSaveSectionLocations[0].size); + result = sub_8125B88((ARRAY_COUNT(gSaveSectionLocations) * 2 + 0), gHallOfFameSaveSectionLocations[0].data, gHallOfFameSaveSectionLocations[0].size); if (result == 1) - result = sub_8125B88(29, gHallOfFameSaveSectionLocations[1].data, gHallOfFameSaveSectionLocations[1].size); + result = sub_8125B88((ARRAY_COUNT(gSaveSectionLocations) * 2 + 1), gHallOfFameSaveSectionLocations[1].data, gHallOfFameSaveSectionLocations[1].size); break; } -- cgit v1.2.3 From 0354f2cc5ae9771d745e6ffadd4715bdc8ff5221 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Fri, 12 May 2017 01:57:43 -0400 Subject: remove unknowns from birch_pc.c --- src/battle_interface.c | 4 +- src/birch_pc.c | 105 +++++++++++++++++++------------------- src/credits.c | 2 +- src/easy_chat.c | 2 +- src/pokedex.c | 22 ++++---- src/script_pokemon_util_80C4BF0.c | 4 +- 6 files changed, 70 insertions(+), 69 deletions(-) (limited to 'src') diff --git a/src/battle_interface.c b/src/battle_interface.c index d097598b5..d4a9f9cce 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -8,6 +8,7 @@ #include "songs.h" #include "battle.h" #include "palette.h" +#include "pokedex.h" struct UnknownStruct5 { @@ -104,7 +105,6 @@ extern const u16 gBattleInterfaceStatusIcons_DynPal[]; #define MACRO1(n) ((n) - (n) / 8 * 8) + 64 * ((n) / 8) extern int sub_8040D3C(); -extern u8 sub_8090D90(); extern void load_gfxc_health_bar(); static void sub_8043D5C(struct Sprite *); @@ -2534,7 +2534,7 @@ static void sub_8045458(u8 a, u8 b) if (battle_side_get_owner(r4) != 0) { u16 species = GetMonData(&gEnemyParty[gUnknown_02024A6A[r4]], MON_DATA_SPECIES); - if (sub_8090D90(SpeciesToNationalPokedexNum(species), 1) != 0) + if (GetNationalPokedexFlag(SpeciesToNationalPokedexNum(species), 1) != 0) { r4 = gSprites[a].data5; if (b != 0) diff --git a/src/birch_pc.c b/src/birch_pc.c index 89eafc0ce..79070b5a8 100644 --- a/src/birch_pc.c +++ b/src/birch_pc.c @@ -9,31 +9,31 @@ extern u16 gSpecialVar_0x8004; extern u16 gSpecialVar_0x8005; extern u16 gSpecialVar_0x8006; -extern const u8 gUnknown_081C4520[]; -extern const u8 gUnknown_081C456A[]; -extern const u8 gUnknown_081C45B0[]; -extern const u8 gUnknown_081C45F9[]; -extern const u8 gUnknown_081C4648[]; -extern const u8 gUnknown_081C467E[]; -extern const u8 gUnknown_081C46B9[]; -extern const u8 gUnknown_081C46FE[]; -extern const u8 gUnknown_081C4747[]; -extern const u8 gUnknown_081C4780[]; -extern const u8 gUnknown_081C47DF[]; -extern const u8 gUnknown_081C4828[]; -extern const u8 gUnknown_081C4863[]; -extern const u8 gUnknown_081C489C[]; -extern const u8 gUnknown_081C48EB[]; -extern const u8 gUnknown_081C4936[]; -extern const u8 gUnknown_081C49A2[]; -extern const u8 gUnknown_081C4A06[]; -extern const u8 gUnknown_081C4A4F[]; -extern const u8 gUnknown_081C4A91[]; -extern const u8 gUnknown_081C4ADA[]; +extern const u8 gBirchDexRatingText_LessThan10[]; +extern const u8 gBirchDexRatingText_LessThan20[]; +extern const u8 gBirchDexRatingText_LessThan30[]; +extern const u8 gBirchDexRatingText_LessThan40[]; +extern const u8 gBirchDexRatingText_LessThan50[]; +extern const u8 gBirchDexRatingText_LessThan60[]; +extern const u8 gBirchDexRatingText_LessThan70[]; +extern const u8 gBirchDexRatingText_LessThan80[]; +extern const u8 gBirchDexRatingText_LessThan90[]; +extern const u8 gBirchDexRatingText_LessThan100[]; +extern const u8 gBirchDexRatingText_LessThan110[]; +extern const u8 gBirchDexRatingText_LessThan120[]; +extern const u8 gBirchDexRatingText_LessThan130[]; +extern const u8 gBirchDexRatingText_LessThan140[]; +extern const u8 gBirchDexRatingText_LessThan150[]; +extern const u8 gBirchDexRatingText_LessThan160[]; +extern const u8 gBirchDexRatingText_LessThan170[]; +extern const u8 gBirchDexRatingText_LessThan180[]; +extern const u8 gBirchDexRatingText_LessThan190[]; +extern const u8 gBirchDexRatingText_LessThan200[]; +extern const u8 gBirchDexRatingText_DexCompleted[]; bool16 ScriptGetPokedexInfo(void) { - if (!gSpecialVar_0x8004) + if (gSpecialVar_0x8004 == 0) // is national dex not present? { gSpecialVar_0x8005 = GetHoennPokedexCount(0); gSpecialVar_0x8006 = GetHoennPokedexCount(1); @@ -47,65 +47,66 @@ bool16 ScriptGetPokedexInfo(void) return IsNationalPokedexEnabled(); } +// This shows your Hoenn Pokedex rating and NOT your National Dex. const u8 *GetPokedexRatingText(u16 count) { if (count < 10) - return gUnknown_081C4520; + return gBirchDexRatingText_LessThan10; if (count < 20) - return gUnknown_081C456A; + return gBirchDexRatingText_LessThan20; if (count < 30) - return gUnknown_081C45B0; + return gBirchDexRatingText_LessThan30; if (count < 40) - return gUnknown_081C45F9; + return gBirchDexRatingText_LessThan40; if (count < 50) - return gUnknown_081C4648; + return gBirchDexRatingText_LessThan50; if (count < 60) - return gUnknown_081C467E; + return gBirchDexRatingText_LessThan60; if (count < 70) - return gUnknown_081C46B9; + return gBirchDexRatingText_LessThan70; if (count < 80) - return gUnknown_081C46FE; + return gBirchDexRatingText_LessThan80; if (count < 90) - return gUnknown_081C4747; + return gBirchDexRatingText_LessThan90; if (count < 100) - return gUnknown_081C4780; + return gBirchDexRatingText_LessThan100; if (count < 110) - return gUnknown_081C47DF; + return gBirchDexRatingText_LessThan110; if (count < 120) - return gUnknown_081C4828; + return gBirchDexRatingText_LessThan120; if (count < 130) - return gUnknown_081C4863; + return gBirchDexRatingText_LessThan130; if (count < 140) - return gUnknown_081C489C; + return gBirchDexRatingText_LessThan140; if (count < 150) - return gUnknown_081C48EB; + return gBirchDexRatingText_LessThan150; if (count < 160) - return gUnknown_081C4936; + return gBirchDexRatingText_LessThan160; if (count < 170) - return gUnknown_081C49A2; + return gBirchDexRatingText_LessThan170; if (count < 180) - return gUnknown_081C4A06; + return gBirchDexRatingText_LessThan180; if (count < 190) - return gUnknown_081C4A4F; + return gBirchDexRatingText_LessThan190; if (count < 200) - return gUnknown_081C4A91; + return gBirchDexRatingText_LessThan200; if (count == 200) { - if (sub_8090D90(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), 1) - || sub_8090D90(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), 1)) - return gUnknown_081C4A91; - return gUnknown_081C4ADA; + if (GetNationalPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), 1) + || GetNationalPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), 1)) // Jirachi or Deoxys is not counted towards the dex completion. + return gBirchDexRatingText_LessThan200; + return gBirchDexRatingText_DexCompleted; } if (count == 201) { - if (sub_8090D90(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), 1) - && sub_8090D90(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), 1)) - return gUnknown_081C4A91; - return gUnknown_081C4ADA; + if (GetNationalPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), 1) + && GetNationalPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), 1)) + return gBirchDexRatingText_LessThan200; + return gBirchDexRatingText_DexCompleted; } if (count == 202) - return gUnknown_081C4ADA; - return gUnknown_081C4520; + return gBirchDexRatingText_DexCompleted; + return gBirchDexRatingText_LessThan10; } void ShowPokedexRatingMessage(void) diff --git a/src/credits.c b/src/credits.c index 01af78bce..ffb7554ba 100644 --- a/src/credits.c +++ b/src/credits.c @@ -2044,7 +2044,7 @@ void sub_81458DC(void) _0814590E:\n\ adds r0, r4, 0\n\ movs r1, 0x1\n\ - bl sub_8090D90\n\ + bl GetNationalPokedexFlag\n\ lsls r0, 24\n\ adds r6, r7, 0\n\ adds r6, 0x90\n\ diff --git a/src/easy_chat.c b/src/easy_chat.c index 380fe6e4d..33d7678bb 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -243,7 +243,7 @@ static u16 sub_80EB9D8(void) { { const u16 dexNum = SpeciesToNationalPokedexNum(*speciesList); - const u8 local2 = sub_8090D90(dexNum, 0); + const u8 local2 = GetNationalPokedexFlag(dexNum, 0); if (local2) { diff --git a/src/pokedex.c b/src/pokedex.c index 5ea1f9938..83b87906d 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -855,8 +855,8 @@ void SortPokedex(u8 dexMode, u8 sortMode) { vars[2] = HoennToNationalOrder(i + 1); gPokedexView->unk0[i].dexNum = vars[2]; - gPokedexView->unk0[i].seen = sub_8090D90(vars[2], 0); - gPokedexView->unk0[i].owned = sub_8090D90(vars[2], 1); + gPokedexView->unk0[i].seen = GetNationalPokedexFlag(vars[2], 0); + gPokedexView->unk0[i].owned = GetNationalPokedexFlag(vars[2], 1); if (gPokedexView->unk0[i].seen) gPokedexView->unk60C = i + 1; } @@ -870,14 +870,14 @@ void SortPokedex(u8 dexMode, u8 sortMode) for (i = 0; i < vars[0]; i++) { vars[2] = i + 1; - if (sub_8090D90(vars[2], 0)) + if (GetNationalPokedexFlag(vars[2], 0)) r10 = 1; if (r10) { asm(""); //Needed to match for some reason gPokedexView->unk0[r5].dexNum = vars[2]; - gPokedexView->unk0[r5].seen = sub_8090D90(vars[2], 0); - gPokedexView->unk0[r5].owned = sub_8090D90(vars[2], 1); + gPokedexView->unk0[r5].seen = GetNationalPokedexFlag(vars[2], 0); + gPokedexView->unk0[r5].owned = GetNationalPokedexFlag(vars[2], 1); if (gPokedexView->unk0[r5].seen) gPokedexView->unk60C = r5 + 1; r5++; @@ -891,11 +891,11 @@ void SortPokedex(u8 dexMode, u8 sortMode) { vars[2] = gPokedexOrder_Alphabetical[i]; - if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 0)) + if (NationalToHoennOrder(vars[2]) <= vars[0] && GetNationalPokedexFlag(vars[2], 0)) { gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2]; gPokedexView->unk0[gPokedexView->unk60C].seen = 1; - gPokedexView->unk0[gPokedexView->unk60C].owned = sub_8090D90(vars[2], 1); + gPokedexView->unk0[gPokedexView->unk60C].owned = GetNationalPokedexFlag(vars[2], 1); gPokedexView->unk60C++; } } @@ -905,7 +905,7 @@ void SortPokedex(u8 dexMode, u8 sortMode) { vars[2] = gPokedexOrder_Weight[i]; - if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 1)) + if (NationalToHoennOrder(vars[2]) <= vars[0] && GetNationalPokedexFlag(vars[2], 1)) { gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2]; gPokedexView->unk0[gPokedexView->unk60C].seen = 1; @@ -919,7 +919,7 @@ void SortPokedex(u8 dexMode, u8 sortMode) { vars[2] = gPokedexOrder_Weight[i]; - if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 1)) + if (NationalToHoennOrder(vars[2]) <= vars[0] && GetNationalPokedexFlag(vars[2], 1)) { gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2]; gPokedexView->unk0[gPokedexView->unk60C].seen = 1; @@ -933,7 +933,7 @@ void SortPokedex(u8 dexMode, u8 sortMode) { vars[2] = gPokedexOrder_Height[i]; - if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 1)) + if (NationalToHoennOrder(vars[2]) <= vars[0] && GetNationalPokedexFlag(vars[2], 1)) { gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2]; gPokedexView->unk0[gPokedexView->unk60C].seen = 1; @@ -947,7 +947,7 @@ void SortPokedex(u8 dexMode, u8 sortMode) { vars[2] = gPokedexOrder_Height[i]; - if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 1)) + if (NationalToHoennOrder(vars[2]) <= vars[0] && GetNationalPokedexFlag(vars[2], 1)) { gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2]; gPokedexView->unk0[gPokedexView->unk60C].seen = 1; diff --git a/src/script_pokemon_util_80C4BF0.c b/src/script_pokemon_util_80C4BF0.c index 912458655..d1e401e18 100644 --- a/src/script_pokemon_util_80C4BF0.c +++ b/src/script_pokemon_util_80C4BF0.c @@ -568,8 +568,8 @@ u8 ScriptGiveMon(u16 species, u8 var, u16 item, u32 var3, u32 var4, u8 var5) if(sentToPc >= 0) { // set both the seen and caught flags - sub_8090D90(nationalSpecies, 2); - sub_8090D90(nationalSpecies, 3); + GetNationalPokedexFlag(nationalSpecies, 2); + GetNationalPokedexFlag(nationalSpecies, 3); } } return sentToPc; -- cgit v1.2.3 From ac021a863dfc9672933d6f4ac2a8978a8dd457c0 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Fri, 12 May 2017 02:15:34 -0400 Subject: more comments on birch_pc.c --- src/birch_pc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/birch_pc.c b/src/birch_pc.c index 79070b5a8..df6ebc6ea 100644 --- a/src/birch_pc.c +++ b/src/birch_pc.c @@ -93,19 +93,19 @@ const u8 *GetPokedexRatingText(u16 count) if (count == 200) { if (GetNationalPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), 1) - || GetNationalPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), 1)) // Jirachi or Deoxys is not counted towards the dex completion. + || GetNationalPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), 1)) // Jirachi or Deoxys is not counted towards the dex completion. If either of these flags are enabled, it means the actual count is less than 200. return gBirchDexRatingText_LessThan200; return gBirchDexRatingText_DexCompleted; } if (count == 201) { if (GetNationalPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), 1) - && GetNationalPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), 1)) + && GetNationalPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), 1)) // If both of these flags are enabled, it means the actual count is less than 200. return gBirchDexRatingText_LessThan200; return gBirchDexRatingText_DexCompleted; } if (count == 202) - return gBirchDexRatingText_DexCompleted; + return gBirchDexRatingText_DexCompleted; // Hoenn dex is considered complete, even though the hoenn dex count is 210. return gBirchDexRatingText_LessThan10; } -- cgit v1.2.3 From f999ebede0e0012cc68be71841edd3910168c105 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Fri, 12 May 2017 02:15:51 -0400 Subject: actually update the file --- src/birch_pc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/birch_pc.c b/src/birch_pc.c index df6ebc6ea..f01107b3d 100644 --- a/src/birch_pc.c +++ b/src/birch_pc.c @@ -47,7 +47,7 @@ bool16 ScriptGetPokedexInfo(void) return IsNationalPokedexEnabled(); } -// This shows your Hoenn Pokedex rating and NOT your National Dex. +// This shows your Hoenn Pokedex rating and not your National Dex. const u8 *GetPokedexRatingText(u16 count) { if (count < 10) -- cgit v1.2.3 From d8ce874f29cb6d21f3348f62ebe05ce004ac3c38 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Sun, 14 May 2017 19:34:04 -0400 Subject: decompile up to sub_813AF3C --- src/player_pc.c | 129 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 125 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/player_pc.c b/src/player_pc.c index f0f0709b1..d24dbecb7 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -21,28 +21,41 @@ enum QUANTITY, }; +// special item description handlers +enum +{ + ITEMPC_SWITCH_WHICH_ITEM = 0xFFF7, + ITEMPC_OKAY_TO_THROW_AWAY, + ITEMPC_TOO_IMPORTANT, + ITEMPC_NO_MORE_ROOM, + ITEMPC_THREW_AWAY_ITEM, + ITEMPC_HOW_MANY_TO_TOSS, + ITEMPC_WITHDREW_THING, + ITEMPC_HOW_MANY_TO_WITHDRAW, + ITEMPC_GO_BACK_TO_PREV +}; + extern void DisplayItemMessageOnField(u8, u8*, TaskFunc, u16); extern void DoPlayerPCDecoration(u8); extern void BuyMenuFreeMemory(void); extern void DestroyVerticalScrollIndicator(u8); -extern u8 sub_813AF3C(void); extern void sub_813AF78(void); extern void sub_813B108(u8); extern void sub_813B174(u8); extern void sub_80A6A30(void); extern u8 sub_807D770(void); -extern void sub_813AE6C(u8, u8); -extern void sub_813AD58(u16); -extern void sub_813AE0C(u8); extern void sub_80F996C(u8); extern void sub_80A418C(u16, enum StringConvertMode, int, int, int); extern void sub_80F98DC(int); extern void sub_80A4164(u8 *, u16, enum StringConvertMode, u8); extern void CreateVerticalScrollIndicators(u32, u32, u32); // unknown args +extern void sub_80F944C(void); +extern void LoadScrollIndicatorPalette(void); extern u8 gOtherText_NoItems[]; extern u16 gNewGamePCItems[]; +extern u16 gUnknown_08406334[3]; extern u8 gOtherText_WhatWillYouDo[]; extern u8 gOtherText_NoMailHere[]; @@ -57,7 +70,16 @@ extern u8 gUnknown_08406327[]; extern u8 gUnknown_08406330[]; extern u8 gUnknown_0840631E[]; extern u8 gUnknown_08406318[]; +extern u8 gMenuText_GoBackToPrev[]; extern u8 gOtherText_CancelNoTerminator[]; +extern u8 gOtherText_HowManyToWithdraw[]; +extern u8 gOtherText_WithdrewThing[]; +extern u8 gOtherText_HowManyToToss[]; +extern u8 gOtherText_ThrewAwayItem[]; +extern u8 gOtherText_NoMoreRoom[]; +extern u8 gOtherText_TooImportant[]; +extern u8 gOtherText_OkayToThrowAwayPrompt[]; +extern u8 gOtherText_SwitchWhichItem[]; extern u8 gUnknown_030007B4; extern u8 unk_201FE00[]; @@ -86,6 +108,11 @@ void sub_813A984(u8); void sub_813A9EC(u8); void sub_813AA30(u8, u8); void sub_813ABE8(u8); +void sub_813AD58(u16); +void sub_813AE0C(u8); +void sub_813AE6C(u8, u8); +void sub_813AF04(void); +u8 sub_813AF3C(void); void NewGameInitPCItems(void) { @@ -825,3 +852,97 @@ weirdCase: else DestroyVerticalScrollIndicator(1); } + +void sub_813AD58(u16 itemId) +{ + u8 *string; + + switch(itemId) + { + case ITEMPC_GO_BACK_TO_PREV: + string = gMenuText_GoBackToPrev; + break; + case ITEMPC_HOW_MANY_TO_WITHDRAW: + string = gOtherText_HowManyToWithdraw; + break; + case ITEMPC_WITHDREW_THING: + string = gOtherText_WithdrewThing; + break; + case ITEMPC_HOW_MANY_TO_TOSS: + string = gOtherText_HowManyToToss; + break; + case ITEMPC_THREW_AWAY_ITEM: + string = gOtherText_ThrewAwayItem; + break; + case ITEMPC_NO_MORE_ROOM: + string = gOtherText_NoMoreRoom; + break; + case ITEMPC_TOO_IMPORTANT: + string = gOtherText_TooImportant; + break; + case ITEMPC_OKAY_TO_THROW_AWAY: + string = gOtherText_OkayToThrowAwayPrompt; + break; + case ITEMPC_SWITCH_WHICH_ITEM: + string = gOtherText_SwitchWhichItem; + break; + default: + string = ItemId_GetDescription(itemId); + break; + } + + sub_8072AB0(string, 8, 0x68, 0x68, 0x30, 1); +} + +void sub_813AE0C(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + s16 var = data[1] + data[0]; + + sub_813ABE8(taskId); + + if(data[9] == 0) + { + if(var == data[2]) + sub_813AD58(0xFFFF); + else + sub_813AD58(gSaveBlock1.pcItems[var].itemId); + } +} + +void sub_813AE6C(u8 taskId, u8 var) +{ + s16 *data = gTasks[taskId].data; + + sub_80F944C(); + LoadScrollIndicatorPalette(); + sub_813AF04(); + MenuDrawTextWindow(0xF, 0, 0x1D, 0x13); + MenuDrawTextWindow(0, 0xC, 0xE, 0x13); + MenuDrawTextWindow(0, 0, 0xB, 3); + sub_813AD58(gSaveBlock1.pcItems[0].itemId); + MenuPrint(gUnknown_084062C0[var].text, 1, 1); + sub_813ABE8(taskId); + InitMenu(0, 0x10, 2, data[4], data[0], 0xD); +} + +void sub_813AF04(void) +{ + u16 arr[3]; + + memcpy(arr, gUnknown_08406334, sizeof(arr)); + LoadPalette(&arr[2], 0xDF, 2); + LoadPalette(&arr[1], 0xD1, 2); + LoadPalette(&arr[0], 0xD8, 2); +} + +u8 sub_813AF3C(void) +{ + u8 i, j; + + for(i = 0, j = 6; j < 16; j++) + if(gSaveBlock1.mail[j].itemId != 0) + i++; + + return i; +} -- cgit v1.2.3 From 629ee584a5490a587aff4e8f1485d8e35bd14a38 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 17 May 2017 01:36:12 -0500 Subject: fix up party_menu.c and decompile some more functions --- src/party_menu.c | 457 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 244 insertions(+), 213 deletions(-) (limited to 'src') diff --git a/src/party_menu.c b/src/party_menu.c index d473eae6d..b38e89376 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -5,46 +5,99 @@ #include "sound.h" #include "string_util.h" #include "task.h" +#include "sprite.h" +#include "palette.h" +#include "event_data.h" +#include "main.h" #define DATA_COUNT (6) struct Unk201C000 { /*0x00*/ struct Pokemon *pokemon; - /*0x04*/ u8 var04; - /*0x05*/ u8 var05; - /*0x06*/ u16 var06; - u8 pad_08[10]; - /*0x12*/ u16 var12; + /*0x04*/ u8 unk4; + /*0x05*/ u8 unk5; + /*0x06*/ u16 unk6; + /*0x08*/ u8 pad_08[4]; + /*0x0C*/ s32 var0C; + /*0x10*/ TaskFunc unk10; }; -struct Unk201B260 +struct Unk201B000 { - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - u8 pad_02[2]; - /*0x04*/ s16 var04[DATA_COUNT * 2]; - u8 pad_1C[2]; - /*0x1E*/ u16 var1E; - /*0x20*/ u16 var20; + u8 filler0[0x260]; + u8 unk260; + u8 unk261; + u8 filler262[2]; + s16 unk264[DATA_COUNT * 2]; + u8 filler27C[2]; + s16 unk27E; + s16 unk280; + u16 unk282; }; -extern struct Unk201B260 unk_201B260; -extern struct Unk201C000 unk_201C000; +struct UnknownStruct5 +{ + u8 unk0; + u8 unk1; + u16 *unk4; +}; + +extern u8 ewram[]; +#define ewram1B000 (*(struct Unk201B000 *)(ewram + 0x1B000)) +#define ewram1C000 (*(struct Unk201C000 *)(ewram + 0x1C000)) + extern u8 gUnknown_0202E8F4; extern u8 gUnknown_0202E8F6; +extern u8 gUnknown_0202E8FA; +extern u8 gLastFieldPokeMenuOpened; -extern u8 gUnknown_083769A8[][12]; +//extern const u16 gUnknown_083769A8[][6]; +//extern const u8 gUnknown_083769A8[][12]; +extern const u8 gUnknown_083769A8[]; extern u8 gUnknown_08376D1C[DATA_COUNT]; extern u8 *gUnknown_08376D04[DATA_COUNT]; +extern void (*const gUnknown_08376B54[])(u8); +extern const struct UnknownStruct5 gUnknown_08376BB4[][6]; extern u8 gOtherText_TallPlusAndRightArrow[]; +extern u8 gOtherText_WontHaveAnyEffect[]; +extern const u8 gMoveNames[][13]; +extern u8 *const gItemEffectTable[]; + +extern bool8 IsDoubleBattle(void); +extern void AddBagItem(); +extern void RemoveBagItem(); +extern void SetUpBattlePokemonMenu(u8); +extern void sub_808B0C0(u8); -void task_pc_turn_off(u8 *u8, int i); +void task_pc_turn_off(); static void sub_806E884(u8 taskId); void sub_806F8AC(u8 taskId); +void sub_806FB0C(u8 taskId); void PartyMenuUpdateLevelOrStatus(struct Pokemon *, u8); -u8 ExecuteTableBasedItemEffect__(u8 u8, u16 u16, int i); +u8 ExecuteTableBasedItemEffect__(u8, u16, u8); void sub_80701DC(u8 taskId); +void DoRecoverPP(u8); +void sub_806D538(); +void sub_806D5A4(void); +void sub_806E8D0(); +void GetMedicineItemEffectMessage(); + +/* +void sub_806AEDC(void) +{ + const struct UnknownStruct5 *r5; + s32 i; + + AnimateSprites(); + BuildOamBuffer(); + r5 = gUnknown_08376BB4[gUnknown_0202E8FA]; + for (i = 0; i < 6; i++) + sub_800142C(r5[i].unk0 * 8, r5[i].unk1 * 8, r5[i].unk4, 0, (i << 5) | 0x200); + RunTasks(); + UpdatePaletteFade(); +} +*/ u8 sub_806E834(u8 *message, u8 arg1) { @@ -80,208 +133,194 @@ static void sub_806E884(u8 taskId) asm(".section .text_b"); -#ifdef NONMATCHING void sub_8070088(u8 taskId) { - u8 dummyTaskId; - struct Task *task2; + u8 taskId2; gTasks[taskId].func = TaskDummy; - - if (GetMonData(&gPlayerParty[unk_201C000.var04], MON_DATA_SPECIES) == 0) + if (GetMonData(&gPlayerParty[ewram1C000.unk5], MON_DATA_SPECIES) == 0) { gTasks[taskId].func = sub_80701DC; - return; } + else + { + s16 *taskData; + + taskId2 = CreateTask(TaskDummy, 5); + taskData = gTasks[taskId2].data; + ewram1C000.pokemon = &gPlayerParty[ewram1C000.unk5]; + taskData[10] = GetMonData(ewram1C000.pokemon, MON_DATA_MAX_HP); + taskData[11] = GetMonData(ewram1C000.pokemon, MON_DATA_HP); + if (ExecuteTableBasedItemEffect__(ewram1C000.unk5, ewram1C000.unk6, 0)) + { + DestroyTask(taskId2); + gTasks[taskId].func = sub_80701DC; + } + else + { + gUnknown_0202E8F4 = 1; + MenuZeroFillWindowRect(3, 14, 26, 19); + PlaySE(SE_KAIFUKU); + PartyMenuUpdateLevelOrStatus(ewram1C000.pokemon, ewram1C000.unk5); + task_pc_turn_off(&gUnknown_083769A8[IsDoubleBattle() * 12 + ewram1C000.unk5 * 2], 9); + ewram1B000.unk261 = 2; + taskData[12] = GetMonData(ewram1C000.pokemon, MON_DATA_HP) - taskData[11]; + taskData[14] = 1; + ewram1B000.unk27E = 1; + ewram1B000.unk280 = 1; + ewram1B000.unk282 = taskData[11]; + ewram1C000.var0C = -32768; + gTasks[taskId2].func = sub_806F8AC; + } + } +} - dummyTaskId = CreateTask(TaskDummy, 5); - task2 = &gTasks[dummyTaskId]; +void sub_80701DC(u8 taskId) +{ + if (ewram1B000.unk27E == 1) + { + AddBagItem(ewram1C000.unk6, 1); + if (GetMonData(&gPlayerParty[ewram1C000.unk5], MON_DATA_SPECIES) != 0) + { + task_pc_turn_off(&gUnknown_083769A8[IsDoubleBattle() * 12 + ewram1C000.unk5 * 2], 3); + ewram1B000.unk261 = 2; + } + ewram1B000.unk27E = 0; + } + ewram1C000.unk5++; + if (ewram1C000.unk5 == 6) + { + gUnknown_0202E8F4 = 0; + if (ewram1B000.unk280 == 0) + { + gTasks[taskId].func = TaskDummy; + sub_806E834(gOtherText_WontHaveAnyEffect, 1); + CreateTask(sub_806FB0C, 8); + } + else + { + RemoveBagItem(ewram1C000.unk6, 1); + gTasks[taskId].func = ewram1C000.unk10; + } + gLastFieldPokeMenuOpened = 0; + } + else + { + sub_8070088(taskId); + } +} - task2->data[10] = GetMonData(unk_201C000.pokemon, MON_DATA_MAX_HP); - task2->data[11] = GetMonData(unk_201C000.pokemon, MON_DATA_HP); +void CreateItemUseMoveMenu(u8 partyMonIndex) +{ + u8 r6; + u8 i; - if (ExecuteTableBasedItemEffect__(unk_201C000.var05, unk_201C000.var06, 0)) + r6 = 0; + MenuDrawTextWindow(19, 10, 29, 19); + for (i = 0; i < 4; i++) { - DestroyTask(dummyTaskId); - gTasks[taskId].func = sub_80701DC; - return; + u16 move = GetMonData(&gPlayerParty[partyMonIndex], MON_DATA_MOVE1 + i); + + MenuPrint(gMoveNames[move], 20, i * 2 + 11); + if (move != 0) + r6++; } + InitMenu(0, 20, 11, r6, 0, 9); +} - gUnknown_0202E8F4 = 1; - MenuZeroFillWindowRect(3, 14, 26, 19); - PlaySE(SE_KAIFUKU); - PartyMenuUpdateLevelOrStatus(unk_201C000.pokemon, unk_201C000.var05); +void Task_HandleItemUseMoveMenuInput(u8 taskId) +{ + if (gMain.newKeys & DPAD_UP) + { + PlaySE(SE_SELECT); + MoveMenuCursor(-1); + } + else if (gMain.newKeys & DPAD_DOWN) + { + PlaySE(SE_SELECT); + MoveMenuCursor(1); + } + else if (gMain.newKeys & A_BUTTON) + { + gUnknown_08376B54[0](taskId); + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + gUnknown_08376B54[1](taskId); + } +} - task_pc_turn_off(&gUnknown_083769A8[IsDoubleBattle()][unk_201C000.var05], 9); - unk_201B260.var01 = 2; // u8 +void DoPPRecoveryItemEffect(u8 taskId, u16 b, TaskFunc c) +{ + u8 *itemEffect; + u8 taskId2; - task2->data[12] = GetMonData(unk_201C000.pokemon, MON_DATA_HP) - task2->data[11]; - task2->data[14] = 1; - unk_201B260.var1E = 1; // u16 - unk_201B260.var20 = 1; // u16 + if (b == 0xAF) + itemEffect = gSaveBlock1.enigmaBerry.itemEffect; + else + itemEffect = gItemEffectTable[b - 13]; + gTasks[taskId].func = TaskDummy; + taskId2 = CreateTask(TaskDummy, 5); + sub_806E8D0(taskId, b, c); + if (!(itemEffect[4] & 0x10)) + { + gTasks[taskId2].data[11] = 0; + DoRecoverPP(taskId2); + } + else + { + PlaySE(SE_SELECT); + sub_806D538(10, 3); + CreateItemUseMoveMenu(ewram1C000.unk5); + gTasks[taskId2].func = Task_HandleItemUseMoveMenuInput; + gMain.newKeys = 0; + } +} - unk_201C000.var12 = -0x8000; - task2->func = sub_806F8AC; +void ItemUseMoveMenu_HandleMoveSelection(u8 taskId) +{ + sub_8072DEC(); + MenuZeroFillWindowRect(19, 10, 29, 19); + sub_806D5A4(); + gTasks[taskId].data[11] = GetMenuCursorPos(); + DoRecoverPP(taskId); } -#else -__attribute__((naked)) -void sub_8070088(void) + +void ItemUseMoveMenu_HandleCancel(u8 taskId) { - 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, 0x4\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - ldr r1, _08070120 @ =gTasks\n\ - mov r10, r1\n\ - lsls r1, r0, 2\n\ - adds r1, r0\n\ - lsls r1, 3\n\ - mov r2, r10\n\ - adds r7, r1, r2\n\ - ldr r5, _08070124 @ =TaskDummy\n\ - str r5, [r7]\n\ - ldr r4, _08070128 @ =0x0201c000\n\ - ldrb r0, [r4, 0x5]\n\ - movs r1, 0x64\n\ - mov r9, r1\n\ - mov r2, r9\n\ - muls r2, r0\n\ - adds r0, r2, 0\n\ - ldr r1, _0807012C @ =gPlayerParty\n\ - mov r8, r1\n\ - add r0, r8\n\ - movs r1, 0xB\n\ - bl GetMonData\n\ - cmp r0, 0\n\ - beq _08070118\n\ - adds r0, r5, 0\n\ - movs r1, 0x5\n\ - bl CreateTask\n\ - lsls r0, 24\n\ - lsrs r5, r0, 24\n\ - lsls r0, r5, 2\n\ - adds r0, r5\n\ - lsls r0, 3\n\ - str r0, [sp]\n\ - mov r0, r10\n\ - adds r0, 0x8\n\ - ldr r2, [sp]\n\ - adds r6, r2, r0\n\ - ldrb r0, [r4, 0x5]\n\ - mov r1, r9\n\ - muls r1, r0\n\ - adds r0, r1, 0\n\ - add r0, r8\n\ - str r0, [r4]\n\ - movs r1, 0x3A\n\ - bl GetMonData\n\ - strh r0, [r6, 0x14]\n\ - ldr r0, [r4]\n\ - movs r1, 0x39\n\ - bl GetMonData\n\ - strh r0, [r6, 0x16]\n\ - ldrb r0, [r4, 0x5]\n\ - ldrh r1, [r4, 0x6]\n\ - movs r2, 0\n\ - bl ExecuteTableBasedItemEffect__\n\ - lsls r0, 24\n\ - cmp r0, 0\n\ - beq _08070134\n\ - adds r0, r5, 0\n\ - bl DestroyTask\n\ -_08070118:\n\ - ldr r0, _08070130 @ =sub_80701DC\n\ - str r0, [r7]\n\ - b _080701B0\n\ - .align 2, 0\n\ -_08070120: .4byte gTasks\n\ -_08070124: .4byte TaskDummy\n\ -_08070128: .4byte 0x0201c000\n\ -_0807012C: .4byte gPlayerParty\n\ -_08070130: .4byte sub_80701DC\n\ -_08070134:\n\ - ldr r1, _080701C0 @ =gUnknown_0202E8F4\n\ - movs r0, 0x1\n\ - strb r0, [r1]\n\ - movs r0, 0x3\n\ - movs r1, 0xE\n\ - movs r2, 0x1A\n\ - movs r3, 0x13\n\ - bl MenuZeroFillWindowRect\n\ - movs r0, 0x1\n\ - bl PlaySE\n\ - ldr r0, [r4]\n\ - ldrb r1, [r4, 0x5]\n\ - bl PartyMenuUpdateLevelOrStatus\n\ - bl IsDoubleBattle\n\ - adds r1, r0, 0\n\ - lsls r1, 24\n\ - lsrs r1, 24\n\ - lsls r0, r1, 1\n\ - adds r0, r1\n\ - lsls r0, 2\n\ - ldrb r1, [r4, 0x5]\n\ - lsls r1, 1\n\ - adds r0, r1\n\ - ldr r1, _080701C4 @ =gUnknown_083769A8\n\ - adds r0, r1\n\ - movs r1, 0x9\n\ - bl task_pc_turn_off\n\ - ldr r2, _080701C8 @ =0xfffff261\n\ - adds r1, r4, r2\n\ - movs r0, 0x2\n\ - strb r0, [r1]\n\ - ldr r0, [r4]\n\ - movs r1, 0x39\n\ - bl GetMonData\n\ - ldrh r1, [r6, 0x16]\n\ - subs r0, r1\n\ - strh r0, [r6, 0x18]\n\ - movs r0, 0x1\n\ - strh r0, [r6, 0x1C]\n\ - ldr r1, _080701CC @ =0xfffff27e\n\ - adds r0, r4, r1\n\ - movs r1, 0x1\n\ - strh r1, [r0]\n\ - ldr r2, _080701D0 @ =0xfffff280\n\ - adds r0, r4, r2\n\ - strh r1, [r0]\n\ - ldrh r1, [r6, 0x16]\n\ - adds r2, 0x2\n\ - adds r0, r4, r2\n\ - strh r1, [r0]\n\ - ldr r0, _080701D4 @ =0xffff8000\n\ - str r0, [r4, 0xC]\n\ - ldr r1, [sp]\n\ - add r1, r10\n\ - ldr r0, _080701D8 @ =sub_806F8AC\n\ - str r0, [r1]\n\ -_080701B0:\n\ - add sp, 0x4\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\ -_080701C0: .4byte gUnknown_0202E8F4\n\ -_080701C4: .4byte gUnknown_083769A8\n\ -_080701C8: .4byte 0xfffff261\n\ -_080701CC: .4byte 0xfffff27e\n\ -_080701D0: .4byte 0xfffff280\n\ -_080701D4: .4byte 0xffff8000\n\ -_080701D8: .4byte sub_806F8AC\n\ - .syntax divided\n"); + sub_8072DEC(); + MenuZeroFillWindowRect(19, 10, 29, 19); + if (gMain.inBattle) + gTasks[ewram1C000.unk4].func = SetUpBattlePokemonMenu; + else + gTasks[ewram1C000.unk4].func = sub_808B0C0; + sub_806D538(3, 0); + DestroyTask(taskId); } -#endif +void DoRecoverPP(u8 taskId) +{ + u16 r5 = 0; + + if (ExecuteTableBasedItemEffect__(ewram1C000.unk5, ewram1C000.unk6, gTasks[taskId].data[11])) + { + gUnknown_0202E8F4 = r5; + PlaySE(SE_SELECT); + sub_806E834(gOtherText_WontHaveAnyEffect, 1); + } + else + { + gUnknown_0202E8F4 = 1; + PlaySE(SE_KAIFUKU); + RemoveBagItem(ewram1C000.unk6, 1); + r5 = GetMonData(ewram1C000.pokemon, MON_DATA_MOVE1 + gTasks[taskId].data[11]); + StringCopy(gStringVar1, gMoveNames[r5]); + GetMedicineItemEffectMessage(ewram1C000.unk6); + sub_806E834(gStringVar4, 1); + } + gTasks[taskId].func = sub_806FB0C; +} asm(".section .text_c"); @@ -296,35 +335,27 @@ void sub_8070848(u8 taskId) u8 x; u8 y; u32 stat; - struct Pokemon **pokemon; - pokemon = &unk_201C000.pokemon; - asm("" ::: "r0"); - stat = GetMonData(*pokemon, gUnknown_08376D1C[i]); + stat = GetMonData(ewram1C000.pokemon, gUnknown_08376D1C[i]); - unk_201B260.var04[i + DATA_COUNT] = stat; - unk_201B260.var04[i] = stat - unk_201B260.var04[i]; + ewram1B000.unk264[i + DATA_COUNT] = stat; + ewram1B000.unk264[i] = stat - ewram1B000.unk264[i]; x = (i / 3) * 9 + 11; y = ((i % 3) << 1) + 1; MenuPrint_PixelCoords(gUnknown_08376D04[i], (x + 1) * 8, y * 8, 1); - if (i == 2) - { MenuPrint_PixelCoords(gOtherText_TallPlusAndRightArrow, (x + 6) * 8 + 6, y * 8, 0); - } else - { MenuPrint_PixelCoords(gOtherText_TallPlusAndRightArrow, (x + 6) * 8 + 6, y * 8, 1); - } - gStringVar1[0] = 0xFC; + gStringVar1[0] = EXT_CTRL_CODE_BEGIN; gStringVar1[1] = 0x14; gStringVar1[2] = 0x06; - ConvertIntToDecimalStringN(gStringVar1 + 3, unk_201B260.var04[i], 1, 2); + ConvertIntToDecimalStringN(gStringVar1 + 3, ewram1B000.unk264[i], 1, 2); MenuPrint_PixelCoords(gStringVar1, (x + 6) * 8 + 12, y * 8, 0); } -- cgit v1.2.3 From acd08a46a52bca689914d018430777bd6e2710d6 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 17 May 2017 17:40:04 -0500 Subject: fill holes in party_menu.c and add battle_interface.h header --- src/battle_interface.c | 32 +- src/battle_party_menu.c | 1 - src/menu.c | 2 +- src/party_menu.c | 1182 +++++++++++++++++++++++++++++++++++++++++++++-- 4 files changed, 1161 insertions(+), 56 deletions(-) (limited to 'src') diff --git a/src/battle_interface.c b/src/battle_interface.c index 9938c4b54..ba3cba894 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -8,6 +8,7 @@ #include "songs.h" #include "battle.h" #include "palette.h" +#include "battle_interface.h" struct UnknownStruct5 { @@ -35,15 +36,6 @@ struct UnknownStruct7 u8 filler0[0x180]; }; -struct UnknownStruct9 -{ - s32 unk0; - u32 unk4; - u32 unk8; - u32 unkC_0:5; - u32 unk10; -}; - extern u8 ewram[]; #define ewram520 ((struct UnknownStruct7 *)(ewram + 0x00520)) #define ewram16088 (*(u8 *) (ewram + 0x16088)) @@ -109,9 +101,8 @@ extern void load_gfxc_health_bar(); static void sub_8043D5C(struct Sprite *); static const void *sub_8043CDC(u8); -void sub_8044210(u8, s16, u8); +static void sub_8044210(u8, s16, u8); static void draw_status_ailment_maybe(u8); -void sub_8045A5C(u8 a, struct Pokemon *pkmn, u8 c); extern void sub_8045180(struct Sprite *); static void sub_8045110(struct Sprite *); static void sub_8045048(struct Sprite *); @@ -119,12 +110,11 @@ static void sub_8044F70(u8 taskId); static void sub_8044E74(u8 taskId); static void sub_8044ECC(u8 taskId); static u8 sub_80457E8(u8, u8); -s32 sub_8045C78(u8, u8, u8, u8); static int sub_8045F58(s32, s32, int, int *, u8, u16); static u8 GetScaledExpFraction(int, int, int, u8); static void sub_8045D58(u8, u8); static u8 sub_804602C(int, int, int, int *, u8 *, u8); -static void sub_8046128(struct UnknownStruct9 *a, int *b, void *c); +static void sub_8046128(struct BattleInterfaceStruct1 *a, int *b, void *c); static int do_nothing(s16 unused1, s16 unused2, int unused3) { @@ -937,7 +927,7 @@ _0804420C: .4byte 0x04000008\n\ } #endif -void sub_8044210(u8 a, s16 b, u8 c) +static void sub_8044210(u8 a, s16 b, u8 c) { u8 str[0x14]; u8 *ptr; @@ -1377,15 +1367,9 @@ void sub_804454C(void) } } -struct UnknownStruct8 -{ - u16 unk0; - u32 unk4; -}; - // This function almost matches except for just two instructions around 0x08044B52 that are swapped. #ifdef NONMATCHING -u8 sub_8044804(u8 a, const struct UnknownStruct8 *b, u8 c, u8 d) +u8 sub_8044804(u8 a, const struct BattleInterfaceStruct2 *b, u8 c, u8 d) { u8 r7; s16 x; @@ -1594,7 +1578,7 @@ u8 sub_8044804(u8 a, const struct UnknownStruct8 *b, u8 c, u8 d) } #else __attribute__((naked)) -u8 sub_8044804(u8 a, const struct UnknownStruct8 *b, u8 c, u8 d) +u8 sub_8044804(u8 a, const struct BattleInterfaceStruct2 *b, u8 c, u8 d) { asm(".syntax unified\n\ push {r4-r7,lr}\n\ @@ -3005,7 +2989,7 @@ static u8 sub_804602C(int a, int b, int c, int *d, u8 *e, u8 f) return r3; } -s16 sub_80460C8(struct UnknownStruct9 *a, int *b, void *c, int d) +s16 sub_80460C8(struct BattleInterfaceStruct1 *a, int *b, void *c, int d) { u16 r7; s16 r1; @@ -3020,7 +3004,7 @@ s16 sub_80460C8(struct UnknownStruct9 *a, int *b, void *c, int d) return r7; } -static void sub_8046128(struct UnknownStruct9 *a, int *b, void *c) +static void sub_8046128(struct BattleInterfaceStruct1 *a, int *b, void *c) { u8 sp8[6]; u16 sp10[6]; diff --git a/src/battle_party_menu.c b/src/battle_party_menu.c index 820d16465..690ef99be 100644 --- a/src/battle_party_menu.c +++ b/src/battle_party_menu.c @@ -40,7 +40,6 @@ extern TaskFunc PartyMenuGetPopupMenuFunc(u8, const struct PartyPopupMenu *, con extern void ShowPokemonSummaryScreen(struct Pokemon *, u8, u8, void (*)(u8), int); extern void sub_806E7D0(u8, const struct PartyPopupMenu *); extern u8 *sub_8040D08(); -extern void sub_806E834(); extern u8 sub_8094C20(); extern void sub_8040B8C(void); extern u8 pokemon_order_func(u8); diff --git a/src/menu.c b/src/menu.c index ba98ff057..3759d22c9 100644 --- a/src/menu.c +++ b/src/menu.c @@ -598,7 +598,7 @@ s8 ProcessMenuInputNoWrap_(void) return ProcessMenuInputNoWrap(); } -u8 MenuPrint_PixelCoords(u8 *text, u8 left, u16 top, u8 a4) +u8 MenuPrint_PixelCoords(const u8 *text, u8 left, u16 top, u8 a4) { return sub_8004D04(gMenuWindowPtr, text, gMenuTextTileOffset, left, top, a4); } diff --git a/src/party_menu.c b/src/party_menu.c index b38e89376..8eb181f46 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -1,4 +1,5 @@ #include "global.h" +#include "asm.h" #include "menu.h" #include "pokemon.h" #include "songs.h" @@ -9,18 +10,17 @@ #include "palette.h" #include "event_data.h" #include "main.h" +#include "item.h" +#include "battle_interface.h" +#include "species.h" #define DATA_COUNT (6) -struct Unk201C000 +struct Unk2001000 { - /*0x00*/ struct Pokemon *pokemon; - /*0x04*/ u8 unk4; - /*0x05*/ u8 unk5; - /*0x06*/ u16 unk6; - /*0x08*/ u8 pad_08[4]; - /*0x0C*/ s32 var0C; - /*0x10*/ TaskFunc unk10; + u8 unk0; + u8 unk1; + u8 unk2; }; struct Unk201B000 @@ -33,7 +33,26 @@ struct Unk201B000 u8 filler27C[2]; s16 unk27E; s16 unk280; - u16 unk282; + s16 unk282; +}; + +struct Unk201C000 +{ + /*0x00*/ struct Pokemon *pokemon; + /*0x04*/ u8 unk4; + /*0x05*/ u8 unk5; + /*0x06*/ u16 unk6; + /*0x08*/ u16 unk8; + /*0x0A*/ u8 pad_0A[2]; + /*0x0C*/ s32 unkC; + /*0x10*/ TaskFunc unk10; + /*0x14*/ TaskFunc unk14; +}; + +struct Unk201F000 +{ + u8 filler0[0xE00]; + u8 unkE00[3]; // not sure if this is an array or struct, or how big it is }; struct UnknownStruct5 @@ -44,44 +63,143 @@ struct UnknownStruct5 }; extern u8 ewram[]; +#define ewram01000 (*(struct Unk2001000 *)(ewram + 0x01000)) #define ewram1B000 (*(struct Unk201B000 *)(ewram + 0x1B000)) #define ewram1C000 (*(struct Unk201C000 *)(ewram + 0x1C000)) +#define ewram1F000 (*(struct Unk201F000 *)(ewram + 0x1F000)) extern u8 gUnknown_0202E8F4; extern u8 gUnknown_0202E8F6; +extern u16 gUnknown_0202E8F8; extern u8 gUnknown_0202E8FA; extern u8 gLastFieldPokeMenuOpened; +extern u8 gPlayerPartyCount; +extern u16 gScriptItemId; +extern s32 gBattleMoveDamage; //extern const u16 gUnknown_083769A8[][6]; //extern const u8 gUnknown_083769A8[][12]; +extern void *const gUnknown_08376858[][6]; extern const u8 gUnknown_083769A8[]; -extern u8 gUnknown_08376D1C[DATA_COUNT]; -extern u8 *gUnknown_08376D04[DATA_COUNT]; +extern const u8 gUnknown_08376D1C[DATA_COUNT]; +extern const u16 gUnknown_08376504[]; extern void (*const gUnknown_08376B54[])(u8); +extern const u8 *const gUnknown_08376D04[DATA_COUNT]; extern const struct UnknownStruct5 gUnknown_08376BB4[][6]; -extern u8 gOtherText_TallPlusAndRightArrow[]; -extern u8 gOtherText_WontHaveAnyEffect[]; +extern const u8 gOtherText_TallPlusAndRightArrow[]; +extern const u8 gOtherText_WontHaveAnyEffect[]; +extern const u8 gOtherText_ElevatedTo[]; +extern const u8 gOtherText_MailMustBeRemoved[]; +extern const u8 gOtherText_AlreadyHolding[]; +extern const u8 gOtherText_TakenAndReplaced[]; +extern const u8 gOtherText_BagFullCannotRemoveItem[]; +extern const u8 gOtherText_WasGivenToHold[]; +extern const u8 gOtherText_PokeHoldingItemCantMail[]; +extern const u8 gOtherText_MailTransferredMailbox[]; +extern const u8 gOtherText_NotHoldingAnything[]; +extern const u8 gOtherText_ReceivedTheThingFrom[]; +extern const u8 gOtherText_SendRemovedMailPrompt[]; +extern const u8 gOtherText_MailTaken[]; +extern const u8 gOtherText_MailWasSent[]; +extern const u8 gOtherText_MailboxIsFull[]; +extern const u8 gOtherText_MailRemovedMessageLost[]; +extern const u8 gOtherText_WantsToLearn[]; +extern const u8 gOtherText_NotCompatible[]; +extern const u8 gOtherText_AlreadyKnows[]; +extern const u8 gOtherText_LearnedMove[]; +extern const u8 gOtherText_WhichMoveToForget2[]; +extern const u8 gOtherText_ForgetMove123_2[]; +extern const u8 gOtherText_StopTryingTo[]; +extern const u8 gOtherText_DidNotLearnMove2[]; +extern const u8 gOtherText_RegainedHealth[]; +extern const u8 gOtherText_HPRestoredBy[]; +extern const u8 gOtherText_CuredPoisoning[]; +extern const u8 gOtherText_WokeUp[]; +extern const u8 gOtherText_BurnHealed[]; +extern const u8 gOtherText_ThawedOut[]; +extern const u8 gOtherText_CuredParalysis[]; +extern const u8 gOtherText_SnapConfusion[]; +extern const u8 gOtherText_GotOverLove[]; +extern const u8 gOtherText_BecameHealthy[]; +extern const u8 gOtherText_Hp2[]; +extern const u8 gOtherText_Attack[]; +extern const u8 gOtherText_Defense[]; +extern const u8 gOtherText_Speed[]; +extern const u8 gOtherText_SpAtk2[]; +extern const u8 gOtherText_SpDef2[]; +extern const u8 gOtherText_WasRaised[]; +extern const u8 gOtherText_PPIncreased[]; +extern const u8 gOtherText_PPRestored[]; extern const u8 gMoveNames[][13]; -extern u8 *const gItemEffectTable[]; +extern const u8 *const gItemEffectTable[]; extern bool8 IsDoubleBattle(void); -extern void AddBagItem(); -extern void RemoveBagItem(); extern void SetUpBattlePokemonMenu(u8); extern void sub_808B0C0(u8); +extern u8 GiveMailToMon(struct Pokemon *, u16); +extern bool8 ItemIsMail(u16); +extern void ClearMailStruct(struct MailStruct *); +extern u8 GiveMailToMon2(struct Pokemon *, struct MailStruct *); +extern void TakeMailFromMon(struct Pokemon *); +extern u8 TakeMailFromMon2(struct Pokemon *); +extern u32 CanMonLearnTMHM(struct Pokemon *, u8); +extern void sub_809D9F0(struct Pokemon *, u8, u8, void *, u32); +extern void sub_808B564(); +extern u8 sub_809FA30(void); +extern void sub_808B508(u8); +extern void sub_8032638(); +extern u8 sub_8094C20(); +extern bool8 ExecuteTableBasedItemEffect_(); +extern u8 GetMonStatusAndPokerus(); +u8 sub_806CA38(u8); void task_pc_turn_off(); static void sub_806E884(u8 taskId); void sub_806F8AC(u8 taskId); void sub_806FB0C(u8 taskId); void PartyMenuUpdateLevelOrStatus(struct Pokemon *, u8); -u8 ExecuteTableBasedItemEffect__(u8, u16, u8); +bool8 ExecuteTableBasedItemEffect__(u8, u16, u8); void sub_80701DC(u8 taskId); void DoRecoverPP(u8); +void Task_RareCandy1(u8); +void Task_RareCandy2(u8); +void Task_RareCandy3(u8); void sub_806D538(); void sub_806D5A4(void); -void sub_806E8D0(); -void GetMedicineItemEffectMessage(); +void sub_806E8D0(u8 taskId, u16 b, TaskFunc c); +void GetMedicineItemEffectMessage(u16); +void sub_8070A20(); +void sub_8070848(u8 taskId); +void sub_8070968(); +void party_menu_link_mon_held_item_object(u8); +void Task_ConfirmGiveHeldItem(u8); +void DisplayGiveHeldItemMessage(u8, u16, u8); +void SetHeldItemIconVisibility(); +void DisplayTakeHeldItemMessage(u8, u16, u8); +void Task_ConfirmTakeHeldMail(u8); +void Task_TeamMonTMMove(u8); +void Task_TeamMonTMMove2(u8); +void Task_TeamMonTMMove3(u8); +void Task_TeamMonTMMove4(u8); +void sub_806F358(u8); +void sub_806F390(u8); +void sub_806F44C(u8); +void TMMoveUpdateMoveSlot(u8); +void StopTryingToTeachMove_806F614(u8); +void StopTryingToTeachMove_806F67C(u8); +void StopTryingToTeachMove_806F6B4(u8); +void sub_806FB44(u8); +void sub_8070C54(); +void SetMonIconAnim(); +u8 GetMonIconSpriteId_maybe(); +void PartyMenuDoPrintHP(u8, int, u16, u16); +void PartyMenuClearLevelStatusTilemap(); +void PartyMenuPrintMonLevelOrStatus(); +u8 GetItemEffectType(); +bool8 IsBlueYellowRedFlute(u16); +void TryPrintPartyMenuMonNickname(); +void sub_8070088(u8); + /* void sub_806AEDC(void) @@ -99,7 +217,7 @@ void sub_806AEDC(void) } */ -u8 sub_806E834(u8 *message, u8 arg1) +u8 sub_806E834(const u8 *message, u8 arg1) { u8 taskId; @@ -116,22 +234,953 @@ u8 sub_806E834(u8 *message, u8 arg1) static void sub_806E884(u8 taskId) { - if (MenuUpdateWindowText() == 0) + if (MenuUpdateWindowText()) { - return; + gUnknown_0202E8F6 = 0; + if (gTasks[taskId].data[0] == 0) + MenuZeroFillWindowRect(3, 14, 26, 19); + DestroyTask(taskId); } +} + +void sub_806E8D0(u8 taskId, u16 b, TaskFunc c) +{ + ewram1C000.unk10 = c; + ewram1C000.unk4 = taskId; + ewram1C000.unk5 = sub_806CA38(taskId); + ewram1C000.unk6 = b; + ewram1C000.pokemon = &gPlayerParty[ewram1C000.unk5]; +} - gUnknown_0202E8F6 = 0; +bool8 PartyMenuUpdateMonHeldItem(struct Pokemon *pkmn, u16 item) +{ + u8 itemData[2]; - if (gTasks[taskId].data[0] == 0) + if (ItemIsMail(item) == TRUE) { - MenuZeroFillWindowRect(3, 14, 26, 19); + if (GiveMailToMon(pkmn, item) == 0xFF) + return TRUE; + gUnknown_0202E8F4 = 2; + } + else + { + gUnknown_0202E8F4 = 1; } - DestroyTask(taskId); + itemData[0] = item; + itemData[1] = item >> 8; + SetMonData(pkmn, MON_DATA_HELD_ITEM, itemData); + return FALSE; +} + +void PartyMenuTryGiveMonHeldItem(u8 taskId, u16 newItem, TaskFunc c) +{ + u16 currentItem; + + gTasks[taskId].func = TaskDummy; + sub_806E8D0(taskId, newItem, c); + currentItem = GetMonData(ewram1C000.pokemon, MON_DATA_HELD_ITEM); + gUnknown_0202E8F4 = 0; + gUnknown_0202E8F8 = 0; + if (currentItem != 0) + { + if (ItemIsMail(currentItem) == TRUE) + { + sub_806E834(gOtherText_MailMustBeRemoved, 1); + CreateTask(party_menu_link_mon_held_item_object, 5); + } + else + { + GetMonNickname(ewram1C000.pokemon, gStringVar1); + CopyItemName(currentItem, gStringVar2); + StringExpandPlaceholders(gStringVar4, gOtherText_AlreadyHolding); + sub_806E834(gStringVar4, 1); + CreateTask(Task_ConfirmGiveHeldItem, 5); + if (ItemIsMail(newItem) == TRUE) + gUnknown_0202E8F8 = currentItem; + } + } + else + { + PartyMenuUpdateMonHeldItem(ewram1C000.pokemon, newItem); + RemoveBagItem(newItem, 1); + if (ItemIsMail(newItem)) + { + gTasks[taskId].func = c; + } + else + { + DisplayGiveHeldItemMessage(ewram1C000.unk5, newItem, 1); + CreateTask(party_menu_link_mon_held_item_object, 5); + } + } +} + +void party_menu_link_mon_held_item_object(u8 taskId) +{ + if (gUnknown_0202E8F6 == 0) + { + SetHeldItemIconVisibility(ewram1C000.unk4, ewram1C000.unk5); + gTasks[ewram1C000.unk4].func = ewram1C000.unk10; + DestroyTask(taskId); + } +} + +void PartyMenuTryGiveMonHeldItem_806EACC(u8 taskId) +{ + s8 selection = ProcessMenuInputNoWrap_(); + + if (selection == 0) + { + u16 currentItem; + + MenuZeroFillWindowRect(23, 8, 29, 13); + currentItem = GetMonData(ewram1C000.pokemon, MON_DATA_HELD_ITEM); + RemoveBagItem(ewram1C000.unk6, 1); + if (AddBagItem(currentItem, 1) == TRUE) + { + PartyMenuUpdateMonHeldItem(ewram1C000.pokemon, ewram1C000.unk6); + if (ItemIsMail(ewram1C000.unk6)) + { + DisplayTakeHeldItemMessage(ewram1C000.unk5, currentItem, 1); + } + else + { + CopyItemName(ewram1C000.unk6, gStringVar1); + StringExpandPlaceholders(gStringVar4, gOtherText_TakenAndReplaced); + sub_806E834(gStringVar4, 1); + } + } + else + { + sub_806E834(gOtherText_BagFullCannotRemoveItem, 0); + AddBagItem(ewram1C000.unk6, 1); + } + } + else + { + if (selection != 1 && selection != -1) + return; + if (selection == -1) + PlaySE(SE_SELECT); + MenuZeroFillWindowRect(23, 8, 29, 13); + } + gTasks[taskId].func = party_menu_link_mon_held_item_object; +} + +void Task_ConfirmGiveHeldItem(u8 taskId) +{ + if (gUnknown_0202E8F6 == 0) + { + DisplayYesNoMenu(23, 8, 1); + gTasks[taskId].func = PartyMenuTryGiveMonHeldItem_806EACC; + } +} + +void DisplayGiveHeldItemMessage(u8 a, u16 b, u8 c) +{ + GetMonNickname(&gPlayerParty[a], gStringVar1); + CopyItemName(b, gStringVar2); + StringExpandPlaceholders(gStringVar4, gOtherText_WasGivenToHold); + sub_806E834(gStringVar4, c); +} + + +// Not sure about this one for now. +/* +void PartyMenuTryGiveMonMail(u8 taskId, TaskFunc func) +{ + u16 currentItem; + struct MailStruct *r4; + + gTasks[taskId].func = TaskDummy; + sub_806E8D0(taskId, 0, func); + currentItem = GetMonData(ewram1C000.pokemon, MON_DATA_HELD_ITEM); + gUnknown_0202E8F4 = 0; + r4 = &gSaveBlock1.mail[ewram1F000.unkE00[0] + ewram1F000.unkE00[2]]; + if (currentItem != 0) + { + sub_806E834(gOtherText_PokeHoldingItemCantMail, 1); + CreateTask(party_menu_link_mon_held_item_object, 5); + } + else + { + GiveMailToMon2(ewram1C000.pokemon, r4); + ClearMailStruct(r4); + sub_806E834(gOtherText_MailTransferredMailbox, 1); + CreateTask(party_menu_link_mon_held_item_object, 5); + } +} +*/ +__attribute__((naked)) +void PartyMenuTryGiveMonMail(u8 taskId, TaskFunc func) +{ + asm(".syntax unified\n\ + push {r4,r5,lr}\n\ + adds r2, r1, 0\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + ldr r3, _0806ECA0 @ =gTasks\n\ + lsls r1, r0, 2\n\ + adds r1, r0\n\ + lsls r1, 3\n\ + adds r1, r3\n\ + ldr r3, _0806ECA4 @ =TaskDummy\n\ + str r3, [r1]\n\ + movs r1, 0\n\ + bl sub_806E8D0\n\ + ldr r5, _0806ECA8 @ =0x0201c000\n\ + ldr r0, [r5]\n\ + movs r1, 0xC\n\ + bl GetMonData\n\ + lsls r0, 16\n\ + ldr r2, _0806ECAC @ =gUnknown_0202E8F4\n\ + movs r1, 0\n\ + strb r1, [r2]\n\ + movs r1, 0xF8\n\ + lsls r1, 6\n\ + adds r2, r5, r1\n\ + ldrb r1, [r2]\n\ + adds r1, 0x6\n\ + ldrb r2, [r2, 0x2]\n\ + adds r1, r2\n\ + lsls r2, r1, 3\n\ + adds r2, r1\n\ + lsls r2, 2\n\ + ldr r1, _0806ECB0 @ =gSaveBlock1 + 0x2B4C\n\ + adds r4, r2, r1\n\ + cmp r0, 0\n\ + beq _0806ECBC\n\ + ldr r0, _0806ECB4 @ =gOtherText_PokeHoldingItemCantMail\n\ + movs r1, 0x1\n\ + bl sub_806E834\n\ + ldr r0, _0806ECB8 @ =party_menu_link_mon_held_item_object\n\ + movs r1, 0x5\n\ + bl CreateTask\n\ + b _0806ECDA\n\ + .align 2, 0\n\ +_0806ECA0: .4byte gTasks\n\ +_0806ECA4: .4byte TaskDummy\n\ +_0806ECA8: .4byte 0x0201c000\n\ +_0806ECAC: .4byte gUnknown_0202E8F4\n\ +_0806ECB0: .4byte gSaveBlock1 + 0x2B4C\n\ +_0806ECB4: .4byte gOtherText_PokeHoldingItemCantMail\n\ +_0806ECB8: .4byte party_menu_link_mon_held_item_object\n\ +_0806ECBC:\n\ + ldr r0, [r5]\n\ + adds r1, r4, 0\n\ + bl GiveMailToMon2\n\ + adds r0, r4, 0\n\ + bl ClearMailStruct\n\ + ldr r0, _0806ECE0 @ =gOtherText_MailTransferredMailbox\n\ + movs r1, 0x1\n\ + bl sub_806E834\n\ + ldr r0, _0806ECE4 @ =party_menu_link_mon_held_item_object\n\ + movs r1, 0x5\n\ + bl CreateTask\n\ +_0806ECDA:\n\ + pop {r4,r5}\n\ + pop {r0}\n\ + bx r0\n\ + .align 2, 0\n\ +_0806ECE0: .4byte gOtherText_MailTransferredMailbox\n\ +_0806ECE4: .4byte party_menu_link_mon_held_item_object\n\ + .syntax divided\n"); +} + +void PartyMenuTryGiveMonHeldItem_806ECE8(u8 taskId, TaskFunc func) +{ + u16 currentItem; + + gTasks[taskId].func = TaskDummy; + sub_806E8D0(taskId, 0, func); + currentItem = GetMonData(ewram1C000.pokemon, MON_DATA_HELD_ITEM); + if (currentItem == 0) + { + StringExpandPlaceholders(gStringVar4, gOtherText_NotHoldingAnything); + sub_806E834(gStringVar4, 0); + CreateTask(party_menu_link_mon_held_item_object, 5); + } + else + { + u8 itemData[2]; + + itemData[0] = 0; + itemData[1] = 0; + if (AddBagItem(currentItem, 1) == TRUE) + { + if (ItemIsMail(currentItem) == TRUE) + TakeMailFromMon(ewram1C000.pokemon); + DisplayTakeHeldItemMessage(ewram1C000.unk5, currentItem, 0); + SetMonData(ewram1C000.pokemon, MON_DATA_HELD_ITEM, itemData); + } + else + { + sub_806E834(gOtherText_BagFullCannotRemoveItem, 0); + } + CreateTask(party_menu_link_mon_held_item_object, 5); + } +} + +void DisplayTakeHeldItemMessage(u8 a, u16 b, u8 c) +{ + GetMonNickname(&gPlayerParty[a], gStringVar1); + CopyItemName(b, gStringVar2); + StringExpandPlaceholders(gStringVar4, gOtherText_ReceivedTheThingFrom); + sub_806E834(gStringVar4, c); +} + +void DoTakeMail(u8 taskId, TaskFunc func) +{ + gTasks[taskId].func = TaskDummy; + sub_806E8D0(taskId, 0, func); + ewram1C000.unk6 = GetMonData(ewram1C000.pokemon, MON_DATA_HELD_ITEM); + sub_806E834(gOtherText_SendRemovedMailPrompt, 1); + CreateTask(Task_ConfirmTakeHeldMail, 5); +} + +void Task_LoseMailMessage(u8 taskId) +{ + s8 selection = ProcessMenuInputNoWrap_(); + + if (selection == 0) + { + if (AddBagItem(ewram1C000.unk6, 1) == TRUE) + { + TakeMailFromMon(ewram1C000.pokemon); + sub_806E834(gOtherText_MailTaken, 0); + } + else + { + sub_806E834(gOtherText_BagFullCannotRemoveItem, 0); + } + MenuZeroFillWindowRect(23, 8, 29, 13); + gTasks[taskId].func = party_menu_link_mon_held_item_object; + } + else + { + if (selection != 1 && selection != -1) + return; + if (selection == -1) + PlaySE(SE_SELECT); + MenuZeroFillWindowRect(23, 8, 29, 13); + MenuZeroFillWindowRect(0, 14, 29, 19); + gTasks[taskId].func = party_menu_link_mon_held_item_object; + } +} + +void Task_ConfirmLoseMailMessage(u8 taskId) +{ + if (gUnknown_0202E8F6 == 0) + { + DisplayYesNoMenu(23, 8, 1); + gTasks[taskId].func = Task_LoseMailMessage; + } +} + +void Task_TakeHeldMail(u8 taskId) +{ + s8 selection = ProcessMenuInputNoWrap_(); + + if (selection == 0) + { + MenuZeroFillWindowRect(23, 8, 29, 13); + if (TakeMailFromMon2(ewram1C000.pokemon) != 0xFF) + sub_806E834(gOtherText_MailWasSent, 0); + else + sub_806E834(gOtherText_MailboxIsFull, 0); + gTasks[taskId].func = party_menu_link_mon_held_item_object; + } + else + { + if (selection != 1 && selection != -1) + return; + if (selection == -1) + PlaySE(SE_SELECT); + MenuZeroFillWindowRect(23, 8, 29, 13); + sub_806E834(gOtherText_MailRemovedMessageLost, 1); + gTasks[taskId].func = Task_ConfirmLoseMailMessage; + } +} + +void Task_ConfirmTakeHeldMail(u8 taskId) +{ + if (gUnknown_0202E8F6 == 0) + { + DisplayYesNoMenu(23, 8, 1); + gTasks[taskId].func = Task_TakeHeldMail; + } +} + +u16 ItemIdToBattleMoveId(u16 item) +{ + u16 moveId = item - 289; + + return gUnknown_08376504[moveId]; +} + +bool8 pokemon_has_move(struct Pokemon *pkmn, u16 move) +{ + u8 i; + + for (i = 0; i < 4; i++) + { + if (GetMonData(pkmn, MON_DATA_MOVE1 + i) == move) + return TRUE; + } + return FALSE; +} + +void TeachMonTMMove(u8 taskId, u16 move, TaskFunc func) +{ + PlaySE(SE_SELECT); + gTasks[taskId].func = TaskDummy; + sub_806E8D0(taskId, move, func); + CreateTask(Task_TeamMonTMMove, 5); +} + +void Task_TeamMonTMMove(u8 taskId) +{ + GetMonNickname(ewram1C000.pokemon, gStringVar1); + ewram1C000.unk8 = ItemIdToBattleMoveId(ewram1C000.unk6); + StringCopy(gStringVar2, gMoveNames[ewram1C000.unk8]); + ewram1B000.unk282 = 0; + if (pokemon_has_move(ewram1C000.pokemon, ewram1C000.unk8)) + { + StringExpandPlaceholders(gStringVar4, gOtherText_AlreadyKnows); + sub_806E834(gStringVar4, 1); + gTasks[taskId].func = party_menu_link_mon_held_item_object; + } + else + { + if (!CanMonLearnTMHM(ewram1C000.pokemon, ewram1C000.unk6 - 33)) + { + StringExpandPlaceholders(gStringVar4, gOtherText_NotCompatible); + sub_806E834(gStringVar4, 1); + gTasks[taskId].func = party_menu_link_mon_held_item_object; + } + else + { + if (GiveMoveToMon(ewram1C000.pokemon, ewram1C000.unk8) != 0xFFFF) + { + Task_TeamMonTMMove2(taskId); + } + else + { + StringExpandPlaceholders(gStringVar4, gOtherText_WantsToLearn); + sub_806E834(gStringVar4, 1); + gTasks[taskId].func = sub_806F358; + } + } + } +} + +void Task_TeamMonTMMove2(u8 taskId) +{ + StringCopy(gStringVar2, gMoveNames[ewram1C000.unk8]); + StringExpandPlaceholders(gStringVar4, gOtherText_LearnedMove); + sub_806E834(gStringVar4, 1); + AdjustFriendship(ewram1C000.pokemon, 4); + if (ewram1B000.unk282 == 0 && ewram1C000.unk6 <= 0x152) + RemoveBagItem(ewram1C000.unk6, 1); + gTasks[taskId].func = Task_TeamMonTMMove3; +} + +void Task_TeamMonTMMove3(u8 taskId) +{ + if (gUnknown_0202E8F6 == 0) + { + PlayFanfare(BGM_FANFA1); + gTasks[taskId].func = Task_TeamMonTMMove4; + } +} + +void Task_TeamMonTMMove4(u8 taskId) +{ + if (IsFanfareTaskInactive()) + { + if ((gMain.newKeys & A_BUTTON) || (gMain.newKeys & B_BUTTON)) + { + SetHeldItemIconVisibility(ewram1C000.unk4, ewram1C000.unk5); + if (ewram1B000.unk282 == 1) + { + sub_8070C54(taskId); + } + else + { + gTasks[ewram1C000.unk4].func = ewram1C000.unk10; + DestroyTask(taskId); + } + } + } +} + +void sub_806F2FC(u8 taskId) +{ + if (gUnknown_0202E8F6 == 0) + { + SetHeldItemIconVisibility(ewram1C000.unk4, ewram1C000.unk5); + if (ewram1B000.unk282 == 1) + { + sub_8070C54(taskId); + } + else + { + gTasks[ewram1C000.unk4].func = ewram1C000.unk10; + DestroyTask(taskId); + } + } } -asm(".section .text_b"); +void sub_806F358(u8 taskId) +{ + if (gUnknown_0202E8F6 == 0) + { + DisplayYesNoMenu(23, 8, 1); + gTasks[taskId].func = sub_806F390; + } +} + +void sub_806F390(u8 taskId) +{ + s8 selection = ProcessMenuInputNoWrap_(); + + if (selection == 0) + { + MenuZeroFillWindowRect(23, 8, 29, 13); + sub_806E834(gOtherText_WhichMoveToForget2, 1); + gTasks[taskId].func = sub_806F44C; + } + else + { + if (selection != 1 && selection != -1) + return; + if (selection == -1) + PlaySE(SE_SELECT); + StopTryingToTeachMove_806F614(taskId); + } +} + +void sub_806F3FC(u8 taskId) +{ + if (!gPaletteFade.active) + { + sub_809D9F0(gPlayerParty, ewram1C000.unk5, gPlayerPartyCount - 1, sub_808B564, ewram1C000.unk8); + DestroyTask(taskId); + } +} + +void sub_806F44C(u8 taskId) +{ + if (gUnknown_0202E8F6 == 0) + { + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0); + gTasks[taskId].func = sub_806F3FC; + } +} + +void TaughtMove(u8 taskId) +{ + if (!gPaletteFade.active) + { + u8 moveIndex; + u16 r4; + + gTasks[taskId].func = TaskDummy; + sub_806E8D0(taskId, gScriptItemId, sub_808B508); + moveIndex = sub_809FA30(); + r4 = GetMonData(ewram1C000.pokemon, MON_DATA_MOVE1 + moveIndex); + GetMonNickname(ewram1C000.pokemon, gStringVar1); + StringCopy(gStringVar2, gMoveNames[r4]); + StringExpandPlaceholders(gStringVar4, gOtherText_ForgetMove123_2); + sub_806E834(gStringVar4, 1); + CreateTask(TMMoveUpdateMoveSlot, 5); + } +} + +void TMMoveUpdateMoveSlot(u8 taskId) +{ + if (gUnknown_0202E8F6 == 0) + { + RemoveMonPPBonus(ewram1C000.pokemon, sub_809FA30()); + SetMonMoveSlot(ewram1C000.pokemon, ewram1C000.unk8, sub_809FA30()); + Task_TeamMonTMMove2(taskId); + } +} + +void StopTryingToTeachMove_806F588(u8 taskId) +{ + if (!gPaletteFade.active) + { + gTasks[taskId].func = TaskDummy; + sub_806E8D0(taskId, gScriptItemId, sub_808B508); + StringCopy(gStringVar2, gMoveNames[ewram1C000.unk8]); + StringExpandPlaceholders(gStringVar4, gOtherText_StopTryingTo); + sub_806E834(gStringVar4, 1); + CreateTask(StopTryingToTeachMove_806F67C, 5); + } +} + +void StopTryingToTeachMove_806F614(u8 taskId) +{ + MenuZeroFillWindowRect(23, 8, 29, 13); + StringCopy(gStringVar2, gMoveNames[ewram1C000.unk8]); + StringExpandPlaceholders(gStringVar4, gOtherText_StopTryingTo); + sub_806E834(gStringVar4, 1); + gTasks[taskId].func = StopTryingToTeachMove_806F67C; +} + +void StopTryingToTeachMove_806F67C(u8 taskId) +{ + if (gUnknown_0202E8F6 == 0) + { + DisplayYesNoMenu(23, 8, 1); + gTasks[taskId].func = StopTryingToTeachMove_806F6B4; + } +} + +void StopTryingToTeachMove_806F6B4(u8 taskId) +{ + s8 selection = ProcessMenuInputNoWrap_(); + + if (selection == 0) + { + MenuZeroFillWindowRect(23, 8, 29, 13); + GetMonNickname(ewram1C000.pokemon, gStringVar1); + StringCopy(gStringVar2, gMoveNames[ewram1C000.unk8]); + StringExpandPlaceholders(gStringVar4, gOtherText_DidNotLearnMove2); + sub_806E834(gStringVar4, 1); + gTasks[taskId].func = sub_806F2FC; + } + else + { + if (selection != 1 && selection != -1) + return; + if (selection == -1) + PlaySE(SE_SELECT); + MenuZeroFillWindowRect(23, 8, 29, 13); + GetMonNickname(ewram1C000.pokemon, gStringVar1); + StringCopy(gStringVar2, gMoveNames[ewram1C000.unk8]); + StringExpandPlaceholders(gStringVar4, gOtherText_WantsToLearn); + sub_806E834(gStringVar4, 1); + gTasks[taskId].func = sub_806F358; + } +} + +bool8 IsHMMove(u16 move) +{ + u8 i; + + for (i = 0; i < 8; i++) + { + if (gUnknown_08376504[50 + i] == move) + return TRUE; + } + return FALSE; +} + +s16 sub_806F7E8(u8 taskId, struct BattleInterfaceStruct1 *b, s8 c) +{ + s16 *taskData; + u8 hpBarLevel; + void *vramPtr; + + taskData = gTasks[taskId].data; + + b->unk0 = taskData[10]; + b->unk4 = taskData[11]; + b->unk8 = taskData[12] * c; + b->unk10 = 0x100; + hpBarLevel = GetHPBarLevel(ewram1B000.unk282, b->unk0); + if (hpBarLevel > 2) + b->unkC_0 = 4; + if (hpBarLevel == 2) + b->unkC_0 = 5; + if (hpBarLevel < 2) + b->unkC_0 = 6; + vramPtr = gUnknown_08376858[IsDoubleBattle()][ewram1C000.unk5]; + return sub_80460C8(b, &ewram1C000.unkC, vramPtr, 0); +} + +void sub_806F8AC(u8 taskId) +{ + struct BattleInterfaceStruct1 sp0; + u16 sp14; + + ewram1B000.unk282 = sub_806F7E8(taskId, &sp0, -1); + if (ewram1B000.unk282 == -1) + { + ewram1C000.unkC = 0; + if (-sp0.unk8 + sp0.unk4 > sp0.unk0) + sp14 = sp0.unk0 - sp0.unk4; + else + sp14 = -sp0.unk8; + gBattleMoveDamage = -sp14; + GetMonNickname(ewram1C000.pokemon, gStringVar1); + ConvertIntToDecimalStringN(gStringVar2, sp14, 0, 3); + if (gTasks[taskId].data[14] == 0) + StringExpandPlaceholders(gStringVar4, gOtherText_HPRestoredBy); + else + StringExpandPlaceholders(gStringVar4, gOtherText_RegainedHealth); + SetMonIconAnim(GetMonIconSpriteId_maybe(ewram1C000.unk4, ewram1C000.unk5), ewram1C000.pokemon); + task_pc_turn_off(&gUnknown_083769A8[IsDoubleBattle() * 12 + ewram1C000.unk5 * 2], 7); + ewram1B000.unk261 = 2; + sub_806E834(gStringVar4, 1); + sp14 += sp0.unk4; + SetMonData(ewram1C000.pokemon, MON_DATA_HP, (u8 *)&sp14); + RemoveBagItem(ewram1C000.unk6, 1); + sub_8032638(); + gTasks[taskId].func = sub_806FB44; + } + else + { + PartyMenuDoPrintHP(ewram1C000.unk5, IsDoubleBattle(), ewram1B000.unk282, sp0.unk0); + } +} + +void sub_806FA18(u8 taskId) +{ + struct BattleInterfaceStruct1 sp0; + + ewram1B000.unk282 = sub_806F7E8(taskId, &sp0, 1); + if (ewram1B000.unk282 == -1) + { + PlaySE(SE_KAIFUKU); + ewram1C000.unkC = 0; + gTasks[taskId].data[11] -= gTasks[taskId].data[12]; + SetMonData(ewram1C000.pokemon, MON_DATA_HP, (u8 *)&gTasks[taskId].data[11]); + SetMonIconAnim(GetMonIconSpriteId_maybe(ewram1C000.unk4, ewram01000.unk1), ewram1C000.pokemon); + ewram1C000.unk5 = gSprites[ewram01000.unk2].data0; + ewram1C000.pokemon = &gPlayerParty[ewram1C000.unk5]; + gTasks[taskId].data[10] = GetMonData(ewram1C000.pokemon, MON_DATA_MAX_HP); + gTasks[taskId].data[11] = GetMonData(ewram1C000.pokemon, MON_DATA_HP); + ewram1C000.unkC = -32768; + ewram1C000.unk14 = ewram1C000.unk10; + gTasks[taskId].func = sub_806F8AC; + ewram1B000.unk282 = gTasks[taskId].data[11]; + } + else + { + PartyMenuDoPrintHP(ewram1C000.unk5, IsDoubleBattle(), ewram1B000.unk282, sp0.unk0); + } +} + +void sub_806FB0C(u8 taskId) +{ + if (gUnknown_0202E8F6 == 0) + { + gTasks[ewram1C000.unk4].func = ewram1C000.unk10; + DestroyTask(taskId); + } +} + +void sub_806FB44(u8 taskId) +{ + if (gUnknown_0202E8F6 == 0) + { + gTasks[ewram1C000.unk4].func = ewram1C000.unk14; + DestroyTask(taskId); + } +} + +bool8 IsHPRecoveryItem(u16 item) +{ + const u8 *itemEffect; + + if (item == 0xAF) + itemEffect = gSaveBlock1.enigmaBerry.itemEffect; + else + itemEffect = gItemEffectTable[item - 13]; + + if (itemEffect[4] & 4) + return TRUE; + else + return FALSE; +} + +void PartyMenuUpdateLevelOrStatus(struct Pokemon *pkmn, u8 b) +{ + PartyMenuClearLevelStatusTilemap(b); + PartyMenuPrintMonLevelOrStatus(b, pkmn); +} + +void GetMedicineItemEffectMessage(u16 item) +{ + switch (GetItemEffectType(item)) + { + case 3: + StringExpandPlaceholders(gStringVar4, gOtherText_CuredPoisoning); + break; + case 4: + StringExpandPlaceholders(gStringVar4, gOtherText_WokeUp); + break; + case 5: + StringExpandPlaceholders(gStringVar4, gOtherText_BurnHealed); + break; + case 6: + StringExpandPlaceholders(gStringVar4, gOtherText_ThawedOut); + break; + case 7: + StringExpandPlaceholders(gStringVar4, gOtherText_CuredParalysis); + break; + case 8: + StringExpandPlaceholders(gStringVar4, gOtherText_SnapConfusion); + break; + case 9: + StringExpandPlaceholders(gStringVar4, gOtherText_GotOverLove); + break; + case 11: + StringExpandPlaceholders(gStringVar4, gOtherText_BecameHealthy); + break; + case 13: + StringCopy(gStringVar2, gOtherText_Hp2); + StringExpandPlaceholders(gStringVar4, gOtherText_WasRaised); + break; + case 12: + StringCopy(gStringVar2, gOtherText_Attack); + StringExpandPlaceholders(gStringVar4, gOtherText_WasRaised); + break; + case 17: + StringCopy(gStringVar2, gOtherText_Defense); + StringExpandPlaceholders(gStringVar4, gOtherText_WasRaised); + break; + case 16: + StringCopy(gStringVar2, gOtherText_Speed); + StringExpandPlaceholders(gStringVar4, gOtherText_WasRaised); + break; + case 14: + StringCopy(gStringVar2, gOtherText_SpAtk2); + StringExpandPlaceholders(gStringVar4, gOtherText_WasRaised); + break; + case 15: + StringCopy(gStringVar2, gOtherText_SpDef2); + StringExpandPlaceholders(gStringVar4, gOtherText_WasRaised); + break; + case 19: + case 20: + StringExpandPlaceholders(gStringVar4, gOtherText_PPIncreased); + break; + case 21: + StringExpandPlaceholders(gStringVar4, gOtherText_PPRestored); + break; + default: + StringExpandPlaceholders(gStringVar4, gOtherText_WontHaveAnyEffect); + break; + } +} + +bool8 IsMedicineIneffective(struct Pokemon *pkmn, u16 item) +{ + if (GetItemEffectType(item) == 13 + && GetMonData(pkmn, MON_DATA_SPECIES) == SPECIES_SHEDINJA) + return TRUE; + else + return FALSE; +} + +bool8 ExecuteTableBasedItemEffect__(u8 a, u16 b, u8 c) +{ + if (gMain.inBattle) + return ExecuteTableBasedItemEffect_(&gPlayerParty[a], b, sub_8094C20(a), c); + else + return ExecuteTableBasedItemEffect_(&gPlayerParty[a], b, a, c); +} + +void UseMedicine(u8 taskId, u16 item, TaskFunc func) +{ + u8 r7; + bool8 r9 = FALSE; + bool8 r0; + + gTasks[taskId].func = TaskDummy; + r7 = CreateTask(TaskDummy, 5); + sub_806E8D0(taskId, item, func); + if (!IsMedicineIneffective(ewram1C000.pokemon, item)) + { + r9 = IsHPRecoveryItem(item); + if (r9 == TRUE) + { + gTasks[r7].data[10] = GetMonData(ewram1C000.pokemon, MON_DATA_MAX_HP); + gTasks[r7].data[11] = GetMonData(ewram1C000.pokemon, MON_DATA_HP); + if (gTasks[r7].data[10] == gTasks[r7].data[11]) + { + r9 = FALSE; + gTasks[r7].data[10] = 0; + gTasks[r7].data[11] = 0; + } + } + r0 = ExecuteTableBasedItemEffect__(ewram1C000.unk5, item, 0); + } + else + { + r0 = TRUE; + } + + if (r0) + { + gUnknown_0202E8F4 = 0; + PlaySE(SE_SELECT); + sub_806E834(gOtherText_WontHaveAnyEffect, 1); + gTasks[r7].func = sub_806FB0C; + } + else + { + u8 statusAndPkrs; + + gUnknown_0202E8F4 = 1; + if (!IsBlueYellowRedFlute(item)) + PlaySE(SE_KAIFUKU); + else + PlaySE(SE_BIDORO); + statusAndPkrs = GetMonStatusAndPokerus(ewram1C000.pokemon); + if (statusAndPkrs == 6 || statusAndPkrs == 0) + PartyMenuUpdateLevelOrStatus(ewram1C000.pokemon, ewram1C000.unk5); + if (r9 == TRUE) + { + gTasks[r7].data[12] = GetMonData(ewram1C000.pokemon, MON_DATA_HP) - gTasks[r7].data[11]; + ewram1C000.unkC = -32768; + if (gTasks[r7].data[11] == 0) + gTasks[r7].data[14] = 1; + else + gTasks[r7].data[14] = 0; + ewram1C000.unk14 = ewram1C000.unk10; + gTasks[r7].func = sub_806F8AC; + ewram1B000.unk282 = gTasks[r7].data[11]; + } + else + { + GetMonNickname(ewram1C000.pokemon, gStringVar1); + if (!IsBlueYellowRedFlute(item)) + RemoveBagItem(item, 1); + GetMedicineItemEffectMessage(item); + TryPrintPartyMenuMonNickname(ewram1C000.unk5, ewram1C000.pokemon); + sub_806E834(gStringVar4, 1); + gTasks[r7].func = sub_806FB0C; + } + } +} + +bool8 IsBlueYellowRedFlute(u16 item) +{ + if (item == 0x27 + || item == 0x29 + || item == 0x28) + return TRUE; + else + return FALSE; +} + +void sub_8070048(u8 taskId, u16 item, TaskFunc func) +{ + ewram1C000.unk10 = func; + ewram1C000.unk4 = taskId; + ewram1C000.unk6 = item; + ewram1C000.unk5 = 0; + ewram1C000.unk14 = sub_80701DC; + ewram1B000.unk27E = 0; + ewram1B000.unk280 = 0; + sub_8070088(taskId); +} void sub_8070088(u8 taskId) { @@ -169,7 +1218,7 @@ void sub_8070088(u8 taskId) ewram1B000.unk27E = 1; ewram1B000.unk280 = 1; ewram1B000.unk282 = taskData[11]; - ewram1C000.var0C = -32768; + ewram1C000.unkC = -32768; gTasks[taskId2].func = sub_806F8AC; } } @@ -253,7 +1302,7 @@ void Task_HandleItemUseMoveMenuInput(u8 taskId) void DoPPRecoveryItemEffect(u8 taskId, u16 b, TaskFunc c) { - u8 *itemEffect; + const u8 *itemEffect; u8 taskId2; if (b == 0xAF) @@ -322,7 +1371,80 @@ void DoRecoverPP(u8 taskId) gTasks[taskId].func = sub_806FB0C; } -asm(".section .text_c"); +void DoPPUpItemEffect(u8 taskId, u16 b, TaskFunc c) +{ + gTasks[taskId].func = TaskDummy; + sub_806E8D0(taskId, b, c); + PlaySE(SE_SELECT); + sub_806D538(11, 3); + CreateItemUseMoveMenu(ewram1C000.unk5); + CreateTask(Task_HandleItemUseMoveMenuInput, 5); + gMain.newKeys = 0; +} + +void DoRareCandyItemEffect(u8 taskId, u16 b, TaskFunc c) +{ + u8 i; + bool8 r0; + + gTasks[taskId].func = TaskDummy; + sub_806E8D0(taskId, b, c); + + if (GetMonData(ewram1C000.pokemon, MON_DATA_LEVEL) != 100) + { + for (i = 0; i < 6; i++) + ewram1B000.unk264[i] = GetMonData(ewram1C000.pokemon, gUnknown_08376D1C[i]); + r0 = ExecuteTableBasedItemEffect__(ewram1C000.unk5, b, 0); + } + else + r0 = TRUE; + + if (r0) + { + gUnknown_0202E8F4 = 0; + PlaySE(SE_SELECT); + sub_806E834(gOtherText_WontHaveAnyEffect, 1); + CreateTask(sub_806FB0C, 5); + } + else + { + u8 level; + + gUnknown_0202E8F4 = 1; + PlayFanfareByFanfareNum(0); + sub_8070A20(ewram1C000.unk5, ewram1C000.pokemon); + RemoveBagItem(b, 1); + GetMonNickname(ewram1C000.pokemon, gStringVar1); + level = GetMonData(ewram1C000.pokemon, MON_DATA_LEVEL); + ConvertIntToDecimalStringN(gStringVar2, level, 0, 3); + StringExpandPlaceholders(gStringVar4, gOtherText_ElevatedTo); + sub_806E834(gStringVar4, 1); + CreateTask(Task_RareCandy1, 5); + } +} + +void Task_RareCandy1(u8 taskId) +{ + if (WaitFanfare(0) && gUnknown_0202E8F6 == 0) + { + if ((gMain.newKeys & A_BUTTON) || (gMain.newKeys & B_BUTTON)) + { + PlaySE(SE_SELECT); + sub_8070848(taskId); + gTasks[taskId].func = Task_RareCandy2; + } + } +} + +void Task_RareCandy2(u8 taskId) +{ + if ((gMain.newKeys & A_BUTTON) || (gMain.newKeys & B_BUTTON)) + { + PlaySE(SE_SELECT); + sub_8070968(taskId); + gTasks[taskId].func = Task_RareCandy3; + } +} void sub_8070848(u8 taskId) { -- cgit v1.2.3 From 3ba95b67bc2565dd61e3879deaa7543d7bf53b4e Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sat, 20 May 2017 17:49:54 +0200 Subject: Decrease indentation level of switches --- src/battle_2.c | 62 +- src/battle_interface.c | 34 +- src/braille_puzzles.c | 74 +- src/clear_save_data_menu.c | 138 ++-- src/field_camera.c | 96 +-- src/field_control_avatar.c | 68 +- src/field_poison.c | 48 +- src/field_special_scene.c | 122 +-- src/fldeff_cut.c | 86 +- src/intro.c | 100 +-- src/item_use.c | 178 ++--- src/matsuda_debug_menu.c | 70 +- src/mauville_old_man.c | 30 +- src/mystery_event_menu.c | 402 +++++----- src/option_menu.c | 296 +++---- src/player_pc.c | 38 +- src/pokedex.c | 1560 ++++++++++++++++++------------------- src/pokemon_2.c | 1036 ++++++++++++------------ src/pokemon_3.c | 112 +-- src/record_mixing.c | 46 +- src/save_failed_screen.c | 106 +-- src/script_menu.c | 26 +- src/script_pokemon_util_80C4BF0.c | 142 ++-- src/script_pokemon_util_80F99CC.c | 266 +++---- src/secret_base.c | 70 +- src/shop.c | 24 +- src/start_menu.c | 306 ++++---- src/starter_choose.c | 40 +- src/text.c | 78 +- src/tv.c | 1106 +++++++++++++------------- src/wallclock.c | 134 ++-- 31 files changed, 3447 insertions(+), 3447 deletions(-) (limited to 'src') diff --git a/src/battle_2.c b/src/battle_2.c index f2ce737d6..12fd4182d 100644 --- a/src/battle_2.c +++ b/src/battle_2.c @@ -2562,39 +2562,39 @@ void sub_8012324(void) r5 = battle_get_per_side_status(gUnknown_02024A60); switch (gUnknown_02024D1E[gUnknown_02024A60]) { - case 0: - ewram[0x016068 + gUnknown_02024A60] = 6; - if (!(gBattleTypeFlags & 0x40) - && (r5 & 2) - && !(ewram160A6 & gBitTable[battle_get_side_with_given_state(r5 ^ 2)]) - && gUnknown_02024D1E[battle_get_side_with_given_state(r5)] != 4) - break; - //_080123F8 - if (ewram160A6 & gBitTable[gUnknown_02024A60]) - { - gUnknown_02024C18[gUnknown_02024A60] = 13; - if (!(gBattleTypeFlags & 0x40)) - gUnknown_02024D1E[gUnknown_02024A60] = 4; - //_08012454 - else - gUnknown_02024D1E[gUnknown_02024A60] = 3; - break; - } - //_08012468 - if ((gBattleMons[gUnknown_02024A60].status2 & 0x1000) - || (gBattleMons[gUnknown_02024A60].status2 & 0x10000000)) - { - gUnknown_02024C18[gUnknown_02024A60] = 0; - gUnknown_02024D1E[gUnknown_02024A60] = 3; - } + case 0: + ewram[0x016068 + gUnknown_02024A60] = 6; + if (!(gBattleTypeFlags & 0x40) + && (r5 & 2) + && !(ewram160A6 & gBitTable[battle_get_side_with_given_state(r5 ^ 2)]) + && gUnknown_02024D1E[battle_get_side_with_given_state(r5)] != 4) + break; + //_080123F8 + if (ewram160A6 & gBitTable[gUnknown_02024A60]) + { + gUnknown_02024C18[gUnknown_02024A60] = 13; + if (!(gBattleTypeFlags & 0x40)) + gUnknown_02024D1E[gUnknown_02024A60] = 4; + //_08012454 else - { - dp01_build_cmdbuf_x12_a_bb(0, gUnknown_02024C18[0], gUnknown_02024260[0][1] | (gUnknown_02024260[0][2] << 8)); - dp01_battle_side_mark_buffer_for_execution(gUnknown_02024A60); - gUnknown_02024D1E[gUnknown_02024A60]++; - } + gUnknown_02024D1E[gUnknown_02024A60] = 3; break; - case 1: + } + //_08012468 + if ((gBattleMons[gUnknown_02024A60].status2 & 0x1000) + || (gBattleMons[gUnknown_02024A60].status2 & 0x10000000)) + { + gUnknown_02024C18[gUnknown_02024A60] = 0; + gUnknown_02024D1E[gUnknown_02024A60] = 3; + } + else + { + dp01_build_cmdbuf_x12_a_bb(0, gUnknown_02024C18[0], gUnknown_02024260[0][1] | (gUnknown_02024260[0][2] << 8)); + dp01_battle_side_mark_buffer_for_execution(gUnknown_02024A60); + gUnknown_02024D1E[gUnknown_02024A60]++; + } + break; + case 1: } } } diff --git a/src/battle_interface.c b/src/battle_interface.c index ba3cba894..61a6a5853 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -2409,23 +2409,23 @@ static void sub_80451A0(u8 a, struct Pokemon *pkmn) gender = 100; switch (gender) { - default: - ptr[0] = 0xB; - ptr[1] = EOS; - ptr += 1; - break; - case MON_MALE: - ptr[0] = 0xB; - ptr[1] = CHAR_MALE; - ptr[2] = EOS; - ptr += 2; - break; - case MON_FEMALE: - ptr[0] = 0xA; - ptr[1] = CHAR_FEMALE; - ptr[2] = EOS; - ptr += 2; - break; + default: + ptr[0] = 0xB; + ptr[1] = EOS; + ptr += 1; + break; + case MON_MALE: + ptr[0] = 0xB; + ptr[1] = CHAR_MALE; + ptr[2] = EOS; + ptr += 2; + break; + case MON_FEMALE: + ptr[0] = 0xA; + ptr[1] = CHAR_FEMALE; + ptr[2] = EOS; + ptr += 2; + break; } ptr[0] = EXT_CTRL_CODE_BEGIN; ptr[1] = 0x13; diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c index 220e8420c..2ee4f91bb 100644 --- a/src/braille_puzzles.c +++ b/src/braille_puzzles.c @@ -151,50 +151,50 @@ void Task_BrailleWait(u8 taskId) switch (data[0]) { - case 0: - data[1] = 7200; - data[0] = 1; - break; - case 1: - if (BrailleWait_CheckButtonPress() != FALSE) + case 0: + data[1] = 7200; + data[0] = 1; + break; + case 1: + if (BrailleWait_CheckButtonPress() != FALSE) + { + MenuZeroFillScreen(); + PlaySE(5); + data[0] = 2; + } + else + { + data[1] = data[1] - 1; + if (data[1] == 0) { MenuZeroFillScreen(); - PlaySE(5); - data[0] = 2; - } - else - { - data[1] = data[1] - 1; - if (data[1] == 0) - { - MenuZeroFillScreen(); - data[0] = 3; - data[1] = 30; - } - } - break; - case 2: - if (BrailleWait_CheckButtonPress() == FALSE) - { - data[1] = data[1] - 1; - if (data[1] == 0) - data[0] = 4; - break; + data[0] = 3; + data[1] = 30; } - sub_8064E2C(); - DestroyTask(taskId); - ScriptContext2_Disable(); - break; - case 3: + } + break; + case 2: + if (BrailleWait_CheckButtonPress() == FALSE) + { data[1] = data[1] - 1; if (data[1] == 0) data[0] = 4; break; - case 4: - sub_8064E2C(); - ScriptContext1_SetupScript(gIslandCave_EventScript_OpenRegiiceChamber); - DestroyTask(taskId); - break; + } + sub_8064E2C(); + DestroyTask(taskId); + ScriptContext2_Disable(); + break; + case 3: + data[1] = data[1] - 1; + if (data[1] == 0) + data[0] = 4; + break; + case 4: + sub_8064E2C(); + ScriptContext1_SetupScript(gIslandCave_EventScript_OpenRegiiceChamber); + DestroyTask(taskId); + break; } } diff --git a/src/clear_save_data_menu.c b/src/clear_save_data_menu.c index 21cd643ef..c519e1a30 100644 --- a/src/clear_save_data_menu.c +++ b/src/clear_save_data_menu.c @@ -99,65 +99,65 @@ static u8 InitClearSaveDataScreen(void) switch (gMain.state) { - case 0: - default: - SetVBlankCallback(NULL); - - REG_DISPCNT = 0; - REG_BG0HOFS = 0; - REG_BG0VOFS = 0; - REG_BG3HOFS = 0; - REG_BG3VOFS = 0; - REG_WIN0H = 0; - REG_WIN0V = 0; - REG_WININ = 0; - REG_WINOUT = 0; - REG_BLDCNT = 0; - REG_BLDALPHA = 0; - REG_BLDY = 0; - - DmaFill16(3, 0, (void *)VRAM, VRAM_SIZE); - DmaFill32(3, 0, (void *)OAM, OAM_SIZE); - DmaFill16(3, 0, (void *)(PLTT + 2), PLTT_SIZE - 2); - - ResetPaletteFade(); - - gPlttBufferUnfaded[0] = 0x7fff; - gPlttBufferFaded[0] = 0x7fff; - gPlttBufferUnfaded[1] = 0x3945; - gPlttBufferFaded[1] = 0x3945; - - for (i = 0; i < 0x10; i++) - ((u16 *)(VRAM + 0x20))[i] = 0x1111; - - for (i = 0; i < 0x500; i++) - ((u16 *)(VRAM + 0x3800))[i] = 0x0001; - - ResetTasks(); - ResetSpriteData(); - - SetUpWindowConfig(&gWindowConfig_81E6C3C); - InitMenuWindow(&gWindowConfig_81E6CE4); - BeginNormalPaletteFade(-1, 0, 0x10, 0, 0xffff); - - ime = REG_IME; - REG_IME = 0; - REG_IE |= INTR_FLAG_VBLANK; - REG_IME = ime; - REG_DISPSTAT |= DISPSTAT_VBLANK_INTR; - - SetVBlankCallback(VBlankCB_InitClearSaveDataScreen); - - REG_BG3CNT = BGCNT_PRIORITY(3) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(7) | BGCNT_16COLOR | BGCNT_TXT256x256; - REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_BG0_ON | DISPCNT_BG3_ON; - gMain.state = 1; + case 0: + default: + SetVBlankCallback(NULL); + + REG_DISPCNT = 0; + REG_BG0HOFS = 0; + REG_BG0VOFS = 0; + REG_BG3HOFS = 0; + REG_BG3VOFS = 0; + REG_WIN0H = 0; + REG_WIN0V = 0; + REG_WININ = 0; + REG_WINOUT = 0; + REG_BLDCNT = 0; + REG_BLDALPHA = 0; + REG_BLDY = 0; + + DmaFill16(3, 0, (void *)VRAM, VRAM_SIZE); + DmaFill32(3, 0, (void *)OAM, OAM_SIZE); + DmaFill16(3, 0, (void *)(PLTT + 2), PLTT_SIZE - 2); + + ResetPaletteFade(); + + gPlttBufferUnfaded[0] = 0x7fff; + gPlttBufferFaded[0] = 0x7fff; + gPlttBufferUnfaded[1] = 0x3945; + gPlttBufferFaded[1] = 0x3945; + + for (i = 0; i < 0x10; i++) + ((u16 *)(VRAM + 0x20))[i] = 0x1111; + + for (i = 0; i < 0x500; i++) + ((u16 *)(VRAM + 0x3800))[i] = 0x0001; + + ResetTasks(); + ResetSpriteData(); + + SetUpWindowConfig(&gWindowConfig_81E6C3C); + InitMenuWindow(&gWindowConfig_81E6CE4); + BeginNormalPaletteFade(-1, 0, 0x10, 0, 0xffff); + + ime = REG_IME; + REG_IME = 0; + REG_IE |= INTR_FLAG_VBLANK; + REG_IME = ime; + REG_DISPSTAT |= DISPSTAT_VBLANK_INTR; + + SetVBlankCallback(VBlankCB_InitClearSaveDataScreen); + + REG_BG3CNT = BGCNT_PRIORITY(3) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(7) | BGCNT_16COLOR | BGCNT_TXT256x256; + REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_BG0_ON | DISPCNT_BG3_ON; + gMain.state = 1; + return 0; + case 1: + UpdatePaletteFade(); + if (gPaletteFade.active) return 0; - case 1: - UpdatePaletteFade(); - if (gPaletteFade.active) - return 0; - SetMainCallback2(CB2_ClearSaveDataScreen); - return 1; + SetMainCallback2(CB2_ClearSaveDataScreen); + return 1; } } @@ -165,16 +165,16 @@ static void CB2_SoftReset(void) { switch (gMain.state) { - case 0: - default: - BeginNormalPaletteFade(-1, 0, 0, 0x10, 0xffff); - gMain.state = 1; - break; - case 1: - UpdatePaletteFade(); - if (gPaletteFade.active) - return; - DoSoftReset(); - break; + case 0: + default: + BeginNormalPaletteFade(-1, 0, 0, 0x10, 0xffff); + gMain.state = 1; + break; + case 1: + UpdatePaletteFade(); + if (gPaletteFade.active) + return; + DoSoftReset(); + break; } } diff --git a/src/field_camera.c b/src/field_camera.c index 442bc095b..182e180ab 100644 --- a/src/field_camera.c +++ b/src/field_camera.c @@ -258,54 +258,54 @@ static void DrawMetatile(s32 a, u16 *b, u16 c) { switch (a) { - case 2: - gBGTilemapBuffers[3][c] = b[0]; - gBGTilemapBuffers[3][c + 1] = b[1]; - gBGTilemapBuffers[3][c + 0x20] = b[2]; - gBGTilemapBuffers[3][c + 0x21] = b[3]; - - gBGTilemapBuffers[2][c] = 0; - gBGTilemapBuffers[2][c + 1] = 0; - gBGTilemapBuffers[2][c + 0x20] = 0; - gBGTilemapBuffers[2][c + 0x21] = 0; - - gBGTilemapBuffers[1][c] = b[4]; - gBGTilemapBuffers[1][c + 1] = b[5]; - gBGTilemapBuffers[1][c + 0x20] = b[6]; - gBGTilemapBuffers[1][c + 0x21] = b[7]; - break; - case 1: - gBGTilemapBuffers[3][c] = b[0]; - gBGTilemapBuffers[3][c + 1] = b[1]; - gBGTilemapBuffers[3][c + 0x20] = b[2]; - gBGTilemapBuffers[3][c + 0x21] = b[3]; - - gBGTilemapBuffers[2][c] = b[4]; - gBGTilemapBuffers[2][c + 1] = b[5]; - gBGTilemapBuffers[2][c + 0x20] = b[6]; - gBGTilemapBuffers[2][c + 0x21] = b[7]; - - gBGTilemapBuffers[1][c] = 0; - gBGTilemapBuffers[1][c + 1] = 0; - gBGTilemapBuffers[1][c + 0x20] = 0; - gBGTilemapBuffers[1][c + 0x21] = 0; - break; - case 0: - gBGTilemapBuffers[3][c] = 0x3014; - gBGTilemapBuffers[3][c + 1] = 0x3014; - gBGTilemapBuffers[3][c + 0x20] = 0x3014; - gBGTilemapBuffers[3][c + 0x21] = 0x3014; - - gBGTilemapBuffers[2][c] = b[0]; - gBGTilemapBuffers[2][c + 1] = b[1]; - gBGTilemapBuffers[2][c + 0x20] = b[2]; - gBGTilemapBuffers[2][c + 0x21] = b[3]; - - gBGTilemapBuffers[1][c] = b[4]; - gBGTilemapBuffers[1][c + 1] = b[5]; - gBGTilemapBuffers[1][c + 0x20] = b[6]; - gBGTilemapBuffers[1][c + 0x21] = b[7]; - break; + case 2: + gBGTilemapBuffers[3][c] = b[0]; + gBGTilemapBuffers[3][c + 1] = b[1]; + gBGTilemapBuffers[3][c + 0x20] = b[2]; + gBGTilemapBuffers[3][c + 0x21] = b[3]; + + gBGTilemapBuffers[2][c] = 0; + gBGTilemapBuffers[2][c + 1] = 0; + gBGTilemapBuffers[2][c + 0x20] = 0; + gBGTilemapBuffers[2][c + 0x21] = 0; + + gBGTilemapBuffers[1][c] = b[4]; + gBGTilemapBuffers[1][c + 1] = b[5]; + gBGTilemapBuffers[1][c + 0x20] = b[6]; + gBGTilemapBuffers[1][c + 0x21] = b[7]; + break; + case 1: + gBGTilemapBuffers[3][c] = b[0]; + gBGTilemapBuffers[3][c + 1] = b[1]; + gBGTilemapBuffers[3][c + 0x20] = b[2]; + gBGTilemapBuffers[3][c + 0x21] = b[3]; + + gBGTilemapBuffers[2][c] = b[4]; + gBGTilemapBuffers[2][c + 1] = b[5]; + gBGTilemapBuffers[2][c + 0x20] = b[6]; + gBGTilemapBuffers[2][c + 0x21] = b[7]; + + gBGTilemapBuffers[1][c] = 0; + gBGTilemapBuffers[1][c + 1] = 0; + gBGTilemapBuffers[1][c + 0x20] = 0; + gBGTilemapBuffers[1][c + 0x21] = 0; + break; + case 0: + gBGTilemapBuffers[3][c] = 0x3014; + gBGTilemapBuffers[3][c + 1] = 0x3014; + gBGTilemapBuffers[3][c + 0x20] = 0x3014; + gBGTilemapBuffers[3][c + 0x21] = 0x3014; + + gBGTilemapBuffers[2][c] = b[0]; + gBGTilemapBuffers[2][c + 1] = b[1]; + gBGTilemapBuffers[2][c + 0x20] = b[2]; + gBGTilemapBuffers[2][c + 0x21] = b[3]; + + gBGTilemapBuffers[1][c] = b[4]; + gBGTilemapBuffers[1][c + 1] = b[5]; + gBGTilemapBuffers[1][c + 0x20] = b[6]; + gBGTilemapBuffers[1][c + 0x21] = b[7]; + break; } } diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index c5f2c08e7..8220a144b 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -342,41 +342,41 @@ static u8 *TryGetInvisibleMapObjectScript(struct MapPosition *position, u8 unuse return gUnknown_081C6C02; switch (bgEvent->kind) { - case 0: - default: - return bgEvent->bgUnion.script; - case 1: - if (c != 2) - return NULL; - break; - case 2: - if (c != 1) - return NULL; - break; - case 3: - if (c != 4) - return NULL; - break; - case 4: - if (c != 3) - return NULL; - break; - case 5: - case 6: - case 7: - gSpecialVar_0x8004 = ((u32)bgEvent->bgUnion.script >> 16) + 0x258; - gSpecialVar_0x8005 = (u32)bgEvent->bgUnion.script; - if (FlagGet(gSpecialVar_0x8004) == TRUE) - return NULL; - return HiddenItemScript; - case 8: - if (c == 2) - { - gSpecialVar_0x8004 = (u32)bgEvent->bgUnion.script; - if (sub_80BC050()) - return gUnknown_081A2C51; - } + case 0: + default: + return bgEvent->bgUnion.script; + case 1: + if (c != 2) + return NULL; + break; + case 2: + if (c != 1) + return NULL; + break; + case 3: + if (c != 4) return NULL; + break; + case 4: + if (c != 3) + return NULL; + break; + case 5: + case 6: + case 7: + gSpecialVar_0x8004 = ((u32)bgEvent->bgUnion.script >> 16) + 0x258; + gSpecialVar_0x8005 = (u32)bgEvent->bgUnion.script; + if (FlagGet(gSpecialVar_0x8004) == TRUE) + return NULL; + return HiddenItemScript; + case 8: + if (c == 2) + { + gSpecialVar_0x8004 = (u32)bgEvent->bgUnion.script; + if (sub_80BC050()) + return gUnknown_081A2C51; + } + return NULL; } return bgEvent->bgUnion.script; } diff --git a/src/field_poison.c b/src/field_poison.c index 8e49080b0..4d4d4b975 100644 --- a/src/field_poison.c +++ b/src/field_poison.c @@ -72,32 +72,32 @@ void Task_WhiteOut(u8 taskId) switch (taskData[TD_STATE]) { - case 0: //Check if Pokemon have fainted due to poison - while (taskData[TD_PARTY_MEMBER] < 6) + case 0: //Check if Pokemon have fainted due to poison + while (taskData[TD_PARTY_MEMBER] < 6) + { + if (CheckMonFaintedFromPoison(taskData[TD_PARTY_MEMBER])) { - if (CheckMonFaintedFromPoison(taskData[TD_PARTY_MEMBER])) - { - MonFaintFromPoisonOnField(taskData[TD_PARTY_MEMBER]); - ShowFieldMessage(fieldPoisonText_PokemonFainted); - taskData[TD_STATE]++; - return; - } - taskData[TD_PARTY_MEMBER]++; + MonFaintFromPoisonOnField(taskData[TD_PARTY_MEMBER]); + ShowFieldMessage(fieldPoisonText_PokemonFainted); + taskData[TD_STATE]++; + return; } - taskData[TD_STATE] = 2; - break; - case 1: //Wait for message box to disappear - if (IsFieldMessageBoxHidden()) - taskData[TD_STATE]--; //Check next party member - break; - case 2: //Done checking Pokemon - if (AllMonsFainted()) - gScriptResult = 1; - else - gScriptResult = 0; - EnableBothScriptContexts(); - DestroyTask(taskId); - break; + taskData[TD_PARTY_MEMBER]++; + } + taskData[TD_STATE] = 2; + break; + case 1: //Wait for message box to disappear + if (IsFieldMessageBoxHidden()) + taskData[TD_STATE]--; //Check next party member + break; + case 2: //Done checking Pokemon + if (AllMonsFainted()) + gScriptResult = 1; + else + gScriptResult = 0; + EnableBothScriptContexts(); + DestroyTask(taskId); + break; } } diff --git a/src/field_special_scene.c b/src/field_special_scene.c index 59280b743..9e06ede81 100644 --- a/src/field_special_scene.c +++ b/src/field_special_scene.c @@ -143,64 +143,64 @@ void Task_HandleTruckSequence(u8 taskId) { s16 *data = gTasks[taskId].data; - switch (data[0]) - { - /* - Each case has a timer which is handled with data[1], incrementing - until it reaches the if function's condition, which sets the next task up. - */ - case 0: - data[1]++; - if (data[1] == SECONDS(1.5)) - { - SetCameraPanningCallback(0); - data[1] = 0; // reset the timer. - data[2] = CreateTask(Task_Truck1, 0xA); - data[0] = 1; // run the next case. - PlaySE(SE_TRACK_MOVE); - } - break; - case 1: - data[1]++; - if (data[1] == SECONDS(2.5)) - { - pal_fill_black(); - data[1] = 0; - data[0] = 2; - } - break; - case 2: - data[1]++; - if (!gPaletteFade.active && data[1] > SECONDS(5)) - { - data[1] = 0; - DestroyTask(data[2]); - data[3] = CreateTask(Task_Truck2, 0xA); - data[0] = 3; - PlaySE(SE_TRACK_STOP); - } - break; - case 3: - if (!gTasks[data[3]].isActive) // is Truck2 no longer active (is Truck3 active?) - { - InstallCameraPanAheadCallback(); - data[1] = 0; - data[0] = 4; - } - break; - case 4: - data[1]++; - if (data[1] == 90) - { - PlaySE(SE_TRACK_HAIK); - data[1] = 0; - data[0] = 5; - } - break; - case 5: - data[1]++; - if (data[1] == 120) - { + switch (data[0]) + { + /* + Each case has a timer which is handled with data[1], incrementing + until it reaches the if function's condition, which sets the next task up. + */ + case 0: + data[1]++; + if (data[1] == SECONDS(1.5)) + { + SetCameraPanningCallback(0); + data[1] = 0; // reset the timer. + data[2] = CreateTask(Task_Truck1, 0xA); + data[0] = 1; // run the next case. + PlaySE(SE_TRACK_MOVE); + } + break; + case 1: + data[1]++; + if (data[1] == SECONDS(2.5)) + { + pal_fill_black(); + data[1] = 0; + data[0] = 2; + } + break; + case 2: + data[1]++; + if (!gPaletteFade.active && data[1] > SECONDS(5)) + { + data[1] = 0; + DestroyTask(data[2]); + data[3] = CreateTask(Task_Truck2, 0xA); + data[0] = 3; + PlaySE(SE_TRACK_STOP); + } + break; + case 3: + if (!gTasks[data[3]].isActive) // is Truck2 no longer active (is Truck3 active?) + { + InstallCameraPanAheadCallback(); + data[1] = 0; + data[0] = 4; + } + break; + case 4: + data[1]++; + if (data[1] == 90) + { + PlaySE(SE_TRACK_HAIK); + data[1] = 0; + data[0] = 5; + } + break; + case 5: + data[1]++; + if (data[1] == 120) + { MapGridSetMetatileIdAt(11, 8, 520); MapGridSetMetatileIdAt(11, 9, 528); MapGridSetMetatileIdAt(11, 10, 536); @@ -208,9 +208,9 @@ void Task_HandleTruckSequence(u8 taskId) PlaySE(SE_TRACK_DOOR); DestroyTask(taskId); ScriptContext2_Disable(); - } - break; - } + } + break; + } } void ExecuteTruckSequence(void) diff --git a/src/fldeff_cut.c b/src/fldeff_cut.c index 77c8752d1..8fde74852 100644 --- a/src/fldeff_cut.c +++ b/src/fldeff_cut.c @@ -160,37 +160,37 @@ void sub_80A27A8(s16 x, s16 y) switch(metatileId) { - case 0x208: - case 0x15: - case 0xD: - MapGridSetMetatileIdAt(x, y, 0x1); - break; - case 0x1C6: - MapGridSetMetatileIdAt(x, y, 0x1CE); - break; - case 0x1C7: - MapGridSetMetatileIdAt(x, y, 0x1CF); - break; - case 0x281: - MapGridSetMetatileIdAt(x, y, 0x279); - break; - case 0x282: - MapGridSetMetatileIdAt(x, y, 0x27A); - break; - case 0x283: - MapGridSetMetatileIdAt(x, y, 0x27B); - break; - case 0x206: - case 0x207: - MapGridSetMetatileIdAt(x, y, 0x271); - break; - case 0x212: - case 0x20A: - MapGridSetMetatileIdAt(x, y, 0x218); - break; - case 0x25: - MapGridSetMetatileIdAt(x, y, 0xE); - break; + case 0x208: + case 0x15: + case 0xD: + MapGridSetMetatileIdAt(x, y, 0x1); + break; + case 0x1C6: + MapGridSetMetatileIdAt(x, y, 0x1CE); + break; + case 0x1C7: + MapGridSetMetatileIdAt(x, y, 0x1CF); + break; + case 0x281: + MapGridSetMetatileIdAt(x, y, 0x279); + break; + case 0x282: + MapGridSetMetatileIdAt(x, y, 0x27A); + break; + case 0x283: + MapGridSetMetatileIdAt(x, y, 0x27B); + break; + case 0x206: + case 0x207: + MapGridSetMetatileIdAt(x, y, 0x271); + break; + case 0x212: + case 0x20A: + MapGridSetMetatileIdAt(x, y, 0x218); + break; + case 0x25: + MapGridSetMetatileIdAt(x, y, 0xE); + break; } } @@ -223,18 +223,18 @@ void sub_80A28F4(s16 x, s16 y) { switch((u8)sub_80A28A0(currentXsigned, y + 1)) { - case 1: - MapGridSetMetatileIdAt(currentXsigned, y + 1, 0x208); - break; - case 2: - MapGridSetMetatileIdAt(currentXsigned, y + 1, 0x281); - break; - case 3: - MapGridSetMetatileIdAt(currentXsigned, y + 1, 0x282); - break; - case 4: - MapGridSetMetatileIdAt(currentXsigned, y + 1, 0x283); - break; + case 1: + MapGridSetMetatileIdAt(currentXsigned, y + 1, 0x208); + break; + case 2: + MapGridSetMetatileIdAt(currentXsigned, y + 1, 0x281); + break; + case 3: + MapGridSetMetatileIdAt(currentXsigned, y + 1, 0x282); + break; + case 4: + MapGridSetMetatileIdAt(currentXsigned, y + 1, 0x283); + break; } } if(MapGridGetMetatileIdAt((s16)currentX, (s16)lowerY) == 1) diff --git a/src/intro.c b/src/intro.c index 2a62892ba..56eaa11e8 100644 --- a/src/intro.c +++ b/src/intro.c @@ -2084,29 +2084,29 @@ static void sub_813D788(struct Sprite *sprite) { switch (sprite->data0) { - case 0: - StartSpriteAnimIfDifferent(sprite, 0); - sprite->pos1.x--; - break; - case 1: - StartSpriteAnimIfDifferent(sprite, 0); - if (gIntroFrameCounter & 7) - return; + case 0: + StartSpriteAnimIfDifferent(sprite, 0); + sprite->pos1.x--; + break; + case 1: + StartSpriteAnimIfDifferent(sprite, 0); + if (gIntroFrameCounter & 7) + return; + sprite->pos1.x++; + break; + case 2: + StartSpriteAnimIfDifferent(sprite, 2); + if (sprite->pos1.x <= 120 || (gIntroFrameCounter & 7)) sprite->pos1.x++; - break; - case 2: - StartSpriteAnimIfDifferent(sprite, 2); - if (sprite->pos1.x <= 120 || (gIntroFrameCounter & 7)) - sprite->pos1.x++; - break; - case 3: - StartSpriteAnimIfDifferent(sprite, 3); - break; - case 4: - StartSpriteAnimIfDifferent(sprite, 0); - if (sprite->pos1.x > -32) - sprite->pos1.x -= 2; - break; + break; + case 3: + StartSpriteAnimIfDifferent(sprite, 3); + break; + case 4: + StartSpriteAnimIfDifferent(sprite, 0); + if (sprite->pos1.x > -32) + sprite->pos1.x -= 2; + break; } if (gIntroFrameCounter & 7) return; @@ -2118,16 +2118,16 @@ static void sub_813D788(struct Sprite *sprite) { switch (Random() & 3) { - case 0: - sprite->pos2.y = -1; - break; - case 1: - sprite->pos2.y = 1; - break; - case 2: - case 3: - sprite->pos2.y = 0; - break; + case 0: + sprite->pos2.y = -1; + break; + case 1: + sprite->pos2.y = 1; + break; + case 2: + case 3: + sprite->pos2.y = 0; + break; } } } @@ -2136,24 +2136,24 @@ static void sub_813D880(struct Sprite *sprite) { switch (sprite->data0) { - case 0: - break; - case 1: - if (sprite->pos2.x + sprite->pos1.x < 304) - sprite->pos2.x += 8; - else - sprite->data0 = 2; - break; - case 2: - if (sprite->pos2.x + sprite->pos1.x > 120) - sprite->pos2.x -= 1; - else - sprite->data0 = 3; - break; - case 3: - if (sprite->pos2.x > 0) - sprite->pos2.x -= 2; - break; + case 0: + break; + case 1: + if (sprite->pos2.x + sprite->pos1.x < 304) + sprite->pos2.x += 8; + else + sprite->data0 = 2; + break; + case 2: + if (sprite->pos2.x + sprite->pos1.x > 120) + sprite->pos2.x -= 1; + else + sprite->data0 = 3; + break; + case 3: + if (sprite->pos2.x > 0) + sprite->pos2.x -= 2; + break; } sprite->pos2.y = Sin((u8)sprite->data1, 8) - gUnknown_0203935A; sprite->data1 += 4; diff --git a/src/item_use.c b/src/item_use.c index 4047ade5c..116a57226 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -180,13 +180,13 @@ void HandleDeniedItemUseMessage(u8 var1, u8 playerMenuStatus, const u8 *text) switch (playerMenuStatus) { - case 0: // Item Menu - MenuZeroFillWindowRect(0, 13, 13, 20); - DisplayItemMessageOnField(var1, gStringVar4, CleanUpItemMenuMessage, 1); - break; - default: // Field - DisplayItemMessageOnField(var1, gStringVar4, CleanUpOverworldMessage, 0); - break; + case 0: // Item Menu + MenuZeroFillWindowRect(0, 13, 13, 20); + DisplayItemMessageOnField(var1, gStringVar4, CleanUpItemMenuMessage, 1); + break; + default: // Field + DisplayItemMessageOnField(var1, gStringVar4, CleanUpOverworldMessage, 0); + break; } } @@ -439,33 +439,33 @@ bool8 sub_80C9688(struct MapConnection *connection, int x, int y) switch(connection->direction) { - // same weird temp variable behavior seen in HiddenItemAtPos - case 2: - localOffset = connection->offset + 7; - localX = x - localOffset; - localLength = mapHeader->mapData->height - 7; - localY = localLength + y; // additions are reversed for some reason - break; - case 1: - localOffset = connection->offset + 7; - localX = x - localOffset; - localLength = gMapHeader.mapData->height + 7; - localY = y - localLength; - break; - case 3: - localLength = mapHeader->mapData->width - 7; - localX = localLength + x; // additions are reversed for some reason - localOffset = connection->offset + 7; - localY = y - localOffset; - break; - case 4: - localLength = gMapHeader.mapData->width + 7; - localX = x - localLength; - localOffset = connection->offset + 7; - localY = y - localOffset; - break; - default: - return FALSE; + // same weird temp variable behavior seen in HiddenItemAtPos + case 2: + localOffset = connection->offset + 7; + localX = x - localOffset; + localLength = mapHeader->mapData->height - 7; + localY = localLength + y; // additions are reversed for some reason + break; + case 1: + localOffset = connection->offset + 7; + localX = x - localOffset; + localLength = gMapHeader.mapData->height + 7; + localY = y - localLength; + break; + case 3: + localLength = mapHeader->mapData->width - 7; + localX = localLength + x; // additions are reversed for some reason + localOffset = connection->offset + 7; + localY = y - localOffset; + break; + case 4: + localLength = gMapHeader.mapData->width + 7; + localX = x - localLength; + localOffset = connection->offset + 7; + localY = y - localOffset; + break; + default: + return FALSE; } return HiddenItemAtPos(mapHeader->events, localX, localY); } @@ -1188,42 +1188,42 @@ void ItemUseOutOfBattle_EnigmaBerry(u8 taskId) { switch(GetItemEffectType(gScriptItemId) - 1) { - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - gTasks[taskId].data[15] = 1; - ItemUseOutOfBattle_Medicine(taskId); - break; - case 9: - gTasks[taskId].data[15] = 1; - ItemUseOutOfBattle_SacredAsh(taskId); - break; - case 0: - gTasks[taskId].data[15] = 1; - ItemUseOutOfBattle_RareCandy(taskId); - break; - case 18: - case 19: - gTasks[taskId].data[15] = 1; - ItemUseOutOfBattle_PPUp(taskId); - break; - case 20: - gTasks[taskId].data[15] = 1; - ItemUseOutOfBattle_PPRecovery(taskId); - break; - default: - gTasks[taskId].data[15] = 4; - ItemUseOutOfBattle_CannotUse(taskId); + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + gTasks[taskId].data[15] = 1; + ItemUseOutOfBattle_Medicine(taskId); + break; + case 9: + gTasks[taskId].data[15] = 1; + ItemUseOutOfBattle_SacredAsh(taskId); + break; + case 0: + gTasks[taskId].data[15] = 1; + ItemUseOutOfBattle_RareCandy(taskId); + break; + case 18: + case 19: + gTasks[taskId].data[15] = 1; + ItemUseOutOfBattle_PPUp(taskId); + break; + case 20: + gTasks[taskId].data[15] = 1; + ItemUseOutOfBattle_PPRecovery(taskId); + break; + default: + gTasks[taskId].data[15] = 4; + ItemUseOutOfBattle_CannotUse(taskId); } } @@ -1231,25 +1231,25 @@ void ItemUseInBattle_EnigmaBerry(u8 taskId) { switch(GetItemEffectType(gScriptItemId)) { - case 0: - ItemUseInBattle_StatIncrease(taskId); - break; - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 11: - ItemUseInBattle_Medicine(taskId); - break; - case 21: - ItemUseInBattle_PPRecovery(taskId); - break; - default: - ItemUseOutOfBattle_CannotUse(taskId); + case 0: + ItemUseInBattle_StatIncrease(taskId); + break; + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 11: + ItemUseInBattle_Medicine(taskId); + break; + case 21: + ItemUseInBattle_PPRecovery(taskId); + break; + default: + ItemUseOutOfBattle_CannotUse(taskId); } } diff --git a/src/matsuda_debug_menu.c b/src/matsuda_debug_menu.c index d2ca754bb..09ee5fc66 100644 --- a/src/matsuda_debug_menu.c +++ b/src/matsuda_debug_menu.c @@ -528,41 +528,41 @@ void sub_80AA754(struct Sprite *sprite) { switch (gMain.newAndRepeatedKeys) { - case 0x10: - case 0x20: - sprite->data0 ^= 1; - break; - case 0x40: - if (sprite->data1 == 0) - sprite->data1 = 8; - else - sprite->data1--; - break; - case 0x80: - if (sprite->data1 == 8) - sprite->data1 = 0; - else - sprite->data1++; - break; - case 0x1: - gUnknown_083C92E4[sprite->data1][sprite->data0](sprite, 1); - sub_80AA614(sprite->data2, sprite->data3); - break; - case 0x2: - gUnknown_083C92E4[sprite->data1][sprite->data0](sprite, -1); - sub_80AA614(sprite->data2, sprite->data3); - break; - case 0x100: - gUnknown_083C92E4[sprite->data1][sprite->data0](sprite, 10); - sub_80AA614(sprite->data2, sprite->data3); - break; - case 0x200: - gUnknown_083C92E4[sprite->data1][sprite->data0](sprite, -10); - sub_80AA614(sprite->data2, sprite->data3); - break; - case 0x8: - sub_80AAD08(sprite, 1); - break; + case DPAD_RIGHT: + case DPAD_LEFT: + sprite->data0 ^= 1; + break; + case DPAD_UP: + if (sprite->data1 == 0) + sprite->data1 = 8; + else + sprite->data1--; + break; + case DPAD_DOWN: + if (sprite->data1 == 8) + sprite->data1 = 0; + else + sprite->data1++; + break; + case A_BUTTON: + gUnknown_083C92E4[sprite->data1][sprite->data0](sprite, 1); + sub_80AA614(sprite->data2, sprite->data3); + break; + case B_BUTTON: + gUnknown_083C92E4[sprite->data1][sprite->data0](sprite, -1); + sub_80AA614(sprite->data2, sprite->data3); + break; + case R_BUTTON: + gUnknown_083C92E4[sprite->data1][sprite->data0](sprite, 10); + sub_80AA614(sprite->data2, sprite->data3); + break; + case L_BUTTON: + gUnknown_083C92E4[sprite->data1][sprite->data0](sprite, -10); + sub_80AA614(sprite->data2, sprite->data3); + break; + case START_BUTTON: + sub_80AAD08(sprite, 1); + break; } sprite->pos1.x = gUnknown_083C9296[sprite->data0 + sprite->data1 * 2]; sprite->pos1.y = gUnknown_083C92A8[sprite->data1]; diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index 11dadf380..2fa889a15 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -65,21 +65,21 @@ void SetMauvilleOldMan(void) switch(var) { - case 0: - sub_80F7A34(); - break; - case 1: - sub_80F7A6C(); - break; - case 2: - sub_80F7A98(); - break; - case 3: - sub_80F7A7C(); - break; - case 4: - sub_80F7A88(); - break; + case 0: + sub_80F7A34(); + break; + case 1: + sub_80F7A6C(); + break; + case 2: + sub_80F7A98(); + break; + case 3: + sub_80F7A7C(); + break; + case 4: + sub_80F7A88(); + break; } sub_80F83D0(); } diff --git a/src/mystery_event_menu.c b/src/mystery_event_menu.c index 97deb348c..fa2e42b91 100644 --- a/src/mystery_event_menu.c +++ b/src/mystery_event_menu.c @@ -91,240 +91,240 @@ static void CB2_MysteryEventMenu(void) switch (gMain.state) { - case 0: - MenuDrawTextWindow(0, 14, 29, 19); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0); - gMain.state++; + case 0: + MenuDrawTextWindow(0, 14, 29, 19); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0); + gMain.state++; + break; + case 1: + if (gPaletteFade.active) break; - case 1: - if (gPaletteFade.active) - break; - sub_8072044(gSystemText_LinkStandby); + sub_8072044(gSystemText_LinkStandby); + gMain.state++; + break; + case 2: + if (MenuUpdateWindowText()) + { gMain.state++; - break; - case 2: - if (MenuUpdateWindowText()) - { - gMain.state++; - gLinkType = 21761; - OpenLink(); - } - break; - case 3: - if ((gLinkStatus & 0x20) && (gLinkStatus & 0x1C) > 4) - { - PlaySE(SE_PIN); - sub_8072044(gSystemText_LoadEventPressA); - gMain.state++; - } - if (gMain.newKeys & B_BUTTON) - { - PlaySE(SE_SELECT); - CloseLink(); - gMain.state = 15; - } - break; - case 4: - if (MenuUpdateWindowText()) - gMain.state++; - break; + gLinkType = 21761; + OpenLink(); + } + break; + case 3: + if ((gLinkStatus & 0x20) && (gLinkStatus & 0x1C) > 4) + { + PlaySE(SE_PIN); + sub_8072044(gSystemText_LoadEventPressA); + gMain.state++; + } + if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + CloseLink(); + gMain.state = 15; + } + break; + case 4: + if (MenuUpdateWindowText()) + gMain.state++; + break; #ifdef NONMATCHING - case 5: - if (GetLinkPlayerCount_2() != 2) + case 5: + if (GetLinkPlayerCount_2() != 2) + { + GetEventLoadMessage(gStringVar4, 1); + sub_8072044(gStringVar4); + gMain.state = 13; + break; + } + if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + sub_8007F4C(); + MenuDrawTextWindow(6, 5, 23, 8); + MenuPrint(gSystemText_LoadingEvent, 7, 6); + gMain.state++; + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + CloseLink(); + gMain.state = 15; + } + break; + case 6: + if (IsLinkConnectionEstablished()) + { + if (!gReceivedRemoteLinkPlayers) + break; + + if (GetLinkPlayerDataExchangeStatusTimed() == 3) { + sub_800832C(); + MenuZeroFillWindowRect(6, 5, 23, 8); GetEventLoadMessage(gStringVar4, 1); sub_8072044(gStringVar4); gMain.state = 13; break; } - if (gMain.newKeys & A_BUTTON) + else if (CheckLanguageMatch()) { - PlaySE(SE_SELECT); - sub_8007F4C(); - MenuDrawTextWindow(6, 5, 23, 8); - MenuPrint(gSystemText_LoadingEvent, 7, 6); + sub_8072044(gSystemText_DontCutLink); gMain.state++; + break; } - else if (gMain.newKeys & B_BUTTON) - { - PlaySE(SE_SELECT); - CloseLink(); - gMain.state = 15; - } - break; - case 6: - if (IsLinkConnectionEstablished()) - { - if (!gReceivedRemoteLinkPlayers) - break; - - if (GetLinkPlayerDataExchangeStatusTimed() == 3) - { - sub_800832C(); - MenuZeroFillWindowRect(6, 5, 23, 8); - GetEventLoadMessage(gStringVar4, 1); - sub_8072044(gStringVar4); - gMain.state = 13; - break; - } - else if (CheckLanguageMatch()) - { - sub_8072044(gSystemText_DontCutLink); - gMain.state++; - break; - } - else - { - CloseLink(); - MenuZeroFillWindowRect(6, 5, 23, 8); - GetEventLoadMessage(gStringVar4, 1); - sub_8072044(gStringVar4); - gMain.state = 13; - break; - } - } - if (gMain.newKeys & B_BUTTON) + else { - PlaySE(SE_SELECT); CloseLink(); - gMain.state = 15; + MenuZeroFillWindowRect(6, 5, 23, 8); + GetEventLoadMessage(gStringVar4, 1); + sub_8072044(gStringVar4); + gMain.state = 13; break; } + } + if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + CloseLink(); + gMain.state = 15; break; + } + break; #else - case 5: - if (GetLinkPlayerCount_2() != 2) - { - goto label; - } - if (gMain.newKeys & A_BUTTON) - { - PlaySE(SE_SELECT); - sub_8007F4C(); - MenuDrawTextWindow(6, 5, 23, 8); - MenuPrint(gSystemText_LoadingEvent, 7, 6); - gMain.state++; - } - else if (gMain.newKeys & B_BUTTON) - { - PlaySE(SE_SELECT); - CloseLink(); - gMain.state = 15; - } - break; - case 6: - if (IsLinkConnectionEstablished()) - { - register u8 *ptr asm("r0"); - register u32 offset1 asm("r2"); - register u32 offset2 asm("r1"); - - if (!gReceivedRemoteLinkPlayers) - break; + case 5: + if (GetLinkPlayerCount_2() != 2) + { + goto label; + } + if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + sub_8007F4C(); + MenuDrawTextWindow(6, 5, 23, 8); + MenuPrint(gSystemText_LoadingEvent, 7, 6); + gMain.state++; + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + CloseLink(); + gMain.state = 15; + } + break; + case 6: + if (IsLinkConnectionEstablished()) + { + register u8 *ptr asm("r0"); + register u32 offset1 asm("r2"); + register u32 offset2 asm("r1"); - if (GetLinkPlayerDataExchangeStatusTimed() == 3) - { - sub_800832C(); - MenuZeroFillWindowRect(6, 5, 23, 8); - GetEventLoadMessage(gStringVar4, 1); - sub_8072044(gStringVar4); - ptr = (u8 *)&gMain; - offset1 = offsetof(struct Main, state); - asm("" ::: "r1"); - ptr += offset1; - *ptr = 13; - } - else if (CheckLanguageMatch()) - { - register u8 *ptr2 asm("r1"); - register int offset3 asm("r0"); - register int dummy asm("r2"); - sub_8072044(gSystemText_DontCutLink); - ptr2 = (u8 *)&gMain; - offset3 = offsetof(struct Main, state); - if (dummy) - dummy++; - ptr2 += offset3; - (*ptr2)++; - break; - } - else - { - CloseLink(); - MenuZeroFillWindowRect(6, 5, 23, 8); - label: - GetEventLoadMessage(gStringVar4, 1); - sub_8072044(gStringVar4); - ptr = (u8 *)&gMain; - offset2 = offsetof(struct Main, state); - ptr += offset2; - *ptr = 13; - } + if (!gReceivedRemoteLinkPlayers) break; + + if (GetLinkPlayerDataExchangeStatusTimed() == 3) + { + sub_800832C(); + MenuZeroFillWindowRect(6, 5, 23, 8); + GetEventLoadMessage(gStringVar4, 1); + sub_8072044(gStringVar4); + ptr = (u8 *)&gMain; + offset1 = offsetof(struct Main, state); + asm("" ::: "r1"); + ptr += offset1; + *ptr = 13; } - if (gMain.newKeys & B_BUTTON) + else if (CheckLanguageMatch()) { - PlaySE(SE_SELECT); - CloseLink(); - gMain.state = 15; + register u8 *ptr2 asm("r1"); + register int offset3 asm("r0"); + register int dummy asm("r2"); + sub_8072044(gSystemText_DontCutLink); + ptr2 = (u8 *)&gMain; + offset3 = offsetof(struct Main, state); + if (dummy) + dummy++; + ptr2 += offset3; + (*ptr2)++; break; } - break; -#endif - case 7: - if (MenuUpdateWindowText()) - gMain.state++; - break; - case 8: - if (GetBlockReceivedStatus()) + else { - ResetBlockReceivedFlags(); - gMain.state++; + CloseLink(); + MenuZeroFillWindowRect(6, 5, 23, 8); + label: + GetEventLoadMessage(gStringVar4, 1); + sub_8072044(gStringVar4); + ptr = (u8 *)&gMain; + offset2 = offsetof(struct Main, state); + ptr += offset2; + *ptr = 13; } break; - case 9: - gMain.state++; + } + if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + CloseLink(); + gMain.state = 15; break; - case 10: - sub_800832C(); + } + break; +#endif + case 7: + if (MenuUpdateWindowText()) gMain.state++; - break; - case 11: - if (gReceivedRemoteLinkPlayers) - break; - unkVal = sub_812613C(unk_2000000); - CpuFill32(0, unk_2000000, 0x7D4); - if (!GetEventLoadMessage(gStringVar4, unkVal)) - TrySavingData(NORMAL_SAVE); + break; + case 8: + if (GetBlockReceivedStatus()) + { + ResetBlockReceivedFlags(); gMain.state++; + } + break; + case 9: + gMain.state++; + break; + case 10: + sub_800832C(); + gMain.state++; + break; + case 11: + if (gReceivedRemoteLinkPlayers) break; - case 12: - sub_8072044(gStringVar4); + unkVal = sub_812613C(unk_2000000); + CpuFill32(0, unk_2000000, 0x7D4); + if (!GetEventLoadMessage(gStringVar4, unkVal)) + TrySavingData(NORMAL_SAVE); + gMain.state++; + break; + case 12: + sub_8072044(gStringVar4); + gMain.state++; + break; + case 13: + MenuZeroFillWindowRect(6, 5, 23, 8); + if (MenuUpdateWindowText()) + { gMain.state++; - break; - case 13: - MenuZeroFillWindowRect(6, 5, 23, 8); - if (MenuUpdateWindowText()) - { - gMain.state++; - gUnknown_02039338 = 0; - } - break; - case 14: - if (gMain.newKeys & A_BUTTON) - { - PlaySE(SE_SELECT); - gMain.state++; - } - break; - case 15: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0); + gUnknown_02039338 = 0; + } + break; + case 14: + if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); gMain.state++; - break; - case 16: - if (!gPaletteFade.active) - DoSoftReset(); - break; + } + break; + case 15: + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0); + gMain.state++; + break; + case 16: + if (!gPaletteFade.active) + DoSoftReset(); + break; } if (gLinkStatus & 0x40) diff --git a/src/option_menu.c b/src/option_menu.c index 613012972..49ad98196 100644 --- a/src/option_menu.c +++ b/src/option_menu.c @@ -93,135 +93,135 @@ void CB2_InitOptionMenu(void) { switch (gMain.state) { - default: - case 0: + default: + case 0: + { + u8 *addr; + u32 size; + + SetVBlankCallback(NULL); + REG_DISPCNT = 0; + REG_BG2CNT = 0; + REG_BG1CNT = 0; + REG_BG0CNT = 0; + REG_BG2HOFS = 0; + REG_BG2VOFS = 0; + REG_BG1HOFS = 0; + REG_BG1VOFS = 0; + REG_BG0HOFS = 0; + REG_BG0VOFS = 0; + addr = (u8 *)VRAM; + size = 0x18000; + while (1) { - u8 *addr; - u32 size; - - SetVBlankCallback(NULL); - REG_DISPCNT = 0; - REG_BG2CNT = 0; - REG_BG1CNT = 0; - REG_BG0CNT = 0; - REG_BG2HOFS = 0; - REG_BG2VOFS = 0; - REG_BG1HOFS = 0; - REG_BG1VOFS = 0; - REG_BG0HOFS = 0; - REG_BG0VOFS = 0; - addr = (u8 *)VRAM; - size = 0x18000; - while (1) + DmaFill16(3, 0, addr, 0x1000); + addr += 0x1000; + size -= 0x1000; + if (size <= 0x1000) { - DmaFill16(3, 0, addr, 0x1000); - addr += 0x1000; - size -= 0x1000; - if (size <= 0x1000) - { - DmaFill16(3, 0, addr, size); - break; - } + DmaFill16(3, 0, addr, size); + break; } - DmaClear32(3, OAM, OAM_SIZE); - DmaClear16(3, PLTT, PLTT_SIZE); - gMain.state++; - break; - } - case 1: - ResetPaletteFade(); - remove_some_task(); - ResetTasks(); - ResetSpriteData(); - gMain.state++; - break; - case 2: - SetUpWindowConfig(&gWindowConfig_81E71B4); - gMain.state++; - break; - case 3: - MultistepInitMenuWindowBegin(&gWindowConfig_81E71B4); - gMain.state++; - break; - case 4: - if (!MultistepInitMenuWindowContinue()) - return; - gMain.state++; - break; - case 5: - LoadPalette(gUnknown_0839F5FC, 0x80, 0x40); - CpuCopy16(gUnknown_0839F63C, (void *)0x0600BEE0, 0x40); - gMain.state++; - break; - case 6: - BeginNormalPaletteFade(-1, 0, 0x10, 0, 0); - gMain.state++; - break; - case 7: - { - u16 savedIme; - - REG_WIN0H = 0; - REG_WIN0V = 0; - REG_WIN1H = 0; - REG_WIN1V = 0; - REG_WININ = 0x1111; - REG_WINOUT = 0x31; - REG_BLDCNT = 0xE1; - REG_BLDALPHA = 0; - REG_BLDY = 7; - savedIme = REG_IME; - REG_IME = 0; - REG_IE |= INTR_FLAG_VBLANK; - REG_IME = savedIme; - REG_DISPSTAT |= DISPSTAT_VBLANK_INTR; - SetVBlankCallback(VBlankCB); - REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | DISPCNT_OBJ_ON | - DISPCNT_WIN0_ON | DISPCNT_WIN1_ON; - gMain.state++; - break; - } - case 8: - { - u8 taskId = CreateTask(Task_OptionMenuFadeIn, 0); - - gTasks[taskId].data[TD_MENUSELECTION] = 0; - gTasks[taskId].data[TD_TEXTSPEED] = gSaveBlock2.optionsTextSpeed; - gTasks[taskId].data[TD_BATTLESCENE] = gSaveBlock2.optionsBattleSceneOff; - gTasks[taskId].data[TD_BATTLESTYLE] = gSaveBlock2.optionsBattleStyle; - gTasks[taskId].data[TD_SOUND] = gSaveBlock2.optionsSound; - gTasks[taskId].data[TD_BUTTONMODE] = gSaveBlock2.optionsButtonMode; - gTasks[taskId].data[TD_FRAMETYPE] = gSaveBlock2.optionsWindowFrameType; - - MenuDrawTextWindow(2, 0, 27, 3); - MenuDrawTextWindow(2, 4, 27, 19); - - MenuPrint(gSystemText_OptionMenu, 4, 1); - MenuPrint(gSystemText_TextSpeed, 4, 5); - MenuPrint(gSystemText_BattleScene, 4, 7); - MenuPrint(gSystemText_BattleStyle, 4, 9); - MenuPrint(gSystemText_Sound, 4, 11); - MenuPrint(gSystemText_ButtonMode, 4, 13); - MenuPrint(gSystemText_Frame, 4, 15); - MenuPrint(gSystemText_Cancel, 4, 17); - - TextSpeed_DrawChoices(gTasks[taskId].data[TD_TEXTSPEED]); - BattleScene_DrawChoices(gTasks[taskId].data[TD_BATTLESCENE]); - BattleStyle_DrawChoices(gTasks[taskId].data[TD_BATTLESTYLE]); - Sound_DrawChoices(gTasks[taskId].data[TD_SOUND]); - ButtonMode_DrawChoices(gTasks[taskId].data[TD_BUTTONMODE]); - FrameType_DrawChoices(gTasks[taskId].data[TD_FRAMETYPE]); - - REG_WIN0H = WIN_RANGE(17, 223); - REG_WIN0V = WIN_RANGE(1, 31); - - HighlightOptionMenuItem(gTasks[taskId].data[TD_MENUSELECTION]); - gMain.state++; - break; } - case 9: - SetMainCallback2(MainCB); + DmaClear32(3, OAM, OAM_SIZE); + DmaClear16(3, PLTT, PLTT_SIZE); + gMain.state++; + break; + } + case 1: + ResetPaletteFade(); + remove_some_task(); + ResetTasks(); + ResetSpriteData(); + gMain.state++; + break; + case 2: + SetUpWindowConfig(&gWindowConfig_81E71B4); + gMain.state++; + break; + case 3: + MultistepInitMenuWindowBegin(&gWindowConfig_81E71B4); + gMain.state++; + break; + case 4: + if (!MultistepInitMenuWindowContinue()) return; + gMain.state++; + break; + case 5: + LoadPalette(gUnknown_0839F5FC, 0x80, 0x40); + CpuCopy16(gUnknown_0839F63C, (void *)0x0600BEE0, 0x40); + gMain.state++; + break; + case 6: + BeginNormalPaletteFade(-1, 0, 0x10, 0, 0); + gMain.state++; + break; + case 7: + { + u16 savedIme; + + REG_WIN0H = 0; + REG_WIN0V = 0; + REG_WIN1H = 0; + REG_WIN1V = 0; + REG_WININ = 0x1111; + REG_WINOUT = 0x31; + REG_BLDCNT = 0xE1; + REG_BLDALPHA = 0; + REG_BLDY = 7; + savedIme = REG_IME; + REG_IME = 0; + REG_IE |= INTR_FLAG_VBLANK; + REG_IME = savedIme; + REG_DISPSTAT |= DISPSTAT_VBLANK_INTR; + SetVBlankCallback(VBlankCB); + REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | DISPCNT_OBJ_ON | + DISPCNT_WIN0_ON | DISPCNT_WIN1_ON; + gMain.state++; + break; + } + case 8: + { + u8 taskId = CreateTask(Task_OptionMenuFadeIn, 0); + + gTasks[taskId].data[TD_MENUSELECTION] = 0; + gTasks[taskId].data[TD_TEXTSPEED] = gSaveBlock2.optionsTextSpeed; + gTasks[taskId].data[TD_BATTLESCENE] = gSaveBlock2.optionsBattleSceneOff; + gTasks[taskId].data[TD_BATTLESTYLE] = gSaveBlock2.optionsBattleStyle; + gTasks[taskId].data[TD_SOUND] = gSaveBlock2.optionsSound; + gTasks[taskId].data[TD_BUTTONMODE] = gSaveBlock2.optionsButtonMode; + gTasks[taskId].data[TD_FRAMETYPE] = gSaveBlock2.optionsWindowFrameType; + + MenuDrawTextWindow(2, 0, 27, 3); + MenuDrawTextWindow(2, 4, 27, 19); + + MenuPrint(gSystemText_OptionMenu, 4, 1); + MenuPrint(gSystemText_TextSpeed, 4, 5); + MenuPrint(gSystemText_BattleScene, 4, 7); + MenuPrint(gSystemText_BattleStyle, 4, 9); + MenuPrint(gSystemText_Sound, 4, 11); + MenuPrint(gSystemText_ButtonMode, 4, 13); + MenuPrint(gSystemText_Frame, 4, 15); + MenuPrint(gSystemText_Cancel, 4, 17); + + TextSpeed_DrawChoices(gTasks[taskId].data[TD_TEXTSPEED]); + BattleScene_DrawChoices(gTasks[taskId].data[TD_BATTLESCENE]); + BattleStyle_DrawChoices(gTasks[taskId].data[TD_BATTLESTYLE]); + Sound_DrawChoices(gTasks[taskId].data[TD_SOUND]); + ButtonMode_DrawChoices(gTasks[taskId].data[TD_BUTTONMODE]); + FrameType_DrawChoices(gTasks[taskId].data[TD_FRAMETYPE]); + + REG_WIN0H = WIN_RANGE(17, 223); + REG_WIN0V = WIN_RANGE(1, 31); + + HighlightOptionMenuItem(gTasks[taskId].data[TD_MENUSELECTION]); + gMain.state++; + break; + } + case 9: + SetMainCallback2(MainCB); + return; } } @@ -264,30 +264,30 @@ static void Task_OptionMenuProcessInput(u8 taskId) { switch (gTasks[taskId].data[TD_MENUSELECTION]) { - case MENUITEM_TEXTSPEED: - gTasks[taskId].data[TD_TEXTSPEED] = TextSpeed_ProcessInput(gTasks[taskId].data[TD_TEXTSPEED]); - TextSpeed_DrawChoices(gTasks[taskId].data[TD_TEXTSPEED]); - break; - case MENUITEM_BATTLESCENE: - gTasks[taskId].data[TD_BATTLESCENE] = BattleScene_ProcessInput(gTasks[taskId].data[TD_BATTLESCENE]); - BattleScene_DrawChoices(gTasks[taskId].data[TD_BATTLESCENE]); - break; - case MENUITEM_BATTLESTYLE: - gTasks[taskId].data[TD_BATTLESTYLE] = BattleStyle_ProcessInput(gTasks[taskId].data[TD_BATTLESTYLE]); - BattleStyle_DrawChoices(gTasks[taskId].data[TD_BATTLESTYLE]); - break; - case MENUITEM_SOUND: - gTasks[taskId].data[TD_SOUND] = Sound_ProcessInput(gTasks[taskId].data[TD_SOUND]); - Sound_DrawChoices(gTasks[taskId].data[TD_SOUND]); - break; - case MENUITEM_BUTTONMODE: - gTasks[taskId].data[TD_BUTTONMODE] = ButtonMode_ProcessInput(gTasks[taskId].data[TD_BUTTONMODE]); - ButtonMode_DrawChoices(gTasks[taskId].data[TD_BUTTONMODE]); - break; - case MENUITEM_FRAMETYPE: - gTasks[taskId].data[TD_FRAMETYPE] = FrameType_ProcessInput(gTasks[taskId].data[TD_FRAMETYPE]); - FrameType_DrawChoices(gTasks[taskId].data[TD_FRAMETYPE]); - break; + case MENUITEM_TEXTSPEED: + gTasks[taskId].data[TD_TEXTSPEED] = TextSpeed_ProcessInput(gTasks[taskId].data[TD_TEXTSPEED]); + TextSpeed_DrawChoices(gTasks[taskId].data[TD_TEXTSPEED]); + break; + case MENUITEM_BATTLESCENE: + gTasks[taskId].data[TD_BATTLESCENE] = BattleScene_ProcessInput(gTasks[taskId].data[TD_BATTLESCENE]); + BattleScene_DrawChoices(gTasks[taskId].data[TD_BATTLESCENE]); + break; + case MENUITEM_BATTLESTYLE: + gTasks[taskId].data[TD_BATTLESTYLE] = BattleStyle_ProcessInput(gTasks[taskId].data[TD_BATTLESTYLE]); + BattleStyle_DrawChoices(gTasks[taskId].data[TD_BATTLESTYLE]); + break; + case MENUITEM_SOUND: + gTasks[taskId].data[TD_SOUND] = Sound_ProcessInput(gTasks[taskId].data[TD_SOUND]); + Sound_DrawChoices(gTasks[taskId].data[TD_SOUND]); + break; + case MENUITEM_BUTTONMODE: + gTasks[taskId].data[TD_BUTTONMODE] = ButtonMode_ProcessInput(gTasks[taskId].data[TD_BUTTONMODE]); + ButtonMode_DrawChoices(gTasks[taskId].data[TD_BUTTONMODE]); + break; + case MENUITEM_FRAMETYPE: + gTasks[taskId].data[TD_FRAMETYPE] = FrameType_ProcessInput(gTasks[taskId].data[TD_FRAMETYPE]); + FrameType_DrawChoices(gTasks[taskId].data[TD_FRAMETYPE]); + break; } } } diff --git a/src/player_pc.c b/src/player_pc.c index f0f0709b1..048c79862 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -784,17 +784,17 @@ void sub_813ABE8(u8 taskId) switch(GetPocketByItemId(gSaveBlock1.pcItems[i].itemId) - 1) { - case 0: - case 1: - case 3: - sub_813AB64((struct ItemSlot *)&gSaveBlock1.pcItems[i], j + 2, tempArg); - break; - case 4: - sub_813AB90((struct ItemSlot *)&gSaveBlock1.pcItems[i], j + 2, tempArg); - break; - case 2: - sub_813ABAC((struct ItemSlot *)&gSaveBlock1.pcItems[i], j + 2, tempArg); - break; + case 0: + case 1: + case 3: + sub_813AB64((struct ItemSlot *)&gSaveBlock1.pcItems[i], j + 2, tempArg); + break; + case 4: + sub_813AB90((struct ItemSlot *)&gSaveBlock1.pcItems[i], j + 2, tempArg); + break; + case 2: + sub_813ABAC((struct ItemSlot *)&gSaveBlock1.pcItems[i], j + 2, tempArg); + break; } } else @@ -809,15 +809,15 @@ beforeLabel: switch(data[1]) { - default: - CreateVerticalScrollIndicators(0, 0xB8, 8); - break; + default: + CreateVerticalScrollIndicators(0, 0xB8, 8); + break; weirdCase: - sub_8072A18(gOtherText_CancelNoTerminator, 0x80, (j + 2) * 8, 0x68, 1); - goto beforeLabel; - case 0: - DestroyVerticalScrollIndicator(0); - break; + sub_8072A18(gOtherText_CancelNoTerminator, 0x80, (j + 2) * 8, 0x68, 1); + goto beforeLabel; + case 0: + DestroyVerticalScrollIndicator(0); + break; } if(data[1] + data[4] <= data[2]) diff --git a/src/pokedex.c b/src/pokedex.c index 5ea1f9938..03a7d916a 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -207,97 +207,97 @@ void CB2_InitPokedex(void) { switch (gMain.state) { - case 0: - default: - { - u8 *addr; - u32 size; + case 0: + default: + { + u8 *addr; + u32 size; - SetVBlankCallback(NULL); - sub_8091060(0); - addr = (u8 *)VRAM; - size = VRAM_SIZE; - while (1) + SetVBlankCallback(NULL); + sub_8091060(0); + addr = (u8 *)VRAM; + size = VRAM_SIZE; + while (1) + { + DmaFill16(3, 0, addr, 0x1000); + addr += 0x1000; + size -= 0x1000; + if (size <= 0x1000) { - DmaFill16(3, 0, addr, 0x1000); - addr += 0x1000; - size -= 0x1000; - if (size <= 0x1000) - { - DmaFill16(3, 0, addr, size); - break; - } + DmaFill16(3, 0, addr, size); + break; } - DmaClear32(3, OAM, OAM_SIZE); - DmaClear16(3, PLTT, PLTT_SIZE); - gMain.state = 1; - break; } + DmaClear32(3, OAM, OAM_SIZE); + DmaClear16(3, PLTT, PLTT_SIZE); + gMain.state = 1; + break; + } + case 1: + remove_some_task(); + ResetTasks(); + ResetSpriteData(); + ResetPaletteFade(); + FreeAllSpritePalettes(); + gReservedSpritePaletteCount = 8; + SetUpWindowConfig(&gWindowConfig_81E7048); + InitMenuWindow(&gWindowConfig_81E7048); + gMain.state++; + break; + case 2: + switch (Random() & 3) + { + case 0: + default: + gPokedexView = (struct PokedexView *)0x02018000; + break; case 1: - remove_some_task(); - ResetTasks(); - ResetSpriteData(); - ResetPaletteFade(); - FreeAllSpritePalettes(); - gReservedSpritePaletteCount = 8; - SetUpWindowConfig(&gWindowConfig_81E7048); - InitMenuWindow(&gWindowConfig_81E7048); - gMain.state++; + gPokedexView = (struct PokedexView *)0x02018800; break; case 2: - switch (Random() & 3) - { - case 0: - default: - gPokedexView = (struct PokedexView *)0x02018000; - break; - case 1: - gPokedexView = (struct PokedexView *)0x02018800; - break; - case 2: - gPokedexView = (struct PokedexView *)0x02019000; - break; - case 3: - gPokedexView = (struct PokedexView *)0x02019800; - break; - } - ClearPokedexView(gPokedexView); - CreateTask(Task_PokedexShowMainScreen, 0); - gPokedexView->dexMode = gSaveBlock2.pokedex.unknown1; - if (!IsNationalPokedexEnabled()) - gPokedexView->dexMode = DEX_MODE_HOENN; - gPokedexView->dexOrder = gSaveBlock2.pokedex.order; - gPokedexView->selectedPokemon = gUnknown_0202FFB8; - gPokedexView->unk62C = gUnknown_0202FFBA; - gPokedexView->selectedScreen = PAGE_SCREEN; - gPokedexView->unk64E = 0; - if (!IsNationalPokedexEnabled()) - { - gPokedexView->unk61A = GetHoennPokedexCount(0); - gPokedexView->unk61C = GetHoennPokedexCount(1); - } - else - { - gPokedexView->unk61A = GetNationalPokedexCount(0); - gPokedexView->unk61C = GetNationalPokedexCount(1); - } - gPokedexView->unk62D = 8; - gMain.state++; + gPokedexView = (struct PokedexView *)0x02019000; break; case 3: + gPokedexView = (struct PokedexView *)0x02019800; + break; + } + ClearPokedexView(gPokedexView); + CreateTask(Task_PokedexShowMainScreen, 0); + gPokedexView->dexMode = gSaveBlock2.pokedex.unknown1; + if (!IsNationalPokedexEnabled()) + gPokedexView->dexMode = DEX_MODE_HOENN; + gPokedexView->dexOrder = gSaveBlock2.pokedex.order; + gPokedexView->selectedPokemon = gUnknown_0202FFB8; + gPokedexView->unk62C = gUnknown_0202FFBA; + gPokedexView->selectedScreen = PAGE_SCREEN; + gPokedexView->unk64E = 0; + if (!IsNationalPokedexEnabled()) { - u16 savedIme; - - savedIme = REG_IME; - REG_IME = 0; - REG_IE |= 1; - REG_IME = savedIme; - REG_DISPSTAT |= 8; - SetVBlankCallback(sub_808C0B8); - SetMainCallback2(MainCB); - SortPokedex(gPokedexView->dexMode, gPokedexView->dexOrder); - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x80); + gPokedexView->unk61A = GetHoennPokedexCount(0); + gPokedexView->unk61C = GetHoennPokedexCount(1); + } + else + { + gPokedexView->unk61A = GetNationalPokedexCount(0); + gPokedexView->unk61C = GetNationalPokedexCount(1); } + gPokedexView->unk62D = 8; + gMain.state++; + break; + case 3: + { + u16 savedIme; + + savedIme = REG_IME; + REG_IME = 0; + REG_IE |= 1; + REG_IME = savedIme; + REG_DISPSTAT |= 8; + SetVBlankCallback(sub_808C0B8); + SetMainCallback2(MainCB); + SortPokedex(gPokedexView->dexMode, gPokedexView->dexOrder); + m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x80); + } } } @@ -423,29 +423,29 @@ void Task_PokedexMainScreenMenu(u8 taskId) { switch (gPokedexView->menuCursorPos) { - case 0: //BACK TO LIST - default: - gMain.newKeys |= START_BUTTON; //Exit menu - break; - case 1: //LIST TOP - gPokedexView->selectedPokemon = 0; - gPokedexView->unk62C = 0x40; - sub_808E82C(); - sub_808E0CC(gPokedexView->selectedPokemon, 0xE); - gMain.newKeys |= START_BUTTON; //Exit menu - break; - case 2: //LIST BOTTOM - gPokedexView->selectedPokemon = gPokedexView->unk60C - 1; - gPokedexView->unk62C = gPokedexView->unk60C * 16 + 0x30; - sub_808E82C(); - sub_808E0CC(gPokedexView->selectedPokemon, 0xE); - gMain.newKeys |= START_BUTTON; //Exit menu - break; - case 3: //CLOSE POKEDEX - BeginNormalPaletteFade(-1, 0, 0, 0x10, 0); - gTasks[taskId].func = Task_ClosePokedex; - PlaySE(SE_PC_OFF); - break; + case 0: //BACK TO LIST + default: + gMain.newKeys |= START_BUTTON; //Exit menu + break; + case 1: //LIST TOP + gPokedexView->selectedPokemon = 0; + gPokedexView->unk62C = 0x40; + sub_808E82C(); + sub_808E0CC(gPokedexView->selectedPokemon, 0xE); + gMain.newKeys |= START_BUTTON; //Exit menu + break; + case 2: //LIST BOTTOM + gPokedexView->selectedPokemon = gPokedexView->unk60C - 1; + gPokedexView->unk62C = gPokedexView->unk60C * 16 + 0x30; + sub_808E82C(); + sub_808E0CC(gPokedexView->selectedPokemon, 0xE); + gMain.newKeys |= START_BUTTON; //Exit menu + break; + case 3: //CLOSE POKEDEX + BeginNormalPaletteFade(-1, 0, 0, 0x10, 0); + gTasks[taskId].func = Task_ClosePokedex; + PlaySE(SE_PC_OFF); + break; } } @@ -614,34 +614,34 @@ void Task_PokedexResultsScreenMenu(u8 taskId) { switch (gPokedexView->menuCursorPos) { - case 0: //BACK TO LIST - default: - gMain.newKeys |= START_BUTTON; - break; - case 1: //LIST TOP - gPokedexView->selectedPokemon = 0; - gPokedexView->unk62C = 0x40; - sub_808E82C(); - sub_808E0CC(gPokedexView->selectedPokemon, 0xE); - gMain.newKeys |= START_BUTTON; - break; - case 2: //LIST BOTTOM - gPokedexView->selectedPokemon = gPokedexView->unk60C - 1; - gPokedexView->unk62C = gPokedexView->unk60C * 16 + 0x30; - sub_808E82C(); - sub_808E0CC(gPokedexView->selectedPokemon, 0xE); - gMain.newKeys |= START_BUTTON; - break; - case 3: //BACK TO POKEDEX - BeginNormalPaletteFade(-1, 0, 0, 0x10, 0); - gTasks[taskId].func = Task_PokedexResultsScreenReturnToMainScreen; - PlaySE(SE_TRACK_DOOR); - break; - case 4: //CLOSE POKEDEX - BeginNormalPaletteFade(-1, 0, 0, 0x10, 0); - gTasks[taskId].func = Task_PokedexResultsScreenExitPokedex; - PlaySE(SE_PC_OFF); - break; + case 0: //BACK TO LIST + default: + gMain.newKeys |= START_BUTTON; + break; + case 1: //LIST TOP + gPokedexView->selectedPokemon = 0; + gPokedexView->unk62C = 0x40; + sub_808E82C(); + sub_808E0CC(gPokedexView->selectedPokemon, 0xE); + gMain.newKeys |= START_BUTTON; + break; + case 2: //LIST BOTTOM + gPokedexView->selectedPokemon = gPokedexView->unk60C - 1; + gPokedexView->unk62C = gPokedexView->unk60C * 16 + 0x30; + sub_808E82C(); + sub_808E0CC(gPokedexView->selectedPokemon, 0xE); + gMain.newKeys |= START_BUTTON; + break; + case 3: //BACK TO POKEDEX + BeginNormalPaletteFade(-1, 0, 0, 0x10, 0); + gTasks[taskId].func = Task_PokedexResultsScreenReturnToMainScreen; + PlaySE(SE_TRACK_DOOR); + break; + case 4: //CLOSE POKEDEX + BeginNormalPaletteFade(-1, 0, 0, 0x10, 0); + gTasks[taskId].func = Task_PokedexResultsScreenExitPokedex; + PlaySE(SE_PC_OFF); + break; } } @@ -726,83 +726,83 @@ bool8 sub_808D344(u8 a) { switch (gMain.state) { - case 0: - default: - if (gPaletteFade.active) - return 0; - //_0808D39E - SetVBlankCallback(NULL); - gPokedexView->unk64A = a; - sub_8091060(0); - REG_BG2VOFS = gPokedexView->unk62D; - LZ77UnCompVram(gPokedexMenu_Gfx, (void *)(VRAM)); - LZ77UnCompVram(gUnknown_08E96738, (void *)(VRAM + 0x6800)); - LZ77UnCompVram(gUnknown_08E9C6DC, (void *)(VRAM + 0x7800)); - DmaClear16(3, VRAM + 0x6000, 0x500); - if (a == 0) - LZ77UnCompVram(gUnknown_08E96888, (void *)(VRAM + 0x6500)); - else - LZ77UnCompVram(gUnknown_08E96994, (void *)(VRAM + 0x6500)); - ResetPaletteFade(); - if (a == 0) - gPokedexView->unk64C_1 = 0; - else - gPokedexView->unk64C_1 = 1; - sub_808D640(); - gMain.state = 1; - break; - case 1: - ResetSpriteData(); - FreeAllSpritePalettes(); - gReservedSpritePaletteCount = 8; - LoadCompressedObjectPic(&gUnknown_083A05CC); - LoadSpritePalettes(gUnknown_083A05DC); - sub_808E978(a); - gMain.state++; - break; - case 2: - SetUpWindowConfig(&gWindowConfig_81E7048); - InitMenuWindow(&gWindowConfig_81E7048); - LZ77UnCompVram(gUnknown_0839FA7C, (void *)(VRAM + 0xFF80)); - gMain.state++; - break; - case 3: - if (a == 0) - SortPokedex(gPokedexView->dexMode, gPokedexView->dexOrder); - sub_808E0CC(gPokedexView->selectedPokemon, 0xE); - gPokedexView->menuIsOpen = 0; - gPokedexView->menuY = 0; - gMain.state++; - break; - case 4: - BeginNormalPaletteFade(-1, 0, 0x10, 0, 0); - SetVBlankCallback(sub_808C0B8); - gMain.state++; - break; - case 5: - REG_WININ = 0x3F3F; - REG_WINOUT = 0x1D3F; - REG_WIN0H = 0; - REG_WIN0V = 0; - REG_WIN1H = 0; - REG_WIN1V = 0; - REG_BLDCNT = 0; - REG_BLDALPHA = 0; - REG_BLDY = 0; - REG_BG3CNT = BGCNT_PRIORITY(3) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(15) | BGCNT_16COLOR | BGCNT_TXT256x256; - REG_BG1CNT = BGCNT_PRIORITY(1) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(13) | BGCNT_16COLOR | BGCNT_TXT256x256; - REG_BG0CNT = BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(12) | BGCNT_16COLOR | BGCNT_TXT256x256; - REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG_ALL_ON | DISPCNT_OBJ_ON | DISPCNT_OBJWIN_ON; - gMain.state++; - break; - case 6: - if (!gPaletteFade.active) - { - gMain.state = 0; - return 1; - } - else - return 0; + case 0: + default: + if (gPaletteFade.active) + return 0; + //_0808D39E + SetVBlankCallback(NULL); + gPokedexView->unk64A = a; + sub_8091060(0); + REG_BG2VOFS = gPokedexView->unk62D; + LZ77UnCompVram(gPokedexMenu_Gfx, (void *)(VRAM)); + LZ77UnCompVram(gUnknown_08E96738, (void *)(VRAM + 0x6800)); + LZ77UnCompVram(gUnknown_08E9C6DC, (void *)(VRAM + 0x7800)); + DmaClear16(3, VRAM + 0x6000, 0x500); + if (a == 0) + LZ77UnCompVram(gUnknown_08E96888, (void *)(VRAM + 0x6500)); + else + LZ77UnCompVram(gUnknown_08E96994, (void *)(VRAM + 0x6500)); + ResetPaletteFade(); + if (a == 0) + gPokedexView->unk64C_1 = 0; + else + gPokedexView->unk64C_1 = 1; + sub_808D640(); + gMain.state = 1; + break; + case 1: + ResetSpriteData(); + FreeAllSpritePalettes(); + gReservedSpritePaletteCount = 8; + LoadCompressedObjectPic(&gUnknown_083A05CC); + LoadSpritePalettes(gUnknown_083A05DC); + sub_808E978(a); + gMain.state++; + break; + case 2: + SetUpWindowConfig(&gWindowConfig_81E7048); + InitMenuWindow(&gWindowConfig_81E7048); + LZ77UnCompVram(gUnknown_0839FA7C, (void *)(VRAM + 0xFF80)); + gMain.state++; + break; + case 3: + if (a == 0) + SortPokedex(gPokedexView->dexMode, gPokedexView->dexOrder); + sub_808E0CC(gPokedexView->selectedPokemon, 0xE); + gPokedexView->menuIsOpen = 0; + gPokedexView->menuY = 0; + gMain.state++; + break; + case 4: + BeginNormalPaletteFade(-1, 0, 0x10, 0, 0); + SetVBlankCallback(sub_808C0B8); + gMain.state++; + break; + case 5: + REG_WININ = 0x3F3F; + REG_WINOUT = 0x1D3F; + REG_WIN0H = 0; + REG_WIN0V = 0; + REG_WIN1H = 0; + REG_WIN1V = 0; + REG_BLDCNT = 0; + REG_BLDALPHA = 0; + REG_BLDY = 0; + REG_BG3CNT = BGCNT_PRIORITY(3) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(15) | BGCNT_16COLOR | BGCNT_TXT256x256; + REG_BG1CNT = BGCNT_PRIORITY(1) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(13) | BGCNT_16COLOR | BGCNT_TXT256x256; + REG_BG0CNT = BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(12) | BGCNT_16COLOR | BGCNT_TXT256x256; + REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG_ALL_ON | DISPCNT_OBJ_ON | DISPCNT_OBJWIN_ON; + gMain.state++; + break; + case 6: + if (!gPaletteFade.active) + { + gMain.state = 0; + return 1; + } + else + return 0; } return 0; } @@ -826,136 +826,136 @@ void SortPokedex(u8 dexMode, u8 sortMode) switch (dexMode) { - default: - case DEX_MODE_HOENN: + default: + case DEX_MODE_HOENN: + vars[0] = 202; + vars[1] = 1; + break; + case DEX_MODE_NATIONAL: + if (IsNationalPokedexEnabled()) + { + vars[0] = 386; + vars[1] = 0; + } + else + { vars[0] = 202; vars[1] = 1; - break; - case DEX_MODE_NATIONAL: - if (IsNationalPokedexEnabled()) - { - vars[0] = 386; - vars[1] = 0; - } - else - { - vars[0] = 202; - vars[1] = 1; - } - break; + } + break; } switch (sortMode) { - case 0: + case 0: + { + if (vars[1]) { - if (vars[1]) + for (i = 0; i < vars[0]; i++) { - for (i = 0; i < vars[0]; i++) - { - vars[2] = HoennToNationalOrder(i + 1); - gPokedexView->unk0[i].dexNum = vars[2]; - gPokedexView->unk0[i].seen = sub_8090D90(vars[2], 0); - gPokedexView->unk0[i].owned = sub_8090D90(vars[2], 1); - if (gPokedexView->unk0[i].seen) - gPokedexView->unk60C = i + 1; - } + vars[2] = HoennToNationalOrder(i + 1); + gPokedexView->unk0[i].dexNum = vars[2]; + gPokedexView->unk0[i].seen = sub_8090D90(vars[2], 0); + gPokedexView->unk0[i].owned = sub_8090D90(vars[2], 1); + if (gPokedexView->unk0[i].seen) + gPokedexView->unk60C = i + 1; } - else - { - bool32 r10; - s16 r5; + } + else + { + bool32 r10; + s16 r5; - r10 = r5 = i = 0; - for (i = 0; i < vars[0]; i++) + r10 = r5 = i = 0; + for (i = 0; i < vars[0]; i++) + { + vars[2] = i + 1; + if (sub_8090D90(vars[2], 0)) + r10 = 1; + if (r10) { - vars[2] = i + 1; - if (sub_8090D90(vars[2], 0)) - r10 = 1; - if (r10) - { - asm(""); //Needed to match for some reason - gPokedexView->unk0[r5].dexNum = vars[2]; - gPokedexView->unk0[r5].seen = sub_8090D90(vars[2], 0); - gPokedexView->unk0[r5].owned = sub_8090D90(vars[2], 1); - if (gPokedexView->unk0[r5].seen) - gPokedexView->unk60C = r5 + 1; - r5++; - } + asm(""); //Needed to match for some reason + gPokedexView->unk0[r5].dexNum = vars[2]; + gPokedexView->unk0[r5].seen = sub_8090D90(vars[2], 0); + gPokedexView->unk0[r5].owned = sub_8090D90(vars[2], 1); + if (gPokedexView->unk0[r5].seen) + gPokedexView->unk60C = r5 + 1; + r5++; } } - break; } - case 1: - for (i = 0; i < 411; i++) - { - vars[2] = gPokedexOrder_Alphabetical[i]; + break; + } + case 1: + for (i = 0; i < 411; i++) + { + vars[2] = gPokedexOrder_Alphabetical[i]; - if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 0)) - { - gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2]; - gPokedexView->unk0[gPokedexView->unk60C].seen = 1; - gPokedexView->unk0[gPokedexView->unk60C].owned = sub_8090D90(vars[2], 1); - gPokedexView->unk60C++; - } - } - break; - case 2: - for (i = 385; i >= 0; i--) + if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 0)) { - vars[2] = gPokedexOrder_Weight[i]; - - if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 1)) - { - gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2]; - gPokedexView->unk0[gPokedexView->unk60C].seen = 1; - gPokedexView->unk0[gPokedexView->unk60C].owned = 1; - gPokedexView->unk60C++; - } + gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2]; + gPokedexView->unk0[gPokedexView->unk60C].seen = 1; + gPokedexView->unk0[gPokedexView->unk60C].owned = sub_8090D90(vars[2], 1); + gPokedexView->unk60C++; } - break; - case 3: - for (i = 0; i < 386; i++) - { - vars[2] = gPokedexOrder_Weight[i]; + } + break; + case 2: + for (i = 385; i >= 0; i--) + { + vars[2] = gPokedexOrder_Weight[i]; - if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 1)) - { - gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2]; - gPokedexView->unk0[gPokedexView->unk60C].seen = 1; - gPokedexView->unk0[gPokedexView->unk60C].owned = 1; - gPokedexView->unk60C++; - } - } - break; - case 4: - for (i = 385; i >=0; i--) + if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 1)) { - vars[2] = gPokedexOrder_Height[i]; + gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2]; + gPokedexView->unk0[gPokedexView->unk60C].seen = 1; + gPokedexView->unk0[gPokedexView->unk60C].owned = 1; + gPokedexView->unk60C++; + } + } + break; + case 3: + for (i = 0; i < 386; i++) + { + vars[2] = gPokedexOrder_Weight[i]; - if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 1)) - { - gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2]; - gPokedexView->unk0[gPokedexView->unk60C].seen = 1; - gPokedexView->unk0[gPokedexView->unk60C].owned = 1; - gPokedexView->unk60C++; - } + if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 1)) + { + gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2]; + gPokedexView->unk0[gPokedexView->unk60C].seen = 1; + gPokedexView->unk0[gPokedexView->unk60C].owned = 1; + gPokedexView->unk60C++; } - break; - case 5: - for (i = 0; i < 386; i++) + } + break; + case 4: + for (i = 385; i >=0; i--) + { + vars[2] = gPokedexOrder_Height[i]; + + if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 1)) { - vars[2] = gPokedexOrder_Height[i]; + gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2]; + gPokedexView->unk0[gPokedexView->unk60C].seen = 1; + gPokedexView->unk0[gPokedexView->unk60C].owned = 1; + gPokedexView->unk60C++; + } + } + break; + case 5: + for (i = 0; i < 386; i++) + { + vars[2] = gPokedexOrder_Height[i]; - if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 1)) - { - gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2]; - gPokedexView->unk0[gPokedexView->unk60C].seen = 1; - gPokedexView->unk0[gPokedexView->unk60C].owned = 1; - gPokedexView->unk60C++; - } + if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 1)) + { + gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2]; + gPokedexView->unk0[gPokedexView->unk60C].seen = 1; + gPokedexView->unk0[gPokedexView->unk60C].owned = 1; + gPokedexView->unk60C++; } - break; + } + break; } for (i = gPokedexView->unk60C; i < 386; i++) { @@ -969,87 +969,87 @@ void sub_808DBE8(u8 a, u16 b, u16 c) { switch (a) { - case 0: - default: - { - u16 i; - s16 _b = b - 5; + case 0: + default: + { + u16 i; + s16 _b = b - 5; - for (i = 0; i <= 10; i++) - { - if ((u16)_b > 385 || gPokedexView->unk0[_b].dexNum == 0xFFFF) - sub_808E090(0x11, i * 2, c); - else - { - sub_808E090(0x11, i * 2, c); - if (gPokedexView->unk0[_b].seen) - { - sub_808DEB0(_b, 0x12, i * 2, c); - sub_808DF88(gPokedexView->unk0[_b].owned, 0x11, i * 2, c); - sub_808DFE4(gPokedexView->unk0[_b].dexNum, 0x17, i * 2); - } - else - { - sub_808DEB0(_b, 0x12, i * 2, c); - sub_808DF88(0, 0x11, i * 2, c); - sub_808DFE4(0, 0x17, i * 2); - } - } - _b++; - } - break; - } - case 1: + for (i = 0; i <= 10; i++) { - s16 _b = b - 5; - if ((u16)_b > 385 || gPokedexView->unk0[_b].dexNum == 0xFFFF) - sub_808E090(0x11, gPokedexView->unk630 * 2, c); + sub_808E090(0x11, i * 2, c); else { - sub_808E090(0x11, gPokedexView->unk630 * 2, c); + sub_808E090(0x11, i * 2, c); if (gPokedexView->unk0[_b].seen) { - sub_808DEB0(_b, 0x12, gPokedexView->unk630 * 2, c); - sub_808DF88(gPokedexView->unk0[_b].owned, 0x11, gPokedexView->unk630 * 2, c); - sub_808DFE4(gPokedexView->unk0[_b].dexNum, 0x17, gPokedexView->unk630 * 2); + sub_808DEB0(_b, 0x12, i * 2, c); + sub_808DF88(gPokedexView->unk0[_b].owned, 0x11, i * 2, c); + sub_808DFE4(gPokedexView->unk0[_b].dexNum, 0x17, i * 2); } else { - sub_808DEB0(_b, 0x12, gPokedexView->unk630 * 2, c); - sub_808DF88(0, 0x11, gPokedexView->unk630 * 2, c); - sub_808DFE4(0, 0x17, gPokedexView->unk630 * 2); + sub_808DEB0(_b, 0x12, i * 2, c); + sub_808DF88(0, 0x11, i * 2, c); + sub_808DFE4(0, 0x17, i * 2); } } - break; + _b++; } - case 2: + break; + } + case 1: + { + s16 _b = b - 5; + + if ((u16)_b > 385 || gPokedexView->unk0[_b].dexNum == 0xFFFF) + sub_808E090(0x11, gPokedexView->unk630 * 2, c); + else { - s16 _b = b + 5; - u16 r2 = gPokedexView->unk630 + 10; + sub_808E090(0x11, gPokedexView->unk630 * 2, c); + if (gPokedexView->unk0[_b].seen) + { + sub_808DEB0(_b, 0x12, gPokedexView->unk630 * 2, c); + sub_808DF88(gPokedexView->unk0[_b].owned, 0x11, gPokedexView->unk630 * 2, c); + sub_808DFE4(gPokedexView->unk0[_b].dexNum, 0x17, gPokedexView->unk630 * 2); + } + else + { + sub_808DEB0(_b, 0x12, gPokedexView->unk630 * 2, c); + sub_808DF88(0, 0x11, gPokedexView->unk630 * 2, c); + sub_808DFE4(0, 0x17, gPokedexView->unk630 * 2); + } + } + break; + } + case 2: + { + s16 _b = b + 5; + u16 r2 = gPokedexView->unk630 + 10; - if (r2 > 15) - r2 -= 16; - if ((u16)_b > 385 || gPokedexView->unk0[_b].dexNum == 0xFFFF) - sub_808E090(0x11, r2 * 2, c); + if (r2 > 15) + r2 -= 16; + if ((u16)_b > 385 || gPokedexView->unk0[_b].dexNum == 0xFFFF) + sub_808E090(0x11, r2 * 2, c); + else + { + sub_808E090(0x11, r2 * 2, c); + if (gPokedexView->unk0[_b].seen) + { + sub_808DEB0(_b, 0x12, r2 * 2, c); + sub_808DF88(gPokedexView->unk0[_b].owned, 0x11, r2 * 2, c); + sub_808DFE4(gPokedexView->unk0[_b].dexNum, 0x17, r2 * 2); + } else { - sub_808E090(0x11, r2 * 2, c); - if (gPokedexView->unk0[_b].seen) - { - sub_808DEB0(_b, 0x12, r2 * 2, c); - sub_808DF88(gPokedexView->unk0[_b].owned, 0x11, r2 * 2, c); - sub_808DFE4(gPokedexView->unk0[_b].dexNum, 0x17, r2 * 2); - } - else - { - sub_808DEB0(_b, 0x12, r2 * 2, c); - sub_808DF88(0, 0x11, r2 * 2, c); - sub_808DFE4(0, 0x17, r2 * 2); - } + sub_808DEB0(_b, 0x12, r2 * 2, c); + sub_808DF88(0, 0x11, r2 * 2, c); + sub_808DFE4(0, 0x17, r2 * 2); } - break; } + break; + } } } @@ -1268,26 +1268,26 @@ bool8 sub_808E208(u8 a, u8 b, u8 c) gPokedexView->unk62E--; switch (a) { - case 1: - for (i = 0; i < 4; i++) - { - if (gPokedexView->unk61E[i] != 0xFFFF) - gSprites[gPokedexView->unk61E[i]].data5 += b; - } - foo = 16 * (c - gPokedexView->unk62E) / c; - REG_BG2VOFS = gPokedexView->unk62D + gPokedexView->unk632 * 16 - foo; - gPokedexView->unk62C -= gPokedexView->unk628; - break; - case 2: - for (i = 0; i < 4; i++) - { - if (gPokedexView->unk61E[i] != 0xFFFF) - gSprites[gPokedexView->unk61E[i]].data5 -= b; - } - foo = 16 * (c - gPokedexView->unk62E) / c; - REG_BG2VOFS = gPokedexView->unk62D + gPokedexView->unk632 * 16 + foo; - gPokedexView->unk62C += gPokedexView->unk628; - break; + case 1: + for (i = 0; i < 4; i++) + { + if (gPokedexView->unk61E[i] != 0xFFFF) + gSprites[gPokedexView->unk61E[i]].data5 += b; + } + foo = 16 * (c - gPokedexView->unk62E) / c; + REG_BG2VOFS = gPokedexView->unk62D + gPokedexView->unk632 * 16 - foo; + gPokedexView->unk62C -= gPokedexView->unk628; + break; + case 2: + for (i = 0; i < 4; i++) + { + if (gPokedexView->unk61E[i] != 0xFFFF) + gSprites[gPokedexView->unk61E[i]].data5 -= b; + } + foo = 16 * (c - gPokedexView->unk62E) / c; + REG_BG2VOFS = gPokedexView->unk62D + gPokedexView->unk632 * 16 + foo; + gPokedexView->unk62C += gPokedexView->unk628; + break; } return 0; } @@ -1307,36 +1307,36 @@ void sub_808E398(u8 a, u16 b) gPokedexView->unk632 = gPokedexView->unk630; switch (a) { - case 1: + case 1: + { + unk = sub_808E888(b - 1); + if (unk != 0xFFFF) { - unk = sub_808E888(b - 1); - if (unk != 0xFFFF) - { - spriteId = sub_808E8C8(unk, 0x60, 0x50); - gSprites[spriteId].callback = sub_808EE28; - gSprites[spriteId].data5 = 0xFFC0; - } - if (gPokedexView->unk630 > 0) - gPokedexView->unk630--; - else - gPokedexView->unk630 = 0xF; - break; + spriteId = sub_808E8C8(unk, 0x60, 0x50); + gSprites[spriteId].callback = sub_808EE28; + gSprites[spriteId].data5 = 0xFFC0; } - case 2: + if (gPokedexView->unk630 > 0) + gPokedexView->unk630--; + else + gPokedexView->unk630 = 0xF; + break; + } + case 2: + { + unk = sub_808E888(b + 1); + if (unk != 0xFFFF) { - unk = sub_808E888(b + 1); - if (unk != 0xFFFF) - { - spriteId = sub_808E8C8(unk, 0x60, 0x50); - gSprites[spriteId].callback = sub_808EE28; - gSprites[spriteId].data5 = 0x40; - } - if (gPokedexView->unk630 <= 0xE) - gPokedexView->unk630++; - else - gPokedexView->unk630 = 0; - break; + spriteId = sub_808E8C8(unk, 0x60, 0x50); + gSprites[spriteId].callback = sub_808EE28; + gSprites[spriteId].data5 = 0x40; } + if (gPokedexView->unk630 <= 0xE) + gPokedexView->unk630++; + else + gPokedexView->unk630 = 0; + break; + } } } #ifdef NONMATCHING @@ -2206,126 +2206,126 @@ void Task_InitPageScreenMultistep(u8 taskId) { switch (gMain.state) { - case 0: - default: - if (!gPaletteFade.active) - { - u16 r2; - - gPokedexView->unk64A = 1; - gPokedexView->unk64E = 0; - gUnknown_03005CEC = gMain.vblankCallback; - SetVBlankCallback(NULL); - r2 = 0; - if (gTasks[taskId].data[1] != 0) - r2 += 0x1000; - if (gTasks[taskId].data[2] != 0) - r2 |= 0x200; - sub_8091060(r2); - gMain.state = 1; - } - break; - case 1: - LZ77UnCompVram(gPokedexMenu_Gfx, (void *)VRAM); - LZ77UnCompVram(gUnknown_08E96BD4, (void *)(VRAM + 0x7800)); - sub_8091738(gUnknown_0202FFBC->dexNum, 2, 0x3FC); - gMain.state++; - break; - case 2: - sub_80904FC(0xD); - sub_8090584(gPokedexView->selectedScreen, 0xD); - sub_808D640(); - gMain.state++; - break; - case 3: - SetUpWindowConfig(&gWindowConfig_81E7064); - InitMenuWindow(&gWindowConfig_81E7064); - gMain.state++; - break; - case 4: - if (gPokedexView->dexMode == DEX_MODE_HOENN) - sub_8091154(NationalToHoennOrder(gUnknown_0202FFBC->dexNum), 0xD, 3); - else - sub_8091154(gUnknown_0202FFBC->dexNum, 0xD, 3); - //_0808F45A - sub_80911C8(gUnknown_0202FFBC->dexNum, 0x10, 3); - MenuPrint(gDexText_UnknownPoke, 11, 5); - MenuPrint(gDexText_UnknownHeight, 16, 7); - MenuPrint(gDexText_UnknownWeight, 16, 9); - if (gUnknown_0202FFBC->owned) - { - sub_8091304(gPokedexEntries[gUnknown_0202FFBC->dexNum].categoryName, 11, 5); - sub_8091458(gPokedexEntries[gUnknown_0202FFBC->dexNum].height, 16, 7); - sub_8091564(gPokedexEntries[gUnknown_0202FFBC->dexNum].weight, 16, 9); - MenuPrint(gPokedexEntries[gUnknown_0202FFBC->dexNum].descriptionPage1, 2, 13); - sub_80917CC(14, 0x3FC); - } - //_0808F50C - else - { - MenuPrint(gUnknown_083A05F8, 2, 13); - LoadPalette(gPlttBufferUnfaded + 1, 0x31, 0x1E); - } - gMain.state++; - break; - case 5: - if (gTasks[taskId].data[1] == 0) - { - //_0808F540 - gTasks[taskId].data[4] = (u16)sub_80918EC(gUnknown_0202FFBC->dexNum, 0x30, 0x38, 0); - gSprites[gTasks[taskId].data[4]].oam.priority = 0; - } - gMain.state++; - break; - case 6: + case 0: + default: + if (!gPaletteFade.active) { - u32 r3 = 0; + u16 r2; - if (gTasks[taskId].data[2] != 0) - r3 = 0x14; + gPokedexView->unk64A = 1; + gPokedexView->unk64E = 0; + gUnknown_03005CEC = gMain.vblankCallback; + SetVBlankCallback(NULL); + r2 = 0; if (gTasks[taskId].data[1] != 0) - { - r3 |= (1 << (gSprites[gTasks[taskId].data[4]].oam.paletteNum + 0x10)); - } - BeginNormalPaletteFade(~r3, 0, 0x10, 0, 0); - SetVBlankCallback(gUnknown_03005CEC); - gMain.state++; - break; + r2 += 0x1000; + if (gTasks[taskId].data[2] != 0) + r2 |= 0x200; + sub_8091060(r2); + gMain.state = 1; } - case 7: - REG_BLDCNT = 0; - REG_BLDALPHA = 0; - REG_BLDY = 0; - REG_BG3CNT = BGCNT_PRIORITY(3) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(15) | BGCNT_16COLOR | BGCNT_TXT256x256; - REG_BG1CNT = BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(13) | BGCNT_16COLOR | BGCNT_TXT256x256; - REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG1_ON | DISPCNT_BG2_ON | DISPCNT_BG3_ON | DISPCNT_OBJ_ON; + break; + case 1: + LZ77UnCompVram(gPokedexMenu_Gfx, (void *)VRAM); + LZ77UnCompVram(gUnknown_08E96BD4, (void *)(VRAM + 0x7800)); + sub_8091738(gUnknown_0202FFBC->dexNum, 2, 0x3FC); + gMain.state++; + break; + case 2: + sub_80904FC(0xD); + sub_8090584(gPokedexView->selectedScreen, 0xD); + sub_808D640(); + gMain.state++; + break; + case 3: + SetUpWindowConfig(&gWindowConfig_81E7064); + InitMenuWindow(&gWindowConfig_81E7064); + gMain.state++; + break; + case 4: + if (gPokedexView->dexMode == DEX_MODE_HOENN) + sub_8091154(NationalToHoennOrder(gUnknown_0202FFBC->dexNum), 0xD, 3); + else + sub_8091154(gUnknown_0202FFBC->dexNum, 0xD, 3); + //_0808F45A + sub_80911C8(gUnknown_0202FFBC->dexNum, 0x10, 3); + MenuPrint(gDexText_UnknownPoke, 11, 5); + MenuPrint(gDexText_UnknownHeight, 16, 7); + MenuPrint(gDexText_UnknownWeight, 16, 9); + if (gUnknown_0202FFBC->owned) + { + sub_8091304(gPokedexEntries[gUnknown_0202FFBC->dexNum].categoryName, 11, 5); + sub_8091458(gPokedexEntries[gUnknown_0202FFBC->dexNum].height, 16, 7); + sub_8091564(gPokedexEntries[gUnknown_0202FFBC->dexNum].weight, 16, 9); + MenuPrint(gPokedexEntries[gUnknown_0202FFBC->dexNum].descriptionPage1, 2, 13); + sub_80917CC(14, 0x3FC); + } + //_0808F50C + else + { + MenuPrint(gUnknown_083A05F8, 2, 13); + LoadPalette(gPlttBufferUnfaded + 1, 0x31, 0x1E); + } + gMain.state++; + break; + case 5: + if (gTasks[taskId].data[1] == 0) + { + //_0808F540 + gTasks[taskId].data[4] = (u16)sub_80918EC(gUnknown_0202FFBC->dexNum, 0x30, 0x38, 0); + gSprites[gTasks[taskId].data[4]].oam.priority = 0; + } + gMain.state++; + break; + case 6: + { + u32 r3 = 0; + + if (gTasks[taskId].data[2] != 0) + r3 = 0x14; + if (gTasks[taskId].data[1] != 0) + { + r3 |= (1 << (gSprites[gTasks[taskId].data[4]].oam.paletteNum + 0x10)); + } + BeginNormalPaletteFade(~r3, 0, 0x10, 0, 0); + SetVBlankCallback(gUnknown_03005CEC); + gMain.state++; + break; + } + case 7: + REG_BLDCNT = 0; + REG_BLDALPHA = 0; + REG_BLDY = 0; + REG_BG3CNT = BGCNT_PRIORITY(3) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(15) | BGCNT_16COLOR | BGCNT_TXT256x256; + REG_BG1CNT = BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(13) | BGCNT_16COLOR | BGCNT_TXT256x256; + REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG1_ON | DISPCNT_BG2_ON | DISPCNT_BG3_ON | DISPCNT_OBJ_ON; + gMain.state++; + break; + case 8: + if (!gPaletteFade.active) + { gMain.state++; - break; - case 8: - if (!gPaletteFade.active) + if (gTasks[taskId].data[3] == 0) { - gMain.state++; - if (gTasks[taskId].data[3] == 0) - { - StopCryAndClearCrySongs(); - PlayCry2(NationalPokedexNumToSpecies(gUnknown_0202FFBC->dexNum), 0, 0x7D, 0xA); - } - else - gMain.state++; + StopCryAndClearCrySongs(); + PlayCry2(NationalPokedexNumToSpecies(gUnknown_0202FFBC->dexNum), 0, 0x7D, 0xA); } - break; - case 9: - if (!IsCryPlayingOrClearCrySongs()) + else gMain.state++; - break; - case 10: - gTasks[taskId].data[0] = 0; - gTasks[taskId].data[1] = 0; - gTasks[taskId].data[2] = 1; - gTasks[taskId].data[3] = 1; - gTasks[taskId].func = Task_PageScreenProcessInput; - gMain.state = 0; - break; + } + break; + case 9: + if (!IsCryPlayingOrClearCrySongs()) + gMain.state++; + break; + case 10: + gTasks[taskId].data[0] = 0; + gTasks[taskId].data[1] = 0; + gTasks[taskId].data[2] = 1; + gTasks[taskId].data[3] = 1; + gTasks[taskId].func = Task_PageScreenProcessInput; + gMain.state = 0; + break; } } @@ -2462,99 +2462,99 @@ void Task_InitCryScreenMultistep(u8 taskId) { switch (gMain.state) { - case 0: - default: - if (!gPaletteFade.active) - { - m4aMPlayStop(&gMPlay_BGM); - gPokedexView->unk64A = 6; - gUnknown_03005CEC = gMain.vblankCallback; - SetVBlankCallback(NULL); - sub_8091060(0x200); - gPokedexView->selectedScreen = CRY_SCREEN; - gMain.state = 1; - } - break; - case 1: - LZ77UnCompVram(gPokedexMenu_Gfx, (void *)VRAM); - LZ77UnCompVram(gUnknown_0839F8A0, (void *)(VRAM + 0x7000)); - gMain.state++; - break; - case 2: - sub_8090540(0xD); - sub_8090644(2, 0xD); - sub_808D640(); - DmaClear16(3, (void *)(VRAM + 0xF800), 0x500); - gMain.state++; - break; - case 3: - SetUpWindowConfig(&gWindowConfig_81E702C); - InitMenuWindow(&gWindowConfig_81E702C); - ResetPaletteFade(); - gMain.state++; - break; - case 4: - MenuPrint(gDexText_CryOf, 10, 4); - sub_8091260(gUnknown_0202FFBC->dexNum, 10, 6, 2); - gMain.state++; - break; - case 5: - gTasks[taskId].data[4] = sub_80918EC(gUnknown_0202FFBC->dexNum, 0x30, 0x38, 0); - gSprites[gTasks[taskId].data[4]].oam.priority = 0; - gUnknown_03005E98 = 0; - gMain.state++; - break; - case 6: + case 0: + default: + if (!gPaletteFade.active) { - struct CryRelatedStruct sp8; - - sp8.unk0 = 0x4020; - sp8.unk2 = 0x1F; - sp8.paletteNo = 8; - sp8.yPos = 0x1E; - sp8.xPos = 0xC; - if (sub_8119E3C(&sp8, 0) != 0) - { - gMain.state++; - gUnknown_03005E98 = 0; - } - break; + m4aMPlayStop(&gMPlay_BGM); + gPokedexView->unk64A = 6; + gUnknown_03005CEC = gMain.vblankCallback; + SetVBlankCallback(NULL); + sub_8091060(0x200); + gPokedexView->selectedScreen = CRY_SCREEN; + gMain.state = 1; } - case 7: - { - struct CryRelatedStruct sp10; + break; + case 1: + LZ77UnCompVram(gPokedexMenu_Gfx, (void *)VRAM); + LZ77UnCompVram(gUnknown_0839F8A0, (void *)(VRAM + 0x7000)); + gMain.state++; + break; + case 2: + sub_8090540(0xD); + sub_8090644(2, 0xD); + sub_808D640(); + DmaClear16(3, (void *)(VRAM + 0xF800), 0x500); + gMain.state++; + break; + case 3: + SetUpWindowConfig(&gWindowConfig_81E702C); + InitMenuWindow(&gWindowConfig_81E702C); + ResetPaletteFade(); + gMain.state++; + break; + case 4: + MenuPrint(gDexText_CryOf, 10, 4); + sub_8091260(gUnknown_0202FFBC->dexNum, 10, 6, 2); + gMain.state++; + break; + case 5: + gTasks[taskId].data[4] = sub_80918EC(gUnknown_0202FFBC->dexNum, 0x30, 0x38, 0); + gSprites[gTasks[taskId].data[4]].oam.priority = 0; + gUnknown_03005E98 = 0; + gMain.state++; + break; + case 6: + { + struct CryRelatedStruct sp8; - sp10.unk0 = 0x3000; - sp10.unk2 = 0xE; - sp10.paletteNo = 9; - sp10.xPos = 0x12; - sp10.yPos = 3; - if (ShowPokedexCryScreen(&sp10, 1) != 0) - { - gMain.state++; - } - break; - } - case 8: - BeginNormalPaletteFade(-0x15, 0, 0x10, 0, 0); - SetVBlankCallback(gUnknown_03005CEC); + sp8.unk0 = 0x4020; + sp8.unk2 = 0x1F; + sp8.paletteNo = 8; + sp8.yPos = 0x1E; + sp8.xPos = 0xC; + if (sub_8119E3C(&sp8, 0) != 0) + { gMain.state++; - break; - case 9: - REG_BLDCNT = 0; - REG_BLDALPHA = 0; - REG_BLDY = 0; - REG_BG2CNT = BGCNT_PRIORITY(2) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(14) | BGCNT_16COLOR | BGCNT_TXT256x256; - REG_BG0CNT = BGCNT_PRIORITY(3) | BGCNT_CHARBASE(1) | BGCNT_SCREENBASE(31) | BGCNT_16COLOR | BGCNT_TXT256x256; - REG_BG1CNT = BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(13) | BGCNT_16COLOR | BGCNT_TXT256x256; - REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG_ALL_ON | DISPCNT_OBJ_ON; + gUnknown_03005E98 = 0; + } + break; + } + case 7: + { + struct CryRelatedStruct sp10; + + sp10.unk0 = 0x3000; + sp10.unk2 = 0xE; + sp10.paletteNo = 9; + sp10.xPos = 0x12; + sp10.yPos = 3; + if (ShowPokedexCryScreen(&sp10, 1) != 0) + { gMain.state++; - break; - case 10: - gPokedexView->unk64F = 0; - gMain.state = 0; - gTasks[taskId].func = Task_CryScreenProcessInput; - break; + } + break; + } + case 8: + BeginNormalPaletteFade(-0x15, 0, 0x10, 0, 0); + SetVBlankCallback(gUnknown_03005CEC); + gMain.state++; + break; + case 9: + REG_BLDCNT = 0; + REG_BLDALPHA = 0; + REG_BLDY = 0; + REG_BG2CNT = BGCNT_PRIORITY(2) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(14) | BGCNT_16COLOR | BGCNT_TXT256x256; + REG_BG0CNT = BGCNT_PRIORITY(3) | BGCNT_CHARBASE(1) | BGCNT_SCREENBASE(31) | BGCNT_16COLOR | BGCNT_TXT256x256; + REG_BG1CNT = BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(13) | BGCNT_16COLOR | BGCNT_TXT256x256; + REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG_ALL_ON | DISPCNT_OBJ_ON; + gMain.state++; + break; + case 10: + gPokedexView->unk64F = 0; + gMain.state = 0; + gTasks[taskId].func = Task_CryScreenProcessInput; + break; } } @@ -2616,15 +2616,15 @@ void sub_808FFBC(u8 taskId) DestroyCryMeterNeedleSprite(); switch (gPokedexView->unk64F) { - default: - case 1: - gTasks[taskId].func = Task_InitPageScreenMultistep; - break; - case 2: - gTasks[taskId].func = Task_InitAreaScreenMultistep; - break; - case 3: - gTasks[taskId].func = Task_InitSizeScreenMultistep; + default: + case 1: + gTasks[taskId].func = Task_InitPageScreenMultistep; + break; + case 2: + gTasks[taskId].func = Task_InitAreaScreenMultistep; + break; + case 3: + gTasks[taskId].func = Task_InitSizeScreenMultistep; } } } @@ -2646,87 +2646,87 @@ void Task_InitSizeScreenMultistep(u8 taskId) switch (gMain.state) { - default: - case 0: - if (!gPaletteFade.active) - { - gPokedexView->unk64A = 7; - gUnknown_03005CEC = gMain.vblankCallback; - SetVBlankCallback(NULL); - sub_8091060(0x200); - gPokedexView->selectedScreen = SIZE_SCREEN; - gMain.state = 1; - } - break; - case 1: - LZ77UnCompVram(gPokedexMenu_Gfx, (void *)VRAM); - LZ77UnCompVram(gUnknown_0839F988, (void *)(VRAM + 0x7000)); - gMain.state++; - break; - case 2: - sub_8090540(0xD); - sub_8090644(3, 0xD); - sub_808D640(); - gMain.state++; - break; - case 3: + default: + case 0: + if (!gPaletteFade.active) { - u8 string[40]; //I hope this is the correct size + gPokedexView->unk64A = 7; + gUnknown_03005CEC = gMain.vblankCallback; + SetVBlankCallback(NULL); + sub_8091060(0x200); + gPokedexView->selectedScreen = SIZE_SCREEN; + gMain.state = 1; + } + break; + case 1: + LZ77UnCompVram(gPokedexMenu_Gfx, (void *)VRAM); + LZ77UnCompVram(gUnknown_0839F988, (void *)(VRAM + 0x7000)); + gMain.state++; + break; + case 2: + sub_8090540(0xD); + sub_8090644(3, 0xD); + sub_808D640(); + gMain.state++; + break; + case 3: + { + u8 string[40]; //I hope this is the correct size - SetUpWindowConfig(&gWindowConfig_81E702C); - InitMenuWindow(&gWindowConfig_81E702C); - string[0] = EOS; - StringAppend(string, gDexText_SizeComparedTo); - StringAppend(string, gSaveBlock2.playerName); - sub_8072BD8(string, 3, 15, 0xC0); - gMain.state++; - break; + SetUpWindowConfig(&gWindowConfig_81E702C); + InitMenuWindow(&gWindowConfig_81E702C); + string[0] = EOS; + StringAppend(string, gDexText_SizeComparedTo); + StringAppend(string, gSaveBlock2.playerName); + sub_8072BD8(string, 3, 15, 0xC0); + gMain.state++; + break; + } + case 4: + ResetPaletteFade(); + gMain.state++; + break; + case 5: + spriteId = sub_8091A4C(gSaveBlock2.playerGender, 0x98, 0x38, 0); + gSprites[spriteId].oam.affineMode = 1; + gSprites[spriteId].oam.matrixNum = 1; + gSprites[spriteId].oam.priority = 0; + gSprites[spriteId].pos2.y = gPokedexEntries[gUnknown_0202FFBC->dexNum].trainerOffset; + SetOamMatrix(1, gPokedexEntries[gUnknown_0202FFBC->dexNum].trainerScale, 0, 0, gPokedexEntries[gUnknown_0202FFBC->dexNum].trainerScale); + LoadPalette(gUnknown_083B4EC4, (gSprites[spriteId].oam.paletteNum + 16) * 16, 0x20); + gMain.state++; + break; + case 6: + spriteId = sub_80918EC(gUnknown_0202FFBC->dexNum, 0x58, 0x38, 1); + gSprites[spriteId].oam.affineMode = 1; + gSprites[spriteId].oam.matrixNum = 2; + gSprites[spriteId].oam.priority = 0; + gSprites[spriteId].pos2.y = gPokedexEntries[gUnknown_0202FFBC->dexNum].pokemonOffset; + SetOamMatrix(2, gPokedexEntries[gUnknown_0202FFBC->dexNum].pokemonScale, 0, 0, gPokedexEntries[gUnknown_0202FFBC->dexNum].pokemonScale); + LoadPalette(gUnknown_083B4EC4, (gSprites[spriteId].oam.paletteNum + 16) * 16, 0x20); + gMain.state++; + break; + case 7: + BeginNormalPaletteFade(-0x15, 0, 0x10, 0, 0); + SetVBlankCallback(gUnknown_03005CEC); + gMain.state++; + break; + case 8: + REG_BLDCNT = 0; + REG_BLDALPHA = 0; + REG_BLDY = 0; + REG_BG2CNT = BGCNT_PRIORITY(3) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(14) | BGCNT_16COLOR | BGCNT_TXT256x256; + REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG1_ON | DISPCNT_BG2_ON | DISPCNT_BG3_ON | DISPCNT_OBJ_ON; + gMain.state++; + break; + case 9: + if (!gPaletteFade.active) + { + gPokedexView->unk64F = 0; + gMain.state = 0; + gTasks[taskId].func = Task_SizeScreenProcessInput; } - case 4: - ResetPaletteFade(); - gMain.state++; - break; - case 5: - spriteId = sub_8091A4C(gSaveBlock2.playerGender, 0x98, 0x38, 0); - gSprites[spriteId].oam.affineMode = 1; - gSprites[spriteId].oam.matrixNum = 1; - gSprites[spriteId].oam.priority = 0; - gSprites[spriteId].pos2.y = gPokedexEntries[gUnknown_0202FFBC->dexNum].trainerOffset; - SetOamMatrix(1, gPokedexEntries[gUnknown_0202FFBC->dexNum].trainerScale, 0, 0, gPokedexEntries[gUnknown_0202FFBC->dexNum].trainerScale); - LoadPalette(gUnknown_083B4EC4, (gSprites[spriteId].oam.paletteNum + 16) * 16, 0x20); - gMain.state++; - break; - case 6: - spriteId = sub_80918EC(gUnknown_0202FFBC->dexNum, 0x58, 0x38, 1); - gSprites[spriteId].oam.affineMode = 1; - gSprites[spriteId].oam.matrixNum = 2; - gSprites[spriteId].oam.priority = 0; - gSprites[spriteId].pos2.y = gPokedexEntries[gUnknown_0202FFBC->dexNum].pokemonOffset; - SetOamMatrix(2, gPokedexEntries[gUnknown_0202FFBC->dexNum].pokemonScale, 0, 0, gPokedexEntries[gUnknown_0202FFBC->dexNum].pokemonScale); - LoadPalette(gUnknown_083B4EC4, (gSprites[spriteId].oam.paletteNum + 16) * 16, 0x20); - gMain.state++; - break; - case 7: - BeginNormalPaletteFade(-0x15, 0, 0x10, 0, 0); - SetVBlankCallback(gUnknown_03005CEC); - gMain.state++; - break; - case 8: - REG_BLDCNT = 0; - REG_BLDALPHA = 0; - REG_BLDY = 0; - REG_BG2CNT = BGCNT_PRIORITY(3) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(14) | BGCNT_16COLOR | BGCNT_TXT256x256; - REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG1_ON | DISPCNT_BG2_ON | DISPCNT_BG3_ON | DISPCNT_OBJ_ON; - gMain.state++; - break; - case 9: - if (!gPaletteFade.active) - { - gPokedexView->unk64F = 0; - gMain.state = 0; - gTasks[taskId].func = Task_SizeScreenProcessInput; - } - break; + break; } } @@ -3094,81 +3094,81 @@ void sub_8090750(u8 taskId) switch (gTasks[taskId].data[0]) { - default: - case 0: - if (!gPaletteFade.active) - { - gUnknown_03005CEC = gMain.vblankCallback; - SetVBlankCallback(NULL); - sub_8091060(0x100); - gTasks[taskId].data[0] = 1; - } - break; - case 1: + default: + case 0: + if (!gPaletteFade.active) { - u16 i; - - LZ77UnCompVram(gPokedexMenu_Gfx, (void *)(VRAM + 0x4000)); - LZ77UnCompVram(gUnknown_08E96BD4, (void *)(VRAM + 0x7800)); - for (i = 0; i < 0x280; i++) - ((u16 *)(VRAM + 0x7800))[i] += 0x2000; - sub_8091738(gTasks[taskId].data[1], 2, 0x3FC); - ResetPaletteFade(); - LoadPalette(gPokedexMenu_Pal + 2, 0x21, 0x9E); - gTasks[taskId].data[0]++; - break; + gUnknown_03005CEC = gMain.vblankCallback; + SetVBlankCallback(NULL); + sub_8091060(0x100); + gTasks[taskId].data[0] = 1; } - case 2: - SetUpWindowConfig(&gWindowConfig_81E7064); - InitMenuWindow(&gWindowConfig_81E7064); - DmaClear16(3, (void *)(VRAM + 0xC000), 0x200); - gTasks[taskId].data[0]++; - break; - case 3: - sub_8072BD8(gDexText_RegisterComplete, 2, 0, 0xD0); - if (!IsNationalPokedexEnabled()) - sub_8091154(NationalToHoennOrder(dexNum), 13, 3); - else - sub_8091154(dexNum, 13, 3); - sub_80911C8(dexNum, 16, 3); - MenuPrint(gDexText_UnknownPoke, 11, 5); - MenuPrint(gDexText_UnknownHeight, 16, 7); - MenuPrint(gDexText_UnknownWeight, 16, 9); - sub_8091304(&gPokedexEntries[dexNum], 11, 5); - sub_8091458(gPokedexEntries[dexNum].height, 16, 7); - sub_8091564(gPokedexEntries[dexNum].weight, 16, 9); - MenuPrint(gPokedexEntries[dexNum].descriptionPage1, 2, 13); - sub_80917CC(14, 0x3FC); - gTasks[taskId].data[0]++; - break; - case 4: - { - u8 spriteId = sub_80918EC(dexNum, 0x30, 0x38, 0); + break; + case 1: + { + u16 i; - gSprites[spriteId].oam.priority = 0; - BeginNormalPaletteFade(-1, 0, 0x10, 0, 0); - SetVBlankCallback(gUnknown_03005CEC); - gTasks[taskId].data[3] = spriteId; - gTasks[taskId].data[0]++; - break; + LZ77UnCompVram(gPokedexMenu_Gfx, (void *)(VRAM + 0x4000)); + LZ77UnCompVram(gUnknown_08E96BD4, (void *)(VRAM + 0x7800)); + for (i = 0; i < 0x280; i++) + ((u16 *)(VRAM + 0x7800))[i] += 0x2000; + sub_8091738(gTasks[taskId].data[1], 2, 0x3FC); + ResetPaletteFade(); + LoadPalette(gPokedexMenu_Pal + 2, 0x21, 0x9E); + gTasks[taskId].data[0]++; + break; + } + case 2: + SetUpWindowConfig(&gWindowConfig_81E7064); + InitMenuWindow(&gWindowConfig_81E7064); + DmaClear16(3, (void *)(VRAM + 0xC000), 0x200); + gTasks[taskId].data[0]++; + break; + case 3: + sub_8072BD8(gDexText_RegisterComplete, 2, 0, 0xD0); + if (!IsNationalPokedexEnabled()) + sub_8091154(NationalToHoennOrder(dexNum), 13, 3); + else + sub_8091154(dexNum, 13, 3); + sub_80911C8(dexNum, 16, 3); + MenuPrint(gDexText_UnknownPoke, 11, 5); + MenuPrint(gDexText_UnknownHeight, 16, 7); + MenuPrint(gDexText_UnknownWeight, 16, 9); + sub_8091304(&gPokedexEntries[dexNum], 11, 5); + sub_8091458(gPokedexEntries[dexNum].height, 16, 7); + sub_8091564(gPokedexEntries[dexNum].weight, 16, 9); + MenuPrint(gPokedexEntries[dexNum].descriptionPage1, 2, 13); + sub_80917CC(14, 0x3FC); + gTasks[taskId].data[0]++; + break; + case 4: + { + u8 spriteId = sub_80918EC(dexNum, 0x30, 0x38, 0); + + gSprites[spriteId].oam.priority = 0; + BeginNormalPaletteFade(-1, 0, 0x10, 0, 0); + SetVBlankCallback(gUnknown_03005CEC); + gTasks[taskId].data[3] = spriteId; + gTasks[taskId].data[0]++; + break; + } + case 5: + REG_BLDCNT = 0; + REG_BLDALPHA = 0; + REG_BLDY = 0; + REG_BG3CNT = BGCNT_PRIORITY(3) | BGCNT_CHARBASE(1) | BGCNT_SCREENBASE(15) | BGCNT_16COLOR | BGCNT_TXT256x256; + REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG2_ON | DISPCNT_BG3_ON | DISPCNT_OBJ_ON; + gTasks[taskId].data[0]++; + break; + case 6: + if (!gPaletteFade.active) + { + PlayCry1(NationalPokedexNumToSpecies(dexNum), 0); + gTasks[taskId].data[2] = 0; + gTasks[taskId].data[4] = 0; + gTasks[taskId].func = sub_8090A3C; } - case 5: - REG_BLDCNT = 0; - REG_BLDALPHA = 0; - REG_BLDY = 0; - REG_BG3CNT = BGCNT_PRIORITY(3) | BGCNT_CHARBASE(1) | BGCNT_SCREENBASE(15) | BGCNT_16COLOR | BGCNT_TXT256x256; - REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG2_ON | DISPCNT_BG3_ON | DISPCNT_OBJ_ON; - gTasks[taskId].data[0]++; - break; - case 6: - if (!gPaletteFade.active) - { - PlayCry1(NationalPokedexNumToSpecies(dexNum), 0); - gTasks[taskId].data[2] = 0; - gTasks[taskId].data[4] = 0; - gTasks[taskId].func = sub_8090A3C; - } - break; + break; } } */ diff --git a/src/pokemon_2.c b/src/pokemon_2.c index 3be11f453..31b66fd9a 100644 --- a/src/pokemon_2.c +++ b/src/pokemon_2.c @@ -417,307 +417,307 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data) switch (field) { - case MON_DATA_PERSONALITY: - retVal = boxMon->personality; - break; - case MON_DATA_OT_ID: - retVal = boxMon->otId; - break; - case MON_DATA_NICKNAME: + case MON_DATA_PERSONALITY: + retVal = boxMon->personality; + break; + case MON_DATA_OT_ID: + retVal = boxMon->otId; + break; + case MON_DATA_NICKNAME: + { + if (boxMon->isBadEgg) { - if (boxMon->isBadEgg) - { - StringCopy(data, gBadEggNickname); - retVal = StringLength(data); - } - else if (boxMon->isEgg) - { - StringCopy(data, gEggNickname); - retVal = StringLength(data); - } - else - { - retVal = 0; - - while (retVal < POKEMON_NAME_LENGTH && boxMon->nickname[retVal] != EOS) - { - data[retVal] = boxMon->nickname[retVal]; - retVal++; - } - - data[retVal] = EOS; - ConvertInternationalString(data, boxMon->language); - retVal = StringLength(data); - } - break; + StringCopy(data, gBadEggNickname); + retVal = StringLength(data); } - case MON_DATA_LANGUAGE: - retVal = boxMon->language; - break; - case MON_DATA_SANITY_BIT1: - retVal = boxMon->isBadEgg; - break; - case MON_DATA_SANITY_BIT2: - retVal = boxMon->hasSpecies; - break; - case MON_DATA_SANITY_BIT3: - retVal = boxMon->isEgg; - break; - case MON_DATA_OT_NAME: + else if (boxMon->isEgg) + { + StringCopy(data, gEggNickname); + retVal = StringLength(data); + } + else { retVal = 0; - while (retVal < OT_NAME_LENGTH && boxMon->otName[retVal] != EOS) + while (retVal < POKEMON_NAME_LENGTH && boxMon->nickname[retVal] != EOS) { - data[retVal] = boxMon->otName[retVal]; + data[retVal] = boxMon->nickname[retVal]; retVal++; } data[retVal] = EOS; - break; + ConvertInternationalString(data, boxMon->language); + retVal = StringLength(data); } - case MON_DATA_MARKINGS: - retVal = boxMon->markings; - break; - case MON_DATA_CHECKSUM: - retVal = boxMon->checksum; - break; - case MON_DATA_10: - retVal = boxMon->unknown; - break; - case MON_DATA_SPECIES: - retVal = boxMon->isBadEgg ? SPECIES_EGG : substruct0->species; - break; - case MON_DATA_HELD_ITEM: - retVal = substruct0->heldItem; - break; - case MON_DATA_EXP: - retVal = substruct0->experience; - break; - case MON_DATA_PP_BONUSES: - retVal = substruct0->ppBonuses; - break; - case MON_DATA_FRIENDSHIP: - retVal = substruct0->friendship; - break; - case MON_DATA_MOVE1: - case MON_DATA_MOVE2: - case MON_DATA_MOVE3: - case MON_DATA_MOVE4: - retVal = substruct1->moves[field - MON_DATA_MOVE1]; - break; - case MON_DATA_PP1: - case MON_DATA_PP2: - case MON_DATA_PP3: - case MON_DATA_PP4: - retVal = substruct1->pp[field - MON_DATA_PP1]; - break; - case MON_DATA_HP_EV: - retVal = substruct2->hpEV; - break; - case MON_DATA_ATK_EV: - retVal = substruct2->attackEV; - break; - case MON_DATA_DEF_EV: - retVal = substruct2->defenseEV; - break; - case MON_DATA_SPD_EV: - retVal = substruct2->speedEV; - break; - case MON_DATA_SPATK_EV: - retVal = substruct2->spAttackEV; - break; - case MON_DATA_SPDEF_EV: - retVal = substruct2->spDefenseEV; - break; - case MON_DATA_COOL: - retVal = substruct2->cool; - break; - case MON_DATA_BEAUTY: - retVal = substruct2->beauty; - break; - case MON_DATA_CUTE: - retVal = substruct2->cute; - break; - case MON_DATA_SMART: - retVal = substruct2->smart; - break; - case MON_DATA_TOUGH: - retVal = substruct2->tough; - break; - case MON_DATA_SHEEN: - retVal = substruct2->sheen; - break; - case MON_DATA_POKERUS: - retVal = substruct3->pokerus; - break; - case MON_DATA_MET_LOCATION: - retVal = substruct3->metLocation; - break; - case MON_DATA_MET_LEVEL: - retVal = substruct3->metLevel; - break; - case MON_DATA_MET_GAME: - retVal = substruct3->metGame; - break; - case MON_DATA_POKEBALL: - retVal = substruct3->pokeball; - break; - case MON_DATA_OT_GENDER: - retVal = substruct3->otGender; - break; - case MON_DATA_HP_IV: - retVal = substruct3->hpIV; - break; - case MON_DATA_ATK_IV: - retVal = substruct3->attackIV; - break; - case MON_DATA_DEF_IV: - retVal = substruct3->defenseIV; - break; - case MON_DATA_SPD_IV: - retVal = substruct3->speedIV; - break; - case MON_DATA_SPATK_IV: - retVal = substruct3->spAttackIV; - break; - case MON_DATA_SPDEF_IV: - retVal = substruct3->spDefenseIV; - break; - case MON_DATA_IS_EGG: - retVal = substruct3->isEgg; - break; - case MON_DATA_ALT_ABILITY: - retVal = substruct3->altAbility; - break; - case MON_DATA_COOL_RIBBON: - retVal = substruct3->coolRibbon; - break; - case MON_DATA_BEAUTY_RIBBON: - retVal = substruct3->beautyRibbon; - break; - case MON_DATA_CUTE_RIBBON: - retVal = substruct3->cuteRibbon; - break; - case MON_DATA_SMART_RIBBON: - retVal = substruct3->smartRibbon; - break; - case MON_DATA_TOUGH_RIBBON: - retVal = substruct3->toughRibbon; - break; - case MON_DATA_CHAMPION_RIBBON: - retVal = substruct3->championRibbon; - break; - case MON_DATA_WINNING_RIBBON: - retVal = substruct3->winningRibbon; - break; - case MON_DATA_VICTORY_RIBBON: - retVal = substruct3->victoryRibbon; - break; - case MON_DATA_ARTIST_RIBBON: - retVal = substruct3->artistRibbon; - break; - case MON_DATA_EFFORT_RIBBON: - retVal = substruct3->effortRibbon; - break; - case MON_DATA_GIFT_RIBBON_1: - retVal = substruct3->giftRibbon1; - break; - case MON_DATA_GIFT_RIBBON_2: - retVal = substruct3->giftRibbon2; - break; - case MON_DATA_GIFT_RIBBON_3: - retVal = substruct3->giftRibbon3; - break; - case MON_DATA_GIFT_RIBBON_4: - retVal = substruct3->giftRibbon4; - break; - case MON_DATA_GIFT_RIBBON_5: - retVal = substruct3->giftRibbon5; - break; - case MON_DATA_GIFT_RIBBON_6: - retVal = substruct3->giftRibbon6; - break; - case MON_DATA_GIFT_RIBBON_7: - retVal = substruct3->giftRibbon7; - break; - case MON_DATA_FATEFUL_ENCOUNTER: - retVal = substruct3->fatefulEncounter; - break; - case MON_DATA_SPECIES2: - retVal = substruct0->species; - if (substruct0->species && (substruct3->isEgg || boxMon->isBadEgg)) - retVal = SPECIES_EGG; - break; - case MON_DATA_IVS: - retVal = substruct3->hpIV | (substruct3->attackIV << 5) | (substruct3->defenseIV << 10) | (substruct3->speedIV << 15) | (substruct3->spAttackIV << 20) | (substruct3->spDefenseIV << 25); - break; - case MON_DATA_KNOWN_MOVES: - if (substruct0->species && !substruct3->isEgg) - { - u16 *moves = (u16 *)data; - s32 i = 0; - - while (moves[i] != 355) - { - u16 move = moves[i]; - if (substruct1->moves[0] == move - || substruct1->moves[1] == move - || substruct1->moves[2] == move - || substruct1->moves[3] == move) - retVal |= gBitTable[i]; - i++; - } - } - break; - case MON_DATA_RIBBON_COUNT: - retVal = 0; - if (substruct0->species && !substruct3->isEgg) - { - retVal += substruct3->coolRibbon; - retVal += substruct3->beautyRibbon; - retVal += substruct3->cuteRibbon; - retVal += substruct3->smartRibbon; - retVal += substruct3->toughRibbon; - retVal += substruct3->championRibbon; - retVal += substruct3->winningRibbon; - retVal += substruct3->victoryRibbon; - retVal += substruct3->artistRibbon; - retVal += substruct3->effortRibbon; - retVal += substruct3->giftRibbon1; - retVal += substruct3->giftRibbon2; - retVal += substruct3->giftRibbon3; - retVal += substruct3->giftRibbon4; - retVal += substruct3->giftRibbon5; - retVal += substruct3->giftRibbon6; - retVal += substruct3->giftRibbon7; - } - break; - case MON_DATA_RIBBONS: - retVal = 0; - if (substruct0->species && !substruct3->isEgg) + break; + } + case MON_DATA_LANGUAGE: + retVal = boxMon->language; + break; + case MON_DATA_SANITY_BIT1: + retVal = boxMon->isBadEgg; + break; + case MON_DATA_SANITY_BIT2: + retVal = boxMon->hasSpecies; + break; + case MON_DATA_SANITY_BIT3: + retVal = boxMon->isEgg; + break; + case MON_DATA_OT_NAME: + { + retVal = 0; + + while (retVal < OT_NAME_LENGTH && boxMon->otName[retVal] != EOS) + { + data[retVal] = boxMon->otName[retVal]; + retVal++; + } + + data[retVal] = EOS; + break; + } + case MON_DATA_MARKINGS: + retVal = boxMon->markings; + break; + case MON_DATA_CHECKSUM: + retVal = boxMon->checksum; + break; + case MON_DATA_10: + retVal = boxMon->unknown; + break; + case MON_DATA_SPECIES: + retVal = boxMon->isBadEgg ? SPECIES_EGG : substruct0->species; + break; + case MON_DATA_HELD_ITEM: + retVal = substruct0->heldItem; + break; + case MON_DATA_EXP: + retVal = substruct0->experience; + break; + case MON_DATA_PP_BONUSES: + retVal = substruct0->ppBonuses; + break; + case MON_DATA_FRIENDSHIP: + retVal = substruct0->friendship; + break; + case MON_DATA_MOVE1: + case MON_DATA_MOVE2: + case MON_DATA_MOVE3: + case MON_DATA_MOVE4: + retVal = substruct1->moves[field - MON_DATA_MOVE1]; + break; + case MON_DATA_PP1: + case MON_DATA_PP2: + case MON_DATA_PP3: + case MON_DATA_PP4: + retVal = substruct1->pp[field - MON_DATA_PP1]; + break; + case MON_DATA_HP_EV: + retVal = substruct2->hpEV; + break; + case MON_DATA_ATK_EV: + retVal = substruct2->attackEV; + break; + case MON_DATA_DEF_EV: + retVal = substruct2->defenseEV; + break; + case MON_DATA_SPD_EV: + retVal = substruct2->speedEV; + break; + case MON_DATA_SPATK_EV: + retVal = substruct2->spAttackEV; + break; + case MON_DATA_SPDEF_EV: + retVal = substruct2->spDefenseEV; + break; + case MON_DATA_COOL: + retVal = substruct2->cool; + break; + case MON_DATA_BEAUTY: + retVal = substruct2->beauty; + break; + case MON_DATA_CUTE: + retVal = substruct2->cute; + break; + case MON_DATA_SMART: + retVal = substruct2->smart; + break; + case MON_DATA_TOUGH: + retVal = substruct2->tough; + break; + case MON_DATA_SHEEN: + retVal = substruct2->sheen; + break; + case MON_DATA_POKERUS: + retVal = substruct3->pokerus; + break; + case MON_DATA_MET_LOCATION: + retVal = substruct3->metLocation; + break; + case MON_DATA_MET_LEVEL: + retVal = substruct3->metLevel; + break; + case MON_DATA_MET_GAME: + retVal = substruct3->metGame; + break; + case MON_DATA_POKEBALL: + retVal = substruct3->pokeball; + break; + case MON_DATA_OT_GENDER: + retVal = substruct3->otGender; + break; + case MON_DATA_HP_IV: + retVal = substruct3->hpIV; + break; + case MON_DATA_ATK_IV: + retVal = substruct3->attackIV; + break; + case MON_DATA_DEF_IV: + retVal = substruct3->defenseIV; + break; + case MON_DATA_SPD_IV: + retVal = substruct3->speedIV; + break; + case MON_DATA_SPATK_IV: + retVal = substruct3->spAttackIV; + break; + case MON_DATA_SPDEF_IV: + retVal = substruct3->spDefenseIV; + break; + case MON_DATA_IS_EGG: + retVal = substruct3->isEgg; + break; + case MON_DATA_ALT_ABILITY: + retVal = substruct3->altAbility; + break; + case MON_DATA_COOL_RIBBON: + retVal = substruct3->coolRibbon; + break; + case MON_DATA_BEAUTY_RIBBON: + retVal = substruct3->beautyRibbon; + break; + case MON_DATA_CUTE_RIBBON: + retVal = substruct3->cuteRibbon; + break; + case MON_DATA_SMART_RIBBON: + retVal = substruct3->smartRibbon; + break; + case MON_DATA_TOUGH_RIBBON: + retVal = substruct3->toughRibbon; + break; + case MON_DATA_CHAMPION_RIBBON: + retVal = substruct3->championRibbon; + break; + case MON_DATA_WINNING_RIBBON: + retVal = substruct3->winningRibbon; + break; + case MON_DATA_VICTORY_RIBBON: + retVal = substruct3->victoryRibbon; + break; + case MON_DATA_ARTIST_RIBBON: + retVal = substruct3->artistRibbon; + break; + case MON_DATA_EFFORT_RIBBON: + retVal = substruct3->effortRibbon; + break; + case MON_DATA_GIFT_RIBBON_1: + retVal = substruct3->giftRibbon1; + break; + case MON_DATA_GIFT_RIBBON_2: + retVal = substruct3->giftRibbon2; + break; + case MON_DATA_GIFT_RIBBON_3: + retVal = substruct3->giftRibbon3; + break; + case MON_DATA_GIFT_RIBBON_4: + retVal = substruct3->giftRibbon4; + break; + case MON_DATA_GIFT_RIBBON_5: + retVal = substruct3->giftRibbon5; + break; + case MON_DATA_GIFT_RIBBON_6: + retVal = substruct3->giftRibbon6; + break; + case MON_DATA_GIFT_RIBBON_7: + retVal = substruct3->giftRibbon7; + break; + case MON_DATA_FATEFUL_ENCOUNTER: + retVal = substruct3->fatefulEncounter; + break; + case MON_DATA_SPECIES2: + retVal = substruct0->species; + if (substruct0->species && (substruct3->isEgg || boxMon->isBadEgg)) + retVal = SPECIES_EGG; + break; + case MON_DATA_IVS: + retVal = substruct3->hpIV | (substruct3->attackIV << 5) | (substruct3->defenseIV << 10) | (substruct3->speedIV << 15) | (substruct3->spAttackIV << 20) | (substruct3->spDefenseIV << 25); + break; + case MON_DATA_KNOWN_MOVES: + if (substruct0->species && !substruct3->isEgg) + { + u16 *moves = (u16 *)data; + s32 i = 0; + + while (moves[i] != 355) { - retVal = substruct3->championRibbon - | (substruct3->coolRibbon << 1) - | (substruct3->beautyRibbon << 4) - | (substruct3->cuteRibbon << 7) - | (substruct3->smartRibbon << 10) - | (substruct3->toughRibbon << 13) - | (substruct3->winningRibbon << 16) - | (substruct3->victoryRibbon << 17) - | (substruct3->artistRibbon << 18) - | (substruct3->effortRibbon << 19) - | (substruct3->giftRibbon1 << 20) - | (substruct3->giftRibbon2 << 21) - | (substruct3->giftRibbon3 << 22) - | (substruct3->giftRibbon4 << 23) - | (substruct3->giftRibbon5 << 24) - | (substruct3->giftRibbon6 << 25) - | (substruct3->giftRibbon7 << 26); + u16 move = moves[i]; + if (substruct1->moves[0] == move + || substruct1->moves[1] == move + || substruct1->moves[2] == move + || substruct1->moves[3] == move) + retVal |= gBitTable[i]; + i++; } - break; - default: - break; + } + break; + case MON_DATA_RIBBON_COUNT: + retVal = 0; + if (substruct0->species && !substruct3->isEgg) + { + retVal += substruct3->coolRibbon; + retVal += substruct3->beautyRibbon; + retVal += substruct3->cuteRibbon; + retVal += substruct3->smartRibbon; + retVal += substruct3->toughRibbon; + retVal += substruct3->championRibbon; + retVal += substruct3->winningRibbon; + retVal += substruct3->victoryRibbon; + retVal += substruct3->artistRibbon; + retVal += substruct3->effortRibbon; + retVal += substruct3->giftRibbon1; + retVal += substruct3->giftRibbon2; + retVal += substruct3->giftRibbon3; + retVal += substruct3->giftRibbon4; + retVal += substruct3->giftRibbon5; + retVal += substruct3->giftRibbon6; + retVal += substruct3->giftRibbon7; + } + break; + case MON_DATA_RIBBONS: + retVal = 0; + if (substruct0->species && !substruct3->isEgg) + { + retVal = substruct3->championRibbon + | (substruct3->coolRibbon << 1) + | (substruct3->beautyRibbon << 4) + | (substruct3->cuteRibbon << 7) + | (substruct3->smartRibbon << 10) + | (substruct3->toughRibbon << 13) + | (substruct3->winningRibbon << 16) + | (substruct3->victoryRibbon << 17) + | (substruct3->artistRibbon << 18) + | (substruct3->effortRibbon << 19) + | (substruct3->giftRibbon1 << 20) + | (substruct3->giftRibbon2 << 21) + | (substruct3->giftRibbon3 << 22) + | (substruct3->giftRibbon4 << 23) + | (substruct3->giftRibbon5 << 24) + | (substruct3->giftRibbon6 << 25) + | (substruct3->giftRibbon7 << 26); + } + break; + default: + break; } if (field > MON_DATA_10) @@ -800,239 +800,239 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const u8 *data) switch (field) { - case MON_DATA_PERSONALITY: - SET32(boxMon->personality); - break; - case MON_DATA_OT_ID: - SET32(boxMon->otId); - break; - case MON_DATA_NICKNAME: - { - s32 i; - for (i = 0; i < POKEMON_NAME_LENGTH; i++) - boxMon->nickname[i] = data[i]; - break; - } - case MON_DATA_LANGUAGE: - SET8(boxMon->language); - break; - case MON_DATA_SANITY_BIT1: - SET8(boxMon->isBadEgg); - break; - case MON_DATA_SANITY_BIT2: - SET8(boxMon->hasSpecies); - break; - case MON_DATA_SANITY_BIT3: - SET8(boxMon->isEgg); - break; - case MON_DATA_OT_NAME: - { - s32 i; - for (i = 0; i < OT_NAME_LENGTH; i++) - boxMon->otName[i] = data[i]; - break; - } - case MON_DATA_MARKINGS: - SET8(boxMon->markings); - break; - case MON_DATA_CHECKSUM: - SET16(boxMon->checksum); - break; - case MON_DATA_10: - SET16(boxMon->unknown); - break; - case MON_DATA_SPECIES: - { - SET16(substruct0->species); - if (substruct0->species) - boxMon->hasSpecies = 1; - else - boxMon->hasSpecies = 0; - break; - } - case MON_DATA_HELD_ITEM: - SET16(substruct0->heldItem); - break; - case MON_DATA_EXP: - SET32(substruct0->experience); - break; - case MON_DATA_PP_BONUSES: - SET8(substruct0->ppBonuses); - break; - case MON_DATA_FRIENDSHIP: - SET8(substruct0->friendship); - break; - case MON_DATA_MOVE1: - case MON_DATA_MOVE2: - case MON_DATA_MOVE3: - case MON_DATA_MOVE4: - SET16(substruct1->moves[field - MON_DATA_MOVE1]); - break; - case MON_DATA_PP1: - case MON_DATA_PP2: - case MON_DATA_PP3: - case MON_DATA_PP4: - SET8(substruct1->pp[field - MON_DATA_PP1]); - break; - case MON_DATA_HP_EV: - SET8(substruct2->hpEV); - break; - case MON_DATA_ATK_EV: - SET8(substruct2->attackEV); - break; - case MON_DATA_DEF_EV: - SET8(substruct2->defenseEV); - break; - case MON_DATA_SPD_EV: - SET8(substruct2->speedEV); - break; - case MON_DATA_SPATK_EV: - SET8(substruct2->spAttackEV); - break; - case MON_DATA_SPDEF_EV: - SET8(substruct2->spDefenseEV); - break; - case MON_DATA_COOL: - SET8(substruct2->cool); - break; - case MON_DATA_BEAUTY: - SET8(substruct2->beauty); - break; - case MON_DATA_CUTE: - SET8(substruct2->cute); - break; - case MON_DATA_SMART: - SET8(substruct2->smart); - break; - case MON_DATA_TOUGH: - SET8(substruct2->tough); - break; - case MON_DATA_SHEEN: - SET8(substruct2->sheen); - break; - case MON_DATA_POKERUS: - SET8(substruct3->pokerus); - break; - case MON_DATA_MET_LOCATION: - SET8(substruct3->metLocation); - break; - case MON_DATA_MET_LEVEL: - { - u8 metLevel = *data; - substruct3->metLevel = metLevel; - break; - } - case MON_DATA_MET_GAME: - SET8(substruct3->metGame); - break; - case MON_DATA_POKEBALL: - { - u8 pokeball = *data; - substruct3->pokeball = pokeball; - break; - } - case MON_DATA_OT_GENDER: - SET8(substruct3->otGender); - break; - case MON_DATA_HP_IV: - SET8(substruct3->hpIV); - break; - case MON_DATA_ATK_IV: - SET8(substruct3->attackIV); - break; - case MON_DATA_DEF_IV: - SET8(substruct3->defenseIV); - break; - case MON_DATA_SPD_IV: - SET8(substruct3->speedIV); - break; - case MON_DATA_SPATK_IV: - SET8(substruct3->spAttackIV); - break; - case MON_DATA_SPDEF_IV: - SET8(substruct3->spDefenseIV); - break; - case MON_DATA_IS_EGG: - SET8(substruct3->isEgg); - if (substruct3->isEgg) - boxMon->isEgg = 1; - else - boxMon->isEgg = 0; - break; - case MON_DATA_ALT_ABILITY: - SET8(substruct3->altAbility); - break; - case MON_DATA_COOL_RIBBON: - SET8(substruct3->coolRibbon); - break; - case MON_DATA_BEAUTY_RIBBON: - SET8(substruct3->beautyRibbon); - break; - case MON_DATA_CUTE_RIBBON: - SET8(substruct3->cuteRibbon); - break; - case MON_DATA_SMART_RIBBON: - SET8(substruct3->smartRibbon); - break; - case MON_DATA_TOUGH_RIBBON: - SET8(substruct3->toughRibbon); - break; - case MON_DATA_CHAMPION_RIBBON: - SET8(substruct3->championRibbon); - break; - case MON_DATA_WINNING_RIBBON: - SET8(substruct3->winningRibbon); - break; - case MON_DATA_VICTORY_RIBBON: - SET8(substruct3->victoryRibbon); - break; - case MON_DATA_ARTIST_RIBBON: - SET8(substruct3->artistRibbon); - break; - case MON_DATA_EFFORT_RIBBON: - SET8(substruct3->effortRibbon); - break; - case MON_DATA_GIFT_RIBBON_1: - SET8(substruct3->giftRibbon1); - break; - case MON_DATA_GIFT_RIBBON_2: - SET8(substruct3->giftRibbon2); - break; - case MON_DATA_GIFT_RIBBON_3: - SET8(substruct3->giftRibbon3); - break; - case MON_DATA_GIFT_RIBBON_4: - SET8(substruct3->giftRibbon4); - break; - case MON_DATA_GIFT_RIBBON_5: - SET8(substruct3->giftRibbon5); - break; - case MON_DATA_GIFT_RIBBON_6: - SET8(substruct3->giftRibbon6); - break; - case MON_DATA_GIFT_RIBBON_7: - SET8(substruct3->giftRibbon7); - break; - case MON_DATA_FATEFUL_ENCOUNTER: - SET8(substruct3->fatefulEncounter); - break; - case MON_DATA_IVS: - { + case MON_DATA_PERSONALITY: + SET32(boxMon->personality); + break; + case MON_DATA_OT_ID: + SET32(boxMon->otId); + break; + case MON_DATA_NICKNAME: + { + s32 i; + for (i = 0; i < POKEMON_NAME_LENGTH; i++) + boxMon->nickname[i] = data[i]; + break; + } + case MON_DATA_LANGUAGE: + SET8(boxMon->language); + break; + case MON_DATA_SANITY_BIT1: + SET8(boxMon->isBadEgg); + break; + case MON_DATA_SANITY_BIT2: + SET8(boxMon->hasSpecies); + break; + case MON_DATA_SANITY_BIT3: + SET8(boxMon->isEgg); + break; + case MON_DATA_OT_NAME: + { + s32 i; + for (i = 0; i < OT_NAME_LENGTH; i++) + boxMon->otName[i] = data[i]; + break; + } + case MON_DATA_MARKINGS: + SET8(boxMon->markings); + break; + case MON_DATA_CHECKSUM: + SET16(boxMon->checksum); + break; + case MON_DATA_10: + SET16(boxMon->unknown); + break; + case MON_DATA_SPECIES: + { + SET16(substruct0->species); + if (substruct0->species) + boxMon->hasSpecies = 1; + else + boxMon->hasSpecies = 0; + break; + } + case MON_DATA_HELD_ITEM: + SET16(substruct0->heldItem); + break; + case MON_DATA_EXP: + SET32(substruct0->experience); + break; + case MON_DATA_PP_BONUSES: + SET8(substruct0->ppBonuses); + break; + case MON_DATA_FRIENDSHIP: + SET8(substruct0->friendship); + break; + case MON_DATA_MOVE1: + case MON_DATA_MOVE2: + case MON_DATA_MOVE3: + case MON_DATA_MOVE4: + SET16(substruct1->moves[field - MON_DATA_MOVE1]); + break; + case MON_DATA_PP1: + case MON_DATA_PP2: + case MON_DATA_PP3: + case MON_DATA_PP4: + SET8(substruct1->pp[field - MON_DATA_PP1]); + break; + case MON_DATA_HP_EV: + SET8(substruct2->hpEV); + break; + case MON_DATA_ATK_EV: + SET8(substruct2->attackEV); + break; + case MON_DATA_DEF_EV: + SET8(substruct2->defenseEV); + break; + case MON_DATA_SPD_EV: + SET8(substruct2->speedEV); + break; + case MON_DATA_SPATK_EV: + SET8(substruct2->spAttackEV); + break; + case MON_DATA_SPDEF_EV: + SET8(substruct2->spDefenseEV); + break; + case MON_DATA_COOL: + SET8(substruct2->cool); + break; + case MON_DATA_BEAUTY: + SET8(substruct2->beauty); + break; + case MON_DATA_CUTE: + SET8(substruct2->cute); + break; + case MON_DATA_SMART: + SET8(substruct2->smart); + break; + case MON_DATA_TOUGH: + SET8(substruct2->tough); + break; + case MON_DATA_SHEEN: + SET8(substruct2->sheen); + break; + case MON_DATA_POKERUS: + SET8(substruct3->pokerus); + break; + case MON_DATA_MET_LOCATION: + SET8(substruct3->metLocation); + break; + case MON_DATA_MET_LEVEL: + { + u8 metLevel = *data; + substruct3->metLevel = metLevel; + break; + } + case MON_DATA_MET_GAME: + SET8(substruct3->metGame); + break; + case MON_DATA_POKEBALL: + { + u8 pokeball = *data; + substruct3->pokeball = pokeball; + break; + } + case MON_DATA_OT_GENDER: + SET8(substruct3->otGender); + break; + case MON_DATA_HP_IV: + SET8(substruct3->hpIV); + break; + case MON_DATA_ATK_IV: + SET8(substruct3->attackIV); + break; + case MON_DATA_DEF_IV: + SET8(substruct3->defenseIV); + break; + case MON_DATA_SPD_IV: + SET8(substruct3->speedIV); + break; + case MON_DATA_SPATK_IV: + SET8(substruct3->spAttackIV); + break; + case MON_DATA_SPDEF_IV: + SET8(substruct3->spDefenseIV); + break; + case MON_DATA_IS_EGG: + SET8(substruct3->isEgg); + if (substruct3->isEgg) + boxMon->isEgg = 1; + else + boxMon->isEgg = 0; + break; + case MON_DATA_ALT_ABILITY: + SET8(substruct3->altAbility); + break; + case MON_DATA_COOL_RIBBON: + SET8(substruct3->coolRibbon); + break; + case MON_DATA_BEAUTY_RIBBON: + SET8(substruct3->beautyRibbon); + break; + case MON_DATA_CUTE_RIBBON: + SET8(substruct3->cuteRibbon); + break; + case MON_DATA_SMART_RIBBON: + SET8(substruct3->smartRibbon); + break; + case MON_DATA_TOUGH_RIBBON: + SET8(substruct3->toughRibbon); + break; + case MON_DATA_CHAMPION_RIBBON: + SET8(substruct3->championRibbon); + break; + case MON_DATA_WINNING_RIBBON: + SET8(substruct3->winningRibbon); + break; + case MON_DATA_VICTORY_RIBBON: + SET8(substruct3->victoryRibbon); + break; + case MON_DATA_ARTIST_RIBBON: + SET8(substruct3->artistRibbon); + break; + case MON_DATA_EFFORT_RIBBON: + SET8(substruct3->effortRibbon); + break; + case MON_DATA_GIFT_RIBBON_1: + SET8(substruct3->giftRibbon1); + break; + case MON_DATA_GIFT_RIBBON_2: + SET8(substruct3->giftRibbon2); + break; + case MON_DATA_GIFT_RIBBON_3: + SET8(substruct3->giftRibbon3); + break; + case MON_DATA_GIFT_RIBBON_4: + SET8(substruct3->giftRibbon4); + break; + case MON_DATA_GIFT_RIBBON_5: + SET8(substruct3->giftRibbon5); + break; + case MON_DATA_GIFT_RIBBON_6: + SET8(substruct3->giftRibbon6); + break; + case MON_DATA_GIFT_RIBBON_7: + SET8(substruct3->giftRibbon7); + break; + case MON_DATA_FATEFUL_ENCOUNTER: + SET8(substruct3->fatefulEncounter); + break; + case MON_DATA_IVS: + { #ifdef BUGFIX_SETMONIVS - u32 ivs = data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24); + u32 ivs = data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24); #else - u32 ivs = *data; // Bug: Only the HP IV and the lower 3 bits of the Attack IV are read. The rest become 0. + u32 ivs = *data; // Bug: Only the HP IV and the lower 3 bits of the Attack IV are read. The rest become 0. #endif - substruct3->hpIV = ivs & 0x1F; - substruct3->attackIV = (ivs >> 5) & 0x1F; - substruct3->defenseIV = (ivs >> 10) & 0x1F; - substruct3->speedIV = (ivs >> 15) & 0x1F; - substruct3->spAttackIV = (ivs >> 20) & 0x1F; - substruct3->spDefenseIV = (ivs >> 25) & 0x1F; - break; - } - default: - break; + substruct3->hpIV = ivs & 0x1F; + substruct3->attackIV = (ivs >> 5) & 0x1F; + substruct3->defenseIV = (ivs >> 10) & 0x1F; + substruct3->speedIV = (ivs >> 15) & 0x1F; + substruct3->spAttackIV = (ivs >> 20) & 0x1F; + substruct3->spDefenseIV = (ivs >> 25) & 0x1F; + break; + } + default: + break; } if (field > MON_DATA_10) diff --git a/src/pokemon_3.c b/src/pokemon_3.c index 270a52ad5..6b42d3272 100644 --- a/src/pokemon_3.c +++ b/src/pokemon_3.c @@ -169,28 +169,28 @@ u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit) { switch (j) { - case 2: - if (val & 0x10) - val &= 0xEF; - case 0: - if (i == effectByte && (val & effectBit)) - return offset; - offset++; - break; - case 1: - if (i == effectByte && (val & effectBit)) - return offset; - offset++; - break; - case 3: - if (i == effectByte && (val & effectBit)) - return offset; - offset++; - break; - case 7: - if (i == effectByte) - return 0; - break; + case 2: + if (val & 0x10) + val &= 0xEF; + case 0: + if (i == effectByte && (val & effectBit)) + return offset; + offset++; + break; + case 1: + if (i == effectByte && (val & effectBit)) + return offset; + offset++; + break; + case 3: + if (i == effectByte && (val & effectBit)) + return offset; + offset++; + break; + case 7: + if (i == effectByte) + return 0; + break; } } j++; @@ -208,21 +208,21 @@ u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit) { switch (j) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - if (i == effectByte && (val & effectBit)) - return offset; - offset++; - break; - case 7: - if (i == effectByte) - return 0; - break; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + if (i == effectByte && (val & effectBit)) + return offset; + offset++; + break; + case 7: + if (i == effectByte) + return 0; + break; } } j++; @@ -1153,26 +1153,26 @@ u16 sub_8040728(void) { switch (gTrainers[gTrainerBattleOpponent].trainerClass) { - case 2: - case 0x31: - return BGM_BATTLE30; - case 3: - case 4: - case 0x32: - case 0x33: - return BGM_BATTLE31; - case 0x19: - return BGM_BATTLE32; - case 0x20: - return BGM_BATTLE33; - case 0x2E: - if (!StringCompare(gTrainers[gTrainerBattleOpponent].trainerName, BattleText_Wally)) - return BGM_BATTLE20; - return BGM_BATTLE35; - case 0x18: - return BGM_BATTLE38; - default: + case 2: + case 0x31: + return BGM_BATTLE30; + case 3: + case 4: + case 0x32: + case 0x33: + return BGM_BATTLE31; + case 0x19: + return BGM_BATTLE32; + case 0x20: + return BGM_BATTLE33; + case 0x2E: + if (!StringCompare(gTrainers[gTrainerBattleOpponent].trainerName, BattleText_Wally)) return BGM_BATTLE20; + return BGM_BATTLE35; + case 0x18: + return BGM_BATTLE38; + default: + return BGM_BATTLE20; } } return BGM_BATTLE27; diff --git a/src/record_mixing.c b/src/record_mixing.c index 58722010f..2e01ead61 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -262,31 +262,31 @@ void Task_RecordMixing_SendPacket(u8 taskId) switch (task->data[TD_STATE]) { - case 0: //Copy record data to send buffer - { - void *recordData = (u8 *)LoadPtrFromTaskData(&task->data[2]) + BUFFER_CHUNK_SIZE * task->data[4]; + case 0: //Copy record data to send buffer + { + void *recordData = (u8 *)LoadPtrFromTaskData(&task->data[2]) + BUFFER_CHUNK_SIZE * task->data[4]; - memcpy(gBlockSendBuffer, recordData, BUFFER_CHUNK_SIZE); - task->data[TD_STATE]++; - break; - } - case 1: - if (GetMultiplayerId() == 0) - sub_8007E9C(1); + memcpy(gBlockSendBuffer, recordData, BUFFER_CHUNK_SIZE); + task->data[TD_STATE]++; + break; + } + case 1: + if (GetMultiplayerId() == 0) + sub_8007E9C(1); + task->data[TD_STATE]++; + break; + case 2: + break; + case 3: + task->data[4]++; + if ((u16)task->data[4] == 24) task->data[TD_STATE]++; - break; - case 2: - break; - case 3: - task->data[4]++; - if ((u16)task->data[4] == 24) - task->data[TD_STATE]++; - else - task->data[TD_STATE] = 0; - break; - case 4: - if (!gTasks[task->data[10]].isActive) - task->func = Task_RecordMixing_SendPacket_SwitchToReceive; + else + task->data[TD_STATE] = 0; + break; + case 4: + if (!gTasks[task->data[10]].isActive) + task->func = Task_RecordMixing_SendPacket_SwitchToReceive; } } diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index d46abc74d..0de1e5ca9 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -110,59 +110,59 @@ static void CB2_SaveFailedScreen(void) switch (gMain.state) { - case 0: - default: - SetVBlankCallback(0); - REG_DISPCNT = 0; - REG_BG3CNT = 0; - REG_BG2CNT = 0; - REG_BG1CNT = 0; - REG_BG0CNT = 0; - REG_BG3HOFS = 0; - REG_BG3VOFS = 0; - REG_BG2HOFS = 0; - REG_BG2VOFS = 0; - REG_BG1HOFS = 0; - REG_BG1VOFS = 0; - REG_BG0HOFS = 0; - REG_BG0VOFS = 0; - DmaFill16(3, 0, VRAM, VRAM_SIZE); - DmaFill32(3, 0, OAM, OAM_SIZE); - DmaFill16(3, 0, PLTT, PLTT_SIZE); - LZ77UnCompVram(&gBirchHelpGfx, (void *)VRAM); - LZ77UnCompVram(&gBirchBagTilemap, (void *)(VRAM + 0x3000)); - LZ77UnCompVram(&gBirchGrassTilemap, (void *)(VRAM + 0x3800)); - LZ77UnCompVram(&gSaveFailedClockGfx, (void *)(VRAM + 0x10020)); - ResetSpriteData(); - ResetTasks(); - ResetPaletteFade(); - LoadPalette(&gBirchBagGrassPal, 0, sizeof(gBirchBagGrassPal)); - LoadPalette(&gSaveFailedClockPal, 0x100, sizeof(gSaveFailedClockPal)); - SetUpWindowConfig(&gWindowConfig_81E6C3C); - InitMenuWindow(&gWindowConfig_81E6CE4); - MenuDrawTextWindow(13, CLOCK_WIN_TOP, 16, CLOCK_WIN_TOP + 3); // clock window - MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); // message window - MenuPrint(gSystemText_SaveFailedBackupCheck, 2, MSG_WIN_TOP + 1); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); - ime = REG_IME; - REG_IME = 0; - REG_IE |= INTR_FLAG_VBLANK; - REG_IME = ime; - REG_DISPSTAT |= DISPSTAT_VBLANK_INTR; - SetVBlankCallback(VBlankCB); - REG_BG3CNT = BGCNT_PRIORITY(3) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(7) | BGCNT_16COLOR | BGCNT_TXT256x256; - REG_BG2CNT = BGCNT_PRIORITY(2) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(6) | BGCNT_16COLOR | BGCNT_TXT256x256; - REG_BG0CNT = BGCNT_PRIORITY(0) | BGCNT_CHARBASE(2) | BGCNT_SCREENBASE(31) | BGCNT_16COLOR | BGCNT_TXT256x256; - REG_DISPCNT = DISPCNT_OBJ_ON | DISPCNT_BG3_ON | DISPCNT_BG2_ON | DISPCNT_BG0_ON | DISPCNT_OBJ_1D_MAP | DISPCNT_MODE_0; - gMain.state++; - break; - case 1: - if (!UpdatePaletteFade()) - { - SetMainCallback2(CB2_WipeSave); - SetVBlankCallback(VBlankCB_UpdateClockGraphics); - } - break; + case 0: + default: + SetVBlankCallback(0); + REG_DISPCNT = 0; + REG_BG3CNT = 0; + REG_BG2CNT = 0; + REG_BG1CNT = 0; + REG_BG0CNT = 0; + REG_BG3HOFS = 0; + REG_BG3VOFS = 0; + REG_BG2HOFS = 0; + REG_BG2VOFS = 0; + REG_BG1HOFS = 0; + REG_BG1VOFS = 0; + REG_BG0HOFS = 0; + REG_BG0VOFS = 0; + DmaFill16(3, 0, VRAM, VRAM_SIZE); + DmaFill32(3, 0, OAM, OAM_SIZE); + DmaFill16(3, 0, PLTT, PLTT_SIZE); + LZ77UnCompVram(&gBirchHelpGfx, (void *)VRAM); + LZ77UnCompVram(&gBirchBagTilemap, (void *)(VRAM + 0x3000)); + LZ77UnCompVram(&gBirchGrassTilemap, (void *)(VRAM + 0x3800)); + LZ77UnCompVram(&gSaveFailedClockGfx, (void *)(VRAM + 0x10020)); + ResetSpriteData(); + ResetTasks(); + ResetPaletteFade(); + LoadPalette(&gBirchBagGrassPal, 0, sizeof(gBirchBagGrassPal)); + LoadPalette(&gSaveFailedClockPal, 0x100, sizeof(gSaveFailedClockPal)); + SetUpWindowConfig(&gWindowConfig_81E6C3C); + InitMenuWindow(&gWindowConfig_81E6CE4); + MenuDrawTextWindow(13, CLOCK_WIN_TOP, 16, CLOCK_WIN_TOP + 3); // clock window + MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); // message window + MenuPrint(gSystemText_SaveFailedBackupCheck, 2, MSG_WIN_TOP + 1); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); + ime = REG_IME; + REG_IME = 0; + REG_IE |= INTR_FLAG_VBLANK; + REG_IME = ime; + REG_DISPSTAT |= DISPSTAT_VBLANK_INTR; + SetVBlankCallback(VBlankCB); + REG_BG3CNT = BGCNT_PRIORITY(3) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(7) | BGCNT_16COLOR | BGCNT_TXT256x256; + REG_BG2CNT = BGCNT_PRIORITY(2) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(6) | BGCNT_16COLOR | BGCNT_TXT256x256; + REG_BG0CNT = BGCNT_PRIORITY(0) | BGCNT_CHARBASE(2) | BGCNT_SCREENBASE(31) | BGCNT_16COLOR | BGCNT_TXT256x256; + REG_DISPCNT = DISPCNT_OBJ_ON | DISPCNT_BG3_ON | DISPCNT_BG2_ON | DISPCNT_BG0_ON | DISPCNT_OBJ_1D_MAP | DISPCNT_MODE_0; + gMain.state++; + break; + case 1: + if (!UpdatePaletteFade()) + { + SetMainCallback2(CB2_WipeSave); + SetVBlankCallback(VBlankCB_UpdateClockGraphics); + } + break; } } diff --git a/src/script_menu.c b/src/script_menu.c index eba438397..50941f9ac 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -913,19 +913,19 @@ void task_picbox(u8 taskId) switch (task->data[0]) { - case 0: - task->data[0]++; - break; - case 1: - break; - case 2: - FreeResourcesAndDestroySprite(&gSprites[task->data[2]]); - task->data[0]++; - break; - case 3: - MenuZeroFillWindowRect(task->data[3], task->data[4], task->data[3] + 9, task->data[4] + 10); - DestroyTask(taskId); - break; + case 0: + task->data[0]++; + break; + case 1: + break; + case 2: + FreeResourcesAndDestroySprite(&gSprites[task->data[2]]); + task->data[0]++; + break; + case 3: + MenuZeroFillWindowRect(task->data[3], task->data[4], task->data[3] + 9, task->data[4] + 10); + DestroyTask(taskId); + break; } } diff --git a/src/script_pokemon_util_80C4BF0.c b/src/script_pokemon_util_80C4BF0.c index 912458655..b87f5e956 100644 --- a/src/script_pokemon_util_80C4BF0.c +++ b/src/script_pokemon_util_80C4BF0.c @@ -73,18 +73,18 @@ void sub_80C4C28(void) switch(specialVar) { - case 0: - var = 3; - break; - case 1: - var = 4; - break; - case 2: - var = 5; - break; - default: - var = 100; - break; + case 0: + var = 3; + break; + case 1: + var = 4; + break; + case 2: + var = 5; + break; + default: + var = 100; + break; } gSpecialVar_0x8004 = var; } @@ -103,22 +103,22 @@ void sub_80C4C78(void) switch(gScriptContestCategory) { - case 0: - var = 8; - break; - case 1: - var = 9; - break; - case 2: - var = 10; - break; - case 3: - var = 11; - break; - case 4: - default: - var = 12; - break; + case 0: + var = 8; + break; + case 1: + var = 9; + break; + case 2: + var = 10; + break; + case 3: + var = 11; + break; + case 4: + default: + var = 12; + break; } returnVar = gSaveBlock1.sbStruct.unkSB2.sb1_2EFC_struct2[var].var; @@ -467,26 +467,26 @@ void sub_80C5190(u8 taskId) switch(task->data[0]) { - case 2: - sprite = &gSprites[task->data[2]]; - FreeSpritePaletteByTag(GetSpritePaletteTagByPaletteNum(sprite->oam.paletteNum)); - - if(sprite->oam.affineMode) - FreeOamMatrix(sprite->oam.matrixNum); - - DestroySprite(sprite); - task->data[0]++; - break; - case 0: - task->data[0]++; - break; - case 3: - MenuZeroFillWindowRect(task->data[3], task->data[4], task->data[3] + 9, task->data[4] + 10); - DestroyTask(taskId); - break; - case 1: - default: - break; + case 2: + sprite = &gSprites[task->data[2]]; + FreeSpritePaletteByTag(GetSpritePaletteTagByPaletteNum(sprite->oam.paletteNum)); + + if(sprite->oam.affineMode) + FreeOamMatrix(sprite->oam.matrixNum); + + DestroySprite(sprite); + task->data[0]++; + break; + case 0: + task->data[0]++; + break; + case 3: + MenuZeroFillWindowRect(task->data[3], task->data[4], task->data[3] + 9, task->data[4] + 10); + DestroyTask(taskId); + break; + case 1: + default: + break; } } @@ -593,15 +593,15 @@ void CheckForAlivePartyMons(void) switch(var) { - case 1: - gScriptResult = var; - break; - case 0: - gScriptResult = var; - break; - case 2: - gScriptResult = var; - break; + case 1: + gScriptResult = var; + break; + case 0: + gScriptResult = var; + break; + case 2: + gScriptResult = var; + break; } } @@ -663,12 +663,12 @@ void sub_80C5580(void) switch(var) { - case 0: - gScriptResult = 0; - break; - default: - gScriptResult = 1; - break; + case 0: + gScriptResult = 0; + break; + default: + gScriptResult = 1; + break; } SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music); @@ -686,14 +686,14 @@ void SetBattleTowerPlayerParty(void) switch(var) { - case 0: // player quit battle tower? - LoadPlayerParty(); - gScriptResult = 0; - break; - default: // load battle tower. - ReducePlayerPartyToThree(); - gScriptResult = 1; - break; + case 0: // player quit battle tower? + LoadPlayerParty(); + gScriptResult = 0; + break; + default: // load battle tower. + ReducePlayerPartyToThree(); + gScriptResult = 1; + break; } SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music); diff --git a/src/script_pokemon_util_80F99CC.c b/src/script_pokemon_util_80F99CC.c index ce62f2abb..e1d532b16 100644 --- a/src/script_pokemon_util_80F99CC.c +++ b/src/script_pokemon_util_80F99CC.c @@ -81,62 +81,62 @@ bool8 sub_80F9ACC(void) { switch(EWRAM_1B000.unk264) { - case 0: - if(EWRAM_1B000.unk266 < gPlayerPartyCount) - { - TryCreatePartyMenuMonIcon(EWRAM_1B000.unk260, EWRAM_1B000.unk266, &gPlayerParty[EWRAM_1B000.unk266]); - EWRAM_1B000.unk266++; - } - else - { - EWRAM_1B000.unk266 = 0; - EWRAM_1B000.unk264++; - } - break; - case 1: - LoadHeldItemIconGraphics(); - EWRAM_1B000.unk264++; - break; - case 2: - CreateHeldItemIcons_806DC34(EWRAM_1B000.unk260); - EWRAM_1B000.unk264++; - break; - case 3: - if(sub_806BD58(EWRAM_1B000.unk260, EWRAM_1B000.unk266) != 1) - { - EWRAM_1B000.unk266++; - break; - } - else - { - EWRAM_1B000.unk266 = 0; - EWRAM_1B000.unk264++; - break; - } - case 4: - PartyMenuPrintMonsLevelOrStatus(); + case 0: + if(EWRAM_1B000.unk266 < gPlayerPartyCount) + { + TryCreatePartyMenuMonIcon(EWRAM_1B000.unk260, EWRAM_1B000.unk266, &gPlayerParty[EWRAM_1B000.unk266]); + EWRAM_1B000.unk266++; + } + else + { + EWRAM_1B000.unk266 = 0; EWRAM_1B000.unk264++; + } + break; + case 1: + LoadHeldItemIconGraphics(); + EWRAM_1B000.unk264++; + break; + case 2: + CreateHeldItemIcons_806DC34(EWRAM_1B000.unk260); + EWRAM_1B000.unk264++; + break; + case 3: + if(sub_806BD58(EWRAM_1B000.unk260, EWRAM_1B000.unk266) != 1) + { + EWRAM_1B000.unk266++; break; - case 5: - PrintPartyMenuMonNicknames(); + } + else + { + EWRAM_1B000.unk266 = 0; EWRAM_1B000.unk264++; break; - case 6: - sub_80F9C00(); - EWRAM_1B000.unk264++; + } + case 4: + PartyMenuPrintMonsLevelOrStatus(); + EWRAM_1B000.unk264++; + break; + case 5: + PrintPartyMenuMonNicknames(); + EWRAM_1B000.unk264++; + break; + case 6: + sub_80F9C00(); + EWRAM_1B000.unk264++; + break; + case 7: // the only case that can return true. + if(sub_806B58C(EWRAM_1B000.unk266) != 1) + { + EWRAM_1B000.unk266++; break; - case 7: // the only case that can return true. - if(sub_806B58C(EWRAM_1B000.unk266) != 1) - { - EWRAM_1B000.unk266++; - break; - } - else - { - EWRAM_1B000.unk266 = 0; - EWRAM_1B000.unk264 = 0; - return TRUE; - } + } + else + { + EWRAM_1B000.unk266 = 0; + EWRAM_1B000.unk264 = 0; + return TRUE; + } } return FALSE; } @@ -149,15 +149,15 @@ void sub_80F9C00(void) { switch(sub_80AE47C(&gPlayerParty[i])) { - case 0: - case 3: - case 4: - sub_806BC3C(i, 0x7E); - break; - case 1: - case 2: - sub_806BC3C(i, 0x70); - break; + case 0: + case 3: + case 4: + sub_806BC3C(i, 0x7E); + break; + case 1: + case 2: + sub_806BC3C(i, 0x70); + break; } } } @@ -168,18 +168,18 @@ void sub_80F9C6C(u8 var) { switch(sub_806BD80(var)) { - case 1: - PlaySE(5); - gUnknown_02038694 = sub_806CA38(var); - gSpecialVar_0x8004 = gUnknown_02038694; - sub_8123138(var); - break; - case 2: - PlaySE(5); - gUnknown_02038694 = 0xFF; - gSpecialVar_0x8004 = 0xFF; - sub_8123138(var); - break; + case 1: + PlaySE(5); + gUnknown_02038694 = sub_806CA38(var); + gSpecialVar_0x8004 = gUnknown_02038694; + sub_8123138(var); + break; + case 2: + PlaySE(5); + gUnknown_02038694 = 0xFF; + gSpecialVar_0x8004 = 0xFF; + sub_8123138(var); + break; } } } @@ -188,62 +188,62 @@ bool8 sub_80F9CE8(void) // this is the same function as sub_80F9ACC except case { switch(EWRAM_1B000.unk264) { - case 0: - if(EWRAM_1B000.unk266 < gPlayerPartyCount) - { - TryCreatePartyMenuMonIcon(EWRAM_1B000.unk260, EWRAM_1B000.unk266, &gPlayerParty[EWRAM_1B000.unk266]); - EWRAM_1B000.unk266++; - } - else - { - EWRAM_1B000.unk266 = 0; - EWRAM_1B000.unk264++; - } - break; - case 1: - LoadHeldItemIconGraphics(); - EWRAM_1B000.unk264++; - break; - case 2: - CreateHeldItemIcons_806DC34(EWRAM_1B000.unk260); - EWRAM_1B000.unk264++; - break; - case 3: - if(sub_806BD58(EWRAM_1B000.unk260, EWRAM_1B000.unk266) != 1) - { - EWRAM_1B000.unk266++; - break; - } - else - { - EWRAM_1B000.unk266 = 0; - EWRAM_1B000.unk264++; - break; - } - case 4: - PartyMenuPrintMonsLevelOrStatus(); + case 0: + if(EWRAM_1B000.unk266 < gPlayerPartyCount) + { + TryCreatePartyMenuMonIcon(EWRAM_1B000.unk260, EWRAM_1B000.unk266, &gPlayerParty[EWRAM_1B000.unk266]); + EWRAM_1B000.unk266++; + } + else + { + EWRAM_1B000.unk266 = 0; EWRAM_1B000.unk264++; + } + break; + case 1: + LoadHeldItemIconGraphics(); + EWRAM_1B000.unk264++; + break; + case 2: + CreateHeldItemIcons_806DC34(EWRAM_1B000.unk260); + EWRAM_1B000.unk264++; + break; + case 3: + if(sub_806BD58(EWRAM_1B000.unk260, EWRAM_1B000.unk266) != 1) + { + EWRAM_1B000.unk266++; break; - case 5: - PrintPartyMenuMonNicknames(); + } + else + { + EWRAM_1B000.unk266 = 0; EWRAM_1B000.unk264++; break; - case 6: - sub_80F9E1C(); - EWRAM_1B000.unk264++; + } + case 4: + PartyMenuPrintMonsLevelOrStatus(); + EWRAM_1B000.unk264++; + break; + case 5: + PrintPartyMenuMonNicknames(); + EWRAM_1B000.unk264++; + break; + case 6: + sub_80F9E1C(); + EWRAM_1B000.unk264++; + break; + case 7: // the only case that can return true. + if(sub_806B58C(EWRAM_1B000.unk266) != 1) + { + EWRAM_1B000.unk266++; break; - case 7: // the only case that can return true. - if(sub_806B58C(EWRAM_1B000.unk266) != 1) - { - EWRAM_1B000.unk266++; - break; - } - else - { - EWRAM_1B000.unk266 = 0; - EWRAM_1B000.unk264 = 0; - return TRUE; - } + } + else + { + EWRAM_1B000.unk266 = 0; + EWRAM_1B000.unk264 = 0; + return TRUE; + } } return FALSE; } @@ -267,16 +267,16 @@ void sub_80F9E64(u8 var) { switch(sub_806BD80(var)) { - case 1: - PlaySE(5); - gSpecialVar_0x8004 = sub_806CA38(var); - gSpecialVar_0x8005 = sub_8040574(&gPlayerParty[gSpecialVar_0x8004]); - sub_8123138(var); - break; - case 2: - PlaySE(5); - gSpecialVar_0x8004 = 0xFF; - sub_8123138(var); + case 1: + PlaySE(5); + gSpecialVar_0x8004 = sub_806CA38(var); + gSpecialVar_0x8005 = sub_8040574(&gPlayerParty[gSpecialVar_0x8004]); + sub_8123138(var); + break; + case 2: + PlaySE(5); + gSpecialVar_0x8004 = 0xFF; + sub_8123138(var); } } } diff --git a/src/secret_base.c b/src/secret_base.c index 2769806f6..c210a55d2 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -237,24 +237,24 @@ void sub_80BBA48(u8 taskid) { u16 curbaseid; switch (gTasks[taskid].data[0]) { - case 0: - gTasks[taskid].data[0] = 1; - break; - case 1: - if (!gPaletteFade.active) { - gTasks[taskid].data[0] = 2; - } - break; - case 2: - curbaseid = VarGet(VAR_0x4054); - if (gSaveBlock1.secretBases[curbaseid].sbr_field_10 < 0xff) - gSaveBlock1.secretBases[curbaseid].sbr_field_10 ++; - sub_80BBA14(); - warp_in(); - gUnknown_0300485C = sub_8080990; - SetMainCallback2(CB2_LoadMap); - DestroyTask(taskid); - break; + case 0: + gTasks[taskid].data[0] = 1; + break; + case 1: + if (!gPaletteFade.active) { + gTasks[taskid].data[0] = 2; + } + break; + case 2: + curbaseid = VarGet(VAR_0x4054); + if (gSaveBlock1.secretBases[curbaseid].sbr_field_10 < 0xff) + gSaveBlock1.secretBases[curbaseid].sbr_field_10 ++; + sub_80BBA14(); + warp_in(); + gUnknown_0300485C = sub_8080990; + SetMainCallback2(CB2_LoadMap); + DestroyTask(taskid); + break; } } @@ -782,23 +782,23 @@ bool8 sub_80BC050(void) void sub_80BC074(u8 taskid) { switch (gTasks[taskid].data[0]) { - case 0: - ScriptContext2_Enable(); - gTasks[taskid].data[0] = 1; - break; - case 1: - if (!gPaletteFade.active) { - gTasks[taskid].data[0] = 2; - } - break; - case 2: - copy_saved_warp2_bank_and_enter_x_to_warp1(0x7E); - warp_in(); - gUnknown_0300485C = mapldr_default; - SetMainCallback2(CB2_LoadMap); - ScriptContext2_Disable(); - DestroyTask(taskid); - break; + case 0: + ScriptContext2_Enable(); + gTasks[taskid].data[0] = 1; + break; + case 1: + if (!gPaletteFade.active) { + gTasks[taskid].data[0] = 2; + } + break; + case 2: + copy_saved_warp2_bank_and_enter_x_to_warp1(0x7E); + warp_in(); + gUnknown_0300485C = mapldr_default; + SetMainCallback2(CB2_LoadMap); + ScriptContext2_Disable(); + DestroyTask(taskid); + break; } } diff --git a/src/shop.c b/src/shop.c index 780dff02a..9f4a360df 100644 --- a/src/shop.c +++ b/src/shop.c @@ -342,17 +342,17 @@ void BuyMenuDrawMapMetatile(int var1, int var2, u16 *var3, s8 var4) switch(tempVar4) { - case 0: // _080B335C - BuyMenuDrawMapMetatileLayer(gBGTilemapBuffers[2], offset1, offset2, var3); - BuyMenuDrawMapMetatileLayer(gBGTilemapBuffers[1], offset1, offset2, var3 + 4); - break; - case 1: // _080B3364 - BuyMenuDrawMapMetatileLayer(gBGTilemapBuffers[3], offset1, offset2, var3); - BuyMenuDrawMapMetatileLayer(gBGTilemapBuffers[2], offset1, offset2, var3 + 4); - break; - case 2: // _080B3398 - BuyMenuDrawMapMetatileLayer(gBGTilemapBuffers[3], offset1, offset2, var3); - BuyMenuDrawMapMetatileLayer(gBGTilemapBuffers[1], offset1, offset2, var3 + 4); - break; + case 0: // _080B335C + BuyMenuDrawMapMetatileLayer(gBGTilemapBuffers[2], offset1, offset2, var3); + BuyMenuDrawMapMetatileLayer(gBGTilemapBuffers[1], offset1, offset2, var3 + 4); + break; + case 1: // _080B3364 + BuyMenuDrawMapMetatileLayer(gBGTilemapBuffers[3], offset1, offset2, var3); + BuyMenuDrawMapMetatileLayer(gBGTilemapBuffers[2], offset1, offset2, var3 + 4); + break; + case 2: // _080B3398 + BuyMenuDrawMapMetatileLayer(gBGTilemapBuffers[3], offset1, offset2, var3); + BuyMenuDrawMapMetatileLayer(gBGTilemapBuffers[1], offset1, offset2, var3 + 4); + break; } } diff --git a/src/start_menu.c b/src/start_menu.c index 37d361c0b..8d7e50ea5 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -227,30 +227,30 @@ static bool32 InitStartMenuMultistep(s16 *step, s16 *index) { switch (*step) { - case 1: - BuildStartMenuActions(); + case 1: + BuildStartMenuActions(); + (*step)++; + break; + case 2: + MenuDrawTextWindow(22, 0, 29, sNumStartMenuActions * 2 + 3); + *index = 0; + (*step)++; + break; + case 3: + if (GetSafariZoneFlag()) + DisplaySafariBallsWindow(); + (*step)++; + break; + case 4: + if (PrintStartMenuItemsMultistep(index, 2)) (*step)++; - break; - case 2: - MenuDrawTextWindow(22, 0, 29, sNumStartMenuActions * 2 + 3); - *index = 0; - (*step)++; - break; - case 3: - if (GetSafariZoneFlag()) - DisplaySafariBallsWindow(); - (*step)++; - break; - case 4: - if (PrintStartMenuItemsMultistep(index, 2)) - (*step)++; - break; - case 0: - (*step)++; - break; - case 5: - sStartMenuCursorPos = InitMenu(0, 0x17, 2, sNumStartMenuActions, sStartMenuCursorPos, 6); - return TRUE; + break; + case 0: + (*step)++; + break; + case 5: + sStartMenuCursorPos = InitMenu(0, 0x17, 2, sNumStartMenuActions, sStartMenuCursorPos, 6); + return TRUE; } return FALSE; } @@ -288,14 +288,14 @@ void sub_80712B4(u8 taskId) switch (task->data[0]) { - case 0: - gCallback_03004AE8 = StartMenu_InputProcessCallback; - task->data[0]++; - break; - case 1: - if (gCallback_03004AE8() == 1) - DestroyTask(taskId); - break; + case 0: + gCallback_03004AE8 = StartMenu_InputProcessCallback; + task->data[0]++; + break; + case 1: + if (gCallback_03004AE8() == 1) + DestroyTask(taskId); + break; } } @@ -475,20 +475,20 @@ static u8 SaveCallback2(void) { switch (RunSaveDialogCallback()) { - case SAVE_IN_PROGRESS: - return FALSE; - case SAVE_CANCELED: - //Go back to start menu - MenuZeroFillScreen(); - InitStartMenu(); - gCallback_03004AE8 = StartMenu_InputProcessCallback; - return FALSE; - case SAVE_SUCCESS: - case SAVE_ERROR: - MenuZeroFillScreen(); - sub_8064E2C(); - ScriptContext2_Disable(); - return TRUE; + case SAVE_IN_PROGRESS: + return FALSE; + case SAVE_CANCELED: + //Go back to start menu + MenuZeroFillScreen(); + InitStartMenu(); + gCallback_03004AE8 = StartMenu_InputProcessCallback; + return FALSE; + case SAVE_SUCCESS: + case SAVE_ERROR: + MenuZeroFillScreen(); + sub_8064E2C(); + ScriptContext2_Disable(); + return TRUE; } return FALSE; } @@ -532,15 +532,15 @@ static void Task_SaveDialog(u8 taskId) switch (status) { - case SAVE_CANCELED: - case SAVE_ERROR: - gScriptResult = 0; - break; - case SAVE_SUCCESS: - gScriptResult = status; - break; - case SAVE_IN_PROGRESS: - return; + case SAVE_CANCELED: + case SAVE_ERROR: + gScriptResult = 0; + break; + case SAVE_SUCCESS: + gScriptResult = status; + break; + case SAVE_IN_PROGRESS: + return; } DestroyTask(taskId); EnableBothScriptContexts(); @@ -602,29 +602,29 @@ static u8 SaveDialogCB_ProcessConfirmYesNoMenu(void) { switch (ProcessMenuInputNoWrap_()) { - case 0: //YES - HideSaveDialog(); - switch (gSaveFileStatus) + case 0: //YES + HideSaveDialog(); + switch (gSaveFileStatus) + { + case 0: + case 2: + if (gDifferentSaveFile == FALSE) { - case 0: - case 2: - if (gDifferentSaveFile == FALSE) - { - saveDialogCallback = SaveDialogCB_SaveFileExists; - return SAVE_IN_PROGRESS; - } - saveDialogCallback = SaveDialogCB_DisplaySavingMessage; - return SAVE_IN_PROGRESS; - default: - saveDialogCallback = SaveDialogCB_SaveFileExists; - return SAVE_IN_PROGRESS; + saveDialogCallback = SaveDialogCB_SaveFileExists; + return SAVE_IN_PROGRESS; } - break; - case -1: //B button - case 1: //NO - HideSaveDialog(); - sub_8071700(); - return SAVE_CANCELED; + saveDialogCallback = SaveDialogCB_DisplaySavingMessage; + return SAVE_IN_PROGRESS; + default: + saveDialogCallback = SaveDialogCB_SaveFileExists; + return SAVE_IN_PROGRESS; + } + break; + case -1: //B button + case 1: //NO + HideSaveDialog(); + sub_8071700(); + return SAVE_CANCELED; } return SAVE_IN_PROGRESS; } @@ -648,15 +648,15 @@ static u8 SaveDialogCB_ProcessOverwriteYesNoMenu(void) { switch (ProcessMenuInputNoWrap_()) { - case 0: //YES - HideSaveDialog(); - saveDialogCallback = SaveDialogCB_DisplaySavingMessage; - break; - case -1: //B button - case 1: //NO - HideSaveDialog(); - sub_8071700(); - return SAVE_CANCELED; + case 0: //YES + HideSaveDialog(); + saveDialogCallback = SaveDialogCB_DisplaySavingMessage; + break; + case -1: //B button + case 1: //NO + HideSaveDialog(); + sub_8071700(); + return SAVE_CANCELED; } return SAVE_IN_PROGRESS; } @@ -749,55 +749,55 @@ static bool32 sub_80719FC(u8 *step) { switch (*step) { - case 0: + case 0: + { + u8 *addr; + u32 size; + + REG_DISPCNT = 0; + SetVBlankCallback(NULL); + remove_some_task(); + DmaClear16(3, PLTT, PLTT_SIZE); + addr = (void *)VRAM; + size = 0x18000; + while (1) { - u8 *addr; - u32 size; - - REG_DISPCNT = 0; - SetVBlankCallback(NULL); - remove_some_task(); - DmaClear16(3, PLTT, PLTT_SIZE); - addr = (void *)VRAM; - size = 0x18000; - while (1) + DmaFill16(3, 0, addr, 0x1000); + addr += 0x1000; + size -= 0x1000; + if (size <= 0x1000) { - DmaFill16(3, 0, addr, 0x1000); - addr += 0x1000; - size -= 0x1000; - if (size <= 0x1000) - { - DmaFill16(3, 0, addr, size); - break; - } + DmaFill16(3, 0, addr, size); + break; } - break; } - case 1: - ResetSpriteData(); - ResetTasks(); - ResetPaletteFade(); - dp12_8087EA4(); - break; - case 2: - SetUpWindowConfig(&gWindowConfig_81E6CE4); - InitMenuWindow(&gWindowConfig_81E6CE4); - REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_BG0_ON; - break; - case 3: - { - u32 savedIme; - - BlendPalettes(-1, 0x10, 0); - SetVBlankCallback(sub_80719F0); - savedIme = REG_IME; - REG_IME = 0; - REG_IE |= 1; - REG_IME = savedIme; - break; - } - case 4: - return TRUE; + break; + } + case 1: + ResetSpriteData(); + ResetTasks(); + ResetPaletteFade(); + dp12_8087EA4(); + break; + case 2: + SetUpWindowConfig(&gWindowConfig_81E6CE4); + InitMenuWindow(&gWindowConfig_81E6CE4); + REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_BG0_ON; + break; + case 3: + { + u32 savedIme; + + BlendPalettes(-1, 0x10, 0); + SetVBlankCallback(sub_80719F0); + savedIme = REG_IME; + REG_IME = 0; + REG_IE |= 1; + REG_IME = savedIme; + break; + } + case 4: + return TRUE; } (*step)++; return FALSE; @@ -826,31 +826,31 @@ static void Task_8071B64(u8 taskId) { switch (*step) { - case 0: - MenuDisplayMessageBox(); - MenuPrint(gSystemText_Saving, 2, 15); - BeginNormalPaletteFade(-1, 0, 0x10, 0, 0); - (*step)++; - break; - case 1: - SetSecretBase2Field_9_AndHideBG(); - sub_8125E2C(); - (*step)++; - break; - case 2: - if (!sub_8125E6C()) - break; - ClearSecretBase2Field_9_2(); - (*step)++; - break; - case 3: - BeginNormalPaletteFade(-1, 0, 0, 0x10, 0); - (*step)++; - break; - case 4: - SetMainCallback2(gMain.savedCallback); - DestroyTask(taskId); + case 0: + MenuDisplayMessageBox(); + MenuPrint(gSystemText_Saving, 2, 15); + BeginNormalPaletteFade(-1, 0, 0x10, 0, 0); + (*step)++; + break; + case 1: + SetSecretBase2Field_9_AndHideBG(); + sub_8125E2C(); + (*step)++; + break; + case 2: + if (!sub_8125E6C()) break; + ClearSecretBase2Field_9_2(); + (*step)++; + break; + case 3: + BeginNormalPaletteFade(-1, 0, 0, 0x10, 0); + (*step)++; + break; + case 4: + SetMainCallback2(gMain.savedCallback); + DestroyTask(taskId); + break; } } } diff --git a/src/starter_choose.c b/src/starter_choose.c index 6ef410d21..4b857dba6 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -448,26 +448,26 @@ static void Task_StarterChoose5(u8 taskId) switch (ProcessMenuInputNoWrap_()) { - case 0: // YES - //Return the starter choice and exit. - gScriptResult = gTasks[taskId].tStarterSelection; - SetMainCallback2(gMain.savedCallback); - break; - case 1: // NO - case -1: // B button - PlaySE(SE_SELECT); - MenuZeroFillWindowRect(21, 7, 27, 12); - - spriteId = gTasks[taskId].tPkmnSpriteId; - FreeSpritePaletteByTag(GetSpritePaletteTagByPaletteNum(gSprites[spriteId].oam.paletteNum)); - FreeOamMatrix(gSprites[spriteId].oam.matrixNum); - DestroySprite(&gSprites[spriteId]); - - spriteId = gTasks[taskId].tCircleSpriteId; - FreeOamMatrix(gSprites[spriteId].oam.matrixNum); - DestroySprite(&gSprites[spriteId]); - gTasks[taskId].func = Task_StarterChoose6; - break; + case 0: // YES + //Return the starter choice and exit. + gScriptResult = gTasks[taskId].tStarterSelection; + SetMainCallback2(gMain.savedCallback); + break; + case 1: // NO + case -1: // B button + PlaySE(SE_SELECT); + MenuZeroFillWindowRect(21, 7, 27, 12); + + spriteId = gTasks[taskId].tPkmnSpriteId; + FreeSpritePaletteByTag(GetSpritePaletteTagByPaletteNum(gSprites[spriteId].oam.paletteNum)); + FreeOamMatrix(gSprites[spriteId].oam.matrixNum); + DestroySprite(&gSprites[spriteId]); + + spriteId = gTasks[taskId].tCircleSpriteId; + FreeOamMatrix(gSprites[spriteId].oam.matrixNum); + DestroySprite(&gSprites[spriteId]); + gTasks[taskId].func = Task_StarterChoose6; + break; } } diff --git a/src/text.c b/src/text.c index 7be72833a..02cafea48 100644 --- a/src/text.c +++ b/src/text.c @@ -1755,21 +1755,21 @@ u16 InitWindowTileData(struct Window *win, u16 startOffset) case 1: switch (win->config->fontNum) { - case 0: - case 3: - retVal = LoadFixedWidthFont(win, startOffset); - break; - case 1: - case 2: - retVal = LoadFixedWidthFont_Font1Latin(win, startOffset); - break; - case 4: - case 5: - retVal = LoadFixedWidthFont_Font4Latin(win, startOffset); - break; - case 6: - retVal = LoadFixedWidthFont_Braille(win, startOffset); - break; + case 0: + case 3: + retVal = LoadFixedWidthFont(win, startOffset); + break; + case 1: + case 2: + retVal = LoadFixedWidthFont_Font1Latin(win, startOffset); + break; + case 4: + case 5: + retVal = LoadFixedWidthFont_Font4Latin(win, startOffset); + break; + case 6: + retVal = LoadFixedWidthFont_Braille(win, startOffset); + break; } break; } @@ -1888,30 +1888,30 @@ static void MultistepLoadFont_LoadGlyph(struct Window *win, u16 startOffset, u8 switch (win->config->fontNum) { - case 0: - case 3: - buffer = win->tileData + 32 * startOffset + 64 * glyph; - LoadFixedWidthGlyph(win, glyph, buffer); - break; - case 1: - case 2: - buffer = win->tileData + 32 * (glyph + startOffset); - ApplyColors_UnshadowedFont( - &sFont1LatinGlyphs[8 * glyph], - (u32 *)buffer, - win->foregroundColor, - win->backgroundColor); - break; - case 4: - case 5: - buffer = win->tileData + 32 * (glyph + startOffset); - ApplyColors_ShadowedFont( - &gFont4LatinGlyphs[8 * glyph], - buffer, - win->foregroundColor, - win->shadowColor, - win->backgroundColor); - break; + case 0: + case 3: + buffer = win->tileData + 32 * startOffset + 64 * glyph; + LoadFixedWidthGlyph(win, glyph, buffer); + break; + case 1: + case 2: + buffer = win->tileData + 32 * (glyph + startOffset); + ApplyColors_UnshadowedFont( + &sFont1LatinGlyphs[8 * glyph], + (u32 *)buffer, + win->foregroundColor, + win->backgroundColor); + break; + case 4: + case 5: + buffer = win->tileData + 32 * (glyph + startOffset); + ApplyColors_ShadowedFont( + &gFont4LatinGlyphs[8 * glyph], + buffer, + win->foregroundColor, + win->shadowColor, + win->backgroundColor); + break; } } diff --git a/src/tv.c b/src/tv.c index ea1f13047..dfda14d82 100644 --- a/src/tv.c +++ b/src/tv.c @@ -157,61 +157,61 @@ extern u8 GabbyAndTyGetBattleNum(void); void GabbyAndTySetScriptVarsToFieldObjectLocalIds(void) { switch (GabbyAndTyGetBattleNum()) { - case 1: - gSpecialVar_0x8004 = 0xE; - gSpecialVar_0x8005 = 0xD; - break; - case 2: - gSpecialVar_0x8004 = 0x5; - gSpecialVar_0x8005 = 0x6; - break; - case 3: - gSpecialVar_0x8004 = 0x12; - gSpecialVar_0x8005 = 0x11; - break; - case 4: - gSpecialVar_0x8004 = 0x15; - gSpecialVar_0x8005 = 0x16; - break; - case 5: - gSpecialVar_0x8004 = 0x8; - gSpecialVar_0x8005 = 0x9; - break; - case 6: - gSpecialVar_0x8004 = 0x13; - gSpecialVar_0x8005 = 0x14; - break; - case 7: - gSpecialVar_0x8004 = 0x17; - gSpecialVar_0x8005 = 0x18; - break; - case 8: - gSpecialVar_0x8004 = 0xA; - gSpecialVar_0x8005 = 0xB; - break; + case 1: + gSpecialVar_0x8004 = 0xE; + gSpecialVar_0x8005 = 0xD; + break; + case 2: + gSpecialVar_0x8004 = 0x5; + gSpecialVar_0x8005 = 0x6; + break; + case 3: + gSpecialVar_0x8004 = 0x12; + gSpecialVar_0x8005 = 0x11; + break; + case 4: + gSpecialVar_0x8004 = 0x15; + gSpecialVar_0x8005 = 0x16; + break; + case 5: + gSpecialVar_0x8004 = 0x8; + gSpecialVar_0x8005 = 0x9; + break; + case 6: + gSpecialVar_0x8004 = 0x13; + gSpecialVar_0x8005 = 0x14; + break; + case 7: + gSpecialVar_0x8004 = 0x17; + gSpecialVar_0x8005 = 0x18; + break; + case 8: + gSpecialVar_0x8004 = 0xA; + gSpecialVar_0x8005 = 0xB; + break; } } void sub_80BDE48(void) { switch (gSpecialVar_0x8005) { - case TVSHOW_FAN_CLUB_LETTER: - sub_80BE5FC(); - break; - case TVSHOW_RECENT_HAPPENINGS: - sub_80BE65C(); - break; - case TVSHOW_PKMN_FAN_CLUB_OPINIONS: - sub_80BE6A0(); - break; - case TVSHOW_UNKN_SHOWTYPE_04: - nullsub_21(); - break; - case TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE: - sub_80BE188(); - break; - case TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE: - sub_80BE320(); - break; + case TVSHOW_FAN_CLUB_LETTER: + sub_80BE5FC(); + break; + case TVSHOW_RECENT_HAPPENINGS: + sub_80BE65C(); + break; + case TVSHOW_PKMN_FAN_CLUB_OPINIONS: + sub_80BE6A0(); + break; + case TVSHOW_UNKN_SHOWTYPE_04: + nullsub_21(); + break; + case TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE: + sub_80BE188(); + break; + case TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE: + sub_80BE320(); + break; } } @@ -1025,28 +1025,28 @@ bool8 IsPriceDiscounted(u8 arg0) { switch (arg0) { - case 1: - if (gSaveBlock1.location.mapGroup == MAP_GROUP_SLATEPORT_CITY && gSaveBlock1.location.mapNum == MAP_ID_SLATEPORT_CITY && gScriptLastTalked == 0x1a) - { - return TRUE; - } - else - { - return FALSE; - } - break; - case 3: - if (gSaveBlock1.location.mapGroup == MAP_GROUP_LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP && gSaveBlock1.location.mapNum == MAP_ID_LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP) - { - return TRUE; - } - else - { - return FALSE; - } - break; - default: + case 1: + if (gSaveBlock1.location.mapGroup == MAP_GROUP_SLATEPORT_CITY && gSaveBlock1.location.mapNum == MAP_ID_SLATEPORT_CITY && gScriptLastTalked == 0x1a) + { + return TRUE; + } + else + { + return FALSE; + } + break; + case 3: + if (gSaveBlock1.location.mapGroup == MAP_GROUP_LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP && gSaveBlock1.location.mapNum == MAP_ID_LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP) + { return TRUE; + } + else + { + return FALSE; + } + break; + default: + return TRUE; } } @@ -1098,18 +1098,18 @@ void sub_80BEF10(u8 strvaridx, u8 rank) { switch (rank) { - case NORMAL_RANK: - StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[NORMAL_RANK + 5]); - break; - case SUPER_RANK: - StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[SUPER_RANK + 5]); - break; - case HYPER_RANK: - StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[HYPER_RANK + 5]); - break; - case MASTER_RANK: - StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[MASTER_RANK + 5]); - break; + case NORMAL_RANK: + StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[NORMAL_RANK + 5]); + break; + case SUPER_RANK: + StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[SUPER_RANK + 5]); + break; + case HYPER_RANK: + StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[HYPER_RANK + 5]); + break; + case MASTER_RANK: + StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[MASTER_RANK + 5]); + break; } } @@ -1117,21 +1117,21 @@ void CopyContestCategoryToStringVar(u8 strvaridx, u8 category) { switch (category) { - case CONTEST_COOL: - StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[CONTEST_COOL]); - break; - case CONTEST_BEAUTY: - StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[CONTEST_BEAUTY]); - break; - case CONTEST_CUTE: - StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[CONTEST_CUTE]); - break; - case CONTEST_SMART: - StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[CONTEST_SMART]); - break; - case CONTEST_TOUGH: - StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[CONTEST_TOUGH]); - break; + case CONTEST_COOL: + StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[CONTEST_COOL]); + break; + case CONTEST_BEAUTY: + StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[CONTEST_BEAUTY]); + break; + case CONTEST_CUTE: + StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[CONTEST_CUTE]); + break; + case CONTEST_SMART: + StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[CONTEST_SMART]); + break; + case CONTEST_TOUGH: + StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[CONTEST_TOUGH]); + break; } } @@ -1260,27 +1260,27 @@ void sub_80BF2C4(void) { gScriptResult = 0; switch (gSpecialVar_0x8005) { - case TVSHOW_FAN_CLUB_LETTER: - sub_80BF334(); - break; - case TVSHOW_RECENT_HAPPENINGS: - sub_80BF3A4(); - break; - case TVSHOW_PKMN_FAN_CLUB_OPINIONS: - sub_80BF3DC(); - break; - case TVSHOW_UNKN_SHOWTYPE_04: - sub_80BF46C(); - break; - case TVSHOW_NAME_RATER_SHOW: - sub_80BF478(); - break; - case TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE: - sub_80BF484(); - break; - case TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE: - sub_80BF4BC(); - break; + case TVSHOW_FAN_CLUB_LETTER: + sub_80BF334(); + break; + case TVSHOW_RECENT_HAPPENINGS: + sub_80BF3A4(); + break; + case TVSHOW_PKMN_FAN_CLUB_OPINIONS: + sub_80BF3DC(); + break; + case TVSHOW_UNKN_SHOWTYPE_04: + sub_80BF46C(); + break; + case TVSHOW_NAME_RATER_SHOW: + sub_80BF478(); + break; + case TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE: + sub_80BF484(); + break; + case TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE: + sub_80BF4BC(); + break; } } @@ -1827,18 +1827,18 @@ void sub_80BFD44(u8 *arg0, u32 arg1, u8 arg2) } ewramTVShows = &gUnknown_02007000; switch (arg2) { - case 0: - sub_80BFE24(&gSaveBlock1.tvShows, &ewramTVShows->tvshows[1], &ewramTVShows->tvshows[2], &ewramTVShows->tvshows[3]); - break; - case 1: - sub_80BFE24(&ewramTVShows->tvshows[0], &gSaveBlock1.tvShows, &ewramTVShows->tvshows[2], &ewramTVShows->tvshows[3]); - break; - case 2: - sub_80BFE24(&ewramTVShows->tvshows[0], &ewramTVShows->tvshows[1], &gSaveBlock1.tvShows, &ewramTVShows->tvshows[3]); - break; - case 3: - sub_80BFE24(&ewramTVShows->tvshows[0], &ewramTVShows->tvshows[1], &ewramTVShows->tvshows[2], &gSaveBlock1.tvShows); - break; + case 0: + sub_80BFE24(&gSaveBlock1.tvShows, &ewramTVShows->tvshows[1], &ewramTVShows->tvshows[2], &ewramTVShows->tvshows[3]); + break; + case 1: + sub_80BFE24(&ewramTVShows->tvshows[0], &gSaveBlock1.tvShows, &ewramTVShows->tvshows[2], &ewramTVShows->tvshows[3]); + break; + case 2: + sub_80BFE24(&ewramTVShows->tvshows[0], &ewramTVShows->tvshows[1], &gSaveBlock1.tvShows, &ewramTVShows->tvshows[3]); + break; + case 3: + sub_80BFE24(&ewramTVShows->tvshows[0], &ewramTVShows->tvshows[1], &ewramTVShows->tvshows[2], &gSaveBlock1.tvShows); + break; } sub_80BF588(gSaveBlock1.tvShows.shows); sub_80C04A0(); @@ -1899,15 +1899,15 @@ bool8 sub_80BFF68(struct SaveTVStruct ** arg1, struct SaveTVStruct ** arg2, u8 i value = FALSE; switchval = sub_80BFB54(tv2->shows[gUnknown_03000722].common.var00); switch (switchval) { - case 2: - value = sub_80C004C(&tv1->shows[gUnknown_03005D38.var0], &tv2->shows[gUnknown_03000722], idx); - break; - case 3: - value = sub_80C00B4(&tv1->shows[gUnknown_03005D38.var0], &tv2->shows[gUnknown_03000722], idx); - break; - case 4: - value = sub_80C0134(&tv1->shows[gUnknown_03005D38.var0], &tv2->shows[gUnknown_03000722], idx); - break; + case 2: + value = sub_80C004C(&tv1->shows[gUnknown_03005D38.var0], &tv2->shows[gUnknown_03000722], idx); + break; + case 3: + value = sub_80C00B4(&tv1->shows[gUnknown_03005D38.var0], &tv2->shows[gUnknown_03000722], idx); + break; + case 4: + value = sub_80C0134(&tv1->shows[gUnknown_03005D38.var0], &tv2->shows[gUnknown_03000722], idx); + break; } if (value == TRUE) { sub_80BF55C(tv2->shows, gUnknown_03000722); @@ -2102,50 +2102,50 @@ void sub_80C01D4(void) { u8 i; for (i=0; i<24; i++) { switch (gSaveBlock1.tvShows.shows[i].common.var00) { - case 0: - break; - case TVSHOW_FAN_CLUB_LETTER: - sub_80C03C8(gSaveBlock1.tvShows.shows[i].fanclubLetter.species, i); - break; - case TVSHOW_RECENT_HAPPENINGS: - break; - case TVSHOW_PKMN_FAN_CLUB_OPINIONS: - sub_80C03C8(gSaveBlock1.tvShows.shows[i].fanclubOpinions.var02, i); - break; - case TVSHOW_UNKN_SHOWTYPE_04: - sub_80C03C8(gSaveBlock1.tvShows.shows[i].worldOfMasters.var06, i); - break; - case TVSHOW_NAME_RATER_SHOW: - sub_80C03C8(gSaveBlock1.tvShows.shows[i].nameRaterShow.species, i); - sub_80C03C8(gSaveBlock1.tvShows.shows[i].nameRaterShow.var1C, i); - break; - case TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE: - sub_80C03C8(gSaveBlock1.tvShows.shows[i].bravoTrainer.species, i); - break; - case TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE: - sub_80C03C8(gSaveBlock1.tvShows.shows[i].bravoTrainerTower.var0a, i); - sub_80C03C8(gSaveBlock1.tvShows.shows[i].bravoTrainerTower.var14, i); - break; - case TVSHOW_POKEMON_TODAY_CAUGHT: - sub_80C03C8(gSaveBlock1.tvShows.shows[i].pokemonToday.species, i); - break; - case TVSHOW_SMART_SHOPPER: - break; - case TVSHOW_POKEMON_TODAY_FAILED: - sub_80C03C8(gSaveBlock1.tvShows.shows[i].pokemonTodayFailed.species, i); - sub_80C03C8(gSaveBlock1.tvShows.shows[i].pokemonTodayFailed.species2, i); - break; - case TVSHOW_FISHING_ADVICE: - sub_80C03C8(gSaveBlock1.tvShows.shows[i].pokemonAngler.var04, i); - break; - case TVSHOW_WORLD_OF_MASTERS: - sub_80C03C8(gSaveBlock1.tvShows.shows[i].worldOfMasters.var08, i); - sub_80C03C8(gSaveBlock1.tvShows.shows[i].worldOfMasters.var04, i); - break; - case TVSHOW_MASS_OUTBREAK: - break; - default: - sub_80C03A8(i); + case 0: + break; + case TVSHOW_FAN_CLUB_LETTER: + sub_80C03C8(gSaveBlock1.tvShows.shows[i].fanclubLetter.species, i); + break; + case TVSHOW_RECENT_HAPPENINGS: + break; + case TVSHOW_PKMN_FAN_CLUB_OPINIONS: + sub_80C03C8(gSaveBlock1.tvShows.shows[i].fanclubOpinions.var02, i); + break; + case TVSHOW_UNKN_SHOWTYPE_04: + sub_80C03C8(gSaveBlock1.tvShows.shows[i].worldOfMasters.var06, i); + break; + case TVSHOW_NAME_RATER_SHOW: + sub_80C03C8(gSaveBlock1.tvShows.shows[i].nameRaterShow.species, i); + sub_80C03C8(gSaveBlock1.tvShows.shows[i].nameRaterShow.var1C, i); + break; + case TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE: + sub_80C03C8(gSaveBlock1.tvShows.shows[i].bravoTrainer.species, i); + break; + case TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE: + sub_80C03C8(gSaveBlock1.tvShows.shows[i].bravoTrainerTower.var0a, i); + sub_80C03C8(gSaveBlock1.tvShows.shows[i].bravoTrainerTower.var14, i); + break; + case TVSHOW_POKEMON_TODAY_CAUGHT: + sub_80C03C8(gSaveBlock1.tvShows.shows[i].pokemonToday.species, i); + break; + case TVSHOW_SMART_SHOPPER: + break; + case TVSHOW_POKEMON_TODAY_FAILED: + sub_80C03C8(gSaveBlock1.tvShows.shows[i].pokemonTodayFailed.species, i); + sub_80C03C8(gSaveBlock1.tvShows.shows[i].pokemonTodayFailed.species2, i); + break; + case TVSHOW_FISHING_ADVICE: + sub_80C03C8(gSaveBlock1.tvShows.shows[i].pokemonAngler.var04, i); + break; + case TVSHOW_WORLD_OF_MASTERS: + sub_80C03C8(gSaveBlock1.tvShows.shows[i].worldOfMasters.var08, i); + sub_80C03C8(gSaveBlock1.tvShows.shows[i].worldOfMasters.var04, i); + break; + case TVSHOW_MASS_OUTBREAK: + break; + default: + sub_80C03A8(i); } } } @@ -2508,45 +2508,45 @@ void sub_80C0788(void) { void DoTVShow(void) { if (gSaveBlock1.tvShows.shows[gSpecialVar_0x8004].common.var01 != 0) { switch (gSaveBlock1.tvShows.shows[gSpecialVar_0x8004].common.var00) { - case TVSHOW_FAN_CLUB_LETTER: - DoTVShowPokemonFanClubLetter(); - break; - case TVSHOW_RECENT_HAPPENINGS: - DoTVShowRecentHappenings(); - break; - case TVSHOW_PKMN_FAN_CLUB_OPINIONS: - DoTVShowPokemonFanClubOpinions(); - break; - case TVSHOW_UNKN_SHOWTYPE_04: - nullsub_22(); - break; - case TVSHOW_MASS_OUTBREAK: - DoTVShowPokemonNewsMassOutbreak(); - break; - case TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE: - DoTVShowBravoTrainerPokemonProfile(); - break; - case TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE: - DoTVShowBravoTrainerBattleTowerProfile(); - break; - case TVSHOW_POKEMON_TODAY_CAUGHT: - DoTVShowPokemonTodaySuccessfulCapture(); - break; - case TVSHOW_SMART_SHOPPER: - DoTVShowTodaysSmartShopper(); - break; - case TVSHOW_NAME_RATER_SHOW: - DoTVShowTheNameRaterShow(); - break; - case TVSHOW_POKEMON_TODAY_FAILED: - DoTVShowPokemonTodayFailedCapture(); - break; - case TVSHOW_FISHING_ADVICE: - DoTVShowPokemonAngler(); - break; - case TVSHOW_WORLD_OF_MASTERS: - DoTVShowTheWorldOfMasters(); - break; + case TVSHOW_FAN_CLUB_LETTER: + DoTVShowPokemonFanClubLetter(); + break; + case TVSHOW_RECENT_HAPPENINGS: + DoTVShowRecentHappenings(); + break; + case TVSHOW_PKMN_FAN_CLUB_OPINIONS: + DoTVShowPokemonFanClubOpinions(); + break; + case TVSHOW_UNKN_SHOWTYPE_04: + nullsub_22(); + break; + case TVSHOW_MASS_OUTBREAK: + DoTVShowPokemonNewsMassOutbreak(); + break; + case TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE: + DoTVShowBravoTrainerPokemonProfile(); + break; + case TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE: + DoTVShowBravoTrainerBattleTowerProfile(); + break; + case TVSHOW_POKEMON_TODAY_CAUGHT: + DoTVShowPokemonTodaySuccessfulCapture(); + break; + case TVSHOW_SMART_SHOPPER: + DoTVShowTodaysSmartShopper(); + break; + case TVSHOW_NAME_RATER_SHOW: + DoTVShowTheNameRaterShow(); + break; + case TVSHOW_POKEMON_TODAY_FAILED: + DoTVShowPokemonTodayFailedCapture(); + break; + case TVSHOW_FISHING_ADVICE: + DoTVShowPokemonAngler(); + break; + case TVSHOW_WORLD_OF_MASTERS: + DoTVShowTheWorldOfMasters(); + break; } } } @@ -2571,91 +2571,91 @@ void DoTVShowTheNameRaterShow(void) { gScriptResult = 0; switchval = gUnknown_020387E8; switch (switchval) { - case 0: - TVShowConvertInternationalString(gStringVar1, tvShow->nameRaterShow.trainerName, tvShow->nameRaterShow.language); - StringCopy(gStringVar2, gSpeciesNames[tvShow->nameRaterShow.species]); - TVShowConvertInternationalString(gStringVar3, tvShow->nameRaterShow.pokemonName, tvShow->nameRaterShow.pokemonNameLanguage); - gUnknown_020387E8 = sub_80BF7E8(&tvShow->nameRaterShow) + 1; - break; - case 1: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - if (tvShow->nameRaterShow.random == 0) { - gUnknown_020387E8 = 9; - } else if (tvShow->nameRaterShow.random == 1) { - gUnknown_020387E8 = 10; - } else if (tvShow->nameRaterShow.random == 2) { - gUnknown_020387E8 = 11; - } - break; - case 2: - TVShowConvertInternationalString(gStringVar1, tvShow->nameRaterShow.trainerName, tvShow->nameRaterShow.language); - if (tvShow->nameRaterShow.random == 0) { - gUnknown_020387E8 = 9; - } else if (tvShow->nameRaterShow.random == 1) { - gUnknown_020387E8 = 10; - } else if (tvShow->nameRaterShow.random == 2) { - gUnknown_020387E8 = 11; - } - break; - case 9: - case 10: - case 11: - sub_80BF820(0, 1, 0, 1, 0, &tvShow->nameRaterShow); - TVShowConvertInternationalString(gStringVar3, gStringVar1, tvShow->nameRaterShow.pokemonNameLanguage); - sub_80BF820(0, 0, 0, 1, 0, &tvShow->nameRaterShow); - TVShowConvertInternationalString(gStringVar2, gStringVar1, tvShow->nameRaterShow.pokemonNameLanguage); - TVShowConvertInternationalString(gStringVar1, tvShow->nameRaterShow.pokemonName, tvShow->nameRaterShow.pokemonNameLanguage); - gUnknown_020387E8 = 12; - break; - case 13: - sub_80BF820(0, 0, 3, 1, 0, &tvShow->nameRaterShow); - TVShowConvertInternationalString(gStringVar3, gStringVar1, tvShow->nameRaterShow.pokemonNameLanguage); - sub_80BF820(0, 0, 2, 0, 0, &tvShow->nameRaterShow); - TVShowConvertInternationalString(gStringVar2, gStringVar1, tvShow->nameRaterShow.language); - TVShowConvertInternationalString(gStringVar1, tvShow->nameRaterShow.trainerName, tvShow->nameRaterShow.language); - gUnknown_020387E8 = 14; - break; - case 14: - sub_80BF820(0, 0, 3, 0, 0, &tvShow->nameRaterShow); - TVShowConvertInternationalString(gStringVar3, gStringVar1, tvShow->nameRaterShow.language); - sub_80BF820(0, 0, 2, 1, 0, &tvShow->nameRaterShow); - TVShowConvertInternationalString(gStringVar2, gStringVar1, tvShow->nameRaterShow.pokemonNameLanguage); - TVShowConvertInternationalString(gStringVar1, tvShow->nameRaterShow.trainerName, tvShow->nameRaterShow.language); - gUnknown_020387E8 = 18; - break; - case 15: - sub_80BF820(1, 0, 2, 1, 0, &tvShow->nameRaterShow); - TVShowConvertInternationalString(gStringVar1, gStringVar2, tvShow->nameRaterShow.pokemonNameLanguage); - StringCopy(gStringVar2, gSpeciesNames[tvShow->nameRaterShow.species]); - sub_80BF820(2, 0, 3, 2, tvShow->nameRaterShow.species, &tvShow->nameRaterShow); - gUnknown_020387E8 = 16; - break; - case 16: - sub_80BF820(0, 0, 3, 1, 0, &tvShow->nameRaterShow); - TVShowConvertInternationalString(gStringVar3, gStringVar1, tvShow->nameRaterShow.pokemonNameLanguage); - sub_80BF820(0, 0, 2, 2, tvShow->nameRaterShow.species, &tvShow->nameRaterShow); - gUnknown_020387E8 = 17; - break; - case 17: - sub_80BF820(1, 0, 2, 1, 0, &tvShow->nameRaterShow); - TVShowConvertInternationalString(gStringVar1, gStringVar2, tvShow->nameRaterShow.pokemonNameLanguage); - sub_80BF820(2, 0, 3, 2, tvShow->nameRaterShow.var1C, &tvShow->nameRaterShow); - StringCopy(gStringVar2, gSpeciesNames[tvShow->nameRaterShow.var1C]); - gUnknown_020387E8 = 18; - break; - case 12: - switchval = 18; - gUnknown_020387E8 = 18; - case 18: - TVShowConvertInternationalString(gStringVar1, tvShow->nameRaterShow.pokemonName, tvShow->nameRaterShow.pokemonNameLanguage); - TVShowConvertInternationalString(gStringVar2, tvShow->nameRaterShow.trainerName, tvShow->nameRaterShow.language); - TVShowDone(); - break; + case 0: + TVShowConvertInternationalString(gStringVar1, tvShow->nameRaterShow.trainerName, tvShow->nameRaterShow.language); + StringCopy(gStringVar2, gSpeciesNames[tvShow->nameRaterShow.species]); + TVShowConvertInternationalString(gStringVar3, tvShow->nameRaterShow.pokemonName, tvShow->nameRaterShow.pokemonNameLanguage); + gUnknown_020387E8 = sub_80BF7E8(&tvShow->nameRaterShow) + 1; + break; + case 1: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + if (tvShow->nameRaterShow.random == 0) { + gUnknown_020387E8 = 9; + } else if (tvShow->nameRaterShow.random == 1) { + gUnknown_020387E8 = 10; + } else if (tvShow->nameRaterShow.random == 2) { + gUnknown_020387E8 = 11; + } + break; + case 2: + TVShowConvertInternationalString(gStringVar1, tvShow->nameRaterShow.trainerName, tvShow->nameRaterShow.language); + if (tvShow->nameRaterShow.random == 0) { + gUnknown_020387E8 = 9; + } else if (tvShow->nameRaterShow.random == 1) { + gUnknown_020387E8 = 10; + } else if (tvShow->nameRaterShow.random == 2) { + gUnknown_020387E8 = 11; + } + break; + case 9: + case 10: + case 11: + sub_80BF820(0, 1, 0, 1, 0, &tvShow->nameRaterShow); + TVShowConvertInternationalString(gStringVar3, gStringVar1, tvShow->nameRaterShow.pokemonNameLanguage); + sub_80BF820(0, 0, 0, 1, 0, &tvShow->nameRaterShow); + TVShowConvertInternationalString(gStringVar2, gStringVar1, tvShow->nameRaterShow.pokemonNameLanguage); + TVShowConvertInternationalString(gStringVar1, tvShow->nameRaterShow.pokemonName, tvShow->nameRaterShow.pokemonNameLanguage); + gUnknown_020387E8 = 12; + break; + case 13: + sub_80BF820(0, 0, 3, 1, 0, &tvShow->nameRaterShow); + TVShowConvertInternationalString(gStringVar3, gStringVar1, tvShow->nameRaterShow.pokemonNameLanguage); + sub_80BF820(0, 0, 2, 0, 0, &tvShow->nameRaterShow); + TVShowConvertInternationalString(gStringVar2, gStringVar1, tvShow->nameRaterShow.language); + TVShowConvertInternationalString(gStringVar1, tvShow->nameRaterShow.trainerName, tvShow->nameRaterShow.language); + gUnknown_020387E8 = 14; + break; + case 14: + sub_80BF820(0, 0, 3, 0, 0, &tvShow->nameRaterShow); + TVShowConvertInternationalString(gStringVar3, gStringVar1, tvShow->nameRaterShow.language); + sub_80BF820(0, 0, 2, 1, 0, &tvShow->nameRaterShow); + TVShowConvertInternationalString(gStringVar2, gStringVar1, tvShow->nameRaterShow.pokemonNameLanguage); + TVShowConvertInternationalString(gStringVar1, tvShow->nameRaterShow.trainerName, tvShow->nameRaterShow.language); + gUnknown_020387E8 = 18; + break; + case 15: + sub_80BF820(1, 0, 2, 1, 0, &tvShow->nameRaterShow); + TVShowConvertInternationalString(gStringVar1, gStringVar2, tvShow->nameRaterShow.pokemonNameLanguage); + StringCopy(gStringVar2, gSpeciesNames[tvShow->nameRaterShow.species]); + sub_80BF820(2, 0, 3, 2, tvShow->nameRaterShow.species, &tvShow->nameRaterShow); + gUnknown_020387E8 = 16; + break; + case 16: + sub_80BF820(0, 0, 3, 1, 0, &tvShow->nameRaterShow); + TVShowConvertInternationalString(gStringVar3, gStringVar1, tvShow->nameRaterShow.pokemonNameLanguage); + sub_80BF820(0, 0, 2, 2, tvShow->nameRaterShow.species, &tvShow->nameRaterShow); + gUnknown_020387E8 = 17; + break; + case 17: + sub_80BF820(1, 0, 2, 1, 0, &tvShow->nameRaterShow); + TVShowConvertInternationalString(gStringVar1, gStringVar2, tvShow->nameRaterShow.pokemonNameLanguage); + sub_80BF820(2, 0, 3, 2, tvShow->nameRaterShow.var1C, &tvShow->nameRaterShow); + StringCopy(gStringVar2, gSpeciesNames[tvShow->nameRaterShow.var1C]); + gUnknown_020387E8 = 18; + break; + case 12: + switchval = 18; + gUnknown_020387E8 = 18; + case 18: + TVShowConvertInternationalString(gStringVar1, tvShow->nameRaterShow.pokemonName, tvShow->nameRaterShow.pokemonNameLanguage); + TVShowConvertInternationalString(gStringVar2, tvShow->nameRaterShow.trainerName, tvShow->nameRaterShow.language); + TVShowDone(); + break; } ShowFieldMessage(gTVNameRaterTextGroup[switchval]); } @@ -2667,64 +2667,64 @@ void DoTVShowPokemonTodaySuccessfulCapture(void) { gScriptResult = 0; switchval = gUnknown_020387E8; switch (switchval) { - case 0: - TVShowConvertInternationalString(gStringVar1, tvShow->pokemonToday.playerName, tvShow->pokemonToday.language); - StringCopy(gStringVar2, gSpeciesNames[tvShow->pokemonToday.species]); - TVShowConvertInternationalString(gStringVar3, tvShow->pokemonToday.nickname, tvShow->pokemonToday.language2); - if (tvShow->pokemonToday.ball == ITEM_MASTER_BALL) { - gUnknown_020387E8 = 5; - } else { - gUnknown_020387E8 = 1; - } - break; - case 1: - gUnknown_020387E8 = 2; - break; - case 2: - StringCopy(gStringVar2, ItemId_GetItem(tvShow->pokemonToday.ball)->name); - sub_80BF088(2, tvShow->pokemonToday.var12); - if (tvShow->pokemonToday.var12 < 4) { - gUnknown_020387E8 = 3; - } else { - gUnknown_020387E8 = 4; - } - break; - case 3: - TVShowConvertInternationalString(gStringVar1, tvShow->pokemonToday.playerName, tvShow->pokemonToday.language); - StringCopy(gStringVar2, gSpeciesNames[tvShow->pokemonToday.species]); - TVShowConvertInternationalString(gStringVar3, tvShow->pokemonToday.nickname, tvShow->pokemonToday.language2); - gUnknown_020387E8 = 6; - break; - case 4: - gUnknown_020387E8 = 6; - break; - case 5: - TVShowConvertInternationalString(gStringVar1, tvShow->pokemonToday.playerName, tvShow->pokemonToday.language); - StringCopy(gStringVar2, gSpeciesNames[tvShow->pokemonToday.species]); - gUnknown_020387E8 = 6; - break; - case 6: - TVShowConvertInternationalString(gStringVar1, tvShow->pokemonToday.playerName, tvShow->pokemonToday.language); - StringCopy(gStringVar2, gSpeciesNames[tvShow->pokemonToday.species]); - TVShowConvertInternationalString(gStringVar3, tvShow->pokemonToday.nickname, tvShow->pokemonToday.language2); - gUnknown_020387E8 += (Random() % 4) + 1; - break; - case 7: - case 8: - StringCopy(gStringVar1, gSpeciesNames[tvShow->pokemonToday.species]); - TVShowConvertInternationalString(gStringVar2, tvShow->pokemonToday.nickname, tvShow->pokemonToday.language2); - sub_80BF638(2, tvShow->pokemonToday.species); - gUnknown_020387E8 = 11; - break; - case 9: - case 10: - StringCopy(gStringVar1, gSpeciesNames[tvShow->pokemonToday.species]); - TVShowConvertInternationalString(gStringVar2, tvShow->pokemonToday.nickname, tvShow->pokemonToday.language2); - gUnknown_020387E8 = 11; - break; - case 11: - TVShowDone(); - break; + case 0: + TVShowConvertInternationalString(gStringVar1, tvShow->pokemonToday.playerName, tvShow->pokemonToday.language); + StringCopy(gStringVar2, gSpeciesNames[tvShow->pokemonToday.species]); + TVShowConvertInternationalString(gStringVar3, tvShow->pokemonToday.nickname, tvShow->pokemonToday.language2); + if (tvShow->pokemonToday.ball == ITEM_MASTER_BALL) { + gUnknown_020387E8 = 5; + } else { + gUnknown_020387E8 = 1; + } + break; + case 1: + gUnknown_020387E8 = 2; + break; + case 2: + StringCopy(gStringVar2, ItemId_GetItem(tvShow->pokemonToday.ball)->name); + sub_80BF088(2, tvShow->pokemonToday.var12); + if (tvShow->pokemonToday.var12 < 4) { + gUnknown_020387E8 = 3; + } else { + gUnknown_020387E8 = 4; + } + break; + case 3: + TVShowConvertInternationalString(gStringVar1, tvShow->pokemonToday.playerName, tvShow->pokemonToday.language); + StringCopy(gStringVar2, gSpeciesNames[tvShow->pokemonToday.species]); + TVShowConvertInternationalString(gStringVar3, tvShow->pokemonToday.nickname, tvShow->pokemonToday.language2); + gUnknown_020387E8 = 6; + break; + case 4: + gUnknown_020387E8 = 6; + break; + case 5: + TVShowConvertInternationalString(gStringVar1, tvShow->pokemonToday.playerName, tvShow->pokemonToday.language); + StringCopy(gStringVar2, gSpeciesNames[tvShow->pokemonToday.species]); + gUnknown_020387E8 = 6; + break; + case 6: + TVShowConvertInternationalString(gStringVar1, tvShow->pokemonToday.playerName, tvShow->pokemonToday.language); + StringCopy(gStringVar2, gSpeciesNames[tvShow->pokemonToday.species]); + TVShowConvertInternationalString(gStringVar3, tvShow->pokemonToday.nickname, tvShow->pokemonToday.language2); + gUnknown_020387E8 += (Random() % 4) + 1; + break; + case 7: + case 8: + StringCopy(gStringVar1, gSpeciesNames[tvShow->pokemonToday.species]); + TVShowConvertInternationalString(gStringVar2, tvShow->pokemonToday.nickname, tvShow->pokemonToday.language2); + sub_80BF638(2, tvShow->pokemonToday.species); + gUnknown_020387E8 = 11; + break; + case 9: + case 10: + StringCopy(gStringVar1, gSpeciesNames[tvShow->pokemonToday.species]); + TVShowConvertInternationalString(gStringVar2, tvShow->pokemonToday.nickname, tvShow->pokemonToday.language2); + gUnknown_020387E8 = 11; + break; + case 11: + TVShowDone(); + break; } ShowFieldMessage(gTVPokemonTodayTextGroup[switchval]); } @@ -2737,40 +2737,40 @@ void DoTVShowPokemonTodayFailedCapture(void) { gScriptResult = 0; switchval = gUnknown_020387E8; switch (switchval) { - case 0: - TVShowConvertInternationalString(gStringVar1, tvShow->pokemonTodayFailed.playerName, tvShow->pokemonTodayFailed.language); - StringCopy(gStringVar2, gSpeciesNames[tvShow->pokemonTodayFailed.species]); - gUnknown_020387E8 = 1; - break; - case 1: - TVShowConvertInternationalString(gStringVar1, tvShow->pokemonTodayFailed.playerName, tvShow->pokemonTodayFailed.language); - sub_80FBFB4(gStringVar2, tvShow->pokemonTodayFailed.var12, 0); - StringCopy(gStringVar3, gSpeciesNames[tvShow->pokemonTodayFailed.species2]); - if (tvShow->pokemonTodayFailed.var11 == 1) { - gUnknown_020387E8 = 3; - } else { - gUnknown_020387E8 = 2; - } - break; - case 2: - case 3: - TVShowConvertInternationalString(gStringVar1, tvShow->pokemonTodayFailed.playerName, tvShow->pokemonTodayFailed.language); - sub_80BF088(1, tvShow->pokemonTodayFailed.var10); - rval = (Random() % 3); - if (rval == 0) { - gUnknown_020387E8 = 5; - } else { - gUnknown_020387E8 = 4; - } - break; - case 4: - case 5: - TVShowConvertInternationalString(gStringVar1, tvShow->pokemonTodayFailed.playerName, tvShow->pokemonTodayFailed.language); - gUnknown_020387E8 = 6; - break; - case 6: - TVShowDone(); - break; + case 0: + TVShowConvertInternationalString(gStringVar1, tvShow->pokemonTodayFailed.playerName, tvShow->pokemonTodayFailed.language); + StringCopy(gStringVar2, gSpeciesNames[tvShow->pokemonTodayFailed.species]); + gUnknown_020387E8 = 1; + break; + case 1: + TVShowConvertInternationalString(gStringVar1, tvShow->pokemonTodayFailed.playerName, tvShow->pokemonTodayFailed.language); + sub_80FBFB4(gStringVar2, tvShow->pokemonTodayFailed.var12, 0); + StringCopy(gStringVar3, gSpeciesNames[tvShow->pokemonTodayFailed.species2]); + if (tvShow->pokemonTodayFailed.var11 == 1) { + gUnknown_020387E8 = 3; + } else { + gUnknown_020387E8 = 2; + } + break; + case 2: + case 3: + TVShowConvertInternationalString(gStringVar1, tvShow->pokemonTodayFailed.playerName, tvShow->pokemonTodayFailed.language); + sub_80BF088(1, tvShow->pokemonTodayFailed.var10); + rval = (Random() % 3); + if (rval == 0) { + gUnknown_020387E8 = 5; + } else { + gUnknown_020387E8 = 4; + } + break; + case 4: + case 5: + TVShowConvertInternationalString(gStringVar1, tvShow->pokemonTodayFailed.playerName, tvShow->pokemonTodayFailed.language); + gUnknown_020387E8 = 6; + break; + case 6: + TVShowDone(); + break; } ShowFieldMessage(gTVPokemonTodayFailedCaptureTextGroup[switchval]); } @@ -2783,46 +2783,46 @@ void DoTVShowPokemonFanClubLetter(void) { gScriptResult = 0; switchval = gUnknown_020387E8; switch (switchval) { - case 0: - TVShowConvertInternationalString(gStringVar1, tvShow->fanclubLetter.playerName, tvShow->fanclubLetter.language); - StringCopy(gStringVar2, gSpeciesNames[tvShow->fanclubLetter.species]); - gUnknown_020387E8 = 50; - break; - case 1: - rval = (Random() % 4) + 1; - if (rval == 1) { - gUnknown_020387E8 = 2; - } else { - gUnknown_020387E8 = rval + 2; - } - break; - case 2: - gUnknown_020387E8 = 51; - break; - case 3: - gUnknown_020387E8 += (Random() % 3) + 1; - break; - case 4: - case 5: - case 6: - sub_80BF79C(tvShow); - gUnknown_020387E8 = 7; - break; - case 7: - rval = (Random() % 0x1f) + 0x46; - sub_80BF088(2, rval); - TVShowDone(); - break; - case 50: - ConvertEasyChatWordsToString(gStringVar4, tvShow->fanclubLetter.pad04, 2, 2); - ShowFieldMessage(gStringVar4); - gUnknown_020387E8 = 1; - return; - case 51: - ConvertEasyChatWordsToString(gStringVar4, tvShow->fanclubLetter.pad04, 2, 2); - ShowFieldMessage(gStringVar4); - gUnknown_020387E8 = 3; - return; + case 0: + TVShowConvertInternationalString(gStringVar1, tvShow->fanclubLetter.playerName, tvShow->fanclubLetter.language); + StringCopy(gStringVar2, gSpeciesNames[tvShow->fanclubLetter.species]); + gUnknown_020387E8 = 50; + break; + case 1: + rval = (Random() % 4) + 1; + if (rval == 1) { + gUnknown_020387E8 = 2; + } else { + gUnknown_020387E8 = rval + 2; + } + break; + case 2: + gUnknown_020387E8 = 51; + break; + case 3: + gUnknown_020387E8 += (Random() % 3) + 1; + break; + case 4: + case 5: + case 6: + sub_80BF79C(tvShow); + gUnknown_020387E8 = 7; + break; + case 7: + rval = (Random() % 0x1f) + 0x46; + sub_80BF088(2, rval); + TVShowDone(); + break; + case 50: + ConvertEasyChatWordsToString(gStringVar4, tvShow->fanclubLetter.pad04, 2, 2); + ShowFieldMessage(gStringVar4); + gUnknown_020387E8 = 1; + return; + case 51: + ConvertEasyChatWordsToString(gStringVar4, tvShow->fanclubLetter.pad04, 2, 2); + ShowFieldMessage(gStringVar4); + gUnknown_020387E8 = 3; + return; } ShowFieldMessage(gTVFanClubTextGroup[switchval]); } @@ -2834,27 +2834,27 @@ void DoTVShowRecentHappenings(void) { gScriptResult = 0; switchval = gUnknown_020387E8; switch (switchval) { - case 0: - TVShowConvertInternationalString(gStringVar1, tvShow->recentHappenings.playerName, tvShow->recentHappenings.language); - sub_80BF79C(tvShow); - gUnknown_020387E8 = 50; - break; - case 1: - gUnknown_020387E8 += 1 + (Random() % 3); - break; - case 2: - case 3: - case 4: - gUnknown_020387E8 = 5; - break; - case 5: - TVShowDone(); - break; - case 50: - ConvertEasyChatWordsToString(gStringVar4, tvShow->recentHappenings.var04, 2, 2); - ShowFieldMessage(gStringVar4); - gUnknown_020387E8 = 1; - return; + case 0: + TVShowConvertInternationalString(gStringVar1, tvShow->recentHappenings.playerName, tvShow->recentHappenings.language); + sub_80BF79C(tvShow); + gUnknown_020387E8 = 50; + break; + case 1: + gUnknown_020387E8 += 1 + (Random() % 3); + break; + case 2: + case 3: + case 4: + gUnknown_020387E8 = 5; + break; + case 5: + TVShowDone(); + break; + case 50: + ConvertEasyChatWordsToString(gStringVar4, tvShow->recentHappenings.var04, 2, 2); + ShowFieldMessage(gStringVar4); + gUnknown_020387E8 = 1; + return; } ShowFieldMessage(gTVRecentHappeningsTextGroup[switchval]); } @@ -2866,25 +2866,25 @@ void DoTVShowPokemonFanClubOpinions(void) { gScriptResult = 0; switchval = gUnknown_020387E8; switch (switchval) { - case 0: - TVShowConvertInternationalString(gStringVar1, tvShow->fanclubOpinions.playerName, tvShow->fanclubOpinions.language); - StringCopy(gStringVar2, gSpeciesNames[tvShow->fanclubOpinions.var02]); - TVShowConvertInternationalString(gStringVar3, tvShow->fanclubOpinions.var10, tvShow->fanclubOpinions.var0E); - gUnknown_020387E8 = tvShow->fanclubOpinions.var04B + 1; - break; - case 1: - case 2: - case 3: - TVShowConvertInternationalString(gStringVar1, tvShow->fanclubOpinions.playerName, tvShow->fanclubOpinions.language); - StringCopy(gStringVar2, gSpeciesNames[tvShow->fanclubOpinions.var02]); - sub_80EB3FC(gStringVar3, tvShow->fanclubOpinions.var1C[0]); - gUnknown_020387E8 = 4; - break; - case 4: - TVShowConvertInternationalString(gStringVar1, tvShow->fanclubOpinions.playerName, tvShow->fanclubOpinions.language); - sub_80EB3FC(gStringVar3, tvShow->fanclubOpinions.var1C[1]); - TVShowDone(); - break; + case 0: + TVShowConvertInternationalString(gStringVar1, tvShow->fanclubOpinions.playerName, tvShow->fanclubOpinions.language); + StringCopy(gStringVar2, gSpeciesNames[tvShow->fanclubOpinions.var02]); + TVShowConvertInternationalString(gStringVar3, tvShow->fanclubOpinions.var10, tvShow->fanclubOpinions.var0E); + gUnknown_020387E8 = tvShow->fanclubOpinions.var04B + 1; + break; + case 1: + case 2: + case 3: + TVShowConvertInternationalString(gStringVar1, tvShow->fanclubOpinions.playerName, tvShow->fanclubOpinions.language); + StringCopy(gStringVar2, gSpeciesNames[tvShow->fanclubOpinions.var02]); + sub_80EB3FC(gStringVar3, tvShow->fanclubOpinions.var1C[0]); + gUnknown_020387E8 = 4; + break; + case 4: + TVShowConvertInternationalString(gStringVar1, tvShow->fanclubOpinions.playerName, tvShow->fanclubOpinions.language); + sub_80EB3FC(gStringVar3, tvShow->fanclubOpinions.var1C[1]); + TVShowDone(); + break; } ShowFieldMessage(gTVFanClubOpinionsTextGroup[switchval]); } @@ -2914,50 +2914,50 @@ void DoTVShowInSearchOfTrainers(void) { gScriptResult = 0; switchval = gUnknown_020387E8; switch (switchval) { - case 0: - sub_80FBFB4(gStringVar1, gSaveBlock1.gabbyAndTyData.mapnum, 0); - if (gSaveBlock1.gabbyAndTyData.val9 > 1) { - gUnknown_020387E8 = 1; - } else { - gUnknown_020387E8 = 2; - } - break; - case 1: + case 0: + sub_80FBFB4(gStringVar1, gSaveBlock1.gabbyAndTyData.mapnum, 0); + if (gSaveBlock1.gabbyAndTyData.val9 > 1) { + gUnknown_020387E8 = 1; + } else { gUnknown_020387E8 = 2; - break; - case 2: - if (gSaveBlock1.gabbyAndTyData.valA_0 == 0) { - gUnknown_020387E8 = 4; - } else if (gSaveBlock1.gabbyAndTyData.valA_3 != 0) { - gUnknown_020387E8 = 5; - } else if (gSaveBlock1.gabbyAndTyData.valA_2 != 0) { - gUnknown_020387E8 = 6; - } else if (gSaveBlock1.gabbyAndTyData.valA_1 != 0) { - gUnknown_020387E8 = 7; - } else { - gUnknown_020387E8 = 3; - } - break; - case 3: - StringCopy(gStringVar1, gSpeciesNames[gSaveBlock1.gabbyAndTyData.mon1]); - StringCopy(gStringVar2, gMoveNames[gSaveBlock1.gabbyAndTyData.move1]); - StringCopy(gStringVar3, gSpeciesNames[gSaveBlock1.gabbyAndTyData.mon2]); - gUnknown_020387E8 = 8; - break; - case 4: - case 5: - case 6: - case 7: - gUnknown_020387E8 = 8; - break; - case 8: - sub_80EB3FC(gStringVar1, gSaveBlock1.gabbyAndTyData.move2); - StringCopy(gStringVar2, gSpeciesNames[gSaveBlock1.gabbyAndTyData.mon1]); - StringCopy(gStringVar3, gSpeciesNames[gSaveBlock1.gabbyAndTyData.mon2]); - gScriptResult = 1; - gUnknown_020387E8 = 0;; - TakeTVShowInSearchOfTrainersOffTheAir(); - break; + } + break; + case 1: + gUnknown_020387E8 = 2; + break; + case 2: + if (gSaveBlock1.gabbyAndTyData.valA_0 == 0) { + gUnknown_020387E8 = 4; + } else if (gSaveBlock1.gabbyAndTyData.valA_3 != 0) { + gUnknown_020387E8 = 5; + } else if (gSaveBlock1.gabbyAndTyData.valA_2 != 0) { + gUnknown_020387E8 = 6; + } else if (gSaveBlock1.gabbyAndTyData.valA_1 != 0) { + gUnknown_020387E8 = 7; + } else { + gUnknown_020387E8 = 3; + } + break; + case 3: + StringCopy(gStringVar1, gSpeciesNames[gSaveBlock1.gabbyAndTyData.mon1]); + StringCopy(gStringVar2, gMoveNames[gSaveBlock1.gabbyAndTyData.move1]); + StringCopy(gStringVar3, gSpeciesNames[gSaveBlock1.gabbyAndTyData.mon2]); + gUnknown_020387E8 = 8; + break; + case 4: + case 5: + case 6: + case 7: + gUnknown_020387E8 = 8; + break; + case 8: + sub_80EB3FC(gStringVar1, gSaveBlock1.gabbyAndTyData.move2); + StringCopy(gStringVar2, gSpeciesNames[gSaveBlock1.gabbyAndTyData.mon1]); + StringCopy(gStringVar3, gSpeciesNames[gSaveBlock1.gabbyAndTyData.mon2]); + gScriptResult = 1; + gUnknown_020387E8 = 0;; + TakeTVShowInSearchOfTrainersOffTheAir(); + break; } ShowFieldMessage(gTVGabbyAndTyTextGroup[switchval]); } @@ -2974,18 +2974,18 @@ void DoTVShowPokemonAngler(void) { } switchval = gUnknown_020387E8; switch (switchval) { - case 0: - TVShowConvertInternationalString(gStringVar1, tvShow->pokemonAngler.playerName, tvShow->pokemonAngler.language); - StringCopy(gStringVar2, gSpeciesNames[tvShow->pokemonAngler.var04]); - sub_80BF088(2, tvShow->pokemonAngler.var03); - TVShowDone(); - break; - case 1: - TVShowConvertInternationalString(gStringVar1, tvShow->pokemonAngler.playerName, tvShow->pokemonAngler.language); - StringCopy(gStringVar2, gSpeciesNames[tvShow->pokemonAngler.var04]); - sub_80BF088(2, tvShow->pokemonAngler.var02); - TVShowDone(); - break; + case 0: + TVShowConvertInternationalString(gStringVar1, tvShow->pokemonAngler.playerName, tvShow->pokemonAngler.language); + StringCopy(gStringVar2, gSpeciesNames[tvShow->pokemonAngler.var04]); + sub_80BF088(2, tvShow->pokemonAngler.var03); + TVShowDone(); + break; + case 1: + TVShowConvertInternationalString(gStringVar1, tvShow->pokemonAngler.playerName, tvShow->pokemonAngler.language); + StringCopy(gStringVar2, gSpeciesNames[tvShow->pokemonAngler.var04]); + sub_80BF088(2, tvShow->pokemonAngler.var02); + TVShowDone(); + break; } ShowFieldMessage(gTVFishingGuruAdviceTextGroup[switchval]); } @@ -2997,24 +2997,24 @@ void DoTVShowTheWorldOfMasters(void) { gScriptResult = 0; switchval = gUnknown_020387E8; switch (switchval) { - case 0: - TVShowConvertInternationalString(gStringVar1, tvShow->worldOfMasters.playerName, - tvShow->worldOfMasters.language); - sub_80BF088(1, tvShow->worldOfMasters.var06); - sub_80BF088(2, tvShow->worldOfMasters.var02); - gUnknown_020387E8 = 1; - break; - case 1: - StringCopy(gStringVar1, gSpeciesNames[tvShow->worldOfMasters.var08]); - gUnknown_020387E8 = 2; - break; - case 2: - TVShowConvertInternationalString(gStringVar1, tvShow->worldOfMasters.playerName, - tvShow->worldOfMasters.language); - sub_80FBFB4(gStringVar2, tvShow->worldOfMasters.var0a, 0); - StringCopy(gStringVar3, gSpeciesNames[tvShow->worldOfMasters.var04]); - TVShowDone(); - break; + case 0: + TVShowConvertInternationalString(gStringVar1, tvShow->worldOfMasters.playerName, + tvShow->worldOfMasters.language); + sub_80BF088(1, tvShow->worldOfMasters.var06); + sub_80BF088(2, tvShow->worldOfMasters.var02); + gUnknown_020387E8 = 1; + break; + case 1: + StringCopy(gStringVar1, gSpeciesNames[tvShow->worldOfMasters.var08]); + gUnknown_020387E8 = 2; + break; + case 2: + TVShowConvertInternationalString(gStringVar1, tvShow->worldOfMasters.playerName, + tvShow->worldOfMasters.language); + sub_80FBFB4(gStringVar2, tvShow->worldOfMasters.var0a, 0); + StringCopy(gStringVar3, gSpeciesNames[tvShow->worldOfMasters.var04]); + TVShowDone(); + break; } ShowFieldMessage(gTVWorldOfMastersTextGroup[switchval]); } diff --git a/src/wallclock.c b/src/wallclock.c index 0f3665c65..de007c1b3 100644 --- a/src/wallclock.c +++ b/src/wallclock.c @@ -428,17 +428,17 @@ static void Task_SetClock4(u8 taskId) { switch (ProcessMenuInputNoWrap_()) { - case 0: //YES - PlaySE(SE_SELECT); - gTasks[taskId].func = Task_SetClock5; //Move on - return; - case -1: //B button - case 1: //NO - sub_8072DEC(); - PlaySE(SE_SELECT); - MenuZeroFillWindowRect(23, 8, 29, 13); - MenuZeroFillWindowRect(2, 16, 27, 19); - gTasks[taskId].func = Task_SetClock2; //Go back and let player adjust clock + case 0: //YES + PlaySE(SE_SELECT); + gTasks[taskId].func = Task_SetClock5; //Move on + return; + case -1: //B button + case 1: //NO + sub_8072DEC(); + PlaySE(SE_SELECT); + MenuZeroFillWindowRect(23, 8, 29, 13); + MenuZeroFillWindowRect(2, 16, 27, 19); + gTasks[taskId].func = Task_SetClock2; //Go back and let player adjust clock } } @@ -501,18 +501,18 @@ static u16 CalcNewMinHandAngle(u16 angle, u8 direction, u8 speed) switch (direction) { - case MVMT_BACKWARD: - if (angle) - angle = angle - delta; - else - angle = 360 - delta; - break; - case MVMT_FORWARD: - if (angle < 360 - delta) - angle = angle + delta; - else - angle = 0; - break; + case MVMT_BACKWARD: + if (angle) + angle = angle - delta; + else + angle = 360 - delta; + break; + case MVMT_FORWARD: + if (angle < 360 - delta) + angle = angle + delta; + else + angle = 0; + break; } return angle; } @@ -522,32 +522,32 @@ static u8 AdvanceClock(u8 taskId, u8 direction) { switch (direction) { - case MVMT_BACKWARD: - if (gTasks[taskId].tMinutes > 0) - gTasks[taskId].tMinutes--; + case MVMT_BACKWARD: + if (gTasks[taskId].tMinutes > 0) + gTasks[taskId].tMinutes--; + else + { + gTasks[taskId].tMinutes = 59; + if (gTasks[taskId].tHours > 0) + gTasks[taskId].tHours--; else - { - gTasks[taskId].tMinutes = 59; - if (gTasks[taskId].tHours > 0) - gTasks[taskId].tHours--; - else - gTasks[taskId].tHours = 23; - UpdateClockPeriod(taskId, direction); - } - break; - case MVMT_FORWARD: - if (gTasks[taskId].tMinutes < 59) - gTasks[taskId].tMinutes++; + gTasks[taskId].tHours = 23; + UpdateClockPeriod(taskId, direction); + } + break; + case MVMT_FORWARD: + if (gTasks[taskId].tMinutes < 59) + gTasks[taskId].tMinutes++; + else + { + gTasks[taskId].tMinutes = 0; + if (gTasks[taskId].tHours < 23) + gTasks[taskId].tHours++; else - { - gTasks[taskId].tMinutes = 0; - if (gTasks[taskId].tHours < 23) - gTasks[taskId].tHours++; - else - gTasks[taskId].tHours = 0; - UpdateClockPeriod(taskId, direction); - } - break; + gTasks[taskId].tHours = 0; + UpdateClockPeriod(taskId, direction); + } + break; } return 0; } @@ -559,28 +559,28 @@ static void UpdateClockPeriod(u8 taskId, u8 direction) switch (direction) { - case MVMT_BACKWARD: - switch (hours) - { - case 11: - gTasks[taskId].tPeriod = PERIOD_AM; - break; - case 23: - gTasks[taskId].tPeriod = PERIOD_PM; - break; - } + case MVMT_BACKWARD: + switch (hours) + { + case 11: + gTasks[taskId].tPeriod = PERIOD_AM; break; - case MVMT_FORWARD: - switch (hours) - { - case 0: - gTasks[taskId].tPeriod = PERIOD_AM; - break; - case 12: - gTasks[taskId].tPeriod = PERIOD_PM; - break; - } + case 23: + gTasks[taskId].tPeriod = PERIOD_PM; break; + } + break; + case MVMT_FORWARD: + switch (hours) + { + case 0: + gTasks[taskId].tPeriod = PERIOD_AM; + break; + case 12: + gTasks[taskId].tPeriod = PERIOD_PM; + break; + } + break; } } -- cgit v1.2.3 From 8ba066d303825722a78ffbc67cecc0f4598f6f1e Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sun, 21 May 2017 11:37:35 +0200 Subject: Remove duplicate strings.h declarations --- src/battle_party_menu.c | 11 +---------- src/battle_setup.c | 9 ++++----- src/berry_tag_screen.c | 5 +---- src/coins.c | 3 +-- src/contest_painting.c | 38 +------------------------------------- src/item.c | 2 +- src/item_use.c | 18 +----------------- src/main_menu.c | 22 +++++----------------- src/mauville_old_man.c | 3 +-- src/menu.c | 8 +++----- src/party_menu.c | 45 +-------------------------------------------- src/player_pc.c | 9 ++------- src/pokedex.c | 7 +------ src/save_failed_screen.c | 8 +------- src/shop.c | 5 ++--- src/start_menu.c | 7 +++---- src/starter_choose.c | 4 +--- src/string_util.c | 29 ++++++++--------------------- 18 files changed, 38 insertions(+), 195 deletions(-) (limited to 'src') diff --git a/src/battle_party_menu.c b/src/battle_party_menu.c index 690ef99be..359517ecd 100644 --- a/src/battle_party_menu.c +++ b/src/battle_party_menu.c @@ -8,6 +8,7 @@ #include "songs.h" #include "sound.h" #include "string_util.h" +#include "strings.h" #include "task.h" #include "text.h" @@ -58,16 +59,6 @@ extern u8 gUnknown_0202E8F6; extern u8 gUnknown_02038473; extern u8 gUnknown_020384F0; extern void (*gUnknown_03004AE4)(); //don't know types yet -extern const u8 gOtherText_CantSwitchPokeWithYours[]; -extern const u8 gOtherText_NoEnergyLeft[]; -extern const u8 gOtherText_EGGCantBattle[]; -extern const u8 gOtherText_AlreadySelected[]; -extern const u8 gOtherText_CantBeSwitched[]; -extern const u8 gOtherText_AlreadyBattle[]; -extern const u8 OtherText_Summary[]; -extern const u8 gOtherText_CancelNoTerminator[]; -extern const u8 OtherText_Shift[]; -extern const u8 OtherText_SendOut[]; static void Task_809527C(u8); static void Task_80952B4(u8); diff --git a/src/battle_setup.c b/src/battle_setup.c index 0753fba70..61b9bb1e9 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -23,6 +23,7 @@ #include "species.h" #include "starter_choose.h" #include "string_util.h" +#include "strings.h" #include "task.h" #include "text.h" #include "trainer.h" @@ -45,8 +46,6 @@ EWRAM_DATA u8 *gTrainerCannotBattleSpeech = NULL; EWRAM_DATA u8 *gTrainerBattleScriptReturnAddress = NULL; EWRAM_DATA u8 *gTrainerBattleEndScript = NULL; -extern u8 gOtherText_CancelWithTerminator[]; - extern u16 gBattleTypeFlags; extern u16 gScriptLastTalked; extern u8 gUnknown_02024D26; @@ -1169,12 +1168,12 @@ void PlayTrainerEncounterMusic(void) } //Returns an empty string if a null pointer was passed, otherwise returns str -u8 *SanitizeString(u8 *str) +u8 *SanitizeString(const u8 *str) { if (str) - return str; + return (u8 *) str; else - return gOtherText_CancelWithTerminator; + return (u8 *) gOtherText_CancelWithTerminator; } u8 *sub_808281C(void) diff --git a/src/berry_tag_screen.c b/src/berry_tag_screen.c index 511b88c5a..f0bcb4f27 100644 --- a/src/berry_tag_screen.c +++ b/src/berry_tag_screen.c @@ -12,6 +12,7 @@ #include "sound.h" #include "sprite.h" #include "string_util.h" +#include "strings.h" #include "task.h" #include "text.h" @@ -38,10 +39,6 @@ extern u16 gUnknown_030041B4; extern const struct SpriteSheet gUnknown_083C1F74; extern const struct SpritePalette gUnknown_083C1F7C; -extern u8 gOtherText_ThreeQuestions2[]; -extern u8 gOtherText_Size[]; -extern u8 gOtherText_Firm[]; -extern u8 gContestStatsText_Unknown1[]; extern u8 *gUnknown_0841192C[]; extern u8 gBerryCheck_Gfx[]; diff --git a/src/coins.c b/src/coins.c index 193ea249e..3c6356612 100644 --- a/src/coins.c +++ b/src/coins.c @@ -2,11 +2,10 @@ #include "coins.h" #include "menu.h" #include "string_util.h" +#include "strings.h" #define MAX_COINS 9999 -extern u8 gOtherText_Coins2[]; - void UpdateCoinsWindow(s32 a, u8 b, u8 c) { PrintCoins(a, 4, b + 2, c + 1); diff --git a/src/contest_painting.c b/src/contest_painting.c index 2ef50ee17..c970deaf2 100644 --- a/src/contest_painting.c +++ b/src/contest_painting.c @@ -8,6 +8,7 @@ #include "rng.h" #include "sprite.h" #include "string_util.h" +#include "strings.h" #include "text.h" extern u8 unk_2000000[]; @@ -28,43 +29,6 @@ extern const struct MonCoords gMonFrontPicCoords[]; extern const struct SpriteSheet gMonBackPicTable[]; extern const struct MonCoords gMonBackPicCoords[]; extern void *gUnknown_081FAF4C[]; -extern const u8 OtherText_Cool[]; -extern const u8 OtherText_Beauty2[]; -extern const u8 OtherText_Cute[]; -extern const u8 OtherText_Smart[]; -extern const u8 OtherText_Tough[]; -extern const u8 OtherText_NonstopSuperCool[]; -extern const u8 OtherText_Terminator6[]; -extern const u8 OtherText_GoodLookingPoke[]; -extern const u8 OtherText_Terminator7[]; -extern const u8 OtherText_MarvelousGreat[]; -extern const u8 OtherText_Terminator8[]; -extern const u8 OtherText_CenturyLastVenus[]; -extern const u8 OtherText_Terminator9[]; -extern const u8 OtherText_Terminator10[]; -extern const u8 OtherText_DazzlingSmile[]; -extern const u8 OtherText_PokeCenterIdol[]; -extern const u8 OtherText_Terminator11[]; -extern const u8 OtherText_LovelyAndSweet[]; -extern const u8 OtherText_Terminator12[]; -extern const u8 OtherText_ThePretty[]; -extern const u8 OtherText_WinningPortrait[]; -extern const u8 OtherText_GiveUsWink[]; -extern const u8 OtherText_Terminator13[]; -extern const u8 OtherText_SmartnessMaestro[]; -extern const u8 OtherText_Terminator14[]; -extern const u8 OtherText_ChosenPokeAmong[]; -extern const u8 OtherText_Terminator15[]; -extern const u8 OtherText_TheExcellent[]; -extern const u8 OtherText_ItsMomentOfElegance[]; -extern const u8 OtherText_PowerfullyMuscular[]; -extern const u8 OtherText_Terminator16[]; -extern const u8 OtherText_StrongErEst[]; -extern const u8 OtherText_Terminator17[]; -extern const u8 OtherText_MightyTough[]; -extern const u8 OtherText_Exclamation[]; -extern const u8 gContestText_ContestWinner[]; -extern const u8 gOtherText_Unknown1[]; static const u16 gPictureFramePalettes[][16] = { diff --git a/src/item.c b/src/item.c index 7257c3649..ad2b9aed3 100644 --- a/src/item.c +++ b/src/item.c @@ -1,10 +1,10 @@ #include "global.h" #include "item.h" #include "string_util.h" +#include "strings.h" extern struct Berry *GetBerryInfo(u8 berry); -extern u8 gOtherText_Berry2[]; extern u8 gUnknown_02038560; extern struct Item gItems[]; diff --git a/src/item_use.c b/src/item_use.c index 116a57226..cc961836b 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -22,6 +22,7 @@ #include "songs.h" #include "sound.h" #include "string_util.h" +#include "strings.h" #include "task.h" #include "vars.h" @@ -74,23 +75,6 @@ extern u8 GetItemEffectType(); extern void sub_808B020(void); extern void sub_810B96C(void); -extern u8 gOtherText_DadsAdvice[]; -extern u8 gOtherText_CantGetOffBike[]; -extern u8 gOtherText_NoResponse[]; -extern u8 gOtherText_ItemfinderResponding[]; -extern u8 gOtherText_ItemfinderItemUnderfoot[]; -extern u8 gOtherText_Coins3[]; -extern u8 gOtherText_BootedHM[]; -extern u8 gOtherText_BootedTM[]; -extern u8 gOtherText_ContainsMove[]; -extern u8 gOtherText_UsedItem[]; -extern u8 gOtherText_RepelLingers[]; -extern u8 gOtherText_UsedFlute[]; -extern u8 gOtherText_UsedRepel[]; -extern u8 gOtherText_BoxIsFull[]; -extern u8 gOtherText_WontHaveAnyEffect[]; -extern u8 gOtherText_SnapConfusion[]; - extern u16 gScriptItemId; extern u16 gBattleTypeFlags; diff --git a/src/main_menu.c b/src/main_menu.c index 50fefc471..e5ab0c822 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -15,6 +15,7 @@ #include "sound.h" #include "species.h" #include "string_util.h" +#include "strings.h" #include "task.h" #include "text.h" #include "title_screen.h" @@ -41,18 +42,6 @@ extern const u8 gBirchSpeech_WhatsYourName[]; extern u8 gBirchSpeech_SoItsPlayer[]; extern u8 gBirchSpeech_AhOkayYouArePlayer[]; extern u8 gBirchSpeech_AreYouReady[]; -extern u8 gSaveFileDeletedMessage[]; -extern u8 gSaveFileCorruptMessage[]; -extern u8 gBoardNotInstalledMessage[]; -extern u8 gBatteryDryMessage[]; -extern u8 gMainMenuString_Continue[]; -extern u8 gMainMenuString_NewGame[]; -extern u8 gMainMenuString_MysteryEvents[]; -extern u8 gMainMenuString_Option[]; -extern u8 gMainMenuString_Player[]; -extern u8 gMainMenuString_Time[]; -extern u8 gMainMenuString_Pokedex[]; -extern u8 gMainMenuString_Badges[]; extern const struct MonCoords gMonFrontPicCoords[]; extern const struct SpriteSheet gMonFrontPicTable[]; @@ -68,7 +57,6 @@ extern const u8 gUnknown_081E764C[]; extern const u8 gBirchIntroShadowGfx[]; extern const u8 gUnknown_081E7834[]; extern const u8 gUnknown_081E796C[]; -extern const u8 gSystemText_NewPara[]; extern const union AffineAnimCmd *const gSpriteAffineAnimTable_81E79AC[]; @@ -115,7 +103,7 @@ static void Task_MainMenuProcessKeyInput(u8 taskId); static void Task_MainMenuPressedA(u8 taskId); static void Task_MainMenuPressedB(u8 taskId); static void HighlightCurrentMenuItem(u8 layout, u8 menuItem); -static void PrintMainMenuItem(u8 *text, u8 left, u8 top); +static void PrintMainMenuItem(const u8 *text, u8 left, u8 top); static void PrintSaveFileInfo(void); static void PrintPlayerName(void); static void PrintPlayTime(void); @@ -657,7 +645,7 @@ void HighlightCurrentMenuItem(u8 layout, u8 menuItem) } } -void PrintMainMenuItem(u8 *text, u8 left, u8 top) +void PrintMainMenuItem(const u8 *text, u8 left, u8 top) { u8 i; u8 buffer[32]; @@ -1646,9 +1634,9 @@ static void SetPresetPlayerName(u8 index) u8 *name; if (gSaveBlock2.playerGender == MALE) - name = gMalePresetNames[index].text; + name = (u8 *) gMalePresetNames[index].text; else - name = gFemalePresetNames[index].text; + name = (u8 *) gFemalePresetNames[index].text; for (i = 0; i < 7; i++) gSaveBlock2.playerName[i] = name[i]; diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index 2fa889a15..d6fb33917 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -4,6 +4,7 @@ #include "rng.h" #include "script.h" #include "string_util.h" +#include "strings.h" extern u16 gScriptResult; extern u16 gSpecialVar_0x8004; @@ -14,8 +15,6 @@ extern void sub_80F83D0(void); extern void sub_80F7F80(u8); extern u16 sub_80EB8EC(void); extern void sub_80F7DC0(void); -extern u8 gOtherText_Is[]; -extern u8 gOtherText_DontYouAgree[]; extern u32 gUnknown_083E5388[]; extern u32 gUnknown_083E53A8[]; diff --git a/src/menu.c b/src/menu.c index 3759d22c9..f9b9dbf0b 100644 --- a/src/menu.c +++ b/src/menu.c @@ -6,6 +6,7 @@ #include "script.h" #include "songs.h" #include "sound.h" +#include "strings.h" #include "text.h" #include "text_window.h" @@ -22,9 +23,6 @@ struct Menu u8 columnXCoords[8]; }; -extern u8 OtherText_Yes[]; -extern u8 OtherText_No[]; - static void MultistepInitMenuWindowInternal(const struct WindowConfig *, u16); static void InitMenuWindowInternal(const struct WindowConfig *, u16); static bool8 sub_80723D4(void); @@ -603,7 +601,7 @@ u8 MenuPrint_PixelCoords(const u8 *text, u8 left, u16 top, u8 a4) return sub_8004D04(gMenuWindowPtr, text, gMenuTextTileOffset, left, top, a4); } -u8 sub_8072A18(u8 *text, u8 left, u16 top, u8 width, u32 a5) +u8 sub_8072A18(const u8 *text, u8 left, u16 top, u8 width, u32 a5) { return sub_8004FD0(gMenuWindowPtr, 0, text, gMenuTextTileOffset, left, top, width, a5); } @@ -659,7 +657,7 @@ u8 *sub_8072C74(u8 *a1, const u8 *a2, u8 a3, u8 a4) return AlignString(gMenuWindowPtr, a1, a2, a3, a4); } -u8 sub_8072CA4(u8 *str) +u8 sub_8072CA4(const u8 *str) { return GetStringWidth(gMenuWindowPtr, str); } diff --git a/src/party_menu.c b/src/party_menu.c index 8eb181f46..82f234ae4 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -5,6 +5,7 @@ #include "songs.h" #include "sound.h" #include "string_util.h" +#include "strings.h" #include "task.h" #include "sprite.h" #include "palette.h" @@ -86,50 +87,6 @@ extern const u16 gUnknown_08376504[]; extern void (*const gUnknown_08376B54[])(u8); extern const u8 *const gUnknown_08376D04[DATA_COUNT]; extern const struct UnknownStruct5 gUnknown_08376BB4[][6]; -extern const u8 gOtherText_TallPlusAndRightArrow[]; -extern const u8 gOtherText_WontHaveAnyEffect[]; -extern const u8 gOtherText_ElevatedTo[]; -extern const u8 gOtherText_MailMustBeRemoved[]; -extern const u8 gOtherText_AlreadyHolding[]; -extern const u8 gOtherText_TakenAndReplaced[]; -extern const u8 gOtherText_BagFullCannotRemoveItem[]; -extern const u8 gOtherText_WasGivenToHold[]; -extern const u8 gOtherText_PokeHoldingItemCantMail[]; -extern const u8 gOtherText_MailTransferredMailbox[]; -extern const u8 gOtherText_NotHoldingAnything[]; -extern const u8 gOtherText_ReceivedTheThingFrom[]; -extern const u8 gOtherText_SendRemovedMailPrompt[]; -extern const u8 gOtherText_MailTaken[]; -extern const u8 gOtherText_MailWasSent[]; -extern const u8 gOtherText_MailboxIsFull[]; -extern const u8 gOtherText_MailRemovedMessageLost[]; -extern const u8 gOtherText_WantsToLearn[]; -extern const u8 gOtherText_NotCompatible[]; -extern const u8 gOtherText_AlreadyKnows[]; -extern const u8 gOtherText_LearnedMove[]; -extern const u8 gOtherText_WhichMoveToForget2[]; -extern const u8 gOtherText_ForgetMove123_2[]; -extern const u8 gOtherText_StopTryingTo[]; -extern const u8 gOtherText_DidNotLearnMove2[]; -extern const u8 gOtherText_RegainedHealth[]; -extern const u8 gOtherText_HPRestoredBy[]; -extern const u8 gOtherText_CuredPoisoning[]; -extern const u8 gOtherText_WokeUp[]; -extern const u8 gOtherText_BurnHealed[]; -extern const u8 gOtherText_ThawedOut[]; -extern const u8 gOtherText_CuredParalysis[]; -extern const u8 gOtherText_SnapConfusion[]; -extern const u8 gOtherText_GotOverLove[]; -extern const u8 gOtherText_BecameHealthy[]; -extern const u8 gOtherText_Hp2[]; -extern const u8 gOtherText_Attack[]; -extern const u8 gOtherText_Defense[]; -extern const u8 gOtherText_Speed[]; -extern const u8 gOtherText_SpAtk2[]; -extern const u8 gOtherText_SpDef2[]; -extern const u8 gOtherText_WasRaised[]; -extern const u8 gOtherText_PPIncreased[]; -extern const u8 gOtherText_PPRestored[]; extern const u8 gMoveNames[][13]; extern const u8 *const gItemEffectTable[]; diff --git a/src/player_pc.c b/src/player_pc.c index 048c79862..c012afb02 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -10,6 +10,7 @@ #include "script.h" #include "sound.h" #include "string_util.h" +#include "strings.h" #include "task.h" #define NEW_GAME_PC_ITEMS(i, type) ((u16)(gNewGamePCItems + type)[i * 2]) @@ -21,7 +22,7 @@ enum QUANTITY, }; -extern void DisplayItemMessageOnField(u8, u8*, TaskFunc, u16); +extern void DisplayItemMessageOnField(u8, const u8*, TaskFunc, u16); extern void DoPlayerPCDecoration(u8); extern void BuyMenuFreeMemory(void); extern void DestroyVerticalScrollIndicator(u8); @@ -40,13 +41,8 @@ extern void sub_80F98DC(int); extern void sub_80A4164(u8 *, u16, enum StringConvertMode, u8); extern void CreateVerticalScrollIndicators(u32, u32, u32); // unknown args -extern u8 gOtherText_NoItems[]; - extern u16 gNewGamePCItems[]; -extern u8 gOtherText_WhatWillYouDo[]; -extern u8 gOtherText_NoMailHere[]; - extern u8 *gUnknown_02039314; extern struct MenuAction gUnknown_08406298[]; @@ -57,7 +53,6 @@ extern u8 gUnknown_08406327[]; extern u8 gUnknown_08406330[]; extern u8 gUnknown_0840631E[]; extern u8 gUnknown_08406318[]; -extern u8 gOtherText_CancelNoTerminator[]; extern u8 gUnknown_030007B4; extern u8 unk_201FE00[]; diff --git a/src/pokedex.c b/src/pokedex.c index 03a7d916a..51552789b 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -12,6 +12,7 @@ #include "songs.h" #include "sound.h" #include "string_util.h" +#include "strings.h" #include "task.h" // I'm #define-ing these just for now so I can keep using the old unkXXX member names @@ -90,12 +91,6 @@ extern u8 gUnknown_08E96ACC[]; extern u8 gUnknown_08E96B58[]; extern struct PokedexEntry gPokedexEntries[]; -extern u8 gDexText_UnknownPoke[]; -extern u8 gDexText_UnknownHeight[]; -extern u8 gDexText_UnknownWeight[]; -extern u8 gDexText_CryOf[]; -extern u8 gDexText_SizeComparedTo[]; -extern u8 gDexText_RegisterComplete[]; extern void m4aMPlayVolumeControl(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u16 volume); extern bool8 BeginNormalPaletteFade(u32, s8, u8, u8, u16); diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index 0de1e5ca9..a3de0bd00 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -7,6 +7,7 @@ #include "palette.h" #include "save.h" #include "sprite.h" +#include "strings.h" #include "task.h" #include "text.h" @@ -36,13 +37,6 @@ extern u32 gGameContinueCallback; extern u8 gBirchHelpGfx[]; -extern u8 gSystemText_SaveFailedBackupCheck[]; -extern u8 gSystemText_CheckCompleteSaveAttempt[]; -extern u8 gSystemText_BackupDamagedGameContinue[]; -extern u8 gSystemText_SaveCompletedPressA[]; -extern u8 gSystemText_SaveCompletedGameEnd[]; -extern u8 gSystemText_GameplayEnded[]; - extern u8 gBirchGrassTilemap[]; extern u8 gBirchBagTilemap[]; extern u8 gBirchBagGrassPal[0x40]; diff --git a/src/shop.c b/src/shop.c index 9f4a360df..81c403e92 100644 --- a/src/shop.c +++ b/src/shop.c @@ -9,6 +9,7 @@ #include "script.h" #include "sound.h" #include "sprite.h" +#include "strings.h" #include "task.h" struct UnknownShopStruct @@ -28,8 +29,6 @@ extern struct MenuAction gUnknown_083CC6D0[]; extern u8 gUnknown_083CC6E8[]; extern u8 gUnknown_083CC6EB[]; -extern u8 gOtherText_CanIHelpYou[]; -extern u8 gOtherText_AnythingElse[]; extern u8 gBuyMenuFrame_Gfx[]; extern u16 gBuyMenuFrame_Tilemap[]; @@ -38,7 +37,7 @@ extern u16 gUnknown_083CC710[2]; extern void sub_80A6300(void); extern void sub_80BE3BC(void); -extern void DisplayItemMessageOnField(u8, u8*, TaskFunc, u16); +extern void DisplayItemMessageOnField(u8, const u8*, TaskFunc, u16); extern u8 sub_807D770(void); extern void pal_fill_black(void); extern void sub_80B3764(int, int); diff --git a/src/start_menu.c b/src/start_menu.c index 8d7e50ea5..231e4d608 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -21,6 +21,7 @@ #include "sound.h" #include "sprite.h" #include "string_util.h" +#include "strings.h" #include "task.h" #include "trainer_card.h" @@ -54,10 +55,8 @@ EWRAM_DATA static u8 sNumStartMenuActions = 0; EWRAM_DATA static u8 sCurrentStartMenuActions[10] = {0}; //Text strings -extern u8 gSystemText_Saving[]; extern u8 gSaveText_PlayerSavedTheGame[]; extern u8 gSaveText_DontTurnOff[]; -extern u8 gSystemText_SaveErrorExchangeBackup[]; extern u8 gSaveText_ThereIsAlreadyAFile[]; extern u8 gSaveText_ThereIsADifferentFile[]; extern u8 gSaveText_WouldYouLikeToSave[]; @@ -113,7 +112,7 @@ static u8 SaveCallback1(void); static u8 SaveCallback2(void); static void sub_807160C(void); static u8 RunSaveDialogCallback(void); -static void DisplaySaveMessageWithCallback(u8 *ptr, u8 (*func)(void)); +static void DisplaySaveMessageWithCallback(const u8 *ptr, u8 (*func)(void)); static void Task_SaveDialog(u8 taskId); static void sub_8071700(void); static void HideSaveDialog(void); @@ -517,7 +516,7 @@ void InitSaveDialog(void) CreateTask(Task_SaveDialog, 0x50); } -static void DisplaySaveMessageWithCallback(u8 *ptr, u8 (*func)(void)) +static void DisplaySaveMessageWithCallback(const u8 *ptr, u8 (*func)(void)) { StringExpandPlaceholders(gStringVar4, ptr); MenuDisplayMessageBox(); diff --git a/src/starter_choose.c b/src/starter_choose.c index 4b857dba6..35647473c 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -11,6 +11,7 @@ #include "species.h" #include "sprite.h" #include "string_util.h" +#include "strings.h" #include "task.h" #include "trig.h" @@ -20,14 +21,11 @@ struct MonCoords }; extern void * const gUnknown_081FAF4C[]; -extern const u8 gOtherText_DoYouChoosePoke[]; extern u16 gScriptResult; extern const u8 gSpeciesNames[][11]; -extern const u8 gOtherText_Poke[]; extern const struct SpriteSheet gMonFrontPicTable[]; extern const struct MonCoords gMonFrontPicCoords[]; extern const struct SpritePalette gMonPaletteTable[]; -extern const u8 gOtherText_BirchInTrouble[]; extern struct SpriteTemplate gUnknown_02024E8C; //-------------------------------------------------- diff --git a/src/string_util.c b/src/string_util.c index 957d70153..9686256a1 100644 --- a/src/string_util.c +++ b/src/string_util.c @@ -1,5 +1,6 @@ #include "global.h" #include "string_util.h" +#include "strings.h" #include "text.h" u8 gUnknownStringVar[16]; @@ -23,20 +24,6 @@ static const s32 sPowersOfTen[] = 1000000000, }; -extern u8 gExpandedPlaceholder_Empty[]; -extern u8 gExpandedPlaceholder_Kun[]; -extern u8 gExpandedPlaceholder_Chan[]; -extern u8 gExpandedPlaceholder_Sapphire[]; -extern u8 gExpandedPlaceholder_Ruby[]; -extern u8 gExpandedPlaceholder_Aqua[]; -extern u8 gExpandedPlaceholder_Magma[]; -extern u8 gExpandedPlaceholder_Archie[]; -extern u8 gExpandedPlaceholder_Maxie[]; -extern u8 gExpandedPlaceholder_Kyogre[]; -extern u8 gExpandedPlaceholder_Groudon[]; -extern u8 gExpandedPlaceholder_Brendan[]; -extern u8 gExpandedPlaceholder_May[]; - u8 *StringCopy10(u8 *dest, const u8 *src) { u8 i; @@ -473,17 +460,17 @@ static u8 *ExpandPlaceholder_StringVar3(void) static u8 *ExpandPlaceholder_KunChan(void) { if (gSaveBlock2.playerGender == MALE) - return gExpandedPlaceholder_Kun; + return (u8 *) gExpandedPlaceholder_Kun; else - return gExpandedPlaceholder_Chan; + return (u8 *) gExpandedPlaceholder_Chan; } static u8 *ExpandPlaceholder_RivalName(void) { if (gSaveBlock2.playerGender == MALE) - return gExpandedPlaceholder_May; + return (u8 *) gExpandedPlaceholder_May; else - return gExpandedPlaceholder_Brendan; + return (u8 *) gExpandedPlaceholder_Brendan; } #define VERSION_DEPENDENT_PLACEHOLDER_LIST \ @@ -497,11 +484,11 @@ static u8 *ExpandPlaceholder_RivalName(void) #ifdef SAPPHIRE #define X(ph, r, s) \ -static u8 *ExpandPlaceholder_##ph(void) { return gExpandedPlaceholder_##s; } +static u8 *ExpandPlaceholder_##ph(void) { return (u8 *) gExpandedPlaceholder_##s; } VERSION_DEPENDENT_PLACEHOLDER_LIST #else #define X(ph, r, s) \ -static u8 *ExpandPlaceholder_##ph(void) { return gExpandedPlaceholder_##r; } +static u8 *ExpandPlaceholder_##ph(void) { return (u8 *) gExpandedPlaceholder_##r; } VERSION_DEPENDENT_PLACEHOLDER_LIST #endif @@ -530,7 +517,7 @@ u8 *GetExpandedPlaceholder(u32 id) }; if (id >= ARRAY_COUNT(funcs)) - return gExpandedPlaceholder_Empty; + return (u8 *) gExpandedPlaceholder_Empty; else return funcs[id](); } -- cgit v1.2.3 From 17d352b0f8f2e17c02fac0b8e3e2238b7cd44f37 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sun, 21 May 2017 12:46:28 +0200 Subject: Add strings2.h --- src/battle_records.c | 4 +--- src/calculate_base_damage.c | 2 +- src/clear_save_data_menu.c | 3 +-- src/diploma.c | 5 +---- src/easy_chat.c | 3 +-- src/field_player_avatar.c | 6 +----- src/field_region_map.c | 3 +-- src/link.c | 3 +-- src/mail.c | 3 +-- src/menu.c | 4 ++-- src/mystery_event_menu.c | 8 +------- src/naming_screen.c | 5 +---- src/option_menu.c | 25 ++----------------------- src/pokemon_2.c | 2 +- src/pokemon_size_record.c | 2 +- src/pokemon_summary_screen.c | 13 +------------ src/record_mixing.c | 3 +-- src/save_menu_util.c | 6 +----- src/start_menu.c | 12 +----------- src/trainer_card.c | 13 ++----------- src/wallclock.c | 2 +- 21 files changed, 24 insertions(+), 103 deletions(-) (limited to 'src') diff --git a/src/battle_records.c b/src/battle_records.c index 3290bbebe..35fd3284b 100644 --- a/src/battle_records.c +++ b/src/battle_records.c @@ -1,8 +1,6 @@ #include "global.h" #include "menu.h" - -extern const u8 gOtherText_BattleResults[]; -extern const u8 gOtherText_WinLoseDraw[]; +#include "strings2.h" void PrintLinkBattleWinsLossesDraws(void *); diff --git a/src/calculate_base_damage.c b/src/calculate_base_damage.c index 293e2f24d..45dc59094 100644 --- a/src/calculate_base_damage.c +++ b/src/calculate_base_damage.c @@ -11,6 +11,7 @@ #include "species.h" #include "sprite.h" #include "string_util.h" +#include "strings2.h" #include "text.h" extern u8 gPlayerPartyCount; @@ -34,7 +35,6 @@ extern u16 gTrainerBattleOpponent; extern struct PokemonStorage gPokemonStorage; extern u8 gBadEggNickname[]; -extern u8 gEggNickname[]; extern u32 gBitTable[]; extern struct BaseStats gBaseStats[]; extern u8 gSpeciesNames[][11]; diff --git a/src/clear_save_data_menu.c b/src/clear_save_data_menu.c index c519e1a30..690ce3f55 100644 --- a/src/clear_save_data_menu.c +++ b/src/clear_save_data_menu.c @@ -7,10 +7,9 @@ #include "songs.h" #include "sound.h" #include "sprite.h" +#include "strings2.h" #include "task.h" -extern u8 gSystemText_ClearAllSaveDataPrompt[]; -extern u8 gSystemText_ClearingData[]; extern const struct MenuAction gMenuYesNoItems[]; static void VBlankCB_ClearSaveDataScreen(void); diff --git a/src/diploma.c b/src/diploma.c index c32b72a70..80adac8f7 100644 --- a/src/diploma.c +++ b/src/diploma.c @@ -7,13 +7,10 @@ #include "rom4.h" #include "sprite.h" #include "string_util.h" +#include "strings2.h" #include "task.h" #include "text.h" -extern u8 gOtherText_NationalDex[]; -extern u8 gOtherText_HoennDex[]; -extern u8 gOtherText_DiplomaCertificationGameFreak[]; - static void VBlankCB(void); static void MainCB2(void); static void Task_DiplomaFadeIn(u8); diff --git a/src/easy_chat.c b/src/easy_chat.c index 86719a2ae..678b25a0e 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -7,6 +7,7 @@ #include "rng.h" #include "string_util.h" #include "strings.h" +#include "strings2.h" #include "text.h" u8 sub_80EB37C(u16); @@ -28,8 +29,6 @@ extern const u8 gEasyChatGroupSizes[]; extern u16 gSpecialVar_0x8004; -extern const u8 gOtherText_ThreeQuestions[]; - #ifdef NONMATCHING u8 *sub_80EB3FC(u8 *dst, u16 word) { int group, wordIndex; diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 6a0fe1dce..c1b892f15 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -16,14 +16,10 @@ #include "script.h" #include "songs.h" #include "sound.h" +#include "strings2.h" #include "task.h" #include "wild_encounter.h" -extern u8 gOtherText_OhABite[]; -extern u8 gOtherText_PokeOnHook[]; -extern u8 gOtherText_NotEvenANibble[]; -extern u8 gOtherText_ItGotAway[]; - extern u32 gUnknown_0202FF84[]; //Functions diff --git a/src/field_region_map.c b/src/field_region_map.c index ec630ad00..66e3d968c 100644 --- a/src/field_region_map.c +++ b/src/field_region_map.c @@ -5,6 +5,7 @@ #include "palette.h" #include "sprite.h" #include "text.h" +#include "strings2.h" extern void sub_80FA8EC(u32, u8); extern void sub_80FAB10(void); @@ -29,8 +30,6 @@ struct UnkStruct extern struct UnkStruct unk_2000000; -extern u8 gOtherText_Hoenn[]; - void CB2_FieldInitRegionMap(void); void CB2_FieldRegionMap(void); void VBlankCB_FieldRegionMap(void); diff --git a/src/link.c b/src/link.c index 224c0ae1c..7cf2fc611 100644 --- a/src/link.c +++ b/src/link.c @@ -10,6 +10,7 @@ #include "songs.h" #include "sound.h" #include "sprite.h" +#include "strings2.h" #include "task.h" #include "text.h" @@ -39,8 +40,6 @@ extern u16 gScriptItemId; extern u16 word_3004858; -extern u8 gMultiText_LinkError[]; - static void InitLinkTestBG(u8, u8, u8, u8); void InitLinkTestBG_Unused(u8, u8, u8, u8); void LinkTestScreen(); diff --git a/src/mail.c b/src/mail.c index 807864332..4ec107011 100644 --- a/src/mail.c +++ b/src/mail.c @@ -8,6 +8,7 @@ #include "rom4.h" #include "sprite.h" #include "string_util.h" +#include "strings2.h" #include "task.h" #include "text.h" @@ -70,8 +71,6 @@ extern u16 gUnknown_083E562C[][2]; extern struct MailLayout gUnknown_083E5730[]; extern struct MailLayout gUnknown_083E57A4[]; -extern u8 gOtherText_From[]; - static u8 sub_80F8A28(void); static void sub_80F8D50(void); static void sub_80F8DA0(void); diff --git a/src/menu.c b/src/menu.c index f9b9dbf0b..61eaebb6f 100644 --- a/src/menu.c +++ b/src/menu.c @@ -173,7 +173,7 @@ void MenuDrawTextWindow(u8 left, u8 top, u8 right, u8 bottom) DrawTextWindow(gMenuWindowPtr, left, top, right, bottom); } -void sub_8071F40(u8 *str) +void sub_8071F40(const u8 *str) { MenuDrawTextWindow(2, 14, 28, 19); MenuPrint(str, 3, 15); @@ -637,7 +637,7 @@ void sub_8072B80(u8 *a1, u8 a2, u8 a3, u8 *a4) sub_8003460(gMenuWindowPtr, buffer, gMenuTextTileOffset, a2, a3); } -void sub_8072BD8(u8 *a1, u8 a2, u8 a3, u16 a4) +void sub_8072BD8(const u8 *a1, u8 a2, u8 a3, u16 a4) { sub_8004DB0(gMenuWindowPtr, a1, gMenuTextTileOffset, a2, a3, a4); } diff --git a/src/mystery_event_menu.c b/src/mystery_event_menu.c index fa2e42b91..77c959b07 100644 --- a/src/mystery_event_menu.c +++ b/src/mystery_event_menu.c @@ -10,19 +10,13 @@ #include "sound.h" #include "sprite.h" #include "string_util.h" +#include "strings2.h" #include "task.h" #include "text.h" extern u8 unk_2000000[]; extern u8 gUnknown_02039338; -extern u8 gSystemText_LinkStandby[]; -extern u8 gSystemText_LoadEventPressA[]; -extern u8 gSystemText_LoadingEvent[]; -extern u8 gSystemText_DontCutLink[]; -extern u8 gSystemText_EventLoadSuccess[]; -extern u8 gSystemText_LoadingError[]; - static void VBlankCB(void); static bool8 CheckLanguageMatch(void); static bool8 GetEventLoadMessage(u8 *dest, u32 status); diff --git a/src/naming_screen.c b/src/naming_screen.c index b14c690e2..8c90686ee 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -8,6 +8,7 @@ #include "sound.h" #include "sprite.h" #include "string_util.h" +#include "strings2.h" #include "task.h" #include "text.h" #include "trig.h" @@ -48,7 +49,6 @@ extern const struct SpriteTemplate gSpriteTemplate_83CE670; extern const struct SpriteTemplate gSpriteTemplate_83CE688; extern const struct SpriteSheet gUnknown_083CE6A0[]; extern const struct SpritePalette gUnknown_083CE708[]; -extern const u8 gOtherText_SentToPC[]; extern const u8 gNamingScreenMenu_Gfx[]; extern u16 gMenuMessageBoxContentTileOffset; extern const u16 gNamingScreenPalettes[]; @@ -57,9 +57,6 @@ extern const u16 gUnknown_083CEBF8[]; extern const u16 gUnknown_083CF0A8[]; extern const u16 gUnknown_08E86258[]; extern const u8 gSpeciesNames[][11]; -extern const u8 OtherText_YourName[]; -extern const u8 OtherText_BoxName[]; -extern const u8 OtherText_PokeName[]; static void C2_NamingScreen(void); static void sub_80B5AA0(void); diff --git a/src/option_menu.c b/src/option_menu.c index 49ad98196..878df16ba 100644 --- a/src/option_menu.c +++ b/src/option_menu.c @@ -4,6 +4,7 @@ #include "menu.h" #include "palette.h" #include "sprite.h" +#include "strings2.h" #include "task.h" extern void SetPokemonCryStereo(u32 val); @@ -33,28 +34,6 @@ enum { extern u8 gUnknown_0839F63C[]; extern u8 gUnknown_0839F5FC[]; //palette -extern u8 gSystemText_Normal[]; -extern u8 gSystemText_LR[]; -extern u8 gSystemText_LA[]; -extern u8 gSystemText_Terminator[]; -extern u8 gSystemText_Type[]; -extern u8 gSystemText_Mono[]; -extern u8 gSystemText_Stereo[]; -extern u8 gSystemText_Shift[]; -extern u8 gSystemText_Set[]; -extern u8 gSystemText_On[]; -extern u8 gSystemText_Off[]; -extern u8 gSystemText_Slow[]; -extern u8 gSystemText_Mid[]; -extern u8 gSystemText_Fast[]; -extern u8 gSystemText_OptionMenu[]; -extern u8 gSystemText_TextSpeed[]; -extern u8 gSystemText_BattleScene[]; -extern u8 gSystemText_BattleStyle[]; -extern u8 gSystemText_Sound[]; -extern u8 gSystemText_ButtonMode[]; -extern u8 gSystemText_Frame[]; -extern u8 gSystemText_Cancel[]; static void Task_OptionMenuFadeIn(u8 taskId); static void Task_OptionMenuProcessInput(u8 taskId); @@ -323,7 +302,7 @@ static void HighlightOptionMenuItem(u8 index) REG_WIN1V = WIN_RANGE_(index * 16 + 40, index * 16 + 56); } -static void DrawOptionMenuChoice(u8 *text, u8 x, u8 y, u8 style) +static void DrawOptionMenuChoice(const u8 *text, u8 x, u8 y, u8 style) { u8 dst[16]; u16 i; diff --git a/src/pokemon_2.c b/src/pokemon_2.c index 31b66fd9a..5d24d36d5 100644 --- a/src/pokemon_2.c +++ b/src/pokemon_2.c @@ -8,6 +8,7 @@ #include "sprite.h" #include "string_util.h" #include "text.h" +#include "strings2.h" extern u8 gPlayerPartyCount; extern struct Pokemon gPlayerParty[6]; @@ -34,7 +35,6 @@ extern u16 gTrainerBattleOpponent; extern struct PokemonStorage gPokemonStorage; extern u8 gBadEggNickname[]; -extern u8 gEggNickname[]; extern u32 gBitTable[]; extern struct BaseStats gBaseStats[]; extern u8 gSpeciesNames[][11]; diff --git a/src/pokemon_size_record.c b/src/pokemon_size_record.c index 6540858c1..3406a818b 100644 --- a/src/pokemon_size_record.c +++ b/src/pokemon_size_record.c @@ -3,6 +3,7 @@ #include "event_data.h" #include "species.h" #include "string_util.h" +#include "strings2.h" #include "text.h" extern u16 SpeciesToNationalPokedexNum(u16); @@ -15,7 +16,6 @@ struct UnknownStruct u16 unk4; }; -extern u8 gOtherText_Marco[]; extern u16 gScriptResult; extern u8 gSpeciesNames[][11]; diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 5f96512f0..56a56e455 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -4,22 +4,11 @@ #include "menu.h" #include "pokemon.h" #include "string_util.h" +#include "strings2.h" extern struct Pokemon *unk_2018000; extern u8 *(gNatureNames[]); -extern const u8 gOtherText_Terminator4[]; -extern const u8 gOtherText_Nature[]; - -extern const u8 gOtherText_Met[]; -extern const u8 gOtherText_Egg2[]; -extern const u8 gOtherText_ObtainedInTrade[]; -extern const u8 gOtherText_FatefulEncounter[]; -extern const u8 gOtherText_Met2[]; -extern const u8 gOtherText_EggDayCare[]; -extern const u8 gOtherText_EggNicePlace[]; -extern const u8 gOtherText_EggObtainedInTrade[]; -extern const u8 gOtherText_EggHotSprings[]; u8 *sub_80A1E9C(u8 *dest, u8 *src, u8); u8 PokemonSummaryScreen_CheckOT(struct Pokemon *pokemon); diff --git a/src/record_mixing.c b/src/record_mixing.c index 2e01ead61..c84cfd2ae 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -10,6 +10,7 @@ #include "songs.h" #include "sound.h" #include "string_util.h" +#include "strings2.h" #include "task.h" extern void *recordMixingSecretBases; @@ -28,8 +29,6 @@ extern u16 gSpecialVar_0x8005; extern u32 gUnknown_03005D2C; extern u8 gUnknown_03000718; extern u8 gUnknown_0300071C[]; -extern u8 gOtherText_MixingComplete[]; -extern u8 gOtherText_MixingRecordsWithFriend[]; extern bool8 gReceivedRemoteLinkPlayers; #define BUFFER_CHUNK_SIZE 200 diff --git a/src/save_menu_util.c b/src/save_menu_util.c index 7899fabb1..8910bb300 100644 --- a/src/save_menu_util.c +++ b/src/save_menu_util.c @@ -5,11 +5,7 @@ #include "menu.h" #include "pokedex.h" #include "string_util.h" - -extern u8 gOtherText_Player[]; -extern u8 gOtherText_Badges[]; -extern u8 gOtherText_Pokedex[]; -extern u8 gOtherText_PlayTime[]; +#include "strings2.h" void HandleDrawSaveWindowInfo(s16 left, s16 top) { diff --git a/src/start_menu.c b/src/start_menu.c index 231e4d608..a3258bab1 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -22,6 +22,7 @@ #include "sprite.h" #include "string_util.h" #include "strings.h" +#include "strings2.h" #include "task.h" #include "trainer_card.h" @@ -60,17 +61,6 @@ extern u8 gSaveText_DontTurnOff[]; extern u8 gSaveText_ThereIsAlreadyAFile[]; extern u8 gSaveText_ThereIsADifferentFile[]; extern u8 gSaveText_WouldYouLikeToSave[]; -extern u8 gOtherText_SafariStock[]; -extern u8 SystemText_Pokedex[]; -extern u8 SystemText_Pokemon[]; -extern u8 SystemText_BAG[]; -extern u8 SystemText_Pokenav[]; -extern u8 SystemText_Player[]; -extern u8 SystemText_Save[]; -extern u8 SystemText_Option[]; -extern u8 SystemText_Exit[]; -extern u8 SystemText_Retire[]; -extern u8 SystemText_Player[]; static u8 StartMenu_PokedexCallback(void); static u8 StartMenu_PokemonCallback(void); diff --git a/src/trainer_card.c b/src/trainer_card.c index e6ed79c15..ef3a2d857 100644 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -14,6 +14,7 @@ #include "sound.h" #include "sprite.h" #include "string_util.h" +#include "strings2.h" #include "task.h" typedef void (*Callback)(void); @@ -64,16 +65,6 @@ extern u16 gUnknown_083B5F4C[]; extern u16 gUnknown_08E8CFC0[]; extern u16 gUnknown_08E8D9C0[]; -extern u8 gOtherText_TrainersTrainerCard[]; -extern u8 gOtherText_FirstHOF[]; -extern u8 gOtherText_LinkCableBattles[]; -extern u8 gOtherText_BattleTowerWinRecord[]; -extern u8 gOtherText_ContestRecord[]; -extern u8 gOtherText_MixingRecord[]; -extern u8 gOtherText_TradeRecord[]; -extern u8 gOtherText_Boy[]; -extern u8 gOtherText_Girl[]; - extern bool8 (*const gUnknown_083B5EBC[])(struct Task *); extern bool8 (*const gUnknown_083B5ED8[])(struct Task *); @@ -1831,7 +1822,7 @@ static void TrainerCard_Back_PrintPokemonTrades(void) void unref_sub_8094588(u16 left, u16 top) { - u8 *text = gOtherText_Boy; + const u8 *text = gOtherText_Boy; if (gSaveBlock2.playerGender == FEMALE) { diff --git a/src/wallclock.c b/src/wallclock.c index de007c1b3..0b9948adc 100644 --- a/src/wallclock.c +++ b/src/wallclock.c @@ -8,6 +8,7 @@ #include "rtc.h" #include "songs.h" #include "sound.h" +#include "strings2.h" #include "task.h" #include "trig.h" @@ -15,7 +16,6 @@ extern u16 gSpecialVar_0x8004; extern u8 gMiscClock_Gfx[]; extern u8 gUnknown_08E95774[]; extern u8 gUnknown_08E954B0[]; -extern u8 gOtherText_CorrectTimePrompt[]; extern const struct MenuAction gMenuYesNoItems[]; extern u16 gMiscClockMale_Pal[]; extern u16 gMiscClockFemale_Pal[]; -- cgit v1.2.3 From ca6485a3b23102c96bf046bfacb3b994d83f9555 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sun, 21 May 2017 13:25:26 +0200 Subject: Add data2 header --- src/battle_2.c | 28 +++++----------------------- src/battle_ai.c | 3 +-- src/battle_setup.c | 4 ++-- src/calculate_base_damage.c | 6 +----- src/contest_painting.c | 13 +------------ src/credits.c | 14 +++----------- src/decompress.c | 5 +---- src/easy_chat.c | 3 +-- src/intro.c | 20 ++++---------------- src/item_use.c | 3 +-- src/main_menu.c | 14 +++----------- src/matsuda_debug_menu.c | 2 +- src/mori_debug_menu.c | 3 +-- src/naming_screen.c | 2 +- src/party_menu.c | 2 +- src/pokedex.c | 1 - src/pokemon_1.c | 2 +- src/pokemon_2.c | 6 +----- src/pokemon_3.c | 6 +----- src/pokemon_size_record.c | 2 +- src/pokenav.c | 3 +-- src/rom3.c | 1 - src/rom_8077ABC.c | 14 +------------- src/scrcmd.c | 4 +--- src/script_pokemon_util_80C4BF0.c | 7 ++----- src/script_pokemon_util_80F99CC.c | 3 +-- src/smokescreen.c | 4 +--- src/starter_choose.c | 13 ++----------- src/tv.c | 4 +--- 29 files changed, 41 insertions(+), 151 deletions(-) (limited to 'src') diff --git a/src/battle_2.c b/src/battle_2.c index 12fd4182d..6bcccbaf9 100644 --- a/src/battle_2.c +++ b/src/battle_2.c @@ -1,6 +1,7 @@ #include "global.h" #include "asm.h" #include "battle.h" +#include "data2.h" #include "main.h" #include "text.h" #include "palette.h" @@ -17,18 +18,6 @@ #include "trig.h" #include "abilities.h" -struct MonCoords -{ - u8 x, y; -}; - -struct UnknownStruct5 -{ - u32 unk0; - u32 unk4; - u32 unk8; -}; - struct UnknownStruct6 { u16 unk0[0xA0]; @@ -138,14 +127,7 @@ struct UnknownStruct13 u8 filler4[12]; }; -extern const struct UnknownStruct5 gUnknown_081F9674; -extern const u8 gUnknown_081F96C8[]; -extern void *const gUnknown_081FAF4C[]; extern const u16 gUnknown_08D004E0[]; -extern const struct Trainer gTrainers[]; -extern const u8 gSpeciesNames[][11]; -extern const struct BattleMove gBattleMoves[]; -extern const struct MonCoords gMonFrontPicCoords[]; extern const struct MonCoords gCastformFrontSpriteCoords[]; extern const struct BaseStats gBaseStats[]; extern const u32 gBitTable[]; @@ -1524,19 +1506,19 @@ void sub_8010384(struct Sprite *sprite) else unownSpecies = NUM_SPECIES + unownForm; // Use one of the other Unown letters - yOffset = gMonFrontPicCoords[unownSpecies].y; + yOffset = gMonFrontPicCoords[unownSpecies].y_offset; } else if (species == SPECIES_CASTFORM) { - yOffset = gCastformFrontSpriteCoords[gBattleMonForms[r6]].y; + yOffset = gCastformFrontSpriteCoords[gBattleMonForms[r6]].y_offset; } else if (species > NUM_SPECIES) { - yOffset = gMonFrontPicCoords[SPECIES_NONE].y; + yOffset = gMonFrontPicCoords[SPECIES_NONE].y_offset; } else { - yOffset = gMonFrontPicCoords[species].y; + yOffset = gMonFrontPicCoords[species].y_offset; } sprite->data3 = 8 - yOffset / 8; diff --git a/src/battle_ai.c b/src/battle_ai.c index 9bbaf908e..f10c6a013 100644 --- a/src/battle_ai.c +++ b/src/battle_ai.c @@ -4,6 +4,7 @@ #include "asm.h" #include "battle.h" #include "battle_move_effects.h" +#include "data2.h" #include "item.h" #include "moves.h" #include "pokemon.h" @@ -36,8 +37,6 @@ extern u8 gCritMultiplier; extern u16 gTrainerBattleOpponent; extern u32 gBitTable[]; extern u8 *BattleAIs[]; -extern struct Trainer gTrainers[]; -extern struct BattleMove gBattleMoves[]; extern struct BaseStats gBaseStats[]; /* diff --git a/src/battle_setup.c b/src/battle_setup.c index 61b9bb1e9..a70157a43 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -2,6 +2,7 @@ #include "battle_setup.h" #include "asm.h" #include "battle.h" +#include "data2.h" #include "event_data.h" #include "field_control_avatar.h" #include "field_map_obj_helpers.h" @@ -34,7 +35,6 @@ extern void (*gUnknown_0300485C)(void); extern struct Pokemon gEnemyParty[]; extern struct Pokemon gPlayerParty[]; -extern struct Trainer gTrainers[]; EWRAM_DATA u16 gTrainerBattleMode = 0; EWRAM_DATA u16 gTrainerBattleOpponent = 0; @@ -752,7 +752,7 @@ u8 GetWildBattleTransition(void) u8 GetTrainerBattleTransition(void) { - struct Trainer *trainer; + const struct Trainer *trainer; u8 minPartyCount; u8 flashVar; u8 level; diff --git a/src/calculate_base_damage.c b/src/calculate_base_damage.c index 45dc59094..7868a2c67 100644 --- a/src/calculate_base_damage.c +++ b/src/calculate_base_damage.c @@ -2,6 +2,7 @@ #include "abilities.h" #include "battle.h" #include "berry.h" +#include "data2.h" #include "event_data.h" #include "hold_effects.h" #include "item.h" @@ -37,12 +38,7 @@ extern struct PokemonStorage gPokemonStorage; extern u8 gBadEggNickname[]; extern u32 gBitTable[]; extern struct BaseStats gBaseStats[]; -extern u8 gSpeciesNames[][11]; -extern struct BattleMove gBattleMoves[]; extern struct SpriteTemplate gSpriteTemplate_8208288[]; -extern union AmimCmd *gSpriteAnimTable_81E7C64[]; -extern union AnimCmd **gUnknown_081EC2A4[]; -extern union AnimCmd **gUnknown_081ECACC[]; extern u8 gTrainerClassToPicIndex[]; extern u8 gTrainerClassToNameIndex[]; extern u8 gSecretBaseTrainerClasses[]; diff --git a/src/contest_painting.c b/src/contest_painting.c index c970deaf2..d7bacb905 100644 --- a/src/contest_painting.c +++ b/src/contest_painting.c @@ -1,6 +1,7 @@ #include "global.h" #include "contest_painting.h" #include "asm.h" +#include "data2.h" #include "decompress.h" #include "main.h" #include "menu.h" @@ -24,11 +25,6 @@ extern struct Unk2015E00 unk_2015e00; extern struct Unk3000756 gUnknown_03000756; extern struct Unk03005E20 gUnknown_03005E20; extern struct ContestEntry *gUnknown_03005E8C; -extern const struct SpriteSheet gMonFrontPicTable[]; -extern const struct MonCoords gMonFrontPicCoords[]; -extern const struct SpriteSheet gMonBackPicTable[]; -extern const struct MonCoords gMonBackPicCoords[]; -extern void *gUnknown_081FAF4C[]; static const u16 gPictureFramePalettes[][16] = { @@ -345,13 +341,6 @@ static void VBlankCB_ContestPainting(void) TransferPlttBuffer(); } - -struct MonCoords -{ - u8 x; - u8 y; -}; - #ifdef NONMATCHING static void sub_8106AC4(u16 species, u8 arg1) { diff --git a/src/credits.c b/src/credits.c index ca5553c2e..de1d52361 100644 --- a/src/credits.c +++ b/src/credits.c @@ -1,5 +1,6 @@ #include "global.h" #include "asm.h" +#include "data2.h" #include "decompress.h" #include "event_data.h" #include "m4a.h" @@ -20,11 +21,6 @@ asm(".set OFFSET_REG_BLDALPHA, 0x52"); asm(".set REG_BLDCNT, REG_BASE + OFFSET_REG_BLDCNT"); asm(".set REG_BLDALPHA, REG_BASE + OFFSET_REG_BLDALPHA"); -struct MonCoords -{ - u8 x, y; -}; - extern void *species_and_otid_get_pal(u32, u16, u16); enum @@ -173,10 +169,6 @@ extern s16 gUnknown_0203935C; extern u8 gReservedSpritePaletteCount; -// data/data2 -extern struct MonCoords gMonFrontPicCoords[]; -extern struct SpriteSheet gMonFrontPicTable[]; - // data/starter_choose extern u16 gBirchBagGrassPal[32]; extern u8 gBirchGrassTilemap[]; @@ -1520,8 +1512,8 @@ static u8 sub_81456B4(u16 species, u16 x, u16 y, u16 position) LoadSpecialPokePic( &gMonFrontPicTable[species], - gMonFrontPicCoords[species].x, - gMonFrontPicCoords[species].y, + gMonFrontPicCoords[species].coords, + gMonFrontPicCoords[species].y_offset, 0x2000000, gUnknown_0840B5A0[position], species, diff --git a/src/decompress.c b/src/decompress.c index 12be8a055..37aa1e8d5 100644 --- a/src/decompress.c +++ b/src/decompress.c @@ -1,15 +1,12 @@ #include "global.h" #include "decompress.h" #include "asm.h" +#include "data2.h" #include "species.h" #include "text.h" #define WRAM 0x02000000 -extern struct SpriteSheet gMonFrontPicTable[]; -extern struct SpriteSheet gMonBackPicTable[]; -extern void *gUnknown_081FAF4C[]; - void sub_800D238(const void *src, void *dest) { LZ77UnCompWram(src, dest); diff --git a/src/easy_chat.c b/src/easy_chat.c index 678b25a0e..b21b00368 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -1,6 +1,7 @@ #include "global.h" #include "easy_chat.h" #include "asm.h" +#include "data2.h" #include "event_data.h" #include "field_message_box.h" #include "pokedex.h" @@ -22,8 +23,6 @@ static u16 sub_80EB9D8(void); static u16 sub_80EB960(void); u16 sub_80EB72C(u16); -extern const u8 gSpeciesNames[][11]; -extern u8 gMoveNames[][13]; extern void *gEasyChatGroupWords[]; extern const u8 gEasyChatGroupSizes[]; diff --git a/src/intro.c b/src/intro.c index 56eaa11e8..7f6763199 100644 --- a/src/intro.c +++ b/src/intro.c @@ -2,6 +2,7 @@ #include "gba/m4a_internal.h" #include "intro.h" #include "asm.h" +#include "data2.h" #include "decompress.h" #include "libgncmultiboot.h" #include "link.h" @@ -21,12 +22,6 @@ extern void *species_and_otid_get_pal(/*TODO: arg types*/); extern void sub_8143680(int, u8); -struct MonCoords -{ - u8 x, y; -}; - - extern struct SpriteTemplate gUnknown_02024E8C; extern u16 gUnknown_02039318; extern u16 gUnknown_0203931A; @@ -36,13 +31,6 @@ extern u32 gIntroFrameCounter; extern struct GcmbStruct gMultibootProgramStruct; extern u16 gSaveFileStatus; extern u8 gReservedSpritePaletteCount; -extern struct SpriteSheet gMonFrontPicTable[]; -extern struct MonCoords gMonFrontPicCoords[]; -extern struct SpriteSheet gMonBackPicTable[]; -extern struct MonCoords gMonBackPicCoords[]; -extern struct SpriteSheet gTrainerBackPicTable[]; -extern struct MonCoords gTrainerBackPicCoords[]; -extern struct SpritePalette gTrainerBackPicPaletteTable[]; extern const u8 gInterfaceGfx_PokeBall[]; extern const u16 gInterfacePal_PokeBall[]; extern const struct SpriteSheet gIntro2BrendanSpriteSheet; @@ -1797,9 +1785,9 @@ static u16 sub_813CE88(u16 species, s16 x, s16 y, u16 d, u8 front) u8 spriteId; if (front) - LoadSpecialPokePic(&gMonFrontPicTable[species], gMonFrontPicCoords[species].x, gMonFrontPicCoords[species].y, 0x2000000, gUnknown_0840B5A0[d], species, 0, 1); + LoadSpecialPokePic(&gMonFrontPicTable[species], gMonFrontPicCoords[species].coords, gMonFrontPicCoords[species].y_offset, 0x2000000, gUnknown_0840B5A0[d], species, 0, 1); else - LoadSpecialPokePic(&gMonBackPicTable[species], gMonBackPicCoords[species].x, gMonBackPicCoords[species].y, 0x2000000, gUnknown_0840B5A0[d], species, 0, 0); + LoadSpecialPokePic(&gMonBackPicTable[species], gMonBackPicCoords[species].coords, gMonBackPicCoords[species].y_offset, 0x2000000, gUnknown_0840B5A0[d], species, 0, 0); pal = species_and_otid_get_pal(species, 0, 0xFFFF); LoadCompressedPalette(pal, 0x100 + d * 0x10, 0x20); sub_8143648(d, d); @@ -1813,7 +1801,7 @@ static u8 sub_813CFA8(u16 a, u16 b, u16 c, u16 d) { u8 spriteId; - DecompressPicFromTable_2(&gTrainerBackPicTable[a], gTrainerBackPicCoords[a].x, gTrainerBackPicCoords[a].y, (void *)0x2000000, gUnknown_0840B5A0[d], a); + DecompressPicFromTable_2(&gTrainerBackPicTable[a], gTrainerBackPicCoords[a].coords, gTrainerBackPicCoords[a].y_offset, (void *)0x2000000, gUnknown_0840B5A0[d], a); LoadCompressedPalette(gTrainerBackPicPaletteTable[a].data, 0x100 + d * 0x10, 0x20); sub_8143680(d, d); gUnknown_02024E8C.anims = gUnknown_0840B064; diff --git a/src/item_use.c b/src/item_use.c index cc961836b..d1c1dbf2a 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -3,6 +3,7 @@ #include "battle.h" #include "berry.h" #include "coins.h" +#include "data2.h" #include "event_data.h" #include "field_map_obj_helpers.h" #include "field_player_avatar.h" @@ -30,8 +31,6 @@ extern void (* gUnknown_03005D00)(u8); extern void (* gUnknown_0300485C)(void); extern void (* gUnknown_03004AE4)(u8); -extern u8 gMoveNames[][13]; - extern u8 gUnknown_02038561; extern u8 gLastFieldPokeMenuOpened; extern u8 gUnknown_02024E6C; diff --git a/src/main_menu.c b/src/main_menu.c index e5ab0c822..b2d08698b 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -1,6 +1,7 @@ #include "global.h" #include "main_menu.h" #include "asm.h" +#include "data2.h" #include "decompress.h" #include "event_data.h" #include "menu.h" @@ -22,11 +23,6 @@ #define BirchSpeechUpdateWindowText() ((u8)MenuUpdateWindowText_OverrideLineLength(24)) -struct MonCoords -{ - u8 x, y; -}; - extern struct PaletteFadeControl gPaletteFade; extern u16 gSaveFileStatus; @@ -43,11 +39,7 @@ extern u8 gBirchSpeech_SoItsPlayer[]; extern u8 gBirchSpeech_AhOkayYouArePlayer[]; extern u8 gBirchSpeech_AreYouReady[]; -extern const struct MonCoords gMonFrontPicCoords[]; -extern const struct SpriteSheet gMonFrontPicTable[]; -extern const struct SpritePalette gMonPaletteTable[]; extern struct SpriteTemplate gUnknown_02024E8C; -extern void * const gUnknown_081FAF4C[]; extern u16 gUnknown_081E795C[]; extern const struct MenuAction gUnknown_081E79B0[]; extern const struct MenuAction gMalePresetNames[]; @@ -1400,8 +1392,8 @@ u8 CreateAzurillSprite(u8 x, u8 y) { DecompressPicFromTable_2( &gMonFrontPicTable[SPECIES_AZURILL], - gMonFrontPicCoords[SPECIES_AZURILL].x, - gMonFrontPicCoords[SPECIES_AZURILL].y, + gMonFrontPicCoords[SPECIES_AZURILL].coords, + gMonFrontPicCoords[SPECIES_AZURILL].y_offset, gUnknown_081FAF4C[0], gUnknown_081FAF4C[1], SPECIES_AZURILL); diff --git a/src/matsuda_debug_menu.c b/src/matsuda_debug_menu.c index 09ee5fc66..018e36567 100644 --- a/src/matsuda_debug_menu.c +++ b/src/matsuda_debug_menu.c @@ -2,6 +2,7 @@ #include "matsuda_debug_menu.h" #include "asm.h" #include "contest.h" +#include "data2.h" #include "link.h" #include "main.h" #include "menu.h" @@ -55,7 +56,6 @@ extern struct SpriteTemplate gSpriteTemplate_83C92CC; extern void (*gUnknown_083C92E4[][2])(struct Sprite *, s8); extern u32 gUnknown_083C9400[2]; -extern u8 gMoveNames[][13]; extern u8 gMatsudaDebugMenu_UnknownByteArray[]; extern u8* gMatsudaDebugMenuTextList1[]; diff --git a/src/mori_debug_menu.c b/src/mori_debug_menu.c index fd0ad773b..18c65b7e6 100644 --- a/src/mori_debug_menu.c +++ b/src/mori_debug_menu.c @@ -1,6 +1,7 @@ #include "global.h" #include "mori_debug_menu.h" #include "asm.h" +#include "data2.h" #include "link.h" #include "main.h" #include "menu.h" @@ -20,8 +21,6 @@ extern u8 gUnknown_0839B257[]; extern const struct MenuAction gMoriDebugMenuActions[]; -extern u8 gSpeciesNames[][11]; - void unref_sub_8083CF0(void) { int i; diff --git a/src/naming_screen.c b/src/naming_screen.c index 8c90686ee..53ee5ff19 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -1,6 +1,7 @@ #include "global.h" #include "naming_screen.h" #include "asm.h" +#include "data2.h" #include "main.h" #include "menu.h" #include "palette.h" @@ -56,7 +57,6 @@ extern const u16 gUnknown_083CE748[]; extern const u16 gUnknown_083CEBF8[]; extern const u16 gUnknown_083CF0A8[]; extern const u16 gUnknown_08E86258[]; -extern const u8 gSpeciesNames[][11]; static void C2_NamingScreen(void); static void sub_80B5AA0(void); diff --git a/src/party_menu.c b/src/party_menu.c index 82f234ae4..ee6bcf2a9 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -1,5 +1,6 @@ #include "global.h" #include "asm.h" +#include "data2.h" #include "menu.h" #include "pokemon.h" #include "songs.h" @@ -87,7 +88,6 @@ extern const u16 gUnknown_08376504[]; extern void (*const gUnknown_08376B54[])(u8); extern const u8 *const gUnknown_08376D04[DATA_COUNT]; extern const struct UnknownStruct5 gUnknown_08376BB4[][6]; -extern const u8 gMoveNames[][13]; extern const u8 *const gItemEffectTable[]; extern bool8 IsDoubleBattle(void); diff --git a/src/pokedex.c b/src/pokedex.c index 51552789b..91e577bbc 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -103,7 +103,6 @@ extern u16 NationalToHoennOrder(u16); extern u16 gPokedexOrder_Alphabetical[]; extern u16 gPokedexOrder_Weight[]; extern u16 gPokedexOrder_Height[]; -extern u8 gSpeciesNames[][11]; u16 NationalPokedexNumToSpecies(u16); diff --git a/src/pokemon_1.c b/src/pokemon_1.c index 204fa7b9a..dacbb81c3 100644 --- a/src/pokemon_1.c +++ b/src/pokemon_1.c @@ -1,5 +1,6 @@ #include "global.h" #include "asm.h" +#include "data2.h" #include "items.h" #include "main.h" #include "pokemon.h" @@ -25,7 +26,6 @@ extern u8 byte_2024E88; extern u32 gExperienceTables[8][101]; extern struct BaseStats gBaseStats[]; -extern struct BattleMove gBattleMoves[]; extern const u16 *gLevelUpLearnsets[]; void ZeroBoxMonData(struct BoxPokemon *boxMon) diff --git a/src/pokemon_2.c b/src/pokemon_2.c index 5d24d36d5..7fbfc1271 100644 --- a/src/pokemon_2.c +++ b/src/pokemon_2.c @@ -1,5 +1,6 @@ #include "global.h" #include "asm.h" +#include "data2.h" #include "event_data.h" #include "main.h" #include "pokemon.h" @@ -37,13 +38,8 @@ extern struct PokemonStorage gPokemonStorage; extern u8 gBadEggNickname[]; extern u32 gBitTable[]; extern struct BaseStats gBaseStats[]; -extern u8 gSpeciesNames[][11]; -extern struct BattleMove gBattleMoves[]; extern const struct SpriteTemplate gSpriteTemplate_8208288[]; -extern const union AmimCmd *const gSpriteAnimTable_81E7C64[]; //array of pointers to arrays of pointers to union AnimCmd (We probably need to typedef this.) -extern const union AnimCmd *const *const gUnknown_081EC2A4[]; -extern const union AnimCmd *const *const gUnknown_081ECACC[]; extern u8 gTrainerClassToPicIndex[]; extern u8 gTrainerClassToNameIndex[]; extern u8 gSecretBaseTrainerClasses[]; diff --git a/src/pokemon_3.c b/src/pokemon_3.c index 6b42d3272..f9eb3a7e9 100644 --- a/src/pokemon_3.c +++ b/src/pokemon_3.c @@ -1,6 +1,7 @@ #include "global.h" #include "asm.h" #include "battle.h" +#include "data2.h" #include "event_data.h" #include "hold_effects.h" #include "item.h" @@ -74,9 +75,6 @@ extern u8 gEnemyMonIndex; extern u8 gUnknown_02024C0B; extern u8 gUnknown_02024E6C; extern struct SpindaSpot gSpindaSpotGraphics[]; -extern void *gUnknown_081FAF4C[]; -extern u8 gSpeciesNames[][11]; -extern struct Trainer gTrainers[]; extern s8 gNatureStatTable[][5]; extern s8 gUnknown_082082FE[][3]; extern u16 gTrainerBattleOpponent; @@ -88,8 +86,6 @@ extern u32 gTMHMLearnsets[][2]; extern const u16 *gLevelUpLearnsets[]; extern u8 gBattleMonForms[]; extern const u8 BattleText_Wally[]; -extern const struct SpritePalette gMonPaletteTable[]; -extern const struct SpritePalette gMonShinyPaletteTable[]; extern const u16 gHMMoves[]; extern s8 gUnknown_083F7E28[]; extern u8 byte_2024C06; diff --git a/src/pokemon_size_record.c b/src/pokemon_size_record.c index 3406a818b..b2f8a1569 100644 --- a/src/pokemon_size_record.c +++ b/src/pokemon_size_record.c @@ -1,5 +1,6 @@ #include "global.h" #include "pokemon_size_record.h" +#include "data2.h" #include "event_data.h" #include "species.h" #include "string_util.h" @@ -17,7 +18,6 @@ struct UnknownStruct }; extern u16 gScriptResult; -extern u8 gSpeciesNames[][11]; static const struct UnknownStruct sBigMonSizeTable[] = { diff --git a/src/pokenav.c b/src/pokenav.c index 60e7c73e1..f50f039f8 100644 --- a/src/pokenav.c +++ b/src/pokenav.c @@ -1,5 +1,6 @@ #include "global.h" #include "battle.h" +#include "data2.h" #include "string_util.h" struct UnkPokenavStruct_Sub { @@ -17,8 +18,6 @@ struct UnkPokenavStruct { extern struct UnkPokenavStruct *gUnknown_083DFEC4; -extern const struct Trainer gTrainers[]; -extern const u8 gTrainerClassNames[][13]; void sub_80F700C(u8 *arg0, u16 arg1) { struct Trainer *trainer; diff --git a/src/rom3.c b/src/rom3.c index ef7b9a7ed..be6ae0b27 100644 --- a/src/rom3.c +++ b/src/rom3.c @@ -15,7 +15,6 @@ extern u8 unk_2000000[]; extern u16 gBattleTypeFlags; extern const u32 gBitTable[]; extern u16 gBattleWeather; -extern const struct BattleMove gBattleMoves[]; extern struct BattlePokemon gBattleMons[]; extern u8 gUnknown_020238C4; diff --git a/src/rom_8077ABC.c b/src/rom_8077ABC.c index 437c62400..9561db690 100644 --- a/src/rom_8077ABC.c +++ b/src/rom_8077ABC.c @@ -1,6 +1,7 @@ #include "global.h" #include "battle.h" #include "blend_palette.h" +#include "data2.h" #include "decompress.h" #include "palette.h" #include "species.h" @@ -40,13 +41,6 @@ struct TransformStatus { u16 species; }; -struct MonCoords { - // This would use a bitfield, but sub_8079F44 - // uses it as a u8 and casting won't match. - u8 coords; // u8 x:4, y:4; - u8 y_offset; -}; - struct Struct_gUnknown_0837F578 { u8 field_0; u8 field_1; @@ -101,11 +95,8 @@ extern struct Struct_unk_2019348 unk_2019348; extern struct TransformStatus gTransformStatuses[]; extern u16 gBattleMonPartyPositions[]; extern u16 gBattleTypeFlags; -extern struct MonCoords gMonBackPicCoords[]; -extern struct MonCoords gMonFrontPicCoords[]; extern u32 gTransformPersonalities[NUM_BATTLE_SLOTS]; extern u8 gBattleMonForms[NUM_BATTLE_SLOTS]; -extern u8 gEnemyMonElevation[]; extern u16 gUnknown_0202F7CA[]; extern u8 gBattleMonSprites[NUM_BATTLE_SLOTS]; extern u8 gBattleAnimPlayerMonIndex; @@ -116,9 +107,6 @@ extern u8 gUnknown_02024A68; // gNumBattleMons? extern struct OamMatrix gOamMatrices[]; extern struct Struct_2017810 unk_2017810[]; extern u8 gUnknown_0202F7BE; -extern const union AffineAnimCmd *const gSpriteAffineAnimTable_81E7C18; -extern struct SpriteSheet gMonFrontPicTable[]; -extern struct SpriteSheet gMonBackPicTable[]; extern u8 IsContest(); extern bool8 sub_8078874(u8); diff --git a/src/scrcmd.c b/src/scrcmd.c index 136181bd3..33867b58a 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -6,6 +6,7 @@ #include "clock.h" #include "coins.h" #include "contest_painting.h" +#include "data2.h" #include "decoration.h" #include "event_data.h" #include "field_door.h" @@ -59,9 +60,6 @@ extern SpecialFunc gSpecials[]; extern u8 *gStdScripts[]; extern u8 *gStdScripts_End[]; -extern u8 gSpeciesNames[][11]; -extern u8 gMoveNames[][13]; - extern u8 * const gUnknown_083CE048[]; extern struct Decoration gDecorations[]; diff --git a/src/script_pokemon_util_80C4BF0.c b/src/script_pokemon_util_80C4BF0.c index b87f5e956..d111cf8f6 100644 --- a/src/script_pokemon_util_80C4BF0.c +++ b/src/script_pokemon_util_80C4BF0.c @@ -3,6 +3,7 @@ #include "battle.h" #include "berry.h" #include "contest.h" +#include "data2.h" #include "decompress.h" #include "event_data.h" #include "items.h" @@ -21,9 +22,6 @@ #define CONTEST_ENTRY_PIC_LEFT 10 #define CONTEST_ENTRY_PIC_TOP 3 -extern const struct SpriteSheet gMonFrontPicTable[]; -extern struct MonCoords gMonFrontPicCoords[]; - extern void sub_80C46EC(void); extern void sub_80C4740(void); extern void sub_80C48F4(void); @@ -35,7 +33,6 @@ extern void sub_8042044(struct Pokemon *mon, u16, u8); extern void sub_8121E10(void); extern void sub_8121E34(void); -extern void *gUnknown_081FAF4C[]; extern struct SpriteTemplate gUnknown_02024E8C; extern struct SpritePalette *sub_80409C8(u16, u32, u32); @@ -437,7 +434,7 @@ void ShowContestEntryMonPic(void) gTasks[taskId].data[0] = 0; gTasks[taskId].data[1] = species; HandleLoadSpecialPokePic((struct SpriteSheet *)&gMonFrontPicTable[species].data, - gMonFrontPicCoords[species].x, gMonFrontPicCoords[species].y, + gMonFrontPicCoords[species].coords, gMonFrontPicCoords[species].y_offset, (u32)gUnknown_081FAF4C[0], gUnknown_081FAF4C[1], species, var1); paletteData = sub_80409C8(species, var2, var1); LoadCompressedObjectPalette(paletteData); diff --git a/src/script_pokemon_util_80F99CC.c b/src/script_pokemon_util_80F99CC.c index e1d532b16..9e833ec34 100644 --- a/src/script_pokemon_util_80F99CC.c +++ b/src/script_pokemon_util_80F99CC.c @@ -1,6 +1,7 @@ #include "global.h" #include "asm.h" #include "battle_party_menu.h" +#include "data2.h" #include "palette.h" #include "pokemon.h" #include "rom4.h" @@ -17,8 +18,6 @@ extern u16 gSpecialVar_0x8005; extern u8 gUnknown_02038694; extern u16 gScriptResult; -extern u8 gMoveNames[][13]; - extern void (*gUnknown_0300485C)(void); extern void OpenPartyMenu(u8, u8); diff --git a/src/smokescreen.c b/src/smokescreen.c index 1d3a14a5b..0406c1cb3 100644 --- a/src/smokescreen.c +++ b/src/smokescreen.c @@ -1,4 +1,5 @@ #include "global.h" +#include "data2.h" #include "decompress.h" #include "sprite.h" @@ -6,9 +7,6 @@ extern u8 CreateInvisibleSpriteWithCallback(void (*)(struct Sprite *)); static void sub_8046388(struct Sprite *); -extern struct SpriteSheet gUnknown_081FAEA4; -extern struct SpritePalette gUnknown_081FAEAC; -extern const struct SpriteTemplate gSpriteTemplate_81FAF0C; u8 sub_8046234(s16 x, s16 y, u8 a3) { diff --git a/src/starter_choose.c b/src/starter_choose.c index 35647473c..32b6adf36 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -1,6 +1,7 @@ #include "global.h" #include "starter_choose.h" #include "asm.h" +#include "data2.h" #include "decompress.h" #include "main.h" #include "menu.h" @@ -15,17 +16,7 @@ #include "task.h" #include "trig.h" -struct MonCoords -{ - u8 x, y; -}; - -extern void * const gUnknown_081FAF4C[]; extern u16 gScriptResult; -extern const u8 gSpeciesNames[][11]; -extern const struct SpriteSheet gMonFrontPicTable[]; -extern const struct MonCoords gMonFrontPicCoords[]; -extern const struct SpritePalette gMonPaletteTable[]; extern struct SpriteTemplate gUnknown_02024E8C; //-------------------------------------------------- @@ -565,7 +556,7 @@ static u8 CreatePokemonFrontSprite(u16 species, u8 x, u8 y) DecompressPicFromTable_2( &gMonFrontPicTable[species], - gMonFrontPicCoords[species].x, gMonFrontPicCoords[species].y, + gMonFrontPicCoords[species].coords, gMonFrontPicCoords[species].y_offset, gUnknown_081FAF4C[0], gUnknown_081FAF4C[1], species); LoadCompressedObjectPalette(&gMonPaletteTable[species]); diff --git a/src/tv.c b/src/tv.c index dfda14d82..d2e38c088 100644 --- a/src/tv.c +++ b/src/tv.c @@ -1,6 +1,7 @@ #include "global.h" #include "asm.h" #include "tv.h" +#include "data2.h" #include "event_data.h" #include "field_message_box.h" #include "flags.h" @@ -69,9 +70,6 @@ extern u8 gUnknown_020387E8; extern struct UnkTvStruct gUnknown_03005D38; -extern u8 gSpeciesNames[][11]; -extern u8 gMoveNames[][13]; - extern u8 *gTVBravoTrainerTextGroup[]; extern u8 *gTVBravoTrainerBattleTowerTextGroup[]; extern u8 *gTVSmartShopperTextGroup[]; -- cgit v1.2.3 From 6508197cbbd6a10226958d4e4b6bebb4fc754cad Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sun, 21 May 2017 13:31:26 +0200 Subject: Define gSineTable in trig.h --- src/intro.c | 1 - src/pokedex.c | 2 +- src/trig.c | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/intro.c b/src/intro.c index 7f6763199..3f4897092 100644 --- a/src/intro.c +++ b/src/intro.c @@ -44,7 +44,6 @@ extern const u16 gIntroCopyright_Pal[]; extern const u16 gIntroCopyright_Tilemap[]; extern const u16 gUnknown_08393E64[]; extern void *const gUnknown_0840B5A0[]; -extern const s16 gSineTable[]; //-------------------------------------------------- // Graphics Data diff --git a/src/pokedex.c b/src/pokedex.c index 91e577bbc..97bac3390 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -14,6 +14,7 @@ #include "string_util.h" #include "strings.h" #include "task.h" +#include "trig.h" // I'm #define-ing these just for now so I can keep using the old unkXXX member names #define unk60E selectedPokemon @@ -78,7 +79,6 @@ extern struct SpriteTemplate gSpriteTemplate_83A056C; extern struct SpriteTemplate gSpriteTemplate_83A0584; extern struct SpriteTemplate gSpriteTemplate_83A059C; extern struct SpriteTemplate gSpriteTemplate_83A05B4; -extern s16 gSineTable[]; extern struct PokedexListItem *gUnknown_0202FFBC; extern IntrCallback gUnknown_03005CEC; extern u8 gUnknown_08E96BD4[]; diff --git a/src/trig.c b/src/trig.c index 8b75b3838..d64231087 100644 --- a/src/trig.c +++ b/src/trig.c @@ -1,7 +1,6 @@ #include "global.h" #include "trig.h" -extern s16 gSineTable[]; extern s16 gSineDegreeTable[]; // amplitude * sin(index*(Ï€/128)) -- cgit v1.2.3 From 2b8d522c6cf6de600f07e409b9148e6ce92e047d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 20 May 2017 23:32:57 -0400 Subject: sub_805C930 --- src/field_map_obj.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index f7e09aacf..19d4676cf 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -6,6 +6,7 @@ #include "field_player_avatar.h" #include "palette.h" #include "rom4.h" +#include "rng.h" #include "sprite.h" extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[36]; @@ -1547,3 +1548,17 @@ u8 sub_805C904(struct MapObject *mapObject, struct Sprite *sprite) return 1; } +extern bool8 FieldObjectExecRegularAnim(); +extern const s16 gUnknown_0837520C[]; +extern void sub_8064820(struct Sprite *, s16); + +u8 sub_805C930(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite) == 0) { + return 0; + } + sub_8064820(sprite, gUnknown_0837520C[Random() & 3]); + sprite->data1 = 3; + return 1; +} + -- cgit v1.2.3 From a8d4813e571bb4dcdac5ee1fcf11d1efa4384687 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 20 May 2017 23:49:47 -0400 Subject: A handful more functions related to field map movement patterns --- src/field_map_obj.c | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 19d4676cf..a7856ec07 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -1548,13 +1548,14 @@ u8 sub_805C904(struct MapObject *mapObject, struct Sprite *sprite) return 1; } -extern bool8 FieldObjectExecRegularAnim(); +extern u8 FieldObjectExecRegularAnim(struct MapObject *, struct Sprite *); extern const s16 gUnknown_0837520C[]; extern void sub_8064820(struct Sprite *, s16); u8 sub_805C930(struct MapObject *mapObject, struct Sprite *sprite) { - if (FieldObjectExecRegularAnim(mapObject, sprite) == 0) { + if (FieldObjectExecRegularAnim(mapObject, sprite) == 0) + { return 0; } sub_8064820(sprite, gUnknown_0837520C[Random() & 3]); @@ -1562,3 +1563,41 @@ u8 sub_805C930(struct MapObject *mapObject, struct Sprite *sprite) return 1; } +extern u8 sub_8064824(struct Sprite *); + +u8 sub_805C96C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8064824(sprite) != 0) + { + sprite->data1 = 4; + return 1; + } + return 0; +} + +extern const u8 gUnknown_08375240[4]; +extern u8 sub_805FF20(struct MapObject *, u8); + +u8 sub_805C98C(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 direction; + u8 directions[4]; + memcpy(directions, gUnknown_08375240, 4); + direction = directions[Random() & 3]; + FieldObjectSetDirection(mapObject, direction); + sprite->data1 = 5; + if (sub_805FF20(mapObject, direction) != 0) + { + sprite->data1 = 1; + } + return 1; +} + +u8 sub_805C9D8(struct MapObject *mapObject, struct Sprite *sprite) +{ + FieldObjectSetRegularAnim(mapObject, sprite, GetGoSpeed0AnimId(mapObject->placeholder18)); + mapObject->mapobj_bit_1 = 1; + sprite->data1 = 6; + return 1; +} + -- cgit v1.2.3 From 83ddca476069c52e0ea550b335539c0371d164c3 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 21 May 2017 00:18:31 -0400 Subject: field_map_obj.c up to and including FieldObjectIsTrainerAndCloseToPlayer --- src/field_map_obj.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index a7856ec07..61ec26365 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -1601,3 +1601,44 @@ u8 sub_805C9D8(struct MapObject *mapObject, struct Sprite *sprite) return 1; } +u8 sub_805CA08(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite) != 0) + { + mapObject->mapobj_bit_1 = 0; + sprite->data1 = 1; + } + return 0; +} + +u8 FieldObjectIsTrainerAndCloseToPlayer(struct MapObject *mapObject) +{ + s16 x; + s16 y; + s16 objx; + s16 objy; + s16 minx; + s16 maxx; + s16 miny; + s16 maxy; + if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_DASH) == 0) + { + return 0; + } + if (mapObject->trainerType != 1 && mapObject->trainerType != 3) + { + return 0; + } + PlayerGetDestCoords(&x, &y); + objx = mapObject->coords2.x; + objy = mapObject->coords2.y; + minx = objx - mapObject->trainerRange_berryTreeId; + miny = objy - mapObject->trainerRange_berryTreeId; + maxx = objx + mapObject->trainerRange_berryTreeId; + maxy = objy + mapObject->trainerRange_berryTreeId; + if (minx > x || maxx < x || miny > y || maxy < y) + { + return 0; + } + return 1; +} -- cgit v1.2.3 From f578c81cfdfb54e1101c5f5785cb685bd63c3b5a Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 21 May 2017 00:48:56 -0400 Subject: More functions governing npc trainer facing directions --- src/field_map_obj.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 61ec26365..e5a50362a 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -1642,3 +1642,47 @@ u8 FieldObjectIsTrainerAndCloseToPlayer(struct MapObject *mapObject) } return 1; } + +u8 sub_805CAAC(s16 a0, s16 a1, s16 a2, s16 a3) +{ + u8 dirn; + if (a2 > a3) + { + dirn = DIR_EAST; + if (a0 < 0) + { + dirn = DIR_WEST; + } + } + else + { + dirn = DIR_SOUTH; + if (a1 < 0) + { + dirn = DIR_NORTH; + } + } + return dirn; +} + +u8 sub_805CADC(s16 a0, s16 a1) +{ + u8 dirn; + dirn = DIR_SOUTH; + if (a1 < 0) + { + dirn = DIR_NORTH; + } + return dirn; +} + +u8 sub_805CAEC(s16 a0, s16 a1) +{ + u8 dirn; + dirn = DIR_EAST; + if (a0 < 0) + { + dirn = DIR_WEST; + } + return dirn; +} -- cgit v1.2.3 From 9997127c347abfbc245270077a762348162831b8 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 21 May 2017 10:01:47 -0400 Subject: A few more functions for calculating map object facing directions --- src/field_map_obj.c | 133 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 131 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index e5a50362a..f042b4af1 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -1665,7 +1665,7 @@ u8 sub_805CAAC(s16 a0, s16 a1, s16 a2, s16 a3) return dirn; } -u8 sub_805CADC(s16 a0, s16 a1) +u8 sub_805CADC(s16 a0, s16 a1, s16 a2, s16 a3) { u8 dirn; dirn = DIR_SOUTH; @@ -1676,7 +1676,7 @@ u8 sub_805CADC(s16 a0, s16 a1) return dirn; } -u8 sub_805CAEC(s16 a0, s16 a1) +u8 sub_805CAEC(s16 a0, s16 a1, s16 a2, s16 a3) { u8 dirn; dirn = DIR_EAST; @@ -1686,3 +1686,132 @@ u8 sub_805CAEC(s16 a0, s16 a1) } return dirn; } + +u8 sub_805CB00(s16 a0, s16 a1, s16 a2, s16 a3) { + u8 dirn; + dirn = sub_805CAAC(a0, a1, a2, a3); + if (dirn == DIR_SOUTH) + { + dirn = sub_805CAEC(a0, a1, a2, a3); + if (dirn == DIR_EAST) + { + dirn = DIR_NORTH; + } + } + else if (dirn == DIR_EAST) + { + dirn = sub_805CADC(a0, a1, a2, a3); + if (dirn == DIR_SOUTH) + { + dirn = DIR_NORTH; + } + } + return dirn; +} + +u8 sub_805CB5C(s16 a0, s16 a1, s16 a2, s16 a3) { + u8 dirn; + dirn = sub_805CAAC(a0, a1, a2, a3); + if (dirn == DIR_SOUTH) + { + dirn = sub_805CAEC(a0, a1, a2, a3); + if (dirn == DIR_WEST) + { + dirn = DIR_NORTH; + } + } + else if (dirn == DIR_WEST) + { + dirn = sub_805CADC(a0, a1, a2, a3); + if (dirn == DIR_SOUTH) + { + dirn = DIR_NORTH; + } + } + return dirn; +} + +u8 sub_805CBB8(s16 a0, s16 a1, s16 a2, s16 a3) { + u8 dirn; + dirn = sub_805CAAC(a0, a1, a2, a3); + if (dirn == DIR_NORTH) + { + dirn = sub_805CAEC(a0, a1, a2, a3); + if (dirn == DIR_EAST) + { + dirn = DIR_SOUTH; + } + } + else if (dirn == DIR_EAST) + { + dirn = sub_805CADC(a0, a1, a2, a3); + if (dirn == DIR_NORTH) + { + dirn = DIR_SOUTH; + } + } + return dirn; +} + +u8 sub_805CC14(s16 a0, s16 a1, s16 a2, s16 a3) { + u8 dirn; + dirn = sub_805CAAC(a0, a1, a2, a3); + if (dirn == DIR_NORTH) + { + dirn = sub_805CAEC(a0, a1, a2, a3); + if (dirn == DIR_WEST) + { + dirn = DIR_SOUTH; + } + } + else if (dirn == DIR_WEST) + { + dirn = sub_805CADC(a0, a1, a2, a3); + if (dirn == DIR_NORTH) + { + dirn = DIR_SOUTH; + } + } + return dirn; +} + +u8 sub_805CC70(s16 a0, s16 a1, s16 a2, s16 a3) { + u8 dirn; + dirn = sub_805CAAC(a0, a1, a2, a3); + if (dirn == DIR_EAST) + { + dirn = sub_805CADC(a0, a1, a2, a3); + } + return dirn; +} + +u8 sub_805CCAC(s16 a0, s16 a1, s16 a2, s16 a3) { + u8 dirn; + dirn = sub_805CAAC(a0, a1, a2, a3); + if (dirn == DIR_WEST) + { + dirn = sub_805CADC(a0, a1, a2, a3); + } + return dirn; +} + +u8 sub_805CCE8(s16 a0, s16 a1, s16 a2, s16 a3) { + u8 dirn; + dirn = sub_805CAAC(a0, a1, a2, a3); + if (dirn == DIR_SOUTH) + { + dirn = sub_805CAEC(a0, a1, a2, a3); + } + return dirn; +} + +u8 sub_805CD24(s16 a0, s16 a1, s16 a2, s16 a3) { + u8 dirn; + dirn = sub_805CAAC(a0, a1, a2, a3); + if (dirn == DIR_NORTH) + { + dirn = sub_805CAEC(a0, a1, a2, a3); + } + return dirn; +} + -- cgit v1.2.3 From bb42b58e4b703e1f00828b38ac233cf222b8885d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 21 May 2017 10:15:44 -0400 Subject: sub_805CD60 --- src/field_map_obj.c | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index f042b4af1..9d4a67da3 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -34,6 +34,7 @@ void GetFieldObjectMovingCameraOffset(s16 *, s16 *); void sub_805BDF8(u16); u8 sub_805BE58(const struct SpritePalette *); u8 FindFieldObjectPaletteIndexByTag(u16); +extern u8 (*const gUnknown_08375244[])(s16 a0, s16 a1, s16 a2, s16 a3); struct PairedPalettes { @@ -1687,7 +1688,8 @@ u8 sub_805CAEC(s16 a0, s16 a1, s16 a2, s16 a3) return dirn; } -u8 sub_805CB00(s16 a0, s16 a1, s16 a2, s16 a3) { +u8 sub_805CB00(s16 a0, s16 a1, s16 a2, s16 a3) +{ u8 dirn; dirn = sub_805CAAC(a0, a1, a2, a3); if (dirn == DIR_SOUTH) @@ -1709,7 +1711,8 @@ u8 sub_805CB00(s16 a0, s16 a1, s16 a2, s16 a3) { return dirn; } -u8 sub_805CB5C(s16 a0, s16 a1, s16 a2, s16 a3) { +u8 sub_805CB5C(s16 a0, s16 a1, s16 a2, s16 a3) +{ u8 dirn; dirn = sub_805CAAC(a0, a1, a2, a3); if (dirn == DIR_SOUTH) @@ -1731,7 +1734,8 @@ u8 sub_805CB5C(s16 a0, s16 a1, s16 a2, s16 a3) { return dirn; } -u8 sub_805CBB8(s16 a0, s16 a1, s16 a2, s16 a3) { +u8 sub_805CBB8(s16 a0, s16 a1, s16 a2, s16 a3) +{ u8 dirn; dirn = sub_805CAAC(a0, a1, a2, a3); if (dirn == DIR_NORTH) @@ -1775,7 +1779,8 @@ u8 sub_805CC14(s16 a0, s16 a1, s16 a2, s16 a3) { return dirn; } -u8 sub_805CC70(s16 a0, s16 a1, s16 a2, s16 a3) { +u8 sub_805CC70(s16 a0, s16 a1, s16 a2, s16 a3) +{ u8 dirn; dirn = sub_805CAAC(a0, a1, a2, a3); if (dirn == DIR_EAST) @@ -1785,7 +1790,8 @@ u8 sub_805CC70(s16 a0, s16 a1, s16 a2, s16 a3) { return dirn; } -u8 sub_805CCAC(s16 a0, s16 a1, s16 a2, s16 a3) { +u8 sub_805CCAC(s16 a0, s16 a1, s16 a2, s16 a3) +{ u8 dirn; dirn = sub_805CAAC(a0, a1, a2, a3); if (dirn == DIR_WEST) @@ -1795,7 +1801,8 @@ u8 sub_805CCAC(s16 a0, s16 a1, s16 a2, s16 a3) { return dirn; } -u8 sub_805CCE8(s16 a0, s16 a1, s16 a2, s16 a3) { +u8 sub_805CCE8(s16 a0, s16 a1, s16 a2, s16 a3) +{ u8 dirn; dirn = sub_805CAAC(a0, a1, a2, a3); if (dirn == DIR_SOUTH) @@ -1805,7 +1812,8 @@ u8 sub_805CCE8(s16 a0, s16 a1, s16 a2, s16 a3) { return dirn; } -u8 sub_805CD24(s16 a0, s16 a1, s16 a2, s16 a3) { +u8 sub_805CD24(s16 a0, s16 a1, s16 a2, s16 a3) +{ u8 dirn; dirn = sub_805CAAC(a0, a1, a2, a3); if (dirn == DIR_NORTH) @@ -1815,3 +1823,28 @@ u8 sub_805CD24(s16 a0, s16 a1, s16 a2, s16 a3) { return dirn; } +u8 sub_805CD60(struct MapObject *mapObject, u8 a1) +{ + s16 x; + s16 y; + s16 x2; + s16 y2; + if (!FieldObjectIsTrainerAndCloseToPlayer(mapObject)) + { + return 0; + } + PlayerGetDestCoords(&x, &y); + x -= mapObject->coords2.x; + y -= mapObject->coords2.y; + x2 = x; + y2 = y; + if (x2 < 0) + { + x2 = -x2; + } + if (y2 < 0) + { + y2 = -y2; + } + return gUnknown_08375244[a1](x, y, x2, y2); +} -- cgit v1.2.3 From 6a02a6f6e5f90ae5ddf38bd69c90734a50d9142b Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 21 May 2017 11:30:23 -0400 Subject: sub_805CE0C and helpers --- src/field_map_obj.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 69 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 9d4a67da3..f6ebbee68 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -35,6 +35,7 @@ void sub_805BDF8(u16); u8 sub_805BE58(const struct SpritePalette *); u8 FindFieldObjectPaletteIndexByTag(u16); extern u8 (*const gUnknown_08375244[])(s16 a0, s16 a1, s16 a2, s16 a3); +extern u16 (*const gUnknown_08375270[])(struct MapObject *mapObject, struct Sprite *sprite); struct PairedPalettes { @@ -1505,19 +1506,19 @@ u16 npc_paltag_by_palslot(u8 a) return 0x11FF; } -u32 sub_805C8A8(void); +u8 sub_805C8A8(struct MapObject *mapObject, struct Sprite *sprite); void sub_805C884(struct Sprite *sprite) { meta_step(&gMapObjects[sprite->data0], sprite, sub_805C8A8); } -u32 sub_805C8A8(void) +u8 sub_805C8A8(struct MapObject *mapObject, struct Sprite *sprite) { return 0; } -u32 sub_805C8D0(struct MapObject *, struct Sprite *); +u8 sub_805C8D0(struct MapObject *, struct Sprite *); void sub_805C8AC(struct Sprite *sprite) { @@ -1526,16 +1527,16 @@ void sub_805C8AC(struct Sprite *sprite) extern u8 (*const gUnknown_08375224[])(); -u32 sub_805C8D0(struct MapObject *mapObject, struct Sprite *sprite) +u8 sub_805C8D0(struct MapObject *mapObject, struct Sprite *sprite) { return gUnknown_08375224[sprite->data1](mapObject, sprite); } -void npc_reset(); +void npc_reset(struct MapObject *mapObject, struct Sprite *sprite); u8 sub_805C8F0(struct MapObject *mapObject, struct Sprite *sprite) { - npc_reset(mapObject); + npc_reset(mapObject, sprite); sprite->data1 = 1; return 1; } @@ -1848,3 +1849,65 @@ u8 sub_805CD60(struct MapObject *mapObject, u8 a1) } return gUnknown_08375244[a1](x, y, x2, y2); } + +u8 sub_805CE0C(struct MapObject *mapObject, struct Sprite *sprite); + +void sub_805CDE8(struct Sprite *sprite) +{ + meta_step(&gMapObjects[sprite->data0], sprite, sub_805CE0C); +} + +u8 sub_805CE0C(struct MapObject *mapObject, struct Sprite *sprite) +{ + return gUnknown_08375270[sprite->data1](mapObject, sprite); +} + +u16 sub_805CE2C(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + sprite->data1 = 1; + return 1; +} + +u16 sub_805CE40(struct MapObject *mapObject, struct Sprite *sprite) +{ + FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); + sprite->data1 = 2; + return 1; +} + +u16 sub_805CE6C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite) != 0) + { + sub_8064820(sprite, gUnknown_0837520C[Random() & 3]); + mapObject->mapobj_bit_1 = 0; + sprite->data1 = 3; + } + return 0; +} + +u16 sub_805CEB0(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8064824(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) + { + sprite->data1 = 4; + return 1; + } + return 0; +} + +u16 sub_805CEE0(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 direction; + u8 directions[4]; + memcpy(directions, gUnknown_08375240, 4); + direction = sub_805CD60(mapObject, 0); + if (direction == 0) + { + direction = directions[Random() & 3]; + } + FieldObjectSetDirection(mapObject, direction); + sprite->data1 = 1; + return 1; +} -- cgit v1.2.3 From 5b3a726820513cebb68ac3a3fc8e97014e415db3 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 21 May 2017 11:53:38 -0400 Subject: sub_805CF28 and helpers --- src/field_map_obj.c | 94 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 88 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index f6ebbee68..84d3d1f01 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -35,7 +35,8 @@ void sub_805BDF8(u16); u8 sub_805BE58(const struct SpritePalette *); u8 FindFieldObjectPaletteIndexByTag(u16); extern u8 (*const gUnknown_08375244[])(s16 a0, s16 a1, s16 a2, s16 a3); -extern u16 (*const gUnknown_08375270[])(struct MapObject *mapObject, struct Sprite *sprite); +extern u8 (*const gUnknown_08375270[])(struct MapObject *mapObject, struct Sprite *sprite); +extern u8 (*const gUnknown_08375284[])(struct MapObject *mapObject, struct Sprite *sprite); struct PairedPalettes { @@ -1577,6 +1578,7 @@ u8 sub_805C96C(struct MapObject *mapObject, struct Sprite *sprite) return 0; } +extern const u8 gUnknown_083752A0[2]; extern const u8 gUnknown_08375240[4]; extern u8 sub_805FF20(struct MapObject *, u8); @@ -1862,21 +1864,21 @@ u8 sub_805CE0C(struct MapObject *mapObject, struct Sprite *sprite) return gUnknown_08375270[sprite->data1](mapObject, sprite); } -u16 sub_805CE2C(struct MapObject *mapObject, struct Sprite *sprite) +u8 sub_805CE2C(struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); sprite->data1 = 1; return 1; } -u16 sub_805CE40(struct MapObject *mapObject, struct Sprite *sprite) +u8 sub_805CE40(struct MapObject *mapObject, struct Sprite *sprite) { FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); sprite->data1 = 2; return 1; } -u16 sub_805CE6C(struct MapObject *mapObject, struct Sprite *sprite) +u8 sub_805CE6C(struct MapObject *mapObject, struct Sprite *sprite) { if (FieldObjectExecRegularAnim(mapObject, sprite) != 0) { @@ -1887,7 +1889,7 @@ u16 sub_805CE6C(struct MapObject *mapObject, struct Sprite *sprite) return 0; } -u16 sub_805CEB0(struct MapObject *mapObject, struct Sprite *sprite) +u8 sub_805CEB0(struct MapObject *mapObject, struct Sprite *sprite) { if (sub_8064824(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) { @@ -1897,7 +1899,7 @@ u16 sub_805CEB0(struct MapObject *mapObject, struct Sprite *sprite) return 0; } -u16 sub_805CEE0(struct MapObject *mapObject, struct Sprite *sprite) +u8 sub_805CEE0(struct MapObject *mapObject, struct Sprite *sprite) { u8 direction; u8 directions[4]; @@ -1911,3 +1913,83 @@ u16 sub_805CEE0(struct MapObject *mapObject, struct Sprite *sprite) sprite->data1 = 1; return 1; } + +u8 sub_805CF4C(struct MapObject *mapObject, struct Sprite *sprite); + +void sub_805CF28(struct Sprite *sprite) +{ + meta_step(&gMapObjects[sprite->data0], sprite, sub_805CF4C); +} + +u8 sub_805CF4C(struct MapObject *mapObject, struct Sprite *sprite) +{ + return gUnknown_08375284[sprite->data1](mapObject, sprite); +} + +u8 sub_805CF6C(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + sprite->data1 = 1; + return 1; +} + +u8 sub_805CF80(struct MapObject *mapObject, struct Sprite *sprite) +{ + FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); + sprite->data1 = 2; + return 1; +} + +u8 sub_805CFAC(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite) == 0) + { + return 0; + } + sub_8064820(sprite, gUnknown_0837520C[Random() & 3]); + sprite->data1 = 3; + return 1; +} + +u8 sub_805CFE8(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8064824(sprite) != 0) + { + sprite->data1 = 4; + return 1; + } + return 0; +} + +u8 sub_805D008(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 direction; + u8 directions[2]; + memcpy(directions, gUnknown_083752A0, 2); + direction = directions[Random() & 1]; + FieldObjectSetDirection(mapObject, direction); + sprite->data1 = 5; + if (sub_805FF20(mapObject, direction) != 0) + { + sprite->data1 = 1; + } + return 1; +} + +u8 sub_805D054(struct MapObject *mapObject, struct Sprite *sprite) +{ + FieldObjectSetRegularAnim(mapObject, sprite, GetGoSpeed0AnimId(mapObject->placeholder18)); + mapObject->mapobj_bit_1 = 1; + sprite->data1 = 6; + return 1; +} + +u8 sub_805D084(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite) != 0) + { + mapObject->mapobj_bit_1 = 0; + sprite->data1 = 1; + } + return 0; +} -- cgit v1.2.3 From 2501d0b6d391e2d424c238990be233c88502bb55 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 21 May 2017 12:03:47 -0400 Subject: sub_805D0AC and helpers --- src/field_map_obj.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 84d3d1f01..4de55e0af 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -37,6 +37,7 @@ u8 FindFieldObjectPaletteIndexByTag(u16); extern u8 (*const gUnknown_08375244[])(s16 a0, s16 a1, s16 a2, s16 a3); extern u8 (*const gUnknown_08375270[])(struct MapObject *mapObject, struct Sprite *sprite); extern u8 (*const gUnknown_08375284[])(struct MapObject *mapObject, struct Sprite *sprite); +extern u8 (*const gUnknown_083752A4[])(struct MapObject *mapObject, struct Sprite *sprite); struct PairedPalettes { @@ -1578,8 +1579,9 @@ u8 sub_805C96C(struct MapObject *mapObject, struct Sprite *sprite) return 0; } -extern const u8 gUnknown_083752A0[2]; extern const u8 gUnknown_08375240[4]; +extern const u8 gUnknown_083752A0[2]; +extern const u8 gUnknown_083752C0[2]; extern u8 sub_805FF20(struct MapObject *, u8); u8 sub_805C98C(struct MapObject *mapObject, struct Sprite *sprite) @@ -1993,3 +1995,84 @@ u8 sub_805D084(struct MapObject *mapObject, struct Sprite *sprite) } return 0; } + +u8 sub_805D0D0(struct MapObject *mapObject, struct Sprite *sprite); + +void sub_805D0AC(struct Sprite *sprite) +{ + meta_step(&gMapObjects[sprite->data0], sprite, sub_805D0D0); +} + +u8 sub_805D0D0(struct MapObject *mapObject, struct Sprite *sprite) +{ + return gUnknown_083752A4[sprite->data1](mapObject, sprite); +} + +u8 sub_805D0F0(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + sprite->data1 = 1; + return 1; +} + +u8 sub_805D104(struct MapObject *mapObject, struct Sprite *sprite) +{ + FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); + sprite->data1 = 2; + return 1; +} + +u8 sub_805D130(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite) == 0) + { + return 0; + } + sub_8064820(sprite, gUnknown_0837520C[Random() & 3]); + sprite->data1 = 3; + return 1; +} + +u8 sub_805D16C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8064824(sprite) != 0) + { + sprite->data1 = 4; + return 1; + } + return 0; +} + +u8 sub_805D18C(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 direction; + u8 directions[2]; + memcpy(directions, gUnknown_083752C0, 2); + direction = directions[Random() & 1]; + FieldObjectSetDirection(mapObject, direction); + sprite->data1 = 5; + if (sub_805FF20(mapObject, direction) != 0) + { + sprite->data1 = 1; + } + return 1; +} + +u8 sub_805D1D8(struct MapObject *mapObject, struct Sprite *sprite) +{ + FieldObjectSetRegularAnim(mapObject, sprite, GetGoSpeed0AnimId(mapObject->placeholder18)); + mapObject->mapobj_bit_1 = 1; + sprite->data1 = 6; + return 1; +} + +u8 sub_805D208(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite) != 0) + { + mapObject->mapobj_bit_1 = 0; + sprite->data1 = 1; + } + return 0; +} + -- cgit v1.2.3 From ea609c2b3791c8bd23e3d8109093090c5d619e9d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 21 May 2017 12:10:42 -0400 Subject: sub_805D230 and helpers --- src/field_map_obj.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 4de55e0af..c31db8a4b 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -38,6 +38,7 @@ extern u8 (*const gUnknown_08375244[])(s16 a0, s16 a1, s16 a2, s16 a3); extern u8 (*const gUnknown_08375270[])(struct MapObject *mapObject, struct Sprite *sprite); extern u8 (*const gUnknown_08375284[])(struct MapObject *mapObject, struct Sprite *sprite); extern u8 (*const gUnknown_083752A4[])(struct MapObject *mapObject, struct Sprite *sprite); +extern u8 (*const gUnknown_083752C4[])(struct MapObject *mapObject, struct Sprite *sprite); struct PairedPalettes { @@ -2076,3 +2077,38 @@ u8 sub_805D208(struct MapObject *mapObject, struct Sprite *sprite) return 0; } +u8 sub_805D254(struct MapObject *mapObject, struct Sprite *sprite); + +void sub_805D230(struct Sprite *sprite) +{ + meta_step(&gMapObjects[sprite->data0], sprite, sub_805D254); +} + +u8 sub_805D254(struct MapObject *mapObject, struct Sprite *sprite) +{ + return gUnknown_083752C4[sprite->data1](mapObject, sprite); +} + +u8 sub_805D274(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); + sprite->data1 = 1; + return 1; +} + +u8 sub_805D2A0(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite) != 0) + { + sprite->data1 = 2; + return 1; + } + return 0; +} + +u8 sub_805D2C0(struct MapObject *mapObject, struct Sprite *sprite) +{ + mapObject->mapobj_bit_1 = 0; + return 0; +} -- cgit v1.2.3 From 6bb35f495cfc8f31be4a09100d4eb46fd1d5cd68 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 21 May 2017 13:40:38 -0400 Subject: npc_reset and get image anim id functions --- src/field_map_obj.c | 168 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 168 insertions(+) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index c31db8a4b..7e75d0ac1 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -2112,3 +2112,171 @@ u8 sub_805D2C0(struct MapObject *mapObject, struct Sprite *sprite) mapObject->mapobj_bit_1 = 0; return 0; } + +void FieldObjectCB_BerryTree(struct Sprite *sprite); +void sub_805D4F4(struct Sprite *sprite); +void sub_805D634(struct Sprite *sprite); +void sub_805D774(struct Sprite *sprite); +void sub_805D8B4(struct Sprite *sprite); +void sub_805D9F4(struct Sprite *sprite); +void sub_805DB34(struct Sprite *sprite); +void sub_805DC74(struct Sprite *sprite); +void sub_805DDB4(struct Sprite *sprite); +void sub_805DEF4(struct Sprite *sprite); +void sub_805E034(struct Sprite *sprite); +void sub_805E174(struct Sprite *sprite); +void sub_805E278(struct Sprite *sprite); +void sub_805E37C(struct Sprite *sprite); +void sub_805E37C(struct Sprite *sprite); +void sub_805E37C(struct Sprite *sprite); +void sub_805E37C(struct Sprite *sprite); +void sub_805E5DC(struct Sprite *sprite); +void sub_805E668(struct Sprite *sprite); +void sub_805E6F4(struct Sprite *sprite); +void sub_805E780(struct Sprite *sprite); +void sub_805E80C(struct Sprite *sprite); +void sub_805E898(struct Sprite *sprite); +void sub_805E924(struct Sprite *sprite); +void sub_805E9B0(struct Sprite *sprite); +void sub_805EA3C(struct Sprite *sprite); +void sub_805EAC8(struct Sprite *sprite); +void sub_805EB54(struct Sprite *sprite); +void sub_805EBE0(struct Sprite *sprite); +void sub_805EC6C(struct Sprite *sprite); +void sub_805ECF8(struct Sprite *sprite); +void sub_805ED84(struct Sprite *sprite); +void sub_805EE10(struct Sprite *sprite); +void sub_805EE9C(struct Sprite *sprite); +void sub_805EF28(struct Sprite *sprite); +void sub_805EFB4(struct Sprite *sprite); +void sub_805F040(struct Sprite *sprite); +void sub_805F0CC(struct Sprite *sprite); +void sub_805F158(struct Sprite *sprite); +void sub_805F1E4(struct Sprite *sprite); +void sub_805F270(struct Sprite *sprite); +void sub_805F2FC(struct Sprite *sprite); +void sub_805F2FC(struct Sprite *sprite); +void sub_805F2FC(struct Sprite *sprite); +void sub_805F2FC(struct Sprite *sprite); +void FieldObjectCB_TreeDisguise(struct Sprite *sprite); +void FieldObjectCB_MountainDisguise(struct Sprite *sprite); +void sub_805F8E0(struct Sprite *sprite); +void sub_805F8E0(struct Sprite *sprite); +void sub_805F8E0(struct Sprite *sprite); +void sub_805F8E0(struct Sprite *sprite); +void FieldObjectCB_Hidden1(struct Sprite *sprite); +void sub_805FB20(struct Sprite *sprite); +void sub_805FB20(struct Sprite *sprite); +void sub_805FB20(struct Sprite *sprite); +void sub_805FB20(struct Sprite *sprite); +void sub_805FB90(struct Sprite *sprite); +void sub_805FB90(struct Sprite *sprite); +void sub_805FB90(struct Sprite *sprite); +void sub_805FB90(struct Sprite *sprite); +void sub_805FC00(struct Sprite *sprite); +void sub_805FC00(struct Sprite *sprite); +void sub_805FC00(struct Sprite *sprite); +void sub_805FC00(struct Sprite *sprite); +void sub_805FC70(struct Sprite *sprite); + +asm(".section .text_b\n"); + +void npc_reset(struct MapObject *mapObject, struct Sprite *sprite) +{ + mapObject->mapobj_bit_1 = 0; + mapObject->mapobj_bit_6 = 0; + mapObject->mapobj_bit_7 = 0; + mapObject->mapobj_unk_1C = 0xff; + sprite->data1 = 0; +} + +extern const u8 gUnknown_083755F4[9]; +extern const u8 gUnknown_083755FD[9]; +extern const u8 gUnknown_08375606[9]; +extern const u8 gUnknown_0837560F[9]; +extern const u8 gUnknown_08375618[9]; +extern const u8 gUnknown_08375621[9]; +extern const u8 gUnknown_0837562A[9]; +extern const u8 gUnknown_08375633[9]; +extern const u8 gUnknown_0837563C[9]; +extern const u8 gUnknown_08375645[9]; +extern const u8 gUnknown_0837564E[9]; +extern const u8 gUnknown_08375657[9]; +extern const u8 gUnknown_08375660[9]; +extern const u8 gUnknown_08375669[9]; +extern const u8 gUnknown_08375672[9]; + +u8 FieldObjectDirectionToImageAnimId(u8 direction) +{ + return gUnknown_083755F4[direction]; +} + +u8 get_go_image_anim_num(u8 direction) +{ + return gUnknown_083755FD[direction]; +} + +u8 get_go_fast_image_anim_num(u8 direction) +{ + return gUnknown_08375606[direction]; +} + +u8 get_go_faster_image_anim_num(u8 direction) +{ + return gUnknown_0837560F[direction]; +} + +u8 sub_805FD78(u8 direction) +{ + return gUnknown_08375618[direction]; +} + +u8 sub_805FD88(u8 direction) +{ + return gUnknown_08375621[direction]; +} + +u8 sub_805FD98(u8 direction) +{ + return gUnknown_0837562A[direction]; +} + +u8 unref_sub_805FDA8(u8 direction) +{ + return gUnknown_08375633[direction]; +} + +u8 sub_805FDB8(u8 direction) +{ + return gUnknown_0837563C[direction]; +} + +u8 sub_805FDC8(u8 direction) +{ + return gUnknown_08375645[direction]; +} + +u8 sub_805FDD8(u8 direction) +{ + return gUnknown_0837564E[direction]; +} + +u8 sub_805FDE8(u8 direction) +{ + return gUnknown_08375657[direction]; +} + +u8 sub_805FDF8(u8 direction) +{ + return gUnknown_08375660[direction]; +} + +u8 sub_805FE08(u8 direction) +{ + return gUnknown_08375669[direction]; +} + +u8 get_run_image_anim_num(u8 direction) +{ + return gUnknown_08375672[direction]; +} -- cgit v1.2.3 From 29d718686112139d3fd6f5cc8341f354da9414fc Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 21 May 2017 14:33:21 -0400 Subject: Berry tree field map object callback --- src/field_map_obj.c | 111 +++++++++++++++++++++++++++++++++++++++++++++- src/field_player_avatar.c | 4 +- 2 files changed, 112 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 7e75d0ac1..98bc73390 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -4,6 +4,7 @@ #include "berry.h" #include "event_data.h" #include "field_player_avatar.h" +#include "field_effect.h" #include "palette.h" #include "rom4.h" #include "rng.h" @@ -39,6 +40,7 @@ extern u8 (*const gUnknown_08375270[])(struct MapObject *mapObject, struct Sprit extern u8 (*const gUnknown_08375284[])(struct MapObject *mapObject, struct Sprite *sprite); extern u8 (*const gUnknown_083752A4[])(struct MapObject *mapObject, struct Sprite *sprite); extern u8 (*const gUnknown_083752C4[])(struct MapObject *mapObject, struct Sprite *sprite); +extern u8 (*const gUnknown_083752D0[])(struct MapObject *mapObject, struct Sprite *sprite); struct PairedPalettes { @@ -2113,7 +2115,114 @@ u8 sub_805D2C0(struct MapObject *mapObject, struct Sprite *sprite) return 0; } -void FieldObjectCB_BerryTree(struct Sprite *sprite); +u8 sub_805D314(struct MapObject *mapObject, struct Sprite *sprite); + +void FieldObjectCB_BerryTree(struct Sprite *sprite) +{ + struct MapObject *mapObject; + mapObject = &gMapObjects[sprite->data0]; + if (!(sprite->data7 & 1)) + { + get_berry_tree_graphics(mapObject, sprite); + sprite->data7 |= 1; + } + meta_step(mapObject, sprite, sub_805D314); +} + +u8 sub_805D314(struct MapObject *mapObject, struct Sprite *sprite) +{ + return gUnknown_083752D0[sprite->data1](mapObject, sprite); +} + +extern u32 gUnknown_0202FF84[]; + +u8 do_berry_tree_growth_sparkle_1(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 berryTreeStage; + npc_reset(mapObject, sprite); + mapObject->mapobj_bit_13 = 1; + sprite->invisible = 1; + berryTreeStage = GetStageByBerryTreeId(mapObject->trainerRange_berryTreeId); + if (!berryTreeStage) + { + if (!(sprite->data7 & 4) && sprite->animNum == 4) + { + gUnknown_0202FF84[0] = mapObject->coords2.x; + gUnknown_0202FF84[1] = mapObject->coords2.y; + gUnknown_0202FF84[2] = sprite->subpriority - 1; + gUnknown_0202FF84[3] = sprite->oam.priority; + FieldEffectStart(0x17); + sprite->animNum = 0; + } + return 0; + } + mapObject->mapobj_bit_13 = 0; + sprite->invisible = 0; + berryTreeStage--; + if (sprite->animNum != berryTreeStage) + { + sprite->data1 = 2; + return 1; + } + get_berry_tree_graphics(mapObject, sprite); + FieldObjectSetRegularAnim(mapObject, sprite, 0x39); + sprite->data1 = 1; + return 1; +} + +u8 sub_805D3EC(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite)) + { + sprite->data1 = 0; + return 1; + } + return 0; +} + +u8 do_berry_tree_growth_sparkle_2(struct MapObject *mapObject, struct Sprite *sprite) +{ + mapObject->mapobj_bit_1 = 1; + sprite->data1 = 3; + sprite->data2 = 0; + sprite->data7 |= 2; + gUnknown_0202FF84[0] = mapObject->coords2.x; + gUnknown_0202FF84[1] = mapObject->coords2.y; + gUnknown_0202FF84[2] = sprite->subpriority - 1; + gUnknown_0202FF84[3] = sprite->oam.priority; + FieldEffectStart(0x17); + return 1; +} + +u8 sub_805D458(struct MapObject *mapObject, struct Sprite *sprite) +{ + sprite->data2++; + mapObject->mapobj_bit_13 = ((sprite->data2 & 0x2) >> 1); + sprite->animPaused = 1; + if (sprite->data2 > 64) + { + get_berry_tree_graphics(mapObject, sprite); + sprite->data1 = 4; + sprite->data2 = 0; + return 1; + } + return 0; +} + +u8 sub_805D4A8(struct MapObject *mapObject, struct Sprite *sprite) +{ + sprite->data2++; + mapObject->mapobj_bit_13 = ((sprite->data2 & 0x2) >> 1); + sprite->animPaused = 1; + if (sprite->data2 > 64) + { + sprite->data1 = 0; + sprite->data7 &= (-3); + return 1; + } + return 0; +} + void sub_805D4F4(struct Sprite *sprite); void sub_805D634(struct Sprite *sprite); void sub_805D774(struct Sprite *sprite); diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index c1b892f15..3a280f58a 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -23,7 +23,7 @@ extern u32 gUnknown_0202FF84[]; //Functions -static u32 sub_80587D8(void); +static u8 sub_80587D8(void); static bool8 sub_8058854(struct MapObject *, u8); static void npc_clear_strange_bits(struct MapObject *a); static void MovePlayerAvatarUsingKeypadInput(u8 a, u16 b, u16 c); @@ -248,7 +248,7 @@ void sub_80587B4(struct Sprite *sprite) meta_step(&gMapObjects[sprite->data0], sprite, sub_80587D8); } -static u32 sub_80587D8(void) +static u8 sub_80587D8(void) { return 0; } -- cgit v1.2.3 From 4aeb3bac738b470c83848de58d370d707d3d67df Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 21 May 2017 16:47:09 -0400 Subject: sub_805D4F4 --- src/field_map_obj.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 98bc73390..a637d5767 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -41,6 +41,7 @@ extern u8 (*const gUnknown_08375284[])(struct MapObject *mapObject, struct Sprit extern u8 (*const gUnknown_083752A4[])(struct MapObject *mapObject, struct Sprite *sprite); extern u8 (*const gUnknown_083752C4[])(struct MapObject *mapObject, struct Sprite *sprite); extern u8 (*const gUnknown_083752D0[])(struct MapObject *mapObject, struct Sprite *sprite); +extern u8 (*const gUnknown_083752E4[])(struct MapObject *mapObject, struct Sprite *sprite); struct PairedPalettes { @@ -1546,7 +1547,7 @@ u8 sub_805C8F0(struct MapObject *mapObject, struct Sprite *sprite) return 1; } -extern void FieldObjectSetRegularAnim(); +extern void FieldObjectSetRegularAnim(struct MapObject *, struct Sprite *, u8); u8 sub_805C904(struct MapObject *mapObject, struct Sprite *sprite) { @@ -2223,7 +2224,68 @@ u8 sub_805D4A8(struct MapObject *mapObject, struct Sprite *sprite) return 0; } -void sub_805D4F4(struct Sprite *sprite); +u8 sub_805D518(struct MapObject *mapObject, struct Sprite *sprite); + +void sub_805D4F4(struct Sprite *sprite) +{ + meta_step(&gMapObjects[sprite->data0], sprite, sub_805D518); +} + +u8 sub_805D518(struct MapObject *mapObject, struct Sprite *sprite) +{ + return gUnknown_083752E4[sprite->data1](mapObject, sprite); +} + +u8 sub_805D538(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + sprite->data1 = 1; + return 1; +} + +u8 sub_805D54C(struct MapObject *mapObject, struct Sprite *sprite) +{ + FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); + sprite->data1 = 2; + return 1; +} + +u8 sub_805D578(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite)) + { + sub_8064820(sprite, gUnknown_0837520C[Random() & 3]); + mapObject->mapobj_bit_1 = 0; + sprite->data1 = 3; + } + return 0; +} + +u8 sub_805D5BC(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8064824(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) + { + sprite->data1 = 4; + return 1; + } + return 0; +} + +u8 sub_805D5EC(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 direction; + u8 directions[2]; + memcpy(directions, gUnknown_083752A0, 2); + direction = sub_805CD60(mapObject, 1); + if (direction == 0) + { + direction = directions[Random() & 1]; + } + FieldObjectSetDirection(mapObject, direction); + sprite->data1 = 1; + return 1; +} + void sub_805D634(struct Sprite *sprite); void sub_805D774(struct Sprite *sprite); void sub_805D8B4(struct Sprite *sprite); -- cgit v1.2.3 From e08f647c025853d3a03199cad8f42b38b0e5c41a Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 21 May 2017 18:40:52 -0400 Subject: sub_805D634 --- src/field_map_obj.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index a637d5767..951f3724f 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -42,6 +42,7 @@ extern u8 (*const gUnknown_083752A4[])(struct MapObject *mapObject, struct Sprit extern u8 (*const gUnknown_083752C4[])(struct MapObject *mapObject, struct Sprite *sprite); extern u8 (*const gUnknown_083752D0[])(struct MapObject *mapObject, struct Sprite *sprite); extern u8 (*const gUnknown_083752E4[])(struct MapObject *mapObject, struct Sprite *sprite); +extern u8 (*const gUnknown_083752F8[])(struct MapObject *mapObject, struct Sprite *sprite); struct PairedPalettes { @@ -2286,7 +2287,69 @@ u8 sub_805D5EC(struct MapObject *mapObject, struct Sprite *sprite) return 1; } -void sub_805D634(struct Sprite *sprite); + +u8 sub_805D658(struct MapObject *mapObject, struct Sprite *sprite); + +void sub_805D634(struct Sprite *sprite) +{ + meta_step(&gMapObjects[sprite->data0], sprite, sub_805D658); +} + +u8 sub_805D658(struct MapObject *mapObject, struct Sprite *sprite) +{ + return gUnknown_083752F8[sprite->data1](mapObject, sprite); +} + +u8 sub_805D678(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + sprite->data1 = 1; + return 1; +} + +u8 sub_805D68C(struct MapObject *mapObject, struct Sprite *sprite) +{ + FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); + sprite->data1 = 2; + return 1; +} + +u8 sub_805D6B8(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite)) + { + sub_8064820(sprite, gUnknown_0837520C[Random() & 3]); + mapObject->mapobj_bit_1 = 0; + sprite->data1 = 3; + } + return 0; +} + +u8 sub_805D6FC(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8064824(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) + { + sprite->data1 = 4; + return 1; + } + return 0; +} + +u8 sub_805D72C(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 direction; + u8 directions[2]; + memcpy(directions, gUnknown_083752C0, 2); + direction = sub_805CD60(mapObject, 2); + if (direction == 0) + { + direction = directions[Random() & 1]; + } + FieldObjectSetDirection(mapObject, direction); + sprite->data1 = 1; + return 1; +} + void sub_805D774(struct Sprite *sprite); void sub_805D8B4(struct Sprite *sprite); void sub_805D9F4(struct Sprite *sprite); -- cgit v1.2.3 From ec86ef04a3f725e5c93437fe18c8e1fbb62b38ad Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 21 May 2017 18:50:23 -0400 Subject: sub_805D774 --- src/field_map_obj.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 951f3724f..83bff1026 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -43,6 +43,7 @@ extern u8 (*const gUnknown_083752C4[])(struct MapObject *mapObject, struct Sprit extern u8 (*const gUnknown_083752D0[])(struct MapObject *mapObject, struct Sprite *sprite); extern u8 (*const gUnknown_083752E4[])(struct MapObject *mapObject, struct Sprite *sprite); extern u8 (*const gUnknown_083752F8[])(struct MapObject *mapObject, struct Sprite *sprite); +extern u8 (*const gUnknown_0837530C[])(struct MapObject *mapObject, struct Sprite *sprite); struct PairedPalettes { @@ -1559,6 +1560,7 @@ u8 sub_805C904(struct MapObject *mapObject, struct Sprite *sprite) extern u8 FieldObjectExecRegularAnim(struct MapObject *, struct Sprite *); extern const s16 gUnknown_0837520C[]; +extern const s16 gUnknown_0837521C[]; extern void sub_8064820(struct Sprite *, s16); u8 sub_805C930(struct MapObject *mapObject, struct Sprite *sprite) @@ -1587,6 +1589,7 @@ u8 sub_805C96C(struct MapObject *mapObject, struct Sprite *sprite) extern const u8 gUnknown_08375240[4]; extern const u8 gUnknown_083752A0[2]; extern const u8 gUnknown_083752C0[2]; +extern const u8 gUnknown_08375320[2]; extern u8 sub_805FF20(struct MapObject *, u8); u8 sub_805C98C(struct MapObject *mapObject, struct Sprite *sprite) @@ -2350,7 +2353,69 @@ u8 sub_805D72C(struct MapObject *mapObject, struct Sprite *sprite) return 1; } -void sub_805D774(struct Sprite *sprite); + +u8 sub_805D798(struct MapObject *mapObject, struct Sprite *sprite); + +void sub_805D774(struct Sprite *sprite) +{ + meta_step(&gMapObjects[sprite->data0], sprite, sub_805D798); +} + +u8 sub_805D798(struct MapObject *mapObject, struct Sprite *sprite) +{ + return gUnknown_0837530C[sprite->data1](mapObject, sprite); +} + +u8 sub_805D7B8(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + sprite->data1 = 1; + return 1; +} + +u8 sub_805D7CC(struct MapObject *mapObject, struct Sprite *sprite) +{ + FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); + sprite->data1 = 2; + return 1; +} + +u8 sub_805D7F8(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite)) + { + sub_8064820(sprite, gUnknown_0837521C[Random() & 3]); + mapObject->mapobj_bit_1 = 0; + sprite->data1 = 3; + } + return 0; +} + +u8 sub_805D83C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8064824(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) + { + sprite->data1 = 4; + return 1; + } + return 0; +} + +u8 sub_805D86C(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 direction; + u8 directions[2]; + memcpy(directions, gUnknown_08375320, 2); + direction = sub_805CD60(mapObject, 3); + if (direction == 0) + { + direction = directions[Random() & 1]; + } + FieldObjectSetDirection(mapObject, direction); + sprite->data1 = 1; + return 1; +} + void sub_805D8B4(struct Sprite *sprite); void sub_805D9F4(struct Sprite *sprite); void sub_805DB34(struct Sprite *sprite); -- cgit v1.2.3 From 87b6adf33d61a1f6e5518fdd1d741b621e88f55d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 21 May 2017 19:41:36 -0400 Subject: Finish this block of nearly-identical callbacks --- src/field_map_obj.c | 479 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 454 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 83bff1026..394f3c43d 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -44,6 +44,13 @@ extern u8 (*const gUnknown_083752D0[])(struct MapObject *mapObject, struct Sprit extern u8 (*const gUnknown_083752E4[])(struct MapObject *mapObject, struct Sprite *sprite); extern u8 (*const gUnknown_083752F8[])(struct MapObject *mapObject, struct Sprite *sprite); extern u8 (*const gUnknown_0837530C[])(struct MapObject *mapObject, struct Sprite *sprite); +extern u8 (*const gUnknown_08375324[])(struct MapObject *mapObject, struct Sprite *sprite); +extern u8 (*const gUnknown_0837533C[])(struct MapObject *mapObject, struct Sprite *sprite); +extern u8 (*const gUnknown_08375354[])(struct MapObject *mapObject, struct Sprite *sprite); +extern u8 (*const gUnknown_0837536C[])(struct MapObject *mapObject, struct Sprite *sprite); +extern u8 (*const gUnknown_08375384[])(struct MapObject *mapObject, struct Sprite *sprite); +extern u8 (*const gUnknown_0837539C[])(struct MapObject *mapObject, struct Sprite *sprite); +extern u8 (*const gUnknown_083753B4[])(struct MapObject *mapObject, struct Sprite *sprite); struct PairedPalettes { @@ -1590,6 +1597,13 @@ extern const u8 gUnknown_08375240[4]; extern const u8 gUnknown_083752A0[2]; extern const u8 gUnknown_083752C0[2]; extern const u8 gUnknown_08375320[2]; +extern const u8 gUnknown_08375338[2]; +extern const u8 gUnknown_08375350[2]; +extern const u8 gUnknown_08375368[2]; +extern const u8 gUnknown_08375380[2]; +extern const u8 gUnknown_08375398[2]; +extern const u8 gUnknown_083753B0[2]; +extern const u8 gUnknown_083753C8[2]; extern u8 sub_805FF20(struct MapObject *, u8); u8 sub_805C98C(struct MapObject *mapObject, struct Sprite *sprite) @@ -2416,19 +2430,449 @@ u8 sub_805D86C(struct MapObject *mapObject, struct Sprite *sprite) return 1; } -void sub_805D8B4(struct Sprite *sprite); -void sub_805D9F4(struct Sprite *sprite); -void sub_805DB34(struct Sprite *sprite); -void sub_805DC74(struct Sprite *sprite); -void sub_805DDB4(struct Sprite *sprite); -void sub_805DEF4(struct Sprite *sprite); -void sub_805E034(struct Sprite *sprite); + +u8 sub_805D8D8(struct MapObject *mapObject, struct Sprite *sprite); + +void sub_805D8B4(struct Sprite *sprite) +{ + meta_step(&gMapObjects[sprite->data0], sprite, sub_805D8D8); +} + +u8 sub_805D8D8(struct MapObject *mapObject, struct Sprite *sprite) +{ + return gUnknown_08375324[sprite->data1](mapObject, sprite); +} + +u8 sub_805D8F8(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + sprite->data1 = 1; + return 1; +} + +u8 sub_805D90C(struct MapObject *mapObject, struct Sprite *sprite) +{ + FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); + sprite->data1 = 2; + return 1; +} + +u8 sub_805D938(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite)) + { + sub_8064820(sprite, gUnknown_0837521C[Random() & 3]); + mapObject->mapobj_bit_1 = 0; + sprite->data1 = 3; + } + return 0; +} + +u8 sub_805D97C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8064824(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) + { + sprite->data1 = 4; + return 1; + } + return 0; +} + +u8 sub_805D9AC(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 direction; + u8 directions[2]; + memcpy(directions, gUnknown_08375338, 2); + direction = sub_805CD60(mapObject, 4); + if (direction == 0) + { + direction = directions[Random() & 1]; + } + FieldObjectSetDirection(mapObject, direction); + sprite->data1 = 1; + return 1; +} + + +u8 sub_805DA18(struct MapObject *mapObject, struct Sprite *sprite); + +void sub_805D9F4(struct Sprite *sprite) +{ + meta_step(&gMapObjects[sprite->data0], sprite, sub_805DA18); +} + +u8 sub_805DA18(struct MapObject *mapObject, struct Sprite *sprite) +{ + return gUnknown_0837533C[sprite->data1](mapObject, sprite); +} + +u8 sub_805DA38(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + sprite->data1 = 1; + return 1; +} + +u8 sub_805DA4C(struct MapObject *mapObject, struct Sprite *sprite) +{ + FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); + sprite->data1 = 2; + return 1; +} + +u8 sub_805DA78(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite)) + { + sub_8064820(sprite, gUnknown_0837521C[Random() & 3]); + mapObject->mapobj_bit_1 = 0; + sprite->data1 = 3; + } + return 0; +} + +u8 sub_805DABC(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8064824(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) + { + sprite->data1 = 4; + return 1; + } + return 0; +} + +u8 sub_805DAEC(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 direction; + u8 directions[2]; + memcpy(directions, gUnknown_08375350, 2); + direction = sub_805CD60(mapObject, 5); + if (direction == 0) + { + direction = directions[Random() & 1]; + } + FieldObjectSetDirection(mapObject, direction); + sprite->data1 = 1; + return 1; +} + + +u8 sub_805DB58(struct MapObject *mapObject, struct Sprite *sprite); + +void sub_805DB34(struct Sprite *sprite) +{ + meta_step(&gMapObjects[sprite->data0], sprite, sub_805DB58); +} + +u8 sub_805DB58(struct MapObject *mapObject, struct Sprite *sprite) +{ + return gUnknown_08375354[sprite->data1](mapObject, sprite); +} + +u8 sub_805DB78(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + sprite->data1 = 1; + return 1; +} + +u8 sub_805DB8C(struct MapObject *mapObject, struct Sprite *sprite) +{ + FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); + sprite->data1 = 2; + return 1; +} + +u8 sub_805DBB8(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite)) + { + sub_8064820(sprite, gUnknown_0837521C[Random() & 3]); + mapObject->mapobj_bit_1 = 0; + sprite->data1 = 3; + } + return 0; +} + +u8 sub_805DBFC(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8064824(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) + { + sprite->data1 = 4; + return 1; + } + return 0; +} + +u8 sub_805DC2C(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 direction; + u8 directions[2]; + memcpy(directions, gUnknown_08375368, 2); + direction = sub_805CD60(mapObject, 6); + if (direction == 0) + { + direction = directions[Random() & 1]; + } + FieldObjectSetDirection(mapObject, direction); + sprite->data1 = 1; + return 1; +} + + +u8 sub_805DC98(struct MapObject *mapObject, struct Sprite *sprite); + +void sub_805DC74(struct Sprite *sprite) +{ + meta_step(&gMapObjects[sprite->data0], sprite, sub_805DC98); +} + +u8 sub_805DC98(struct MapObject *mapObject, struct Sprite *sprite) +{ + return gUnknown_0837536C[sprite->data1](mapObject, sprite); +} + +u8 sub_805DCB8(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + sprite->data1 = 1; + return 1; +} + +u8 sub_805DCCC(struct MapObject *mapObject, struct Sprite *sprite) +{ + FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); + sprite->data1 = 2; + return 1; +} + +u8 sub_805DCF8(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite)) + { + sub_8064820(sprite, gUnknown_0837521C[Random() & 3]); + mapObject->mapobj_bit_1 = 0; + sprite->data1 = 3; + } + return 0; +} + +u8 sub_805DD3C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8064824(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) + { + sprite->data1 = 4; + return 1; + } + return 0; +} + +u8 sub_805DD6C(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 direction; + u8 directions[4]; + memcpy(directions, gUnknown_08375380, 4); + direction = sub_805CD60(mapObject, 7); + if (direction == 0) + { + direction = directions[Random() & 3]; + } + FieldObjectSetDirection(mapObject, direction); + sprite->data1 = 1; + return 1; +} + +u8 sub_805DDD8(struct MapObject *mapObject, struct Sprite *sprite); + +void sub_805DDB4(struct Sprite *sprite) +{ + meta_step(&gMapObjects[sprite->data0], sprite, sub_805DDD8); +} + +u8 sub_805DDD8(struct MapObject *mapObject, struct Sprite *sprite) +{ + return gUnknown_08375384[sprite->data1](mapObject, sprite); +} + +u8 sub_805DDF8(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + sprite->data1 = 1; + return 1; +} + +u8 sub_805DE0C(struct MapObject *mapObject, struct Sprite *sprite) +{ + FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); + sprite->data1 = 2; + return 1; +} + +u8 sub_805DE38(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite)) + { + sub_8064820(sprite, gUnknown_0837521C[Random() & 3]); + mapObject->mapobj_bit_1 = 0; + sprite->data1 = 3; + } + return 0; +} + +u8 sub_805DE7C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8064824(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) + { + sprite->data1 = 4; + return 1; + } + return 0; +} + +u8 sub_805DEAC(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 direction; + u8 directions[4]; + memcpy(directions, gUnknown_08375398, 4); + direction = sub_805CD60(mapObject, 8); + if (direction == 0) + { + direction = directions[Random() & 3]; + } + FieldObjectSetDirection(mapObject, direction); + sprite->data1 = 1; + return 1; +} + + +u8 sub_805DF18(struct MapObject *mapObject, struct Sprite *sprite); + +void sub_805DEF4(struct Sprite *sprite) +{ + meta_step(&gMapObjects[sprite->data0], sprite, sub_805DF18); +} + +u8 sub_805DF18(struct MapObject *mapObject, struct Sprite *sprite) +{ + return gUnknown_0837539C[sprite->data1](mapObject, sprite); +} + +u8 sub_805DF38(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + sprite->data1 = 1; + return 1; +} + +u8 sub_805DF4C(struct MapObject *mapObject, struct Sprite *sprite) +{ + FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); + sprite->data1 = 2; + return 1; +} + +u8 sub_805DF78(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite)) + { + sub_8064820(sprite, gUnknown_0837521C[Random() & 3]); + mapObject->mapobj_bit_1 = 0; + sprite->data1 = 3; + } + return 0; +} + +u8 sub_805DFBC(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8064824(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) + { + sprite->data1 = 4; + return 1; + } + return 0; +} + +u8 sub_805DFEC(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 direction; + u8 directions[4]; + memcpy(directions, gUnknown_083753B0, 4); + direction = sub_805CD60(mapObject, 9); + if (direction == 0) + { + direction = directions[Random() & 3]; + } + FieldObjectSetDirection(mapObject, direction); + sprite->data1 = 1; + return 1; +} + + +u8 sub_805E058(struct MapObject *mapObject, struct Sprite *sprite); + +void sub_805E034(struct Sprite *sprite) +{ + meta_step(&gMapObjects[sprite->data0], sprite, sub_805E058); +} + +u8 sub_805E058(struct MapObject *mapObject, struct Sprite *sprite) +{ + return gUnknown_083753B4[sprite->data1](mapObject, sprite); +} + +u8 sub_805E078(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + sprite->data1 = 1; + return 1; +} + +u8 sub_805E08C(struct MapObject *mapObject, struct Sprite *sprite) +{ + FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); + sprite->data1 = 2; + return 1; +} + +u8 sub_805E0B8(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite)) + { + sub_8064820(sprite, gUnknown_0837521C[Random() & 3]); + mapObject->mapobj_bit_1 = 0; + sprite->data1 = 3; + } + return 0; +} + +u8 sub_805E0FC(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8064824(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) + { + sprite->data1 = 4; + return 1; + } + return 0; +} + +u8 sub_805E12C(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 direction; + u8 directions[4]; + memcpy(directions, gUnknown_083753C8, 4); + direction = sub_805CD60(mapObject, 10); + if (direction == 0) + { + direction = directions[Random() & 3]; + } + FieldObjectSetDirection(mapObject, direction); + sprite->data1 = 1; + return 1; +} + void sub_805E174(struct Sprite *sprite); void sub_805E278(struct Sprite *sprite); void sub_805E37C(struct Sprite *sprite); -void sub_805E37C(struct Sprite *sprite); -void sub_805E37C(struct Sprite *sprite); -void sub_805E37C(struct Sprite *sprite); void sub_805E5DC(struct Sprite *sprite); void sub_805E668(struct Sprite *sprite); void sub_805E6F4(struct Sprite *sprite); @@ -2454,27 +2898,12 @@ void sub_805F158(struct Sprite *sprite); void sub_805F1E4(struct Sprite *sprite); void sub_805F270(struct Sprite *sprite); void sub_805F2FC(struct Sprite *sprite); -void sub_805F2FC(struct Sprite *sprite); -void sub_805F2FC(struct Sprite *sprite); -void sub_805F2FC(struct Sprite *sprite); void FieldObjectCB_TreeDisguise(struct Sprite *sprite); void FieldObjectCB_MountainDisguise(struct Sprite *sprite); void sub_805F8E0(struct Sprite *sprite); -void sub_805F8E0(struct Sprite *sprite); -void sub_805F8E0(struct Sprite *sprite); -void sub_805F8E0(struct Sprite *sprite); void FieldObjectCB_Hidden1(struct Sprite *sprite); void sub_805FB20(struct Sprite *sprite); -void sub_805FB20(struct Sprite *sprite); -void sub_805FB20(struct Sprite *sprite); -void sub_805FB20(struct Sprite *sprite); -void sub_805FB90(struct Sprite *sprite); void sub_805FB90(struct Sprite *sprite); -void sub_805FB90(struct Sprite *sprite); -void sub_805FB90(struct Sprite *sprite); -void sub_805FC00(struct Sprite *sprite); -void sub_805FC00(struct Sprite *sprite); -void sub_805FC00(struct Sprite *sprite); void sub_805FC00(struct Sprite *sprite); void sub_805FC70(struct Sprite *sprite); -- cgit v1.2.3 From 42e6ed382f1e9fdf3f28e2dd048fc99bbd56b347 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 22 May 2017 08:34:47 -0400 Subject: sub_805E174 --- src/field_map_obj.c | 84 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 55 insertions(+), 29 deletions(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 394f3c43d..475620c28 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -35,22 +35,6 @@ void GetFieldObjectMovingCameraOffset(s16 *, s16 *); void sub_805BDF8(u16); u8 sub_805BE58(const struct SpritePalette *); u8 FindFieldObjectPaletteIndexByTag(u16); -extern u8 (*const gUnknown_08375244[])(s16 a0, s16 a1, s16 a2, s16 a3); -extern u8 (*const gUnknown_08375270[])(struct MapObject *mapObject, struct Sprite *sprite); -extern u8 (*const gUnknown_08375284[])(struct MapObject *mapObject, struct Sprite *sprite); -extern u8 (*const gUnknown_083752A4[])(struct MapObject *mapObject, struct Sprite *sprite); -extern u8 (*const gUnknown_083752C4[])(struct MapObject *mapObject, struct Sprite *sprite); -extern u8 (*const gUnknown_083752D0[])(struct MapObject *mapObject, struct Sprite *sprite); -extern u8 (*const gUnknown_083752E4[])(struct MapObject *mapObject, struct Sprite *sprite); -extern u8 (*const gUnknown_083752F8[])(struct MapObject *mapObject, struct Sprite *sprite); -extern u8 (*const gUnknown_0837530C[])(struct MapObject *mapObject, struct Sprite *sprite); -extern u8 (*const gUnknown_08375324[])(struct MapObject *mapObject, struct Sprite *sprite); -extern u8 (*const gUnknown_0837533C[])(struct MapObject *mapObject, struct Sprite *sprite); -extern u8 (*const gUnknown_08375354[])(struct MapObject *mapObject, struct Sprite *sprite); -extern u8 (*const gUnknown_0837536C[])(struct MapObject *mapObject, struct Sprite *sprite); -extern u8 (*const gUnknown_08375384[])(struct MapObject *mapObject, struct Sprite *sprite); -extern u8 (*const gUnknown_0837539C[])(struct MapObject *mapObject, struct Sprite *sprite); -extern u8 (*const gUnknown_083753B4[])(struct MapObject *mapObject, struct Sprite *sprite); struct PairedPalettes { @@ -1593,17 +1577,6 @@ u8 sub_805C96C(struct MapObject *mapObject, struct Sprite *sprite) return 0; } -extern const u8 gUnknown_08375240[4]; -extern const u8 gUnknown_083752A0[2]; -extern const u8 gUnknown_083752C0[2]; -extern const u8 gUnknown_08375320[2]; -extern const u8 gUnknown_08375338[2]; -extern const u8 gUnknown_08375350[2]; -extern const u8 gUnknown_08375368[2]; -extern const u8 gUnknown_08375380[2]; -extern const u8 gUnknown_08375398[2]; -extern const u8 gUnknown_083753B0[2]; -extern const u8 gUnknown_083753C8[2]; extern u8 sub_805FF20(struct MapObject *, u8); u8 sub_805C98C(struct MapObject *mapObject, struct Sprite *sprite) @@ -2744,7 +2717,6 @@ u8 sub_805DEAC(struct MapObject *mapObject, struct Sprite *sprite) return 1; } - u8 sub_805DF18(struct MapObject *mapObject, struct Sprite *sprite); void sub_805DEF4(struct Sprite *sprite) @@ -2870,7 +2842,61 @@ u8 sub_805E12C(struct MapObject *mapObject, struct Sprite *sprite) return 1; } -void sub_805E174(struct Sprite *sprite); + +u8 sub_805E198(struct MapObject *mapObject, struct Sprite *sprite); + +void sub_805E174(struct Sprite *sprite) +{ + meta_step(&gMapObjects[sprite->data0], sprite, sub_805E198); +} + +u8 sub_805E198(struct MapObject *mapObject, struct Sprite *sprite) +{ + return gUnknown_083753CC[sprite->data1](mapObject, sprite); +} + +u8 sub_805E1B8(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); + sprite->data1 = 1; + return 1; +} + +u8 sub_805E1E4(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite)) + { + sub_8064820(sprite, 0x30); + sprite->data1 = 2; + } + return 0; +} + +u8 sub_805E208(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8064824(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) + { + sprite->data1 = 3; + } + return 0; +} + +u8 sub_805E234(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 direction; + u8 directions[5]; + memcpy(directions, gUnknown_083753DC, 5); + direction = sub_805CD60(mapObject, 0); + if (direction == 0) + { + direction = directions[mapObject->mapobj_unk_18]; + } + FieldObjectSetDirection(mapObject, direction); + sprite->data1 = 0; + return 1; +} + void sub_805E278(struct Sprite *sprite); void sub_805E37C(struct Sprite *sprite); void sub_805E5DC(struct Sprite *sprite); -- cgit v1.2.3 From 4c42206a7f63b2045eae85ad2b4a60a630178d4c Mon Sep 17 00:00:00 2001 From: scnorton Date: Mon, 22 May 2017 14:40:21 -0400 Subject: Create and propagate field map object callback declaration macro --- src/field_map_obj.c | 261 +++++++++++----------------------------------- src/field_player_avatar.c | 12 +-- 2 files changed, 63 insertions(+), 210 deletions(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 475620c28..b75f16d54 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -12,6 +12,7 @@ extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[36]; + extern void strange_npc_table_clear(void); extern void ClearPlayerAvatarInfo(void); extern void npc_load_two_palettes__no_record(u16, u8); @@ -1505,33 +1506,8 @@ u16 npc_paltag_by_palslot(u8 a) return 0x11FF; } -u8 sub_805C8A8(struct MapObject *mapObject, struct Sprite *sprite); - -void sub_805C884(struct Sprite *sprite) -{ - meta_step(&gMapObjects[sprite->data0], sprite, sub_805C8A8); -} - -u8 sub_805C8A8(struct MapObject *mapObject, struct Sprite *sprite) -{ - return 0; -} - -u8 sub_805C8D0(struct MapObject *, struct Sprite *); - -void sub_805C8AC(struct Sprite *sprite) -{ - meta_step(&gMapObjects[sprite->data0], sprite, sub_805C8D0); -} - -extern u8 (*const gUnknown_08375224[])(); - -u8 sub_805C8D0(struct MapObject *mapObject, struct Sprite *sprite) -{ - return gUnknown_08375224[sprite->data1](mapObject, sprite); -} - -void npc_reset(struct MapObject *mapObject, struct Sprite *sprite); +fieldmap_object_null_cb(sub_805C884, sub_805C8A8); +fieldmap_object_cb(sub_805C8AC, sub_805C8D0, gUnknown_08375224); u8 sub_805C8F0(struct MapObject *mapObject, struct Sprite *sprite) { @@ -1849,17 +1825,7 @@ u8 sub_805CD60(struct MapObject *mapObject, u8 a1) return gUnknown_08375244[a1](x, y, x2, y2); } -u8 sub_805CE0C(struct MapObject *mapObject, struct Sprite *sprite); - -void sub_805CDE8(struct Sprite *sprite) -{ - meta_step(&gMapObjects[sprite->data0], sprite, sub_805CE0C); -} - -u8 sub_805CE0C(struct MapObject *mapObject, struct Sprite *sprite) -{ - return gUnknown_08375270[sprite->data1](mapObject, sprite); -} +fieldmap_object_cb(sub_805CDE8, sub_805CE0c, gUnknown_08375270); u8 sub_805CE2C(struct MapObject *mapObject, struct Sprite *sprite) { @@ -1911,17 +1877,7 @@ u8 sub_805CEE0(struct MapObject *mapObject, struct Sprite *sprite) return 1; } -u8 sub_805CF4C(struct MapObject *mapObject, struct Sprite *sprite); - -void sub_805CF28(struct Sprite *sprite) -{ - meta_step(&gMapObjects[sprite->data0], sprite, sub_805CF4C); -} - -u8 sub_805CF4C(struct MapObject *mapObject, struct Sprite *sprite) -{ - return gUnknown_08375284[sprite->data1](mapObject, sprite); -} +fieldmap_object_cb(sub_805CF28, sub_805CF4C, gUnknown_08375284); u8 sub_805CF6C(struct MapObject *mapObject, struct Sprite *sprite) { @@ -1991,17 +1947,7 @@ u8 sub_805D084(struct MapObject *mapObject, struct Sprite *sprite) return 0; } -u8 sub_805D0D0(struct MapObject *mapObject, struct Sprite *sprite); - -void sub_805D0AC(struct Sprite *sprite) -{ - meta_step(&gMapObjects[sprite->data0], sprite, sub_805D0D0); -} - -u8 sub_805D0D0(struct MapObject *mapObject, struct Sprite *sprite) -{ - return gUnknown_083752A4[sprite->data1](mapObject, sprite); -} +fieldmap_object_cb(sub_805D0AC, sub_805D0D0, gUnknown_083752A4); u8 sub_805D0F0(struct MapObject *mapObject, struct Sprite *sprite) { @@ -2071,17 +2017,7 @@ u8 sub_805D208(struct MapObject *mapObject, struct Sprite *sprite) return 0; } -u8 sub_805D254(struct MapObject *mapObject, struct Sprite *sprite); - -void sub_805D230(struct Sprite *sprite) -{ - meta_step(&gMapObjects[sprite->data0], sprite, sub_805D254); -} - -u8 sub_805D254(struct MapObject *mapObject, struct Sprite *sprite) -{ - return gUnknown_083752C4[sprite->data1](mapObject, sprite); -} +fieldmap_object_cb(sub_805D230, sub_805D254, gUnknown_083752C4); u8 sub_805D274(struct MapObject *mapObject, struct Sprite *sprite) { @@ -2108,6 +2044,7 @@ u8 sub_805D2C0(struct MapObject *mapObject, struct Sprite *sprite) } u8 sub_805D314(struct MapObject *mapObject, struct Sprite *sprite); +extern u8 (*const gUnknown_083752D0[])(struct MapObject *mapObject, struct Sprite *sprite); void FieldObjectCB_BerryTree(struct Sprite *sprite) { @@ -2215,17 +2152,7 @@ u8 sub_805D4A8(struct MapObject *mapObject, struct Sprite *sprite) return 0; } -u8 sub_805D518(struct MapObject *mapObject, struct Sprite *sprite); - -void sub_805D4F4(struct Sprite *sprite) -{ - meta_step(&gMapObjects[sprite->data0], sprite, sub_805D518); -} - -u8 sub_805D518(struct MapObject *mapObject, struct Sprite *sprite) -{ - return gUnknown_083752E4[sprite->data1](mapObject, sprite); -} +fieldmap_object_cb(sub_805D4F4, sub_805D518, gUnknown_083752E4); u8 sub_805D538(struct MapObject *mapObject, struct Sprite *sprite) { @@ -2277,18 +2204,7 @@ u8 sub_805D5EC(struct MapObject *mapObject, struct Sprite *sprite) return 1; } - -u8 sub_805D658(struct MapObject *mapObject, struct Sprite *sprite); - -void sub_805D634(struct Sprite *sprite) -{ - meta_step(&gMapObjects[sprite->data0], sprite, sub_805D658); -} - -u8 sub_805D658(struct MapObject *mapObject, struct Sprite *sprite) -{ - return gUnknown_083752F8[sprite->data1](mapObject, sprite); -} +fieldmap_object_cb(sub_805D634, sub_805D658, gUnknown_083752F8); u8 sub_805D678(struct MapObject *mapObject, struct Sprite *sprite) { @@ -2340,18 +2256,7 @@ u8 sub_805D72C(struct MapObject *mapObject, struct Sprite *sprite) return 1; } - -u8 sub_805D798(struct MapObject *mapObject, struct Sprite *sprite); - -void sub_805D774(struct Sprite *sprite) -{ - meta_step(&gMapObjects[sprite->data0], sprite, sub_805D798); -} - -u8 sub_805D798(struct MapObject *mapObject, struct Sprite *sprite) -{ - return gUnknown_0837530C[sprite->data1](mapObject, sprite); -} +fieldmap_object_cb(sub_805D774, sub_805D798, gUnknown_0837530C); u8 sub_805D7B8(struct MapObject *mapObject, struct Sprite *sprite) { @@ -2403,18 +2308,7 @@ u8 sub_805D86C(struct MapObject *mapObject, struct Sprite *sprite) return 1; } - -u8 sub_805D8D8(struct MapObject *mapObject, struct Sprite *sprite); - -void sub_805D8B4(struct Sprite *sprite) -{ - meta_step(&gMapObjects[sprite->data0], sprite, sub_805D8D8); -} - -u8 sub_805D8D8(struct MapObject *mapObject, struct Sprite *sprite) -{ - return gUnknown_08375324[sprite->data1](mapObject, sprite); -} +fieldmap_object_cb(sub_805D8B4, sub_805D8D8, gUnknown_08375324); u8 sub_805D8F8(struct MapObject *mapObject, struct Sprite *sprite) { @@ -2466,18 +2360,7 @@ u8 sub_805D9AC(struct MapObject *mapObject, struct Sprite *sprite) return 1; } - -u8 sub_805DA18(struct MapObject *mapObject, struct Sprite *sprite); - -void sub_805D9F4(struct Sprite *sprite) -{ - meta_step(&gMapObjects[sprite->data0], sprite, sub_805DA18); -} - -u8 sub_805DA18(struct MapObject *mapObject, struct Sprite *sprite) -{ - return gUnknown_0837533C[sprite->data1](mapObject, sprite); -} +fieldmap_object_cb(sub_805D9F4, sub_805DA18, gUnknown_0837533C); u8 sub_805DA38(struct MapObject *mapObject, struct Sprite *sprite) { @@ -2529,18 +2412,7 @@ u8 sub_805DAEC(struct MapObject *mapObject, struct Sprite *sprite) return 1; } - -u8 sub_805DB58(struct MapObject *mapObject, struct Sprite *sprite); - -void sub_805DB34(struct Sprite *sprite) -{ - meta_step(&gMapObjects[sprite->data0], sprite, sub_805DB58); -} - -u8 sub_805DB58(struct MapObject *mapObject, struct Sprite *sprite) -{ - return gUnknown_08375354[sprite->data1](mapObject, sprite); -} +fieldmap_object_cb(sub_805DB34, sub_805DB58, gUnknown_08375354); u8 sub_805DB78(struct MapObject *mapObject, struct Sprite *sprite) { @@ -2592,18 +2464,7 @@ u8 sub_805DC2C(struct MapObject *mapObject, struct Sprite *sprite) return 1; } - -u8 sub_805DC98(struct MapObject *mapObject, struct Sprite *sprite); - -void sub_805DC74(struct Sprite *sprite) -{ - meta_step(&gMapObjects[sprite->data0], sprite, sub_805DC98); -} - -u8 sub_805DC98(struct MapObject *mapObject, struct Sprite *sprite) -{ - return gUnknown_0837536C[sprite->data1](mapObject, sprite); -} +fieldmap_object_cb(sub_805DC74, sub_805DC98, gUnknown_0837536C); u8 sub_805DCB8(struct MapObject *mapObject, struct Sprite *sprite) { @@ -2655,17 +2516,7 @@ u8 sub_805DD6C(struct MapObject *mapObject, struct Sprite *sprite) return 1; } -u8 sub_805DDD8(struct MapObject *mapObject, struct Sprite *sprite); - -void sub_805DDB4(struct Sprite *sprite) -{ - meta_step(&gMapObjects[sprite->data0], sprite, sub_805DDD8); -} - -u8 sub_805DDD8(struct MapObject *mapObject, struct Sprite *sprite) -{ - return gUnknown_08375384[sprite->data1](mapObject, sprite); -} +fieldmap_object_cb(sub_805DDB4, sub_805DDD8, gUnknown_08375384); u8 sub_805DDF8(struct MapObject *mapObject, struct Sprite *sprite) { @@ -2717,17 +2568,7 @@ u8 sub_805DEAC(struct MapObject *mapObject, struct Sprite *sprite) return 1; } -u8 sub_805DF18(struct MapObject *mapObject, struct Sprite *sprite); - -void sub_805DEF4(struct Sprite *sprite) -{ - meta_step(&gMapObjects[sprite->data0], sprite, sub_805DF18); -} - -u8 sub_805DF18(struct MapObject *mapObject, struct Sprite *sprite) -{ - return gUnknown_0837539C[sprite->data1](mapObject, sprite); -} +fieldmap_object_cb(sub_805DEF4, sub_805DF18, gUnknown_0837539C); u8 sub_805DF38(struct MapObject *mapObject, struct Sprite *sprite) { @@ -2779,18 +2620,7 @@ u8 sub_805DFEC(struct MapObject *mapObject, struct Sprite *sprite) return 1; } - -u8 sub_805E058(struct MapObject *mapObject, struct Sprite *sprite); - -void sub_805E034(struct Sprite *sprite) -{ - meta_step(&gMapObjects[sprite->data0], sprite, sub_805E058); -} - -u8 sub_805E058(struct MapObject *mapObject, struct Sprite *sprite) -{ - return gUnknown_083753B4[sprite->data1](mapObject, sprite); -} +fieldmap_object_cb(sub_805E034, sub_805E058, gUnknown_083753B4); u8 sub_805E078(struct MapObject *mapObject, struct Sprite *sprite) { @@ -2842,20 +2672,53 @@ u8 sub_805E12C(struct MapObject *mapObject, struct Sprite *sprite) return 1; } +fieldmap_object_cb(sub_805E174, sub_805E198, gUnknown_083753CC); -u8 sub_805E198(struct MapObject *mapObject, struct Sprite *sprite); +u8 sub_805E1B8(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); + sprite->data1 = 1; + return 1; +} -void sub_805E174(struct Sprite *sprite) +u8 sub_805E1E4(struct MapObject *mapObject, struct Sprite *sprite) { - meta_step(&gMapObjects[sprite->data0], sprite, sub_805E198); + if (FieldObjectExecRegularAnim(mapObject, sprite)) + { + sub_8064820(sprite, 0x30); + sprite->data1 = 2; + } + return 0; } -u8 sub_805E198(struct MapObject *mapObject, struct Sprite *sprite) +u8 sub_805E208(struct MapObject *mapObject, struct Sprite *sprite) { - return gUnknown_083753CC[sprite->data1](mapObject, sprite); + if (sub_8064824(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) + { + sprite->data1 = 3; + } + return 0; } -u8 sub_805E1B8(struct MapObject *mapObject, struct Sprite *sprite) +u8 sub_805E234(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 direction; + u8 directions[5]; + memcpy(directions, gUnknown_083753DC, 5); + direction = sub_805CD60(mapObject, 0); + if (direction == 0) + { + direction = directions[mapObject->mapobj_unk_18]; + } + FieldObjectSetDirection(mapObject, direction); + sprite->data1 = 0; + return 1; +} + +fieldmap_object_cb(sub_805E278, sub_803E29C, gUnknown_083753E4); + +u8 sub_805E2BC(struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); @@ -2863,7 +2726,7 @@ u8 sub_805E1B8(struct MapObject *mapObject, struct Sprite *sprite) return 1; } -u8 sub_805E1E4(struct MapObject *mapObject, struct Sprite *sprite) +u8 sub_805E2E8(struct MapObject *mapObject, struct Sprite *sprite) { if (FieldObjectExecRegularAnim(mapObject, sprite)) { @@ -2873,7 +2736,7 @@ u8 sub_805E1E4(struct MapObject *mapObject, struct Sprite *sprite) return 0; } -u8 sub_805E208(struct MapObject *mapObject, struct Sprite *sprite) +u8 sub_805E30C(struct MapObject *mapObject, struct Sprite *sprite) { if (sub_8064824(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) { @@ -2882,11 +2745,11 @@ u8 sub_805E208(struct MapObject *mapObject, struct Sprite *sprite) return 0; } -u8 sub_805E234(struct MapObject *mapObject, struct Sprite *sprite) +u8 sub_805E338(struct MapObject *mapObject, struct Sprite *sprite) { u8 direction; u8 directions[5]; - memcpy(directions, gUnknown_083753DC, 5); + memcpy(directions, gUnknown_083753F4, 5); direction = sub_805CD60(mapObject, 0); if (direction == 0) { @@ -2897,7 +2760,7 @@ u8 sub_805E234(struct MapObject *mapObject, struct Sprite *sprite) return 1; } -void sub_805E278(struct Sprite *sprite); + void sub_805E37C(struct Sprite *sprite); void sub_805E5DC(struct Sprite *sprite); void sub_805E668(struct Sprite *sprite); diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 3a280f58a..1e1162350 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -23,7 +23,6 @@ extern u32 gUnknown_0202FF84[]; //Functions -static u8 sub_80587D8(void); static bool8 sub_8058854(struct MapObject *, u8); static void npc_clear_strange_bits(struct MapObject *a); static void MovePlayerAvatarUsingKeypadInput(u8 a, u16 b, u16 c); @@ -242,16 +241,7 @@ static u8 (*const gUnknown_0830FC98[])(struct Task *, struct MapObject *) = sub_805A1B8, }; - -void sub_80587B4(struct Sprite *sprite) -{ - meta_step(&gMapObjects[sprite->data0], sprite, sub_80587D8); -} - -static u8 sub_80587D8(void) -{ - return 0; -} +fieldmap_object_null_cb(sub_80587B4, sub_80587D8); void player_step(u8 direction, u16 newKeys, u16 heldKeys) { -- cgit v1.2.3 From abe5f5053624f876ea17c44370b203c0a4ace86b Mon Sep 17 00:00:00 2001 From: scnorton Date: Mon, 22 May 2017 17:21:17 -0400 Subject: Another chunk of library-like functions --- src/field_map_obj.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 103 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index b75f16d54..7c332c505 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -1,10 +1,12 @@ #include "global.h" #include "field_map_obj.h" +#include "fieldmap.h" #include "asm.h" #include "berry.h" #include "event_data.h" #include "field_player_avatar.h" #include "field_effect.h" +#include "field_ground_effect.h" #include "palette.h" #include "rom4.h" #include "rng.h" @@ -20,14 +22,14 @@ extern void npc_load_two_palettes__and_record(u16, u8); extern void sub_8060388(s16, s16, s16 *, s16 *); extern void sub_80634D0(); extern void pal_patch_for_npc(u16, u16); -extern void sub_80603CC(); +extern void sub_80603CC(s16, s16, s16 *, s16 *); extern void CameraObjectReset1(void); void sub_805AAB0(void); u8 GetFieldObjectIdByLocalId(u8); u8 GetFieldObjectIdByLocalIdAndMapInternal(u8, u8, u8); u8 GetAvailableFieldObjectSlot(u16, u8, u8, u8 *); -void FieldObjectHandleDynamicGraphicsId(); +void FieldObjectHandleDynamicGraphicsId(struct MapObject *); void RemoveFieldObjectInternal(struct MapObject *); u16 GetFieldObjectFlagIdByFieldObjectId(u8); void MakeObjectTemplateFromFieldObjectTemplate(struct MapObjectTemplate *mapObjTemplate, struct SpriteTemplate *sprTemplate, struct SubspriteTable **subspriteTables); @@ -2897,3 +2899,102 @@ u8 get_run_image_anim_num(u8 direction) { return gUnknown_08375672[direction]; } + +void sub_805FE28(struct MapObject *mapObject, struct Sprite *sprite, u8 animNum) +{ + if (!mapObject->mapobj_bit_12) + { + sprite->animNum = animNum; + if (sprite->animCmdIndex == 1) + { + sprite->animCmdIndex = 2; + } else if (sprite->animCmdIndex == 3) + { + sprite->animCmdIndex = 0; + } + SeekSpriteAnim(sprite, sprite->animCmdIndex); + } +} + +void sub_805FE64(struct MapObject *mapObject, struct Sprite *sprite, u8 animNum) +{ + u8 animCmdIndex; + if (!mapObject->mapobj_bit_12) + { + sprite->animNum = animNum; + animCmdIndex = 3; + if (sprite->animCmdIndex < 2) + { + animCmdIndex = 1; + } + SeekSpriteAnim(sprite, animCmdIndex); + } +} + +u8 sub_805FE90(s16 a0, s16 a1, s16 a2, s16 a3) +{ + if (a0 > a2) + { + return DIR_WEST; + } else if (a0 < a2) + { + return DIR_EAST; + } else if (a1 > a3) + { + return DIR_NORTH; + } else + { + return DIR_SOUTH; + } +} + +void npc_set_running_behaviour_etc(struct MapObject *mapObject, u8 animPattern) +{ + mapObject->animPattern = animPattern; + mapObject->mapobj_unk_21 = 0; + mapObject->animId = 0; + gSprites[mapObject->spriteId].callback = gUnknown_0836DA88[animPattern]; + gSprites[mapObject->spriteId].data1 = 0; +} + +u8 npc_running_behaviour_by_direction(u8 direction) +{ + return gUnknown_0837567B[direction]; +} + +u8 sub_805FF20(struct MapObject *mapObject, u8 direction) +{ + s16 x; + s16 y; + x = mapObject->coords2.x; + y = mapObject->coords2.y; + MoveCoords(direction, &x, &y); + return npc_block_way(mapObject, x, y, direction); +} + +bool8 IsCoordOutsideFieldObjectMovementRect(struct MapObject *mapObject, s16 x, s16 y); + +u8 npc_block_way(struct MapObject *mapObject, s16 x, s16 y, u8 direction) +{ + if (IsCoordOutsideFieldObjectMovementRect(mapObject, x, y)) + { + return 1; + } + if (MapGridIsImpassableAt(x, y) || GetMapBorderIdAt(x, y) == -1 || IsMetatileDirectionallyImpassable(mapObject, x, y, direction)) + { + return 2; + } + if (mapObject->mapobj_bit_15 && !CanCameraMoveInDirection(direction)) + { + return 2; + } + if (IsZCoordMismatchAt(mapObject->mapobj_unk_0B_0, x, y)) + { + return 3; + } + if (CheckForCollisionBetweenFieldObjects(mapObject, x, y)) + { + return 4; + } + return 0; +} -- cgit v1.2.3 From b087d8a909925baf772aa0d631318fb17667067c Mon Sep 17 00:00:00 2001 From: scnorton Date: Mon, 22 May 2017 19:31:47 -0400 Subject: IsCoordOutsideFieldObjectMovementRect and others --- src/field_map_obj.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 53 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 7c332c505..755de7611 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -2972,19 +2972,20 @@ u8 sub_805FF20(struct MapObject *mapObject, u8 direction) return npc_block_way(mapObject, x, y, direction); } -bool8 IsCoordOutsideFieldObjectMovementRect(struct MapObject *mapObject, s16 x, s16 y); +bool8 IsCoordOutsideFieldObjectMovementRect(struct MapObject2 *mapObject, s16 x, s16 y); +bool8 CheckForCollisionBetweenFieldObjects(struct MapObject *mapObject, s16 x, s16 y); +bool8 IsMetatileDirectionallyImpassable(struct MapObject *mapObject, s16 x, s16 y, u8 direction); u8 npc_block_way(struct MapObject *mapObject, s16 x, s16 y, u8 direction) { - if (IsCoordOutsideFieldObjectMovementRect(mapObject, x, y)) + if (IsCoordOutsideFieldObjectMovementRect((struct MapObject2 *)mapObject, x, y)) { return 1; } if (MapGridIsImpassableAt(x, y) || GetMapBorderIdAt(x, y) == -1 || IsMetatileDirectionallyImpassable(mapObject, x, y, direction)) { return 2; - } - if (mapObject->mapobj_bit_15 && !CanCameraMoveInDirection(direction)) + } else if (mapObject->mapobj_bit_15 && !CanCameraMoveInDirection(direction)) { return 2; } @@ -2998,3 +2999,51 @@ u8 npc_block_way(struct MapObject *mapObject, s16 x, s16 y, u8 direction) } return 0; } + +u8 sub_8060024(struct MapObject *mapObject, s16 x, s16 y, u8 direction) +{ + u8 flags; + flags = 0; + if (IsCoordOutsideFieldObjectMovementRect((struct MapObject2 *)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; + } + if (IsZCoordMismatchAt(mapObject->mapobj_unk_0B_0, x, y)) + { + flags |= 4; + } + if (CheckForCollisionBetweenFieldObjects(mapObject, x, y)) + { + flags |= 8; + } + return flags; +} + +bool8 IsCoordOutsideFieldObjectMovementRect(struct MapObject2 *mapObject, s16 x, s16 y) +{ + s16 minv; + s16 maxv; + if (mapObject->mapobj_unk_19 != 0) + { + minv = mapObject->coords1.x - (mapObject->mapobj_unk_19); + maxv = mapObject->coords1.x + (mapObject->mapobj_unk_19); + if (minv > x || maxv < x) + { + return 1; + } + } + if (mapObject->mapobj_unk_19b != 0) + { + minv = mapObject->coords1.y - (mapObject->mapobj_unk_19b); + maxv = mapObject->coords1.y + (mapObject->mapobj_unk_19b); + if (minv > y || maxv < y) + { + return 1; + } + } + return 0; +} -- cgit v1.2.3 From cf9607b0a809258170df8e8c970442a09ff21380 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 22 May 2017 21:34:17 -0400 Subject: sub_805E37C and helpers --- src/field_map_obj.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) mode change 100644 => 100755 src/field_map_obj.c (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c old mode 100644 new mode 100755 index 755de7611..d186eea66 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -2762,8 +2762,73 @@ u8 sub_805E338(struct MapObject *mapObject, struct Sprite *sprite) return 1; } +fieldmap_object_cb(sub_805E37C, sub_805E3A0, gUnknown_083753FC); + +u8 sub_805E3C0(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + sprite->data1 = 1; + return 1; +} + +u8 sub_805E3D4(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 direction; + direction = gUnknown_0836DC09[mapObject->animPattern]; + if (mapObject->mapobj_unk_21 != 0) + { + direction = GetOppositeDirection(direction); + } + FieldObjectSetDirection(mapObject, direction); + sprite->data1 = 2; + return 1; +} + +u8 sub_805E40C(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 v0; + u8 goSpeed0AnimId; + if (mapObject->mapobj_unk_21 && mapObject->coords1.x == mapObject->coords2.x && mapObject->coords1.y == mapObject->coords2.y) + { + mapObject->mapobj_unk_21 = 0; + FieldObjectSetDirection(mapObject, GetOppositeDirection(mapObject->placeholder18)); + } + v0 = sub_805FF20(mapObject, mapObject->placeholder18); + goSpeed0AnimId = GetGoSpeed0AnimId(mapObject->placeholder18); + if (v0 == 1) + { + mapObject->mapobj_unk_21 ++; + FieldObjectSetDirection(mapObject, GetOppositeDirection(mapObject->placeholder18)); + goSpeed0AnimId = GetGoSpeed0AnimId(mapObject->placeholder18); + v0 = sub_805FF20(mapObject, mapObject->placeholder18); + } + if (v0 != 0) + { + goSpeed0AnimId = GetStepInPlaceDelay16AnimId(mapObject->mapobj_unk_18); + } + FieldObjectSetRegularAnim(mapObject, sprite, goSpeed0AnimId); + mapObject->mapobj_bit_1 = 1; + sprite->data1 = 3; + return 1; +} + +u8 sub_805E4C4(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite)) + { + mapObject->mapobj_bit_1 = 0; + sprite->data1 = 1; + } + return 0; +} + +u8 sub_805E4EC(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + sprite->data1 = 1; + return 1; +} -void sub_805E37C(struct Sprite *sprite); void sub_805E5DC(struct Sprite *sprite); void sub_805E668(struct Sprite *sprite); void sub_805E6F4(struct Sprite *sprite); -- cgit v1.2.3 From eae1c5be1196c5e7e57bafcea8a3d204f049abb6 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 22 May 2017 21:55:50 -0400 Subject: A handful more functions in the midst of field map object callbacks --- src/field_map_obj.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index d186eea66..845f84a34 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -2829,6 +2829,44 @@ u8 sub_805E4EC(struct MapObject *mapObject, struct Sprite *sprite) return 1; } +u8 MoveFieldObjectInNextDirectionInSequence(struct MapObject *mapObject, struct Sprite *sprite, u8 *directionSequence) +{ + u8 v0; + u8 goSpeed0AnimId; + if (mapObject->mapobj_unk_21 == 3 && mapObject->coords1.x == mapObject->coords2.x && mapObject->coords1.y == mapObject->coords2.y) + { + mapObject->mapobj_unk_21 = 0; + } + FieldObjectSetDirection(mapObject, directionSequence[mapObject->mapobj_unk_21]); + goSpeed0AnimId = GetGoSpeed0AnimId(mapObject->placeholder18); + v0 = sub_805FF20(mapObject, mapObject->placeholder18); + if (v0 == 1) + { + mapObject->mapobj_unk_21 ++; + FieldObjectSetDirection(mapObject, directionSequence[mapObject->mapobj_unk_21]); + goSpeed0AnimId = GetGoSpeed0AnimId(mapObject->placeholder18); + v0 = sub_805FF20(mapObject, mapObject->placeholder18); + } + if (v0 != 0) + { + goSpeed0AnimId = GetStepInPlaceDelay16AnimId(mapObject->mapobj_unk_18); + } + FieldObjectSetRegularAnim(mapObject, sprite, goSpeed0AnimId); + mapObject->mapobj_bit_1 = 1; + sprite->data1 = 2; + return 1; +} + +u8 sub_805E5B4(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite)) + { + mapObject->mapobj_bit_1 = 0; + sprite->data1 = 1; + } + return 0; +} + void sub_805E5DC(struct Sprite *sprite); void sub_805E668(struct Sprite *sprite); void sub_805E6F4(struct Sprite *sprite); -- cgit v1.2.3 From 5b4191d55480021c5a26a11a0acbd26b8e3f4053 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 22 May 2017 22:30:35 -0400 Subject: Halfway mark on asm/field_map_obj.s --- src/field_map_obj.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 845f84a34..f91328805 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -2867,10 +2867,60 @@ u8 sub_805E5B4(struct MapObject *mapObject, struct Sprite *sprite) return 0; } -void sub_805E5DC(struct Sprite *sprite); -void sub_805E668(struct Sprite *sprite); -void sub_805E6F4(struct Sprite *sprite); +fieldmap_object_cb(sub_805E5DC, sub_805E600, gUnknown_0837540C); + +u8 sub_805E620(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_08375418, 4); + if (mapObject->mapobj_unk_21 == 2 && mapObject->coords1.x == mapObject->coords2.x) + { + mapObject->mapobj_unk_21 = 3; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + +fieldmap_object_cb(sub_805E668, sub_805E68C, gUnknown_0837541C); + +u8 sub_805E6AC(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_08375428, 4); + if (mapObject->mapobj_unk_21 == 1 && mapObject->coords1.x == mapObject->coords2.x) + { + mapObject->mapobj_unk_21 = 2; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + +fieldmap_object_cb(sub_805E6F4, sub_805E718, gUnknown_0837542C); + +u8 sub_805E738(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_08375438, 4); + if (mapObject->mapobj_unk_21 == 1 && mapObject->coords1.y == mapObject->coords2.y) + { + mapObject->mapobj_unk_21 = 2; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + void sub_805E780(struct Sprite *sprite); + +fieldmap_object_cb(sub_805E780, sub_805E7A4, gUnknown_0837543C); + +u8 sub_805E7C4(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_08375448, 4); + if (mapObject->mapobj_unk_21 == 2 && mapObject->coords1.y == mapObject->coords2.y) + { + mapObject->mapobj_unk_21 = 3; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + void sub_805E80C(struct Sprite *sprite); void sub_805E898(struct Sprite *sprite); void sub_805E924(struct Sprite *sprite); -- cgit v1.2.3 From 9c3a25305cfa90021caae4f3a64e5de5ebc6cd45 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 23 May 2017 08:52:21 -0400 Subject: Knock off twenty more field object callbacks --- src/field_map_obj.c | 284 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 262 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index f91328805..1f48c9aad 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -2906,8 +2906,6 @@ u8 sub_805E738(struct MapObject *mapObject, struct Sprite *sprite) return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); } -void sub_805E780(struct Sprite *sprite); - fieldmap_object_cb(sub_805E780, sub_805E7A4, gUnknown_0837543C); u8 sub_805E7C4(struct MapObject *mapObject, struct Sprite *sprite) @@ -2921,26 +2919,268 @@ u8 sub_805E7C4(struct MapObject *mapObject, struct Sprite *sprite) return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); } -void sub_805E80C(struct Sprite *sprite); -void sub_805E898(struct Sprite *sprite); -void sub_805E924(struct Sprite *sprite); -void sub_805E9B0(struct Sprite *sprite); -void sub_805EA3C(struct Sprite *sprite); -void sub_805EAC8(struct Sprite *sprite); -void sub_805EB54(struct Sprite *sprite); -void sub_805EBE0(struct Sprite *sprite); -void sub_805EC6C(struct Sprite *sprite); -void sub_805ECF8(struct Sprite *sprite); -void sub_805ED84(struct Sprite *sprite); -void sub_805EE10(struct Sprite *sprite); -void sub_805EE9C(struct Sprite *sprite); -void sub_805EF28(struct Sprite *sprite); -void sub_805EFB4(struct Sprite *sprite); -void sub_805F040(struct Sprite *sprite); -void sub_805F0CC(struct Sprite *sprite); -void sub_805F158(struct Sprite *sprite); -void sub_805F1E4(struct Sprite *sprite); -void sub_805F270(struct Sprite *sprite); + + +fieldmap_object_cb(sub_805E80C, sub_805E830, gUnknown_0837544C); + +u8 sub_805E850(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_08375458, 4); + if (mapObject->mapobj_unk_21 == 2 && mapObject->coords1.x == mapObject->coords2.x) + { + mapObject->mapobj_unk_21 = 3; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + +fieldmap_object_cb(sub_805E898, sub_805E8BC, gUnknown_0837545C); + +u8 sub_805E8DC(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_08375468, 4); + if (mapObject->mapobj_unk_21 == 1 && mapObject->coords1.x == mapObject->coords2.x) + { + mapObject->mapobj_unk_21 = 2; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + +fieldmap_object_cb(sub_805E924, sub_805E948, gUnknown_0837546C); + +u8 sub_805E968(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_08375240, 4); + if (mapObject->mapobj_unk_21 == 1 && mapObject->coords1.y == mapObject->coords2.y) + { + mapObject->mapobj_unk_21 = 2; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + +fieldmap_object_cb(sub_805E9B0, sub_805E9D4, gUnknown_08375478); + +u8 sub_805E9F4(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_08375484, 4); + if (mapObject->mapobj_unk_21 == 2 && mapObject->coords1.y == mapObject->coords2.y) + { + mapObject->mapobj_unk_21 = 3; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + +fieldmap_object_cb(sub_805EA3C, sub_805EA60, gUnknown_08375488); + +u8 sub_805EA80(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_08375494, 4); + if (mapObject->mapobj_unk_21 == 2 && mapObject->coords1.y == mapObject->coords2.y) + { + mapObject->mapobj_unk_21 = 3; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + +fieldmap_object_cb(sub_805EAC8, sub_805EAEC, gUnknown_08375498); + +u8 sub_805EB0C(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_083754A4, 4); + if (mapObject->mapobj_unk_21 == 1 && mapObject->coords1.y == mapObject->coords2.y) + { + mapObject->mapobj_unk_21 = 2; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + +fieldmap_object_cb(sub_805EB54, sub_805EB78, gUnknown_083754A8); + +u8 sub_805EB98(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_083754B4, 4); + if (mapObject->mapobj_unk_21 == 1 && mapObject->coords1.x == mapObject->coords2.x) + { + mapObject->mapobj_unk_21 = 2; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + +fieldmap_object_cb(sub_805EBE0, sub_805EC04, gUnknown_083754B8); + +u8 sub_805EC24(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_083754C4, 4); + if (mapObject->mapobj_unk_21 == 2 && mapObject->coords1.x == mapObject->coords2.x) + { + mapObject->mapobj_unk_21 = 3; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + +fieldmap_object_cb(sub_805EC6C, sub_805EC90, gUnknown_083754C8); + +u8 sub_805ECB0(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_083754D4, 4); + if (mapObject->mapobj_unk_21 == 2 && mapObject->coords1.y == mapObject->coords2.y) + { + mapObject->mapobj_unk_21 = 3; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + +fieldmap_object_cb(sub_805ECF8, sub_805ED1C, gUnknown_083754D8); + +u8 sub_805ED3C(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_083754E4, 4); + if (mapObject->mapobj_unk_21 == 1 && mapObject->coords1.y == mapObject->coords2.y) + { + mapObject->mapobj_unk_21 = 2; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + +fieldmap_object_cb(sub_805ED84, sub_805EDA8, gUnknown_083754E8); + +u8 sub_805EDC8(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_083754F4, 4); + if (mapObject->mapobj_unk_21 == 1 && mapObject->coords1.x == mapObject->coords2.x) + { + mapObject->mapobj_unk_21 = 2; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + +fieldmap_object_cb(sub_805EE10, sub_805EE34, gUnknown_083754F8); + +u8 sub_805EE54(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_08375504, 4); + if (mapObject->mapobj_unk_21 == 2 && mapObject->coords1.x == mapObject->coords2.x) + { + mapObject->mapobj_unk_21 = 3; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + +fieldmap_object_cb(sub_805EE9C, sub_805EEC0, gUnknown_08375508); + +u8 sub_805EEE0(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_08375514, 4); + if (mapObject->mapobj_unk_21 == 2 && mapObject->coords1.y == mapObject->coords2.y) + { + mapObject->mapobj_unk_21 = 3; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + +fieldmap_object_cb(sub_805EF28, sub_805EF4C, gUnknown_08375518); + +u8 sub_805EF6C(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_08375524, 4); + if (mapObject->mapobj_unk_21 == 2 && mapObject->coords1.y == mapObject->coords2.y) + { + mapObject->mapobj_unk_21 = 3; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + +fieldmap_object_cb(sub_805EFB4, sub_805EFD8, gUnknown_08375528); + +u8 sub_805EFF8(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_08375534, 4); + if (mapObject->mapobj_unk_21 == 2 && mapObject->coords1.x == mapObject->coords2.x) + { + mapObject->mapobj_unk_21 = 3; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + +fieldmap_object_cb(sub_805F040, sub_805F064, gUnknown_08375538); + +u8 sub_805F084(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_08375544, 4); + if (mapObject->mapobj_unk_21 == 2 && mapObject->coords1.x == mapObject->coords2.x) + { + mapObject->mapobj_unk_21 = 3; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + +fieldmap_object_cb(sub_805F0CC, sub_805F0F0, gUnknown_08375548); + +u8 sub_805F110(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_08375554, 4); + if (mapObject->mapobj_unk_21 == 2 && mapObject->coords1.y == mapObject->coords2.y) + { + mapObject->mapobj_unk_21 = 3; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + +fieldmap_object_cb(sub_805F158, sub_805F17C, gUnknown_08375558); + +u8 sub_805F19C(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_08375564, 4); + if (mapObject->mapobj_unk_21 == 2 && mapObject->coords1.y == mapObject->coords2.y) + { + mapObject->mapobj_unk_21 = 3; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + +fieldmap_object_cb(sub_805F1E4, sub_805F208, gUnknown_08375568); + +u8 sub_805F228(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_08375574, 4); + if (mapObject->mapobj_unk_21 == 2 && mapObject->coords1.x == mapObject->coords2.x) + { + mapObject->mapobj_unk_21 = 3; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +} + +fieldmap_object_cb(sub_805F270, sub_805F294, gUnknown_08375578); + +u8 sub_805F2B4(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 directions[4]; + memcpy(directions, gUnknown_08375584, 4); + if (mapObject->mapobj_unk_21 == 2 && mapObject->coords1.x == mapObject->coords2.x) + { + mapObject->mapobj_unk_21 = 3; + } + return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); +}; + void sub_805F2FC(struct Sprite *sprite); void FieldObjectCB_TreeDisguise(struct Sprite *sprite); void FieldObjectCB_MountainDisguise(struct Sprite *sprite); -- cgit v1.2.3 From 48a3b78f82095fb2bd77db7c1c296158deacd76e Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 23 May 2017 10:16:08 -0400 Subject: IsMetatileDirectionallyImpassable, CheckForCollisionBetweenFieldObjects --- src/field_map_obj.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 1f48c9aad..c94b5a180 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -3440,3 +3440,34 @@ bool8 IsCoordOutsideFieldObjectMovementRect(struct MapObject2 *mapObject, s16 x, } return 0; } + +bool8 IsMetatileDirectionallyImpassable(struct MapObject *mapObject, s16 x, s16 y, u8 direction) +{ + if (gUnknown_08375684[direction - 1](mapObject->mapobj_unk_1E) || gUnknown_08375694[direction - 1](MapGridGetMetatileBehaviorAt(x, y))) + { + return 1; + } + return 0; +} + +bool8 CheckForCollisionBetweenFieldObjects(struct MapObject *mapObject, s16 x, s16 y) +{ + struct MapObject *mapObject2; + u8 i; + for (i=0; i<16; i++) + { + mapObject2 = &gMapObjects[i]; + if (mapObject2->active && mapObject2 != mapObject) + { + if ((mapObject2->coords2.x != x || mapObject2->coords2.y != y) && (mapObject2->coords3.x != x || mapObject2->coords3.y != y)) + { + continue; + } + if (AreZCoordsCompatible(mapObject->mapobj_unk_0B_0, mapObject2->mapobj_unk_0B_0)) + { + return 1; + } + } + } + return 0; +} -- cgit v1.2.3 From 8155a807befd4f55f31a38a4535225221708783d Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 23 May 2017 11:13:36 -0400 Subject: Another set of functions related to adjusting coordinates --- src/field_map_obj.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index c94b5a180..8ca2970ab 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -3471,3 +3471,68 @@ bool8 CheckForCollisionBetweenFieldObjects(struct MapObject *mapObject, s16 x, s } return 0; } + +bool8 sub_8060234(u8 localId, u8 mapNum, u8 mapGroup) +{ + u8 mapObjectId; + if (!TryGetFieldObjectIdByLocalIdAndMap(localId, mapNum, mapGroup, &mapObjectId)) + { + if (gSprites[gMapObjects[mapObjectId].spriteId].data7 & 2) + { + return 1; + } + } + return 0; +} + +void sub_8060288(u8 localId, u8 mapNum, u8 mapGroup) +{ + u8 mapObjectId; + if (!TryGetFieldObjectIdByLocalIdAndMap(localId, mapNum, mapGroup, &mapObjectId)) + { + gSprites[gMapObjects[mapObjectId].spriteId].data7 |= 4; + } +} + +void MoveCoords(u8 direction, s16 *x, s16 *y) +{ + *x += gDirectionToVector[direction].x; + *y += gDirectionToVector[direction].y; +} + +void unref_sub_80602F8(u8 direction, s16 *x, s16 *y) +{ + *x += gDirectionToVector[direction].x << 4; + *y += gDirectionToVector[direction].y << 4; +} + +void sub_8060320(u8 direction, s16 *x, s16 *y, s16 deltaX, s16 deltaY) +{ + if (gDirectionToVector[direction].x > 0) + { + *x += deltaX; + } + if (gDirectionToVector[direction].x < 0) + { + *x -= deltaX; + } + if (gDirectionToVector[direction].y > 0) + { + *y += deltaY; + } + if (gDirectionToVector[direction].y < 0) + { + *y -= deltaY; + } +} + +extern s16 gUnknown_03004898; +extern s16 gUnknown_0300489C; + +void sub_8060388(s16 x1, s16 y1, s16 *x2, s16 *y2) +{ + *x2 = (x1 - gSaveBlock1.pos.x) << 4; + *y2 = (y1 - gSaveBlock1.pos.y) << 4; + *x2 -= gUnknown_0300489C; + *y2 -= gUnknown_03004898; +} -- cgit v1.2.3 From 9684b862198f763e66a4f6348cc1f1cdef075ec0 Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 23 May 2017 12:06:33 -0400 Subject: Some more functions related to FMO camera and special anims --- src/field_camera.c | 10 ------ src/field_map_obj.c | 102 +++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 97 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/field_camera.c b/src/field_camera.c index 182e180ab..df5ccc301 100644 --- a/src/field_camera.c +++ b/src/field_camera.c @@ -25,16 +25,6 @@ extern s16 gUnknown_0300059A; extern u8 gUnknown_0300059C; extern void (*gUnknown_030005A0)(void); -struct CameraSomething -{ - void (*callback)(struct CameraSomething *); - u32 unk4; - s32 unk8; - s32 unkC; - s32 unk10; - s32 unk14; -}; - extern struct CameraSomething gUnknown_03004880; extern u16 gUnknown_03004898; extern u16 gUnknown_0300489C; diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 8ca2970ab..bd77ad2be 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -1,5 +1,6 @@ #include "global.h" #include "field_map_obj.h" +#include "field_map_obj_helpers.h" #include "fieldmap.h" #include "asm.h" #include "berry.h" @@ -11,6 +12,7 @@ #include "rom4.h" #include "rng.h" #include "sprite.h" +#include "field_camera.h" extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[36]; @@ -22,7 +24,6 @@ extern void npc_load_two_palettes__and_record(u16, u8); extern void sub_8060388(s16, s16, s16 *, s16 *); extern void sub_80634D0(); extern void pal_patch_for_npc(u16, u16); -extern void sub_80603CC(s16, s16, s16 *, s16 *); extern void CameraObjectReset1(void); void sub_805AAB0(void); @@ -614,7 +615,7 @@ u8 AddPseudoFieldObject(u16 graphicsId, void (*callback)(struct Sprite *), s16 c } extern void sub_8064970(struct Sprite *); -extern void sub_8060470(); +extern void sub_8060470(s16 *, s16 *, s16, s16); extern void InitObjectPriorityByZCoord(); u8 sub_805B410(u8 a, u8 b, s16 c, s16 d, u8 e, u8 f) @@ -3526,9 +3527,6 @@ void sub_8060320(u8 direction, s16 *x, s16 *y, s16 deltaX, s16 deltaY) } } -extern s16 gUnknown_03004898; -extern s16 gUnknown_0300489C; - void sub_8060388(s16 x1, s16 y1, s16 *x2, s16 *y2) { *x2 = (x1 - gSaveBlock1.pos.x) << 4; @@ -3536,3 +3534,97 @@ void sub_8060388(s16 x1, s16 y1, s16 *x2, s16 *y2) *x2 -= gUnknown_0300489C; *y2 -= gUnknown_03004898; } + +void sub_80603CC(s16 x1, s16 y1, s16 *x2, s16 *y2) +{ + s16 x3; + s16 y3; + x3 = -gUnknown_0300489C - gUnknown_03004880.unk10; + y3 = -gUnknown_03004898 - gUnknown_03004880.unk14; + if (gUnknown_03004880.unk10 > 0) + { + x3 += 0x10; + } + if (gUnknown_03004880.unk10 < 0) + { + x3 -= 0x10; + } + if (gUnknown_03004880.unk14 > 0) + { + y3 += 0x10; + } + if (gUnknown_03004880.unk14 < 0) + { + y3 -= 0x10; + } + *x2 = ((x1 - gSaveBlock1.pos.x) << 4) + x3; + *y2 = ((y1 - gSaveBlock1.pos.y) << 4) + y3; +} + +void sub_8060470(s16 *x, s16 *y, s16 dx, s16 dy) +{ + sub_80603CC(*x, *y, x, y); + *x += dx; + *y += dy; +} + +void GetFieldObjectMovingCameraOffset(s16 *x, s16 *y) +{ + *x = 0; + *y = 0; + if (gUnknown_03004880.unk10 > 0) + { + (*x)++; + } + if (gUnknown_03004880.unk10 < 0) + { + (*x)--; + } + if (gUnknown_03004880.unk14 > 0) + { + (*y)++; + } + if (gUnknown_03004880.unk14 < 0) + { + (*y)--; + } +} + +void FieldObjectMoveDestCoords(struct MapObject *mapObject, u8 direction, s16 *x, s16 *y) +{ + *x = mapObject->coords2.x; + *y = mapObject->coords2.y; + MoveCoords(direction, x, y); +} + +bool8 FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive(struct MapObject *mapObject) +{ + if (mapObject->mapobj_bit_1 || mapObject->mapobj_bit_6) + { + return TRUE; + } + return FALSE; +} + +bool8 FieldObjectIsSpecialAnimActive(struct MapObject *mapObject) +{ + if (mapObject->mapobj_bit_6 && mapObject->mapobj_unk_1C != 0xff) + { + return TRUE; + } + return FALSE; +} + +bool8 FieldObjectSetSpecialAnim(struct MapObject *mapObject, u8 specialAnimId) +{ + if (FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive(mapObject)) + { + return TRUE; + } + UnfreezeMapObject(mapObject); + mapObject->mapobj_unk_1C = specialAnimId; + mapObject->mapobj_bit_6 = 1; + mapObject->mapobj_bit_7 = 0; + gSprites[mapObject->spriteId].data2 = 0; + return FALSE; +} -- cgit v1.2.3 From f9c54affb68b5aa35ef97fad29db67935d2c7d8d Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 23 May 2017 13:18:23 -0400 Subject: Special anims; meta_step --- src/field_map_obj.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index bd77ad2be..29dbc4bd0 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -22,7 +22,7 @@ extern void ClearPlayerAvatarInfo(void); extern void npc_load_two_palettes__no_record(u16, u8); extern void npc_load_two_palettes__and_record(u16, u8); extern void sub_8060388(s16, s16, s16 *, s16 *); -extern void sub_80634D0(); +extern void sub_80634D0(struct MapObject *, struct Sprite *); extern void pal_patch_for_npc(u16, u16); extern void CameraObjectReset1(void); @@ -3628,3 +3628,82 @@ bool8 FieldObjectSetSpecialAnim(struct MapObject *mapObject, u8 specialAnimId) gSprites[mapObject->spriteId].data2 = 0; return FALSE; } + +void FieldObjectForceSetSpecialAnim(struct MapObject *mapObject, u8 specialAnimId) +{ + FieldObjectClearAnimIfSpecialAnimActive(mapObject); + FieldObjectSetSpecialAnim(mapObject, specialAnimId); +} + +void FieldObjectClearAnimIfSpecialAnimActive(struct MapObject *mapObject) +{ + if (mapObject->mapobj_bit_6) + { + FieldObjectClearAnim(mapObject); + } +} + +void FieldObjectClearAnim(struct MapObject *mapObject) +{ + mapObject->mapobj_unk_1C = 0xFF; + mapObject->mapobj_bit_6 = 0; + mapObject->mapobj_bit_7 = 0; + gSprites[mapObject->spriteId].data1 = 0; + gSprites[mapObject->spriteId].data2 = 0; +} + +bool8 FieldObjectCheckIfSpecialAnimFinishedOrInactive(struct MapObject *mapObject) +{ + if (mapObject->mapobj_bit_6) + return mapObject->mapobj_bit_7; + return 0x10; +} + +bool8 FieldObjectClearAnimIfSpecialAnimFinished(struct MapObject *mapObject) +{ + u8 specialAnimStatus; + specialAnimStatus = FieldObjectCheckIfSpecialAnimFinishedOrInactive(mapObject); + if (specialAnimStatus != 0 && specialAnimStatus != 0x10) + { + FieldObjectClearAnimIfSpecialAnimActive(mapObject); + } + return specialAnimStatus; +} + +u8 FieldObjectGetSpecialAnim(struct MapObject *mapObject) +{ + if (mapObject->mapobj_bit_6) + { + return mapObject->mapobj_unk_1C; + } + return 0xFF; +} + +extern void DoGroundEffects_OnSpawn(struct MapObject *mapObject, struct Sprite *sprite); +extern void DoGroundEffects_OnBeginStep(struct MapObject *mapObject, struct Sprite *sprite); +extern void DoGroundEffects_OnFinishStep(struct MapObject *mapObject, struct Sprite *sprite); +extern void npc_obj_transfer_image_anim_pause_flag(struct MapObject *mapObject, struct Sprite *sprite); +void sub_80634A0(struct MapObject *mapObject, struct Sprite *sprite); +void FieldObjectExecSpecialAnim(struct MapObject *mapObject, struct Sprite *sprite); +void FieldObjectUpdateSubpriority(struct MapObject *mapObject, struct Sprite *sprite); + +void meta_step(struct MapObject *mapObject, struct Sprite *sprite, u8 (*callback)(struct MapObject *, struct Sprite *)) +{ + DoGroundEffects_OnSpawn(mapObject, sprite); + sub_80634A0(mapObject, sprite); + if (FieldObjectIsSpecialAnimActive(mapObject)) + { + FieldObjectExecSpecialAnim(mapObject, sprite); + } else + { + if (!mapObject->mapobj_bit_8) + { + while (callback(mapObject, sprite)); + } + } + DoGroundEffects_OnBeginStep(mapObject, sprite); + DoGroundEffects_OnFinishStep(mapObject, sprite); + npc_obj_transfer_image_anim_pause_flag(mapObject, sprite); + sub_80634D0(mapObject, sprite); + FieldObjectUpdateSubpriority(mapObject, sprite); +} -- cgit v1.2.3 From f678fe263da7deeeb060672a3520b4b1d71ce848 Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 23 May 2017 13:50:14 -0400 Subject: Another chunk of largely-identical FMO functions --- src/field_map_obj.c | 357 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 357 insertions(+) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 29dbc4bd0..211bc919f 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -3707,3 +3707,360 @@ void meta_step(struct MapObject *mapObject, struct Sprite *sprite, u8 (*callback sub_80634D0(mapObject, sprite); FieldObjectUpdateSubpriority(mapObject, sprite); } + + +const u8 gUnknown_083756C8[5]; + +u8 GetFaceDirectionAnimId(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_083756C8, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_083756CD[5]; + +u8 GetSimpleGoAnimId(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_083756CD, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_083756D2[5]; + +u8 GetGoSpeed0AnimId(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_083756D2, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_083756D7[5]; + +u8 sub_8060744(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_083756D7, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_083756DC[5]; + +u8 d2s_08064034(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_083756DC, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_083756E1[5]; + +u8 sub_806079C(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_083756E1, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_083756E6[5]; + +u8 sub_80607C8(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_083756E6, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_083756EB[5]; + +u8 sub_80607F4(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_083756EB, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_083756F0[5]; + +u8 GetJumpLedgeAnimId(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_083756F0, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_083756F5[5]; + +u8 sub_806084C(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_083756F5, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_083756FA[5]; + +u8 sub_8060878(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_083756FA, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_083756FF[5]; + +u8 sub_80608A4(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_083756FF, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_08375704[5]; + +u8 sub_80608D0(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_08375704, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_08375709[5]; + +u8 GetStepInPlaceDelay32AnimId(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_08375709, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_0837570E[5]; + +u8 GetStepInPlaceDelay16AnimId(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_0837570E, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_08375713[5]; + +u8 GetStepInPlaceDelay8AnimId(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_08375713, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_08375718[5]; + +u8 GetStepInPlaceDelay4AnimId(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_08375718, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +u8 FieldObjectFaceOppositeDirection(struct MapObject *mapObject, u8 direction) +{ + return FieldObjectSetSpecialAnim(mapObject, GetFaceDirectionAnimId(GetOppositeDirection(direction))); +} + +const u8 gUnknown_0837571D[5]; + +u8 sub_80609D8(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_0837571D, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_08375722[5]; + +u8 sub_8060A04(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_08375722, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_08375727[5]; + +u8 sub_8060A30(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_08375727, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_0837572C[5]; + +u8 sub_8060A5C(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_0837572C, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_08375731[5]; + +u8 sub_8060A88(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_08375731, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_08375736[5]; + +u8 sub_8060AB4(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_08375736, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_0837573B[5]; + +u8 sub_8060AE0(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_0837573B, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_08375740[5]; + +u8 sub_8060B0C(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_08375740, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_08375745[5]; + +u8 sub_8060B38(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_08375745, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} + +const u8 gUnknown_0837574A[5]; + +u8 sub_8060B64(u8 index) +{ + u8 directions[5]; + memcpy(directions, gUnknown_0837574A, 5); + if (index >= 5) + { + index = 0; + } + return directions[index]; +} -- cgit v1.2.3 From 39e0ce9f6d6dab0f9d72f967ba6fef23398bb342 Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 23 May 2017 14:27:22 -0400 Subject: up through state_to_direction, which is nonmatching (help, registers are misbehaving) --- src/field_map_obj.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 211bc919f..108f9cc20 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -4064,3 +4064,73 @@ u8 sub_8060B64(u8 index) } return directions[index]; } + +u8 GetOppositeDirection(u8 direction) +{ + u8 directions[8]; + memcpy(directions, gUnknown_0837574F, 8); + if (direction == 0 || direction > 8) + { + return direction; + } + return directions[direction - 1]; +} + +int zffu_offset_calc(u8 a0, u8 a1) +{ + return gUnknown_08375757[a0 - 1][a1 - 1]; +} + +#ifdef NONMATCHING +u8 state_to_direction(u8 a0, u8 a1, u8 a2) +{ + int zffuOffset; + if (a1 == 0 || a2 == 0 || a1 > 4 || a2 > 4) + { + return 0; + } + zffuOffset = zffu_offset_calc(a1, a2); + return gUnknown_08375767[a0 - 1][zffuOffset - 1]; +} +#else +__attribute__((naked)) +u8 state_to_direction(u8 a0, u8 a1, u8 a2) +{ + asm(".syntax unified\n\ + push {r4,lr}\n\ + lsls r0, 24\n\ + lsrs r4, r0, 24\n\ + lsls r1, 24\n\ + lsrs r1, 24\n\ + adds r0, r1, 0\n\ + lsls r2, 24\n\ + lsrs r2, 24\n\ + cmp r1, 0\n\ + beq _08060BFC\n\ + cmp r2, 0\n\ + beq _08060BFC\n\ + cmp r1, 0x4\n\ + bhi _08060BFC\n\ + cmp r2, 0x4\n\ + bls _08060C00\n\ +_08060BFC:\n\ + movs r0, 0\n\ + b _08060C12\n\ +_08060C00:\n\ + adds r1, r2, 0\n\ + bl zffu_offset_calc\n\ + ldr r2, _08060C18 @ =gUnknown_08375767\n\ + lsls r1, r4, 2\n\ + subs r1, 0x5\n\ + adds r0, r1\n\ + adds r0, r2\n\ + ldrb r0, [r0]\n\ +_08060C12:\n\ + pop {r4}\n\ + pop {r1}\n\ + bx r1\n\ + .align 2, 0\n\ +_08060C18: .4byte gUnknown_08375767\n\ +.syntax divided\n"); +} +#endif -- cgit v1.2.3 From d44cefb06d4d2e160db450a27b74a739753d24dd Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 23 May 2017 15:26:25 -0400 Subject: Some more field map object functions; asm/field_map_obj.s down to 7k lines --- src/field_map_obj.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 108f9cc20..ae5d65ce2 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -4085,6 +4085,7 @@ int zffu_offset_calc(u8 a0, u8 a1) u8 state_to_direction(u8 a0, u8 a1, u8 a2) { int zffuOffset; + asm_comment("For some reason, r2 is being backed up to r3 and restored ahead of the zffu call.") if (a1 == 0 || a2 == 0 || a1 > 4 || a2 > 4) { return 0; @@ -4134,3 +4135,106 @@ _08060C18: .4byte gUnknown_08375767\n\ .syntax divided\n"); } #endif + +void FieldObjectExecSpecialAnim(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (gUnknown_08375778[mapObject->mapobj_unk_1C][sprite->data2](mapObject, sprite)) + { + mapObject->mapobj_bit_7 = 1; + } +} + +bool8 FieldObjectExecRegularAnim(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (gUnknown_08375778[mapObject->mapobj_unk_1C][sprite->data2](mapObject, sprite)) + { + mapObject->mapobj_unk_1C = 0xFF; + sprite->data2 = 0; + return 1; + } + return 0; +} + +void FieldObjectSetRegularAnim(struct MapObject *mapObject, struct Sprite *sprite, u8 animId) +{ + mapObject->mapobj_unk_1C = animId; + sprite->data2 = 0; +} + +void an_look_any(struct MapObject *mapObject, struct Sprite *sprite, u8 direction) +{ + FieldObjectSetDirection(mapObject, direction); + npc_coords_shift_still(mapObject); + sub_805FE64(mapObject, sprite, get_go_image_anim_num(mapObject->mapobj_unk_18)); + sprite->animPaused = 1; + sprite->data2 = 1; +} + +u8 sub_8060CE0(struct MapObject *mapObject, struct Sprite *sprite) +{ + an_look_any(mapObject, sprite, DIR_SOUTH); + return 1; +} + +u8 sub_8060CF0(struct MapObject *mapObject, struct Sprite *sprite) +{ + an_look_any(mapObject, sprite, DIR_NORTH); + return 1; +} + +u8 sub_8060D00(struct MapObject *mapObject, struct Sprite *sprite) +{ + an_look_any(mapObject, sprite, DIR_WEST); + return 1; +} + +u8 sub_8060D10(struct MapObject *mapObject, struct Sprite *sprite) +{ + an_look_any(mapObject, sprite, DIR_EAST); + return 1; +} + +void sub_8060D20(struct MapObject *mapObject, struct Sprite *sprite, u8 direction, u8 a2) +{ + s16 x; + s16 y; + x = mapObject->coords2.x; + y = mapObject->coords2.y; + FieldObjectSetDirection(mapObject, direction); + MoveCoords(direction, &x, &y); + npc_coords_shift(mapObject, x, y); + oamt_npc_ministep_reset(sprite, direction, a2); + sprite->animPaused = 0; + mapObject->mapobj_bit_2 = 1; + sprite->data2 = 1; +} + +extern u8 (*const gUnknown_083759C0[5])(u8); + +void do_go_anim(struct MapObject *mapObject, struct Sprite *sprite, u8 direction, u8 a2) +{ + u8 (*functions[5])(u8); + memcpy(functions, gUnknown_083759C0, sizeof(gUnknown_083759C0)); + sub_8060D20(mapObject, sprite, direction, a2); + sub_805FE28(mapObject, sprite, functions[a2](mapObject->mapobj_unk_18)); +} + +void do_run_anim(struct MapObject *mapObject, struct Sprite *sprite, u8 direction) +{ + sub_8060D20(mapObject, sprite, direction, 1); + sub_805FE28(mapObject, sprite, get_run_image_anim_num(mapObject->mapobj_unk_18)); +} + +bool8 obj_npc_ministep(struct Sprite *); + +bool8 npc_obj_ministep_stop_on_arrival(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (obj_npc_ministep(sprite)) + { + npc_coords_shift_still(mapObject); + mapObject->mapobj_bit_3 = 1; + sprite->animPaused = 1; + return 1; + } + return 0; +} -- cgit v1.2.3 From d60a59a62738c9c56119b607f6a875556723d0bb Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 23 May 2017 19:21:07 -0400 Subject: Another chunk of functions with similar (and, in some cases, identical) decompilation --- src/field_map_obj.c | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index ae5d65ce2..cb68b0140 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -4238,3 +4238,109 @@ bool8 npc_obj_ministep_stop_on_arrival(struct MapObject *mapObject, struct Sprit } return 0; } + +void sub_8060E68(struct MapObject *mapObject, struct Sprite *sprite, u8 direction) +{ + s16 x; + s16 y; + x = mapObject->coords2.x; + y = mapObject->coords2.y; + FieldObjectSetDirection(mapObject, direction); + MoveCoords(direction, &x, &y); + npc_coords_shift(mapObject, x, y); + sub_806467C(sprite, direction); + sprite->animPaused = 0; + mapObject->mapobj_bit_2 = 1; + sprite->data2 = 1; +} + +void sub_8060ED8(struct MapObject *mapObject, struct Sprite *sprite, u8 direction) +{ + sub_8060E68(mapObject, sprite, direction); + sub_805FE28(mapObject, sprite, get_go_image_anim_num(mapObject->mapobj_unk_18)); +} + +bool8 an_walk_any_2(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_806468C(sprite)) + { + npc_coords_shift_still(mapObject); + mapObject->mapobj_bit_3 = 1; + sprite->animPaused = 1; + return TRUE; + } + return FALSE; +} + +bool8 sub_8060F5C(struct MapObject *, struct Sprite *); + +bool8 sub_8060F3C(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8060ED8(mapObject, sprite, DIR_SOUTH); + return sub_8060F5C(mapObject, sprite); +} + +bool8 sub_8060F5C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (an_walk_any_2(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8060F9C(struct MapObject *, struct Sprite *); + +bool8 sub_8060F7C(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8060ED8(mapObject, sprite, DIR_NORTH); + return sub_8060F9C(mapObject, sprite); +} + +bool8 sub_8060F9C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (an_walk_any_2(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8060FDC(struct MapObject *, struct Sprite *); + +bool8 sub_8060FBC(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8060ED8(mapObject, sprite, DIR_WEST); + return sub_8060FDC(mapObject, sprite); +} + +bool8 sub_8060FDC(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (an_walk_any_2(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_806101C(struct MapObject *, struct Sprite *); + +bool8 sub_8060FFC(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8060ED8(mapObject, sprite, DIR_EAST); + return sub_806101C(mapObject, sprite); +} + +bool8 sub_806101C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (an_walk_any_2(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + -- cgit v1.2.3 From 989316f66a7175ff8a25b10ceb9de51d6d0f7de7 Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 23 May 2017 19:29:49 -0400 Subject: Yet another chunk of functions with similar (and, in some cases, identical) decompilation --- src/field_map_obj.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index cb68b0140..21dcb90bc 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -4344,3 +4344,75 @@ bool8 sub_806101C(struct MapObject *mapObject, struct Sprite *sprite) return FALSE; } +bool8 sub_806105C(struct MapObject *, struct Sprite *); + +bool8 sub_806103C(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_go_anim(mapObject, sprite, DIR_SOUTH, 0); + return sub_806105C(mapObject, sprite); +} + +bool8 sub_806105C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_806109C(struct MapObject *, struct Sprite *); + +bool8 sub_806107C(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_go_anim(mapObject, sprite, DIR_NORTH, 0); + return sub_806109C(mapObject, sprite); +} + +bool8 sub_806109C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_80610DC(struct MapObject *, struct Sprite *); + +bool8 sub_80610BC(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_go_anim(mapObject, sprite, DIR_WEST, 0); + return sub_80610DC(mapObject, sprite); +} + +bool8 sub_80610DC(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_806111C(struct MapObject *, struct Sprite *); + +bool8 sub_80610FC(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_go_anim(mapObject, sprite, DIR_EAST, 0); + return sub_806111C(mapObject, sprite); +} + +bool8 sub_806111C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + -- cgit v1.2.3 From 4a352535b994fa3c277d5c64e7f6ece4d5e94b5f Mon Sep 17 00:00:00 2001 From: yenatch Date: Tue, 23 May 2017 22:32:52 -0400 Subject: Fix ld warnings for undeclared externs. --- src/field_map_obj.c | 54 ++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 21dcb90bc..8c85e7b6d 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -3709,7 +3709,7 @@ void meta_step(struct MapObject *mapObject, struct Sprite *sprite, u8 (*callback } -const u8 gUnknown_083756C8[5]; +extern const u8 gUnknown_083756C8[5]; u8 GetFaceDirectionAnimId(u8 index) { @@ -3722,7 +3722,7 @@ u8 GetFaceDirectionAnimId(u8 index) return directions[index]; } -const u8 gUnknown_083756CD[5]; +extern const u8 gUnknown_083756CD[5]; u8 GetSimpleGoAnimId(u8 index) { @@ -3735,7 +3735,7 @@ u8 GetSimpleGoAnimId(u8 index) return directions[index]; } -const u8 gUnknown_083756D2[5]; +extern const u8 gUnknown_083756D2[5]; u8 GetGoSpeed0AnimId(u8 index) { @@ -3748,7 +3748,7 @@ u8 GetGoSpeed0AnimId(u8 index) return directions[index]; } -const u8 gUnknown_083756D7[5]; +extern const u8 gUnknown_083756D7[5]; u8 sub_8060744(u8 index) { @@ -3761,7 +3761,7 @@ u8 sub_8060744(u8 index) return directions[index]; } -const u8 gUnknown_083756DC[5]; +extern const u8 gUnknown_083756DC[5]; u8 d2s_08064034(u8 index) { @@ -3774,7 +3774,7 @@ u8 d2s_08064034(u8 index) return directions[index]; } -const u8 gUnknown_083756E1[5]; +extern const u8 gUnknown_083756E1[5]; u8 sub_806079C(u8 index) { @@ -3787,7 +3787,7 @@ u8 sub_806079C(u8 index) return directions[index]; } -const u8 gUnknown_083756E6[5]; +extern const u8 gUnknown_083756E6[5]; u8 sub_80607C8(u8 index) { @@ -3800,7 +3800,7 @@ u8 sub_80607C8(u8 index) return directions[index]; } -const u8 gUnknown_083756EB[5]; +extern const u8 gUnknown_083756EB[5]; u8 sub_80607F4(u8 index) { @@ -3813,7 +3813,7 @@ u8 sub_80607F4(u8 index) return directions[index]; } -const u8 gUnknown_083756F0[5]; +extern const u8 gUnknown_083756F0[5]; u8 GetJumpLedgeAnimId(u8 index) { @@ -3826,7 +3826,7 @@ u8 GetJumpLedgeAnimId(u8 index) return directions[index]; } -const u8 gUnknown_083756F5[5]; +extern const u8 gUnknown_083756F5[5]; u8 sub_806084C(u8 index) { @@ -3839,7 +3839,7 @@ u8 sub_806084C(u8 index) return directions[index]; } -const u8 gUnknown_083756FA[5]; +extern const u8 gUnknown_083756FA[5]; u8 sub_8060878(u8 index) { @@ -3852,7 +3852,7 @@ u8 sub_8060878(u8 index) return directions[index]; } -const u8 gUnknown_083756FF[5]; +extern const u8 gUnknown_083756FF[5]; u8 sub_80608A4(u8 index) { @@ -3865,7 +3865,7 @@ u8 sub_80608A4(u8 index) return directions[index]; } -const u8 gUnknown_08375704[5]; +extern const u8 gUnknown_08375704[5]; u8 sub_80608D0(u8 index) { @@ -3878,7 +3878,7 @@ u8 sub_80608D0(u8 index) return directions[index]; } -const u8 gUnknown_08375709[5]; +extern const u8 gUnknown_08375709[5]; u8 GetStepInPlaceDelay32AnimId(u8 index) { @@ -3891,7 +3891,7 @@ u8 GetStepInPlaceDelay32AnimId(u8 index) return directions[index]; } -const u8 gUnknown_0837570E[5]; +extern const u8 gUnknown_0837570E[5]; u8 GetStepInPlaceDelay16AnimId(u8 index) { @@ -3904,7 +3904,7 @@ u8 GetStepInPlaceDelay16AnimId(u8 index) return directions[index]; } -const u8 gUnknown_08375713[5]; +extern const u8 gUnknown_08375713[5]; u8 GetStepInPlaceDelay8AnimId(u8 index) { @@ -3917,7 +3917,7 @@ u8 GetStepInPlaceDelay8AnimId(u8 index) return directions[index]; } -const u8 gUnknown_08375718[5]; +extern const u8 gUnknown_08375718[5]; u8 GetStepInPlaceDelay4AnimId(u8 index) { @@ -3935,7 +3935,7 @@ u8 FieldObjectFaceOppositeDirection(struct MapObject *mapObject, u8 direction) return FieldObjectSetSpecialAnim(mapObject, GetFaceDirectionAnimId(GetOppositeDirection(direction))); } -const u8 gUnknown_0837571D[5]; +extern const u8 gUnknown_0837571D[5]; u8 sub_80609D8(u8 index) { @@ -3948,7 +3948,7 @@ u8 sub_80609D8(u8 index) return directions[index]; } -const u8 gUnknown_08375722[5]; +extern const u8 gUnknown_08375722[5]; u8 sub_8060A04(u8 index) { @@ -3961,7 +3961,7 @@ u8 sub_8060A04(u8 index) return directions[index]; } -const u8 gUnknown_08375727[5]; +extern const u8 gUnknown_08375727[5]; u8 sub_8060A30(u8 index) { @@ -3974,7 +3974,7 @@ u8 sub_8060A30(u8 index) return directions[index]; } -const u8 gUnknown_0837572C[5]; +extern const u8 gUnknown_0837572C[5]; u8 sub_8060A5C(u8 index) { @@ -3987,7 +3987,7 @@ u8 sub_8060A5C(u8 index) return directions[index]; } -const u8 gUnknown_08375731[5]; +extern const u8 gUnknown_08375731[5]; u8 sub_8060A88(u8 index) { @@ -4000,7 +4000,7 @@ u8 sub_8060A88(u8 index) return directions[index]; } -const u8 gUnknown_08375736[5]; +extern const u8 gUnknown_08375736[5]; u8 sub_8060AB4(u8 index) { @@ -4013,7 +4013,7 @@ u8 sub_8060AB4(u8 index) return directions[index]; } -const u8 gUnknown_0837573B[5]; +extern const u8 gUnknown_0837573B[5]; u8 sub_8060AE0(u8 index) { @@ -4026,7 +4026,7 @@ u8 sub_8060AE0(u8 index) return directions[index]; } -const u8 gUnknown_08375740[5]; +extern const u8 gUnknown_08375740[5]; u8 sub_8060B0C(u8 index) { @@ -4039,7 +4039,7 @@ u8 sub_8060B0C(u8 index) return directions[index]; } -const u8 gUnknown_08375745[5]; +extern const u8 gUnknown_08375745[5]; u8 sub_8060B38(u8 index) { @@ -4052,7 +4052,7 @@ u8 sub_8060B38(u8 index) return directions[index]; } -const u8 gUnknown_0837574A[5]; +extern const u8 gUnknown_0837574A[5]; u8 sub_8060B64(u8 index) { -- cgit v1.2.3 From 5b525b279413b08bc5841255d390f6e95187d787 Mon Sep 17 00:00:00 2001 From: NieDzejkob Date: Sun, 21 May 2017 22:17:31 +0200 Subject: Identify gUnknown_3001764 --- src/link.c | 2 +- src/main.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/link.c b/src/link.c index 7cf2fc611..17e78e0a5 100644 --- a/src/link.c +++ b/src/link.c @@ -642,7 +642,7 @@ static void BuildSendCmd(u16 code) gSendCmd[0] = 0x5FFF; break; case 0xCAFE: - if (!word_3004858 || gUnknown_3001764) + if (!word_3004858 || gLinkTransferringData) break; gSendCmd[0] = 0xCAFE; gSendCmd[1] = word_3004858; diff --git a/src/main.c b/src/main.c index 114fc171f..37db02174 100644 --- a/src/main.c +++ b/src/main.c @@ -60,7 +60,7 @@ const IntrFunc gIntrTableTemplate[] = #define INTR_COUNT ((int)(sizeof(gIntrTableTemplate)/sizeof(IntrFunc))) u16 gKeyRepeatStartDelay; -u8 gUnknown_3001764; +bool8 gLinkTransferringData; struct Main gMain; u16 gKeyRepeatContinueDelay; u8 gSoftResetDisabled; @@ -99,7 +99,7 @@ void AgbMain() if (gFlashMemoryPresent != TRUE) SetMainCallback2(NULL); - gUnknown_3001764 = 0; + gLinkTransferringData = FALSE; for (;;) { @@ -112,13 +112,13 @@ void AgbMain() if (gLink.sendQueue.count > 1 && sub_8055910() == 1) { - gUnknown_3001764 = 1; + gLinkTransferringData = TRUE; UpdateLinkAndCallCallbacks(); - gUnknown_3001764 = 0; + gLinkTransferringData = FALSE; } else { - gUnknown_3001764 = 0; + gLinkTransferringData = FALSE; UpdateLinkAndCallCallbacks(); if (gLink.recvQueue.count > 1) @@ -126,9 +126,9 @@ void AgbMain() if (sub_80558AC() == 1) { gMain.newKeys = 0; - gUnknown_3001764 = 1; + gLinkTransferringData = TRUE; UpdateLinkAndCallCallbacks(); - gUnknown_3001764 = 0; + gLinkTransferringData = FALSE; } } } -- cgit v1.2.3 From fe2090c222eab31db62c9d599e6e95f6898c8ebc Mon Sep 17 00:00:00 2001 From: NieDzejkob Date: Sun, 21 May 2017 23:40:08 +0200 Subject: Various intro naming --- src/intro.c | 20 ++++++++++---------- src/main.c | 2 +- src/title_screen.c | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/intro.c b/src/intro.c index 3f4897092..ba2197ae7 100644 --- a/src/intro.c +++ b/src/intro.c @@ -838,14 +838,14 @@ static void MainCB2_EndIntro(void) SetMainCallback2(CB2_InitTitleScreen); } -static void LoadCopyrightGraphics(u16 a1, u16 a2, u16 a3) +static void LoadCopyrightGraphics(u16 tilesetAddress, u16 tilemapAddress, u16 paletteAddress) { - LZ77UnCompVram(gIntroCopyright_Gfx, (void *)(VRAM + a1)); - LoadPalette(gIntroCopyright_Pal, a3, 0x20); - CpuCopy16(gIntroCopyright_Tilemap, (void *)(VRAM + a2), 0x500); + LZ77UnCompVram(gIntroCopyright_Gfx, (void *)(VRAM + tilesetAddress)); + LoadPalette(gIntroCopyright_Pal, paletteAddress, 0x20); + CpuCopy16(gIntroCopyright_Tilemap, (void *)(VRAM + tilemapAddress), 0x500); } -static void SerialCb_CopyrightScreen(void) +static void SerialCB_CopyrightScreen(void) { GameCubeMultiBoot_HandleSerialInterrupt(&gMultibootProgramStruct); } @@ -869,7 +869,7 @@ static u8 SetUpCopyrightScreen(void) DmaFill32(3, 0, (void *)OAM, OAM_SIZE); DmaFill16(3, 0, (void *)(PLTT + 2), PLTT_SIZE - 2); ResetPaletteFade(); - LoadCopyrightGraphics(0, 14336, 0); + LoadCopyrightGraphics(0, 0x3800, 0); remove_some_task(); ResetTasks(); ResetSpriteData(); @@ -887,7 +887,7 @@ static u8 SetUpCopyrightScreen(void) REG_DISPSTAT |= DISPSTAT_VBLANK_INTR; SetVBlankCallback(VBlankCB_Intro); REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON; - SetSerialCallback(SerialCb_CopyrightScreen); + SetSerialCallback(SerialCB_CopyrightScreen); GameCubeMultiBoot_Init(&gMultibootProgramStruct); default: UpdatePaletteFade(); @@ -898,7 +898,7 @@ static u8 SetUpCopyrightScreen(void) GameCubeMultiBoot_Main(&gMultibootProgramStruct); if (gMultibootProgramStruct.gcmb_field_2 != 1) { - BeginNormalPaletteFade(0xFFFFFFFFu, 0, 0, 0x10, 0); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0); gMain.state++; } break; @@ -922,7 +922,7 @@ static u8 SetUpCopyrightScreen(void) return 1; } -void c2_copyright_1(void) +void CB2_InitCopyrightScreenAfterBootup(void) { if (!SetUpCopyrightScreen()) { @@ -935,7 +935,7 @@ void c2_copyright_1(void) } } -void CB2_InitCopyrightScreen(void) +void CB2_InitCopyrightScreenAfterTitleScreen(void) { SetUpCopyrightScreen(); } diff --git a/src/main.c b/src/main.c index 37db02174..19891459c 100644 --- a/src/main.c +++ b/src/main.c @@ -152,7 +152,7 @@ static void InitMainCallbacks(void) gMain.vblankCounter1 = 0; gMain.vblankCounter2 = 0; gMain.callback1 = NULL; - SetMainCallback2(c2_copyright_1); + SetMainCallback2(CB2_InitCopyrightScreenAfterBootup); } static void CallCallbacks(void) diff --git a/src/title_screen.c b/src/title_screen.c index dd6a858f6..241e5489e 100644 --- a/src/title_screen.c +++ b/src/title_screen.c @@ -709,7 +709,7 @@ static void CB2_GoToMainMenu(void) static void CB2_GoToCopyrightScreen(void) { if (!UpdatePaletteFade()) - SetMainCallback2(CB2_InitCopyrightScreen); + SetMainCallback2(CB2_InitCopyrightScreenAfterTitleScreen); } static void CB2_GoToClearSaveDataScreen(void) -- cgit v1.2.3 From 465825382017814f28495a8c4bb385c00436087a Mon Sep 17 00:00:00 2001 From: NieDzejkob Date: Sun, 21 May 2017 23:44:49 +0200 Subject: name InitBattle --- src/battle_2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/battle_2.c b/src/battle_2.c index 6bcccbaf9..e5091bd08 100644 --- a/src/battle_2.c +++ b/src/battle_2.c @@ -293,7 +293,7 @@ extern u8 sub_80170DC(); extern u8 ItemId_GetHoldEffect(u16); extern void sub_8094C98(); -void sub_800E7F8(void); +void InitBattle(void); void sub_800EC9C(void); void sub_800F104(void); void sub_800F298(void); @@ -347,11 +347,11 @@ void sub_800E7C4(void) } else { - sub_800E7F8(); + InitBattle(); } } -void sub_800E7F8(void) +void InitBattle(void) { s32 i; @@ -767,7 +767,7 @@ void sub_800F104(void) { gBattleTypeFlags = *pSavedBattleTypeFlags; gMain.savedCallback = *pSavedCallback; - SetMainCallback2(sub_800E7F8); + SetMainCallback2(InitBattle); } break; } -- cgit v1.2.3 From 6bfb9af365db91947ee65ceaa15ad0c2dba4147d Mon Sep 17 00:00:00 2001 From: scnorton Date: Wed, 24 May 2017 15:59:43 -0400 Subject: sub_806113C --- src/field_map_obj.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 8c85e7b6d..7e245410c 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -4416,3 +4416,22 @@ bool8 sub_806111C(struct MapObject *mapObject, struct Sprite *sprite) return FALSE; } +extern const s16 gUnknown_08375A34[3]; + +void sub_806113C(struct MapObject *mapObject, struct Sprite *sprite, u8 direction, u8 a4, u8 a5) +{ + s16 vSPp4[3]; + s16 x; + s16 y; + memcpy(vSPp4, gUnknown_08375A34, sizeof gUnknown_08375A34); + x = 0; + y = 0; + FieldObjectSetDirection(mapObject, direction); + sub_8060320(direction, &x, &y, vSPp4[a4], vSPp4[a4]); + npc_coords_shift(mapObject, mapObject->coords2.x + x, mapObject->coords2.y + y); + sub_80646E4(sprite, direction, a4, a5); + sprite->data2 = 1; + sprite->animPaused = 0; + mapObject->mapobj_bit_2 = 1; + mapObject->mapobj_bit_4 = 1; +} -- cgit v1.2.3 From 3a1e42f8f1929d5c74ee931de511d7f481db9756 Mon Sep 17 00:00:00 2001 From: scnorton Date: Wed, 24 May 2017 16:12:44 -0400 Subject: maybe_shadow_1 --- src/field_map_obj.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 7e245410c..f8fd87c64 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -4435,3 +4435,10 @@ void sub_806113C(struct MapObject *mapObject, struct Sprite *sprite, u8 directio mapObject->mapobj_bit_2 = 1; mapObject->mapobj_bit_4 = 1; } + +void maybe_shadow_1(struct MapObject *mapObject, struct Sprite *sprite, u8 direction, u8 a4, u8 a5) +{ + sub_806113C(mapObject, sprite, direction, a4, a5); + sub_805FE28(mapObject, sprite, get_go_image_anim_num(mapObject->mapobj_unk_18)); + DoShadowFieldEffect(mapObject); +} -- cgit v1.2.3 From 7f47c3b8eeece77252c0564c4677e8432caf33ed Mon Sep 17 00:00:00 2001 From: scnorton Date: Wed, 24 May 2017 16:48:48 -0400 Subject: sub_806123C --- src/field_map_obj.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index f8fd87c64..65ef99b3b 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -4417,6 +4417,7 @@ bool8 sub_806111C(struct MapObject *mapObject, struct Sprite *sprite) } extern const s16 gUnknown_08375A34[3]; +extern const s16 gUnknown_08375A3A[3]; void sub_806113C(struct MapObject *mapObject, struct Sprite *sprite, u8 direction, u8 a4, u8 a5) { @@ -4442,3 +4443,29 @@ void maybe_shadow_1(struct MapObject *mapObject, struct Sprite *sprite, u8 direc sub_805FE28(mapObject, sprite, get_go_image_anim_num(mapObject->mapobj_unk_18)); DoShadowFieldEffect(mapObject); } + +u8 sub_806123C(struct MapObject *mapObject, struct Sprite *sprite, u8 (*const callback)(struct Sprite *)) +{ + s16 vSPp4[3]; + s16 x; + s16 y; + u8 retval; + memcpy(vSPp4, gUnknown_08375A3A, sizeof gUnknown_08375A3A); + retval = callback(sprite); + if (retval == 1 && vSPp4[sprite->data4] != 0) + { + x = 0; + y = 0; + sub_8060320(mapObject->placeholder18, &x, &y, vSPp4[sprite->data4], vSPp4[sprite->data4]); + npc_coords_shift(mapObject, mapObject->coords2.x + x, mapObject->coords2.y + y); + mapObject->mapobj_bit_2 = 1; + mapObject->mapobj_bit_4 = 1; + } else if (retval == 0xff) + { + npc_coords_shift_still(mapObject); + mapObject->mapobj_bit_3 = 1; + mapObject->mapobj_bit_5 = 1; + sprite->animPaused = 1; + } + return retval; +} -- cgit v1.2.3 From 0cb48e9bb08b4efd157748d7e2446c12450b9b46 Mon Sep 17 00:00:00 2001 From: scnorton Date: Wed, 24 May 2017 17:10:40 -0400 Subject: A couple more functions in FMO --- src/field_map_obj.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 65ef99b3b..eedb74033 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -4469,3 +4469,68 @@ u8 sub_806123C(struct MapObject *mapObject, struct Sprite *sprite, u8 (*const ca } return retval; } + +u8 sub_8061300(struct MapObject *mapObject, struct Sprite *sprite) +{ + return sub_806123C(mapObject, sprite, sub_8064704); +} + +u8 sub_8061314(struct MapObject *mapObject, struct Sprite *sprite) +{ + return sub_806123C(mapObject, sprite, sub_806478C); +} + +bool8 sub_8061328(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061300(mapObject, sprite) == 0xFF) + { + return TRUE; + } + return FALSE; +} + +bool8 sub_8061340(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061314(mapObject, sprite) == 0xFF) + { + return TRUE; + } + return FALSE; +} + +bool8 sub_8061358(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 retval; + + retval = sub_8061300(mapObject, sprite); + if (retval != 1) + { + if (retval == 0xFF) + { + return TRUE; + } + return FALSE; + } + FieldObjectSetDirection(mapObject, GetOppositeDirection(mapObject->placeholder18)); + sub_805FE64(mapObject, sprite, get_go_image_anim_num(mapObject->mapobj_unk_18)); + return FALSE; +} + +bool8 sub_80613D4(struct MapObject *, struct Sprite *); + +bool8 sub_80613A8(struct MapObject *mapObject, struct Sprite *sprite) +{ + maybe_shadow_1(mapObject, sprite, DIR_SOUTH, 2, 0); + return sub_80613D4(mapObject, sprite); +} + +bool8 sub_80613D4(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} -- cgit v1.2.3 From 82ad1f63c4b0516e2c8e0975c8bfd750480b9e3d Mon Sep 17 00:00:00 2001 From: scnorton Date: Wed, 24 May 2017 17:26:58 -0400 Subject: FMO under 6k lines --- src/field_map_obj.c | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index eedb74033..ddf76fef6 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -4517,6 +4517,9 @@ bool8 sub_8061358(struct MapObject *mapObject, struct Sprite *sprite) } bool8 sub_80613D4(struct MapObject *, struct Sprite *); +bool8 sub_806142C(struct MapObject *, struct Sprite *); +bool8 sub_8061484(struct MapObject *, struct Sprite *); +bool8 sub_80614DC(struct MapObject *, struct Sprite *); bool8 sub_80613A8(struct MapObject *mapObject, struct Sprite *sprite) { @@ -4534,3 +4537,101 @@ bool8 sub_80613D4(struct MapObject *mapObject, struct Sprite *sprite) } return FALSE; } + +bool8 sub_8061400(struct MapObject *mapObject, struct Sprite *sprite) +{ + maybe_shadow_1(mapObject, sprite, DIR_NORTH, 2, 0); + return sub_806142C(mapObject, sprite); +} + +bool8 sub_806142C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8061458(struct MapObject *mapObject, struct Sprite *sprite) +{ + maybe_shadow_1(mapObject, sprite, DIR_WEST, 2, 0); + return sub_8061484(mapObject, sprite); +} + +bool8 sub_8061484(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_80614B0(struct MapObject *mapObject, struct Sprite *sprite) +{ + maybe_shadow_1(mapObject, sprite, DIR_EAST, 2, 0); + return sub_80614DC(mapObject, sprite); +} + +bool8 sub_80614DC(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +void sub_8061508(struct Sprite *sprite, u16 duration) +{ + sprite->data2 = 1; + sprite->data3 = duration; +} + +bool8 sub_8061510(struct MapObject *mapObject, struct Sprite *sprite) +{ + sprite->data3--; + if (!sprite->data3) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_806152C(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8061508(sprite, 1); + return sub_8061510(mapObject, sprite); +} + +bool8 sub_806154C(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8061508(sprite, 2); + return sub_8061510(mapObject, sprite); +} + +bool8 sub_806156C(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8061508(sprite, 4); + return sub_8061510(mapObject, sprite); +} + +bool8 sub_806158C(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8061508(sprite, 8); + return sub_8061510(mapObject, sprite); +} + +bool8 sub_80615AC(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8061508(sprite, 16); + return sub_8061510(mapObject, sprite); +} -- cgit v1.2.3 From 4e3874a3febde4ba5f8c247004b4f84bf098bc9c Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 24 May 2017 20:19:30 -0400 Subject: Swiss cheese to put off these functions for later --- src/field_map_obj.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 74 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index ddf76fef6..ede9b2901 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -3182,9 +3182,79 @@ u8 sub_805F2B4(struct MapObject *mapObject, struct Sprite *sprite) return MoveFieldObjectInNextDirectionInSequence(mapObject, sprite, directions); }; -void sub_805F2FC(struct Sprite *sprite); +fieldmap_object_cb(sub_805F2FC, sub_805F320, gUnknown_08375588); + +u8 mss_npc_reset_oampriv3_1_unk2_unk3(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + if (mapObject->mapobj_unk_21 == 0) + { + mapObject->mapobj_unk_21 = player_get_direction_lower_nybble(); + } + sprite->data1 = 1; + return 1; +} + +extern u8 (*const gUnknown_08375594[])(struct MapObject *, struct Sprite *, u8, u8); + +u8 sub_805F364(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (gMapObjects[gPlayerAvatar.mapObjectId].mapobj_unk_1C == 0xFF || gPlayerAvatar.running1 == 2) + { + return 0; + } + return gUnknown_08375594[player_get_x22()](mapObject, sprite, player_get_direction_upper_nybble(), 0); +} + +u8 sub_805F3C4(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite)) + { + mapObject->mapobj_bit_1 = 0; + sprite->data1 = 1; + } + return 0; +} + +#ifdef NONMATCHING + +u8 sub_805F3EC(struct MapObject *mapObject, struct Sprite *sprite, u8 a2, u8 *a3(u8)) +{ + return 0; +} + +u8 sub_805F3F0(struct MapObject *mapObject, struct Sprite *sprite, u8 a2, u8 *a3(u8)) +{ + int direction; + direction = state_to_direction(gUnknown_0836DC09[mapObject->animPattern], mapObject->mapobj_unk_21, a2); + FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(direction)); + mapObject->mapobj_bit_1 = 1; + sprite->data1 = 2; + return 1; +} + +u8 sub_805F438(struct MapObject *mapObject, struct Sprite *sprite, u8 a2, u8 *a3(u8)) +{ + s16 x; + s16 y; + int direction; + direction = state_to_direction(gUnknown_0836DC09[mapObject->animPattern], mapObject->mapobj_unk_21, a2); + FieldObjectMoveDestCoords(mapObject, direction, &x, &y); + FieldObjectSetRegularAnim(mapObject, sprite, GetGoSpeed0AnimId(direction)); + if (!npc_block_way(mapObject, x, y, direction) || (a3 != NULL && !a3(MapGridGetMetatileBehaviorAt(x, y)))) + { + FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(direction)); + } + mapObject->mapobj_bit_1 = 1; + sprite->data1 = 2; + return 1; +} +#endif + void FieldObjectCB_TreeDisguise(struct Sprite *sprite); void FieldObjectCB_MountainDisguise(struct Sprite *sprite); + +asm(".section .text_fmocb2_c\n"); void sub_805F8E0(struct Sprite *sprite); void FieldObjectCB_Hidden1(struct Sprite *sprite); void sub_805FB20(struct Sprite *sprite); @@ -4082,10 +4152,10 @@ int zffu_offset_calc(u8 a0, u8 a1) } #ifdef NONMATCHING -u8 state_to_direction(u8 a0, u8 a1, u8 a2) +int state_to_direction(u8 a0, u8 a1, u8 a2) { int zffuOffset; - asm_comment("For some reason, r2 is being backed up to r3 and restored ahead of the zffu call.") + asm_comment("For some reason, r2 is being backed up to r3 and restored ahead of the zffu call."); if (a1 == 0 || a2 == 0 || a1 > 4 || a2 > 4) { return 0; @@ -4095,7 +4165,7 @@ u8 state_to_direction(u8 a0, u8 a1, u8 a2) } #else __attribute__((naked)) -u8 state_to_direction(u8 a0, u8 a1, u8 a2) +int state_to_direction(u8 a0, u8 a1, u8 a2) { asm(".syntax unified\n\ push {r4,lr}\n\ -- cgit v1.2.3 From fc8cc3767f0e424fbc590e24852a1ca73f89d9a9 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 25 May 2017 08:46:38 -0400 Subject: A couple more map object callbacks --- src/field_map_obj.c | 93 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 86 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index ede9b2901..1982affac 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -13,6 +13,7 @@ #include "rng.h" #include "sprite.h" #include "field_camera.h" +#include "metatile_behavior.h" extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[36]; @@ -3195,7 +3196,7 @@ u8 mss_npc_reset_oampriv3_1_unk2_unk3(struct MapObject *mapObject, struct Sprite return 1; } -extern u8 (*const gUnknown_08375594[])(struct MapObject *, struct Sprite *, u8, u8); +extern u8 (*const gUnknown_08375594[])(struct MapObject *, struct Sprite *, u8, bool8 (*const)(u8)); u8 sub_805F364(struct MapObject *mapObject, struct Sprite *sprite) { @@ -3203,7 +3204,7 @@ u8 sub_805F364(struct MapObject *mapObject, struct Sprite *sprite) { return 0; } - return gUnknown_08375594[player_get_x22()](mapObject, sprite, player_get_direction_upper_nybble(), 0); + return gUnknown_08375594[player_get_x22()](mapObject, sprite, player_get_direction_upper_nybble(), NULL); } u8 sub_805F3C4(struct MapObject *mapObject, struct Sprite *sprite) @@ -3251,12 +3252,90 @@ u8 sub_805F438(struct MapObject *mapObject, struct Sprite *sprite, u8 a2, u8 *a3 } #endif -void FieldObjectCB_TreeDisguise(struct Sprite *sprite); -void FieldObjectCB_MountainDisguise(struct Sprite *sprite); - asm(".section .text_fmocb2_c\n"); -void sub_805F8E0(struct Sprite *sprite); -void FieldObjectCB_Hidden1(struct Sprite *sprite); + +fieldmap_object_cb(sub_805F8E0, sub_805F904, gUnknown_083755C0); + +u8 mss_08062EA4(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (gMapObjects[gPlayerAvatar.mapObjectId].mapobj_unk_1C == 0xFF || gPlayerAvatar.running1 == 2) + { + return 0; + } + return gUnknown_08375594[player_get_x22()](mapObject, sprite, player_get_direction_upper_nybble(), MetatileBehavior_IsPokeGrass); +} + +u8 sub_805F9F8(struct MapObject *, struct Sprite *); + +void FieldObjectCB_TreeDisguise(struct Sprite *sprite) +{ + struct MapObject *mapObject; + mapObject = &gMapObjects[sprite->data0]; + if (mapObject->mapobj_unk_21 == 0 || (mapObject->mapobj_unk_21 == 1 && sprite->data7 == 0)) + { + FieldObjectGetLocalIdAndMap(mapObject, (u8 *)&gUnknown_0202FF84[0], (u8 *)&gUnknown_0202FF84[1], (u8 *)&gUnknown_0202FF84[2]); + mapObject->mapobj_unk_1A = FieldEffectStart(0x1c); + mapObject->mapobj_unk_21 = 1; + sprite->data7 ++; + } + meta_step(&gMapObjects[sprite->data0], sprite, sub_805F9F8); +} + +u8 sub_805F9F8(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + return 0; +} + +void FieldObjectCB_MountainDisguise(struct Sprite *sprite) +{ + struct MapObject *mapObject; + mapObject = &gMapObjects[sprite->data0]; + if (mapObject->mapobj_unk_21 == 0 || (mapObject->mapobj_unk_21 == 1 && sprite->data7 == 0)) + { + FieldObjectGetLocalIdAndMap(mapObject, (u8 *)&gUnknown_0202FF84[0], (u8 *)&gUnknown_0202FF84[1], (u8 *)&gUnknown_0202FF84[2]); + mapObject->mapobj_unk_1A = FieldEffectStart(0x1d); + mapObject->mapobj_unk_21 = 1; + sprite->data7 ++; + } + meta_step(&gMapObjects[sprite->data0], sprite, sub_805F9F8); +} + +u8 sub_805FAD8(struct MapObject *mapObject, struct Sprite *sprite); +extern u8 (*const gUnknown_083755CC[])(struct MapObject *, struct Sprite *); + +void FieldObjectCB_Hidden1(struct Sprite *sprite) +{ + if (sprite->data7 == 0) + { + gMapObjects[sprite->data0].mapobj_bit_26 = 1; + sprite->subspriteMode = 2; + sprite->oam.priority = 3; + sprite->data7 ++; + } + meta_step(&gMapObjects[sprite->data0], sprite, sub_805FAD8); +} + +u8 sub_805FAD8(struct MapObject *mapObject, struct Sprite *sprite) +{ + return gUnknown_083755CC[sprite->data1](mapObject, sprite); +} + +u8 sub_805FAF8(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + return 0; +} + +u8 sub_805FB04(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite)) + { + sprite->data1 = 0; + } + return 0; +} + void sub_805FB20(struct Sprite *sprite); void sub_805FB90(struct Sprite *sprite); void sub_805FC00(struct Sprite *sprite); -- cgit v1.2.3 From 9ad379c53b64ad7592490f10c324d21064e8863b Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 25 May 2017 10:56:39 -0400 Subject: Finish field map object callbacks (except functions known or predicted not to match) --- src/field_map_obj.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 57 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 1982affac..4fdec1919 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -3336,12 +3336,64 @@ u8 sub_805FB04(struct MapObject *mapObject, struct Sprite *sprite) return 0; } -void sub_805FB20(struct Sprite *sprite); -void sub_805FB90(struct Sprite *sprite); -void sub_805FC00(struct Sprite *sprite); -void sub_805FC70(struct Sprite *sprite); +fieldmap_object_cb(sub_805FB20, sub_805FB44, gUnknown_083755D0); + +u8 sub_805FB64(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + FieldObjectSetRegularAnim(mapObject, sprite, GetStepInPlaceDelay16AnimId(mapObject->mapobj_unk_18)); + sprite->data1 = 1; + return 1; +} + +fieldmap_object_cb(sub_805FB90, sub_805FBB4, gUnknown_083755D8); -asm(".section .text_b\n"); +u8 sub_805FBD4(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + FieldObjectSetRegularAnim(mapObject, sprite, GetStepInPlaceDelay8AnimId(mapObject->mapobj_unk_18)); + sprite->data1 = 1; + return 1; +} + +fieldmap_object_cb(sub_805FC00, sub_805FC24, gUnknown_083755E0); + +u8 sub_805FC44(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + FieldObjectSetRegularAnim(mapObject, sprite, GetStepInPlaceDelay4AnimId(mapObject->mapobj_unk_18)); + sprite->data1 = 1; + return 1; +} + +fieldmap_object_cb(sub_805FC70, sub_805FC94, gUnknown_083755E8); + +u8 sub_805FCB4(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_reset(mapObject, sprite); + FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); + mapObject->mapobj_bit_13 = 1; + sprite->data1 = 1; + return 1; +} + +u8 sub_805FCE8(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectExecRegularAnim(mapObject, sprite)) + { + sprite->data1 = 2; + return 1; + } + return 0; +} + +u8 sub_805FD08(struct MapObject *mapObject, struct Sprite *sprite) +{ + mapObject->mapobj_bit_1 = 0; + return 0; +} + +void sub_805FC70(struct Sprite *sprite); void npc_reset(struct MapObject *mapObject, struct Sprite *sprite) { -- cgit v1.2.3 From f41eba1ffe419c43727732a4aa665c25467e7db2 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 25 May 2017 11:01:50 -0400 Subject: Another group of directional functions --- src/field_map_obj.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 4fdec1919..3d49465da 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -4836,3 +4836,69 @@ bool8 sub_80615AC(struct MapObject *mapObject, struct Sprite *sprite) sub_8061508(sprite, 16); return sub_8061510(mapObject, sprite); } + +bool8 sub_80615EC(struct MapObject *mapObject, struct Sprite *sprite); +bool8 sub_806162C(struct MapObject *mapObject, struct Sprite *sprite); +bool8 sub_806166C(struct MapObject *mapObject, struct Sprite *sprite); +bool8 sub_80616AC(struct MapObject *mapObject, struct Sprite *sprite); + +bool8 sub_80615CC(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_go_anim(mapObject, sprite, DIR_SOUTH, 1); + return sub_80615EC(mapObject, sprite); +} + +bool8 sub_80615EC(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} +bool8 sub_806160C(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_go_anim(mapObject, sprite, DIR_NORTH, 1); + return sub_806162C(mapObject, sprite); +} + +bool8 sub_806162C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} +bool8 sub_806164C(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_go_anim(mapObject, sprite, DIR_WEST, 1); + return sub_806166C(mapObject, sprite); +} + +bool8 sub_806166C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} +bool8 sub_806168C(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_go_anim(mapObject, sprite, DIR_EAST, 1); + return sub_80616AC(mapObject, sprite); +} + +bool8 sub_80616AC(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} -- cgit v1.2.3 From 65ce0eeb8a83c570679a66e768c55cc45991b4ec Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 25 May 2017 11:33:48 -0400 Subject: Another chunk of functions with similar templates --- src/field_map_obj.c | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 3d49465da..f70237c34 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -4902,3 +4902,129 @@ bool8 sub_80616AC(struct MapObject *mapObject, struct Sprite *sprite) } return FALSE; } + +void sub_80616CC(struct MapObject *mapObject, struct Sprite *sprite, u8 direction, u8 animId, u16 duration) +{ + FieldObjectSetDirection(mapObject, direction); + sub_805FE28(mapObject, sprite, animId); + sprite->animPaused = 0; + sprite->data2 = 1; + sprite->data3 = duration; +} + +bool8 sub_8061714(struct MapObject *mapObject, struct Sprite *sprite) +{ + sprite->data3--; + if (sprite->data3 == 0) + { + sprite->data2 = 2; + sprite->animPaused = 1; + return TRUE; + } + return FALSE; +} + +bool8 sub_806173C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sprite->data3 & 1) + { + sprite->animDelayCounter++; + } + return sub_8061714(mapObject, sprite); +} + +bool8 sub_8061778(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80616CC(mapObject, sprite, DIR_SOUTH, get_go_image_anim_num(DIR_SOUTH), 32); + return sub_806173C(mapObject, sprite); +} + +bool8 sub_80617B0(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80616CC(mapObject, sprite, DIR_NORTH, get_go_image_anim_num(DIR_NORTH), 32); + return sub_806173C(mapObject, sprite); +} + +bool8 sub_80617E8(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80616CC(mapObject, sprite, DIR_WEST, get_go_image_anim_num(DIR_WEST), 32); + return sub_806173C(mapObject, sprite); +} + +bool8 sub_8061820(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80616CC(mapObject, sprite, DIR_EAST, get_go_image_anim_num(DIR_EAST), 32); + return sub_806173C(mapObject, sprite); +} + +bool8 sub_8061858(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80616CC(mapObject, sprite, DIR_SOUTH, get_go_image_anim_num(DIR_SOUTH), 16); + return sub_8061714(mapObject, sprite); +} + +bool8 sub_8061890(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80616CC(mapObject, sprite, DIR_NORTH, get_go_image_anim_num(DIR_NORTH), 16); + return sub_8061714(mapObject, sprite); +} + +bool8 sub_80618C8(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80616CC(mapObject, sprite, DIR_WEST, get_go_image_anim_num(DIR_WEST), 16); + return sub_8061714(mapObject, sprite); +} + +bool8 sub_8061900(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80616CC(mapObject, sprite, DIR_EAST, get_go_image_anim_num(DIR_EAST), 16); + return sub_8061714(mapObject, sprite); +} + +bool8 sub_8061938(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80616CC(mapObject, sprite, DIR_SOUTH, get_go_fast_image_anim_num(DIR_SOUTH), 8); + return sub_8061714(mapObject, sprite); +} + +bool8 sub_8061970(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80616CC(mapObject, sprite, DIR_NORTH, get_go_fast_image_anim_num(DIR_NORTH), 8); + return sub_8061714(mapObject, sprite); +} + +bool8 sub_80619A8(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80616CC(mapObject, sprite, DIR_WEST, get_go_fast_image_anim_num(DIR_WEST), 8); + return sub_8061714(mapObject, sprite); +} + +bool8 sub_80619E0(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80616CC(mapObject, sprite, DIR_EAST, get_go_fast_image_anim_num(DIR_EAST), 8); + return sub_8061714(mapObject, sprite); +} + +bool8 sub_8061A18(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80616CC(mapObject, sprite, DIR_SOUTH, get_go_faster_image_anim_num(DIR_SOUTH), 4); + return sub_8061714(mapObject, sprite); +} + +bool8 sub_8061A50(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80616CC(mapObject, sprite, DIR_NORTH, get_go_faster_image_anim_num(DIR_NORTH), 4); + return sub_8061714(mapObject, sprite); +} + +bool8 sub_8061A88(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80616CC(mapObject, sprite, DIR_WEST, get_go_faster_image_anim_num(DIR_WEST), 4); + return sub_8061714(mapObject, sprite); +} + +bool8 sub_8061AC0(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80616CC(mapObject, sprite, DIR_EAST, get_go_faster_image_anim_num(DIR_EAST), 4); + return sub_8061714(mapObject, sprite); +} -- cgit v1.2.3 From ae24650fbd7814f28d50365881ff388ba9b576b6 Mon Sep 17 00:00:00 2001 From: scnorton Date: Thu, 25 May 2017 16:00:29 -0400 Subject: Decompile another group of functions --- src/field_map_obj.c | 668 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 668 insertions(+) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index f70237c34..0aba02e1a 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -14,6 +14,7 @@ #include "sprite.h" #include "field_camera.h" #include "metatile_behavior.h" +#include "map_constants.h" extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[36]; @@ -5028,3 +5029,670 @@ bool8 sub_8061AC0(struct MapObject *mapObject, struct Sprite *sprite) sub_80616CC(mapObject, sprite, DIR_EAST, get_go_faster_image_anim_num(DIR_EAST), 4); return sub_8061714(mapObject, sprite); } + +bool8 sub_8061B18(struct MapObject *, struct Sprite *); + +bool8 sub_8061AF8(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_go_anim(mapObject, sprite, DIR_SOUTH, 2); + return sub_8061B18(mapObject, sprite); +} + +bool8 sub_8061B18(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + + +bool8 sub_8061B58(struct MapObject *, struct Sprite *); + +bool8 sub_8061B38(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_go_anim(mapObject, sprite, DIR_NORTH, 2); + return sub_8061B58(mapObject, sprite); +} + +bool8 sub_8061B58(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + + +bool8 sub_8061B98(struct MapObject *, struct Sprite *); + +bool8 sub_8061B78(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_go_anim(mapObject, sprite, DIR_WEST, 2); + return sub_8061B98(mapObject, sprite); +} + +bool8 sub_8061B98(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + + +bool8 sub_8061BD8(struct MapObject *, struct Sprite *); + +bool8 sub_8061BB8(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_go_anim(mapObject, sprite, DIR_EAST, 2); + return sub_8061BD8(mapObject, sprite); +} + +bool8 sub_8061BD8(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8061C18(struct MapObject *, struct Sprite *); + +bool8 sub_8061BF8(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_go_anim(mapObject, sprite, DIR_SOUTH, 3); + return sub_8061C18(mapObject, sprite); +} + +bool8 sub_8061C18(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8061C58(struct MapObject *, struct Sprite *); + +bool8 sub_8061C38(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_go_anim(mapObject, sprite, DIR_NORTH, 3); + return sub_8061C58(mapObject, sprite); +} + +bool8 sub_8061C58(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + + +bool8 sub_8061C98(struct MapObject *, struct Sprite *); + +bool8 sub_8061C78(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_go_anim(mapObject, sprite, DIR_WEST, 3); + return sub_8061C98(mapObject, sprite); +} + +bool8 sub_8061C98(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + + +bool8 sub_8061CD8(struct MapObject *, struct Sprite *); + +bool8 sub_8061CB8(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_go_anim(mapObject, sprite, DIR_EAST, 3); + return sub_8061CD8(mapObject, sprite); +} + +bool8 sub_8061CD8(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8061D18(struct MapObject *, struct Sprite *); + +bool8 sub_8061CF8(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_go_anim(mapObject, sprite, DIR_SOUTH, 4); + return sub_8061D18(mapObject, sprite); +} + +bool8 sub_8061D18(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8061D58(struct MapObject *, struct Sprite *); + +bool8 sub_8061D38(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_go_anim(mapObject, sprite, DIR_NORTH, 4); + return sub_8061D58(mapObject, sprite); +} + +bool8 sub_8061D58(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + + +bool8 sub_8061D98(struct MapObject *, struct Sprite *); + +bool8 sub_8061D78(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_go_anim(mapObject, sprite, DIR_WEST, 4); + return sub_8061D98(mapObject, sprite); +} + +bool8 sub_8061D98(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + + +bool8 sub_8061DD8(struct MapObject *, struct Sprite *); + +bool8 sub_8061DB8(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_go_anim(mapObject, sprite, DIR_EAST, 4); + return sub_8061DD8(mapObject, sprite); +} + +bool8 sub_8061DD8(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8061E18(struct MapObject *, struct Sprite *); + +bool8 do_run_south_anim(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_run_anim(mapObject, sprite, DIR_SOUTH); + return sub_8061E18(mapObject, sprite); +} + +bool8 sub_8061E18(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8061E58(struct MapObject *, struct Sprite *); + +bool8 do_run_north_anim(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_run_anim(mapObject, sprite, DIR_NORTH); + return sub_8061E58(mapObject, sprite); +} + +bool8 sub_8061E58(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8061E98(struct MapObject *, struct Sprite *); + +bool8 do_run_west_anim(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_run_anim(mapObject, sprite, DIR_WEST); + return sub_8061E98(mapObject, sprite); +} + +bool8 sub_8061E98(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8061ED8(struct MapObject *, struct Sprite *); + +bool8 do_run_east_anim(struct MapObject *mapObject, struct Sprite *sprite) +{ + do_run_anim(mapObject, sprite, DIR_EAST); + return sub_8061ED8(mapObject, sprite); +} + +bool8 sub_8061ED8(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +void npc_set_direction_and_anim__an_proceed(struct MapObject *mapObject, struct Sprite *sprite, u8 direction, u8 animNum) +{ + obj_anim_image_set_and_seek(sprite, animNum, 0); + FieldObjectSetDirection(mapObject, direction); + sprite->data2 = 1; +} + +u8 sub_8061F24(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_set_direction_and_anim__an_proceed(mapObject, sprite, mapObject->placeholder18, sprite->animNum); + return 0; +} + +bool8 sub_8064864(struct Sprite *); + +bool8 sub_8061F3C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8064864(sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +void sub_8061F5C(struct MapObject *mapObject, struct Sprite *sprite, u8 direction) +{ + sub_806113C(mapObject, sprite, direction, 1, 0); + StartSpriteAnim(sprite, sub_805FD88(direction)); +} + +bool8 sub_8061FB0(struct MapObject *, struct Sprite *); + +bool8 sub_8061F90(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8061F5C(mapObject, sprite, DIR_SOUTH); + return sub_8061FB0(mapObject, sprite); +} + +bool8 sub_8061FB0(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061340(mapObject, sprite)) + { + sprite->data2 = 2; + mapObject->mapobj_bit_5 = 0; + return TRUE; + } + return FALSE; +} + +bool8 sub_8061FF8(struct MapObject *, struct Sprite *); + +bool8 sub_8061FD8(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8061F5C(mapObject, sprite, DIR_NORTH); + return sub_8061FF8(mapObject, sprite); +} + +bool8 sub_8061FF8(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061340(mapObject, sprite)) + { + sprite->data2 = 2; + mapObject->mapobj_bit_5 = 0; + return TRUE; + } + return FALSE; +} + +bool8 sub_8062040(struct MapObject *, struct Sprite *); + +bool8 sub_8062020(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8061F5C(mapObject, sprite, DIR_WEST); + return sub_8062040(mapObject, sprite); +} + +bool8 sub_8062040(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061340(mapObject, sprite)) + { + sprite->data2 = 2; + mapObject->mapobj_bit_5 = 0; + return TRUE; + } + return FALSE; +} + +bool8 sub_8062088(struct MapObject *, struct Sprite *); + +bool8 sub_8062068(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8061F5C(mapObject, sprite, DIR_EAST); + return sub_8062088(mapObject, sprite); +} + +bool8 sub_8062088(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061340(mapObject, sprite)) + { + sprite->data2 = 2; + mapObject->mapobj_bit_5 = 0; + return TRUE; + } + return FALSE; +} + +bool8 sub_80620B0(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 objectId; + if (!TryGetFieldObjectIdByLocalIdAndMap(0xFF, MAP_GROUP_PETALBURG_CITY, MAP_ID_PETALBURG_CITY, &objectId)) + { + an_look_any(mapObject, sprite, sub_805FE90(mapObject->coords2.x, mapObject->coords2.y, gMapObjects[objectId].coords2.x, gMapObjects[objectId].coords2.y)); + } + sprite->data2 = 1; + return TRUE; +} + +bool8 sub_806210C(struct MapObject *mapObject, struct Sprite *sprite) +{ + u8 objectId; + if (!TryGetFieldObjectIdByLocalIdAndMap(0xFF, MAP_GROUP_PETALBURG_CITY, MAP_ID_PETALBURG_CITY, &objectId)) + { + an_look_any(mapObject, sprite, GetOppositeDirection(sub_805FE90(mapObject->coords2.x, mapObject->coords2.y, gMapObjects[objectId].coords2.x, gMapObjects[objectId].coords2.y))); + } + sprite->data2 = 1; + return TRUE; +} + +bool8 sub_8062170(struct MapObject *mapObject, struct Sprite *sprite) +{ + mapObject->mapobj_bit_9 = 1; + sprite->data2 = 1; + return TRUE; +} + +bool8 sub_8062180(struct MapObject *mapObject, struct Sprite *sprite) +{ + mapObject->mapobj_bit_9 = 0; + sprite->data2 = 1; + return TRUE; +} + +bool8 sub_80621BC(struct MapObject *mapObject, struct Sprite *sprite); + +bool8 sub_8062190(struct MapObject *mapObject, struct Sprite *sprite) +{ + maybe_shadow_1(mapObject, sprite, DIR_SOUTH, 1, 2); + return sub_80621BC(mapObject, sprite); +} + +bool8 sub_80621BC(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8062214(struct MapObject *mapObject, struct Sprite *sprite); + +bool8 sub_80621E8(struct MapObject *mapObject, struct Sprite *sprite) +{ + maybe_shadow_1(mapObject, sprite, DIR_NORTH, 1, 2); + return sub_8062214(mapObject, sprite); +} + +bool8 sub_8062214(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_806226C(struct MapObject *mapObject, struct Sprite *sprite); + +bool8 sub_8062240(struct MapObject *mapObject, struct Sprite *sprite) +{ + maybe_shadow_1(mapObject, sprite, DIR_WEST, 1, 2); + return sub_806226C(mapObject, sprite); +} + +bool8 sub_806226C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_80622C4(struct MapObject *mapObject, struct Sprite *sprite); + +bool8 sub_8062298(struct MapObject *mapObject, struct Sprite *sprite) +{ + maybe_shadow_1(mapObject, sprite, DIR_EAST, 1, 2); + return sub_80622C4(mapObject, sprite); +} + +bool8 sub_80622C4(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_806231C(struct MapObject *mapObject, struct Sprite *sprite); + +bool8 sub_80622F0(struct MapObject *mapObject, struct Sprite *sprite) +{ + maybe_shadow_1(mapObject, sprite, DIR_SOUTH, 0, 0); + return sub_806231C(mapObject, sprite); +} + +bool8 sub_806231C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8062374(struct MapObject *mapObject, struct Sprite *sprite); + +bool8 sub_8062348(struct MapObject *mapObject, struct Sprite *sprite) +{ + maybe_shadow_1(mapObject, sprite, DIR_NORTH, 0, 0); + return sub_8062374(mapObject, sprite); +} + +bool8 sub_8062374(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_80623CC(struct MapObject *mapObject, struct Sprite *sprite); + +bool8 sub_80623A0(struct MapObject *mapObject, struct Sprite *sprite) +{ + maybe_shadow_1(mapObject, sprite, DIR_WEST, 0, 0); + return sub_80623CC(mapObject, sprite); +} + +bool8 sub_80623CC(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8062424(struct MapObject *mapObject, struct Sprite *sprite); + +bool8 sub_80623F8(struct MapObject *mapObject, struct Sprite *sprite) +{ + maybe_shadow_1(mapObject, sprite, DIR_EAST, 0, 0); + return sub_8062424(mapObject, sprite); +} + +bool8 sub_8062424(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_806247C(struct MapObject *mapObject, struct Sprite *sprite); + +bool8 sub_8062450(struct MapObject *mapObject, struct Sprite *sprite) +{ + maybe_shadow_1(mapObject, sprite, DIR_SOUTH, 0, 2); + return sub_806247C(mapObject, sprite); +} + +bool8 sub_806247C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061358(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_80624D4(struct MapObject *mapObject, struct Sprite *sprite); + +bool8 sub_80624A8(struct MapObject *mapObject, struct Sprite *sprite) +{ + maybe_shadow_1(mapObject, sprite, DIR_NORTH, 0, 2); + return sub_80624D4(mapObject, sprite); +} + +bool8 sub_80624D4(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061358(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_806252C(struct MapObject *mapObject, struct Sprite *sprite); + +bool8 sub_8062500(struct MapObject *mapObject, struct Sprite *sprite) +{ + maybe_shadow_1(mapObject, sprite, DIR_WEST, 0, 2); + return sub_806252C(mapObject, sprite); +} + +bool8 sub_806252C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061358(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8062584(struct MapObject *mapObject, struct Sprite *sprite); + +bool8 sub_8062558(struct MapObject *mapObject, struct Sprite *sprite) +{ + maybe_shadow_1(mapObject, sprite, DIR_EAST, 0, 2); + return sub_8062584(mapObject, sprite); +} + +bool8 sub_8062584(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061358(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + -- cgit v1.2.3 From 1398206bd5feeea5f04fd26e6a9a28a773125cd6 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Mon, 15 May 2017 20:09:04 +0200 Subject: Make credits match German build --- src/credits.c | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/credits.c b/src/credits.c index de1d52361..5af2d1e3c 100644 --- a/src/credits.c +++ b/src/credits.c @@ -70,18 +70,37 @@ enum PAGE_PROGRAMMERS, PAGE_GRAPHIC_DESIGNERS, PAGE_PRODUCT_SUPPORT, + +#if ENGLISH PAGE_ARTWORK, PAGE_TEXT_EDITOR, PAGE_NOA_TESTING, PAGE_BRAILLE_CODE_CHECK_1, PAGE_BRAILLE_CODE_CHECK_2, +#elif GERMAN + PAGE_NOE_TESTING, + PAGE_BRAILLE_CODE_CHECK_1, +#endif + PAGE_SPECIAL_THANKS_4, PAGE_SPECIAL_THANKS_5, PAGE_COUNT }; +#if ENGLISH +#define POKEMON_TILE_COUNT 68 +#define LAST_PAGE (PAGE_TEXT_EDITOR) +#define UNK_DEFINE_45 (0x45) #define UNK_DEFINE_82 (0x82) +#define UNK_DEF_1F3 (499) +#elif GERMAN +#define POKEMON_TILE_COUNT 65 +#define LAST_PAGE (PAGE_NOE_TESTING) +#define UNK_DEFINE_45 (8) +#define UNK_DEFINE_82 (0x8D) +#define UNK_DEF_1F3 (554) +#endif #define COLOR_DARK_GREEN 0x1967 #define COLOR_LIGHT_GREEN 0x328D @@ -125,7 +144,6 @@ enum TDE_TASK_A_ID = 2, }; -#define POKEMON_TILE_COUNT 68 struct Unk201C000 { @@ -746,8 +764,6 @@ static void task_b_81441B8(u8 taskIdB) } } -#define LAST_PAGE (PAGE_TEXT_EDITOR) - static u8 sub_8144454(u8 page, u8 taskIdA) { // Starts with bike + ocean + morning @@ -942,8 +958,6 @@ void task_c_8144664(u8 taskIdC) } } -#define UNK_DEF_1F3 (499) - void task_e_8144934(u8 taskIdE) { s16 taskIdC; @@ -1008,8 +1022,6 @@ void task_e_8144934(u8 taskIdE) } } -#define UNK_DEFINE_45 (0x45) - static void sub_8144A68(u8 data, u8 taskIdA) { switch (data) @@ -1280,12 +1292,19 @@ static void sub_81452D0(u16 arg0, u16 palette) for (pos = 0; pos < 32 * 32; pos++) ((u16 *) (VRAM + arg0))[pos] = baseTile + 1; +#if ENGLISH sub_814524C(gUnknown_0840B83C, 3, 7, arg0, palette); sub_814524C(gUnknown_0840B84B, 7, 7, arg0, palette); sub_814524C(gUnknown_0840B85A, 11, 7, arg0, palette); sub_814524C(gUnknown_0840B85A, 16, 7, arg0, palette); sub_814524C(gUnknown_0840B869, 20, 7, arg0, palette); sub_814524C(gUnknown_0840B878, 24, 7, arg0, palette); +#elif GERMAN + sub_814524C(gUnknown_0840B85A, 7, 7, arg0, palette); + sub_814524C(gUnknown_0840B869, 11, 7, arg0, palette); + sub_814524C(gUnknown_0840B878, 15, 7, arg0, palette); + sub_814524C(gUnknown_0840B85A, 19, 7, arg0, palette); +#endif } static void spritecb_player_8145378(struct Sprite *sprite) -- cgit v1.2.3 From 524b2c20082031c07490070601d22708a8010904 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Mon, 22 May 2017 20:05:20 +0200 Subject: Make berry_tag_screen match German build --- src/berry_tag_screen.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src') diff --git a/src/berry_tag_screen.c b/src/berry_tag_screen.c index f0bcb4f27..394a3691b 100644 --- a/src/berry_tag_screen.c +++ b/src/berry_tag_screen.c @@ -263,30 +263,49 @@ static void sub_8146480(u8 taskid) static void sub_81464E4(void) { const struct Berry *berryInfo; +#ifdef UNITS_IMPERIAL u32 size; s32 sizeMajor; s32 sizeMinor; +#endif +#if GERMAN + u8 buffer[16]; +#endif berryInfo = GetBerryInfo(gScriptItemId + OFFSET_7B + 1); ConvertIntToDecimalStringN(gStringVar1, gScriptItemId - FIRST_BERRY + 1, STR_CONV_MODE_LEADING_ZEROS, 2); MenuPrint(gStringVar1, 12, 4); +#if ENGLISH MenuPrint(berryInfo->name, 14, 4); +#elif GERMAN + StringCopy(buffer, berryInfo->name); + StringAppend(buffer, gOtherText_Berry2); + MenuPrint(buffer, 14, 4); +#endif + MenuPrint(berryInfo->description1, 4, 14); MenuPrint(berryInfo->description2, 4, 16); +#ifdef UNITS_IMPERIAL size = (berryInfo->size * 1000) / 254; if (size % 10 >= 5) size += 10; sizeMinor = (size % 100) / 10; sizeMajor = size / 100; +#endif MenuPrint(gOtherText_Size, 11, 7); if (berryInfo->size != 0) { +#ifdef UNITS_IMPERIAL ConvertIntToDecimalStringN(gStringVar1, sizeMajor, STR_CONV_MODE_LEFT_ALIGN, 2); ConvertIntToDecimalStringN(gStringVar2, sizeMinor, STR_CONV_MODE_LEFT_ALIGN, 2); +#else + ConvertIntToDecimalStringN(gStringVar1, berryInfo->size / 10, STR_CONV_MODE_LEFT_ALIGN, 2); + ConvertIntToDecimalStringN(gStringVar2, berryInfo->size % 10, STR_CONV_MODE_LEFT_ALIGN, 2); +#endif MenuPrint(gContestStatsText_Unknown1, 16, 7); } else -- cgit v1.2.3 From ad0aac31f1d19717ff71c9eab6a404ef546e146f Mon Sep 17 00:00:00 2001 From: scnorton Date: Thu, 25 May 2017 18:39:51 -0400 Subject: A few more functions in asm/field_map_obj.s --- src/field_map_obj.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 0aba02e1a..aa2169677 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -5332,10 +5332,10 @@ void npc_set_direction_and_anim__an_proceed(struct MapObject *mapObject, struct sprite->data2 = 1; } -u8 sub_8061F24(struct MapObject *mapObject, struct Sprite *sprite) +bool8 sub_8061F24(struct MapObject *mapObject, struct Sprite *sprite) { npc_set_direction_and_anim__an_proceed(mapObject, sprite, mapObject->placeholder18, sprite->animNum); - return 0; + return FALSE; } bool8 sub_8064864(struct Sprite *); @@ -5696,3 +5696,56 @@ bool8 sub_8062584(struct MapObject *mapObject, struct Sprite *sprite) return FALSE; } +bool8 sub_80625B0(struct MapObject *mapObject, struct Sprite *sprite) +{ + an_look_any(mapObject, sprite, gUnknown_0836DC09[mapObject->animPattern]); + return TRUE; +} + +bool8 sub_80625C8(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_set_direction_and_anim__an_proceed(mapObject, sprite, DIR_SOUTH, 0x14); + return FALSE; +} + +bool8 sub_80625D8(struct MapObject *mapObject, struct Sprite *sprite) +{ + mapObject->mapobj_bit_25 = 0; + sprite->data2 = 1; + return TRUE; +} + +bool8 sub_80625E8(struct MapObject *mapObject, struct Sprite *sprite) +{ + mapObject->mapobj_bit_25 = 1; + sprite->data2 = 1; + return TRUE; +} + +bool8 sub_80625F8(struct MapObject *mapObject, struct Sprite *sprite) +{ + mapObject->mapobj_bit_12 = 1; + sprite->data2 = 1; + return TRUE; +} + +bool8 sub_8062608(struct MapObject *mapObject, struct Sprite *sprite) +{ + mapObject->mapobj_bit_12 = GetFieldObjectGraphicsInfo(mapObject->graphicsId)->inanimate; + sprite->data2 = 1; + return TRUE; +} + +bool8 sub_8062634(struct MapObject *mapObject, struct Sprite *sprite) +{ + mapObject->mapobj_bit_13 = 1; + sprite->data2 = 1; + return TRUE; +} + +bool8 sub_8062644(struct MapObject *mapObject, struct Sprite *sprite) +{ + mapObject->mapobj_bit_13 = 0; + sprite->data2 = 1; + return TRUE; +} -- cgit v1.2.3 From a349844cf1dd164cb309438b53deff4cf1fc8b0a Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 25 May 2017 21:19:46 -0400 Subject: Another set of fns --- src/field_map_obj.c | 166 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/trainer_see.c | 4 +- 2 files changed, 168 insertions(+), 2 deletions(-) mode change 100644 => 100755 src/trainer_see.c (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index aa2169677..d12e4cfe1 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -15,6 +15,8 @@ #include "field_camera.h" #include "metatile_behavior.h" #include "map_constants.h" +#include "trainer_see.h" +#include "field_effect_helpers.h" extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[36]; @@ -5749,3 +5751,167 @@ bool8 sub_8062644(struct MapObject *mapObject, struct Sprite *sprite) sprite->data2 = 1; return TRUE; } + +bool8 do_exclamation_mark_bubble_1(struct MapObject *mapObject, struct Sprite *sprite) +{ + FieldObjectGetLocalIdAndMap(mapObject, (u8 *)&gUnknown_0202FF84[0], (u8 *)&gUnknown_0202FF84[1], (u8 *)&gUnknown_0202FF84[2]); + FieldEffectStart(0x0); + sprite->data2 = 1; + return TRUE; +} + +bool8 do_exclamation_mark_bubble_2(struct MapObject *mapObject, struct Sprite *sprite) +{ + FieldObjectGetLocalIdAndMap(mapObject, (u8 *)&gUnknown_0202FF84[0], (u8 *)&gUnknown_0202FF84[1], (u8 *)&gUnknown_0202FF84[2]); + FieldEffectStart(0x21); + sprite->data2 = 1; + return TRUE; +} + +bool8 do_heart_bubble(struct MapObject *mapObject, struct Sprite *sprite) +{ + FieldObjectGetLocalIdAndMap(mapObject, (u8 *)&gUnknown_0202FF84[0], (u8 *)&gUnknown_0202FF84[1], (u8 *)&gUnknown_0202FF84[2]); + FieldEffectStart(0x2e); + sprite->data2 = 1; + return TRUE; +} + +bool8 sub_8062704(struct MapObject *, struct Sprite *); + +bool8 sub_80626C0(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (mapObject->animPattern == 0x3F) + { + sub_8084794(mapObject); + return FALSE; + } + else if (mapObject->animPattern != 0x39 && mapObject->animPattern != 0x3A) + { + sprite->data2 = 2; + return TRUE; + } + else + { + sub_812869C(mapObject); + sprite->data2 = 1; + return sub_8062704(mapObject, sprite); + } +} + +bool8 sub_8062704(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_81286C4(mapObject)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8062724(struct MapObject *mapObject, struct Sprite *sprite) +{ + obj_anim_image_set_and_seek(sprite, 1, 0); + sprite->data2 = 1; + return FALSE; +} + +bool8 sub_8062740(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8064864(sprite)) + { + sub_8064820(sprite, 0x20); + sprite->data2 = 2; + } + return FALSE; +} + +bool8 sub_8062764(struct MapObject *mapObject, struct Sprite *sprite) +{ + mapObject->mapobj_bit_13 ^= 1; + if (sub_8064824(sprite)) + { + mapObject->mapobj_bit_13 = 1; + sprite->data2 = 3; + } + return FALSE; +} + +bool8 sub_80627A0(struct MapObject *mapObject, struct Sprite *sprite) +{ + obj_anim_image_set_and_seek(sprite, 1, 0); + sprite->data2 = 1; + return FALSE; +} + +bool8 sub_80627BC(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8064864(sprite)) + { + sub_8064820(sprite, 0x20); + sprite->data2 = 2; + } + return FALSE; +} + +bool8 sub_80627E0(struct MapObject *mapObject, struct Sprite *sprite) +{ + mapObject->mapobj_bit_13 ^= 1; + if (sub_8064824(sprite)) + { + mapObject->mapobj_bit_13 = 1; + sprite->data2 = 3; + } + return FALSE; +} + +bool8 sub_806281C(struct MapObject *mapObject, struct Sprite *sprite) +{ + mapObject->mapobj_bit_26 = 1; + sprite->data2 = 1; + return TRUE; +} + +bool8 sub_806282C(struct MapObject *mapObject, struct Sprite *sprite) +{ + mapObject->mapobj_bit_26 = 0; + sprite->data2 = 1; + return TRUE; +} + +bool8 sub_806283C(struct MapObject *mapObject, struct Sprite *sprite) +{ + sprite->oam.affineMode = 3; + InitSpriteAffineAnim(sprite); + sprite->affineAnimPaused = 1; + sprite->subspriteMode = 0; + return TRUE; +} + +bool8 sub_806286C(struct MapObject *mapObject, struct Sprite *sprite) +{ + FreeOamMatrix(sprite->oam.matrixNum); + sprite->oam.affineMode = 0; + CalcCenterToCornerVec(sprite, sprite->oam.shape, sprite->oam.size, sprite->oam.affineMode); + return TRUE; +} + +bool8 sub_80628D0(struct MapObject *, struct Sprite *); + +bool8 sub_806289C(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8060ED8(mapObject, sprite, DIR_SOUTH); + sprite->affineAnimPaused = 0; + StartSpriteAffineAnimIfDifferent(sprite, 0); + return sub_80628D0(mapObject, sprite); +} + +bool8 sub_80628D0(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (an_walk_any_2(mapObject, sprite)) + { + sprite->affineAnimPaused = 1; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} diff --git a/src/trainer_see.c b/src/trainer_see.c old mode 100644 new mode 100755 index 9d58faab8..6c2bf0ab0 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -373,9 +373,9 @@ void sub_80846E4(u8 taskId) mapObj->mapobj_bit_7 = 0; } -void sub_8084794(u32 var) +void sub_8084794(struct MapObject *var) { - StoreWordInTwoHalfwords(&gTasks[CreateTask(sub_80846E4, 0)].data[1], var); + StoreWordInTwoHalfwords(&gTasks[CreateTask(sub_80846E4, 0)].data[1], (u32)var); } void sub_80847C8(void) -- cgit v1.2.3 From 4d2b22a899c11dfcacfec6889968ab01655a3fe3 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Fri, 26 May 2017 14:53:51 +0200 Subject: Add headers --- src/bard_music.c | 1 - src/battle_2.c | 94 +++----------------------- src/battle_6.c | 3 +- src/battle_811DA74.c | 34 +++------- src/battle_ai.c | 9 +-- src/battle_anim.c | 21 ++---- src/battle_anim_80A7E7C.c | 15 +---- src/battle_anim_81258BC.c | 6 +- src/battle_interface.c | 15 ++--- src/battle_party_menu.c | 44 ++---------- src/battle_records.c | 5 +- src/battle_setup.c | 9 +-- src/berry.c | 4 +- src/berry_tag_screen.c | 4 +- src/bike.c | 2 +- src/birch_pc.c | 1 - src/braille_puzzles.c | 3 +- src/cable_club.c | 13 +--- src/calculate_base_damage.c | 13 ---- src/clear_save_data_menu.c | 2 - src/clock.c | 13 ++-- src/contest_painting.c | 8 +-- src/coord_event_weather.c | 3 +- src/credits.c | 19 +----- src/daycare.c | 2 +- src/decompress.c | 1 - src/decoration.c | 6 +- src/dewford_trend.c | 1 - src/diploma.c | 3 +- src/easy_chat.c | 9 --- src/field_camera.c | 4 +- src/field_control_avatar.c | 30 +++------ src/field_door.c | 2 +- src/field_fadetransition.c | 18 ++--- src/field_ground_effect.c | 20 +----- src/field_map_obj.c | 26 +------- src/field_map_obj_helpers.c | 5 +- src/field_message_box.c | 4 +- src/field_player_avatar.c | 59 ++-------------- src/field_poison.c | 5 +- src/field_region_map.c | 15 +---- src/field_special_scene.c | 7 +- src/field_specials.c | 3 +- src/field_weather.c | 1 - src/fieldmap.c | 25 ++----- src/fldeff_cut.c | 17 ++--- src/fldeff_softboiled.c | 8 +-- src/fldeff_strength.c | 3 +- src/fldeff_sweetscent.c | 2 +- src/fldeff_teleport.c | 9 +-- src/hof_pc.c | 1 - src/intro.c | 14 +--- src/item.c | 3 +- src/item_use.c | 64 +++--------------- src/link.c | 8 ++- src/load_save.c | 1 - src/lottery_corner.c | 1 - src/mail.c | 6 +- src/mail_data.c | 7 +- src/main.c | 3 +- src/main_menu.c | 4 +- src/map_name_popup.c | 3 +- src/map_obj_lock.c | 3 +- src/matsuda_debug_menu.c | 8 +-- src/mauville_old_man.c | 10 +-- src/metatile_behavior.c | 3 +- src/mori_debug_menu.c | 4 +- src/mystery_event_menu.c | 2 +- src/mystery_event_script.c | 3 +- src/name_string_util.c | 1 + src/naming_screen.c | 12 ++-- src/new_game.c | 14 +++- src/palette.c | 1 - src/party_menu.c | 79 +++------------------- src/player_pc.c | 42 ++---------- src/pokedex.c | 19 ++---- src/pokedex_cry_screen.c | 2 +- src/pokemon_1.c | 10 +-- src/pokemon_2.c | 15 ++--- src/pokemon_3.c | 23 ++----- src/pokemon_size_record.c | 4 +- src/pokemon_storage_system.c | 1 + src/pokemon_summary_screen.c | 11 +-- src/pokenav.c | 17 +---- src/post_battle_event_funcs.c | 3 +- src/record_mixing.c | 12 ++-- src/roamer.c | 2 +- src/rom3.c | 37 +++------- src/rom4.c | 23 ++++--- src/rom6.c | 8 +-- src/rom_8077ABC.c | 44 ++---------- src/rom_8094928.c | 11 +-- src/safari_zone.c | 2 +- src/save.c | 1 - src/save_failed_screen.c | 9 +-- src/save_menu_util.c | 2 +- src/scrcmd.c | 20 ++++-- src/script.c | 1 - src/script_menu.c | 5 +- src/script_movement.c | 8 +-- src/script_pokemon_util_80C4BF0.c | 17 ++--- src/script_pokemon_util_80F99CC.c | 22 ++---- src/secret_base.c | 10 +-- src/shop.c | 27 ++------ src/slot_machine.c | 6 +- src/smokescreen.c | 2 +- src/sound.c | 4 +- src/sprite.c | 1 - src/start_menu.c | 7 +- src/starter_choose.c | 2 +- src/strings.c | 2 +- src/time_events.c | 8 +-- src/title_screen.c | 3 +- src/trainer_card.c | 8 ++- src/trainer_see.c | 3 +- src/tv.c | 137 +++++++++----------------------------- src/unknown_debug_menu.c | 4 +- src/util.c | 2 +- src/wallclock.c | 3 +- src/wild_encounter.c | 7 +- 120 files changed, 385 insertions(+), 1103 deletions(-) (limited to 'src') diff --git a/src/bard_music.c b/src/bard_music.c index 43c2923d2..a5514e3f7 100644 --- a/src/bard_music.c +++ b/src/bard_music.c @@ -1,5 +1,4 @@ #include "global.h" -#include "asm.h" struct BardSound { diff --git a/src/battle_2.c b/src/battle_2.c index e5091bd08..93d6f7204 100644 --- a/src/battle_2.c +++ b/src/battle_2.c @@ -1,5 +1,14 @@ +#include "rom3.h" +#include "unknown_task.h" +#include "rom_8077ABC.h" +#include "party_menu.h" +#include "pokedex.h" +#include "item.h" +#include "util.h" +#include "rom_8094928.h" +#include "pokeball.h" +#include "battle_interface.h" #include "global.h" -#include "asm.h" #include "battle.h" #include "data2.h" #include "main.h" @@ -129,8 +138,6 @@ struct UnknownStruct13 extern const u16 gUnknown_08D004E0[]; extern const struct MonCoords gCastformFrontSpriteCoords[]; -extern const struct BaseStats gBaseStats[]; -extern const u32 gBitTable[]; extern u8 ewram[]; #define ewram0 (*(struct UnknownStruct7 *)(ewram + 0x0)) @@ -256,87 +263,6 @@ extern u32 gBattleMoveDamage; extern struct BattlePokemon gBattleMons[]; extern u8 gBattleMoveFlags; -extern void sub_800B858(void); -extern void dp12_8087EA4(void); -extern void sub_80895F8(); -extern void sub_800D6D4(); -extern void sub_800DAB8(); -extern void sub_800E23C(); -extern void setup_poochyena_battle(); -extern void SetWildMonHeldItem(void); -extern void AdjustFriendship(struct Pokemon *, u8); -extern void sub_800DE30(u8); -extern void sub_800B950(void); -extern u8 battle_load_something(); -extern void OpenPartyMenu(); -extern void sub_8089668(); -extern void sub_800D74C(); -extern void sub_804777C(u8); -extern void sub_8043DFC(); -extern u8 CreateInvisibleSpriteWithCallback(void (*)(struct Sprite *)); -extern void dp01_build_cmdbuf_x00_a_b_0(u8 a, u8 b, u8 c); -extern void dp01_build_cmdbuf_x04_4_4_4(u8 a); -extern void dp01_build_cmdbuf_x07_7_7_7(u8 a); -extern void dp01_build_cmdbuf_x12_a_bb(u8 a, u8 b, u16 c); -extern void dp01_build_cmdbuf_x2E_a(u8 a, u8 b); -extern void dp01_build_cmdbuf_x2F_2F_2F_2F(u8 a); -extern void dp01_build_cmdbuf_x30_TODO(u8 a, u8 *b, u8 c); -extern void dp01_battle_side_mark_buffer_for_execution(); -extern u8 sub_8090D90(); -extern void sub_800C704(u8, u8, u8); -extern u8 sub_8018324(); -extern u8 sub_801A02C(); -extern u8 sub_8015DFC(); -extern u8 sub_8016558(); -extern u8 sub_80173A4(); -extern u8 sub_80170DC(); -extern u8 ItemId_GetHoldEffect(u16); -extern void sub_8094C98(); - -void InitBattle(void); -void sub_800EC9C(void); -void sub_800F104(void); -void sub_800F298(void); -void sub_800F808(void); -void sub_800F838(struct Sprite *); -u8 CreateNPCTrainerParty(struct Pokemon *, u16); -void sub_800FCFC(void); -void sub_8010824(void); -void sub_80101B8(void); -void c2_081284E0(void); -void sub_8010278(struct Sprite *); -void sub_80102AC(struct Sprite *); -void nullsub_37(struct Sprite *); -void sub_8010320(struct Sprite *); -void sub_8010494(struct Sprite *); -void sub_801053C(struct Sprite *); -void oac_poke_ally_(struct Sprite *); -void nullsub_86(struct Sprite *); -void objc_dp11b_pingpong(struct Sprite *); -void sub_8010874(void); -void bc_8012FAC(void); -void bc_load_battlefield(void); -void sub_8011384(void); -void bc_801333C(void); -void bc_battle_begin_message(void); -void bc_8013568(void); -void sub_8011800(void); -void sub_8011834(void); -void bc_801362C(void); -void sub_8011970(void); -void sub_80119B4(void); -void sub_8011B00(void); -void sub_8011E8C(void); -void sub_8012324(void); -void sub_8012FBC(u8, u8); -u8 b_first_side(); -void sub_801365C(u8); -void sub_801377C(void); -void sub_80138F0(void); -void b_cancel_multi_turn_move_maybe(u8); -void b_std_message(); -void sub_80156DC(); - void sub_800E7C4(void) { if (gBattleTypeFlags & BATTLE_TYPE_MULTI) diff --git a/src/battle_6.c b/src/battle_6.c index bc540ce72..ad5121d81 100644 --- a/src/battle_6.c +++ b/src/battle_6.c @@ -1,5 +1,6 @@ +#include "battle_message.h" #include "global.h" -#include "asm.h" +#include "battle.h" #include "menu_cursor.h" #include "text.h" diff --git a/src/battle_811DA74.c b/src/battle_811DA74.c index 328b45f49..ccb23ca42 100644 --- a/src/battle_811DA74.c +++ b/src/battle_811DA74.c @@ -1,5 +1,13 @@ +#include "battle.h" +#include "rom_8077ABC.h" +#include "battle_interface.h" +#include "pokeball.h" +#include "task.h" +#include "battle_anim_813F0F4.h" +#include "util.h" +#include "rom3.h" #include "global.h" -#include "asm.h" +#include "battle_811DA74.h" #include "link.h" #include "m4a.h" #include "main.h" @@ -34,7 +42,6 @@ struct UnknownStruct3 u8 ppBonuses; }; -extern u32 gBitTable[]; extern u16 gBattleTypeFlags; extern u8 gUnknown_02023A60[][0x200]; @@ -55,29 +62,6 @@ extern u8 unk_2000000[]; #define EWRAM_17800 ((u8 *)(unk_2000000 + 0x17800)) #define EWRAM_17810 ((struct UnknownStruct2 *)(unk_2000000 + 0x17810)) -extern void nullsub_10(); -extern void sub_8045A5C(); -extern void sub_804777C(); -extern void sub_8043DFC(); -extern s16 sub_8045C78(); -extern void sub_80440EC(); -extern void sub_80324F8(); -extern void nullsub_9(u16); -extern void sub_8043DB0(); -extern void move_anim_start_t4(); -extern void c3_0802FDF4(u8); -extern void sub_8031F88(); -extern void sub_8141828(); -extern void c2_8011A1C(void); -extern void dp01_prepare_buffer_wireless_probably(); -extern void dp01_build_cmdbuf_x1D_1D_numargs_varargs(int, u16, void *); - -void sub_811DA94(void); -void sub_811E0A0(void); -void dp01_tbl3_exec_completed(void); -u32 dp01_getattr_by_ch1_for_player_pokemon(u8 a, u8 *b); -void sub_811EC68(u8); - void nullsub_74(void) { } diff --git a/src/battle_ai.c b/src/battle_ai.c index f10c6a013..18f4108c8 100644 --- a/src/battle_ai.c +++ b/src/battle_ai.c @@ -1,7 +1,8 @@ +#include "util.h" +#include "rom_8077ABC.h" #include "global.h" #include "battle_ai.h" #include "abilities.h" -#include "asm.h" #include "battle.h" #include "battle_move_effects.h" #include "data2.h" @@ -11,10 +12,6 @@ #include "rng.h" #include "species.h" -extern void sub_801CAF8(u8, u8); - -extern void move_effectiveness_something(u16, u8, u8); - extern u16 gBattleTypeFlags; extern u16 gBattleWeather; extern u8 gUnknown_02024A60; @@ -35,9 +32,7 @@ extern struct BattlePokemon gUnknown_02024A8C[]; extern u8 gUnknown_030042E0[]; extern u8 gCritMultiplier; extern u16 gTrainerBattleOpponent; -extern u32 gBitTable[]; extern u8 *BattleAIs[]; -extern struct BaseStats gBaseStats[]; /* gAIScriptPtr is a pointer to the next battle AI cmd command to read. diff --git a/src/battle_anim.c b/src/battle_anim.c index bdb34365f..ee9bc003d 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -1,6 +1,11 @@ +#include "rom_8077ABC.h" +#include "battle_interface.h" +#include "battle_anim_80CA710.h" +#include "contest.h" +#include "main.h" +#include "battle.h" #include "global.h" #include "battle_anim.h" -#include "asm.h" #include "decompress.h" #include "m4a.h" #include "palette.h" @@ -57,20 +62,6 @@ extern const struct SpriteSheet gBattleAnimPicTable[]; extern const struct SpritePalette gBattleAnimPaletteTable[]; extern const struct BattleAnimBackground gBattleAnimBackgroundTable[]; -extern void sub_8079E24(); -extern void sub_8043EB4(); -extern u8 sub_8079E90(); -extern u8 sub_8077ABC(); -extern u8 sub_8078874(u8); -extern void sub_8078914(); -extern u8 sub_80AEB1C(); -extern void sub_80E4EF8(int, int, int, int, u16, u8, int); -extern u8 sub_80789BC(); -extern void sub_80AB2AC(void); -extern void sub_800D7B8(void); -extern u8 obj_id_for_side_relative_to_move(); -extern u8 battle_get_per_side_status_permutated(); - static void RunAnimScriptCommand(void); static void ScriptCmd_loadsprite(void); static void ScriptCmd_unloadsprite(void); diff --git a/src/battle_anim_80A7E7C.c b/src/battle_anim_80A7E7C.c index 285a782f3..ca17dba8f 100644 --- a/src/battle_anim_80A7E7C.c +++ b/src/battle_anim_80A7E7C.c @@ -1,3 +1,4 @@ +#include "rom_8077ABC.h" #include "global.h" #include "battle_anim.h" #include "sprite.h" @@ -15,20 +16,6 @@ extern u16 gUnknown_0202F7BC; extern u8 gBattleAnimPlayerMonIndex; extern u8 gBattleAnimEnemyMonIndex; -extern u8 obj_id_for_side_relative_to_move(u8 side); -extern void DestroyAnimVisualTask(u8 task); -extern u8 battle_get_side_with_given_state(u8 state); -extern u8 battle_side_get_owner(u8 side); -extern void oamt_set_x3A_32(struct Sprite *sprite, void(*callback)(struct Sprite*)); -extern void sub_8078458(struct Sprite *sprite); -extern void move_anim_8072740(struct Sprite *sprite); -extern void sub_8078A5C(struct Sprite *sprite); -extern void sub_80784A8(struct Sprite *sprite); -extern void sub_8078E70(u8 sprite, u8); -extern void obj_id_set_rotscale(u8 sprite, int, int, u16); -extern void sub_8078F40(u8 sprite); -extern void sub_8078F9C(u8 sprite); - static void sub_80A7EF0(u8 task); static void sub_80A808C(u8 task); static void sub_80A81D8(u8 task); diff --git a/src/battle_anim_81258BC.c b/src/battle_anim_81258BC.c index 42a685f4a..57b060174 100644 --- a/src/battle_anim_81258BC.c +++ b/src/battle_anim_81258BC.c @@ -1,5 +1,7 @@ +#include "battle.h" +#include "battle_message.h" #include "global.h" -#include "asm.h" +#include "battle_anim_81258BC.h" #include "text.h" #include "menu_cursor.h" @@ -15,8 +17,6 @@ extern void* gUnknown_03004330[]; extern u16 gUnknown_030042A0; extern u16 gUnknown_030042A4; -void bx_battle_menu_t6_2(void); - #if ENGLISH #define SUB_812BB10_TILE_DATA_OFFSET 440 #elif GERMAN diff --git a/src/battle_interface.c b/src/battle_interface.c index 61a6a5853..b1c0c1497 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -1,5 +1,9 @@ +#include "rom_8077ABC.h" +#include "task.h" +#include "safari_zone.h" +#include "pokedex.h" #include "global.h" -#include "asm.h" +#include "battle_interface.h" #include "sprite.h" #include "string_util.h" #include "text.h" @@ -8,7 +12,6 @@ #include "songs.h" #include "battle.h" #include "palette.h" -#include "battle_interface.h" struct UnknownStruct5 { @@ -50,9 +53,7 @@ extern u8 gUnknown_02024A72[]; extern u8 gUnknown_03004340[]; extern u16 gBattleTypeFlags; -extern u8 gNumSafariBalls; -extern u32 gExperienceTables[8][101]; extern const struct SpriteTemplate gSpriteTemplate_820A4EC[]; extern const struct SpriteTemplate gSpriteTemplate_820A51C[]; extern const struct SpriteTemplate gSpriteTemplate_820A54C; @@ -82,23 +83,17 @@ extern const u8 gUnknown_0820A81C[]; extern const u8 gUnknown_0820A864[]; extern const u8 gUnknown_0820A89C[]; extern const u8 gUnknown_0820A8B0[]; -extern const struct BaseStats gBaseStats[]; extern const u8 BattleText_SafariBalls[]; extern const u8 BattleText_SafariBallsLeft[]; extern const u8 BattleText_HighlightRed[]; extern const u8 gUnknown_08D1216C[][32]; -extern const u8 *const gNatureNames[]; extern const u16 gBattleInterfaceStatusIcons_DynPal[]; #define ABS(n) ((n) >= 0 ? (n) : -(n)) // Used for computing copy destination addresses #define MACRO1(n) ((n) - (n) / 8 * 8) + 64 * ((n) / 8) -extern int sub_8040D3C(); -extern u8 sub_8090D90(); -extern void load_gfxc_health_bar(); - static void sub_8043D5C(struct Sprite *); static const void *sub_8043CDC(u8); static void sub_8044210(u8, s16, u8); diff --git a/src/battle_party_menu.c b/src/battle_party_menu.c index 359517ecd..8be774047 100644 --- a/src/battle_party_menu.c +++ b/src/battle_party_menu.c @@ -1,6 +1,12 @@ +#include "party_menu.h" +#include "rom_8094928.h" +#include "battle.h" +#include "item_menu.h" +#include "rom_8077ABC.h" +#include "menu_helpers.h" +#include "pokemon_summary_screen.h" #include "global.h" #include "battle_party_menu.h" -#include "asm.h" #include "main.h" #include "menu.h" #include "palette.h" @@ -12,42 +18,6 @@ #include "task.h" #include "text.h" -extern u8 IsLinkDoubleBattle(void); -extern void TryCreatePartyMenuMonIcon(u8, u8, struct Pokemon *); -extern void LoadHeldItemIconGraphics(void); -extern void CreateHeldItemIcons_806DC34(); -extern u8 sub_806BD58(u8, u8); -extern void PartyMenuPrintMonsLevelOrStatus(void); -extern void PrintPartyMenuMonNicknames(void); -extern void PartyMenuTryPrintMonsHP(void); -extern void nullsub_13(void); -extern void PartyMenuDrawHPBars(void); -extern u8 sub_806B58C(u8); -extern u8 GetItemEffectType(); -extern void sub_806E750(u8, const struct PartyPopupMenu *, const struct PartyMenuItem *, int); -extern u16 sub_806BD80(); -extern u8 sub_806CA38(); -extern void sub_806D5A4(void); -extern void sub_802E414(void); -extern void sub_8094D60(void); -extern void sub_80A6DCC(void); -extern void sub_806AF4C(); -extern u8 sub_80F9344(void); -extern u8 sub_806B124(void); -extern void sub_806C994(); -extern void sub_806BF74(); -extern void sub_806AEDC(void); -extern TaskFunc PartyMenuGetPopupMenuFunc(u8, const struct PartyPopupMenu *, const struct PartyMenuItem *, u8); -extern void ShowPokemonSummaryScreen(struct Pokemon *, u8, u8, void (*)(u8), int); -extern void sub_806E7D0(u8, const struct PartyPopupMenu *); -extern u8 *sub_8040D08(); -extern u8 sub_8094C20(); -extern void sub_8040B8C(void); -extern u8 pokemon_order_func(u8); -extern void sub_8094C98(u8, u8); -extern void sub_806E6F0(); -extern void sub_806D538(); - extern u16 gScriptItemId; extern u8 gPlayerPartyCount; extern u8 gUnknown_02024A68; diff --git a/src/battle_records.c b/src/battle_records.c index 35fd3284b..cf86787f0 100644 --- a/src/battle_records.c +++ b/src/battle_records.c @@ -1,11 +1,8 @@ #include "global.h" +#include "battle_records.h" #include "menu.h" #include "strings2.h" -void PrintLinkBattleWinsLossesDraws(void *); - -void PrintLinkBattleRecord(void *, u8); - void ShowLinkBattleRecords(void) { s32 i; MenuDrawTextWindow(1, 0, 28, 18); diff --git a/src/battle_setup.c b/src/battle_setup.c index a70157a43..09a1b14e1 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -1,6 +1,10 @@ +#include "fldeff_80C5CD4.h" +#include "battle_transition.h" +#include "fieldmap.h" +#include "secret_base.h" +#include "field_fadetransition.h" #include "global.h" #include "battle_setup.h" -#include "asm.h" #include "battle.h" #include "data2.h" #include "event_data.h" @@ -33,9 +37,6 @@ extern u16 gScriptResult; extern void (*gUnknown_0300485C)(void); -extern struct Pokemon gEnemyParty[]; -extern struct Pokemon gPlayerParty[]; - EWRAM_DATA u16 gTrainerBattleMode = 0; EWRAM_DATA u16 gTrainerBattleOpponent = 0; EWRAM_DATA u16 gTrainerMapObjectLocalId = 0; diff --git a/src/berry.c b/src/berry.c index 257248e5c..470044709 100644 --- a/src/berry.c +++ b/src/berry.c @@ -1,6 +1,8 @@ +#include "field_map_obj.h" +#include "fieldmap.h" +#include "item_menu.h" #include "global.h" #include "berry.h" -#include "asm.h" #include "field_control_avatar.h" #include "item.h" #include "items.h" diff --git a/src/berry_tag_screen.c b/src/berry_tag_screen.c index 394a3691b..39cc7ac70 100644 --- a/src/berry_tag_screen.c +++ b/src/berry_tag_screen.c @@ -1,6 +1,8 @@ +#include "menu_helpers.h" +#include "item_menu.h" +#include "field_map_obj.h" #include "global.h" #include "berry_tag_screen.h" -#include "asm.h" #include "berry.h" #include "decompress.h" #include "items.h" diff --git a/src/bike.c b/src/bike.c index d7175b5e0..ca3b17bb7 100644 --- a/src/bike.c +++ b/src/bike.c @@ -1,6 +1,6 @@ +#include "fieldmap.h" #include "global.h" #include "bike.h" -#include "asm.h" #include "field_map_obj.h" #include "field_player_avatar.h" #include "flags.h" diff --git a/src/birch_pc.c b/src/birch_pc.c index 89eafc0ce..4a83c048f 100644 --- a/src/birch_pc.c +++ b/src/birch_pc.c @@ -1,5 +1,4 @@ #include "global.h" -#include "asm.h" #include "event_data.h" #include "field_message_box.h" #include "pokedex.h" diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c index 2ee4f91bb..f0ef51ac2 100644 --- a/src/braille_puzzles.c +++ b/src/braille_puzzles.c @@ -1,6 +1,7 @@ +#include "fieldmap.h" +#include "main.h" #include "global.h" #include "braille_puzzles.h" -#include "asm.h" #include "event_data.h" #include "field_camera.h" #include "field_effect.h" diff --git a/src/cable_club.c b/src/cable_club.c index 45fb347f3..13ae65322 100644 --- a/src/cable_club.c +++ b/src/cable_club.c @@ -1,5 +1,5 @@ #include "global.h" -#include "asm.h" +#include "cable_club.h" #include "field_message_box.h" #include "link.h" #include "main.h" @@ -20,20 +20,9 @@ extern u8 gFieldLinkPlayerCount; extern u8 gUnknown_081A4932[]; extern const u8 gUnknown_081A4975[]; -void sub_8082D4C(); -void sub_8082D60(u8, u8); -u16 sub_8082D9C(u8, u8); -u32 sub_8082DF4(u8); -u32 sub_8082E28(u8); -u32 sub_8082EB8(u8); -void sub_8082FEC(u8 taskId); static void sub_80830E4(u8 taskId); -void sub_8083188(u8 taskId); static void sub_8083288(u8 taskId); static void sub_8083314(u8 taskId); -void sub_80833C4(u8 taskId); -void sub_8083418(u8 taskId); -u8 sub_8083444(u8 taskId); void sub_808303C(u8 taskId) { s32 linkPlayerCount; diff --git a/src/calculate_base_damage.c b/src/calculate_base_damage.c index 7868a2c67..f3799ab66 100644 --- a/src/calculate_base_damage.c +++ b/src/calculate_base_damage.c @@ -16,9 +16,7 @@ #include "text.h" extern u8 gPlayerPartyCount; -extern struct Pokemon gPlayerParty[6]; extern u8 gEnemyPartyCount; -extern struct Pokemon gEnemyParty[6]; extern u16 unk_20160BC[]; extern struct SecretBaseRecord gSecretBaseRecord; @@ -36,21 +34,10 @@ extern u16 gTrainerBattleOpponent; extern struct PokemonStorage gPokemonStorage; extern u8 gBadEggNickname[]; -extern u32 gBitTable[]; -extern struct BaseStats gBaseStats[]; extern struct SpriteTemplate gSpriteTemplate_8208288[]; -extern u8 gTrainerClassToPicIndex[]; -extern u8 gTrainerClassToNameIndex[]; extern u8 gSecretBaseTrainerClasses[]; -extern u8 gUnknown_08208238[]; -extern u8 gUnknown_0820823C[]; -extern u8 gStatStageRatios[]; extern u8 gHoldEffectToType[][2]; -extern u8 battle_side_get_owner(u8); -extern u8 sub_8018324(u8, u8, u8, u8, u16); -extern u8 sub_803C348(u8); - #define APPLY_STAT_MOD(var, mon, stat, statIndex) \ { \ (var) = (stat) * (gStatStageRatios)[(mon)->statStages[(statIndex)] * 2]; \ diff --git a/src/clear_save_data_menu.c b/src/clear_save_data_menu.c index 690ce3f55..498562fe0 100644 --- a/src/clear_save_data_menu.c +++ b/src/clear_save_data_menu.c @@ -10,8 +10,6 @@ #include "strings2.h" #include "task.h" -extern const struct MenuAction gMenuYesNoItems[]; - static void VBlankCB_ClearSaveDataScreen(void); static void Task_InitMenu(u8); static void Task_ProcessMenuInput(u8); diff --git a/src/clock.c b/src/clock.c index b263e99ae..669e4cf3c 100644 --- a/src/clock.c +++ b/src/clock.c @@ -1,3 +1,8 @@ +#include "dewford_trend.h" +#include "field_weather.h" +#include "tv.h" +#include "time_events.h" +#include "field_specials.h" #include "global.h" #include "clock.h" #include "berry.h" @@ -8,14 +13,6 @@ #include "rtc.h" #include "wallclock.h" -extern void UpdateDewfordTrendPerDay(u16); -extern void UpdateTVShowsPerDay(u16); -extern void UpdateWeatherPerDay(u16); -extern void UpdatePartyPokerusTime(u16); -extern void UpdateMirageRnd(u16); -extern void UpdateBirchState(u16); -extern void SetShoalItemFlag(u16); - static void InitTimeBasedEvents(void); static void UpdatePerDay(struct Time *time); static void UpdatePerMinute(struct Time *time); diff --git a/src/contest_painting.c b/src/contest_painting.c index d7bacb905..3abcf85d1 100644 --- a/src/contest_painting.c +++ b/src/contest_painting.c @@ -1,6 +1,7 @@ +#include "unknown_task.h" +#include "cute_sketch.h" #include "global.h" #include "contest_painting.h" -#include "asm.h" #include "data2.h" #include "decompress.h" #include "main.h" @@ -105,11 +106,6 @@ static void VBlankCB_ContestPainting(void); void sub_8106B90(); //should be static static void sub_8107090(u8 arg0, u8 arg1); -extern void sub_80FC7A0(struct Unk03005E20*); -extern void sub_80FDA18(struct Unk03005E20*); -extern void sub_80FD8CC(struct Unk03005E20*); -extern void *species_and_otid_get_pal(); - __attribute__((naked)) void sub_8106630(u32 arg0) { diff --git a/src/coord_event_weather.c b/src/coord_event_weather.c index f033e5391..719ff05bf 100644 --- a/src/coord_event_weather.c +++ b/src/coord_event_weather.c @@ -1,5 +1,6 @@ +#include "field_weather.h" #include "global.h" -#include "asm.h" +#include "coord_event_weather.h" struct CoordEventWeather { diff --git a/src/credits.c b/src/credits.c index 5af2d1e3c..247a69dbd 100644 --- a/src/credits.c +++ b/src/credits.c @@ -1,5 +1,7 @@ +#include "task.h" +#include "intro_credits_graphics.h" +#include "hall_of_fame.h" #include "global.h" -#include "asm.h" #include "data2.h" #include "decompress.h" #include "event_data.h" @@ -21,8 +23,6 @@ asm(".set OFFSET_REG_BLDALPHA, 0x52"); asm(".set REG_BLDCNT, REG_BASE + OFFSET_REG_BLDCNT"); asm(".set REG_BLDALPHA, REG_BASE + OFFSET_REG_BLDALPHA"); -extern void *species_and_otid_get_pal(u32, u16, u16); - enum { PAGE_TITLE, @@ -187,11 +187,6 @@ extern s16 gUnknown_0203935C; extern u8 gReservedSpritePaletteCount; -// data/starter_choose -extern u16 gBirchBagGrassPal[32]; -extern u8 gBirchGrassTilemap[]; -extern u8 gBirchHelpGfx[]; - // data/hall_of_fame extern void *gUnknown_0840B5A0[]; @@ -211,14 +206,6 @@ extern const union AnimCmd *const gSpriteAnimTable_0840CA54[]; extern const union AnimCmd *const gSpriteAnimTable_0840CA94[]; extern struct SpriteTemplate gSpriteTemplate_840CAEC; -// data/intro_credits_graphics -extern const struct SpriteSheet gIntro2BrendanSpriteSheet; -extern const struct SpriteSheet gIntro2MaySpriteSheet; -extern const struct SpriteSheet gIntro2BicycleSpriteSheet; -extern const struct SpritePalette gIntro2SpritePalettes[]; -extern const struct SpriteSheet gUnknown_08416E24; -extern const struct SpriteSheet gUnknown_08416E34; - // graphics extern u8 gCreditsCopyrightEnd_Gfx[]; extern u16 gIntroCopyright_Pal[16]; diff --git a/src/daycare.c b/src/daycare.c index 92be45cfa..96546f78c 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -1,7 +1,7 @@ #include "global.h" +#include "daycare.h" #include "pokemon.h" #include "string_util.h" -#include "asm.h" extern u8 gLastFieldPokeMenuOpened; diff --git a/src/decompress.c b/src/decompress.c index 37aa1e8d5..1d38447b5 100644 --- a/src/decompress.c +++ b/src/decompress.c @@ -1,6 +1,5 @@ #include "global.h" #include "decompress.h" -#include "asm.h" #include "data2.h" #include "species.h" #include "text.h" diff --git a/src/decoration.c b/src/decoration.c index 279a7568b..da5e4af5b 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -1,5 +1,5 @@ #include "global.h" -#include "asm.h" +#include "decoration.h" #include "menu.h" extern u8 gUnknown_020388F2; @@ -8,10 +8,6 @@ extern u8 gUnknown_020388F4; extern u8 gUnknown_020388F6; extern u8 gUnknown_020388D5; -void sub_80FEC94(u8 arg0); -void sub_80FECB8(u8 arg0); -void sub_80FECE0(u8 arg0); - void sub_80FE7EC(u8 arg0) { sub_8072DEC(); diff --git a/src/dewford_trend.c b/src/dewford_trend.c index e4ce0c0c7..aaf4dd66a 100644 --- a/src/dewford_trend.c +++ b/src/dewford_trend.c @@ -1,6 +1,5 @@ #include "global.h" #include "dewford_trend.h" -#include "asm.h" #include "easy_chat.h" #include "event_data.h" #include "link.h" diff --git a/src/diploma.c b/src/diploma.c index 80adac8f7..a9ea8a262 100644 --- a/src/diploma.c +++ b/src/diploma.c @@ -1,5 +1,6 @@ +#include "unknown_task.h" #include "global.h" -#include "asm.h" +#include "diploma.h" #include "main.h" #include "menu.h" #include "palette.h" diff --git a/src/easy_chat.c b/src/easy_chat.c index b21b00368..26cc50738 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -1,6 +1,5 @@ #include "global.h" #include "easy_chat.h" -#include "asm.h" #include "data2.h" #include "event_data.h" #include "field_message_box.h" @@ -11,17 +10,9 @@ #include "strings2.h" #include "text.h" -u8 sub_80EB37C(u16); -u8 sub_80EB8C0(void); -u8 sub_80EB868(u8); -u16 sub_80EAE88(u8); -void sub_80EB890(u8); -u16 sub_80EB784(u16 group); -u8 sub_80EAD7C(u8 group); static bool8 sub_80EB680(u16 *, u16, u16, u16); static u16 sub_80EB9D8(void); static u16 sub_80EB960(void); -u16 sub_80EB72C(u16); extern void *gEasyChatGroupWords[]; extern const u8 gEasyChatGroupSizes[]; diff --git a/src/field_camera.c b/src/field_camera.c index df5ccc301..163082282 100644 --- a/src/field_camera.c +++ b/src/field_camera.c @@ -1,7 +1,7 @@ +#include "rotating_gate.h" +#include "fieldmap.h" #include "global.h" #include "field_camera.h" -#include "asm.h" -#include "asm_fieldmap.h" #include "berry.h" #include "field_player_avatar.h" #include "sprite.h" diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 8220a144b..60065fe5d 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -1,6 +1,14 @@ +#include "fieldmap.h" +#include "start_menu.h" +#include "item_menu.h" +#include "secret_base.h" +#include "field_fadetransition.h" +#include "coord_event_weather.h" +#include "field_specials.h" +#include "daycare.h" +#include "field_poison.h" #include "global.h" #include "field_control_avatar.h" -#include "asm.h" #include "battle_setup.h" #include "bike.h" #include "event_data.h" @@ -22,7 +30,6 @@ struct Coords32 s32 y; }; -extern const struct Coords32 gUnknown_0821664C[]; extern u16 gScriptLastTalked; extern u16 gScriptFacing; extern struct LinkPlayerMapObject gLinkPlayerMapObjects[]; @@ -82,14 +89,10 @@ static u8 *TryGetFieldMoveScript(struct MapPosition *, u8, u8); static bool32 sub_8068770(void); static bool32 sub_80687A4(void); static bool8 sub_80687E4(struct MapPosition *, u16, u16); -bool8 mapheader_trigger_activate_at__run_now(struct MapPosition *); -bool8 sub_8068870(u16 a); -bool8 sub_8068894(void); static void happiness_algorithm_step(void); static bool8 overworld_poison_step(void); static bool8 is_it_battle_time_3(u16); static bool8 mapheader_run_first_tag2_script_list_match_conditionally(struct MapPosition *, u16, u8); -bool8 sub_8068A64(struct MapPosition *, u16); static bool8 sub_8068B30(u16); static bool8 is_non_stair_warp_tile(u16, u8); static s8 map_warp_check_packed(struct MapHeader *, struct MapPosition *); @@ -98,21 +101,6 @@ static bool8 map_warp_consider_2_to_inside(struct MapPosition *, u16, u8); static s8 map_warp_check(struct MapHeader *, u16, u16, u8); static u8 *mapheader_trigger_activate_at(struct MapHeader *, u16, u16, u8); static struct BgEvent *FindInvisibleMapObjectByPosition(struct MapHeader *, u16, u16, u8); -u8 sub_8068F18(void); - -extern u8 mapheader_run_first_tag2_script_list_match(void); -extern void sub_8071310(void); -extern int sub_80A6D1C(void); -extern u8 sub_80BC050(); -extern u8 sub_80422A0(void); -extern s32 overworld_poison(void); -extern void sub_8080E88(); -extern void walkrun_find_lowest_active_bit_in_bitfield(void); -extern void sub_8080F2C(u8); -extern void sub_8080F48(void); -extern void sub_8080F58(void); -extern void sub_80BC038(); -extern void DoCoordEventWeather(u8); void FieldClearPlayerInput(struct FieldInput *input) { diff --git a/src/field_door.c b/src/field_door.c index fa763a5d6..62ebb9721 100644 --- a/src/field_door.c +++ b/src/field_door.c @@ -1,6 +1,6 @@ +#include "fieldmap.h" #include "global.h" #include "field_door.h" -#include "asm.h" #include "field_camera.h" #include "metatile_behavior.h" #include "task.h" diff --git a/src/field_fadetransition.c b/src/field_fadetransition.c index b5e6c1039..125fc2c62 100644 --- a/src/field_fadetransition.c +++ b/src/field_fadetransition.c @@ -1,25 +1,15 @@ +#include "rom4.h" +#include "fldeff_flash.h" +#include "field_player_avatar.h" #include "global.h" #include "gba/syscall.h" +#include "field_fadetransition.h" #include "field_weather.h" #include "global.fieldmap.h" #include "script.h" #include "task.h" -void palette_bg_fill_white(void); -void palette_bg_fill_black(void); -void pal_fill_black(void); -void task0A_asap_script_env_2_enable_and_set_ctx_running(u8); - -extern u8 get_map_light_from_warp0(void); -extern u8 sav1_map_get_light_level(void); -extern u8 fade_type_for_given_maplight_pair(u8, u8); extern u16 gPlttBufferFaded[]; -extern struct MapHeader * warp1_get_mapheader(void); -extern void sub_8059B88(u8); -extern void sub_8053E90(void); - -extern u8 sub_810CDB8(u8, u8); -extern int sub_8080E70(void); void palette_bg_fill_white(void) { diff --git a/src/field_ground_effect.c b/src/field_ground_effect.c index 1aea8f52e..357ba2df9 100644 --- a/src/field_ground_effect.c +++ b/src/field_ground_effect.c @@ -1,26 +1,10 @@ +#include "fieldmap.h" #include "global.h" -#include "asm_fieldmap.h" +#include "field_ground_effect.h" #include "metatile_behavior.h" extern u32 gUnknown_08376008[]; -void FieldObjectUpdateMetatileBehaviors(struct MapObject *); -void GetGroundEffectFlags_Reflection(struct MapObject *, u32 *); -void GetGroundEffectFlags_TallGrassOnSpawn(struct MapObject *, u32 *); -void GetGroundEffectFlags_TallGrassOnBeginStep(struct MapObject *, u32 *); -void GetGroundEffectFlags_LongGrassOnSpawn(struct MapObject *, u32 *); -void GetGroundEffectFlags_LongGrassOnBeginStep(struct MapObject *, u32 *); -void GetGroundEffectFlags_Tracks(struct MapObject *, u32 *); -void GetGroundEffectFlags_SandPile(struct MapObject *, u32 *); -void GetGroundEffectFlags_ShallowFlowingWater(struct MapObject *, u32 *); -void GetGroundEffectFlags_Puddle(struct MapObject *, u32 *); -void GetGroundEffectFlags_Ripple(struct MapObject *, u32 *); -void GetGroundEffectFlags_ShortGrass(struct MapObject *, u32 *); -void GetGroundEffectFlags_HotSprings(struct MapObject *, u32 *); -void GetGroundEffectFlags_Seaweed(struct MapObject *, u32 *); -void GetGroundEffectFlags_JumpLanding(struct MapObject *, u32 *); -u8 FieldObjectCheckForReflectiveSurface(struct MapObject *); - void GetAllGroundEffectFlags_OnSpawn(struct MapObject *mapObj, u32 *flags) { FieldObjectUpdateMetatileBehaviors(mapObj); diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 8c85e7b6d..1314cbc2c 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -1,8 +1,8 @@ +#include "field_effect_helpers.h" #include "global.h" #include "field_map_obj.h" #include "field_map_obj_helpers.h" #include "fieldmap.h" -#include "asm.h" #include "berry.h" #include "event_data.h" #include "field_player_avatar.h" @@ -16,30 +16,6 @@ extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[36]; - -extern void strange_npc_table_clear(void); -extern void ClearPlayerAvatarInfo(void); -extern void npc_load_two_palettes__no_record(u16, u8); -extern void npc_load_two_palettes__and_record(u16, u8); -extern void sub_8060388(s16, s16, s16 *, s16 *); -extern void sub_80634D0(struct MapObject *, struct Sprite *); -extern void pal_patch_for_npc(u16, u16); -extern void CameraObjectReset1(void); - -void sub_805AAB0(void); -u8 GetFieldObjectIdByLocalId(u8); -u8 GetFieldObjectIdByLocalIdAndMapInternal(u8, u8, u8); -u8 GetAvailableFieldObjectSlot(u16, u8, u8, u8 *); -void FieldObjectHandleDynamicGraphicsId(struct MapObject *); -void RemoveFieldObjectInternal(struct MapObject *); -u16 GetFieldObjectFlagIdByFieldObjectId(u8); -void MakeObjectTemplateFromFieldObjectTemplate(struct MapObjectTemplate *mapObjTemplate, struct SpriteTemplate *sprTemplate, struct SubspriteTable **subspriteTables); -struct MapObjectTemplate *GetFieldObjectTemplateByLocalIdAndMap(u8, u8, u8); -void GetFieldObjectMovingCameraOffset(s16 *, s16 *); -void sub_805BDF8(u16); -u8 sub_805BE58(const struct SpritePalette *); -u8 FindFieldObjectPaletteIndexByTag(u16); - struct PairedPalettes { u16 tag; diff --git a/src/field_map_obj_helpers.c b/src/field_map_obj_helpers.c index afc3c680c..d93b429a0 100644 --- a/src/field_map_obj_helpers.c +++ b/src/field_map_obj_helpers.c @@ -1,6 +1,7 @@ +#include "field_map_obj.h" +#include "field_ground_effect.h" #include "global.h" -#include "asm.h" -#include "asm_fieldmap.h" +#include "field_map_obj_helpers.h" #include "field_effect.h" #include "sprite.h" diff --git a/src/field_message_box.c b/src/field_message_box.c index 798725540..925c13015 100644 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -1,3 +1,4 @@ +#include "menu.h" #include "global.h" #include "field_message_box.h" #include "string_util.h" @@ -6,9 +7,6 @@ #include "text_window.h" extern struct Window gFieldMessageBoxWindow; -extern u16 gMenuTextWindowContentTileOffset; - -extern u16 gMenuTextTileOffset; static u8 sMessageBoxMode; diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 1e1162350..346c29bbb 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -1,7 +1,11 @@ +#include "fieldmap.h" +#include "field_ground_effect.h" +#include "field_effect_helpers.h" +#include "tv.h" +#include "party_menu.h" +#include "rotating_gate.h" #include "global.h" #include "field_player_avatar.h" -#include "asm.h" -#include "asm_fieldmap.h" #include "bike.h" #include "event_data.h" #include "field_effect.h" @@ -29,41 +33,14 @@ static void MovePlayerAvatarUsingKeypadInput(u8 a, u16 b, u16 c); static void PlayerAllowForcedMovementIfMovingSameDirection(void); static u8 TryDoMetatileBehaviorForcedMovement(void); static u8 GetForcedMovementByMetatileBehavior(void); -u8 ForcedMovement_None(void); -u8 ForcedMovement_Slip(void); -u8 sub_8058AAC(void); -u8 sub_8058AC4(void); -u8 sub_8058ADC(void); -u8 sub_8058AF4(void); -u8 sub_8058B0C(void); -u8 sub_8058B24(void); -u8 sub_8058B3C(void); -u8 sub_8058B54(void); -u8 ForcedMovement_SlideSouth(void); -u8 ForcedMovement_SlideNorth(void); -u8 ForcedMovement_SlideWest(void); -u8 ForcedMovement_SlideEast(void); -u8 sub_8058C04(void); -u8 sub_8058C10(void); -u8 ForcedMovement_MuddySlope(void); static void MovePlayerNotOnBike(u8 a, u16 b); static u8 CheckMovementInputNotOnBike(u8 a); -void PlayerNotOnBikeNotMoving(u8 direction, u16 heldKeys); -void PlayerNotOnBikeTurningInPlace(u8 direction, u16 heldKeys); -void sub_8058D0C(u8 direction, u16 heldKeys); static u8 CheckForPlayerAvatarCollision(u8 a); static u8 sub_8058EF0(s16 a, s16 b, u8 c); static bool8 ShouldJumpLedge(s16 a, s16 b, u8 c); static u8 sub_8058F6C(s16 a, s16 b, u8 c); static void check_acro_bike_metatile(int unused1, int unused2, u8 c, u8 *d); static void DoPlayerAvatarTransition(void); -void nullsub_49(struct MapObject *a); -void PlayerAvatarTransition_Normal(struct MapObject *a); -void PlayerAvatarTransition_MachBike(struct MapObject *a); -void PlayerAvatarTransition_AcroBike(struct MapObject *a); -void PlayerAvatarTransition_Surfing(struct MapObject *a); -void PlayerAvatarTransition_Underwater(struct MapObject *a); -void sub_80591F4(struct MapObject *a); static bool8 player_is_anim_in_certain_ranges(void); static bool8 sub_80592A4(void); static bool8 PlayerIsAnimActive(void); @@ -72,32 +49,8 @@ static void PlayerNotOnBikeCollide(u8 a); static void PlayCollisionSoundIfNotFacingWarp(u8 a); static void sub_8059D60(struct MapObject *a); static void StartStrengthAnim(u8 a, u8 b); -u8 sub_8059E84(struct Task *task, struct MapObject *b, struct MapObject *c); -u8 sub_8059EA4(struct Task *task, struct MapObject *b, struct MapObject *c); -u8 sub_8059F40(struct Task *task, struct MapObject *b, struct MapObject *c); static void sub_8059F94(void); -u8 sub_805A000(struct Task *task, struct MapObject *mapObject); static void sub_805A06C(void); -u8 sub_805A0D8(struct Task *task, struct MapObject *mapObject); -u8 sub_805A100(struct Task *task, struct MapObject *mapObject); -u8 sub_805A178(struct Task *task, struct MapObject *mapObject); -u8 sub_805A1B8(struct Task *task, struct MapObject *mapObject); -u8 Fishing1(struct Task *task); -u8 Fishing2(struct Task *task); -u8 Fishing3(struct Task *task); -u8 Fishing4(struct Task *task); -u8 Fishing5(struct Task *task); -u8 Fishing6(struct Task *task); -u8 Fishing7(struct Task *task); -u8 Fishing8(struct Task *task); -u8 Fishing9(struct Task *task); -u8 Fishing10(struct Task *task); -u8 Fishing11(struct Task *task); -u8 Fishing12(struct Task *task); -u8 Fishing13(struct Task *task); -u8 Fishing14(struct Task *task); -u8 Fishing15(struct Task *task); -u8 Fishing16(struct Task *task); static bool8 (*const gUnknown_0830FB58[])(u8) = { diff --git a/src/field_poison.c b/src/field_poison.c index 4d4d4b975..e5edb6f76 100644 --- a/src/field_poison.c +++ b/src/field_poison.c @@ -1,5 +1,7 @@ +#include "pokemon_summary_screen.h" +#include "fldeff_80C5CD4.h" #include "global.h" -#include "asm.h" +#include "field_poison.h" #include "field_message_box.h" #include "pokemon.h" #include "script.h" @@ -7,7 +9,6 @@ #include "task.h" #include "text.h" -extern struct Pokemon gPlayerParty[6]; extern u16 gScriptResult; extern u8 fieldPoisonText_PokemonFainted[]; diff --git a/src/field_region_map.c b/src/field_region_map.c index 66e3d968c..7616a1e27 100644 --- a/src/field_region_map.c +++ b/src/field_region_map.c @@ -1,5 +1,6 @@ +#include "region_map.h" #include "global.h" -#include "asm.h" +#include "field_region_map.h" #include "main.h" #include "menu.h" #include "palette.h" @@ -7,12 +8,6 @@ #include "text.h" #include "strings2.h" -extern void sub_80FA8EC(u32, u8); -extern void sub_80FAB10(void); -extern u8 sub_80FAB60(void); -extern void sub_80FBCF0(u32, u8); -extern void sub_80FBB3C(u16, u16); - struct RegionMapStruct { u8 str[0x16]; @@ -30,12 +25,6 @@ struct UnkStruct extern struct UnkStruct unk_2000000; -void CB2_FieldInitRegionMap(void); -void CB2_FieldRegionMap(void); -void VBlankCB_FieldRegionMap(void); -void sub_813EFDC(void); -void sub_813F0C8(void); - void FieldInitRegionMap(MainCallback callback) { SetVBlankCallback(NULL); diff --git a/src/field_special_scene.c b/src/field_special_scene.c index 9e06ede81..d4ce816fb 100644 --- a/src/field_special_scene.c +++ b/src/field_special_scene.c @@ -1,6 +1,11 @@ +#include "field_map_obj.h" +#include "field_specials.h" +#include "main.h" +#include "script_movement.h" +#include "field_fadetransition.h" +#include "fieldmap.h" #include "global.h" #include "field_special_scene.h" -#include "asm.h" #include "event_data.h" #include "field_camera.h" #include "palette.h" diff --git a/src/field_specials.c b/src/field_specials.c index 9f5a314e2..fda5efdea 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -1,5 +1,6 @@ +#include "diploma.h" #include "global.h" -#include "asm.h" +#include "field_specials.h" #include "event_data.h" #include "field_player_avatar.h" #include "main.h" diff --git a/src/field_weather.c b/src/field_weather.c index ff5d5b507..5ff2eddf9 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -1,6 +1,5 @@ #include "global.h" #include "field_weather.h" -#include "asm.h" #include "palette.h" #include "sprite.h" #include "task.h" diff --git a/src/fieldmap.c b/src/fieldmap.c index 0301115d5..e138a7c57 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -1,3 +1,7 @@ +#include "script.h" +#include "secret_base.h" +#include "rom4.h" +#include "tv.h" #include "global.h" #include "fieldmap.h" #include "palette.h" @@ -9,14 +13,6 @@ struct BackupMapData u16 *map; }; -extern struct MapHeader * const get_mapheader_by_bank_and_number(u8, u8); -extern void mapheader_run_script_with_tag_x1(void); -extern void sub_80BB970(struct MapEvents *); -extern void sub_80BBCCC(); -extern void sub_8056670(); -extern void UpdateTVScreensOnMap(); -extern void sub_80538F0(u8 mapGroup, u8 mapNum); - struct ConnectionFlags { u8 south:1; @@ -31,7 +27,6 @@ struct Coords32 s32 y; }; -extern const struct Coords32 gUnknown_0821664C[]; extern struct BackupMapData gUnknown_03004870; EWRAM_DATA static u16 gUnknown_02029828[0x2800] = {0}; @@ -41,18 +36,6 @@ EWRAM_DATA static struct ConnectionFlags gUnknown_0202E850 = {0}; static const struct ConnectionFlags sDummyConnectionFlags = {0}; -void mapheader_copy_mapdata_with_padding(struct MapHeader *mapHeader); -void sub_80560AC(struct MapHeader *); -void map_copy_with_padding(u16 *map, u16 width, u16 height); -void fillSouthConnection(struct MapHeader *, struct MapHeader *, s32); -void fillNorthConnection(struct MapHeader *, struct MapHeader *, s32); -void fillWestConnection(struct MapHeader *, struct MapHeader *, s32); -void fillEastConnection(struct MapHeader *, struct MapHeader *, s32); -u32 GetBehaviorByMetatileId(u16 metatile); -struct MapConnection *sub_8056A64(u8 direction, int x, int y); -bool8 sub_8056ABC(u8 direction, int x, int y, struct MapConnection *connection); -bool8 sub_8056B20(int x, int src_width, int dest_width, int offset); - struct MapHeader *mapconnection_get_mapheader(struct MapConnection *connection) { return get_mapheader_by_bank_and_number(connection->mapGroup, connection->mapNum); diff --git a/src/fldeff_cut.c b/src/fldeff_cut.c index 8fde74852..aabdde1eb 100644 --- a/src/fldeff_cut.c +++ b/src/fldeff_cut.c @@ -1,5 +1,8 @@ +#include "pokemon_menu.h" +#include "fieldmap.h" +#include "task.h" #include "global.h" -#include "asm.h" +#include "fldeff_cut.h" #include "field_camera.h" #include "field_effect.h" #include "field_player_avatar.h" @@ -28,18 +31,6 @@ extern u32 gUnknown_0202FF84[]; extern u8 UseCutScript; -extern void sub_808AB90(void); // unknown args -extern void sub_805BCC0(s16 x, s16 y); - -void sub_80A2634(void); -void sub_80A25E8(void); -void sub_80A2684(void); -void sub_80A27A8(s16, s16); -void sub_80A28F4(s16, s16); -void objc_8097BBC(struct Sprite *sprite); -void sub_80A2AB8(void); -void sub_80A2B00(void); // unknown args - bool8 SetUpFieldMove_Cut(void) { s16 x, y; diff --git a/src/fldeff_softboiled.c b/src/fldeff_softboiled.c index d0ee712af..8a1a8d3b7 100644 --- a/src/fldeff_softboiled.c +++ b/src/fldeff_softboiled.c @@ -1,5 +1,7 @@ +#include "party_menu.h" +#include "pokemon_menu.h" #include "global.h" -#include "asm.h" +#include "fldeff_softboiled.h" #include "menu.h" #include "pokemon.h" #include "songs.h" @@ -62,10 +64,6 @@ extern u8 gLastFieldPokeMenuOpened; extern u8 unk_2000000[]; extern u8 gUnknown_0202E8F4; -// Public -bool8 SetUpFieldMove_SoftBoiled(void); -void sub_8133D28(u8 taskid); - // Static static void sub_8133D50(u8 taskId); static void sub_8133E74(u8 taskId); diff --git a/src/fldeff_strength.c b/src/fldeff_strength.c index f9db40a67..8381e6f01 100644 --- a/src/fldeff_strength.c +++ b/src/fldeff_strength.c @@ -1,5 +1,6 @@ +#include "pokemon_menu.h" +#include "party_menu.h" #include "global.h" -#include "asm.h" #include "braille_puzzles.h" #include "field_effect.h" #include "pokemon.h" diff --git a/src/fldeff_sweetscent.c b/src/fldeff_sweetscent.c index 4e8214b07..3ce0ac8e9 100644 --- a/src/fldeff_sweetscent.c +++ b/src/fldeff_sweetscent.c @@ -1,5 +1,5 @@ +#include "pokemon_menu.h" #include "global.h" -#include "asm.h" #include "field_effect.h" #include "field_player_avatar.h" #include "palette.h" diff --git a/src/fldeff_teleport.c b/src/fldeff_teleport.c index 0e6933649..489e20193 100644 --- a/src/fldeff_teleport.c +++ b/src/fldeff_teleport.c @@ -1,21 +1,18 @@ +#include "task.h" +#include "pokemon_menu.h" #include "global.h" -#include "asm.h" +#include "fldeff_teleport.h" #include "field_effect.h" #include "field_player_avatar.h" #include "rom4.h" #include "rom6.h" -extern void sub_8087BA8(void); - extern u32 gUnknown_0202FF84[]; extern void (*gUnknown_0300485C)(void); extern u8 gLastFieldPokeMenuOpened; extern void (*gUnknown_03005CE4)(void); -void hm_teleport_run_dp02scr(void); -void sub_814A404(void); - bool8 SetUpFieldMove_Teleport(void) { if (is_light_level_1_2_3_or_6(gMapHeader.mapType) == TRUE) diff --git a/src/hof_pc.c b/src/hof_pc.c index fcbc3f7e1..287fef572 100644 --- a/src/hof_pc.c +++ b/src/hof_pc.c @@ -6,7 +6,6 @@ #include "script_menu.h" #include "task.h" -extern void sub_81428CC(void); extern void (*gUnknown_0300485C)(void); static void ReshowPCMenuAfterHallOfFamePC(void); diff --git a/src/intro.c b/src/intro.c index ba2197ae7..20cb36cd7 100644 --- a/src/intro.c +++ b/src/intro.c @@ -1,7 +1,9 @@ +#include "intro_credits_graphics.h" +#include "unknown_task.h" +#include "hall_of_fame.h" #include "global.h" #include "gba/m4a_internal.h" #include "intro.h" -#include "asm.h" #include "data2.h" #include "decompress.h" #include "libgncmultiboot.h" @@ -19,9 +21,6 @@ #include "title_screen.h" #include "trig.h" -extern void *species_and_otid_get_pal(/*TODO: arg types*/); -extern void sub_8143680(int, u8); - extern struct SpriteTemplate gUnknown_02024E8C; extern u16 gUnknown_02039318; extern u16 gUnknown_0203931A; @@ -33,16 +32,9 @@ extern u16 gSaveFileStatus; extern u8 gReservedSpritePaletteCount; extern const u8 gInterfaceGfx_PokeBall[]; extern const u16 gInterfacePal_PokeBall[]; -extern const struct SpriteSheet gIntro2BrendanSpriteSheet; -extern const struct SpriteSheet gIntro2MaySpriteSheet; -extern const struct SpriteSheet gIntro2BicycleSpriteSheet; -extern const struct SpriteSheet gIntro2LatiosSpriteSheet; -extern const struct SpriteSheet gIntro2LatiasSpriteSheet; -extern const struct SpritePalette gIntro2SpritePalettes[]; extern const u8 gIntroCopyright_Gfx[]; extern const u16 gIntroCopyright_Pal[]; extern const u16 gIntroCopyright_Tilemap[]; -extern const u16 gUnknown_08393E64[]; extern void *const gUnknown_0840B5A0[]; //-------------------------------------------------- diff --git a/src/item.c b/src/item.c index ad2b9aed3..16a11ba8d 100644 --- a/src/item.c +++ b/src/item.c @@ -1,10 +1,9 @@ +#include "berry.h" #include "global.h" #include "item.h" #include "string_util.h" #include "strings.h" -extern struct Berry *GetBerryInfo(u8 berry); - extern u8 gUnknown_02038560; extern struct Item gItems[]; diff --git a/src/item_use.c b/src/item_use.c index d1c1dbf2a..09173cf8e 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -1,5 +1,14 @@ +#include "pokemon_menu.h" +#include "pokeblock.h.h" +#include "item_menu.h" +#include "bike.h" +#include "field_fadetransition.h" +#include "pokemon_item_effect.h" +#include "party_menu.h" +#include "rom_8094928.h" +#include "field_effect.h" #include "global.h" -#include "asm.h" +#include "item_use.h" #include "battle.h" #include "berry.h" #include "coins.h" @@ -40,62 +49,9 @@ extern u8 gUnknown_081A168F[]; extern u16 gUnknown_02024A6A[]; -extern void HandleItemMenuPaletteFade(u8); -extern void ExecuteItemUseFromBlackPalette(void); -extern void DisplayItemMessageOnField(u8, const u8 *, TaskFunc, u16); -extern void CleanUpItemMenuMessage(u8); -extern void CleanUpOverworldMessage(u8); -extern void ItemUseOnFieldCB_Bike(u8); -extern void ItemUseOnFieldCB_Rod(u8); -extern void ItemUseOnFieldCB_Itemfinder(u8); -extern void sub_80A5D04(void); -extern bool8 IsBikingDisallowedByPlayer(void); -extern void GetOnOffBike(u8); -extern struct MapConnection *sub_8056BA0(s16 x, s16 y); // fieldmap.c -extern void sub_810BA7C(u8); -extern void sub_8080E28(void); -extern void UseMedicine(u8); -extern void sub_8070048(u8); -extern void DoPPRecoveryItemEffect(u8); -extern void DoPPUpItemEffect(u8); -extern void DoRareCandyItemEffect(u8); -extern void DoEvolutionStoneItemEffect(u8); -extern u16 ItemIdToBattleMoveId(u16); -extern void sub_80A3FA0(u16 *, u32, u32, u32, u32, u32); -extern void sub_80A3E0C(void); -extern void TeachMonTMMove(u8); -extern void sub_80878A8(void); -extern void sub_8053014(void); -extern void sub_80A7094(u8); -extern bool8 ExecuteTableBasedItemEffect_(struct Pokemon *mon, u16, u8, u16); -extern void sub_8094E4C(void); -extern u8 ExecuteTableBasedItemEffect__(u8 u8, u16 u16, int i); -extern u8 GetItemEffectType(); -extern void sub_808B020(void); -extern void sub_810B96C(void); - extern u16 gScriptItemId; extern u16 gBattleTypeFlags; -bool8 ItemfinderCheckForHiddenItems(struct MapEvents *events, u8 taskId); -void RunItemfinderResults(u8); -void ExitItemfinder(u8); -void sub_80C9720(u8); -void sub_80C9838(u8, s16, s16); -u8 GetPlayerDirectionTowardsHiddenItem(s16, s16); -void SetPlayerDirectionTowardsItem(u8); -void DisplayItemRespondingMessageAndExitItemfinder(u8); -void RotatePlayerAndExitItemfinder(u8); -void sub_80C9D00(u8); -void sub_80C9D74(u8); -void sub_80C9EE4(u8); -void sub_80C9F10(u8); -void sub_80C9F80(u8); -void sub_80C9FC0(u8); -void ItemUseOutOfBattle_TMHM(u8); -void ItemUseOutOfBattle_EvolutionStone(u8); -void ItemUseOutOfBattle_CannotUse(u8); - static const u8 gSSTidalBetaString[] = _("ã“ã®ã€€ãƒã‚±ãƒƒãƒˆã§ã€€ãµã­ã«ã€€ã®ã‚Šã»ã†ã ã„\nã¯ã‚„ã ã®ã£ã¦ã¿ãŸã„ãª"); static const u8 gSSTidalBetaString2[] = _("ã“ã®ã€€ãƒã‚±ãƒƒãƒˆã§ã€€ãµã­ã«ã€€ã®ã‚Šã»ã†ã ã„\nã¯ã‚„ã ã®ã£ã¦ã¿ãŸã„ãª"); diff --git a/src/link.c b/src/link.c index 17e78e0a5..102714c39 100644 --- a/src/link.c +++ b/src/link.c @@ -1,6 +1,6 @@ +#include "berry_blender.h" #include "global.h" #include "link.h" -#include "asm.h" #include "battle.h" #include "main.h" #include "menu.h" @@ -75,6 +75,12 @@ static void sub_80083E0(void); static void sub_8008454(void); static void sub_80084C8(void); static void sub_80084F4(void); + +extern void *species_and_otid_get_pal(/*TODO: arg types*/); +extern void sub_8143680(int, u8); +extern void sub_81428CC(void); + +extern struct Berry *GetBerryInfo(u8 berry); static void CheckErrorStatus(void); static void CB2_PrintErrorMessage(void); static u8 IsSioMultiMaster(void); diff --git a/src/load_save.c b/src/load_save.c index 0add1b0e3..0630f060c 100644 --- a/src/load_save.c +++ b/src/load_save.c @@ -1,7 +1,6 @@ #include "global.h" #include "gba/flash_internal.h" #include "load_save.h" -#include "asm.h" #include "main.h" #include "pokemon.h" #include "rom4.h" diff --git a/src/lottery_corner.c b/src/lottery_corner.c index 66e1238ef..c2c25b9ac 100644 --- a/src/lottery_corner.c +++ b/src/lottery_corner.c @@ -9,7 +9,6 @@ extern u16 gScriptResult; extern u16 gSpecialVar_0x8004; -extern struct Pokemon gPlayerParty[6]; extern struct PokemonStorage gPokemonStorage; extern u16 gSpecialVar_0x8005; extern u16 gSpecialVar_0x8006; diff --git a/src/mail.c b/src/mail.c index 4ec107011..1f19bf230 100644 --- a/src/mail.c +++ b/src/mail.c @@ -1,6 +1,10 @@ +#include "easy_chat.h" +#include "mail_data.h" +#include "pokemon_icon.h" +#include "menu_helpers.h" +#include "unknown_task.h" #include "global.h" #include "mail.h" -#include "asm.h" #include "items.h" #include "menu.h" #include "name_string_util.h" diff --git a/src/mail_data.c b/src/mail_data.c index 23d22e21f..9deb9f685 100644 --- a/src/mail_data.c +++ b/src/mail_data.c @@ -1,15 +1,12 @@ +#include "pokemon_icon.h" #include "global.h" +#include "mail_data.h" #include "items.h" #include "name_string_util.h" #include "pokemon.h" #include "species.h" #include "text.h" -void ClearMailStruct(struct MailStruct *); -u16 SpeciesToMailSpecies(u16, u32); -bool8 ItemIsMail(u16); -u16 GetUnownLetterByPersonality(u32); - void ClearMailData(void) { u8 i; diff --git a/src/main.c b/src/main.c index 19891459c..9d4a3a1ed 100644 --- a/src/main.c +++ b/src/main.c @@ -1,8 +1,9 @@ +#include "rom3.h" +#include "unknown_task.h" #include "global.h" #include "gba/flash_internal.h" #include "gba/m4a_internal.h" #include "main.h" -#include "asm.h" #include "intro.h" #include "link.h" #include "load_save.h" diff --git a/src/main_menu.c b/src/main_menu.c index b2d08698b..1a9ed9dd9 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -1,6 +1,8 @@ +#include "unknown_task.h" +#include "field_effect.h" +#include "pokeball.h" #include "global.h" #include "main_menu.h" -#include "asm.h" #include "data2.h" #include "decompress.h" #include "event_data.h" diff --git a/src/map_name_popup.c b/src/map_name_popup.c index c10a3f9de..e47b89d07 100644 --- a/src/map_name_popup.c +++ b/src/map_name_popup.c @@ -1,5 +1,6 @@ +#include "region_map.h" #include "global.h" -#include "asm.h" +#include "map_name_popup.h" #include "event_data.h" #include "menu.h" #include "task.h" diff --git a/src/map_obj_lock.c b/src/map_obj_lock.c index 713ca03f9..1aeb248ee 100644 --- a/src/map_obj_lock.c +++ b/src/map_obj_lock.c @@ -1,6 +1,7 @@ +#include "field_map_obj.h" +#include "script_movement.h" #include "global.h" #include "map_obj_lock.h" -#include "asm.h" #include "field_map_obj_helpers.h" #include "field_player_avatar.h" #include "task.h" diff --git a/src/matsuda_debug_menu.c b/src/matsuda_debug_menu.c index 018e36567..a9a6079a1 100644 --- a/src/matsuda_debug_menu.c +++ b/src/matsuda_debug_menu.c @@ -1,6 +1,8 @@ +#include "contest_link_80C2020.h" +#include "contest_link_80C857C.h" +#include "unknown_task.h" #include "global.h" #include "matsuda_debug_menu.h" -#include "asm.h" #include "contest.h" #include "data2.h" #include "link.h" @@ -27,8 +29,6 @@ extern u8 gContestPlayerMonIndex; extern u16 gScriptContestCategory; extern u16 gScriptContestRank; -extern struct Window gMenuWindow; - extern u16 gUnknown_030042A4; extern u16 gUnknown_030042A0; extern u16 gUnknown_030042C0; @@ -84,8 +84,6 @@ static void sub_80AA10C(void); static void sub_80AA5BC(u8); static void sub_80AA614(u8, u8); static void sub_80AAD08(struct Sprite *, s8); -extern void sub_80AB47C(void); -extern int sub_80B2A7C(u8); //Don't know return type size u8 unref_sub_80A9B28(void) { diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index d6fb33917..d5d2ae3a9 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -1,5 +1,7 @@ +#include "easy_chat.h" +#include "trader.h" #include "global.h" -#include "asm.h" +#include "mauville_old_man.h" #include "menu.h" #include "rng.h" #include "script.h" @@ -9,12 +11,6 @@ extern u16 gScriptResult; extern u16 gSpecialVar_0x8004; -extern void sub_80F83F8(void); -extern void sub_81099CC(void); -extern void sub_80F83D0(void); -extern void sub_80F7F80(u8); -extern u16 sub_80EB8EC(void); -extern void sub_80F7DC0(void); extern u32 gUnknown_083E5388[]; extern u32 gUnknown_083E53A8[]; diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index befd6f20d..d05ba0b89 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -1,4 +1,5 @@ #include "global.h" +#include "metatile_behavior.h" #include "metatile_behaviors.h" #define TILE_ATTRIBUTES(three, two, one) (((one) ? 1 : 0) | ((two) ? 2 : 0) | ((three) ? 4 : 0)) @@ -247,8 +248,6 @@ static const u8 sTileBitAttributes[] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE) }; -bool8 MetatileBehavior_IsWaterfall(u8); - // only used as default case for checking jump landing in field_ground_effect. bool8 MetatileBehavior_IsATile(u8 var) { diff --git a/src/mori_debug_menu.c b/src/mori_debug_menu.c index 18c65b7e6..50a090026 100644 --- a/src/mori_debug_menu.c +++ b/src/mori_debug_menu.c @@ -1,6 +1,8 @@ +#include "daycare.h" +#include "pokeblock.h.h" +#include "learn_move.h" #include "global.h" #include "mori_debug_menu.h" -#include "asm.h" #include "data2.h" #include "link.h" #include "main.h" diff --git a/src/mystery_event_menu.c b/src/mystery_event_menu.c index 77c959b07..8254bbbec 100644 --- a/src/mystery_event_menu.c +++ b/src/mystery_event_menu.c @@ -1,6 +1,6 @@ +#include "mystery_event_script.h" #include "global.h" #include "mystery_event_menu.h" -#include "asm.h" #include "link.h" #include "main.h" #include "menu.h" diff --git a/src/mystery_event_script.c b/src/mystery_event_script.c index 515a0722f..e3d533d28 100644 --- a/src/mystery_event_script.c +++ b/src/mystery_event_script.c @@ -1,4 +1,5 @@ #include "global.h" +#include "mystery_event_script.h" #include "script.h" #include "string_util.h" #include "text.h" @@ -16,8 +17,6 @@ extern ScrCmdFunc gScriptFuncs_End[]; extern u8 gOtherText_DataCannotUseVersion[]; -void sub_8126160(u32 val); - bool32 sub_8126098(u16 a1, u32 a2, u16 a3, u32 a4) { if (!(a1 & 0x2)) diff --git a/src/name_string_util.c b/src/name_string_util.c index a1812d5e9..f1a935453 100644 --- a/src/name_string_util.c +++ b/src/name_string_util.c @@ -1,4 +1,5 @@ #include "global.h" +#include "name_string_util.h" #include "string_util.h" #include "text.h" diff --git a/src/naming_screen.c b/src/naming_screen.c index 53ee5ff19..65e55e284 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -1,6 +1,10 @@ +#include "util.h" +#include "field_player_avatar.h" +#include "field_map_obj.h" +#include "pokemon_icon.h" +#include "field_effect.h" #include "global.h" #include "naming_screen.h" -#include "asm.h" #include "data2.h" #include "main.h" #include "menu.h" @@ -14,11 +18,6 @@ #include "text.h" #include "trig.h" -extern u8 GetRivalAvatarGraphicsIdByStateIdAndGender(u8, u8); -extern u8 CreateMonIcon(); -extern void sub_809D51C(void); -extern void MultiplyInvertedPaletteRGBComponents(u16, u8, u8, u8); - extern u16 gKeyRepeatStartDelay; extern u8 unk_2000000[]; @@ -51,7 +50,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 u16 gMenuMessageBoxContentTileOffset; extern const u16 gNamingScreenPalettes[]; extern const u16 gUnknown_083CE748[]; extern const u16 gUnknown_083CEBF8[]; diff --git a/src/new_game.c b/src/new_game.c index 12e04a4ef..a1f949fdd 100644 --- a/src/new_game.c +++ b/src/new_game.c @@ -1,6 +1,18 @@ +#include "item_menu.h" +#include "mail_data.h" +#include "tv.h" +#include "secret_base.h" +#include "contest.h" +#include "battle_records.h" +#include "pokemon_storage_system.h" +#include "player_pc.h" +#include "decoration_inventory.h" +#include "pokeblock.h.h" +#include "mauville_old_man.h" +#include "easy_chat.h" +#include "field_specials.h" #include "global.h" #include "new_game.h" -#include "asm.h" #include "berry.h" #include "dewford_trend.h" #include "event_data.h" diff --git a/src/palette.c b/src/palette.c index 165eb2eae..c5e2b9202 100644 --- a/src/palette.c +++ b/src/palette.c @@ -1,6 +1,5 @@ #include "global.h" #include "palette.h" -#include "asm.h" #include "blend_palette.h" #include "decompress.h" diff --git a/src/party_menu.c b/src/party_menu.c index ee6bcf2a9..549a2a45a 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -1,5 +1,13 @@ +#include "mail_data.h" +#include "pokemon_summary_screen.h" +#include "pokemon_menu.h" +#include "rom_8077ABC.h" +#include "battle.h" +#include "battle_party_menu.h" +#include "rom_8094928.h" +#include "pokemon_item_effect.h" #include "global.h" -#include "asm.h" +#include "party_menu.h" #include "data2.h" #include "menu.h" #include "pokemon.h" @@ -88,75 +96,6 @@ extern const u16 gUnknown_08376504[]; extern void (*const gUnknown_08376B54[])(u8); extern const u8 *const gUnknown_08376D04[DATA_COUNT]; extern const struct UnknownStruct5 gUnknown_08376BB4[][6]; -extern const u8 *const gItemEffectTable[]; - -extern bool8 IsDoubleBattle(void); -extern void SetUpBattlePokemonMenu(u8); -extern void sub_808B0C0(u8); -extern u8 GiveMailToMon(struct Pokemon *, u16); -extern bool8 ItemIsMail(u16); -extern void ClearMailStruct(struct MailStruct *); -extern u8 GiveMailToMon2(struct Pokemon *, struct MailStruct *); -extern void TakeMailFromMon(struct Pokemon *); -extern u8 TakeMailFromMon2(struct Pokemon *); -extern u32 CanMonLearnTMHM(struct Pokemon *, u8); -extern void sub_809D9F0(struct Pokemon *, u8, u8, void *, u32); -extern void sub_808B564(); -extern u8 sub_809FA30(void); -extern void sub_808B508(u8); -extern void sub_8032638(); -extern u8 sub_8094C20(); -extern bool8 ExecuteTableBasedItemEffect_(); -extern u8 GetMonStatusAndPokerus(); - -u8 sub_806CA38(u8); -void task_pc_turn_off(); -static void sub_806E884(u8 taskId); -void sub_806F8AC(u8 taskId); -void sub_806FB0C(u8 taskId); -void PartyMenuUpdateLevelOrStatus(struct Pokemon *, u8); -bool8 ExecuteTableBasedItemEffect__(u8, u16, u8); -void sub_80701DC(u8 taskId); -void DoRecoverPP(u8); -void Task_RareCandy1(u8); -void Task_RareCandy2(u8); -void Task_RareCandy3(u8); -void sub_806D538(); -void sub_806D5A4(void); -void sub_806E8D0(u8 taskId, u16 b, TaskFunc c); -void GetMedicineItemEffectMessage(u16); -void sub_8070A20(); -void sub_8070848(u8 taskId); -void sub_8070968(); -void party_menu_link_mon_held_item_object(u8); -void Task_ConfirmGiveHeldItem(u8); -void DisplayGiveHeldItemMessage(u8, u16, u8); -void SetHeldItemIconVisibility(); -void DisplayTakeHeldItemMessage(u8, u16, u8); -void Task_ConfirmTakeHeldMail(u8); -void Task_TeamMonTMMove(u8); -void Task_TeamMonTMMove2(u8); -void Task_TeamMonTMMove3(u8); -void Task_TeamMonTMMove4(u8); -void sub_806F358(u8); -void sub_806F390(u8); -void sub_806F44C(u8); -void TMMoveUpdateMoveSlot(u8); -void StopTryingToTeachMove_806F614(u8); -void StopTryingToTeachMove_806F67C(u8); -void StopTryingToTeachMove_806F6B4(u8); -void sub_806FB44(u8); -void sub_8070C54(); -void SetMonIconAnim(); -u8 GetMonIconSpriteId_maybe(); -void PartyMenuDoPrintHP(u8, int, u16, u16); -void PartyMenuClearLevelStatusTilemap(); -void PartyMenuPrintMonLevelOrStatus(); -u8 GetItemEffectType(); -bool8 IsBlueYellowRedFlute(u16); -void TryPrintPartyMenuMonNickname(); -void sub_8070088(u8); - /* void sub_806AEDC(void) diff --git a/src/player_pc.c b/src/player_pc.c index c012afb02..95ce07b2c 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -1,5 +1,8 @@ +#include "item_menu.h" +#include "field_fadetransition.h" +#include "decoration.h" #include "global.h" -#include "asm.h" +#include "player_pc.h" #include "field_weather.h" #include "item.h" #include "items.h" @@ -22,25 +25,6 @@ enum QUANTITY, }; -extern void DisplayItemMessageOnField(u8, const u8*, TaskFunc, u16); -extern void DoPlayerPCDecoration(u8); -extern void BuyMenuFreeMemory(void); -extern void DestroyVerticalScrollIndicator(u8); -extern u8 sub_813AF3C(void); -extern void sub_813AF78(void); -extern void sub_813B108(u8); -extern void sub_813B174(u8); -extern void sub_80A6A30(void); -extern u8 sub_807D770(void); -extern void sub_813AE6C(u8, u8); -extern void sub_813AD58(u16); -extern void sub_813AE0C(u8); -extern void sub_80F996C(u8); -extern void sub_80A418C(u16, enum StringConvertMode, int, int, int); -extern void sub_80F98DC(int); -extern void sub_80A4164(u8 *, u16, enum StringConvertMode, u8); -extern void CreateVerticalScrollIndicators(u32, u32, u32); // unknown args - extern u16 gNewGamePCItems[]; extern u8 *gUnknown_02039314; @@ -64,24 +48,6 @@ extern u32 gUnknown_08406288[]; extern const struct MenuAction gUnknown_084062C0[]; extern const struct YesNoFuncTable gUnknown_084062E0; -void InitPlayerPCMenu(u8 taskId); -void PlayerPCProcessMenuInput(u8 taskId); -void InitItemStorageMenu(u8); -void ItemStorageMenuPrint(u8 *); -void ItemStorageMenuProcessInput(u8); -void sub_813A280(u8); -void sub_813A240(u8); -void sub_813A4B4(u8); -void sub_813A468(u8); -void HandleQuantityRolling(u8); -void sub_813A6FC(u8); -void sub_813A794(u8); -void sub_813A8F0(u8); -void sub_813A984(u8); -void sub_813A9EC(u8); -void sub_813AA30(u8, u8); -void sub_813ABE8(u8); - void NewGameInitPCItems(void) { u8 i; diff --git a/src/pokedex.c b/src/pokedex.c index 97bac3390..89dcd293b 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -1,7 +1,8 @@ + +#include "unknown_task.h" #include "global.h" #include "gba/m4a_internal.h" #include "pokedex.h" -#include "asm.h" #include "decompress.h" #include "event_data.h" #include "m4a.h" @@ -15,6 +16,9 @@ #include "strings.h" #include "task.h" #include "trig.h" +#include "rom4.h" +#include "pokedex_cry_screen.h" +#include "pokedex_area_screen.h" // I'm #define-ing these just for now so I can keep using the old unkXXX member names #define unk60E selectedPokemon @@ -92,23 +96,10 @@ extern u8 gUnknown_08E96B58[]; extern struct PokedexEntry gPokedexEntries[]; -extern void m4aMPlayVolumeControl(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u16 volume); -extern bool8 BeginNormalPaletteFade(u32, s8, u8, u8, u16); -extern void remove_some_task(void); -extern u8 sub_8091E3C(void); -extern void DisableNationalPokedex(void); -extern void sub_805469C(void); -extern u16 HoennToNationalOrder(u16); -extern u16 NationalToHoennOrder(u16); extern u16 gPokedexOrder_Alphabetical[]; extern u16 gPokedexOrder_Weight[]; extern u16 gPokedexOrder_Height[]; -u16 NationalPokedexNumToSpecies(u16); - -// asm/pokedex_area_screen -void ShowPokedexAreaScreen(u16 species, u8 *string); - void ResetPokedex(void) { u16 i; diff --git a/src/pokedex_cry_screen.c b/src/pokedex_cry_screen.c index 53807befc..92fd832fc 100644 --- a/src/pokedex_cry_screen.c +++ b/src/pokedex_cry_screen.c @@ -1,5 +1,5 @@ #include "global.h" -#include "asm.h" +#include "pokedex_cry_screen.h" #include "palette.h" #include "sprite.h" diff --git a/src/pokemon_1.c b/src/pokemon_1.c index dacbb81c3..a8e5dfa32 100644 --- a/src/pokemon_1.c +++ b/src/pokemon_1.c @@ -1,9 +1,8 @@ #include "global.h" -#include "asm.h" +#include "pokemon.h" #include "data2.h" #include "items.h" #include "main.h" -#include "pokemon.h" #include "rng.h" #include "rom4.h" #include "species.h" @@ -17,17 +16,10 @@ //Extracts the lower 16 bits of a 32-bit number #define LOHALF(n) ((n) & 0xFFFF) -extern struct Pokemon gPlayerParty[6]; // 0x3004360 -extern struct Pokemon gEnemyParty[6]; // 0x30045C0 - extern u8 unk_2000000[]; extern u16 word_2024E82; extern u8 byte_2024E88; -extern u32 gExperienceTables[8][101]; -extern struct BaseStats gBaseStats[]; -extern const u16 *gLevelUpLearnsets[]; - void ZeroBoxMonData(struct BoxPokemon *boxMon) { u8 *raw = (u8 *)boxMon; diff --git a/src/pokemon_2.c b/src/pokemon_2.c index 7fbfc1271..cab68b07e 100644 --- a/src/pokemon_2.c +++ b/src/pokemon_2.c @@ -1,9 +1,11 @@ +#include "rom_8077ABC.h" +#include "util.h" +#include "battle.h" #include "global.h" -#include "asm.h" +#include "pokemon.h" #include "data2.h" #include "event_data.h" #include "main.h" -#include "pokemon.h" #include "rng.h" #include "species.h" #include "sprite.h" @@ -12,9 +14,7 @@ #include "strings2.h" extern u8 gPlayerPartyCount; -extern struct Pokemon gPlayerParty[6]; extern u8 gEnemyPartyCount; -extern struct Pokemon gEnemyParty[6]; extern u16 unk_20160BC[]; extern struct SecretBaseRecord gSecretBaseRecord; @@ -36,16 +36,9 @@ extern u16 gTrainerBattleOpponent; extern struct PokemonStorage gPokemonStorage; extern u8 gBadEggNickname[]; -extern u32 gBitTable[]; -extern struct BaseStats gBaseStats[]; extern const struct SpriteTemplate gSpriteTemplate_8208288[]; //array of pointers to arrays of pointers to union AnimCmd (We probably need to typedef this.) -extern u8 gTrainerClassToPicIndex[]; -extern u8 gTrainerClassToNameIndex[]; extern u8 gSecretBaseTrainerClasses[]; -extern u8 gUnknown_08208238[]; -extern u8 gUnknown_0820823C[]; -extern u8 gStatStageRatios[][2]; extern u8 gHoldEffectToType[][2]; u8 sub_803C348(u8 a1) diff --git a/src/pokemon_3.c b/src/pokemon_3.c index f9eb3a7e9..8622c11d9 100644 --- a/src/pokemon_3.c +++ b/src/pokemon_3.c @@ -1,5 +1,9 @@ +#include "battle_message.h" +#include "rom_8077ABC.h" +#include "rom_8094928.h" +#include "util.h" #include "global.h" -#include "asm.h" +#include "pokemon.h" #include "battle.h" #include "data2.h" #include "event_data.h" @@ -9,7 +13,6 @@ #include "link.h" #include "main.h" #include "m4a.h" -#include "pokemon.h" #include "rng.h" #include "rom4.h" #include "rtc.h" @@ -55,14 +58,10 @@ struct SpindaSpot }; extern u8 gPlayerPartyCount; -extern struct Pokemon gPlayerParty[6]; extern u8 gEnemyPartyCount; -extern struct Pokemon gEnemyParty[6]; extern struct BattlePokemon gBattleMons[4]; -extern u8 * const gItemEffectTable[]; extern u8 gUnknown_02024A60; extern struct BattleEnigmaBerry gEnigmaBerries[]; -extern struct EvolutionData gEvolutionTable[]; extern u16 gSpeciesToHoennPokedexNum[]; extern u16 gSpeciesToNationalPokedexNum[]; extern u16 gHoennToNationalOrder[]; @@ -79,11 +78,7 @@ extern s8 gNatureStatTable[][5]; extern s8 gUnknown_082082FE[][3]; extern u16 gTrainerBattleOpponent; extern u16 gBattleTypeFlags; -extern struct BaseStats gBaseStats[]; -extern u32 gBitTable[]; -extern u32 gExperienceTables[8][101]; extern u32 gTMHMLearnsets[][2]; -extern const u16 *gLevelUpLearnsets[]; extern u8 gBattleMonForms[]; extern const u8 BattleText_Wally[]; extern const u16 gHMMoves[]; @@ -100,8 +95,6 @@ extern u8 gUnknown_083FEE5D[]; extern u8 gUnknown_083FEE92[]; extern u8 *gUnknown_08400F58[]; -u8 CheckPartyHasHadPokerus(struct Pokemon *, u8); - bool8 HealStatusConditions(struct Pokemon *mon, u32 unused, u32 healMask, u8 battleId) { u32 status = GetMonData(mon, MON_DATA_STATUS, 0); @@ -1191,8 +1184,6 @@ void current_map_music_set__default_for_battle(u16 song) PlayNewMapMusic(sub_8040728()); } -const u16 *species_and_otid_get_pal(u16, u32, u32); - const u16 *pokemon_get_pal(struct Pokemon *mon) { u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0); @@ -1221,8 +1212,6 @@ const u16 *species_and_otid_get_pal(u16 species, u32 otId , u32 personality) return gMonPaletteTable[species].data; } -const struct SpritePalette *sub_80409C8(u16, u32, u32); - const struct SpritePalette *sub_8040990(struct Pokemon *mon) { u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0); @@ -1270,8 +1259,6 @@ s8 sub_8040A7C(u32 personality, u8 a2) return gUnknown_083F7E28[nature * 5 + a2]; } -bool8 IsOtherTrainer(u32, u8 *); - bool8 IsTradedMon(struct Pokemon *mon) { u8 otName[8]; diff --git a/src/pokemon_size_record.c b/src/pokemon_size_record.c index b2f8a1569..b96bdcf5f 100644 --- a/src/pokemon_size_record.c +++ b/src/pokemon_size_record.c @@ -1,3 +1,4 @@ +#include "pokedex.h" #include "global.h" #include "pokemon_size_record.h" #include "data2.h" @@ -7,9 +8,6 @@ #include "strings2.h" #include "text.h" -extern u16 SpeciesToNationalPokedexNum(u16); -extern u16 GetPokedexHeightWeight(u16, u8); - struct UnknownStruct { u16 unk0; diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 679ec0bc4..fb837f1f6 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -1,4 +1,5 @@ #include "global.h" +#include "pokemon_storage_system.h" #include "menu.h" #include "string_util.h" diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 56a56e455..47af6c6f9 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -1,5 +1,7 @@ +#include "region_map.h" +#include "tv.h" #include "global.h" -#include "asm.h" +#include "pokemon_summary_screen.h" #include "link.h" #include "menu.h" #include "pokemon.h" @@ -8,13 +10,6 @@ extern struct Pokemon *unk_2018000; -extern u8 *(gNatureNames[]); - -u8 *sub_80A1E9C(u8 *dest, u8 *src, u8); -u8 PokemonSummaryScreen_CheckOT(struct Pokemon *pokemon); -u8 *PokemonSummaryScreen_CopyPokemonLevel(u8 *dest, u8 level); -u32 GetPlayerTrainerId(void); - bool8 PokemonSummaryScreen_CheckOT(struct Pokemon *mon) { u32 trainerId; diff --git a/src/pokenav.c b/src/pokenav.c index f50f039f8..24253e878 100644 --- a/src/pokenav.c +++ b/src/pokenav.c @@ -1,24 +1,9 @@ #include "global.h" +#include "pokenav.h" #include "battle.h" #include "data2.h" #include "string_util.h" -struct UnkPokenavStruct_Sub { - /*0x0*/ u16 unk0; - /*0x2*/ u8 filler2[6]; -}; - - -struct UnkPokenavStruct { - /*0x0000*/ u8 filler0000[0xCEE8]; - /*0xCEE8*/ struct UnkPokenavStruct_Sub unkCEE8[78]; - /*0xD158*/ u16 unkD158; - -}; - -extern struct UnkPokenavStruct *gUnknown_083DFEC4; - - void sub_80F700C(u8 *arg0, u16 arg1) { struct Trainer *trainer; u8 *ptr; diff --git a/src/post_battle_event_funcs.c b/src/post_battle_event_funcs.c index f0b88025c..44fb2d66a 100644 --- a/src/post_battle_event_funcs.c +++ b/src/post_battle_event_funcs.c @@ -1,3 +1,4 @@ +#include "hall_of_fame.h" #include "global.h" #include "event_data.h" #include "load_save.h" @@ -6,8 +7,6 @@ #include "rom4.h" #include "script_pokemon_80C4.h" -extern void sub_8141F90(void); - extern u8 gUnknown_02039324; int GameClear(void) diff --git a/src/record_mixing.c b/src/record_mixing.c index c84cfd2ae..02dd6181f 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -1,6 +1,13 @@ +#include "cable_club.h" +#include "secret_base.h" +#include "mauville_old_man.h" +#include "battle_tower.h" +#include "tv.h" +#include "mystery_event_script.h" +#include "daycare.h" +#include "fldeff_80C5CD4.h" #include "global.h" #include "record_mixing.h" -#include "asm.h" #include "dewford_trend.h" #include "event_data.h" #include "link.h" @@ -52,9 +59,6 @@ struct PlayerRecords { extern struct PlayerRecords unk_2008000; extern struct PlayerRecords unk_2018000; -void sub_80BC300(); -void sub_80C045C(); - void RecordMixing_PrepareExchangePacket(void) { sub_80BC300(); diff --git a/src/roamer.c b/src/roamer.c index 394f81c75..948828d5e 100644 --- a/src/roamer.c +++ b/src/roamer.c @@ -1,7 +1,7 @@ #include "global.h" +#include "roamer.h" #include "pokemon.h" #include "rng.h" -#include "roamer.h" #include "species.h" #ifdef SAPPHIRE diff --git a/src/rom3.c b/src/rom3.c index be6ae0b27..21c63af78 100644 --- a/src/rom3.c +++ b/src/rom3.c @@ -1,5 +1,13 @@ +#include "battle_anim.h" +#include "battle_ai.h" +#include "rom_8094928.h" +#include "battle_811DA74.h" +#include "util.h" +#include "battle_anim_81258BC.h" +#include "battle_anim_8137220.h" +#include "cable_club.h" #include "global.h" -#include "asm.h" +#include "rom3.h" #include "battle.h" #include "items.h" #include "link.h" @@ -13,7 +21,6 @@ extern u8 unk_2000000[]; #define EWRAM_15000 ((u8 *)(unk_2000000 + 0x15000)) extern u16 gBattleTypeFlags; -extern const u32 gBitTable[]; extern u16 gBattleWeather; extern struct BattlePokemon gBattleMons[]; @@ -49,32 +56,6 @@ extern u8 gUnknown_030042B0[]; extern void (*gUnknown_030042D4)(void); extern void (*gUnknown_03004330[])(void); -extern void sub_800BF28(void); -extern void sub_8083C50(u8); -extern void nullsub_41(void); -extern void nullsub_91(void); -extern void battle_anim_clear_some_data(void); -extern void ClearBattleMonForms(void); -extern void BattleAI_HandleItemUseBeforeAISetup(void); -extern void sub_8094978(u8, int); -extern void sub_800BA78(void); -extern void sub_800B9A8(void); -extern void sub_800BD54(void); -extern void sub_8010800(void); -extern void sub_812B468(void); -extern void sub_8137224(void); -extern void sub_802BF74(void); -extern void sub_8032AE0(void); -extern void sub_8037510(void); -extern void sub_811DA78(void); -extern void dp01_prepare_buffer_wireless_probably(u8 a, u16, u8 *c); -extern void sub_800C1A8(u8); -extern void sub_800C47C(u8); -extern void sub_8007F4C(void); -extern u8 sub_8007ECC(void); -extern void sub_80155A4(); -extern u8 sub_8018324(); - void sub_800B858(void) { if (gBattleTypeFlags & BATTLE_TYPE_LINK) diff --git a/src/rom4.c b/src/rom4.c index 79ac6d769..be07e5867 100644 --- a/src/rom4.c +++ b/src/rom4.c @@ -1,7 +1,19 @@ +#include "field_specials.h" +#include "fieldmap.h" +#include "tv.h" +#include "secret_base.h" +#include "map_name_popup.h" +#include "field_fadetransition.h" +#include "fldeff_flash.h" +#include "unknown_task.h" +#include "cable_club.h" +#include "field_ground_effect.h" +#include "field_tasks.h" +#include "rotating_gate.h" +#include "field_screen_effect.h" +#include "time_events.h" #include "global.h" #include "rom4.h" -#include "asm.h" -#include "asm_fieldmap.h" #include "battle_setup.h" #include "berry.h" #include "clock.h" @@ -48,11 +60,6 @@ struct UnkTVStruct u32 tv_field_4; }; -struct UCoords32 -{ - u32 x, y; -}; - extern struct WarpData gUnknown_020297F0; extern struct WarpData gUnknown_020297F8; extern struct WarpData gUnknown_02029800; @@ -97,8 +104,6 @@ extern u8 TradeRoom_PromptToCancelLink[]; extern u8 TradeRoom_TerminateLink[]; extern u8 gUnknown_081A4508[]; -extern struct UCoords32 gUnknown_0821664C[]; - extern u8 (*gUnknown_082166A0[])(struct LinkPlayerMapObject *, struct MapObject *, u8); extern u8 (*gUnknown_082166AC[])(struct LinkPlayerMapObject *, struct MapObject *, u8); extern void (*gUnknown_082166D8[])(struct LinkPlayerMapObject *, struct MapObject *); diff --git a/src/rom6.c b/src/rom6.c index a2b52c9aa..c466e724d 100644 --- a/src/rom6.c +++ b/src/rom6.c @@ -1,6 +1,8 @@ +#include "field_map_obj.h" +#include "pokemon_menu.h" +#include "item_use.h" #include "global.h" #include "rom6.h" -#include "asm.h" #include "braille_puzzles.h" #include "field_effect.h" #include "field_player_avatar.h" @@ -19,10 +21,6 @@ extern u8 gLastFieldPokeMenuOpened; extern void (*gUnknown_03005CE4)(void); extern u8 UseRockSmashScript[]; -extern void sub_808AB90(void); -extern void task08_080A1C44(u8); -extern u8 sub_80CA1C8(void); - static void task08_080C9820(u8); static void sub_810B3DC(u8); static void sub_810B428(u8); diff --git a/src/rom_8077ABC.c b/src/rom_8077ABC.c index 9561db690..7e079c0d3 100644 --- a/src/rom_8077ABC.c +++ b/src/rom_8077ABC.c @@ -1,4 +1,8 @@ +#include "util.h" +#include "battle_anim.h" +#include "pokemon_icon.h" #include "global.h" +#include "rom_8077ABC.h" #include "battle.h" #include "blend_palette.h" #include "data2.h" @@ -89,7 +93,6 @@ struct BGCnt { extern struct OamData gOamData_837DF9C[]; extern const union AnimCmd *const gDummySpriteAnimTable[]; extern const union AffineAnimCmd *const gDummySpriteAffineAnimTable[]; -extern u8 gMiscBlank_Gfx[]; extern struct Struct_unk_2019348 unk_2019348; extern struct TransformStatus gTransformStatuses[]; @@ -108,45 +111,6 @@ extern struct OamMatrix gOamMatrices[]; extern struct Struct_2017810 unk_2017810[]; extern u8 gUnknown_0202F7BE; -extern u8 IsContest(); -extern bool8 sub_8078874(u8); -extern bool8 b_side_obj__get_some_boolean(u8); -extern void UpdateMonIconFrame(struct Sprite *sprite); -extern void CalcCenterToCornerVec(struct Sprite *sprite, u8 shape, u8 size, u8 affineMode); -extern void *species_and_otid_get_pal(u32, u32, u32); -extern void FreeSpriteOamMatrix(struct Sprite *sprite); -extern void ResetPaletteStructByUid(u16); -extern void DestroyAnimVisualTask(u8 task); -extern u8 CreateInvisibleSpriteWithCallback(void (*callback)(struct Sprite *)); - -u8 sub_8077E44(u8 slot, u16 species, u8 a3); -u8 battle_get_per_side_status(u8 slot); -u8 battle_side_get_owner(u8 slot); -void sub_8078314(struct Sprite *sprite); -void sub_8078364(struct Sprite *sprite); -void move_anim_8072740(struct Sprite *sprite); -void obj_translate_based_on_private_1_2_3_4(struct Sprite *sprite); -bool8 sub_8078B5C(struct Sprite *sprite); -u8 battle_get_per_side_status_permutated(u8 slot); -void sub_8078A5C(struct Sprite *sprite); -void sub_8078BB8(struct Sprite *sprite); -void sub_8078D44(struct Sprite *sprite); -bool8 sub_8078E38(); -void sub_8079518(struct Sprite *sprite); -void sub_80796F8(u8 task); -void sub_80797EC(struct Task *task); -void sub_8079814(u8 taskId); -void sub_8079BF4(s16 *bottom, s16 *top, void *ptr); -void *sub_8079BFC(s16 bottom, s16 top); -void sub_8079A64(u8 sprite); -u16 sub_8079B10(u8 sprite); -u8 sub_8079E90(u8 slot); -void sub_807A784(u8 taskId); -void sub_807A850(struct Task *task, u8 taskId); -void sub_807A8D4(struct Sprite *sprite); -void sub_807A960(struct Sprite *sprite); - - EWRAM_DATA union AffineAnimCmd *gUnknown_0202F7D4 = NULL; EWRAM_DATA u32 filler_0202F7D8[3] = {0}; diff --git a/src/rom_8094928.c b/src/rom_8094928.c index 794fc78f6..de1823d88 100644 --- a/src/rom_8094928.c +++ b/src/rom_8094928.c @@ -1,20 +1,15 @@ +#include "party_menu.h" +#include "rom_8077ABC.h" #include "global.h" -#include "pokemon.h" +#include "rom_8094928.h" #define UNK_201606C_ARRAY (unk_2000000 + 0x1606C) // lazy define but whatever. extern u8 unk_2000000[]; extern struct PokemonStorage gPokemonStorage; -extern u8 IsLinkDoubleBattle(void); -extern u8 IsDoubleBattle(void); -extern u8 battle_get_side_with_given_state(u8); -extern u8 battle_side_get_owner(u8); -void sub_8094998(u8[3], u8); -void sub_8094A74(u8[3], u8, u32); extern u8 gUnknown_02038470[3]; -extern u8 sub_803FBBC(void); extern u16 gUnknown_02024A6A[]; void unref_sub_8094928(struct PokemonStorage *ptr) diff --git a/src/safari_zone.c b/src/safari_zone.c index 8c2b63469..74f1a9f0b 100644 --- a/src/safari_zone.c +++ b/src/safari_zone.c @@ -1,6 +1,6 @@ +#include "field_fadetransition.h" #include "global.h" #include "safari_zone.h" -#include "asm.h" #include "event_data.h" #include "field_player_avatar.h" #include "main.h" diff --git a/src/save.c b/src/save.c index 9ab6e83f6..570210fb0 100644 --- a/src/save.c +++ b/src/save.c @@ -2,7 +2,6 @@ #include "gba/gba.h" #include "gba/flash_internal.h" #include "save.h" -#include "asm.h" #include "load_save.h" #include "rom4.h" #include "save_failed_screen.h" diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index a3de0bd00..07f90ed17 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -1,6 +1,7 @@ +#include "starter_choose.h" #include "global.h" #include "gba/flash_internal.h" -#include "asm.h" +#include "save_failed_screen.h" #include "m4a.h" #include "main.h" #include "menu.h" @@ -35,12 +36,6 @@ extern struct SaveFailedClockStruct gSaveFailedClockInfo; extern u32 gDamagedSaveSectors; extern u32 gGameContinueCallback; -extern u8 gBirchHelpGfx[]; - -extern u8 gBirchGrassTilemap[]; -extern u8 gBirchBagTilemap[]; -extern u8 gBirchBagGrassPal[0x40]; - static const struct OamData sClockOamData = { 160, // Y diff --git a/src/save_menu_util.c b/src/save_menu_util.c index 8910bb300..19bd178ad 100644 --- a/src/save_menu_util.c +++ b/src/save_menu_util.c @@ -1,6 +1,6 @@ +#include "region_map.h" #include "global.h" #include "save_menu_util.h" -#include "asm.h" #include "event_data.h" #include "menu.h" #include "pokedex.h" diff --git a/src/scrcmd.c b/src/scrcmd.c index 33867b58a..965a1aa88 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1,6 +1,18 @@ +#include "decoration_inventory.h" +#include "field_screen_effect.h" +#include "field_map_obj.h" +#include "script_movement.h" +#include "field_fadetransition.h" +#include "mystery_event_script.h" +#include "contest_link_80C2020.h" +#include "fieldmap.h" +#include "field_specials.h" +#include "shop.h" +#include "party_menu.h" +#include "field_tasks.h" +#include "tv.h" +#include "slot_machine.h" #include "global.h" -#include "asm.h" -#include "asm_fieldmap.h" #include "battle_setup.h" #include "berry.h" #include "clock.h" @@ -35,9 +47,6 @@ typedef u16 (*SpecialFunc)(void); typedef void (*NativeFunc)(void); -extern struct Pokemon gPlayerParty[6]; // 0x3004360 -extern struct Pokemon gEnemyParty[6]; // 0x30045C0 - extern u32 gUnknown_0202E8AC; extern u32 gUnknown_0202E8B0; extern u16 gUnknown_0202E8B4; @@ -60,7 +69,6 @@ extern SpecialFunc gSpecials[]; extern u8 *gStdScripts[]; extern u8 *gStdScripts_End[]; -extern u8 * const gUnknown_083CE048[]; extern struct Decoration gDecorations[]; // This is defined in here so the optimizer can't see its value when compiling diff --git a/src/script.c b/src/script.c index 7a9c8e102..488a67de1 100644 --- a/src/script.c +++ b/src/script.c @@ -1,6 +1,5 @@ #include "global.h" #include "script.h" -#include "asm_fieldmap.h" #include "event_data.h" #define RAM_SCRIPT_MAGIC 51 diff --git a/src/script_menu.c b/src/script_menu.c index 50941f9ac..98c55e678 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -1,3 +1,4 @@ +#include "field_effect.h" #include "global.h" #include "script_menu.h" #include "event_data.h" @@ -573,10 +574,6 @@ extern u8 gPCText_WhichPCShouldBeAccessed[]; extern u16 gScriptResult; -// field_effect -extern void FreeResourcesAndDestroySprite(struct Sprite *sprite); -extern u8 CreateMonSprite_PicBox(u16, s16, s16, u8); - bool8 sub_80B5054(u8 left, u8 top, u8 var3, u8 var4) { if (FuncIsActiveTask(sub_80B52B4) == 1) diff --git a/src/script_movement.c b/src/script_movement.c index 2dc816532..f1033c525 100644 --- a/src/script_movement.c +++ b/src/script_movement.c @@ -1,14 +1,12 @@ +#include "field_map_obj.h" +#include "util.h" #include "global.h" -#include "asm.h" +#include "script_movement.h" #include "field_map_obj_helpers.h" #include "task.h" -extern const u32 gBitTable[]; extern u8 *gUnknown_020384F8[]; -extern void UnfreezeMapObject(struct MapObject *); -extern bool8 FieldObjectIsSpecialAnimActive(struct MapObject *); - static void sub_80A2198(u8); static u8 sub_80A21E0(void); static bool8 sub_80A21F4(u8, u8, u8 *); diff --git a/src/script_pokemon_util_80C4BF0.c b/src/script_pokemon_util_80C4BF0.c index d111cf8f6..6f5b941f4 100644 --- a/src/script_pokemon_util_80C4BF0.c +++ b/src/script_pokemon_util_80C4BF0.c @@ -1,5 +1,9 @@ +#include "contest_link_80C2020.h" +#include "daycare.h" +#include "contest_painting.h" +#include "debug.h" +#include "choose_party.h" #include "global.h" -#include "asm.h" #include "battle.h" #include "berry.h" #include "contest.h" @@ -22,17 +26,6 @@ #define CONTEST_ENTRY_PIC_LEFT 10 #define CONTEST_ENTRY_PIC_TOP 3 -extern void sub_80C46EC(void); -extern void sub_80C4740(void); -extern void sub_80C48F4(void); -extern void sub_80B2A7C(u8); -extern void sub_80AAF30(void); // matsuda debug? -extern u8 sub_80B2C4C(u8, u8); -extern void CB2_ContestPainting(void); -extern void sub_8042044(struct Pokemon *mon, u16, u8); -extern void sub_8121E10(void); -extern void sub_8121E34(void); - extern struct SpriteTemplate gUnknown_02024E8C; extern struct SpritePalette *sub_80409C8(u16, u32, u32); diff --git a/src/script_pokemon_util_80F99CC.c b/src/script_pokemon_util_80F99CC.c index 9e833ec34..29c4560c0 100644 --- a/src/script_pokemon_util_80F99CC.c +++ b/src/script_pokemon_util_80F99CC.c @@ -1,5 +1,9 @@ +#include "party_menu.h" +#include "contest.h" +#include "choose_party.h" +#include "pokemon_summary_screen.h" +#include "field_fadetransition.h" #include "global.h" -#include "asm.h" #include "battle_party_menu.h" #include "data2.h" #include "palette.h" @@ -20,22 +24,6 @@ extern u16 gScriptResult; extern void (*gUnknown_0300485C)(void); -extern void OpenPartyMenu(u8, u8); -extern void TryCreatePartyMenuMonIcon(u8, u8, struct Pokemon *); -extern void LoadHeldItemIconGraphics(void); -extern void CreateHeldItemIcons_806DC34(); // undefined args -extern u8 sub_806BD58(u8, u8); -extern void PartyMenuPrintMonsLevelOrStatus(void); -extern void PrintPartyMenuMonNicknames(void); -extern u8 sub_806B58C(u8); -extern u8 sub_80AE47C(struct Pokemon *party); -extern void sub_806BC3C(u8, u8); -extern u16 sub_806BD80(); // undefined args in battle_party_menu.c -extern u8 sub_806CA38(); -extern void sub_8123138(u8); -extern u8 sub_8040574(struct Pokemon *party); -extern void sub_809D9F0(struct Pokemon *party, u8, u8, void *, u32); - void sub_80F99CC(void) { u8 taskId; diff --git a/src/secret_base.c b/src/secret_base.c index c210a55d2..0d558f02b 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -1,11 +1,15 @@ +#include "fieldmap.h" +#include "field_fadetransition.h" +#include "main.h" +#include "map_name_popup.h" #include "global.h" +#include "secret_base.h" #include "string_util.h" #include "strings.h" #include "text.h" #include "event_data.h" #include "vars.h" #include "rom4.h" -#include "asm.h" #include "script.h" #include "field_player_avatar.h" #include "field_camera.h" @@ -30,9 +34,7 @@ extern const struct } gUnknown_083D1358[7]; extern const u8 gUnknown_083D1374[4 * 16]; extern void *gUnknown_0300485C; -extern const u8 sub_807D770(void); extern const u8 gUnknown_083D13EC[12]; -extern const u8 sub_80BCCA4(u8); extern u8 gUnknown_081A2E14[]; @@ -824,8 +826,6 @@ u8 sub_80BC14C(u8 sbid) return 0; } - - u8 *sub_80BC190(u8 *dest, u8 arg1) { // 80bc190 u8 local1; u8 *str; diff --git a/src/shop.c b/src/shop.c index 81c403e92..4eee33632 100644 --- a/src/shop.c +++ b/src/shop.c @@ -1,5 +1,10 @@ +#include "menu_helpers.h" +#include "field_fadetransition.h" +#include "item_menu.h" +#include "tv.h" +#include "unknown_task.h" #include "global.h" -#include "asm.h" +#include "shop.h" #include "decompress.h" #include "field_weather.h" #include "main.h" @@ -35,26 +40,6 @@ extern u16 gBuyMenuFrame_Tilemap[]; extern u16 gMenuMoneyPal[16]; extern u16 gUnknown_083CC710[2]; -extern void sub_80A6300(void); -extern void sub_80BE3BC(void); -extern void DisplayItemMessageOnField(u8, const u8*, TaskFunc, u16); -extern u8 sub_807D770(void); -extern void pal_fill_black(void); -extern void sub_80B3764(int, int); -extern void sub_80B37EC(void); -extern void sub_80B40E8(u8); -extern void BuyMenuDrawMapGraphics(void); -extern void sub_80F944C(void); -extern void CreateVerticalScrollIndicators(u32, u32, u32); // unknown args -extern void sub_80F979C(u32, u32); // unknown args - -void sub_80B2E38(u8); -void HandleShopMenuQuit(u8); -void sub_80B2FA0(u8); -void BuyMenuDrawGraphics(void); -void sub_80B3240(void); -void sub_80B3270(void); - u8 CreateShopMenu(bool8 var) { ScriptContext2_Enable(); diff --git a/src/slot_machine.c b/src/slot_machine.c index c087bf6b4..c9a06a758 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -1,4 +1,5 @@ #include "global.h" +#include "slot_machine.h" #include "decompress.h" #include "palette.h" #include "task.h" @@ -31,11 +32,6 @@ extern const u16 gUnknown_08E95A18[]; extern u16 gUnknown_08E95AB8[]; extern u16 gUnknown_08E95FB8[]; - -void sub_8104DA4(void); - -u8 sub_8105BB4(u8, u8, s16); - static void LoadSlotMachineWheelOverlay(void); void sub_8104CAC(u8 arg0) { diff --git a/src/smokescreen.c b/src/smokescreen.c index 0406c1cb3..327b6ae6f 100644 --- a/src/smokescreen.c +++ b/src/smokescreen.c @@ -1,9 +1,9 @@ +#include "util.h" #include "global.h" #include "data2.h" #include "decompress.h" #include "sprite.h" -extern u8 CreateInvisibleSpriteWithCallback(void (*)(struct Sprite *)); static void sub_8046388(struct Sprite *); diff --git a/src/sound.c b/src/sound.c index ed69ca01d..988feeb2c 100644 --- a/src/sound.c +++ b/src/sound.c @@ -1,7 +1,7 @@ +#include "main.h" #include "global.h" #include "gba/m4a_internal.h" #include "sound.h" -#include "asm.h" #include "battle.h" #include "m4a.h" #include "songs.h" @@ -13,7 +13,7 @@ struct Fanfare u16 duration; }; -// Hack: different prototype than definition +// FIXME: different prototype than definition u32 SpeciesToCryId(u32); extern u16 gBattleTypeFlags; diff --git a/src/sprite.c b/src/sprite.c index 409c66cfa..fb8c2b648 100644 --- a/src/sprite.c +++ b/src/sprite.c @@ -57,7 +57,6 @@ static void ClearSpriteCopyRequests(void); static void ResetOamMatrices(void); static void ResetSprite(struct Sprite *sprite); static s16 AllocSpriteTiles(u16 tileCount); -u8 SpriteTileAllocBitmapOp(u16 bit, u8 op); static void RequestSpriteFrameImageCopy(u16 index, u16 tileNum, const struct SpriteFrameImage *images); static void ResetAllSprites(void); static void BeginAnim(struct Sprite *sprite); diff --git a/src/start_menu.c b/src/start_menu.c index a3258bab1..6c3b411bc 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -1,6 +1,10 @@ +#include "item_menu.h" +#include "pokenav.h" +#include "pokemon_menu.h" +#include "unknown_task.h" +#include "fieldmap.h" #include "global.h" #include "start_menu.h" -#include "asm.h" #include "event_data.h" #include "field_map_obj_helpers.h" #include "field_player_avatar.h" @@ -49,7 +53,6 @@ extern u16 gSaveFileStatus; extern u16 gScriptResult; extern u8 (*gCallback_03004AE8)(void); extern u8 gUnknown_03004860; -extern u8 gNumSafariBalls; EWRAM_DATA static u8 sStartMenuCursorPos = 0; EWRAM_DATA static u8 sNumStartMenuActions = 0; diff --git a/src/starter_choose.c b/src/starter_choose.c index 32b6adf36..dd35ab9df 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -1,6 +1,6 @@ +#include "unknown_task.h" #include "global.h" #include "starter_choose.h" -#include "asm.h" #include "data2.h" #include "decompress.h" #include "main.h" diff --git a/src/strings.c b/src/strings.c index f41af082c..a24bb383f 100644 --- a/src/strings.c +++ b/src/strings.c @@ -1,4 +1,5 @@ #include "global.h" +#include "strings.h" #if ENGLISH // placeholder strings @@ -923,7 +924,6 @@ const u8 gSystemText_NoSaveFileNoTime[] = _("There is no save file, so the time\ const u8 gSystemText_ClockAdjustmentUsable[] = _("The in-game clock adjustment system\nis now useable."); const u8 gSystemText_Saving[] = _("SAVING...\nDON’T TURN OFF THE POWER."); #elif GERMAN -#include "global.h" // placeholder strings const u8 gExpandedPlaceholder_Empty[] = _(""); diff --git a/src/time_events.c b/src/time_events.c index 8cbf52a1a..f05828bec 100644 --- a/src/time_events.c +++ b/src/time_events.c @@ -1,4 +1,6 @@ +#include "field_weather.h" #include "global.h" +#include "time_events.h" #include "event_data.h" #include "pokemon.h" #include "rng.h" @@ -7,16 +9,14 @@ #include "script.h" #include "task.h" -extern bool8 sub_807DDFC(void); - -u32 GetMirageRnd(void) +static u32 GetMirageRnd(void) { u32 hi = VarGet(VAR_MIRAGE_RND_H); u32 lo = VarGet(VAR_MIRAGE_RND_L); return (hi << 16) | lo; } -void SetMirageRnd(u32 rnd) +static void SetMirageRnd(u32 rnd) { VarSet(VAR_MIRAGE_RND_H, rnd >> 16); VarSet(VAR_MIRAGE_RND_L, rnd); diff --git a/src/title_screen.c b/src/title_screen.c index 241e5489e..25967a91a 100644 --- a/src/title_screen.c +++ b/src/title_screen.c @@ -1,7 +1,8 @@ +#include "unknown_task.h" +#include "reset_rtc_screen.h" #include "global.h" #include "gba/m4a_internal.h" #include "title_screen.h" -#include "asm.h" #include "clear_save_data_menu.h" #include "decompress.h" #include "event_data.h" diff --git a/src/trainer_card.c b/src/trainer_card.c index ef3a2d857..d5567b12a 100644 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -1,6 +1,9 @@ +#include "unknown_task.h" +#include "easy_chat.h" +#include "util.h" +#include "field_effect.h" #include "global.h" #include "trainer_card.h" -#include "asm.h" #include "event_data.h" #include "link.h" #include "main.h" @@ -68,9 +71,8 @@ extern u16 gUnknown_08E8D9C0[]; extern bool8 (*const gUnknown_083B5EBC[])(struct Task *); extern bool8 (*const gUnknown_083B5ED8[])(struct Task *); -// Other signature than on save_menu_util.h +// FIXME: Other signature than on save_menu_util.h void FormatPlayTime(u8 *playtime, u16 hours, u16 minutes, s16 colon); - u16 GetPokedexSeenCount(void); enum diff --git a/src/trainer_see.c b/src/trainer_see.c index 9d58faab8..f8bd3339b 100644 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -1,7 +1,5 @@ #include "global.h" #include "trainer_see.h" -#include "asm.h" -#include "asm_fieldmap.h" #include "battle_setup.h" #include "field_effect.h" #include "field_map_obj.h" @@ -9,6 +7,7 @@ #include "script.h" #include "sprite.h" #include "task.h" +#include "util.h" extern bool8 (*gIsTrainerInRange[])(struct MapObject *, u16, s16, s16); extern bool8 (*gTrainerSeeFuncList[])(u8, struct Task *, struct MapObject *); diff --git a/src/tv.c b/src/tv.c index d2e38c088..b7a4e206a 100644 --- a/src/tv.c +++ b/src/tv.c @@ -1,5 +1,9 @@ +#include "battle_tower.h" +#include "field_specials.h" +#include "region_map.h" +#include "script_menu.h" +#include "field_map_obj.h" #include "global.h" -#include "asm.h" #include "tv.h" #include "data2.h" #include "event_data.h" @@ -41,8 +45,6 @@ struct UnkBattleStruct { u8 var35; u8 var36[11]; }; -extern struct UnkBattleStruct gUnknown_030042E0; -extern u8 gUnknown_0300430A[11]; struct OutbreakPokemon { @@ -52,13 +54,21 @@ struct OutbreakPokemon /*0x0B*/ u8 location; }; -extern u8 *gUnknown_083D1464[3]; -extern u8 gUnknown_02038694; - struct TVSaleItem { u16 item_id; u16 item_amount; }; + +struct ewramStruct_0207000 { + struct SaveTVStruct tvshows[4]; +}; + +extern struct UnkBattleStruct gUnknown_030042E0; +extern u8 gUnknown_0300430A[11]; + + +extern u8 gUnknown_02038694; + extern struct TVSaleItem gUnknown_02038724[3]; extern u16 gSpecialVar_0x8004; @@ -85,11 +95,8 @@ extern u8 *gTVFishingGuruAdviceTextGroup[]; extern u8 *gTVWorldOfMastersTextGroup[]; extern struct OutbreakPokemon gPokeOutbreakSpeciesList[5]; -extern void sub_80BEBF4(void); - extern u16 gUnknown_020387E0; extern u16 gUnknown_020387E2; -extern const u8 *gUnknown_083CE048[]; extern const u8 *gTVNewsTextGroup1[]; extern const u8 *gTVNewsTextGroup2[]; @@ -97,7 +104,20 @@ extern const u8 *gTVNewsTextGroup3[]; extern u16 gScriptLastTalked; -u32 GetPlayerTrainerId(void); + +extern u8 gScriptContestCategory; +extern u8 gScriptContestRank; +extern u8 gUnknown_03004316[11]; +extern u8 gUnknown_02024D26; + +extern u16 gUnknown_02024C04; + +extern u8 ewram[]; +#define gUnknown_02007000 (*(struct ewramStruct_0207000 *)(ewram + 0x7000)) +extern u8 gUnknown_020387E4; + +extern u8 gUnknown_03000720; +extern s8 gUnknown_03000722; void ClearTVShowData(void) { @@ -113,45 +133,7 @@ void ClearTVShowData(void) sub_80BEBF4(); } -bool8 sub_80BF1B4(u8); -void sub_80BF20C(void); -extern u16 sub_8135D3C(u8); -extern u8 gScriptContestCategory; -extern u8 gScriptContestRank; -extern u8 gUnknown_03004316[11]; -extern u8 gUnknown_02024D26; - -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 sub_80BE028(void); -void sub_80BE074(void); -void sub_80BE778(void); -void sub_80BEB20(void); - asm(".section .text_a"); -s8 sub_80BF74C(TVShow tvShow[]); - -void sub_80BF55C(TVShow tvShow[], u8 showidx); -void sub_80BEA88(void); - -void sub_80BE138(TVShow *show); -void sub_80BE160(TVShow *show); -extern u16 gUnknown_02024C04; - -void sub_80BE5FC(void); -void sub_80BE65C(void); -void sub_80BE6A0(void); -void nullsub_21(void); -void sub_80BE188(void); -void sub_80BE320(void); - -extern u8 GabbyAndTyGetBattleNum(void); void GabbyAndTySetScriptVarsToFieldObjectLocalIds(void) { switch (GabbyAndTyGetBattleNum()) { @@ -784,8 +766,6 @@ void UpdateMassOutbreakTimeLeft(u16 arg0) gSaveBlock1.outbreakUnk5 -= arg0; } -void sub_80BE9D4(); - void sub_80BE97C(bool8 flag) { u8 var0, var1; @@ -839,9 +819,6 @@ void sub_80BEA50(u16 var) gUnknown_020387E0 = var; } -void sub_80BF55C(TVShow tvShow[], u8 showidx); -void sub_80BEA88(void); - void sub_80BEA5C(u16 arg0) { TVShow *unk_2a98; @@ -885,15 +862,6 @@ void sub_80BEA88(void) } } -int sub_80BEBC8(struct UnknownSaveStruct2ABC *arg0); -void sub_80BEC10(u8); -void sub_80BF588(TVShow tvShows[]); -void sub_80BF6D8(void); -bool8 sub_80BF77C(u16); -bool8 sub_80BEE48(u8); - -bool8 IsPriceDiscounted(u8); - void sub_80BEB20(void) { u16 rval; struct SaveBlock1 *save; @@ -1802,20 +1770,6 @@ void sub_80BFD20(void) RemoveFieldObjectByLocalIdAndMap(5, gSaveBlock1.location.mapNum, gSaveBlock1.location.mapGroup); } -extern u8 ewram[]; -#define gUnknown_02007000 (*(struct ewramStruct_0207000 *)(ewram + 0x7000)) -extern u8 gUnknown_020387E4; - -struct ewramStruct_0207000 { - struct SaveTVStruct tvshows[4]; -}; - -void sub_80BFE24(struct SaveTVStruct *arg0, struct SaveTVStruct *arg1, struct SaveTVStruct *arg2, struct SaveTVStruct *arg3); - -void sub_80C04A0(void); -void sub_80C01D4(void); -void sub_80C0408(void); - void sub_80BFD44(u8 *arg0, u32 arg1, u8 arg2) { u8 i; @@ -1845,14 +1799,6 @@ void sub_80BFD44(u8 *arg0, u32 arg1, u8 arg2) sub_80C0408(); } -extern u8 gUnknown_03000720; -extern s8 gUnknown_03000722; -s8 sub_80C019C(TVShow tvShows[]); -bool8 sub_80BFF68(struct SaveTVStruct ** tv1, struct SaveTVStruct ** tv2, u8 idx); -u8 sub_80C004C(TVShow *tv1, TVShow *tv2, u8 idx); -u8 sub_80C00B4(TVShow *tv1, TVShow *tv2, u8 idx); -u8 sub_80C0134(TVShow *tv1, TVShow *tv2, u8 idx); - void sub_80BFE24(struct SaveTVStruct *arg0, struct SaveTVStruct *arg1, struct SaveTVStruct *arg2, struct SaveTVStruct *arg3) { u8 i, j; @@ -2092,9 +2038,6 @@ s8 sub_80C019C(TVShow tvShows[]) { return -1; } -void sub_80C03A8(u8 showidx); -void sub_80C03C8(u16 species, u8 showidx); - #ifdef NONMATCHING void sub_80C01D4(void) { u8 i; @@ -2436,22 +2379,6 @@ void sub_80C045C(void) { asm(".section .dotvshow\n"); -void DoTVShowPokemonFanClubLetter(void); -void DoTVShowRecentHappenings(void); -void DoTVShowPokemonFanClubOpinions(void); -void nullsub_22(void); -void DoTVShowPokemonNewsMassOutbreak(void); -void DoTVShowBravoTrainerPokemonProfile(void); -void DoTVShowBravoTrainerBattleTowerProfile(void); -void DoTVShowPokemonTodaySuccessfulCapture(void); -void DoTVShowTodaysSmartShopper(void); -void DoTVShowTheNameRaterShow(void); -void DoTVShowPokemonTodayFailedCapture(void); -void DoTVShowPokemonAngler(void); -void DoTVShowTheWorldOfMasters(void); - -bool8 sub_80C06E8(struct UnknownSaveStruct2ABC *arg0, struct UnknownSaveStruct2ABC *arg1, s8 arg2); - void sub_80C06BC(int *arg0, int *arg1) { struct UnknownSaveStruct2ABC *str0; struct UnknownSaveStruct2ABC *str1; @@ -2558,10 +2485,6 @@ void TVShowConvertInternationalString(u8 *dest, u8 *src, u8 language) { asm(".section .text_c"); -void TVShowConvertInternationalString(u8 *, u8 *, u8); - -void TakeTVShowInSearchOfTrainersOffTheAir(void); - void DoTVShowTheNameRaterShow(void) { TVShow *tvShow; u8 switchval; diff --git a/src/unknown_debug_menu.c b/src/unknown_debug_menu.c index bbaeef63a..2cdcbaabd 100644 --- a/src/unknown_debug_menu.c +++ b/src/unknown_debug_menu.c @@ -7,7 +7,7 @@ extern u8 (*gCallback_03004AE8)(void); extern const struct MenuAction gUnknown_0842C29C[]; -u8 sub_814A464(void); +static u8 sub_814A464(void); int unref_sub_814A414(void) { @@ -19,7 +19,7 @@ int unref_sub_814A414(void) return 0; } -u8 sub_814A464(void) +static u8 sub_814A464(void) { s8 result = ProcessMenuInput(); if (result == -2) diff --git a/src/util.c b/src/util.c index 2278c50fe..c686a6d54 100644 --- a/src/util.c +++ b/src/util.c @@ -1,5 +1,5 @@ #include "global.h" -#include "sprite.h" +#include "util.h" extern const struct SpriteTemplate gInvisibleSpriteTemplate; extern const u8 gSpriteDimensions[3][4][2]; diff --git a/src/wallclock.c b/src/wallclock.c index 0b9948adc..1fe4cc19b 100644 --- a/src/wallclock.c +++ b/src/wallclock.c @@ -1,6 +1,6 @@ +#include "unknown_task.h" #include "global.h" #include "wallclock.h" -#include "asm.h" #include "decompress.h" #include "main.h" #include "menu.h" @@ -16,7 +16,6 @@ extern u16 gSpecialVar_0x8004; extern u8 gMiscClock_Gfx[]; extern u8 gUnknown_08E95774[]; extern u8 gUnknown_08E954B0[]; -extern const struct MenuAction gMenuYesNoItems[]; extern u16 gMiscClockMale_Pal[]; extern u16 gMiscClockFemale_Pal[]; diff --git a/src/wild_encounter.c b/src/wild_encounter.c index 9dfcf0e5c..0746c7a90 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -1,7 +1,9 @@ +#include "fieldmap.h" +#include "pokeblock.h.h" +#include "tv.h" #include "global.h" #include "wild_encounter.h" #include "abilities.h" -#include "asm.h" #include "battle_setup.h" #include "event_data.h" #include "field_player_avatar.h" @@ -2921,9 +2923,6 @@ const struct WildPokemonInfo Underwater2_WaterMonsInfo = {4, Underwater2_WaterMo extern u16 gRoute119WaterTileData[]; -extern struct WildPokemonHeader gWildMonHeaders[]; -extern struct Pokemon gEnemyParty[6]; -extern struct Pokemon gPlayerParty[6]; extern u16 gScriptResult; extern struct WildPokemon gWildFeebasRoute119Data; extern u8 Event_RepelWoreOff[]; -- cgit v1.2.3 From f26daa3d6954d2db3a7c44b79d319a7a084462c2 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Fri, 26 May 2017 15:01:42 +0200 Subject: Sort includes --- src/battle_2.c | 38 +++++++++++++++++++------------------- src/battle_6.c | 2 +- src/battle_811DA74.c | 16 ++++++++-------- src/battle_ai.c | 4 ++-- src/battle_anim.c | 12 ++++++------ src/battle_anim_80A7E7C.c | 2 +- src/battle_anim_81258BC.c | 8 ++++---- src/battle_interface.c | 18 +++++++++--------- src/battle_party_menu.c | 14 +++++++------- src/battle_setup.c | 10 +++++----- src/berry.c | 6 +++--- src/berry_tag_screen.c | 6 +++--- src/bike.c | 2 +- src/braille_puzzles.c | 4 ++-- src/clock.c | 10 +++++----- src/contest_painting.c | 4 ++-- src/coord_event_weather.c | 2 +- src/credits.c | 6 +++--- src/diploma.c | 2 +- src/field_camera.c | 4 ++-- src/field_control_avatar.c | 18 +++++++++--------- src/field_door.c | 2 +- src/field_fadetransition.c | 6 +++--- src/field_ground_effect.c | 2 +- src/field_map_obj.c | 12 ++++++------ src/field_map_obj_helpers.c | 4 ++-- src/field_message_box.c | 2 +- src/field_player_avatar.c | 12 ++++++------ src/field_poison.c | 4 ++-- src/field_region_map.c | 4 ++-- src/field_special_scene.c | 12 ++++++------ src/field_specials.c | 2 +- src/fieldmap.c | 8 ++++---- src/fldeff_cut.c | 6 +++--- src/fldeff_softboiled.c | 4 ++-- src/fldeff_strength.c | 4 ++-- src/fldeff_sweetscent.c | 2 +- src/fldeff_teleport.c | 4 ++-- src/intro.c | 6 +++--- src/item.c | 2 +- src/item_use.c | 18 +++++++++--------- src/link.c | 2 +- src/mail.c | 10 +++++----- src/mail_data.c | 2 +- src/main.c | 4 ++-- src/main_menu.c | 6 +++--- src/map_name_popup.c | 2 +- src/map_obj_lock.c | 4 ++-- src/matsuda_debug_menu.c | 6 +++--- src/mauville_old_man.c | 4 ++-- src/mori_debug_menu.c | 6 +++--- src/mystery_event_menu.c | 2 +- src/naming_screen.c | 10 +++++----- src/new_game.c | 26 +++++++++++++------------- src/party_menu.c | 30 +++++++++++++++--------------- src/player_pc.c | 6 +++--- src/pokedex.c | 8 ++++---- src/pokemon_1.c | 2 +- src/pokemon_2.c | 10 +++++----- src/pokemon_3.c | 12 ++++++------ src/pokemon_size_record.c | 2 +- src/pokemon_summary_screen.c | 4 ++-- src/post_battle_event_funcs.c | 2 +- src/record_mixing.c | 16 ++++++++-------- src/rom3.c | 14 +++++++------- src/rom4.c | 30 +++++++++++++++--------------- src/rom6.c | 6 +++--- src/rom_8077ABC.c | 6 +++--- src/rom_8094928.c | 4 ++-- src/safari_zone.c | 2 +- src/save_failed_screen.c | 2 +- src/save_menu_util.c | 2 +- src/scrcmd.c | 28 ++++++++++++++-------------- src/script_menu.c | 2 +- src/script_movement.c | 4 ++-- src/script_pokemon_util_80C4BF0.c | 10 +++++----- src/script_pokemon_util_80F99CC.c | 10 +++++----- src/secret_base.c | 30 +++++++++++++++--------------- src/shop.c | 10 +++++----- src/smokescreen.c | 2 +- src/sound.c | 2 +- src/start_menu.c | 10 +++++----- src/starter_choose.c | 2 +- src/time_events.c | 2 +- src/title_screen.c | 4 ++-- src/trainer_card.c | 8 ++++---- src/tv.c | 34 +++++++++++++++++----------------- src/wallclock.c | 2 +- src/wild_encounter.c | 6 +++--- 89 files changed, 356 insertions(+), 356 deletions(-) mode change 100755 => 100644 src/field_map_obj.c (limited to 'src') diff --git a/src/battle_2.c b/src/battle_2.c index 93d6f7204..4beb0a46f 100644 --- a/src/battle_2.c +++ b/src/battle_2.c @@ -1,31 +1,31 @@ -#include "rom3.h" -#include "unknown_task.h" -#include "rom_8077ABC.h" -#include "party_menu.h" -#include "pokedex.h" -#include "item.h" -#include "util.h" -#include "rom_8094928.h" -#include "pokeball.h" -#include "battle_interface.h" #include "global.h" +#include "abilities.h" #include "battle.h" +#include "battle_interface.h" +#include "battle_setup.h" #include "data2.h" +#include "item.h" +#include "link.h" #include "main.h" -#include "text.h" +#include "name_string_util.h" #include "palette.h" -#include "sprite.h" -#include "task.h" +#include "party_menu.h" +#include "pokeball.h" +#include "pokedex.h" #include "pokemon.h" -#include "species.h" -#include "link.h" -#include "name_string_util.h" -#include "battle_setup.h" #include "rng.h" -#include "sound.h" +#include "rom3.h" +#include "rom_8077ABC.h" +#include "rom_8094928.h" #include "songs.h" +#include "sound.h" +#include "species.h" +#include "sprite.h" +#include "task.h" +#include "text.h" #include "trig.h" -#include "abilities.h" +#include "unknown_task.h" +#include "util.h" struct UnknownStruct6 { diff --git a/src/battle_6.c b/src/battle_6.c index ad5121d81..866a66ae3 100644 --- a/src/battle_6.c +++ b/src/battle_6.c @@ -1,6 +1,6 @@ -#include "battle_message.h" #include "global.h" #include "battle.h" +#include "battle_message.h" #include "menu_cursor.h" #include "text.h" diff --git a/src/battle_811DA74.c b/src/battle_811DA74.c index ccb23ca42..145e9bba1 100644 --- a/src/battle_811DA74.c +++ b/src/battle_811DA74.c @@ -1,22 +1,22 @@ -#include "battle.h" -#include "rom_8077ABC.h" -#include "battle_interface.h" -#include "pokeball.h" -#include "task.h" -#include "battle_anim_813F0F4.h" -#include "util.h" -#include "rom3.h" #include "global.h" #include "battle_811DA74.h" +#include "battle.h" +#include "battle_anim_813F0F4.h" +#include "battle_interface.h" #include "link.h" #include "m4a.h" #include "main.h" #include "palette.h" +#include "pokeball.h" #include "pokemon.h" +#include "rom3.h" +#include "rom_8077ABC.h" #include "sound.h" #include "sprite.h" #include "string_util.h" +#include "task.h" #include "text.h" +#include "util.h" struct UnknownStruct1 { diff --git a/src/battle_ai.c b/src/battle_ai.c index 18f4108c8..c9a3d16ca 100644 --- a/src/battle_ai.c +++ b/src/battle_ai.c @@ -1,5 +1,3 @@ -#include "util.h" -#include "rom_8077ABC.h" #include "global.h" #include "battle_ai.h" #include "abilities.h" @@ -10,7 +8,9 @@ #include "moves.h" #include "pokemon.h" #include "rng.h" +#include "rom_8077ABC.h" #include "species.h" +#include "util.h" extern u16 gBattleTypeFlags; extern u16 gBattleWeather; diff --git a/src/battle_anim.c b/src/battle_anim.c index ee9bc003d..90e5c97c3 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -1,14 +1,14 @@ -#include "rom_8077ABC.h" -#include "battle_interface.h" -#include "battle_anim_80CA710.h" -#include "contest.h" -#include "main.h" -#include "battle.h" #include "global.h" #include "battle_anim.h" +#include "battle.h" +#include "battle_anim_80CA710.h" +#include "battle_interface.h" +#include "contest.h" #include "decompress.h" #include "m4a.h" +#include "main.h" #include "palette.h" +#include "rom_8077ABC.h" #include "sound.h" #include "sprite.h" #include "task.h" diff --git a/src/battle_anim_80A7E7C.c b/src/battle_anim_80A7E7C.c index ca17dba8f..12b53d7d9 100644 --- a/src/battle_anim_80A7E7C.c +++ b/src/battle_anim_80A7E7C.c @@ -1,6 +1,6 @@ -#include "rom_8077ABC.h" #include "global.h" #include "battle_anim.h" +#include "rom_8077ABC.h" #include "sprite.h" #include "task.h" #include "trig.h" diff --git a/src/battle_anim_81258BC.c b/src/battle_anim_81258BC.c index 57b060174..fe4e9bd38 100644 --- a/src/battle_anim_81258BC.c +++ b/src/battle_anim_81258BC.c @@ -1,9 +1,9 @@ -#include "battle.h" -#include "battle_message.h" #include "global.h" #include "battle_anim_81258BC.h" -#include "text.h" +#include "battle.h" +#include "battle_message.h" #include "menu_cursor.h" +#include "text.h" extern struct Window gUnknown_03004210; extern u8 gUnknown_020238CC[]; @@ -13,7 +13,7 @@ extern const u8 gUnknown_08400CBB[]; extern u8 gUnknown_02024A60; extern const u8 gUnknown_08400D15[]; -extern void* gUnknown_03004330[]; +extern void *gUnknown_03004330[]; extern u16 gUnknown_030042A0; extern u16 gUnknown_030042A4; diff --git a/src/battle_interface.c b/src/battle_interface.c index b1c0c1497..e555bbad6 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -1,17 +1,17 @@ -#include "rom_8077ABC.h" -#include "task.h" -#include "safari_zone.h" -#include "pokedex.h" #include "global.h" #include "battle_interface.h" +#include "battle.h" +#include "decompress.h" +#include "palette.h" +#include "pokedex.h" +#include "rom_8077ABC.h" +#include "safari_zone.h" +#include "songs.h" +#include "sound.h" #include "sprite.h" #include "string_util.h" +#include "task.h" #include "text.h" -#include "decompress.h" -#include "sound.h" -#include "songs.h" -#include "battle.h" -#include "palette.h" struct UnknownStruct5 { diff --git a/src/battle_party_menu.c b/src/battle_party_menu.c index 8be774047..be34cd5c0 100644 --- a/src/battle_party_menu.c +++ b/src/battle_party_menu.c @@ -1,16 +1,16 @@ -#include "party_menu.h" -#include "rom_8094928.h" -#include "battle.h" -#include "item_menu.h" -#include "rom_8077ABC.h" -#include "menu_helpers.h" -#include "pokemon_summary_screen.h" #include "global.h" #include "battle_party_menu.h" +#include "battle.h" +#include "item_menu.h" #include "main.h" #include "menu.h" +#include "menu_helpers.h" #include "palette.h" +#include "party_menu.h" #include "pokemon.h" +#include "pokemon_summary_screen.h" +#include "rom_8077ABC.h" +#include "rom_8094928.h" #include "songs.h" #include "sound.h" #include "string_util.h" diff --git a/src/battle_setup.c b/src/battle_setup.c index 09a1b14e1..97e8ffe42 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -1,18 +1,17 @@ -#include "fldeff_80C5CD4.h" -#include "battle_transition.h" -#include "fieldmap.h" -#include "secret_base.h" -#include "field_fadetransition.h" #include "global.h" #include "battle_setup.h" #include "battle.h" +#include "battle_transition.h" #include "data2.h" #include "event_data.h" #include "field_control_avatar.h" +#include "field_fadetransition.h" #include "field_map_obj_helpers.h" #include "field_message_box.h" #include "field_player_avatar.h" #include "field_weather.h" +#include "fieldmap.h" +#include "fldeff_80C5CD4.h" #include "main.h" #include "map_constants.h" #include "metatile_behavior.h" @@ -23,6 +22,7 @@ #include "safari_zone.h" #include "script.h" #include "script_pokemon_80C4.h" +#include "secret_base.h" #include "songs.h" #include "sound.h" #include "species.h" diff --git a/src/berry.c b/src/berry.c index 470044709..d6fbb955e 100644 --- a/src/berry.c +++ b/src/berry.c @@ -1,10 +1,10 @@ -#include "field_map_obj.h" -#include "fieldmap.h" -#include "item_menu.h" #include "global.h" #include "berry.h" #include "field_control_avatar.h" +#include "field_map_obj.h" +#include "fieldmap.h" #include "item.h" +#include "item_menu.h" #include "items.h" #include "main.h" #include "rng.h" diff --git a/src/berry_tag_screen.c b/src/berry_tag_screen.c index 39cc7ac70..5647d4593 100644 --- a/src/berry_tag_screen.c +++ b/src/berry_tag_screen.c @@ -1,13 +1,13 @@ -#include "menu_helpers.h" -#include "item_menu.h" -#include "field_map_obj.h" #include "global.h" #include "berry_tag_screen.h" #include "berry.h" #include "decompress.h" +#include "field_map_obj.h" +#include "item_menu.h" #include "items.h" #include "main.h" #include "menu.h" +#include "menu_helpers.h" #include "palette.h" #include "rom4.h" #include "songs.h" diff --git a/src/bike.c b/src/bike.c index ca3b17bb7..f37eb2144 100644 --- a/src/bike.c +++ b/src/bike.c @@ -1,8 +1,8 @@ -#include "fieldmap.h" #include "global.h" #include "bike.h" #include "field_map_obj.h" #include "field_player_avatar.h" +#include "fieldmap.h" #include "flags.h" #include "global.fieldmap.h" #include "metatile_behavior.h" diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c index f0ef51ac2..4de945b9c 100644 --- a/src/braille_puzzles.c +++ b/src/braille_puzzles.c @@ -1,11 +1,11 @@ -#include "fieldmap.h" -#include "main.h" #include "global.h" #include "braille_puzzles.h" #include "event_data.h" #include "field_camera.h" #include "field_effect.h" +#include "fieldmap.h" #include "flags.h" +#include "main.h" #include "map_obj_lock.h" #include "menu.h" #include "rom6.h" diff --git a/src/clock.c b/src/clock.c index 669e4cf3c..1f2aac9fd 100644 --- a/src/clock.c +++ b/src/clock.c @@ -1,16 +1,16 @@ -#include "dewford_trend.h" -#include "field_weather.h" -#include "tv.h" -#include "time_events.h" -#include "field_specials.h" #include "global.h" #include "clock.h" #include "berry.h" +#include "dewford_trend.h" #include "event_data.h" +#include "field_specials.h" +#include "field_weather.h" #include "lottery_corner.h" #include "main.h" #include "rom4.h" #include "rtc.h" +#include "time_events.h" +#include "tv.h" #include "wallclock.h" static void InitTimeBasedEvents(void); diff --git a/src/contest_painting.c b/src/contest_painting.c index 3abcf85d1..eddcc87c1 100644 --- a/src/contest_painting.c +++ b/src/contest_painting.c @@ -1,7 +1,6 @@ -#include "unknown_task.h" -#include "cute_sketch.h" #include "global.h" #include "contest_painting.h" +#include "cute_sketch.h" #include "data2.h" #include "decompress.h" #include "main.h" @@ -12,6 +11,7 @@ #include "string_util.h" #include "strings.h" #include "text.h" +#include "unknown_task.h" extern u8 unk_2000000[]; extern u8 gUnknown_03000750; diff --git a/src/coord_event_weather.c b/src/coord_event_weather.c index 719ff05bf..9c5a1ca4d 100644 --- a/src/coord_event_weather.c +++ b/src/coord_event_weather.c @@ -1,6 +1,6 @@ -#include "field_weather.h" #include "global.h" #include "coord_event_weather.h" +#include "field_weather.h" struct CoordEventWeather { diff --git a/src/credits.c b/src/credits.c index 247a69dbd..e66fbe1e7 100644 --- a/src/credits.c +++ b/src/credits.c @@ -1,10 +1,9 @@ -#include "task.h" -#include "intro_credits_graphics.h" -#include "hall_of_fame.h" #include "global.h" #include "data2.h" #include "decompress.h" #include "event_data.h" +#include "hall_of_fame.h" +#include "intro_credits_graphics.h" #include "m4a.h" #include "main.h" #include "menu.h" @@ -15,6 +14,7 @@ #include "sound.h" #include "species.h" #include "starter_choose.h" +#include "task.h" #include "trig.h" asm(".set REG_BASE, 0x4000000"); diff --git a/src/diploma.c b/src/diploma.c index a9ea8a262..ba7de58aa 100644 --- a/src/diploma.c +++ b/src/diploma.c @@ -1,4 +1,3 @@ -#include "unknown_task.h" #include "global.h" #include "diploma.h" #include "main.h" @@ -11,6 +10,7 @@ #include "strings2.h" #include "task.h" #include "text.h" +#include "unknown_task.h" static void VBlankCB(void); static void MainCB2(void); diff --git a/src/field_camera.c b/src/field_camera.c index 163082282..1aed1549b 100644 --- a/src/field_camera.c +++ b/src/field_camera.c @@ -1,9 +1,9 @@ -#include "rotating_gate.h" -#include "fieldmap.h" #include "global.h" #include "field_camera.h" #include "berry.h" #include "field_player_avatar.h" +#include "fieldmap.h" +#include "rotating_gate.h" #include "sprite.h" #include "text.h" diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 60065fe5d..2d8140be5 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -1,25 +1,25 @@ -#include "fieldmap.h" -#include "start_menu.h" -#include "item_menu.h" -#include "secret_base.h" -#include "field_fadetransition.h" -#include "coord_event_weather.h" -#include "field_specials.h" -#include "daycare.h" -#include "field_poison.h" #include "global.h" #include "field_control_avatar.h" #include "battle_setup.h" #include "bike.h" +#include "coord_event_weather.h" +#include "daycare.h" #include "event_data.h" +#include "field_fadetransition.h" #include "field_player_avatar.h" +#include "field_poison.h" +#include "field_specials.h" +#include "fieldmap.h" #include "flags.h" +#include "item_menu.h" #include "metatile_behavior.h" #include "rom4.h" #include "safari_zone.h" #include "script.h" +#include "secret_base.h" #include "songs.h" #include "sound.h" +#include "start_menu.h" #include "trainer_see.h" #include "vars.h" #include "wild_encounter.h" diff --git a/src/field_door.c b/src/field_door.c index 62ebb9721..791ed4c94 100644 --- a/src/field_door.c +++ b/src/field_door.c @@ -1,7 +1,7 @@ -#include "fieldmap.h" #include "global.h" #include "field_door.h" #include "field_camera.h" +#include "fieldmap.h" #include "metatile_behavior.h" #include "task.h" diff --git a/src/field_fadetransition.c b/src/field_fadetransition.c index 125fc2c62..364d55e51 100644 --- a/src/field_fadetransition.c +++ b/src/field_fadetransition.c @@ -1,11 +1,11 @@ -#include "rom4.h" -#include "fldeff_flash.h" -#include "field_player_avatar.h" #include "global.h" #include "gba/syscall.h" #include "field_fadetransition.h" +#include "field_player_avatar.h" #include "field_weather.h" +#include "fldeff_flash.h" #include "global.fieldmap.h" +#include "rom4.h" #include "script.h" #include "task.h" diff --git a/src/field_ground_effect.c b/src/field_ground_effect.c index 357ba2df9..42862d0ff 100644 --- a/src/field_ground_effect.c +++ b/src/field_ground_effect.c @@ -1,6 +1,6 @@ -#include "fieldmap.h" #include "global.h" #include "field_ground_effect.h" +#include "fieldmap.h" #include "metatile_behavior.h" extern u32 gUnknown_08376008[]; diff --git a/src/field_map_obj.c b/src/field_map_obj.c old mode 100755 new mode 100644 index 1314cbc2c..3530f5579 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -1,18 +1,18 @@ -#include "field_effect_helpers.h" #include "global.h" #include "field_map_obj.h" -#include "field_map_obj_helpers.h" -#include "fieldmap.h" #include "berry.h" #include "event_data.h" -#include "field_player_avatar.h" +#include "field_camera.h" #include "field_effect.h" +#include "field_effect_helpers.h" #include "field_ground_effect.h" +#include "field_map_obj_helpers.h" +#include "field_player_avatar.h" +#include "fieldmap.h" #include "palette.h" -#include "rom4.h" #include "rng.h" +#include "rom4.h" #include "sprite.h" -#include "field_camera.h" extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[36]; diff --git a/src/field_map_obj_helpers.c b/src/field_map_obj_helpers.c index d93b429a0..e269cd924 100644 --- a/src/field_map_obj_helpers.c +++ b/src/field_map_obj_helpers.c @@ -1,8 +1,8 @@ -#include "field_map_obj.h" -#include "field_ground_effect.h" #include "global.h" #include "field_map_obj_helpers.h" #include "field_effect.h" +#include "field_ground_effect.h" +#include "field_map_obj.h" #include "sprite.h" typedef void (*SpriteStepFunc)(struct Sprite *sprite, u8 dir); diff --git a/src/field_message_box.c b/src/field_message_box.c index 925c13015..2cd2e66ab 100644 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -1,6 +1,6 @@ -#include "menu.h" #include "global.h" #include "field_message_box.h" +#include "menu.h" #include "string_util.h" #include "task.h" #include "text.h" diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 346c29bbb..3cdb45584 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -1,27 +1,27 @@ -#include "fieldmap.h" -#include "field_ground_effect.h" -#include "field_effect_helpers.h" -#include "tv.h" -#include "party_menu.h" -#include "rotating_gate.h" #include "global.h" #include "field_player_avatar.h" #include "bike.h" #include "event_data.h" #include "field_effect.h" +#include "field_effect_helpers.h" +#include "field_ground_effect.h" #include "field_map_obj.h" #include "field_map_obj_helpers.h" +#include "fieldmap.h" #include "main.h" #include "map_object_constants.h" #include "menu.h" #include "metatile_behavior.h" +#include "party_menu.h" #include "rng.h" #include "rom4.h" +#include "rotating_gate.h" #include "script.h" #include "songs.h" #include "sound.h" #include "strings2.h" #include "task.h" +#include "tv.h" #include "wild_encounter.h" extern u32 gUnknown_0202FF84[]; diff --git a/src/field_poison.c b/src/field_poison.c index e5edb6f76..8c9e029e1 100644 --- a/src/field_poison.c +++ b/src/field_poison.c @@ -1,9 +1,9 @@ -#include "pokemon_summary_screen.h" -#include "fldeff_80C5CD4.h" #include "global.h" #include "field_poison.h" #include "field_message_box.h" +#include "fldeff_80C5CD4.h" #include "pokemon.h" +#include "pokemon_summary_screen.h" #include "script.h" #include "string_util.h" #include "task.h" diff --git a/src/field_region_map.c b/src/field_region_map.c index 7616a1e27..58b0e37bc 100644 --- a/src/field_region_map.c +++ b/src/field_region_map.c @@ -1,12 +1,12 @@ -#include "region_map.h" #include "global.h" #include "field_region_map.h" #include "main.h" #include "menu.h" #include "palette.h" +#include "region_map.h" #include "sprite.h" -#include "text.h" #include "strings2.h" +#include "text.h" struct RegionMapStruct { diff --git a/src/field_special_scene.c b/src/field_special_scene.c index d4ce816fb..c88ac8f65 100644 --- a/src/field_special_scene.c +++ b/src/field_special_scene.c @@ -1,16 +1,16 @@ -#include "field_map_obj.h" -#include "field_specials.h" -#include "main.h" -#include "script_movement.h" -#include "field_fadetransition.h" -#include "fieldmap.h" #include "global.h" #include "field_special_scene.h" #include "event_data.h" #include "field_camera.h" +#include "field_fadetransition.h" +#include "field_map_obj.h" +#include "field_specials.h" +#include "fieldmap.h" +#include "main.h" #include "palette.h" #include "rom4.h" #include "script.h" +#include "script_movement.h" #include "songs.h" #include "sound.h" #include "sprite.h" diff --git a/src/field_specials.c b/src/field_specials.c index fda5efdea..2cb2cf795 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -1,6 +1,6 @@ -#include "diploma.h" #include "global.h" #include "field_specials.h" +#include "diploma.h" #include "event_data.h" #include "field_player_avatar.h" #include "main.h" diff --git a/src/fieldmap.c b/src/fieldmap.c index e138a7c57..c4e7dde8b 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -1,10 +1,10 @@ -#include "script.h" -#include "secret_base.h" -#include "rom4.h" -#include "tv.h" #include "global.h" #include "fieldmap.h" #include "palette.h" +#include "rom4.h" +#include "script.h" +#include "secret_base.h" +#include "tv.h" struct BackupMapData { diff --git a/src/fldeff_cut.c b/src/fldeff_cut.c index aabdde1eb..5bba4e888 100644 --- a/src/fldeff_cut.c +++ b/src/fldeff_cut.c @@ -1,20 +1,20 @@ -#include "pokemon_menu.h" -#include "fieldmap.h" -#include "task.h" #include "global.h" #include "fldeff_cut.h" #include "field_camera.h" #include "field_effect.h" #include "field_player_avatar.h" +#include "fieldmap.h" #include "map_obj_lock.h" #include "metatile_behavior.h" #include "metatile_behaviors.h" +#include "pokemon_menu.h" #include "rom4.h" #include "rom6.h" #include "script.h" #include "songs.h" #include "sound.h" #include "sprite.h" +#include "task.h" #include "trig.h" extern u8 gCutGrassSpriteArray[8]; // seems to be an array of 8 sprite IDs diff --git a/src/fldeff_softboiled.c b/src/fldeff_softboiled.c index 8a1a8d3b7..45f319c62 100644 --- a/src/fldeff_softboiled.c +++ b/src/fldeff_softboiled.c @@ -1,9 +1,9 @@ -#include "party_menu.h" -#include "pokemon_menu.h" #include "global.h" #include "fldeff_softboiled.h" #include "menu.h" +#include "party_menu.h" #include "pokemon.h" +#include "pokemon_menu.h" #include "songs.h" #include "sound.h" #include "sprite.h" diff --git a/src/fldeff_strength.c b/src/fldeff_strength.c index 8381e6f01..1de9ee8ca 100644 --- a/src/fldeff_strength.c +++ b/src/fldeff_strength.c @@ -1,9 +1,9 @@ -#include "pokemon_menu.h" -#include "party_menu.h" #include "global.h" #include "braille_puzzles.h" #include "field_effect.h" +#include "party_menu.h" #include "pokemon.h" +#include "pokemon_menu.h" #include "rom6.h" #include "script.h" #include "task.h" diff --git a/src/fldeff_sweetscent.c b/src/fldeff_sweetscent.c index 3ce0ac8e9..9716e21f1 100644 --- a/src/fldeff_sweetscent.c +++ b/src/fldeff_sweetscent.c @@ -1,8 +1,8 @@ -#include "pokemon_menu.h" #include "global.h" #include "field_effect.h" #include "field_player_avatar.h" #include "palette.h" +#include "pokemon_menu.h" #include "rom6.h" #include "script.h" #include "sound.h" diff --git a/src/fldeff_teleport.c b/src/fldeff_teleport.c index 489e20193..4fba1285f 100644 --- a/src/fldeff_teleport.c +++ b/src/fldeff_teleport.c @@ -1,11 +1,11 @@ -#include "task.h" -#include "pokemon_menu.h" #include "global.h" #include "fldeff_teleport.h" #include "field_effect.h" #include "field_player_avatar.h" +#include "pokemon_menu.h" #include "rom4.h" #include "rom6.h" +#include "task.h" extern u32 gUnknown_0202FF84[]; diff --git a/src/intro.c b/src/intro.c index 20cb36cd7..d5383b899 100644 --- a/src/intro.c +++ b/src/intro.c @@ -1,11 +1,10 @@ -#include "intro_credits_graphics.h" -#include "unknown_task.h" -#include "hall_of_fame.h" #include "global.h" #include "gba/m4a_internal.h" #include "intro.h" #include "data2.h" #include "decompress.h" +#include "hall_of_fame.h" +#include "intro_credits_graphics.h" #include "libgncmultiboot.h" #include "link.h" #include "m4a.h" @@ -20,6 +19,7 @@ #include "task.h" #include "title_screen.h" #include "trig.h" +#include "unknown_task.h" extern struct SpriteTemplate gUnknown_02024E8C; extern u16 gUnknown_02039318; diff --git a/src/item.c b/src/item.c index 16a11ba8d..920670e8f 100644 --- a/src/item.c +++ b/src/item.c @@ -1,6 +1,6 @@ -#include "berry.h" #include "global.h" #include "item.h" +#include "berry.h" #include "string_util.h" #include "strings.h" diff --git a/src/item_use.c b/src/item_use.c index 09173cf8e..8139114ba 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -1,24 +1,19 @@ -#include "pokemon_menu.h" -#include "pokeblock.h.h" -#include "item_menu.h" -#include "bike.h" -#include "field_fadetransition.h" -#include "pokemon_item_effect.h" -#include "party_menu.h" -#include "rom_8094928.h" -#include "field_effect.h" #include "global.h" #include "item_use.h" #include "battle.h" #include "berry.h" +#include "bike.h" #include "coins.h" #include "data2.h" #include "event_data.h" +#include "field_effect.h" +#include "field_fadetransition.h" #include "field_map_obj_helpers.h" #include "field_player_avatar.h" #include "field_weather.h" #include "fieldmap.h" #include "item.h" +#include "item_menu.h" #include "items.h" #include "mail.h" #include "main.h" @@ -27,7 +22,12 @@ #include "menu_helpers.h" #include "metatile_behavior.h" #include "palette.h" +#include "party_menu.h" +#include "pokeblock.h.h" +#include "pokemon_item_effect.h" +#include "pokemon_menu.h" #include "rom4.h" +#include "rom_8094928.h" #include "script.h" #include "songs.h" #include "sound.h" diff --git a/src/link.c b/src/link.c index 102714c39..6ad5a8fb7 100644 --- a/src/link.c +++ b/src/link.c @@ -1,7 +1,7 @@ -#include "berry_blender.h" #include "global.h" #include "link.h" #include "battle.h" +#include "berry_blender.h" #include "main.h" #include "menu.h" #include "palette.h" diff --git a/src/mail.c b/src/mail.c index 1f19bf230..6b26bafe9 100644 --- a/src/mail.c +++ b/src/mail.c @@ -1,20 +1,20 @@ -#include "easy_chat.h" -#include "mail_data.h" -#include "pokemon_icon.h" -#include "menu_helpers.h" -#include "unknown_task.h" #include "global.h" #include "mail.h" +#include "easy_chat.h" #include "items.h" +#include "mail_data.h" #include "menu.h" +#include "menu_helpers.h" #include "name_string_util.h" #include "palette.h" +#include "pokemon_icon.h" #include "rom4.h" #include "sprite.h" #include "string_util.h" #include "strings2.h" #include "task.h" #include "text.h" +#include "unknown_task.h" struct UnkMailStruct { diff --git a/src/mail_data.c b/src/mail_data.c index 9deb9f685..ae3f4b3e8 100644 --- a/src/mail_data.c +++ b/src/mail_data.c @@ -1,9 +1,9 @@ -#include "pokemon_icon.h" #include "global.h" #include "mail_data.h" #include "items.h" #include "name_string_util.h" #include "pokemon.h" +#include "pokemon_icon.h" #include "species.h" #include "text.h" diff --git a/src/main.c b/src/main.c index 9d4a3a1ed..afaa0e77a 100644 --- a/src/main.c +++ b/src/main.c @@ -1,5 +1,3 @@ -#include "rom3.h" -#include "unknown_task.h" #include "global.h" #include "gba/flash_internal.h" #include "gba/m4a_internal.h" @@ -10,10 +8,12 @@ #include "m4a.h" #include "play_time.h" #include "rng.h" +#include "rom3.h" #include "rom4.h" #include "rtc.h" #include "siirtc.h" #include "sound.h" +#include "unknown_task.h" extern struct SoundInfo gSoundInfo; extern u32 IntrMain[]; diff --git a/src/main_menu.c b/src/main_menu.c index 1a9ed9dd9..28473c166 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -1,16 +1,15 @@ -#include "unknown_task.h" -#include "field_effect.h" -#include "pokeball.h" #include "global.h" #include "main_menu.h" #include "data2.h" #include "decompress.h" #include "event_data.h" +#include "field_effect.h" #include "menu.h" #include "mystery_event_menu.h" #include "naming_screen.h" #include "option_menu.h" #include "palette.h" +#include "pokeball.h" #include "rom4.h" #include "rtc.h" #include "save_menu_util.h" @@ -22,6 +21,7 @@ #include "task.h" #include "text.h" #include "title_screen.h" +#include "unknown_task.h" #define BirchSpeechUpdateWindowText() ((u8)MenuUpdateWindowText_OverrideLineLength(24)) diff --git a/src/map_name_popup.c b/src/map_name_popup.c index e47b89d07..303cc3d07 100644 --- a/src/map_name_popup.c +++ b/src/map_name_popup.c @@ -1,8 +1,8 @@ -#include "region_map.h" #include "global.h" #include "map_name_popup.h" #include "event_data.h" #include "menu.h" +#include "region_map.h" #include "task.h" EWRAM_DATA static u8 sTaskId = 0; diff --git a/src/map_obj_lock.c b/src/map_obj_lock.c index 1aeb248ee..bd40bcacc 100644 --- a/src/map_obj_lock.c +++ b/src/map_obj_lock.c @@ -1,9 +1,9 @@ -#include "field_map_obj.h" -#include "script_movement.h" #include "global.h" #include "map_obj_lock.h" +#include "field_map_obj.h" #include "field_map_obj_helpers.h" #include "field_player_avatar.h" +#include "script_movement.h" #include "task.h" extern u16 gScriptFacing; diff --git a/src/matsuda_debug_menu.c b/src/matsuda_debug_menu.c index a9a6079a1..3665cabd8 100644 --- a/src/matsuda_debug_menu.c +++ b/src/matsuda_debug_menu.c @@ -1,9 +1,8 @@ -#include "contest_link_80C2020.h" -#include "contest_link_80C857C.h" -#include "unknown_task.h" #include "global.h" #include "matsuda_debug_menu.h" #include "contest.h" +#include "contest_link_80C2020.h" +#include "contest_link_80C857C.h" #include "data2.h" #include "link.h" #include "main.h" @@ -15,6 +14,7 @@ #include "string_util.h" #include "task.h" #include "text.h" +#include "unknown_task.h" extern u8 gUnknown_0203856C; extern u8 gUnknown_0203857D[][64]; diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index d5d2ae3a9..93684fc60 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -1,12 +1,12 @@ -#include "easy_chat.h" -#include "trader.h" #include "global.h" #include "mauville_old_man.h" +#include "easy_chat.h" #include "menu.h" #include "rng.h" #include "script.h" #include "string_util.h" #include "strings.h" +#include "trader.h" extern u16 gScriptResult; extern u16 gSpecialVar_0x8004; diff --git a/src/mori_debug_menu.c b/src/mori_debug_menu.c index 50a090026..b2e1116a9 100644 --- a/src/mori_debug_menu.c +++ b/src/mori_debug_menu.c @@ -1,12 +1,12 @@ -#include "daycare.h" -#include "pokeblock.h.h" -#include "learn_move.h" #include "global.h" #include "mori_debug_menu.h" #include "data2.h" +#include "daycare.h" +#include "learn_move.h" #include "link.h" #include "main.h" #include "menu.h" +#include "pokeblock.h.h" #include "start_menu.h" #include "string_util.h" diff --git a/src/mystery_event_menu.c b/src/mystery_event_menu.c index 8254bbbec..4be5dec1c 100644 --- a/src/mystery_event_menu.c +++ b/src/mystery_event_menu.c @@ -1,9 +1,9 @@ -#include "mystery_event_script.h" #include "global.h" #include "mystery_event_menu.h" #include "link.h" #include "main.h" #include "menu.h" +#include "mystery_event_script.h" #include "palette.h" #include "save.h" #include "songs.h" diff --git a/src/naming_screen.c b/src/naming_screen.c index 65e55e284..88059e669 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -1,14 +1,13 @@ -#include "util.h" -#include "field_player_avatar.h" -#include "field_map_obj.h" -#include "pokemon_icon.h" -#include "field_effect.h" #include "global.h" #include "naming_screen.h" #include "data2.h" +#include "field_effect.h" +#include "field_map_obj.h" +#include "field_player_avatar.h" #include "main.h" #include "menu.h" #include "palette.h" +#include "pokemon_icon.h" #include "songs.h" #include "sound.h" #include "sprite.h" @@ -17,6 +16,7 @@ #include "task.h" #include "text.h" #include "trig.h" +#include "util.h" extern u16 gKeyRepeatStartDelay; diff --git a/src/new_game.c b/src/new_game.c index a1f949fdd..d22babb4a 100644 --- a/src/new_game.c +++ b/src/new_game.c @@ -1,30 +1,30 @@ -#include "item_menu.h" -#include "mail_data.h" -#include "tv.h" -#include "secret_base.h" -#include "contest.h" -#include "battle_records.h" -#include "pokemon_storage_system.h" -#include "player_pc.h" -#include "decoration_inventory.h" -#include "pokeblock.h.h" -#include "mauville_old_man.h" -#include "easy_chat.h" -#include "field_specials.h" #include "global.h" #include "new_game.h" +#include "battle_records.h" #include "berry.h" +#include "contest.h" +#include "decoration_inventory.h" #include "dewford_trend.h" +#include "easy_chat.h" #include "event_data.h" +#include "field_specials.h" +#include "item_menu.h" #include "lottery_corner.h" +#include "mail_data.h" +#include "mauville_old_man.h" #include "play_time.h" +#include "player_pc.h" +#include "pokeblock.h.h" #include "pokedex.h" #include "pokemon_size_record.h" +#include "pokemon_storage_system.h" #include "rng.h" #include "roamer.h" #include "rom4.h" #include "rtc.h" #include "script.h" +#include "secret_base.h" +#include "tv.h" extern u8 gDifferentSaveFile; diff --git a/src/party_menu.c b/src/party_menu.c index 549a2a45a..7d21de63c 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -1,28 +1,28 @@ -#include "mail_data.h" -#include "pokemon_summary_screen.h" -#include "pokemon_menu.h" -#include "rom_8077ABC.h" -#include "battle.h" -#include "battle_party_menu.h" -#include "rom_8094928.h" -#include "pokemon_item_effect.h" #include "global.h" #include "party_menu.h" +#include "battle.h" +#include "battle_interface.h" +#include "battle_party_menu.h" #include "data2.h" +#include "event_data.h" +#include "item.h" +#include "mail_data.h" +#include "main.h" #include "menu.h" +#include "palette.h" #include "pokemon.h" +#include "pokemon_item_effect.h" +#include "pokemon_menu.h" +#include "pokemon_summary_screen.h" +#include "rom_8077ABC.h" +#include "rom_8094928.h" #include "songs.h" #include "sound.h" +#include "species.h" +#include "sprite.h" #include "string_util.h" #include "strings.h" #include "task.h" -#include "sprite.h" -#include "palette.h" -#include "event_data.h" -#include "main.h" -#include "item.h" -#include "battle_interface.h" -#include "species.h" #define DATA_COUNT (6) diff --git a/src/player_pc.c b/src/player_pc.c index 95ce07b2c..822365222 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -1,10 +1,10 @@ -#include "item_menu.h" -#include "field_fadetransition.h" -#include "decoration.h" #include "global.h" #include "player_pc.h" +#include "decoration.h" +#include "field_fadetransition.h" #include "field_weather.h" #include "item.h" +#include "item_menu.h" #include "items.h" #include "main.h" #include "menu.h" diff --git a/src/pokedex.c b/src/pokedex.c index 89dcd293b..53becdb1f 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -1,5 +1,4 @@ -#include "unknown_task.h" #include "global.h" #include "gba/m4a_internal.h" #include "pokedex.h" @@ -9,16 +8,17 @@ #include "main.h" #include "menu.h" #include "palette.h" +#include "pokedex_area_screen.h" +#include "pokedex_cry_screen.h" #include "rng.h" +#include "rom4.h" #include "songs.h" #include "sound.h" #include "string_util.h" #include "strings.h" #include "task.h" #include "trig.h" -#include "rom4.h" -#include "pokedex_cry_screen.h" -#include "pokedex_area_screen.h" +#include "unknown_task.h" // I'm #define-ing these just for now so I can keep using the old unkXXX member names #define unk60E selectedPokemon diff --git a/src/pokemon_1.c b/src/pokemon_1.c index a8e5dfa32..c55105ef3 100644 --- a/src/pokemon_1.c +++ b/src/pokemon_1.c @@ -1,8 +1,8 @@ #include "global.h" -#include "pokemon.h" #include "data2.h" #include "items.h" #include "main.h" +#include "pokemon.h" #include "rng.h" #include "rom4.h" #include "species.h" diff --git a/src/pokemon_2.c b/src/pokemon_2.c index cab68b07e..91cd77f86 100644 --- a/src/pokemon_2.c +++ b/src/pokemon_2.c @@ -1,17 +1,17 @@ -#include "rom_8077ABC.h" -#include "util.h" -#include "battle.h" #include "global.h" -#include "pokemon.h" +#include "battle.h" #include "data2.h" #include "event_data.h" #include "main.h" +#include "pokemon.h" #include "rng.h" +#include "rom_8077ABC.h" #include "species.h" #include "sprite.h" #include "string_util.h" -#include "text.h" #include "strings2.h" +#include "text.h" +#include "util.h" extern u8 gPlayerPartyCount; extern u8 gEnemyPartyCount; diff --git a/src/pokemon_3.c b/src/pokemon_3.c index 8622c11d9..98fa68302 100644 --- a/src/pokemon_3.c +++ b/src/pokemon_3.c @@ -1,20 +1,19 @@ -#include "battle_message.h" -#include "rom_8077ABC.h" -#include "rom_8094928.h" -#include "util.h" #include "global.h" -#include "pokemon.h" #include "battle.h" +#include "battle_message.h" #include "data2.h" #include "event_data.h" #include "hold_effects.h" #include "item.h" #include "items.h" #include "link.h" -#include "main.h" #include "m4a.h" +#include "main.h" +#include "pokemon.h" #include "rng.h" #include "rom4.h" +#include "rom_8077ABC.h" +#include "rom_8094928.h" #include "rtc.h" #include "songs.h" #include "sound.h" @@ -22,6 +21,7 @@ #include "sprite.h" #include "string_util.h" #include "text.h" +#include "util.h" #define EVO_FRIENDSHIP 0x0001 // Pokémon levels up with friendship ≥ 220 #define EVO_FRIENDSHIP_DAY 0x0002 // Pokémon levels up during the day with friendship ≥ 220 diff --git a/src/pokemon_size_record.c b/src/pokemon_size_record.c index b96bdcf5f..f293190e8 100644 --- a/src/pokemon_size_record.c +++ b/src/pokemon_size_record.c @@ -1,8 +1,8 @@ -#include "pokedex.h" #include "global.h" #include "pokemon_size_record.h" #include "data2.h" #include "event_data.h" +#include "pokedex.h" #include "species.h" #include "string_util.h" #include "strings2.h" diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 47af6c6f9..61ae11438 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -1,12 +1,12 @@ -#include "region_map.h" -#include "tv.h" #include "global.h" #include "pokemon_summary_screen.h" #include "link.h" #include "menu.h" #include "pokemon.h" +#include "region_map.h" #include "string_util.h" #include "strings2.h" +#include "tv.h" extern struct Pokemon *unk_2018000; diff --git a/src/post_battle_event_funcs.c b/src/post_battle_event_funcs.c index 44fb2d66a..8d85705c8 100644 --- a/src/post_battle_event_funcs.c +++ b/src/post_battle_event_funcs.c @@ -1,6 +1,6 @@ -#include "hall_of_fame.h" #include "global.h" #include "event_data.h" +#include "hall_of_fame.h" #include "load_save.h" #include "main.h" #include "pokemon.h" diff --git a/src/record_mixing.c b/src/record_mixing.c index 02dd6181f..3b1076626 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -1,24 +1,24 @@ -#include "cable_club.h" -#include "secret_base.h" -#include "mauville_old_man.h" -#include "battle_tower.h" -#include "tv.h" -#include "mystery_event_script.h" -#include "daycare.h" -#include "fldeff_80C5CD4.h" #include "global.h" #include "record_mixing.h" +#include "battle_tower.h" +#include "cable_club.h" +#include "daycare.h" #include "dewford_trend.h" #include "event_data.h" +#include "fldeff_80C5CD4.h" #include "link.h" +#include "mauville_old_man.h" #include "menu.h" +#include "mystery_event_script.h" #include "rom4.h" #include "script.h" +#include "secret_base.h" #include "songs.h" #include "sound.h" #include "string_util.h" #include "strings2.h" #include "task.h" +#include "tv.h" extern void *recordMixingSecretBases; extern void *recordMixingTvShows; diff --git a/src/rom3.c b/src/rom3.c index 21c63af78..93f0f0356 100644 --- a/src/rom3.c +++ b/src/rom3.c @@ -1,19 +1,19 @@ -#include "battle_anim.h" -#include "battle_ai.h" -#include "rom_8094928.h" +#include "global.h" +#include "rom3.h" +#include "battle.h" #include "battle_811DA74.h" -#include "util.h" +#include "battle_ai.h" +#include "battle_anim.h" #include "battle_anim_81258BC.h" #include "battle_anim_8137220.h" #include "cable_club.h" -#include "global.h" -#include "rom3.h" -#include "battle.h" #include "items.h" #include "link.h" #include "pokemon.h" +#include "rom_8094928.h" #include "species.h" #include "task.h" +#include "util.h" extern u8 unk_2000000[]; diff --git a/src/rom4.c b/src/rom4.c index be07e5867..04071cedb 100644 --- a/src/rom4.c +++ b/src/rom4.c @@ -1,36 +1,31 @@ -#include "field_specials.h" -#include "fieldmap.h" -#include "tv.h" -#include "secret_base.h" -#include "map_name_popup.h" -#include "field_fadetransition.h" -#include "fldeff_flash.h" -#include "unknown_task.h" -#include "cable_club.h" -#include "field_ground_effect.h" -#include "field_tasks.h" -#include "rotating_gate.h" -#include "field_screen_effect.h" -#include "time_events.h" #include "global.h" #include "rom4.h" #include "battle_setup.h" #include "berry.h" +#include "cable_club.h" #include "clock.h" #include "event_data.h" #include "field_camera.h" #include "field_control_avatar.h" #include "field_effect.h" +#include "field_fadetransition.h" +#include "field_ground_effect.h" #include "field_map_obj.h" #include "field_map_obj_helpers.h" #include "field_message_box.h" #include "field_player_avatar.h" -#include "field_weather.h" +#include "field_screen_effect.h" #include "field_special_scene.h" +#include "field_specials.h" +#include "field_tasks.h" +#include "field_weather.h" +#include "fieldmap.h" +#include "fldeff_flash.h" #include "heal_location.h" #include "link.h" #include "load_save.h" #include "main.h" +#include "map_name_popup.h" #include "menu.h" #include "metatile_behavior.h" #include "new_game.h" @@ -38,14 +33,19 @@ #include "play_time.h" #include "rng.h" #include "roamer.h" +#include "rotating_gate.h" #include "safari_zone.h" #include "script.h" #include "script_pokemon_80C4.h" +#include "secret_base.h" #include "songs.h" #include "sound.h" #include "start_menu.h" #include "task.h" #include "tileset_anim.h" +#include "time_events.h" +#include "tv.h" +#include "unknown_task.h" #include "wild_encounter.h" #ifdef SAPPHIRE diff --git a/src/rom6.c b/src/rom6.c index c466e724d..d5314fdec 100644 --- a/src/rom6.c +++ b/src/rom6.c @@ -1,11 +1,11 @@ -#include "field_map_obj.h" -#include "pokemon_menu.h" -#include "item_use.h" #include "global.h" #include "rom6.h" #include "braille_puzzles.h" #include "field_effect.h" +#include "field_map_obj.h" #include "field_player_avatar.h" +#include "item_use.h" +#include "pokemon_menu.h" #include "rom4.h" #include "script.h" #include "songs.h" diff --git a/src/rom_8077ABC.c b/src/rom_8077ABC.c index 7e079c0d3..a31a764fb 100644 --- a/src/rom_8077ABC.c +++ b/src/rom_8077ABC.c @@ -1,17 +1,17 @@ -#include "util.h" -#include "battle_anim.h" -#include "pokemon_icon.h" #include "global.h" #include "rom_8077ABC.h" #include "battle.h" +#include "battle_anim.h" #include "blend_palette.h" #include "data2.h" #include "decompress.h" #include "palette.h" +#include "pokemon_icon.h" #include "species.h" #include "sprite.h" #include "task.h" #include "trig.h" +#include "util.h" #define GET_UNOWN_LETTER(personality) ((\ (((personality & 0x03000000) >> 24) << 6) \ diff --git a/src/rom_8094928.c b/src/rom_8094928.c index de1823d88..b927fe329 100644 --- a/src/rom_8094928.c +++ b/src/rom_8094928.c @@ -1,7 +1,7 @@ -#include "party_menu.h" -#include "rom_8077ABC.h" #include "global.h" #include "rom_8094928.h" +#include "party_menu.h" +#include "rom_8077ABC.h" #define UNK_201606C_ARRAY (unk_2000000 + 0x1606C) // lazy define but whatever. diff --git a/src/safari_zone.c b/src/safari_zone.c index 74f1a9f0b..f3fc2a0ad 100644 --- a/src/safari_zone.c +++ b/src/safari_zone.c @@ -1,7 +1,7 @@ -#include "field_fadetransition.h" #include "global.h" #include "safari_zone.h" #include "event_data.h" +#include "field_fadetransition.h" #include "field_player_avatar.h" #include "main.h" #include "rom4.h" diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index 07f90ed17..a64b3eb5f 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -1,4 +1,3 @@ -#include "starter_choose.h" #include "global.h" #include "gba/flash_internal.h" #include "save_failed_screen.h" @@ -8,6 +7,7 @@ #include "palette.h" #include "save.h" #include "sprite.h" +#include "starter_choose.h" #include "strings.h" #include "task.h" #include "text.h" diff --git a/src/save_menu_util.c b/src/save_menu_util.c index 19bd178ad..b2dd662d6 100644 --- a/src/save_menu_util.c +++ b/src/save_menu_util.c @@ -1,9 +1,9 @@ -#include "region_map.h" #include "global.h" #include "save_menu_util.h" #include "event_data.h" #include "menu.h" #include "pokedex.h" +#include "region_map.h" #include "string_util.h" #include "strings2.h" diff --git a/src/scrcmd.c b/src/scrcmd.c index 965a1aa88..f309b4f93 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1,48 +1,48 @@ -#include "decoration_inventory.h" -#include "field_screen_effect.h" -#include "field_map_obj.h" -#include "script_movement.h" -#include "field_fadetransition.h" -#include "mystery_event_script.h" -#include "contest_link_80C2020.h" -#include "fieldmap.h" -#include "field_specials.h" -#include "shop.h" -#include "party_menu.h" -#include "field_tasks.h" -#include "tv.h" -#include "slot_machine.h" #include "global.h" #include "battle_setup.h" #include "berry.h" #include "clock.h" #include "coins.h" +#include "contest_link_80C2020.h" #include "contest_painting.h" #include "data2.h" #include "decoration.h" +#include "decoration_inventory.h" #include "event_data.h" #include "field_door.h" #include "field_effect.h" +#include "field_fadetransition.h" +#include "field_map_obj.h" #include "field_map_obj_helpers.h" #include "field_message_box.h" #include "field_player_avatar.h" +#include "field_screen_effect.h" +#include "field_specials.h" +#include "field_tasks.h" #include "field_weather.h" +#include "fieldmap.h" #include "item.h" #include "main.h" #include "map_obj_lock.h" #include "menu.h" #include "money.h" +#include "mystery_event_script.h" #include "palette.h" +#include "party_menu.h" #include "pokemon.h" #include "rng.h" #include "rom4.h" #include "rtc.h" #include "script.h" #include "script_menu.h" +#include "script_movement.h" #include "script_pokemon_80C4.h" #include "script_pokemon_80F9.h" +#include "shop.h" +#include "slot_machine.h" #include "sound.h" #include "string_util.h" +#include "tv.h" typedef u16 (*SpecialFunc)(void); typedef void (*NativeFunc)(void); diff --git a/src/script_menu.c b/src/script_menu.c index 98c55e678..4669a362a 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -1,7 +1,7 @@ -#include "field_effect.h" #include "global.h" #include "script_menu.h" #include "event_data.h" +#include "field_effect.h" #include "menu.h" #include "palette.h" #include "script.h" diff --git a/src/script_movement.c b/src/script_movement.c index f1033c525..31143ed6f 100644 --- a/src/script_movement.c +++ b/src/script_movement.c @@ -1,9 +1,9 @@ -#include "field_map_obj.h" -#include "util.h" #include "global.h" #include "script_movement.h" +#include "field_map_obj.h" #include "field_map_obj_helpers.h" #include "task.h" +#include "util.h" extern u8 *gUnknown_020384F8[]; diff --git a/src/script_pokemon_util_80C4BF0.c b/src/script_pokemon_util_80C4BF0.c index 6f5b941f4..8edae138a 100644 --- a/src/script_pokemon_util_80C4BF0.c +++ b/src/script_pokemon_util_80C4BF0.c @@ -1,13 +1,13 @@ -#include "contest_link_80C2020.h" -#include "daycare.h" -#include "contest_painting.h" -#include "debug.h" -#include "choose_party.h" #include "global.h" #include "battle.h" #include "berry.h" +#include "choose_party.h" #include "contest.h" +#include "contest_link_80C2020.h" +#include "contest_painting.h" #include "data2.h" +#include "daycare.h" +#include "debug.h" #include "decompress.h" #include "event_data.h" #include "items.h" diff --git a/src/script_pokemon_util_80F99CC.c b/src/script_pokemon_util_80F99CC.c index 29c4560c0..25c467312 100644 --- a/src/script_pokemon_util_80F99CC.c +++ b/src/script_pokemon_util_80F99CC.c @@ -1,13 +1,13 @@ -#include "party_menu.h" -#include "contest.h" -#include "choose_party.h" -#include "pokemon_summary_screen.h" -#include "field_fadetransition.h" #include "global.h" #include "battle_party_menu.h" +#include "choose_party.h" +#include "contest.h" #include "data2.h" +#include "field_fadetransition.h" #include "palette.h" +#include "party_menu.h" #include "pokemon.h" +#include "pokemon_summary_screen.h" #include "rom4.h" #include "script.h" #include "script_pokemon_80F9.h" diff --git a/src/secret_base.c b/src/secret_base.c index 0d558f02b..91878abaf 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -1,25 +1,25 @@ -#include "fieldmap.h" -#include "field_fadetransition.h" -#include "main.h" -#include "map_name_popup.h" #include "global.h" #include "secret_base.h" -#include "string_util.h" -#include "strings.h" -#include "text.h" +#include "decoration.h" #include "event_data.h" -#include "vars.h" -#include "rom4.h" -#include "script.h" -#include "field_player_avatar.h" #include "field_camera.h" -#include "map_constants.h" -#include "task.h" -#include "palette.h" -#include "decoration.h" +#include "field_fadetransition.h" +#include "field_player_avatar.h" #include "field_weather.h" +#include "fieldmap.h" +#include "main.h" +#include "map_constants.h" +#include "map_name_popup.h" #include "metatile_behavior.h" +#include "palette.h" #include "pokemon.h" +#include "rom4.h" +#include "script.h" +#include "string_util.h" +#include "strings.h" +#include "task.h" +#include "text.h" +#include "vars.h" extern u8 gUnknown_020387DC; extern u16 gSpecialVar_0x8004; diff --git a/src/shop.c b/src/shop.c index 4eee33632..3b315121e 100644 --- a/src/shop.c +++ b/src/shop.c @@ -1,14 +1,12 @@ -#include "menu_helpers.h" -#include "field_fadetransition.h" -#include "item_menu.h" -#include "tv.h" -#include "unknown_task.h" #include "global.h" #include "shop.h" #include "decompress.h" +#include "field_fadetransition.h" #include "field_weather.h" +#include "item_menu.h" #include "main.h" #include "menu.h" +#include "menu_helpers.h" #include "money.h" #include "palette.h" #include "script.h" @@ -16,6 +14,8 @@ #include "sprite.h" #include "strings.h" #include "task.h" +#include "tv.h" +#include "unknown_task.h" struct UnknownShopStruct { diff --git a/src/smokescreen.c b/src/smokescreen.c index 327b6ae6f..8345cb6ad 100644 --- a/src/smokescreen.c +++ b/src/smokescreen.c @@ -1,8 +1,8 @@ -#include "util.h" #include "global.h" #include "data2.h" #include "decompress.h" #include "sprite.h" +#include "util.h" static void sub_8046388(struct Sprite *); diff --git a/src/sound.c b/src/sound.c index 988feeb2c..c9c4916b0 100644 --- a/src/sound.c +++ b/src/sound.c @@ -1,9 +1,9 @@ -#include "main.h" #include "global.h" #include "gba/m4a_internal.h" #include "sound.h" #include "battle.h" #include "m4a.h" +#include "main.h" #include "songs.h" #include "task.h" diff --git a/src/start_menu.c b/src/start_menu.c index 6c3b411bc..f6d50db71 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -1,14 +1,11 @@ -#include "item_menu.h" -#include "pokenav.h" -#include "pokemon_menu.h" -#include "unknown_task.h" -#include "fieldmap.h" #include "global.h" #include "start_menu.h" #include "event_data.h" #include "field_map_obj_helpers.h" #include "field_player_avatar.h" #include "field_weather.h" +#include "fieldmap.h" +#include "item_menu.h" #include "load_save.h" #include "main.h" #include "map_obj_lock.h" @@ -16,6 +13,8 @@ #include "option_menu.h" #include "palette.h" #include "pokedex.h" +#include "pokemon_menu.h" +#include "pokenav.h" #include "rom4.h" #include "safari_zone.h" #include "save.h" @@ -29,6 +28,7 @@ #include "strings2.h" #include "task.h" #include "trainer_card.h" +#include "unknown_task.h" //Menu actions enum { diff --git a/src/starter_choose.c b/src/starter_choose.c index dd35ab9df..0e3c6ad16 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -1,4 +1,3 @@ -#include "unknown_task.h" #include "global.h" #include "starter_choose.h" #include "data2.h" @@ -15,6 +14,7 @@ #include "strings.h" #include "task.h" #include "trig.h" +#include "unknown_task.h" extern u16 gScriptResult; extern struct SpriteTemplate gUnknown_02024E8C; diff --git a/src/time_events.c b/src/time_events.c index f05828bec..e1b9a2e9e 100644 --- a/src/time_events.c +++ b/src/time_events.c @@ -1,7 +1,7 @@ -#include "field_weather.h" #include "global.h" #include "time_events.h" #include "event_data.h" +#include "field_weather.h" #include "pokemon.h" #include "rng.h" #include "rom4.h" diff --git a/src/title_screen.c b/src/title_screen.c index 25967a91a..12c31d10a 100644 --- a/src/title_screen.c +++ b/src/title_screen.c @@ -1,5 +1,3 @@ -#include "unknown_task.h" -#include "reset_rtc_screen.h" #include "global.h" #include "gba/m4a_internal.h" #include "title_screen.h" @@ -11,9 +9,11 @@ #include "main.h" #include "main_menu.h" #include "palette.h" +#include "reset_rtc_screen.h" #include "sound.h" #include "sprite.h" #include "task.h" +#include "unknown_task.h" extern u8 gReservedSpritePaletteCount; extern struct MusicPlayerInfo gMPlay_BGM; diff --git a/src/trainer_card.c b/src/trainer_card.c index d5567b12a..b2a1ad71b 100644 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -1,10 +1,8 @@ -#include "unknown_task.h" -#include "easy_chat.h" -#include "util.h" -#include "field_effect.h" #include "global.h" #include "trainer_card.h" +#include "easy_chat.h" #include "event_data.h" +#include "field_effect.h" #include "link.h" #include "main.h" #include "menu.h" @@ -19,6 +17,8 @@ #include "string_util.h" #include "strings2.h" #include "task.h" +#include "unknown_task.h" +#include "util.h" typedef void (*Callback)(void); diff --git a/src/tv.c b/src/tv.c index b7a4e206a..0881a2d2b 100644 --- a/src/tv.c +++ b/src/tv.c @@ -1,29 +1,29 @@ -#include "battle_tower.h" -#include "field_specials.h" -#include "region_map.h" -#include "script_menu.h" -#include "field_map_obj.h" #include "global.h" #include "tv.h" +#include "battle_tower.h" +#include "contest_painting.h" #include "data2.h" +#include "easy_chat.h" #include "event_data.h" +#include "field_map_obj.h" #include "field_message_box.h" +#include "field_specials.h" #include "flags.h" -#include "rng.h" -#include "string_util.h" -#include "text.h" -#include "species.h" -#include "pokedex.h" -#include "naming_screen.h" -#include "rom4.h" -#include "map_constants.h" -#include "strings.h" -#include "link.h" -#include "easy_chat.h" #include "item.h" #include "items.h" -#include "contest_painting.h" +#include "link.h" +#include "map_constants.h" +#include "naming_screen.h" +#include "pokedex.h" +#include "region_map.h" +#include "rng.h" +#include "rom4.h" #include "rtc.h" +#include "script_menu.h" +#include "species.h" +#include "string_util.h" +#include "strings.h" +#include "text.h" struct UnkTvStruct { diff --git a/src/wallclock.c b/src/wallclock.c index 1fe4cc19b..7faa177b0 100644 --- a/src/wallclock.c +++ b/src/wallclock.c @@ -1,4 +1,3 @@ -#include "unknown_task.h" #include "global.h" #include "wallclock.h" #include "decompress.h" @@ -11,6 +10,7 @@ #include "strings2.h" #include "task.h" #include "trig.h" +#include "unknown_task.h" extern u16 gSpecialVar_0x8004; extern u8 gMiscClock_Gfx[]; diff --git a/src/wild_encounter.c b/src/wild_encounter.c index 0746c7a90..143587438 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -1,19 +1,19 @@ -#include "fieldmap.h" -#include "pokeblock.h.h" -#include "tv.h" #include "global.h" #include "wild_encounter.h" #include "abilities.h" #include "battle_setup.h" #include "event_data.h" #include "field_player_avatar.h" +#include "fieldmap.h" #include "metatile_behavior.h" +#include "pokeblock.h.h" #include "rng.h" #include "roamer.h" #include "rom4.h" #include "safari_zone.h" #include "script.h" #include "species.h" +#include "tv.h" struct WildPokemon { -- cgit v1.2.3 From 2aae7e99d52fc488e75309909d279b459f5e1d80 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Fri, 26 May 2017 15:35:40 +0200 Subject: Make rom build again --- src/field_map_obj_helpers.c | 1 - src/hof_pc.c | 1 + src/item_use.c | 2 +- src/link.c | 7 ++----- src/mail.c | 2 +- src/party_menu.c | 2 ++ src/pokemon_3.c | 12 ++++++------ src/scrcmd.c | 2 +- src/script_pokemon_util_80C4BF0.c | 3 +-- src/starter_choose.c | 2 +- src/tv.c | 18 +++++++++--------- 11 files changed, 25 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/field_map_obj_helpers.c b/src/field_map_obj_helpers.c index e269cd924..977183beb 100644 --- a/src/field_map_obj_helpers.c +++ b/src/field_map_obj_helpers.c @@ -9,7 +9,6 @@ typedef void (*SpriteStepFunc)(struct Sprite *sprite, u8 dir); extern u32 gUnknown_0202FF84[]; -extern struct UCoords16 gDirectionToVector[]; extern s16 gUnknown_08376194[]; extern SpriteStepFunc *gUnknown_08376180[]; extern s8 *gUnknown_083761D0[]; diff --git a/src/hof_pc.c b/src/hof_pc.c index 287fef572..6e932d1e5 100644 --- a/src/hof_pc.c +++ b/src/hof_pc.c @@ -1,4 +1,5 @@ #include "global.h" +#include "hall_of_fame.h" #include "main.h" #include "palette.h" #include "rom4.h" diff --git a/src/item_use.c b/src/item_use.c index 8139114ba..6e7ccfae0 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -38,7 +38,7 @@ extern void (* gUnknown_03005D00)(u8); extern void (* gUnknown_0300485C)(void); -extern void (* gUnknown_03004AE4)(u8); +extern void (* gUnknown_03004AE4)(u8, u16, TaskFunc); extern u8 gUnknown_02038561; extern u8 gLastFieldPokeMenuOpened; diff --git a/src/link.c b/src/link.c index 6ad5a8fb7..5f6c32370 100644 --- a/src/link.c +++ b/src/link.c @@ -1,7 +1,9 @@ #include "global.h" #include "link.h" #include "battle.h" +#include "berry.h" #include "berry_blender.h" +#include "hall_of_fame.h" #include "main.h" #include "menu.h" #include "palette.h" @@ -76,11 +78,6 @@ static void sub_8008454(void); static void sub_80084C8(void); static void sub_80084F4(void); -extern void *species_and_otid_get_pal(/*TODO: arg types*/); -extern void sub_8143680(int, u8); -extern void sub_81428CC(void); - -extern struct Berry *GetBerryInfo(u8 berry); static void CheckErrorStatus(void); static void CB2_PrintErrorMessage(void); static u8 IsSioMultiMaster(void); diff --git a/src/mail.c b/src/mail.c index 6b26bafe9..658d37976 100644 --- a/src/mail.c +++ b/src/mail.c @@ -88,7 +88,7 @@ static void sub_80F8FB4(void); void HandleReadMail(struct MailStruct *arg0, MainCallback arg1, bool8 arg2) { u16 mailDesign; - u8 buffer[4]; + u16 buffer[2]; ewram0.varFF = GAME_LANGUAGE; ewram0.var100 = 1; diff --git a/src/party_menu.c b/src/party_menu.c index 7d21de63c..3ea191eb3 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -97,6 +97,8 @@ extern void (*const gUnknown_08376B54[])(u8); extern const u8 *const gUnknown_08376D04[DATA_COUNT]; extern const struct UnknownStruct5 gUnknown_08376BB4[][6]; +static void sub_806E884(u8 taskId); + /* void sub_806AEDC(void) { diff --git a/src/pokemon_3.c b/src/pokemon_3.c index 98fa68302..c942dff03 100644 --- a/src/pokemon_3.c +++ b/src/pokemon_3.c @@ -124,7 +124,7 @@ u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit) offset = 6; - temp = gItemEffectTable[itemId - 13]; + temp = (u8 *) gItemEffectTable[itemId - 13]; if (!temp && itemId != ITEM_ENIGMA_BERRY) return 0; @@ -252,7 +252,7 @@ u8 *sub_803F378(u16 itemId) } else { - itemEffect = gItemEffectTable[itemId - 13]; + itemEffect = (u8 *) gItemEffectTable[itemId - 13]; } gUnknown_02024C0B = gUnknown_02024E6C; @@ -1198,18 +1198,18 @@ const u16 *pokemon_get_pal(struct Pokemon *mon) //Extracts the lower 16 bits of a 32-bit number #define LOHALF(n) ((n) & 0xFFFF) -const u16 *species_and_otid_get_pal(u16 species, u32 otId , u32 personality) +void *species_and_otid_get_pal(u16 species, u32 otId , u32 personality) { u32 shinyValue; if (species > SPECIES_EGG) - return gMonPaletteTable[0].data; + return (void *) gMonPaletteTable[0].data; shinyValue = HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality); if (shinyValue < 8) - return gMonShinyPaletteTable[species].data; + return (void *) gMonShinyPaletteTable[species].data; else - return gMonPaletteTable[species].data; + return (void *) gMonPaletteTable[species].data; } const struct SpritePalette *sub_8040990(struct Pokemon *mon) diff --git a/src/scrcmd.c b/src/scrcmd.c index f309b4f93..d24417a74 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1418,7 +1418,7 @@ bool8 ScrCmd_bufferstd(struct ScriptContext *ctx) { u8 stringVarIndex = ScriptReadByte(ctx); u16 index = VarGet(ScriptReadHalfword(ctx)); - StringCopy(sScriptStringVars[stringVarIndex], gUnknown_083CE048[index]); + StringCopy(sScriptStringVars[stringVarIndex], gUnknown_083CE048[index].text); return FALSE; } diff --git a/src/script_pokemon_util_80C4BF0.c b/src/script_pokemon_util_80C4BF0.c index 8edae138a..5fa657190 100644 --- a/src/script_pokemon_util_80C4BF0.c +++ b/src/script_pokemon_util_80C4BF0.c @@ -27,7 +27,6 @@ #define CONTEST_ENTRY_PIC_TOP 3 extern struct SpriteTemplate gUnknown_02024E8C; -extern struct SpritePalette *sub_80409C8(u16, u32, u32); extern u8 gContestPlayerMonIndex; extern u8 gIsLinkContest; @@ -429,7 +428,7 @@ void ShowContestEntryMonPic(void) HandleLoadSpecialPokePic((struct SpriteSheet *)&gMonFrontPicTable[species].data, gMonFrontPicCoords[species].coords, gMonFrontPicCoords[species].y_offset, (u32)gUnknown_081FAF4C[0], gUnknown_081FAF4C[1], species, var1); - paletteData = sub_80409C8(species, var2, var1); + paletteData = (struct SpritePalette *) sub_80409C8(species, var2, var1); LoadCompressedObjectPalette(paletteData); GetMonSpriteTemplate_803C56C(species, 1); gUnknown_02024E8C.paletteTag = paletteData->tag; diff --git a/src/starter_choose.c b/src/starter_choose.c index 0e3c6ad16..a025c9386 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -23,7 +23,7 @@ extern struct SpriteTemplate gUnknown_02024E8C; // Graphics Data //-------------------------------------------------- -const u16 gBirchBagGrassPal[][16] = +const u16 gBirchBagGrassPal[2][16] = { INCBIN_U16("graphics/misc/birch_bag.gbapal"), INCBIN_U16("graphics/misc/birch_grass.gbapal"), diff --git a/src/tv.c b/src/tv.c index 0881a2d2b..2f2cf6d56 100644 --- a/src/tv.c +++ b/src/tv.c @@ -1065,16 +1065,16 @@ void sub_80BEF10(u8 strvaridx, u8 rank) switch (rank) { case NORMAL_RANK: - StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[NORMAL_RANK + 5]); + StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[NORMAL_RANK + 5].text); break; case SUPER_RANK: - StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[SUPER_RANK + 5]); + StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[SUPER_RANK + 5].text); break; case HYPER_RANK: - StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[HYPER_RANK + 5]); + StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[HYPER_RANK + 5].text); break; case MASTER_RANK: - StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[MASTER_RANK + 5]); + StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[MASTER_RANK + 5].text); break; } } @@ -1084,19 +1084,19 @@ void CopyContestCategoryToStringVar(u8 strvaridx, u8 category) switch (category) { case CONTEST_COOL: - StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[CONTEST_COOL]); + StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[CONTEST_COOL].text); break; case CONTEST_BEAUTY: - StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[CONTEST_BEAUTY]); + StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[CONTEST_BEAUTY].text); break; case CONTEST_CUTE: - StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[CONTEST_CUTE]); + StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[CONTEST_CUTE].text); break; case CONTEST_SMART: - StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[CONTEST_SMART]); + StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[CONTEST_SMART].text); break; case CONTEST_TOUGH: - StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[CONTEST_TOUGH]); + StringCopy(gUnknown_083D1464[strvaridx], gUnknown_083CE048[CONTEST_TOUGH].text); break; } } -- cgit v1.2.3 From b4aa5dfd4053ed2de5d046f06884376641c6e8b5 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Fri, 26 May 2017 16:50:46 +0200 Subject: Make rom match checksum --- src/battle_ai.c | 2 +- src/credits.c | 2 +- src/field_map_obj_helpers.c | 16 ++++++++-------- src/fieldmap.c | 8 ++++---- src/pokemon_3.c | 12 ------------ src/script_pokemon_util_80F99CC.c | 2 +- src/wild_encounter.c | 24 ------------------------ 7 files changed, 15 insertions(+), 51 deletions(-) (limited to 'src') diff --git a/src/battle_ai.c b/src/battle_ai.c index c9a3d16ca..d815b959a 100644 --- a/src/battle_ai.c +++ b/src/battle_ai.c @@ -264,7 +264,7 @@ void BattleAI_HandleItemUseBeforeAISetup(void) s32 i; u8 *data = (u8 *)UNK_2016A00_STRUCT; - for (i = 0; (u32)i < sizeof(struct UnknownStruct1); i++) + for (i = 0; (u32)i < sizeof(struct UnknownStruct1B); i++) data[i] = 0; if ((gBattleTypeFlags & BATTLE_TYPE_TRAINER) diff --git a/src/credits.c b/src/credits.c index e66fbe1e7..6355a17e9 100644 --- a/src/credits.c +++ b/src/credits.c @@ -448,7 +448,7 @@ void task_a_8143D04(u8 taskIdA) gReservedSpritePaletteCount = 8; LZ77UnCompVram(&gBirchHelpGfx, (void *)VRAM); LZ77UnCompVram(&gBirchGrassTilemap, (void *)(VRAM + 0x3800)); - LoadPalette(gBirchBagGrassPal + 1, 1, 31 * 2); + LoadPalette(gBirchBagGrassPal[0] + 1, 1, 31 * 2); for (i = 0; i < 0x800; i++) HALL_OF_FAME_SHEET_0[i] = 0x11; diff --git a/src/field_map_obj_helpers.c b/src/field_map_obj_helpers.c index 977183beb..17584c96a 100644 --- a/src/field_map_obj_helpers.c +++ b/src/field_map_obj_helpers.c @@ -76,26 +76,26 @@ void Step1(struct Sprite *sprite, u8 dir) void Step2(struct Sprite *sprite, u8 dir) { - sprite->pos1.x += 2 * gDirectionToVector[dir].x; - sprite->pos1.y += 2 * gDirectionToVector[dir].y; + sprite->pos1.x += 2 * (u16) gDirectionToVector[dir].x; + sprite->pos1.y += 2 * (u16) gDirectionToVector[dir].y; } void Step3(struct Sprite *sprite, u8 dir) { - sprite->pos1.x += 2 * gDirectionToVector[dir].x + gDirectionToVector[dir].x; - sprite->pos1.y += 2 * gDirectionToVector[dir].y + gDirectionToVector[dir].y; + sprite->pos1.x += 2 * (u16) gDirectionToVector[dir].x + (u16) gDirectionToVector[dir].x; + sprite->pos1.y += 2 * (u16) gDirectionToVector[dir].y + (u16) gDirectionToVector[dir].y; } void Step4(struct Sprite *sprite, u8 dir) { - sprite->pos1.x += 4 * gDirectionToVector[dir].x; - sprite->pos1.y += 4 * gDirectionToVector[dir].y; + sprite->pos1.x += 4 * (u16) gDirectionToVector[dir].x; + sprite->pos1.y += 4 * (u16) gDirectionToVector[dir].y; } void Step8(struct Sprite *sprite, u8 dir) { - sprite->pos1.x += 8 * gDirectionToVector[dir].x; - sprite->pos1.y += 8 * gDirectionToVector[dir].y; + sprite->pos1.x += 8 * (u16) gDirectionToVector[dir].x; + sprite->pos1.y += 8 * (u16) gDirectionToVector[dir].y; } void oamt_npc_ministep_reset(struct Sprite *sprite, u8 a2, u8 a3) diff --git a/src/fieldmap.c b/src/fieldmap.c index c4e7dde8b..4cff47c17 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -344,7 +344,7 @@ union Block u16 value; }; -u16 MapGridGetZCoordAt(int x, int y) +u8 MapGridGetZCoordAt(int x, int y) { u16 block; int i; @@ -370,7 +370,7 @@ u16 MapGridGetZCoordAt(int x, int y) return block >> 12; } -u16 MapGridIsImpassableAt(int x, int y) +u8 MapGridIsImpassableAt(int x, int y) { u16 block; int i; @@ -396,7 +396,7 @@ u16 MapGridIsImpassableAt(int x, int y) return (block & 0xc00) >> 10; } -u16 MapGridGetMetatileIdAt(int x, int y) +u32 MapGridGetMetatileIdAt(int x, int y) { u16 block; int i; @@ -436,7 +436,7 @@ u32 MapGridGetMetatileBehaviorAt(int x, int y) return GetBehaviorByMetatileId(metatile) & 0xff; } -u16 MapGridGetMetatileLayerTypeAt(int x, int y) +u8 MapGridGetMetatileLayerTypeAt(int x, int y) { u16 metatile; metatile = MapGridGetMetatileIdAt(x, y); diff --git a/src/pokemon_3.c b/src/pokemon_3.c index c942dff03..09cbd2a3e 100644 --- a/src/pokemon_3.c +++ b/src/pokemon_3.c @@ -39,18 +39,6 @@ #define EVO_LEVEL_SHEDINJA 0x000e // Pokémon reaches the specified level (special value for Shedinja) #define EVO_BEAUTY 0x000f // Pokémon levels up with beauty ≥ specified value -struct Evolution -{ - u16 method; - u16 param; - u16 targetSpecies; -}; - -struct EvolutionData -{ - struct Evolution evolutions[5]; -}; - struct SpindaSpot { u8 x, y; diff --git a/src/script_pokemon_util_80F99CC.c b/src/script_pokemon_util_80F99CC.c index 25c467312..2cc9fd7cf 100644 --- a/src/script_pokemon_util_80F99CC.c +++ b/src/script_pokemon_util_80F99CC.c @@ -59,7 +59,7 @@ void sub_80F9A8C(u8 taskId) if(!gPaletteFade.active) { gPaletteFade.bufferTransferDisabled = 1; - OpenPartyMenu(gTasks[taskId].data[0], 0); + OpenPartyMenu((u8) gTasks[taskId].data[0], 0); DestroyTask(taskId); } } diff --git a/src/wild_encounter.c b/src/wild_encounter.c index 143587438..31dbd17a2 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -15,30 +15,6 @@ #include "species.h" #include "tv.h" -struct WildPokemon -{ - u8 minLevel; - u8 maxLevel; - u16 species; -}; - -struct WildPokemonInfo -{ - u8 encounterRate; - const struct WildPokemon *wildPokemon; -}; - -struct WildPokemonHeader -{ - u8 mapGroup; - u8 mapNum; - struct WildPokemonInfo *landMonsInfo; - struct WildPokemonInfo *waterMonsInfo; - struct WildPokemonInfo *rockSmashMonsInfo; - struct WildPokemonInfo *fishingMonsInfo; -}; - - const struct WildPokemon PetalburgCity_WaterMons [] = { {20, 30, SPECIES_MARILL}, -- cgit v1.2.3 From 93da3ddcd3ee11ffe25b194770cec7225db868cc Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Fri, 26 May 2017 17:43:18 +0200 Subject: Rename pokeblock.h.h --- src/item_use.c | 2 +- src/mori_debug_menu.c | 2 +- src/new_game.c | 2 +- src/wild_encounter.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/item_use.c b/src/item_use.c index 6e7ccfae0..98a122316 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -23,7 +23,7 @@ #include "metatile_behavior.h" #include "palette.h" #include "party_menu.h" -#include "pokeblock.h.h" +#include "pokeblock.h" #include "pokemon_item_effect.h" #include "pokemon_menu.h" #include "rom4.h" diff --git a/src/mori_debug_menu.c b/src/mori_debug_menu.c index b2e1116a9..ba79261c0 100644 --- a/src/mori_debug_menu.c +++ b/src/mori_debug_menu.c @@ -6,7 +6,7 @@ #include "link.h" #include "main.h" #include "menu.h" -#include "pokeblock.h.h" +#include "pokeblock.h" #include "start_menu.h" #include "string_util.h" diff --git a/src/new_game.c b/src/new_game.c index d22babb4a..33aacd10a 100644 --- a/src/new_game.c +++ b/src/new_game.c @@ -14,7 +14,7 @@ #include "mauville_old_man.h" #include "play_time.h" #include "player_pc.h" -#include "pokeblock.h.h" +#include "pokeblock.h" #include "pokedex.h" #include "pokemon_size_record.h" #include "pokemon_storage_system.h" diff --git a/src/wild_encounter.c b/src/wild_encounter.c index 31dbd17a2..96f47c067 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -6,7 +6,7 @@ #include "field_player_avatar.h" #include "fieldmap.h" #include "metatile_behavior.h" -#include "pokeblock.h.h" +#include "pokeblock.h" #include "rng.h" #include "roamer.h" #include "rom4.h" -- cgit v1.2.3 From 65cca21dddc7ae26f96c7757504b2b39765d9eb0 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 26 May 2017 12:04:13 -0400 Subject: Finish decompiling functions which can reasonably be decompiled in field_map_obj.s --- src/field_map_obj.c | 835 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 828 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index d12e4cfe1..eaad98cb0 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -26,7 +26,7 @@ extern void ClearPlayerAvatarInfo(void); extern void npc_load_two_palettes__no_record(u16, u8); extern void npc_load_two_palettes__and_record(u16, u8); extern void sub_8060388(s16, s16, s16 *, s16 *); -extern void sub_80634D0(struct MapObject *, struct Sprite *); +void sub_80634D0(struct MapObject *, struct Sprite *); extern void pal_patch_for_npc(u16, u16); extern void CameraObjectReset1(void); @@ -3886,7 +3886,7 @@ u8 FieldObjectGetSpecialAnim(struct MapObject *mapObject) extern void DoGroundEffects_OnSpawn(struct MapObject *mapObject, struct Sprite *sprite); extern void DoGroundEffects_OnBeginStep(struct MapObject *mapObject, struct Sprite *sprite); extern void DoGroundEffects_OnFinishStep(struct MapObject *mapObject, struct Sprite *sprite); -extern void npc_obj_transfer_image_anim_pause_flag(struct MapObject *mapObject, struct Sprite *sprite); +void npc_obj_transfer_image_anim_pause_flag(struct MapObject *mapObject, struct Sprite *sprite); void sub_80634A0(struct MapObject *mapObject, struct Sprite *sprite); void FieldObjectExecSpecialAnim(struct MapObject *mapObject, struct Sprite *sprite); void FieldObjectUpdateSubpriority(struct MapObject *mapObject, struct Sprite *sprite); @@ -4398,7 +4398,7 @@ u8 sub_8060D10(struct MapObject *mapObject, struct Sprite *sprite) return 1; } -void sub_8060D20(struct MapObject *mapObject, struct Sprite *sprite, u8 direction, u8 a2) +void sub_8060D20(struct MapObject *mapObject, struct Sprite *sprite, u8 direction, u8 a3) { s16 x; s16 y; @@ -4407,7 +4407,7 @@ void sub_8060D20(struct MapObject *mapObject, struct Sprite *sprite, u8 directio FieldObjectSetDirection(mapObject, direction); MoveCoords(direction, &x, &y); npc_coords_shift(mapObject, x, y); - oamt_npc_ministep_reset(sprite, direction, a2); + oamt_npc_ministep_reset(sprite, direction, a3); sprite->animPaused = 0; mapObject->mapobj_bit_2 = 1; sprite->data2 = 1; @@ -4415,12 +4415,12 @@ void sub_8060D20(struct MapObject *mapObject, struct Sprite *sprite, u8 directio extern u8 (*const gUnknown_083759C0[5])(u8); -void do_go_anim(struct MapObject *mapObject, struct Sprite *sprite, u8 direction, u8 a2) +void do_go_anim(struct MapObject *mapObject, struct Sprite *sprite, u8 direction, u8 a3) { u8 (*functions[5])(u8); memcpy(functions, gUnknown_083759C0, sizeof(gUnknown_083759C0)); - sub_8060D20(mapObject, sprite, direction, a2); - sub_805FE28(mapObject, sprite, functions[a2](mapObject->mapobj_unk_18)); + sub_8060D20(mapObject, sprite, direction, a3); + sub_805FE28(mapObject, sprite, functions[a3](mapObject->mapobj_unk_18)); } void do_run_anim(struct MapObject *mapObject, struct Sprite *sprite, u8 direction) @@ -5915,3 +5915,824 @@ bool8 sub_80628D0(struct MapObject *mapObject, struct Sprite *sprite) } return FALSE; } + +bool8 sub_8062930(struct MapObject *, struct Sprite *); + +bool8 sub_80628FC(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8060ED8(mapObject, sprite, DIR_SOUTH); + sprite->affineAnimPaused = 0; + ChangeSpriteAffineAnimIfDifferent(sprite, 1); + return sub_8062930(mapObject, sprite); +} + +bool8 sub_8062930(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (an_walk_any_2(mapObject, sprite)) + { + sprite->affineAnimPaused = 1; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +void sub_806295C(struct MapObject *mapObject, struct Sprite *sprite, u8 direction) +{ + FieldObjectSetDirection(mapObject, direction); + npc_coords_shift_still(mapObject); + sub_805FE64(mapObject, sprite, sub_805FDD8(direction)); + sprite->animPaused = 1; + sprite->data2 = 1; +} + +bool8 sub_806299C(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_806295C(mapObject, sprite, DIR_SOUTH); + return TRUE; +} + +bool8 sub_80629AC(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_806295C(mapObject, sprite, DIR_NORTH); + return TRUE; +} + +bool8 sub_80629BC(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_806295C(mapObject, sprite, DIR_WEST); + return TRUE; +} + +bool8 sub_80629CC(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_806295C(mapObject, sprite, DIR_EAST); + return TRUE; +} + +bool8 sub_80629DC(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_set_direction_and_anim__an_proceed(mapObject, sprite, DIR_SOUTH, sub_805FD98(DIR_SOUTH)); + return FALSE; +} + +bool8 sub_8062A00(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_set_direction_and_anim__an_proceed(mapObject, sprite, DIR_NORTH, sub_805FD98(DIR_NORTH)); + return FALSE; +} + +bool8 sub_8062A24(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_set_direction_and_anim__an_proceed(mapObject, sprite, DIR_WEST, sub_805FD98(DIR_WEST)); + return FALSE; +} + +bool8 sub_8062A48(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_set_direction_and_anim__an_proceed(mapObject, sprite, DIR_EAST, sub_805FD98(DIR_EAST)); + return FALSE; +} + +bool8 sub_8062A6C(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_set_direction_and_anim__an_proceed(mapObject, sprite, DIR_SOUTH, sub_805FDB8(DIR_SOUTH)); + return FALSE; +} + +bool8 sub_8062A90(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_set_direction_and_anim__an_proceed(mapObject, sprite, DIR_NORTH, sub_805FDB8(DIR_NORTH)); + return FALSE; +} + +bool8 sub_8062AB4(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_set_direction_and_anim__an_proceed(mapObject, sprite, DIR_WEST, sub_805FDB8(DIR_WEST)); + return FALSE; +} + +bool8 sub_8062AD8(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_set_direction_and_anim__an_proceed(mapObject, sprite, DIR_EAST, sub_805FDB8(DIR_EAST)); + return FALSE; +} + +bool8 sub_8062AFC(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_set_direction_and_anim__an_proceed(mapObject, sprite, DIR_SOUTH, sub_805FDC8(DIR_SOUTH)); + return FALSE; +} + +bool8 sub_8062B20(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_set_direction_and_anim__an_proceed(mapObject, sprite, DIR_NORTH, sub_805FDC8(DIR_NORTH)); + return FALSE; +} + +bool8 sub_8062B44(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_set_direction_and_anim__an_proceed(mapObject, sprite, DIR_WEST, sub_805FDC8(DIR_WEST)); + return FALSE; +} + +bool8 sub_8062B68(struct MapObject *mapObject, struct Sprite *sprite) +{ + npc_set_direction_and_anim__an_proceed(mapObject, sprite, DIR_EAST, sub_805FDC8(DIR_EAST)); + return FALSE; +} + +void sub_8062B8C(struct MapObject *mapObject, struct Sprite *sprite, u8 direction, u8 a3, u8 a4) +{ + sub_806113C(mapObject, sprite, direction, a3, a4); + StartSpriteAnimIfDifferent(sprite, sub_805FD98(direction)); + DoShadowFieldEffect(mapObject); +} + +bool8 sub_8062BFC(struct MapObject *, struct Sprite *); + +bool8 sub_8062BD0(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8062B8C(mapObject, sprite, DIR_SOUTH, 0, 1); + return sub_8062BFC(mapObject, sprite); +} + +bool8 sub_8062BFC(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8062C54(struct MapObject *, struct Sprite *); + +bool8 sub_8062C28(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8062B8C(mapObject, sprite, DIR_NORTH, 0, 1); + return sub_8062C54(mapObject, sprite); +} + +bool8 sub_8062C54(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8062CAC(struct MapObject *, struct Sprite *); + +bool8 sub_8062C80(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8062B8C(mapObject, sprite, DIR_WEST, 0, 1); + return sub_8062CAC(mapObject, sprite); +} + +bool8 sub_8062CAC(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8062D04(struct MapObject *, struct Sprite *); + +bool8 sub_8062CD8(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8062B8C(mapObject, sprite, DIR_EAST, 0, 1); + return sub_8062D04(mapObject, sprite); +} + +bool8 sub_8062D04(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8062D5C(struct MapObject *, struct Sprite *); + +bool8 sub_8062D30(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8062B8C(mapObject, sprite, DIR_SOUTH, 1, 1); + return sub_8062D5C(mapObject, sprite); +} + +bool8 sub_8062D5C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8062DB4(struct MapObject *, struct Sprite *); + +bool8 sub_8062D88(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8062B8C(mapObject, sprite, DIR_NORTH, 1, 1); + return sub_8062DB4(mapObject, sprite); +} + +bool8 sub_8062DB4(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8062E0C(struct MapObject *, struct Sprite *); + +bool8 sub_8062DE0(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8062B8C(mapObject, sprite, DIR_WEST, 1, 1); + return sub_8062E0C(mapObject, sprite); +} + +bool8 sub_8062E0C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8062E64(struct MapObject *, struct Sprite *); + +bool8 sub_8062E38(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8062B8C(mapObject, sprite, DIR_EAST, 1, 1); + return sub_8062E64(mapObject, sprite); +} + +bool8 sub_8062E64(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8062EBC(struct MapObject *, struct Sprite *); + +bool8 sub_8062E90(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8062B8C(mapObject, sprite, DIR_SOUTH, 2, 0); + return sub_8062EBC(mapObject, sprite); +} + +bool8 sub_8062EBC(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8062F14(struct MapObject *, struct Sprite *); + +bool8 sub_8062EE8(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8062B8C(mapObject, sprite, DIR_NORTH, 2, 0); + return sub_8062F14(mapObject, sprite); +} + +bool8 sub_8062F14(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8062F6C(struct MapObject *, struct Sprite *); + +bool8 sub_8062F40(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8062B8C(mapObject, sprite, DIR_WEST, 2, 0); + return sub_8062F6C(mapObject, sprite); +} + +bool8 sub_8062F6C(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8062FC4(struct MapObject *, struct Sprite *); + +bool8 sub_8062F98(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8062B8C(mapObject, sprite, DIR_EAST, 2, 0); + return sub_8062FC4(mapObject, sprite); +} + +bool8 sub_8062FC4(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_8061328(mapObject, sprite)) + { + mapObject->mapobj_bit_22 = 0; + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8062FF0(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80616CC(mapObject, sprite, DIR_SOUTH, sub_805FDD8(DIR_SOUTH), 8); + return sub_8061714(mapObject, sprite); +} + +bool8 sub_8063028(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80616CC(mapObject, sprite, DIR_NORTH, sub_805FDD8(DIR_NORTH), 8); + return sub_8061714(mapObject, sprite); +} + +bool8 sub_8063060(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80616CC(mapObject, sprite, DIR_WEST, sub_805FDD8(DIR_WEST), 8); + return sub_8061714(mapObject, sprite); +} + +bool8 sub_8063098(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80616CC(mapObject, sprite, DIR_EAST, sub_805FDD8(DIR_EAST), 8); + return sub_8061714(mapObject, sprite); +} + +void sub_80630D0(struct MapObject *mapObject, struct Sprite *sprite, u8 direction, u8 a3) +{ + sub_8060D20(mapObject, sprite, direction, a3); + StartSpriteAnim(sprite, sub_805FD98(mapObject->mapobj_unk_18)); + SeekSpriteAnim(sprite, 0); +} + +bool8 sub_8063128(struct MapObject *, struct Sprite *); + +bool8 sub_8063108(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80630D0(mapObject, sprite, DIR_SOUTH, 1); + return sub_8063128(mapObject, sprite); +} + +bool8 sub_8063128(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8063168(struct MapObject *, struct Sprite *); + +bool8 sub_8063148(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80630D0(mapObject, sprite, DIR_NORTH, 1); + return sub_8063168(mapObject, sprite); +} + +bool8 sub_8063168(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_80631A8(struct MapObject *, struct Sprite *); + +bool8 sub_8063188(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80630D0(mapObject, sprite, DIR_WEST, 1); + return sub_80631A8(mapObject, sprite); +} + +bool8 sub_80631A8(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_80631E8(struct MapObject *, struct Sprite *); + +bool8 sub_80631C8(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80630D0(mapObject, sprite, DIR_EAST, 1); + return sub_80631E8(mapObject, sprite); +} + +bool8 sub_80631E8(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +void sub_8063208(struct MapObject *mapObject, struct Sprite *sprite, u8 direction, u8 a3) +{ + sub_8060D20(mapObject, sprite, direction, a3); + sub_805FE28(mapObject, sprite, sub_805FDD8(mapObject->mapobj_unk_18)); +} + +bool8 sub_8063258(struct MapObject *, struct Sprite *); + +bool8 sub_8063238(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8063208(mapObject, sprite, DIR_SOUTH, 1); + return sub_8063258(mapObject, sprite); +} + +bool8 sub_8063258(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8063298(struct MapObject *, struct Sprite *); + +bool8 sub_8063278(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8063208(mapObject, sprite, DIR_NORTH, 1); + return sub_8063298(mapObject, sprite); +} + +bool8 sub_8063298(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_80632D8(struct MapObject *, struct Sprite *); + +bool8 sub_80632B8(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8063208(mapObject, sprite, DIR_WEST, 1); + return sub_80632D8(mapObject, sprite); +} + +bool8 sub_80632D8(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8063318(struct MapObject *, struct Sprite *); + +bool8 sub_80632F8(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8063208(mapObject, sprite, DIR_EAST, 1); + return sub_8063318(mapObject, sprite); +} + +bool8 sub_8063318(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +void sub_8063338(struct MapObject *mapObject, struct Sprite *sprite, u8 direction, u8 a3) +{ + sub_8060D20(mapObject, sprite, direction, a3); + StartSpriteAnim(sprite, sub_805FDB8(mapObject->mapobj_unk_18)); + SeekSpriteAnim(sprite, 0); +} + +bool8 sub_8063390(struct MapObject *, struct Sprite *); + +bool8 sub_8063370(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8063338(mapObject, sprite, DIR_SOUTH, 1); + return sub_8063390(mapObject, sprite); +} + +bool8 sub_8063390(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_80633D0(struct MapObject *, struct Sprite *); + +bool8 sub_80633B0(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8063338(mapObject, sprite, DIR_NORTH, 1); + return sub_80633D0(mapObject, sprite); +} + +bool8 sub_80633D0(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8063410(struct MapObject *, struct Sprite *); + +bool8 sub_80633F0(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8063338(mapObject, sprite, DIR_WEST, 1); + return sub_8063410(mapObject, sprite); +} + +bool8 sub_8063410(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8063450(struct MapObject *, struct Sprite *); + +bool8 sub_8063430(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8063338(mapObject, sprite, DIR_EAST, 1); + return sub_8063450(mapObject, sprite); +} + +bool8 sub_8063450(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(mapObject, sprite)) + { + sprite->data2 = 2; + return TRUE; + } + return FALSE; +} + +bool8 sub_8063470(struct MapObject *mapObject, struct Sprite *sprite) +{ + return TRUE; +} + +bool8 sub_8063474(struct MapObject *mapObject, struct Sprite *sprite) +{ + sprite->animPaused = 1; + return TRUE; +} + +void npc_obj_transfer_image_anim_pause_flag(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (mapObject->mapobj_bit_10) + { + sprite->animPaused = 1; + } +} + +void sub_80634A0(struct MapObject *mapObject, struct Sprite *sprite) +{ + if (mapObject->mapobj_bit_11) + { + sprite->animPaused = 0; + mapObject->mapobj_bit_10 = 0; + mapObject->mapobj_bit_11 = 0; + } +} + +void sub_80634E8(struct MapObject *, struct Sprite *); +void npc_update_obj_anim_flag(struct MapObject *, struct Sprite *); + +void sub_80634D0(struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_80634E8(mapObject, sprite); + npc_update_obj_anim_flag(mapObject, sprite); +} + +#ifdef NONMATCHING +void sub_80634E8(struct MapObject *mapObject, struct Sprite *sprite) +{ + u16 x; + u16 y; + s16 x2; + s16 y2; + const struct MapObjectGraphicsInfo *graphicsInfo; + mapObject->mapobj_bit_14 = 0; + graphicsInfo = GetFieldObjectGraphicsInfo(mapObject->graphicsId); + if (sprite->coordOffsetEnabled) + { + x = sprite->pos1.x + sprite->pos2.x + sprite->centerToCornerVecX + gSpriteCoordOffsetX; + y = sprite->pos1.y + sprite->pos2.y + sprite->centerToCornerVecY + gSpriteCoordOffsetY; + } else + { + x = sprite->pos1.x + sprite->pos2.x + sprite->centerToCornerVecX; + y = sprite->pos1.y + sprite->pos2.y + sprite->centerToCornerVecY; + } + x2 = graphicsInfo->width + x; // offending line + y2 = graphicsInfo->height + y; // similarly offending line + if ((s16)x >= 0x100 || x2 < -0x10) + { + mapObject->mapobj_bit_14 = 1; + } + if ((s16)y >= 0xB0 || y2 < -0x10) + { + mapObject->mapobj_bit_14 = 1; + } +} +#else +__attribute__((naked)) +void sub_80634E8(struct MapObject *mapObject, struct Sprite *sprite) { + asm(".syntax unified\n\ + push {r4-r6,lr}\n\ + adds r5, r0, 0\n\ + adds r4, r1, 0\n\ + ldrb r1, [r5, 0x1]\n\ + movs r0, 0x41\n\ + negs r0, r0\n\ + ands r0, r1\n\ + strb r0, [r5, 0x1]\n\ + ldrb r0, [r5, 0x5]\n\ + bl GetFieldObjectGraphicsInfo\n\ + adds r6, r0, 0\n\ + adds r0, r4, 0\n\ + adds r0, 0x3E\n\ + ldrb r1, [r0]\n\ + movs r0, 0x2\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _0806354C\n\ + ldrh r1, [r4, 0x24]\n\ + ldrh r0, [r4, 0x20]\n\ + adds r1, r0\n\ + adds r0, r4, 0\n\ + adds r0, 0x28\n\ + ldrb r0, [r0]\n\ + lsls r0, 24\n\ + asrs r0, 24\n\ + ldr r2, _08063544 @ =gSpriteCoordOffsetX\n\ + adds r0, r1\n\ + ldrh r2, [r2]\n\ + adds r0, r2\n\ + lsls r0, 16\n\ + lsrs r3, r0, 16\n\ + ldrh r1, [r4, 0x26]\n\ + ldrh r0, [r4, 0x22]\n\ + adds r1, r0\n\ + adds r0, r4, 0\n\ + adds r0, 0x29\n\ + ldrb r0, [r0]\n\ + lsls r0, 24\n\ + asrs r0, 24\n\ + ldr r2, _08063548 @ =gSpriteCoordOffsetY\n\ + adds r0, r1\n\ + ldrh r2, [r2]\n\ + adds r0, r2\n\ + b _08063574\n\ + .align 2, 0\n\ +_08063544: .4byte gSpriteCoordOffsetX\n\ +_08063548: .4byte gSpriteCoordOffsetY\n\ +_0806354C:\n\ + ldrh r1, [r4, 0x24]\n\ + ldrh r0, [r4, 0x20]\n\ + adds r1, r0\n\ + adds r0, r4, 0\n\ + adds r0, 0x28\n\ + ldrb r0, [r0]\n\ + lsls r0, 24\n\ + asrs r0, 24\n\ + adds r0, r1\n\ + lsls r0, 16\n\ + lsrs r3, r0, 16\n\ + ldrh r1, [r4, 0x26]\n\ + ldrh r0, [r4, 0x22]\n\ + adds r1, r0\n\ + adds r0, r4, 0\n\ + adds r0, 0x29\n\ + ldrb r0, [r0]\n\ + lsls r0, 24\n\ + asrs r0, 24\n\ + adds r0, r1\n\ +_08063574:\n\ + lsls r0, 16\n\ + lsrs r2, r0, 16\n\ + ldrh r0, [r6, 0x8]\n\ + adds r0, r3\n\ + lsls r0, 16\n\ + lsrs r1, r0, 16\n\ + ldrh r0, [r6, 0xA]\n\ + adds r0, r2\n\ + lsls r0, 16\n\ + lsrs r4, r0, 16\n\ + lsls r0, r3, 16\n\ + asrs r0, 16\n\ + cmp r0, 0xFF\n\ + bgt _0806359C\n\ + lsls r0, r1, 16\n\ + asrs r0, 16\n\ + movs r1, 0x10\n\ + negs r1, r1\n\ + cmp r0, r1\n\ + bge _080635A4\n\ +_0806359C:\n\ + ldrb r0, [r5, 0x1]\n\ + movs r1, 0x40\n\ + orrs r0, r1\n\ + strb r0, [r5, 0x1]\n\ +_080635A4:\n\ + lsls r0, r2, 16\n\ + asrs r0, 16\n\ + cmp r0, 0xAF\n\ + bgt _080635B8\n\ + lsls r0, r4, 16\n\ + asrs r0, 16\n\ + movs r1, 0x10\n\ + negs r1, r1\n\ + cmp r0, r1\n\ + bge _080635C0\n\ +_080635B8:\n\ + ldrb r0, [r5, 0x1]\n\ + movs r1, 0x40\n\ + orrs r0, r1\n\ + strb r0, [r5, 0x1]\n\ +_080635C0:\n\ + pop {r4-r6}\n\ + pop {r0}\n\ + bx r0\n\ +.syntax divided\n"); +} +#endif + +void npc_update_obj_anim_flag(struct MapObject *mapObject, struct Sprite *sprite) +{ + sprite->invisible = 0; + if (mapObject->mapobj_bit_13 || mapObject->mapobj_bit_14) + { + sprite->invisible = 1; + } +} -- cgit v1.2.3 From 21efe53b6805a0dcc5dcba7d1f78e9a7e7bd93c4 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 26 May 2017 12:43:22 -0400 Subject: Make C and ASM files non-executable --- src/field_map_obj.c | 0 src/trainer_see.c | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 src/field_map_obj.c mode change 100755 => 100644 src/trainer_see.c (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c old mode 100755 new mode 100644 diff --git a/src/trainer_see.c b/src/trainer_see.c old mode 100755 new mode 100644 -- cgit v1.2.3 From 03e4f7c9cf592feefc10c1276fb8f648a7fe2bcd Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 26 May 2017 20:22:45 -0400 Subject: Rid code base of redundant SaveTVStruct and define unknown_2a98 as the last of 25 TVShow objects --- src/easy_chat.c | 6 +- src/tv.c | 216 ++++++++++++++++++++++++++++---------------------------- 2 files changed, 111 insertions(+), 111 deletions(-) (limited to 'src') diff --git a/src/easy_chat.c b/src/easy_chat.c index b21b00368..b0168d3bc 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -216,15 +216,15 @@ void unref_sub_80EB684(u8 arg0, u16 arg1) { { case 5: c = 6; - ptr = (u16*)((void *)&gSaveBlock1.tvShows.shows[arg1] + 0x04); + ptr = (u16*)((void *)&gSaveBlock1.tvShows[arg1] + 0x04); break; case 7: c = 2; - ptr = (u16*)((void *)&gSaveBlock1.tvShows.shows[arg1] + 0x1C); + ptr = (u16*)((void *)&gSaveBlock1.tvShows[arg1] + 0x1C); break; case 8: c = 1; - ptr = (u16*)((void *)&gSaveBlock1.tvShows.shows[arg1] + 0x02); + ptr = (u16*)((void *)&gSaveBlock1.tvShows[arg1] + 0x02); break; default: diff --git a/src/tv.c b/src/tv.c index d2e38c088..9d5426a88 100644 --- a/src/tv.c +++ b/src/tv.c @@ -104,10 +104,10 @@ void ClearTVShowData(void) u8 showidx; u8 extradataidx; for (showidx=0; showidx<25; showidx++) { - gSaveBlock1.tvShows.shows[showidx].common.var00 = 0; - gSaveBlock1.tvShows.shows[showidx].common.var01 = 0; + gSaveBlock1.tvShows[showidx].common.var00 = 0; + gSaveBlock1.tvShows[showidx].common.var01 = 0; for (extradataidx=0; extradataidx<34; extradataidx++) { - gSaveBlock1.tvShows.shows[showidx].common.pad02[extradataidx] = 0; + gSaveBlock1.tvShows[showidx].common.pad02[extradataidx] = 0; } } sub_80BEBF4(); @@ -235,14 +235,14 @@ void sub_80BDEC8(void) { } else { sub_80BE028(); if (sub_80BF77C(0xffff) == 0 && StringCompareWithoutExtCtrlCodes(gSpeciesNames[gUnknown_030042E0.var28], gUnknown_030042E0.var2a) != 0) { - gUnknown_03005D38.var0 = sub_80BF74C(gSaveBlock1.tvShows.shows); + gUnknown_03005D38.var0 = sub_80BF74C(gSaveBlock1.tvShows); if (gUnknown_03005D38.var0 != -1 && sub_80BF1B4(TVSHOW_POKEMON_TODAY_CAUGHT) != 1) { for (i=0; i<11; i++) { total += gUnknown_030042E0.var36[i]; } if (total != 0 || gUnknown_030042E0.var05_1 != 0) { total = FALSE; - show = &gSaveBlock1.tvShows.shows[gUnknown_03005D38.var0]; + show = &gSaveBlock1.tvShows[gUnknown_03005D38.var0]; show->pokemonToday.var00 = TVSHOW_POKEMON_TODAY_CAUGHT; show->pokemonToday.var01 = total; if (gUnknown_030042E0.var05_1 != 0) { @@ -274,9 +274,9 @@ void sub_80BDEC8(void) { void sub_80BE028(void) { TVShow *buffer; - buffer = &gSaveBlock1.tvShows.unknown_2A98; + buffer = &gSaveBlock1.tvShows[24]; if (buffer->worldOfMasters.var00 != TVSHOW_WORLD_OF_MASTERS) { - sub_80BF55C(gSaveBlock1.tvShows.shows, 24); + sub_80BF55C(gSaveBlock1.tvShows, 24); buffer->worldOfMasters.var06 = GetGameStat(GAME_STAT_STEPS); buffer->worldOfMasters.var00 = TVSHOW_WORLD_OF_MASTERS; } @@ -300,10 +300,10 @@ void sub_80BE074(void) { total = 0xff; } if (total > 2 && gUnknown_02024D26 == 1) { - gUnknown_03005D38.var0 = sub_80BF74C(gSaveBlock1.tvShows.shows); + gUnknown_03005D38.var0 = sub_80BF74C(gSaveBlock1.tvShows); if (gUnknown_03005D38.var0 != -1 && sub_80BF1B4(TVSHOW_POKEMON_TODAY_FAILED) != 1) { flag = FALSE; - show = &gSaveBlock1.tvShows.shows[gUnknown_03005D38.var0]; + show = &gSaveBlock1.tvShows[gUnknown_03005D38.var0]; asm_comment("Here the wrong registers are used to hold the show ID and flag."); show->pokemonTodayFailed.var00 = TVSHOW_POKEMON_TODAY_FAILED; show->pokemonTodayFailed.var01 = flag; @@ -440,9 +440,9 @@ void sub_80BE160(TVShow *show) { void sub_80BE188(void) { TVShow *show; TVShow *buffer; - buffer = &gSaveBlock1.tvShows.unknown_2A98; + buffer = &gSaveBlock1.tvShows[24]; if (buffer->bravoTrainer.var00 == TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE) { - show = &gSaveBlock1.tvShows.shows[gUnknown_03005D38.var0]; + show = &gSaveBlock1.tvShows[gUnknown_03005D38.var0]; show->bravoTrainer.var00 = TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE; show->bravoTrainer.var01 = 1; show->bravoTrainer.species = buffer->bravoTrainer.species; @@ -462,11 +462,11 @@ void sub_80BE188(void) { void sub_80BE23C(u16 a0) { TVShow *show; - show = &gSaveBlock1.tvShows.unknown_2A98; + show = &gSaveBlock1.tvShows[24]; sub_80BF484(); - gUnknown_03005D38.var0 = sub_80BF720(gSaveBlock1.tvShows.shows); + gUnknown_03005D38.var0 = sub_80BF720(gSaveBlock1.tvShows); if (gUnknown_03005D38.var0 != -1) { - sub_80BF55C(gSaveBlock1.tvShows.shows, 24); + sub_80BF55C(gSaveBlock1.tvShows, 24); show->bravoTrainer.var14 = a0; show->bravoTrainer.var00 = TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE; } @@ -474,8 +474,8 @@ void sub_80BE23C(u16 a0) { void sub_80BE284(u8 a0) { TVShow *show; - show = &gSaveBlock1.tvShows.unknown_2A98; - gUnknown_03005D38.var0 = sub_80BF720(gSaveBlock1.tvShows.shows); + show = &gSaveBlock1.tvShows[24]; + gUnknown_03005D38.var0 = sub_80BF720(gSaveBlock1.tvShows); if (gUnknown_03005D38.var0 != -1) { show->bravoTrainer.var13_5 = a0; show->bravoTrainer.contestCategory = gScriptContestCategory; @@ -487,7 +487,7 @@ void sub_80BE284(u8 a0) { void sub_80BE320(void) { TVShow *show; - show = &gSaveBlock1.tvShows.shows[gUnknown_03005D38.var0]; + show = &gSaveBlock1.tvShows[gUnknown_03005D38.var0]; show->bravoTrainerTower.var00 = TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE; show->bravoTrainerTower.var01 = 1; StringCopy(show->bravoTrainerTower.trainerName, gSaveBlock2.playerName); @@ -513,11 +513,11 @@ void sub_80BE3BC(void) { rval = sub_80BF77C(0x5555); if (rval == 0) { - gUnknown_03005D38.var0 = sub_80BF74C(gSaveBlock1.tvShows.shows); + gUnknown_03005D38.var0 = sub_80BF74C(gSaveBlock1.tvShows); if (gUnknown_03005D38.var0 != -1 && sub_80BF1B4(TVSHOW_SMART_SHOPPER) != 1) { sub_80BF20C(); if (gUnknown_02038724[0].item_amount >= 20) { - tvShow = &gSaveBlock1.tvShows.shows[gUnknown_03005D38.var0]; + tvShow = &gSaveBlock1.tvShows[gUnknown_03005D38.var0]; tvShow->smartshopperShow.var00 = TVSHOW_SMART_SHOPPER; tvShow->smartshopperShow.var01 = rval; tvShow->smartshopperShow.shopLocation = gMapHeader.name; @@ -561,7 +561,7 @@ void sub_80BE478(void) return; } - tvShow = &gSaveBlock1.tvShows.shows[gUnknown_03005D38.var0]; + tvShow = &gSaveBlock1.tvShows[gUnknown_03005D38.var0]; tvShow->nameRaterShow.var00 = TVSHOW_NAME_RATER_SHOW; tvShow->nameRaterShow.var01 = 1; @@ -588,7 +588,7 @@ void StartMassOutbreak(void) { TVShow *tvShow; - tvShow = &gSaveBlock1.tvShows.shows[gSpecialVar_0x8004]; + tvShow = &gSaveBlock1.tvShows[gSpecialVar_0x8004]; gSaveBlock1.outbreakPokemonSpecies = tvShow->massOutbreak.species; gSaveBlock1.outbreakLocationMapNum = tvShow->massOutbreak.locationMapNum; @@ -610,7 +610,7 @@ void sub_80BE5FC(void) TVShow *tvShow; u16 species; - tvShow = &gSaveBlock1.tvShows.shows[gUnknown_03005D38.var0]; + tvShow = &gSaveBlock1.tvShows[gUnknown_03005D38.var0]; tvShow->fanclubLetter.var00 = TVSHOW_FAN_CLUB_LETTER; tvShow->fanclubLetter.var01 = 1; @@ -626,7 +626,7 @@ void sub_80BE65C(void) { TVShow *tvShow; - tvShow = &gSaveBlock1.tvShows.shows[gUnknown_03005D38.var0]; + tvShow = &gSaveBlock1.tvShows[gUnknown_03005D38.var0]; tvShow->recentHappenings.var00 = TVSHOW_RECENT_HAPPENINGS; tvShow->recentHappenings.var01 = 1; @@ -642,7 +642,7 @@ void sub_80BE6A0(void) TVShow *tvShow; u8 monIndex; - tvShow = &gSaveBlock1.tvShows.shows[gUnknown_03005D38.var0]; + tvShow = &gSaveBlock1.tvShows[gUnknown_03005D38.var0]; tvShow->fanclubOpinions.var00 = TVSHOW_PKMN_FAN_CLUB_OPINIONS; tvShow->fanclubOpinions.var01 = 1; @@ -680,7 +680,7 @@ void sub_80BE778(void) for (i = 0; i < 24; i++) { - if (gSaveBlock1.tvShows.shows[i].massOutbreak.var00 == TVSHOW_MASS_OUTBREAK) + if (gSaveBlock1.tvShows[i].massOutbreak.var00 == TVSHOW_MASS_OUTBREAK) { return; } @@ -691,7 +691,7 @@ void sub_80BE778(void) return; } - gUnknown_03005D38.var0 = sub_80BF720(gSaveBlock1.tvShows.shows); + gUnknown_03005D38.var0 = sub_80BF720(gSaveBlock1.tvShows); if (gUnknown_03005D38.var0 == -1) { return; @@ -707,7 +707,7 @@ void sub_80BE778(void) val2 = gUnknown_03005D38.var0; - tvShow = &gSaveBlock1.tvShows.shows[val2]; + tvShow = &gSaveBlock1.tvShows[val2]; tvShow->massOutbreak.var00 = TVSHOW_MASS_OUTBREAK; tvShow->massOutbreak.var01 = 1; @@ -764,8 +764,8 @@ void sub_80BE8EC(u16 arg0) TVShow *tvShow; if (gSaveBlock1.outbreakPokemonSpecies == 0) { for (showidx=0; showidx<24; showidx++) { - if (gSaveBlock1.tvShows.shows[showidx].massOutbreak.var00 == TVSHOW_MASS_OUTBREAK && gSaveBlock1.tvShows.shows[showidx].massOutbreak.var01 == 0x01) { - tvShow = &(gSaveBlock1.tvShows.shows[showidx]); + if (gSaveBlock1.tvShows[showidx].massOutbreak.var00 == TVSHOW_MASS_OUTBREAK && gSaveBlock1.tvShows[showidx].massOutbreak.var01 == 0x01) { + tvShow = &(gSaveBlock1.tvShows[showidx]); if (tvShow->massOutbreak.var16 < arg0) tvShow->massOutbreak.var16 = 0; else @@ -811,9 +811,9 @@ void sub_80BE97C(bool8 flag) void sub_80BE9D4() { TVShow *show; - gUnknown_03005D38.var0 = sub_80BF74C(gSaveBlock1.tvShows.shows); + gUnknown_03005D38.var0 = sub_80BF74C(gSaveBlock1.tvShows); if (gUnknown_03005D38.var0 != -1 && sub_80BF1B4(TVSHOW_FISHING_ADVICE) != 1) { - show = &(gSaveBlock1.tvShows.shows[gUnknown_03005D38.var0]); + show = &(gSaveBlock1.tvShows[gUnknown_03005D38.var0]); #ifdef NONMATCHING show->pokemonAngler.var00 = TVSHOW_FISHING_ADVICE; show->pokemonAngler.var01 = 0; @@ -845,12 +845,12 @@ void sub_80BEA88(void); void sub_80BEA5C(u16 arg0) { TVShow *unk_2a98; - unk_2a98 = &gSaveBlock1.tvShows.unknown_2A98; + unk_2a98 = &gSaveBlock1.tvShows[24]; if (unk_2a98->common.var00 == TVSHOW_WORLD_OF_MASTERS) { if (unk_2a98->worldOfMasters.var02 < 20) { - sub_80BF55C(gSaveBlock1.tvShows.shows, 0x18); + sub_80BF55C(gSaveBlock1.tvShows, 0x18); } else { @@ -863,14 +863,14 @@ void sub_80BEA88(void) TVShow *unk_2a98; TVShow *tvShow; u8 rval; - unk_2a98 = &gSaveBlock1.tvShows.unknown_2A98; + unk_2a98 = &gSaveBlock1.tvShows[24]; rval = sub_80BF77C(0xFFFF); if (rval == 0) { - gUnknown_03005D38.var0 = sub_80BF74C(gSaveBlock1.tvShows.shows); + gUnknown_03005D38.var0 = sub_80BF74C(gSaveBlock1.tvShows); if (gUnknown_03005D38.var0 != -1 && sub_80BF1B4(TVSHOW_WORLD_OF_MASTERS) != 1) { - tvShow = &gSaveBlock1.tvShows.shows[gUnknown_03005D38.var0]; + tvShow = &gSaveBlock1.tvShows[gUnknown_03005D38.var0]; tvShow->worldOfMasters.var00 = TVSHOW_WORLD_OF_MASTERS; tvShow->worldOfMasters.var01 = rval; tvShow->worldOfMasters.var02 = unk_2a98->worldOfMasters.var02; @@ -1136,7 +1136,7 @@ void CopyContestCategoryToStringVar(u8 strvaridx, u8 category) void SetContestCategoryStringVarForInterview(void) { TVShow *tvShow; - tvShow = &gSaveBlock1.tvShows.shows[gSpecialVar_0x8004]; + tvShow = &gSaveBlock1.tvShows[gSpecialVar_0x8004]; CopyContestCategoryToStringVar(1, tvShow->bravoTrainer.contestCategory); } @@ -1196,7 +1196,7 @@ bool8 sub_80BF1B4(u8 showIdx) TVShow *tvShows; u8 i; u32 trainerId; - tvShows = gSaveBlock1.tvShows.shows; + tvShows = gSaveBlock1.tvShows; trainerId = GetPlayerTrainerId(); for (i=5; i<24; i++) { @@ -1237,15 +1237,15 @@ void sub_80BF25C(u8 showType) u8 i; for (i=0; i<5; i++) { - if (gSaveBlock1.tvShows.shows[i].common.var00 == showType) { - if(gSaveBlock1.tvShows.shows[i].common.var01 == 1) + if (gSaveBlock1.tvShows[i].common.var00 == showType) { + if(gSaveBlock1.tvShows[i].common.var01 == 1) { gScriptResult = 1; } else { - sub_80BF55C(gSaveBlock1.tvShows.shows, i); - sub_80BF588(gSaveBlock1.tvShows.shows); + sub_80BF55C(gSaveBlock1.tvShows, i); + sub_80BF588(gSaveBlock1.tvShows); sub_80BF6D8(); } return; @@ -1288,7 +1288,7 @@ void sub_80BF334(void) sub_80BF25C(TVSHOW_FAN_CLUB_LETTER); if (gScriptResult == 0) { StringCopy(gStringVar1, gSpeciesNames[GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_SPECIES, 0)]); - show = &gSaveBlock1.tvShows.shows[gUnknown_03005D38.var0]; + show = &gSaveBlock1.tvShows[gUnknown_03005D38.var0]; sub_80EB6FC(show->fanclubLetter.pad04, 6); } } @@ -1298,7 +1298,7 @@ void sub_80BF3A4(void) TVShow *show; sub_80BF25C(TVSHOW_RECENT_HAPPENINGS); if (gScriptResult == 0) { - show = &gSaveBlock1.tvShows.shows[gUnknown_03005D38.var0]; + show = &gSaveBlock1.tvShows[gUnknown_03005D38.var0]; sub_80EB6FC(show->recentHappenings.var04, 6); } } @@ -1311,7 +1311,7 @@ void sub_80BF3DC(void) StringCopy(gStringVar1, gSpeciesNames[GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_SPECIES, 0)]); GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_NICKNAME, gStringVar2); StringGetEnd10(gStringVar2); - show = &gSaveBlock1.tvShows.shows[gUnknown_03005D38.var0]; + show = &gSaveBlock1.tvShows[gUnknown_03005D38.var0]; sub_80EB6FC(show->fanclubOpinions.var1C, 2); } } @@ -1331,7 +1331,7 @@ void sub_80BF484(void) TVShow *show; sub_80BF25C(TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE); if (gScriptResult == 0) { - show = &gSaveBlock1.tvShows.shows[gUnknown_03005D38.var0]; + show = &gSaveBlock1.tvShows[gUnknown_03005D38.var0]; sub_80EB6FC(show->bravoTrainer.var04, 2); } } @@ -1341,7 +1341,7 @@ void sub_80BF4BC(void) TVShow *show; sub_80BF25C(TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE); if (gScriptResult == 0) { - show = &gSaveBlock1.tvShows.shows[gUnknown_03005D38.var0]; + show = &gSaveBlock1.tvShows[gUnknown_03005D38.var0]; sub_80EB6FC(show->bravoTrainerTower.var18, 1); // wrong struct ident, fix later } } @@ -1397,7 +1397,7 @@ void sub_80BF588(TVShow tvShow[]) for (showidx2=showidx+1; showidx2<24; showidx2++) { if (tvShow[showidx2].common.var00 != 0) { tvShow[showidx] = tvShow[showidx2]; - sub_80BF55C(gSaveBlock1.tvShows.shows, showidx2); + sub_80BF55C(gSaveBlock1.tvShows, showidx2); break; } } @@ -1433,7 +1433,7 @@ u16 sub_80BF674(u16 species) void sub_80BF6D8(void) { - gUnknown_03005D38.var0 = sub_80BF720(gSaveBlock1.tvShows.shows); + gUnknown_03005D38.var0 = sub_80BF720(gSaveBlock1.tvShows); gSpecialVar_0x8006 = gUnknown_03005D38.var0; if (gUnknown_03005D38.var0 == -1) gScriptResult = 1; @@ -1549,7 +1549,7 @@ bool8 sub_80BF974(void) u8 i; for (i=0; i<5; i++) { - if (gSaveBlock1.tvShows.shows[i].common.var00 == gSpecialVar_0x8004) + if (gSaveBlock1.tvShows[i].common.var00 == gSpecialVar_0x8004) return TRUE; } return FALSE; @@ -1807,10 +1807,10 @@ extern u8 ewram[]; extern u8 gUnknown_020387E4; struct ewramStruct_0207000 { - struct SaveTVStruct tvshows[4]; + TVShow tvshows[4][25]; }; -void sub_80BFE24(struct SaveTVStruct *arg0, struct SaveTVStruct *arg1, struct SaveTVStruct *arg2, struct SaveTVStruct *arg3); +void sub_80BFE24(TVShow arg0[25], TVShow arg1[25], TVShow arg2[25], TVShow arg3[25]); void sub_80C04A0(void); void sub_80C01D4(void); @@ -1821,26 +1821,26 @@ void sub_80BFD44(u8 *arg0, u32 arg1, u8 arg2) u8 i; struct ewramStruct_0207000 *ewramTVShows; for (i=0; i<4; i++) { - memcpy(&gUnknown_02007000.tvshows[i], &arg0[i * arg1], sizeof(struct SaveTVStruct)); + memcpy(&gUnknown_02007000.tvshows[i], &arg0[i * arg1], 25 * sizeof(TVShow)); } ewramTVShows = &gUnknown_02007000; switch (arg2) { case 0: - sub_80BFE24(&gSaveBlock1.tvShows, &ewramTVShows->tvshows[1], &ewramTVShows->tvshows[2], &ewramTVShows->tvshows[3]); + sub_80BFE24(gSaveBlock1.tvShows, ewramTVShows->tvshows[1], ewramTVShows->tvshows[2], ewramTVShows->tvshows[3]); break; case 1: - sub_80BFE24(&ewramTVShows->tvshows[0], &gSaveBlock1.tvShows, &ewramTVShows->tvshows[2], &ewramTVShows->tvshows[3]); + sub_80BFE24(ewramTVShows->tvshows[0], gSaveBlock1.tvShows, ewramTVShows->tvshows[2], ewramTVShows->tvshows[3]); break; case 2: - sub_80BFE24(&ewramTVShows->tvshows[0], &ewramTVShows->tvshows[1], &gSaveBlock1.tvShows, &ewramTVShows->tvshows[3]); + sub_80BFE24(ewramTVShows->tvshows[0], ewramTVShows->tvshows[1], gSaveBlock1.tvShows, ewramTVShows->tvshows[3]); break; case 3: - sub_80BFE24(&ewramTVShows->tvshows[0], &ewramTVShows->tvshows[1], &ewramTVShows->tvshows[2], &gSaveBlock1.tvShows); + sub_80BFE24(ewramTVShows->tvshows[0], ewramTVShows->tvshows[1], ewramTVShows->tvshows[2], gSaveBlock1.tvShows); break; } - sub_80BF588(gSaveBlock1.tvShows.shows); + sub_80BF588(gSaveBlock1.tvShows); sub_80C04A0(); - sub_80BF588(gSaveBlock1.tvShows.shows); + sub_80BF588(gSaveBlock1.tvShows); sub_80C01D4(); sub_80C0408(); } @@ -1848,15 +1848,15 @@ void sub_80BFD44(u8 *arg0, u32 arg1, u8 arg2) extern u8 gUnknown_03000720; extern s8 gUnknown_03000722; s8 sub_80C019C(TVShow tvShows[]); -bool8 sub_80BFF68(struct SaveTVStruct ** tv1, struct SaveTVStruct ** tv2, u8 idx); +bool8 sub_80BFF68(TVShow * tv1[25], TVShow * tv2[25], u8 idx); u8 sub_80C004C(TVShow *tv1, TVShow *tv2, u8 idx); u8 sub_80C00B4(TVShow *tv1, TVShow *tv2, u8 idx); u8 sub_80C0134(TVShow *tv1, TVShow *tv2, u8 idx); -void sub_80BFE24(struct SaveTVStruct *arg0, struct SaveTVStruct *arg1, struct SaveTVStruct *arg2, struct SaveTVStruct *arg3) +void sub_80BFE24(TVShow arg0[25], TVShow arg1[25], TVShow arg2[25], TVShow arg3[25]) { u8 i, j; - struct SaveTVStruct ** argslist[4]; + TVShow ** argslist[4]; argslist[0] = &arg0; argslist[1] = &arg1; argslist[2] = &arg2; @@ -1866,20 +1866,20 @@ void sub_80BFE24(struct SaveTVStruct *arg0, struct SaveTVStruct *arg1, struct Sa for (i=0; ishows); + gUnknown_03000722 = sub_80C019C(argslist[i][0]); if (gUnknown_03000722 == -1) { gUnknown_020387E4++; if (gUnknown_020387E4 == gUnknown_03000720) return; } else { for (j=0; jshows); - if (gUnknown_03005D38.var0 != -1 && sub_80BFF68(argslist[(i + j + 1) % gUnknown_03000720], argslist[i], (i + j + 1) % gUnknown_03000720) == 1) { + gUnknown_03005D38.var0 = sub_80BF74C(argslist[(i + j + 1) % gUnknown_03000720][0]); + if (gUnknown_03005D38.var0 != -1 && sub_80BFF68(&argslist[(i + j + 1) % gUnknown_03000720][0], &argslist[i][0], (i + j + 1) % gUnknown_03000720) == 1) { break; } } if (j == gUnknown_03000720 - 1) { - sub_80BF55C(argslist[i][0]->shows, gUnknown_03000722); + sub_80BF55C(argslist[i][0], gUnknown_03000722); } } } @@ -1887,28 +1887,28 @@ void sub_80BFE24(struct SaveTVStruct *arg0, struct SaveTVStruct *arg1, struct Sa } #ifdef NONMATCHING -bool8 sub_80BFF68(struct SaveTVStruct ** arg1, struct SaveTVStruct ** arg2, u8 idx) { +bool8 sub_80BFF68(TVShow * arg1[25], TVShow * arg2[25], u8 idx) { u8 value; u8 switchval; - struct SaveTVStruct *tv1; - struct SaveTVStruct *tv2; + TVShow tv1[25]; + TVShow tv2[25]; tv1 = *arg1; tv2 = *arg2; value = FALSE; - switchval = sub_80BFB54(tv2->shows[gUnknown_03000722].common.var00); + switchval = sub_80BFB54(tv2[gUnknown_03000722].common.var00); switch (switchval) { case 2: - value = sub_80C004C(&tv1->shows[gUnknown_03005D38.var0], &tv2->shows[gUnknown_03000722], idx); + value = sub_80C004C(&tv1[gUnknown_03005D38.var0], &tv2[gUnknown_03000722], idx); break; case 3: - value = sub_80C00B4(&tv1->shows[gUnknown_03005D38.var0], &tv2->shows[gUnknown_03000722], idx); + value = sub_80C00B4(&tv1[gUnknown_03005D38.var0], &tv2[gUnknown_03000722], idx); break; case 4: - value = sub_80C0134(&tv1->shows[gUnknown_03005D38.var0], &tv2->shows[gUnknown_03000722], idx); + value = sub_80C0134(&tv1[gUnknown_03005D38.var0], &tv2[gUnknown_03000722], idx); break; } if (value == TRUE) { - sub_80BF55C(tv2->shows, gUnknown_03000722); + sub_80BF55C(tv2, gUnknown_03000722); return TRUE; } else { return FALSE; @@ -1916,7 +1916,7 @@ bool8 sub_80BFF68(struct SaveTVStruct ** arg1, struct SaveTVStruct ** arg2, u8 i } #else __attribute__((naked)) -bool8 sub_80BFF68(struct SaveTVStruct ** arg1, struct SaveTVStruct ** arg2, u8 idx) { +bool8 sub_80BFF68(TVShow * arg1[25], TVShow * arg2[25], u8 idx) { asm(".syntax unified\n\ push {r4-r7,lr}\n\ sub sp, 0x4\n\ @@ -2099,46 +2099,46 @@ void sub_80C03C8(u16 species, u8 showidx); void sub_80C01D4(void) { u8 i; for (i=0; i<24; i++) { - switch (gSaveBlock1.tvShows.shows[i].common.var00) { + switch (gSavegitBlock1.tvShows[i].common.var00) { case 0: break; case TVSHOW_FAN_CLUB_LETTER: - sub_80C03C8(gSaveBlock1.tvShows.shows[i].fanclubLetter.species, i); + sub_80C03C8(gSaveBlock1.tvShows[i].fanclubLetter.species, i); break; case TVSHOW_RECENT_HAPPENINGS: break; case TVSHOW_PKMN_FAN_CLUB_OPINIONS: - sub_80C03C8(gSaveBlock1.tvShows.shows[i].fanclubOpinions.var02, i); + sub_80C03C8(gSaveBlock1.tvShows[i].fanclubOpinions.var02, i); break; case TVSHOW_UNKN_SHOWTYPE_04: - sub_80C03C8(gSaveBlock1.tvShows.shows[i].worldOfMasters.var06, i); + sub_80C03C8(gSaveBlock1.tvShows[i].worldOfMasters.var06, i); break; case TVSHOW_NAME_RATER_SHOW: - sub_80C03C8(gSaveBlock1.tvShows.shows[i].nameRaterShow.species, i); - sub_80C03C8(gSaveBlock1.tvShows.shows[i].nameRaterShow.var1C, i); + sub_80C03C8(gSaveBlock1.tvShows[i].nameRaterShow.species, i); + sub_80C03C8(gSaveBlock1.tvShows[i].nameRaterShow.var1C, i); break; case TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE: - sub_80C03C8(gSaveBlock1.tvShows.shows[i].bravoTrainer.species, i); + sub_80C03C8(gSaveBlock1.tvShows[i].bravoTrainer.species, i); break; case TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE: - sub_80C03C8(gSaveBlock1.tvShows.shows[i].bravoTrainerTower.var0a, i); - sub_80C03C8(gSaveBlock1.tvShows.shows[i].bravoTrainerTower.var14, i); + sub_80C03C8(gSaveBlock1.tvShows[i].bravoTrainerTower.var0a, i); + sub_80C03C8(gSaveBlock1.tvShows[i].bravoTrainerTower.var14, i); break; case TVSHOW_POKEMON_TODAY_CAUGHT: - sub_80C03C8(gSaveBlock1.tvShows.shows[i].pokemonToday.species, i); + sub_80C03C8(gSaveBlock1.tvShows[i].pokemonToday.species, i); break; case TVSHOW_SMART_SHOPPER: break; case TVSHOW_POKEMON_TODAY_FAILED: - sub_80C03C8(gSaveBlock1.tvShows.shows[i].pokemonTodayFailed.species, i); - sub_80C03C8(gSaveBlock1.tvShows.shows[i].pokemonTodayFailed.species2, i); + sub_80C03C8(gSaveBlock1.tvShows[i].pokemonTodayFailed.species, i); + sub_80C03C8(gSaveBlock1.tvShows[i].pokemonTodayFailed.species2, i); break; case TVSHOW_FISHING_ADVICE: - sub_80C03C8(gSaveBlock1.tvShows.shows[i].pokemonAngler.var04, i); + sub_80C03C8(gSaveBlock1.tvShows[i].pokemonAngler.var04, i); break; case TVSHOW_WORLD_OF_MASTERS: - sub_80C03C8(gSaveBlock1.tvShows.shows[i].worldOfMasters.var08, i); - sub_80C03C8(gSaveBlock1.tvShows.shows[i].worldOfMasters.var04, i); + sub_80C03C8(gSaveBlock1.tvShows[i].worldOfMasters.var08, i); + sub_80C03C8(gSaveBlock1.tvShows[i].worldOfMasters.var04, i); break; case TVSHOW_MASS_OUTBREAK: break; @@ -2356,12 +2356,12 @@ _080C03A0:\n\ #endif void sub_80C03A8(u8 showidx) { - gSaveBlock1.tvShows.shows[showidx].common.var01 = 0; + gSaveBlock1.tvShows[showidx].common.var01 = 0; } void sub_80C03C8(u16 species, u8 showidx) { if (sub_8090D90(SpeciesToNationalPokedexNum(species), 0) == 0) { - gSaveBlock1.tvShows.shows[showidx].common.var01 = 0; + gSaveBlock1.tvShows[showidx].common.var01 = 0; } } @@ -2370,8 +2370,8 @@ void sub_80C0408(void) { u16 i; if (FlagGet(SYS_GAME_CLEAR) != 1) { for (i=0; i<24; i++) { - if (gSaveBlock1.tvShows.shows[i].common.var00 == TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE || gSaveBlock1.tvShows.shows[i].common.var00 == TVSHOW_MASS_OUTBREAK) { - gSaveBlock1.tvShows.shows[i].common.var01 = 0; + if (gSaveBlock1.tvShows[i].common.var00 == TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE || gSaveBlock1.tvShows[i].common.var00 == TVSHOW_MASS_OUTBREAK) { + gSaveBlock1.tvShows[i].common.var01 = 0; } } } @@ -2428,8 +2428,8 @@ _080C0458: .4byte 0x00002738\n\ void sub_80C045C(void) { u8 i; for (i=0; i<5; i++) { - if (sub_80BFB54(gSaveBlock1.tvShows.shows[i].common.var00) == 2) { - gSaveBlock1.tvShows.shows[i].common.var01 = 0; + if (sub_80BFB54(gSaveBlock1.tvShows[i].common.var00) == 2) { + gSaveBlock1.tvShows[i].common.var01 = 0; } } } @@ -2504,8 +2504,8 @@ void sub_80C0788(void) { } void DoTVShow(void) { - if (gSaveBlock1.tvShows.shows[gSpecialVar_0x8004].common.var01 != 0) { - switch (gSaveBlock1.tvShows.shows[gSpecialVar_0x8004].common.var00) { + if (gSaveBlock1.tvShows[gSpecialVar_0x8004].common.var01 != 0) { + switch (gSaveBlock1.tvShows[gSpecialVar_0x8004].common.var00) { case TVSHOW_FAN_CLUB_LETTER: DoTVShowPokemonFanClubLetter(); break; @@ -2565,7 +2565,7 @@ void TakeTVShowInSearchOfTrainersOffTheAir(void); void DoTVShowTheNameRaterShow(void) { TVShow *tvShow; u8 switchval; - tvShow = &gSaveBlock1.tvShows.shows[gSpecialVar_0x8004]; + tvShow = &gSaveBlock1.tvShows[gSpecialVar_0x8004]; gScriptResult = 0; switchval = gUnknown_020387E8; switch (switchval) { @@ -2661,7 +2661,7 @@ void DoTVShowTheNameRaterShow(void) { void DoTVShowPokemonTodaySuccessfulCapture(void) { TVShow *tvShow; u8 switchval; - tvShow = &gSaveBlock1.tvShows.shows[gSpecialVar_0x8004]; + tvShow = &gSaveBlock1.tvShows[gSpecialVar_0x8004]; gScriptResult = 0; switchval = gUnknown_020387E8; switch (switchval) { @@ -2731,7 +2731,7 @@ void DoTVShowPokemonTodayFailedCapture(void) { TVShow *tvShow; u8 switchval; u16 rval; - tvShow = &gSaveBlock1.tvShows.shows[gSpecialVar_0x8004]; + tvShow = &gSaveBlock1.tvShows[gSpecialVar_0x8004]; gScriptResult = 0; switchval = gUnknown_020387E8; switch (switchval) { @@ -2777,7 +2777,7 @@ void DoTVShowPokemonFanClubLetter(void) { TVShow *tvShow; u8 switchval; u16 rval; - tvShow = &gSaveBlock1.tvShows.shows[gSpecialVar_0x8004]; + tvShow = &gSaveBlock1.tvShows[gSpecialVar_0x8004]; gScriptResult = 0; switchval = gUnknown_020387E8; switch (switchval) { @@ -2828,7 +2828,7 @@ void DoTVShowPokemonFanClubLetter(void) { void DoTVShowRecentHappenings(void) { TVShow *tvShow; u8 switchval; - tvShow = &gSaveBlock1.tvShows.shows[gSpecialVar_0x8004]; + tvShow = &gSaveBlock1.tvShows[gSpecialVar_0x8004]; gScriptResult = 0; switchval = gUnknown_020387E8; switch (switchval) { @@ -2860,7 +2860,7 @@ void DoTVShowRecentHappenings(void) { void DoTVShowPokemonFanClubOpinions(void) { TVShow *tvShow; u8 switchval; - tvShow = &gSaveBlock1.tvShows.shows[gSpecialVar_0x8004]; + tvShow = &gSaveBlock1.tvShows[gSpecialVar_0x8004]; gScriptResult = 0; switchval = gUnknown_020387E8; switch (switchval) { @@ -2895,7 +2895,7 @@ void DoTVShowPokemonNewsMassOutbreak(void) { TVShow *tvShow; - tvShow = &gSaveBlock1.tvShows.shows[gSpecialVar_0x8004]; + tvShow = &gSaveBlock1.tvShows[gSpecialVar_0x8004]; sub_80FBFB4(gStringVar1, tvShow->massOutbreak.locationMapNum, 0); @@ -2963,7 +2963,7 @@ void DoTVShowInSearchOfTrainers(void) { void DoTVShowPokemonAngler(void) { TVShow *tvShow; u8 switchval; - tvShow = &gSaveBlock1.tvShows.shows[gSpecialVar_0x8004]; + tvShow = &gSaveBlock1.tvShows[gSpecialVar_0x8004]; gScriptResult = 0; if (tvShow->pokemonAngler.var02 < tvShow->pokemonAngler.var03) { gUnknown_020387E8 = 0; @@ -2991,7 +2991,7 @@ void DoTVShowPokemonAngler(void) { void DoTVShowTheWorldOfMasters(void) { TVShow *tvShow; u8 switchval; - tvShow = &gSaveBlock1.tvShows.shows[gSpecialVar_0x8004]; + tvShow = &gSaveBlock1.tvShows[gSpecialVar_0x8004]; gScriptResult = 0; switchval = gUnknown_020387E8; switch (switchval) { @@ -3022,7 +3022,7 @@ void TVShowDone(void) gScriptResult = 1; gUnknown_020387E8 = 0; - gSaveBlock1.tvShows.shows[gSpecialVar_0x8004].common.var01 = 0; + gSaveBlock1.tvShows[gSpecialVar_0x8004].common.var01 = 0; } void sub_80C2014(void) -- cgit v1.2.3 From 9dfb37a584dd6a5d01ffdf12004b320e5c8d8987 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 28 May 2017 21:48:20 -0400 Subject: nonmatching special_0x44 --- src/tv.c | 142 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) mode change 100644 => 100755 src/tv.c (limited to 'src') diff --git a/src/tv.c b/src/tv.c old mode 100644 new mode 100755 index 9d5426a88..7ae7c03ba --- a/src/tv.c +++ b/src/tv.c @@ -134,6 +134,148 @@ void sub_80BE074(void); void sub_80BE778(void); void sub_80BEB20(void); +u8 sub_80BFB54(u8); + +#ifdef NONMATCHING +u8 special_0x44(void) +{ + u8 i; + u8 j; + u8 var01; + TVShow *tvShow; + for (i=5; i<24; i++) + { + if (gSaveBlock1.tvShows[i].common.var00 == 0) + { + break; + } + } + i = Random() % i; + j = i; + do + { + if (sub_80BFB54(gSaveBlock1.tvShows[i].common.var00) != 4) + { + var01 = gSaveBlock1.tvShows[i].common.var01; + } else + { + tvShow = &gSaveBlock1.tvShows[i]; + if (tvShow->massOutbreak.var16 != 0) { + continue; + } else { + var01 = tvShow->common.var01; + } + } + if (var01 == 1) + { + return i; + } + } while (i == 0 ? i = 23 : i --, i != j); + return 0xff; +} +#else +__attribute__((naked)) +u8 special_0x44(void) +{ + asm(".syntax unified\n" + " push {r4-r7,lr}\n" + " mov r7, r9\n" + " mov r6, r8\n" + " push {r6,r7}\n" + " movs r4, 0x5\n" + " ldr r1, _080BD874 @ =gSaveBlock1\n" + " ldr r2, _080BD878 @ =0x000027ec\n" + " adds r0, r1, r2\n" + " ldrb r0, [r0]\n" + " cmp r0, 0\n" + " beq _080BD834\n" + " adds r2, r1, 0\n" + " ldr r1, _080BD87C @ =0x00002738\n" + "_080BD81A:\n" + " adds r0, r4, 0x1\n" + " lsls r0, 24\n" + " lsrs r4, r0, 24\n" + " cmp r4, 0x17\n" + " bhi _080BD834\n" + " lsls r0, r4, 3\n" + " adds r0, r4\n" + " lsls r0, 2\n" + " adds r0, r2\n" + " adds r0, r1\n" + " ldrb r0, [r0]\n" + " cmp r0, 0\n" + " bne _080BD81A\n" + "_080BD834:\n" + " bl Random\n" + " lsls r0, 16\n" + " lsrs r0, 16\n" + " adds r1, r4, 0\n" + " bl __modsi3\n" + " lsls r0, 24\n" + " lsrs r4, r0, 24\n" + " mov r8, r4\n" + " ldr r7, _080BD874 @ =gSaveBlock1\n" + " ldr r0, _080BD87C @ =0x00002738\n" + " adds r0, r7\n" + " mov r9, r0\n" + "_080BD850:\n" + " lsls r0, r4, 3\n" + " adds r0, r4\n" + " lsls r6, r0, 2\n" + " adds r5, r6, r7\n" + " ldr r1, _080BD87C @ =0x00002738\n" + " adds r0, r5, r1\n" + " ldrb r0, [r0]\n" + " bl sub_80BFB54\n" + " lsls r0, 24\n" + " lsrs r0, 24\n" + " cmp r0, 0x4\n" + " beq _080BD884\n" + " ldr r2, _080BD880 @ =0x00002739\n" + " adds r0, r5, r2\n" + " ldrb r0, [r0]\n" + " b _080BD890\n" + " .align 2, 0\n" + "_080BD874: .4byte gSaveBlock1\n" + "_080BD878: .4byte 0x000027ec\n" + "_080BD87C: .4byte 0x00002738\n" + "_080BD880: .4byte 0x00002739\n" + "_080BD884:\n" + " mov r0, r9\n" + " adds r1, r6, r0\n" + " ldrh r0, [r1, 0x16]\n" + " cmp r0, 0\n" + " bne _080BD898\n" + " ldrb r0, [r1, 0x1]\n" + "_080BD890:\n" + " cmp r0, 0x1\n" + " bne _080BD898\n" + " adds r0, r4, 0\n" + " b _080BD8AC\n" + "_080BD898:\n" + " cmp r4, 0\n" + " bne _080BD8A0\n" + " movs r4, 0x17\n" + " b _080BD8A6\n" + "_080BD8A0:\n" + " subs r0, r4, 0x1\n" + " lsls r0, 24\n" + " lsrs r4, r0, 24\n" + "_080BD8A6:\n" + " cmp r4, r8\n" + " bne _080BD850\n" + " movs r0, 0xFF\n" + "_080BD8AC:\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"); +} +#endif + asm(".section .text_a"); s8 sub_80BF74C(TVShow tvShow[]); -- cgit v1.2.3 From d3ed70f31029e3702d2a7e2eb1844bcdaad323b2 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 28 May 2017 22:07:11 -0400 Subject: sub_80BD8B8 --- src/tv.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/tv.c b/src/tv.c index 7ae7c03ba..b4b2058ea 100755 --- a/src/tv.c +++ b/src/tv.c @@ -276,6 +276,23 @@ u8 special_0x44(void) } #endif +u8 sub_80BDA30(void); + +u8 sub_80BD8B8(void) +{ + u8 retval; + retval = special_0x44(); + if (retval == 0xff) + { + return 0xff; + } + if (gSaveBlock1.outbreakPokemonSpecies != 0 && gSaveBlock1.tvShows[retval].common.var00 == TVSHOW_MASS_OUTBREAK) + { + return sub_80BDA30(); + } + return retval; +} + asm(".section .text_a"); s8 sub_80BF74C(TVShow tvShow[]); -- cgit v1.2.3 From 8c18d43811d663d9998e32444d137c6064eba840 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 29 May 2017 18:47:32 -0400 Subject: UpdateTVScreensOnMap --- src/tv.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src') diff --git a/src/tv.c b/src/tv.c index b4b2058ea..6a1034f81 100755 --- a/src/tv.c +++ b/src/tv.c @@ -293,6 +293,36 @@ u8 sub_80BD8B8(void) return retval; } +u8 CheckForBigMovieOrEmergencyNewsOnTV(void); +void SetTVMetatilesOnMap(s32, s32, u16); +bool8 sub_80BECA0(void); +bool8 IsTVShowInSearchOfTrainersAiring(void); + +void UpdateTVScreensOnMap(s32 a0, s32 a1) +{ + u8 bigMovieOrEmergencyNewsOnTv; + FlagSet(SYS_TV_WATCH); + bigMovieOrEmergencyNewsOnTv = CheckForBigMovieOrEmergencyNewsOnTV(); + switch (bigMovieOrEmergencyNewsOnTv) + { + case 1: + SetTVMetatilesOnMap(a0, a1, 0x3); + break; + case 2: + break; + default: + if (gSaveBlock1.location.mapGroup == MAP_GROUP_LILYCOVE_CITY_COVE_LILY_MOTEL_1F && gSaveBlock1.location.mapNum == MAP_ID_LILYCOVE_CITY_COVE_LILY_MOTEL_1F) + { + SetTVMetatilesOnMap(a0, a1, 0x3); + } + else if (FlagGet(SYS_TV_START) && (sub_80BD8B8() != 0xff || sub_80BECA0() != 0xff || IsTVShowInSearchOfTrainersAiring())) + { + FlagReset(SYS_TV_WATCH); + SetTVMetatilesOnMap(a0, a1, 0x3); + } + } +} + asm(".section .text_a"); s8 sub_80BF74C(TVShow tvShow[]); -- cgit v1.2.3 From e18309037970a8034c4c3022c978bb7122984953 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 29 May 2017 19:07:55 -0400 Subject: SetTVMetatilesOnMap --- src/tv.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/tv.c b/src/tv.c index 6a1034f81..94aab8f56 100755 --- a/src/tv.c +++ b/src/tv.c @@ -294,11 +294,11 @@ u8 sub_80BD8B8(void) } u8 CheckForBigMovieOrEmergencyNewsOnTV(void); -void SetTVMetatilesOnMap(s32, s32, u16); +void SetTVMetatilesOnMap(int, int, u16); bool8 sub_80BECA0(void); bool8 IsTVShowInSearchOfTrainersAiring(void); -void UpdateTVScreensOnMap(s32 a0, s32 a1) +void UpdateTVScreensOnMap(int a0, int a1) { u8 bigMovieOrEmergencyNewsOnTv; FlagSet(SYS_TV_WATCH); @@ -323,6 +323,22 @@ void UpdateTVScreensOnMap(s32 a0, s32 a1) } } +void SetTVMetatilesOnMap(int width, int height, u16 tileId) +{ + int x; + int y; + for (y=0; y Date: Mon, 29 May 2017 19:12:46 -0400 Subject: TurnOffTVScreen --- src/fieldmap.c | 8 -------- src/tv.c | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/fieldmap.c b/src/fieldmap.c index 0301115d5..46b996e52 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -2,13 +2,6 @@ #include "fieldmap.h" #include "palette.h" -struct BackupMapData -{ - s32 width; - s32 height; - u16 *map; -}; - extern struct MapHeader * const get_mapheader_by_bank_and_number(u8, u8); extern void mapheader_run_script_with_tag_x1(void); extern void sub_80BB970(struct MapEvents *); @@ -32,7 +25,6 @@ struct Coords32 }; extern const struct Coords32 gUnknown_0821664C[]; -extern struct BackupMapData gUnknown_03004870; EWRAM_DATA static u16 gUnknown_02029828[0x2800] = {0}; EWRAM_DATA struct MapHeader gMapHeader = {0}; diff --git a/src/tv.c b/src/tv.c index 94aab8f56..5e9314353 100755 --- a/src/tv.c +++ b/src/tv.c @@ -3,7 +3,9 @@ #include "tv.h" #include "data2.h" #include "event_data.h" +#include "fieldmap.h" #include "field_message_box.h" +#include "field_camera.h" #include "flags.h" #include "rng.h" #include "string_util.h" @@ -339,6 +341,12 @@ void SetTVMetatilesOnMap(int width, int height, u16 tileId) } } +void TurnOffTVScreen(void) +{ + SetTVMetatilesOnMap(gUnknown_03004870.width, gUnknown_03004870.height, 0x2); + DrawWholeMapView(); +} + asm(".section .text_a"); s8 sub_80BF74C(TVShow tvShow[]); -- cgit v1.2.3 From e78a3021bbac8f439797265b727803ee5ea40484 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 29 May 2017 19:23:59 -0400 Subject: Two more subroutines in tv.s --- src/tv.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src') diff --git a/src/tv.c b/src/tv.c index 5e9314353..af86a335b 100755 --- a/src/tv.c +++ b/src/tv.c @@ -347,6 +347,24 @@ void TurnOffTVScreen(void) DrawWholeMapView(); } +u8 sub_80BDA0C(void) +{ + return gSaveBlock1.tvShows[gSpecialVar_0x8004].common.var00; +} + +u8 sub_80BDA30(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) + { + return showIdx; + } + } + return 0xff; +} + asm(".section .text_a"); s8 sub_80BF74C(TVShow tvShow[]); -- cgit v1.2.3 From 2cd382d3c65c19dbd9812ce977d6cfcc2aef8dff Mon Sep 17 00:00:00 2001 From: Scott Norton Date: Tue, 30 May 2017 08:38:05 -0400 Subject: ResetGabbyAndTy (nonmatching) --- src/tv.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) (limited to 'src') diff --git a/src/tv.c b/src/tv.c index af86a335b..521bbcb74 100755 --- a/src/tv.c +++ b/src/tv.c @@ -365,6 +365,85 @@ u8 sub_80BDA30(void) return 0xff; } +u8 special_0x4a(void) +{ + TVShow *tvShow; + tvShow = &gSaveBlock1.tvShows[gSpecialVar_0x8004]; + if (tvShow->common.var00 == TVSHOW_MASS_OUTBREAK && gSaveBlock1.outbreakPokemonSpecies) + { + return sub_80BDA30(); + } + return gSpecialVar_0x8004; +} + +#ifdef NONMATCHING +void ResetGabbyAndTy(void) +{ + gSaveBlock1.gabbyAndTyData.mon1 = 0; + gSaveBlock1.gabbyAndTyData.mon2 = 0; + gSaveBlock1.gabbyAndTyData.move1 = 0; + gSaveBlock1.gabbyAndTyData.move2 = 0xffff; + gSaveBlock1.gabbyAndTyData.valA_0 = 0; + gSaveBlock1.gabbyAndTyData.valA_1 = 0; + gSaveBlock1.gabbyAndTyData.valA_2 = 0; + gSaveBlock1.gabbyAndTyData.valA_3 = 0; + gSaveBlock1.gabbyAndTyData.valA_4 = 0; + gSaveBlock1.gabbyAndTyData.valB = 0; + gSaveBlock1.gabbyAndTyData.mapnum = 0; + gSaveBlock1.gabbyAndTyData.val9 = 0; +} +#else +__attribute__((naked)) +void ResetGabbyAndTy(void) +{ + asm(".syntax unified\n" + "\tpush {r4,lr}\n" + "\tldr r2, _080BDAF8 @ =gSaveBlock1\n" + "\tldr r1, _080BDAFC @ =0x00002b10\n" + "\tadds r0, r2, r1\n" + "\tmovs r3, 0\n" + "\tmovs r1, 0\n" + "\tstrh r1, [r0]\n" + "\tldr r4, _080BDB00 @ =0x00002b12\n" + "\tadds r0, r2, r4\n" + "\tstrh r1, [r0]\n" + "\tadds r4, 0x2\n" + "\tadds r0, r2, r4\n" + "\tstrh r1, [r0]\n" + "\tldr r0, _080BDB04 @ =0x00002b16\n" + "\tadds r1, r2, r0\n" + "\tldr r0, _080BDB08 @ =0x0000ffff\n" + "\tstrh r0, [r1]\n" + "\tadds r4, 0x6\n" + "\tadds r1, r2, r4\n" + "\tmovs r0, 0\n" + "\tstrb r0, [r1]\n" + "\tldr r0, _080BDB0C @ =0x00002b1b\n" + "\tadds r1, r2, r0\n" + "\tmovs r0, 0\n" + "\tstrb r0, [r1]\n" + "\tldr r1, _080BDB10 @ =0x00002b18\n" + "\tadds r0, r2, r1\n" + "\tstrb r3, [r0]\n" + "\tsubs r4, 0x1\n" + "\tadds r2, r4\n" + "\tstrb r3, [r2]\n" + "\tpop {r4}\n" + "\tpop {r0}\n" + "\tbx r0\n" + "\t.align 2, 0\n" + "_080BDAF8: .4byte gSaveBlock1\n" + "_080BDAFC: .4byte 0x00002b10\n" + "_080BDB00: .4byte 0x00002b12\n" + "_080BDB04: .4byte 0x00002b16\n" + "_080BDB08: .4byte 0x0000ffff\n" + "_080BDB0C: .4byte 0x00002b1b\n" + "_080BDB10: .4byte 0x00002b18\n" + ".syntax divided\n"); +} +#endif + + asm(".section .text_a"); s8 sub_80BF74C(TVShow tvShow[]); -- cgit v1.2.3 From f2e369d6835a4405644f1a1c9936a06d7cb52775 Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 30 May 2017 10:01:24 -0400 Subject: GabbyAndTyBeforeInterview --- src/tv.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 55 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/tv.c b/src/tv.c index 521bbcb74..33fad5da2 100755 --- a/src/tv.c +++ b/src/tv.c @@ -29,15 +29,20 @@ struct UnkTvStruct }; struct UnkBattleStruct { - u16 var00; - u8 var02[3]; + u8 var00; + u8 var01; + u8 var02; + u8 var03; + u8 var04; u8 var05_0:1; u8 var05_1:1; u8 var05_pad2:6; u16 var06; u8 pad08[24]; u16 var20; - u8 pad22[6]; + u16 var22; + u16 var24; + u16 var26; u16 var28; u8 var2a[11]; u8 var35; @@ -443,6 +448,53 @@ void ResetGabbyAndTy(void) } #endif +void TakeTVShowInSearchOfTrainersOffTheAir(void); + +void GabbyAndTyBeforeInterview(void) +{ + u8 i; + gSaveBlock1.gabbyAndTyData.mon1 = gUnknown_030042E0.var06; + gSaveBlock1.gabbyAndTyData.mon2 = gUnknown_030042E0.var26; + gSaveBlock1.gabbyAndTyData.move1 = gUnknown_030042E0.var22; + if (gSaveBlock1.gabbyAndTyData.val9 != 0xff) + { + gSaveBlock1.gabbyAndTyData.val9 ++; + } + gSaveBlock1.gabbyAndTyData.valA_0 = gUnknown_030042E0.var05_0; + if (gUnknown_030042E0.var00) + { + gSaveBlock1.gabbyAndTyData.valA_1 = 1; + } else + { + gSaveBlock1.gabbyAndTyData.valA_1 = 0; + } + if (gUnknown_030042E0.var03) + { + gSaveBlock1.gabbyAndTyData.valA_2 = 1; + } else + { + gSaveBlock1.gabbyAndTyData.valA_2 = 0; + } + if (!gUnknown_030042E0.var05_1) + { + for (i=0; i < 11; i++) + { + if (gUnknown_030042E0.var36[i] != 0) + { + gSaveBlock1.gabbyAndTyData.valA_3 = 1; + break; + } + } + } else + { + gSaveBlock1.gabbyAndTyData.valA_3 = 1; + } + TakeTVShowInSearchOfTrainersOffTheAir(); + if (gSaveBlock1.gabbyAndTyData.move1 == 0) + { + FlagSet(1); + } +} asm(".section .text_a"); s8 sub_80BF74C(TVShow tvShow[]); -- cgit v1.2.3 From 432f5372c711696e818a26c545ac030539f72f5e Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 30 May 2017 10:29:22 -0400 Subject: sub_80BDC14; get ResetGabbyAndTy matching --- src/tv.c | 70 +++++++++++++++++----------------------------------------------- 1 file changed, 18 insertions(+), 52 deletions(-) (limited to 'src') diff --git a/src/tv.c b/src/tv.c index 33fad5da2..0d04372be 100755 --- a/src/tv.c +++ b/src/tv.c @@ -381,7 +381,6 @@ u8 special_0x4a(void) return gSpecialVar_0x8004; } -#ifdef NONMATCHING void ResetGabbyAndTy(void) { gSaveBlock1.gabbyAndTyData.mon1 = 0; @@ -393,60 +392,16 @@ void ResetGabbyAndTy(void) gSaveBlock1.gabbyAndTyData.valA_2 = 0; gSaveBlock1.gabbyAndTyData.valA_3 = 0; gSaveBlock1.gabbyAndTyData.valA_4 = 0; - gSaveBlock1.gabbyAndTyData.valB = 0; + gSaveBlock1.gabbyAndTyData.valA_5 = 0; + gSaveBlock1.gabbyAndTyData.valB_0 = 0; + gSaveBlock1.gabbyAndTyData.valB_1 = 0; + gSaveBlock1.gabbyAndTyData.valB_2 = 0; + gSaveBlock1.gabbyAndTyData.valB_3 = 0; + gSaveBlock1.gabbyAndTyData.valB_4 = 0; + gSaveBlock1.gabbyAndTyData.valB_5 = 0; gSaveBlock1.gabbyAndTyData.mapnum = 0; gSaveBlock1.gabbyAndTyData.val9 = 0; } -#else -__attribute__((naked)) -void ResetGabbyAndTy(void) -{ - asm(".syntax unified\n" - "\tpush {r4,lr}\n" - "\tldr r2, _080BDAF8 @ =gSaveBlock1\n" - "\tldr r1, _080BDAFC @ =0x00002b10\n" - "\tadds r0, r2, r1\n" - "\tmovs r3, 0\n" - "\tmovs r1, 0\n" - "\tstrh r1, [r0]\n" - "\tldr r4, _080BDB00 @ =0x00002b12\n" - "\tadds r0, r2, r4\n" - "\tstrh r1, [r0]\n" - "\tadds r4, 0x2\n" - "\tadds r0, r2, r4\n" - "\tstrh r1, [r0]\n" - "\tldr r0, _080BDB04 @ =0x00002b16\n" - "\tadds r1, r2, r0\n" - "\tldr r0, _080BDB08 @ =0x0000ffff\n" - "\tstrh r0, [r1]\n" - "\tadds r4, 0x6\n" - "\tadds r1, r2, r4\n" - "\tmovs r0, 0\n" - "\tstrb r0, [r1]\n" - "\tldr r0, _080BDB0C @ =0x00002b1b\n" - "\tadds r1, r2, r0\n" - "\tmovs r0, 0\n" - "\tstrb r0, [r1]\n" - "\tldr r1, _080BDB10 @ =0x00002b18\n" - "\tadds r0, r2, r1\n" - "\tstrb r3, [r0]\n" - "\tsubs r4, 0x1\n" - "\tadds r2, r4\n" - "\tstrb r3, [r2]\n" - "\tpop {r4}\n" - "\tpop {r0}\n" - "\tbx r0\n" - "\t.align 2, 0\n" - "_080BDAF8: .4byte gSaveBlock1\n" - "_080BDAFC: .4byte 0x00002b10\n" - "_080BDB00: .4byte 0x00002b12\n" - "_080BDB04: .4byte 0x00002b16\n" - "_080BDB08: .4byte 0x0000ffff\n" - "_080BDB0C: .4byte 0x00002b1b\n" - "_080BDB10: .4byte 0x00002b18\n" - ".syntax divided\n"); -} -#endif void TakeTVShowInSearchOfTrainersOffTheAir(void); @@ -496,6 +451,17 @@ void GabbyAndTyBeforeInterview(void) } } +void sub_80BDC14(void) +{ + gSaveBlock1.gabbyAndTyData.valB_0 = gSaveBlock1.gabbyAndTyData.valA_0; + gSaveBlock1.gabbyAndTyData.valB_1 = gSaveBlock1.gabbyAndTyData.valA_1; + gSaveBlock1.gabbyAndTyData.valB_2 = gSaveBlock1.gabbyAndTyData.valA_2; + gSaveBlock1.gabbyAndTyData.valB_3 = gSaveBlock1.gabbyAndTyData.valA_3; + gSaveBlock1.gabbyAndTyData.valA_4 = 1; + gSaveBlock1.gabbyAndTyData.mapnum = gMapHeader.name; + IncrementGameStat(GAME_STAT_GOT_INTERVIEWED); +} + asm(".section .text_a"); s8 sub_80BF74C(TVShow tvShow[]); -- cgit v1.2.3 From 4450be586e712c9903f70425edfd7b3fd9bebd20 Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 30 May 2017 10:39:12 -0400 Subject: More Gabby and Ty functions --- src/tv.c | 50 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/tv.c b/src/tv.c index 0d04372be..d1ac9126a 100755 --- a/src/tv.c +++ b/src/tv.c @@ -385,8 +385,8 @@ void ResetGabbyAndTy(void) { gSaveBlock1.gabbyAndTyData.mon1 = 0; gSaveBlock1.gabbyAndTyData.mon2 = 0; - gSaveBlock1.gabbyAndTyData.move1 = 0; - gSaveBlock1.gabbyAndTyData.move2 = 0xffff; + gSaveBlock1.gabbyAndTyData.lastMove = 0; + gSaveBlock1.gabbyAndTyData.quote = 0xffff; gSaveBlock1.gabbyAndTyData.valA_0 = 0; gSaveBlock1.gabbyAndTyData.valA_1 = 0; gSaveBlock1.gabbyAndTyData.valA_2 = 0; @@ -400,7 +400,7 @@ void ResetGabbyAndTy(void) gSaveBlock1.gabbyAndTyData.valB_4 = 0; gSaveBlock1.gabbyAndTyData.valB_5 = 0; gSaveBlock1.gabbyAndTyData.mapnum = 0; - gSaveBlock1.gabbyAndTyData.val9 = 0; + gSaveBlock1.gabbyAndTyData.battleNum = 0; } void TakeTVShowInSearchOfTrainersOffTheAir(void); @@ -410,10 +410,10 @@ void GabbyAndTyBeforeInterview(void) u8 i; gSaveBlock1.gabbyAndTyData.mon1 = gUnknown_030042E0.var06; gSaveBlock1.gabbyAndTyData.mon2 = gUnknown_030042E0.var26; - gSaveBlock1.gabbyAndTyData.move1 = gUnknown_030042E0.var22; - if (gSaveBlock1.gabbyAndTyData.val9 != 0xff) + gSaveBlock1.gabbyAndTyData.lastMove = gUnknown_030042E0.var22; + if (gSaveBlock1.gabbyAndTyData.battleNum != 0xff) { - gSaveBlock1.gabbyAndTyData.val9 ++; + gSaveBlock1.gabbyAndTyData.battleNum ++; } gSaveBlock1.gabbyAndTyData.valA_0 = gUnknown_030042E0.var05_0; if (gUnknown_030042E0.var00) @@ -445,7 +445,7 @@ void GabbyAndTyBeforeInterview(void) gSaveBlock1.gabbyAndTyData.valA_3 = 1; } TakeTVShowInSearchOfTrainersOffTheAir(); - if (gSaveBlock1.gabbyAndTyData.move1 == 0) + if (gSaveBlock1.gabbyAndTyData.lastMove == 0) { FlagSet(1); } @@ -462,6 +462,36 @@ void sub_80BDC14(void) IncrementGameStat(GAME_STAT_GOT_INTERVIEWED); } +void TakeTVShowInSearchOfTrainersOffTheAir(void) +{ + gSaveBlock1.gabbyAndTyData.valA_4 = 0; +} + +u8 GabbyAndTyGetBattleNum(void) +{ + if (gSaveBlock1.gabbyAndTyData.battleNum >= 6) + { + return (gSaveBlock1.gabbyAndTyData.battleNum % 3) + 6; + } + return gSaveBlock1.gabbyAndTyData.battleNum; +} + +bool8 IsTVShowInSearchOfTrainersAiring(void) +{ + return gSaveBlock1.gabbyAndTyData.valA_4; +} + +bool8 GabbyAndTyGetLastQuote(void) +{ + if (gSaveBlock1.gabbyAndTyData.quote == 0xffff) + { + return FALSE; + } + sub_80EB3FC(gStringVar1, gSaveBlock1.gabbyAndTyData.quote); + gSaveBlock1.gabbyAndTyData.quote |= 0xffff; + return TRUE; +} + asm(".section .text_a"); s8 sub_80BF74C(TVShow tvShow[]); @@ -3242,7 +3272,7 @@ void DoTVShowInSearchOfTrainers(void) { switch (switchval) { case 0: sub_80FBFB4(gStringVar1, gSaveBlock1.gabbyAndTyData.mapnum, 0); - if (gSaveBlock1.gabbyAndTyData.val9 > 1) { + if (gSaveBlock1.gabbyAndTyData.battleNum > 1) { gUnknown_020387E8 = 1; } else { gUnknown_020387E8 = 2; @@ -3266,7 +3296,7 @@ void DoTVShowInSearchOfTrainers(void) { break; case 3: StringCopy(gStringVar1, gSpeciesNames[gSaveBlock1.gabbyAndTyData.mon1]); - StringCopy(gStringVar2, gMoveNames[gSaveBlock1.gabbyAndTyData.move1]); + StringCopy(gStringVar2, gMoveNames[gSaveBlock1.gabbyAndTyData.lastMove]); StringCopy(gStringVar3, gSpeciesNames[gSaveBlock1.gabbyAndTyData.mon2]); gUnknown_020387E8 = 8; break; @@ -3277,7 +3307,7 @@ void DoTVShowInSearchOfTrainers(void) { gUnknown_020387E8 = 8; break; case 8: - sub_80EB3FC(gStringVar1, gSaveBlock1.gabbyAndTyData.move2); + sub_80EB3FC(gStringVar1, gSaveBlock1.gabbyAndTyData.quote); StringCopy(gStringVar2, gSpeciesNames[gSaveBlock1.gabbyAndTyData.mon1]); StringCopy(gStringVar3, gSpeciesNames[gSaveBlock1.gabbyAndTyData.mon2]); gScriptResult = 1; -- cgit v1.2.3 From e98044024f37fadb12ff4a41eea34093e67b051b Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 30 May 2017 10:45:29 -0400 Subject: Close a gap in tv.s,tv.c --- src/tv.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/tv.c b/src/tv.c index d1ac9126a..80fd628e2 100755 --- a/src/tv.c +++ b/src/tv.c @@ -492,7 +492,27 @@ bool8 GabbyAndTyGetLastQuote(void) return TRUE; } -asm(".section .text_a"); +u8 sub_80BDD18(void) +{ + if (!gSaveBlock1.gabbyAndTyData.valB_0) + { + return 1; + } + if (gSaveBlock1.gabbyAndTyData.valB_3) + { + return 2; + } + if (gSaveBlock1.gabbyAndTyData.valB_2) + { + return 3; + } + if (gSaveBlock1.gabbyAndTyData.valB_1) + { + return 4; + } + return 0; +} + s8 sub_80BF74C(TVShow tvShow[]); void sub_80BF55C(TVShow tvShow[], u8 showidx); -- cgit v1.2.3 From 43567f631bd3ccf4539a277d5b2f01a6bc0b518e Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 30 May 2017 11:07:38 -0400 Subject: UnkBattleStruct is actually UnknownStruct11 --- src/battle_2.c | 25 ---------------------- src/tv.c | 65 +++++++++++++++++++++------------------------------------- 2 files changed, 23 insertions(+), 67 deletions(-) (limited to 'src') diff --git a/src/battle_2.c b/src/battle_2.c index e5091bd08..119085e14 100644 --- a/src/battle_2.c +++ b/src/battle_2.c @@ -72,31 +72,6 @@ struct UnknownStruct10 u8 filler4[8]; }; -struct UnknownStruct11 -{ - u8 unk0; - u8 unk1; - u8 unk2; - u8 unk3; - u8 unk4; - u8 unk5_0:1; - u8 unk5_1:1; - u16 unk6; - u8 unk8[10]; - u8 unk12; - u8 unk13; - u8 unk14[10]; - u8 filler1E[2]; - u16 unk20; - u16 unk22; - u16 unk24; - u16 unk26; - u16 unk28; - u8 unk2A[10]; - u8 filler34[2]; - u8 unk36[10]; -}; - struct UnknownStruct12 { u32 unk0; diff --git a/src/tv.c b/src/tv.c index 80fd628e2..012e8dde1 100755 --- a/src/tv.c +++ b/src/tv.c @@ -16,6 +16,7 @@ #include "rom4.h" #include "map_constants.h" #include "strings.h" +#include "battle.h" #include "link.h" #include "easy_chat.h" #include "item.h" @@ -28,27 +29,7 @@ struct UnkTvStruct s8 var0; }; -struct UnkBattleStruct { - u8 var00; - u8 var01; - u8 var02; - u8 var03; - u8 var04; - u8 var05_0:1; - u8 var05_1:1; - u8 var05_pad2:6; - u16 var06; - u8 pad08[24]; - u16 var20; - u16 var22; - u16 var24; - u16 var26; - u16 var28; - u8 var2a[11]; - u8 var35; - u8 var36[11]; -}; -extern struct UnkBattleStruct gUnknown_030042E0; +extern struct UnknownStruct11 gUnknown_030042E0; extern u8 gUnknown_0300430A[11]; struct OutbreakPokemon @@ -408,33 +389,33 @@ void TakeTVShowInSearchOfTrainersOffTheAir(void); void GabbyAndTyBeforeInterview(void) { u8 i; - gSaveBlock1.gabbyAndTyData.mon1 = gUnknown_030042E0.var06; - gSaveBlock1.gabbyAndTyData.mon2 = gUnknown_030042E0.var26; - gSaveBlock1.gabbyAndTyData.lastMove = gUnknown_030042E0.var22; + gSaveBlock1.gabbyAndTyData.mon1 = gUnknown_030042E0.unk6; + gSaveBlock1.gabbyAndTyData.mon2 = gUnknown_030042E0.unk26; + gSaveBlock1.gabbyAndTyData.lastMove = gUnknown_030042E0.unk22; if (gSaveBlock1.gabbyAndTyData.battleNum != 0xff) { gSaveBlock1.gabbyAndTyData.battleNum ++; } - gSaveBlock1.gabbyAndTyData.valA_0 = gUnknown_030042E0.var05_0; - if (gUnknown_030042E0.var00) + gSaveBlock1.gabbyAndTyData.valA_0 = gUnknown_030042E0.unk5_0; + if (gUnknown_030042E0.unk0) { gSaveBlock1.gabbyAndTyData.valA_1 = 1; } else { gSaveBlock1.gabbyAndTyData.valA_1 = 0; } - if (gUnknown_030042E0.var03) + if (gUnknown_030042E0.unk3) { gSaveBlock1.gabbyAndTyData.valA_2 = 1; } else { gSaveBlock1.gabbyAndTyData.valA_2 = 0; } - if (!gUnknown_030042E0.var05_1) + if (!gUnknown_030042E0.unk5_1) { - for (i=0; i < 11; i++) + for (i=0; i<11; i++) { - if (gUnknown_030042E0.var36[i] != 0) + if (gUnknown_030042E0.unk36[i] != 0) { gSaveBlock1.gabbyAndTyData.valA_3 = 1; break; @@ -608,27 +589,27 @@ void sub_80BDEC8(void) { total = 0; sub_80BEB20(); sub_80BE778(); - if (gUnknown_030042E0.var28 == 0) { + if (gUnknown_030042E0.unk28 == 0) { sub_80BE074(); } else { sub_80BE028(); - if (sub_80BF77C(0xffff) == 0 && StringCompareWithoutExtCtrlCodes(gSpeciesNames[gUnknown_030042E0.var28], gUnknown_030042E0.var2a) != 0) { + if (sub_80BF77C(0xffff) == 0 && StringCompareWithoutExtCtrlCodes(gSpeciesNames[gUnknown_030042E0.unk28], gUnknown_030042E0.unk2A) != 0) { gUnknown_03005D38.var0 = sub_80BF74C(gSaveBlock1.tvShows); if (gUnknown_03005D38.var0 != -1 && sub_80BF1B4(TVSHOW_POKEMON_TODAY_CAUGHT) != 1) { for (i=0; i<11; i++) { - total += gUnknown_030042E0.var36[i]; + total += gUnknown_030042E0.unk36[i]; } - if (total != 0 || gUnknown_030042E0.var05_1 != 0) { + if (total != 0 || gUnknown_030042E0.unk5_1 != 0) { total = FALSE; show = &gSaveBlock1.tvShows[gUnknown_03005D38.var0]; show->pokemonToday.var00 = TVSHOW_POKEMON_TODAY_CAUGHT; show->pokemonToday.var01 = total; - if (gUnknown_030042E0.var05_1 != 0) { + if (gUnknown_030042E0.unk5_1 != 0) { total = 1; item = ITEM_MASTER_BALL; } else { for (i=0; i<11; i++) { - total += gUnknown_030042E0.var36[i]; + total += gUnknown_030042E0.unk36[i]; } if (total > 0xff) { total = 0xff; @@ -638,8 +619,8 @@ void sub_80BDEC8(void) { show->pokemonToday.var12 = total; show->pokemonToday.ball = item; StringCopy(show->pokemonToday.playerName, gSaveBlock2.playerName); - StringCopy(show->pokemonToday.nickname, gUnknown_030042E0.var2a); - show->pokemonToday.species = gUnknown_030042E0.var28; + StringCopy(show->pokemonToday.nickname, gUnknown_030042E0.unk2A); + show->pokemonToday.species = gUnknown_030042E0.unk28; sub_80BE138(show); show->pokemonToday.language = GAME_LANGUAGE; show->pokemonToday.language2 = sub_80BDEAC(show->pokemonToday.nickname); @@ -659,8 +640,8 @@ void sub_80BE028(void) { buffer->worldOfMasters.var00 = TVSHOW_WORLD_OF_MASTERS; } buffer->worldOfMasters.var02++; - buffer->worldOfMasters.var04 = gUnknown_030042E0.var28; - buffer->worldOfMasters.var08 = gUnknown_030042E0.var06; + buffer->worldOfMasters.var04 = gUnknown_030042E0.unk28; + buffer->worldOfMasters.var08 = gUnknown_030042E0.unk6; buffer->worldOfMasters.var0a = gMapHeader.name; } @@ -685,8 +666,8 @@ void sub_80BE074(void) { asm_comment("Here the wrong registers are used to hold the show ID and flag."); show->pokemonTodayFailed.var00 = TVSHOW_POKEMON_TODAY_FAILED; show->pokemonTodayFailed.var01 = flag; - show->pokemonTodayFailed.species = gUnknown_030042E0.var06; - show->pokemonTodayFailed.species2 = gUnknown_030042E0.var20; + show->pokemonTodayFailed.species = gUnknown_030042E0.unk6; + show->pokemonTodayFailed.species2 = gUnknown_030042E0.unk20; show->pokemonTodayFailed.var10 = total; show->pokemonTodayFailed.var11 = gUnknown_02024D26; show->pokemonTodayFailed.var12 = gMapHeader.name; -- cgit v1.2.3 From 07d55ccf72316bf23792797da807514fc254d647 Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 30 May 2017 12:47:53 -0400 Subject: Fill another gap in tv.c --- src/tv.c | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 107 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/tv.c b/src/tv.c index 012e8dde1..f06f93acf 100755 --- a/src/tv.c +++ b/src/tv.c @@ -124,6 +124,22 @@ void sub_80BEB20(void); u8 sub_80BFB54(u8); +s8 sub_80BF74C(TVShow tvShow[]); + +void sub_80BF55C(TVShow tvShow[], u8 showidx); +void sub_80BEA88(void); + +void sub_80BE138(TVShow *show); +void sub_80BE160(TVShow *show); +extern u16 gUnknown_02024C04; + +void sub_80BE5FC(void); +void sub_80BE65C(void); +void sub_80BE6A0(void); +void nullsub_21(void); +void sub_80BE188(void); +void sub_80BE320(void); + #ifdef NONMATCHING u8 special_0x44(void) { @@ -494,24 +510,6 @@ u8 sub_80BDD18(void) return 0; } -s8 sub_80BF74C(TVShow tvShow[]); - -void sub_80BF55C(TVShow tvShow[], u8 showidx); -void sub_80BEA88(void); - -void sub_80BE138(TVShow *show); -void sub_80BE160(TVShow *show); -extern u16 gUnknown_02024C04; - -void sub_80BE5FC(void); -void sub_80BE65C(void); -void sub_80BE6A0(void); -void nullsub_21(void); -void sub_80BE188(void); -void sub_80BE320(void); - -extern u8 GabbyAndTyGetBattleNum(void); - void GabbyAndTySetScriptVarsToFieldObjectLocalIds(void) { switch (GabbyAndTyGetBattleNum()) { case 1: @@ -1198,7 +1196,6 @@ void sub_80BEA50(u16 var) gUnknown_020387E0 = var; } -void sub_80BF55C(TVShow tvShow[], u8 showidx); void sub_80BEA88(void); void sub_80BEA5C(u16 arg0) @@ -2162,12 +2159,13 @@ void sub_80BFD20(void) } extern u8 ewram[]; -#define gUnknown_02007000 (*(struct ewramStruct_0207000 *)(ewram + 0x7000)) +#define gUnknown_02007000 (*(ewramStruct_02007000 *)(ewram + 0x7000)) extern u8 gUnknown_020387E4; -struct ewramStruct_0207000 { +typedef union ewramStruct_02007000 { TVShow tvshows[4][25]; -}; + struct UnknownSaveStruct2ABC unknown_2abc[4][16]; +} ewramStruct_02007000; void sub_80BFE24(TVShow arg0[25], TVShow arg1[25], TVShow arg2[25], TVShow arg3[25]); @@ -2178,7 +2176,7 @@ void sub_80C0408(void); void sub_80BFD44(u8 *arg0, u32 arg1, u8 arg2) { u8 i; - struct ewramStruct_0207000 *ewramTVShows; + ewramStruct_02007000 *ewramTVShows; for (i=0; i<4; i++) { memcpy(&gUnknown_02007000.tvshows[i], &arg0[i * arg1], 25 * sizeof(TVShow)); } @@ -2205,6 +2203,7 @@ void sub_80BFD44(u8 *arg0, u32 arg1, u8 arg2) } extern u8 gUnknown_03000720; +extern u8 gUnknown_03000721; extern s8 gUnknown_03000722; s8 sub_80C019C(TVShow tvShows[]); bool8 sub_80BFF68(TVShow * tv1[25], TVShow * tv2[25], u8 idx); @@ -2793,7 +2792,88 @@ void sub_80C045C(void) { } } -asm(".section .dotvshow\n"); +void sub_80C04A0(void) +{ + s8 showIdx; + s8 count; + count = 0; + for (showIdx=5; showIdx<24; showIdx++) + { + if (gSaveBlock1.tvShows[showIdx].common.var00 == 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_80C0750(void); +void sub_80C0788(void); +s8 sub_80C0730(struct UnknownSaveStruct2ABC[16], u8); +void sub_80C06BC(struct UnknownSaveStruct2ABC *[16], struct UnknownSaveStruct2ABC *[16]); + +void sub_80C0514(void *a0, u32 a1, u8 a2) +{ + ewramStruct_02007000 *struct02007000; + u8 i; + for (i=0; i<4; i++) + { + memcpy(gUnknown_02007000.unknown_2abc[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]); + break; + case 1: + sub_80C05C4(struct02007000->unknown_2abc[0], gSaveBlock1.unknown_2ABC, struct02007000->unknown_2abc[2], struct02007000->unknown_2abc[3]); + break; + case 2: + sub_80C05C4(struct02007000->unknown_2abc[0], struct02007000->unknown_2abc[1], gSaveBlock1.unknown_2ABC, struct02007000->unknown_2abc[3]); + break; + case 3: + sub_80C05C4(struct02007000->unknown_2abc[0], struct02007000->unknown_2abc[1], struct02007000->unknown_2abc[2], gSaveBlock1.unknown_2ABC); + break; + } + sub_80C0750(); + sub_80C0788(); +} + +void sub_80C05C4(struct UnknownSaveStruct2ABC a0[16], struct UnknownSaveStruct2ABC a1[16], struct UnknownSaveStruct2ABC a2[16], struct UnknownSaveStruct2ABC a3[16]) +{ + u8 i; + u8 j; + u8 k; + struct UnknownSaveStruct2ABC ** arglist[4]; + arglist[0] = &a0; + arglist[1] = &a1; + arglist[2] = &a2; + arglist[3] = &a3; + gUnknown_03000721 = GetLinkPlayerCount(); + for (i=0; i<16; i++) + { + for (j=0; j Date: Tue, 30 May 2017 13:34:24 -0400 Subject: DoTVShowBravoTrainerPokemonProfile --- src/tv.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/tv.c b/src/tv.c index f06f93acf..6b43a16d0 100755 --- a/src/tv.c +++ b/src/tv.c @@ -808,7 +808,7 @@ void sub_80BE188(void) { show->bravoTrainer.contestCategory = buffer->bravoTrainer.contestCategory; show->bravoTrainer.contestRank = buffer->bravoTrainer.contestRank; show->bravoTrainer.var14 = buffer->bravoTrainer.var14; - show->bravoTrainer.var13_5 = buffer->bravoTrainer.var13_5; + show->bravoTrainer.contestResult = buffer->bravoTrainer.contestResult; show->bravoTrainer.contestCategory = buffer->bravoTrainer.contestCategory; sub_80BE160(show); show->bravoTrainer.language = GAME_LANGUAGE; @@ -834,7 +834,7 @@ void sub_80BE284(u8 a0) { show = &gSaveBlock1.tvShows[24]; gUnknown_03005D38.var0 = sub_80BF720(gSaveBlock1.tvShows); if (gUnknown_03005D38.var0 != -1) { - show->bravoTrainer.var13_5 = a0; + show->bravoTrainer.contestResult = a0; show->bravoTrainer.contestCategory = gScriptContestCategory; show->bravoTrainer.contestRank = gScriptContestRank; show->bravoTrainer.species = GetMonData(&gPlayerParty[gUnknown_02038694], MON_DATA_SPECIES, NULL); @@ -2995,6 +2995,87 @@ void TVShowConvertInternationalString(u8 *dest, u8 *src, u8 language) { } } +void DoTVShowBravoTrainerPokemonProfile(void) +{ + TVShow *tvShow; + u8 switchval; + + tvShow = &gSaveBlock1.tvShows[gSpecialVar_0x8004]; + gScriptResult = 0; + switchval = gUnknown_020387E8; + switch(switchval) + { + case 0: + TVShowConvertInternationalString(gStringVar1, tvShow->bravoTrainer.playerName, tvShow->bravoTrainer.language); + CopyContestCategoryToStringVar(1, tvShow->bravoTrainer.contestCategory); + sub_80BEF10(2, tvShow->bravoTrainer.contestRank); + if (!StringCompareWithoutExtCtrlCodes(gSpeciesNames[tvShow->bravoTrainer.species], tvShow->bravoTrainer.pokemonNickname)) + { + gUnknown_020387E8 = 8; + } else + { + gUnknown_020387E8 = 1; + } + break; + case 1: + StringCopy(gStringVar1, gSpeciesNames[tvShow->bravoTrainer.species]); + TVShowConvertInternationalString(gStringVar2, tvShow->bravoTrainer.pokemonNickname, tvShow->bravoTrainer.var1f); + CopyContestCategoryToStringVar(2, tvShow->bravoTrainer.contestCategory); + gUnknown_020387E8 = 2; + break; + case 2: + TVShowConvertInternationalString(gStringVar1, tvShow->bravoTrainer.playerName, tvShow->bravoTrainer.language); + if (tvShow->bravoTrainer.contestResult == 0) // placed first + { + gUnknown_020387E8 = 3; + } else + { + gUnknown_020387E8 = 4; + } + break; + case 3: + TVShowConvertInternationalString(gStringVar1, tvShow->bravoTrainer.playerName, tvShow->bravoTrainer.language); + sub_80EB3FC(gStringVar2, tvShow->bravoTrainer.var04[0]); + sub_80BF088(2, tvShow->bravoTrainer.contestResult + 1); + gUnknown_020387E8 = 5; + break; + case 4: + TVShowConvertInternationalString(gStringVar1, tvShow->bravoTrainer.playerName, tvShow->bravoTrainer.language); + sub_80EB3FC(gStringVar2, tvShow->bravoTrainer.var04[0]); + sub_80BF088(2, tvShow->bravoTrainer.contestResult + 1); + gUnknown_020387E8 = 5; + break; + case 5: + TVShowConvertInternationalString(gStringVar1, tvShow->bravoTrainer.playerName, tvShow->bravoTrainer.language); + CopyContestCategoryToStringVar(1, tvShow->bravoTrainer.contestCategory); + sub_80EB3FC(gStringVar3, tvShow->bravoTrainer.var04[1]); + if (tvShow->bravoTrainer.var14) + { + gUnknown_020387E8 = 6; + } else + { + gUnknown_020387E8 = 7; + } + break; + case 6: + StringCopy(gStringVar1, gSpeciesNames[tvShow->bravoTrainer.species]); + StringCopy(gStringVar2, gMoveNames[tvShow->bravoTrainer.var14]); + sub_80EB3FC(gStringVar3, tvShow->bravoTrainer.var04[1]); + gUnknown_020387E8 = 7; + break; + case 7: + TVShowConvertInternationalString(gStringVar1, tvShow->bravoTrainer.playerName, tvShow->bravoTrainer.language); + StringCopy(gStringVar2, gSpeciesNames[tvShow->bravoTrainer.species]); + TVShowDone(); + break; + case 8: + StringCopy(gStringVar1, gSpeciesNames[tvShow->bravoTrainer.species]); + gUnknown_020387E8 = 2; + break; + } + ShowFieldMessage(gTVBravoTrainerTextGroup[switchval]); +} + asm(".section .text_c"); void TVShowConvertInternationalString(u8 *, u8 *, u8); -- cgit v1.2.3 From d461483611ae66ad2cd9fd9e4d2c5f95d38f5387 Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 30 May 2017 14:01:23 -0400 Subject: DoTVShowBravoTrainerBattleTowerProfile --- src/tv.c | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) (limited to 'src') diff --git a/src/tv.c b/src/tv.c index 6b43a16d0..7b177df1d 100755 --- a/src/tv.c +++ b/src/tv.c @@ -3076,6 +3076,114 @@ void DoTVShowBravoTrainerPokemonProfile(void) ShowFieldMessage(gTVBravoTrainerTextGroup[switchval]); } +void DoTVShowBravoTrainerBattleTowerProfile(void) +{ + TVShow *tvShow; + u8 switchval; + + tvShow = &gSaveBlock1.tvShows[gSpecialVar_0x8004]; + gScriptResult = 0; + switchval = gUnknown_020387E8; + switch(switchval) + { + case 0: + TVShowConvertInternationalString(gStringVar1, tvShow->bravoTrainerTower.trainerName, tvShow->bravoTrainerTower.language); + StringCopy(gStringVar2, gSpeciesNames[tvShow->bravoTrainerTower.species]); + if (tvShow->bravoTrainerTower.var16 >= 7) + { + gUnknown_020387E8 = 1; + } else + { + gUnknown_020387E8 = 2; + } + break; + case 1: + sub_80BF088(0, tvShow->bravoTrainerTower.btLevel); + sub_80BF088(1, tvShow->bravoTrainerTower.var16); + if (tvShow->bravoTrainerTower.var1c == 1) + { + gUnknown_020387E8 = 3; + } else + { + gUnknown_020387E8 = 4; + } + break; + case 2: + TVShowConvertInternationalString(gStringVar1, tvShow->bravoTrainerTower.pokemonName, tvShow->bravoTrainerTower.language); + sub_80BF088(1, tvShow->bravoTrainerTower.var16 + 1); + if (tvShow->bravoTrainerTower.var1b == 0) + { + gUnknown_020387E8 = 5; + } else + { + gUnknown_020387E8 = 6; + } + break; + case 3: + TVShowConvertInternationalString(gStringVar1, tvShow->bravoTrainerTower.pokemonName, tvShow->bravoTrainerTower.language); + StringCopy(gStringVar2, gSpeciesNames[tvShow->bravoTrainerTower.winningMove]); + if (tvShow->bravoTrainerTower.var1b == 0) + { + gUnknown_020387E8 = 5; + } else + { + gUnknown_020387E8 = 6; + } + break; + case 4: + TVShowConvertInternationalString(gStringVar1, tvShow->bravoTrainerTower.pokemonName, tvShow->bravoTrainerTower.language); + StringCopy(gStringVar2, gSpeciesNames[tvShow->bravoTrainerTower.winningMove]); + if (tvShow->bravoTrainerTower.var1b == 0) + { + gUnknown_020387E8 = 5; + } else + { + gUnknown_020387E8 = 6; + } + break; + case 5: + TVShowConvertInternationalString(gStringVar1, tvShow->bravoTrainerTower.pokemonName, tvShow->bravoTrainerTower.language); + gUnknown_020387E8 = 11; + break; + case 6: + TVShowConvertInternationalString(gStringVar1, tvShow->bravoTrainerTower.pokemonName, tvShow->bravoTrainerTower.language); + gUnknown_020387E8 = 11; + break; + case 7: + gUnknown_020387E8 = 11; + break; + case 8: + case 9: + case 10: + TVShowConvertInternationalString(gStringVar1, tvShow->bravoTrainerTower.trainerName, tvShow->bravoTrainerTower.language); + gUnknown_020387E8 = 11; + break; + case 11: + sub_80EB3FC(gStringVar1, tvShow->bravoTrainerTower.var18[0]); + if (tvShow->bravoTrainerTower.var1b == 0) + { + gUnknown_020387E8 = 12; + } else + { + gUnknown_020387E8 = 13; + } + break; + case 12: + case 13: + sub_80EB3FC(gStringVar1, tvShow->bravoTrainerTower.var18[0]); + TVShowConvertInternationalString(gStringVar2, tvShow->bravoTrainerTower.trainerName, tvShow->bravoTrainerTower.language); + TVShowConvertInternationalString(gStringVar3, tvShow->bravoTrainerTower.pokemonName, tvShow->bravoTrainerTower.language); + gUnknown_020387E8 = 14; + break; + case 14: + TVShowConvertInternationalString(gStringVar1, tvShow->bravoTrainerTower.trainerName, tvShow->bravoTrainerTower.language); + StringCopy(gStringVar2, gSpeciesNames[tvShow->bravoTrainerTower.species]); + TVShowDone(); + break; + } + ShowFieldMessage(gTVBravoTrainerBattleTowerTextGroup[switchval]); +} + asm(".section .text_c"); void TVShowConvertInternationalString(u8 *, u8 *, u8); -- cgit v1.2.3 From 4b03459d3ff6391fe604fe02445a51605a9dc18a Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 30 May 2017 14:29:38 -0400 Subject: Finish decompiling tv.s --- src/tv.c | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 113 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/tv.c b/src/tv.c index 7b177df1d..8352efb17 100755 --- a/src/tv.c +++ b/src/tv.c @@ -3184,7 +3184,119 @@ void DoTVShowBravoTrainerBattleTowerProfile(void) ShowFieldMessage(gTVBravoTrainerBattleTowerTextGroup[switchval]); } -asm(".section .text_c"); +void DoTVShowTodaysSmartShopper(void) +{ + TVShow *tvShow; + u8 switchval; + + tvShow = &gSaveBlock1.tvShows[gSpecialVar_0x8004]; + gScriptResult = 0; + switchval = gUnknown_020387E8; + switch(switchval) + { + case 0: + TVShowConvertInternationalString(gStringVar1, tvShow->smartshopperShow.playerName, tvShow->smartshopperShow.language); + sub_80FBFB4(gStringVar2, tvShow->smartshopperShow.shopLocation, 0); + if (tvShow->smartshopperShow.itemAmounts[0] >= 0xff) + { + gUnknown_020387E8 = 11; + } else + { + gUnknown_020387E8 = 1; + } + break; + case 1: + TVShowConvertInternationalString(gStringVar1, tvShow->smartshopperShow.playerName, tvShow->smartshopperShow.language); + StringCopy(gStringVar2, ItemId_GetItem(tvShow->smartshopperShow.itemIds[0])->name); + sub_80BF088(2, tvShow->smartshopperShow.itemAmounts[0]); + gUnknown_020387E8 += (Random() % 4) + 1; + break; + case 2: + case 4: + case 5: + if (tvShow->smartshopperShow.itemIds[1] != 0) + { + gUnknown_020387E8 = 6; + } else + { + gUnknown_020387E8 = 10; + } + break; + case 3: + sub_80BF088(2, tvShow->smartshopperShow.itemAmounts[0] + 1); + if (tvShow->smartshopperShow.itemIds[1] != 0) + { + gUnknown_020387E8 = 6; + } else + { + gUnknown_020387E8 = 10; + } + break; + case 6: + StringCopy(gStringVar2, ItemId_GetItem(tvShow->smartshopperShow.itemIds[1])->name); + sub_80BF088(2, tvShow->smartshopperShow.itemAmounts[1]); + if (tvShow->smartshopperShow.itemIds[2] != 0) + { + gUnknown_020387E8 = 7; + } else if (tvShow->smartshopperShow.priceReduced == 1) + { + gUnknown_020387E8 = 8; + } else + { + gUnknown_020387E8 = 9; + } + break; + case 7: + StringCopy(gStringVar2, ItemId_GetItem(tvShow->smartshopperShow.itemIds[2])->name); + sub_80BF088(2, tvShow->smartshopperShow.itemAmounts[2]); + if (tvShow->smartshopperShow.priceReduced == 1) + { + gUnknown_020387E8 = 8; + } else + { + gUnknown_020387E8 = 9; + } + break; + case 8: + if (tvShow->smartshopperShow.itemAmounts[0] < 0xff) + { + gUnknown_020387E8 = 9; + } else + { + gUnknown_020387E8 = 12; + } + break; + case 9: + sub_80BF154(1, &tvShow->smartshopperShow); + TVShowDone(); + break; + case 10: + if (tvShow->smartshopperShow.priceReduced == 1) + { + gUnknown_020387E8 = 8; + } else + { + gUnknown_020387E8 = 9; + } + break; + case 11: + TVShowConvertInternationalString(gStringVar1, tvShow->smartshopperShow.playerName, tvShow->smartshopperShow.language); + StringCopy(gStringVar2, ItemId_GetItem(tvShow->smartshopperShow.itemIds[0])->name); + if (tvShow->smartshopperShow.priceReduced == 1) + { + gUnknown_020387E8 = 8; + } else + { + gUnknown_020387E8 = 12; + } + break; + case 12: + TVShowConvertInternationalString(gStringVar1, tvShow->smartshopperShow.playerName, tvShow->smartshopperShow.language); + TVShowDone(); + break; + } + ShowFieldMessage(gTVSmartShopperTextGroup[switchval]); +} void TVShowConvertInternationalString(u8 *, u8 *, u8); -- cgit v1.2.3 From 859a04c318904a3894896c0c66f47def453df858 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 31 May 2017 08:40:15 -0400 Subject: Get sub_80C01D4 closer to matching --- src/tv.c | 104 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 52 insertions(+), 52 deletions(-) (limited to 'src') diff --git a/src/tv.c b/src/tv.c index 8352efb17..566d547a6 100755 --- a/src/tv.c +++ b/src/tv.c @@ -850,7 +850,7 @@ void sub_80BE320(void) { StringCopy(show->bravoTrainerTower.trainerName, gSaveBlock2.playerName); StringCopy(show->bravoTrainerTower.pokemonName, gSaveBlock2.filler_A8.filler_3DC); show->bravoTrainerTower.species = gSaveBlock2.filler_A8.var_480; - show->bravoTrainerTower.winningMove = gSaveBlock2.filler_A8.var_482; + show->bravoTrainerTower.defeatedSpecies = gSaveBlock2.filler_A8.var_482; show->bravoTrainerTower.var16 = sub_8135D3C(gSaveBlock2.filler_A8.var_4D0); show->bravoTrainerTower.var1c = gSaveBlock2.filler_A8.var_4AD; if (gSaveBlock2.filler_A8.var_4D0 == 0) { @@ -2454,54 +2454,54 @@ void sub_80C03A8(u8 showidx); void sub_80C03C8(u16 species, u8 showidx); #ifdef NONMATCHING -void sub_80C01D4(void) { - u8 i; - for (i=0; i<24; i++) { - switch (gSavegitBlock1.tvShows[i].common.var00) { - case 0: - break; - case TVSHOW_FAN_CLUB_LETTER: - sub_80C03C8(gSaveBlock1.tvShows[i].fanclubLetter.species, i); - break; - case TVSHOW_RECENT_HAPPENINGS: - break; - case TVSHOW_PKMN_FAN_CLUB_OPINIONS: - sub_80C03C8(gSaveBlock1.tvShows[i].fanclubOpinions.var02, i); - break; - case TVSHOW_UNKN_SHOWTYPE_04: - sub_80C03C8(gSaveBlock1.tvShows[i].worldOfMasters.var06, i); - break; - case TVSHOW_NAME_RATER_SHOW: - sub_80C03C8(gSaveBlock1.tvShows[i].nameRaterShow.species, i); - sub_80C03C8(gSaveBlock1.tvShows[i].nameRaterShow.var1C, i); - break; - case TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE: - sub_80C03C8(gSaveBlock1.tvShows[i].bravoTrainer.species, i); - break; - case TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE: - sub_80C03C8(gSaveBlock1.tvShows[i].bravoTrainerTower.var0a, i); - sub_80C03C8(gSaveBlock1.tvShows[i].bravoTrainerTower.var14, i); - break; - case TVSHOW_POKEMON_TODAY_CAUGHT: - sub_80C03C8(gSaveBlock1.tvShows[i].pokemonToday.species, i); - break; - case TVSHOW_SMART_SHOPPER: - break; - case TVSHOW_POKEMON_TODAY_FAILED: - sub_80C03C8(gSaveBlock1.tvShows[i].pokemonTodayFailed.species, i); - sub_80C03C8(gSaveBlock1.tvShows[i].pokemonTodayFailed.species2, i); - break; - case TVSHOW_FISHING_ADVICE: - sub_80C03C8(gSaveBlock1.tvShows[i].pokemonAngler.var04, i); - break; - case TVSHOW_WORLD_OF_MASTERS: - sub_80C03C8(gSaveBlock1.tvShows[i].worldOfMasters.var08, i); - sub_80C03C8(gSaveBlock1.tvShows[i].worldOfMasters.var04, i); - break; - case TVSHOW_MASS_OUTBREAK: - break; - default: - sub_80C03A8(i); +void sub_80C01D4(void) +{ + u16 i; + for (i=0; i<24; i++) + { + switch (gSaveBlock1.tvShows[i].common.var00) + { + case 0: + case TVSHOW_RECENT_HAPPENINGS: + case TVSHOW_SMART_SHOPPER: + case TVSHOW_MASS_OUTBREAK: + break; + case TVSHOW_FAN_CLUB_LETTER: + sub_80C03C8((&gSaveBlock1.tvShows[i])->fanclubLetter.species, i); + break; + case TVSHOW_PKMN_FAN_CLUB_OPINIONS: + sub_80C03C8((&gSaveBlock1.tvShows[i])->fanclubOpinions.var02, i); + break; + case TVSHOW_UNKN_SHOWTYPE_04: + sub_80C03C8((&gSaveBlock1.tvShows[i])->unkShow04.var06, i); + break; + case TVSHOW_NAME_RATER_SHOW: + sub_80C03C8((&gSaveBlock1.tvShows[i])->nameRaterShow.species, i); + sub_80C03C8((&gSaveBlock1.tvShows[i])->nameRaterShow.var1C, i); + break; + case TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE: + sub_80C03C8((&gSaveBlock1.tvShows[i])->bravoTrainer.species, i); + break; + case TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE: + sub_80C03C8((&gSaveBlock1.tvShows[i])->bravoTrainerTower.species, i); + sub_80C03C8((&gSaveBlock1.tvShows[i])->bravoTrainerTower.defeatedSpecies, i); + break; + case TVSHOW_POKEMON_TODAY_CAUGHT: + sub_80C03C8((&gSaveBlock1.tvShows[i])->pokemonToday.species, i); + break; + case TVSHOW_POKEMON_TODAY_FAILED: + sub_80C03C8((&gSaveBlock1.tvShows[i])->pokemonTodayFailed.species, i); + sub_80C03C8((&gSaveBlock1.tvShows[i])->pokemonTodayFailed.species2, i); + break; + case TVSHOW_FISHING_ADVICE: + sub_80C03C8((&gSaveBlock1.tvShows[i])->pokemonAngler.var04, i); + break; + case TVSHOW_WORLD_OF_MASTERS: + sub_80C03C8((&gSaveBlock1.tvShows[i])->worldOfMasters.var08, i); + sub_80C03C8((&gSaveBlock1.tvShows[i])->worldOfMasters.var04, i); + break; + default: + sub_80C03A8(i); } } } @@ -2718,7 +2718,7 @@ void sub_80C03A8(u8 showidx) { } void sub_80C03C8(u16 species, u8 showidx) { - if (sub_8090D90(SpeciesToNationalPokedexNum(species), 0) == 0) { + if (!sub_8090D90(SpeciesToNationalPokedexNum(species), 0)) { gSaveBlock1.tvShows[showidx].common.var01 = 0; } } @@ -3121,7 +3121,7 @@ void DoTVShowBravoTrainerBattleTowerProfile(void) break; case 3: TVShowConvertInternationalString(gStringVar1, tvShow->bravoTrainerTower.pokemonName, tvShow->bravoTrainerTower.language); - StringCopy(gStringVar2, gSpeciesNames[tvShow->bravoTrainerTower.winningMove]); + StringCopy(gStringVar2, gSpeciesNames[tvShow->bravoTrainerTower.defeatedSpecies]); if (tvShow->bravoTrainerTower.var1b == 0) { gUnknown_020387E8 = 5; @@ -3132,7 +3132,7 @@ void DoTVShowBravoTrainerBattleTowerProfile(void) break; case 4: TVShowConvertInternationalString(gStringVar1, tvShow->bravoTrainerTower.pokemonName, tvShow->bravoTrainerTower.language); - StringCopy(gStringVar2, gSpeciesNames[tvShow->bravoTrainerTower.winningMove]); + StringCopy(gStringVar2, gSpeciesNames[tvShow->bravoTrainerTower.defeatedSpecies]); if (tvShow->bravoTrainerTower.var1b == 0) { gUnknown_020387E8 = 5; -- cgit v1.2.3 From 717c14afc42305dcf0a4846191b1c913aae3a3d0 Mon Sep 17 00:00:00 2001 From: scnorton Date: Wed, 31 May 2017 16:35:53 -0400 Subject: Decompile the lead section of decoration.s --- src/decoration.c | 267 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 257 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 279a7568b..0898e7a4b 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -1,23 +1,264 @@ #include "global.h" #include "asm.h" +#include "sound.h" +#include "songs.h" +#include "string_util.h" #include "menu.h" +#include "strings.h" +#include "script.h" +#include "palette.h" +#include "decoration.h" -extern u8 gUnknown_020388F2; -extern u8 gUnknown_020388F3; -extern u8 gUnknown_020388F4; -extern u8 gUnknown_020388F6; -extern u8 gUnknown_020388D5; +void sub_80FE1DC(void) +{ + sub_80FE2B4(); + MenuDrawTextWindow(0, 0, 10, 9); + PrintMenuItems(1, 1, 4, (const struct MenuAction *)gUnknown_083EC604); + InitMenu(0, 1, 1, 4, gUnknown_020388D4, 9); +} + +void sub_80FE220(void) +{ + gUnknown_020388D4 = 0; + ScriptContext2_Enable(); + sub_80FE1DC(); + sub_80FE394(); +} + +void DecorationPC(u8 taskId) +{ + sub_80FE220(); + gTasks[taskId].func = Task_DecorationPCProcessMenuInput; +} + +void Task_SecretBasePC_Decoration(u8 taskId) +{ + DecorationPC(taskId); + ewram_1f000.items = gSaveBlock1.secretBases[0].decorations; + ewram_1f000.pos = gSaveBlock1.secretBases[0].decorationPos; + ewram_1f000.size = sizeof gSaveBlock1.secretBases[0].decorations; + ewram_1f000.isPlayerRoom = 0; +} + +void DoPlayerPCDecoration(u8 taskId) +{ + DecorationPC(taskId); + ewram_1f000.items = gSaveBlock1.playerRoomDecor; + ewram_1f000.pos = gSaveBlock1.playerRoomDecorPos; + ewram_1f000.size = sizeof gSaveBlock1.playerRoomDecor; + ewram_1f000.isPlayerRoom = 1; +} + +void sub_80FE2B4(void) +{ + u16 palettes[3]; + memcpy(palettes, gUnknown_083EC654, sizeof gUnknown_083EC654); + LoadPalette(&palettes[2], 0xdf, 2); + LoadPalette(&palettes[1], 0xd1, 2); + LoadPalette(&palettes[0], 0xd8, 2); +} + +void Task_DecorationPCProcessMenuInput(u8 taskId) +{ + if (!gPaletteFade.active) + { + if (gMain.newKeys & DPAD_UP) + { + PlaySE(SE_SELECT); + gUnknown_020388D4 = MoveMenuCursor(-1); + sub_80FE394(); + } + if (gMain.newKeys & DPAD_DOWN) + { + PlaySE(SE_SELECT); + gUnknown_020388D4 = MoveMenuCursor(1); + sub_80FE394(); + } + if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + gUnknown_083EC604[gUnknown_020388D4].func(taskId); + } else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + gpu_pal_decompress_alloc_tag_and_upload(taskId); + } + } +} + +void sub_80FE394(void) +{ + MenuFillWindowRectWithBlankTile(2, 15, 27, 18); + MenuPrint(gUnknown_083EC624[gUnknown_020388D4], 2, 15); +} + +void gpu_pal_decompress_alloc_tag_and_upload(u8 taskId) +{ + sub_8072DEC(); + MenuZeroFillWindowRect(0, 0, 10, 9); + MenuFillWindowRectWithBlankTile(2, 15, 27, 18); + FreeSpritePaletteByTag(6); + if (ewram_1f000.isPlayerRoom == 0) + { + ScriptContext1_SetupScript(gUnknown_0815F399); + DestroyTask(taskId); + } else + { + ReshowPlayerPC(taskId); + } +} + +void sub_80FE418(u8 taskId) +{ + sub_80FE5AC(taskId); +} + +void sub_80FE428(u8 taskId) +{ + InitMenu(0, 1, 1, 4, gUnknown_020388D4, 9); + sub_80FE394(); + gTasks[taskId].func = Task_DecorationPCProcessMenuInput; +} + +void sub_80FE470(u8 decoCat, u8 a1, u8 a2, u8 palIdx) +{ + u8 *strptr; + u8 v0; + v0 = sub_8072CBC(); + // PALETTE {palIdx} + strptr = gStringVar4; + strptr[0] = EXT_CTRL_CODE_BEGIN; + strptr[1] = 5; + strptr[2] = palIdx; + strptr += 3; + strptr = StringCopy(strptr, gUnknown_083EC5E4[decoCat]); + strptr = sub_8072C14(strptr, sub_8134194(decoCat), 0x56, 1); + *strptr++ = 0xba; + strptr = sub_8072C14(strptr, gDecorationInventories[decoCat].size, 0x68, 1); + strptr[0] = EXT_CTRL_CODE_BEGIN; + strptr[1] = 5; + strptr[2] = v0; + strptr[3] = EOS; + MenuPrint(gStringVar4, a1, a2); +} -void sub_80FEC94(u8 arg0); -void sub_80FECB8(u8 arg0); -void sub_80FECE0(u8 arg0); +void sub_80FE528(u8 taskId) +{ + u8 decoCat; + MenuDrawTextWindow(0, 0, 14, 19); + for (decoCat=0; decoCat<8; decoCat++) + { + if (ewram_1f000.isPlayerRoom == 1 && gTasks[taskId].data[11] == 0 && decoCat != DECOCAT_DOLL && decoCat != DECOCAT_CUSHION) + { + sub_80FE470(decoCat, 1, 2 * decoCat + 1, 13); + } else + { + sub_80FE470(decoCat, 1, 2 * decoCat + 1, 255); + } + } + MenuPrint(gUnknownText_Exit, 1, 17); +} -void sub_80FE7EC(u8 arg0) +void sub_80FE5AC(u8 taskId) { sub_8072DEC(); MenuZeroFillWindowRect(0, 0, 29, 19); + sub_80FE528(taskId); + InitMenu(0, 1, 1, 9, gUnknown_020388F6, 13); + gTasks[taskId].func = sub_80FE604; +} - sub_80FEC94(arg0); +void sub_80FE604(u8 taskId) +{ + if (!gPaletteFade.active) + { + if (gMain.newAndRepeatedKeys & DPAD_UP) + { + PlaySE(SE_SELECT); + MoveMenuCursor(-1); + } else if (gMain.newAndRepeatedKeys & DPAD_DOWN) + { + PlaySE(SE_SELECT); + MoveMenuCursor(1); + } else if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + gUnknown_020388F6 = GetMenuCursorPos(); + if (gUnknown_020388F6 != 8) + { + gUnknown_020388D5 = sub_8134194(gUnknown_020388F6); + if (gUnknown_020388D5) + { + sub_8134104(gUnknown_020388F6); + gUnknown_020388D0 = gDecorationInventories[gUnknown_020388F6].items; + sub_80FEF50(taskId); + sub_80F944C(); + sub_80F9480(gUnknown_020388F7, 8); + LoadScrollIndicatorPalette(); + gTasks[taskId].func = sub_80FE868; + } else + { + sub_8072DEC(); + MenuZeroFillWindowRect(0, 0, 14, 19); + DisplayItemMessageOnField(taskId, gSecretBaseText_NoDecors, sub_80FE418, 0); + } + } else + { + sub_80FE728(taskId); + } + } else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + sub_80FE728(taskId); + } + } +} + +void sub_80FE728(u8 taskId) +{ + if (gTasks[taskId].data[11] != 3) + { + sub_80FE758(taskId); + } else + { + sub_8109DAC(taskId); + } +} + +void sub_80FE758(u8 taskId) +{ + sub_8072DEC(); + MenuZeroFillWindowRect(0, 0, 14, 19); + if (gTasks[taskId].data[11] != 2) + { + sub_80FE1DC(); + MenuDisplayMessageBox(); + sub_80FE394(); + gTasks[taskId].func = Task_DecorationPCProcessMenuInput; + } else + { + sub_80B3068(taskId); + } +} + +void sub_80FE7A8(u8 taskId) +{ + gTasks[taskId].data[11] = 3; + gUnknown_020388F6 = 0; + sub_80FE5AC(taskId); +} + +void sub_80FE7D4(u8 *dest, u8 decClass) +{ + StringCopy(dest, gUnknown_083EC5E4[decClass]); +} + +void sub_80FE7EC(u8 taskId) +{ + sub_8072DEC(); + MenuZeroFillWindowRect(0, 0, 29, 19); + + sub_80FEC94(taskId); sub_80FECB8(gUnknown_020388F6); MenuDrawTextWindow(15, 12, 29, 19); @@ -25,3 +266,9 @@ void sub_80FE7EC(u8 arg0) sub_80FECE0(gUnknown_020388F2 + gUnknown_020388F4); InitMenu(0, 1, 2, gUnknown_020388F3 + 1, gUnknown_020388F2, 13); } + +void sub_80FE868(u8 taskId) +{ + sub_80FE7EC(taskId); + gTasks[taskId].func = sub_80FE948; +} -- cgit v1.2.3 From 9c45d48b962eb8f885e5753205673e7a5499d301 Mon Sep 17 00:00:00 2001 From: scnorton Date: Wed, 31 May 2017 18:26:50 -0400 Subject: A couple more decorations tasks --- src/decoration.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 0898e7a4b..599a51eea 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -272,3 +272,77 @@ void sub_80FE868(u8 taskId) sub_80FE7EC(taskId); gTasks[taskId].func = sub_80FE948; } + +void sub_80FE894(u8 taskId /*r8*/, s8 cursorVector /*r5*/, s8 bgVector /*r7*/) +{ + int v0 /*r10*/; + u8 v1; + v0 = gUnknown_020388F2 + gUnknown_020388F4 == gUnknown_020388D5; + PlaySE(SE_SELECT); + if (cursorVector != 0) + { + gUnknown_020388F2 = MoveMenuCursor(cursorVector); + } + if (bgVector != 0) + { + v1 = gUnknown_020388F4; + gUnknown_020388F4 = v1 + bgVector; + sub_80FEABC(taskId, 1); + } + if (gUnknown_020388F2 + gUnknown_020388F4 != gUnknown_020388D5) + { + if (v0) + { + MenuDrawTextWindow(15, 12, 29, 19); + } + sub_80FECE0(gUnknown_020388F2 + gUnknown_020388F4); + } else + { + MenuZeroFillWindowRect(15, 12, 29, 19); + } +} + +void sub_80FE948(u8 taskId) +{ + if (!gPaletteFade.active) + { + if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_UP) + { + if (gUnknown_020388F2 != 0) + { + sub_80FE894(taskId, -1, 0); + } else if (gUnknown_020388F4 != 0) + { + sub_80FE894(taskId, 0, -1); + } + } + if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_DOWN) + { + if (gUnknown_020388F2 != gUnknown_020388F3) + { + sub_80FE894(taskId, 1, 0); + } else if (gUnknown_020388F4 + gUnknown_020388F2 != gUnknown_020388D5) + { + sub_80FE894(taskId, 0, 1); + } + } + if (gMain.newKeys & A_BUTTON) + { + sub_8072DEC(); + PlaySE(SE_SELECT); + gUnknown_020388F5 = gUnknown_020388F2 + gUnknown_020388F4; + if (gUnknown_020388F5 == gUnknown_020388D5) + { + gUnknown_083EC634[gTasks[taskId].data[11]].func2(taskId); + } else + { + gUnknown_083EC634[gTasks[taskId].data[11]].func1(taskId); + } + } else if (gMain.newKeys & B_BUTTON) + { + sub_8072DEC(); + PlaySE(SE_SELECT); + gUnknown_083EC634[gTasks[taskId].data[11]].func2(taskId); + } + } +} -- cgit v1.2.3 From baebe7b6173f4d68996e889fca5f08ac8d1854f7 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 31 May 2017 22:57:30 -0400 Subject: sub_80FEABC --- src/decoration.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) mode change 100644 => 100755 src/decoration.c (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c old mode 100644 new mode 100755 index 599a51eea..59f15e088 --- a/src/decoration.c +++ b/src/decoration.c @@ -346,3 +346,62 @@ void sub_80FE948(u8 taskId) } } } + +void sub_80FEABC(u8 taskId, u8 dummy1) +{ + u16 i; + u16 j; + u8 ni; + if (gUnknown_020388F4 != 0 || (DestroyVerticalScrollIndicator(0), gUnknown_020388F4 != 0)) + { + CreateVerticalScrollIndicators(0, 0x3c, 0x08); + } + if (gUnknown_020388F4 + 7 == gUnknown_020388D5) + { + DestroyVerticalScrollIndicator(1); + } + if (gUnknown_020388F4 + 7 < gUnknown_020388D5) + { + CreateVerticalScrollIndicators(1, 0x3c, 0x98); + } + for (i=gUnknown_020388F4; i Date: Wed, 31 May 2017 23:31:50 -0400 Subject: Several smaller functions in decoration.c --- src/decoration.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 59f15e088..8d64ceea6 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -405,3 +405,45 @@ void sub_80FEABC(u8 taskId, u8 dummy1) } } } + +void sub_80FEC94(u8 taskId) +{ + MenuDrawTextWindow(0, 0, 14, 19); + sub_80FEABC(taskId, 0); +} + +void sub_80FECB8(u8 decoCat) +{ + MenuDrawTextWindow(15, 0, 29, 3); + sub_80FE470(decoCat, 16, 1, 0xff); +} + +void sub_80FECE0(u8 taskId) +{ + sub_8072AB0(gDecorations[gUnknown_020388D0[taskId]].description, 0x80, 0x68, 0x68, 0x30, 0x1); +} + +void sub_80FED1C(void) +{ + MenuZeroFillWindowRect(15, 0, 29, 3); + MenuZeroFillWindowRect(15, 12, 29, 19); +} + +void sub_80FED3C(u8 taskId) +{ + LoadScrollIndicatorPalette(); + gTasks[taskId].func = sub_80FE868; +} + +bool8 sub_80FED64(u8 a0) +{ + u8 i; + for (i=0; i<16; i++) + { + if (gUnknown_020388D6[i] == a0) + { + return TRUE; + } + } + return FALSE; +} -- cgit v1.2.3 From 40938484ab716ff8e5c8977c4c23ac520d936be0 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 1 Jun 2017 08:49:49 -0400 Subject: sub_80FED90 --- src/decoration.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 62 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 8d64ceea6..af5868266 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -190,7 +190,7 @@ void sub_80FE604(u8 taskId) if (gUnknown_020388D5) { sub_8134104(gUnknown_020388F6); - gUnknown_020388D0 = gDecorationInventories[gUnknown_020388F6].items; + *gUnknown_020388D0 = gDecorationInventories[gUnknown_020388F6].items; sub_80FEF50(taskId); sub_80F944C(); sub_80F9480(gUnknown_020388F7, 8); @@ -376,15 +376,15 @@ void sub_80FEABC(u8 taskId, u8 dummy1) sub_8072A18(gUnknownText_Exit, 0x08, 8 * ni, 0x68, 1); break; } - if (gUnknown_020388D0[i]) + if ((*gUnknown_020388D0)[i]) { if (ewram_1f000.isPlayerRoom == 1 && gUnknown_020388F6 != DECOCAT_DOLL && gUnknown_020388F6 != DECOCAT_CUSHION && gTasks[taskId].data[11] == 0) { - StringCopy(gStringVar1, gDecorations[gUnknown_020388D0[i]].name); + StringCopy(gStringVar1, gDecorations[(*gUnknown_020388D0)[i]].name); sub_8072A18(gUnknown_083EC65A, 0x08, 8 * ni, 0x68, 1); } else { - sub_8072A18(gDecorations[gUnknown_020388D0[i]].name, 0x08, 8 * ni, 0x68, 1); + sub_8072A18(gDecorations[(*gUnknown_020388D0)[i]].name, 0x08, 8 * ni, 0x68, 1); } for (j=0; j<16; j++) { @@ -418,9 +418,9 @@ void sub_80FECB8(u8 decoCat) sub_80FE470(decoCat, 16, 1, 0xff); } -void sub_80FECE0(u8 taskId) +void sub_80FECE0(u8 decoCat) { - sub_8072AB0(gDecorations[gUnknown_020388D0[taskId]].description, 0x80, 0x68, 0x68, 0x30, 0x1); + sub_8072AB0(gDecorations[(*gUnknown_020388D0)[decoCat]].description, 0x80, 0x68, 0x68, 0x30, 0x1); } void sub_80FED1C(void) @@ -447,3 +447,59 @@ bool8 sub_80FED64(u8 a0) } return FALSE; } + +void sub_80FED90(void) +{ + u16 i; + u16 j; + u16 k; + u16 cnt; + cnt = 0; + for (i=0; i<16; i++) + { + gUnknown_020388D6[i] = 0; + if (i < 12) + { + gUnknown_020388E6[i] = 0; + } + } + for (i=0; i<16; i++) + { + if (gSaveBlock1.secretBases[0].decorations[i] != 0) + { + for (j=0; j Date: Thu, 1 Jun 2017 14:01:34 -0400 Subject: A bunch more functions in decoration.c --- src/decoration.c | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 110 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index af5868266..ba923d527 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -1,5 +1,6 @@ #include "global.h" #include "asm.h" +#include "rom4.h" #include "sound.h" #include "songs.h" #include "string_util.h" @@ -7,6 +8,8 @@ #include "strings.h" #include "script.h" #include "palette.h" +#include "field_player_avatar.h" +#include "field_camera.h" #include "decoration.h" void sub_80FE1DC(void) @@ -448,7 +451,7 @@ bool8 sub_80FED64(u8 a0) return FALSE; } -void sub_80FED90(void) +void sub_80FED90(u8 taskId) { u16 i; u16 j; @@ -503,3 +506,109 @@ void sub_80FED90(void) } } } + +void sub_80FEF28(void) +{ + if (gUnknown_020388D5 <= 7) + { + gUnknown_020388F3 = gUnknown_020388D5; + } else + { + gUnknown_020388F3 = 7; + } +} + +void sub_80FEF50(u8 taskId) +{ + sub_80FED90(taskId); + sub_80FEF28(); + gUnknown_020388F2 = 0; + gUnknown_020388F4 = 0; +} + +void sub_80FEF74(void) +{ + sub_80F9520(gUnknown_020388F7, 8); + DestroyVerticalScrollIndicator(0); + DestroyVerticalScrollIndicator(1); + sub_8072DEC(); + MenuZeroFillWindowRect(0, 0, 14, 19); +} + +bool8 sub_80FEFA4(void) +{ + u16 i; + int v0; + for (i=0; i<16; i++) + { + v0 = gUnknown_020388F4 + gUnknown_020388F2 + 1; + if (gUnknown_020388D6[i] == v0 || (i < 12 && gUnknown_020388E6[i] == v0)) + { + return FALSE; + } + } + return TRUE; +} + +void sub_80FEFF4(u8 taskId) +{ + if (gMain.newKeys & A_BUTTON || gMain.newKeys & B_BUTTON) + { + LoadScrollIndicatorPalette(); + gTasks[taskId].func = sub_80FE868; + } +} + +void sub_80FF034(u8 taskId) +{ + sub_8072DEC(); + MenuZeroFillWindowRect(0, 0, 14, 19); + sub_80FE5AC(taskId); +} + +void sub_80FF058(u8 taskId) +{ + sub_80F9520(gUnknown_020388F7, 8); + DestroyVerticalScrollIndicator(0); + DestroyVerticalScrollIndicator(1); + BuyMenuFreeMemory(); + gTasks[taskId].func = sub_80FF034; +} + +void sub_80FF098(u8 taskId) +{ + gUnknown_020388D5--; + if (gUnknown_020388F4 + 7 > gUnknown_020388D5 && gUnknown_020388F4 != 0) + { + gUnknown_020388F4--; + } + sub_8134104(gUnknown_020388F6); + sub_80FED90(taskId); + sub_80FEF28(); +} + +void sub_80FF0E0(u8 taskId) +{ + gTasks[taskId].data[3] = gSaveBlock1.pos.x; + gTasks[taskId].data[4] = gSaveBlock1.pos.y; + PlayerGetDestCoords(&gTasks[taskId].data[0], &gTasks[taskId].data[1]); +} + +void sub_80FF114(u8 taskId) +{ + DrawWholeMapView(); + warp1_set(gSaveBlock1.location.mapGroup, gSaveBlock1.location.mapNum, -1, gTasks[taskId].data[3], gTasks[taskId].data[4]); + warp_in(); +} +void sub_80FF160(u8 taskId) +{ + if (!sub_81341D4()) + { + DisplayItemMessageOnField(taskId, gSecretBaseText_NoDecors, sub_80FE428, 0); + } else + { + gTasks[taskId].data[11] = 0; + gUnknown_020388F6 = 0; + sub_80FE5AC(taskId); + } +} -- cgit v1.2.3 From 928687bdf61fa44aec66e36adae2ae9f241d7b48 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 2 Jun 2017 08:24:32 -0400 Subject: sub_80FF1B0 (thanks revo :lovechatot:) --- src/decoration.c | 22 ++++++++++++++++++++++ src/fieldmap.c | 1 - src/tv.c | 0 3 files changed, 22 insertions(+), 1 deletion(-) mode change 100755 => 100644 src/decoration.c mode change 100755 => 100644 src/tv.c (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c old mode 100755 new mode 100644 index ba923d527..482b5922e --- a/src/decoration.c +++ b/src/decoration.c @@ -10,8 +10,12 @@ #include "palette.h" #include "field_player_avatar.h" #include "field_camera.h" +#include "fieldmap.h" +#include "metatile_behavior.h" #include "decoration.h" +extern Script gUnknown_0815F399; + void sub_80FE1DC(void) { sub_80FE2B4(); @@ -612,3 +616,21 @@ void sub_80FF160(u8 taskId) sub_80FE5AC(taskId); } } + +u16 sub_80FF1B0(u8 decoId, u8 a1) +{ + u16 retval; + retval = 0xffff; + + switch (decoId) + { + case DECOR_STAND: + retval = gUnknown_083EC97C[a1] << 12; + return retval; + case DECOR_SLIDE: + retval = gUnknown_083EC984[a1] << 12; + return retval; + default: + return retval; + } +} diff --git a/src/fieldmap.c b/src/fieldmap.c index 46b996e52..2ed2266f5 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -40,7 +40,6 @@ void fillSouthConnection(struct MapHeader *, struct MapHeader *, s32); void fillNorthConnection(struct MapHeader *, struct MapHeader *, s32); void fillWestConnection(struct MapHeader *, struct MapHeader *, s32); void fillEastConnection(struct MapHeader *, struct MapHeader *, s32); -u32 GetBehaviorByMetatileId(u16 metatile); struct MapConnection *sub_8056A64(u8 direction, int x, int y); bool8 sub_8056ABC(u8 direction, int x, int y, struct MapConnection *connection); bool8 sub_8056B20(int x, int src_width, int dest_width, int offset); diff --git a/src/tv.c b/src/tv.c old mode 100755 new mode 100644 -- cgit v1.2.3 From 97a19baae9076dd2c74c6fc8e2231ef3ec6786fd Mon Sep 17 00:00:00 2001 From: scnorton Date: Fri, 2 Jun 2017 14:47:30 -0400 Subject: sub_80FF1EC --- src/decoration.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 482b5922e..6b57ead5f 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -634,3 +634,47 @@ u16 sub_80FF1B0(u8 decoId, u8 a1) return retval; } } + +void sub_80FF1EC(s16 mapX, s16 mapY, u8 decWidth, u8 decHeight, u16 decIdx) +{ + u16 i; + u16 j; // r10 + u16 behavior; + u16 flags; // r8 + u16 v0; + u16 v1; + s16 x; + s16 decBottom; + + for (i=0; i> 12))) + { + flags = 0xc00; + } else + { + flags = 0x000; + } + if (gDecorations[decIdx].decor_field_11 != 3 && sub_80572B0(MapGridGetMetatileBehaviorAt(x, decBottom)) == 1) + { + v0 = 1; + } else + { + v0 = 0; + } + v1 = sub_80FF1B0(gDecorations[decIdx].id, i * decWidth + j); + if (v1 != 0xffff) + { + MapGridSetMetatileEntryAt(x, decBottom, (gDecorations[decIdx].tiles[i * decWidth + j] + (0x200 | v0)) | flags | v1); + } else + { + MapGridSetMetatileIdAt(x, decBottom, (gDecorations[decIdx].tiles[i * decWidth + j] + (0x200 | v0)) | flags); + } + } + } +} -- cgit v1.2.3 From ce6dc3665fd4a90807dae239065610b9a27e9726 Mon Sep 17 00:00:00 2001 From: scnorton Date: Fri, 2 Jun 2017 14:57:32 -0400 Subject: sub_80FF394 --- src/decoration.c | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 6b57ead5f..f2d4c62a3 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -635,7 +635,7 @@ u16 sub_80FF1B0(u8 decoId, u8 a1) } } -void sub_80FF1EC(s16 mapX, s16 mapY, u8 decWidth, u8 decHeight, u16 decIdx) +void sub_80FF1EC(u16 mapX, u16 mapY, u8 decWidth, u8 decHeight, u16 decIdx) { u16 i; u16 j; // r10 @@ -678,3 +678,40 @@ void sub_80FF1EC(s16 mapX, s16 mapY, u8 decWidth, u8 decHeight, u16 decIdx) } } } + +void sub_80FF394(u16 mapX, u16 mapY, u16 decIdx) +{ + switch (gDecorations[decIdx].decor_field_12) + { + case 0: + sub_80FF1EC(mapX, mapY, 1, 1, decIdx); + break; + case 1: + sub_80FF1EC(mapX, mapY, 2, 1, decIdx); + break; + case 2: + sub_80FF1EC(mapX, mapY, 3, 1, decIdx); + break; + case 3: + sub_80FF1EC(mapX, mapY, 4, 2, decIdx); + break; + case 4: + sub_80FF1EC(mapX, mapY, 2, 2, decIdx); + break; + case 5: + sub_80FF1EC(mapX, mapY, 1, 2, decIdx); + break; + case 6: + sub_80FF1EC(mapX, mapY, 1, 3, decIdx); + break; + case 7: + sub_80FF1EC(mapX, mapY, 2, 4, decIdx); + break; + case 8: + sub_80FF1EC(mapX, mapY, 3, 3, decIdx); + break; + case 9: + sub_80FF1EC(mapX, mapY, 3, 2, decIdx); + break; + } +} -- cgit v1.2.3 From 1ef73db9299a79bdb3db15140d8ee59ada985aa9 Mon Sep 17 00:00:00 2001 From: scnorton Date: Fri, 2 Jun 2017 15:14:05 -0400 Subject: sub_80FF474 --- src/decoration.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index f2d4c62a3..a1663e31f 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -12,6 +12,7 @@ #include "field_camera.h" #include "fieldmap.h" #include "metatile_behavior.h" +#include "event_data.h" #include "decoration.h" extern Script gUnknown_0815F399; @@ -715,3 +716,31 @@ void sub_80FF394(u16 mapX, u16 mapY, u16 decIdx) break; } } + +void sub_80FF474(void) +{ + u8 i; + u8 j; + for (i=0; i<14; i++) + { + if (FlagGet(i + 0xae) == 1) + { + FlagReset(i + 0xae); + for (j=0; jmapObjectCount; j++) + { + if (gMapHeader.events->mapObjects[j].flagId == i + 0xae) + { + break; + } + } + VarSet(0x3f20 + gMapHeader.events->mapObjects[j].graphicsId, gUnknown_02038900->tiles[0]); + gSpecialVar_0x8005 = gMapHeader.events->mapObjects[j].localId; + gSpecialVar_0x8006 = gUnknown_020391A4; + gSpecialVar_0x8007 = gUnknown_020391A6; + show_sprite(gSpecialVar_0x8005, gSaveBlock1.location.mapNum, gSaveBlock1.location.mapGroup); + sub_805C0F8(gSpecialVar_0x8005, gSaveBlock1.location.mapNum, gSaveBlock1.location.mapGroup, gSpecialVar_0x8006, gSpecialVar_0x8007); + sub_805C78C(gSpecialVar_0x8005, gSaveBlock1.location.mapNum, gSaveBlock1.location.mapGroup); + break; + } + } +} -- cgit v1.2.3 From 3d82de46b836c00a617869bf6e2916eeb3cc4fef Mon Sep 17 00:00:00 2001 From: scnorton Date: Fri, 2 Jun 2017 15:32:00 -0400 Subject: sub_80FF5BC --- src/decoration.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index a1663e31f..d172e1426 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -13,6 +13,7 @@ #include "fieldmap.h" #include "metatile_behavior.h" #include "event_data.h" +#include "field_weather.h" #include "decoration.h" extern Script gUnknown_0815F399; @@ -744,3 +745,52 @@ void sub_80FF474(void) } } } + +bool8 sub_80FF58C/*IsThereRoomForMoreDecorations*/(void) +{ + u16 i; + for (i=0; i Date: Fri, 2 Jun 2017 16:34:20 -0400 Subject: sub_80FF6AC --- src/decoration.c | 48 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index d172e1426..75f9f4b96 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -199,7 +199,7 @@ void sub_80FE604(u8 taskId) if (gUnknown_020388D5) { sub_8134104(gUnknown_020388F6); - *gUnknown_020388D0 = gDecorationInventories[gUnknown_020388F6].items; + gUnknown_020388D0 = gDecorationInventories[gUnknown_020388F6].items; sub_80FEF50(taskId); sub_80F944C(); sub_80F9480(gUnknown_020388F7, 8); @@ -385,15 +385,15 @@ void sub_80FEABC(u8 taskId, u8 dummy1) sub_8072A18(gUnknownText_Exit, 0x08, 8 * ni, 0x68, 1); break; } - if ((*gUnknown_020388D0)[i]) + if (gUnknown_020388D0[i]) { if (ewram_1f000.isPlayerRoom == 1 && gUnknown_020388F6 != DECOCAT_DOLL && gUnknown_020388F6 != DECOCAT_CUSHION && gTasks[taskId].data[11] == 0) { - StringCopy(gStringVar1, gDecorations[(*gUnknown_020388D0)[i]].name); + StringCopy(gStringVar1, gDecorations[gUnknown_020388D0[i]].name); sub_8072A18(gUnknown_083EC65A, 0x08, 8 * ni, 0x68, 1); } else { - sub_8072A18(gDecorations[(*gUnknown_020388D0)[i]].name, 0x08, 8 * ni, 0x68, 1); + sub_8072A18(gDecorations[gUnknown_020388D0[i]].name, 0x08, 8 * ni, 0x68, 1); } for (j=0; j<16; j++) { @@ -429,7 +429,7 @@ void sub_80FECB8(u8 decoCat) void sub_80FECE0(u8 decoCat) { - sub_8072AB0(gDecorations[(*gUnknown_020388D0)[decoCat]].description, 0x80, 0x68, 0x68, 0x30, 0x1); + sub_8072AB0(gDecorations[gUnknown_020388D0[decoCat]].description, 0x80, 0x68, 0x68, 0x30, 0x1); } void sub_80FED1C(void) @@ -478,7 +478,7 @@ void sub_80FED90(u8 taskId) { for (j=0; j Date: Fri, 2 Jun 2017 17:51:04 -0400 Subject: AddDecorationIconObjectFromFieldObject, and other functions that needed compatibility fixes with struct UnkStruct_02038900 --- src/decoration.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 75f9f4b96..7dc4448ef 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -734,7 +734,7 @@ void sub_80FF474(void) break; } } - VarSet(0x3f20 + gMapHeader.events->mapObjects[j].graphicsId, gUnknown_02038900->tiles[0]); + VarSet(0x3f20 + gMapHeader.events->mapObjects[j].graphicsId, gUnknown_02038900.decoration->tiles[0]); gSpecialVar_0x8005 = gMapHeader.events->mapObjects[j].localId; gSpecialVar_0x8006 = gUnknown_020391A4; gSpecialVar_0x8007 = gUnknown_020391A6; @@ -828,3 +828,26 @@ void sub_80FF6AC(u8 taskId) break; } } + +void AddDecorationIconObjectFromFieldObject(struct UnkStruct_02038900 * unk_02038900, u8 decoIdx) +{ + sub_80FEF74(); + sub_80FED1C(); + sub_81006D0(unk_02038900); + unk_02038900->decoration = &gDecorations[decoIdx]; + if (gDecorations[decoIdx].decor_field_11 != 4) + { + sub_81008BC(unk_02038900); + sub_8100930(unk_02038900->decoration->decor_field_12); + sub_8100874(unk_02038900); + sub_810070C(unk_02038900->unk_884, ((u16 *)gMapHeader.mapData->secondaryTileset->metatiles + 8 * unk_02038900->decoration->tiles[0])[7] >> 12); + LoadSpritePalette(&gUnknown_083EC954); + gUnknown_020391A8 = gSprites[gUnknown_03004880.unk4].data0; + gUnknown_03004880.unk4 = CreateSprite(&gSpriteTemplate_83EC93C, gUnknown_083EC900[unk_02038900->decoration->decor_field_12].unk_2, gUnknown_083EC900[unk_02038900->decoration->decor_field_12].unk_3, 0); + } else + { + gUnknown_020391A8 = gSprites[gUnknown_03004880.unk4].data0; + gUnknown_03004880.unk4 = AddPseudoFieldObject(unk_02038900->decoration->tiles[0], sub_81009A8, gUnknown_083EC900[unk_02038900->decoration->decor_field_12].unk_2, gUnknown_083EC900[unk_02038900->decoration->decor_field_12].unk_3, 1); + gSprites[gUnknown_03004880.unk4].oam.priority = 1; + } +} -- cgit v1.2.3 From a969b2df27c284179f231a5e9215596af7a5a215 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 2 Jun 2017 19:37:53 -0400 Subject: SetUpPlacingDecorationPlayerAvatar --- src/decoration.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) mode change 100644 => 100755 src/decoration.c (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c old mode 100644 new mode 100755 index 7dc4448ef..542644bb0 --- a/src/decoration.c +++ b/src/decoration.c @@ -851,3 +851,23 @@ void AddDecorationIconObjectFromFieldObject(struct UnkStruct_02038900 * unk_0203 gSprites[gUnknown_03004880.unk4].oam.priority = 1; } } + +void SetUpPlacingDecorationPlayerAvatar(u8 taskId, struct UnkStruct_02038900 *unk_02038900) +{ + u8 v0; + v0 = 16 * (u8)gTasks[taskId].data[5] + gUnknown_083EC900[unk_02038900->decoration->decor_field_12].unk_2 - 8 * ((u8)gTasks[taskId].data[5] - 1); + if (unk_02038900->decoration->decor_field_12 == 2 || unk_02038900->decoration->decor_field_12 == 8 || unk_02038900->decoration->decor_field_12 == 9) + { + v0 -= 8; + } + if (gSaveBlock2.playerGender == MALE) + { + gUnknown_020391A9 = AddPseudoFieldObject(0xc1, SpriteCallbackDummy, v0, 0x48, 0); + } else + { + gUnknown_020391A9 = AddPseudoFieldObject(0xc2, SpriteCallbackDummy, v0, 0x48, 0); + } + gSprites[gUnknown_020391A9].oam.priority = 1; + DestroySprite(&gSprites[gUnknown_020391A8]); + gUnknown_020391A8 = gUnknown_03004880.unk4; +} -- cgit v1.2.3 From d03bf0f3818bacfe962a1da4a53c30080573e6a8 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 2 Jun 2017 20:29:36 -0400 Subject: sub_80FF960 --- src/decoration.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 542644bb0..9a1e9ed2a 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -871,3 +871,51 @@ void SetUpPlacingDecorationPlayerAvatar(u8 taskId, struct UnkStruct_02038900 *un DestroySprite(&gSprites[gUnknown_020391A8]); gUnknown_020391A8 = gUnknown_03004880.unk4; } + +void sub_80FF960(u8 taskId) +{ + switch (gDecorations[gUnknown_020388D0[gUnknown_020388F5]].decor_field_12) + { + case 0: + gTasks[taskId].data[5] = 1; + gTasks[taskId].data[6] = 1; + break; + case 1: + gTasks[taskId].data[5] = 2; + gTasks[taskId].data[6] = 1; + break; + case 2: + gTasks[taskId].data[5] = 3; + gTasks[taskId].data[6] = 1; + break; + case 3: + gTasks[taskId].data[5] = 4; + gTasks[taskId].data[6] = 2; + break; + case 4: + gTasks[taskId].data[5] = 2; + gTasks[taskId].data[6] = 2; + break; + case 5: + gTasks[taskId].data[5] = 1; + gTasks[taskId].data[6] = 2; + break; + case 6: + gTasks[taskId].data[5] = 1; + gTasks[taskId].data[6] = 3; + gTasks[taskId].data[1]++; + break; + case 7: + gTasks[taskId].data[5] = 2; + gTasks[taskId].data[6] = 4; + break; + case 8: + gTasks[taskId].data[5] = 3; + gTasks[taskId].data[6] = 3; + break; + case 9: + gTasks[taskId].data[5] = 3; + gTasks[taskId].data[6] = 2; + break; + } +} -- cgit v1.2.3 From ac48aab8e61d8ac3e0ed0386da5dd74389b1a51c Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 2 Jun 2017 20:50:14 -0400 Subject: Some smaller functions --- src/decoration.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 9a1e9ed2a..67c4d13af 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -919,3 +919,55 @@ void sub_80FF960(u8 taskId) break; } } + +void sub_80FFAB0(u8 taskId) +{ + gTasks[taskId].data[10] = 0; + gSprites[gUnknown_020391A8].data7 = 1; + gSprites[gUnknown_020391A9].data7 = 1; + sub_810045C(); + sub_8100038(taskId); +} + +void sub_80FFB08(u8 taskId) +{ + gTasks[taskId].data[10] = 0; + gSprites[gUnknown_020391A8].data7 = 1; + gSprites[gUnknown_020391A9].data7 = 1; + sub_810045C(); + DisplayItemMessageOnField(taskId, gSecretBaseText_CancelDecorating, sub_8100248, 0); +} + +bool8 sub_80FFB6C(u8 a0, u16 a1) +{ + if (sub_8057274(a0) != 1 || a1 != 0) + { + return FALSE; + } + return TRUE; +} + +bool8 sub_80FFB94(u8 taskId, s16 x, s16 y, u16 decoId) +{ + if (x == gTasks[taskId].data[3] + 7 && y == gTasks[taskId].data[4] + 7 && decoId != 0) + { + return FALSE; + } + return TRUE; +} + +bool8 sub_80FFBDC(u16 a0, struct Decoration *decoration) +{ + if (sub_8057274(a0) != 1) + { + if (decoration->id == DECOR_SOLID_BOARD && sub_8057300(a0) == 1) + { + return TRUE; + } + if (sub_805729C(a0)) + { + return TRUE; + } + } + return FALSE; +} -- cgit v1.2.3 From 0b2bd5faa0bc59d8c2153a305c9a9c46ca8d69d0 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 3 Jun 2017 18:38:32 -0400 Subject: sub_80FFC24 (nonmatching) --- src/decoration.c | 667 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 667 insertions(+) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 67c4d13af..63fe83b48 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -971,3 +971,670 @@ bool8 sub_80FFBDC(u16 a0, struct Decoration *decoration) } return FALSE; } + +#ifdef NONMATCHING +bool8 sub_80FFC24(u8 taskId, struct Decoration *decoration) +{ + u8 i; + u8 j; + u8 behaviorAt; + u16 behaviorBy; + u8 fieldObjectId; + u8 mapY; + u8 mapX; + s16 curY; + s16 curX; + mapY = gTasks[taskId].data[6]; + mapX = gTasks[taskId].data[5]; + switch (decoration->decor_field_11) + { + case 0: + case 1: + for (i=0; itiles[(mapY - 1 - i) * mapX + j]); + if (!sub_80FFBDC(behaviorAt, decoration)) + { + return FALSE; + } + if (!sub_80FFB94(taskId, curX, curY, behaviorBy)) + { + return FALSE; + } + fieldObjectId = GetFieldObjectIdByXYZ(curX, curY, 0); + if (fieldObjectId != 0 && fieldObjectId != 16) + { + return FALSE; + } + } + } + break; + case 2: + for (i=0; itiles[(mapY - i) * mapX + j]); + if (!sub_805729C(behaviorAt) && !sub_80FFB6C(behaviorAt, behaviorBy)) + { + return FALSE; + } + if (!sub_80FFB94(taskId, curX, curY, behaviorBy)) + { + return FALSE; + } + fieldObjectId = GetFieldObjectIdByXYZ(curX, curY, 0); + if (fieldObjectId != 16) + { + return FALSE; + } + } + } + curY = gTasks[taskId].data[1] - mapY + 1; + for (j=0; jtiles[j]); + if (!sub_805729C(behaviorAt) && !sub_80572B0(behaviorAt)) + { + return FALSE; + } + if (!sub_80FFB94(taskId, curX, curY, behaviorBy)) + { + return FALSE; + } + fieldObjectId = GetFieldObjectIdByXYZ(curX, curY, 0); + if (fieldObjectId != 0 && fieldObjectId != 16) + { + return FALSE; + } + } + break; + case 3: + for (i=0; idecor_field_12 == 5) + { + if (!sub_80572EC(behaviorAt)) + { + return FALSE; + } + } + else if (!sub_80572D8(behaviorAt)) + { + if (!sub_80572EC(behaviorAt)) + { + return FALSE; + } + } + fieldObjectId = GetFieldObjectIdByXYZ(curX, curY, 0); + if (fieldObjectId != 16) + { + return FALSE; + } + } + break; + } + return TRUE; +} +#else +__attribute__((naked)) +bool8 sub_80FFC24(u8 taskId, struct Decoration *decoration) +{ + asm(".syntax unified\n" + "\tpush {r4-r7,lr}\n" + "\tmov r7, r10\n" + "\tmov r6, r9\n" + "\tmov r5, r8\n" + "\tpush {r5-r7}\n" + "\tsub sp, 0x24\n" + "\tstr r1, [sp]\n" + "\tlsls r0, 24\n" + "\tlsrs r0, 24\n" + "\tmov r10, r0\n" + "\tldr r1, _080FFC60 @ =gTasks\n" + "\tlsls r0, 2\n" + "\tadd r0, r10\n" + "\tlsls r0, 3\n" + "\tadds r0, r1\n" + "\tldrb r2, [r0, 0x14]\n" + "\tstr r2, [sp, 0x4]\n" + "\tldrb r0, [r0, 0x12]\n" + "\tstr r0, [sp, 0x8]\n" + "\tldr r3, [sp]\n" + "\tldrb r0, [r3, 0x11]\n" + "\tadds r2, r1, 0\n" + "\tcmp r0, 0x4\n" + "\tbls _080FFC56\n" + "\tb _08100024\n" + "_080FFC56:\n" + "\tlsls r0, 2\n" + "\tldr r1, _080FFC64 @ =_080FFC68\n" + "\tadds r0, r1\n" + "\tldr r0, [r0]\n" + "\tmov pc, r0\n" + "\t.align 2, 0\n" + "_080FFC60: .4byte gTasks\n" + "_080FFC64: .4byte _080FFC68\n" + "\t.align 2, 0\n" + "_080FFC68:\n" + "\t.4byte _080FFC7C\n" + "\t.4byte _080FFC7C\n" + "\t.4byte _080FFD68\n" + "\t.4byte _080FFF1C\n" + "\t.4byte _080FFFA0\n" + "_080FFC7C:\n" + "\tmovs r6, 0\n" + "\tldr r0, [sp, 0x4]\n" + "\tcmp r6, r0\n" + "\tbcc _080FFC86\n" + "\tb _08100024\n" + "_080FFC86:\n" + "\tmov r1, r10\n" + "\tlsls r1, 2\n" + "\tstr r1, [sp, 0x1C]\n" + "_080FFC8C:\n" + "\tmov r2, r10\n" + "\tlsls r0, r2, 2\n" + "\tadd r0, r10\n" + "\tlsls r0, 3\n" + "\tldr r3, _080FFD64 @ =gTasks\n" + "\tadds r0, r3\n" + "\tldrh r0, [r0, 0xA]\n" + "\tsubs r0, r6\n" + "\tlsls r0, 16\n" + "\tlsrs r0, 16\n" + "\tmov r9, r0\n" + "\tmovs r7, 0\n" + "\tadds r6, 0x1\n" + "\tstr r6, [sp, 0x14]\n" + "\tldr r0, [sp, 0x8]\n" + "\tcmp r7, r0\n" + "\tbcs _080FFD56\n" + "\tmov r1, r9\n" + "\tlsls r1, 16\n" + "\tstr r1, [sp, 0xC]\n" + "\tasrs r1, 16\n" + "\tmov r9, r1\n" + "_080FFCB8:\n" + "\tldr r0, [sp, 0x1C]\n" + "\tadd r0, r10\n" + "\tlsls r0, 3\n" + "\tldr r2, _080FFD64 @ =gTasks\n" + "\tadds r0, r2\n" + "\tldrh r0, [r0, 0x8]\n" + "\tadds r0, r7\n" + "\tlsls r0, 16\n" + "\tmov r8, r0\n" + "\tasrs r6, r0, 16\n" + "\tadds r0, r6, 0\n" + "\tmov r1, r9\n" + "\tbl MapGridGetMetatileBehaviorAt\n" + "\tlsls r0, 24\n" + "\tlsrs r4, r0, 24\n" + "\tldr r3, [sp, 0x4]\n" + "\tldr r1, [sp, 0x14]\n" + "\tsubs r0, r3, r1\n" + "\tldr r2, [sp, 0x8]\n" + "\tadds r1, r0, 0\n" + "\tmuls r1, r2\n" + "\tadds r1, r7\n" + "\tldr r3, [sp]\n" + "\tldr r0, [r3, 0x1C]\n" + "\tlsls r1, 1\n" + "\tadds r1, r0\n" + "\tmovs r2, 0x80\n" + "\tlsls r2, 2\n" + "\tadds r0, r2, 0\n" + "\tldrh r1, [r1]\n" + "\tadds r0, r1\n" + "\tlsls r0, 16\n" + "\tlsrs r0, 16\n" + "\tbl GetBehaviorByMetatileId\n" + "\tmovs r3, 0xF0\n" + "\tlsls r3, 8\n" + "\tadds r1, r3, 0\n" + "\tadds r5, r1, 0\n" + "\tands r5, r0\n" + "\tadds r0, r4, 0\n" + "\tldr r1, [sp]\n" + "\tbl sub_80FFBDC\n" + "\tlsls r0, 24\n" + "\tcmp r0, 0\n" + "\tbne _080FFD1A\n" + "\tb _080FFFF4\n" + "_080FFD1A:\n" + "\tmov r0, r10\n" + "\tadds r1, r6, 0\n" + "\tmov r2, r9\n" + "\tadds r3, r5, 0\n" + "\tbl sub_80FFB94\n" + "\tlsls r0, 24\n" + "\tcmp r0, 0\n" + "\tbne _080FFD2E\n" + "\tb _080FFFF4\n" + "_080FFD2E:\n" + "\tmov r1, r8\n" + "\tlsrs r0, r1, 16\n" + "\tldr r2, [sp, 0xC]\n" + "\tlsrs r1, r2, 16\n" + "\tmovs r2, 0\n" + "\tbl GetFieldObjectIdByXYZ\n" + "\tlsls r0, 24\n" + "\tlsrs r4, r0, 24\n" + "\tcmp r4, 0\n" + "\tbeq _080FFD4A\n" + "\tcmp r4, 0x10\n" + "\tbeq _080FFD4A\n" + "\tb _080FFFF4\n" + "_080FFD4A:\n" + "\tadds r0, r7, 0x1\n" + "\tlsls r0, 24\n" + "\tlsrs r7, r0, 24\n" + "\tldr r3, [sp, 0x8]\n" + "\tcmp r7, r3\n" + "\tbcc _080FFCB8\n" + "_080FFD56:\n" + "\tldr r1, [sp, 0x14]\n" + "\tlsls r0, r1, 24\n" + "\tlsrs r6, r0, 24\n" + "\tldr r2, [sp, 0x4]\n" + "\tcmp r6, r2\n" + "\tbcc _080FFC8C\n" + "\tb _08100024\n" + "\t.align 2, 0\n" + "_080FFD64: .4byte gTasks\n" + "_080FFD68:\n" + "\tmovs r6, 0\n" + "\tmov r3, r10\n" + "\tlsls r3, 2\n" + "\tstr r3, [sp, 0x1C]\n" + "\tldr r0, [sp, 0x4]\n" + "\tsubs r0, 0x1\n" + "\tstr r0, [sp, 0x18]\n" + "\tcmp r6, r0\n" + "\tbge _080FFE54\n" + "\tadds r0, r3, 0\n" + "\tadd r0, r10\n" + "\tlsls r0, 3\n" + "\tstr r0, [sp, 0x10]\n" + "_080FFD82:\n" + "\tldr r1, [sp, 0x10]\n" + "\tadds r0, r1, r2\n" + "\tldrh r0, [r0, 0xA]\n" + "\tsubs r0, r6\n" + "\tlsls r0, 16\n" + "\tlsrs r0, 16\n" + "\tmov r9, r0\n" + "\tmovs r7, 0\n" + "\tadds r6, 0x1\n" + "\tstr r6, [sp, 0x14]\n" + "\tldr r3, [sp, 0x8]\n" + "\tcmp r7, r3\n" + "\tbcs _080FFE48\n" + "\tlsls r0, 16\n" + "\tstr r0, [sp, 0x20]\n" + "_080FFDA0:\n" + "\tldr r1, [sp, 0x10]\n" + "\tadds r0, r1, r2\n" + "\tldrh r0, [r0, 0x8]\n" + "\tadds r0, r7\n" + "\tlsls r0, 16\n" + "\tmov r8, r0\n" + "\tasrs r6, r0, 16\n" + "\tmov r2, r9\n" + "\tlsls r1, r2, 16\n" + "\tadds r0, r6, 0\n" + "\tasrs r1, 16\n" + "\tbl MapGridGetMetatileBehaviorAt\n" + "\tlsls r0, 24\n" + "\tlsrs r4, r0, 24\n" + "\tldr r3, [sp, 0x4]\n" + "\tldr r1, [sp, 0x14]\n" + "\tsubs r0, r3, r1\n" + "\tldr r2, [sp, 0x8]\n" + "\tadds r1, r0, 0\n" + "\tmuls r1, r2\n" + "\tadds r1, r7\n" + "\tldr r3, [sp]\n" + "\tldr r0, [r3, 0x1C]\n" + "\tlsls r1, 1\n" + "\tadds r1, r0\n" + "\tmovs r2, 0x80\n" + "\tlsls r2, 2\n" + "\tadds r0, r2, 0\n" + "\tldrh r1, [r1]\n" + "\tadds r0, r1\n" + "\tlsls r0, 16\n" + "\tlsrs r0, 16\n" + "\tbl GetBehaviorByMetatileId\n" + "\tmovs r3, 0xF0\n" + "\tlsls r3, 8\n" + "\tadds r1, r3, 0\n" + "\tadds r5, r1, 0\n" + "\tands r5, r0\n" + "\tadds r0, r4, 0\n" + "\tbl sub_805729C\n" + "\tlsls r0, 24\n" + "\tcmp r0, 0\n" + "\tbne _080FFE0C\n" + "\tadds r0, r4, 0\n" + "\tadds r1, r5, 0\n" + "\tbl sub_80FFB6C\n" + "\tlsls r0, 24\n" + "\tcmp r0, 0\n" + "\tbne _080FFE0C\n" + "\tb _080FFFF4\n" + "_080FFE0C:\n" + "\tmov r0, r10\n" + "\tadds r1, r6, 0\n" + "\tldr r3, [sp, 0x20]\n" + "\tasrs r2, r3, 16\n" + "\tadds r3, r5, 0\n" + "\tbl sub_80FFB94\n" + "\tlsls r0, 24\n" + "\tcmp r0, 0\n" + "\tbne _080FFE22\n" + "\tb _080FFFF4\n" + "_080FFE22:\n" + "\tmov r1, r8\n" + "\tlsrs r0, r1, 16\n" + "\tldr r2, [sp, 0x20]\n" + "\tlsrs r1, r2, 16\n" + "\tmovs r2, 0\n" + "\tbl GetFieldObjectIdByXYZ\n" + "\tlsls r0, 24\n" + "\tlsrs r0, 24\n" + "\tcmp r0, 0x10\n" + "\tbeq _080FFE3A\n" + "\tb _080FFFF4\n" + "_080FFE3A:\n" + "\tadds r0, r7, 0x1\n" + "\tlsls r0, 24\n" + "\tlsrs r7, r0, 24\n" + "\tldr r2, _080FFF18 @ =gTasks\n" + "\tldr r3, [sp, 0x8]\n" + "\tcmp r7, r3\n" + "\tbcc _080FFDA0\n" + "_080FFE48:\n" + "\tldr r1, [sp, 0x14]\n" + "\tlsls r0, r1, 24\n" + "\tlsrs r6, r0, 24\n" + "\tldr r3, [sp, 0x18]\n" + "\tcmp r6, r3\n" + "\tblt _080FFD82\n" + "_080FFE54:\n" + "\tldr r0, [sp, 0x1C]\n" + "\tadd r0, r10\n" + "\tlsls r0, 3\n" + "\tadds r0, r2\n" + "\tldrh r0, [r0, 0xA]\n" + "\tldr r1, [sp, 0x4]\n" + "\tsubs r0, r1\n" + "\tadds r0, 0x1\n" + "\tlsls r0, 16\n" + "\tlsrs r0, 16\n" + "\tmov r9, r0\n" + "\tmovs r7, 0\n" + "\tldr r3, [sp, 0x8]\n" + "\tcmp r7, r3\n" + "\tbcc _080FFE74\n" + "\tb _08100024\n" + "_080FFE74:\n" + "\tlsls r0, 16\n" + "\tstr r0, [sp, 0x20]\n" + "_080FFE78:\n" + "\tldr r0, [sp, 0x1C]\n" + "\tadd r0, r10\n" + "\tlsls r0, 3\n" + "\tldr r1, _080FFF18 @ =gTasks\n" + "\tadds r0, r1\n" + "\tldrh r0, [r0, 0x8]\n" + "\tadds r0, r7\n" + "\tlsls r0, 16\n" + "\tmov r8, r0\n" + "\tasrs r6, r0, 16\n" + "\tmov r2, r9\n" + "\tlsls r1, r2, 16\n" + "\tadds r0, r6, 0\n" + "\tasrs r1, 16\n" + "\tbl MapGridGetMetatileBehaviorAt\n" + "\tlsls r0, 24\n" + "\tlsrs r4, r0, 24\n" + "\tldr r3, [sp]\n" + "\tldr r0, [r3, 0x1C]\n" + "\tlsls r1, r7, 1\n" + "\tadds r1, r0\n" + "\tmovs r2, 0x80\n" + "\tlsls r2, 2\n" + "\tadds r0, r2, 0\n" + "\tldrh r1, [r1]\n" + "\tadds r0, r1\n" + "\tlsls r0, 16\n" + "\tlsrs r0, 16\n" + "\tbl GetBehaviorByMetatileId\n" + "\tmovs r3, 0xF0\n" + "\tlsls r3, 8\n" + "\tadds r1, r3, 0\n" + "\tadds r5, r1, 0\n" + "\tands r5, r0\n" + "\tadds r0, r4, 0\n" + "\tbl sub_805729C\n" + "\tlsls r0, 24\n" + "\tcmp r0, 0\n" + "\tbne _080FFEDA\n" + "\tadds r0, r4, 0\n" + "\tbl sub_80572B0\n" + "\tlsls r0, 24\n" + "\tcmp r0, 0\n" + "\tbne _080FFEDA\n" + "\tb _080FFFF4\n" + "_080FFEDA:\n" + "\tmov r0, r10\n" + "\tadds r1, r6, 0\n" + "\tldr r3, [sp, 0x20]\n" + "\tasrs r2, r3, 16\n" + "\tadds r3, r5, 0\n" + "\tbl sub_80FFB94\n" + "\tlsls r0, 24\n" + "\tcmp r0, 0\n" + "\tbne _080FFEF0\n" + "\tb _080FFFF4\n" + "_080FFEF0:\n" + "\tmov r1, r8\n" + "\tlsrs r0, r1, 16\n" + "\tldr r2, [sp, 0x20]\n" + "\tlsrs r1, r2, 16\n" + "\tmovs r2, 0\n" + "\tbl GetFieldObjectIdByXYZ\n" + "\tlsls r0, 24\n" + "\tlsrs r4, r0, 24\n" + "\tcmp r4, 0\n" + "\tbeq _080FFF0A\n" + "\tcmp r4, 0x10\n" + "\tbne _080FFFF4\n" + "_080FFF0A:\n" + "\tadds r0, r7, 0x1\n" + "\tlsls r0, 24\n" + "\tlsrs r7, r0, 24\n" + "\tldr r3, [sp, 0x8]\n" + "\tcmp r7, r3\n" + "\tbcc _080FFE78\n" + "\tb _08100024\n" + "\t.align 2, 0\n" + "_080FFF18: .4byte gTasks\n" + "_080FFF1C:\n" + "\tmovs r6, 0\n" + "\tldr r0, [sp, 0x4]\n" + "\tcmp r6, r0\n" + "\tbcc _080FFF26\n" + "\tb _08100024\n" + "_080FFF26:\n" + "\tmov r1, r10\n" + "\tlsls r0, r1, 2\n" + "\tadd r0, r10\n" + "\tlsls r1, r0, 3\n" + "\tldr r2, _080FFF9C @ =gTasks\n" + "\tadds r0, r1, r2\n" + "\tldrh r0, [r0, 0xA]\n" + "\tsubs r0, r6\n" + "\tlsls r0, 16\n" + "\tlsrs r0, 16\n" + "\tmov r9, r0\n" + "\tmovs r7, 0\n" + "\tldr r3, [sp, 0x8]\n" + "\tcmp r7, r3\n" + "\tbcs _080FFF8C\n" + "\tadds r0, r2, 0\n" + "\tadds r1, r0\n" + "\tmov r8, r1\n" + "\tmov r1, r9\n" + "\tlsls r0, r1, 16\n" + "\tasrs r5, r0, 16\n" + "_080FFF50:\n" + "\tmov r2, r8\n" + "\tldrh r0, [r2, 0x8]\n" + "\tadds r0, r7\n" + "\tlsls r0, 16\n" + "\tasrs r4, r0, 16\n" + "\tadds r0, r4, 0\n" + "\tadds r1, r5, 0\n" + "\tbl MapGridGetMetatileBehaviorAt\n" + "\tlsls r0, 24\n" + "\tlsrs r0, 24\n" + "\tbl sub_80572B0\n" + "\tlsls r0, 24\n" + "\tcmp r0, 0\n" + "\tbeq _080FFFF4\n" + "\tadds r0, r4, 0\n" + "\tadds r1, r5, 0x1\n" + "\tbl MapGridGetMetatileIdAt\n" + "\tmovs r1, 0xA3\n" + "\tlsls r1, 2\n" + "\tcmp r0, r1\n" + "\tbeq _080FFFF4\n" + "\tadds r0, r7, 0x1\n" + "\tlsls r0, 24\n" + "\tlsrs r7, r0, 24\n" + "\tldr r3, [sp, 0x8]\n" + "\tcmp r7, r3\n" + "\tbcc _080FFF50\n" + "_080FFF8C:\n" + "\tadds r0, r6, 0x1\n" + "\tlsls r0, 24\n" + "\tlsrs r6, r0, 24\n" + "\tldr r0, [sp, 0x4]\n" + "\tcmp r6, r0\n" + "\tbcc _080FFF26\n" + "\tb _08100024\n" + "\t.align 2, 0\n" + "_080FFF9C: .4byte gTasks\n" + "_080FFFA0:\n" + "\tmov r3, r10\n" + "\tlsls r1, r3, 2\n" + "\tadds r0, r1, r3\n" + "\tlsls r0, 3\n" + "\tadds r0, r2\n" + "\tldrh r0, [r0, 0xA]\n" + "\tmov r9, r0\n" + "\tmovs r7, 0\n" + "\tstr r1, [sp, 0x1C]\n" + "\tldr r0, [sp, 0x8]\n" + "\tcmp r7, r0\n" + "\tbcs _08100024\n" + "\tadds r6, r2, 0\n" + "\tmov r1, r9\n" + "\tlsls r1, 16\n" + "\tstr r1, [sp, 0x20]\n" + "_080FFFC0:\n" + "\tldr r0, [sp, 0x1C]\n" + "\tadd r0, r10\n" + "\tlsls r0, 3\n" + "\tadds r0, r6\n" + "\tldrh r0, [r0, 0x8]\n" + "\tadds r0, r7\n" + "\tlsls r0, 16\n" + "\tlsrs r5, r0, 16\n" + "\tasrs r0, 16\n" + "\tmov r2, r9\n" + "\tlsls r1, r2, 16\n" + "\tasrs r1, 16\n" + "\tbl MapGridGetMetatileBehaviorAt\n" + "\tlsls r0, 24\n" + "\tlsrs r4, r0, 24\n" + "\tldr r3, [sp]\n" + "\tldrb r0, [r3, 0x12]\n" + "\tcmp r0, 0x5\n" + "\tbne _080FFFF8\n" + "_080FFFE8:\n" + "\tadds r0, r4, 0\n" + "\tbl sub_80572EC\n" + "\tlsls r0, 24\n" + "\tcmp r0, 0\n" + "\tbne _08100004\n" + "_080FFFF4:\n" + "\tmovs r0, 0\n" + "\tb _08100026\n" + "_080FFFF8:\n" + "\tadds r0, r4, 0\n" + "\tbl sub_80572D8\n" + "\tlsls r0, 24\n" + "\tcmp r0, 0\n" + "\tbeq _080FFFE8\n" + "_08100004:\n" + "\tadds r0, r5, 0\n" + "\tldr r2, [sp, 0x20]\n" + "\tlsrs r1, r2, 16\n" + "\tmovs r2, 0\n" + "\tbl GetFieldObjectIdByXYZ\n" + "\tlsls r0, 24\n" + "\tlsrs r0, 24\n" + "\tcmp r0, 0x10\n" + "\tbne _080FFFF4\n" + "\tadds r0, r7, 0x1\n" + "\tlsls r0, 24\n" + "\tlsrs r7, r0, 24\n" + "\tldr r3, [sp, 0x8]\n" + "\tcmp r7, r3\n" + "\tbcc _080FFFC0\n" + "_08100024:\n" + "\tmovs r0, 0x1\n" + "_08100026:\n" + "\tadd sp, 0x24\n" + "\tpop {r3-r5}\n" + "\tmov r8, r3\n" + "\tmov r9, r4\n" + "\tmov r10, r5\n" + "\tpop {r4-r7}\n" + "\tpop {r1}\n" + "\tbx r1\n" + ".syntax divided\n"); +} + +#endif -- cgit v1.2.3 From d0c276a0d89703dd42683ba392f467336be0b78d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 3 Jun 2017 19:44:08 -0400 Subject: Several smaller functions in decoration.s --- src/decoration.c | 162 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 161 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 63fe83b48..a001ffba9 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -5,6 +5,7 @@ #include "songs.h" #include "string_util.h" #include "menu.h" +#include "menu_helpers.h" #include "strings.h" #include "script.h" #include "palette.h" @@ -1636,5 +1637,164 @@ bool8 sub_80FFC24(u8 taskId, struct Decoration *decoration) "\tbx r1\n" ".syntax divided\n"); } - #endif + +void sub_8100038(u8 taskId) +{ + if (sub_80FFC24(taskId, &gDecorations[gUnknown_020388D0[gUnknown_020388F5]]) == 1) + { + DisplayItemMessageOnField(taskId, gSecretBaseText_PlaceItHere, sub_81000A0, 0); + } else + { + PlaySE(SE_HAZURE); + DisplayItemMessageOnField(taskId, gSecretBaseText_CantBePlacedHere, sub_81006A8, 0); + } +} + +void sub_81000A0(u8 taskId) +{ + DisplayYesNoMenu(20, 8, 1); + sub_80F914C(taskId, &gUnknown_083EC95C); +} + +void sub_81000C4(u8 taskId) +{ + MenuZeroFillWindowRect(0, 0, 29, 19); + sub_8100174(taskId); + if (gDecorations[gUnknown_020388D0[gUnknown_020388F5]].decor_field_11 != 4) + { + sub_80FF394(gTasks[taskId].data[0], gTasks[taskId].data[1], gUnknown_020388D0[gUnknown_020388F5]); + } else + { + gUnknown_020391A4 = gTasks[taskId].data[0] - 7; + gUnknown_020391A6 = gTasks[taskId].data[1] - 7; + ScriptContext1_SetupScript(gUnknown_081A2F7B); + } + gSprites[gUnknown_020391A8].pos1.y += 2; + sub_810028C(taskId); +} + +void sub_8100174(u8 taskId) +{ + u16 i; + for (i=0; i= gMapHeader.mapData->height) + { + data[1]--; + return FALSE; + } else if (gUnknown_020391AA == DIR_WEST && data[0] - 7 < 0) + { + data[0]++; + return FALSE; + } else if (gUnknown_020391AA == DIR_EAST && data[0] + data[5] - 8 >= gMapHeader.mapData->width) + { + data[0]--; + return FALSE; + } + return TRUE; +} + +bool8 sub_8100430(void) +{ + if ((gMain.heldKeys & 0xF0) != DPAD_UP && (gMain.heldKeys & 0xF0) != DPAD_DOWN && (gMain.heldKeys & 0xF0) != DPAD_LEFT && (gMain.heldKeys & 0xF0) != DPAD_RIGHT) + { + return FALSE; + } + return TRUE; +} -- cgit v1.2.3 From 88181cf35b084689ee6b1a2dd2bdd4b32cbd4e80 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 3 Jun 2017 21:42:43 -0400 Subject: sub_8100494 --- src/decoration.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index a001ffba9..5387ad27d 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -1792,9 +1792,80 @@ bool8 sub_810038C(u8 taskId) bool8 sub_8100430(void) { - if ((gMain.heldKeys & 0xF0) != DPAD_UP && (gMain.heldKeys & 0xF0) != DPAD_DOWN && (gMain.heldKeys & 0xF0) != DPAD_LEFT && (gMain.heldKeys & 0xF0) != DPAD_RIGHT) + if ((gMain.heldKeys & DPAD_ANY) != DPAD_UP && (gMain.heldKeys & DPAD_ANY) != DPAD_DOWN && (gMain.heldKeys & DPAD_ANY) != DPAD_LEFT && (gMain.heldKeys & DPAD_ANY) != DPAD_RIGHT) { return FALSE; } return TRUE; } + +void sub_810045C(void) +{ + gUnknown_020391AA = 0; + gSprites[gUnknown_020391A8].data2 = 0; + gSprites[gUnknown_020391A8].data3 = 0; +} + +void sub_8100494(u8 taskId) +{ + if (!gSprites[gUnknown_020391A8].data4) + { + if (gTasks[taskId].data[10] == 1) + { + gUnknown_083EC96C[gTasks[taskId].data[12]][0](taskId); + return; + } else if (gTasks[taskId].data[10] == 2) + { + gUnknown_083EC96C[gTasks[taskId].data[12]][1](taskId); + return; + } + if ((gMain.heldKeys & DPAD_ANY) == DPAD_UP) + { + gUnknown_020391AA = DIR_SOUTH; + gSprites[gUnknown_020391A8].data2 = 0; + gSprites[gUnknown_020391A8].data3 = -2; + gTasks[taskId].data[1]--; + } + if ((gMain.heldKeys & DPAD_ANY) == DPAD_DOWN) + { + gUnknown_020391AA = DIR_NORTH; + gSprites[gUnknown_020391A8].data2 = 0; + gSprites[gUnknown_020391A8].data3 = 2; + gTasks[taskId].data[1]++; + } + if ((gMain.heldKeys & DPAD_ANY) == DPAD_LEFT) + { + gUnknown_020391AA = DIR_WEST; + gSprites[gUnknown_020391A8].data2 = -2; + gSprites[gUnknown_020391A8].data3 = 0; + gTasks[taskId].data[0]--; + } + if ((gMain.heldKeys & DPAD_ANY) == DPAD_RIGHT) + { + gUnknown_020391AA = DIR_EAST; + gSprites[gUnknown_020391A8].data2 = 2; + gSprites[gUnknown_020391A8].data3 = 0; + gTasks[taskId].data[0]++; + } + if (!sub_8100430() || !sub_810038C(taskId)) + { + sub_810045C(); + } + } + if (gUnknown_020391AA) + { + gSprites[gUnknown_020391A8].data4++; + gSprites[gUnknown_020391A8].data4 &= 7; + } + if (!gTasks[taskId].data[10]) + { + if (gMain.newKeys & A_BUTTON) + { + gTasks[taskId].data[10] = A_BUTTON; + } + if (gMain.newKeys & B_BUTTON) + { + gTasks[taskId].data[10] = B_BUTTON; + } + } +} -- cgit v1.2.3 From 82373556f8ff16a6b532011c04c9128be814d160 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 3 Jun 2017 22:12:23 -0400 Subject: Another set of small subroutines in decoration --- src/decoration.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 5387ad27d..58537ec0e 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -1869,3 +1869,41 @@ void sub_8100494(u8 taskId) } } } + +void sub_810065C(u8 taskId) +{ + MenuZeroFillWindowRect(0, 0, 29, 19); + gSprites[gUnknown_020391A8].data7 = 0; + gTasks[taskId].data[10] = 0; + gTasks[taskId].func = sub_8100494; +} + +void sub_81006A8(u8 taskId) +{ + if ((gMain.newKeys & A_BUTTON) || (gMain.newKeys & B_BUTTON)) + { + sub_810065C(taskId); + } +} + +void sub_81006D0(struct UnkStruct_02038900 *unk_02038900) +{ + u16 i; + for (i=0; i<0x800; i++) + { + unk_02038900->unk_084[i] = 0; + } + for (i=0; i<0x40; i++) + { + unk_02038900->unk_004[i] = 0; + } +} + +void sub_810070C(u16 *a0, u16 a1) +{ + u16 i; + for (i=0; i<16; i++) + { + a0[i] = ((u16 *)gMapHeader.mapData->primaryTileset->palettes)[16 * a1 + i]; + } +} -- cgit v1.2.3 From ae417f7590829d6018cd80e02364834dedd88fe4 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 4 Jun 2017 09:31:44 -0400 Subject: sub_8100740 --- src/decoration.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 58537ec0e..3dd3d4dd3 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -1907,3 +1907,52 @@ void sub_810070C(u16 *a0, u16 a1) a0[i] = ((u16 *)gMapHeader.mapData->primaryTileset->palettes)[16 * a1 + i]; } } + +void sub_8100740(u8 *dest, u16 flags) +{ + u8 buffer[32]; + u16 mode; + u16 i; + mode = flags >> 10; + if (flags != 0) + { + flags &= 0x3ff; + } + for (i=0; i<32; i++) + { + buffer[i] = ((u8 *)gMapHeader.mapData->primaryTileset->tiles)[flags * 32 + i]; + } + switch (mode) + { + case 0: + for (i=0; i<32; i++) + { + dest[i] = buffer[i]; + } + break; + case 1: + for (i=0; i<8; i++) + { + dest[4*i] = (buffer[4*(i+1) - 1] >> 4) + ((buffer[4*(i+1) - 1] & 0xf) << 4); + dest[4*i + 1] = (buffer[4*(i+1) - 2] >> 4) + ((buffer[4*(i+1) - 2] & 0xf) << 4); + dest[4*i + 2] = (buffer[4*(i+1) - 3] >> 4) + ((buffer[4*(i+1) - 3] & 0xf) << 4); + dest[4*i + 3] = (buffer[4*(i+1) - 4] >> 4) + ((buffer[4*(i+1) - 4] & 0xf) << 4); + } + break; + case 2: + for (i=0; i<8; i++) + { + dest[4*i] = buffer[4*(7-i)]; + dest[4*i + 1] = buffer[4*(7-i) + 1]; + dest[4*i + 2] = buffer[4*(7-i) + 2]; + dest[4*i + 3] = buffer[4*(7-i) + 3]; + } + break; + case 3: + for (i=0; i<32; i++) + { + dest[i] = (buffer[31-i] >> 4) + ((buffer[31-i] & 0xf) << 4); + } + break; + } +} -- cgit v1.2.3 From d53b7d3b2eb17cc6e7973b50f460709df658bad5 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 4 Jun 2017 09:37:56 -0400 Subject: A couple more small functions in decoration.s --- src/decoration.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 3dd3d4dd3..eed0f9f67 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -1956,3 +1956,15 @@ void sub_8100740(u8 *dest, u16 flags) break; } } + +void sub_8100874(struct UnkStruct_02038900 *unk_02038900) +{ + u16 i; + for (i=0; i<0x40; i++) + sub_8100740(&unk_02038900->unk_084[i * 32], unk_02038900->unk_004[i]); +} + +u16 sub_810089C(u16 a0) +{ + return ((u16 *)gMapHeader.mapData->secondaryTileset->metatiles)[a0] & 0xfff; +} -- cgit v1.2.3 From 54c74220e6f53ef0fd4fdb25f58c0196c809f840 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 4 Jun 2017 09:59:07 -0400 Subject: sub_81008BC --- src/decoration.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index eed0f9f67..f3a9df367 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -1968,3 +1968,14 @@ u16 sub_810089C(u16 a0) { return ((u16 *)gMapHeader.mapData->secondaryTileset->metatiles)[a0] & 0xfff; } + +void sub_81008BC(struct UnkStruct_02038900 *unk_02038900) +{ + u8 i; + u8 idx; + idx = unk_02038900->decoration->decor_field_12; + for (i=0; iunk_004[gUnknown_083EC860[idx].var0[i]] = sub_810089C(unk_02038900->decoration->tiles[gUnknown_083EC860[idx].var4[i]] * 8 + gUnknown_083EC860[idx].var8[i]); + } +} -- cgit v1.2.3 From d0e72abccfe15f0d120d3f5811f893fbddde0aa6 Mon Sep 17 00:00:00 2001 From: scnorton Date: Sun, 4 Jun 2017 13:34:33 -0400 Subject: A couple more functions in decoration.s --- src/decoration.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index f3a9df367..7c92ca696 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -1979,3 +1979,94 @@ void sub_81008BC(struct UnkStruct_02038900 *unk_02038900) unk_02038900->unk_004[gUnknown_083EC860[idx].var0[i]] = sub_810089C(unk_02038900->decoration->tiles[gUnknown_083EC860[idx].var4[i]] * 8 + gUnknown_083EC860[idx].var8[i]); } } + +void sub_8100930(u8 unk12) +/* + * This function sets an OAM object not directly referenced anywhere else + * in the source. + */ +{ + gUnknown_020391AC.y = 0; + gUnknown_020391AC.affineMode = 0; + gUnknown_020391AC.objMode = 0; + gUnknown_020391AC.mosaic = 0; + gUnknown_020391AC.bpp = 0; + gUnknown_020391AC.shape = gUnknown_083EC900[unk12].unk_0; + gUnknown_020391AC.x = 0; + gUnknown_020391AC.matrixNum = 0; + gUnknown_020391AC.size = gUnknown_083EC900[unk12].unk_1; + gUnknown_020391AC.tileNum = 0; + gUnknown_020391AC.priority = 1; + gUnknown_020391AC.paletteNum = 0; +} + +void sub_81009A8(struct Sprite *sprite) +{ + sprite->data2 = 0; + sprite->data3 = 0; + sprite->data4 = 0; + sprite->data5 = 0; + sprite->data6 = 0; + sprite->data7 = 0; + sprite->callback = sub_81009C0; +} + +void sub_81009C0(struct Sprite *sprite) +{ + if (sprite->data7 == 0) + { + if (sprite->data6 < 15) + { + sprite->invisible = 0; + } else + { + sprite->invisible = 1; + } + sprite->data6 = (sprite->data6 + 1) & 0x1f; + } else + { + sprite->invisible = 0; + } +} + +void sub_8100A0C(u8 taskId) +{ + if (sub_8100D38(taskId) == 1) + { + fade_screen(1, 0); + gTasks[taskId].data[2] = 0; + gTasks[taskId].func = sub_8100E70; + } else + { + DisplayItemMessageOnField(taskId, gSecretBaseText_NoDecorInUse, sub_80FE428, 0); + } +} + +void sub_8100A60(u8 a0) +{ + ewram_1f000.items[a0] = 0; + ewram_1f000.pos[a0] = 0; +} + +void sub_8100A7C(void) +{ + u16 i; + gSpecialVar_0x8005 = 0; + gScriptResult = 0; + if (gSpecialVar_0x8004 == gUnknown_02039234) + { + gScriptResult = 1; + } else if (gDecorations[ewram_1f000.items[gUnknown_020391B4[gSpecialVar_0x8004].var00]].decor_field_11 == 4) + { + gSpecialVar_0x8005 = gUnknown_020391B4[gSpecialVar_0x8004].var04; + sub_8100A60(gUnknown_020391B4[gSpecialVar_0x8004].var00); + for (i=0; imapObjectCount; i++) + { + if (gMapHeader.events->mapObjects[i].flagId == gSpecialVar_0x8005) + { + gSpecialVar_0x8006 = gMapHeader.events->mapObjects[i].localId; + break; + } + } + } +} -- cgit v1.2.3 From be3833002afbd5e38bbcd11a5d410af400783173 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 4 Jun 2017 17:33:42 -0400 Subject: sub_8100B6C --- src/decoration.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 7c92ca696..c5c9b6b6d 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -2070,3 +2070,47 @@ void sub_8100A7C(void) } } } + +void sub_8100B20(void) +{ + u8 i; + for (i=0; imapObjectCount; i++) + { + if (gMapHeader.events->mapObjects[i].flagId == gSpecialVar_0x8004) + { + gSpecialVar_0x8005 = gMapHeader.events->mapObjects[i].localId; + break; + } + } +} + +void sub_8100B6C(void) +{ + u8 i; + u8 j; + u8 k; + u8 x; + u8 y; + u8 unk11; + for (i=0; i> 4; + y = ewram_1f000.pos[gUnknown_020391B4[i].var00] & 0xf; + if (unk11 != 4) + { + if (ewram_1f000.items[gUnknown_020391B4[i].var00] == DECOR_SAND_ORNAMENT && MapGridGetMetatileIdAt(x + 7, y + 7) == 0x28c) + { + gUnknown_020391B4[i].var02++; + } + for (j=0; jmap)[(x + k) + gMapHeader.mapData->width * (y - j)] | 0x3000); + } + } + sub_8100A60(gUnknown_020391B4[i].var00); + } + } +} -- cgit v1.2.3 From 7e8308fbd3fb19e096ca5072c5c5591e096fadd8 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 4 Jun 2017 17:47:55 -0400 Subject: sub_8100C88 --- src/decoration.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index c5c9b6b6d..6e8ba51e3 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -2114,3 +2114,36 @@ void sub_8100B6C(void) } } } + +void sub_8100C88(u8 taskId) +{ + switch (gTasks[taskId].data[2]) + { + case 0: + sub_8100B6C(); + gTasks[taskId].data[2] = 1; + break; + case 1: + if (!gPaletteFade.active) + { + DrawWholeMapView(); + ScriptContext1_SetupScript(gUnknown_081A2F8A); + MenuZeroFillWindowRect(0, 0, 29, 19); + gTasks[taskId].data[2] = 2; + } + break; + case 2: + ScriptContext2_Enable(); + sub_80FED90(taskId); + pal_fill_black(); + gTasks[taskId].data[2] = 3; + break; + case 3: + if (sub_807D770() == 1) + { + gTasks[taskId].data[13] = -1; + DisplayItemMessageOnField(taskId, gSecretBaseText_DecorReturned, sub_81010F0, 0); + } + break; + } +} -- cgit v1.2.3 From 9b0018cab96f924c040d0b2062481c91f0e7c09b Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 4 Jun 2017 18:09:15 -0400 Subject: SetUpPuttingAwayDecorationPlayerAvatar and some related functions --- src/decoration.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 6e8ba51e3..5f5c9eace 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -2147,3 +2147,68 @@ void sub_8100C88(u8 taskId) break; } } + +bool8 sub_8100D38(u8 taskId) +{ + u16 i; + for (i=0; i Date: Sun, 4 Jun 2017 19:05:33 -0400 Subject: Up through sub_8101200 --- src/decoration.c | 135 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 5f5c9eace..6b4a359e2 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -2212,3 +2212,138 @@ void sub_8100E70(u8 taskId) break; } } + +void sub_8100EEC(u8 taskId) +{ + MenuZeroFillWindowRect(0, 0, 29, 19); + gSprites[gUnknown_020391A8].data7 = 0; + gSprites[gUnknown_020391A8].invisible = 0; + gSprites[gUnknown_020391A8].callback = sub_8101698; + gSprites[gUnknown_020391A9].pos1.x = 0x88; + gSprites[gUnknown_020391A9].pos1.y = 0x48; + gTasks[taskId].data[10] = 0; + gTasks[taskId].func = sub_8100494; +} + +void sub_8100F88(u8 taskId) +{ + gTasks[taskId].data[10] = 0; + sub_810045C(); + sub_8101024(taskId); +} + +void sub_8100FB4(u8 taskId) +{ + gTasks[taskId].data[10] = 0; + sub_810045C(); + gSprites[gUnknown_020391A8].invisible = 0; + gSprites[gUnknown_020391A8].callback = SpriteCallbackDummy; + DisplayItemMessageOnField(taskId, gSecretBaseText_StopPuttingAwayDecor, sub_810156C, 0); +} + +void sub_8101024(u8 taskId) +{ + u8 mtBehavior; + s16 *data; + sub_8101460(taskId); + if (gUnknown_02039234 != 0) + { + DisplayItemMessageOnField(taskId, gSecretBaseText_ReturnDecor, sub_8101518, 0); + } else + { + data = gTasks[taskId].data; + mtBehavior = MapGridGetMetatileBehaviorAt(data[0], data[1]); + if (MetatileBehavior_IsSecretBasePC(mtBehavior) == TRUE || sub_805738C(mtBehavior) == TRUE) + { + gSprites[gUnknown_020391A8].invisible = 0; + gSprites[gUnknown_020391A8].callback = SpriteCallbackDummy; + DisplayItemMessageOnField(taskId, gSecretBaseText_StopPuttingAwayDecor, sub_810156C, 0); + } else + { + DisplayItemMessageOnField(taskId, gSecretBaseText_NoDecor, sub_81010F0, 0); + } + } +} + +void sub_81010F0(u8 taskId) +{ + if ((gMain.newKeys & A_BUTTON) || (gMain.newKeys & B_BUTTON)) + { + sub_8100EEC(taskId); + } +} + +void sub_8101118(u8 decorIdx, struct UnkStruct_020391B4 *unk_020391B4) +{ + if (gDecorations[decorIdx].decor_field_12 == 0) + { + unk_020391B4->var01 = 1; + unk_020391B4->var02 = 1; + } else if (gDecorations[decorIdx].decor_field_12 == 1) + { + unk_020391B4->var01 = 2; + unk_020391B4->var02 = 1; + } else if (gDecorations[decorIdx].decor_field_12 == 2) + { + unk_020391B4->var01 = 3; + unk_020391B4->var02 = 1; + } else if (gDecorations[decorIdx].decor_field_12 == 3) + { + unk_020391B4->var01 = 4; + unk_020391B4->var02 = 2; + } else if (gDecorations[decorIdx].decor_field_12 == 4) + { + unk_020391B4->var01 = 2; + unk_020391B4->var02 = 2; + } else if (gDecorations[decorIdx].decor_field_12 == 5) + { + unk_020391B4->var01 = 1; + unk_020391B4->var02 = 2; + } else if (gDecorations[decorIdx].decor_field_12 == 6) + { + unk_020391B4->var01 = 1; + unk_020391B4->var02 = 3; + } else if (gDecorations[decorIdx].decor_field_12 == 7) + { + unk_020391B4->var01 = 2; + unk_020391B4->var02 = 4; + } else if (gDecorations[decorIdx].decor_field_12 == 8) + { + unk_020391B4->var01 = 3; + unk_020391B4->var02 = 3; + } else if (gDecorations[decorIdx].decor_field_12 == 9) + { + unk_020391B4->var01 = 3; + unk_020391B4->var02 = 2; + } +} + +void sub_8101198(u8 x, u8 y) +{ + gSprites[gUnknown_020391A8].invisible = 1; + gSprites[gUnknown_020391A8].callback = SpriteCallbackDummy; + gSprites[gUnknown_020391A9].pos1.x = 0x88 + x * 16; + gSprites[gUnknown_020391A9].pos1.y = 0x48 + y * 16; +} + +bool8 sub_8101200(u8 taskId, u8 decorIdx, struct UnkStruct_020391B4 *unk_020391B4) +{ + u8 x; + u8 y; + u8 xOff; + u8 yOff; + x = gTasks[taskId].data[0] - 7; + y = gTasks[taskId].data[1] - 7; + xOff = ewram_1f000.pos[decorIdx] >> 4; + yOff = ewram_1f000.pos[decorIdx] & 0xf; + if (ewram_1f000.items[decorIdx] == DECOR_SAND_ORNAMENT && MapGridGetMetatileIdAt(xOff + 7, yOff + 7) == 0x28c) + { + unk_020391B4->var02--; + } + if (x >= xOff && x < xOff + unk_020391B4->var01 && y > yOff - unk_020391B4->var02 && y <= yOff) + { + sub_8101198(unk_020391B4->var01 - (x - xOff + 1), yOff - y); + return TRUE; + } + return FALSE; +} -- cgit v1.2.3 From 31622bd5e5d811cedfbb29da8d10b6c036e54ea6 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 5 Jun 2017 08:41:09 -0400 Subject: nonmatching sub_8101460, and a few functions beyond --- src/decoration.c | 218 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 218 insertions(+) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 6b4a359e2..3c33d9a0b 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -2347,3 +2347,221 @@ bool8 sub_8101200(u8 taskId, u8 decorIdx, struct UnkStruct_020391B4 *unk_020391B } return FALSE; } + +void sub_81012A0(void) +{ + u8 xOff; + u8 yOff; + u16 i; + xOff = ewram_1f000.pos[gUnknown_020391B4[gUnknown_02039234].var00] >> 4; + yOff = ewram_1f000.pos[gUnknown_020391B4[gUnknown_02039234].var00] & 0xf; + for (i=0; i<0x40; i++) + { + if (gSaveBlock1.mapObjectTemplates[i].x == xOff && gSaveBlock1.mapObjectTemplates[i].y == yOff && !FlagGet(gSaveBlock1.mapObjectTemplates[i].flagId)) + { + gUnknown_020391B4[gUnknown_02039234].var04 = gSaveBlock1.mapObjectTemplates[i].flagId; + break; + } + } +} + +bool8 sub_8101340(u8 taskId) +{ + u16 i; + for (i=0; ivar00 = i; + sub_81012A0(); + gUnknown_02039234 = 1; + return TRUE; + } + } + } + } + return FALSE; +} + +void sub_81013B8(u8 a0, u8 a1, u8 a2, u8 a3) +{ + u8 i; + u8 xOff; + u8 yOff; + u8 decorIdx; + for (i=0; i> 4; + yOff = ewram_1f000.pos[i] & 0xf; + if (decorIdx != 0 && gDecorations[decorIdx].decor_field_11 == 4 && a0 <= xOff && a1 <= yOff && a2 >= xOff && a3 >= yOff) + { + gUnknown_020391B4[gUnknown_02039234].var00 = i; + sub_81012A0(); + gUnknown_02039234++; + } + } +} + +#ifdef NONMATCHING +void sub_8101460(u8 taskId) +{ + u8 i; + u8 xOff; + u8 yOff; + gUnknown_02039234 = 0; + if (sub_8101340(taskId) != TRUE) + { + for (i=0; i> 4; + yOff = ewram_1f000.pos[gUnknown_020391B4[0].var00] & 0xf; + sub_81013B8(xOff, yOff - gUnknown_020391B4[0].var02 + 1, xOff + gUnknown_020391B4[0].var01 - 1, yOff); + } + } +} +#else +__attribute__((naked)) + +void sub_8101460(u8 taskId) +{ + asm(".syntax unified\n" + "\tpush {r4-r7,lr}\n" + "\tlsls r0, 24\n" + "\tlsrs r6, r0, 24\n" + "\tldr r4, _081014B8 @ =gUnknown_02039234\n" + "\tmovs r0, 0\n" + "\tstrb r0, [r4]\n" + "\tadds r0, r6, 0\n" + "\tbl sub_8101340\n" + "\tlsls r0, 24\n" + "\tlsrs r0, 24\n" + "\tcmp r0, 0x1\n" + "\tbeq _08101504\n" + "\tmovs r5, 0\n" + "\tldr r0, _081014BC @ =ewram_1f000\n" + "\tldrb r1, [r0, 0x8]\n" + "\tcmp r5, r1\n" + "\tbcs _081014D2\n" + "\tadds r7, r4, 0\n" + "_08101486:\n" + "\tldr r0, [r0]\n" + "\tadds r0, r5\n" + "\tldrb r1, [r0] @ compiler incorrectly uses r0 for this and the next instruction\n" + "\tcmp r1, 0\n" + "\tbeq _081014C4\n" + "\tldr r4, _081014C0 @ =gUnknown_020391B4\n" + "\tadds r0, r1, 0\n" + "\tadds r1, r4, 0\n" + "\tbl sub_8101118\n" + "\tadds r0, r6, 0\n" + "\tadds r1, r5, 0\n" + "\tadds r2, r4, 0\n" + "\tbl sub_8101200\n" + "\tlsls r0, 24\n" + "\tlsrs r0, 24\n" + "\tcmp r0, 0x1\n" + "\tbne _081014C4\n" + "\tstrb r5, [r4]\n" + "\tldrb r0, [r7]\n" + "\tadds r0, 0x1\n" + "\tstrb r0, [r7]\n" + "\tb _081014D2\n" + "\t.align 2, 0\n" + "_081014B8: .4byte gUnknown_02039234\n" + "_081014BC: .4byte 0x201f000\n" + "_081014C0: .4byte gUnknown_020391B4\n" + "_081014C4:\n" + "\tadds r0, r5, 0x1\n" + "\tlsls r0, 24\n" + "\tlsrs r5, r0, 24\n" + "\tldr r0, _0810150C @ =ewram_1f000\n" + "\tldrb r1, [r0, 0x8]\n" + "\tcmp r5, r1\n" + "\tbcc _08101486\n" + "_081014D2:\n" + "\tldr r0, _08101510 @ =gUnknown_02039234\n" + "\tldrb r0, [r0]\n" + "\tcmp r0, 0\n" + "\tbeq _08101504\n" + "\tldr r0, _0810150C @ =ewram_1f000\n" + "\tldr r2, _08101514 @ =gUnknown_020391B4\n" + "\tldrb r1, [r2]\n" + "\tldr r0, [r0, 0x4]\n" + "\tadds r0, r1\n" + "\tldrb r1, [r0]\n" + "\tlsrs r0, r1, 4\n" + "\tmovs r3, 0xF\n" + "\tands r3, r1\n" + "\tldrb r1, [r2, 0x2]\n" + "\tsubs r1, r3, r1\n" + "\tadds r1, 0x1\n" + "\tlsls r1, 24\n" + "\tlsrs r1, 24\n" + "\tldrb r2, [r2, 0x1]\n" + "\tadds r2, r0\n" + "\tsubs r2, 0x1\n" + "\tlsls r2, 24\n" + "\tlsrs r2, 24\n" + "\tbl sub_81013B8\n" + "_08101504:\n" + "\tpop {r4-r7}\n" + "\tpop {r0}\n" + "\tbx r0\n" + "\t.align 2, 0\n" + "_0810150C: .4byte 0x201f000\n" + "_08101510: .4byte gUnknown_02039234\n" + "_08101514: .4byte gUnknown_020391B4\n" + ".syntax divided\n"); +} +#endif + +void sub_8101518(u8 taskId) +{ + DisplayYesNoMenu(20, 8, 1); + sub_80F914C(taskId, &gUnknown_083EC9CC); +} + +void sub_810153C(u8 taskId) +{ + fade_screen(1, 0); + gTasks[taskId].data[2] = 0; + gTasks[taskId].func = sub_8100C88; +} + +void sub_810156C(u8 taskId) +{ + DisplayYesNoMenu(20, 8, 1); + sub_80F914C(taskId, &gUnknown_083EC9D4); +} + +void sub_8101590(u8 taskId) +{ + MenuZeroFillWindowRect(0, 0, 29, 19); + sub_81015B0(taskId); +} + +void sub_81015B0(u8 taskId) +{ + fade_screen(1, 0); + gTasks[taskId].data[2] = 0; + gTasks[taskId].func = sub_81015E0; +} -- cgit v1.2.3 From ba6ba4ff2c323559f4534edc12c68a1eafdb5cb4 Mon Sep 17 00:00:00 2001 From: scnorton Date: Mon, 5 Jun 2017 10:04:16 -0400 Subject: Delete asm/decoration.s, having completed its decompilation aside from two non-matching functions --- src/decoration.c | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/secret_base.c | 5 +-- 2 files changed, 122 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 3c33d9a0b..729f14280 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -2565,3 +2565,123 @@ void sub_81015B0(u8 taskId) gTasks[taskId].data[2] = 0; gTasks[taskId].func = sub_81015E0; } + +void sub_81015E0(u8 taskId) +{ + switch (gTasks[taskId].data[2]) + { + case 0: + if (!gPaletteFade.active) + { + sub_80FF114(taskId); + gTasks[taskId].data[2] = 1; + } + break; + case 1: + sub_81016F4(); + gUnknown_0300485C = sub_8101678; + SetMainCallback2(c2_exit_to_overworld_2_switch); + DestroyTask(taskId); + break; + } +} + +void sub_8101648(u8 taskId) +{ + if (sub_807D770() == TRUE) + { + gTasks[taskId].func = Task_DecorationPCProcessMenuInput; + } +} + +void sub_8101678(void) +{ + pal_fill_black(); + MenuDisplayMessageBox(); + sub_80FE220(); + CreateTask(sub_8101648, 8); +} + +void sub_8101698(struct Sprite *sprite) +{ + sprite->data0 = (sprite->data0 + 1) & 0x1f; + if (sprite->data0 >= 16) + { + sprite->invisible = TRUE; + } else + { + sprite->invisible = FALSE; + } +} + +void sub_81016C8(void) +{ + if (gSaveBlock2.playerGender == MALE) + { + LoadSpritePalette(&gUnknown_083ECA5C); + } else + { + LoadSpritePalette(&gUnknown_083ECA64); + } +} + +void sub_81016F4(void) +{ + FreeSpritePaletteByTag(8); +} + +void sub_8101700(u8 taskId) +{ + if (!sub_81341D4()) + { + DisplayItemMessageOnField(taskId, gSecretBaseText_NoDecors, sub_80FE428, 0); + } else + { + gTasks[taskId].data[11] = 1; + gUnknown_020388F6 = 0; + sub_80FE5AC(taskId); + } +} + +void sub_8101750(u8 taskId) +{ + if (!sub_81341D4()) + { + DisplayItemMessageOnField(taskId, gSecretBaseText_NoDecors, sub_80FE428, 0); + } else + { + gTasks[taskId].data[11] = 2; + gUnknown_020388F6 = 0; + sub_80FE5AC(taskId); + } +} + +void sub_81017A0(u8 taskId) +{ + sub_80FEF74(); + sub_80FED1C(); + if (sub_80FEFA4() == TRUE) + { + StringCopy(gStringVar1, gDecorations[gUnknown_020388D0[gUnknown_020388F5]].name); + StringExpandPlaceholders(gStringVar4, gSecretBaseText_WillBeDiscarded); + DisplayItemMessageOnField(taskId, gStringVar4, sub_8101824, 0); + } else + { + DisplayItemMessageOnField(taskId, gSecretBaseText_DecorInUse, sub_80FEFF4, 0); + } +} + +void sub_8101824(u8 taskId) +{ + DisplayYesNoMenu(20, 8, 1); + sub_80F914C(taskId, &gUnknown_083ECAA0); +} + +void sub_8101848(u8 taskId) +{ + MenuZeroFillWindowRect(20, 8, 26, 14); + sub_8109A30(gUnknown_020388D0[gUnknown_020388F5]); + gUnknown_020388D0[gUnknown_020388F5] = DECOR_NONE; + sub_80FF098(taskId); + DisplayItemMessageOnField(taskId, gSecretBaseText_DecorThrownAway, sub_80FEFF4, 0); +} diff --git a/src/secret_base.c b/src/secret_base.c index c210a55d2..4ff0b6b17 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -12,10 +12,11 @@ #include "map_constants.h" #include "task.h" #include "palette.h" -#include "decoration.h" #include "field_weather.h" #include "metatile_behavior.h" #include "pokemon.h" +#include "script.h" +#include "decoration.h" extern u8 gUnknown_020387DC; extern u16 gSpecialVar_0x8004; @@ -29,8 +30,6 @@ extern const struct u16 unk_083D1358_1; } gUnknown_083D1358[7]; extern const u8 gUnknown_083D1374[4 * 16]; -extern void *gUnknown_0300485C; -extern const u8 sub_807D770(void); extern const u8 gUnknown_083D13EC[12]; extern const u8 sub_80BCCA4(u8); extern u8 gUnknown_081A2E14[]; -- cgit v1.2.3 From 454d7bbdd7ee6c5cb61680da855755869662968f Mon Sep 17 00:00:00 2001 From: scnorton Date: Mon, 5 Jun 2017 10:58:50 -0400 Subject: Decompile asm/decoration_inventory.s --- src/decoration_inventory.c | 156 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 src/decoration_inventory.c (limited to 'src') diff --git a/src/decoration_inventory.c b/src/decoration_inventory.c new file mode 100644 index 000000000..a483629b1 --- /dev/null +++ b/src/decoration_inventory.c @@ -0,0 +1,156 @@ +// +// Created by Scott Norton on 6/5/17. +// + +#include "global.h" +#include "sprite.h" +#include "task.h" +#include "decoration.h" +#include "decoration_inventory.h" + +void ClearDecorationInventory(u8 invIdx) +{ + u8 i; + for (i=0; i gDecorationInventories[invIdx].items[j])) + { + tmp = gDecorationInventories[invIdx].items[i]; + gDecorationInventories[invIdx].items[i] = gDecorationInventories[invIdx].items[j]; + gDecorationInventories[invIdx].items[j] = tmp; + } + } + } +} + +u8 sub_8134194(u8 invIdx) +{ + u8 i; + u8 count; + count = 0; + for (i=0; i Date: Wed, 31 May 2017 08:40:15 -0400 Subject: Get sub_80C01D4 closer to matching --- src/tv.c | 104 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 52 insertions(+), 52 deletions(-) (limited to 'src') diff --git a/src/tv.c b/src/tv.c index 8352efb17..566d547a6 100755 --- a/src/tv.c +++ b/src/tv.c @@ -850,7 +850,7 @@ void sub_80BE320(void) { StringCopy(show->bravoTrainerTower.trainerName, gSaveBlock2.playerName); StringCopy(show->bravoTrainerTower.pokemonName, gSaveBlock2.filler_A8.filler_3DC); show->bravoTrainerTower.species = gSaveBlock2.filler_A8.var_480; - show->bravoTrainerTower.winningMove = gSaveBlock2.filler_A8.var_482; + show->bravoTrainerTower.defeatedSpecies = gSaveBlock2.filler_A8.var_482; show->bravoTrainerTower.var16 = sub_8135D3C(gSaveBlock2.filler_A8.var_4D0); show->bravoTrainerTower.var1c = gSaveBlock2.filler_A8.var_4AD; if (gSaveBlock2.filler_A8.var_4D0 == 0) { @@ -2454,54 +2454,54 @@ void sub_80C03A8(u8 showidx); void sub_80C03C8(u16 species, u8 showidx); #ifdef NONMATCHING -void sub_80C01D4(void) { - u8 i; - for (i=0; i<24; i++) { - switch (gSavegitBlock1.tvShows[i].common.var00) { - case 0: - break; - case TVSHOW_FAN_CLUB_LETTER: - sub_80C03C8(gSaveBlock1.tvShows[i].fanclubLetter.species, i); - break; - case TVSHOW_RECENT_HAPPENINGS: - break; - case TVSHOW_PKMN_FAN_CLUB_OPINIONS: - sub_80C03C8(gSaveBlock1.tvShows[i].fanclubOpinions.var02, i); - break; - case TVSHOW_UNKN_SHOWTYPE_04: - sub_80C03C8(gSaveBlock1.tvShows[i].worldOfMasters.var06, i); - break; - case TVSHOW_NAME_RATER_SHOW: - sub_80C03C8(gSaveBlock1.tvShows[i].nameRaterShow.species, i); - sub_80C03C8(gSaveBlock1.tvShows[i].nameRaterShow.var1C, i); - break; - case TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE: - sub_80C03C8(gSaveBlock1.tvShows[i].bravoTrainer.species, i); - break; - case TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE: - sub_80C03C8(gSaveBlock1.tvShows[i].bravoTrainerTower.var0a, i); - sub_80C03C8(gSaveBlock1.tvShows[i].bravoTrainerTower.var14, i); - break; - case TVSHOW_POKEMON_TODAY_CAUGHT: - sub_80C03C8(gSaveBlock1.tvShows[i].pokemonToday.species, i); - break; - case TVSHOW_SMART_SHOPPER: - break; - case TVSHOW_POKEMON_TODAY_FAILED: - sub_80C03C8(gSaveBlock1.tvShows[i].pokemonTodayFailed.species, i); - sub_80C03C8(gSaveBlock1.tvShows[i].pokemonTodayFailed.species2, i); - break; - case TVSHOW_FISHING_ADVICE: - sub_80C03C8(gSaveBlock1.tvShows[i].pokemonAngler.var04, i); - break; - case TVSHOW_WORLD_OF_MASTERS: - sub_80C03C8(gSaveBlock1.tvShows[i].worldOfMasters.var08, i); - sub_80C03C8(gSaveBlock1.tvShows[i].worldOfMasters.var04, i); - break; - case TVSHOW_MASS_OUTBREAK: - break; - default: - sub_80C03A8(i); +void sub_80C01D4(void) +{ + u16 i; + for (i=0; i<24; i++) + { + switch (gSaveBlock1.tvShows[i].common.var00) + { + case 0: + case TVSHOW_RECENT_HAPPENINGS: + case TVSHOW_SMART_SHOPPER: + case TVSHOW_MASS_OUTBREAK: + break; + case TVSHOW_FAN_CLUB_LETTER: + sub_80C03C8((&gSaveBlock1.tvShows[i])->fanclubLetter.species, i); + break; + case TVSHOW_PKMN_FAN_CLUB_OPINIONS: + sub_80C03C8((&gSaveBlock1.tvShows[i])->fanclubOpinions.var02, i); + break; + case TVSHOW_UNKN_SHOWTYPE_04: + sub_80C03C8((&gSaveBlock1.tvShows[i])->unkShow04.var06, i); + break; + case TVSHOW_NAME_RATER_SHOW: + sub_80C03C8((&gSaveBlock1.tvShows[i])->nameRaterShow.species, i); + sub_80C03C8((&gSaveBlock1.tvShows[i])->nameRaterShow.var1C, i); + break; + case TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE: + sub_80C03C8((&gSaveBlock1.tvShows[i])->bravoTrainer.species, i); + break; + case TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE: + sub_80C03C8((&gSaveBlock1.tvShows[i])->bravoTrainerTower.species, i); + sub_80C03C8((&gSaveBlock1.tvShows[i])->bravoTrainerTower.defeatedSpecies, i); + break; + case TVSHOW_POKEMON_TODAY_CAUGHT: + sub_80C03C8((&gSaveBlock1.tvShows[i])->pokemonToday.species, i); + break; + case TVSHOW_POKEMON_TODAY_FAILED: + sub_80C03C8((&gSaveBlock1.tvShows[i])->pokemonTodayFailed.species, i); + sub_80C03C8((&gSaveBlock1.tvShows[i])->pokemonTodayFailed.species2, i); + break; + case TVSHOW_FISHING_ADVICE: + sub_80C03C8((&gSaveBlock1.tvShows[i])->pokemonAngler.var04, i); + break; + case TVSHOW_WORLD_OF_MASTERS: + sub_80C03C8((&gSaveBlock1.tvShows[i])->worldOfMasters.var08, i); + sub_80C03C8((&gSaveBlock1.tvShows[i])->worldOfMasters.var04, i); + break; + default: + sub_80C03A8(i); } } } @@ -2718,7 +2718,7 @@ void sub_80C03A8(u8 showidx) { } void sub_80C03C8(u16 species, u8 showidx) { - if (sub_8090D90(SpeciesToNationalPokedexNum(species), 0) == 0) { + if (!sub_8090D90(SpeciesToNationalPokedexNum(species), 0)) { gSaveBlock1.tvShows[showidx].common.var01 = 0; } } @@ -3121,7 +3121,7 @@ void DoTVShowBravoTrainerBattleTowerProfile(void) break; case 3: TVShowConvertInternationalString(gStringVar1, tvShow->bravoTrainerTower.pokemonName, tvShow->bravoTrainerTower.language); - StringCopy(gStringVar2, gSpeciesNames[tvShow->bravoTrainerTower.winningMove]); + StringCopy(gStringVar2, gSpeciesNames[tvShow->bravoTrainerTower.defeatedSpecies]); if (tvShow->bravoTrainerTower.var1b == 0) { gUnknown_020387E8 = 5; @@ -3132,7 +3132,7 @@ void DoTVShowBravoTrainerBattleTowerProfile(void) break; case 4: TVShowConvertInternationalString(gStringVar1, tvShow->bravoTrainerTower.pokemonName, tvShow->bravoTrainerTower.language); - StringCopy(gStringVar2, gSpeciesNames[tvShow->bravoTrainerTower.winningMove]); + StringCopy(gStringVar2, gSpeciesNames[tvShow->bravoTrainerTower.defeatedSpecies]); if (tvShow->bravoTrainerTower.var1b == 0) { gUnknown_020387E8 = 5; -- cgit v1.2.3 From 4a6d595e5171ed4dc3742c3ff43e771b731a9716 Mon Sep 17 00:00:00 2001 From: scnorton Date: Mon, 5 Jun 2017 16:34:47 -0400 Subject: Assign types to structures passed to secret base exchange packet receipt subroutine staged for decompilation; decompile sub_8041324 --- src/daycare.c | 84 ++++++++++++++----------------------------------- src/record_mixing.c | 91 ++++++----------------------------------------------- 2 files changed, 34 insertions(+), 141 deletions(-) (limited to 'src') diff --git a/src/daycare.c b/src/daycare.c index 92be45cfa..5bcbff6af 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -1,5 +1,7 @@ #include "global.h" #include "pokemon.h" +#include "species.h" +#include "items.h" #include "string_util.h" #include "asm.h" @@ -34,67 +36,29 @@ u8 Daycare_CountPokemon(struct BoxPokemon *daycare_data) } #ifndef ASDF -__attribute__((naked)) -void sub_8041324(struct BoxPokemon * box_pokemon, void * void_pointer) +void sub_8041324(struct BoxPokemon * box_pokemon, struct RecordMixing_UnknownStruct * void_pointer) { - 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\ - mov r9, r0\n\ - mov r10, r1\n\ - movs r7, 0\n\ - movs r5, 0\n\ - mov r6, r10\n\ - adds r6, 0x74\n\ - movs r0, 0x1\n\ - mov r8, r0\n\ -_0804133E:\n\ - lsls r0, r5, 2\n\ - adds r0, r5\n\ - lsls r0, 4\n\ - mov r1, r9\n\ - adds r4, r1, r0\n\ - adds r0, r4, 0\n\ - movs r1, 0xB\n\ - bl GetBoxMonData\n\ - cmp r0, 0\n\ - beq _0804136E\n\ - adds r0, r7, 0x1\n\ - lsls r0, 24\n\ - lsrs r7, r0, 24\n\ - adds r0, r4, 0\n\ - movs r1, 0xC\n\ - bl GetBoxMonData\n\ - adds r1, r0, 0\n\ - cmp r1, 0\n\ - bne _0804136E\n\ - lsls r0, r5, 1\n\ - adds r0, r6, r0\n\ - b _08041374\n\ -_0804136E:\n\ - lsls r0, r5, 1\n\ - adds r0, r6, r0\n\ - mov r1, r8\n\ -_08041374:\n\ - strh r1, [r0]\n\ - adds r0, r5, 0x1\n\ - lsls r0, 24\n\ - lsrs r5, r0, 24\n\ - cmp r5, 0x1\n\ - bls _0804133E\n\ - mov r0, r10\n\ - str r7, [r0, 0x70]\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\ - .syntax divided\n"); + u8 i; + u8 specCount; + specCount = 0; + for (i=0; i<2; i++) + { + if (GetBoxMonData(&box_pokemon[i], MON_DATA_SPECIES) != SPECIES_NONE) + { + specCount ++; + if (GetBoxMonData(&box_pokemon[i], MON_DATA_HELD_ITEM) == ITEM_NONE) + { + void_pointer->unk74[i] = 0; + } else + { + void_pointer->unk74[i] = 1; + } + } else + { + void_pointer->unk74[i] = 1; + } + } + void_pointer->unk70 = specCount; } #endif diff --git a/src/record_mixing.c b/src/record_mixing.c index c84cfd2ae..6749941dd 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -13,18 +13,19 @@ #include "strings2.h" #include "task.h" + extern void *recordMixingSecretBases; extern void *recordMixingTvShows; extern void *gUnknown_083D0274; extern void *gUnknown_083D0278; extern void *recordMixingEasyChatPairs; -extern void *gUnknown_083D0280; extern void *gUnknown_083D0284; extern u8 gUnknown_083D0288[2]; extern u8 gUnknown_083D028A[2][3]; extern u8 gUnknown_083D0290[9][4]; -extern struct RecordMixing_UnknownStruct gUnknown_02038738[2]; //Don't know what type this points to +extern struct RecordMixing_UnknownStruct gUnknown_02038738; //Don't know what type this points to +extern struct RecordMixing_UnknownStruct *gUnknown_083D0280; extern u16 gSpecialVar_0x8005; extern u32 gUnknown_03005D2C; extern u8 gUnknown_03000718; @@ -40,11 +41,11 @@ void sub_80B929C(void) struct PlayerRecords { struct SecretBaseRecord secretBases[20]; - u8 tvShows[25][36]; + TVShow tvShows[25]; u8 filler1004[0x40]; u8 filler1044[0x40]; struct EasyChatPair easyChatPairs[5]; - u8 filler10AC[0x78]; + struct RecordMixing_UnknownStruct filler10AC; u8 filler1124[0xA4]; u16 filler11C8[0x34]; }; @@ -65,10 +66,10 @@ void RecordMixing_PrepareExchangePacket(void) memcpy(unk_2018000.filler1004, gUnknown_083D0274, 0x40); memcpy(unk_2018000.filler1044, gUnknown_083D0278, 0x40); memcpy(unk_2018000.easyChatPairs, recordMixingEasyChatPairs, 0x28); - gUnknown_02038738[0] = gSaveBlock1.filler_303C[0]; - gUnknown_02038738[1] = gSaveBlock1.filler_303C[1]; - sub_8041324(gSaveBlock1.daycareData, gUnknown_02038738); - memcpy(unk_2018000.filler10AC, gUnknown_083D0280, 0x78); + gUnknown_02038738.data[0] = gSaveBlock1.filler_303C.data[0]; + gUnknown_02038738.data[1] = gSaveBlock1.filler_303C.data[1]; + sub_8041324(gSaveBlock1.daycareData, &gUnknown_02038738); + memcpy(&unk_2018000.filler10AC, gUnknown_083D0280, sizeof(struct RecordMixing_UnknownStruct)); memcpy(unk_2018000.filler1124, gUnknown_083D0284, 0xA4); if (GetMultiplayerId() == 0) @@ -83,7 +84,7 @@ void RecordMixing_ReceiveExchangePacket(u32 a) sub_80B9B1C(unk_2008000.filler1044, sizeof(struct PlayerRecords), a); //UB: Too many arguments for function "sub_80FA4E4" sub_80FA4E4(unk_2008000.easyChatPairs, sizeof(struct PlayerRecords), a); - sub_80B9C6C(unk_2008000.filler10AC, sizeof(struct PlayerRecords), a, unk_2008000.tvShows); + sub_80B9C6C(&unk_2008000.filler10AC, sizeof(struct PlayerRecords), a, unk_2008000.tvShows); sub_80B9B70(unk_2008000.filler1124, sizeof(struct PlayerRecords), a); sub_80B9F3C(unk_2008000.filler11C8, a); } @@ -517,75 +518,3 @@ u8 sub_80B9C4C(u8 *a) return r2; } -struct UnkStruct1 -{ - u8 unk0[4]; - u8 unk4[4]; - u8 unk8[4]; - u8 fillerC[0x10]; - u8 unk1C[4][2]; - u8 filler24[8]; - void *unk2C; - u32 unk30; - u32 unk34; - void *unk38; - u32 unk3C; - u32 unk40; - u8 filler44[4]; - u32 unk48; - u32 unk4C; - u32 unk50; - -}; - -/* -//Not finished -extern void sub_80B9C6C(void *a, u32 b, u8 c, void *d) -{ - struct UnkStruct1 s; - u16 r8; - u16 r3; - - s.unk2C = a; - s.unk30 = b; - s.unk38 = d; - s.unk34 = c; - s.unk40 = Random(); - SeedRng(gLinkPlayers[0].trainerId); - r8 = GetLinkPlayerCount(); - r3 = 0; - - s.unk4C = 12; - - while (r3 < 4) - { - - s.unk4[r3] |= 0xFF; - s.unk8[r3] = 0; - - s.unk1C[r3][0] = 0; - s.unk1C[r3][1] = 0; - r3++; - } - s.unk3C = 0; - r3 = 0; - s.unk50 = r8 << 16; - s.unk48 = s.unk30 * s.unk34; - - if (s.unk3C < r8) - { - do //_080B9D00 - { - u32 *r6 = (u32 *)(s.unk2C + s.unk30 * r3); - if (r6[0x1C] != 0 && r6[0x1C] > 0) - { - - } - //_080B9D3C - } - while (r3 < r8); - } - //_080B9D46 -} -*/ - -- cgit v1.2.3 From dc79b94bb32c758253aba698115b60cb5a683266 Mon Sep 17 00:00:00 2001 From: scnorton Date: Mon, 5 Jun 2017 17:45:15 -0400 Subject: Nonmatching sub_80B9BC4 --- src/record_mixing.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/record_mixing.c b/src/record_mixing.c index 6749941dd..f9cb4116e 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -429,14 +429,20 @@ u8 sub_80B9BBC(u16 *a) #undef NONMATCHING #ifdef NONMATCHING -void sub_80B9BC4(u32 a, u32 b, u32 c, u32 d) +void sub_80B9BC4(struct RecordMixing_UnknownStruct *a, size_t b, u8 c[][2], u8 d, u8 e) { + struct RecordMixing_UnknownStructSub *offA; + struct RecordMixing_UnknownStructSub *offB; + struct RecordMixing_UnknownStructSub v0; + v0 = (offA = ((struct RecordMixing_UnknownStruct *)(b * c[d][0] + (u32)&a))->data)[c[d][1]]; + offA[c[d][1]] = (offB = ((struct RecordMixing_UnknownStruct *)(b * c[e][0] + (u32)&a))->data)[c[e][1]]; + offB[c[e][1]] = v0; //ToDo: Figure out what this strange stack usage is } #else __attribute__((naked)) -void sub_80B9BC4(u32 a, u32 b, u32 c, u32 d) +void sub_80B9BC4(struct RecordMixing_UnknownStruct *a, size_t b, u8 c[][2], u8 d, u8 e) { asm(".syntax unified\n\ push {r4-r6,lr}\n\ -- cgit v1.2.3 From 416ef99e4217e1f309b7560974fb5dabfa1329a8 Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 6 Jun 2017 17:58:40 -0400 Subject: Pick up decompiling field_effect.s --- src/field_effect.c | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++- src/palette.c | 8 ++--- 2 files changed, 101 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index bbc1144c1..e13809d27 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -1,8 +1,11 @@ #include "global.h" -#include "field_effect.h" +#include "data2.h" #include "field_weather.h" +#include "decompress.h" #include "sprite.h" +#include "palette.h" #include "text.h" +#include "field_effect.h" typedef bool8 (*FldEffCmd)(u8 **, u32 *); @@ -207,3 +210,96 @@ bool8 FieldEffectActiveListContains(u8 id) return TRUE; return FALSE; } + +u8 CreateTrainerSprite_BirchSpeech(u8 gender, s16 x, s16 y, u8 subpriority, u8 *buffer) +{ + struct SpriteTemplate spriteTemplate; + LoadCompressedObjectPaletteOverrideBuffer(&gTrainerFrontPicPaletteTable[gender], buffer); + LoadCompressedObjectPicOverrideBuffer(&gTrainerFrontPicTable[gender], buffer); + spriteTemplate.tileTag = gTrainerFrontPicTable[gender].tag; + spriteTemplate.paletteTag = gTrainerFrontPicPaletteTable[gender].tag; + spriteTemplate.oam = &gOamData_839F0F4; + spriteTemplate.anims = gDummySpriteAnimTable; + spriteTemplate.images = NULL; + spriteTemplate.affineAnims = gDummySpriteAffineAnimTable; + spriteTemplate.callback = SpriteCallbackDummy; + return CreateSprite(&spriteTemplate, x, y, subpriority); +} + +void LoadTrainerGfx_TrainerCard(u8 gender, u16 palOffset, u8 *dest) +{ + LZDecompressVram(gTrainerFrontPicTable[gender].data, dest); + LoadCompressedPalette(gTrainerFrontPicPaletteTable[gender].data, palOffset, 0x20); +} + +u8 CreateBirchSprite(s16 x, s16 y, u8 subpriority) +{ + LoadSpritePalette(&gUnknown_0839F114); + return CreateSprite(&gSpriteTemplate_839F128, x, y, subpriority); +} + +u8 CreateMonSprite_PicBox(u16 species, s16 x, s16 y, u8 subpriority) +{ + DecompressPicFromTable_2(&gMonFrontPicTable[species], gMonFrontPicCoords[species].coords, gMonFrontPicCoords[species].y_offset, gUnknown_081FAF4C[3], gUnknown_081FAF4C[3], species); + LoadCompressedObjectPalette(&gMonPaletteTable[species]); + GetMonSpriteTemplate_803C56C(species, 3); + gUnknown_02024E8C.paletteTag = gMonPaletteTable[0].tag; + sub_807DE38(IndexOfSpritePaletteTag(gMonPaletteTable[0].tag) + 0x10); + return CreateSprite(&gUnknown_02024E8C, x, y, subpriority); +} + +u8 CreateMonSprite_FieldMove(u16 species, u32 d, u32 g, s16 x, s16 y, u8 subpriority) +{ + const struct SpritePalette *spritePalette; + HandleLoadSpecialPokePic(&gMonFrontPicTable[species], gMonFrontPicCoords[species].coords, gMonFrontPicCoords[species].y_offset, (u32)gUnknown_081FAF4C[3] /* this is actually u8* or something, pointing to ewram */, gUnknown_081FAF4C[3], species, g); + spritePalette = sub_80409C8(species, d, g); + LoadCompressedObjectPalette(spritePalette); + GetMonSpriteTemplate_803C56C(species, 3); + gUnknown_02024E8C.paletteTag = spritePalette->tag; + sub_807DE38(IndexOfSpritePaletteTag(spritePalette->tag) + 0x10); + return CreateSprite(&gUnknown_02024E8C, x, y, subpriority); +} + +void FreeResourcesAndDestroySprite(struct Sprite *sprite) +{ + sub_807DE68(); + FreeSpritePaletteByTag(GetSpritePaletteTagByPaletteNum(sprite->oam.paletteNum)); + if (sprite->oam.affineMode != 0) + { + FreeOamMatrix(sprite->oam.matrixNum); + } + DestroySprite(sprite); +} + +#undef NONMATCHING +#ifdef NONMATCHING +void MultiplyInvertedPaletteRGBComponents(u16 i, u8 r, u8 g, u8 b) +{ + int curRed; + int curGreen; + int curBlue; + + curRed = gPlttBufferUnfaded[i] & 0x1f; + curGreen = (gPlttBufferUnfaded[i] & (0x1f << 5)) >> 5; + curBlue = (gPlttBufferUnfaded[i] & (0x1f << 10)) >> 10; + curRed += (((0x1f - curRed) * r) >> 4); + curGreen += (((0x1f - curGreen) * g) >> 4); + curBlue += (((0x1f - curBlue) * b) >> 4); + gPlttBufferFaded[i] = RGB(curRed, curGreen, curBlue); +} + +void MultiplyPaletteRGBComponents(u16 i, u8 r, u8 g, u8 b) +{ + int curRed; + int curGreen; + int curBlue; + + curRed = gPlttBufferUnfaded[i] & 0x1f; + curGreen = (gPlttBufferUnfaded[i] & (0x1f << 5)) >> 5; + curBlue = (gPlttBufferUnfaded[i] & (0x1f << 10)) >> 10; + curRed -= ((curRed * r) >> 4); + curGreen -= ((curGreen * g) >> 4); + curBlue -= ((curBlue * b) >> 4); + gPlttBufferFaded[i] = RGB(curRed, curGreen, curBlue); +} +#endif diff --git a/src/palette.c b/src/palette.c index 165eb2eae..a610049bc 100644 --- a/src/palette.c +++ b/src/palette.c @@ -615,7 +615,7 @@ static u8 UpdateFastPaletteFade(void) if (b < b0) b = b0; - gPlttBufferFaded[i] = r | (g << 5) | (b << 10); + gPlttBufferFaded[i] = RGB(r, g, b); } break; case FAST_FADE_OUT_TO_WHTIE: @@ -633,7 +633,7 @@ static u8 UpdateFastPaletteFade(void) if (b > 31) b = 31; - gPlttBufferFaded[i] = r | (g << 5) | (b << 10); + gPlttBufferFaded[i] = RGB(r, g, b); } break; case FAST_FADE_IN_FROM_BLACK: @@ -659,7 +659,7 @@ static u8 UpdateFastPaletteFade(void) if (b > b0) b = b0; - gPlttBufferFaded[i] = r | (g << 5) | (b << 10); + gPlttBufferFaded[i] = RGB(r, g, b); } break; case FAST_FADE_OUT_TO_BLACK: @@ -677,7 +677,7 @@ static u8 UpdateFastPaletteFade(void) if (b < 0) b = 0; - gPlttBufferFaded[i] = r | (g << 5) | (b << 10); + gPlttBufferFaded[i] = RGB(r, g, b); } } -- cgit v1.2.3 From a89c10aa0a2426096a9588f2a5294825f69e3e7f Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 6 Jun 2017 18:56:46 -0400 Subject: Pokecenter Heal and Hall Of Fame Record Effect, 1 --- src/field_effect.c | 266 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 266 insertions(+) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index e13809d27..72fd281af 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -5,6 +5,7 @@ #include "sprite.h" #include "palette.h" #include "text.h" +#include "task.h" #include "field_effect.h" typedef bool8 (*FldEffCmd)(u8 **, u32 *); @@ -302,4 +303,269 @@ void MultiplyPaletteRGBComponents(u16 i, u8 r, u8 g, u8 b) curBlue -= ((curBlue * b) >> 4); gPlttBufferFaded[i] = RGB(curRed, curGreen, curBlue); } +#else +__attribute__((naked)) +void MultiplyInvertedPaletteRGBComponents(u16 i, u8 r, u8 g, u8 b) +{ + asm(".syntax unified\n" + "\tpush {r4-r7,lr}\n" + "\tmov r7, r9\n" + "\tmov r6, r8\n" + "\tpush {r6,r7}\n" + "\tlsls r0, 16\n" + "\tlsls r1, 24\n" + "\tlsrs r1, 24\n" + "\tlsls r2, 24\n" + "\tlsrs r2, 24\n" + "\tlsls r3, 24\n" + "\tlsrs r3, 24\n" + "\tldr r4, _08085D00 @ =gPlttBufferUnfaded\n" + "\tlsrs r0, 15\n" + "\tadds r4, r0, r4\n" + "\tldrh r4, [r4]\n" + "\tmovs r5, 0x1F\n" + "\tmov r9, r5\n" + "\tmov r8, r4\n" + "\tmov r6, r8\n" + "\tands r6, r5\n" + "\tmov r8, r6\n" + "\tmovs r6, 0xF8\n" + "\tlsls r6, 2\n" + "\tands r6, r4\n" + "\tlsrs r6, 5\n" + "\tmovs r5, 0xF8\n" + "\tlsls r5, 7\n" + "\tands r4, r5\n" + "\tlsrs r4, 10\n" + "\tmov r7, r9\n" + "\tmov r5, r8\n" + "\tsubs r7, r5\n" + "\tmov r12, r7\n" + "\tmov r7, r12\n" + "\tmuls r7, r1\n" + "\tadds r1, r7, 0\n" + "\tasrs r1, 4\n" + "\tadd r8, r1\n" + "\tmov r5, r9\n" + "\tsubs r1, r5, r6\n" + "\tmuls r1, r2\n" + "\tasrs r1, 4\n" + "\tadds r6, r1\n" + "\tsubs r5, r4\n" + "\tmov r9, r5\n" + "\tmov r1, r9\n" + "\tmuls r1, r3\n" + "\tasrs r1, 4\n" + "\tadds r4, r1\n" + "\tmov r7, r8\n" + "\tlsls r7, 16\n" + "\tlsls r6, 21\n" + "\torrs r6, r7\n" + "\tlsls r4, 26\n" + "\torrs r4, r6\n" + "\tlsrs r4, 16\n" + "\tldr r1, _08085D04 @ =gPlttBufferFaded\n" + "\tadds r0, r1\n" + "\tstrh r4, [r0]\n" + "\tpop {r3,r4}\n" + "\tmov r8, r3\n" + "\tmov r9, r4\n" + "\tpop {r4-r7}\n" + "\tpop {r0}\n" + "\tbx r0\n" + "\t.align 2, 0\n" + "_08085D00: .4byte gPlttBufferUnfaded\n" + "_08085D04: .4byte gPlttBufferFaded\n" + ".syntax divided"); +} + +__attribute__((naked)) +void MultiplyPaletteRGBComponents(u16 i, u8 r, u8 g, u8 b) +{ + asm(".syntax unified\n" + "\tpush {r4-r6,lr}\n" + "\tmov r6, r8\n" + "\tpush {r6}\n" + "\tlsls r0, 16\n" + "\tlsls r1, 24\n" + "\tlsrs r1, 24\n" + "\tlsls r2, 24\n" + "\tlsrs r2, 24\n" + "\tlsls r3, 24\n" + "\tlsrs r3, 24\n" + "\tldr r4, _08085D78 @ =gPlttBufferUnfaded\n" + "\tlsrs r0, 15\n" + "\tadds r4, r0, r4\n" + "\tldrh r4, [r4]\n" + "\tmovs r5, 0x1F\n" + "\tmov r8, r5\n" + "\tmov r6, r8\n" + "\tands r6, r4\n" + "\tmov r8, r6\n" + "\tmovs r5, 0xF8\n" + "\tlsls r5, 2\n" + "\tands r5, r4\n" + "\tlsrs r5, 5\n" + "\tmovs r6, 0xF8\n" + "\tlsls r6, 7\n" + "\tands r4, r6\n" + "\tlsrs r4, 10\n" + "\tmov r6, r8\n" + "\tmuls r6, r1\n" + "\tadds r1, r6, 0\n" + "\tasrs r1, 4\n" + "\tmov r6, r8\n" + "\tsubs r6, r1\n" + "\tadds r1, r5, 0\n" + "\tmuls r1, r2\n" + "\tasrs r1, 4\n" + "\tsubs r5, r1\n" + "\tadds r1, r4, 0\n" + "\tmuls r1, r3\n" + "\tasrs r1, 4\n" + "\tsubs r4, r1\n" + "\tlsls r6, 16\n" + "\tlsls r5, 21\n" + "\torrs r5, r6\n" + "\tlsls r4, 26\n" + "\torrs r4, r5\n" + "\tlsrs r4, 16\n" + "\tldr r1, _08085D7C @ =gPlttBufferFaded\n" + "\tadds r0, r1\n" + "\tstrh r4, [r0]\n" + "\tpop {r3}\n" + "\tmov r8, r3\n" + "\tpop {r4-r6}\n" + "\tpop {r0}\n" + "\tbx r0\n" + "\t.align 2, 0\n" + "_08085D78: .4byte gPlttBufferUnfaded\n" + "_08085D7C: .4byte gPlttBufferFaded\n" + ".syntax divided"); +} #endif + +void Task_PokecenterHeal(u8 taskId); +extern const void (*gUnknown_0839F268[4])(struct Task *); +u8 CreatePokeballGlowSprite(s16, s16, s16, u16); +u8 PokecenterHealEffectHelper(s16, s16); + +bool8 FldEff_PokecenterHeal(void) +{ + u8 nPokemon; + struct Task *task; + + nPokemon = CalculatePlayerPartyCount(); + task = &gTasks[CreateTask(Task_PokecenterHeal, 0xff)]; + task->data[1] = nPokemon; + task->data[2] = 0x5d; + task->data[3] = 0x24; + task->data[4] = 0x7c; + task->data[5] = 0x18; + return FALSE; +} + +void Task_PokecenterHeal(u8 taskId) +{ + struct Task *task; + task = &gTasks[taskId]; + gUnknown_0839F268[task->data[0]](task); +} + +void PokecenterHealEffect_0(struct Task *task) +{ + task->data[0]++; + task->data[6] = CreatePokeballGlowSprite(task->data[1], task->data[2], task->data[3], 1); + task->data[7] = PokecenterHealEffectHelper(task->data[4], task->data[5]); +} + +void PokecenterHealEffect_1(struct Task *task) +{ + if (gSprites[task->data[6]].data0 > 1) + { + gSprites[task->data[7]].data0++; + task->data[0]++; + } +} + +void PokecenterHealEffect_2(struct Task *task) +{ + if (gSprites[task->data[6]].data0 > 4) + { + task->data[0]++; + } +} + +void PokecenterHealEffect_3(struct Task *task) +{ + if (gSprites[task->data[6]].data0 > 6) + { + DestroySprite(&gSprites[task->data[6]]); + FieldEffectActiveListRemove(FLDEFF_POKECENTER_HEAL); + DestroyTask(FindTaskIdByFunc(Task_PokecenterHeal)); + } +} + +void Task_HallOfFameRecord(u8 taskId); +extern const void (*gUnknown_0839F278[4])(struct Task *); +void HallOfFameRecordEffectHelper(u8, u8, u8, u8); + +bool8 FldEff_HallOfFameRecord(void) +{ + u8 nPokemon; + struct Task *task; + + nPokemon = CalculatePlayerPartyCount(); + task = &gTasks[CreateTask(Task_HallOfFameRecord, 0xff)]; + task->data[1] = nPokemon; + task->data[2] = 0x75; + task->data[3] = 0x34; + return FALSE; +} + +void Task_HallOfFameRecord(u8 taskId) +{ + struct Task *task; + task = &gTasks[taskId]; + gUnknown_0839F278[task->data[0]](task); +} + +void HallOfFameRecordEffect_0(struct Task *task) +{ + u8 taskId; + task->data[0]++; + task->data[6] = CreatePokeballGlowSprite(task->data[1], task->data[2], task->data[3], 0); + taskId = FindTaskIdByFunc(Task_HallOfFameRecord); + HallOfFameRecordEffectHelper(taskId, 0x78, 0x18, 0); + HallOfFameRecordEffectHelper(taskId, 0x28, 0x08, 1); + HallOfFameRecordEffectHelper(taskId, 0x48, 0x08, 1); + HallOfFameRecordEffectHelper(taskId, 0xa8, 0x08, 1); + HallOfFameRecordEffectHelper(taskId, 0xc8, 0x08, 1); +} + +void HallOfFameRecordEffect_1(struct Task *task) +{ + if (gSprites[task->data[6]].data0 > 1) + { + task->data[15]++; // was this ever initialized? is this ever used? + task->data[0]++; + } +} + +void HallOfFameRecordEffect_2(struct Task *task) +{ + if (gSprites[task->data[6]].data0 > 4) + { + task->data[0]++; + } +} + +void HallOfFameRecordEffect_3(struct Task *task) +{ + if (gSprites[task->data[6]].data0 > 6) + { + DestroySprite(&gSprites[task->data[6]]); + FieldEffectActiveListRemove(FLDEFF_HALL_OF_FAME_RECORD); + DestroyTask(FindTaskIdByFunc(Task_HallOfFameRecord)); + } +} -- cgit v1.2.3 From 12a379873526bbaf819ed3dc8ff70a9ee1c3f397 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 6 Jun 2017 22:23:10 -0400 Subject: Pokecenter and HOF field effects, 2 --- src/field_effect.c | 215 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 214 insertions(+), 1 deletion(-) mode change 100644 => 100755 src/field_effect.c (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c old mode 100644 new mode 100755 index 72fd281af..1dfc7e107 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -6,6 +6,8 @@ #include "palette.h" #include "text.h" #include "task.h" +#include "sound.h" +#include "songs.h" #include "field_effect.h" typedef bool8 (*FldEffCmd)(u8 **, u32 *); @@ -508,7 +510,7 @@ void PokecenterHealEffect_3(struct Task *task) void Task_HallOfFameRecord(u8 taskId); extern const void (*gUnknown_0839F278[4])(struct Task *); -void HallOfFameRecordEffectHelper(u8, u8, u8, u8); +void HallOfFameRecordEffectHelper(s16, s16, s16, u8); bool8 FldEff_HallOfFameRecord(void) { @@ -569,3 +571,214 @@ void HallOfFameRecordEffect_3(struct Task *task) DestroyTask(FindTaskIdByFunc(Task_HallOfFameRecord)); } } + +void SpriteCB_PokeballGlowEffect(struct Sprite *); +extern const void (*gUnknown_0839F288[8])(struct Sprite *); +extern const struct SpriteTemplate gSpriteTemplate_839F208; +extern const struct SpriteTemplate gSpriteTemplate_839F220; +extern const struct SpriteTemplate gSpriteTemplate_839F238; +extern const struct SpriteTemplate gSpriteTemplate_839F250; +extern const struct SubspriteTable gUnknown_0839F1A0; +extern const struct SubspriteTable gUnknown_0839F1C8; +extern const struct Coords16 gUnknown_0839F2A8[6]; + +u8 CreatePokeballGlowSprite(s16 data6, s16 x, s16 y, u16 data5) +{ + u8 spriteId; + struct Sprite *sprite; + spriteId = CreateInvisibleSprite(SpriteCB_PokeballGlowEffect); + sprite = &gSprites[spriteId]; + sprite->pos2.x = x; + sprite->pos2.y = y; + sprite->data5 = data5; + sprite->data6 = data6; + sprite->data7 = spriteId; + return spriteId; +} + +void SpriteCB_PokeballGlowEffect(struct Sprite *sprite) +{ + gUnknown_0839F288[sprite->data0](sprite); +} + +void PokeballGlowEffect_0(struct Sprite *sprite) +{ + u8 endSpriteId; + if (sprite->data1 == 0 || (--sprite->data1) == 0) + { + sprite->data1 = 25; + endSpriteId = CreateSpriteAtEnd(&gSpriteTemplate_839F208, gUnknown_0839F2A8[sprite->data2].x + sprite->pos2.x, gUnknown_0839F2A8[sprite->data2].y + sprite->pos2.y, 0); + gSprites[endSpriteId].oam.priority = 2; + gSprites[endSpriteId].data0 = sprite->data7; + sprite->data2++; + sprite->data6--; + PlaySE(SE_BOWA); + } + if (sprite->data6 == 0) + { + sprite->data1 = 32; + sprite->data0++; + } +} + +extern const u8 gUnknown_0839F2C0[4]; // red +extern const u8 gUnknown_0839F2C4[4]; // green +extern const u8 gUnknown_0839F2C8[4]; // blue + +void PokeballGlowEffect_1(struct Sprite *sprite) +{ + if ((--sprite->data1) == 0) + { + sprite->data0++; + sprite->data1 = 8; + sprite->data2 = 0; + sprite->data3 = 0; + if (sprite->data5) + { + PlayFanfare(BGM_ME_ASA); + } + } +} + +void PokeballGlowEffect_2(struct Sprite *sprite) +{ + u8 phase; + if ((--sprite->data1) == 0) + { + sprite->data1 = 8; + sprite->data2++; + sprite->data2 &= 3; + if (sprite->data2 == 0) + { + sprite->data3++; + } + } + phase = (sprite->data2 + 3) & 3; + MultiplyInvertedPaletteRGBComponents((IndexOfSpritePaletteTag(0x1007) << 4) + 0x108, gUnknown_0839F2C0[phase], gUnknown_0839F2C4[phase], gUnknown_0839F2C8[phase]); + phase = (sprite->data2 + 2) & 3; + MultiplyInvertedPaletteRGBComponents((IndexOfSpritePaletteTag(0x1007) << 4) + 0x106, gUnknown_0839F2C0[phase], gUnknown_0839F2C4[phase], gUnknown_0839F2C8[phase]); + phase = (sprite->data2 + 1) & 3; + MultiplyInvertedPaletteRGBComponents((IndexOfSpritePaletteTag(0x1007) << 4) + 0x102, gUnknown_0839F2C0[phase], gUnknown_0839F2C4[phase], gUnknown_0839F2C8[phase]); + phase = sprite->data2; + MultiplyInvertedPaletteRGBComponents((IndexOfSpritePaletteTag(0x1007) << 4) + 0x105, gUnknown_0839F2C0[phase], gUnknown_0839F2C4[phase], gUnknown_0839F2C8[phase]); + MultiplyInvertedPaletteRGBComponents((IndexOfSpritePaletteTag(0x1007) << 4) + 0x103, gUnknown_0839F2C0[phase], gUnknown_0839F2C4[phase], gUnknown_0839F2C8[phase]); + if (sprite->data3 > 2) + { + sprite->data0++; + sprite->data1 = 8; + sprite->data2 = 0; + } +} + +void PokeballGlowEffect_3(struct Sprite *sprite) +{ + u8 phase; + if ((--sprite->data1) == 0) + { + sprite->data1 = 8; + sprite->data2++; + sprite->data2 &= 3; + if (sprite->data2 == 3) + { + sprite->data0++; + sprite->data1 = 30; + } + } + phase = sprite->data2; + MultiplyInvertedPaletteRGBComponents((IndexOfSpritePaletteTag(0x1007) << 4) + 0x108, gUnknown_0839F2C0[phase], gUnknown_0839F2C4[phase], gUnknown_0839F2C8[phase]); + MultiplyInvertedPaletteRGBComponents((IndexOfSpritePaletteTag(0x1007) << 4) + 0x106, gUnknown_0839F2C0[phase], gUnknown_0839F2C4[phase], gUnknown_0839F2C8[phase]); + MultiplyInvertedPaletteRGBComponents((IndexOfSpritePaletteTag(0x1007) << 4) + 0x102, gUnknown_0839F2C0[phase], gUnknown_0839F2C4[phase], gUnknown_0839F2C8[phase]); + MultiplyInvertedPaletteRGBComponents((IndexOfSpritePaletteTag(0x1007) << 4) + 0x105, gUnknown_0839F2C0[phase], gUnknown_0839F2C4[phase], gUnknown_0839F2C8[phase]); + MultiplyInvertedPaletteRGBComponents((IndexOfSpritePaletteTag(0x1007) << 4) + 0x103, gUnknown_0839F2C0[phase], gUnknown_0839F2C4[phase], gUnknown_0839F2C8[phase]); +} + +void PokeballGlowEffect_4(struct Sprite *sprite) +{ + if ((--sprite->data1) == 0) + { + sprite->data0++; + } +} + +void PokeballGlowEffect_5(struct Sprite *sprite) +{ + sprite->data0++; +} + +void PokeballGlowEffect_6(struct Sprite *sprite) +{ + if (sprite->data5 == 0 || IsFanfareTaskInactive()) + { + sprite->data0++; + } +} + +void PokeballGlowEffect_7(struct Sprite *sprite) +{ +} + +void SpriteCB_PokeballGlow(struct Sprite *sprite) +{ + if (gSprites[sprite->data0].data0 > 4) + { + FieldEffectFreeGraphicsResources(sprite); + } +} + +u8 PokecenterHealEffectHelper(s16 x, s16 y) +{ + u8 spriteIdAtEnd; + struct Sprite *sprite; + spriteIdAtEnd = CreateSpriteAtEnd(&gSpriteTemplate_839F220, x, y, 0); + sprite = &gSprites[spriteIdAtEnd]; + sprite->oam.priority = 2; + sprite->invisible = 1; + SetSubspriteTables(sprite, &gUnknown_0839F1A0); + return spriteIdAtEnd; +} + +void SpriteCB_PokecenterMonitor(struct Sprite *sprite) +{ + if (sprite->data0 != 0) + { + sprite->data0 = 0; + sprite->invisible = 0; + StartSpriteAnim(sprite, 1); + } + if (sprite->animEnded) + { + FieldEffectFreeGraphicsResources(sprite); + } +} + +void HallOfFameRecordEffectHelper(s16 a0, s16 a1, s16 a2, u8 a3) +{ + u8 spriteIdAtEnd; + if (!a3) + { + spriteIdAtEnd = CreateSpriteAtEnd(&gSpriteTemplate_839F238, a1, a2, 0); + SetSubspriteTables(&gSprites[spriteIdAtEnd], &gUnknown_0839F1C8); + } else + { + spriteIdAtEnd = CreateSpriteAtEnd(&gSpriteTemplate_839F250, a1, a2, 0); + } + gSprites[spriteIdAtEnd].invisible = 1; + gSprites[spriteIdAtEnd].data0 = a0; +} + +void SpriteCB_HallOfFameMonitor(struct Sprite *sprite) +{ + if (gTasks[sprite->data0].data[15]) + { + if (sprite->data1 == 0 || (--sprite->data1) == 0) + { + sprite->data1 = 16; + sprite->invisible ^= 1; + } + sprite->data2++; + } + if (sprite->data2 > 127) + { + FieldEffectFreeGraphicsResources(sprite); + } +} -- cgit v1.2.3 From d48792a69d0687f50401db08e5b133cd60a9a81a Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 6 Jun 2017 23:18:03 -0400 Subject: Some functions related to queueing overworld fly fldeff --- src/field_effect.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index 1dfc7e107..931116c16 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -1,13 +1,20 @@ #include "global.h" +#include "asm.h" #include "data2.h" +#include "script.h" +#include "main.h" #include "field_weather.h" #include "decompress.h" #include "sprite.h" #include "palette.h" #include "text.h" +#include "rom4.h" #include "task.h" #include "sound.h" #include "songs.h" +#include "decoration.h" +#include "field_map_obj_helpers.h" +#include "field_map_obj.h" #include "field_effect.h" typedef bool8 (*FldEffCmd)(u8 **, u32 *); @@ -782,3 +789,87 @@ void SpriteCB_HallOfFameMonitor(struct Sprite *sprite) FieldEffectFreeGraphicsResources(sprite); } } + +void mapldr_080842E8(void); +void mapldr_08084390(void); +void task00_8084310(u8); +void c3_080843F8(u8); + +void sub_80865BC(void) +{ + SetMainCallback2(c2_exit_to_overworld_2_switch); + gUnknown_0300485C = mapldr_080842E8; +} + +void mapldr_080842E8(void) +{ + pal_fill_black(); + CreateTask(task00_8084310, 0); + ScriptContext2_Enable(); + FreezeMapObjects(); + gUnknown_0300485C = NULL; +} + +void task00_8084310(u8 taskId) +{ + struct Task *task; + task = &gTasks[taskId]; + if (!task->data[0]) + { + if (!sub_807D770()) + { + return; + } + gUnknown_0202FF84[0] = gLastFieldPokeMenuOpened; + if ((int)gUnknown_0202FF84[0] > 5) + { + gUnknown_0202FF84[0] = 0; + } + FieldEffectStart(FLDEFF_USE_FLY); + task->data[0]++; + } + if (!FieldEffectActiveListContains(FLDEFF_USE_FLY)) + { + flag_var_implications_of_teleport_(); + warp_in(); + SetMainCallback2(CB2_LoadMap); + gUnknown_0300485C = mapldr_08084390; + DestroyTask(taskId); + } +} + +void mapldr_08084390(void) +{ + sub_8053E90(); + pal_fill_black(); + CreateTask(c3_080843F8, 0); + gMapObjects[gPlayerAvatar.mapObjectId].mapobj_bit_13 = 1; + if (gPlayerAvatar.flags & 0x08) + { + FieldObjectTurn(&gMapObjects[gPlayerAvatar.mapObjectId], DIR_WEST); + } + ScriptContext2_Enable(); + FreezeMapObjects(); + gUnknown_0300485C = NULL; +} + +void c3_080843F8(u8 taskId) +{ + struct Task *task; + task = &gTasks[taskId]; + if (task->data[0] == 0) + { + if (gPaletteFade.active) + { + return; + } + FieldEffectStart(FLDEFF_FLY_IN); + task->data[0]++; + } + if (!FieldEffectActiveListContains(FLDEFF_FLY_IN)) + { + ScriptContext2_Disable(); + UnfreezeMapObjects(); + DestroyTask(taskId); + } +} -- cgit v1.2.3 From 9140eeaa7347c671df59c323ced655ea94bf62ce Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 7 Jun 2017 02:28:10 -0500 Subject: decompile sub_811EC68 --- src/battle_811DA74.c | 221 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 219 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/battle_811DA74.c b/src/battle_811DA74.c index 328b45f49..44d8f179d 100644 --- a/src/battle_811DA74.c +++ b/src/battle_811DA74.c @@ -455,7 +455,7 @@ u32 dp01_getattr_by_ch1_for_player_pokemon(u8 a, u8 *buffer) case 5: case 6: case 7: - data16 = GetMonData(&gPlayerParty[a], gUnknown_02023A60[gUnknown_02024A60][1] + MON_DATA_CHECKSUM); + data16 = GetMonData(&gPlayerParty[a], MON_DATA_MOVE1 + gUnknown_02023A60[gUnknown_02024A60][1] - 4); buffer[0] = data16; buffer[1] = data16 >> 8; size = 2; @@ -470,7 +470,7 @@ u32 dp01_getattr_by_ch1_for_player_pokemon(u8 a, u8 *buffer) case 10: case 11: case 12: - buffer[0] = GetMonData(&gPlayerParty[a], gUnknown_02023A60[gUnknown_02024A60][1] + MON_DATA_MARKINGS); + buffer[0] = GetMonData(&gPlayerParty[a], MON_DATA_PP1 + gUnknown_02023A60[gUnknown_02024A60][1] - 9); size = 1; break; case 17: @@ -710,3 +710,220 @@ void sub_811EC10(void) } dp01_tbl3_exec_completed(); } + +void sub_811EC68(u8 a) +{ + struct BattlePokemon *battlePokemon = (struct BattlePokemon *)&gUnknown_02023A60[gUnknown_02024A60][3]; + struct UnknownStruct3 *moveData = (struct UnknownStruct3 *)&gUnknown_02023A60[gUnknown_02024A60][3]; + s32 i; + + switch (gUnknown_02023A60[gUnknown_02024A60][1]) + { + case 0: + { + u8 iv; + + SetMonData(&gPlayerParty[a], MON_DATA_SPECIES, (u8 *)&battlePokemon->species); + SetMonData(&gPlayerParty[a], MON_DATA_HELD_ITEM, (u8 *)&battlePokemon->item); + for (i = 0; i < 4; i++) + { + SetMonData(&gPlayerParty[a], MON_DATA_MOVE1 + i, (u8 *)&battlePokemon->moves[i]); + SetMonData(&gPlayerParty[a], MON_DATA_PP1 + i, (u8 *)&battlePokemon->pp[i]); + } + SetMonData(&gPlayerParty[a], MON_DATA_PP_BONUSES, (u8 *)&battlePokemon->ppBonuses); + SetMonData(&gPlayerParty[a], MON_DATA_FRIENDSHIP, (u8 *)&battlePokemon->friendship); + SetMonData(&gPlayerParty[a], MON_DATA_EXP, (u8 *)&battlePokemon->experience); + iv = battlePokemon->hpIV; + SetMonData(&gPlayerParty[a], MON_DATA_HP_IV, (u8 *)&iv); + iv = battlePokemon->attackIV; + SetMonData(&gPlayerParty[a], MON_DATA_ATK_IV, (u8 *)&iv); + iv = battlePokemon->defenseIV; + SetMonData(&gPlayerParty[a], MON_DATA_DEF_IV, (u8 *)&iv); + iv = battlePokemon->speedIV; + SetMonData(&gPlayerParty[a], MON_DATA_SPD_IV, (u8 *)&iv); + iv = battlePokemon->spAttackIV; + SetMonData(&gPlayerParty[a], MON_DATA_SPATK_IV, (u8 *)&iv); + iv = battlePokemon->spDefenseIV; + SetMonData(&gPlayerParty[a], MON_DATA_SPDEF_IV, (u8 *)&iv); + SetMonData(&gPlayerParty[a], MON_DATA_PERSONALITY, (u8 *)&battlePokemon->personality); + SetMonData(&gPlayerParty[a], MON_DATA_STATUS, (u8 *)&battlePokemon->status1); + SetMonData(&gPlayerParty[a], MON_DATA_LEVEL, (u8 *)&battlePokemon->level); + SetMonData(&gPlayerParty[a], MON_DATA_HP, (u8 *)&battlePokemon->hp); + SetMonData(&gPlayerParty[a], MON_DATA_MAX_HP, (u8 *)&battlePokemon->maxHP); + SetMonData(&gPlayerParty[a], MON_DATA_ATK, (u8 *)&battlePokemon->attack); + SetMonData(&gPlayerParty[a], MON_DATA_DEF, (u8 *)&battlePokemon->defense); + SetMonData(&gPlayerParty[a], MON_DATA_SPD, (u8 *)&battlePokemon->speed); + SetMonData(&gPlayerParty[a], MON_DATA_SPATK, (u8 *)&battlePokemon->spAttack); + SetMonData(&gPlayerParty[a], MON_DATA_SPDEF, (u8 *)&battlePokemon->spDefense); + } + break; + case 1: + SetMonData(&gPlayerParty[a], MON_DATA_SPECIES, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 2: + SetMonData(&gPlayerParty[a], MON_DATA_HELD_ITEM, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 3: + for (i = 0; i < 4; i++) + { + SetMonData(&gPlayerParty[a], MON_DATA_MOVE1 + i, (u8 *)&moveData->moves[i]); + SetMonData(&gPlayerParty[a], MON_DATA_PP1 + i, (u8 *)&moveData->pp[i]); + } + SetMonData(&gPlayerParty[a], MON_DATA_PP_BONUSES, &moveData->ppBonuses); + break; + case 4: + case 5: + case 6: + case 7: + SetMonData(&gPlayerParty[a], MON_DATA_MOVE1 + gUnknown_02023A60[gUnknown_02024A60][1] - 4, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 8: + SetMonData(&gPlayerParty[a], MON_DATA_PP1, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_PP2, &gUnknown_02023A60[gUnknown_02024A60][4]); + SetMonData(&gPlayerParty[a], MON_DATA_PP3, &gUnknown_02023A60[gUnknown_02024A60][5]); + SetMonData(&gPlayerParty[a], MON_DATA_PP4, &gUnknown_02023A60[gUnknown_02024A60][6]); + SetMonData(&gPlayerParty[a], MON_DATA_PP_BONUSES, &gUnknown_02023A60[gUnknown_02024A60][7]); + break; + case 9: + case 10: + case 11: + case 12: + SetMonData(&gPlayerParty[a], MON_DATA_PP1 + gUnknown_02023A60[gUnknown_02024A60][1] - 9, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 17: + SetMonData(&gPlayerParty[a], MON_DATA_OT_ID, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 18: + SetMonData(&gPlayerParty[a], MON_DATA_EXP, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 19: + SetMonData(&gPlayerParty[a], MON_DATA_HP_EV, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 20: + SetMonData(&gPlayerParty[a], MON_DATA_ATK_EV, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 21: + SetMonData(&gPlayerParty[a], MON_DATA_DEF_EV, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 22: + SetMonData(&gPlayerParty[a], MON_DATA_SPD_EV, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 23: + SetMonData(&gPlayerParty[a], MON_DATA_SPATK_EV, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 24: + SetMonData(&gPlayerParty[a], MON_DATA_SPDEF_EV, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 25: + SetMonData(&gPlayerParty[a], MON_DATA_FRIENDSHIP, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 26: + SetMonData(&gPlayerParty[a], MON_DATA_POKERUS, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 27: + SetMonData(&gPlayerParty[a], MON_DATA_MET_LOCATION, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 28: + SetMonData(&gPlayerParty[a], MON_DATA_MET_LEVEL, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 29: + SetMonData(&gPlayerParty[a], MON_DATA_MET_GAME, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 30: + SetMonData(&gPlayerParty[a], MON_DATA_POKEBALL, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 31: + SetMonData(&gPlayerParty[a], MON_DATA_HP_IV, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_ATK_IV, &gUnknown_02023A60[gUnknown_02024A60][4]); + SetMonData(&gPlayerParty[a], MON_DATA_DEF_IV, &gUnknown_02023A60[gUnknown_02024A60][5]); + SetMonData(&gPlayerParty[a], MON_DATA_SPD_IV, &gUnknown_02023A60[gUnknown_02024A60][6]); + SetMonData(&gPlayerParty[a], MON_DATA_SPATK_IV, &gUnknown_02023A60[gUnknown_02024A60][7]); + SetMonData(&gPlayerParty[a], MON_DATA_SPDEF_IV, &gUnknown_02023A60[gUnknown_02024A60][8]); + break; + case 32: + SetMonData(&gPlayerParty[a], MON_DATA_HP_IV, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 33: + SetMonData(&gPlayerParty[a], MON_DATA_ATK_IV, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 34: + SetMonData(&gPlayerParty[a], MON_DATA_DEF_IV, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 35: + SetMonData(&gPlayerParty[a], MON_DATA_SPD_IV, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 36: + SetMonData(&gPlayerParty[a], MON_DATA_SPATK_IV, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 37: + SetMonData(&gPlayerParty[a], MON_DATA_SPDEF_IV, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 38: + SetMonData(&gPlayerParty[a], MON_DATA_PERSONALITY, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 39: + SetMonData(&gPlayerParty[a], MON_DATA_CHECKSUM, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 40: + SetMonData(&gPlayerParty[a], MON_DATA_STATUS, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 41: + SetMonData(&gPlayerParty[a], MON_DATA_LEVEL, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 42: + SetMonData(&gPlayerParty[a], MON_DATA_HP, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 43: + SetMonData(&gPlayerParty[a], MON_DATA_MAX_HP, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 44: + SetMonData(&gPlayerParty[a], MON_DATA_ATK, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 45: + SetMonData(&gPlayerParty[a], MON_DATA_DEF, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 46: + SetMonData(&gPlayerParty[a], MON_DATA_SPD, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 47: + SetMonData(&gPlayerParty[a], MON_DATA_SPATK, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 48: + SetMonData(&gPlayerParty[a], MON_DATA_SPDEF, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 49: + SetMonData(&gPlayerParty[a], MON_DATA_COOL, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 50: + SetMonData(&gPlayerParty[a], MON_DATA_BEAUTY, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 51: + SetMonData(&gPlayerParty[a], MON_DATA_CUTE, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 52: + SetMonData(&gPlayerParty[a], MON_DATA_SMART, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 53: + SetMonData(&gPlayerParty[a], MON_DATA_TOUGH, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 54: + SetMonData(&gPlayerParty[a], MON_DATA_SHEEN, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 55: + SetMonData(&gPlayerParty[a], MON_DATA_COOL_RIBBON, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 56: + SetMonData(&gPlayerParty[a], MON_DATA_BEAUTY_RIBBON, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 57: + SetMonData(&gPlayerParty[a], MON_DATA_CUTE_RIBBON, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 58: + SetMonData(&gPlayerParty[a], MON_DATA_SMART_RIBBON, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + case 59: + SetMonData(&gPlayerParty[a], MON_DATA_TOUGH_RIBBON, &gUnknown_02023A60[gUnknown_02024A60][3]); + break; + } + sub_80324F8(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], gUnknown_02024A60); +} -- cgit v1.2.3 From 30c2d09cf89e5f2d3b581bd44f55f88107267ddc Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 7 Jun 2017 02:42:56 -0500 Subject: decompile sub_811F664 --- src/battle_811DA74.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/battle_811DA74.c b/src/battle_811DA74.c index 44d8f179d..3f1bb9266 100644 --- a/src/battle_811DA74.c +++ b/src/battle_811DA74.c @@ -927,3 +927,14 @@ void sub_811EC68(u8 a) } sub_80324F8(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], gUnknown_02024A60); } + +void sub_811F664(void) +{ + u8 *dst; + u8 i; + + dst = (u8 *)&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]] + gUnknown_02023A60[gUnknown_02024A60][1]; + for (i = 0; i < gUnknown_02023A60[gUnknown_02024A60][2]; i++) + dst[i] = gUnknown_02023A60[gUnknown_02024A60][3 + i]; + dp01_tbl3_exec_completed(); +} -- cgit v1.2.3 From dfef744741329de817e5a05ea0f1019a694ef3b2 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 7 Jun 2017 03:00:08 -0500 Subject: decompile sub_811F6D8 --- src/battle_811DA74.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src') diff --git a/src/battle_811DA74.c b/src/battle_811DA74.c index 3f1bb9266..76d9609e7 100644 --- a/src/battle_811DA74.c +++ b/src/battle_811DA74.c @@ -43,11 +43,13 @@ extern u32 gUnknown_02024A64; extern u16 gUnknown_02024A6A[]; extern u8 gUnknown_02024BE0[]; extern u8 gUnknown_02024E6D; +extern struct SpriteTemplate gUnknown_02024E8C; extern struct Window gUnknown_03004210; extern MainCallback gUnknown_030042D0; extern void (*gUnknown_03004330[])(void); extern u8 gUnknown_03004340[]; extern u8 gUnknown_0300434C[]; +extern u8 gBattleMonForms[]; extern void (*const gUnknown_083FE4F4[])(void); extern u8 unk_2000000[]; @@ -55,6 +57,10 @@ extern u8 unk_2000000[]; #define EWRAM_17800 ((u8 *)(unk_2000000 + 0x17800)) #define EWRAM_17810 ((struct UnknownStruct2 *)(unk_2000000 + 0x17810)) +extern void sub_80318FC(); +extern u8 sub_8077ABC(); +extern u8 sub_8077F68(); +extern u8 sub_8079E90(); extern void nullsub_10(); extern void sub_8045A5C(); extern void sub_804777C(); @@ -938,3 +944,21 @@ void sub_811F664(void) dst[i] = gUnknown_02023A60[gUnknown_02024A60][3 + i]; dp01_tbl3_exec_completed(); } + +void sub_811F6D8(void) +{ + sub_80318FC(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], gUnknown_02024A60); + GetMonSpriteTemplate_803C56C( + GetMonData(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], MON_DATA_SPECIES), + battle_get_per_side_status(gUnknown_02024A60)); + gUnknown_02024BE0[gUnknown_02024A60] = CreateSprite( + &gUnknown_02024E8C, + sub_8077ABC(gUnknown_02024A60, 2), + sub_8077F68(gUnknown_02024A60), + sub_8079E90(gUnknown_02024A60)); + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].pos2.x = -240; + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data0 = gUnknown_02024A60; + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].oam.paletteNum = gUnknown_02024A60; + StartSpriteAnim(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]], gBattleMonForms[gUnknown_02024A60]); + gUnknown_03004330[gUnknown_02024A60] = sub_811DDE8; +} -- cgit v1.2.3 From 663851a26d36e354b9b83bc9b76b7c907e39387f Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 7 Jun 2017 03:05:37 -0500 Subject: decompile sub_811F7F4 --- src/battle_811DA74.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/battle_811DA74.c b/src/battle_811DA74.c index 76d9609e7..d1558e440 100644 --- a/src/battle_811DA74.c +++ b/src/battle_811DA74.c @@ -962,3 +962,14 @@ void sub_811F6D8(void) StartSpriteAnim(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]], gBattleMonForms[gUnknown_02024A60]); gUnknown_03004330[gUnknown_02024A60] = sub_811DDE8; } + +void sub_811F864(); + +void sub_811F7F4(void) +{ + sub_8032AA8(gUnknown_02024A60, gUnknown_02023A60[gUnknown_02024A60][2]); + gUnknown_02024A6A[gUnknown_02024A60] = gUnknown_02023A60[gUnknown_02024A60][1]; + sub_80318FC(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], gUnknown_02024A60); + sub_811F864(gUnknown_02024A60, gUnknown_02023A60[gUnknown_02024A60][2]); + gUnknown_03004330[gUnknown_02024A60] = sub_811E1BC; +} -- cgit v1.2.3 From 67a95d8e9619b5b239c21043bf003a2252dedd2c Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 7 Jun 2017 03:06:50 -0500 Subject: trim whitespace --- src/battle_811DA74.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/battle_811DA74.c b/src/battle_811DA74.c index d1558e440..0d49c33bd 100644 --- a/src/battle_811DA74.c +++ b/src/battle_811DA74.c @@ -722,13 +722,13 @@ void sub_811EC68(u8 a) struct BattlePokemon *battlePokemon = (struct BattlePokemon *)&gUnknown_02023A60[gUnknown_02024A60][3]; struct UnknownStruct3 *moveData = (struct UnknownStruct3 *)&gUnknown_02023A60[gUnknown_02024A60][3]; s32 i; - + switch (gUnknown_02023A60[gUnknown_02024A60][1]) { case 0: { u8 iv; - + SetMonData(&gPlayerParty[a], MON_DATA_SPECIES, (u8 *)&battlePokemon->species); SetMonData(&gPlayerParty[a], MON_DATA_HELD_ITEM, (u8 *)&battlePokemon->item); for (i = 0; i < 4; i++) @@ -938,7 +938,7 @@ void sub_811F664(void) { u8 *dst; u8 i; - + dst = (u8 *)&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]] + gUnknown_02023A60[gUnknown_02024A60][1]; for (i = 0; i < gUnknown_02023A60[gUnknown_02024A60][2]; i++) dst[i] = gUnknown_02023A60[gUnknown_02024A60][3 + i]; -- cgit v1.2.3 From bbc25771031be86bf19f11ddf2b078dd5364ca30 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 7 Jun 2017 08:50:09 -0400 Subject: Up through sub_80867AC (nonmatching wip) --- src/field_effect.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index 931116c16..ad8fa3648 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -13,6 +13,7 @@ #include "sound.h" #include "songs.h" #include "decoration.h" +#include "field_player_avatar.h" #include "field_map_obj_helpers.h" #include "field_map_obj.h" #include "field_effect.h" @@ -873,3 +874,43 @@ void c3_080843F8(u8 taskId) DestroyTask(taskId); } } + +extern void pal_fill_for_map_transition(void); +void sub_8086774(u8); +extern const bool8 (*gUnknown_0839F2CC[7])(struct Task *); +extern void CameraObjectReset2(void); + +void sub_8086748(void) +{ + sub_8053E90(); + pal_fill_for_map_transition(); + ScriptContext2_Enable(); + FreezeMapObjects(); + CreateTask(sub_8086774, 0); + gUnknown_0300485C = NULL; +} + +void sub_8086774(u8 taskId) +{ + struct Task *task; + task = &gTasks[taskId]; + while (gUnknown_0839F2CC[task->data[0]](task)); +} + +bool8 sub_80867AC(struct Task *task) +{ + struct MapObject *playerObject; + struct Sprite *playerSprite; + playerObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + playerSprite = &gSprites[gPlayerAvatar.spriteId]; + CameraObjectReset2(); + gMapObjects[gPlayerAvatar.mapObjectId].mapobj_bit_13 = 1; + gPlayerAvatar.unk6 = 1; + FieldObjectSetSpecialAnim(playerObject, GetFaceDirectionAnimId(player_get_direction_lower_nybble())); + task->data[4] = playerSprite->subspriteMode; + playerObject->mapobj_bit_27 = 1; + playerSprite->oam.priority = 1; + playerSprite->subspriteMode = 2; + task->data[0]++; +} + -- cgit v1.2.3 From eb492eb014397ce2b9933e024bea62a32db5fc5d Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 7 Jun 2017 11:52:47 -0500 Subject: decompile sub_811F864 --- src/battle_811DA74.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/battle_811DA74.c b/src/battle_811DA74.c index 0d49c33bd..0bef8b3af 100644 --- a/src/battle_811DA74.c +++ b/src/battle_811DA74.c @@ -57,6 +57,9 @@ extern u8 unk_2000000[]; #define EWRAM_17800 ((u8 *)(unk_2000000 + 0x17800)) #define EWRAM_17810 ((struct UnknownStruct2 *)(unk_2000000 + 0x17810)) +extern u8 sub_8046400(); +extern void sub_80312F0(struct Sprite *); +extern u8 CreateInvisibleSpriteWithCallback(); extern void sub_80318FC(); extern u8 sub_8077ABC(); extern u8 sub_8077F68(); @@ -83,6 +86,7 @@ void sub_811E0A0(void); void dp01_tbl3_exec_completed(void); u32 dp01_getattr_by_ch1_for_player_pokemon(u8 a, u8 *b); void sub_811EC68(u8); +void sub_811F864(u8, u8); void nullsub_74(void) { @@ -963,8 +967,6 @@ void sub_811F6D8(void) gUnknown_03004330[gUnknown_02024A60] = sub_811DDE8; } -void sub_811F864(); - void sub_811F7F4(void) { sub_8032AA8(gUnknown_02024A60, gUnknown_02023A60[gUnknown_02024A60][2]); @@ -973,3 +975,27 @@ void sub_811F7F4(void) sub_811F864(gUnknown_02024A60, gUnknown_02023A60[gUnknown_02024A60][2]); gUnknown_03004330[gUnknown_02024A60] = sub_811E1BC; } + +void sub_811F864(u8 a, u8 b) +{ + u16 species; + + sub_8032AA8(a, b); + gUnknown_02024A6A[a] = gUnknown_02023A60[a][1]; + species = GetMonData(&gPlayerParty[gUnknown_02024A6A[a]], MON_DATA_SPECIES); + gUnknown_0300434C[a] = CreateInvisibleSpriteWithCallback(sub_80312F0); + GetMonSpriteTemplate_803C56C(species, battle_get_per_side_status(a)); + gUnknown_02024BE0[a] = CreateSprite( + &gUnknown_02024E8C, + sub_8077ABC(a, 2), + sub_8077F68(a), + sub_8079E90(a)); + gSprites[gUnknown_0300434C[a]].data1 = gUnknown_02024BE0[a]; + gSprites[gUnknown_02024BE0[a]].data0 = a; + gSprites[gUnknown_02024BE0[a]].data2 = species; + gSprites[gUnknown_02024BE0[a]].oam.paletteNum = a; + StartSpriteAnim(&gSprites[gUnknown_02024BE0[a]], gBattleMonForms[a]); + gSprites[gUnknown_02024BE0[a]].invisible = TRUE; + gSprites[gUnknown_02024BE0[a]].callback = SpriteCallbackDummy; + gSprites[gUnknown_0300434C[a]].data0 = sub_8046400(0, 0xFF); +} -- cgit v1.2.3 From 5d4a042fa654930450f73f0af3abf14df2daf2ef Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 7 Jun 2017 12:00:57 -0500 Subject: decompile sub_811F9D0 --- src/battle_811DA74.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/battle_811DA74.c b/src/battle_811DA74.c index 0bef8b3af..1cb2d620e 100644 --- a/src/battle_811DA74.c +++ b/src/battle_811DA74.c @@ -21,7 +21,11 @@ struct UnknownStruct2 { u8 unk0; u8 unk1; - u8 filler2[7]; + //u8 filler2[7]; + u8 filler2[2]; + u8 unk4; + u8 filler5[4]; + u8 unk9; u8 fillerA[2]; }; @@ -87,6 +91,7 @@ void dp01_tbl3_exec_completed(void); u32 dp01_getattr_by_ch1_for_player_pokemon(u8 a, u8 *b); void sub_811EC68(u8); void sub_811F864(u8, u8); +void sub_811FA5C(void); void nullsub_74(void) { @@ -999,3 +1004,19 @@ void sub_811F864(u8 a, u8 b) gSprites[gUnknown_02024BE0[a]].callback = SpriteCallbackDummy; gSprites[gUnknown_0300434C[a]].data0 = sub_8046400(0, 0xFF); } + +void sub_811F9D0(void) +{ + if (gUnknown_02023A60[gUnknown_02024A60][1] == 0) + { + EWRAM_17810[gUnknown_02024A60].unk4 = 0; + gUnknown_03004330[gUnknown_02024A60] = sub_811FA5C; + } + else + { + FreeSpriteOamMatrix(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); + DestroySprite(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); + sub_8043DB0(gUnknown_03004340[gUnknown_02024A60]); + dp01_tbl3_exec_completed(); + } +} -- cgit v1.2.3 From 6e203fc646494445f28670f14a95067d58d3785d Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 7 Jun 2017 12:12:40 -0500 Subject: decompile sub_811FA5C --- src/battle_811DA74.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/battle_811DA74.c b/src/battle_811DA74.c index 1cb2d620e..717562f84 100644 --- a/src/battle_811DA74.c +++ b/src/battle_811DA74.c @@ -21,11 +21,9 @@ struct UnknownStruct2 { u8 unk0; u8 unk1; - //u8 filler2[7]; u8 filler2[2]; u8 unk4; u8 filler5[4]; - u8 unk9; u8 fillerA[2]; }; @@ -1020,3 +1018,23 @@ void sub_811F9D0(void) dp01_tbl3_exec_completed(); } } + +void sub_811FA5C(void) +{ + switch (EWRAM_17810[gUnknown_02024A60].unk4) + { + case 0: + if (EWRAM_17800[gUnknown_02024A60 * 4] & 4) + move_anim_start_t4(gUnknown_02024A60, gUnknown_02024A60, gUnknown_02024A60, 5); + EWRAM_17810[gUnknown_02024A60].unk4 = 1; + break; + case 1: + if (!(EWRAM_17810[gUnknown_02024A60].unk0 & 0x40)) + { + EWRAM_17810[gUnknown_02024A60].unk4 = 0; + move_anim_start_t4(gUnknown_02024A60, gUnknown_02024A60, gUnknown_02024A60, 1); + gUnknown_03004330[gUnknown_02024A60] = sub_811DF34; + } + break; + } +} -- cgit v1.2.3 From 61101812ca750393ba24cae103cb86b40001251a Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 7 Jun 2017 14:09:45 -0500 Subject: decompile sub_811FAE4 - sub_811FCE8 --- src/battle_811DA74.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/battle_ai.c | 2 +- 2 files changed, 78 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/battle_811DA74.c b/src/battle_811DA74.c index 717562f84..9be2cfe21 100644 --- a/src/battle_811DA74.c +++ b/src/battle_811DA74.c @@ -1,11 +1,14 @@ #include "global.h" #include "asm.h" +#include "battle.h" +#include "data2.h" #include "link.h" #include "m4a.h" #include "main.h" #include "palette.h" #include "pokemon.h" #include "sound.h" +#include "songs.h" #include "sprite.h" #include "string_util.h" #include "text.h" @@ -59,6 +62,13 @@ extern u8 unk_2000000[]; #define EWRAM_17800 ((u8 *)(unk_2000000 + 0x17800)) #define EWRAM_17810 ((struct UnknownStruct2 *)(unk_2000000 + 0x17810)) +extern void oamt_add_pos2_onto_pos1(); +extern void oamt_set_x3A_32(); +extern void sub_8078B34(struct Sprite *); +extern void sub_80105EC(struct Sprite *); +extern s32 sub_803FC34(u16); +extern void sub_8031AF4(); +extern void sub_80313A0(struct Sprite *); extern u8 sub_8046400(); extern void sub_80312F0(struct Sprite *); extern u8 CreateInvisibleSpriteWithCallback(); @@ -1038,3 +1048,70 @@ void sub_811FA5C(void) break; } } + +void sub_811FAE4(void) +{ + s16 xOffset; + u32 gender; + + if (gBattleTypeFlags & BATTLE_TYPE_MULTI) + { + if (battle_get_per_side_status(gUnknown_02024A60) & 2) + xOffset = 16; + else + xOffset = -16; + gender = gLinkPlayers[sub_803FC34(gUnknown_02024A60)].gender; + } + else + { + xOffset = 0; + gender = gLinkPlayers[GetMultiplayerId() ^ 1].gender; + } + sub_8031AF4(gender, gUnknown_02024A60); + GetMonSpriteTemplate_803C5A0(gender, battle_get_per_side_status(gUnknown_02024A60)); + gUnknown_02024BE0[gUnknown_02024A60] = CreateSprite( + &gUnknown_02024E8C, + 80 + xOffset, 80 + 4 * (8 - gTrainerBackPicCoords[gender].coords), + sub_8079E90(gUnknown_02024A60)); + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].oam.paletteNum = gUnknown_02024A60; + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].pos2.x = 240; + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data0 = -2; + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].callback = sub_80313A0; + gUnknown_03004330[gUnknown_02024A60] = sub_811DAE4; +} + +void sub_811FC30(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_811FC3C(void) +{ + oamt_add_pos2_onto_pos1(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data0 = 35; + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data2 = -40; + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data4 = gSprites[gUnknown_02024BE0[gUnknown_02024A60]].pos1.y; + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].callback = sub_8078B34; + oamt_set_x3A_32(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]], SpriteCallbackDummy); + gUnknown_03004330[gUnknown_02024A60] = sub_811DB1C; +} + +void sub_811FCE8(void) +{ + if (EWRAM_17810[gUnknown_02024A60].unk4 == 0) + { + if (EWRAM_17800[gUnknown_02024A60 * 4] & 4) + move_anim_start_t4(gUnknown_02024A60, gUnknown_02024A60, gUnknown_02024A60, 5); + EWRAM_17810[gUnknown_02024A60].unk4++; + } + else if (!(EWRAM_17810[gUnknown_02024A60].unk0 & 0x40)) + { + EWRAM_17810[gUnknown_02024A60].unk4 = 0; + sub_80324F8(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], gUnknown_02024A60); + PlaySE12WithPanning(SE_POKE_DEAD, -64); + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data1 = 0; + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data2 = 5; + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].callback = sub_80105EC; + gUnknown_03004330[gUnknown_02024A60] = sub_811DE98; + } +} diff --git a/src/battle_ai.c b/src/battle_ai.c index f10c6a013..dbd926000 100644 --- a/src/battle_ai.c +++ b/src/battle_ai.c @@ -269,7 +269,7 @@ void BattleAI_HandleItemUseBeforeAISetup(void) s32 i; u8 *data = (u8 *)UNK_2016A00_STRUCT; - for (i = 0; (u32)i < sizeof(struct UnknownStruct1); i++) + for (i = 0; (u32)i < sizeof(struct UnkBattleStruct1); i++) data[i] = 0; if ((gBattleTypeFlags & BATTLE_TYPE_TRAINER) -- cgit v1.2.3 From 7639d3802470825ea4ac1c2ab52173b2ce86c8e6 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 7 Jun 2017 14:12:35 -0500 Subject: decompile sub_811FDCC - sub_811FDF0 --- src/battle_811DA74.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src') diff --git a/src/battle_811DA74.c b/src/battle_811DA74.c index 9be2cfe21..12991c60f 100644 --- a/src/battle_811DA74.c +++ b/src/battle_811DA74.c @@ -1115,3 +1115,23 @@ void sub_811FCE8(void) gUnknown_03004330[gUnknown_02024A60] = sub_811DE98; } } + +void sub_811FDCC(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_811FDD8(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_811FDE4(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_811FDF0(void) +{ + dp01_tbl3_exec_completed(); +} -- cgit v1.2.3 From 3c700c6eb77be99f7864e52e8f3747491f050265 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 7 Jun 2017 14:33:21 -0500 Subject: decompile sub_811FDFC --- src/battle_811DA74.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'src') diff --git a/src/battle_811DA74.c b/src/battle_811DA74.c index 12991c60f..8152645bc 100644 --- a/src/battle_811DA74.c +++ b/src/battle_811DA74.c @@ -48,7 +48,14 @@ extern u32 gUnknown_02024A64; extern u16 gUnknown_02024A6A[]; extern u8 gUnknown_02024BE0[]; extern u8 gUnknown_02024E6D; +extern u32 gUnknown_02024E70[]; extern struct SpriteTemplate gUnknown_02024E8C; +extern u32 *gUnknown_0202F7B4; +extern u32 gUnknown_0202F7B8; +extern u16 gUnknown_0202F7BC; +extern u8 gUnknown_0202F7BE; +extern u16 gUnknown_0202F7C0; +extern u8 gUnknown_0202F7C4; extern struct Window gUnknown_03004210; extern MainCallback gUnknown_030042D0; extern void (*gUnknown_03004330[])(void); @@ -62,6 +69,8 @@ extern u8 unk_2000000[]; #define EWRAM_17800 ((u8 *)(unk_2000000 + 0x17800)) #define EWRAM_17810 ((struct UnknownStruct2 *)(unk_2000000 + 0x17810)) +extern u8 sub_8031720(); +extern u8 mplay_80342A4(); extern void oamt_add_pos2_onto_pos1(); extern void oamt_set_x3A_32(); extern void sub_8078B34(struct Sprite *); @@ -100,6 +109,7 @@ u32 dp01_getattr_by_ch1_for_player_pokemon(u8 a, u8 *b); void sub_811EC68(u8); void sub_811F864(u8, u8); void sub_811FA5C(void); +void sub_811FF30(void); void nullsub_74(void) { @@ -1135,3 +1145,33 @@ void sub_811FDF0(void) { dp01_tbl3_exec_completed(); } + +void sub_811FDFC(void) +{ + if (mplay_80342A4(gUnknown_02024A60) == 0) + { + u32 r0 = gUnknown_02023A60[gUnknown_02024A60][1] + | (gUnknown_02023A60[gUnknown_02024A60][2] << 8); + + gUnknown_0202F7C4 = gUnknown_02023A60[gUnknown_02024A60][3]; + gUnknown_0202F7BC = gUnknown_02023A60[gUnknown_02024A60][4] + | (gUnknown_02023A60[gUnknown_02024A60][5] << 8); + gUnknown_0202F7B8 = gUnknown_02023A60[gUnknown_02024A60][6] + | (gUnknown_02023A60[gUnknown_02024A60][7] << 8) + | (gUnknown_02023A60[gUnknown_02024A60][8] << 16) + | (gUnknown_02023A60[gUnknown_02024A60][9] << 24); + gUnknown_0202F7BE = gUnknown_02023A60[gUnknown_02024A60][10]; + gUnknown_0202F7C0 = gUnknown_02023A60[gUnknown_02024A60][12] + | (gUnknown_02023A60[gUnknown_02024A60][13] << 8); + gUnknown_0202F7B4 = (u32 *)&gUnknown_02023A60[gUnknown_02024A60][16]; + gUnknown_02024E70[gUnknown_02024A60] = *gUnknown_0202F7B4; + + if (sub_8031720(r0, gUnknown_0202F7C4) != 0) + dp01_tbl3_exec_completed(); + else + { + EWRAM_17810[gUnknown_02024A60].unk4 = 0; + gUnknown_03004330[gUnknown_02024A60] = sub_811FF30; + } + } +} -- cgit v1.2.3 From 585cab7a47066e5e70d89180e7e7154652058400 Mon Sep 17 00:00:00 2001 From: scnorton Date: Wed, 7 Jun 2017 15:45:12 -0400 Subject: sub_8086870 (nonmatching) --- src/field_effect.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 91 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index ad8fa3648..a40b6d0cb 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -894,10 +894,10 @@ void sub_8086774(u8 taskId) { struct Task *task; task = &gTasks[taskId]; - while (gUnknown_0839F2CC[task->data[0]](task)); + while (gUnknown_0839F2CC[task->data[0]](task)); // return code signifies whether to continue blocking here } -bool8 sub_80867AC(struct Task *task) +bool8 sub_80867AC(struct Task *task) // gUnknown_0839F2CC[0] { struct MapObject *playerObject; struct Sprite *playerSprite; @@ -908,9 +908,97 @@ bool8 sub_80867AC(struct Task *task) gPlayerAvatar.unk6 = 1; FieldObjectSetSpecialAnim(playerObject, GetFaceDirectionAnimId(player_get_direction_lower_nybble())); task->data[4] = playerSprite->subspriteMode; - playerObject->mapobj_bit_27 = 1; + playerObject->mapobj_bit_26 = 1; playerSprite->oam.priority = 1; playerSprite->subspriteMode = 2; task->data[0]++; + return TRUE; +} + +bool8 sub_8086854(struct Task *task) // gUnknown_0839F2CC[1] +{ + if (sub_807D770()) + { + task->data[0]++; + } + return FALSE; +} + +#ifdef NONMATCHING +bool8 sub_8086870(struct Task *task) // gUnknown_0839F2CC[2] +{ + struct Sprite *sprite; + s16 centerToCornerVecY; + int ctcvy; + sprite = &gSprites[gPlayerAvatar.spriteId]; + centerToCornerVecY = sprite->centerToCornerVecY; + ctcvy = -(centerToCornerVecY << 17); + sprite->pos2.y = -((sprite->pos1.y + centerToCornerVecY + gSpriteCoordOffsetY) + (ctcvy >> 16)); + task->data[1] = 1; + task->data[2] = 0; + gMapObjects[gPlayerAvatar.mapObjectId].mapobj_bit_13 = 0; + PlaySE(SE_RU_HYUU); + task->data[0]++; + return FALSE; } +#else +__attribute__((naked)) +bool8 sub_8086870(struct Task *task) // gUnknown_0839F2CC[2] +{ + asm_unified("\tpush {r4-r6,lr}\n" + "\tadds r5, r0, 0\n" + "\tldr r6, _080868D4 @ =gPlayerAvatar\n" + "\tldrb r0, [r6, 0x4]\n" + "\tlsls r2, r0, 4\n" + "\tadds r2, r0\n" + "\tlsls r2, 2\n" + "\tldr r0, _080868D8 @ =gSprites\n" + "\tadds r2, r0\n" + "\tadds r0, r2, 0\n" + "\tadds r0, 0x29\n" + "\tmovs r4, 0\n" + "\tldrsb r4, [r0, r4] @ =gSprites[gPlayerAvatar.spriteId].centerToCornerVecY\n" + "\tlsls r0, r4, 17\n" + "\tnegs r0, r0\n" + "\tldrh r1, [r2, 0x22] @ =gSprites[gPlayerAvatar.spriteId].pos1.y\n" + "\tldr r3, _080868DC @ =gSpriteCoordOffsetY\n" + "\tadds r1, r4\n" + "\tldrh r3, [r3]\n" + "\tadds r1, r3\n" + "\tasrs r0, 16\n" + "\tadds r0, r1\n" + "\tnegs r0, r0\n" + "\tmovs r1, 0\n" + "\tstrh r0, [r2, 0x26]\n" + "\tmovs r0, 0x1\n" + "\tstrh r0, [r5, 0xA]\n" + "\tstrh r1, [r5, 0xC]\n" + "\tldr r2, _080868E0 @ =gMapObjects\n" + "\tldrb r0, [r6, 0x5]\n" + "\tlsls r1, r0, 3\n" + "\tadds r1, r0\n" + "\tlsls r1, 2\n" + "\tadds r1, r2\n" + "\tldrb r2, [r1, 0x1]\n" + "\tmovs r0, 0x21\n" + "\tnegs r0, r0\n" + "\tands r0, r2\n" + "\tstrb r0, [r1, 0x1]\n" + "\tmovs r0, 0x2B\n" + "\tbl PlaySE\n" + "\tldrh r0, [r5, 0x8]\n" + "\tadds r0, 0x1\n" + "\tstrh r0, [r5, 0x8]\n" + "\tmovs r0, 0\n" + "\tpop {r4-r6}\n" + "\tpop {r1}\n" + "\tbx r1\n" + "\t.align 2, 0\n" + "_080868D4: .4byte gPlayerAvatar\n" + "_080868D8: .4byte gSprites\n" + "_080868DC: .4byte gSpriteCoordOffsetY\n" + "_080868E0: .4byte gMapObjects"); +} +#endif + -- cgit v1.2.3 From a6e1eb7f7522c3fef4a6c93c37c1a138524a1aa2 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 7 Jun 2017 15:23:27 -0500 Subject: decompile sub_811FF30 --- src/battle_2.c | 2 +- src/battle_811DA74.c | 130 ++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 98 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/battle_2.c b/src/battle_2.c index e5091bd08..79d62ce69 100644 --- a/src/battle_2.c +++ b/src/battle_2.c @@ -1821,7 +1821,7 @@ void sub_8010874(void) void sub_8010B88(void) { - struct UnknownStruct4 sp0 = gUnknown_02024CA8[gUnknown_02024A60]; + struct UnkBattleStruct4 sp0 = gUnknown_02024CA8[gUnknown_02024A60]; s32 i; u8 *ptr; u32 *ptr2; diff --git a/src/battle_811DA74.c b/src/battle_811DA74.c index 8152645bc..a1b41d7bb 100644 --- a/src/battle_811DA74.c +++ b/src/battle_811DA74.c @@ -39,6 +39,13 @@ struct UnknownStruct3 u8 ppBonuses; }; +struct UnknownStruct4 +{ + u8 unk0_0:2; + u8 unk0_2:1; + u8 unk0_3:1; +}; + extern u32 gBitTable[]; extern u16 gBattleTypeFlags; @@ -62,13 +69,19 @@ extern void (*gUnknown_03004330[])(void); extern u8 gUnknown_03004340[]; extern u8 gUnknown_0300434C[]; extern u8 gBattleMonForms[]; +extern u8 gAnimScriptActive; +extern void (*gAnimScriptCallback)(void); extern void (*const gUnknown_083FE4F4[])(void); -extern u8 unk_2000000[]; +extern u8 ewram[]; -#define EWRAM_17800 ((u8 *)(unk_2000000 + 0x17800)) -#define EWRAM_17810 ((struct UnknownStruct2 *)(unk_2000000 + 0x17810)) +#define ewram17800 ((struct UnknownStruct4 *)(ewram + 0x17800)) +#define ewram17810 ((struct UnknownStruct2 *)(ewram + 0x17810)) +extern void sub_8031F24(void); +extern void sub_80326EC(); +extern void ExecuteMoveAnim(); +extern void sub_80324BC(); extern u8 sub_8031720(); extern u8 mplay_80342A4(); extern void oamt_add_pos2_onto_pos1(); @@ -150,9 +163,9 @@ void sub_811DB1C(void) void sub_811DB84(void) { - if ((--EWRAM_17810[gUnknown_02024A60].unk9) == 0xFF) + if ((--ewram17810[gUnknown_02024A60].unk9) == 0xFF) { - EWRAM_17810[gUnknown_02024A60].unk9 = 0; + ewram17810[gUnknown_02024A60].unk9 = 0; dp01_tbl3_exec_completed(); } } @@ -176,7 +189,7 @@ void sub_811DBC0(void) r6 = FALSE; if (r6) { - EWRAM_17810[gUnknown_02024A60].unk9 = 3; + ewram17810[gUnknown_02024A60].unk9 = 3; gUnknown_03004330[gUnknown_02024A60] = sub_811DB84; } } @@ -185,12 +198,12 @@ void sub_811DCA0(void) { u8 r2; - if (!(EWRAM_17810[gUnknown_02024A60].unk0 & 8)) + if (!(ewram17810[gUnknown_02024A60].unk0 & 8)) { - r2 = EWRAM_17810[gUnknown_02024A60 ^ 2].unk0 & 8; - if (!r2 && (++EWRAM_17810[gUnknown_02024A60].unk9) != 1) + r2 = ewram17810[gUnknown_02024A60 ^ 2].unk0 & 8; + if (!r2 && (++ewram17810[gUnknown_02024A60].unk9) != 1) { - EWRAM_17810[gUnknown_02024A60].unk9 = r2; + ewram17810[gUnknown_02024A60].unk9 = r2; if (IsDoubleBattle() && !(gBattleTypeFlags & 0x40)) { DestroySprite(&gSprites[gUnknown_0300434C[gUnknown_02024A60 ^ 2]]); @@ -202,7 +215,7 @@ void sub_811DCA0(void) sub_8045A5C(gUnknown_03004340[gUnknown_02024A60], &gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], 0); sub_804777C(gUnknown_02024A60); sub_8043DFC(gUnknown_03004340[gUnknown_02024A60]); - (s8)EWRAM_17810[4].unk9 &= ~1; + (s8)ewram17810[4].unk9 &= ~1; gUnknown_03004330[gUnknown_02024A60] = sub_811DBC0; } } @@ -246,7 +259,7 @@ void sub_811DE98(void) void sub_811DF34(void) { - if (!(EWRAM_17810[gUnknown_02024A60].unk0 & 0x40)) + if (!(ewram17810[gUnknown_02024A60].unk0 & 0x40)) { FreeSpriteOamMatrix(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); DestroySprite(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); @@ -285,7 +298,7 @@ void sub_811E034(void) { if (gSprites[gUnknown_03004340[gUnknown_02024A60]].callback == SpriteCallbackDummy) { - if (EWRAM_17800[gUnknown_02024A60 * 4] & 4) + if (ewram17800[gUnknown_02024A60].unk0_2) move_anim_start_t4(gUnknown_02024A60, gUnknown_02024A60, gUnknown_02024A60, 6); gUnknown_03004330[gUnknown_02024A60] = sub_811E0A0; } @@ -293,16 +306,16 @@ void sub_811E034(void) void sub_811E0A0(void) { - if (!(EWRAM_17810[gUnknown_02024A60].unk0 & 0x40)) + if (!(ewram17810[gUnknown_02024A60].unk0 & 0x40)) dp01_tbl3_exec_completed(); } void sub_811E0CC(void) { - if (EWRAM_17810[gUnknown_02024A60].unk1 & 1) + if (ewram17810[gUnknown_02024A60].unk1 & 1) { - EWRAM_17810[gUnknown_02024A60].unk0 &= 0x7F; - (s8)EWRAM_17810[gUnknown_02024A60].unk1 &= ~1; + ewram17810[gUnknown_02024A60].unk0 &= 0x7F; + (s8)ewram17810[gUnknown_02024A60].unk1 &= ~1; FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); CreateTask(c3_0802FDF4, 10); @@ -318,10 +331,10 @@ void sub_811E0CC(void) void sub_811E1BC(void) { - if (!(EWRAM_17810[gUnknown_02024A60].unk0 & 0x88)) + if (!(ewram17810[gUnknown_02024A60].unk0 & 0x88)) sub_8141828(gUnknown_02024A60, &gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]]); if (gSprites[gUnknown_0300434C[gUnknown_02024A60]].callback == SpriteCallbackDummy - && !(EWRAM_17810[gUnknown_02024A60].unk0 & 8)) + && !(ewram17810[gUnknown_02024A60].unk0 & 8)) { DestroySprite(&gSprites[gUnknown_0300434C[gUnknown_02024A60]]); gUnknown_03004330[gUnknown_02024A60] = sub_811E0CC; @@ -377,13 +390,13 @@ void dp01_tbl3_exec_completed(void) void sub_811E38C(void) { - if (!(EWRAM_17810[gUnknown_02024A60].unk0 & 0x10)) + if (!(ewram17810[gUnknown_02024A60].unk0 & 0x10)) dp01_tbl3_exec_completed(); } void sub_811E3B8(void) { - if (!(EWRAM_17810[gUnknown_02024A60].unk0 & 0x20)) + if (!(ewram17810[gUnknown_02024A60].unk0 & 0x20)) dp01_tbl3_exec_completed(); } @@ -1027,7 +1040,7 @@ void sub_811F9D0(void) { if (gUnknown_02023A60[gUnknown_02024A60][1] == 0) { - EWRAM_17810[gUnknown_02024A60].unk4 = 0; + ewram17810[gUnknown_02024A60].unk4 = 0; gUnknown_03004330[gUnknown_02024A60] = sub_811FA5C; } else @@ -1041,17 +1054,17 @@ void sub_811F9D0(void) void sub_811FA5C(void) { - switch (EWRAM_17810[gUnknown_02024A60].unk4) + switch (ewram17810[gUnknown_02024A60].unk4) { case 0: - if (EWRAM_17800[gUnknown_02024A60 * 4] & 4) + if (ewram17800[gUnknown_02024A60].unk0_2) move_anim_start_t4(gUnknown_02024A60, gUnknown_02024A60, gUnknown_02024A60, 5); - EWRAM_17810[gUnknown_02024A60].unk4 = 1; + ewram17810[gUnknown_02024A60].unk4 = 1; break; case 1: - if (!(EWRAM_17810[gUnknown_02024A60].unk0 & 0x40)) + if (!(ewram17810[gUnknown_02024A60].unk0 & 0x40)) { - EWRAM_17810[gUnknown_02024A60].unk4 = 0; + ewram17810[gUnknown_02024A60].unk4 = 0; move_anim_start_t4(gUnknown_02024A60, gUnknown_02024A60, gUnknown_02024A60, 1); gUnknown_03004330[gUnknown_02024A60] = sub_811DF34; } @@ -1108,15 +1121,15 @@ void sub_811FC3C(void) void sub_811FCE8(void) { - if (EWRAM_17810[gUnknown_02024A60].unk4 == 0) + if (ewram17810[gUnknown_02024A60].unk4 == 0) { - if (EWRAM_17800[gUnknown_02024A60 * 4] & 4) + if (ewram17800[gUnknown_02024A60].unk0_2) move_anim_start_t4(gUnknown_02024A60, gUnknown_02024A60, gUnknown_02024A60, 5); - EWRAM_17810[gUnknown_02024A60].unk4++; + ewram17810[gUnknown_02024A60].unk4++; } - else if (!(EWRAM_17810[gUnknown_02024A60].unk0 & 0x40)) + else if (!(ewram17810[gUnknown_02024A60].unk0 & 0x40)) { - EWRAM_17810[gUnknown_02024A60].unk4 = 0; + ewram17810[gUnknown_02024A60].unk4 = 0; sub_80324F8(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], gUnknown_02024A60); PlaySE12WithPanning(SE_POKE_DEAD, -64); gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data1 = 0; @@ -1170,8 +1183,59 @@ void sub_811FDFC(void) dp01_tbl3_exec_completed(); else { - EWRAM_17810[gUnknown_02024A60].unk4 = 0; + ewram17810[gUnknown_02024A60].unk4 = 0; gUnknown_03004330[gUnknown_02024A60] = sub_811FF30; } } } + +void sub_811FF30(void) +{ + u16 r4 = gUnknown_02023A60[gUnknown_02024A60][1] + | (gUnknown_02023A60[gUnknown_02024A60][2] << 8); + u8 r7 = gUnknown_02023A60[gUnknown_02024A60][11]; + + switch (ewram17810[gUnknown_02024A60].unk4) + { + case 0: + if (ewram17800[gUnknown_02024A60].unk0_2 && !ewram17800[gUnknown_02024A60].unk0_3) + { + ewram17800[gUnknown_02024A60].unk0_3 = 1; + move_anim_start_t4(gUnknown_02024A60, gUnknown_02024A60, gUnknown_02024A60, 5); + } + ewram17810[gUnknown_02024A60].unk4 = 1; + break; + case 1: + if (!(ewram17810[gUnknown_02024A60].unk0 & 0x40)) + { + sub_80326EC(0); + ExecuteMoveAnim(r4); + ewram17810[gUnknown_02024A60].unk4 = 2; + } + break; + case 2: + gAnimScriptCallback(); + if (!gAnimScriptActive) + { + sub_80326EC(1); + if ((ewram17800[gUnknown_02024A60].unk0_2) && r7 <= 1) + { + move_anim_start_t4(gUnknown_02024A60, gUnknown_02024A60, gUnknown_02024A60, 6); + ewram17800[gUnknown_02024A60].unk0_3 = 0; + } + ewram17810[gUnknown_02024A60].unk4 = 3; + } + break; + case 3: + if (!(ewram17810[gUnknown_02024A60].unk0 & 0x40)) + { + sub_8031F24(); + sub_80324BC( + gUnknown_02024A60, + gUnknown_02023A60[gUnknown_02024A60][1] | (gUnknown_02023A60[gUnknown_02024A60][2] << 8)); + ewram17810[gUnknown_02024A60].unk4 = 0; + dp01_tbl3_exec_completed(); + } + break; + } +} -- cgit v1.2.3 From eed525462313d549da185d4caacc46a171a31de1 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 7 Jun 2017 15:35:51 -0500 Subject: decompile sub_8120094 - sub_8120140 --- src/battle_811DA74.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'src') diff --git a/src/battle_811DA74.c b/src/battle_811DA74.c index a1b41d7bb..f4e2cc57d 100644 --- a/src/battle_811DA74.c +++ b/src/battle_811DA74.c @@ -49,6 +49,7 @@ struct UnknownStruct4 extern u32 gBitTable[]; extern u16 gBattleTypeFlags; +extern u8 gUnknown_020238CC[]; extern u8 gUnknown_02023A60[][0x200]; extern u8 gUnknown_02024A60; extern u32 gUnknown_02024A64; @@ -64,6 +65,8 @@ extern u8 gUnknown_0202F7BE; extern u16 gUnknown_0202F7C0; extern u8 gUnknown_0202F7C4; extern struct Window gUnknown_03004210; +extern u16 gUnknown_030042A0; +extern u16 gUnknown_030042A4; extern MainCallback gUnknown_030042D0; extern void (*gUnknown_03004330[])(void); extern u8 gUnknown_03004340[]; @@ -78,6 +81,7 @@ extern u8 ewram[]; #define ewram17800 ((struct UnknownStruct4 *)(ewram + 0x17800)) #define ewram17810 ((struct UnknownStruct2 *)(ewram + 0x17810)) +extern void sub_8120AA8(); extern void sub_8031F24(void); extern void sub_80326EC(); extern void ExecuteMoveAnim(); @@ -1239,3 +1243,47 @@ void sub_811FF30(void) break; } } + +void sub_8120094(void) +{ + gUnknown_030042A4 = 0; + gUnknown_030042A0 = 0; + sub_8120AA8(*(u16 *)&gUnknown_02023A60[gUnknown_02024A60][2]); + sub_8002EB0(&gUnknown_03004210, gUnknown_020238CC, 144, 2, 15); + gUnknown_03004330[gUnknown_02024A60] = sub_811DFA0; +} + +void sub_81200F8(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_8120104(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_8120110(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_812011C(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_8120128(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_8120134(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_8120140(void) +{ + dp01_tbl3_exec_completed(); +} -- cgit v1.2.3 From f4463930f4776198a7d6f5d1aac425dfc05a0dbf Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 7 Jun 2017 15:47:12 -0500 Subject: decompile sub_812014C --- src/battle_811DA74.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src') diff --git a/src/battle_811DA74.c b/src/battle_811DA74.c index f4e2cc57d..dbd7f77e8 100644 --- a/src/battle_811DA74.c +++ b/src/battle_811DA74.c @@ -81,6 +81,8 @@ extern u8 ewram[]; #define ewram17800 ((struct UnknownStruct4 *)(ewram + 0x17800)) #define ewram17810 ((struct UnknownStruct2 *)(ewram + 0x17810)) +extern void load_gfxc_health_bar(); +extern void sub_8043D84(); extern void sub_8120AA8(); extern void sub_8031F24(void); extern void sub_80326EC(); @@ -1287,3 +1289,25 @@ void sub_8120140(void) { dp01_tbl3_exec_completed(); } + +void sub_812014C(void) +{ + s16 r7; + + load_gfxc_health_bar(0); + r7 = gUnknown_02023A60[gUnknown_02024A60][2] | (gUnknown_02023A60[gUnknown_02024A60][3] << 8); + if (r7 != 0x7FFF) + { + u32 maxHP = GetMonData(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], MON_DATA_MAX_HP); + u32 hp = GetMonData(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], MON_DATA_HP); + + sub_8043D84(gUnknown_02024A60, gUnknown_03004340[gUnknown_02024A60], maxHP, hp, r7); + } + else + { + u32 maxHP = GetMonData(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], MON_DATA_MAX_HP); + + sub_8043D84(gUnknown_02024A60, gUnknown_03004340[gUnknown_02024A60], maxHP, 0, r7); + } + gUnknown_03004330[gUnknown_02024A60] = bx_t3_healthbar_update; +} -- cgit v1.2.3 From 4e9e61ecb17fd11b126c34980eaa88e90e091368 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 7 Jun 2017 18:05:18 -0500 Subject: finish decompiling battle_811DA74 --- src/battle_811DA74.c | 353 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 351 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/battle_811DA74.c b/src/battle_811DA74.c index dbd7f77e8..24e509d94 100644 --- a/src/battle_811DA74.c +++ b/src/battle_811DA74.c @@ -1,6 +1,7 @@ #include "global.h" #include "asm.h" #include "battle.h" +#include "battle_interface.h" #include "data2.h" #include "link.h" #include "m4a.h" @@ -26,6 +27,20 @@ struct UnknownStruct2 u8 unk1; u8 filler2[2]; u8 unk4; + u8 unk5; + u8 filler6[3]; + u8 unk9; + u8 fillerA[2]; +}; + +struct UnknownStruct2_ +{ + u8 unk0_0:3; + u8 unk0_3:1; + u8 unk0_4:1; + u8 unk1; + u8 filler2[2]; + u8 unk4; u8 filler5[4]; u8 unk9; u8 fillerA[2]; @@ -46,15 +61,31 @@ struct UnknownStruct4 u8 unk0_3:1; }; +struct UnknownStruct5 +{ + u8 unk0_0:7; + u8 unk0_7:1; +}; + +struct UnknownStruct6 +{ + u8 filler0[9]; + u8 unk9; +}; + extern u32 gBitTable[]; extern u16 gBattleTypeFlags; +extern struct UnknownStruct5 gUnknown_020238C8; extern u8 gUnknown_020238CC[]; extern u8 gUnknown_02023A60[][0x200]; extern u8 gUnknown_02024A60; extern u32 gUnknown_02024A64; extern u16 gUnknown_02024A6A[]; extern u8 gUnknown_02024BE0[]; +extern u8 gUnknown_02024D26; +extern u16 gUnknown_02024DE8; +extern u8 gUnknown_02024E68[]; extern u8 gUnknown_02024E6D; extern u32 gUnknown_02024E70[]; extern struct SpriteTemplate gUnknown_02024E8C; @@ -80,7 +111,16 @@ extern u8 ewram[]; #define ewram17800 ((struct UnknownStruct4 *)(ewram + 0x17800)) #define ewram17810 ((struct UnknownStruct2 *)(ewram + 0x17810)) - +#define ewram17810_ ((struct UnknownStruct2_ *)(ewram + 0x17810)) +#define ewram17840 (*(struct UnknownStruct6 *)(ewram + 0x17840)) + +extern u8 move_anim_start_t3(); +extern u8 sub_8078874(); +extern void sub_8044CA0(u8); +extern void sub_8030E38(struct Sprite *); +extern void sub_80E43C0(); +extern void sub_8047858(); +extern void move_anim_start_t2_for_situation(); extern void load_gfxc_health_bar(); extern void sub_8043D84(); extern void sub_8120AA8(); @@ -108,7 +148,7 @@ extern void nullsub_10(); extern void sub_8045A5C(); extern void sub_804777C(); extern void sub_8043DFC(); -extern s16 sub_8045C78(); +//extern s16 sub_8045C78(); extern void sub_80440EC(); extern void sub_80324F8(); extern void nullsub_9(u16); @@ -129,6 +169,8 @@ void sub_811EC68(u8); void sub_811F864(u8, u8); void sub_811FA5C(void); void sub_811FF30(void); +void sub_812071C(u8); +void sub_81208E0(void); void nullsub_74(void) { @@ -205,6 +247,7 @@ void sub_811DCA0(void) u8 r2; if (!(ewram17810[gUnknown_02024A60].unk0 & 8)) + //if (!ewram17810_[gUnknown_02024A60].unk0_3) { r2 = ewram17810[gUnknown_02024A60 ^ 2].unk0 & 8; if (!r2 && (++ewram17810[gUnknown_02024A60].unk9) != 1) @@ -1311,3 +1354,309 @@ void sub_812014C(void) } gUnknown_03004330[gUnknown_02024A60] = bx_t3_healthbar_update; } + +void sub_812023C(void) +{ + dp01_tbl3_exec_completed(); +} + +struct MaybeABitfield +{ + u8 unk0_0:1; + u8 unk0_1:3; + u8 unk0_4:1; +}; + +void sub_8120248(void) +{ + if (mplay_80342A4(gUnknown_02024A60) == 0) + { + sub_8045A5C(gUnknown_03004340[gUnknown_02024A60], &gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], 9); + //ewram17810[gUnknown_02024A60].unk0 &= ~0x10; + //ewram17810_[gUnknown_02024A60].unk0_4 = 0; + ((struct MaybeABitfield *)&ewram17810[gUnknown_02024A60])->unk0_4 = 0; + gUnknown_03004330[gUnknown_02024A60] = sub_811E38C; + } +} + +void sub_81202BC(void) +{ + if (mplay_80342A4(gUnknown_02024A60) == 0) + { + move_anim_start_t2_for_situation( + gUnknown_02023A60[gUnknown_02024A60][1], + gUnknown_02023A60[gUnknown_02024A60][2] + | (gUnknown_02023A60[gUnknown_02024A60][3] << 8) + | (gUnknown_02023A60[gUnknown_02024A60][4] << 16) + | (gUnknown_02023A60[gUnknown_02024A60][5] << 24)); + gUnknown_03004330[gUnknown_02024A60] = sub_811E38C; + } +} + +void sub_8120324(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_8120330(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_812033C(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_8120348(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_8120354(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_8120360(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_812036C(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_8120378(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_8120384(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_8120390(void) +{ + gUnknown_020238C8.unk0_0 = 0; + dp01_tbl3_exec_completed(); +} + +void sub_81203AC(void) +{ + gUnknown_020238C8.unk0_0 = gUnknown_02023A60[gUnknown_02024A60][1]; + dp01_tbl3_exec_completed(); +} + +void sub_81203E4(void) +{ + gUnknown_020238C8.unk0_7 = 0; + dp01_tbl3_exec_completed(); +} + +void sub_81203FC(void) +{ + gUnknown_020238C8.unk0_7 ^= 1; + dp01_tbl3_exec_completed(); +} + +void dp01t_29_3_blink(void) +{ + if (gSprites[gUnknown_02024BE0[gUnknown_02024A60]].invisible == TRUE) + dp01_tbl3_exec_completed(); + else + { + gUnknown_02024E6D = 1; + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data1 = 0; + sub_8047858(gUnknown_02024A60); + gUnknown_03004330[gUnknown_02024A60] = bx_blink_t3; + } +} + +void sub_8120494(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_81204A0(void) +{ + s8 pan; + + if (battle_side_get_owner(gUnknown_02024A60) == 0) + pan = -64; + else + pan = 63; + PlaySE12WithPanning(gUnknown_02023A60[gUnknown_02024A60][1] | (gUnknown_02023A60[gUnknown_02024A60][2] << 8), pan); + dp01_tbl3_exec_completed(); +} + +void sub_81204E4(void) +{ + PlayFanfare(gUnknown_02023A60[gUnknown_02024A60][1] | (gUnknown_02023A60[gUnknown_02024A60][2] << 8)); + dp01_tbl3_exec_completed(); +} + +void sub_8120514(void) +{ + PlayCry3( + GetMonData(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], MON_DATA_SPECIES), + -25, 5); + dp01_tbl3_exec_completed(); +} + +void dp01t_2E_3_battle_intro(void) +{ + sub_80E43C0(gUnknown_02023A60[gUnknown_02024A60][1]); + gUnknown_02024DE8 |= 1; + dp01_tbl3_exec_completed(); +} + +void sub_8120588(void) +{ + u8 r4; + u8 taskId; + + oamt_add_pos2_onto_pos1(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data0 = 50; + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data2 = -40; + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data4 = gSprites[gUnknown_02024BE0[gUnknown_02024A60]].pos1.y; + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].callback = sub_8078B34; + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data5 = gUnknown_02024A60; + oamt_set_x3A_32(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]], sub_8030E38); + StartSpriteAnim(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]], 1); + r4 = AllocSpritePalette(0xD6F9); + LoadCompressedPalette( + gTrainerBackPicPaletteTable[gLinkPlayers[sub_803FC34(gUnknown_02024A60)].gender].data, + 0x100 + r4 * 16, 0x20); + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].oam.paletteNum = r4; + taskId = CreateTask(sub_812071C, 5); + gTasks[taskId].data[0] = gUnknown_02024A60; + if (ewram17810[gUnknown_02024A60].unk0 & 1) + gTasks[gUnknown_02024E68[gUnknown_02024A60]].func = sub_8044CA0; + ewram17840.unk9 |= 1; + gUnknown_03004330[gUnknown_02024A60] = nullsub_74; +} + +void sub_812071C(u8 taskId) +{ + u8 r9; + + if (gTasks[taskId].data[1] < 24) + { + gTasks[taskId].data[1]++; + return; + } + + r9 = gUnknown_02024A60; + gUnknown_02024A60 = gTasks[taskId].data[0]; + if (!IsDoubleBattle() || (gBattleTypeFlags & BATTLE_TYPE_MULTI)) + { + gUnknown_02023A60[gUnknown_02024A60][1] = gUnknown_02024A6A[gUnknown_02024A60]; + sub_811F864(gUnknown_02024A60, 0); + } + else + { + gUnknown_02023A60[gUnknown_02024A60][1] = gUnknown_02024A6A[gUnknown_02024A60]; + sub_811F864(gUnknown_02024A60, 0); + gUnknown_02024A60 ^= 2; + gUnknown_02023A60[gUnknown_02024A60][1] = gUnknown_02024A6A[gUnknown_02024A60]; + sub_80318FC(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], gUnknown_02024A60); + sub_811F864(gUnknown_02024A60, 0); + gUnknown_02024A60 ^= 2; + } + gUnknown_03004330[gUnknown_02024A60] = sub_811DCA0; + gUnknown_02024A60 = r9; + DestroyTask(taskId); +} + +void dp01t_30_3_80EB11C(void) +{ + if (gUnknown_02023A60[gUnknown_02024A60][1] != 0 && battle_side_get_owner(gUnknown_02024A60) == 0) + { + dp01_tbl3_exec_completed(); + return; + } + + //ewram17810[gUnknown_02024A60].unk0 |= 1; + ((struct MaybeABitfield *)&ewram17810[gUnknown_02024A60])->unk0_0 = 1; + gUnknown_02024E68[gUnknown_02024A60] = sub_8044804( + gUnknown_02024A60, + (struct BattleInterfaceStruct2 *)&gUnknown_02023A60[gUnknown_02024A60][4], + gUnknown_02023A60[gUnknown_02024A60][1], + gUnknown_02023A60[gUnknown_02024A60][2]); + ewram17810[gUnknown_02024A60].unk5 = 0; + if (gUnknown_02023A60[gUnknown_02024A60][2] != 0) + ewram17810[gUnknown_02024A60].unk5 = 0x5D; + gUnknown_03004330[gUnknown_02024A60] = sub_81208E0; +} + +void sub_81208E0(void) +{ + if (ewram17810[gUnknown_02024A60].unk5++ >= 93) + { + ewram17810[gUnknown_02024A60].unk5 = 0; + dp01_tbl3_exec_completed(); + } +} + +void sub_8120920(void) +{ + if (ewram17810[gUnknown_02024A60].unk0 & 1) + gTasks[gUnknown_02024E68[gUnknown_02024A60]].func = sub_8044CA0; + dp01_tbl3_exec_completed(); +} + +void sub_812096C(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_8120978(void) +{ + if (sub_8078874(gUnknown_02024A60) != 0) + { + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].invisible = gUnknown_02023A60[gUnknown_02024A60][1]; + sub_8031F88(gUnknown_02024A60); + } + dp01_tbl3_exec_completed(); +} + +void sub_81209D8(void) +{ + if (mplay_80342A4(gUnknown_02024A60) == 0) + { + u8 r3 = gUnknown_02023A60[gUnknown_02024A60][1]; + u16 r4 = gUnknown_02023A60[gUnknown_02024A60][2] | (gUnknown_02023A60[gUnknown_02024A60][3] << 8); + u8 var = gUnknown_02024A60; + + if (move_anim_start_t3(var, var, var, r3, r4) != 0) + dp01_tbl3_exec_completed(); + else + gUnknown_03004330[gUnknown_02024A60] = sub_811E3B8; + } +} + +void sub_8120A40(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_8120A4C(void) +{ + dp01_tbl3_exec_completed(); +} + +void sub_8120A58(void) +{ + gUnknown_02024D26 = gUnknown_02023A60[gUnknown_02024A60][1]; + FadeOutMapMusic(5); + BeginFastPaletteFade(3); + dp01_tbl3_exec_completed(); + gUnknown_03004330[gUnknown_02024A60] = sub_811E29C; +} + +void nullsub_75(void) +{ +} -- cgit v1.2.3 From e4ccb588f4104e7b800d1a18927536617e0e284a Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 7 Jun 2017 19:08:27 -0400 Subject: Fly-related functions? --- src/field_effect.c | 211 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 211 insertions(+) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index a40b6d0cb..664e59ecf 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -2,6 +2,7 @@ #include "asm.h" #include "data2.h" #include "script.h" +#include "trig.h" #include "main.h" #include "field_weather.h" #include "decompress.h" @@ -16,6 +17,7 @@ #include "field_player_avatar.h" #include "field_map_obj_helpers.h" #include "field_map_obj.h" +#include "field_camera.h" #include "field_effect.h" typedef bool8 (*FldEffCmd)(u8 **, u32 *); @@ -879,6 +881,7 @@ extern void pal_fill_for_map_transition(void); void sub_8086774(u8); extern const bool8 (*gUnknown_0839F2CC[7])(struct Task *); extern void CameraObjectReset2(void); +extern void CameraObjectReset1(void); void sub_8086748(void) { @@ -1001,4 +1004,212 @@ bool8 sub_8086870(struct Task *task) // gUnknown_0839F2CC[2] } #endif +bool8 sub_80868E4(struct Task *task) +{ + struct MapObject *mapObject; + struct Sprite *sprite; + + mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + sprite = &gSprites[gPlayerAvatar.spriteId]; + sprite->pos2.y += task->data[1]; + if (task->data[1] < 8) + { + task->data[2] += task->data[1]; + if (task->data[2] & 0xf) + { + task->data[1] <<= 1; + } + } + if (task->data[3] == 0 && sprite->pos2.y >= -16) + { + task->data[3]++; + mapObject->mapobj_bit_26 = 0; + sprite->subspriteMode = task->data[4]; + mapObject->mapobj_bit_2 = 1; + } + if (sprite->pos2.y >= 0) + { + PlaySE(SE_W070); + mapObject->mapobj_bit_3 = 1; + mapObject->mapobj_bit_5 = 1; + sprite->pos2.y = 0; + task->data[0]++; + } + return FALSE; +} + +bool8 sub_808699C(struct Task *task) +{ + task->data[0]++; + task->data[1] = 4; + task->data[2] = 0; + SetCameraPanningCallback(NULL); + return TRUE; +} + +bool8 sub_80869B8(struct Task *task) +{ + SetCameraPanning(0, task->data[1]); + task->data[1] = -task->data[1]; + task->data[2]++; + if ((task->data[2] & 3) == 0) + { + task->data[1] >>= 1; + } + if (task->data[1] == 0) + { + task->data[0]++; + } + return FALSE; +} + +bool8 sub_80869F8(struct Task *task) +{ + gPlayerAvatar.unk6 = 0; + ScriptContext2_Disable(); + CameraObjectReset1(); + UnfreezeMapObjects(); + InstallCameraPanAheadCallback(); + DestroyTask(FindTaskIdByFunc(sub_8086774)); + return FALSE; +} + +void sub_8086A68(u8); +extern const bool8 (*gUnknown_0839F2E8[6])(struct Task *); +extern void sub_80B4824(u8); +void sub_8086B98(struct Task *); +void sub_8086BE4(struct Task *); +void sub_8086C30(void); +void sub_8086C40(void); + +void sub_8086A2C(u8 a0, u8 priority) +{ + u8 taskId; + taskId = CreateTask(sub_8086A68, priority); + gTasks[taskId].data[1] = 0; + if (a0 == 0x6a) + { + gTasks[taskId].data[1] = 1; + } +} + +void sub_8086A68(u8 taskId) +{ + struct Task *task; + task = &gTasks[taskId]; + while (gUnknown_0839F2E8[task->data[0]](task)); +} + +bool8 sub_8086AA0(struct Task *task) +{ + FreezeMapObjects(); + CameraObjectReset2(); + sub_80B4824(task->data[1]); + task->data[0]++; + return FALSE; +} + +bool8 sub_8086AC0(struct Task *task) +{ + struct MapObject *mapObject; + mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + if (!FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive(mapObject) || FieldObjectClearAnimIfSpecialAnimFinished(mapObject)) + { + FieldObjectSetSpecialAnim(mapObject, GetFaceDirectionAnimId(player_get_direction_lower_nybble())); + task->data[0]++; + task->data[2] = 0; + task->data[3] = 0; + if ((u8)task->data[1] == 0) + { + task->data[0] = 4; + } + PlaySE(SE_ESUKA); + } + return FALSE; +} + +bool8 sub_8086B30(struct Task *task) +{ + sub_8086B98(task); + if (task->data[2] > 3) + { + sub_8086C30(); + task->data[0]++; + } + return FALSE; +} + +bool8 sub_8086B54(struct Task *task) +{ + sub_8086B98(task); + sub_8086C40(); + return FALSE; +} + +bool8 sub_8086B64(struct Task *task) +{ + sub_8086BE4(task); + if (task->data[2] > 3) + { + sub_8086C30(); + task->data[0]++; + } + return FALSE; +} + +bool8 sub_8086B88(struct Task *task) +{ + sub_8086BE4(task); + sub_8086C40(); + return FALSE; +} + +void sub_8086B98(struct Task *task) +{ + struct Sprite *sprite; + sprite = &gSprites[gPlayerAvatar.spriteId]; + sprite->pos2.x = Cos(0x84, task->data[2]); + sprite->pos2.y = Sin(0x94, task->data[2]); + task->data[3]++; + if (task->data[3] & 1) + { + task->data[2]++; + } +} +void sub_8086BE4(struct Task *task) +{ + struct Sprite *sprite; + sprite = &gSprites[gPlayerAvatar.spriteId]; + sprite->pos2.x = Cos(0x7c, task->data[2]); + sprite->pos2.y = Sin(0x76, task->data[2]); + task->data[3]++; + if (task->data[3] & 1) + { + task->data[2]++; + } +} + +extern void sub_8053FF8(void); +extern void fade_8080918(void); +bool8 sub_8054034(void); +void sub_8086C94(void); +void sub_80B483C(void); + +void sub_8086C30(void) +{ + sub_8053FF8(); + fade_8080918(); +} + +void sub_8086C40(void) +{ + if (!gPaletteFade.active && sub_8054034() == TRUE) + { + sub_80B483C(); + warp_in(); + gUnknown_0300485C = sub_8086C94; + SetMainCallback2(CB2_LoadMap); + DestroyTask(FindTaskIdByFunc(sub_8086A68)); + } +} -- cgit v1.2.3 From de2060410a6bd3c7939f246a982621873c49c8b0 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 7 Jun 2017 18:47:11 -0500 Subject: clean up battle_811DA74 a bit --- src/battle_811DA74.c | 74 ++++++++++++++++++++-------------------------------- 1 file changed, 28 insertions(+), 46 deletions(-) (limited to 'src') diff --git a/src/battle_811DA74.c b/src/battle_811DA74.c index 24e509d94..56a4bd0c4 100644 --- a/src/battle_811DA74.c +++ b/src/battle_811DA74.c @@ -23,25 +23,18 @@ struct UnknownStruct1 struct UnknownStruct2 { - u8 unk0; - u8 unk1; - u8 filler2[2]; - u8 unk4; - u8 unk5; - u8 filler6[3]; - u8 unk9; - u8 fillerA[2]; -}; - -struct UnknownStruct2_ -{ - u8 unk0_0:3; + u8 unk0_0:1; + u8 unk0_1:2; u8 unk0_3:1; u8 unk0_4:1; - u8 unk1; + u8 unk0_5:1; + u8 unk0_6:1; + u8 unk0_7:1; + u8 unk1_0:1; u8 filler2[2]; u8 unk4; - u8 filler5[4]; + u8 unk5; + u8 filler6[3]; u8 unk9; u8 fillerA[2]; }; @@ -111,7 +104,6 @@ extern u8 ewram[]; #define ewram17800 ((struct UnknownStruct4 *)(ewram + 0x17800)) #define ewram17810 ((struct UnknownStruct2 *)(ewram + 0x17810)) -#define ewram17810_ ((struct UnknownStruct2_ *)(ewram + 0x17810)) #define ewram17840 (*(struct UnknownStruct6 *)(ewram + 0x17840)) extern u8 move_anim_start_t3(); @@ -246,10 +238,10 @@ void sub_811DCA0(void) { u8 r2; - if (!(ewram17810[gUnknown_02024A60].unk0 & 8)) - //if (!ewram17810_[gUnknown_02024A60].unk0_3) + if (!ewram17810[gUnknown_02024A60].unk0_3) { - r2 = ewram17810[gUnknown_02024A60 ^ 2].unk0 & 8; + // I couldn't get it to work as a bitfield here + r2 = *((u8 *)&ewram17810[gUnknown_02024A60 ^ 2]) & 8; if (!r2 && (++ewram17810[gUnknown_02024A60].unk9) != 1) { ewram17810[gUnknown_02024A60].unk9 = r2; @@ -308,7 +300,7 @@ void sub_811DE98(void) void sub_811DF34(void) { - if (!(ewram17810[gUnknown_02024A60].unk0 & 0x40)) + if (!ewram17810[gUnknown_02024A60].unk0_6) { FreeSpriteOamMatrix(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); DestroySprite(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); @@ -355,16 +347,16 @@ void sub_811E034(void) void sub_811E0A0(void) { - if (!(ewram17810[gUnknown_02024A60].unk0 & 0x40)) + if (!ewram17810[gUnknown_02024A60].unk0_6) dp01_tbl3_exec_completed(); } void sub_811E0CC(void) { - if (ewram17810[gUnknown_02024A60].unk1 & 1) + if (ewram17810[gUnknown_02024A60].unk1_0) { - ewram17810[gUnknown_02024A60].unk0 &= 0x7F; - (s8)ewram17810[gUnknown_02024A60].unk1 &= ~1; + ewram17810[gUnknown_02024A60].unk0_7 = 0; + ewram17810[gUnknown_02024A60].unk1_0 = 0; FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); CreateTask(c3_0802FDF4, 10); @@ -380,10 +372,10 @@ void sub_811E0CC(void) void sub_811E1BC(void) { - if (!(ewram17810[gUnknown_02024A60].unk0 & 0x88)) + if (!ewram17810[gUnknown_02024A60].unk0_3 && !ewram17810[gUnknown_02024A60].unk0_7) sub_8141828(gUnknown_02024A60, &gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]]); if (gSprites[gUnknown_0300434C[gUnknown_02024A60]].callback == SpriteCallbackDummy - && !(ewram17810[gUnknown_02024A60].unk0 & 8)) + && !ewram17810[gUnknown_02024A60].unk0_3) { DestroySprite(&gSprites[gUnknown_0300434C[gUnknown_02024A60]]); gUnknown_03004330[gUnknown_02024A60] = sub_811E0CC; @@ -439,13 +431,13 @@ void dp01_tbl3_exec_completed(void) void sub_811E38C(void) { - if (!(ewram17810[gUnknown_02024A60].unk0 & 0x10)) + if (!ewram17810[gUnknown_02024A60].unk0_4) dp01_tbl3_exec_completed(); } void sub_811E3B8(void) { - if (!(ewram17810[gUnknown_02024A60].unk0 & 0x20)) + if (!ewram17810[gUnknown_02024A60].unk0_5) dp01_tbl3_exec_completed(); } @@ -1111,7 +1103,7 @@ void sub_811FA5C(void) ewram17810[gUnknown_02024A60].unk4 = 1; break; case 1: - if (!(ewram17810[gUnknown_02024A60].unk0 & 0x40)) + if (!ewram17810[gUnknown_02024A60].unk0_6) { ewram17810[gUnknown_02024A60].unk4 = 0; move_anim_start_t4(gUnknown_02024A60, gUnknown_02024A60, gUnknown_02024A60, 1); @@ -1176,7 +1168,7 @@ void sub_811FCE8(void) move_anim_start_t4(gUnknown_02024A60, gUnknown_02024A60, gUnknown_02024A60, 5); ewram17810[gUnknown_02024A60].unk4++; } - else if (!(ewram17810[gUnknown_02024A60].unk0 & 0x40)) + else if (!ewram17810[gUnknown_02024A60].unk0_6) { ewram17810[gUnknown_02024A60].unk4 = 0; sub_80324F8(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], gUnknown_02024A60); @@ -1255,7 +1247,7 @@ void sub_811FF30(void) ewram17810[gUnknown_02024A60].unk4 = 1; break; case 1: - if (!(ewram17810[gUnknown_02024A60].unk0 & 0x40)) + if (!ewram17810[gUnknown_02024A60].unk0_6) { sub_80326EC(0); ExecuteMoveAnim(r4); @@ -1276,7 +1268,7 @@ void sub_811FF30(void) } break; case 3: - if (!(ewram17810[gUnknown_02024A60].unk0 & 0x40)) + if (!ewram17810[gUnknown_02024A60].unk0_6) { sub_8031F24(); sub_80324BC( @@ -1360,21 +1352,12 @@ void sub_812023C(void) dp01_tbl3_exec_completed(); } -struct MaybeABitfield -{ - u8 unk0_0:1; - u8 unk0_1:3; - u8 unk0_4:1; -}; - void sub_8120248(void) { if (mplay_80342A4(gUnknown_02024A60) == 0) { sub_8045A5C(gUnknown_03004340[gUnknown_02024A60], &gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], 9); - //ewram17810[gUnknown_02024A60].unk0 &= ~0x10; - //ewram17810_[gUnknown_02024A60].unk0_4 = 0; - ((struct MaybeABitfield *)&ewram17810[gUnknown_02024A60])->unk0_4 = 0; + ewram17810[gUnknown_02024A60].unk0_4 = 0; gUnknown_03004330[gUnknown_02024A60] = sub_811E38C; } } @@ -1533,7 +1516,7 @@ void sub_8120588(void) gSprites[gUnknown_02024BE0[gUnknown_02024A60]].oam.paletteNum = r4; taskId = CreateTask(sub_812071C, 5); gTasks[taskId].data[0] = gUnknown_02024A60; - if (ewram17810[gUnknown_02024A60].unk0 & 1) + if (ewram17810[gUnknown_02024A60].unk0_0) gTasks[gUnknown_02024E68[gUnknown_02024A60]].func = sub_8044CA0; ewram17840.unk9 |= 1; gUnknown_03004330[gUnknown_02024A60] = nullsub_74; @@ -1579,8 +1562,7 @@ void dp01t_30_3_80EB11C(void) return; } - //ewram17810[gUnknown_02024A60].unk0 |= 1; - ((struct MaybeABitfield *)&ewram17810[gUnknown_02024A60])->unk0_0 = 1; + ewram17810[gUnknown_02024A60].unk0_0 = 1; gUnknown_02024E68[gUnknown_02024A60] = sub_8044804( gUnknown_02024A60, (struct BattleInterfaceStruct2 *)&gUnknown_02023A60[gUnknown_02024A60][4], @@ -1603,7 +1585,7 @@ void sub_81208E0(void) void sub_8120920(void) { - if (ewram17810[gUnknown_02024A60].unk0 & 1) + if (ewram17810[gUnknown_02024A60].unk0_0) gTasks[gUnknown_02024E68[gUnknown_02024A60]].func = sub_8044CA0; dp01_tbl3_exec_completed(); } -- cgit v1.2.3 From 3da6d1f0007a61e808a57bd33a5068a1a241bf5f Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 7 Jun 2017 21:14:40 -0400 Subject: okay this isn't fly, but wtf is it? whatever it is, it's finished --- src/field_effect.c | 142 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 136 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index 664e59ecf..f3319169f 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -1076,11 +1076,19 @@ bool8 sub_80869F8(struct Task *task) void sub_8086A68(u8); extern const bool8 (*gUnknown_0839F2E8[6])(struct Task *); +extern const bool8 (*gUnknown_0839F300[7])(struct Task *); extern void sub_80B4824(u8); +extern void sub_8053FF8(void); +extern void fade_8080918(void); + void sub_8086B98(struct Task *); void sub_8086BE4(struct Task *); void sub_8086C30(void); void sub_8086C40(void); +bool8 sub_8054034(void); +void sub_8086C94(void); +void sub_80B483C(void); +void sub_8086CBC(u8); void sub_8086A2C(u8 a0, u8 priority) { @@ -1190,12 +1198,6 @@ void sub_8086BE4(struct Task *task) } } -extern void sub_8053FF8(void); -extern void fade_8080918(void); -bool8 sub_8054034(void); -void sub_8086C94(void); -void sub_80B483C(void); - void sub_8086C30(void) { sub_8053FF8(); @@ -1213,3 +1215,131 @@ void sub_8086C40(void) DestroyTask(FindTaskIdByFunc(sub_8086A68)); } } + +void sub_8086C94(void) +{ + sub_8053E90(); + pal_fill_for_map_transition(); + ScriptContext2_Enable(); + CreateTask(sub_8086CBC, 0); + gUnknown_0300485C = NULL; +} + +void sub_8086CBC(u8 taskId) +{ + struct Task *task; + task = &gTasks[taskId]; + while (gUnknown_0839F300[task->data[0]](task)); +} + +bool8 sub_8086CF4(struct Task *task) +{ + struct MapObject *mapObject; + s16 x; + s16 y; + u8 behavior; + CameraObjectReset2(); + mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + FieldObjectSetSpecialAnim(mapObject, GetFaceDirectionAnimId(DIR_EAST)); + PlayerGetDestCoords(&x, &y); + behavior = MapGridGetMetatileBehaviorAt(x, y); + task->data[0]++; + task->data[1] = 16; + if (behavior == 0x6b) + { + behavior = 1; + task->data[0] = 3; + } else + { + behavior = 0; + } + sub_80B4824(behavior); + return TRUE; +} + +bool8 sub_8086D70(struct Task *task) +{ + struct Sprite *sprite; + sprite = &gSprites[gPlayerAvatar.spriteId]; + sprite->pos2.x = Cos(0x84, task->data[1]); + sprite->pos2.y = Sin(0x94, task->data[1]); + task->data[0]++; + return FALSE; +} + +bool8 sub_8086DB0(struct Task *task) +{ + struct Sprite *sprite; + sprite = &gSprites[gPlayerAvatar.spriteId]; + sprite->pos2.x = Cos(0x84, task->data[1]); + sprite->pos2.y = Sin(0x94, task->data[1]); + task->data[2]++; + if (task->data[2] & 1) + { + task->data[1]--; + } + if (task->data[1] == 0) + { + sprite->pos2.x = 0; + sprite->pos2.y = 0; + task->data[0] = 5; + } + return FALSE; +} + +bool8 sub_8086E10(struct Task *task) +{ + struct Sprite *sprite; + sprite = &gSprites[gPlayerAvatar.spriteId]; + sprite->pos2.x = Cos(0x7c, task->data[1]); + sprite->pos2.y = Sin(0x76, task->data[1]); + task->data[0]++; + return FALSE; +} + +bool8 sub_8086E50(struct Task *task) +{ + struct Sprite *sprite; + sprite = &gSprites[gPlayerAvatar.spriteId]; + sprite->pos2.x = Cos(0x7c, task->data[1]); + sprite->pos2.y = Sin(0x76, task->data[1]); + task->data[2]++; + if (task->data[2] & 1) + { + task->data[1]--; + } + if (task->data[1] == 0) + { + sprite->pos2.x = 0; + sprite->pos2.y = 0; + task->data[0]++; + } + return FALSE; +} + +extern bool8 sub_80B4850(void); + +bool8 sub_8086EB0(struct Task *task) +{ + if (sub_80B4850()) + { + return FALSE; + } + sub_80B483C(); + task->data[0]++; + return TRUE; +} + +bool8 sub_8086ED4(struct Task *task) +{ + struct MapObject *mapObject; + mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + if (FieldObjectClearAnimIfSpecialAnimFinished(mapObject)) + { + CameraObjectReset1(); + ScriptContext2_Disable(); + FieldObjectSetSpecialAnim(mapObject, GetGoSpeed0AnimId(DIR_EAST)); + DestroyTask(FindTaskIdByFunc(sub_8086CBC)); + } + return FALSE; +} -- cgit v1.2.3 From edf088a4dfdf65b28440bb74d8de1564f336beaa Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 7 Jun 2017 23:27:37 -0500 Subject: decompile sub_80312F0 - mplay_80342A4 --- src/battle_7.c | 244 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 244 insertions(+) create mode 100644 src/battle_7.c (limited to 'src') diff --git a/src/battle_7.c b/src/battle_7.c new file mode 100644 index 000000000..07bb1d99e --- /dev/null +++ b/src/battle_7.c @@ -0,0 +1,244 @@ +#include "global.h" +#include "asm.h" +// Include this when my other PR gets merged +//#include "battle.h" +#include "battle_anim.h" +#include "sound.h" +#include "sprite.h" +#include "task.h" +#include "gba/m4a_internal.h" + +// Probably the same one from battle_811DA74.c +struct UnknownStruct2_ +{ + u8 unk0_0:1; + u8 unk0_1:2; + u8 unk0_3:1; + u8 unk0_4:1; + u8 unk0_5:1; + u8 unk0_6:1; + u8 unk0_7:1; + u8 unk1_0:1; + u8 filler2[2]; + u8 unk4; + u8 unk5; + u8 filler6[2]; + u8 unk8; + u8 unk9; + u8 fillerA[2]; +}; + +struct UnknownStruct4 +{ + u8 unk0_0:2; + u8 unk0_2:1; + u8 unk0_3:1; +}; + +struct UnknownStruct6 +{ + u16 unk0; + u8 filler2[7]; + u8 unk9; +}; + +extern u8 ewram[]; + +#define ewram17800 ((struct UnknownStruct4 *)(ewram + 0x17800)) +#define ewram17810 ((struct UnknownStruct2_ *)(ewram + 0x17810)) +#define ewram17840 (*(struct UnknownStruct6 *)(ewram + 0x17840)) + +extern struct MusicPlayerInfo gMPlay_SE1; +extern struct MusicPlayerInfo gMPlay_SE2; +extern u8 gUnknown_02024A60; +extern u8 gUnknown_02024BE0[]; +extern u16 gUnknown_02024DE8; +extern u8 gBattleMonForms[]; +extern u8 gBattleAnimPlayerMonIndex; +extern u8 gBattleAnimEnemyMonIndex; +extern void (*gAnimScriptCallback)(void); +extern u8 gAnimScriptActive; +extern const u8 *const gBattleAnims_Unknown1[]; +extern const u8 *const gBattleAnims_Unknown2[]; + +extern void sub_80105DC(struct Sprite *); +extern void move_anim_start_t2(); +extern void refresh_graphics_maybe(); +extern void sub_80324E0(); + +void sub_80315E8(u8); +u8 sub_803163C(u8); +void sub_80316CC(u8); + +void sub_80312F0(struct Sprite *sprite) +{ + u8 spriteId = sprite->data1; + + if (gSprites[spriteId].affineAnimEnded && !gSprites[spriteId].invisible) + { + if (gSprites[spriteId].animPaused) + gSprites[spriteId].animPaused = FALSE; + else if (gSprites[spriteId].animEnded) + { + gSprites[spriteId].callback = sub_80105DC; + StartSpriteAffineAnim(&gSprites[spriteId], 0); + sprite->callback = SpriteCallbackDummy; + } + } +} + +void unref_sub_8031364(struct Sprite *sprite, bool8 stupid) +{ + sprite->animPaused = TRUE; + sprite->callback = SpriteCallbackDummy; + if (!stupid) + StartSpriteAffineAnim(sprite, 1); + else + StartSpriteAffineAnim(sprite, 1); + AnimateSprite(sprite); +} + +void sub_80313A0(struct Sprite *sprite) +{ + if (!(gUnknown_02024DE8 & 1)) + { + sprite->pos2.x += sprite->data0; + if (sprite->pos2.x == 0) + sprite->callback = SpriteCallbackDummy; + } +} + +void move_anim_start_t2_for_situation(u8 a, u32 b) +{ + ewram17810[gUnknown_02024A60].unk0_4 = 1; + if (a == 0) + { + if (b == 0x20) + move_anim_start_t2(gUnknown_02024A60, 6); + else if (b == 8 || (b & 0x80)) + move_anim_start_t2(gUnknown_02024A60, 0); + else if (b == 0x10) + move_anim_start_t2(gUnknown_02024A60, 2); + else if (b & 7) + move_anim_start_t2(gUnknown_02024A60, 4); + else if (b == 0x40) + move_anim_start_t2(gUnknown_02024A60, 5); + else + ewram17810[gUnknown_02024A60].unk0_4 = 0; + } + else + { + if (b & 0x000F0000) + move_anim_start_t2(gUnknown_02024A60, 3); + else if (b & 7) + move_anim_start_t2(gUnknown_02024A60, 1); + else if (b & 0x10000000) + move_anim_start_t2(gUnknown_02024A60, 7); + else if (b & 0x08000000) + move_anim_start_t2(gUnknown_02024A60, 8); + else if (b & 0x0000E000) + move_anim_start_t2(gUnknown_02024A60, 9); + else + ewram17810[gUnknown_02024A60].unk0_4 = 0; + } +} + +bool8 move_anim_start_t3(u8 a, u8 b, u8 c, u8 d, u16 e) +{ + u8 taskId; + + if (d == 0 && (e & 0x80)) + { + gBattleMonForms[a] = e & 0x7F; + return TRUE; + } + if (ewram17800[a].unk0_2 && sub_803163C(d) == 0) + return TRUE; + if (ewram17800[a].unk0_2 && d == 2 && gSprites[gUnknown_02024BE0[a]].invisible) + { + refresh_graphics_maybe(a, 1, gUnknown_02024BE0[a]); + sub_80324E0(a); + return TRUE; + } + gBattleAnimPlayerMonIndex = b; + gBattleAnimEnemyMonIndex = c; + ewram17840.unk0 = e; + DoMoveAnim(gBattleAnims_Unknown1, d, 0); + taskId = CreateTask(sub_80315E8, 10); + gTasks[taskId].data[0] = a; + ewram17810[gTasks[taskId].data[0]].unk0_5 = 1; + return FALSE; +} + +void sub_80315E8(u8 taskId) +{ + gAnimScriptCallback(); + if (!gAnimScriptActive) + { + ewram17810[gTasks[taskId].data[0]].unk0_5 = 0; + DestroyTask(taskId); + } +} + +u8 sub_803163C(u8 a) +{ + switch (a) + { + case 2: + case 10: + case 11: + case 12: + case 13: + case 17: + return 1; + default: + return 0; + } +} + +void move_anim_start_t4(u8 a, u8 b, u8 c, u8 d) +{ + u8 taskId; + + gBattleAnimPlayerMonIndex = b; + gBattleAnimEnemyMonIndex = c; + DoMoveAnim(gBattleAnims_Unknown2, d, 0); + taskId = CreateTask(sub_80316CC, 10); + gTasks[taskId].data[0] = a; + ewram17810[gTasks[taskId].data[0]].unk0_6 = 1; +} + +void sub_80316CC(u8 taskId) +{ + gAnimScriptCallback(); + if (!gAnimScriptActive) + { + ewram17810[gTasks[taskId].data[0]].unk0_6 = 0; + DestroyTask(taskId); + } +} + +u8 sub_8031720(int unused1, int unused2) +{ + return 0; +} + +bool8 mplay_80342A4(u8 a) +{ + u8 zero = 0; + + if (IsSEPlaying()) + { + ewram17810[a].unk8++; + if (ewram17810[gUnknown_02024A60].unk8 < 30) + return TRUE; + m4aMPlayStop(&gMPlay_SE1); + m4aMPlayStop(&gMPlay_SE2); + } + if (zero == 0) + { + ewram17810[a].unk8 = 0; + return FALSE; + } + return TRUE; +} -- cgit v1.2.3 From 5847f8186942d8180f8648e166111d9c0cb06ad8 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Thu, 8 Jun 2017 00:36:54 -0500 Subject: decompile sub_8031794 --- src/battle_7.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) (limited to 'src') diff --git a/src/battle_7.c b/src/battle_7.c index 07bb1d99e..8a2f462bd 100644 --- a/src/battle_7.c +++ b/src/battle_7.c @@ -3,7 +3,13 @@ // Include this when my other PR gets merged //#include "battle.h" #include "battle_anim.h" +#include "blend_palette.h" +#include "data2.h" +#include "decompress.h" +#include "palette.h" +#include "pokemon.h" #include "sound.h" +#include "species.h" #include "sprite.h" #include "task.h" #include "gba/m4a_internal.h" @@ -33,6 +39,7 @@ struct UnknownStruct4 u8 unk0_0:2; u8 unk0_2:1; u8 unk0_3:1; + u16 unk2; }; struct UnknownStruct6 @@ -53,6 +60,7 @@ extern struct MusicPlayerInfo gMPlay_SE2; extern u8 gUnknown_02024A60; extern u8 gUnknown_02024BE0[]; extern u16 gUnknown_02024DE8; +extern u32 gUnknown_02024E70[]; extern u8 gBattleMonForms[]; extern u8 gBattleAnimPlayerMonIndex; extern u8 gBattleAnimEnemyMonIndex; @@ -61,10 +69,12 @@ extern u8 gAnimScriptActive; extern const u8 *const gBattleAnims_Unknown1[]; extern const u8 *const gBattleAnims_Unknown2[]; +extern const u16 *pokemon_get_pal(struct Pokemon *); extern void sub_80105DC(struct Sprite *); extern void move_anim_start_t2(); extern void refresh_graphics_maybe(); extern void sub_80324E0(); +extern const u16 *species_and_otid_get_pal(); void sub_80315E8(u8); u8 sub_803163C(u8); @@ -242,3 +252,55 @@ bool8 mplay_80342A4(u8 a) } return TRUE; } + +void sub_8031794(struct Pokemon *pkmn, u8 b) +{ + u32 personalityValue; + u16 species; + u32 r7; + u32 otId; + u8 var; + u16 paletteOffset; + const u16 *palette; + + personalityValue = GetMonData(pkmn, MON_DATA_PERSONALITY); + if (ewram17800[b].unk2 == 0) + { + species = GetMonData(pkmn, MON_DATA_SPECIES); + r7 = personalityValue; + } + else + { + species = ewram17800[b].unk2; + r7 = gUnknown_02024E70[b]; + } + otId = GetMonData(pkmn, MON_DATA_OT_ID); + var = battle_get_per_side_status(b); + HandleLoadSpecialPokePic( + &gMonFrontPicTable[species], + gMonFrontPicCoords[species].coords, + gMonFrontPicCoords[species].y_offset, + 0x02000000, + gUnknown_081FAF4C[var], + species, + r7); + paletteOffset = 0x100 + b * 16; + if (ewram17800[b].unk2 == 0) + palette = pokemon_get_pal(pkmn); + else + palette = species_and_otid_get_pal(species, otId, personalityValue); + sub_800D238(palette, ewram); + LoadPalette(ewram, paletteOffset, 0x20); + LoadPalette(ewram, 0x80 + b * 16, 0x20); + if (species == SPECIES_CASTFORM) + { + paletteOffset = 0x100 + b * 16; + sub_800D238(palette, ewram + 0x16400); + LoadPalette(ewram + 0x16400 + gBattleMonForms[b] * 32, paletteOffset, 0x20); + } + if (ewram17800[b].unk2 != 0) + { + BlendPalette(paletteOffset, 16, 6, 0x7FFF); + CpuCopy32(gPlttBufferFaded + paletteOffset, gPlttBufferUnfaded + paletteOffset, 32); + } +} -- cgit v1.2.3 From f597469988d5d1e58fccb203c0e9de351b0c278e Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Thu, 8 Jun 2017 01:25:53 -0500 Subject: decompile sub_80318FC - unref_sub_8031BA0 --- src/battle_7.c | 140 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 140 insertions(+) (limited to 'src') diff --git a/src/battle_7.c b/src/battle_7.c index 8a2f462bd..567377222 100644 --- a/src/battle_7.c +++ b/src/battle_7.c @@ -58,6 +58,7 @@ extern u8 ewram[]; extern struct MusicPlayerInfo gMPlay_SE1; extern struct MusicPlayerInfo gMPlay_SE2; extern u8 gUnknown_02024A60; +extern u8 gUnknown_02024A72[]; extern u8 gUnknown_02024BE0[]; extern u16 gUnknown_02024DE8; extern u32 gUnknown_02024E70[]; @@ -68,6 +69,15 @@ extern void (*gAnimScriptCallback)(void); extern u8 gAnimScriptActive; extern const u8 *const gBattleAnims_Unknown1[]; extern const u8 *const gBattleAnims_Unknown2[]; +extern const struct SpriteSheet gTrainerFrontPicTable[]; +extern const struct MonCoords gTrainerFrontPicCoords[]; +extern const struct SpritePalette gTrainerFrontPicPaletteTable[]; +extern const struct SpriteSheet gUnknown_0820A47C; +extern const struct SpriteSheet gUnknown_0820A484; +extern const struct SpriteSheet gUnknown_0820A48C[]; +extern const struct SpriteSheet gUnknown_0820A49C[]; +extern const struct SpriteSheet gUnknown_0820A4B4[]; +extern const struct SpritePalette gUnknown_0820A4D4[]; extern const u16 *pokemon_get_pal(struct Pokemon *); extern void sub_80105DC(struct Sprite *); @@ -304,3 +314,133 @@ void sub_8031794(struct Pokemon *pkmn, u8 b) CpuCopy32(gPlttBufferFaded + paletteOffset, gPlttBufferUnfaded + paletteOffset, 32); } } + +void sub_80318FC(struct Pokemon *pkmn, u8 b) +{ + u32 personalityValue; + u16 species; + u32 r7; + u32 otId; + u8 var; + u16 paletteOffset; + const u16 *palette; + + personalityValue = GetMonData(pkmn, MON_DATA_PERSONALITY); + if (ewram17800[b].unk2 == 0) + { + species = GetMonData(pkmn, MON_DATA_SPECIES); + r7 = personalityValue; + } + else + { + species = ewram17800[b].unk2; + r7 = gUnknown_02024E70[b]; + } + otId = GetMonData(pkmn, MON_DATA_OT_ID); + var = battle_get_per_side_status(b); + HandleLoadSpecialPokePic( + &gMonBackPicTable[species], + gMonBackPicCoords[species].coords, + gMonBackPicCoords[species].y_offset, + 0x02000000, + gUnknown_081FAF4C[var], + species, + r7); + paletteOffset = 0x100 + b * 16; + if (ewram17800[b].unk2 == 0) + palette = pokemon_get_pal(pkmn); + else + palette = species_and_otid_get_pal(species, otId, personalityValue); + sub_800D238(palette, ewram); + LoadPalette(ewram, paletteOffset, 0x20); + LoadPalette(ewram, 0x80 + b * 16, 0x20); + if (species == SPECIES_CASTFORM) + { + paletteOffset = 0x100 + b * 16; + sub_800D238(palette, ewram + 0x16400); + LoadPalette(ewram + 0x16400 + gBattleMonForms[b] * 32, paletteOffset, 0x20); + } + if (ewram17800[b].unk2 != 0) + { + BlendPalette(paletteOffset, 16, 6, 0x7FFF); + CpuCopy32(gPlttBufferFaded + paletteOffset, gPlttBufferUnfaded + paletteOffset, 32); + } +} + +void unref_sub_8031A64(void) +{ +} + +void nullsub_9(u16 unused) +{ +} + +void sub_8031A6C(u16 a, u8 b) +{ + u8 status; + struct SpriteSheet spriteSheet; + + status = battle_get_per_side_status(b); + DecompressPicFromTable_2( + &gTrainerFrontPicTable[a], + gTrainerFrontPicCoords[a].coords, + gTrainerFrontPicCoords[a].y_offset, + (void *)0x02000000, + gUnknown_081FAF4C[status], + 0); + spriteSheet.data = gUnknown_081FAF4C[status]; + spriteSheet.size = gTrainerFrontPicTable[a].size; + spriteSheet.tag = gTrainerFrontPicTable[a].tag; + LoadCompressedObjectPic(&spriteSheet); + LoadCompressedObjectPalette(&gTrainerFrontPicPaletteTable[a]); +} + +void sub_8031AF4(u16 a, u8 b) +{ + u8 status; + + status = battle_get_per_side_status(b); + DecompressPicFromTable_2( + &gTrainerBackPicTable[a], + gTrainerBackPicCoords[a].coords, + gTrainerBackPicCoords[a].y_offset, + (void *)0x02000000, + gUnknown_081FAF4C[status], + 0); + LoadCompressedPalette(gTrainerBackPicPaletteTable[a].data, 0x100 + b * 16, 32); +} + +void nullsub_10(int unused) +{ +} + +void sub_8031B74(u16 a) +{ + FreeSpritePaletteByTag(gTrainerFrontPicPaletteTable[a].tag); + FreeSpriteTilesByTag(gTrainerFrontPicTable[a].tag); +} + +void unref_sub_8031BA0(void) +{ + u8 count; + u8 i; + + LoadSpritePalette(&gUnknown_0820A4D4[0]); + LoadSpritePalette(&gUnknown_0820A4D4[1]); + if (!IsDoubleBattle()) + { + LoadCompressedObjectPic(&gUnknown_0820A47C); + LoadCompressedObjectPic(&gUnknown_0820A484); + count = 2; + } + else + { + LoadCompressedObjectPic(&gUnknown_0820A48C[0]); + LoadCompressedObjectPic(&gUnknown_0820A48C[1]); + LoadCompressedObjectPic(&gUnknown_0820A49C[0]); + LoadCompressedObjectPic(&gUnknown_0820A49C[1]); + count = 4; + } + for (i = 0; i < count; i++) + LoadCompressedObjectPic(&gUnknown_0820A4B4[gUnknown_02024A72[i]]); +} -- cgit v1.2.3 From f4e3ad1d345a4ee2c54383d2edf0069bea9029ab Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Thu, 8 Jun 2017 11:43:00 -0500 Subject: decompile sub_8031C30 - load_gfxc_health_bar --- src/battle_7.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) (limited to 'src') diff --git a/src/battle_7.c b/src/battle_7.c index 567377222..0e77ec71a 100644 --- a/src/battle_7.c +++ b/src/battle_7.c @@ -62,6 +62,7 @@ extern u8 gUnknown_02024A72[]; extern u8 gUnknown_02024BE0[]; extern u16 gUnknown_02024DE8; extern u32 gUnknown_02024E70[]; +extern u16 gBattleTypeFlags; extern u8 gBattleMonForms[]; extern u8 gBattleAnimPlayerMonIndex; extern u8 gBattleAnimEnemyMonIndex; @@ -76,8 +77,10 @@ extern const struct SpriteSheet gUnknown_0820A47C; extern const struct SpriteSheet gUnknown_0820A484; extern const struct SpriteSheet gUnknown_0820A48C[]; extern const struct SpriteSheet gUnknown_0820A49C[]; +extern const struct SpriteSheet gUnknown_0820A4AC; extern const struct SpriteSheet gUnknown_0820A4B4[]; extern const struct SpritePalette gUnknown_0820A4D4[]; +extern const u8 gUnknown_08D09C48[]; extern const u16 *pokemon_get_pal(struct Pokemon *); extern void sub_80105DC(struct Sprite *); @@ -444,3 +447,62 @@ void unref_sub_8031BA0(void) for (i = 0; i < count; i++) LoadCompressedObjectPic(&gUnknown_0820A4B4[gUnknown_02024A72[i]]); } + +bool8 sub_8031C30(u8 a) +{ + bool8 retVal = FALSE; + + if (a != 0) + { + if (a == 1) + { + LoadSpritePalette(&gUnknown_0820A4D4[0]); + LoadSpritePalette(&gUnknown_0820A4D4[1]); + } + else if (!IsDoubleBattle()) + { + if (a == 2) + { + if (gBattleTypeFlags & 0x80) + LoadCompressedObjectPic(&gUnknown_0820A4AC); + else + LoadCompressedObjectPic(&gUnknown_0820A47C); + } + else if (a == 3) + LoadCompressedObjectPic(&gUnknown_0820A484); + else if (a == 4) + LoadCompressedObjectPic(&gUnknown_0820A4B4[gUnknown_02024A72[0]]); + else if (a == 5) + LoadCompressedObjectPic(&gUnknown_0820A4B4[gUnknown_02024A72[1]]); + else + retVal = TRUE; + } + else + { + if (a == 2) + LoadCompressedObjectPic(&gUnknown_0820A48C[0]); + else if (a == 3) + LoadCompressedObjectPic(&gUnknown_0820A48C[1]); + else if (a == 4) + LoadCompressedObjectPic(&gUnknown_0820A49C[0]); + else if (a == 5) + LoadCompressedObjectPic(&gUnknown_0820A49C[1]); + else if (a == 6) + LoadCompressedObjectPic(&gUnknown_0820A4B4[gUnknown_02024A72[0]]); + else if (a == 7) + LoadCompressedObjectPic(&gUnknown_0820A4B4[gUnknown_02024A72[1]]); + else if (a == 8) + LoadCompressedObjectPic(&gUnknown_0820A4B4[gUnknown_02024A72[2]]); + else if (a == 9) + LoadCompressedObjectPic(&gUnknown_0820A4B4[gUnknown_02024A72[3]]); + else + retVal = TRUE; + } + } + return retVal; +} + +void load_gfxc_health_bar(void) +{ + sub_800D238(gUnknown_08D09C48, (void *)0x02000000); +} -- cgit v1.2.3 From 49f1eec47221914975e257f3ea4a12d8edbfe376 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Thu, 8 Jun 2017 12:24:49 -0500 Subject: decompile battle_load_something - sub_8031F88 --- src/battle_7.c | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 112 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/battle_7.c b/src/battle_7.c index 0e77ec71a..9b73eb573 100644 --- a/src/battle_7.c +++ b/src/battle_7.c @@ -2,6 +2,7 @@ #include "asm.h" // Include this when my other PR gets merged //#include "battle.h" +#include "battle_interface.h" #include "battle_anim.h" #include "blend_palette.h" #include "data2.h" @@ -34,9 +35,10 @@ struct UnknownStruct2_ u8 fillerA[2]; }; -struct UnknownStruct4 +struct UnknownStruct4_ { - u8 unk0_0:2; + u8 unk0_0:1; + u8 unk0_1:1; u8 unk0_2:1; u8 unk0_3:1; u16 unk2; @@ -51,17 +53,20 @@ struct UnknownStruct6 extern u8 ewram[]; -#define ewram17800 ((struct UnknownStruct4 *)(ewram + 0x17800)) +#define ewram17800 ((struct UnknownStruct4_ *)(ewram + 0x17800)) #define ewram17810 ((struct UnknownStruct2_ *)(ewram + 0x17810)) #define ewram17840 (*(struct UnknownStruct6 *)(ewram + 0x17840)) extern struct MusicPlayerInfo gMPlay_SE1; extern struct MusicPlayerInfo gMPlay_SE2; extern u8 gUnknown_02024A60; +extern u8 gUnknown_02024A68; +extern u16 gUnknown_02024A6A[]; extern u8 gUnknown_02024A72[]; extern u8 gUnknown_02024BE0[]; extern u16 gUnknown_02024DE8; extern u32 gUnknown_02024E70[]; +extern u8 gUnknown_03004340[]; extern u16 gBattleTypeFlags; extern u8 gBattleMonForms[]; extern u8 gBattleAnimPlayerMonIndex; @@ -82,6 +87,7 @@ extern const struct SpriteSheet gUnknown_0820A4B4[]; extern const struct SpritePalette gUnknown_0820A4D4[]; extern const u8 gUnknown_08D09C48[]; +extern void sub_8094958(void); extern const u16 *pokemon_get_pal(struct Pokemon *); extern void sub_80105DC(struct Sprite *); extern void move_anim_start_t2(); @@ -92,6 +98,8 @@ extern const u16 *species_and_otid_get_pal(); void sub_80315E8(u8); u8 sub_803163C(u8); void sub_80316CC(u8); +void sub_8031F0C(void); +void sub_80327CC(void); void sub_80312F0(struct Sprite *sprite) { @@ -506,3 +514,104 @@ void load_gfxc_health_bar(void) { sub_800D238(gUnknown_08D09C48, (void *)0x02000000); } + +u8 battle_load_something(u8 *pState, u8 *b) +{ + bool8 retVal = FALSE; + + switch (*pState) + { + case 0: + sub_8031F0C(); + (*pState)++; + break; + case 1: + if (sub_8031C30(*b) == 0) + { + (*b)++; + } + else + { + *b = 0; + (*pState)++; + } + break; + case 2: + (*pState)++; + break; + case 3: + if ((gBattleTypeFlags & 0x80) && *b == 0) + gUnknown_03004340[*b] = battle_make_oam_safari_battle(); + else + gUnknown_03004340[*b] = battle_make_oam_normal_battle(*b); + (*b)++; + if (*b == gUnknown_02024A68) + { + *b = 0; + (*pState)++; + } + break; + case 4: + sub_8043F44(*b); + if (gUnknown_02024A72[*b] <= 1) + nullsub_11(gUnknown_03004340[*b], 0); + else + nullsub_11(gUnknown_03004340[*b], 1); + (*b)++; + if (*b == gUnknown_02024A68) + { + *b = 0; + (*pState)++; + } + break; + case 5: + if (battle_side_get_owner(*b) == 0) + { + if (!(gBattleTypeFlags & 0x80)) + sub_8045A5C(gUnknown_03004340[*b], &gPlayerParty[gUnknown_02024A6A[*b]], 0); + } + else + { + sub_8045A5C(gUnknown_03004340[*b], &gEnemyParty[gUnknown_02024A6A[*b]], 0); + } + sub_8043DB0(gUnknown_03004340[*b]); + (*b)++; + if (*b == gUnknown_02024A68) + { + *b = 0; + (*pState)++; + } + break; + case 6: + sub_80327CC(); + sub_8094958(); + retVal = TRUE; + break; + } + return retVal; +} + +void sub_8031EE8(void) +{ + memset(ewram17810, 0, 0x30); + memset(&ewram17840, 0, 0x10); +} + +void sub_8031F0C(void) +{ + sub_8031EE8(); + memset(ewram17800, 0, 0x10); +} + +void sub_8031F24(void) +{ + s32 i; + + for (i = 0; i < gUnknown_02024A68; i++) + ewram17800[i].unk0_0 = gSprites[gUnknown_02024BE0[i]].invisible; +} + +void sub_8031F88(u8 a) +{ + ewram17800[a].unk0_0 = gSprites[gUnknown_02024BE0[a]].invisible; +} -- cgit v1.2.3 From 459f56eab50d34bf06c32ec06593340e0ce68702 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 8 Jun 2017 18:51:43 -0400 Subject: Waterfall field effect --- src/field_effect.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index f3319169f..7c1c3f282 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -17,6 +17,7 @@ #include "field_player_avatar.h" #include "field_map_obj_helpers.h" #include "field_map_obj.h" +#include "metatile_behavior.h" #include "field_camera.h" #include "field_effect.h" @@ -1343,3 +1344,76 @@ bool8 sub_8086ED4(struct Task *task) } return FALSE; } + +void sub_8086F64(u8); +extern const bool8 (*gUnknown_0839F31C[5])(struct Task *, struct MapObject *); + +bool8 FldEff_UseWaterfall(void) +{ + u8 taskId; + taskId = CreateTask(sub_8086F64, 0xff); + gTasks[taskId].data[1] = gUnknown_0202FF84[0]; + sub_8086F64(taskId); + return FALSE; +} + +void sub_8086F64(u8 taskId) +{ + while (gUnknown_0839F31C[gTasks[taskId].data[0]](&gTasks[taskId], &gMapObjects[gPlayerAvatar.mapObjectId])); +} + +bool8 sub_8086FB0(struct Task *task, struct MapObject *mapObject) +{ + ScriptContext2_Enable(); + gPlayerAvatar.unk6 = 1; + task->data[0]++; + return FALSE; +} + +bool8 waterfall_1_do_anim_probably(struct Task *task, struct MapObject *mapObject) +{ + ScriptContext2_Enable(); + if (!FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive(mapObject)) + { + FieldObjectClearAnimIfSpecialAnimFinished(mapObject); + gUnknown_0202FF84[0] = task->data[1]; + FieldEffectStart(FLDEFF_FIELD_MOVE_SHOW_MON_INIT); + task->data[0]++; + } + return FALSE; +} + +bool8 waterfall_2_wait_anim_finish_probably(struct Task *task, struct MapObject *mapObject) +{ + if (FieldEffectActiveListContains(FLDEFF_FIELD_MOVE_SHOW_MON)) + { + return FALSE; + } + task->data[0]++; + return TRUE; +} + +bool8 sub_8087030(struct Task *task, struct MapObject *mapObject) +{ + FieldObjectSetSpecialAnim(mapObject, GetSimpleGoAnimId(DIR_NORTH)); + task->data[0]++; + return FALSE; +} + +bool8 sub_8087058(struct Task *task, struct MapObject *mapObject) +{ + if (!FieldObjectClearAnimIfSpecialAnimFinished(mapObject)) + { + return FALSE; + } + if (MetatileBehavior_IsWaterfall(mapObject->mapobj_unk_1E)) + { + task->data[0] = 3; + return TRUE; + } + ScriptContext2_Disable(); + gPlayerAvatar.unk6 = 0; + DestroyTask(FindTaskIdByFunc(sub_8086F64)); + FieldEffectActiveListRemove(FLDEFF_USE_WATERFALL); + return FALSE; +} -- cgit v1.2.3 From 77c679492c15a5b30e4338d2366c2958d7cff4d9 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 8 Jun 2017 19:09:43 -0400 Subject: Dive field effect --- src/field_effect.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index 7c1c3f282..af6f5a36a 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -1417,3 +1417,51 @@ bool8 sub_8087058(struct Task *task, struct MapObject *mapObject) FieldEffectActiveListRemove(FLDEFF_USE_WATERFALL); return FALSE; } + +void Task_Dive(u8); +extern const bool8 (*gUnknown_0839F330[3])(struct Task *); +extern int dive_warp(struct MapPosition *, u16); + +bool8 FldEff_UseDive(void) +{ + u8 taskId; + taskId = CreateTask(Task_Dive, 0xff); + gTasks[taskId].data[15] = gUnknown_0202FF84[0]; + gTasks[taskId].data[14] = gUnknown_0202FF84[1]; + Task_Dive(taskId); + return FALSE; +} + +void Task_Dive(u8 taskId) +{ + while (gUnknown_0839F330[gTasks[taskId].data[0]](&gTasks[taskId])); +} + +bool8 sub_8087124(struct Task *task) +{ + gPlayerAvatar.unk6 = 1; + task->data[0]++; + return FALSE; +} + +bool8 dive_2_unknown(struct Task *task) +{ + ScriptContext2_Enable(); + gUnknown_0202FF84[0] = task->data[15]; + FieldEffectStart(FLDEFF_FIELD_MOVE_SHOW_MON_INIT); + task->data[0]++; + return FALSE; +} + +bool8 dive_3_unknown(struct Task *task) +{ + struct MapPosition mapPosition; + PlayerGetDestCoords(&mapPosition.x, &mapPosition.y); + if (!FieldEffectActiveListContains(FLDEFF_FIELD_MOVE_SHOW_MON)) + { + dive_warp(&mapPosition, gMapObjects[gPlayerAvatar.mapObjectId].mapobj_unk_1E); + DestroyTask(FindTaskIdByFunc(Task_Dive)); + FieldEffectActiveListRemove(FLDEFF_USE_DIVE); + } + return FALSE; +} -- cgit v1.2.3 From f5b7921fa3b4356c2d79a117858fc543fd2cf15f Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Fri, 9 Jun 2017 02:43:39 -0400 Subject: cleanup player_pc.c --- src/battle_party_menu.c | 2 +- src/decoration.c | 2 +- src/main_menu.c | 8 +- src/menu.c | 18 +- src/menu_cursor.c | 4 +- src/player_pc.c | 523 ++++++++++++++++++++------------------ src/script_menu.c | 4 +- src/script_pokemon_util_80C4BF0.c | 12 +- src/shop.c | 2 +- src/start_menu.c | 2 +- src/strings.c | 2 +- src/wallclock.c | 2 +- 12 files changed, 308 insertions(+), 273 deletions(-) (limited to 'src') diff --git a/src/battle_party_menu.c b/src/battle_party_menu.c index 820d16465..e5f78b6c4 100644 --- a/src/battle_party_menu.c +++ b/src/battle_party_menu.c @@ -477,7 +477,7 @@ static void Task_BattlePartyMenuShift(u8 taskId) static void Task_BattlePartyMenuCancel(u8 taskId) { - sub_8072DEC(); + HandleDestroyMenuCursors(); sub_806E7D0(gTasks[taskId].data[4], sBattlePartyPopupMenus); gTasks[taskId].data[4] = gTasks[taskId].data[5]; sub_806D538(0, 0); diff --git a/src/decoration.c b/src/decoration.c index 279a7568b..efe86f144 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -14,7 +14,7 @@ void sub_80FECE0(u8 arg0); void sub_80FE7EC(u8 arg0) { - sub_8072DEC(); + HandleDestroyMenuCursors(); MenuZeroFillWindowRect(0, 0, 29, 19); sub_80FEC94(arg0); diff --git a/src/main_menu.c b/src/main_menu.c index 50fefc471..e825ae70e 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -965,14 +965,14 @@ static void Task_NewGameSpeech16(u8 taskId) switch (GenderMenuProcessInput()) { case MALE: - sub_8072DEC(); + HandleDestroyMenuCursors(); PlaySE(SE_SELECT); gSaveBlock2.playerGender = MALE; MenuZeroFillWindowRect(2, 4, 8, 9); gTasks[taskId].func = Task_NewGameSpeech19; break; case FEMALE: - sub_8072DEC(); + HandleDestroyMenuCursors(); PlaySE(SE_SELECT); gSaveBlock2.playerGender = FEMALE; MenuZeroFillWindowRect(2, 4, 8, 9); @@ -1068,7 +1068,7 @@ static void Task_NewGameSpeech21(u8 taskId) case 2: case 3: case 4: - sub_8072DEC(); + HandleDestroyMenuCursors(); PlaySE(SE_SELECT); MenuZeroFillWindowRect(2, 1, 22, 12); SetPresetPlayerName(selection); @@ -1080,7 +1080,7 @@ static void Task_NewGameSpeech21(u8 taskId) gTasks[taskId].func = Task_NewGameSpeech22; break; case -1: //B button - sub_8072DEC(); + HandleDestroyMenuCursors(); PlaySE(SE_SELECT); MenuZeroFillWindowRect(2, 1, 22, 12); gTasks[taskId].func = Task_NewGameSpeech14; //Go back to gender menu diff --git a/src/menu.c b/src/menu.c index ba98ff057..d11c45c6f 100644 --- a/src/menu.c +++ b/src/menu.c @@ -56,7 +56,7 @@ void CloseMenu(void) MenuZeroFillScreen(); sub_8064E2C(); ScriptContext2_Disable(); - sub_8072DEC(); + HandleDestroyMenuCursors(); } void AppendToList(u8 *list, u8 *pindex, u32 value) @@ -272,14 +272,14 @@ s8 ProcessMenuInput(void) { PlaySE(SE_SELECT); if (gMenu.menu_field_7) - sub_8072DEC(); + HandleDestroyMenuCursors(); return gMenu.cursorPos; } if (gMain.newKeys & B_BUTTON) { if (gMenu.menu_field_7) - sub_8072DEC(); + HandleDestroyMenuCursors(); return -1; } @@ -307,14 +307,14 @@ s8 ProcessMenuInputNoWrap(void) { PlaySE(SE_SELECT); if (gMenu.menu_field_7) - sub_8072DEC(); + HandleDestroyMenuCursors(); return gMenu.cursorPos; } if (gMain.newKeys & B_BUTTON) { if (gMenu.menu_field_7) - sub_8072DEC(); + HandleDestroyMenuCursors(); return -1; } @@ -519,7 +519,7 @@ s8 sub_80727CC(void) if (gMain.newKeys & A_BUTTON) { if (gMenu.menu_field_7) - sub_8072DEC(); + HandleDestroyMenuCursors(); PlaySE(SE_SELECT); return GetMenuCursorPos(); } @@ -527,7 +527,7 @@ s8 sub_80727CC(void) if (gMain.newKeys & B_BUTTON) { if (gMenu.menu_field_7) - sub_8072DEC(); + HandleDestroyMenuCursors(); return -1; } @@ -733,7 +733,7 @@ void sub_8072DDC(u8 a1) sub_8072DCC(8 * a1); } -void sub_8072DEC(void) +void HandleDestroyMenuCursors(void) { - sub_814A7FC(); + DestroyMenuCursor(); } diff --git a/src/menu_cursor.c b/src/menu_cursor.c index fa28332df..cfb38ca47 100644 --- a/src/menu_cursor.c +++ b/src/menu_cursor.c @@ -45,7 +45,7 @@ u8 sub_814A5C0(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5) struct Sprite *v10; if (gUnknown_0203A3D0 != 0x40 || gUnknown_0203A3D1 != 0x40) - sub_814A7FC(); + DestroyMenuCursor(); v9 = 1; if (a2 == 0xFFFF) @@ -120,7 +120,7 @@ u8 unref_sub_814A7AC(u8 a1, u16 a2, u8 a3) return sub_814A758(a1, val1, val2, a3); } -void sub_814A7FC(void) +void DestroyMenuCursor(void) { if (gUnknown_0203A3D0 != 0x40) { diff --git a/src/player_pc.c b/src/player_pc.c index d24dbecb7..f539a5bb5 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -11,14 +11,45 @@ #include "sound.h" #include "string_util.h" #include "task.h" +#include "songs.h" + +// task defines +#define PAGE_INDEX data[0] +#define ITEMS_ABOVE_TOP data[1] +#define NUM_ITEMS data[2] +#define NUM_QUANTITY_ROLLER data[3] +#define NUM_PAGE_ITEMS data[4] +// not used +#define CURRENT_ITEM_STORAGE_MENU data[6] +// not used +#define SWAP_ITEM_INDEX data[8] +#define SWITCH_MODE_ACTIVE data[9] #define NEW_GAME_PC_ITEMS(i, type) ((u16)(gNewGamePCItems + type)[i * 2]) -// type as in define above +// defined and used in the above macro enum { ITEM_ID, - QUANTITY, + QUANTITY +}; + +// player PC menu options +enum +{ + PLAYERPC_MENU_ITEMSTORAGE, + PLAYERPC_MENU_MAILBOX, + PLAYERPC_MENU_DECORATION, + PLAYERPC_MENU_TURNOFF +}; + +// item storage menus +enum +{ + ITEMPC_MENU_WITHDRAW, + ITEMPC_MENU_DEPOSIT, + ITEMPC_MENU_TOSS, + ITEMPC_MENU_EXIT }; // special item description handlers @@ -35,6 +66,16 @@ enum ITEMPC_GO_BACK_TO_PREV }; +struct MailboxStruct +{ + u8 unk0; + u8 pageItems; + u8 unk2; + u8 count; +}; + +extern struct MailboxStruct gMailboxInfo; + extern void DisplayItemMessageOnField(u8, u8*, TaskFunc, u16); extern void DoPlayerPCDecoration(u8); extern void BuyMenuFreeMemory(void); @@ -60,11 +101,11 @@ extern u16 gUnknown_08406334[3]; extern u8 gOtherText_WhatWillYouDo[]; extern u8 gOtherText_NoMailHere[]; -extern u8 *gUnknown_02039314; -extern struct MenuAction gUnknown_08406298[]; +extern u8 *gPcItemMenuOptionOrder; +extern struct MenuAction gPCText_PlayerPCOptionsText[]; -extern u8 gUnknown_084062B8[]; -extern u8 gUnknown_084062BC[]; +extern u8 gBedroomPC_OptionOrder[]; +extern u8 gPlayerPC_OptionOrder[]; extern u8 gUnknown_0840632A[]; extern u8 gUnknown_08406327[]; extern u8 gUnknown_08406330[]; @@ -81,14 +122,13 @@ extern u8 gOtherText_TooImportant[]; extern u8 gOtherText_OkayToThrowAwayPrompt[]; extern u8 gOtherText_SwitchWhichItem[]; -extern u8 gUnknown_030007B4; -extern u8 unk_201FE00[]; +extern u8 gPcItemMenuOptionsNum; extern u8 gUnknown_08152850; extern u8 gUnknown_08152C75; -extern u32 gUnknown_08406288[]; -extern const struct MenuAction gUnknown_084062C0[]; +extern u32 gPCText_OptionDescList[]; +extern const struct MenuAction gPCText_ItemPCOptionsText[]; extern const struct YesNoFuncTable gUnknown_084062E0; void InitPlayerPCMenu(u8 taskId); @@ -96,23 +136,23 @@ void PlayerPCProcessMenuInput(u8 taskId); void InitItemStorageMenu(u8); void ItemStorageMenuPrint(u8 *); void ItemStorageMenuProcessInput(u8); -void sub_813A280(u8); +void ItemStorage_ProcessInput(u8); void sub_813A240(u8); void sub_813A4B4(u8); void sub_813A468(u8); void HandleQuantityRolling(u8); -void sub_813A6FC(u8); +void ItemStorage_DoItemWithdraw(u8); void sub_813A794(u8); void sub_813A8F0(u8); void sub_813A984(u8); void sub_813A9EC(u8); -void sub_813AA30(u8, u8); -void sub_813ABE8(u8); -void sub_813AD58(u16); -void sub_813AE0C(u8); +void ItemStorage_DoItemSwap(u8, bool8); +void ItemStorage_DrawItemList(u8); +void GetPlayerPcResponseString(u16); +void ItemStorage_DrawBothListAndDescription(u8); void sub_813AE6C(u8, u8); void sub_813AF04(void); -u8 sub_813AF3C(void); +u8 GetMailboxMailCount(void); void NewGameInitPCItems(void) { @@ -126,55 +166,49 @@ void NewGameInitPCItems(void) void BedroomPC(void) { - u8 taskId; - - gUnknown_02039314 = gUnknown_084062B8; - gUnknown_030007B4 = 4; - taskId = CreateTask(TaskDummy, 0); - DisplayItemMessageOnField(taskId, gOtherText_WhatWillYouDo, InitPlayerPCMenu, 0); + gPcItemMenuOptionOrder = gBedroomPC_OptionOrder; + gPcItemMenuOptionsNum = 4; + DisplayItemMessageOnField(CreateTask(TaskDummy, 0), gOtherText_WhatWillYouDo, InitPlayerPCMenu, 0); } void PlayerPC(void) { - u8 taskId; - - gUnknown_02039314 = gUnknown_084062BC; - gUnknown_030007B4 = 3; - taskId = CreateTask(TaskDummy, 0); - DisplayItemMessageOnField(taskId, gOtherText_WhatWillYouDo, InitPlayerPCMenu, 0); + gPcItemMenuOptionOrder = gPlayerPC_OptionOrder; + gPcItemMenuOptionsNum = 3; + DisplayItemMessageOnField(CreateTask(TaskDummy, 0), gOtherText_WhatWillYouDo, InitPlayerPCMenu, 0); } void InitPlayerPCMenu(u8 taskId) { - MenuDrawTextWindow(0, 0, 10, gUnknown_030007B4 * 2 + 1); - PrintMenuItemsReordered(1, 1, gUnknown_030007B4, gUnknown_08406298, gUnknown_02039314); - InitMenu(0, 1, 1, gUnknown_030007B4, 0, 9); + MenuDrawTextWindow(0, 0, 10, gPcItemMenuOptionsNum * 2 + 1); + PrintMenuItemsReordered(1, 1, gPcItemMenuOptionsNum, gPCText_PlayerPCOptionsText, gPcItemMenuOptionOrder); + InitMenu(0, 1, 1, gPcItemMenuOptionsNum, 0, 9); gTasks[taskId].func = PlayerPCProcessMenuInput; } void PlayerPCProcessMenuInput(u8 taskId) { - if (gMain.newAndRepeatedKeys & 0x40) + if (gMain.newAndRepeatedKeys & DPAD_UP) { - PlaySE(5); + PlaySE(SE_SELECT); MoveMenuCursor(-1); } - else if (gMain.newAndRepeatedKeys & 0x80) + else if (gMain.newAndRepeatedKeys & DPAD_DOWN) { - PlaySE(5); + PlaySE(SE_SELECT); MoveMenuCursor(1); } - else if (gMain.newKeys & 0x1) + else if (gMain.newKeys & A_BUTTON) { - sub_8072DEC(); - PlaySE(5); - gUnknown_08406298[gUnknown_02039314[GetMenuCursorPos()]].func(taskId); + HandleDestroyMenuCursors(); + PlaySE(SE_SELECT); + gPCText_PlayerPCOptionsText[gPcItemMenuOptionOrder[GetMenuCursorPos()]].func(taskId); } - else if (gMain.newKeys & 0x2) + else if (gMain.newKeys & B_BUTTON) { - sub_8072DEC(); - PlaySE(5); - gUnknown_08406298[gUnknown_030007B4[gUnknown_02039314 - 1]].func(taskId); + HandleDestroyMenuCursors(); + PlaySE(SE_SELECT); + gPCText_PlayerPCOptionsText[gPcItemMenuOptionsNum[gPcItemMenuOptionOrder - 1]].func(taskId); // run EXIT. } } @@ -192,13 +226,14 @@ void PlayerPC_ItemStorage(u8 taskId) void PlayerPC_Mailbox(u8 taskId) { MenuZeroFillWindowRect(0, 0, 10, 9); - unk_201FE00[3] = sub_813AF3C(); - if (!unk_201FE00[3]) + gMailboxInfo.count = GetMailboxMailCount(); + + if (gMailboxInfo.count == 0) DisplayItemMessageOnField(taskId, gOtherText_NoMailHere, ReshowPlayerPC, 0); else { - unk_201FE00[0] = 0; - unk_201FE00[2] = 0; + gMailboxInfo.unk0 = 0; + gMailboxInfo.unk2 = 0; sub_813AF78(); sub_813A240(taskId); sub_813B108(taskId); @@ -214,13 +249,14 @@ void PlayerPC_Decoration(u8 var) void PlayerPC_TurnOff(u8 taskId) { - if (gUnknown_030007B4 == 4) + if (gPcItemMenuOptionsNum == 4) // if the option count is 4, we are at the bedroom PC and not player PC, so do gender specific handling. { MenuZeroFillWindowRect(0, 0, 0x1D, 0x13); - if (!gSaveBlock2.playerGender) - ScriptContext1_SetupScript(&gUnknown_08152850); // male + + if (gSaveBlock2.playerGender == MALE) + ScriptContext1_SetupScript(&gUnknown_08152850); else - ScriptContext1_SetupScript(&gUnknown_08152C75); // female + ScriptContext1_SetupScript(&gUnknown_08152C75); } else { @@ -234,9 +270,9 @@ void InitItemStorageMenu(u8 var) { MenuZeroFillWindowRect(0, 0, 10, 9); MenuDrawTextWindow(0, 0, 11, 9); - PrintMenuItems(1, 1, 4, gUnknown_084062C0); + PrintMenuItems(1, 1, 4, gPCText_ItemPCOptionsText); InitMenu(0, 1, 1, 4, var, 10); - ItemStorageMenuPrint((u8 *)gUnknown_08406288[var]); + ItemStorageMenuPrint((u8 *)gPCText_OptionDescList[var]); } void ItemStorageMenuPrint(u8 *textPtr) @@ -247,28 +283,28 @@ void ItemStorageMenuPrint(u8 *textPtr) void ItemStorageMenuProcessInput(u8 var) { - if (gMain.newAndRepeatedKeys & 0x40) + if (gMain.newAndRepeatedKeys & DPAD_UP) { - PlaySE(5); + PlaySE(SE_SELECT); MoveMenuCursor(-1); - ItemStorageMenuPrint((u8 *)gUnknown_08406288[GetMenuCursorPos()]); + ItemStorageMenuPrint((u8 *)gPCText_OptionDescList[GetMenuCursorPos()]); } - else if (gMain.newAndRepeatedKeys & 0x80) + else if (gMain.newAndRepeatedKeys & DPAD_DOWN) { - PlaySE(5); + PlaySE(SE_SELECT); MoveMenuCursor(1); - ItemStorageMenuPrint((u8 *)gUnknown_08406288[GetMenuCursorPos()]); + ItemStorageMenuPrint((u8 *)gPCText_OptionDescList[GetMenuCursorPos()]); } - else if (gMain.newKeys & 0x1) + else if (gMain.newKeys & A_BUTTON) { - PlaySE(5); - gUnknown_084062C0[GetMenuCursorPos()].func(var); + PlaySE(SE_SELECT); + gPCText_ItemPCOptionsText[GetMenuCursorPos()].func(var); } - else if (gMain.newKeys & 0x2) + else if (gMain.newKeys & B_BUTTON) { - sub_8072DEC(); - PlaySE(5); - gUnknown_084062C0[3].func(var); + HandleDestroyMenuCursors(); + PlaySE(SE_SELECT); + gPCText_ItemPCOptionsText[ITEMPC_MENU_EXIT].func(var); } } @@ -303,23 +339,21 @@ void sub_813A0F8(void) void ItemStorage_Withdraw(u8 taskId) { - u8 var; - u16 * data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; - sub_8072DEC(); + HandleDestroyMenuCursors(); MenuZeroFillWindowRect(0, 0, 11, 9); - var = CountUsedPCItemSlots(); - data[2] = var; + NUM_ITEMS = CountUsedPCItemSlots(); - if (var) + if (NUM_ITEMS != 0) { MenuZeroFillWindowRect(0, 14, 29, 19); - data[6] = 0; - data[0] = 0; - data[1] = 0; + CURRENT_ITEM_STORAGE_MENU = ITEMPC_MENU_WITHDRAW; + PAGE_INDEX = 0; + ITEMS_ABOVE_TOP = 0; sub_813A240(taskId); sub_813AE6C(taskId, 0); - gTasks[taskId].func = sub_813A280; + gTasks[taskId].func = ItemStorage_ProcessInput; } else DisplayItemMessageOnField(taskId, gOtherText_NoItems, PlayerPC_ItemStorage, 0); @@ -327,23 +361,21 @@ void ItemStorage_Withdraw(u8 taskId) void ItemStorage_Toss(u8 taskId) { - u8 var; - u16 * data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; - sub_8072DEC(); + HandleDestroyMenuCursors(); MenuZeroFillWindowRect(0, 0, 11, 9); - var = CountUsedPCItemSlots(); - data[2] = var; + NUM_ITEMS = CountUsedPCItemSlots(); - if (var) + if (NUM_ITEMS) { MenuZeroFillWindowRect(0, 14, 29, 19); - data[6] = 2; - data[0] = 0; - data[1] = 0; + CURRENT_ITEM_STORAGE_MENU = ITEMPC_MENU_TOSS; + PAGE_INDEX = 0; + ITEMS_ABOVE_TOP = 0; sub_813A240(taskId); sub_813AE6C(taskId, 2); - gTasks[taskId].func = sub_813A280; + gTasks[taskId].func = ItemStorage_ProcessInput; } else DisplayItemMessageOnField(taskId, gOtherText_NoItems, PlayerPC_ItemStorage, 0); @@ -351,7 +383,7 @@ void ItemStorage_Toss(u8 taskId) void ItemStorage_Exit(u8 var) { - sub_8072DEC(); + HandleDestroyMenuCursors(); MenuZeroFillWindowRect(0, 0, 11, 9); ReshowPlayerPC(var); } @@ -360,106 +392,107 @@ void sub_813A240(u8 taskId) { s16 *data = gTasks[taskId].data; - if (data[2] > 7) - data[4] = 8; + if (NUM_ITEMS > 7) // we have a full page, so set the num of page items appropriately. + NUM_PAGE_ITEMS = 8; else - data[4] = data[2] + 1; + NUM_PAGE_ITEMS = NUM_ITEMS + 1; // there are not enough items to fill a full page; take the # of items and add 1 for the cancel button. - if (unk_201FE00[3] > 7) - unk_201FE00[1] = 8; + if (gMailboxInfo.count > 7) + gMailboxInfo.pageItems = 8; else - unk_201FE00[1] = unk_201FE00[3] + 1; + gMailboxInfo.pageItems = gMailboxInfo.count + 1; } -void sub_813A280(u8 taskId) +void ItemStorage_ProcessInput(u8 taskId) { s16 *data = gTasks[taskId].data; - s16 var; + s16 trueIndex; if (gMain.newAndRepeatedKeys & DPAD_UP) { - if(data[0]) + if(PAGE_INDEX != 0) // did the cursor move physically upwards? { - PlaySE(5); - data[0] = MoveMenuCursor(-1); - var = data[1] + data[0]; - if (!data[9]) + PlaySE(SE_SELECT); + PAGE_INDEX = MoveMenuCursor(-1); + trueIndex = ITEMS_ABOVE_TOP + PAGE_INDEX; + if (SWITCH_MODE_ACTIVE == FALSE) // are we not currently switching items? { - if (var == data[2]) + if (trueIndex == NUM_ITEMS) // if the cursor is on top of cancel, print the go back to prev description. { - sub_813AD58(0xFFFF); + GetPlayerPcResponseString(ITEMPC_GO_BACK_TO_PREV); } else { - sub_813AD58(gSaveBlock1.pcItems[var].itemId); + GetPlayerPcResponseString(gSaveBlock1.pcItems[trueIndex].itemId); } } } - else // _0813A2E4 + else // the page cursor is at the top. but we may not be at the top of the true index list, so do another check. { - if (!data[1]) + if (ITEMS_ABOVE_TOP == 0) // did the cursor not move due to being at the top of the list? return; - PlaySE(5); - data[1]--; - sub_813AE0C(taskId); - // probably further down - if (data[9]) - MoveMenuCursor(0); + + PlaySE(SE_SELECT); + ITEMS_ABOVE_TOP--; + ItemStorage_DrawBothListAndDescription(taskId); + + if (SWITCH_MODE_ACTIVE != FALSE) + MoveMenuCursor(0); // don't move the cursor. it's at the top of the page index, but not the true index. } } else if(gMain.newAndRepeatedKeys & DPAD_DOWN) // _0813A306 { - if(data[0] != data[4] - 1) + if(PAGE_INDEX != NUM_PAGE_ITEMS - 1) { - PlaySE(5); - data[0] = MoveMenuCursor(1); - var = data[1] + data[0]; + PlaySE(SE_SELECT); + PAGE_INDEX = MoveMenuCursor(1); + trueIndex = ITEMS_ABOVE_TOP + PAGE_INDEX; - if(data[9]) + if(SWITCH_MODE_ACTIVE != FALSE) return; - if (var == data[2]) - sub_813AD58(0xFFFF); // probably further down + if (trueIndex == NUM_ITEMS) + GetPlayerPcResponseString(ITEMPC_GO_BACK_TO_PREV); // probably further down else - sub_813AD58(gSaveBlock1.pcItems[var].itemId); + GetPlayerPcResponseString(gSaveBlock1.pcItems[trueIndex].itemId); } - else if(data[1] + data[0] != data[2]) + else if(ITEMS_ABOVE_TOP + PAGE_INDEX != NUM_ITEMS) { - PlaySE(5); - data[1]++; - sub_813AE0C(taskId); + PlaySE(SE_SELECT); + ITEMS_ABOVE_TOP++; + ItemStorage_DrawBothListAndDescription(taskId); - if (data[9]) + if (SWITCH_MODE_ACTIVE != FALSE) MoveMenuCursor(0); } } else if(gMain.newKeys & SELECT_BUTTON) // _0813A3A0 { - if (!data[9]) + if (SWITCH_MODE_ACTIVE == FALSE) { - if (data[0] + data[1] != data[2]) + if (PAGE_INDEX + ITEMS_ABOVE_TOP != NUM_ITEMS) { - PlaySE(5); - data[9] = 1; - data[8] = data[1] + data[0]; - sub_813AD58(0xFFF7); + PlaySE(SE_SELECT); + SWITCH_MODE_ACTIVE = TRUE; + SWAP_ITEM_INDEX = ITEMS_ABOVE_TOP + PAGE_INDEX; + GetPlayerPcResponseString(ITEMPC_SWITCH_WHICH_ITEM); } // _0813A3DC - sub_813ABE8(taskId); + ItemStorage_DrawItemList(taskId); } else // _0813A3E8 { - PlaySE(5); // merging? - sub_813AA30(taskId, 0); - sub_813AE0C(taskId); + PlaySE(SE_SELECT); + ItemStorage_DoItemSwap(taskId, FALSE); + ItemStorage_DrawBothListAndDescription(taskId); } } else if(gMain.newKeys & A_BUTTON) { - PlaySE(5); - if(!data[9]) + PlaySE(SE_SELECT); + if(SWITCH_MODE_ACTIVE == FALSE) { - if(data[1] + data[0] != data[2]) + if(ITEMS_ABOVE_TOP + PAGE_INDEX != NUM_ITEMS) { sub_813A4B4(taskId); } @@ -470,22 +503,22 @@ void sub_813A280(u8 taskId) } else { - sub_813AA30(taskId, 0); - sub_813AE0C(taskId); + ItemStorage_DoItemSwap(taskId, FALSE); + ItemStorage_DrawBothListAndDescription(taskId); } } else if(gMain.newKeys & B_BUTTON) { - PlaySE(5); - if(!data[9]) + PlaySE(SE_SELECT); + if(SWITCH_MODE_ACTIVE == FALSE) { - sub_8072DEC(); + HandleDestroyMenuCursors(); sub_813A468(taskId); } else { - sub_813AA30(taskId, 1); - sub_813AE0C(taskId); + ItemStorage_DoItemSwap(taskId, TRUE); + ItemStorage_DrawBothListAndDescription(taskId); } } } @@ -497,125 +530,125 @@ void sub_813A468(u8 taskId) DestroyVerticalScrollIndicator(1); MenuZeroFillWindowRect(0, 0, 29, 19); MenuDisplayMessageBox(); - InitItemStorageMenu(gTasks[taskId].data[6]); + InitItemStorageMenu(gTasks[taskId].CURRENT_ITEM_STORAGE_MENU); gTasks[taskId].func = ItemStorageMenuProcessInput; } void sub_813A4B4(u8 taskId) { s16 *data = gTasks[taskId].data; - u8 var = data[0] + data[1]; + u8 trueIndex = PAGE_INDEX + ITEMS_ABOVE_TOP; sub_80F996C(0); sub_80F996C(1); - if(!data[6]) + if(CURRENT_ITEM_STORAGE_MENU == ITEMPC_MENU_WITHDRAW) { - if(gSaveBlock1.pcItems[var].quantity == 1) + if(gSaveBlock1.pcItems[trueIndex].quantity == 1) { - data[3] = 1; - sub_813A6FC(taskId); + NUM_QUANTITY_ROLLER = 1; + ItemStorage_DoItemWithdraw(taskId); return; } else // _0813A50C { - sub_813AD58(0xFFFE); + GetPlayerPcResponseString(ITEMPC_HOW_MANY_TO_WITHDRAW); } } - else if(gSaveBlock1.pcItems[var].quantity == 1) // _0813A518 + else if(gSaveBlock1.pcItems[trueIndex].quantity == 1) // _0813A518 { - data[3] = 1; + NUM_QUANTITY_ROLLER = 1; sub_813A794(taskId); return; } else { - sub_813AD58(0xFFFC); + GetPlayerPcResponseString(ITEMPC_HOW_MANY_TO_TOSS); } - data[3] = 1; + NUM_QUANTITY_ROLLER = 1; MenuDrawTextWindow(6, 8, 13, 11); - sub_80A418C(data[3], STR_CONV_MODE_RIGHT_ALIGN, 8, 9, 3); + sub_80A418C(NUM_QUANTITY_ROLLER, STR_CONV_MODE_RIGHT_ALIGN, 8, 9, 3); gTasks[taskId].func = HandleQuantityRolling; } void HandleQuantityRolling(u8 taskId) { s16 *data = gTasks[taskId].data; - u8 var = data[0] + data[1]; + u8 trueIndex = PAGE_INDEX + ITEMS_ABOVE_TOP; if(gMain.newAndRepeatedKeys & DPAD_UP) { - if(data[3] != gSaveBlock1.pcItems[var].quantity) - data[3]++; + if(NUM_QUANTITY_ROLLER != gSaveBlock1.pcItems[trueIndex].quantity) + NUM_QUANTITY_ROLLER++; else - data[3] = 1; // you are at the max amount of items you have when you press Up, set your quantity back to 1. + NUM_QUANTITY_ROLLER = 1; // you are at the max amount of items you have when you press Up, set your quantity back to 1. - sub_80A418C(data[3], STR_CONV_MODE_RIGHT_ALIGN, 8, 9, 3); // print quantity? + sub_80A418C(NUM_QUANTITY_ROLLER, STR_CONV_MODE_RIGHT_ALIGN, 8, 9, 3); // print quantity? } else if(gMain.newAndRepeatedKeys & DPAD_DOWN) { - if(data[3] != 1) - data[3]--; + if(NUM_QUANTITY_ROLLER != 1) + NUM_QUANTITY_ROLLER--; else - data[3] = gSaveBlock1.pcItems[var].quantity; // you are at 0 when you press down, set your quantity to the amount you have. + NUM_QUANTITY_ROLLER = gSaveBlock1.pcItems[trueIndex].quantity; // you are at 0 when you press down, set your quantity to the amount you have. - sub_80A418C(data[3], STR_CONV_MODE_RIGHT_ALIGN, 8, 9, 3); // print quantity? + sub_80A418C(NUM_QUANTITY_ROLLER, STR_CONV_MODE_RIGHT_ALIGN, 8, 9, 3); // print quantity? } else if(gMain.newAndRepeatedKeys & DPAD_LEFT) // reduce by 10. { - data[3] -= 10; + NUM_QUANTITY_ROLLER -= 10; - if(data[3] <= 0) - data[3] = 1; // dont underflow or allow 0! + if(NUM_QUANTITY_ROLLER <= 0) + NUM_QUANTITY_ROLLER = 1; // dont underflow or allow 0! - sub_80A418C(data[3], STR_CONV_MODE_RIGHT_ALIGN, 8, 9, 3); // print quantity? + sub_80A418C(NUM_QUANTITY_ROLLER, STR_CONV_MODE_RIGHT_ALIGN, 8, 9, 3); // print quantity? } else if(gMain.newAndRepeatedKeys & DPAD_RIGHT) // add 10. { - data[3] += 10; + NUM_QUANTITY_ROLLER += 10; - if(data[3] > gSaveBlock1.pcItems[var].quantity) - data[3] = gSaveBlock1.pcItems[var].quantity; // dont overflow! + if(NUM_QUANTITY_ROLLER > gSaveBlock1.pcItems[trueIndex].quantity) + NUM_QUANTITY_ROLLER = gSaveBlock1.pcItems[trueIndex].quantity; // dont overflow! - sub_80A418C(data[3], STR_CONV_MODE_RIGHT_ALIGN, 8, 9, 3); // print quantity? + sub_80A418C(NUM_QUANTITY_ROLLER, STR_CONV_MODE_RIGHT_ALIGN, 8, 9, 3); // print quantity? } else if(gMain.newKeys & A_BUTTON) // confirm quantity. { - PlaySE(5); + PlaySE(SE_SELECT); MenuZeroFillWindowRect(6, 6, 0xD, 0xB); - if(!data[6]) - sub_813A6FC(taskId); + if(CURRENT_ITEM_STORAGE_MENU == ITEMPC_MENU_WITHDRAW) + ItemStorage_DoItemWithdraw(taskId); else sub_813A794(taskId); } else if(gMain.newKeys & B_BUTTON) // cancel quantity. { - PlaySE(5); + PlaySE(SE_SELECT); MenuZeroFillWindowRect(6, 6, 0xD, 0xB); sub_80F98DC(0); sub_80F98DC(1); - sub_813AD58(gSaveBlock1.pcItems[data[1] + data[0]].itemId); // why not use var? - gTasks[taskId].func = sub_813A280; + GetPlayerPcResponseString(gSaveBlock1.pcItems[ITEMS_ABOVE_TOP + PAGE_INDEX].itemId); // why not use trueIndex? + gTasks[taskId].func = ItemStorage_ProcessInput; } } -void sub_813A6FC(u8 taskId) +void ItemStorage_DoItemWithdraw(u8 taskId) { s16 *data = gTasks[taskId].data; - u8 var = data[0] + data[1]; + u8 trueIndex = PAGE_INDEX + ITEMS_ABOVE_TOP; - if(AddBagItem(gSaveBlock1.pcItems[var].itemId, data[3]) == TRUE) // add item works. + if(AddBagItem(gSaveBlock1.pcItems[trueIndex].itemId, NUM_QUANTITY_ROLLER) == TRUE) // add item works. { - CopyItemName(gSaveBlock1.pcItems[var].itemId, gStringVar1); - ConvertIntToDecimalStringN(gStringVar2, data[3], 0, 3); - sub_813AD58(0xFFFD); + CopyItemName(gSaveBlock1.pcItems[trueIndex].itemId, gStringVar1); + ConvertIntToDecimalStringN(gStringVar2, NUM_QUANTITY_ROLLER, 0, 3); + GetPlayerPcResponseString(ITEMPC_WITHDREW_THING); gTasks[taskId].func = sub_813A8F0; } - else // cannot add item. inventory full? + else { - data[3] = 0; - sub_813AD58(0xFFFA); + NUM_QUANTITY_ROLLER = 0; + GetPlayerPcResponseString(ITEMPC_NO_MORE_ROOM); gTasks[taskId].func = sub_813A984; } } @@ -623,20 +656,20 @@ void sub_813A6FC(u8 taskId) void sub_813A794(u8 taskId) { s16 *data = gTasks[taskId].data; - u8 var = data[0] + data[1]; + u8 var = PAGE_INDEX + ITEMS_ABOVE_TOP; if(ItemId_GetImportance(gSaveBlock1.pcItems[var].itemId) == FALSE) { CopyItemName(gSaveBlock1.pcItems[var].itemId, gStringVar1); - ConvertIntToDecimalStringN(gStringVar2, data[3], 0, 3); - sub_813AD58(65528); + ConvertIntToDecimalStringN(gStringVar2, NUM_QUANTITY_ROLLER, 0, 3); + GetPlayerPcResponseString(ITEMPC_OKAY_TO_THROW_AWAY); DisplayYesNoMenu(7, 6, 1); sub_80F914C(taskId, &gUnknown_084062E0); } else { - data[3] = 0; - sub_813AD58(65529); + NUM_QUANTITY_ROLLER = 0; + GetPlayerPcResponseString(ITEMPC_TOO_IMPORTANT); gTasks[taskId].func = sub_813A8F0; } } @@ -644,7 +677,7 @@ void sub_813A794(u8 taskId) void sub_813A83C(u8 taskId) { MenuZeroFillWindowRect(0x6, 0x6, 0xD, 0xB); - sub_813AD58(0xFFFB); + GetPlayerPcResponseString(ITEMPC_THREW_AWAY_ITEM); gTasks[taskId].func = sub_813A8F0; } @@ -653,11 +686,11 @@ void sub_813A878(u8 taskId) s16 *data = gTasks[taskId].data; MenuZeroFillWindowRect(0x6, 0x6, 0xD, 0xB); - InitMenu(0, 16, 2, data[4], data[0], 0xD); + InitMenu(0, 16, 2, NUM_PAGE_ITEMS, PAGE_INDEX, 0xD); sub_80F98DC(0); sub_80F98DC(1); - sub_813AD58(gSaveBlock1.pcItems[data[1] + data[0]].itemId); - gTasks[taskId].func = sub_813A280; + GetPlayerPcResponseString(gSaveBlock1.pcItems[ITEMS_ABOVE_TOP + PAGE_INDEX].itemId); + gTasks[taskId].func = ItemStorage_ProcessInput; } void sub_813A8F0(u8 taskId) @@ -666,19 +699,19 @@ void sub_813A8F0(u8 taskId) u16 var; u8 usedItemSlots; - if(gMain.newKeys & 0x1 || gMain.newKeys == 0x2) + if(gMain.newKeys & A_BUTTON || gMain.newKeys == B_BUTTON) { - RemovePCItem(data[0] + data[1], data[3]); - var = data[2]; + RemovePCItem(PAGE_INDEX + ITEMS_ABOVE_TOP, NUM_QUANTITY_ROLLER); + var = NUM_ITEMS; usedItemSlots = CountUsedPCItemSlots(); - data[2] = usedItemSlots; + NUM_ITEMS = usedItemSlots; - if((s16)var != usedItemSlots && (s16)var < data[4] + data[1] && data[1] != 0) - data[1]--; + if((s16)var != usedItemSlots && (s16)var < NUM_PAGE_ITEMS + ITEMS_ABOVE_TOP && ITEMS_ABOVE_TOP != 0) + ITEMS_ABOVE_TOP--; sub_813A240(taskId); sub_813A9EC(taskId); - InitMenu(0, 16, 2, data[4], data[0], 0xD); + InitMenu(0, 16, 2, NUM_PAGE_ITEMS, PAGE_INDEX, 0xD); } } @@ -686,12 +719,12 @@ void sub_813A984(u8 taskId) { s16 *data = gTasks[taskId].data; - if(gMain.newKeys & 0x1 || gMain.newKeys == 2) + if(gMain.newKeys & A_BUTTON || gMain.newKeys == B_BUTTON) { - sub_813AD58(gSaveBlock1.pcItems[data[1] + data[0]].itemId); + GetPlayerPcResponseString(gSaveBlock1.pcItems[ITEMS_ABOVE_TOP + PAGE_INDEX].itemId); sub_80F98DC(0); sub_80F98DC(1); - gTasks[taskId].func = sub_813A280; + gTasks[taskId].func = ItemStorage_ProcessInput; } } @@ -700,45 +733,47 @@ void sub_813A9EC(u8 taskId) MenuZeroFillWindowRect(0x6, 0x6, 0xD, 0xB); sub_80F98DC(0); sub_80F98DC(1); - sub_813AE0C(taskId); - gTasks[taskId].func = sub_813A280; + ItemStorage_DrawBothListAndDescription(taskId); + gTasks[taskId].func = ItemStorage_ProcessInput; } -void sub_813AA30(u8 taskId, u8 arg) +void ItemStorage_DoItemSwap(u8 taskId, bool8 switchModeDisabled) { s16 *data = gTasks[taskId].data; - u8 var = data[1] + data[0]; + u8 trueIndex = ITEMS_ABOVE_TOP + PAGE_INDEX; - data[9] = 0; + SWITCH_MODE_ACTIVE = FALSE; - if((u8)data[2] > var && (u8)data[8] != var && arg == 0) + if((u8)NUM_ITEMS > trueIndex && (u8)SWAP_ITEM_INDEX != trueIndex && switchModeDisabled == FALSE) { - struct ItemSlot itemSlot = gSaveBlock1.pcItems[data[8]]; // backup the itemSlot before swapping the two. + struct ItemSlot itemSlot = gSaveBlock1.pcItems[SWAP_ITEM_INDEX]; // backup the itemSlot before swapping the two. - gSaveBlock1.pcItems[data[8]] = gSaveBlock1.pcItems[var]; - gSaveBlock1.pcItems[var] = itemSlot; + gSaveBlock1.pcItems[SWAP_ITEM_INDEX] = gSaveBlock1.pcItems[trueIndex]; + gSaveBlock1.pcItems[trueIndex] = itemSlot; return; } - else if(var == data[2]) + else if(trueIndex == NUM_ITEMS) { - sub_813AD58(0xFFFF); + GetPlayerPcResponseString(ITEMPC_GO_BACK_TO_PREV); } else { - sub_813AD58(gSaveBlock1.pcItems[var].itemId); + GetPlayerPcResponseString(gSaveBlock1.pcItems[trueIndex].itemId); } /* THEORY: This check produces essentially dead code, but it might have been working in an earlier build in which case it allows a programmer to easily duplicate items without the use of a debug menu. + This gets the page index of the swap index for some reason. It is currently unknown what it would have been used + for, but perhaps it was used to increase the quantity of the item without a debug menu. With the removal of a lot of the debug menus close to release, a programmer may have added this to help test things with a low key (such as planting a lot of duplicated berries, which requires this lazy "cheat") without bringing the relevent debug menus back. The commented out line is intentionally left in below to show what it may have looked like. */ - if(data[8] - data[1] > 0) { // this check is arbitrary and used to generate the correct assembly using the subtraction, which is what matters. the 0 check doesn't. - //gSaveBlock1.pcItems[data[8]].quantity += 100; - gSaveBlock1.pcItems[data[8]].quantity += 0; // do not enforce item cap. + if(SWAP_ITEM_INDEX - ITEMS_ABOVE_TOP > 0) { // this check is arbitrary and used to generate the correct assembly using the subtraction, which is what matters. the 0 check doesn't. + //gSaveBlock1.pcItems[SWAP_ITEM_INDEX].quantity += 100; + gSaveBlock1.pcItems[SWAP_ITEM_INDEX].quantity += 0; // do not enforce item cap. } } @@ -789,7 +824,7 @@ void sub_813ABAC(struct ItemSlot *itemSlot, u8 var, int var2) sub_813AB10(var); // key items do not have a quantity. } -void sub_813ABE8(u8 taskId) +void ItemStorage_DrawItemList(u8 taskId) { s16 *data = gTasks[taskId].data; u16 i; @@ -798,15 +833,15 @@ void sub_813ABE8(u8 taskId) // r5 is i and is unsigned 16-bit. - for(i = data[1]; i < data[1] + data[4]; i++) + for(i = ITEMS_ABOVE_TOP; i < ITEMS_ABOVE_TOP + NUM_PAGE_ITEMS; i++) { - j = (i - data[1]) * 2; + j = (i - ITEMS_ABOVE_TOP) * 2; - if(i != data[2]) + if(i != NUM_ITEMS) { tempArg = 0; - if(data[9] != 0 && i == data[8]) + if(SWITCH_MODE_ACTIVE != FALSE && i == SWAP_ITEM_INDEX) tempArg = 1; switch(GetPocketByItemId(gSaveBlock1.pcItems[i].itemId) - 1) @@ -831,10 +866,10 @@ void sub_813ABE8(u8 taskId) } beforeLabel: - if(i - data[1] < 8) + if(i - ITEMS_ABOVE_TOP < 8) MenuFillWindowRectWithBlankTile(16, j + 4, 0x1C, 0x12); - switch(data[1]) + switch(ITEMS_ABOVE_TOP) { default: CreateVerticalScrollIndicators(0, 0xB8, 8); @@ -847,13 +882,13 @@ weirdCase: break; } - if(data[1] + data[4] <= data[2]) + if(ITEMS_ABOVE_TOP + NUM_PAGE_ITEMS <= NUM_ITEMS) CreateVerticalScrollIndicators(1, 0xB8, 0x98); else DestroyVerticalScrollIndicator(1); } -void sub_813AD58(u16 itemId) +void GetPlayerPcResponseString(u16 itemId) { u8 *string; @@ -894,19 +929,19 @@ void sub_813AD58(u16 itemId) sub_8072AB0(string, 8, 0x68, 0x68, 0x30, 1); } -void sub_813AE0C(u8 taskId) +void ItemStorage_DrawBothListAndDescription(u8 taskId) { s16 *data = gTasks[taskId].data; - s16 var = data[1] + data[0]; + s16 trueIndex = ITEMS_ABOVE_TOP + PAGE_INDEX; - sub_813ABE8(taskId); + ItemStorage_DrawItemList(taskId); - if(data[9] == 0) + if(SWITCH_MODE_ACTIVE == FALSE) { - if(var == data[2]) - sub_813AD58(0xFFFF); + if(trueIndex == NUM_ITEMS) + GetPlayerPcResponseString(ITEMPC_GO_BACK_TO_PREV); else - sub_813AD58(gSaveBlock1.pcItems[var].itemId); + GetPlayerPcResponseString(gSaveBlock1.pcItems[trueIndex].itemId); } } @@ -920,10 +955,10 @@ void sub_813AE6C(u8 taskId, u8 var) MenuDrawTextWindow(0xF, 0, 0x1D, 0x13); MenuDrawTextWindow(0, 0xC, 0xE, 0x13); MenuDrawTextWindow(0, 0, 0xB, 3); - sub_813AD58(gSaveBlock1.pcItems[0].itemId); - MenuPrint(gUnknown_084062C0[var].text, 1, 1); - sub_813ABE8(taskId); - InitMenu(0, 0x10, 2, data[4], data[0], 0xD); + GetPlayerPcResponseString(gSaveBlock1.pcItems[0].itemId); + MenuPrint(gPCText_ItemPCOptionsText[var].text, 1, 1); + ItemStorage_DrawItemList(taskId); + InitMenu(0, 0x10, 2, NUM_PAGE_ITEMS, PAGE_INDEX, 0xD); } void sub_813AF04(void) @@ -936,7 +971,7 @@ void sub_813AF04(void) LoadPalette(&arr[0], 0xD8, 2); } -u8 sub_813AF3C(void) +u8 GetMailboxMailCount(void) { u8 i, j; diff --git a/src/script_menu.c b/src/script_menu.c index eba438397..f62b62ac7 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -684,7 +684,7 @@ void sub_80B52B4(u8 taskId) { gScriptResult = var; } - sub_8072DEC(); + HandleDestroyMenuCursors(); MenuZeroFillWindowRect(gTasks[taskId].data[0], gTasks[taskId].data[1], gTasks[taskId].data[2], gTasks[taskId].data[3]); DestroyTask(taskId); EnableBothScriptContexts(); @@ -847,7 +847,7 @@ void sub_80B5684(u8 taskId) { gScriptResult = var; } - sub_8072DEC(); + HandleDestroyMenuCursors(); MenuZeroFillWindowRect(gTasks[taskId].data[0], gTasks[taskId].data[1], gTasks[taskId].data[2], gTasks[taskId].data[3]); DestroyTask(taskId); EnableBothScriptContexts(); diff --git a/src/script_pokemon_util_80C4BF0.c b/src/script_pokemon_util_80C4BF0.c index d1e401e18..e53eb30cb 100644 --- a/src/script_pokemon_util_80C4BF0.c +++ b/src/script_pokemon_util_80C4BF0.c @@ -563,16 +563,16 @@ u8 ScriptGiveMon(u16 species, u8 var, u16 item, u32 var3, u32 var4, u8 var5) nationalSpecies = SpeciesToNationalPokedexNum(species); // nested if check to fool compiler - if(sentToPc < 2) + switch(sentToPc) { - if(sentToPc >= 0) - { - // set both the seen and caught flags + case 0: + case 1: GetNationalPokedexFlag(nationalSpecies, 2); GetNationalPokedexFlag(nationalSpecies, 3); - } + return sentToPc; + default: + return sentToPc; } - return sentToPc; } u8 ScriptGiveEgg(u16 value) diff --git a/src/shop.c b/src/shop.c index 780dff02a..cca920df5 100644 --- a/src/shop.c +++ b/src/shop.c @@ -155,7 +155,7 @@ void sub_80B2F30(u8 taskId) void HandleShopMenuQuit(u8 taskId) { - sub_8072DEC(); + HandleDestroyMenuCursors(); MenuZeroFillWindowRect(0, 0, 11, 8); sub_80BE3BC(); // in tv.s? ScriptContext2_Disable(); diff --git a/src/start_menu.c b/src/start_menu.c index 37d361c0b..be489bd1f 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -410,7 +410,7 @@ static u8 StartMenu_PlayerCallback(void) //When player selects SAVE static u8 StartMenu_SaveCallback(void) { - sub_8072DEC(); + HandleDestroyMenuCursors(); gCallback_03004AE8 = SaveCallback1; return 0; } diff --git a/src/strings.c b/src/strings.c index f41af082c..fa083f00d 100644 --- a/src/strings.c +++ b/src/strings.c @@ -1149,7 +1149,7 @@ const u8 gOtherText_OkayToThrowAwayPrompt[] = _("Willst du wirklich\n{STR_VAR_2} const u8 gOtherText_DadsAdvice[] = _("VATI sagt immer...\n{PLAYER}, dies ist weder der rechte\lOrt noch der rechte Zeitpunkt dafür!{PAUSE_UNTIL_PRESS}"); const u8 gOtherText_CantGetOffBike[] = _("Du kannst hier nicht vom RAD steigen.{PAUSE_UNTIL_PRESS}"); const u8 gOtherText_ItemfinderResponding[] = _("Oh!\nDas Gerät zeigt etwas an!\pHier muss ein Item vergraben sein!{PAUSE_UNTIL_PRESS}"); -const u8 gOtherText_ItemfinderItemUnderfoot[] = _("Das Gerät macht direkt unter\ndeinen Füßen etwas aus!{PAUSE_UNTIL_PRESS}"); +const u8 gOtherText_ItemfinderItemUnderfoot[] = _("Das Gerät macht direkt unter\ndeinen Füßen etwas aus!{PAUSE_UNTIL_PRESS}"); const u8 gOtherText_NoResponse[] = _("... ... ... ... Nichts!\nKeine Anzeige.{PAUSE_UNTIL_PRESS}"); const u8 gOtherText_Coins3[] = _("Deine MÜNZEN:\n{STR_VAR_1}{PAUSE_UNTIL_PRESS}"); const u8 gOtherText_BootedTM[] = _("Eine TM wurde aktiviert."); diff --git a/src/wallclock.c b/src/wallclock.c index 0f3665c65..dafb37442 100644 --- a/src/wallclock.c +++ b/src/wallclock.c @@ -434,7 +434,7 @@ static void Task_SetClock4(u8 taskId) return; case -1: //B button case 1: //NO - sub_8072DEC(); + HandleDestroyMenuCursors(); PlaySE(SE_SELECT); MenuZeroFillWindowRect(23, 8, 29, 13); MenuZeroFillWindowRect(2, 16, 27, 19); -- cgit v1.2.3 From 16fd2ca3856668cd4e7cb5e94d3022ac5edce8a3 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Fri, 9 Jun 2017 04:24:54 -0400 Subject: more player_pc.c labeling --- src/player_pc.c | 184 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 91 insertions(+), 93 deletions(-) (limited to 'src') diff --git a/src/player_pc.c b/src/player_pc.c index f539a5bb5..db23bb803 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -137,21 +137,21 @@ void InitItemStorageMenu(u8); void ItemStorageMenuPrint(u8 *); void ItemStorageMenuProcessInput(u8); void ItemStorage_ProcessInput(u8); -void sub_813A240(u8); -void sub_813A4B4(u8); -void sub_813A468(u8); -void HandleQuantityRolling(u8); +void ItemStorage_SetItemAndMailCount(u8); +void ItemStorage_DoItemAction(u8); +void ItemStorage_GoBackToPlayerPCMenu(u8); +void ItemStorage_HandleQuantityRolling(u8); void ItemStorage_DoItemWithdraw(u8); -void sub_813A794(u8); -void sub_813A8F0(u8); -void sub_813A984(u8); -void sub_813A9EC(u8); +void ItemStorage_DoItemToss(u8); +void ItemStorage_HandleRemoveItem(u8); +void ItemStorage_WaitPressHandleResumeProcessInput(u8); +void ItemStorage_HandleResumeProcessInput(u8); void ItemStorage_DoItemSwap(u8, bool8); void ItemStorage_DrawItemList(u8); -void GetPlayerPcResponseString(u16); +void ItemStorage_PrintItemPcResponse(u16); void ItemStorage_DrawBothListAndDescription(u8); -void sub_813AE6C(u8, u8); -void sub_813AF04(void); +void ItemStorage_GoBackToItemPCMenu(u8, u8); +void ItemStorage_LoadPalette(void); u8 GetMailboxMailCount(void); void NewGameInitPCItems(void) @@ -235,7 +235,7 @@ void PlayerPC_Mailbox(u8 taskId) gMailboxInfo.unk0 = 0; gMailboxInfo.unk2 = 0; sub_813AF78(); - sub_813A240(taskId); + ItemStorage_SetItemAndMailCount(taskId); sub_813B108(taskId); gTasks[taskId].func = sub_813B174; } @@ -351,8 +351,8 @@ void ItemStorage_Withdraw(u8 taskId) CURRENT_ITEM_STORAGE_MENU = ITEMPC_MENU_WITHDRAW; PAGE_INDEX = 0; ITEMS_ABOVE_TOP = 0; - sub_813A240(taskId); - sub_813AE6C(taskId, 0); + ItemStorage_SetItemAndMailCount(taskId); + ItemStorage_GoBackToItemPCMenu(taskId, 0); gTasks[taskId].func = ItemStorage_ProcessInput; } else @@ -373,8 +373,8 @@ void ItemStorage_Toss(u8 taskId) CURRENT_ITEM_STORAGE_MENU = ITEMPC_MENU_TOSS; PAGE_INDEX = 0; ITEMS_ABOVE_TOP = 0; - sub_813A240(taskId); - sub_813AE6C(taskId, 2); + ItemStorage_SetItemAndMailCount(taskId); + ItemStorage_GoBackToItemPCMenu(taskId, 2); gTasks[taskId].func = ItemStorage_ProcessInput; } else @@ -388,7 +388,7 @@ void ItemStorage_Exit(u8 var) ReshowPlayerPC(var); } -void sub_813A240(u8 taskId) +void ItemStorage_SetItemAndMailCount(u8 taskId) { s16 *data = gTasks[taskId].data; @@ -419,11 +419,11 @@ void ItemStorage_ProcessInput(u8 taskId) { if (trueIndex == NUM_ITEMS) // if the cursor is on top of cancel, print the go back to prev description. { - GetPlayerPcResponseString(ITEMPC_GO_BACK_TO_PREV); + ItemStorage_PrintItemPcResponse(ITEMPC_GO_BACK_TO_PREV); } else { - GetPlayerPcResponseString(gSaveBlock1.pcItems[trueIndex].itemId); + ItemStorage_PrintItemPcResponse(gSaveBlock1.pcItems[trueIndex].itemId); } } } @@ -452,9 +452,9 @@ void ItemStorage_ProcessInput(u8 taskId) return; if (trueIndex == NUM_ITEMS) - GetPlayerPcResponseString(ITEMPC_GO_BACK_TO_PREV); // probably further down + ItemStorage_PrintItemPcResponse(ITEMPC_GO_BACK_TO_PREV); // probably further down else - GetPlayerPcResponseString(gSaveBlock1.pcItems[trueIndex].itemId); + ItemStorage_PrintItemPcResponse(gSaveBlock1.pcItems[trueIndex].itemId); } else if(ITEMS_ABOVE_TOP + PAGE_INDEX != NUM_ITEMS) { @@ -470,12 +470,12 @@ void ItemStorage_ProcessInput(u8 taskId) { if (SWITCH_MODE_ACTIVE == FALSE) { - if (PAGE_INDEX + ITEMS_ABOVE_TOP != NUM_ITEMS) + if (PAGE_INDEX + ITEMS_ABOVE_TOP != NUM_ITEMS) // you cannot swap the Cancel button. { PlaySE(SE_SELECT); SWITCH_MODE_ACTIVE = TRUE; SWAP_ITEM_INDEX = ITEMS_ABOVE_TOP + PAGE_INDEX; - GetPlayerPcResponseString(ITEMPC_SWITCH_WHICH_ITEM); + ItemStorage_PrintItemPcResponse(ITEMPC_SWITCH_WHICH_ITEM); } // _0813A3DC ItemStorage_DrawItemList(taskId); @@ -494,11 +494,11 @@ void ItemStorage_ProcessInput(u8 taskId) { if(ITEMS_ABOVE_TOP + PAGE_INDEX != NUM_ITEMS) { - sub_813A4B4(taskId); + ItemStorage_DoItemAction(taskId); } else { - sub_813A468(taskId); + ItemStorage_GoBackToPlayerPCMenu(taskId); } } else @@ -513,7 +513,7 @@ void ItemStorage_ProcessInput(u8 taskId) if(SWITCH_MODE_ACTIVE == FALSE) { HandleDestroyMenuCursors(); - sub_813A468(taskId); + ItemStorage_GoBackToPlayerPCMenu(taskId); } else { @@ -523,7 +523,7 @@ void ItemStorage_ProcessInput(u8 taskId) } } -void sub_813A468(u8 taskId) +void ItemStorage_GoBackToPlayerPCMenu(u8 taskId) { BuyMenuFreeMemory(); DestroyVerticalScrollIndicator(0); @@ -534,7 +534,7 @@ void sub_813A468(u8 taskId) gTasks[taskId].func = ItemStorageMenuProcessInput; } -void sub_813A4B4(u8 taskId) +void ItemStorage_DoItemAction(u8 taskId) { s16 *data = gTasks[taskId].data; u8 trueIndex = PAGE_INDEX + ITEMS_ABOVE_TOP; @@ -552,26 +552,26 @@ void sub_813A4B4(u8 taskId) } else // _0813A50C { - GetPlayerPcResponseString(ITEMPC_HOW_MANY_TO_WITHDRAW); + ItemStorage_PrintItemPcResponse(ITEMPC_HOW_MANY_TO_WITHDRAW); } } else if(gSaveBlock1.pcItems[trueIndex].quantity == 1) // _0813A518 { NUM_QUANTITY_ROLLER = 1; - sub_813A794(taskId); + ItemStorage_DoItemToss(taskId); return; } else { - GetPlayerPcResponseString(ITEMPC_HOW_MANY_TO_TOSS); + ItemStorage_PrintItemPcResponse(ITEMPC_HOW_MANY_TO_TOSS); } NUM_QUANTITY_ROLLER = 1; MenuDrawTextWindow(6, 8, 13, 11); sub_80A418C(NUM_QUANTITY_ROLLER, STR_CONV_MODE_RIGHT_ALIGN, 8, 9, 3); - gTasks[taskId].func = HandleQuantityRolling; + gTasks[taskId].func = ItemStorage_HandleQuantityRolling; } -void HandleQuantityRolling(u8 taskId) +void ItemStorage_HandleQuantityRolling(u8 taskId) { s16 *data = gTasks[taskId].data; u8 trueIndex = PAGE_INDEX + ITEMS_ABOVE_TOP; @@ -620,7 +620,7 @@ void HandleQuantityRolling(u8 taskId) if(CURRENT_ITEM_STORAGE_MENU == ITEMPC_MENU_WITHDRAW) ItemStorage_DoItemWithdraw(taskId); else - sub_813A794(taskId); + ItemStorage_DoItemToss(taskId); } else if(gMain.newKeys & B_BUTTON) // cancel quantity. { @@ -628,7 +628,7 @@ void HandleQuantityRolling(u8 taskId) MenuZeroFillWindowRect(6, 6, 0xD, 0xB); sub_80F98DC(0); sub_80F98DC(1); - GetPlayerPcResponseString(gSaveBlock1.pcItems[ITEMS_ABOVE_TOP + PAGE_INDEX].itemId); // why not use trueIndex? + ItemStorage_PrintItemPcResponse(gSaveBlock1.pcItems[ITEMS_ABOVE_TOP + PAGE_INDEX].itemId); // why not use trueIndex? gTasks[taskId].func = ItemStorage_ProcessInput; } } @@ -642,18 +642,18 @@ void ItemStorage_DoItemWithdraw(u8 taskId) { CopyItemName(gSaveBlock1.pcItems[trueIndex].itemId, gStringVar1); ConvertIntToDecimalStringN(gStringVar2, NUM_QUANTITY_ROLLER, 0, 3); - GetPlayerPcResponseString(ITEMPC_WITHDREW_THING); - gTasks[taskId].func = sub_813A8F0; + ItemStorage_PrintItemPcResponse(ITEMPC_WITHDREW_THING); + gTasks[taskId].func = ItemStorage_HandleRemoveItem; } else { NUM_QUANTITY_ROLLER = 0; - GetPlayerPcResponseString(ITEMPC_NO_MORE_ROOM); - gTasks[taskId].func = sub_813A984; + ItemStorage_PrintItemPcResponse(ITEMPC_NO_MORE_ROOM); + gTasks[taskId].func = ItemStorage_WaitPressHandleResumeProcessInput; } } -void sub_813A794(u8 taskId) +void ItemStorage_DoItemToss(u8 taskId) { s16 *data = gTasks[taskId].data; u8 var = PAGE_INDEX + ITEMS_ABOVE_TOP; @@ -662,26 +662,26 @@ void sub_813A794(u8 taskId) { CopyItemName(gSaveBlock1.pcItems[var].itemId, gStringVar1); ConvertIntToDecimalStringN(gStringVar2, NUM_QUANTITY_ROLLER, 0, 3); - GetPlayerPcResponseString(ITEMPC_OKAY_TO_THROW_AWAY); + ItemStorage_PrintItemPcResponse(ITEMPC_OKAY_TO_THROW_AWAY); DisplayYesNoMenu(7, 6, 1); sub_80F914C(taskId, &gUnknown_084062E0); } else { NUM_QUANTITY_ROLLER = 0; - GetPlayerPcResponseString(ITEMPC_TOO_IMPORTANT); - gTasks[taskId].func = sub_813A8F0; + ItemStorage_PrintItemPcResponse(ITEMPC_TOO_IMPORTANT); + gTasks[taskId].func = ItemStorage_HandleRemoveItem; } } -void sub_813A83C(u8 taskId) +void ItemStorage_ResumeInputFromYesToss(u8 taskId) { MenuZeroFillWindowRect(0x6, 0x6, 0xD, 0xB); - GetPlayerPcResponseString(ITEMPC_THREW_AWAY_ITEM); - gTasks[taskId].func = sub_813A8F0; + ItemStorage_PrintItemPcResponse(ITEMPC_THREW_AWAY_ITEM); + gTasks[taskId].func = ItemStorage_HandleRemoveItem; } -void sub_813A878(u8 taskId) +void ItemStorage_ResumeInputFromNoToss(u8 taskId) { s16 *data = gTasks[taskId].data; @@ -689,46 +689,44 @@ void sub_813A878(u8 taskId) InitMenu(0, 16, 2, NUM_PAGE_ITEMS, PAGE_INDEX, 0xD); sub_80F98DC(0); sub_80F98DC(1); - GetPlayerPcResponseString(gSaveBlock1.pcItems[ITEMS_ABOVE_TOP + PAGE_INDEX].itemId); + ItemStorage_PrintItemPcResponse(gSaveBlock1.pcItems[ITEMS_ABOVE_TOP + PAGE_INDEX].itemId); gTasks[taskId].func = ItemStorage_ProcessInput; } -void sub_813A8F0(u8 taskId) +void ItemStorage_HandleRemoveItem(u8 taskId) { s16 *data = gTasks[taskId].data; - u16 var; - u8 usedItemSlots; + s16 oldNumItems; if(gMain.newKeys & A_BUTTON || gMain.newKeys == B_BUTTON) { RemovePCItem(PAGE_INDEX + ITEMS_ABOVE_TOP, NUM_QUANTITY_ROLLER); - var = NUM_ITEMS; - usedItemSlots = CountUsedPCItemSlots(); - NUM_ITEMS = usedItemSlots; + oldNumItems = NUM_ITEMS; + NUM_ITEMS = CountUsedPCItemSlots(); - if((s16)var != usedItemSlots && (s16)var < NUM_PAGE_ITEMS + ITEMS_ABOVE_TOP && ITEMS_ABOVE_TOP != 0) + if(oldNumItems != NUM_ITEMS && oldNumItems < NUM_PAGE_ITEMS + ITEMS_ABOVE_TOP && ITEMS_ABOVE_TOP != 0) ITEMS_ABOVE_TOP--; - sub_813A240(taskId); - sub_813A9EC(taskId); + ItemStorage_SetItemAndMailCount(taskId); + ItemStorage_HandleResumeProcessInput(taskId); InitMenu(0, 16, 2, NUM_PAGE_ITEMS, PAGE_INDEX, 0xD); } } -void sub_813A984(u8 taskId) +void ItemStorage_WaitPressHandleResumeProcessInput(u8 taskId) { s16 *data = gTasks[taskId].data; if(gMain.newKeys & A_BUTTON || gMain.newKeys == B_BUTTON) { - GetPlayerPcResponseString(gSaveBlock1.pcItems[ITEMS_ABOVE_TOP + PAGE_INDEX].itemId); + ItemStorage_PrintItemPcResponse(gSaveBlock1.pcItems[ITEMS_ABOVE_TOP + PAGE_INDEX].itemId); sub_80F98DC(0); sub_80F98DC(1); gTasks[taskId].func = ItemStorage_ProcessInput; } } -void sub_813A9EC(u8 taskId) +void ItemStorage_HandleResumeProcessInput(u8 taskId) { MenuZeroFillWindowRect(0x6, 0x6, 0xD, 0xB); sub_80F98DC(0); @@ -754,11 +752,11 @@ void ItemStorage_DoItemSwap(u8 taskId, bool8 switchModeDisabled) } else if(trueIndex == NUM_ITEMS) { - GetPlayerPcResponseString(ITEMPC_GO_BACK_TO_PREV); + ItemStorage_PrintItemPcResponse(ITEMPC_GO_BACK_TO_PREV); } else { - GetPlayerPcResponseString(gSaveBlock1.pcItems[trueIndex].itemId); + ItemStorage_PrintItemPcResponse(gSaveBlock1.pcItems[trueIndex].itemId); } /* @@ -771,71 +769,71 @@ void ItemStorage_DoItemSwap(u8 taskId, bool8 switchModeDisabled) without bringing the relevent debug menus back. The commented out line is intentionally left in below to show what it may have looked like. */ - if(SWAP_ITEM_INDEX - ITEMS_ABOVE_TOP > 0) { // this check is arbitrary and used to generate the correct assembly using the subtraction, which is what matters. the 0 check doesn't. + if(SWAP_ITEM_INDEX - ITEMS_ABOVE_TOP <= 0) { // this check is arbitrary and used to generate the correct assembly using the subtraction, which is what matters. the 0 check doesn't. //gSaveBlock1.pcItems[SWAP_ITEM_INDEX].quantity += 100; gSaveBlock1.pcItems[SWAP_ITEM_INDEX].quantity += 0; // do not enforce item cap. } } -void sub_813AAC4(u16 arg1, enum StringConvertMode arg2, u8 arg3, u8 arg4, int arg5) +void ItemStorage_DrawItemQuantity(u16 arg1, enum StringConvertMode arg2, u8 arg3, u8 arg4, int isSwapSelected) { sub_80A4164(gStringVar1, arg1, arg2, arg4); - if(arg5) + if(isSwapSelected != FALSE) MenuPrint(gUnknown_0840632A, 0x1A, arg3); else MenuPrint(gUnknown_08406327, 0x1A, arg3); } -void sub_813AB10(u8 var) +void ItemStorage_DrawItemVoidQuantity(u8 var) { MenuPrint(gUnknown_08406330, 0x19, var); } -void sub_813AB28(struct ItemSlot *itemSlot, u8 var, int var2) +void ItemStorage_DrawItemName(struct ItemSlot *itemSlot, u8 var, int isSwapSelected) { CopyItemName(itemSlot->itemId, gStringVar1); - if(var2) + if(isSwapSelected != FALSE) MenuPrint(gUnknown_0840631E, 16, var); else MenuPrint(gUnknown_08406318, 16, var); } -void sub_813AB64(struct ItemSlot *itemSlot, u8 var, int var2) +void ItemStorage_DrawNormalItemEntry(struct ItemSlot *itemSlot, u8 var, int var2) { - sub_813AB28(itemSlot, var, var2); - sub_813AAC4(itemSlot->quantity, STR_CONV_MODE_RIGHT_ALIGN, var, 3, var2); + ItemStorage_DrawItemName(itemSlot, var, var2); + ItemStorage_DrawItemQuantity(itemSlot->quantity, STR_CONV_MODE_RIGHT_ALIGN, var, 3, var2); } -void sub_813AB90(struct ItemSlot *itemSlot, u8 var, int var2) +void ItemStorage_DrawKeyItemEntry(struct ItemSlot *itemSlot, u8 var, int var2) { - sub_813AB28(itemSlot, var, var2); - sub_813AB10(var); + ItemStorage_DrawItemName(itemSlot, var, var2); + ItemStorage_DrawItemVoidQuantity(var); } -void sub_813ABAC(struct ItemSlot *itemSlot, u8 var, int var2) +void ItemStorage_DrawTMHMEntry(struct ItemSlot *itemSlot, u8 var, int var2) { - sub_813AB28(itemSlot, var, var2); + ItemStorage_DrawItemName(itemSlot, var, var2); if(itemSlot->itemId < ITEM_HM01) - sub_813AAC4(itemSlot->quantity, STR_CONV_MODE_RIGHT_ALIGN, var, 3, var2); + ItemStorage_DrawItemQuantity(itemSlot->quantity, STR_CONV_MODE_RIGHT_ALIGN, var, 3, var2); else - sub_813AB10(var); // key items do not have a quantity. + ItemStorage_DrawItemVoidQuantity(var); // HMs do not have a quantity. } void ItemStorage_DrawItemList(u8 taskId) { s16 *data = gTasks[taskId].data; - u16 i; int tempArg; - u16 j = 0; + u16 i; + u16 yCoord = 0; // r5 is i and is unsigned 16-bit. for(i = ITEMS_ABOVE_TOP; i < ITEMS_ABOVE_TOP + NUM_PAGE_ITEMS; i++) { - j = (i - ITEMS_ABOVE_TOP) * 2; + yCoord = (i - ITEMS_ABOVE_TOP) * 2; if(i != NUM_ITEMS) { @@ -849,13 +847,13 @@ void ItemStorage_DrawItemList(u8 taskId) case 0: case 1: case 3: - sub_813AB64((struct ItemSlot *)&gSaveBlock1.pcItems[i], j + 2, tempArg); + ItemStorage_DrawNormalItemEntry((struct ItemSlot *)&gSaveBlock1.pcItems[i], yCoord + 2, tempArg); break; case 4: - sub_813AB90((struct ItemSlot *)&gSaveBlock1.pcItems[i], j + 2, tempArg); + ItemStorage_DrawKeyItemEntry((struct ItemSlot *)&gSaveBlock1.pcItems[i], yCoord + 2, tempArg); break; case 2: - sub_813ABAC((struct ItemSlot *)&gSaveBlock1.pcItems[i], j + 2, tempArg); + ItemStorage_DrawTMHMEntry((struct ItemSlot *)&gSaveBlock1.pcItems[i], yCoord + 2, tempArg); break; } } @@ -867,7 +865,7 @@ void ItemStorage_DrawItemList(u8 taskId) beforeLabel: if(i - ITEMS_ABOVE_TOP < 8) - MenuFillWindowRectWithBlankTile(16, j + 4, 0x1C, 0x12); + MenuFillWindowRectWithBlankTile(16, yCoord + 4, 0x1C, 0x12); switch(ITEMS_ABOVE_TOP) { @@ -875,7 +873,7 @@ beforeLabel: CreateVerticalScrollIndicators(0, 0xB8, 8); break; weirdCase: - sub_8072A18(gOtherText_CancelNoTerminator, 0x80, (j + 2) * 8, 0x68, 1); + sub_8072A18(gOtherText_CancelNoTerminator, 0x80, (yCoord + 2) * 8, 0x68, 1); goto beforeLabel; case 0: DestroyVerticalScrollIndicator(0); @@ -888,7 +886,7 @@ weirdCase: DestroyVerticalScrollIndicator(1); } -void GetPlayerPcResponseString(u16 itemId) +void ItemStorage_PrintItemPcResponse(u16 itemId) { u8 *string; @@ -939,29 +937,29 @@ void ItemStorage_DrawBothListAndDescription(u8 taskId) if(SWITCH_MODE_ACTIVE == FALSE) { if(trueIndex == NUM_ITEMS) - GetPlayerPcResponseString(ITEMPC_GO_BACK_TO_PREV); + ItemStorage_PrintItemPcResponse(ITEMPC_GO_BACK_TO_PREV); else - GetPlayerPcResponseString(gSaveBlock1.pcItems[trueIndex].itemId); + ItemStorage_PrintItemPcResponse(gSaveBlock1.pcItems[trueIndex].itemId); } } -void sub_813AE6C(u8 taskId, u8 var) +void ItemStorage_GoBackToItemPCMenu(u8 taskId, u8 var) { s16 *data = gTasks[taskId].data; sub_80F944C(); LoadScrollIndicatorPalette(); - sub_813AF04(); + ItemStorage_LoadPalette(); MenuDrawTextWindow(0xF, 0, 0x1D, 0x13); MenuDrawTextWindow(0, 0xC, 0xE, 0x13); MenuDrawTextWindow(0, 0, 0xB, 3); - GetPlayerPcResponseString(gSaveBlock1.pcItems[0].itemId); + ItemStorage_PrintItemPcResponse(gSaveBlock1.pcItems[0].itemId); MenuPrint(gPCText_ItemPCOptionsText[var].text, 1, 1); ItemStorage_DrawItemList(taskId); InitMenu(0, 0x10, 2, NUM_PAGE_ITEMS, PAGE_INDEX, 0xD); } -void sub_813AF04(void) +void ItemStorage_LoadPalette(void) { u16 arr[3]; -- cgit v1.2.3 From 14e1400cfdf8cddc4839164fdcc9f5506764a455 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 9 Jun 2017 11:07:49 -0400 Subject: Field Effect first half of lavaridge gym fall down --- src/field_effect.c | 182 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 118 insertions(+), 64 deletions(-) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index af6f5a36a..320c61b29 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -928,16 +928,13 @@ bool8 sub_8086854(struct Task *task) // gUnknown_0839F2CC[1] return FALSE; } -#ifdef NONMATCHING bool8 sub_8086870(struct Task *task) // gUnknown_0839F2CC[2] { struct Sprite *sprite; s16 centerToCornerVecY; - int ctcvy; sprite = &gSprites[gPlayerAvatar.spriteId]; - centerToCornerVecY = sprite->centerToCornerVecY; - ctcvy = -(centerToCornerVecY << 17); - sprite->pos2.y = -((sprite->pos1.y + centerToCornerVecY + gSpriteCoordOffsetY) + (ctcvy >> 16)); + centerToCornerVecY = -(sprite->centerToCornerVecY << 1); + sprite->pos2.y = -(sprite->pos1.y + sprite->centerToCornerVecY + gSpriteCoordOffsetY + centerToCornerVecY); task->data[1] = 1; task->data[2] = 0; gMapObjects[gPlayerAvatar.mapObjectId].mapobj_bit_13 = 0; @@ -945,65 +942,6 @@ bool8 sub_8086870(struct Task *task) // gUnknown_0839F2CC[2] task->data[0]++; return FALSE; } -#else -__attribute__((naked)) -bool8 sub_8086870(struct Task *task) // gUnknown_0839F2CC[2] -{ - asm_unified("\tpush {r4-r6,lr}\n" - "\tadds r5, r0, 0\n" - "\tldr r6, _080868D4 @ =gPlayerAvatar\n" - "\tldrb r0, [r6, 0x4]\n" - "\tlsls r2, r0, 4\n" - "\tadds r2, r0\n" - "\tlsls r2, 2\n" - "\tldr r0, _080868D8 @ =gSprites\n" - "\tadds r2, r0\n" - "\tadds r0, r2, 0\n" - "\tadds r0, 0x29\n" - "\tmovs r4, 0\n" - "\tldrsb r4, [r0, r4] @ =gSprites[gPlayerAvatar.spriteId].centerToCornerVecY\n" - "\tlsls r0, r4, 17\n" - "\tnegs r0, r0\n" - "\tldrh r1, [r2, 0x22] @ =gSprites[gPlayerAvatar.spriteId].pos1.y\n" - "\tldr r3, _080868DC @ =gSpriteCoordOffsetY\n" - "\tadds r1, r4\n" - "\tldrh r3, [r3]\n" - "\tadds r1, r3\n" - "\tasrs r0, 16\n" - "\tadds r0, r1\n" - "\tnegs r0, r0\n" - "\tmovs r1, 0\n" - "\tstrh r0, [r2, 0x26]\n" - "\tmovs r0, 0x1\n" - "\tstrh r0, [r5, 0xA]\n" - "\tstrh r1, [r5, 0xC]\n" - "\tldr r2, _080868E0 @ =gMapObjects\n" - "\tldrb r0, [r6, 0x5]\n" - "\tlsls r1, r0, 3\n" - "\tadds r1, r0\n" - "\tlsls r1, 2\n" - "\tadds r1, r2\n" - "\tldrb r2, [r1, 0x1]\n" - "\tmovs r0, 0x21\n" - "\tnegs r0, r0\n" - "\tands r0, r2\n" - "\tstrb r0, [r1, 0x1]\n" - "\tmovs r0, 0x2B\n" - "\tbl PlaySE\n" - "\tldrh r0, [r5, 0x8]\n" - "\tadds r0, 0x1\n" - "\tstrh r0, [r5, 0x8]\n" - "\tmovs r0, 0\n" - "\tpop {r4-r6}\n" - "\tpop {r1}\n" - "\tbx r1\n" - "\t.align 2, 0\n" - "_080868D4: .4byte gPlayerAvatar\n" - "_080868D8: .4byte gSprites\n" - "_080868DC: .4byte gSpriteCoordOffsetY\n" - "_080868E0: .4byte gMapObjects"); -} -#endif bool8 sub_80868E4(struct Task *task) { @@ -1465,3 +1403,119 @@ bool8 dive_3_unknown(struct Task *task) } return FALSE; } + +void sub_80871D0(u8); +extern const bool8 (*gUnknown_0839F33C[6])(struct Task *, struct MapObject *, struct Sprite *); +void mapldr_080851BC(void); + +void sub_80871B8(u8 priority) +{ + CreateTask(sub_80871D0, priority); +} + +void sub_80871D0(u8 taskId) +{ + while (gUnknown_0839F33C[gTasks[taskId].data[0]](&gTasks[taskId], &gMapObjects[gPlayerAvatar.mapObjectId], &gSprites[gPlayerAvatar.spriteId])); +} + +bool8 sub_808722C(struct Task *task, struct MapObject *mapObject, struct Sprite *sprite) +{ + FreezeMapObjects(); + CameraObjectReset2(); + SetCameraPanningCallback(NULL); + gPlayerAvatar.unk6 = 1; + mapObject->mapobj_bit_26 = 1; + task->data[1] = 1; + task->data[0]++; + return TRUE; +} + +bool8 sub_8087264(struct Task *task, struct MapObject *mapObject, struct Sprite *sprite) +{ + SetCameraPanning(0, task->data[1]); + task->data[1] = -task->data[1]; + task->data[2]++; + if (task->data[2] > 7) + { + task->data[2] = 0; + task->data[0]++; + } + return FALSE; +} + +bool8 sub_8087298(struct Task *task, struct MapObject *mapObject, struct Sprite *sprite) +{ + sprite->pos2.y = 0; + task->data[3] = 1; + gUnknown_0202FF84[0] = mapObject->coords2.x; + gUnknown_0202FF84[1] = mapObject->coords2.y; + gUnknown_0202FF84[2] = sprite->subpriority - 1; + gUnknown_0202FF84[3] = sprite->oam.priority; + FieldEffectStart(FLDEFF_LAVARIDGE_GYM_WARP); + PlaySE(SE_W153); + task->data[0]++; + return TRUE; +} + +bool8 sub_80872E4(struct Task *task, struct MapObject *mapObject, struct Sprite *sprite) +{ + s16 centerToCornerVecY; + SetCameraPanning(0, task->data[1]); + if (task->data[1] = -task->data[1], ++task->data[2] <= 17) + { + if (!(task->data[2] & 1) && (task->data[1] <= 3)) + { + task->data[1] <<= 1; + } + } else if (!(task->data[2] & 4) && (task->data[1] > 0)) + { + task->data[1] >>= 1; + } + if (task->data[2] > 6) + { + centerToCornerVecY = -(sprite->centerToCornerVecY << 1); + if (sprite->pos2.y > -(sprite->pos1.y + sprite->centerToCornerVecY + gSpriteCoordOffsetY + centerToCornerVecY)) + { + sprite->pos2.y -= task->data[3]; + if (task->data[3] <= 7) + { + task->data[3]++; + } + } else + { + task->data[4] = 1; + } + } + if (task->data[5] == 0 && sprite->pos2.y < -0x10) + { + task->data[5]++; + mapObject->mapobj_bit_26 = 1; + sprite->oam.priority = 1; + sprite->subspriteMode = 2; + } + if (task->data[1] == 0 && task->data[4] != 0) + { + task->data[0]++; + } + return FALSE; +} + +bool8 sub_80873D8(struct Task *task, struct MapObject *mapObject, struct Sprite *sprite) +{ + sub_8053FF8(); + fade_8080918(); + task->data[0]++; + return FALSE; +} + +bool8 sub_80873F4(struct Task *task, struct MapObject *mapObject, struct Sprite *sprite) +{ + if (!gPaletteFade.active && sub_8054034() == TRUE) + { + warp_in(); + gUnknown_0300485C = mapldr_080851BC; + SetMainCallback2(CB2_LoadMap); + DestroyTask(FindTaskIdByFunc(sub_80871D0)); + } + return FALSE; +} -- cgit v1.2.3 From d7c21854332787d2f932bbe2934456850994f730 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 9 Jun 2017 11:34:18 -0400 Subject: Second half of Flannery gym animation (increased uncertainty about which direction it is for) --- src/field_effect.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index 320c61b29..20e23c8fa 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -1519,3 +1519,71 @@ bool8 sub_80873F4(struct Task *task, struct MapObject *mapObject, struct Sprite } return FALSE; } + +void sub_8087470(u8); +extern const bool8 (*gUnknown_0839F354[4])(struct Task *, struct MapObject *, struct Sprite *); +extern u8 sub_80608A4(u8); + +void mapldr_080851BC(void) +{ + sub_8053E90(); + pal_fill_for_map_transition(); + ScriptContext2_Enable(); + gUnknown_0300485C = NULL; + CreateTask(sub_8087470, 0); +} + +void sub_8087470(u8 taskId) +{ + while (gUnknown_0839F354[gTasks[taskId].data[0]](&gTasks[taskId], &gMapObjects[gPlayerAvatar.mapObjectId], &gSprites[gPlayerAvatar.spriteId])); +} + +bool8 sub_80874CC(struct Task *task, struct MapObject *mapObject, struct Sprite *sprite) +{ + CameraObjectReset2(); + FreezeMapObjects(); + gPlayerAvatar.unk6 = 1; + mapObject->mapobj_bit_13 = 1; + task->data[0]++; + return FALSE; +} + +bool8 sub_80874FC(struct Task *task, struct MapObject *mapObject, struct Sprite *sprite) +{ + if (sub_807D770()) + { + gUnknown_0202FF84[0] = mapObject->coords2.x; + gUnknown_0202FF84[1] = mapObject->coords2.y; + gUnknown_0202FF84[2] = sprite->subpriority - 1; + gUnknown_0202FF84[3] = sprite->oam.priority; + task->data[1] = FieldEffectStart(FLDEFF_POP_OUT_OF_ASH); + task->data[0]++; + } + return FALSE; +} + +bool8 sub_8087548(struct Task *task, struct MapObject *mapObject, struct Sprite *sprite) +{ + sprite = &gSprites[task->data[1]]; + if (sprite->animCmdIndex > 1) + { + task->data[0]++; + mapObject->mapobj_bit_13 = 0; + CameraObjectReset1(); + PlaySE(SE_W091); + FieldObjectSetSpecialAnim(mapObject, sub_80608A4(DIR_EAST)); + } + return FALSE; +} + +bool8 sub_808759C(struct Task *task, struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectClearAnimIfSpecialAnimFinished(mapObject)) + { + gPlayerAvatar.unk6 = 0; + ScriptContext2_Disable(); + UnfreezeMapObjects(); + DestroyTask(FindTaskIdByFunc(sub_8087470)); + } + return FALSE; +} -- cgit v1.2.3 From 95b82b5dbb11e63f4cbaa09981dea04f9b729777 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 9 Jun 2017 13:59:11 -0400 Subject: FldEff_LavaridgeGymWarp --- src/field_effect.c | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index 20e23c8fa..1661245c5 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -1587,3 +1587,102 @@ bool8 sub_808759C(struct Task *task, struct MapObject *mapObject, struct Sprite } return FALSE; } + +extern void sub_8060470(s16 *x, s16 *y, s16 dx, s16 dy); +extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[36]; + +u8 FldEff_LavaridgeGymWarp(void) +{ + u8 spriteId; + sub_8060470((s16 *)&gUnknown_0202FF84[0], (s16 *)&gUnknown_0202FF84[1], 8, 8); + spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[33], gUnknown_0202FF84[0], gUnknown_0202FF84[1], gUnknown_0202FF84[2]); + gSprites[spriteId].oam.priority = gUnknown_0202FF84[3]; + gSprites[spriteId].coordOffsetEnabled = 1; + return spriteId; +} + +void sub_8087638(struct Sprite *sprite) +{ + if (sprite->animEnded) + { + FieldEffectStop(sprite, FLDEFF_LAVARIDGE_GYM_WARP); + } +} + +void sub_808766C(u8); +extern const bool8 (*gUnknown_0839F364[5])(struct Task *, struct MapObject *, struct Sprite *); + +void sub_8087654(u8 priority) +{ + CreateTask(sub_808766C, priority); +} + +void sub_808766C(u8 taskId) +{ + while(gUnknown_0839F364[gTasks[taskId].data[0]](&gTasks[taskId], &gMapObjects[gPlayerAvatar.mapObjectId], &gSprites[gPlayerAvatar.spriteId])); +} + +bool8 sub_80876C8(struct Task *task, struct MapObject *mapObject, struct Sprite *sprite) +{ + FreezeMapObjects(); + CameraObjectReset2(); + gPlayerAvatar.unk6 = 1; + mapObject->mapobj_bit_26 = 1; + task->data[0]++; + return FALSE; +} + +bool8 sub_80876F8(struct Task *task, struct MapObject *mapObject, struct Sprite *sprite) +{ + if (FieldObjectClearAnimIfSpecialAnimFinished(mapObject)) + { + if (task->data[1] > 3) + { + gUnknown_0202FF84[0] = mapObject->coords2.x; + gUnknown_0202FF84[1] = mapObject->coords2.y; + gUnknown_0202FF84[2] = sprite->subpriority - 1; + gUnknown_0202FF84[3] = sprite->oam.priority; + task->data[1] = FieldEffectStart(FLDEFF_POP_OUT_OF_ASH); + task->data[0]++; + } else + { + task->data[1]++; + FieldObjectSetSpecialAnim(mapObject, GetStepInPlaceDelay4AnimId(mapObject->mapobj_unk_18)); + PlaySE(SE_FU_ZUZUZU); + } + } + return FALSE; +} + +bool8 sub_8087774(struct Task *task, struct MapObject *mapObject, struct Sprite *sprite) +{ + if (gSprites[task->data[1]].animCmdIndex == 2) + { + mapObject->mapobj_bit_13 = 1; + task->data[0]++; + } + return FALSE; +} + +bool8 sub_80877AC(struct Task *task, struct MapObject *mapObject, struct Sprite *sprite) +{ + if (!FieldEffectActiveListContains(FLDEFF_POP_OUT_OF_ASH)) + { + sub_8053FF8(); + fade_8080918(); + task->data[0]++; + } + return FALSE; +} + +bool8 sub_80877D4(struct Task *task, struct MapObject *mapObject, struct Sprite *sprite) +{ + if (!gPaletteFade.active && sub_8054034() == TRUE) + { + warp_in(); + gUnknown_0300485C = sub_8086748; + SetMainCallback2(CB2_LoadMap); + DestroyTask(FindTaskIdByFunc(sub_808766C)); + } + return FALSE; +} -- cgit v1.2.3 From 5980e95c3daadaa2fe91713fa72b36eeead7678f Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 9 Jun 2017 20:05:28 -0400 Subject: FldEff_PopOutOfAsh (misnamed?) --- src/field_effect.c | 133 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index 1661245c5..f20c2ed60 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -1675,6 +1675,11 @@ bool8 sub_80877AC(struct Task *task, struct MapObject *mapObject, struct Sprite return FALSE; } +void sub_80878C4(u8); +extern u8 gUnknown_0839F380[5]; +extern const void (*gUnknown_0839F378[2])(struct Task *); +void mapldr_080859D4(void); + bool8 sub_80877D4(struct Task *task, struct MapObject *mapObject, struct Sprite *sprite) { if (!gPaletteFade.active && sub_8054034() == TRUE) @@ -1686,3 +1691,131 @@ bool8 sub_80877D4(struct Task *task, struct MapObject *mapObject, struct Sprite } return FALSE; } + +u8 FldEff_PopOutOfAsh(void) +{ + u8 spriteId; + sub_8060470((s16 *)&gUnknown_0202FF84[0], (s16 *)&gUnknown_0202FF84[1], 8, 8); + spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[32], gUnknown_0202FF84[0], gUnknown_0202FF84[1], gUnknown_0202FF84[2]); + gSprites[spriteId].oam.priority = gUnknown_0202FF84[3]; + gSprites[spriteId].coordOffsetEnabled = 1; + return spriteId; +} + +void sub_808788C(struct Sprite *sprite) +{ + if (sprite->animEnded) + { + FieldEffectStop(sprite, FLDEFF_POP_OUT_OF_ASH); + } +} + +void sub_80878A8(void) +{ + ScriptContext2_Enable(); + FreezeMapObjects(); + CreateTask(sub_80878C4, 0x50); +} + +void sub_80878C4(u8 taskId) +{ + gUnknown_0839F378[gTasks[taskId].data[0]](&gTasks[taskId]); +} + +void sub_80878F4(struct Task *task) +{ + task->data[0]++; + task->data[14] = 64; + task->data[15] = player_get_direction_lower_nybble(); +} + +void sub_8087914(struct Task *task) +{ + struct MapObject *mapObject; + u8 unknown_0839F380[5]; + memcpy(unknown_0839F380, gUnknown_0839F380, sizeof gUnknown_0839F380); + if (task->data[14] != 0 && (--task->data[14]) == 0) + { + sub_8053FF8(); + fade_8080918(); + } + mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + if (!FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive(mapObject) || FieldObjectClearAnimIfSpecialAnimFinished(mapObject)) + { + if (task->data[14] == 0 && !gPaletteFade.active && sub_8054034() == TRUE) + { + FieldObjectSetDirection(mapObject, task->data[15]); + sub_8053678(); + warp_in(); + gUnknown_0300485C = mapldr_080859D4; + SetMainCallback2(CB2_LoadMap); + DestroyTask(FindTaskIdByFunc(sub_80878C4)); + } else if (task->data[1] == 0 || (--task->data[1]) == 0) + { + FieldObjectSetSpecialAnim(mapObject, GetFaceDirectionAnimId(unknown_0839F380[mapObject->mapobj_unk_18])); + if (task->data[2] < 12) + { + task->data[2]++; + } + task->data[1] = 8 >> (task->data[2] >> 2); + } + } +} + +void sub_8087A74(u8); +extern const void (*gUnknown_0839F388[2])(struct Task *); + +void mapldr_080859D4(void) +{ + sub_8053E90(); + pal_fill_for_map_transition(); + ScriptContext2_Enable(); + FreezeMapObjects(); + gUnknown_0300485C = NULL; + gMapObjects[gPlayerAvatar.mapObjectId].mapobj_bit_13 = 1; + CreateTask(sub_8087A74, 0); +} + +void sub_8087A74(u8 taskId) +{ + gUnknown_0839F388[gTasks[taskId].data[0]](&gTasks[taskId]); +} + +void sub_8087AA4(struct Task *task) +{ + if (sub_807D770()) + { + task->data[0]++; + task->data[15] = player_get_direction_lower_nybble(); + } +} + +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]; + if (task->data[1] == 0 || (--task->data[1]) == 0) + { + if (FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive(mapObject) && !FieldObjectClearAnimIfSpecialAnimFinished(mapObject)) + { + return; + } + if (task->data[2] >= 32 && task->data[15] == player_get_direction_lower_nybble()) + { + mapObject->mapobj_bit_13 = 0; + ScriptContext2_Disable(); + UnfreezeMapObjects(); + DestroyTask(FindTaskIdByFunc(sub_8087A74)); + return; + } + FieldObjectSetSpecialAnim(mapObject, GetFaceDirectionAnimId(unknown_0839F380[mapObject->mapobj_unk_18])); + if (task->data[2] < 32) + { + task->data[2]++; + } + task->data[1] = task->data[2] >> 2; + } + mapObject->mapobj_bit_13 ^= 1; +} -- cgit v1.2.3 From 66b7c04c71d54baf37f0928dd50004af87596993 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 10 Jun 2017 09:57:36 -0400 Subject: Another map-changing field effect (evil team hideout warp pads?) --- src/field_effect.c | 189 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 189 insertions(+) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index f20c2ed60..8a874efb6 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -1819,3 +1819,192 @@ void sub_8087AC8(struct Task *task) } mapObject->mapobj_bit_13 ^= 1; } + +void sub_8087BBC(u8); +extern const void (*gUnknown_0839F390[4])(struct Task *); +void mapldr_08085D88(void); + +void sub_8087BA8(void) +{ + CreateTask(sub_8087BBC, 0); +} + +void sub_8087BBC(u8 taskId) +{ + gUnknown_0839F390[gTasks[taskId].data[0]](&gTasks[taskId]); +} + +void sub_8087BEC(struct Task *task) +{ + ScriptContext2_Enable(); + FreezeMapObjects(); + CameraObjectReset2(); + task->data[15] = player_get_direction_lower_nybble(); + task->data[0]++; +} + +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]; + if (task->data[1] == 0 || (--task->data[1]) == 0) + { + FieldObjectTurn(mapObject, unknown_0839F380[mapObject->mapobj_unk_18]); + task->data[1] = 8; + task->data[2]++; + } + if (task->data[2] > 7 && task->data[15] == mapObject->mapobj_unk_18) + { + task->data[0]++; + task->data[1] = 4; + task->data[2] = 8; + task->data[3] = 1; + PlaySE(SE_TK_WARPIN); + } +} + +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]; + if ((--task->data[1]) <= 0) + { + task->data[1] = 4; + FieldObjectTurn(mapObject, unknown_0839F380[mapObject->mapobj_unk_18]); + } + sprite->pos1.y -= task->data[3]; + task->data[4] += task->data[3]; + if ((--task->data[2]) <= 0 && (task->data[2] = 4, task->data[3] < 8)) + { + task->data[3] <<= 1; + } + if (task->data[4] > 8 && (sprite->oam.priority = 1, sprite->subspriteMode != 0)) + { + sprite->subspriteMode = 2; + } + if (task->data[4] >= 0xa8) + { + task->data[0]++; + sub_8053FF8(); + fade_8080918(); + } +} + +void sub_8087D78(struct Task *task) +{ + if (!gPaletteFade.active && sub_8054034() == TRUE) + { + sub_8053570(); + warp_in(); + SetMainCallback2(CB2_LoadMap); + gUnknown_0300485C = mapldr_08085D88; + DestroyTask(FindTaskIdByFunc(sub_8087BBC)); + } +} + +void sub_8087E1C(u8); +extern const void (*gUnknown_0839F3A0[3])(struct Task *); + +void mapldr_08085D88(void) +{ + sub_8053E90(); + pal_fill_for_map_transition(); + ScriptContext2_Enable(); + FreezeMapObjects(); + gUnknown_0300485C = NULL; + gMapObjects[gPlayerAvatar.mapObjectId].mapobj_bit_13 = 1; + CameraObjectReset2(); + CreateTask(sub_8087E1C, 0); +} + +void sub_8087E1C(u8 taskId) +{ + gUnknown_0839F3A0[gTasks[taskId].data[0]](&gTasks[taskId]); +} + +void sub_8087E4C(struct Task *task) +{ + struct Sprite *sprite; + s16 centerToCornerVecY; + if (sub_807D770()) + { + sprite = &gSprites[gPlayerAvatar.spriteId]; + centerToCornerVecY = -(sprite->centerToCornerVecY << 1); + sprite->pos2.y = -(sprite->pos1.y + sprite->centerToCornerVecY + gSpriteCoordOffsetY + centerToCornerVecY); + gMapObjects[gPlayerAvatar.mapObjectId].mapobj_bit_13 = 0; + task->data[0]++; + task->data[1] = 8; + task->data[2] = 1; + task->data[14] = sprite->subspriteMode; + task->data[15] = player_get_direction_lower_nybble(); + PlaySE(SE_TK_WARPIN); + } +} + +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]; + if ((sprite->pos2.y += task->data[1]) >= -8) + { + if (task->data[13] == 0) + { + task->data[13]++; + mapObject->mapobj_bit_2 = 1; + sprite->subspriteMode = task->data[14]; + } + } else + { + sprite->oam.priority = 1; + if (sprite->subspriteMode != 0) + { + sprite->subspriteMode = 2; + } + } + if (sprite->pos2.y >= -0x30 && task->data[1] > 1 && !(sprite->pos2.y & 1)) + { + task->data[1]--; + } + if ((--task->data[2]) == 0) + { + task->data[2] = 4; + FieldObjectTurn(mapObject, unknown_0839F380[mapObject->mapobj_unk_18]); + } + if (sprite->pos2.y >= 0) + { + sprite->pos2.y = 0; + task->data[0]++; + task->data[1] = 1; + task->data[2] = 0; + } +} + +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]; + if ((--task->data[1]) == 0) + { + FieldObjectTurn(mapObject, unknown_0839F380[mapObject->mapobj_unk_18]); + task->data[1] = 8; + if ((++task->data[2]) > 4 && task->data[14] == mapObject->mapobj_unk_18) + { + ScriptContext2_Disable(); + CameraObjectReset1(); + UnfreezeMapObjects(); + DestroyTask(FindTaskIdByFunc(sub_8087E1C)); + } + } +} -- cgit v1.2.3 From 40bcba1a64f2377166b419ecbabf8ac4a097b8ef Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 10 Jun 2017 10:07:06 -0400 Subject: Init functions for FieldMoveShowMon --- src/field_effect.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index 8a874efb6..3a56dfdcb 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -2008,3 +2008,35 @@ void sub_8087FDC(struct Task *task) } } } + +void sub_8088120(u8); +void sub_808847C(u8); +u8 sub_8088830(u32, u32, u32); + +bool8 FldEff_FieldMoveShowMon(void) +{ + u8 taskId; + if (is_light_level_1_2_3_5_or_6(sav1_map_get_light_level()) == TRUE) + { + taskId = CreateTask(sub_8088120, 0xff); + } else + { + taskId = CreateTask(sub_808847C, 0xff); + } + gTasks[taskId].data[15] = sub_8088830(gUnknown_0202FF84[0], gUnknown_0202FF84[1], gUnknown_0202FF84[2]); + return FALSE; +} + +bool8 FldEff_FieldMoveShowMonInit(void) +{ + struct Pokemon *pokemon; + u32 flag = gUnknown_0202FF84[0] & 0x80000000; + pokemon = &gPlayerParty[(u8)gUnknown_0202FF84[0]]; + gUnknown_0202FF84[0] = GetMonData(pokemon, MON_DATA_SPECIES); + gUnknown_0202FF84[1] = GetMonData(pokemon, MON_DATA_OT_ID); + gUnknown_0202FF84[2] = GetMonData(pokemon, MON_DATA_PERSONALITY); + gUnknown_0202FF84[0] |= flag; + FieldEffectStart(FLDEFF_FIELD_MOVE_SHOW_MON); + FieldEffectActiveListRemove(FLDEFF_FIELD_MOVE_SHOW_MON_INIT); + return FALSE; +} -- cgit v1.2.3 From 6f843698941b8b21b372a5fe9cda6c286fd68ee3 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Sat, 10 Jun 2017 12:45:31 -0400 Subject: whitespace --- src/player_pc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/player_pc.c b/src/player_pc.c index 4c321ba46..7a2377bbb 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -1015,7 +1015,7 @@ void Mailbox_DrawMailList(u8 taskId) // taskId is unused u16 i = gMailboxInfo.itemsAbove; register struct MailboxStruct *tempMailbox asm("r1") = &gMailboxInfo; register struct MailboxStruct *mailbox asm("r6"); - + if(i < i + tempMailbox->pageItems) { mailbox = tempMailbox; @@ -1038,11 +1038,11 @@ void Mailbox_DrawMailList(u8 taskId) // taskId is unused } } } - + beforeLabel: if(i - gMailboxInfo.itemsAbove != 8) MenuFillWindowRectWithBlankTile(0x15, yCoord + 4, 0x1C, 0x12); - + switch(gMailboxInfo.itemsAbove) { default: @@ -1055,7 +1055,7 @@ weirdCase: DestroyVerticalScrollIndicator(0); break; } - + if(gMailboxInfo.itemsAbove + gMailboxInfo.pageItems <= gMailboxInfo.count) CreateVerticalScrollIndicators(1, 0xC8, 0x98); else @@ -1243,7 +1243,7 @@ void sub_813B578(u8 taskId) struct MailStruct *mail = &gSaveBlock1.mail[gMailboxInfo.itemsAbove + 6 + gMailboxInfo.cursorPos]; MenuZeroFillWindowRect(0x14, 8, 0x1A, 0xD); - + if(AddBagItem(mail->itemId, 1) == FALSE) { DisplayItemMessageOnField(taskId, gOtherText_BagIsFull, sub_813B758, 0); @@ -1297,7 +1297,7 @@ void sub_813B6A4(void) gMailboxInfo.count = GetMailboxMailCount(); Mailbox_UpdateMailList(); - + if(oldCount != gMailboxInfo.count && gMailboxInfo.count < gMailboxInfo.pageItems + gMailboxInfo.itemsAbove && gMailboxInfo.itemsAbove != 0) // did the count update? gMailboxInfo.itemsAbove--; -- cgit v1.2.3 From a7419893b5dd5ce659133ab4655d8b32c923a782 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Sat, 10 Jun 2017 13:04:09 -0400 Subject: whitespace 2 electric boogaloo --- src/player_pc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/player_pc.c b/src/player_pc.c index 7a2377bbb..f39d812b6 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -771,7 +771,7 @@ void ItemStorage_DoItemSwap(u8 taskId, bool8 switchModeDisabled) /* THEORY: This check produces essentially dead code, but it might have been working in an earlier build in which case it allows a programmer to easily duplicate items without the use of a debug menu. - This gets the page index of the swap index for some reason. It is currently unknown what it would have been used + This gets the page index of the swap index for some reason. It is currently unknown what it would have been used for, but perhaps it was used to increase the quantity of the item without a debug menu. With the removal of a lot of the debug menus close to release, a programmer may have added this to help test things with a low key (such as planting a lot of duplicated berries, which requires this lazy "cheat") @@ -942,7 +942,7 @@ void ItemStorage_DrawBothListAndDescription(u8 taskId) s16 trueIndex = ITEMS_ABOVE_TOP + PAGE_INDEX; ItemStorage_DrawItemList(taskId); - + if(SWITCH_MODE_ACTIVE == FALSE) { if(trueIndex == NUM_ITEMS) @@ -1025,7 +1025,7 @@ void Mailbox_DrawMailList(u8 taskId) // taskId is unused forJump: yCoord = (i - mailbox->itemsAbove) * 2; MenuFillWindowRectWithBlankTile(0x15, yCoord + 2, 0x1C, yCoord + 3); - + if(i != mailbox->count) { StringCopy(gStringVar1, (u8 *)gSaveBlock1.mail[i + 6].playerName); @@ -1053,13 +1053,13 @@ weirdCase: goto beforeLabel; case 0: DestroyVerticalScrollIndicator(0); - break; + break; } if(gMailboxInfo.itemsAbove + gMailboxInfo.pageItems <= gMailboxInfo.count) CreateVerticalScrollIndicators(1, 0xC8, 0x98); else - DestroyVerticalScrollIndicator(1); + DestroyVerticalScrollIndicator(1); } void Mailbox_DrawMailboxMenu(u8 taskId) -- cgit v1.2.3 From 16db220259f321860e503282db86837124f3c66a Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 10 Jun 2017 12:56:59 -0500 Subject: move some common battle struct definitions to battle.h --- src/battle_2.c | 19 ------------------- src/battle_7.c | 45 +-------------------------------------------- src/battle_811DA74.c | 33 ++------------------------------- src/battle_ai.c | 2 +- src/battle_interface.c | 26 +++++++------------------- 5 files changed, 11 insertions(+), 114 deletions(-) (limited to 'src') diff --git a/src/battle_2.c b/src/battle_2.c index 79d62ce69..f7051fbfd 100644 --- a/src/battle_2.c +++ b/src/battle_2.c @@ -55,23 +55,6 @@ struct UnknownPokemonStruct2 /*0x1D*/ u8 language; }; -struct UnknownStruct9 -{ - u8 unk0; - u16 unk2; -}; - -struct UnknownStruct10 -{ - u8 unk0_0:1; - u8 unk0_1:1; - u8 unk0_2:1; - u8 filler1[1]; - u8 unk2; - u8 unk3; - u8 filler4[8]; -}; - struct UnknownStruct11 { u8 unk0; @@ -172,8 +155,6 @@ extern u8 ewram[]; #define ewram17100 ((u32 *)(ewram + 0x17100)) #define ewram17130 (ewram[0x17130]) #define ewram17160 (ewram[0x17160]) -#define ewram17800 ((struct UnknownStruct9 *)(ewram + 0x17800)) -#define ewram17810 ((struct UnknownStruct10 *)(ewram + 0x17810)) #define ewram1D000 ((struct Pokemon *)(ewram + 0x1D000)) extern struct UnknownPokemonStruct2 gUnknown_02023A00[]; diff --git a/src/battle_7.c b/src/battle_7.c index 9b73eb573..1acadf7db 100644 --- a/src/battle_7.c +++ b/src/battle_7.c @@ -1,7 +1,6 @@ #include "global.h" #include "asm.h" -// Include this when my other PR gets merged -//#include "battle.h" +#include "battle.h" #include "battle_interface.h" #include "battle_anim.h" #include "blend_palette.h" @@ -15,48 +14,6 @@ #include "task.h" #include "gba/m4a_internal.h" -// Probably the same one from battle_811DA74.c -struct UnknownStruct2_ -{ - u8 unk0_0:1; - u8 unk0_1:2; - u8 unk0_3:1; - u8 unk0_4:1; - u8 unk0_5:1; - u8 unk0_6:1; - u8 unk0_7:1; - u8 unk1_0:1; - u8 filler2[2]; - u8 unk4; - u8 unk5; - u8 filler6[2]; - u8 unk8; - u8 unk9; - u8 fillerA[2]; -}; - -struct UnknownStruct4_ -{ - u8 unk0_0:1; - u8 unk0_1:1; - u8 unk0_2:1; - u8 unk0_3:1; - u16 unk2; -}; - -struct UnknownStruct6 -{ - u16 unk0; - u8 filler2[7]; - u8 unk9; -}; - -extern u8 ewram[]; - -#define ewram17800 ((struct UnknownStruct4_ *)(ewram + 0x17800)) -#define ewram17810 ((struct UnknownStruct2_ *)(ewram + 0x17810)) -#define ewram17840 (*(struct UnknownStruct6 *)(ewram + 0x17840)) - extern struct MusicPlayerInfo gMPlay_SE1; extern struct MusicPlayerInfo gMPlay_SE2; extern u8 gUnknown_02024A60; diff --git a/src/battle_811DA74.c b/src/battle_811DA74.c index 56a4bd0c4..f39aa5248 100644 --- a/src/battle_811DA74.c +++ b/src/battle_811DA74.c @@ -21,24 +21,6 @@ struct UnknownStruct1 u8 unk2[0x1FE]; }; -struct UnknownStruct2 -{ - u8 unk0_0:1; - u8 unk0_1:2; - u8 unk0_3:1; - u8 unk0_4:1; - u8 unk0_5:1; - u8 unk0_6:1; - u8 unk0_7:1; - u8 unk1_0:1; - u8 filler2[2]; - u8 unk4; - u8 unk5; - u8 filler6[3]; - u8 unk9; - u8 fillerA[2]; -}; - //Possibly PokemonSubstruct1 struct UnknownStruct3 { @@ -47,24 +29,19 @@ struct UnknownStruct3 u8 ppBonuses; }; -struct UnknownStruct4 -{ - u8 unk0_0:2; - u8 unk0_2:1; - u8 unk0_3:1; -}; - struct UnknownStruct5 { u8 unk0_0:7; u8 unk0_7:1; }; +/* struct UnknownStruct6 { u8 filler0[9]; u8 unk9; }; +*/ extern u32 gBitTable[]; extern u16 gBattleTypeFlags; @@ -100,12 +77,6 @@ extern u8 gAnimScriptActive; extern void (*gAnimScriptCallback)(void); extern void (*const gUnknown_083FE4F4[])(void); -extern u8 ewram[]; - -#define ewram17800 ((struct UnknownStruct4 *)(ewram + 0x17800)) -#define ewram17810 ((struct UnknownStruct2 *)(ewram + 0x17810)) -#define ewram17840 (*(struct UnknownStruct6 *)(ewram + 0x17840)) - extern u8 move_anim_start_t3(); extern u8 sub_8078874(); extern void sub_8044CA0(u8); diff --git a/src/battle_ai.c b/src/battle_ai.c index dbd926000..4f00cc7cb 100644 --- a/src/battle_ai.c +++ b/src/battle_ai.c @@ -1998,7 +1998,7 @@ static void BattleAICmd_get_item(void) index = gEnemyMonIndex; // this hack and a half matches. whatever. i dont care. someone else fix this mess later. PS: still cant fix this. - AI_THINKING_STRUCT->funcResult = unk_2000000[0x160CC + (index * 2)]; + AI_THINKING_STRUCT->funcResult = ewram[0x160CC + (index * 2)]; gAIScriptPtr += 2; } diff --git a/src/battle_interface.c b/src/battle_interface.c index 61a6a5853..c05d66148 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -1,5 +1,6 @@ #include "global.h" #include "asm.h" +#include "battle.h" #include "sprite.h" #include "string_util.h" #include "text.h" @@ -19,18 +20,6 @@ struct UnknownStruct5 u32 unk10; }; -struct UnknownStruct6 -{ - u8 bit_0:1; - u8 bit_1:1; - u8 bit_2:1; - u8 bit_3:1; - u8 bit_4:1; - u8 bit_5:1; - u8 bit_6:1; - u8 bit_7:1; -}; - struct UnknownStruct7 { u8 filler0[0x180]; @@ -40,7 +29,6 @@ extern u8 ewram[]; #define ewram520 ((struct UnknownStruct7 *)(ewram + 0x00520)) #define ewram16088 (*(u8 *) (ewram + 0x16088)) #define ewram16089 (*(u8 *) (ewram + 0x16089)) -#define ewram17800 ((struct UnknownStruct6 *)(ewram + 0x17800)) #define ewram17850 ((struct UnknownStruct5 *)(ewram + 0x17850)) extern u8 gUnknown_020238CC[]; @@ -939,7 +927,7 @@ static void sub_8044210(u8 a, s16 b, u8 c) // TODO: make this a local variable memcpy(str, gUnknown_0820A89C, sizeof(str)); r4 = gSprites[a].data6; - if ((ewram17800[r4].bit_4) == 0) + if ((ewram17800[r4].unk0_4) == 0) return; ptr = str + 6; if (c == 0) @@ -1312,8 +1300,8 @@ void sub_804454C(void) { u8 r6; - ewram17800[i].bit_4 ^= 1; - r6 = ewram17800[i].bit_4; + ewram17800[i].unk0_4 ^= 1; + r6 = ewram17800[i].unk0_4; if (battle_side_get_owner(i) == 0) { @@ -2587,7 +2575,7 @@ static void draw_status_ailment_maybe(u8 a) for (i = 0; i < 3; i++) CpuCopy32(r6, (void *)(OBJ_VRAM0 + (gSprites[a].oam.tileNum + r8 + i) * 32), 32); - if (!ewram17800[r7].bit_4) + if (!ewram17800[r7].unk0_4) CpuCopy32(sub_8043CDC(1), (void *)(OBJ_VRAM0 + gSprites[r10].oam.tileNum * 32), 64); sub_8045458(a, 1); @@ -2602,7 +2590,7 @@ static void draw_status_ailment_maybe(u8 a) CpuCopy32(r6, (void *)(OBJ_VRAM0 + (gSprites[a].oam.tileNum + r8) * 32), 96); if (IsDoubleBattle() == TRUE || battle_side_get_owner(r7) == TRUE) { - if (!ewram17800[r7].bit_4) + if (!ewram17800[r7].unk0_4) { CpuCopy32(sub_8043CDC(0), (void *)(OBJ_VRAM0 + gSprites[r10].oam.tileNum * 32), 32); CpuCopy32(sub_8043CDC(0x41), (void *)(OBJ_VRAM0 + (gSprites[r10].oam.tileNum + 1) * 32), 32); @@ -2809,7 +2797,7 @@ s32 sub_8045C78(u8 a, u8 unused1, u8 c, u8 unused2) r5 = ABS(r8 / r5); r6 = sub_8045F58(ewram17850[a].unk4, ewram17850[a].unk8, r8, &ewram17850[a].unk10, 8, r5); } - if (c == 1 || (c == 0 && (!ewram17800[a].bit_4))) + if (c == 1 || (c == 0 && (!ewram17800[a].unk0_4))) sub_8045D58(a, c); if (r6 == -1) ewram17850[a].unk10 = 0; -- cgit v1.2.3 From b91879759462841b88ad3f0515ba205bedc84b90 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 10 Jun 2017 14:40:36 -0500 Subject: decompile sub_8031FC4 --- src/battle_7.c | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) (limited to 'src') diff --git a/src/battle_7.c b/src/battle_7.c index 1acadf7db..d909ceffc 100644 --- a/src/battle_7.c +++ b/src/battle_7.c @@ -14,6 +14,16 @@ #include "task.h" #include "gba/m4a_internal.h" +struct Struct2019348 +{ + u8 filler0[2]; + u16 unk2; + u8 filler4[4]; + u32 unk8; + u32 unkC; + u32 unk10; +}; + extern struct MusicPlayerInfo gMPlay_SE1; extern struct MusicPlayerInfo gMPlay_SE2; extern u8 gUnknown_02024A60; @@ -44,6 +54,9 @@ extern const struct SpriteSheet gUnknown_0820A4B4[]; extern const struct SpritePalette gUnknown_0820A4D4[]; extern const u8 gUnknown_08D09C48[]; +#define ewram19348 (*(struct Struct2019348 *)(ewram + 0x19348)) + +extern u8 sub_8077F68(u8); extern void sub_8094958(void); extern const u16 *pokemon_get_pal(struct Pokemon *); extern void sub_80105DC(struct Sprite *); @@ -572,3 +585,105 @@ void sub_8031F88(u8 a) { ewram17800[a].unk0_0 = gSprites[gUnknown_02024BE0[a]].invisible; } + +void sub_8031FC4(u8 a, u8 b, bool8 c) +{ + u16 paletteOffset; + u16 species; + u32 personalityValue; + u32 otId; + u8 r10; + const u16 *palette; + + if (c) + { + StartSpriteAnim(&gSprites[gUnknown_02024BE0[a]], ewram17840.unk0); + paletteOffset = 0x100 + a * 16; + LoadPalette(ewram + 0x16400 + ewram17840.unk0 * 32, paletteOffset, 32); + gBattleMonForms[a] = ewram17840.unk0; + if (ewram17800[a].unk2 != 0) + { + BlendPalette(paletteOffset, 16, 6, 0x7FFF); + CpuCopy32(gPlttBufferFaded + paletteOffset, gPlttBufferUnfaded + paletteOffset, 32); + } + gSprites[gUnknown_02024BE0[a]].pos1.y = sub_8077F68(a); + } + else + { + const void *src; + void *dst; + + if (IsContest()) + { + r10 = 0; + species = ewram19348.unk2; + personalityValue = ewram19348.unk8; + otId = ewram19348.unkC; + HandleLoadSpecialPokePic( + &gMonBackPicTable[species], + gMonBackPicCoords[species].coords, + gMonBackPicCoords[species].y_offset, + 0x02000000, + gUnknown_081FAF4C[0], + species, + ewram19348.unk10); + } + else + { + r10 = battle_get_per_side_status(a); + if (battle_side_get_owner(b) == 1) + species = GetMonData(&gEnemyParty[gUnknown_02024A6A[b]], MON_DATA_SPECIES); + else + species = GetMonData(&gPlayerParty[gUnknown_02024A6A[b]], MON_DATA_SPECIES); + if (battle_side_get_owner(a) == 0) + { + personalityValue = GetMonData(&gPlayerParty[gUnknown_02024A6A[a]], MON_DATA_PERSONALITY); + otId = GetMonData(&gPlayerParty[gUnknown_02024A6A[a]], MON_DATA_OT_ID); + HandleLoadSpecialPokePic( + &gMonBackPicTable[species], + gMonBackPicCoords[species].coords, + gMonBackPicCoords[species].y_offset, + 0x02000000, + gUnknown_081FAF4C[r10], + species, + gUnknown_02024E70[a]); + } + else + { + personalityValue = GetMonData(&gEnemyParty[gUnknown_02024A6A[a]], MON_DATA_PERSONALITY); + otId = GetMonData(&gEnemyParty[gUnknown_02024A6A[a]], MON_DATA_OT_ID); + HandleLoadSpecialPokePic( + &gMonFrontPicTable[species], + gMonFrontPicCoords[species].coords, + gMonFrontPicCoords[species].y_offset, + 0x02000000, + gUnknown_081FAF4C[r10], + species, + gUnknown_02024E70[a]); + } + } + src = gUnknown_081FAF4C[r10]; + dst = (void *)(VRAM + 0x10000 + gSprites[gUnknown_02024BE0[a]].oam.tileNum * 32); + DmaCopy32(3, src, dst, 0x800); + paletteOffset = 0x100 + a * 16; + palette = species_and_otid_get_pal(species, otId, personalityValue); + sub_800D238(palette, ewram); + LoadPalette(ewram, paletteOffset, 32); + if (species == SPECIES_CASTFORM) + { + u16 *paletteSrc = (u16 *)(ewram + 0x16400); + + sub_800D238(palette, paletteSrc); + LoadPalette(paletteSrc + gBattleMonForms[b] * 16, paletteOffset, 32); + } + BlendPalette(paletteOffset, 16, 6, 0x7FFF); + CpuCopy32(gPlttBufferFaded + paletteOffset, gPlttBufferUnfaded + paletteOffset, 32); + if (!IsContest()) + { + ewram17800[a].unk2 = species; + gBattleMonForms[a] = gBattleMonForms[b]; + } + gSprites[gUnknown_02024BE0[a]].pos1.y = sub_8077F68(a); + StartSpriteAnim(&gSprites[gUnknown_02024BE0[a]], gBattleMonForms[a]); + } +} -- cgit v1.2.3 From 974e4da9c9d325491df07d842da5eb6b45b50b2e Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 10 Jun 2017 16:50:56 -0500 Subject: decompile sub_8032350 - sub_80326EC --- src/battle_7.c | 165 ++++++++++++++++++++++++++++++++++++++++++++++++- src/battle_interface.c | 2 +- 2 files changed, 163 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/battle_7.c b/src/battle_7.c index d909ceffc..4288544cd 100644 --- a/src/battle_7.c +++ b/src/battle_7.c @@ -1,13 +1,16 @@ #include "global.h" #include "asm.h" #include "battle.h" -#include "battle_interface.h" #include "battle_anim.h" +#include "battle_interface.h" #include "blend_palette.h" #include "data2.h" #include "decompress.h" +#include "main.h" +#include "m4a.h" #include "palette.h" #include "pokemon.h" +#include "songs.h" #include "sound.h" #include "species.h" #include "sprite.h" @@ -46,6 +49,9 @@ extern const struct SpriteSheet gTrainerFrontPicTable[]; extern const struct MonCoords gTrainerFrontPicCoords[]; extern const struct SpritePalette gTrainerFrontPicPaletteTable[]; extern const struct SpriteSheet gUnknown_0820A47C; +extern const u8 gSubstituteDollTilemap[]; +extern const u8 gSubstituteDollGfx[]; +extern const u8 gSubstituteDollPal[]; extern const struct SpriteSheet gUnknown_0820A484; extern const struct SpriteSheet gUnknown_0820A48C[]; extern const struct SpriteSheet gUnknown_0820A49C[]; @@ -56,19 +62,22 @@ extern const u8 gUnknown_08D09C48[]; #define ewram19348 (*(struct Struct2019348 *)(ewram + 0x19348)) +extern u8 sub_8078874(u8); extern u8 sub_8077F68(u8); +extern u8 sub_8077F7C(u8); extern void sub_8094958(void); extern const u16 *pokemon_get_pal(struct Pokemon *); extern void sub_80105DC(struct Sprite *); extern void move_anim_start_t2(); -extern void refresh_graphics_maybe(); -extern void sub_80324E0(); extern const u16 *species_and_otid_get_pal(); void sub_80315E8(u8); u8 sub_803163C(u8); void sub_80316CC(u8); void sub_8031F0C(void); +void refresh_graphics_maybe(u8, u8, u8); +void sub_80324E0(u8 a); + void sub_80327CC(void); void sub_80312F0(struct Sprite *sprite) @@ -687,3 +696,153 @@ void sub_8031FC4(u8 a, u8 b, bool8 c) StartSpriteAnim(&gSprites[gUnknown_02024BE0[a]], gBattleMonForms[a]); } } + +void sub_8032350(u8 a, u8 b) +{ + u8 r4; + u16 foo; + const u8 *gSubstituteDollPal_; + void *src; + s32 i; + + if (b == 0) + { + if (IsContest()) + r4 = 0; + else + r4 = battle_get_per_side_status(a); + if (IsContest()) + LZDecompressVram(gSubstituteDollTilemap, gUnknown_081FAF4C[r4]); + else if (battle_side_get_owner(a) != 0) + LZDecompressVram(gSubstituteDollGfx, gUnknown_081FAF4C[r4]); + else + LZDecompressVram(gSubstituteDollTilemap, gUnknown_081FAF4C[r4]); + // There is probably a way to do this without all the temp variables, but I couldn't figure it out. + foo = a * 16; + gSubstituteDollPal_ = gSubstituteDollPal; + src = gUnknown_081FAF4C[r4]; + for (i = 0; i < 3; i++) + DmaCopy32(3, src, src + i * 0x800 + 0x800, 0x800); + LoadCompressedPalette(gSubstituteDollPal_, 0x100 + foo, 32); + } + else + { + if (!IsContest()) + { + if (battle_side_get_owner(a) != 0) + sub_8031794(&gEnemyParty[gUnknown_02024A6A[a]], a); + else + sub_80318FC(&gPlayerParty[gUnknown_02024A6A[a]], a); + } + } +} + +void refresh_graphics_maybe(u8 a, u8 b, u8 spriteId) +{ + sub_8032350(a, b); + StartSpriteAnim(&gSprites[spriteId], gBattleMonForms[a]); + if (b == 0) + gSprites[spriteId].pos1.y = sub_8077F7C(a); + else + gSprites[spriteId].pos1.y = sub_8077F68(a); +} + +void sub_80324BC(u8 a, u16 b) +{ + if (b == 0xA4) + ewram17800[a].unk0_2 = 1; +} + +void sub_80324E0(u8 a) +{ + ewram17800[a].unk0_2 = 0; +} + +void sub_80324F8(struct Pokemon *pkmn, u8 b) +{ + u16 hp = GetMonData(pkmn, MON_DATA_HP); + u16 maxHP = GetMonData(pkmn, MON_DATA_MAX_HP); + + if (GetHPBarLevel(hp, maxHP) == 1) + { + if (!ewram17800[b].unk0_1) + { + if (!ewram17800[b ^ 2].unk0_1) + PlaySE(SE_HINSI); + ewram17800[b].unk0_1 = 1; + } + } + else + { + ewram17800[b].unk0_1 = 0; + if (!IsDoubleBattle()) + { + m4aSongNumStop(SE_HINSI); + return; + } + if (IsDoubleBattle() && !ewram17800[b ^ 2].unk0_1) + { + m4aSongNumStop(SE_HINSI); + return; + } + } +} + +void sub_80325B8(void) +{ + u8 r4 = battle_get_side_with_given_state(0); + + ewram17800[r4].unk0_1 = 0; + if (IsDoubleBattle()) + ewram17800[r4 ^ 2].unk0_1 = 0; + m4aSongNumStop(SE_HINSI); +} + +u8 unref_sub_8032604(struct Pokemon *pkmn) +{ + u16 hp = GetMonData(pkmn, MON_DATA_HP); + u16 maxHP = GetMonData(pkmn, MON_DATA_MAX_HP); + + return GetHPBarLevel(hp, maxHP); +} + +void sub_8032638(void) +{ + if (gMain.inBattle) + { + u8 r8 = battle_get_side_with_given_state(0); + u8 r9 = battle_get_side_with_given_state(2); + u8 r4 = pokemon_order_func(gUnknown_02024A6A[r8]); + u8 r5 = pokemon_order_func(gUnknown_02024A6A[r9]); + + if (GetMonData(&gPlayerParty[r4], MON_DATA_HP) != 0) + sub_80324F8(&gPlayerParty[r4], r8); + if (IsDoubleBattle()) + { + if (GetMonData(&gPlayerParty[r5], MON_DATA_HP) != 0) + sub_80324F8(&gPlayerParty[r5], r9); + } + } +} + +void sub_80326EC(u8 a) +{ + s32 i; + + for (i = 0; i < gUnknown_02024A68; i++) + { + if (sub_8078874(i) != 0) + { + gSprites[gUnknown_02024BE0[i]].oam.affineMode = a; + if (a == 0) + { + ewram17810[i].unk6 = gSprites[gUnknown_02024BE0[i]].oam.matrixNum; + gSprites[gUnknown_02024BE0[i]].oam.matrixNum = 0; + } + else + { + gSprites[gUnknown_02024BE0[i]].oam.matrixNum = ewram17810[i].unk6; + } + } + } +} diff --git a/src/battle_interface.c b/src/battle_interface.c index c05d66148..0fd9462cc 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -3032,7 +3032,7 @@ u8 GetScaledHPFraction(s16 hp, s16 maxhp, u8 scale) return result; } -int GetHPBarLevel(s16 hp, s16 maxhp) +u8 GetHPBarLevel(s16 hp, s16 maxhp) { int result; -- cgit v1.2.3 From 1a5bcd59134f062ade7070b8e62f0d2f3c218537 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 10 Jun 2017 18:21:48 -0500 Subject: decompile sub_80327CC - sub_8032C4C --- src/battle_7.c | 173 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 165 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/battle_7.c b/src/battle_7.c index 4288544cd..dad098192 100644 --- a/src/battle_7.c +++ b/src/battle_7.c @@ -29,14 +29,18 @@ struct Struct2019348 extern struct MusicPlayerInfo gMPlay_SE1; extern struct MusicPlayerInfo gMPlay_SE2; +extern u8 gUnknown_02023A60[][0x200]; extern u8 gUnknown_02024A60; +extern u32 gUnknown_02024A64; extern u8 gUnknown_02024A68; extern u16 gUnknown_02024A6A[]; extern u8 gUnknown_02024A72[]; extern u8 gUnknown_02024BE0[]; extern u16 gUnknown_02024DE8; extern u32 gUnknown_02024E70[]; +extern void (*gUnknown_03004330[])(void); extern u8 gUnknown_03004340[]; +extern u32 gBitTable[]; extern u16 gBattleTypeFlags; extern u8 gBattleMonForms[]; extern u8 gBattleAnimPlayerMonIndex; @@ -48,10 +52,13 @@ extern const u8 *const gBattleAnims_Unknown2[]; extern const struct SpriteSheet gTrainerFrontPicTable[]; extern const struct MonCoords gTrainerFrontPicCoords[]; extern const struct SpritePalette gTrainerFrontPicPaletteTable[]; -extern const struct SpriteSheet gUnknown_0820A47C; extern const u8 gSubstituteDollTilemap[]; extern const u8 gSubstituteDollGfx[]; extern const u8 gSubstituteDollPal[]; +extern const struct SpriteSheet gUnknown_081FAF24; +extern const struct SpriteTemplate gSpriteTemplate_81FAF34; +extern void (*const gUnknown_081FAF5C[])(void); +extern const struct SpriteSheet gUnknown_0820A47C; extern const struct SpriteSheet gUnknown_0820A484; extern const struct SpriteSheet gUnknown_0820A48C[]; extern const struct SpriteSheet gUnknown_0820A49C[]; @@ -62,6 +69,7 @@ extern const u8 gUnknown_08D09C48[]; #define ewram19348 (*(struct Struct2019348 *)(ewram + 0x19348)) +extern u8 sub_8077ABC(); extern u8 sub_8078874(u8); extern u8 sub_8077F68(u8); extern u8 sub_8077F7C(u8); @@ -77,8 +85,11 @@ void sub_80316CC(u8); void sub_8031F0C(void); void refresh_graphics_maybe(u8, u8, u8); void sub_80324E0(u8 a); - void sub_80327CC(void); +void sub_8032978(struct Sprite *); +void sub_80328A4(struct Sprite *); +void sub_8032AFC(void); +void sub_80334EC(void); void sub_80312F0(struct Sprite *sprite) { @@ -704,7 +715,7 @@ void sub_8032350(u8 a, u8 b) const u8 *gSubstituteDollPal_; void *src; s32 i; - + if (b == 0) { if (IsContest()) @@ -762,7 +773,7 @@ void sub_80324F8(struct Pokemon *pkmn, u8 b) { u16 hp = GetMonData(pkmn, MON_DATA_HP); u16 maxHP = GetMonData(pkmn, MON_DATA_MAX_HP); - + if (GetHPBarLevel(hp, maxHP) == 1) { if (!ewram17800[b].unk0_1) @@ -791,7 +802,7 @@ void sub_80324F8(struct Pokemon *pkmn, u8 b) void sub_80325B8(void) { u8 r4 = battle_get_side_with_given_state(0); - + ewram17800[r4].unk0_1 = 0; if (IsDoubleBattle()) ewram17800[r4 ^ 2].unk0_1 = 0; @@ -802,7 +813,7 @@ u8 unref_sub_8032604(struct Pokemon *pkmn) { u16 hp = GetMonData(pkmn, MON_DATA_HP); u16 maxHP = GetMonData(pkmn, MON_DATA_MAX_HP); - + return GetHPBarLevel(hp, maxHP); } @@ -814,7 +825,7 @@ void sub_8032638(void) u8 r9 = battle_get_side_with_given_state(2); u8 r4 = pokemon_order_func(gUnknown_02024A6A[r8]); u8 r5 = pokemon_order_func(gUnknown_02024A6A[r9]); - + if (GetMonData(&gPlayerParty[r4], MON_DATA_HP) != 0) sub_80324F8(&gPlayerParty[r4], r8); if (IsDoubleBattle()) @@ -828,7 +839,7 @@ void sub_8032638(void) void sub_80326EC(u8 a) { s32 i; - + for (i = 0; i < gUnknown_02024A68; i++) { if (sub_8078874(i) != 0) @@ -846,3 +857,149 @@ void sub_80326EC(u8 a) } } } + +void sub_80327CC(void) +{ + u8 r5; + + LoadCompressedObjectPic(&gUnknown_081FAF24); + r5 = battle_get_side_with_given_state(1); + ewram17810[r5].unk7 = CreateSprite(&gSpriteTemplate_81FAF34, sub_8077ABC(r5, 0), sub_8077ABC(r5, 1) + 32, 0xC8); + gSprites[ewram17810[r5].unk7].data0 = r5; + if (IsDoubleBattle()) + { + r5 = battle_get_side_with_given_state(3); + ewram17810[r5].unk7 = CreateSprite(&gSpriteTemplate_81FAF34, sub_8077ABC(r5, 0), sub_8077ABC(r5, 1) + 32, 0xC8); + gSprites[ewram17810[r5].unk7].data0 = r5; + } +} + +void sub_80328A4(struct Sprite *sprite) +{ + bool8 invisible = FALSE; + u8 r4 = sprite->data0; + struct Sprite *r7 = &gSprites[gUnknown_02024BE0[r4]]; + + if (!r7->inUse || sub_8078874(r4) == 0) + { + sprite->callback = sub_8032978; + return; + } + if (gAnimScriptActive || r7->invisible) + invisible = TRUE; + else if (ewram17800[r4].unk2 != 0 && gEnemyMonElevation[ewram17800[r4].unk2] == 0) + invisible = TRUE; + if (ewram17800[r4].unk0_2) + invisible = TRUE; + sprite->pos1.x = r7->pos1.x; + sprite->pos2.x = r7->pos2.x; + sprite->invisible = invisible; +} + +void sub_8032978(struct Sprite *sprite) +{ + sprite->invisible = TRUE; +} + +void sub_8032984(u8 a, u16 b) +{ + if (battle_side_get_owner(a) != 0) + { + if (ewram17800[a].unk2 != 0) + b = ewram17800[a].unk2; + if (gEnemyMonElevation[b] != 0) + gSprites[ewram17810[a].unk7].callback = sub_80328A4; + else + gSprites[ewram17810[a].unk7].callback = sub_8032978; + } +} + +void sub_8032A08(u8 a) +{ + gSprites[ewram17810[a].unk7].callback = sub_8032978; +} + +void sub_8032A38(void) +{ + u16 *ptr = (u16 *)(VRAM + 0x240); + s32 i; + s32 j; + + for (i = 0; i < 9; i++) + { + for (j = 0; j < 16; j++) + { + if (!(*ptr & 0xF000)) + *ptr |= 0xF000; + if (!(*ptr & 0x0F00)) + *ptr |= 0x0F00; + if (!(*ptr & 0x00F0)) + *ptr |= 0x00F0; + if (!(*ptr & 0x000F)) + *ptr |= 0x000F; + ptr++; + } + } +} + +void sub_8032AA8(u8 a, u8 b) +{ + ewram17800[a].unk2 = 0; + gBattleMonForms[a] = 0; + if (b == 0) + sub_80324E0(a); +} + +void nullsub_45(void) +{ +} + +void sub_8032AE0(void) +{ + gUnknown_03004330[gUnknown_02024A60] = sub_8032AFC; +} + +void sub_8032AFC(void) +{ + if (gUnknown_02024A64 & gBitTable[gUnknown_02024A60]) + { + if (gUnknown_02023A60[gUnknown_02024A60][0] <= 0x38) + gUnknown_081FAF5C[gUnknown_02023A60[gUnknown_02024A60][0]](); + else + sub_80334EC(); + } +} + +void sub_8032B4C(void) +{ + if (gSprites[gUnknown_02024BE0[gUnknown_02024A60]].callback == SpriteCallbackDummy) + sub_80334EC(); +} + +// Duplicate of sub_8032B4C +void sub_8032B84(void) +{ + if (gSprites[gUnknown_02024BE0[gUnknown_02024A60]].callback == SpriteCallbackDummy) + sub_80334EC(); +} + +void sub_8032BBC(void) +{ + if (gSprites[gUnknown_02024BE0[gUnknown_02024A60]].callback == SpriteCallbackDummy) + { + sub_8031B74(gSprites[gUnknown_02024BE0[gUnknown_02024A60]].oam.affineParam); + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].oam.tileNum = gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data5; + FreeSpriteOamMatrix(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); + DestroySprite(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); + sub_80334EC(); + } +} + +void sub_8032C4C(void) +{ + if ((--ewram17810[gUnknown_02024A60].unk9) == 0xFF) + { + ewram17810[gUnknown_02024A60].unk9 = 0; + sub_80334EC(); + } +} -- cgit v1.2.3 From 19c16e2f94dda9fe354692f6e449b271e845ad22 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 10 Jun 2017 21:36:41 -0400 Subject: Attempt at decompiling field effect for sending out pokemon for field move --- src/field_effect.c | 280 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 280 insertions(+) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index 3a56dfdcb..5719245e5 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -7,6 +7,7 @@ #include "field_weather.h" #include "decompress.h" #include "sprite.h" +#include "menu.h" #include "palette.h" #include "text.h" #include "rom4.h" @@ -2012,6 +2013,13 @@ void sub_8087FDC(struct Task *task) void sub_8088120(u8); void sub_808847C(u8); u8 sub_8088830(u32, u32, u32); +extern const void (*gUnknown_0839F3AC[7])(struct Task *); +extern const void (*gUnknown_0839F3C8[7])(struct Task *); +extern const u32 gFieldMoveStreaksTiles[]; +extern const u16 gFieldMoveStreaksPalette[16]; +void sub_80883DC(void); +void sub_808843C(u16); +void sub_8088890(struct Sprite *); bool8 FldEff_FieldMoveShowMon(void) { @@ -2040,3 +2048,275 @@ bool8 FldEff_FieldMoveShowMonInit(void) FieldEffectActiveListRemove(FLDEFF_FIELD_MOVE_SHOW_MON_INIT); return FALSE; } + +void sub_8088120(u8 taskId) +{ + gUnknown_0839F3AC[gTasks[taskId].data[0]](&gTasks[taskId]); +} + +void sub_8088150(struct Task *task) +{ + task->data[11] = REG_WININ; + task->data[12] = REG_WINOUT; + StoreWordInTwoHalfwords(&task->data[13], (u32)gMain.vblankCallback); + task->data[1] = 0xf0f1; + task->data[2] = 0x5051; + task->data[3] = 0x3f; + task->data[4] = 0x3e; + REG_WIN0H = task->data[1]; + REG_WIN0V = task->data[2]; + REG_WININ = task->data[3]; + REG_WINOUT = task->data[4]; + SetVBlankCallback(sub_80883DC); + task->data[0]++; +} + +void sub_80881C0(struct Task *task) +{ + u32 zero; + u16 offset; + u16 delta; + offset = ((REG_BG0CNT >> 2) << 14); + delta = ((REG_BG0CNT >> 8) << 11); + CpuSet(gFieldMoveStreaksTiles, (void *)(VRAM + offset), 0x100); + zero = 0; + CpuSet(&zero, (void *)(VRAM + delta), 0x5000200); + LoadPalette(gFieldMoveStreaksPalette, 0xf0, 0x20); + sub_808843C(delta); + task->data[0]++; +} + +#ifdef NONMATCHING +void sub_8088228(struct Task *task) +{ + s16 v0; + s16 v2; + s16 v3; + task->data[5] -= 16; + // The order in which registers are loaded is incorrect. + v0 = ((u16)task->data[1] >> 8) - 0x10; + v2 = ((u16)task->data[2] >> 8) - 2; + v3 = ((u16)task->data[2] & 0xff) + 2; + if (v0 < 0) + { + v0 = 0; + } + if (v2 < 0x28) + { + v2 = 0x28; + } + if (v3 > 0x78) + { + v3 = 0x78; + } + task->data[1] = (v0 << 8) | (task->data[1] & 0xff); + task->data[2] = (v2 << 8) | v3; + if (v0 == 0 && v2 == 0x28 && v3 == 0x78) + { + gSprites[task->data[15]].callback = sub_8088890; + task->data[0]++; + } +} +#else +__attribute__((naked)) +void sub_8088228(struct Task *task) +{ + asm_unified("\tpush {r4-r7,lr}\n" + "\tadds r3, r0, 0\n" + "\tldrh r0, [r3, 0x12]\n" + "\tsubs r0, 0x10\n" + "\tstrh r0, [r3, 0x12]\n" + "\tldrh r6, [r3, 0xA]\n" + "\tldrh r2, [r3, 0xC]\n" + "\tmovs r7, 0xFF\n" + "\tlsrs r1, r6, 8\n" + "\tsubs r1, 0x10\n" + "\tlsls r1, 16\n" + "\tlsrs r0, r2, 8\n" + "\tsubs r0, 0x2\n" + "\tlsls r0, 16\n" + "\tlsrs r4, r0, 16\n" + "\tadds r0, r7, 0\n" + "\tands r0, r2\n" + "\tadds r5, r0, 0x2\n" + "\tlsrs r2, r1, 16\n" + "\tcmp r1, 0\n" + "\tbge _08088254\n" + "\tmovs r2, 0\n" + "_08088254:\n" + "\tlsls r0, r4, 16\n" + "\tasrs r0, 16\n" + "\tcmp r0, 0x27\n" + "\tbgt _0808825E\n" + "\tmovs r4, 0x28\n" + "_0808825E:\n" + "\tcmp r5, 0x78\n" + "\tble _08088264\n" + "\tmovs r5, 0x78\n" + "_08088264:\n" + "\tlsls r2, 16\n" + "\tasrs r2, 16\n" + "\tlsls r1, r2, 8\n" + "\tadds r0, r7, 0\n" + "\tands r0, r6\n" + "\torrs r1, r0\n" + "\tstrh r1, [r3, 0xA]\n" + "\tlsls r0, r4, 16\n" + "\tasrs r4, r0, 16\n" + "\tlsls r0, r4, 8\n" + "\tadds r1, r5, 0\n" + "\torrs r0, r1\n" + "\tstrh r0, [r3, 0xC]\n" + "\tcmp r2, 0\n" + "\tbne _080882A4\n" + "\tcmp r4, 0x28\n" + "\tbne _080882A4\n" + "\tcmp r1, 0x78\n" + "\tbne _080882A4\n" + "\tldr r2, _080882AC @ =gSprites\n" + "\tmovs r0, 0x26\n" + "\tldrsh r1, [r3, r0]\n" + "\tlsls r0, r1, 4\n" + "\tadds r0, r1\n" + "\tlsls r0, 2\n" + "\tadds r2, 0x1C\n" + "\tadds r0, r2\n" + "\tldr r1, _080882B0 @ =sub_8088890\n" + "\tstr r1, [r0]\n" + "\tldrh r0, [r3, 0x8]\n" + "\tadds r0, 0x1\n" + "\tstrh r0, [r3, 0x8]\n" + "_080882A4:\n" + "\tpop {r4-r7}\n" + "\tpop {r0}\n" + "\tbx r0\n" + "\t.align 2, 0\n" + "_080882AC: .4byte gSprites\n" + "_080882B0: .4byte sub_8088890"); +} +#endif + +void sub_80882B4(struct Task *task) +{ + task->data[5] -= 0x10; + if (gSprites[task->data[15]].data7) + { + task->data[0]++; + } +} + +#ifdef NONMATCHING +void sub_80882E4(struct Task *task) +{ + s16 v2; + s16 v3; + task->data[5] -= 0x10; + // The order in which registers are loaded is incorrect. + v2 = (task->data[2] >> 8) + 6; + v3 = (task->data[2] & 0xff) - 6; + if (v2 > 0x50) + { + v2 = 0x50; + } + if (v3 < 0x51) + { + v3 = 0x51; + } + task->data[2] = (v2 << 8) | v3; + if (v2 == 0x50 && v3 == 0x51) + { + task->data[0]++; + } +} +#else +__attribute__((naked)) +void sub_80882E4(struct Task *task) +{ + asm_unified("\tpush {r4,lr}\n" + "\tadds r3, r0, 0\n" + "\tldrh r0, [r3, 0x12]\n" + "\tsubs r0, 0x10\n" + "\tstrh r0, [r3, 0x12]\n" + "\tldrh r2, [r3, 0xC]\n" + "\tlsls r1, r2, 16\n" + "\tmovs r0, 0xFF\n" + "\tasrs r1, 24\n" + "\tadds r1, 0x6\n" + "\tlsls r1, 16\n" + "\tands r0, r2\n" + "\tsubs r0, 0x6\n" + "\tlsls r0, 16\n" + "\tlsrs r2, r0, 16\n" + "\tlsrs r4, r1, 16\n" + "\tasrs r1, 16\n" + "\tcmp r1, 0x50\n" + "\tble _0808830C\n" + "\tmovs r4, 0x50\n" + "_0808830C:\n" + "\tlsls r0, r2, 16\n" + "\tasrs r0, 16\n" + "\tcmp r0, 0x50\n" + "\tbgt _08088316\n" + "\tmovs r2, 0x51\n" + "_08088316:\n" + "\tlsls r0, r4, 16\n" + "\tasrs r0, 16\n" + "\tlsls r1, r0, 8\n" + "\tlsls r2, 16\n" + "\tasrs r2, 16\n" + "\torrs r1, r2\n" + "\tstrh r1, [r3, 0xC]\n" + "\tcmp r0, 0x50\n" + "\tbne _08088332\n" + "\tcmp r2, 0x51\n" + "\tbne _08088332\n" + "\tldrh r0, [r3, 0x8]\n" + "\tadds r0, 0x1\n" + "\tstrh r0, [r3, 0x8]\n" + "_08088332:\n" + "\tpop {r4}\n" + "\tpop {r0}\n" + "\tbx r0"); +} +#endif + +void sub_8088338(struct Task *task) +{ + u32 zero; + u16 bg0cnt; + bg0cnt = (REG_BG0CNT >> 8) << 11; + zero = 0; + CpuSet(&zero, (void *)VRAM + bg0cnt, 0x5000200); + task->data[1] = 0xf1; + task->data[2] = 0xa1; + task->data[3] = task->data[11]; + task->data[4] = task->data[12]; + task->data[0]++; +} + +void sub_8088380(struct Task *task) +{ + IntrCallback callback; + LoadWordFromTwoHalfwords((u16 *)&task->data[13], (u32 *)&callback); + SetVBlankCallback(callback); + SetUpWindowConfig(&gWindowConfig_81E6CE4); + InitMenuWindow(&gWindowConfig_81E6CE4); + FreeResourcesAndDestroySprite(&gSprites[task->data[15]]); + FieldEffectActiveListRemove(FLDEFF_FIELD_MOVE_SHOW_MON); + DestroyTask(FindTaskIdByFunc(sub_8088120)); +} + +void sub_80883DC(void) +{ + struct Task *task; + IntrCallback callback; + task = &gTasks[FindTaskIdByFunc(sub_8088120)]; + LoadWordFromTwoHalfwords((u16 *)&task->data[13], (u32 *)&callback); + callback(); + REG_WIN0H = task->data[1]; + REG_WIN0V = task->data[2]; + REG_WININ = task->data[3]; + REG_WINOUT = task->data[4]; + REG_BG0HOFS = task->data[5]; + REG_BG0VOFS = task->data[6]; +} -- cgit v1.2.3 From f14f219929ec0390e385cb9eee9f10fda4baf73a Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 10 Jun 2017 20:53:06 -0500 Subject: finish decompiling battle_7 --- src/battle_7.c | 235 ++++++++++++++++++++++++++++++++++++++++++++++++++- src/battle_811DA74.c | 10 +-- 2 files changed, 234 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/battle_7.c b/src/battle_7.c index dad098192..50f348406 100644 --- a/src/battle_7.c +++ b/src/battle_7.c @@ -15,6 +15,7 @@ #include "species.h" #include "sprite.h" #include "task.h" +#include "text.h" #include "gba/m4a_internal.h" struct Struct2019348 @@ -27,8 +28,6 @@ struct Struct2019348 u32 unk10; }; -extern struct MusicPlayerInfo gMPlay_SE1; -extern struct MusicPlayerInfo gMPlay_SE2; extern u8 gUnknown_02023A60[][0x200]; extern u8 gUnknown_02024A60; extern u32 gUnknown_02024A64; @@ -37,9 +36,15 @@ extern u16 gUnknown_02024A6A[]; extern u8 gUnknown_02024A72[]; extern u8 gUnknown_02024BE0[]; extern u16 gUnknown_02024DE8; +extern u8 gUnknown_02024E6D; extern u32 gUnknown_02024E70[]; +extern struct Window gUnknown_03004210; extern void (*gUnknown_03004330[])(void); extern u8 gUnknown_03004340[]; +extern u8 gUnknown_0300434C[]; +extern struct MusicPlayerInfo gMPlay_SE1; +extern struct MusicPlayerInfo gMPlay_SE2; +extern struct MusicPlayerInfo gMPlay_BGM; extern u32 gBitTable[]; extern u16 gBattleTypeFlags; extern u8 gBattleMonForms[]; @@ -69,6 +74,10 @@ extern const u8 gUnknown_08D09C48[]; #define ewram19348 (*(struct Struct2019348 *)(ewram + 0x19348)) +extern void c3_0802FDF4(u8); +extern void sub_80440EC(); +extern void sub_804777C(); +extern void sub_8141828(); extern u8 sub_8077ABC(); extern u8 sub_8078874(u8); extern u8 sub_8077F68(u8); @@ -89,6 +98,7 @@ void sub_80327CC(void); void sub_8032978(struct Sprite *); void sub_80328A4(struct Sprite *); void sub_8032AFC(void); +void sub_80332D0(void); void sub_80334EC(void); void sub_80312F0(struct Sprite *sprite) @@ -1003,3 +1013,224 @@ void sub_8032C4C(void) sub_80334EC(); } } + +void sub_8032C88(void) +{ + bool8 r6 = FALSE; + + if (!IsDoubleBattle() || (IsDoubleBattle() && (gBattleTypeFlags & BATTLE_TYPE_MULTI))) + { + if (gSprites[gUnknown_03004340[gUnknown_02024A60]].callback == SpriteCallbackDummy) + r6 = TRUE; + } + else + { + if (gSprites[gUnknown_03004340[gUnknown_02024A60]].callback == SpriteCallbackDummy + && gSprites[gUnknown_03004340[gUnknown_02024A60 ^ 2]].callback == SpriteCallbackDummy) + r6 = TRUE; + } + if (IsCryPlayingOrClearCrySongs()) + r6 = FALSE; + + if (r6 && ewram17810[gUnknown_02024A60].unk1_0 && ewram17810[gUnknown_02024A60 ^ 2].unk1_0) + { + ewram17810[gUnknown_02024A60].unk0_7 = 0; + ewram17810[gUnknown_02024A60].unk1_0 = 0; + ewram17810[gUnknown_02024A60 ^ 2].unk0_7 = 0; + ewram17810[gUnknown_02024A60 ^ 2].unk1_0 = 0; + FreeSpriteTilesByTag(0x27F9); + FreeSpritePaletteByTag(0x27F9); + if (gBattleTypeFlags & BATTLE_TYPE_MULTI) + m4aMPlayContinue(&gMPlay_BGM); + else + m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 256); + ewram17810[gUnknown_02024A60].unk9 = 3; + gUnknown_03004330[gUnknown_02024A60] = sub_8032C4C; + } +} + +void sub_8032E2C(void) +{ + if (!ewram17810[gUnknown_02024A60].unk0_3 && !ewram17810[gUnknown_02024A60].unk0_7) + sub_8141828(gUnknown_02024A60, &gEnemyParty[gUnknown_02024A6A[gUnknown_02024A60]]); + if (!ewram17810[gUnknown_02024A60 ^ 2].unk0_3 && !ewram17810[gUnknown_02024A60 ^ 2].unk0_7) + sub_8141828(gUnknown_02024A60 ^ 2, &gEnemyParty[gUnknown_02024A6A[gUnknown_02024A60 ^ 2]]); + if (!ewram17810[gUnknown_02024A60].unk0_3 && !ewram17810[gUnknown_02024A60 ^ 2].unk0_3) + { + if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI)) + { + DestroySprite(&gSprites[gUnknown_0300434C[gUnknown_02024A60 ^ 2]]); + sub_8045A5C( + gUnknown_03004340[gUnknown_02024A60 ^ 2], + &gEnemyParty[gUnknown_02024A6A[gUnknown_02024A60 ^ 2]], + 0); + sub_804777C(gUnknown_02024A60 ^ 2); + sub_8043DFC(gUnknown_03004340[gUnknown_02024A60 ^ 2]); + sub_8032984( + gUnknown_02024A60 ^ 2, + GetMonData(&gEnemyParty[gUnknown_02024A6A[gUnknown_02024A60 ^ 2]], MON_DATA_SPECIES)); + } + DestroySprite(&gSprites[gUnknown_0300434C[gUnknown_02024A60]]); + sub_8045A5C( + gUnknown_03004340[gUnknown_02024A60], + &gEnemyParty[gUnknown_02024A6A[gUnknown_02024A60]], + 0); + sub_804777C(gUnknown_02024A60); + sub_8043DFC(gUnknown_03004340[gUnknown_02024A60]); + sub_8032984( + gUnknown_02024A60, + GetMonData(&gEnemyParty[gUnknown_02024A6A[gUnknown_02024A60]], MON_DATA_SPECIES)); + + ewram17840.unk9_0 = 0; + gUnknown_03004330[gUnknown_02024A60] = sub_8032C88; + } +} + +void sub_8033018(void) +{ + if (gSprites[gUnknown_02024BE0[gUnknown_02024A60]].animEnded == TRUE + && gSprites[gUnknown_02024BE0[gUnknown_02024A60]].pos2.x == 0) + { + if (!ewram17810[gUnknown_02024A60].unk0_7) + { + sub_8141828(gUnknown_02024A60, &gEnemyParty[gUnknown_02024A6A[gUnknown_02024A60]]); + return; + } + if (ewram17810[gUnknown_02024A60].unk1_0) + { + ewram17810[gUnknown_02024A60].unk0_7 = 0; + ewram17810[gUnknown_02024A60].unk1_0 = 0; + FreeSpriteTilesByTag(0x27F9); + FreeSpritePaletteByTag(0x27F9); + sub_80334EC(); + return; + } + } +} + +void sub_80330C8(void) +{ + s16 r4 = sub_8045C78(gUnknown_02024A60, gUnknown_03004340[gUnknown_02024A60], 0, 0); + + sub_8043DFC(gUnknown_03004340[gUnknown_02024A60]); + if (r4 != -1) + sub_80440EC(gUnknown_03004340[gUnknown_02024A60], r4, 0); + else + sub_80334EC(); +} + +void sub_803311C(void) +{ + if (!gSprites[gUnknown_02024BE0[gUnknown_02024A60]].inUse) + { + sub_8043DB0(gUnknown_03004340[gUnknown_02024A60]); + sub_80334EC(); + } +} + +void sub_8033160(void) +{ + if (!ewram17810[gUnknown_02024A60].unk0_6) + { + FreeSpriteOamMatrix(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); + DestroySprite(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); + sub_8032A08(gUnknown_02024A60); + sub_8043DB0(gUnknown_03004340[gUnknown_02024A60]); + sub_80334EC(); + } +} + +void sub_80331D0(void) +{ + if (gUnknown_03004210.state == 0) + sub_80334EC(); +} + +void bx_blink_t7(void) +{ + u8 spriteId = gUnknown_02024BE0[gUnknown_02024A60]; + + if (gSprites[spriteId].data1 == 32) + { + gSprites[spriteId].data1 = 0; + gSprites[spriteId].invisible = FALSE; + gUnknown_02024E6D = 0; + sub_80334EC(); + } + else + { + if (((u16)gSprites[spriteId].data1 % 4) == 0) + gSprites[spriteId].invisible ^= 1; + gSprites[spriteId].data1++; + } +} + +void sub_8033264(void) +{ + if (gSprites[gUnknown_03004340[gUnknown_02024A60]].callback == SpriteCallbackDummy) + { + if (ewram17800[gUnknown_02024A60].unk0_2) + move_anim_start_t4(gUnknown_02024A60, gUnknown_02024A60, gUnknown_02024A60, 6); + gUnknown_03004330[gUnknown_02024A60] = sub_80332D0; + } +} + +void sub_80332D0(void) +{ + if (!ewram17810[gUnknown_02024A60].unk0_6) + { + CreateTask(c3_0802FDF4, 10); + sub_80334EC(); + } +} + +void sub_8033308(void) +{ + if (ewram17810[gUnknown_02024A60].unk1_0) + { + ewram17810[gUnknown_02024A60].unk0_7 = 0; + ewram17810[gUnknown_02024A60].unk1_0 = 0; + FreeSpriteTilesByTag(0x27F9); + FreeSpritePaletteByTag(0x27F9); + StartSpriteAnim(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]], 0); + sub_8045A5C( + gUnknown_03004340[gUnknown_02024A60], + &gEnemyParty[gUnknown_02024A6A[gUnknown_02024A60]], + 0); + sub_804777C(gUnknown_02024A60); + sub_8043DFC(gUnknown_03004340[gUnknown_02024A60]); + sub_8031F88(gUnknown_02024A60); + gUnknown_03004330[gUnknown_02024A60] = sub_8033264; + } +} + +void sub_80333D4(void) +{ + if (!ewram17810[gUnknown_02024A60].unk0_3 && !ewram17810[gUnknown_02024A60].unk0_7) + sub_8141828(gUnknown_02024A60, &gEnemyParty[gUnknown_02024A6A[gUnknown_02024A60]]); + if (gSprites[gUnknown_0300434C[gUnknown_02024A60]].callback == SpriteCallbackDummy + && !ewram17810[gUnknown_02024A60].unk0_3) + { + DestroySprite(&gSprites[gUnknown_0300434C[gUnknown_02024A60]]); + sub_8032984(gUnknown_02024A60, GetMonData(&gEnemyParty[gUnknown_02024A6A[gUnknown_02024A60]], MON_DATA_SPECIES)); + gUnknown_03004330[gUnknown_02024A60] = sub_8033308; + } +} + +void sub_8033494(void) +{ + if (!ewram17810[gUnknown_02024A60].unk0_4) + sub_80334EC(); +} + +void sub_80334C0(void) +{ + if (!ewram17810[gUnknown_02024A60].unk0_5) + sub_80334EC(); +} + +void sub_80334EC(void) +{ + gUnknown_03004330[gUnknown_02024A60] = sub_8032AFC; + gUnknown_02024A64 &= ~gBitTable[gUnknown_02024A60]; +} diff --git a/src/battle_811DA74.c b/src/battle_811DA74.c index f39aa5248..439e6b3c6 100644 --- a/src/battle_811DA74.c +++ b/src/battle_811DA74.c @@ -35,14 +35,6 @@ struct UnknownStruct5 u8 unk0_7:1; }; -/* -struct UnknownStruct6 -{ - u8 filler0[9]; - u8 unk9; -}; -*/ - extern u32 gBitTable[]; extern u16 gBattleTypeFlags; @@ -1489,7 +1481,7 @@ void sub_8120588(void) gTasks[taskId].data[0] = gUnknown_02024A60; if (ewram17810[gUnknown_02024A60].unk0_0) gTasks[gUnknown_02024E68[gUnknown_02024A60]].func = sub_8044CA0; - ewram17840.unk9 |= 1; + ewram17840.unk9_0 = 1; gUnknown_03004330[gUnknown_02024A60] = nullsub_74; } -- cgit v1.2.3 From f44934f8f79c7b361b85721134a0a1eaa2065ca1 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 10 Jun 2017 22:06:58 -0500 Subject: decompile sub_8094B6C --- src/rom_8094928.c | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/rom_8094928.c b/src/rom_8094928.c index 794fc78f6..761a49d27 100644 --- a/src/rom_8094928.c +++ b/src/rom_8094928.c @@ -1,9 +1,9 @@ #include "global.h" #include "pokemon.h" -#define UNK_201606C_ARRAY (unk_2000000 + 0x1606C) // lazy define but whatever. +extern u8 ewram[]; -extern u8 unk_2000000[]; +#define UNK_201606C_ARRAY (ewram + 0x1606C) // lazy define but whatever. extern struct PokemonStorage gPokemonStorage; extern u8 IsLinkDoubleBattle(void); @@ -133,3 +133,41 @@ void sub_8094A74(u8 arg[3], u8 player_number, u32 arg3) arg[i] = (temp[i << 1] << 4) | temp[(i << 1) + 1]; } } + +void sub_8094B6C(u8 a, u8 b, u8 c) +{ + s32 i; + s32 j; + u8 temp[6]; + u8 r3; + u8 r7 = 0; + + if (IsLinkDoubleBattle()) + { + u8 *arr = ewram + 0x1606C + a * 3; + + for (i = 0, j = 0; i < 3; i++) + { + temp[j++] = arr[i] >> 4; + temp[j++] = arr[i] & 0xF; + } + r3 = temp[c]; + for (i = 0; i < 6; i++) + { + if (temp[i] == b) + { + r7 = temp[i]; + temp[i] = r3; + break; + } + } + if (i != 6) + { + temp[c] = r7; + + arr[0] = (temp[0] << 4) | temp[1]; + arr[1] = (temp[2] << 4) | temp[3]; + arr[2] = (temp[4] << 4) | temp[5]; + } + } +} -- cgit v1.2.3 From 92ac981c1c0e454a75c0f0f2b2029cd10bd05e6b Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 10 Jun 2017 23:01:19 -0500 Subject: finish decompiling rom_8094928 --- src/rom_8094928.c | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) (limited to 'src') diff --git a/src/rom_8094928.c b/src/rom_8094928.c index 761a49d27..511c4ed7b 100644 --- a/src/rom_8094928.c +++ b/src/rom_8094928.c @@ -1,8 +1,28 @@ #include "global.h" +#include "palette.h" #include "pokemon.h" extern u8 ewram[]; +#define DATA_COUNT (6) + +struct Unk201B000 +{ + //u8 filler0[0x260]; + struct Pokemon unk0[6]; + u8 filler258[8]; + u8 unk260; + u8 unk261; + u8 filler262[2]; + s16 unk264[DATA_COUNT * 2]; + u8 filler27C[2]; + s16 unk27E; + s16 unk280; + s16 unk282; +}; + +#define ewram1B000 (*(struct Unk201B000 *)(ewram + 0x1B000)) + #define UNK_201606C_ARRAY (ewram + 0x1606C) // lazy define but whatever. extern struct PokemonStorage gPokemonStorage; @@ -12,8 +32,12 @@ extern u8 battle_get_side_with_given_state(u8); extern u8 battle_side_get_owner(u8); void sub_8094998(u8[3], u8); void sub_8094A74(u8[3], u8, u32); +extern void nullsub_14(); +extern void OpenPartyMenu(); +extern void sub_806E6F0(); extern u8 gUnknown_02038470[3]; +extern u8 gUnknown_02038473; extern u8 sub_803FBBC(void); extern u16 gUnknown_02024A6A[]; @@ -171,3 +195,114 @@ void sub_8094B6C(u8 a, u8 b, u8 c) } } } + +u8 sub_8094C20(u8 a) +{ + u8 retVal; + u8 val = a & 1; + + a /= 2; + if (val) + retVal = gUnknown_02038470[a] & 0xF; + else + retVal = gUnknown_02038470[a] >> 4; + return retVal; +} + +void sub_8094C54(u8 a, u8 b) +{ + u8 val = a & 1; + + a /= 2; + if (val) + gUnknown_02038470[a] = (gUnknown_02038470[a] & 0xF0) | b; + else + gUnknown_02038470[a] = (gUnknown_02038470[a] & 0xF) | (b << 4); +} + +void sub_8094C98(u8 a, u8 b) +{ + u8 r4 = sub_8094C20(a); + u8 r1 = sub_8094C20(b); + + sub_8094C54(a, r1); + sub_8094C54(b, r4); +} + +u8 pokemon_order_func(u8 a) +{ + u8 i; + u8 r2; + + for (i = 0, r2 = 0; i < 3; i++) + { + if ((gUnknown_02038470[i] >> 4) == a) + return r2; + r2++; + if ((gUnknown_02038470[i] & 0xF) == a) + return r2; + r2++; + } + return 0; +} + +void pokemon_change_order(void) +{ + u8 i; + + memcpy(ewram1B000.unk0, gPlayerParty, sizeof(gPlayerParty)); + for (i = 0; i < 6; i++) + { + u8 n = pokemon_order_func(i); + + memcpy(&gPlayerParty[n], &ewram1B000.unk0[i], sizeof(struct Pokemon)); + } +} + +void sub_8094D60(void) +{ + struct Pokemon temp[6]; + u8 i; + + memcpy(temp, gPlayerParty, sizeof(gPlayerParty)); + for (i = 0; i < 6; i++) + { + u8 n = sub_8094C20(i); + + memcpy(&gPlayerParty[n], &temp[i], sizeof(struct Pokemon)); + } +} + +void unref_sub_8094DB0(void) +{ + u8 i; + u8 r4; + + for (i = 1; i < 6; i++) + { + u8 n = sub_8094C20(i); + + if (GetMonData(&gPlayerParty[n], MON_DATA_SPECIES) != 0 + && GetMonData(&gPlayerParty[n], MON_DATA_HP) != 0) + { + r4 = sub_8094C20(0); + sub_8094C98(0, i); + sub_806E6F0(&gPlayerParty[r4], &gPlayerParty[n]); + break; + } + } +} + +void sub_8094E20(u8 a) +{ + gPaletteFade.bufferTransferDisabled = TRUE; + gUnknown_02038473 = a; + nullsub_14(); + pokemon_change_order(); + OpenPartyMenu(1, 0xFF); +} + +void sub_8094E4C(void) +{ + sub_8094E20(3); +} -- cgit v1.2.3 From 4c91ef5f49f5f8fb5aff42257807e5480e64dd65 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 10 Jun 2017 23:37:25 -0500 Subject: move rom_8094928.c into battle_party_menu.c --- src/battle_party_menu.c | 309 ++++++++++++++++++++++++++++++++++++++++++++++-- src/party_menu.c | 2 +- src/rom_8094928.c | 308 ----------------------------------------------- 3 files changed, 303 insertions(+), 316 deletions(-) delete mode 100644 src/rom_8094928.c (limited to 'src') diff --git a/src/battle_party_menu.c b/src/battle_party_menu.c index 359517ecd..5e3efcc0d 100644 --- a/src/battle_party_menu.c +++ b/src/battle_party_menu.c @@ -12,6 +12,30 @@ #include "task.h" #include "text.h" +#define DATA_COUNT (6) + +extern u8 ewram[]; + +struct Unk201B000 +{ + //u8 filler0[0x260]; + struct Pokemon unk0[6]; + u8 filler258[1]; + u8 unk259; + u8 filler25A[6]; + u8 unk260; + u8 unk261; + u8 filler262[2]; + s16 unk264[DATA_COUNT * 2]; // This may be a union + u8 filler27C[2]; + s16 unk27E; + s16 unk280; + s16 unk282; +}; + +#define ewram1B000 (*(struct Unk201B000 *)(ewram + 0x1B000)) +#define UNK_201606C_ARRAY (ewram + 0x1606C) // lazy define but whatever. + extern u8 IsLinkDoubleBattle(void); extern void TryCreatePartyMenuMonIcon(u8, u8, struct Pokemon *); extern void LoadHeldItemIconGraphics(void); @@ -29,7 +53,6 @@ extern u16 sub_806BD80(); extern u8 sub_806CA38(); extern void sub_806D5A4(void); extern void sub_802E414(void); -extern void sub_8094D60(void); extern void sub_80A6DCC(void); extern void sub_806AF4C(); extern u8 sub_80F9344(void); @@ -41,12 +64,12 @@ extern TaskFunc PartyMenuGetPopupMenuFunc(u8, const struct PartyPopupMenu *, con extern void ShowPokemonSummaryScreen(struct Pokemon *, u8, u8, void (*)(u8), int); extern void sub_806E7D0(u8, const struct PartyPopupMenu *); extern u8 *sub_8040D08(); -extern u8 sub_8094C20(); extern void sub_8040B8C(void); -extern u8 pokemon_order_func(u8); -extern void sub_8094C98(u8, u8); extern void sub_806E6F0(); extern void sub_806D538(); +extern void nullsub_14(); +extern void OpenPartyMenu(); +extern u8 sub_803FBBC(void); extern u16 gScriptItemId; extern u8 gPlayerPartyCount; @@ -56,10 +79,17 @@ extern u8 gUnknown_02024E6C; extern u8 gUnknown_0202E8F4; extern u8 gUnknown_0202E8F5; extern u8 gUnknown_0202E8F6; +extern u8 gUnknown_02038470[3]; extern u8 gUnknown_02038473; extern u8 gUnknown_020384F0; extern void (*gUnknown_03004AE4)(); //don't know types yet +extern struct PokemonStorage gPokemonStorage; +void sub_8094C98(u8, u8); +static void sub_8094998(u8[3], u8); +static void sub_8094A74(u8[3], u8, u32); +u8 pokemon_order_func(u8); +static void sub_8094D60(void); static void Task_809527C(u8); static void Task_80952B4(u8); static void Task_80952E4(u8); @@ -87,11 +117,276 @@ static const struct PartyPopupMenu sBattlePartyPopupMenus[] = {ARRAY_COUNT(Unknown_83B5FF2), 9, Unknown_83B5FF2}, }; -// rom_8094928 is part of this file, has yet to be decompiled. +void unref_sub_8094928(struct PokemonStorage *ptr) +{ + *ptr = gPokemonStorage; +} + +void unref_sub_8094940(struct PokemonStorage *ptr) +{ + gPokemonStorage = *ptr; +} + +void sub_8094958(void) +{ + sub_8094998(gUnknown_02038470, sub_803FBBC()); +} + +void sub_8094978(u8 arg1, u8 arg2) +{ + sub_8094A74((UNK_201606C_ARRAY) + arg1 * 3, arg2, arg1); +} + +static void sub_8094998(u8 arg[3], u8 player_number) +{ + int i; + u32 pos; + u8 temp[6]; + if (IsLinkDoubleBattle() == TRUE) + { + if (player_number) + { + *arg = 0x30; + arg[1] = 0x45; + arg[2] = 0x12; + } + else + { + *arg = 0x03; + arg[1] = 0x12; + arg[2] = 0x45; + } + } + else + { + if (!IsDoubleBattle()) + { + pos = 1; + *temp = gUnknown_02024A6A[battle_get_side_with_given_state(0)]; + for (i = 0; i <= 5; i++) + if (i != *temp) + temp[pos++] = i; + } + else + { + pos = 2; + *temp = gUnknown_02024A6A[battle_get_side_with_given_state(0)]; + temp[1] = gUnknown_02024A6A[battle_get_side_with_given_state(2)]; + for (i = 0; i <= 5; i++) + if ((i != *temp) && (i != temp[1])) + temp[pos++] = i; + } + for (i = 0; i <= 2; i++) + arg[i] = (temp[i << 1] << 4) | temp[(i << 1) + 1]; + } +} + +static void sub_8094A74(u8 arg[3], u8 player_number, u32 arg3) +{ + int i, j; + u8 temp[6]; + if (!battle_side_get_owner(arg3)) + { + i = battle_get_side_with_given_state(0); + j = battle_get_side_with_given_state(2); + } + else + { + i = battle_get_side_with_given_state(1); + j = battle_get_side_with_given_state(3); + } + if (IsLinkDoubleBattle() == TRUE) + { + if (player_number) + { + *arg = 0x30; + arg[1] = 0x45; + arg[2] = 0x12; + } + else + { + *arg = 0x03; + arg[1] = 0x12; + arg[2] = 0x45; + } + } + else + { + if (!IsDoubleBattle()) + { + int pos = 1; + *temp = gUnknown_02024A6A[i]; + for (i = 0; i <= 5; i++) + if (i != *temp) + temp[pos++] = i; + } + else + { + int pos = 2; + *temp = gUnknown_02024A6A[i]; + temp[1] = gUnknown_02024A6A[j]; + for (i = 0; i <= 5; i++) + if ((i != *temp) && (i != temp[1])) + temp[pos++] = i; + } + for (i = 0; i <= 2; i++) + arg[i] = (temp[i << 1] << 4) | temp[(i << 1) + 1]; + } +} + +void sub_8094B6C(u8 a, u8 b, u8 c) +{ + s32 i; + s32 j; + u8 temp[6]; + u8 r3; + u8 r7 = 0; + + if (IsLinkDoubleBattle()) + { + u8 *arr = ewram + 0x1606C + a * 3; + + for (i = 0, j = 0; i < 3; i++) + { + temp[j++] = arr[i] >> 4; + temp[j++] = arr[i] & 0xF; + } + r3 = temp[c]; + for (i = 0; i < 6; i++) + { + if (temp[i] == b) + { + r7 = temp[i]; + temp[i] = r3; + break; + } + } + if (i != 6) + { + temp[c] = r7; + + arr[0] = (temp[0] << 4) | temp[1]; + arr[1] = (temp[2] << 4) | temp[3]; + arr[2] = (temp[4] << 4) | temp[5]; + } + } +} + +u8 sub_8094C20(u8 a) +{ + u8 retVal; + u8 val = a & 1; + + a /= 2; + if (val) + retVal = gUnknown_02038470[a] & 0xF; + else + retVal = gUnknown_02038470[a] >> 4; + return retVal; +} + +void sub_8094C54(u8 a, u8 b) +{ + u8 val = a & 1; + + a /= 2; + if (val) + gUnknown_02038470[a] = (gUnknown_02038470[a] & 0xF0) | b; + else + gUnknown_02038470[a] = (gUnknown_02038470[a] & 0xF) | (b << 4); +} + +void sub_8094C98(u8 a, u8 b) +{ + u8 r4 = sub_8094C20(a); + u8 r1 = sub_8094C20(b); + + sub_8094C54(a, r1); + sub_8094C54(b, r4); +} + +u8 pokemon_order_func(u8 a) +{ + u8 i; + u8 r2; + + for (i = 0, r2 = 0; i < 3; i++) + { + if ((gUnknown_02038470[i] >> 4) == a) + return r2; + r2++; + if ((gUnknown_02038470[i] & 0xF) == a) + return r2; + r2++; + } + return 0; +} + +void pokemon_change_order(void) +{ + u8 i; + + memcpy(ewram1B000.unk0, gPlayerParty, sizeof(gPlayerParty)); + for (i = 0; i < 6; i++) + { + u8 n = pokemon_order_func(i); + + memcpy(&gPlayerParty[n], &ewram1B000.unk0[i], sizeof(struct Pokemon)); + } +} + +static void sub_8094D60(void) +{ + struct Pokemon temp[6]; + u8 i; + + memcpy(temp, gPlayerParty, sizeof(gPlayerParty)); + for (i = 0; i < 6; i++) + { + u8 n = sub_8094C20(i); + + memcpy(&gPlayerParty[n], &temp[i], sizeof(struct Pokemon)); + } +} + +void unref_sub_8094DB0(void) +{ + u8 i; + u8 r4; + + for (i = 1; i < 6; i++) + { + u8 n = sub_8094C20(i); + + if (GetMonData(&gPlayerParty[n], MON_DATA_SPECIES) != 0 + && GetMonData(&gPlayerParty[n], MON_DATA_HP) != 0) + { + r4 = sub_8094C20(0); + sub_8094C98(0, i); + sub_806E6F0(&gPlayerParty[r4], &gPlayerParty[n]); + break; + } + } +} + +void sub_8094E20(u8 a) +{ + gPaletteFade.bufferTransferDisabled = TRUE; + gUnknown_02038473 = a; + nullsub_14(); + pokemon_change_order(); + OpenPartyMenu(1, 0xFF); +} + +void sub_8094E4C(void) +{ + sub_8094E20(3); +} int SetUpBattlePartyMenu(void) { switch (EWRAM_1B000.unk264) + //switch (ewram1B000.unk264[0]) { case 0: //TODO: try to get rid of this duplicate code @@ -172,9 +467,9 @@ int SetUpBattlePartyMenu(void) if (gUnknown_02038473 == 3) { if (GetItemEffectType(gScriptItemId) == 10) - EWRAM_1B000.unk259 = 0xFF; + ewram1B000.unk259 = 0xFF; else - EWRAM_1B000.unk259 = 3; + ewram1B000.unk259 = 3; } return TRUE; } diff --git a/src/party_menu.c b/src/party_menu.c index ee6bcf2a9..139df5b3a 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -31,7 +31,7 @@ struct Unk201B000 u8 unk260; u8 unk261; u8 filler262[2]; - s16 unk264[DATA_COUNT * 2]; + s16 unk264[DATA_COUNT * 2]; // This may be a union u8 filler27C[2]; s16 unk27E; s16 unk280; diff --git a/src/rom_8094928.c b/src/rom_8094928.c deleted file mode 100644 index 511c4ed7b..000000000 --- a/src/rom_8094928.c +++ /dev/null @@ -1,308 +0,0 @@ -#include "global.h" -#include "palette.h" -#include "pokemon.h" - -extern u8 ewram[]; - -#define DATA_COUNT (6) - -struct Unk201B000 -{ - //u8 filler0[0x260]; - struct Pokemon unk0[6]; - u8 filler258[8]; - u8 unk260; - u8 unk261; - u8 filler262[2]; - s16 unk264[DATA_COUNT * 2]; - u8 filler27C[2]; - s16 unk27E; - s16 unk280; - s16 unk282; -}; - -#define ewram1B000 (*(struct Unk201B000 *)(ewram + 0x1B000)) - -#define UNK_201606C_ARRAY (ewram + 0x1606C) // lazy define but whatever. - -extern struct PokemonStorage gPokemonStorage; -extern u8 IsLinkDoubleBattle(void); -extern u8 IsDoubleBattle(void); -extern u8 battle_get_side_with_given_state(u8); -extern u8 battle_side_get_owner(u8); -void sub_8094998(u8[3], u8); -void sub_8094A74(u8[3], u8, u32); -extern void nullsub_14(); -extern void OpenPartyMenu(); -extern void sub_806E6F0(); - -extern u8 gUnknown_02038470[3]; -extern u8 gUnknown_02038473; -extern u8 sub_803FBBC(void); -extern u16 gUnknown_02024A6A[]; - -void unref_sub_8094928(struct PokemonStorage *ptr) -{ - *ptr = gPokemonStorage; -} - -void unref_sub_8094940(struct PokemonStorage *ptr) -{ - gPokemonStorage = *ptr; -} - -void sub_8094958(void) -{ - sub_8094998(gUnknown_02038470, sub_803FBBC()); -} - -void sub_8094978(u8 arg1, u8 arg2) -{ - sub_8094A74((UNK_201606C_ARRAY) + arg1 * 3, arg2, arg1); -} - -void sub_8094998(u8 arg[3], u8 player_number) -{ - int i; - u32 pos; - u8 temp[6]; - if (IsLinkDoubleBattle() == TRUE) - { - if (player_number) - { - *arg = 0x30; - arg[1] = 0x45; - arg[2] = 0x12; - } - else - { - *arg = 0x03; - arg[1] = 0x12; - arg[2] = 0x45; - } - } - else - { - if (!IsDoubleBattle()) - { - pos = 1; - *temp = gUnknown_02024A6A[battle_get_side_with_given_state(0)]; - for (i = 0; i <= 5; i++) - if (i != *temp) - temp[pos++] = i; - } - else - { - pos = 2; - *temp = gUnknown_02024A6A[battle_get_side_with_given_state(0)]; - temp[1] = gUnknown_02024A6A[battle_get_side_with_given_state(2)]; - for (i = 0; i <= 5; i++) - if ((i != *temp) && (i != temp[1])) - temp[pos++] = i; - } - for (i = 0; i <= 2; i++) - arg[i] = (temp[i << 1] << 4) | temp[(i << 1) + 1]; - } -} - -void sub_8094A74(u8 arg[3], u8 player_number, u32 arg3) -{ - int i, j; - u8 temp[6]; - if (!battle_side_get_owner(arg3)) - { - i = battle_get_side_with_given_state(0); - j = battle_get_side_with_given_state(2); - } - else - { - i = battle_get_side_with_given_state(1); - j = battle_get_side_with_given_state(3); - } - if (IsLinkDoubleBattle() == TRUE) - { - if (player_number) - { - *arg = 0x30; - arg[1] = 0x45; - arg[2] = 0x12; - } - else - { - *arg = 0x03; - arg[1] = 0x12; - arg[2] = 0x45; - } - } - else - { - if (!IsDoubleBattle()) - { - int pos = 1; - *temp = gUnknown_02024A6A[i]; - for (i = 0; i <= 5; i++) - if (i != *temp) - temp[pos++] = i; - } - else - { - int pos = 2; - *temp = gUnknown_02024A6A[i]; - temp[1] = gUnknown_02024A6A[j]; - for (i = 0; i <= 5; i++) - if ((i != *temp) && (i != temp[1])) - temp[pos++] = i; - } - for (i = 0; i <= 2; i++) - arg[i] = (temp[i << 1] << 4) | temp[(i << 1) + 1]; - } -} - -void sub_8094B6C(u8 a, u8 b, u8 c) -{ - s32 i; - s32 j; - u8 temp[6]; - u8 r3; - u8 r7 = 0; - - if (IsLinkDoubleBattle()) - { - u8 *arr = ewram + 0x1606C + a * 3; - - for (i = 0, j = 0; i < 3; i++) - { - temp[j++] = arr[i] >> 4; - temp[j++] = arr[i] & 0xF; - } - r3 = temp[c]; - for (i = 0; i < 6; i++) - { - if (temp[i] == b) - { - r7 = temp[i]; - temp[i] = r3; - break; - } - } - if (i != 6) - { - temp[c] = r7; - - arr[0] = (temp[0] << 4) | temp[1]; - arr[1] = (temp[2] << 4) | temp[3]; - arr[2] = (temp[4] << 4) | temp[5]; - } - } -} - -u8 sub_8094C20(u8 a) -{ - u8 retVal; - u8 val = a & 1; - - a /= 2; - if (val) - retVal = gUnknown_02038470[a] & 0xF; - else - retVal = gUnknown_02038470[a] >> 4; - return retVal; -} - -void sub_8094C54(u8 a, u8 b) -{ - u8 val = a & 1; - - a /= 2; - if (val) - gUnknown_02038470[a] = (gUnknown_02038470[a] & 0xF0) | b; - else - gUnknown_02038470[a] = (gUnknown_02038470[a] & 0xF) | (b << 4); -} - -void sub_8094C98(u8 a, u8 b) -{ - u8 r4 = sub_8094C20(a); - u8 r1 = sub_8094C20(b); - - sub_8094C54(a, r1); - sub_8094C54(b, r4); -} - -u8 pokemon_order_func(u8 a) -{ - u8 i; - u8 r2; - - for (i = 0, r2 = 0; i < 3; i++) - { - if ((gUnknown_02038470[i] >> 4) == a) - return r2; - r2++; - if ((gUnknown_02038470[i] & 0xF) == a) - return r2; - r2++; - } - return 0; -} - -void pokemon_change_order(void) -{ - u8 i; - - memcpy(ewram1B000.unk0, gPlayerParty, sizeof(gPlayerParty)); - for (i = 0; i < 6; i++) - { - u8 n = pokemon_order_func(i); - - memcpy(&gPlayerParty[n], &ewram1B000.unk0[i], sizeof(struct Pokemon)); - } -} - -void sub_8094D60(void) -{ - struct Pokemon temp[6]; - u8 i; - - memcpy(temp, gPlayerParty, sizeof(gPlayerParty)); - for (i = 0; i < 6; i++) - { - u8 n = sub_8094C20(i); - - memcpy(&gPlayerParty[n], &temp[i], sizeof(struct Pokemon)); - } -} - -void unref_sub_8094DB0(void) -{ - u8 i; - u8 r4; - - for (i = 1; i < 6; i++) - { - u8 n = sub_8094C20(i); - - if (GetMonData(&gPlayerParty[n], MON_DATA_SPECIES) != 0 - && GetMonData(&gPlayerParty[n], MON_DATA_HP) != 0) - { - r4 = sub_8094C20(0); - sub_8094C98(0, i); - sub_806E6F0(&gPlayerParty[r4], &gPlayerParty[n]); - break; - } - } -} - -void sub_8094E20(u8 a) -{ - gPaletteFade.bufferTransferDisabled = TRUE; - gUnknown_02038473 = a; - nullsub_14(); - pokemon_change_order(); - OpenPartyMenu(1, 0xFF); -} - -void sub_8094E4C(void) -{ - sub_8094E20(3); -} -- cgit v1.2.3 From 1ebb2b84a202b345435356381fb0dea9a5d7033d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 11 Jun 2017 10:21:44 -0400 Subject: Use CpuCopy and CpuFill macros --- src/field_effect.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index 5719245e5..f9645613b 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -2017,6 +2017,7 @@ extern const void (*gUnknown_0839F3AC[7])(struct Task *); extern const void (*gUnknown_0839F3C8[7])(struct Task *); extern const u32 gFieldMoveStreaksTiles[]; extern const u16 gFieldMoveStreaksPalette[16]; +extern const u16 gFieldMoveStreaksTilemap[0x140]; void sub_80883DC(void); void sub_808843C(u16); void sub_8088890(struct Sprite *); @@ -2073,14 +2074,12 @@ void sub_8088150(struct Task *task) void sub_80881C0(struct Task *task) { - u32 zero; u16 offset; u16 delta; offset = ((REG_BG0CNT >> 2) << 14); delta = ((REG_BG0CNT >> 8) << 11); - CpuSet(gFieldMoveStreaksTiles, (void *)(VRAM + offset), 0x100); - zero = 0; - CpuSet(&zero, (void *)(VRAM + delta), 0x5000200); + CpuCopy16(gFieldMoveStreaksTiles, (void *)(VRAM + offset), 0x200); + CpuFill32(0, (void *)(VRAM + delta), 0x800); LoadPalette(gFieldMoveStreaksPalette, 0xf0, 0x20); sub_808843C(delta); task->data[0]++; @@ -2282,11 +2281,9 @@ void sub_80882E4(struct Task *task) void sub_8088338(struct Task *task) { - u32 zero; u16 bg0cnt; bg0cnt = (REG_BG0CNT >> 8) << 11; - zero = 0; - CpuSet(&zero, (void *)VRAM + bg0cnt, 0x5000200); + CpuFill32(0, (void *)VRAM + bg0cnt, 0x800); task->data[1] = 0xf1; task->data[2] = 0xa1; task->data[3] = task->data[11]; @@ -2320,3 +2317,14 @@ void sub_80883DC(void) REG_BG0HOFS = task->data[5]; REG_BG0VOFS = task->data[6]; } + +void sub_808843C(u16 offs) +{ + u16 i; + u16 *dest; + dest = (u16 *)(VRAM + 0x140 + offs); + for (i=0; i<0x140; i++, dest++) + { + *dest = gFieldMoveStreaksTilemap[i] | 0xf000; + } +} -- cgit v1.2.3 From ba16f9d35f5c6f5daee0a24301d8c48031f6c4df Mon Sep 17 00:00:00 2001 From: scnorton Date: Sun, 11 Jun 2017 14:12:18 -0400 Subject: Get those two functions matching. Thanks camthesaxman\! --- src/field_effect.c | 152 +++++------------------------------------------------ 1 file changed, 12 insertions(+), 140 deletions(-) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index f9645613b..cd58e84ba 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -2085,17 +2085,18 @@ void sub_80881C0(struct Task *task) task->data[0]++; } -#ifdef NONMATCHING void sub_8088228(struct Task *task) { s16 v0; s16 v2; s16 v3; task->data[5] -= 16; - // The order in which registers are loaded is incorrect. - v0 = ((u16)task->data[1] >> 8) - 0x10; - v2 = ((u16)task->data[2] >> 8) - 2; - v3 = ((u16)task->data[2] & 0xff) + 2; + v0 = ((u16)task->data[1] >> 8); + v2 = ((u16)task->data[2] >> 8); + v3 = ((u16)task->data[2] & 0xff); + v0 -= 16; + v2 -= 2; + v3 += 2; if (v0 < 0) { v0 = 0; @@ -2116,103 +2117,25 @@ void sub_8088228(struct Task *task) task->data[0]++; } } -#else -__attribute__((naked)) -void sub_8088228(struct Task *task) -{ - asm_unified("\tpush {r4-r7,lr}\n" - "\tadds r3, r0, 0\n" - "\tldrh r0, [r3, 0x12]\n" - "\tsubs r0, 0x10\n" - "\tstrh r0, [r3, 0x12]\n" - "\tldrh r6, [r3, 0xA]\n" - "\tldrh r2, [r3, 0xC]\n" - "\tmovs r7, 0xFF\n" - "\tlsrs r1, r6, 8\n" - "\tsubs r1, 0x10\n" - "\tlsls r1, 16\n" - "\tlsrs r0, r2, 8\n" - "\tsubs r0, 0x2\n" - "\tlsls r0, 16\n" - "\tlsrs r4, r0, 16\n" - "\tadds r0, r7, 0\n" - "\tands r0, r2\n" - "\tadds r5, r0, 0x2\n" - "\tlsrs r2, r1, 16\n" - "\tcmp r1, 0\n" - "\tbge _08088254\n" - "\tmovs r2, 0\n" - "_08088254:\n" - "\tlsls r0, r4, 16\n" - "\tasrs r0, 16\n" - "\tcmp r0, 0x27\n" - "\tbgt _0808825E\n" - "\tmovs r4, 0x28\n" - "_0808825E:\n" - "\tcmp r5, 0x78\n" - "\tble _08088264\n" - "\tmovs r5, 0x78\n" - "_08088264:\n" - "\tlsls r2, 16\n" - "\tasrs r2, 16\n" - "\tlsls r1, r2, 8\n" - "\tadds r0, r7, 0\n" - "\tands r0, r6\n" - "\torrs r1, r0\n" - "\tstrh r1, [r3, 0xA]\n" - "\tlsls r0, r4, 16\n" - "\tasrs r4, r0, 16\n" - "\tlsls r0, r4, 8\n" - "\tadds r1, r5, 0\n" - "\torrs r0, r1\n" - "\tstrh r0, [r3, 0xC]\n" - "\tcmp r2, 0\n" - "\tbne _080882A4\n" - "\tcmp r4, 0x28\n" - "\tbne _080882A4\n" - "\tcmp r1, 0x78\n" - "\tbne _080882A4\n" - "\tldr r2, _080882AC @ =gSprites\n" - "\tmovs r0, 0x26\n" - "\tldrsh r1, [r3, r0]\n" - "\tlsls r0, r1, 4\n" - "\tadds r0, r1\n" - "\tlsls r0, 2\n" - "\tadds r2, 0x1C\n" - "\tadds r0, r2\n" - "\tldr r1, _080882B0 @ =sub_8088890\n" - "\tstr r1, [r0]\n" - "\tldrh r0, [r3, 0x8]\n" - "\tadds r0, 0x1\n" - "\tstrh r0, [r3, 0x8]\n" - "_080882A4:\n" - "\tpop {r4-r7}\n" - "\tpop {r0}\n" - "\tbx r0\n" - "\t.align 2, 0\n" - "_080882AC: .4byte gSprites\n" - "_080882B0: .4byte sub_8088890"); -} -#endif void sub_80882B4(struct Task *task) { - task->data[5] -= 0x10; + task->data[5] -= 16; if (gSprites[task->data[15]].data7) { task->data[0]++; } } -#ifdef NONMATCHING void sub_80882E4(struct Task *task) { s16 v2; s16 v3; - task->data[5] -= 0x10; - // The order in which registers are loaded is incorrect. - v2 = (task->data[2] >> 8) + 6; - v3 = (task->data[2] & 0xff) - 6; + task->data[5] -= 16; + v2 = (task->data[2] >> 8); + v3 = (task->data[2] & 0xff); + v2 += 6; + v3 -= 6; if (v2 > 0x50) { v2 = 0x50; @@ -2227,57 +2150,6 @@ void sub_80882E4(struct Task *task) task->data[0]++; } } -#else -__attribute__((naked)) -void sub_80882E4(struct Task *task) -{ - asm_unified("\tpush {r4,lr}\n" - "\tadds r3, r0, 0\n" - "\tldrh r0, [r3, 0x12]\n" - "\tsubs r0, 0x10\n" - "\tstrh r0, [r3, 0x12]\n" - "\tldrh r2, [r3, 0xC]\n" - "\tlsls r1, r2, 16\n" - "\tmovs r0, 0xFF\n" - "\tasrs r1, 24\n" - "\tadds r1, 0x6\n" - "\tlsls r1, 16\n" - "\tands r0, r2\n" - "\tsubs r0, 0x6\n" - "\tlsls r0, 16\n" - "\tlsrs r2, r0, 16\n" - "\tlsrs r4, r1, 16\n" - "\tasrs r1, 16\n" - "\tcmp r1, 0x50\n" - "\tble _0808830C\n" - "\tmovs r4, 0x50\n" - "_0808830C:\n" - "\tlsls r0, r2, 16\n" - "\tasrs r0, 16\n" - "\tcmp r0, 0x50\n" - "\tbgt _08088316\n" - "\tmovs r2, 0x51\n" - "_08088316:\n" - "\tlsls r0, r4, 16\n" - "\tasrs r0, 16\n" - "\tlsls r1, r0, 8\n" - "\tlsls r2, 16\n" - "\tasrs r2, 16\n" - "\torrs r1, r2\n" - "\tstrh r1, [r3, 0xC]\n" - "\tcmp r0, 0x50\n" - "\tbne _08088332\n" - "\tcmp r2, 0x51\n" - "\tbne _08088332\n" - "\tldrh r0, [r3, 0x8]\n" - "\tadds r0, 0x1\n" - "\tstrh r0, [r3, 0x8]\n" - "_08088332:\n" - "\tpop {r4}\n" - "\tpop {r0}\n" - "\tbx r0"); -} -#endif void sub_8088338(struct Task *task) { -- cgit v1.2.3 From 433a33ad6516fe18ce378edbb1539e805708d06e Mon Sep 17 00:00:00 2001 From: scnorton Date: Sun, 11 Jun 2017 14:58:09 -0400 Subject: Most of darkness field move streaks field effect --- src/field_effect.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 108 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index cd58e84ba..53f8aaed4 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -2015,9 +2015,12 @@ void sub_808847C(u8); u8 sub_8088830(u32, u32, u32); extern const void (*gUnknown_0839F3AC[7])(struct Task *); extern const void (*gUnknown_0839F3C8[7])(struct Task *); -extern const u32 gFieldMoveStreaksTiles[]; +extern const u32 gFieldMoveStreaksTiles[0x200]; extern const u16 gFieldMoveStreaksPalette[16]; extern const u16 gFieldMoveStreaksTilemap[0x140]; +extern const u32 gDarknessFieldMoveStreaksTiles[0x80]; +extern const u16 gDarknessFieldMoveStreaksPalette[16]; +extern const u16 gDarknessFieldMoveStreaksTilemap[0x140]; void sub_80883DC(void); void sub_808843C(u16); void sub_8088890(struct Sprite *); @@ -2200,3 +2203,107 @@ void sub_808843C(u16 offs) *dest = gFieldMoveStreaksTilemap[i] | 0xf000; } } + +void sub_80886B0(void); +bool8 sub_8088708(struct Task *); +void sub_80886F8(struct Task *); +bool8 sub_80887C0(struct Task *); + +void sub_808847C(u8 taskId) +{ + gUnknown_0839F3C8[gTasks[taskId].data[0]](&gTasks[taskId]); +} + +void sub_80884AC(struct Task *task) +{ + REG_BG0HOFS = task->data[1]; + REG_BG0VOFS = task->data[2]; + StoreWordInTwoHalfwords((u16 *)&task->data[13], (u32)gMain.vblankCallback); + SetVBlankCallback(sub_80886B0); + task->data[0]++; +} + +void sub_80884E8(struct Task *task) +{ + u16 offset; + u16 delta; + offset = ((REG_BG0CNT >> 2) << 14); + delta = ((REG_BG0CNT >> 8) << 11); + task->data[12] = delta; + CpuCopy16(gDarknessFieldMoveStreaksTiles, (void *)(VRAM + offset), 0x80); + CpuFill32(0, (void *)(VRAM + delta), 0x800); + LoadPalette(gDarknessFieldMoveStreaksPalette, 0xf0, 0x20); + task->data[0]++; +} + +void sub_8088554(struct Task *task) +{ + if (sub_8088708(task)) + { + REG_WIN1H = 0x00f0; + REG_WIN1V = 0x2878; + gSprites[task->data[15]].callback = sub_8088890; + task->data[0]++; + } + sub_80886F8(task); +} + +void sub_80885A8(struct Task *task) +{ + sub_80886F8(task); + if (gSprites[task->data[15]].data7) + { + task->data[0]++; + } +} + +void sub_80885D8(struct Task *task) +{ + sub_80886F8(task); + task->data[3] = task->data[1] & 7; + task->data[4] = 0; + REG_WIN1H = 0xffff; + REG_WIN1V = 0xffff; + task->data[0]++; +} + +void sub_808860C(struct Task *task) +{ + sub_80886F8(task); + if (sub_80887C0(task)) + { + task->data[0]++; + } +} + +void sub_808862C(struct Task *task) +{ + IntrCallback intrCallback; + u16 bg0cnt; + bg0cnt = (REG_BG0CNT >> 8) << 11; + CpuFill32(0, (void *)VRAM + bg0cnt, 0x800); + LoadWordFromTwoHalfwords((u16 *)&task->data[13], (u32 *)&intrCallback); + SetVBlankCallback(intrCallback); + SetUpWindowConfig(&gWindowConfig_81E6CE4); + InitMenuWindow(&gWindowConfig_81E6CE4); + FreeResourcesAndDestroySprite(&gSprites[task->data[15]]); + FieldEffectActiveListRemove(FLDEFF_FIELD_MOVE_SHOW_MON); + DestroyTask(FindTaskIdByFunc(sub_808847C)); +} + +void sub_80886B0(void) +{ + IntrCallback intrCallback; + struct Task *task; + task = &gTasks[FindTaskIdByFunc(sub_808847C)]; + LoadWordFromTwoHalfwords((u16 *)&task->data[13], (u32 *)&intrCallback); + intrCallback(); + REG_BG0HOFS = task->data[1]; + REG_BG0VOFS = task->data[2]; +} + +void sub_80886F8(struct Task *task) +{ + task->data[1] -= 16; + task->data[3] += 16; +} -- cgit v1.2.3 From a3162cb844dbbc6bbfd850163526c42cc0191d1c Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 11 Jun 2017 21:04:00 -0400 Subject: Finish FldEff_FieldMoveShowMon except solitary nonmatching function --- src/field_effect.c | 212 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 210 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index 53f8aaed4..12a5e1092 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -2017,10 +2017,10 @@ extern const void (*gUnknown_0839F3AC[7])(struct Task *); extern const void (*gUnknown_0839F3C8[7])(struct Task *); extern const u32 gFieldMoveStreaksTiles[0x200]; extern const u16 gFieldMoveStreaksPalette[16]; -extern const u16 gFieldMoveStreaksTilemap[0x140]; +extern const u16 gFieldMoveStreaksTilemap[10 * 32]; extern const u32 gDarknessFieldMoveStreaksTiles[0x80]; extern const u16 gDarknessFieldMoveStreaksPalette[16]; -extern const u16 gDarknessFieldMoveStreaksTilemap[0x140]; +extern const u16 gDarknessFieldMoveStreaksTilemap[10 * 32]; void sub_80883DC(void); void sub_808843C(u16); void sub_8088890(struct Sprite *); @@ -2307,3 +2307,211 @@ void sub_80886F8(struct Task *task) task->data[1] -= 16; task->data[3] += 16; } + +#ifdef NONMATCHING +bool8 sub_8088708(struct Task *task) +{ + u16 i; + u16 srcOffs; + u16 dstOffs; + u16 *dest; + if (task->data[4] >= 32) + { + return TRUE; + } + dstOffs = (task->data[3] >> 3) & 0x1f; + if (dstOffs >= task->data[4]) + { + dstOffs = (32 - dstOffs) & 0x1f; + srcOffs = (32 - task->data[4]) & 0x1f; + dest = (u16 *)(VRAM + 0x140 + (u16)task->data[12]); + for (i=0; i<10; i++) + { + dest[dstOffs + i * 32] = gDarknessFieldMoveStreaksTilemap[srcOffs + i * 32] | 0xf000; + dest[((dstOffs + 1) & 0x1f) + i * 32] = gDarknessFieldMoveStreaksTilemap[((srcOffs + 1) & 0x1f) + i * 32] | 0xf000; + } + task->data[4] += 2; + } + return FALSE; +} +#else +__attribute__((naked)) +bool8 sub_8088708(struct Task *task) +{ + asm_unified("\tpush {r4-r7,lr}\n" + "\tmov r7, r10\n" + "\tmov r6, r9\n" + "\tmov r5, r8\n" + "\tpush {r5-r7}\n" + "\tsub sp, 0x4\n" + "\tadds r5, r0, 0\n" + "\tldrh r2, [r5, 0x10]\n" + "\tmovs r1, 0x10\n" + "\tldrsh r0, [r5, r1]\n" + "\tcmp r0, 0x1F\n" + "\tble _08088724\n" + "\tmovs r0, 0x1\n" + "\tb _080887A8\n" + "_08088724:\n" + "\tldrh r0, [r5, 0xE]\n" + "\tlsls r0, 16\n" + "\tasrs r3, r0, 19\n" + "\tmovs r1, 0x1F\n" + "\tands r3, r1\n" + "\tmovs r4, 0x10\n" + "\tldrsh r0, [r5, r4]\n" + "\tcmp r3, r0\n" + "\tblt _080887A6\n" + "\tmovs r0, 0x20\n" + "\tsubs r3, r0, r3\n" + "\tands r3, r1\n" + "\tsubs r0, r2\n" + "\tmov r12, r0\n" + "\tmov r7, r12\n" + "\tands r7, r1\n" + "\tmov r12, r7\n" + "\tldrh r0, [r5, 0x20]\n" + "\tldr r1, _080887B8 @ =0x06000140\n" + "\tadds r1, r0\n" + "\tmov r8, r1\n" + "\tmovs r4, 0\n" + "\tldr r7, _080887BC @ =gDarknessFieldMoveStreaksTilemap\n" + "\tmov r10, r7\n" + "\tmovs r0, 0xF0\n" + "\tlsls r0, 8\n" + "\tmov r9, r0\n" + "\tadds r1, r3, 0x1\n" + "\tmovs r0, 0x1F\n" + "\tands r1, r0\n" + "\tstr r1, [sp]\n" + "\tmov r6, r12\n" + "\tadds r6, 0x1\n" + "\tands r6, r0\n" + "_08088768:\n" + "\tlsls r1, r4, 5\n" + "\tadds r2, r1, r3\n" + "\tlsls r2, 1\n" + "\tadd r2, r8\n" + "\tmov r7, r12\n" + "\tadds r0, r7, r1\n" + "\tlsls r0, 1\n" + "\tadd r0, r10\n" + "\tldrh r0, [r0]\n" + "\tmov r7, r9\n" + "\torrs r0, r7\n" + "\tstrh r0, [r2]\n" + "\tldr r0, [sp]\n" + "\tadds r2, r1, r0\n" + "\tlsls r2, 1\n" + "\tadd r2, r8\n" + "\tadds r1, r6, r1\n" + "\tlsls r1, 1\n" + "\tadd r1, r10\n" + "\tldrh r0, [r1]\n" + "\tmov r1, r9\n" + "\torrs r0, r1\n" + "\tstrh r0, [r2]\n" + "\tadds r0, r4, 0x1\n" + "\tlsls r0, 16\n" + "\tlsrs r4, r0, 16\n" + "\tcmp r4, 0x9\n" + "\tbls _08088768\n" + "\tldrh r0, [r5, 0x10]\n" + "\tadds r0, 0x2\n" + "\tstrh r0, [r5, 0x10]\n" + "_080887A6:\n" + "\tmovs r0, 0\n" + "_080887A8:\n" + "\tadd sp, 0x4\n" + "\tpop {r3-r5}\n" + "\tmov r8, r3\n" + "\tmov r9, r4\n" + "\tmov r10, r5\n" + "\tpop {r4-r7}\n" + "\tpop {r1}\n" + "\tbx r1\n" + "\t.align 2, 0\n" + "_080887B8: .4byte 0x06000140\n" + "_080887BC: .4byte gDarknessFieldMoveStreaksTilemap"); +} +#endif + +bool8 sub_80887C0(struct Task *task) +{ + u16 i; + u16 dstOffs; + u16 *dest; + if (task->data[4] >= 32) + { + return TRUE; + } + dstOffs = task->data[3] >> 3; + if (dstOffs >= task->data[4]) + { + dstOffs = (task->data[1] >> 3) & 0x1f; + dest = (u16 *)(VRAM + 0x140 + (u16)task->data[12]); + for (i=0; i<10; i++) + { + dest[dstOffs + i * 32] = 0xf000; + dest[((dstOffs + 1) & 0x1f) + i * 32] = 0xf000; + } + task->data[4] += 2; + } + return FALSE; +} + +u8 sub_8088830(u32 a0, u32 a1, u32 a2) +{ + u16 v0; + u8 monSprite; + struct Sprite *sprite; + v0 = (a0 & 0x80000000) >> 16; + a0 &= 0x7fffffff; + monSprite = CreateMonSprite_FieldMove(a0, a1, a2, 0x140, 0x50, 0); + sprite = &gSprites[monSprite]; + sprite->callback = SpriteCallbackDummy; + sprite->oam.priority = 0; + sprite->data0 = a0; + sprite->data6 = v0; + return monSprite; +} + +void sub_80888D4(struct Sprite *); + +void sub_8088890(struct Sprite *sprite) +{ + if ((sprite->pos1.x -= 20) <= 0x78) + { + sprite->pos1.x = 0x78; + sprite->data1 = 30; + sprite->callback = sub_80888D4; + if (sprite->data6) + { + PlayCry2(sprite->data0, 0, 0x7d, 0xa); + } else + { + PlayCry1(sprite->data0, 0); + } + } +} + +void sub_80888F0(struct Sprite *); + +void sub_80888D4(struct Sprite *sprite) +{ + if ((--sprite->data1) == 0) + { + sprite->callback = sub_80888F0; + } +} + +void sub_80888F0(struct Sprite *sprite) +{ + if (sprite->pos1.x < -0x40) + { + sprite->data7 = 1; + } else + { + sprite->pos1.x -= 20; + } +} -- cgit v1.2.3 From 0ed7376e9ab879ce9a4628442540185d28dea537 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 11 Jun 2017 21:36:39 -0400 Subject: FldEff_UseSurf --- src/field_effect.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index 12a5e1092..c7a7d8d5b 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -2515,3 +2515,90 @@ void sub_80888F0(struct Sprite *sprite) sprite->pos1.x -= 20; } } + +void sub_8088954(u8); +extern const void (*gUnknown_0839F3E4[5])(struct Task *); + +u8 FldEff_UseSurf(void) +{ + u8 taskId; + taskId = CreateTask(sub_8088954, 0xff); + gTasks[taskId].data[15] = gUnknown_0202FF84[0]; + sav1_reset_battle_music_maybe(); + sub_8053FB0(0x016d); + return FALSE; +} + +void sub_8088954(u8 taskId) +{ + gUnknown_0839F3E4[gTasks[taskId].data[0]](&gTasks[taskId]); +} + +void sub_8088984(struct Task *task) +{ + ScriptContext2_Enable(); + FreezeMapObjects(); + gPlayerAvatar.unk6 = 1; + SetPlayerAvatarStateMask(8); + PlayerGetDestCoords(&task->data[1], &task->data[2]); + MoveCoords(gMapObjects[gPlayerAvatar.mapObjectId].placeholder18, &task->data[1], &task->data[2]); + task->data[0]++; +} + +void sub_80889E4(struct Task *task) +{ + struct MapObject *mapObject; + mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + if (!FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive(mapObject) || FieldObjectClearAnimIfSpecialAnimFinished(mapObject)) + { + sub_8059BF4(); + FieldObjectSetSpecialAnim(mapObject, 0x39); + task->data[0]++; + } +} + +void sub_8088A30(struct Task *task) +{ + struct MapObject *mapObject; + mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + if (FieldObjectCheckIfSpecialAnimFinishedOrInactive(mapObject)) + { + gUnknown_0202FF84[0] = task->data[15] | 0x80000000; + FieldEffectStart(FLDEFF_FIELD_MOVE_SHOW_MON_INIT); + task->data[0]++; + } +} + +void sub_8088A78(struct Task *task) +{ + struct MapObject *mapObject; + if (!FieldEffectActiveListContains(FLDEFF_FIELD_MOVE_SHOW_MON)) + { + mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + sub_805B980(mapObject, GetPlayerAvatarGraphicsIdByStateId(3)); + FieldObjectClearAnimIfSpecialAnimFinished(mapObject); + FieldObjectSetSpecialAnim(mapObject, sub_80608D0(mapObject->placeholder18)); + gUnknown_0202FF84[0] = task->data[1]; + gUnknown_0202FF84[1] = task->data[2]; + gUnknown_0202FF84[2] = gPlayerAvatar.mapObjectId; + mapObject->mapobj_unk_1A = FieldEffectStart(FLDEFF_SURF_BLOB); + task->data[0]++; + } +} + +void sub_8088AF4(struct Task *task) +{ + struct MapObject *mapObject; + mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + if (FieldObjectClearAnimIfSpecialAnimFinished(mapObject)) + { + gPlayerAvatar.unk6 = 0; + gPlayerAvatar.flags &= 0xdf; + FieldObjectSetSpecialAnim(mapObject, GetFaceDirectionAnimId(mapObject->placeholder18)); + sub_8127ED0(mapObject->mapobj_unk_1A, 1); + UnfreezeMapObjects(); + ScriptContext2_Disable(); + FieldEffectActiveListRemove(FLDEFF_USE_SURF); + DestroyTask(FindTaskIdByFunc(sub_8088954)); + } +} -- cgit v1.2.3 From e74f4cc8c7aa66618212c6e5b74f21f4bbe29b6e Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 12 Jun 2017 08:28:29 -0400 Subject: FldEff_NPCFlyOut --- src/field_effect.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index c7a7d8d5b..eeb12300b 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -2602,3 +2602,40 @@ void sub_8088AF4(struct Task *task) DestroyTask(FindTaskIdByFunc(sub_8088954)); } } + +void sub_8088BC4(struct Sprite *); + +u8 FldEff_NPCFlyOut(void) +{ + u8 spriteId; + struct Sprite *sprite; + spriteId = CreateSprite(gFieldEffectObjectTemplatePointers[26], 0x78, 0, 1); + sprite = &gSprites[spriteId]; + sprite->oam.paletteNum = 0; + sprite->oam.priority = 1; + sprite->callback = sub_8088BC4; + sprite->data1 = gUnknown_0202FF84[0]; + PlaySE(SE_W019); + return spriteId; +} + +void sub_8088BC4(struct Sprite *sprite) +{ + struct Sprite *npcSprite; + sprite->pos2.x = Cos(sprite->data2, 0x8c); + sprite->pos2.y = Sin(sprite->data2, 0x48); + sprite->data2 = (sprite->data2 + 4) & 0xff; + if (sprite->data0) + { + npcSprite = &gSprites[sprite->data1]; + npcSprite->coordOffsetEnabled = 0; + npcSprite->pos1.x = sprite->pos1.x + sprite->pos2.x; + npcSprite->pos1.y = sprite->pos1.y + sprite->pos2.y - 8; + npcSprite->pos2.x = 0; + npcSprite->pos2.y = 0; + } + if (sprite->data2 >= 0x80) + { + FieldEffectStop(sprite, FLDEFF_NPCFLY_OUT); + } +} -- cgit v1.2.3 From b3df9aad1ddbee7e467bf1799030a5f7987b5f32 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 12 Jun 2017 09:26:59 -0400 Subject: FldEff_UseFly --- src/field_effect.c | 231 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 231 insertions(+) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index eeb12300b..15f42c9f8 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -2639,3 +2639,234 @@ void sub_8088BC4(struct Sprite *sprite) FieldEffectStop(sprite, FLDEFF_NPCFLY_OUT); } } + +void sub_8088C70(u8); +extern const void (*gUnknown_0839F3F8[9])(struct Task *); +extern void sub_8127EFC(u8, u8); +u8 sub_8088F60(void); +bool8 sub_8088FA4(u8); +void sub_8088FC0(u8); +void sub_8088FFC(u8, u8); +void sub_8089018(struct Sprite *); +void sub_80890D8(struct Sprite *); +extern const union AffineAnimCmd *gSpriteAffineAnimTable_0839F44C[]; + +u8 FldEff_UseFly(void) +{ + u8 taskId; + taskId = CreateTask(sub_8088C70, 0xfe); + gTasks[taskId].data[1] = gUnknown_0202FF84[0]; + return 0; +} + +void sub_8088C70(u8 taskId) +{ + gUnknown_0839F3F8[gTasks[taskId].data[0]](&gTasks[taskId]); +} + +void sub_8088CA0(struct Task *task) +{ + struct MapObject *mapObject; + mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + if (!FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive(mapObject) || FieldObjectClearAnimIfSpecialAnimFinished(mapObject)) + { + task->data[15] = gPlayerAvatar.flags; + gPlayerAvatar.unk6 = 0x01; + SetPlayerAvatarStateMask(1); + sub_8059BF4(); + FieldObjectSetSpecialAnim(mapObject, 0x39); + task->data[0]++; + } +} + +void sub_8088CF8(struct Task *task) +{ + struct MapObject *mapObject; + mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + if (FieldObjectClearAnimIfSpecialAnimFinished(mapObject)) + { + task->data[0]++; + gUnknown_0202FF84[0] = task->data[1]; + FieldEffectStart(FLDEFF_FIELD_MOVE_SHOW_MON_INIT); + } +} + +void sub_8088D3C(struct Task *task) +{ + struct MapObject *mapObject; + if (!FieldEffectActiveListContains(FLDEFF_FIELD_MOVE_SHOW_MON)) + { + mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + if (task->data[15] & 0x08) + { + sub_8127ED0(mapObject->mapobj_unk_1A, 2); + sub_8127EFC(mapObject->mapobj_unk_1A, 0); + } + task->data[1] = sub_8088F60(); + task->data[0]++; + } +} + +void sub_8088D94(struct Task *task) +{ + if (sub_8088FA4(task->data[1])) + { + task->data[0]++; + task->data[2] = 16; + SetPlayerAvatarTransitionFlags(0x01); + FieldObjectSetSpecialAnim(&gMapObjects[gPlayerAvatar.mapObjectId], 0x02); + } +} + +void sub_8088DD8(struct Task *task) +{ + struct MapObject *mapObject; + mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + if ((task->data[2] == 0 || (--task->data[2]) == 0) && FieldObjectClearAnimIfSpecialAnimFinished(mapObject)) + { + task->data[0]++; + PlaySE(SE_W019); + sub_8088FC0(task->data[1]); + } +} + +void sub_8088E2C(struct Task *task) +{ + struct MapObject *mapObject; + if ((++task->data[2]) >= 8) + { + mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + sub_805B980(mapObject, GetPlayerAvatarGraphicsIdByStateId(0x03)); + StartSpriteAnim(&gSprites[mapObject->spriteId], 0x16); + mapObject->mapobj_bit_12 = 1; + FieldObjectSetSpecialAnim(mapObject, 0x48); + if (task->data[15] & 0x08) + { + DestroySprite(&gSprites[mapObject->mapobj_unk_1A]); + } + task->data[0]++; + task->data[2] = 0; + } +} + +void sub_8088EB4(struct Task *task) +{ + struct MapObject *mapObject; + if ((++task->data[2]) >= 10) + { + mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + FieldObjectClearAnimIfSpecialAnimActive(mapObject); + mapObject->mapobj_bit_12 = 0; + mapObject->mapobj_bit_22 = 0; + sub_8088FFC(task->data[1], mapObject->spriteId); + CameraObjectReset2(); + task->data[0]++; + } +} + +void sub_8088F10(struct Task *task) +{ + if (sub_8088FA4(task->data[1])) + { + fade_8080918(); + task->data[0]++; + } +} + +void sub_8088F30(struct Task *task) +{ + if (!gPaletteFade.active) + { + FieldEffectActiveListRemove(FLDEFF_USE_FLY); + DestroyTask(FindTaskIdByFunc(sub_8088C70)); + } +} + +u8 sub_8088F60(void) +{ + u8 spriteId; + struct Sprite *sprite; + spriteId = CreateSprite(gFieldEffectObjectTemplatePointers[26], 0xff, 0xb4, 0x1); + sprite = &gSprites[spriteId]; + sprite->oam.paletteNum = 0; + sprite->oam.priority = 1; + sprite->callback = sub_8089018; + return spriteId; +} + +u8 sub_8088FA4(u8 spriteId) +{ + return gSprites[spriteId].data7; +} + +void sub_8088FC0(u8 spriteId) +{ + struct Sprite *sprite; + sprite = &gSprites[spriteId]; + sprite->callback = sub_80890D8; + sprite->pos1.x = 0x78; + sprite->pos1.y = 0x00; + sprite->pos2.x = 0; + sprite->pos2.y = 0; + memset(&sprite->data0, 0, 8 * sizeof(u16) /* zero all data cells */); + sprite->data6 = 0x40; +} + +void sub_8088FFC(u8 a0, u8 a1) +{ + gSprites[a0].data6 = a1; +} + +void sub_8089018(struct Sprite *sprite) +{ + if (sprite->data7 == 0) + { + if (sprite->data0 == 0) + { + sprite->oam.affineMode = 3; + sprite->affineAnims = gSpriteAffineAnimTable_0839F44C; + InitSpriteAffineAnim(sprite); + StartSpriteAffineAnim(sprite, 0); + sprite->pos1.x = 0x76; + sprite->pos1.y = -0x30; + sprite->data0++; + sprite->data1 = 0x40; + sprite->data2 = 0x100; + } + sprite->data1 += (sprite->data2 >> 8); + sprite->pos2.x = Cos(sprite->data1, 0x78); + sprite->pos2.y = Sin(sprite->data1, 0x78); + if (sprite->data2 < 0x800) + { + sprite->data2 += 0x60; + } + if (sprite->data1 > 0x81) + { + sprite->data7++; + sprite->oam.affineMode = 0; + FreeOamMatrix(sprite->oam.matrixNum); + CalcCenterToCornerVec(sprite, sprite->oam.shape, sprite->oam.size, 0); + } + } +} + +void sub_80890D8(struct Sprite *sprite) +{ + struct Sprite *sprite1; + sprite->pos2.x = Cos(sprite->data2, 0x8c); + sprite->pos2.y = Sin(sprite->data2, 0x48); + sprite->data2 = (sprite->data2 + 4) & 0xff; + if (sprite->data6 != 0x40) + { + sprite1 = &gSprites[sprite->data6]; + sprite1->coordOffsetEnabled = 0; + sprite1->pos1.x = sprite->pos1.x + sprite->pos2.x; + sprite1->pos1.y = sprite->pos1.y + sprite->pos2.y - 8; + sprite1->pos2.x = 0; + sprite1->pos2.y = 0; + } + if (sprite->data2 >= 0x80) + { + sprite->data7 = 1; + } +} -- cgit v1.2.3 From e600694768b4badf5fca03e9671d13c54abedfd1 Mon Sep 17 00:00:00 2001 From: scnorton Date: Mon, 12 Jun 2017 12:16:45 -0400 Subject: Another sprite callback currently unlinked to any known/decompiled routine --- src/field_effect.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index 15f42c9f8..9269f7db0 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -2870,3 +2870,53 @@ void sub_80890D8(struct Sprite *sprite) sprite->data7 = 1; } } + +void sub_808914C(struct Sprite *sprite) +{ + if (sprite->data7 == 0) + { + if (sprite->data0 == 0) + { + sprite->oam.affineMode = 3; + sprite->affineAnims = gSpriteAffineAnimTable_0839F44C; + InitSpriteAffineAnim(sprite); + StartSpriteAffineAnim(sprite, 1); + sprite->pos1.x = 0x5e; + sprite->pos1.y = -0x20; + sprite->data0++; + sprite->data1 = 0xf0; + sprite->data2 = 0x800; + sprite->data4 = 0x80; + } + sprite->data1 += sprite->data2 >> 8; + sprite->data3 += sprite->data2 >> 8; + sprite->data1 &= 0xff; + sprite->pos2.x = Cos(sprite->data1, 0x20); + sprite->pos2.y = Sin(sprite->data1, 0x78); + if (sprite->data2 > 0x100) + { + sprite->data2 -= sprite->data4; + } + if (sprite->data4 < 0x100) + { + sprite->data4 += 24; + } + if (sprite->data2 < 0x100) + { + sprite->data2 = 0x100; + } + if (sprite->data3 >= 60) + { + sprite->data7++; + sprite->oam.affineMode = 0; + FreeOamMatrix(sprite->oam.matrixNum); + sprite->invisible = 1; + } + } +} + +void sub_8089230(u8 spriteId) +{ + sub_8088FC0(spriteId); + gSprites[spriteId].callback = sub_808914C; +} -- cgit v1.2.3 From db6818ca9149304463e5e2219ec90993a3af53b2 Mon Sep 17 00:00:00 2001 From: scnorton Date: Mon, 12 Jun 2017 13:58:12 -0400 Subject: FldEff_FlyIn (last remaining field effect) --- src/field_effect.c | 132 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) (limited to 'src') diff --git a/src/field_effect.c b/src/field_effect.c index 9269f7db0..6cff8b864 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -2920,3 +2920,135 @@ void sub_8089230(u8 spriteId) sub_8088FC0(spriteId); gSprites[spriteId].callback = sub_808914C; } + +void sub_8089270(u8); +extern const void (*gUnknown_0839F454[7])(struct Task *); +extern const s16 gUnknown_0839F470[18]; + +u8 FldEff_FlyIn(void) +{ + CreateTask(sub_8089270, 0xfe); + return 0; +} + +void sub_8089270(u8 taskId) +{ + gUnknown_0839F454[gTasks[taskId].data[0]](&gTasks[taskId]); +} + +void sub_80892A0(struct Task *task) +{ + struct MapObject *mapObject; + mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + if (!FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive(mapObject) || FieldObjectClearAnimIfSpecialAnimFinished(mapObject)) + { + task->data[0]++; + task->data[2] = 17; + task->data[15] = gPlayerAvatar.flags; + gPlayerAvatar.unk6 = 1; + SetPlayerAvatarStateMask(0x01); + if (task->data[15] & 0x08) + { + sub_8127ED0(mapObject->mapobj_unk_1A, 0); + } + sub_805B980(mapObject, GetPlayerAvatarGraphicsIdByStateId(0x3)); + CameraObjectReset2(); + FieldObjectTurn(mapObject, DIR_WEST); + StartSpriteAnim(&gSprites[mapObject->spriteId], 0x16); + mapObject->mapobj_bit_13 = 0; + task->data[1] = sub_8088F60(); + sub_8088FC0(task->data[1]); + sub_8088FFC(task->data[1], mapObject->spriteId); + } +} + +void sub_8089354(struct Task *task) +{ + struct MapObject *mapObject; + struct Sprite *sprite; + if (task->data[2] == 0 || (--task->data[2]) == 0) + { + mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + sprite = &gSprites[mapObject->spriteId]; + sub_8088FFC(task->data[1], 0x40); + sprite->pos1.x += sprite->pos2.x; + sprite->pos1.y += sprite->pos2.y; + sprite->pos2.x = 0; + sprite->pos2.y = 0; + task->data[0]++; + task->data[2] = 0; + } +} + +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]; + sprite->pos2.y = unknown_0839F470[task->data[2]]; + if ((++task->data[2]) >= 18) + { + task->data[0]++; + } +} + +void sub_8089414(struct Task *task) +{ + struct MapObject *mapObject; + struct Sprite *sprite; + if (sub_8088FA4(task->data[1])) + { + mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + sprite = &gSprites[mapObject->spriteId]; + mapObject->mapobj_bit_12 = 0; + sub_805C058(mapObject, mapObject->coords2.x, mapObject->coords2.y); + sprite->pos2.x = 0; + sprite->pos2.y = 0; + sprite->coordOffsetEnabled = 1; + sub_8059BF4(); + FieldObjectSetSpecialAnim(mapObject, 0x39); + task->data[0]++; + } +} + +void sub_808948C(struct Task *task) +{ + if (FieldObjectClearAnimIfSpecialAnimFinished(&gMapObjects[gPlayerAvatar.mapObjectId])) + { + task->data[0]++; + sub_8089230(task->data[1]); + } +} + +void sub_80894C4(struct Task *task) +{ + if (sub_8088FA4(task->data[1])) + { + DestroySprite(&gSprites[task->data[1]]); + task->data[0]++; + task->data[1] = 0x10; + } +} + +void fishE(struct Task *task) +{ + u8 state; + struct MapObject *mapObject; + if ((--task->data[1]) == 0) + { + mapObject = &gMapObjects[gPlayerAvatar.mapObjectId]; + state = 0; + if (task->data[15] & 0x08) + { + state = 3; + sub_8127ED0(mapObject->mapobj_unk_1A, 1); + } + sub_805B980(mapObject, GetPlayerAvatarGraphicsIdByStateId(state)); + FieldObjectTurn(mapObject, DIR_SOUTH); + gPlayerAvatar.flags = task->data[15]; + gPlayerAvatar.unk6 = 0; + FieldEffectActiveListRemove(FLDEFF_FLY_IN); + DestroyTask(FindTaskIdByFunc(sub_8089270)); + } +} -- cgit v1.2.3 From 95c56943995bbae7688b581a6b6d084e215827f4 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Mon, 12 Jun 2017 14:36:40 -0500 Subject: decompile sub_8090750 - sub_8091304 --- src/pokedex.c | 857 +++++++++++++++++++++++++++++++++++++++++++-------- src/starter_choose.c | 2 +- 2 files changed, 733 insertions(+), 126 deletions(-) (limited to 'src') diff --git a/src/pokedex.c b/src/pokedex.c index 97bac3390..ec13edac4 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -2,6 +2,7 @@ #include "gba/m4a_internal.h" #include "pokedex.h" #include "asm.h" +#include "data2.h" #include "decompress.h" #include "event_data.h" #include "m4a.h" @@ -58,7 +59,9 @@ extern u8 gReservedSpritePaletteCount; extern struct PokedexView *gPokedexView; extern u16 gUnknown_0202FFB8; extern u8 gUnknown_0202FFBA; +extern struct PokedexListItem *gUnknown_0202FFBC; extern u8 gUnknown_03005CE8; +extern IntrCallback gUnknown_03005CEC; extern u8 gPokedexMenu_Gfx[]; extern u8 gUnknown_08E96738[]; extern u8 gUnknown_08E9C6DC[]; @@ -68,7 +71,8 @@ extern struct SpriteSheet gUnknown_083A05CC; extern struct SpritePalette gUnknown_083A05DC[]; extern u8 gUnknown_0839FA7C[]; extern u8 gUnknown_0839F67C[]; -extern u8 gPokedexMenu_Pal[]; +extern u16 gPokedexMenu_Pal[]; +extern u16 gPokedexMenu2_Pal[]; extern u8 gUnknown_0839F73C[]; extern u8 gUnknown_083A05EC[]; extern u8 gUnknown_083A05F1[]; @@ -79,8 +83,8 @@ extern struct SpriteTemplate gSpriteTemplate_83A056C; extern struct SpriteTemplate gSpriteTemplate_83A0584; extern struct SpriteTemplate gSpriteTemplate_83A059C; extern struct SpriteTemplate gSpriteTemplate_83A05B4; -extern struct PokedexListItem *gUnknown_0202FFBC; -extern IntrCallback gUnknown_03005CEC; +extern u8 gUnknown_083B5558[]; +extern u8 gUnknown_08D00524[]; extern u8 gUnknown_08E96BD4[]; extern u8 gUnknown_083A05F8[]; extern u8 gUnknown_0839F8A0[]; @@ -92,6 +96,8 @@ extern u8 gUnknown_08E96B58[]; extern struct PokedexEntry gPokedexEntries[]; +extern void sub_800D74C(); +extern const u16 *species_and_otid_get_pal(u16, u32, u32); extern void m4aMPlayVolumeControl(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u16 volume); extern bool8 BeginNormalPaletteFade(u32, s8, u8, u8, u16); extern void remove_some_task(void); @@ -104,6 +110,8 @@ extern u16 gPokedexOrder_Alphabetical[]; extern u16 gPokedexOrder_Weight[]; extern u16 gPokedexOrder_Height[]; +void sub_8090B8C(u8); +void sub_8090C28(struct Sprite *); u16 NationalPokedexNumToSpecies(u16); // asm/pokedex_area_screen @@ -806,7 +814,7 @@ void sub_808D640(void) if (gPokedexView->unk64C_1) LoadPalette(gUnknown_0839F67C + 0x2, 1, 0xBE); else if (!IsNationalPokedexEnabled()) - LoadPalette(gPokedexMenu_Pal + 0x2, 1, 0xBE); + LoadPalette(gPokedexMenu_Pal + 1, 1, 0xBE); else LoadPalette(gUnknown_0839F73C + 0x2, 1, 0xBE); } @@ -1084,126 +1092,29 @@ void sub_808DF88(u16 a, u8 b, u8 c, u16 d) *(u16 *)(VRAM + 0x40 + d * 0x800 + c * 0x40 + b * 2) = unk[1]; } -#ifdef NONMATCHING -//FixMe -u8 sub_808DFE4(u16 a, u8 b, u8 c) +u8 sub_808DFE4(u16 num, u8 b, u8 c) { u8 text[10]; u8 i; - u32 species; for (i = 0; i < 10; i++) text[i] = 0; text[i] = EOS; - species = NationalPokedexNumToSpecies(a); - if (species) - { - for (i = 0; gSpeciesNames[species][i] != EOS && i < 10; i++) - text[i] = gSpeciesNames[species][i]; - } - else + num = NationalPokedexNumToSpecies(num); + switch (num) { + default: + for (i = 0; gSpeciesNames[num][i] != EOS && i < 10; i++) + text[i] = gSpeciesNames[num][i]; + break; + case 0: for (i = 0; i < 10; i++) text[i] = 0xAE; + break; } MenuPrint_PixelCoords(text, (b - 0x11) * 8 + 0xFC, c * 8, 0); + return i; } -#else -__attribute__((naked)) -u8 sub_808DFE4(u16 a, u8 b, u8 c) -{ - asm(".syntax unified\n\ - push {r4-r6,lr}\n\ - sub sp, 0xC\n\ - lsls r0, 16\n\ - lsrs r3, r0, 16\n\ - lsls r1, 24\n\ - lsrs r5, r1, 24\n\ - lsls r2, 24\n\ - lsrs r6, r2, 24\n\ - movs r4, 0\n\ - movs r1, 0\n\ -_0808DFF8:\n\ - mov r2, sp\n\ - adds r0, r2, r4\n\ - strb r1, [r0]\n\ - adds r0, r4, 0x1\n\ - lsls r0, 24\n\ - lsrs r4, r0, 24\n\ - cmp r4, 0x9\n\ - bls _0808DFF8\n\ - adds r0, r2, r4\n\ - movs r1, 0xFF\n\ - strb r1, [r0]\n\ - adds r0, r3, 0\n\ - bl NationalPokedexNumToSpecies\n\ - adds r3, r0, 0\n\ - cmp r3, 0\n\ - beq _0808E058\n\ - movs r4, 0\n\ - ldr r2, _0808E054\n\ - movs r0, 0xB\n\ - adds r1, r3, 0\n\ - muls r1, r0\n\ - adds r0, r1, r2\n\ - ldrb r0, [r0]\n\ - subs r5, 0x11\n\ - lsls r6, 19\n\ - cmp r0, 0xFF\n\ - beq _0808E070\n\ - adds r3, r1, 0\n\ -_0808E032:\n\ - mov r0, sp\n\ - adds r1, r0, r4\n\ - adds r0, r4, r3\n\ - adds r0, r2\n\ - ldrb r0, [r0]\n\ - strb r0, [r1]\n\ - adds r0, r4, 0x1\n\ - lsls r0, 24\n\ - lsrs r4, r0, 24\n\ - adds r0, r4, r3\n\ - adds r0, r2\n\ - ldrb r0, [r0]\n\ - cmp r0, 0xFF\n\ - beq _0808E070\n\ - cmp r4, 0x9\n\ - bls _0808E032\n\ - b _0808E070\n\ - .align 2, 0\n\ -_0808E054: .4byte gSpeciesNames\n\ -_0808E058:\n\ - movs r4, 0\n\ - subs r5, 0x11\n\ - lsls r6, 19\n\ - movs r1, 0xAE\n\ -_0808E060:\n\ - mov r2, sp\n\ - adds r0, r2, r4\n\ - strb r1, [r0]\n\ - adds r0, r4, 0x1\n\ - lsls r0, 24\n\ - lsrs r4, r0, 24\n\ - cmp r4, 0x9\n\ - bls _0808E060\n\ -_0808E070:\n\ - lsls r1, r5, 27\n\ - movs r0, 0xFC\n\ - lsls r0, 24\n\ - adds r1, r0\n\ - lsrs r1, 24\n\ - lsrs r2, r6, 16\n\ - mov r0, sp\n\ - movs r3, 0\n\ - bl MenuPrint_PixelCoords\n\ - adds r0, r4, 0\n\ - add sp, 0xC\n\ - pop {r4-r6}\n\ - pop {r1}\n\ - bx r1\n\ - .syntax divided\n"); -} -#endif void sub_808E090(u8 a, u8 b, u16 c) { @@ -3081,15 +2992,17 @@ u8 sub_809070C(u16 dexNum, u32 b, u32 c) return taskId; } -/* +#ifdef NONMATCHING // yet again... void sub_8090750(u8 taskId) { + u8 spriteId; u16 dexNum = gTasks[taskId].data[1]; - + u16 i; + switch (gTasks[taskId].data[0]) { - default: case 0: + default: if (!gPaletteFade.active) { gUnknown_03005CEC = gMain.vblankCallback; @@ -3099,19 +3012,15 @@ void sub_8090750(u8 taskId) } break; case 1: - { - u16 i; - LZ77UnCompVram(gPokedexMenu_Gfx, (void *)(VRAM + 0x4000)); LZ77UnCompVram(gUnknown_08E96BD4, (void *)(VRAM + 0x7800)); for (i = 0; i < 0x280; i++) ((u16 *)(VRAM + 0x7800))[i] += 0x2000; sub_8091738(gTasks[taskId].data[1], 2, 0x3FC); ResetPaletteFade(); - LoadPalette(gPokedexMenu_Pal + 2, 0x21, 0x9E); + LoadPalette(gPokedexMenu_Pal + 1, 0x21, 0x9E); gTasks[taskId].data[0]++; break; - } case 2: SetUpWindowConfig(&gWindowConfig_81E7064); InitMenuWindow(&gWindowConfig_81E7064); @@ -3128,7 +3037,7 @@ void sub_8090750(u8 taskId) MenuPrint(gDexText_UnknownPoke, 11, 5); MenuPrint(gDexText_UnknownHeight, 16, 7); MenuPrint(gDexText_UnknownWeight, 16, 9); - sub_8091304(&gPokedexEntries[dexNum], 11, 5); + sub_8091304(gPokedexEntries[dexNum].categoryName, 11, 5); sub_8091458(gPokedexEntries[dexNum].height, 16, 7); sub_8091564(gPokedexEntries[dexNum].weight, 16, 9); MenuPrint(gPokedexEntries[dexNum].descriptionPage1, 2, 13); @@ -3136,16 +3045,13 @@ void sub_8090750(u8 taskId) gTasks[taskId].data[0]++; break; case 4: - { - u8 spriteId = sub_80918EC(dexNum, 0x30, 0x38, 0); - + spriteId = sub_80918EC(dexNum, 0x30, 0x38, 0); gSprites[spriteId].oam.priority = 0; BeginNormalPaletteFade(-1, 0, 0x10, 0, 0); SetVBlankCallback(gUnknown_03005CEC); gTasks[taskId].data[3] = spriteId; gTasks[taskId].data[0]++; break; - } case 5: REG_BLDCNT = 0; REG_BLDALPHA = 0; @@ -3165,4 +3071,705 @@ void sub_8090750(u8 taskId) break; } } -*/ +#else +__attribute__((naked)) +void sub_8090750(u8 taskId) +{ + asm(".syntax unified\n\ + push {r4-r7,lr}\n\ + sub sp, 0x8\n\ + lsls r0, 24\n\ + lsrs r7, r0, 24\n\ + ldr r1, _08090778 @ =gTasks\n\ + lsls r0, r7, 2\n\ + adds r0, r7\n\ + lsls r0, 3\n\ + adds r0, r1\n\ + ldrh r6, [r0, 0xA]\n\ + movs r2, 0x8\n\ + ldrsh r0, [r0, r2]\n\ + adds r4, r1, 0\n\ + cmp r0, 0x6\n\ + bhi _0809079C\n\ + lsls r0, 2\n\ + ldr r1, _0809077C @ =_08090780\n\ + adds r0, r1\n\ + ldr r0, [r0]\n\ + mov pc, r0\n\ + .align 2, 0\n\ +_08090778: .4byte gTasks\n\ +_0809077C: .4byte _08090780\n\ + .align 2, 0\n\ +_08090780:\n\ + .4byte _0809079C\n\ + .4byte _080907E0\n\ + .4byte _0809085C\n\ + .4byte _080908A0\n\ + .4byte _08090960\n\ + .4byte _080909B8\n\ + .4byte _080909F4\n\ +_0809079C:\n\ + ldr r0, _080907D0 @ =gPaletteFade\n\ + ldrb r1, [r0, 0x7]\n\ + movs r0, 0x80\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080907AA\n\ + b _08090A26\n\ +_080907AA:\n\ + ldr r1, _080907D4 @ =gUnknown_03005CEC\n\ + ldr r0, _080907D8 @ =gMain\n\ + ldr r0, [r0, 0xC]\n\ + str r0, [r1]\n\ + movs r0, 0\n\ + bl SetVBlankCallback\n\ + movs r0, 0x80\n\ + lsls r0, 1\n\ + bl sub_8091060\n\ + ldr r1, _080907DC @ =gTasks\n\ + lsls r0, r7, 2\n\ + adds r0, r7\n\ + lsls r0, 3\n\ + adds r0, r1\n\ + movs r1, 0x1\n\ + strh r1, [r0, 0x8]\n\ + b _08090A26\n\ + .align 2, 0\n\ +_080907D0: .4byte gPaletteFade\n\ +_080907D4: .4byte gUnknown_03005CEC\n\ +_080907D8: .4byte gMain\n\ +_080907DC: .4byte gTasks\n\ +_080907E0:\n\ + ldr r0, _08090840 @ =gPokedexMenu_Gfx\n\ + ldr r1, _08090844 @ =0x06004000\n\ + bl LZ77UnCompVram\n\ + ldr r0, _08090848 @ =gUnknown_08E96BD4\n\ + ldr r4, _0809084C @ =0x06007800\n\ + adds r1, r4, 0\n\ + bl LZ77UnCompVram\n\ + movs r2, 0\n\ + lsls r5, r7, 2\n\ + mov r12, r5\n\ + movs r0, 0x80\n\ + lsls r0, 6\n\ + adds r6, r0, 0\n\ + ldr r3, _08090850 @ =0x0000027f\n\ +_08090800:\n\ + lsls r0, r2, 1\n\ + adds r0, r4\n\ + ldrh r5, [r0]\n\ + adds r1, r6, r5\n\ + strh r1, [r0]\n\ + adds r0, r2, 0x1\n\ + lsls r0, 16\n\ + lsrs r2, r0, 16\n\ + cmp r2, r3\n\ + bls _08090800\n\ + ldr r0, _08090854 @ =gTasks\n\ + mov r1, r12\n\ + adds r4, r1, r7\n\ + lsls r4, 3\n\ + adds r4, r0\n\ + ldrh r0, [r4, 0xA]\n\ + movs r2, 0xFF\n\ + lsls r2, 2\n\ + movs r1, 0x2\n\ + bl sub_8091738\n\ + bl ResetPaletteFade\n\ + ldr r0, _08090858 @ =gPokedexMenu_Pal + 0x2\n\ + movs r1, 0x21\n\ + movs r2, 0x9E\n\ + bl LoadPalette\n\ + ldrh r0, [r4, 0x8]\n\ + adds r0, 0x1\n\ + strh r0, [r4, 0x8]\n\ + b _08090A26\n\ + .align 2, 0\n\ +_08090840: .4byte gPokedexMenu_Gfx\n\ +_08090844: .4byte 0x06004000\n\ +_08090848: .4byte gUnknown_08E96BD4\n\ +_0809084C: .4byte 0x06007800\n\ +_08090850: .4byte 0x0000027f\n\ +_08090854: .4byte gTasks\n\ +_08090858: .4byte gPokedexMenu_Pal + 0x2\n\ +_0809085C:\n\ + ldr r4, _0809088C @ =gWindowConfig_81E7064\n\ + adds r0, r4, 0\n\ + bl SetUpWindowConfig\n\ + adds r0, r4, 0\n\ + bl InitMenuWindow\n\ + ldr r2, _08090890 @ =0x0600c000\n\ + add r1, sp, 0x4\n\ + movs r0, 0\n\ + strh r0, [r1]\n\ + ldr r0, _08090894 @ =0x040000d4\n\ + str r1, [r0]\n\ + str r2, [r0, 0x4]\n\ + ldr r1, _08090898 @ =0x81000100\n\ + str r1, [r0, 0x8]\n\ + ldr r0, [r0, 0x8]\n\ + ldr r1, _0809089C @ =gTasks\n\ + lsls r0, r7, 2\n\ + adds r0, r7\n\ + lsls r0, 3\n\ + adds r0, r1\n\ + b _080909E0\n\ + .align 2, 0\n\ +_0809088C: .4byte gWindowConfig_81E7064\n\ +_08090890: .4byte 0x0600c000\n\ +_08090894: .4byte 0x040000d4\n\ +_08090898: .4byte 0x81000100\n\ +_0809089C: .4byte gTasks\n\ +_080908A0:\n\ + ldr r0, _080908C8 @ =gDexText_RegisterComplete\n\ + movs r1, 0x2\n\ + movs r2, 0\n\ + movs r3, 0xD0\n\ + bl sub_8072BD8\n\ + bl IsNationalPokedexEnabled\n\ + cmp r0, 0\n\ + bne _080908CC\n\ + adds r0, r6, 0\n\ + bl NationalToHoennOrder\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + movs r1, 0xD\n\ + movs r2, 0x3\n\ + bl sub_8091154\n\ + b _080908D6\n\ + .align 2, 0\n\ +_080908C8: .4byte gDexText_RegisterComplete\n\ +_080908CC:\n\ + adds r0, r6, 0\n\ + movs r1, 0xD\n\ + movs r2, 0x3\n\ + bl sub_8091154\n\ +_080908D6:\n\ + adds r0, r6, 0\n\ + movs r1, 0x10\n\ + movs r2, 0x3\n\ + bl sub_80911C8\n\ + ldr r0, _0809094C @ =gDexText_UnknownPoke\n\ + movs r1, 0xB\n\ + movs r2, 0x5\n\ + bl MenuPrint\n\ + ldr r0, _08090950 @ =gDexText_UnknownHeight\n\ + movs r1, 0x10\n\ + movs r2, 0x7\n\ + bl MenuPrint\n\ + ldr r0, _08090954 @ =gDexText_UnknownWeight\n\ + movs r1, 0x10\n\ + movs r2, 0x9\n\ + bl MenuPrint\n\ + lsls r4, r6, 3\n\ + adds r4, r6\n\ + lsls r4, 2\n\ + ldr r6, _08090958 @ =gPokedexEntries\n\ + adds r5, r4, r6\n\ + adds r0, r5, 0\n\ + movs r1, 0xB\n\ + movs r2, 0x5\n\ + bl sub_8091304\n\ + ldrh r0, [r5, 0xC]\n\ + movs r1, 0x10\n\ + movs r2, 0x7\n\ + bl sub_8091458\n\ + ldrh r0, [r5, 0xE]\n\ + movs r1, 0x10\n\ + movs r2, 0x9\n\ + bl sub_8091564\n\ + adds r6, 0x10\n\ + adds r4, r6\n\ + ldr r0, [r4]\n\ + movs r1, 0x2\n\ + movs r2, 0xD\n\ + bl MenuPrint\n\ + movs r1, 0xFF\n\ + lsls r1, 2\n\ + movs r0, 0xE\n\ + bl sub_80917CC\n\ + ldr r1, _0809095C @ =gTasks\n\ + lsls r0, r7, 2\n\ + adds r0, r7\n\ + lsls r0, 3\n\ + adds r0, r1\n\ + b _080909E0\n\ + .align 2, 0\n\ +_0809094C: .4byte gDexText_UnknownPoke\n\ +_08090950: .4byte gDexText_UnknownHeight\n\ +_08090954: .4byte gDexText_UnknownWeight\n\ +_08090958: .4byte gPokedexEntries\n\ +_0809095C: .4byte gTasks\n\ +_08090960:\n\ + adds r0, r6, 0\n\ + movs r1, 0x30\n\ + movs r2, 0x38\n\ + movs r3, 0\n\ + bl sub_80918EC\n\ + adds r4, r0, 0\n\ + lsls r4, 24\n\ + lsrs r4, 24\n\ + ldr r0, _080909AC @ =gSprites\n\ + lsls r1, r4, 4\n\ + adds r1, r4\n\ + lsls r1, 2\n\ + adds r1, r0\n\ + ldrb r2, [r1, 0x5]\n\ + movs r0, 0xD\n\ + negs r0, r0\n\ + ands r0, r2\n\ + strb r0, [r1, 0x5]\n\ + movs r0, 0x1\n\ + negs r0, r0\n\ + movs r1, 0\n\ + str r1, [sp]\n\ + movs r2, 0x10\n\ + movs r3, 0\n\ + bl BeginNormalPaletteFade\n\ + ldr r0, _080909B0 @ =gUnknown_03005CEC\n\ + ldr r0, [r0]\n\ + bl SetVBlankCallback\n\ + ldr r1, _080909B4 @ =gTasks\n\ + lsls r0, r7, 2\n\ + adds r0, r7\n\ + lsls r0, 3\n\ + adds r0, r1\n\ + strh r4, [r0, 0xE]\n\ + b _080909E0\n\ + .align 2, 0\n\ +_080909AC: .4byte gSprites\n\ +_080909B0: .4byte gUnknown_03005CEC\n\ +_080909B4: .4byte gTasks\n\ +_080909B8:\n\ + ldr r0, _080909E8 @ =REG_BLDCNT\n\ + movs r1, 0\n\ + strh r1, [r0]\n\ + adds r0, 0x2\n\ + strh r1, [r0]\n\ + adds r0, 0x2\n\ + strh r1, [r0]\n\ + ldr r1, _080909EC @ =REG_BG3CNT\n\ + ldr r2, _080909F0 @ =0x00000f07\n\ + adds r0, r2, 0\n\ + strh r0, [r1]\n\ + subs r1, 0xE\n\ + movs r5, 0xE2\n\ + lsls r5, 5\n\ + adds r0, r5, 0\n\ + strh r0, [r1]\n\ + lsls r0, r7, 2\n\ + adds r0, r7\n\ + lsls r0, 3\n\ + adds r0, r4\n\ +_080909E0:\n\ + ldrh r1, [r0, 0x8]\n\ + adds r1, 0x1\n\ + strh r1, [r0, 0x8]\n\ + b _08090A26\n\ + .align 2, 0\n\ +_080909E8: .4byte 0x04000050\n\ +_080909EC: .4byte 0x0400000E\n\ +_080909F0: .4byte 0x00000f07\n\ +_080909F4:\n\ + ldr r0, _08090A30 @ =gPaletteFade\n\ + ldrb r1, [r0, 0x7]\n\ + movs r0, 0x80\n\ + ands r0, r1\n\ + lsls r0, 24\n\ + lsrs r5, r0, 24\n\ + cmp r5, 0\n\ + bne _08090A26\n\ + adds r0, r6, 0\n\ + bl NationalPokedexNumToSpecies\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + movs r1, 0\n\ + bl PlayCry1\n\ + ldr r1, _08090A34 @ =gTasks\n\ + lsls r0, r7, 2\n\ + adds r0, r7\n\ + lsls r0, 3\n\ + adds r0, r1\n\ + strh r5, [r0, 0xC]\n\ + strh r5, [r0, 0x10]\n\ + ldr r1, _08090A38 @ =sub_8090A3C\n\ + str r1, [r0]\n\ +_08090A26:\n\ + add sp, 0x8\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .align 2, 0\n\ +_08090A30: .4byte gPaletteFade\n\ +_08090A34: .4byte gTasks\n\ +_08090A38: .4byte sub_8090A3C\n\ + .syntax divided\n"); +} +#endif + +void sub_8090A3C(u8 taskId) +{ + if (gMain.newKeys & 2) + { + BeginNormalPaletteFade(0x0000FFFC, 0, 0, 16, 0); + gSprites[gTasks[taskId].data[3]].callback = sub_8090C28; + gTasks[taskId].func = sub_8090B8C; + return; + } + else if (gMain.newKeys & A_BUTTON) + { + if (gTasks[taskId].data[4] == 0) + { + u16 r4 = gTasks[taskId].data[1]; + + MenuZeroFillWindowRect(2, 13, 27, 19); + MenuPrint(gPokedexEntries[r4].descriptionPage2, 2, 13); + (*(u16 *)(VRAM + 0x7ACA))++; + (*(u16 *)(VRAM + 0x7B0A))++; + gTasks[taskId].data[4] = 1; + PlaySE(SE_PIN); + } + else + { + BeginNormalPaletteFade(0x0000FFFC, 0, 0, 16, 0); + gSprites[gTasks[taskId].data[3]].callback = sub_8090C28; + gTasks[taskId].func = sub_8090B8C; + return; + } + } + gTasks[taskId].data[2]++; + if (gTasks[taskId].data[2] & 0x10) + LoadPalette(gPokedexMenu_Pal + 1, 0x51, 14); + else + LoadPalette(gPokedexMenu2_Pal + 1, 0x51, 14); +} + +void sub_8090B8C(u8 taskId) +{ + if (!gPaletteFade.active) + { + u16 species; + u32 otId; + u32 personality; + u8 paletteNum; + const u16 *palette; + + REG_DISPCNT = 0x1940; + CpuCopy16(gUnknown_08D00524, (void *)(VRAM + 0xC000), 0x1000); + sub_800D74C(); + species = NationalPokedexNumToSpecies(gTasks[taskId].data[1]); + otId = ((u16)gTasks[taskId].data[13] << 16) | (u16)gTasks[taskId].data[12]; + personality = ((u16)gTasks[taskId].data[15] << 16) | (u16)gTasks[taskId].data[14]; + paletteNum = gSprites[gTasks[taskId].data[3]].oam.paletteNum; + palette = species_and_otid_get_pal(species, otId, personality); + LoadCompressedPalette(palette, 0x100 | paletteNum * 16, 32); + DestroyTask(taskId); + } +} + +void sub_8090C28(struct Sprite *sprite) +{ + if (sprite->pos1.x < 0x78) + sprite->pos1.x += 2; + if (sprite->pos1.x > 0x78) + sprite->pos1.x -= 2; + + if (sprite->pos1.y < 0x50) + sprite->pos1.y += 1; + if (sprite->pos1.y > 0x50) + sprite->pos1.y -= 1; +} + +void sub_8090C68(void) +{ + if (gUnknown_0202FFBC->owned) + { + if (gPokedexView->unk64E == 0) + { + MenuZeroFillWindowRect(2, 13, 27, 19); + MenuPrint(gPokedexEntries[gUnknown_0202FFBC->dexNum].descriptionPage2, 2, 13); + gPokedexView->unk64E = 1; + (*(u16 *)(VRAM + 0x7ACA))++; + (*(u16 *)(VRAM + 0x7B0A))++; + PlaySE(SE_PIN); + } + else + { + MenuZeroFillWindowRect(2, 13, 27, 19); + MenuPrint(gPokedexEntries[gUnknown_0202FFBC->dexNum].descriptionPage1, 2, 13); + gPokedexView->unk64E = 0; + (*(u16 *)(VRAM + 0x7ACA))--; + (*(u16 *)(VRAM + 0x7B0A))--; + PlaySE(SE_PIN); + } + } +} + +const u8 *GetPokemonCategory(u16 dexNum) +{ + return gPokedexEntries[dexNum].categoryName; +} + +u16 GetPokedexHeightWeight(u16 dexNum, u8 data) +{ + switch (data) + { + case 0: // height + return gPokedexEntries[dexNum].height; + case 1: // weight + return gPokedexEntries[dexNum].weight; + default: + return 1; + } +} + +s8 sub_8090D90(u16 a, u8 b) +{ + u8 index; + u8 bit; + u8 mask; + s8 retVal; + + a--; + index = a / 8; + bit = a % 8; + mask = 1 << bit; + retVal = 0; + switch (b) + { + case 0: + if (gSaveBlock2.pokedex.seen[index] & mask) + { + if ((gSaveBlock2.pokedex.seen[index] & mask) == (gSaveBlock1.unk938[index] & mask) + && (gSaveBlock2.pokedex.seen[index] & mask) == (gSaveBlock1.unk3A8C[index] & mask)) + retVal = 1; + else + { + gSaveBlock2.pokedex.seen[index] &= ~mask; + gSaveBlock1.unk938[index] &= ~mask; + gSaveBlock1.unk3A8C[index] &= ~mask; + retVal = 0; + } + } + break; + case 1: + if (gSaveBlock2.pokedex.owned[index] & mask) + { + if ((gSaveBlock2.pokedex.owned[index] & mask) == (gSaveBlock2.pokedex.seen[index] & mask) + && (gSaveBlock2.pokedex.owned[index] & mask) == (gSaveBlock1.unk938[index] & mask) + && (gSaveBlock2.pokedex.owned[index] & mask) == (gSaveBlock1.unk3A8C[index] & mask)) + retVal = 1; + else + { + gSaveBlock2.pokedex.owned[index] &= ~mask; + gSaveBlock2.pokedex.seen[index] &= ~mask; + gSaveBlock1.unk938[index] &= ~mask; + gSaveBlock1.unk3A8C[index] &= ~mask; + retVal = 0; + } + } + break; + case 2: + gSaveBlock2.pokedex.seen[index] |= mask; + gSaveBlock1.unk938[index] |= mask; + gSaveBlock1.unk3A8C[index] |= mask; + break; + case 3: + gSaveBlock2.pokedex.owned[index] |= mask; + break; + } + return retVal; +} + +u16 GetNationalPokedexCount(u8 a) +{ + u16 count = 0; + u16 i; + + for (i = 0; i < 386; i++) + { + switch (a) + { + case 0: + if (sub_8090D90(i + 1, 0) != 0) + count++; + break; + case 1: + if (sub_8090D90(i + 1, 1) != 0) + count++; + break; + } + } + return count; +} + +u16 GetHoennPokedexCount(u8 a) +{ + u16 count = 0; + u16 i; + + for (i = 0; i < 202; i++) + { + switch (a) + { + case 0: + if (sub_8090D90(HoennToNationalOrder(i + 1), 0) != 0) + count++; + break; + case 1: + if (sub_8090D90(HoennToNationalOrder(i + 1), 1) != 0) + count++; + break; + } + } + return count; +} + +bool8 sub_8090FC0(void) +{ + u16 i; + + for (i = 0; i < 200; i++) + { + if (sub_8090D90(HoennToNationalOrder(i + 1), 1) == 0) + return FALSE; + } + return TRUE; +} + +u16 sub_8090FF4(void) +{ + u16 i; + + for (i = 0; i < 150; i++) + { + if (sub_8090D90(i + 1, 1) == 0) + return 0; + } + for (i = 152; i < 250; i++) + { + if (sub_8090D90(i + 1, 1) == 0) + return 0; + } + for (i = 252; i < 384; i++) + { + if (sub_8090D90(i + 1, 1) == 0) + return 0; + } + return 1; +} + +void sub_8091060(u16 a) +{ + if (!(a & 0x100)) + { + REG_DISPCNT &= 0xFEFF; + REG_BG0CNT = 0; + REG_BG0HOFS = 0; + REG_BG0VOFS = 0; + } + if (!(a & 0x200)) + { + REG_DISPCNT &= 0xFDFF; + REG_BG1CNT = 0; + REG_BG1HOFS = 0; + REG_BG1VOFS = 0; + } + if (!(a & 0x400)) + { + REG_DISPCNT &= 0xFBFF; + REG_BG2CNT = 0; + REG_BG2HOFS = 0; + REG_BG2VOFS = 0; + } + if (!(a & 0x800)) + { + REG_DISPCNT &= 0xF7FF; + REG_BG3CNT = 0; + REG_BG3HOFS = 0; + REG_BG3VOFS = 0; + } + if (!(a & 0x1000)) + { + REG_DISPCNT &= 0xEFFF; + ResetSpriteData(); + FreeAllSpritePalettes(); + gReservedSpritePaletteCount = 8; + } +} + +void sub_8091154(u16 order, u8 b, u8 c) +{ + u8 str[4]; + + str[0] = 0xA1 + order / 100; + str[1] = 0xA1 + (order % 100) / 10; + str[2] = 0xA1 + (order % 100) % 10; + str[3] = EOS; + MenuPrint(str, b, c); +} + +u8 sub_80911C8(u16 num, u8 b, u8 c) +{ + u8 str[11]; + u8 i; + + for (i = 0; i < 11; i++) + str[i] = EOS; + num = NationalPokedexNumToSpecies(num); + switch (num) + { + default: + for (i = 0; gSpeciesNames[num][i] != EOS && i < 10; i++) + str[i] = gSpeciesNames[num][i]; + break; + case 0: + for (i = 0; i < 10; i++) + str[i] = 0xAE; + break; + } + MenuPrint(str, b, c); + return i; +} + +u8 sub_8091260(u16 num, u8 b, u8 c, u8 d) +{ + u8 str[40]; // Not exactly sure how long this needs to be + u8 *end; + u8 i; + + end = StringCopy(str, gUnknown_083B5558); + str[2] = d; + num = NationalPokedexNumToSpecies(num); + switch (num) + { + default: + for (i = 0; gSpeciesNames[num][i] != EOS && i < 10; i++) + end[i] = gSpeciesNames[num][i]; + break; + case 0: + for (i = 0; i < 10; i++) + end[i] = 0xAE; + break; + } + end[i] = EOS; + MenuPrint(str, b, c); + return i; +} + +void sub_8091304(u8 *name, u8 b, u8 c) +{ + u8 str[32]; // Not exactly sure how long this needs to be + u8 i; + u8 j; + + for (i = 0; name[i] != EOS && i < 11; i++) + str[i] = name[i]; + for (j = 0; gDexText_UnknownPoke[j] == 0xAC || gDexText_UnknownPoke[j] == 0; j++) + ; + j--; + while (gDexText_UnknownPoke[j] != EOS) + str[i++] = gDexText_UnknownPoke[j++]; + str[i] = EOS; + sub_8072B80(str, b, c, (u8 *)gDexText_UnknownPoke); +} diff --git a/src/starter_choose.c b/src/starter_choose.c index 32b6adf36..0ed8315fc 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -483,7 +483,7 @@ static void AddTextColorCtrlCode(u8 *string, u8 bgColor, u8 textColor, u8 shadow static void CreateStarterPokemonLabel(u8 prevSelection, u8 selection) { u8 labelText[72]; - u8 *category; + const u8 *category; u8 srcIndex; u8 dstIndex; u16 species; -- cgit v1.2.3 From ffa2474021a3f72496028a679a67d49e9fd2baef Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Mon, 12 Jun 2017 14:40:30 -0500 Subject: sub_8072B80 const --- src/menu.c | 2 +- src/pokedex.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/menu.c b/src/menu.c index 61eaebb6f..db1724855 100644 --- a/src/menu.c +++ b/src/menu.c @@ -629,7 +629,7 @@ void MenuPrint_RightAligned(u8 *str, u8 left, u8 top) sub_8004D38(gMenuWindowPtr, str, gMenuTextTileOffset, left, top); } -void sub_8072B80(u8 *a1, u8 a2, u8 a3, u8 *a4) +void sub_8072B80(const u8 *a1, u8 a2, u8 a3, const u8 *a4) { u8 buffer[64]; u8 width = GetStringWidth(gMenuWindowPtr, a4); diff --git a/src/pokedex.c b/src/pokedex.c index ec13edac4..832a55666 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -3771,5 +3771,5 @@ void sub_8091304(u8 *name, u8 b, u8 c) while (gDexText_UnknownPoke[j] != EOS) str[i++] = gDexText_UnknownPoke[j++]; str[i] = EOS; - sub_8072B80(str, b, c, (u8 *)gDexText_UnknownPoke); + sub_8072B80(str, b, c, gDexText_UnknownPoke); } -- cgit v1.2.3 From 00fa1e2efdd2b140451472e5fa09e401f2698cba Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Mon, 12 Jun 2017 15:55:22 -0500 Subject: decompile unref_sub_80913A4 (English) --- src/pokedex.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 56 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/pokedex.c b/src/pokedex.c index 832a55666..d2008128c 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -2998,7 +2998,7 @@ void sub_8090750(u8 taskId) u8 spriteId; u16 dexNum = gTasks[taskId].data[1]; u16 i; - + switch (gTasks[taskId].data[0]) { case 0: @@ -3421,7 +3421,7 @@ void sub_8090A3C(u8 taskId) if (gTasks[taskId].data[4] == 0) { u16 r4 = gTasks[taskId].data[1]; - + MenuZeroFillWindowRect(2, 13, 27, 19); MenuPrint(gPokedexEntries[r4].descriptionPage2, 2, 13); (*(u16 *)(VRAM + 0x7ACA))++; @@ -3453,7 +3453,7 @@ void sub_8090B8C(u8 taskId) u32 personality; u8 paletteNum; const u16 *palette; - + REG_DISPCNT = 0x1940; CpuCopy16(gUnknown_08D00524, (void *)(VRAM + 0xC000), 0x1000); sub_800D74C(); @@ -3473,7 +3473,7 @@ void sub_8090C28(struct Sprite *sprite) sprite->pos1.x += 2; if (sprite->pos1.x > 0x78) sprite->pos1.x -= 2; - + if (sprite->pos1.y < 0x50) sprite->pos1.y += 1; if (sprite->pos1.y > 0x50) @@ -3529,7 +3529,7 @@ s8 sub_8090D90(u16 a, u8 b) u8 bit; u8 mask; s8 retVal; - + a--; index = a / 8; bit = a % 8; @@ -3585,7 +3585,7 @@ u16 GetNationalPokedexCount(u8 a) { u16 count = 0; u16 i; - + for (i = 0; i < 386; i++) { switch (a) @@ -3607,7 +3607,7 @@ u16 GetHoennPokedexCount(u8 a) { u16 count = 0; u16 i; - + for (i = 0; i < 202; i++) { switch (a) @@ -3628,7 +3628,7 @@ u16 GetHoennPokedexCount(u8 a) bool8 sub_8090FC0(void) { u16 i; - + for (i = 0; i < 200; i++) { if (sub_8090D90(HoennToNationalOrder(i + 1), 1) == 0) @@ -3640,7 +3640,7 @@ bool8 sub_8090FC0(void) u16 sub_8090FF4(void) { u16 i; - + for (i = 0; i < 150; i++) { if (sub_8090D90(i + 1, 1) == 0) @@ -3701,7 +3701,7 @@ void sub_8091060(u16 a) void sub_8091154(u16 order, u8 b, u8 c) { u8 str[4]; - + str[0] = 0xA1 + order / 100; str[1] = 0xA1 + (order % 100) / 10; str[2] = 0xA1 + (order % 100) % 10; @@ -3713,7 +3713,7 @@ u8 sub_80911C8(u16 num, u8 b, u8 c) { u8 str[11]; u8 i; - + for (i = 0; i < 11; i++) str[i] = EOS; num = NationalPokedexNumToSpecies(num); @@ -3737,7 +3737,7 @@ u8 sub_8091260(u16 num, u8 b, u8 c, u8 d) u8 str[40]; // Not exactly sure how long this needs to be u8 *end; u8 i; - + end = StringCopy(str, gUnknown_083B5558); str[2] = d; num = NationalPokedexNumToSpecies(num); @@ -3757,19 +3757,60 @@ u8 sub_8091260(u16 num, u8 b, u8 c, u8 d) return i; } -void sub_8091304(u8 *name, u8 b, u8 c) +void sub_8091304(u8 *name, u8 left, u8 top) { u8 str[32]; // Not exactly sure how long this needs to be u8 i; +#if ENGLISH u8 j; - +#endif + for (i = 0; name[i] != EOS && i < 11; i++) str[i] = name[i]; +#if ENGLISH for (j = 0; gDexText_UnknownPoke[j] == 0xAC || gDexText_UnknownPoke[j] == 0; j++) ; j--; while (gDexText_UnknownPoke[j] != EOS) str[i++] = gDexText_UnknownPoke[j++]; +#endif str[i] = EOS; - sub_8072B80(str, b, c, gDexText_UnknownPoke); + sub_8072B80(str, left, top, gDexText_UnknownPoke); +} + +void unref_sub_80913A4(u16 a, u8 left, u8 top) +{ + u8 str[6]; + bool8 outputted = FALSE; + u8 result; + + result = a / 0x3E8; + if (result == 0) + { + str[0] = CHAR_SPACE; + outputted = FALSE; + } + else + { + str[0] = CHAR_0 + result; + outputted = TRUE; + } + + result = (a % 0x3E8) / 100; + if (result == 0 && !outputted) + { + str[1] = CHAR_SPACE; + outputted = FALSE; + } + else + { + str[1] = CHAR_0 + result; + outputted = TRUE; + } + + str[2] = CHAR_0 + ((a % 0x3E8) % 100) / 10; + str[3] = CHAR_PERIOD; + str[4] = CHAR_0 + ((a % 0x3E8) % 100) % 10; + str[5] = EOS; + MenuPrint(str, left, top); } -- cgit v1.2.3 From 0f056ab82cad461c418f7a3c6600a374c6c27184 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Mon, 12 Jun 2017 15:58:41 -0500 Subject: 0x3E8 -> 1000 --- src/pokedex.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/pokedex.c b/src/pokedex.c index d2008128c..538e98ff0 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -3784,7 +3784,7 @@ void unref_sub_80913A4(u16 a, u8 left, u8 top) bool8 outputted = FALSE; u8 result; - result = a / 0x3E8; + result = a / 1000; if (result == 0) { str[0] = CHAR_SPACE; @@ -3796,7 +3796,7 @@ void unref_sub_80913A4(u16 a, u8 left, u8 top) outputted = TRUE; } - result = (a % 0x3E8) / 100; + result = (a % 1000) / 100; if (result == 0 && !outputted) { str[1] = CHAR_SPACE; @@ -3808,9 +3808,9 @@ void unref_sub_80913A4(u16 a, u8 left, u8 top) outputted = TRUE; } - str[2] = CHAR_0 + ((a % 0x3E8) % 100) / 10; + str[2] = CHAR_0 + ((a % 1000) % 100) / 10; str[3] = CHAR_PERIOD; - str[4] = CHAR_0 + ((a % 0x3E8) % 100) % 10; + str[4] = CHAR_0 + ((a % 1000) % 100) % 10; str[5] = EOS; MenuPrint(str, left, top); } -- cgit v1.2.3 From af6fd50247ac3a41bc64074f5350f2939e034e20 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Mon, 12 Jun 2017 19:16:02 -0500 Subject: decompile sub_8091738 --- src/pokedex.c | 149 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) (limited to 'src') diff --git a/src/pokedex.c b/src/pokedex.c index 538e98ff0..91ae27a3b 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -93,6 +93,7 @@ extern u8 gUnknown_03005E98; extern u8 gUnknown_083B4EC4[]; extern u8 gUnknown_08E96ACC[]; extern u8 gUnknown_08E96B58[]; +extern const u8 *const gMonFootprintTable[]; extern struct PokedexEntry gPokedexEntries[]; @@ -3814,3 +3815,151 @@ void unref_sub_80913A4(u16 a, u8 left, u8 top) str[5] = EOS; MenuPrint(str, left, top); } + +#ifdef UNITS_IMPERIAL +#define CHAR_PRIME (0xB4) +#define CHAR_DOUBLE_PRIME (0xB2) +void sub_8091458(u16 height, u8 left, u8 top) +{ + u8 buffer[16]; + u32 inches, feet; + u8 i = 0; + + inches = (height * 10000) / 254; + if (inches % 10 >= 5) + inches += 10; + feet = inches / 120; + inches = (inches - (feet * 120)) / 10; + + buffer[i++] = EXT_CTRL_CODE_BEGIN; + buffer[i++] = 0x13; + if (feet / 10 == 0) + { + buffer[i++] = 18; + buffer[i++] = feet + CHAR_0; + } + else + { + buffer[i++] = 12; + buffer[i++] = feet / 10 + CHAR_0; + buffer[i++] = (feet % 10) + CHAR_0; + } + buffer[i++] = CHAR_PRIME; + buffer[i++] = (inches / 10) + CHAR_0; + buffer[i++] = (inches % 10) + CHAR_0; + buffer[i++] = CHAR_DOUBLE_PRIME; + buffer[i++] = EOS; + MenuPrint(buffer, left, top); +} +#else +void sub_8091458(u16 height, u8 left, u8 top) +{ + unref_sub_80913A4(height, left, top); +} +#endif + +#ifdef UNITS_IMPERIAL +#define CHAR_b (0xD6) +#define CHAR_l (0xE0) +#define CHAR_s (0xE7) +void sub_8091564(u16 weight, u8 left, u8 top) +{ + u8 buffer[16]; + u32 lbs; + u8 i = 0; + bool8 output; + + lbs = (weight * 100000) / 4536; + if (lbs % 10 >= 5) + lbs += 10; + output = FALSE; + + buffer[i] = (lbs / 100000) + CHAR_0; + if (buffer[i] == CHAR_0 && output == FALSE) + { + buffer[i++] = CHAR_SPACE; + buffer[i++] = CHAR_SPACE; + } + else + { + output = TRUE; + i++; + } + + lbs = (lbs % 100000); + buffer[i] = (lbs / 10000) + CHAR_0; + if (buffer[i] == CHAR_0 && output == FALSE) + { + buffer[i++] = CHAR_SPACE; + buffer[i++] = CHAR_SPACE; + } + else + { + output = TRUE; + i++; + } + + lbs = (lbs % 10000); + buffer[i] = (lbs / 1000) + CHAR_0; + if (buffer[i] == CHAR_0 && output == FALSE) + { + buffer[i++] = CHAR_SPACE; + buffer[i++] = CHAR_SPACE; + } + else + { + output = TRUE; + i++; + } + lbs = (lbs % 1000); + buffer[i++] = (lbs / 100) + CHAR_0; + lbs = (lbs % 100); + buffer[i++] = CHAR_PERIOD; + buffer[i++] = (lbs / 10) + CHAR_0; + buffer[i++] = CHAR_SPACE; + buffer[i++] = CHAR_l; + buffer[i++] = CHAR_b; + buffer[i++] = CHAR_s; + buffer[i++] = CHAR_PERIOD; + buffer[i++] = EOS; + MenuPrint(buffer, left, top); +} +#else +void sub_8091564(u16 arg0, u8 left, u8 top) +{ + unref_sub_80913A4(arg0, left, top); +} +#endif + +void sub_8091738(u16 a, u16 b, u16 c) +{ + u8 arr[0x80]; + u16 i; + u16 j; + const u8 *r12; + u16 r7; + u8 r3; + + r12 = gMonFootprintTable[NationalPokedexNumToSpecies(a)]; + for (r7 = 0, i = 0; i < 32; i++) + { + r3 = r12[i]; + for (j = 0; j < 4; j++) + { + u32 r1 = j * 2; + s32 r2 = (r3 >> r1) & 1; + + if (r3 & (2 << r1)) + r2 |= 0x10; + +// Needed to match +#ifndef NONMATCHING + asm("");asm("");asm("");asm("");asm(""); +#endif + + arr[r7] = r2; + r7++; + } + } + CpuCopy16(arr, (u16 *)(VRAM + b * 0x4000 + c * 0x20), 0x80); +} -- cgit v1.2.3 From 2f437b0a94dd88cd78d0f6b4d92b9f5169531376 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Mon, 12 Jun 2017 19:34:01 -0500 Subject: Struct30042E0 --- src/battle_2.c | 27 +-------------------------- src/tv.c | 2 +- 2 files changed, 2 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/battle_2.c b/src/battle_2.c index f7051fbfd..498fcec31 100644 --- a/src/battle_2.c +++ b/src/battle_2.c @@ -55,31 +55,6 @@ struct UnknownPokemonStruct2 /*0x1D*/ u8 language; }; -struct UnknownStruct11 -{ - u8 unk0; - u8 unk1; - u8 unk2; - u8 unk3; - u8 unk4; - u8 unk5_0:1; - u8 unk5_1:1; - u16 unk6; - u8 unk8[10]; - u8 unk12; - u8 unk13; - u8 unk14[10]; - u8 filler1E[2]; - u16 unk20; - u16 unk22; - u16 unk24; - u16 unk26; - u16 unk28; - u8 unk2A[10]; - u8 filler34[2]; - u8 unk36[10]; -}; - struct UnknownStruct12 { u32 unk0; @@ -217,7 +192,7 @@ extern u16 gUnknown_030042C0; extern u16 gUnknown_030042C4; extern MainCallback gUnknown_030042D0; extern void (*gUnknown_030042D4)(void); -extern struct UnknownStruct11 gUnknown_030042E0; +extern struct Struct30042E0 gUnknown_030042E0; extern u8 gUnknown_03004324; extern void (*gUnknown_03004330[])(void); extern u8 gUnknown_03004340[]; diff --git a/src/tv.c b/src/tv.c index 566d547a6..4ab5dbd33 100755 --- a/src/tv.c +++ b/src/tv.c @@ -29,7 +29,7 @@ struct UnkTvStruct s8 var0; }; -extern struct UnknownStruct11 gUnknown_030042E0; +extern struct Struct30042E0 gUnknown_030042E0; extern u8 gUnknown_0300430A[11]; struct OutbreakPokemon -- cgit v1.2.3 From 28f5eee3737942c9779b6943fac6c30160efa3b8 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 12 Jun 2017 20:37:47 -0400 Subject: Convert data/field_effect.s to C --- src/data/field_effect.c | 400 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 400 insertions(+) create mode 100755 src/data/field_effect.c (limited to 'src') diff --git a/src/data/field_effect.c b/src/data/field_effect.c new file mode 100755 index 000000000..4aae09667 --- /dev/null +++ b/src/data/field_effect.c @@ -0,0 +1,400 @@ +// +// Created by scott on 6/8/2017. +// + +#include "global.h" +#include "sprite.h" +#include "task.h" +#include "field_effect.h" + +#define subsprite_table(ptr) {.subsprites = ptr, .subspriteCount = (sizeof ptr) / (sizeof(struct Subsprite))} + +#define obj_frame_tiles(ptr) {.data = (u8 *)ptr, .size = sizeof ptr} + +const u32 gSpriteImage_839DC14[] = INCBIN_U32("graphics/birch_speech/birch.4bpp"); +const u16 gBirchPalette[16] = INCBIN_U16("graphics/birch_speech/birch.gbapal"); +const u32 gSpriteImage_839E434[] = INCBIN_U32("graphics/misc/pokeball_glow.4bpp"); +const u16 gFieldEffectObjectPalette4[16] = INCBIN_U16("graphics/field_effect_objects/palettes/04.gbapal"); +const u32 gSpriteImage_839E474[] = INCBIN_U32("graphics/misc/pokecenter_monitor/0.4bpp"); +const u32 gSpriteImage_839E534[] = INCBIN_U32("graphics/misc/pokecenter_monitor/1.4bpp"); +const u32 gSpriteImage_839E5F4[] = INCBIN_U32("graphics/misc/big_hof_monitor.4bpp"); +const u32 gSpriteImage_839E7F4[] = INCBIN_U32("graphics/misc/small_hof_monitor.4bpp"); +const u16 gFieldEffectObjectPalette5[16] = INCBIN_U16("graphics/field_effect_objects/palettes/05.gbapal"); + +// Graphics for the lights streaking past your Pokemon when it uses a field move. +const u32 gFieldMoveStreaksTiles[] = INCBIN_U32("graphics/misc/field_move_streaks.4bpp"); +const u16 gFieldMoveStreaksPalette[16] = INCBIN_U16("graphics/misc/field_move_streaks.gbapal"); +const u16 gFieldMoveStreaksTilemap[] = INCBIN_U16("graphics/misc/field_move_streaks_map.bin"); + +// The following light streaks effect is used when the map is dark (e.g. a cave). +const u32 gDarknessFieldMoveStreaksTiles[] = INCBIN_U32("graphics/misc/darkness_field_move_streaks.4bpp"); +const u16 gDarknessFieldMoveStreaksPalette[16] = INCBIN_U16("graphics/misc/darkness_field_move_streaks.gbapal"); +const u16 gDarknessFieldMoveStreaksTilemap[] = INCBIN_U16("graphics/misc/darkness_field_move_streaks_map.bin"); + +bool8 (*const gFieldEffectScriptFuncs[])(u8 **, u32 *) = { + FieldEffectCmd_loadtiles, + FieldEffectCmd_loadfadedpal, + FieldEffectCmd_loadpal, + FieldEffectCmd_callnative, + FieldEffectCmd_end, + FieldEffectCmd_loadgfx_callnative, + FieldEffectCmd_loadtiles_callnative, + FieldEffectCmd_loadfadedpal_callnative, +}; + +const struct OamData gOamData_839F0F4 = {.size = 3}; +const struct OamData gOamData_839F0FC = {.size = 0}; +const struct OamData gOamData_839F104 = {.size = 1}; + +const struct SpriteFrameImage gSpriteImageTable_839F10C[] = { + obj_frame_tiles(gSpriteImage_839DC14) +}; +const struct SpritePalette gUnknown_0839F114 = {.data = gBirchPalette, .tag = 0x1006}; + +const union AnimCmd gSpriteAnim_839F11C[] = { + ANIMCMD_FRAME(.imageValue = 0, .duration = 1), + ANIMCMD_END +}; + +const union AnimCmd *const gSpriteAnimTable_839F124[] = { + gSpriteAnim_839F11C +}; + +const struct SpriteTemplate gSpriteTemplate_839F128 = { + .tileTag = 0xffff, + .paletteTag = 4102, + .oam = &gOamData_839F0F4, + .anims = (const union AnimCmd *const *)&gSpriteAnimTable_839F124, + .images = gSpriteImageTable_839F10C, + .affineAnims = (const union AffineAnimCmd *const *)&gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy +}; + +const struct SpritePalette gFieldEffectObjectPaletteInfo4 = {.data = gFieldEffectObjectPalette4, .tag = 0x1007}; +const struct SpritePalette gFieldEffectObjectPaletteInfo5 = {.data = gFieldEffectObjectPalette5, .tag = 0x1010}; +const struct OamData gOamData_839F150 = { + .shape = 1, + .size = 2 +}; + +const struct SpriteFrameImage gSpriteImageTable_839F158[] = { + obj_frame_tiles(gSpriteImage_839E434) +}; + +const struct SpriteFrameImage gSpriteImageTable_839F160[] = { + obj_frame_tiles(gSpriteImage_839E474), + obj_frame_tiles(gSpriteImage_839E534) +}; + +const struct SpriteFrameImage gSpriteImageTable_839F170[] = { + obj_frame_tiles(gSpriteImage_839E5F4) +}; + +const struct SpriteFrameImage gSpriteImageTable_839F178[] = { + {.data = (u8 *)gSpriteImage_839E7F4, .size = 0x200} // the macro breaks down here +}; + +const struct Subsprite Unknown_39F180[] = { + {.x = -12, .y = -8, .priority = 2, .tileOffset = 0, .shape = 1, .size = 0}, + {.x = 4, .y = -8, .priority = 2, .tileOffset = 2, .shape = 0, .size = 0}, + {.x = -12, .y = 0, .priority = 2, .tileOffset = 3, .shape = 1, .size = 0}, + {.x = 4, .y = 0, .priority = 2, .tileOffset = 5, .shape = 0, .size = 0} +}; + +const struct SubspriteTable gUnknown_0839F1A0 = subsprite_table(Unknown_39F180); + +const struct Subsprite Unknown_39F1A8[] = { + {.x = -32, .y = -8, .priority = 2, .tileOffset = 0, .shape = 1, .size = 1}, + {.x = 0, .y = -8, .priority = 2, .tileOffset = 4, .shape = 1, .size = 1}, + {.x = -32, .y = 0, .priority = 2, .tileOffset = 8, .shape = 1, .size = 1}, + {.x = 0, .y = 0, .priority = 2, .tileOffset = 12, .shape = 1, .size = 1} +}; + +const struct SubspriteTable gUnknown_0839F1C8 = subsprite_table(Unknown_39F1A8); + +const union AnimCmd gSpriteAnim_839F1D0[] = { + ANIMCMD_FRAME(.imageValue = 0, .duration = 1), + ANIMCMD_JUMP(0) +}; + +const union AnimCmd gSpriteAnim_839F1D8[] = { + ANIMCMD_FRAME(.imageValue = 0, .duration = 16), + ANIMCMD_FRAME(.imageValue = 1, .duration = 16), + ANIMCMD_FRAME(.imageValue = 0, .duration = 16), + ANIMCMD_FRAME(.imageValue = 1, .duration = 16), + ANIMCMD_FRAME(.imageValue = 0, .duration = 16), + ANIMCMD_FRAME(.imageValue = 1, .duration = 16), + ANIMCMD_FRAME(.imageValue = 0, .duration = 16), + ANIMCMD_FRAME(.imageValue = 1, .duration = 16), + ANIMCMD_END +}; + +const union AnimCmd *const gSpriteAnimTable_839F1FC[] = { + gSpriteAnim_839F1D0, + gSpriteAnim_839F1D8 +}; + +const union AnimCmd *const gSpriteAnimTable_839F204[] = { + gSpriteAnim_839F1D0 +}; + +const struct SpriteTemplate gSpriteTemplate_839F208 = { + .tileTag = 0xffff, + .paletteTag = 4103, + .oam = &gOamData_839F0FC, + .anims = gSpriteAnimTable_839F1FC, + .images = gSpriteImageTable_839F158, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_PokeballGlow +}; + + +const struct SpriteTemplate gSpriteTemplate_839F220 = { + .tileTag = 0xffff, + .paletteTag = 4100, + .oam = &gOamData_839F104, + .anims = gSpriteAnimTable_839F1FC, + .images = gSpriteImageTable_839F160, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_PokecenterMonitor +}; + + +const struct SpriteTemplate gSpriteTemplate_839F238 = { + .tileTag = 0xffff, + .paletteTag = 4112, + .oam = &gOamData_839F104, + .anims = gSpriteAnimTable_839F204, + .images = gSpriteImageTable_839F170, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_HallOfFameMonitor +}; + + +const struct SpriteTemplate gSpriteTemplate_839F250 = { + .tileTag = 0xffff, + .paletteTag = 4112, + .oam = &gOamData_839F150, + .anims = gSpriteAnimTable_839F204, + .images = gSpriteImageTable_839F178, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_HallOfFameMonitor +}; + +void (*const gUnknown_0839F268[])(struct Task *) = { + PokecenterHealEffect_0, + PokecenterHealEffect_1, + PokecenterHealEffect_2, + PokecenterHealEffect_3 +}; + +void (*const gUnknown_0839F278[])(struct Task *) = { + HallOfFameRecordEffect_0, + HallOfFameRecordEffect_1, + HallOfFameRecordEffect_2, + HallOfFameRecordEffect_3 +}; + +void (*const gUnknown_0839F288[])(struct Sprite *) = { + PokeballGlowEffect_0, + PokeballGlowEffect_1, + PokeballGlowEffect_2, + PokeballGlowEffect_3, + PokeballGlowEffect_4, + PokeballGlowEffect_5, + PokeballGlowEffect_6, + PokeballGlowEffect_7 +}; + +const struct Coords16 gUnknown_0839F2A8[] = { + {.x = 0, .y = 0}, + {.x = 6, .y = 0}, + {.x = 0, .y = 4}, + {.x = 6, .y = 4}, + {.x = 0, .y = 8}, + {.x = 6, .y = 8} +}; + +const u8 gUnknown_0839F2C0[] = {16, 12, 8, 0}; +const u8 gUnknown_0839F2C4[] = {16, 12, 8, 0}; +const u8 gUnknown_0839F2C8[] = { 0, 0, 0, 0}; + +bool8 (*const gUnknown_0839F2CC[])(struct Task *) = { + sub_80867AC, + sub_8086854, + sub_8086870, + sub_80868E4, + sub_808699C, + sub_80869B8, + sub_80869F8 +}; + +bool8 (*const gUnknown_0839F2E8[])(struct Task *) = { + sub_8086AA0, + sub_8086AC0, + sub_8086B30, + sub_8086B54, + sub_8086B64, + sub_8086B88 +}; + +bool8 (*const gUnknown_0839F300[])(struct Task *) = { + sub_8086CF4, + sub_8086D70, + sub_8086DB0, + sub_8086E10, + sub_8086E50, + sub_8086EB0, + sub_8086ED4 +}; + +bool8 (*const gUnknown_0839F31C[])(struct Task *, struct MapObject *) = { + sub_8086FB0, + waterfall_1_do_anim_probably, + waterfall_2_wait_anim_finish_probably, + sub_8087030, + sub_8087058 +}; + +bool8 (*const gUnknown_0839F330[])(struct Task *) = { + sub_8087124, + dive_2_unknown, + dive_3_unknown +}; + +bool8 (*const gUnknown_0839F33C[])(struct Task *, struct MapObject *, struct Sprite *) = { + sub_808722C, + sub_8087264, + sub_8087298, + sub_80872E4, + sub_80873D8, + sub_80873F4 +}; + +bool8 (*const gUnknown_0839F354[])(struct Task *, struct MapObject *, struct Sprite *) = { + sub_80874CC, + sub_80874FC, + sub_8087548, + sub_808759C +}; + +bool8 (*const gUnknown_0839F364[])(struct Task *, struct MapObject *, struct Sprite *) = { + sub_80876C8, + sub_80876F8, + sub_8087774, + sub_80877AC, + sub_80877D4 +}; + +void (*const gUnknown_0839F378[])(struct Task *) = { + sub_80878F4, + 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 +}; -- cgit v1.2.3 From 80c0abef8c4eb5e839d559c905333e0cbd371103 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 12 Jun 2017 20:46:01 -0400 Subject: Update labels in decoration.h --- src/decoration.c | 90 +++++++++++++++++++++++++++---------------------------- src/secret_base.c | 2 -- 2 files changed, 45 insertions(+), 47 deletions(-) mode change 100644 => 100755 src/secret_base.c (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 3c33d9a0b..0ebeda765 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -684,7 +684,7 @@ void sub_80FF1EC(u16 mapX, u16 mapY, u8 decWidth, u8 decHeight, u16 decIdx) void sub_80FF394(u16 mapX, u16 mapY, u16 decIdx) { - switch (gDecorations[decIdx].decor_field_12) + switch (gDecorations[decIdx].shape) { case 0: sub_80FF1EC(mapX, mapY, 1, 1, decIdx); @@ -839,16 +839,16 @@ void AddDecorationIconObjectFromFieldObject(struct UnkStruct_02038900 * unk_0203 if (gDecorations[decoIdx].decor_field_11 != 4) { sub_81008BC(unk_02038900); - sub_8100930(unk_02038900->decoration->decor_field_12); + sub_8100930(unk_02038900->decoration->shape); sub_8100874(unk_02038900); sub_810070C(unk_02038900->unk_884, ((u16 *)gMapHeader.mapData->secondaryTileset->metatiles + 8 * unk_02038900->decoration->tiles[0])[7] >> 12); LoadSpritePalette(&gUnknown_083EC954); gUnknown_020391A8 = gSprites[gUnknown_03004880.unk4].data0; - gUnknown_03004880.unk4 = CreateSprite(&gSpriteTemplate_83EC93C, gUnknown_083EC900[unk_02038900->decoration->decor_field_12].unk_2, gUnknown_083EC900[unk_02038900->decoration->decor_field_12].unk_3, 0); + gUnknown_03004880.unk4 = CreateSprite(&gSpriteTemplate_83EC93C, gUnknown_083EC900[unk_02038900->decoration->shape].unk_2, gUnknown_083EC900[unk_02038900->decoration->shape].unk_3, 0); } else { gUnknown_020391A8 = gSprites[gUnknown_03004880.unk4].data0; - gUnknown_03004880.unk4 = AddPseudoFieldObject(unk_02038900->decoration->tiles[0], sub_81009A8, gUnknown_083EC900[unk_02038900->decoration->decor_field_12].unk_2, gUnknown_083EC900[unk_02038900->decoration->decor_field_12].unk_3, 1); + gUnknown_03004880.unk4 = AddPseudoFieldObject(unk_02038900->decoration->tiles[0], sub_81009A8, gUnknown_083EC900[unk_02038900->decoration->shape].unk_2, gUnknown_083EC900[unk_02038900->decoration->shape].unk_3, 1); gSprites[gUnknown_03004880.unk4].oam.priority = 1; } } @@ -856,8 +856,8 @@ void AddDecorationIconObjectFromFieldObject(struct UnkStruct_02038900 * unk_0203 void SetUpPlacingDecorationPlayerAvatar(u8 taskId, struct UnkStruct_02038900 *unk_02038900) { u8 v0; - v0 = 16 * (u8)gTasks[taskId].data[5] + gUnknown_083EC900[unk_02038900->decoration->decor_field_12].unk_2 - 8 * ((u8)gTasks[taskId].data[5] - 1); - if (unk_02038900->decoration->decor_field_12 == 2 || unk_02038900->decoration->decor_field_12 == 8 || unk_02038900->decoration->decor_field_12 == 9) + v0 = 16 * (u8)gTasks[taskId].data[5] + gUnknown_083EC900[unk_02038900->decoration->shape].unk_2 - 8 * ((u8)gTasks[taskId].data[5] - 1); + if (unk_02038900->decoration->shape == 2 || unk_02038900->decoration->shape == 8 || unk_02038900->decoration->shape == 9) { v0 -= 8; } @@ -875,7 +875,7 @@ void SetUpPlacingDecorationPlayerAvatar(u8 taskId, struct UnkStruct_02038900 *un void sub_80FF960(u8 taskId) { - switch (gDecorations[gUnknown_020388D0[gUnknown_020388F5]].decor_field_12) + switch (gDecorations[gUnknown_020388D0[gUnknown_020388F5]].shape) { case 0: gTasks[taskId].data[5] = 1; @@ -1080,7 +1080,7 @@ bool8 sub_80FFC24(u8 taskId, struct Decoration *decoration) { curX = gTasks[taskId].data[0] + j; behaviorAt = MapGridGetMetatileBehaviorAt(curX, curY); - if (decoration->decor_field_12 == 5) + if (decoration->shape == 5) { if (!sub_80572EC(behaviorAt)) { @@ -1973,7 +1973,7 @@ void sub_81008BC(struct UnkStruct_02038900 *unk_02038900) { u8 i; u8 idx; - idx = unk_02038900->decoration->decor_field_12; + idx = unk_02038900->decoration->shape; for (i=0; iunk_004[gUnknown_083EC860[idx].var0[i]] = sub_810089C(unk_02038900->decoration->tiles[gUnknown_083EC860[idx].var4[i]] * 8 + gUnknown_083EC860[idx].var8[i]); @@ -2101,11 +2101,11 @@ void sub_8100B6C(void) { if (ewram_1f000.items[gUnknown_020391B4[i].var00] == DECOR_SAND_ORNAMENT && MapGridGetMetatileIdAt(x + 7, y + 7) == 0x28c) { - gUnknown_020391B4[i].var02++; + gUnknown_020391B4[i].height++; } - for (j=0; jmap)[(x + k) + gMapHeader.mapData->width * (y - j)] | 0x3000); } @@ -2275,46 +2275,46 @@ void sub_81010F0(u8 taskId) void sub_8101118(u8 decorIdx, struct UnkStruct_020391B4 *unk_020391B4) { - if (gDecorations[decorIdx].decor_field_12 == 0) + if (gDecorations[decorIdx].shape == 0) { - unk_020391B4->var01 = 1; - unk_020391B4->var02 = 1; - } else if (gDecorations[decorIdx].decor_field_12 == 1) + unk_020391B4->width = 1; + unk_020391B4->height = 1; + } else if (gDecorations[decorIdx].shape == 1) { - unk_020391B4->var01 = 2; - unk_020391B4->var02 = 1; - } else if (gDecorations[decorIdx].decor_field_12 == 2) + unk_020391B4->width = 2; + unk_020391B4->height = 1; + } else if (gDecorations[decorIdx].shape == 2) { - unk_020391B4->var01 = 3; - unk_020391B4->var02 = 1; - } else if (gDecorations[decorIdx].decor_field_12 == 3) + unk_020391B4->width = 3; + unk_020391B4->height = 1; + } else if (gDecorations[decorIdx].shape == 3) { - unk_020391B4->var01 = 4; - unk_020391B4->var02 = 2; - } else if (gDecorations[decorIdx].decor_field_12 == 4) + unk_020391B4->width = 4; + unk_020391B4->height = 2; + } else if (gDecorations[decorIdx].shape == 4) { - unk_020391B4->var01 = 2; - unk_020391B4->var02 = 2; - } else if (gDecorations[decorIdx].decor_field_12 == 5) + unk_020391B4->width = 2; + unk_020391B4->height = 2; + } else if (gDecorations[decorIdx].shape == 5) { - unk_020391B4->var01 = 1; - unk_020391B4->var02 = 2; - } else if (gDecorations[decorIdx].decor_field_12 == 6) + unk_020391B4->width = 1; + unk_020391B4->height = 2; + } else if (gDecorations[decorIdx].shape == 6) { - unk_020391B4->var01 = 1; - unk_020391B4->var02 = 3; - } else if (gDecorations[decorIdx].decor_field_12 == 7) + unk_020391B4->width = 1; + unk_020391B4->height = 3; + } else if (gDecorations[decorIdx].shape == 7) { - unk_020391B4->var01 = 2; - unk_020391B4->var02 = 4; - } else if (gDecorations[decorIdx].decor_field_12 == 8) + unk_020391B4->width = 2; + unk_020391B4->height = 4; + } else if (gDecorations[decorIdx].shape == 8) { - unk_020391B4->var01 = 3; - unk_020391B4->var02 = 3; - } else if (gDecorations[decorIdx].decor_field_12 == 9) + unk_020391B4->width = 3; + unk_020391B4->height = 3; + } else if (gDecorations[decorIdx].shape == 9) { - unk_020391B4->var01 = 3; - unk_020391B4->var02 = 2; + unk_020391B4->width = 3; + unk_020391B4->height = 2; } } @@ -2338,11 +2338,11 @@ bool8 sub_8101200(u8 taskId, u8 decorIdx, struct UnkStruct_020391B4 *unk_020391B yOff = ewram_1f000.pos[decorIdx] & 0xf; if (ewram_1f000.items[decorIdx] == DECOR_SAND_ORNAMENT && MapGridGetMetatileIdAt(xOff + 7, yOff + 7) == 0x28c) { - unk_020391B4->var02--; + unk_020391B4->height--; } - if (x >= xOff && x < xOff + unk_020391B4->var01 && y > yOff - unk_020391B4->var02 && y <= yOff) + if (x >= xOff && x < xOff + unk_020391B4->width && y > yOff - unk_020391B4->height && y <= yOff) { - sub_8101198(unk_020391B4->var01 - (x - xOff + 1), yOff - y); + sub_8101198(unk_020391B4->width - (x - xOff + 1), yOff - y); return TRUE; } return FALSE; diff --git a/src/secret_base.c b/src/secret_base.c old mode 100644 new mode 100755 index c210a55d2..c074d6549 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -29,8 +29,6 @@ extern const struct u16 unk_083D1358_1; } gUnknown_083D1358[7]; extern const u8 gUnknown_083D1374[4 * 16]; -extern void *gUnknown_0300485C; -extern const u8 sub_807D770(void); extern const u8 gUnknown_083D13EC[12]; extern const u8 sub_80BCCA4(u8); extern u8 gUnknown_081A2E14[]; -- cgit v1.2.3 From 8f48da59b18f0d0431e8c64d369d3e82f96be191 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 12 Jun 2017 20:57:16 -0400 Subject: Merge field_effects data into src/field_effect.c --- src/data/field_effect.c | 400 -------------------------------------------- src/field_effect.c | 434 +++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 391 insertions(+), 443 deletions(-) delete mode 100755 src/data/field_effect.c (limited to 'src') diff --git a/src/data/field_effect.c b/src/data/field_effect.c deleted file mode 100755 index 4aae09667..000000000 --- a/src/data/field_effect.c +++ /dev/null @@ -1,400 +0,0 @@ -// -// Created by scott on 6/8/2017. -// - -#include "global.h" -#include "sprite.h" -#include "task.h" -#include "field_effect.h" - -#define subsprite_table(ptr) {.subsprites = ptr, .subspriteCount = (sizeof ptr) / (sizeof(struct Subsprite))} - -#define obj_frame_tiles(ptr) {.data = (u8 *)ptr, .size = sizeof ptr} - -const u32 gSpriteImage_839DC14[] = INCBIN_U32("graphics/birch_speech/birch.4bpp"); -const u16 gBirchPalette[16] = INCBIN_U16("graphics/birch_speech/birch.gbapal"); -const u32 gSpriteImage_839E434[] = INCBIN_U32("graphics/misc/pokeball_glow.4bpp"); -const u16 gFieldEffectObjectPalette4[16] = INCBIN_U16("graphics/field_effect_objects/palettes/04.gbapal"); -const u32 gSpriteImage_839E474[] = INCBIN_U32("graphics/misc/pokecenter_monitor/0.4bpp"); -const u32 gSpriteImage_839E534[] = INCBIN_U32("graphics/misc/pokecenter_monitor/1.4bpp"); -const u32 gSpriteImage_839E5F4[] = INCBIN_U32("graphics/misc/big_hof_monitor.4bpp"); -const u32 gSpriteImage_839E7F4[] = INCBIN_U32("graphics/misc/small_hof_monitor.4bpp"); -const u16 gFieldEffectObjectPalette5[16] = INCBIN_U16("graphics/field_effect_objects/palettes/05.gbapal"); - -// Graphics for the lights streaking past your Pokemon when it uses a field move. -const u32 gFieldMoveStreaksTiles[] = INCBIN_U32("graphics/misc/field_move_streaks.4bpp"); -const u16 gFieldMoveStreaksPalette[16] = INCBIN_U16("graphics/misc/field_move_streaks.gbapal"); -const u16 gFieldMoveStreaksTilemap[] = INCBIN_U16("graphics/misc/field_move_streaks_map.bin"); - -// The following light streaks effect is used when the map is dark (e.g. a cave). -const u32 gDarknessFieldMoveStreaksTiles[] = INCBIN_U32("graphics/misc/darkness_field_move_streaks.4bpp"); -const u16 gDarknessFieldMoveStreaksPalette[16] = INCBIN_U16("graphics/misc/darkness_field_move_streaks.gbapal"); -const u16 gDarknessFieldMoveStreaksTilemap[] = INCBIN_U16("graphics/misc/darkness_field_move_streaks_map.bin"); - -bool8 (*const gFieldEffectScriptFuncs[])(u8 **, u32 *) = { - FieldEffectCmd_loadtiles, - FieldEffectCmd_loadfadedpal, - FieldEffectCmd_loadpal, - FieldEffectCmd_callnative, - FieldEffectCmd_end, - FieldEffectCmd_loadgfx_callnative, - FieldEffectCmd_loadtiles_callnative, - FieldEffectCmd_loadfadedpal_callnative, -}; - -const struct OamData gOamData_839F0F4 = {.size = 3}; -const struct OamData gOamData_839F0FC = {.size = 0}; -const struct OamData gOamData_839F104 = {.size = 1}; - -const struct SpriteFrameImage gSpriteImageTable_839F10C[] = { - obj_frame_tiles(gSpriteImage_839DC14) -}; -const struct SpritePalette gUnknown_0839F114 = {.data = gBirchPalette, .tag = 0x1006}; - -const union AnimCmd gSpriteAnim_839F11C[] = { - ANIMCMD_FRAME(.imageValue = 0, .duration = 1), - ANIMCMD_END -}; - -const union AnimCmd *const gSpriteAnimTable_839F124[] = { - gSpriteAnim_839F11C -}; - -const struct SpriteTemplate gSpriteTemplate_839F128 = { - .tileTag = 0xffff, - .paletteTag = 4102, - .oam = &gOamData_839F0F4, - .anims = (const union AnimCmd *const *)&gSpriteAnimTable_839F124, - .images = gSpriteImageTable_839F10C, - .affineAnims = (const union AffineAnimCmd *const *)&gDummySpriteAffineAnimTable, - .callback = SpriteCallbackDummy -}; - -const struct SpritePalette gFieldEffectObjectPaletteInfo4 = {.data = gFieldEffectObjectPalette4, .tag = 0x1007}; -const struct SpritePalette gFieldEffectObjectPaletteInfo5 = {.data = gFieldEffectObjectPalette5, .tag = 0x1010}; -const struct OamData gOamData_839F150 = { - .shape = 1, - .size = 2 -}; - -const struct SpriteFrameImage gSpriteImageTable_839F158[] = { - obj_frame_tiles(gSpriteImage_839E434) -}; - -const struct SpriteFrameImage gSpriteImageTable_839F160[] = { - obj_frame_tiles(gSpriteImage_839E474), - obj_frame_tiles(gSpriteImage_839E534) -}; - -const struct SpriteFrameImage gSpriteImageTable_839F170[] = { - obj_frame_tiles(gSpriteImage_839E5F4) -}; - -const struct SpriteFrameImage gSpriteImageTable_839F178[] = { - {.data = (u8 *)gSpriteImage_839E7F4, .size = 0x200} // the macro breaks down here -}; - -const struct Subsprite Unknown_39F180[] = { - {.x = -12, .y = -8, .priority = 2, .tileOffset = 0, .shape = 1, .size = 0}, - {.x = 4, .y = -8, .priority = 2, .tileOffset = 2, .shape = 0, .size = 0}, - {.x = -12, .y = 0, .priority = 2, .tileOffset = 3, .shape = 1, .size = 0}, - {.x = 4, .y = 0, .priority = 2, .tileOffset = 5, .shape = 0, .size = 0} -}; - -const struct SubspriteTable gUnknown_0839F1A0 = subsprite_table(Unknown_39F180); - -const struct Subsprite Unknown_39F1A8[] = { - {.x = -32, .y = -8, .priority = 2, .tileOffset = 0, .shape = 1, .size = 1}, - {.x = 0, .y = -8, .priority = 2, .tileOffset = 4, .shape = 1, .size = 1}, - {.x = -32, .y = 0, .priority = 2, .tileOffset = 8, .shape = 1, .size = 1}, - {.x = 0, .y = 0, .priority = 2, .tileOffset = 12, .shape = 1, .size = 1} -}; - -const struct SubspriteTable gUnknown_0839F1C8 = subsprite_table(Unknown_39F1A8); - -const union AnimCmd gSpriteAnim_839F1D0[] = { - ANIMCMD_FRAME(.imageValue = 0, .duration = 1), - ANIMCMD_JUMP(0) -}; - -const union AnimCmd gSpriteAnim_839F1D8[] = { - ANIMCMD_FRAME(.imageValue = 0, .duration = 16), - ANIMCMD_FRAME(.imageValue = 1, .duration = 16), - ANIMCMD_FRAME(.imageValue = 0, .duration = 16), - ANIMCMD_FRAME(.imageValue = 1, .duration = 16), - ANIMCMD_FRAME(.imageValue = 0, .duration = 16), - ANIMCMD_FRAME(.imageValue = 1, .duration = 16), - ANIMCMD_FRAME(.imageValue = 0, .duration = 16), - ANIMCMD_FRAME(.imageValue = 1, .duration = 16), - ANIMCMD_END -}; - -const union AnimCmd *const gSpriteAnimTable_839F1FC[] = { - gSpriteAnim_839F1D0, - gSpriteAnim_839F1D8 -}; - -const union AnimCmd *const gSpriteAnimTable_839F204[] = { - gSpriteAnim_839F1D0 -}; - -const struct SpriteTemplate gSpriteTemplate_839F208 = { - .tileTag = 0xffff, - .paletteTag = 4103, - .oam = &gOamData_839F0FC, - .anims = gSpriteAnimTable_839F1FC, - .images = gSpriteImageTable_839F158, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = SpriteCB_PokeballGlow -}; - - -const struct SpriteTemplate gSpriteTemplate_839F220 = { - .tileTag = 0xffff, - .paletteTag = 4100, - .oam = &gOamData_839F104, - .anims = gSpriteAnimTable_839F1FC, - .images = gSpriteImageTable_839F160, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = SpriteCB_PokecenterMonitor -}; - - -const struct SpriteTemplate gSpriteTemplate_839F238 = { - .tileTag = 0xffff, - .paletteTag = 4112, - .oam = &gOamData_839F104, - .anims = gSpriteAnimTable_839F204, - .images = gSpriteImageTable_839F170, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = SpriteCB_HallOfFameMonitor -}; - - -const struct SpriteTemplate gSpriteTemplate_839F250 = { - .tileTag = 0xffff, - .paletteTag = 4112, - .oam = &gOamData_839F150, - .anims = gSpriteAnimTable_839F204, - .images = gSpriteImageTable_839F178, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = SpriteCB_HallOfFameMonitor -}; - -void (*const gUnknown_0839F268[])(struct Task *) = { - PokecenterHealEffect_0, - PokecenterHealEffect_1, - PokecenterHealEffect_2, - PokecenterHealEffect_3 -}; - -void (*const gUnknown_0839F278[])(struct Task *) = { - HallOfFameRecordEffect_0, - HallOfFameRecordEffect_1, - HallOfFameRecordEffect_2, - HallOfFameRecordEffect_3 -}; - -void (*const gUnknown_0839F288[])(struct Sprite *) = { - PokeballGlowEffect_0, - PokeballGlowEffect_1, - PokeballGlowEffect_2, - PokeballGlowEffect_3, - PokeballGlowEffect_4, - PokeballGlowEffect_5, - PokeballGlowEffect_6, - PokeballGlowEffect_7 -}; - -const struct Coords16 gUnknown_0839F2A8[] = { - {.x = 0, .y = 0}, - {.x = 6, .y = 0}, - {.x = 0, .y = 4}, - {.x = 6, .y = 4}, - {.x = 0, .y = 8}, - {.x = 6, .y = 8} -}; - -const u8 gUnknown_0839F2C0[] = {16, 12, 8, 0}; -const u8 gUnknown_0839F2C4[] = {16, 12, 8, 0}; -const u8 gUnknown_0839F2C8[] = { 0, 0, 0, 0}; - -bool8 (*const gUnknown_0839F2CC[])(struct Task *) = { - sub_80867AC, - sub_8086854, - sub_8086870, - sub_80868E4, - sub_808699C, - sub_80869B8, - sub_80869F8 -}; - -bool8 (*const gUnknown_0839F2E8[])(struct Task *) = { - sub_8086AA0, - sub_8086AC0, - sub_8086B30, - sub_8086B54, - sub_8086B64, - sub_8086B88 -}; - -bool8 (*const gUnknown_0839F300[])(struct Task *) = { - sub_8086CF4, - sub_8086D70, - sub_8086DB0, - sub_8086E10, - sub_8086E50, - sub_8086EB0, - sub_8086ED4 -}; - -bool8 (*const gUnknown_0839F31C[])(struct Task *, struct MapObject *) = { - sub_8086FB0, - waterfall_1_do_anim_probably, - waterfall_2_wait_anim_finish_probably, - sub_8087030, - sub_8087058 -}; - -bool8 (*const gUnknown_0839F330[])(struct Task *) = { - sub_8087124, - dive_2_unknown, - dive_3_unknown -}; - -bool8 (*const gUnknown_0839F33C[])(struct Task *, struct MapObject *, struct Sprite *) = { - sub_808722C, - sub_8087264, - sub_8087298, - sub_80872E4, - sub_80873D8, - sub_80873F4 -}; - -bool8 (*const gUnknown_0839F354[])(struct Task *, struct MapObject *, struct Sprite *) = { - sub_80874CC, - sub_80874FC, - sub_8087548, - sub_808759C -}; - -bool8 (*const gUnknown_0839F364[])(struct Task *, struct MapObject *, struct Sprite *) = { - sub_80876C8, - sub_80876F8, - sub_8087774, - sub_80877AC, - sub_80877D4 -}; - -void (*const gUnknown_0839F378[])(struct Task *) = { - sub_80878F4, - 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 -}; diff --git a/src/field_effect.c b/src/field_effect.c index 6cff8b864..8728155e1 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -22,14 +22,402 @@ #include "field_camera.h" #include "field_effect.h" -typedef bool8 (*FldEffCmd)(u8 **, u32 *); +#define subsprite_table(ptr) {.subsprites = ptr, .subspriteCount = (sizeof ptr) / (sizeof(struct Subsprite))} + +#define obj_frame_tiles(ptr) {.data = (u8 *)ptr, .size = sizeof ptr} + +const u32 gSpriteImage_839DC14[] = INCBIN_U32("graphics/birch_speech/birch.4bpp"); +const u16 gBirchPalette[16] = INCBIN_U16("graphics/birch_speech/birch.gbapal"); +const u32 gSpriteImage_839E434[] = INCBIN_U32("graphics/misc/pokeball_glow.4bpp"); +const u16 gFieldEffectObjectPalette4[16] = INCBIN_U16("graphics/field_effect_objects/palettes/04.gbapal"); +const u32 gSpriteImage_839E474[] = INCBIN_U32("graphics/misc/pokecenter_monitor/0.4bpp"); +const u32 gSpriteImage_839E534[] = INCBIN_U32("graphics/misc/pokecenter_monitor/1.4bpp"); +const u32 gSpriteImage_839E5F4[] = INCBIN_U32("graphics/misc/big_hof_monitor.4bpp"); +const u32 gSpriteImage_839E7F4[] = INCBIN_U32("graphics/misc/small_hof_monitor.4bpp"); +const u16 gFieldEffectObjectPalette5[16] = INCBIN_U16("graphics/field_effect_objects/palettes/05.gbapal"); + +// Graphics for the lights streaking past your Pokemon when it uses a field move. +const u32 gFieldMoveStreaksTiles[] = INCBIN_U32("graphics/misc/field_move_streaks.4bpp"); +const u16 gFieldMoveStreaksPalette[16] = INCBIN_U16("graphics/misc/field_move_streaks.gbapal"); +const u16 gFieldMoveStreaksTilemap[] = INCBIN_U16("graphics/misc/field_move_streaks_map.bin"); + +// The following light streaks effect is used when the map is dark (e.g. a cave). +const u32 gDarknessFieldMoveStreaksTiles[] = INCBIN_U32("graphics/misc/darkness_field_move_streaks.4bpp"); +const u16 gDarknessFieldMoveStreaksPalette[16] = INCBIN_U16("graphics/misc/darkness_field_move_streaks.gbapal"); +const u16 gDarknessFieldMoveStreaksTilemap[] = INCBIN_U16("graphics/misc/darkness_field_move_streaks_map.bin"); + +bool8 (*const gFieldEffectScriptFuncs[])(u8 **, u32 *) = { + FieldEffectCmd_loadtiles, + FieldEffectCmd_loadfadedpal, + FieldEffectCmd_loadpal, + FieldEffectCmd_callnative, + FieldEffectCmd_end, + FieldEffectCmd_loadgfx_callnative, + FieldEffectCmd_loadtiles_callnative, + FieldEffectCmd_loadfadedpal_callnative, +}; + +const struct OamData gOamData_839F0F4 = {.size = 3}; +const struct OamData gOamData_839F0FC = {.size = 0}; +const struct OamData gOamData_839F104 = {.size = 1}; + +const struct SpriteFrameImage gSpriteImageTable_839F10C[] = { + obj_frame_tiles(gSpriteImage_839DC14) +}; +const struct SpritePalette gUnknown_0839F114 = {.data = gBirchPalette, .tag = 0x1006}; + +const union AnimCmd gSpriteAnim_839F11C[] = { + ANIMCMD_FRAME(.imageValue = 0, .duration = 1), + ANIMCMD_END +}; + +const union AnimCmd *const gSpriteAnimTable_839F124[] = { + gSpriteAnim_839F11C +}; + +const struct SpriteTemplate gSpriteTemplate_839F128 = { + .tileTag = 0xffff, + .paletteTag = 4102, + .oam = &gOamData_839F0F4, + .anims = (const union AnimCmd *const *)&gSpriteAnimTable_839F124, + .images = gSpriteImageTable_839F10C, + .affineAnims = (const union AffineAnimCmd *const *)&gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy +}; + +const struct SpritePalette gFieldEffectObjectPaletteInfo4 = {.data = gFieldEffectObjectPalette4, .tag = 0x1007}; +const struct SpritePalette gFieldEffectObjectPaletteInfo5 = {.data = gFieldEffectObjectPalette5, .tag = 0x1010}; +const struct OamData gOamData_839F150 = { + .shape = 1, + .size = 2 +}; + +const struct SpriteFrameImage gSpriteImageTable_839F158[] = { + obj_frame_tiles(gSpriteImage_839E434) +}; + +const struct SpriteFrameImage gSpriteImageTable_839F160[] = { + obj_frame_tiles(gSpriteImage_839E474), + obj_frame_tiles(gSpriteImage_839E534) +}; + +const struct SpriteFrameImage gSpriteImageTable_839F170[] = { + obj_frame_tiles(gSpriteImage_839E5F4) +}; + +const struct SpriteFrameImage gSpriteImageTable_839F178[] = { + {.data = (u8 *)gSpriteImage_839E7F4, .size = 0x200} // the macro breaks down here +}; + +const struct Subsprite Unknown_39F180[] = { + {.x = -12, .y = -8, .priority = 2, .tileOffset = 0, .shape = 1, .size = 0}, + {.x = 4, .y = -8, .priority = 2, .tileOffset = 2, .shape = 0, .size = 0}, + {.x = -12, .y = 0, .priority = 2, .tileOffset = 3, .shape = 1, .size = 0}, + {.x = 4, .y = 0, .priority = 2, .tileOffset = 5, .shape = 0, .size = 0} +}; + +const struct SubspriteTable gUnknown_0839F1A0 = subsprite_table(Unknown_39F180); + +const struct Subsprite Unknown_39F1A8[] = { + {.x = -32, .y = -8, .priority = 2, .tileOffset = 0, .shape = 1, .size = 1}, + {.x = 0, .y = -8, .priority = 2, .tileOffset = 4, .shape = 1, .size = 1}, + {.x = -32, .y = 0, .priority = 2, .tileOffset = 8, .shape = 1, .size = 1}, + {.x = 0, .y = 0, .priority = 2, .tileOffset = 12, .shape = 1, .size = 1} +}; + +const struct SubspriteTable gUnknown_0839F1C8 = subsprite_table(Unknown_39F1A8); + +const union AnimCmd gSpriteAnim_839F1D0[] = { + ANIMCMD_FRAME(.imageValue = 0, .duration = 1), + ANIMCMD_JUMP(0) +}; + +const union AnimCmd gSpriteAnim_839F1D8[] = { + ANIMCMD_FRAME(.imageValue = 0, .duration = 16), + ANIMCMD_FRAME(.imageValue = 1, .duration = 16), + ANIMCMD_FRAME(.imageValue = 0, .duration = 16), + ANIMCMD_FRAME(.imageValue = 1, .duration = 16), + ANIMCMD_FRAME(.imageValue = 0, .duration = 16), + ANIMCMD_FRAME(.imageValue = 1, .duration = 16), + ANIMCMD_FRAME(.imageValue = 0, .duration = 16), + ANIMCMD_FRAME(.imageValue = 1, .duration = 16), + ANIMCMD_END +}; + +const union AnimCmd *const gSpriteAnimTable_839F1FC[] = { + gSpriteAnim_839F1D0, + gSpriteAnim_839F1D8 +}; + +const union AnimCmd *const gSpriteAnimTable_839F204[] = { + gSpriteAnim_839F1D0 +}; + +const struct SpriteTemplate gSpriteTemplate_839F208 = { + .tileTag = 0xffff, + .paletteTag = 4103, + .oam = &gOamData_839F0FC, + .anims = gSpriteAnimTable_839F1FC, + .images = gSpriteImageTable_839F158, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_PokeballGlow +}; + + +const struct SpriteTemplate gSpriteTemplate_839F220 = { + .tileTag = 0xffff, + .paletteTag = 4100, + .oam = &gOamData_839F104, + .anims = gSpriteAnimTable_839F1FC, + .images = gSpriteImageTable_839F160, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_PokecenterMonitor +}; + + +const struct SpriteTemplate gSpriteTemplate_839F238 = { + .tileTag = 0xffff, + .paletteTag = 4112, + .oam = &gOamData_839F104, + .anims = gSpriteAnimTable_839F204, + .images = gSpriteImageTable_839F170, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_HallOfFameMonitor +}; + + +const struct SpriteTemplate gSpriteTemplate_839F250 = { + .tileTag = 0xffff, + .paletteTag = 4112, + .oam = &gOamData_839F150, + .anims = gSpriteAnimTable_839F204, + .images = gSpriteImageTable_839F178, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_HallOfFameMonitor +}; + +void (*const gUnknown_0839F268[])(struct Task *) = { + PokecenterHealEffect_0, + PokecenterHealEffect_1, + PokecenterHealEffect_2, + PokecenterHealEffect_3 +}; + +void (*const gUnknown_0839F278[])(struct Task *) = { + HallOfFameRecordEffect_0, + HallOfFameRecordEffect_1, + HallOfFameRecordEffect_2, + HallOfFameRecordEffect_3 +}; + +void (*const gUnknown_0839F288[])(struct Sprite *) = { + PokeballGlowEffect_0, + PokeballGlowEffect_1, + PokeballGlowEffect_2, + PokeballGlowEffect_3, + PokeballGlowEffect_4, + PokeballGlowEffect_5, + PokeballGlowEffect_6, + PokeballGlowEffect_7 +}; + +const struct Coords16 gUnknown_0839F2A8[] = { + {.x = 0, .y = 0}, + {.x = 6, .y = 0}, + {.x = 0, .y = 4}, + {.x = 6, .y = 4}, + {.x = 0, .y = 8}, + {.x = 6, .y = 8} +}; + +const u8 gUnknown_0839F2C0[] = {16, 12, 8, 0}; +const u8 gUnknown_0839F2C4[] = {16, 12, 8, 0}; +const u8 gUnknown_0839F2C8[] = { 0, 0, 0, 0}; + +bool8 (*const gUnknown_0839F2CC[])(struct Task *) = { + sub_80867AC, + sub_8086854, + sub_8086870, + sub_80868E4, + sub_808699C, + sub_80869B8, + sub_80869F8 +}; + +bool8 (*const gUnknown_0839F2E8[])(struct Task *) = { + sub_8086AA0, + sub_8086AC0, + sub_8086B30, + sub_8086B54, + sub_8086B64, + sub_8086B88 +}; + +bool8 (*const gUnknown_0839F300[])(struct Task *) = { + sub_8086CF4, + sub_8086D70, + sub_8086DB0, + sub_8086E10, + sub_8086E50, + sub_8086EB0, + sub_8086ED4 +}; + +bool8 (*const gUnknown_0839F31C[])(struct Task *, struct MapObject *) = { + sub_8086FB0, + waterfall_1_do_anim_probably, + waterfall_2_wait_anim_finish_probably, + sub_8087030, + sub_8087058 +}; + +bool8 (*const gUnknown_0839F330[])(struct Task *) = { + sub_8087124, + dive_2_unknown, + dive_3_unknown +}; + +bool8 (*const gUnknown_0839F33C[])(struct Task *, struct MapObject *, struct Sprite *) = { + sub_808722C, + sub_8087264, + sub_8087298, + sub_80872E4, + sub_80873D8, + sub_80873F4 +}; + +bool8 (*const gUnknown_0839F354[])(struct Task *, struct MapObject *, struct Sprite *) = { + sub_80874CC, + sub_80874FC, + sub_8087548, + sub_808759C +}; + +bool8 (*const gUnknown_0839F364[])(struct Task *, struct MapObject *, struct Sprite *) = { + sub_80876C8, + sub_80876F8, + sub_8087774, + sub_80877AC, + sub_80877D4 +}; + +void (*const gUnknown_0839F378[])(struct Task *) = { + sub_80878F4, + 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[]; -extern FldEffCmd gFieldEffectScriptFuncs[]; - u32 FieldEffectStart(u8 id) { u8 *script; @@ -460,7 +848,6 @@ void MultiplyPaletteRGBComponents(u16 i, u8 r, u8 g, u8 b) #endif void Task_PokecenterHeal(u8 taskId); -extern const void (*gUnknown_0839F268[4])(struct Task *); u8 CreatePokeballGlowSprite(s16, s16, s16, u16); u8 PokecenterHealEffectHelper(s16, s16); @@ -521,7 +908,6 @@ void PokecenterHealEffect_3(struct Task *task) } void Task_HallOfFameRecord(u8 taskId); -extern const void (*gUnknown_0839F278[4])(struct Task *); void HallOfFameRecordEffectHelper(s16, s16, s16, u8); bool8 FldEff_HallOfFameRecord(void) @@ -585,14 +971,6 @@ void HallOfFameRecordEffect_3(struct Task *task) } void SpriteCB_PokeballGlowEffect(struct Sprite *); -extern const void (*gUnknown_0839F288[8])(struct Sprite *); -extern const struct SpriteTemplate gSpriteTemplate_839F208; -extern const struct SpriteTemplate gSpriteTemplate_839F220; -extern const struct SpriteTemplate gSpriteTemplate_839F238; -extern const struct SpriteTemplate gSpriteTemplate_839F250; -extern const struct SubspriteTable gUnknown_0839F1A0; -extern const struct SubspriteTable gUnknown_0839F1C8; -extern const struct Coords16 gUnknown_0839F2A8[6]; u8 CreatePokeballGlowSprite(s16 data6, s16 x, s16 y, u16 data5) { @@ -633,10 +1011,6 @@ void PokeballGlowEffect_0(struct Sprite *sprite) } } -extern const u8 gUnknown_0839F2C0[4]; // red -extern const u8 gUnknown_0839F2C4[4]; // green -extern const u8 gUnknown_0839F2C8[4]; // blue - void PokeballGlowEffect_1(struct Sprite *sprite) { if ((--sprite->data1) == 0) @@ -881,7 +1255,6 @@ void c3_080843F8(u8 taskId) extern void pal_fill_for_map_transition(void); void sub_8086774(u8); -extern const bool8 (*gUnknown_0839F2CC[7])(struct Task *); extern void CameraObjectReset2(void); extern void CameraObjectReset1(void); @@ -1015,8 +1388,6 @@ bool8 sub_80869F8(struct Task *task) } void sub_8086A68(u8); -extern const bool8 (*gUnknown_0839F2E8[6])(struct Task *); -extern const bool8 (*gUnknown_0839F300[7])(struct Task *); extern void sub_80B4824(u8); extern void sub_8053FF8(void); extern void fade_8080918(void); @@ -1285,7 +1656,6 @@ bool8 sub_8086ED4(struct Task *task) } void sub_8086F64(u8); -extern const bool8 (*gUnknown_0839F31C[5])(struct Task *, struct MapObject *); bool8 FldEff_UseWaterfall(void) { @@ -1358,7 +1728,6 @@ bool8 sub_8087058(struct Task *task, struct MapObject *mapObject) } void Task_Dive(u8); -extern const bool8 (*gUnknown_0839F330[3])(struct Task *); extern int dive_warp(struct MapPosition *, u16); bool8 FldEff_UseDive(void) @@ -1406,7 +1775,6 @@ bool8 dive_3_unknown(struct Task *task) } void sub_80871D0(u8); -extern const bool8 (*gUnknown_0839F33C[6])(struct Task *, struct MapObject *, struct Sprite *); void mapldr_080851BC(void); void sub_80871B8(u8 priority) @@ -1522,7 +1890,6 @@ bool8 sub_80873F4(struct Task *task, struct MapObject *mapObject, struct Sprite } void sub_8087470(u8); -extern const bool8 (*gUnknown_0839F354[4])(struct Task *, struct MapObject *, struct Sprite *); extern u8 sub_80608A4(u8); void mapldr_080851BC(void) @@ -1611,7 +1978,6 @@ void sub_8087638(struct Sprite *sprite) } void sub_808766C(u8); -extern const bool8 (*gUnknown_0839F364[5])(struct Task *, struct MapObject *, struct Sprite *); void sub_8087654(u8 priority) { @@ -1677,8 +2043,6 @@ bool8 sub_80877AC(struct Task *task, struct MapObject *mapObject, struct Sprite } void sub_80878C4(u8); -extern u8 gUnknown_0839F380[5]; -extern const void (*gUnknown_0839F378[2])(struct Task *); void mapldr_080859D4(void); bool8 sub_80877D4(struct Task *task, struct MapObject *mapObject, struct Sprite *sprite) @@ -1764,7 +2128,6 @@ void sub_8087914(struct Task *task) } void sub_8087A74(u8); -extern const void (*gUnknown_0839F388[2])(struct Task *); void mapldr_080859D4(void) { @@ -1822,7 +2185,6 @@ void sub_8087AC8(struct Task *task) } void sub_8087BBC(u8); -extern const void (*gUnknown_0839F390[4])(struct Task *); void mapldr_08085D88(void); void sub_8087BA8(void) @@ -1910,7 +2272,6 @@ void sub_8087D78(struct Task *task) } void sub_8087E1C(u8); -extern const void (*gUnknown_0839F3A0[3])(struct Task *); void mapldr_08085D88(void) { @@ -2013,14 +2374,6 @@ void sub_8087FDC(struct Task *task) void sub_8088120(u8); void sub_808847C(u8); u8 sub_8088830(u32, u32, u32); -extern const void (*gUnknown_0839F3AC[7])(struct Task *); -extern const void (*gUnknown_0839F3C8[7])(struct Task *); -extern const u32 gFieldMoveStreaksTiles[0x200]; -extern const u16 gFieldMoveStreaksPalette[16]; -extern const u16 gFieldMoveStreaksTilemap[10 * 32]; -extern const u32 gDarknessFieldMoveStreaksTiles[0x80]; -extern const u16 gDarknessFieldMoveStreaksPalette[16]; -extern const u16 gDarknessFieldMoveStreaksTilemap[10 * 32]; void sub_80883DC(void); void sub_808843C(u16); void sub_8088890(struct Sprite *); @@ -2517,7 +2870,6 @@ void sub_80888F0(struct Sprite *sprite) } void sub_8088954(u8); -extern const void (*gUnknown_0839F3E4[5])(struct Task *); u8 FldEff_UseSurf(void) { @@ -2641,7 +2993,6 @@ void sub_8088BC4(struct Sprite *sprite) } void sub_8088C70(u8); -extern const void (*gUnknown_0839F3F8[9])(struct Task *); extern void sub_8127EFC(u8, u8); u8 sub_8088F60(void); bool8 sub_8088FA4(u8); @@ -2649,7 +3000,6 @@ void sub_8088FC0(u8); void sub_8088FFC(u8, u8); void sub_8089018(struct Sprite *); void sub_80890D8(struct Sprite *); -extern const union AffineAnimCmd *gSpriteAffineAnimTable_0839F44C[]; u8 FldEff_UseFly(void) { @@ -2922,8 +3272,6 @@ void sub_8089230(u8 spriteId) } void sub_8089270(u8); -extern const void (*gUnknown_0839F454[7])(struct Task *); -extern const s16 gUnknown_0839F470[18]; u8 FldEff_FlyIn(void) { -- cgit v1.2.3 From 32f6422d2fc5ba5153869316ced65cd2f4370d9d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 12 Jun 2017 22:51:53 -0400 Subject: Convert data/decorations.inc to C --- src/decoration.c | 1362 +++++++++++++++++++++++++++++++++++++++++++++++++++++- src/menu.c | 2 +- src/scrcmd.c | 1 - 3 files changed, 1360 insertions(+), 5 deletions(-) mode change 100644 => 100755 src/menu.c mode change 100644 => 100755 src/scrcmd.c (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index d61d72baa..5d6c835ff 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -1,5 +1,6 @@ #include "global.h" #include "asm.h" +#include "map_object_constants.h" #include "rom4.h" #include "sound.h" #include "songs.h" @@ -17,7 +18,1362 @@ #include "field_weather.h" #include "decoration.h" -extern Script gUnknown_0815F399; +#define DECORATION(_id, _name, _decor_field_11, _shape, _decor_field_13, _price, _description, _tiles) {\ +.id = _id,\ +.name = _name,\ +.decor_field_11 = _decor_field_11,\ +.shape = _shape,\ +.decor_field_13 = _decor_field_13,\ +.price = _price,\ +.description = _description,\ +.tiles = _tiles\ +} + +const u8 DecorDesc_SMALL_DESK[] = _( + "A small desk built\n" + "for one."); + +const u8 DecorDesc_POKEMON_DESK[] = _( + "A small desk built in\n" + "the shape of a POKé\n" + "BALL."); + +const u8 DecorDesc_HEAVY_DESK[] = _( + "A large desk made\n" + "of steel. Put some\n" + "decorations on it."); + +const u8 DecorDesc_RAGGED_DESK[] = _( + "A large desk made\n" + "of wood. Put some\n" + "decorations on it."); + +const u8 DecorDesc_COMFORT_DESK[] = _( + "A large desk made\n" + "of leaves. Put some\n" + "decorations on it."); + +const u8 DecorDesc_PRETTY_DESK[] = _( + "A huge desk made\n" + "of glass. Holds lots\n" + "of decorations."); + +const u8 DecorDesc_BRICK_DESK[] = _( + "A huge desk made\n" + "of brick. Holds lots\n" + "of decorations."); + +const u8 DecorDesc_CAMP_DESK[] = _( + "A huge desk made\n" + "of logs. Put lots of\n" + "decorations on it."); + +const u8 DecorDesc_HARD_DESK[] = _( + "A huge desk made\n" + "of rocks. Holds\n" + "many decorations."); + +const u8 DecorDesc_SMALL_CHAIR[] = _( + "A small chair made\n" + "for one."); + +const u8 DecorDesc_POKEMON_CHAIR[] = _( + "A small chair built\n" + "in the shape of a\n" + "POKé BALL."); + +const u8 DecorDesc_HEAVY_CHAIR[] = _( + "A small chair made\n" + "of steel."); + +const u8 DecorDesc_PRETTY_CHAIR[] = _( + "A small chair made\n" + "of glass."); + +const u8 DecorDesc_COMFORT_CHAIR[] = _( + "A small chair made\n" + "of leaves."); + +const u8 DecorDesc_RAGGED_CHAIR[] = _( + "A small chair made\n" + "of wood."); + +const u8 DecorDesc_BRICK_CHAIR[] = _( + "A small chair made\n" + "of brick."); + +const u8 DecorDesc_CAMP_CHAIR[] = _( + "A small chair made\n" + "of logs."); + +const u8 DecorDesc_HARD_CHAIR[] = _( + "A small chair made\n" + "of rock."); + +const u8 DecorDesc_RED_PLANT[] = _( + "A vivid red potted\n" + "plant."); + +const u8 DecorDesc_TROPICAL_PLANT[] = _( + "A flowering tropical\n" + "plant in a pot."); + +const u8 DecorDesc_PRETTY_FLOWERS[] = _( + "A pot of cute\n" + "flowers."); + +const u8 DecorDesc_COLORFUL_PLANT[] = _( + "A large pot with\n" + "many colorful\n" + "flowers."); + +const u8 DecorDesc_BIG_PLANT[] = _( + "A large, umbrella-\n" + "shaped plant in a\n" + "big pot."); + +const u8 DecorDesc_GORGEOUS_PLANT[] = _( + "A large, impressive\n" + "plant in a big pot."); + +const u8 DecorDesc_RED_BRICK[] = _( + "A red-colored brick.\n" + "Decorations can be\n" + "placed on top."); + +const u8 DecorDesc_YELLOW_BRICK[] = _( + "A yellow-colored\n" + "brick. Put some\n" + "decorations on top."); + +const u8 DecorDesc_BLUE_BRICK[] = _( + "A blue-colored\n" + "brick. Put some\n" + "decorations on top."); + +const u8 DecorDesc_RED_BALLOON[] = _( + "A red balloon filled\n" + "with water. Bursts\n" + "if stepped on."); + +const u8 DecorDesc_BLUE_BALLOON[] = _( + "A blue balloon filled\n" + "with water. Bursts\n" + "if stepped on."); + +const u8 DecorDesc_YELLOW_BALLOON[] = _( + "A yellow balloon\n" + "filled with water.\n" + "Pops if stepped on."); + +const u8 DecorDesc_RED_TENT[] = _( + "A large red tent.\n" + "You can hide inside\n" + "it."); + +const u8 DecorDesc_BLUE_TENT[] = _( + "A large blue tent.\n" + "You can hide inside\n" + "it."); + +const u8 DecorDesc_SOLID_BOARD[] = _( + "Place over a hole to\n" + "cross to the other\n" + "side."); + +const u8 DecorDesc_SLIDE[] = _( + "Use to slide down\n" + "from the platform."); + +const u8 DecorDesc_FENCE_LENGTH[] = _( + "A small fence that\n" + "blocks passage."); + +const u8 DecorDesc_FENCE_WIDTH[] = _( + "A small fence that\n" + "blocks passage."); + +const u8 DecorDesc_TIRE[] = _( + "An old large tire.\n" + "Decorations can be\n" + "placed on top."); + +const u8 DecorDesc_STAND[] = _( + "A large pedestal\n" + "with steps."); + +const u8 DecorDesc_MUD_BALL[] = _( + "A large ball of mud.\n" + "Crumbles if stepped\n" + "on."); + +const u8 DecorDesc_BREAKABLE_DOOR[] = _( + "A weird door that\n" + "people can walk\n" + "right through."); + +const u8 DecorDesc_SAND_ORNAMENT[] = _( + "An ornament made\n" + "of sand. Crumbles if\n" + "touched."); + +const u8 DecorDesc_SILVER_SHIELD[] = _( + "Awarded for 50\n" + "straight wins at\n" + "the BATTLE TOWER."); + +const u8 DecorDesc_GOLD_SHIELD[] = _( + "Awarded for 100\n" + "straight wins at\n" + "the BATTLE TOWER."); + +const u8 DecorDesc_GLASS_ORNAMENT[] = _( + "A glass replica of\n" + "a famous sculpture\n" + "at the ART MUSEUM."); + +const u8 DecorDesc_TV[] = _( + "A small, gray-\n" + "colored toy TV."); + +const u8 DecorDesc_ROUND_TV[] = _( + "A toy TV modeled\n" + "in the image of a\n" + "SEEDOT."); + +const u8 DecorDesc_CUTE_TV[] = _( + "A toy TV modeled\n" + "in the image of a\n" + "SKITTY."); + +const u8 DecorDesc_GLITTER_MAT[] = _( + "An odd mat that\n" + "glitters if stepped\n" + "on."); + +const u8 DecorDesc_JUMP_MAT[] = _( + "A trick mat that\n" + "jumps when it is\n" + "stepped on."); + +const u8 DecorDesc_SPIN_MAT[] = _( + "A trick mat that\n" + "spins around when\n" + "stepped on."); + +const u8 DecorDesc_C_LOW_NOTE_MAT[] = _( + "A mat that plays\n" + "a low C note when\n" + "stepped on."); + +const u8 DecorDesc_D_NOTE_MAT[] = _( + "A mat that plays\n" + "a D note when\n" + "stepped on."); + +const u8 DecorDesc_E_NOTE_MAT[] = _( + "A mat that plays\n" + "an E note when\n" + "stepped on."); + +const u8 DecorDesc_F_NOTE_MAT[] = _( + "A mat that plays\n" + "an F note when\n" + "stepped on."); + +const u8 DecorDesc_G_NOTE_MAT[] = _( + "A mat that plays\n" + "a G note when\n" + "stepped on."); + +const u8 DecorDesc_A_NOTE_MAT[] = _( + "A mat that plays\n" + "an A note when\n" + "stepped on."); + +const u8 DecorDesc_B_NOTE_MAT[] = _( + "A mat that plays\n" + "a B note when\n" + "stepped on."); + +const u8 DecorDesc_C_HIGH_NOTE_MAT[] = _( + "A mat that plays\n" + "a high C note when\n" + "stepped on."); + +const u8 DecorDesc_SURF_MAT[] = _( + "A mat designed with\n" + "a SURF image.\n" + "Put items on top."); + +const u8 DecorDesc_THUNDER_MAT[] = _( + "A mat designed with\n" + "a THUNDER image.\n" + "Put items on top."); + +const u8 DecorDesc_FIRE_BLAST_MAT[] = _( + "A mat designed with\n" + "a FIRE BLAST image.\n" + "Put items on top."); + +const u8 DecorDesc_POWDER_SNOW_MAT[] = _( + "A mat with a POWDER\n" + "SNOW image design.\n" + "Put items on top."); + +const u8 DecorDesc_ATTRACT_MAT[] = _( + "A mat designed with\n" + "an ATTRACT image.\n" + "Put items on top."); + +const u8 DecorDesc_FISSURE_MAT[] = _( + "A mat designed with\n" + "a FISSURE image.\n" + "Put items on top."); + +const u8 DecorDesc_SPIKES_MAT[] = _( + "A mat designed with\n" + "a SPIKES image.\n" + "Put items on top."); + +const u8 DecorDesc_BALL_POSTER[] = _( + "A small poster\n" + "printed with POKé\n" + "BALLS."); + +const u8 DecorDesc_GREEN_POSTER[] = _( + "A small poster with\n" + "a TREECKO print."); + +const u8 DecorDesc_RED_POSTER[] = _( + "A small poster with\n" + "a TORCHIC print."); + +const u8 DecorDesc_BLUE_POSTER[] = _( + "A small poster with\n" + "a MUDKIP print."); + +const u8 DecorDesc_CUTE_POSTER[] = _( + "A small poster with\n" + "an AZURILL print."); + +const u8 DecorDesc_PIKA_POSTER[] = _( + "A large poster with\n" + "a PIKACHU and\n" + "PICHU print."); + +const u8 DecorDesc_LONG_POSTER[] = _( + "A large poster with\n" + "a SEVIPER print."); + +const u8 DecorDesc_SEA_POSTER[] = _( + "A large poster with\n" + "a RELICANTH print."); + +const u8 DecorDesc_SKY_POSTER[] = _( + "A large poster with\n" + "a WINGULL print."); + +const u8 DecorDesc_KISS_POSTER[] = _( + "A large poster with\n" + "a SMOOCHUM print."); + +const u8 DecorDesc_PICHU_DOLL[] = _( + "A PICHU doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_PIKACHU_DOLL[] = _( + "A PIKACHU doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_MARILL_DOLL[] = _( + "A MARILL doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_TOGEPI_DOLL[] = _( +#if REVISION >= 1 + "A TOGEPI doll.\n" +#else + "A TOPGEPI doll.\n" +#endif + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_CYNDAQUIL_DOLL[] = _( + "A CYNDAQUIL doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_CHIKORITA_DOLL[] = _( + "A CHIKORITA doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_TOTODILE_DOLL[] = _( + "A TOTODILE doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_JIGGLYPUFF_DOLL[] = _( + "A JIGGLYPUFF doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_MEOWTH_DOLL[] = _( + "A MEOWTH doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_CLEFAIRY_DOLL[] = _( + "A CLEFAIRY doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_DITTO_DOLL[] = _( + "A DITTO doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_SMOOCHUM_DOLL[] = _( + "A SMOOCHUM doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_TREECKO_DOLL[] = _( + "A TREECKO doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_TORCHIC_DOLL[] = _( + "A TORCHIC doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_MUDKIP_DOLL[] = _( + "A MUDKIP doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_DUSKULL_DOLL[] = _( + "A DUSKULL doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_WYNAUT_DOLL[] = _( + "A WYNAUT doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_BALTOY_DOLL[] = _( + "A BALTOY doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_KECLEON_DOLL[] = _( + "A KECLEON doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_AZURILL_DOLL[] = _( + "An AZURILL doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_SKITTY_DOLL[] = _( + "A SKITTY doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_SWABLU_DOLL[] = _( + "A SWABLU doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_GULPIN_DOLL[] = _( + "A GULPIN doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_LOTAD_DOLL[] = _( + "A LOTAD doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_SEEDOT_DOLL[] = _( + "A SEEDOT doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_PIKA_CUSHION[] = _( + "A PIKACHU cushion.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_ROUND_CUSHION[] = _( + "A MARILL cushion.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_KISS_CUSHION[] = _( + "A SMOOCHUM\n" + "cushion. Place it on\n" + "a mat or a desk."); + +const u8 DecorDesc_ZIGZAG_CUSHION[] = _( + "A ZIGZAGOON\n" + "cushion. Place it on\n" + "a mat or a desk."); + +const u8 DecorDesc_SPIN_CUSHION[] = _( + "A SPINDA cushion.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_DIAMOND_CUSHION[] = _( + "A SABLEYE cushion.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_BALL_CUSHION[] = _( + "A BALL cushion.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_GRASS_CUSHION[] = _( + "A grass-mark\n" + "cushion. Place it on\n" + "a mat or a desk."); + +const u8 DecorDesc_FIRE_CUSHION[] = _( + "A fire-mark\n" + "cushion. Place it on\n" + "a mat or a desk."); + +const u8 DecorDesc_WATER_CUSHION[] = _( + "A water-mark\n" + "cushion. Place it on\n" + "a mat or a desk."); + +const u8 DecorDesc_SNORLAX_DOLL[] = _( + "A large doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_RHYDON_DOLL[] = _( + "A large doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_LAPRAS_DOLL[] = _( + "A large doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_VENUSAUR_DOLL[] = _( + "A large doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_CHARIZARD_DOLL[] = _( + "A large doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_BLASTOISE_DOLL[] = _( + "A large doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_WAILMER_DOLL[] = _( + "A large doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_REGIROCK_DOLL[] = _( + "A large doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_REGICE_DOLL[] = _( + "A large doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u8 DecorDesc_REGISTEEL_DOLL[] = _( + "A large doll.\n" + "Place it on a mat\n" + "or a desk."); + +const u16 DecorGfx_SMALL_DESK[] = { + 0x87 +}; + +const u16 DecorGfx_POKEMON_DESK[] = { + 0x8F +}; + +const u16 DecorGfx_HEAVY_DESK[] = { + 0x90, + 0x91, + 0x92, + 0x98, + 0x99, + 0x9A +}; + +const u16 DecorGfx_RAGGED_DESK[] = { + 0x93, + 0x94, + 0x95, + 0x9B, + 0x9C, + 0x9D +}; + +const u16 DecorGfx_COMFORT_DESK[] = { + 0x96, + 0x97, + 0xA3, + 0x9E, + 0x9F, + 0xAB +}; + +const u16 DecorGfx_PRETTY_DESK[] = { + 0xBD, + 0xBE, + 0xBF, + 0xC5, + 0xC6, + 0xC7, + 0xCD, + 0xCE, + 0xCF +}; + +const u16 DecorGfx_BRICK_DESK[] = { + 0xA0, + 0xA1, + 0xA2, + 0xA8, + 0xA9, + 0xAA, + 0xB0, + 0xB1, + 0xB2 +}; + +const u16 DecorGfx_CAMP_DESK[] = { + 0xA4, + 0xA5, + 0xA6, + 0xAC, + 0xAD, + 0xAE, + 0xB4, + 0xB5, + 0xB6 +}; + +const u16 DecorGfx_HARD_DESK[] = { + 0xA7, + 0xBB, + 0xBC, + 0xAF, + 0xC3, + 0xC4, + 0xB7, + 0xCB, + 0xCC +}; + +const u16 DecorGfx_SMALL_CHAIR[] = { + 0xB8 +}; + +const u16 DecorGfx_POKEMON_CHAIR[] = { + 0xB9 +}; + +const u16 DecorGfx_HEAVY_CHAIR[] = { + 0xBA +}; + +const u16 DecorGfx_PRETTY_CHAIR[] = { + 0xC0 +}; + +const u16 DecorGfx_COMFORT_CHAIR[] = { + 0xC1 +}; + +const u16 DecorGfx_RAGGED_CHAIR[] = { + 0xC2 +}; + +const u16 DecorGfx_BRICK_CHAIR[] = { + 0xC8 +}; + +const u16 DecorGfx_CAMP_CHAIR[] = { + 0xC9 +}; + +const u16 DecorGfx_HARD_CHAIR[] = { + 0xCA +}; + +const u16 DecorGfx_RED_PLANT[] = { + 0xD0, + 0xD8 +}; + +const u16 DecorGfx_TROPICAL_PLANT[] = { + 0xD2, + 0xDA +}; + +const u16 DecorGfx_PRETTY_FLOWERS[] = { + 0xD4, + 0xDC +}; + +const u16 DecorGfx_COLORFUL_PLANT[] = { + 0xE0, + 0xE2, + 0xE8, + 0xE9 +}; + +const u16 DecorGfx_BIG_PLANT[] = { + 0xE4, + 0xE6, + 0xEC, + 0xED +}; + +const u16 DecorGfx_GORGEOUS_PLANT[] = { + 0xF0, + 0xF2, + 0xF8, + 0xF9 +}; + +const u16 DecorGfx_RED_BRICK[] = { + 0x25, + 0x2D +}; + +const u16 DecorGfx_YELLOW_BRICK[] = { + 0x26, + 0x2E +}; + +const u16 DecorGfx_BLUE_BRICK[] = { + 0x27, + 0x2F +}; + +const u16 DecorGfx_RED_BALLOON[] = { + 0x138 +}; + +const u16 DecorGfx_BLUE_BALLOON[] = { + 0x13C +}; + +const u16 DecorGfx_YELLOW_BALLOON[] = { + 0x140 +}; + +const u16 DecorGfx_RED_TENT[] = { + 0x30, + 0x31, + 0x32, + 0x38, + 0x39, + 0x3A, + 0x40, + 0x41, + 0x3B +}; + +const u16 DecorGfx_BLUE_TENT[] = { + 0x48, + 0x49, + 0x68, + 0x50, + 0x51, + 0x70, + 0x58, + 0x59, + 0x69 +}; + +const u16 DecorGfx_SOLID_BOARD[] = { + 0x34, + 0x3C +}; + +const u16 DecorGfx_SLIDE[] = { + 0x35, + 0x36, + 0x3D, + 0x3E, + 0x63, + 0x64, + 0x6F, + 0x77 +}; + +const u16 DecorGfx_FENCE_LENGTH[] = { + 0x33 +}; + +const u16 DecorGfx_FENCE_WIDTH[] = { + 0x2C +}; + +const u16 DecorGfx_TIRE[] = { + 0x80, + 0x81, + 0x88, + 0x89 +}; + +const u16 DecorGfx_STAND[] = { + 0x6A, + 0x6B, + 0x6C, + 0x6D, + 0x72, + 0x73, + 0x74, + 0x75 +}; + +const u16 DecorGfx_MUD_BALL[] = { + 0x28 +}; + +const u16 DecorGfx_BREAKABLE_DOOR[] = { + 0x37, + 0x3F +}; + +const u16 DecorGfx_SAND_ORNAMENT[] = { + 0x85, + 0x8D +}; + +const u16 DecorGfx_SILVER_SHIELD[] = { + 0xD6, + 0xDE +}; + +const u16 DecorGfx_GOLD_SHIELD[] = { + 0x12E, + 0x136 +}; + +const u16 DecorGfx_GLASS_ORNAMENT[] = { + 0x82, + 0x8A +}; + +const u16 DecorGfx_TV[] = { + 0xF4 +}; + +const u16 DecorGfx_ROUND_TV[] = { + 0xF5 +}; + +const u16 DecorGfx_CUTE_TV[] = { + 0xF6 +}; + +const u16 DecorGfx_GLITTER_MAT[] = { + 0x60 +}; + +const u16 DecorGfx_JUMP_MAT[] = { + 0x61 +}; + +const u16 DecorGfx_SPIN_MAT[] = { + 0x62 +}; + +const u16 DecorGfx_C_LOW_NOTE_MAT[] = { + 0x78 +}; + +const u16 DecorGfx_D_NOTE_MAT[] = { + 0x79 +}; + +const u16 DecorGfx_E_NOTE_MAT[] = { + 0x7A +}; + +const u16 DecorGfx_F_NOTE_MAT[] = { + 0x7B +}; + +const u16 DecorGfx_G_NOTE_MAT[] = { + 0x7C +}; + +const u16 DecorGfx_A_NOTE_MAT[] = { + 0x7D +}; + +const u16 DecorGfx_B_NOTE_MAT[] = { + 0x7E +}; + +const u16 DecorGfx_C_HIGH_NOTE_MAT[] = { + 0xB3 +}; + +const u16 DecorGfx_SURF_MAT[] = { + 0x42, + 0x43, + 0x44, + 0x4A, + 0x4B, + 0x4C, + 0x52, + 0x53, + 0x54 +}; + +const u16 DecorGfx_THUNDER_MAT[] = { + 0x45, + 0x46, + 0x47, + 0x4D, + 0x4E, + 0x4F, + 0x55, + 0x56, + 0x57 +}; + +const u16 DecorGfx_FIRE_BLAST_MAT[] = { + 0x5A, + 0x5B, + 0x5C, + 0x5D, + 0x5E, + 0x5F, + 0x65, + 0x66, + 0x67 +}; + +const u16 DecorGfx_POWDER_SNOW_MAT[] = { + 0x100, + 0x101, + 0x102, + 0x108, + 0x109, + 0x10A, + 0x110, + 0x111, + 0x112 +}; + +const u16 DecorGfx_ATTRACT_MAT[] = { + 0x103, + 0x104, + 0x105, + 0x10B, + 0x10C, + 0x10D, + 0x113, + 0x114, + 0x115 +}; + +const u16 DecorGfx_FISSURE_MAT[] = { + 0x106, + 0x107, + 0x118, + 0x10E, + 0x10F, + 0x120, + 0x116, + 0x117, + 0x128 +}; + +const u16 DecorGfx_SPIKES_MAT[] = { + 0x119, + 0x11A, + 0x11B, + 0x121, + 0x122, + 0x123, + 0x129, + 0x12A, + 0x12B +}; + +const u16 DecorGfx_BALL_POSTER[] = { + 0x130 +}; + +const u16 DecorGfx_GREEN_POSTER[] = { + 0x131 +}; + +const u16 DecorGfx_RED_POSTER[] = { + 0x132 +}; + +const u16 DecorGfx_BLUE_POSTER[] = { + 0x133 +}; + +const u16 DecorGfx_CUTE_POSTER[] = { + 0x134 +}; + +const u16 DecorGfx_PIKA_POSTER[] = { + 0x11C, + 0x11D +}; + +const u16 DecorGfx_LONG_POSTER[] = { + 0x11E, + 0x11F +}; + +const u16 DecorGfx_SEA_POSTER[] = { + 0x124, + 0x125 +}; + +const u16 DecorGfx_SKY_POSTER[] = { + 0x126, + 0x127 +}; + +const u16 DecorGfx_KISS_POSTER[] = { + 0x12C, + 0x12D +}; + +const u16 DecorGfx_PICHU_DOLL[] = { + MAP_OBJ_GFX_PICHU_DOLL +}; + +const u16 DecorGfx_PIKACHU_DOLL[] = { + MAP_OBJ_GFX_PIKACHU_DOLL +}; + +const u16 DecorGfx_MARILL_DOLL[] = { + MAP_OBJ_GFX_MARILL_DOLL +}; + +const u16 DecorGfx_TOGEPI_DOLL[] = { + MAP_OBJ_GFX_TOGEPI_DOLL +}; + +const u16 DecorGfx_CYNDAQUIL_DOLL[] = { + MAP_OBJ_GFX_CYNDAQUIL_DOLL +}; + +const u16 DecorGfx_CHIKORITA_DOLL[] = { + MAP_OBJ_GFX_CHIKORITA_DOLL +}; + +const u16 DecorGfx_TOTODILE_DOLL[] = { + MAP_OBJ_GFX_TOTODILE_DOLL +}; + +const u16 DecorGfx_JIGGLYPUFF_DOLL[] = { + MAP_OBJ_GFX_JIGGLYPUFF_DOLL +}; + +const u16 DecorGfx_MEOWTH_DOLL[] = { + MAP_OBJ_GFX_MEOWTH_DOLL +}; + +const u16 DecorGfx_CLEFAIRY_DOLL[] = { + MAP_OBJ_GFX_CLEFAIRY_DOLL +}; + +const u16 DecorGfx_DITTO_DOLL[] = { + MAP_OBJ_GFX_DITTO_DOLL +}; + +const u16 DecorGfx_SMOOCHUM_DOLL[] = { + MAP_OBJ_GFX_SMOOCHUM_DOLL +}; + +const u16 DecorGfx_TREECKO_DOLL[] = { + MAP_OBJ_GFX_TREECKO_DOLL +}; + +const u16 DecorGfx_TORCHIC_DOLL[] = { + MAP_OBJ_GFX_TORCHIC_DOLL +}; + +const u16 DecorGfx_MUDKIP_DOLL[] = { + MAP_OBJ_GFX_MUDKIP_DOLL +}; + +const u16 DecorGfx_DUSKULL_DOLL[] = { + MAP_OBJ_GFX_DUSKULL_DOLL +}; + +const u16 DecorGfx_WYNAUT_DOLL[] = { + MAP_OBJ_GFX_WYNAUT_DOLL +}; + +const u16 DecorGfx_BALTOY_DOLL[] = { + MAP_OBJ_GFX_BALTOY_DOLL +}; + +const u16 DecorGfx_KECLEON_DOLL[] = { + MAP_OBJ_GFX_KECLEON_DOLL +}; + +const u16 DecorGfx_AZURILL_DOLL[] = { + MAP_OBJ_GFX_AZURILL_DOLL +}; + +const u16 DecorGfx_SKITTY_DOLL[] = { + MAP_OBJ_GFX_SKITTY_DOLL +}; + +const u16 DecorGfx_SWABLU_DOLL[] = { + MAP_OBJ_GFX_SWABLU_DOLL +}; + +const u16 DecorGfx_GULPIN_DOLL[] = { + MAP_OBJ_GFX_GULPIN_DOLL +}; + +const u16 DecorGfx_LOTAD_DOLL[] = { + MAP_OBJ_GFX_LOTAD_DOLL +}; + +const u16 DecorGfx_SEEDOT_DOLL[] = { + MAP_OBJ_GFX_SEEDOT_DOLL +}; + +const u16 DecorGfx_PIKA_CUSHION[] = { + MAP_OBJ_GFX_PIKA_CUSHION +}; + +const u16 DecorGfx_ROUND_CUSHION[] = { + MAP_OBJ_GFX_ROUND_CUSHION +}; + +const u16 DecorGfx_KISS_CUSHION[] = { + MAP_OBJ_GFX_KISS_CUSHION +}; + +const u16 DecorGfx_ZIGZAG_CUSHION[] = { + MAP_OBJ_GFX_ZIGZAG_CUSHION +}; + +const u16 DecorGfx_SPIN_CUSHION[] = { + MAP_OBJ_GFX_SPIN_CUSHION +}; + +const u16 DecorGfx_DIAMOND_CUSHION[] = { + MAP_OBJ_GFX_DIAMOND_CUSHION +}; + +const u16 DecorGfx_BALL_CUSHION[] = { + MAP_OBJ_GFX_BALL_CUSHION +}; + +const u16 DecorGfx_GRASS_CUSHION[] = { + MAP_OBJ_GFX_GRASS_CUSHION +}; + +const u16 DecorGfx_FIRE_CUSHION[] = { + MAP_OBJ_GFX_FIRE_CUSHION +}; + +const u16 DecorGfx_WATER_CUSHION[] = { + MAP_OBJ_GFX_WATER_CUSHION +}; + +const u16 DecorGfx_SNORLAX_DOLL[] = { + MAP_OBJ_GFX_BIG_SNORLAX_DOLL +}; + +const u16 DecorGfx_RHYDON_DOLL[] = { + MAP_OBJ_GFX_BIG_RHYDON_DOLL +}; + +const u16 DecorGfx_LAPRAS_DOLL[] = { + MAP_OBJ_GFX_BIG_LAPRAS_DOLL +}; + +const u16 DecorGfx_VENUSAUR_DOLL[] = { + MAP_OBJ_GFX_BIG_VENUSAUR_DOLL +}; + +const u16 DecorGfx_CHARIZARD_DOLL[] = { + MAP_OBJ_GFX_BIG_CHARIZARD_DOLL +}; + +const u16 DecorGfx_BLASTOISE_DOLL[] = { + MAP_OBJ_GFX_BIG_BLASTOISE_DOLL +}; + +const u16 DecorGfx_WAILMER_DOLL[] = { + MAP_OBJ_GFX_BIG_WAILMER_DOLL +}; + +const u16 DecorGfx_REGIROCK_DOLL[] = { + MAP_OBJ_GFX_BIG_REGIROCK_DOLL +}; + +const u16 DecorGfx_REGICE_DOLL[] = { + MAP_OBJ_GFX_BIG_REGICE_DOLL +}; + +const u16 DecorGfx_REGISTEEL_DOLL[] = { + MAP_OBJ_GFX_BIG_REGISTEEL_DOLL +}; + +const struct Decoration gDecorations[] = { + DECORATION(DECOR_NONE, _("SMALL DESK"), 0, 0, 0, 0, DecorDesc_SMALL_DESK, DecorGfx_SMALL_DESK), + DECORATION(DECOR_SMALL_DESK, _("SMALL DESK"), 0, 0, 0, 3000, DecorDesc_SMALL_DESK, DecorGfx_SMALL_DESK), + DECORATION(DECOR_POKEMON_DESK, _("POKéMON DESK"), 0, 0, 0, 3000, DecorDesc_POKEMON_DESK, DecorGfx_POKEMON_DESK), + DECORATION(DECOR_HEAVY_DESK, _("HEAVY DESK"), 0, 9, 0, 6000, DecorDesc_HEAVY_DESK, DecorGfx_HEAVY_DESK), + DECORATION(DECOR_RAGGED_DESK, _("RAGGED DESK"), 0, 9, 0, 6000, DecorDesc_RAGGED_DESK, DecorGfx_RAGGED_DESK), + DECORATION(DECOR_COMFORT_DESK, _("COMFORT DESK"), 0, 9, 0, 6000, DecorDesc_COMFORT_DESK, DecorGfx_COMFORT_DESK), + DECORATION(DECOR_PRETTY_DESK, _("PRETTY DESK"), 0, 8, 0, 9000, DecorDesc_PRETTY_DESK, DecorGfx_PRETTY_DESK), + DECORATION(DECOR_BRICK_DESK, _("BRICK DESK"), 0, 8, 0, 9000, DecorDesc_BRICK_DESK, DecorGfx_BRICK_DESK), + DECORATION(DECOR_CAMP_DESK, _("CAMP DESK"), 0, 8, 0, 9000, DecorDesc_CAMP_DESK, DecorGfx_CAMP_DESK), + DECORATION(DECOR_HARD_DESK, _("HARD DESK"), 0, 8, 0, 9000, DecorDesc_HARD_DESK, DecorGfx_HARD_DESK), + DECORATION(DECOR_SMALL_CHAIR, _("SMALL CHAIR"), 1, 0, 1, 2000, DecorDesc_SMALL_CHAIR, DecorGfx_SMALL_CHAIR), + DECORATION(DECOR_POKEMON_CHAIR, _("POKéMON CHAIR"), 1, 0, 1, 2000, DecorDesc_POKEMON_CHAIR, DecorGfx_POKEMON_CHAIR), + DECORATION(DECOR_HEAVY_CHAIR, _("HEAVY CHAIR"), 1, 0, 1, 2000, DecorDesc_HEAVY_CHAIR, DecorGfx_HEAVY_CHAIR), + DECORATION(DECOR_PRETTY_CHAIR, _("PRETTY CHAIR"), 1, 0, 1, 2000, DecorDesc_PRETTY_CHAIR, DecorGfx_PRETTY_CHAIR), + DECORATION(DECOR_COMFORT_CHAIR, _("COMFORT CHAIR"), 1, 0, 1, 2000, DecorDesc_COMFORT_CHAIR, DecorGfx_COMFORT_CHAIR), + DECORATION(DECOR_RAGGED_CHAIR, _("RAGGED CHAIR"), 1, 0, 1, 2000, DecorDesc_RAGGED_CHAIR, DecorGfx_RAGGED_CHAIR), + DECORATION(DECOR_BRICK_CHAIR, _("BRICK CHAIR"), 1, 0, 1, 2000, DecorDesc_BRICK_CHAIR, DecorGfx_BRICK_CHAIR), + DECORATION(DECOR_CAMP_CHAIR, _("CAMP CHAIR"), 1, 0, 1, 2000, DecorDesc_CAMP_CHAIR, DecorGfx_CAMP_CHAIR), + DECORATION(DECOR_HARD_CHAIR, _("HARD CHAIR"), 1, 0, 1, 2000, DecorDesc_HARD_CHAIR, DecorGfx_HARD_CHAIR), + DECORATION(DECOR_RED_PLANT, _("RED PLANT"), 2, 5, 2, 3000, DecorDesc_RED_PLANT, DecorGfx_RED_PLANT), + DECORATION(DECOR_TROPICAL_PLANT, _("TROPICAL PLANT"), 2, 5, 2, 3000, DecorDesc_TROPICAL_PLANT, DecorGfx_TROPICAL_PLANT), + DECORATION(DECOR_PRETTY_FLOWERS, _("PRETTY FLOWERS"), 2, 5, 2, 3000, DecorDesc_PRETTY_FLOWERS, DecorGfx_PRETTY_FLOWERS), + DECORATION(DECOR_COLORFUL_PLANT, _("COLORFUL PLANT"), 2, 4, 2, 5000, DecorDesc_COLORFUL_PLANT, DecorGfx_COLORFUL_PLANT), + DECORATION(DECOR_BIG_PLANT, _("BIG PLANT"), 2, 4, 2, 5000, DecorDesc_BIG_PLANT, DecorGfx_BIG_PLANT), + DECORATION(DECOR_GORGEOUS_PLANT, _("GORGEOUS PLANT"), 2, 4, 2, 5000, DecorDesc_GORGEOUS_PLANT, DecorGfx_GORGEOUS_PLANT), + DECORATION(DECOR_RED_BRICK, _("RED BRICK"), 0, 5, 3, 500, DecorDesc_RED_BRICK, DecorGfx_RED_BRICK), + DECORATION(DECOR_YELLOW_BRICK, _("YELLOW BRICK"), 0, 5, 3, 500, DecorDesc_YELLOW_BRICK, DecorGfx_YELLOW_BRICK), + DECORATION(DECOR_BLUE_BRICK, _("BLUE BRICK"), 0, 5, 3, 500, DecorDesc_BLUE_BRICK, DecorGfx_BLUE_BRICK), + DECORATION(DECOR_RED_BALLOON, _("RED BALLOON"), 1, 0, 3, 500, DecorDesc_RED_BALLOON, DecorGfx_RED_BALLOON), + DECORATION(DECOR_BLUE_BALLOON, _("BLUE BALLOON"), 1, 0, 3, 500, DecorDesc_BLUE_BALLOON, DecorGfx_BLUE_BALLOON), + DECORATION(DECOR_YELLOW_BALLOON, _("YELLOW BALLOON"), 1, 0, 3, 500, DecorDesc_YELLOW_BALLOON, DecorGfx_YELLOW_BALLOON), + DECORATION(DECOR_RED_TENT, _("RED TENT"), 1, 8, 3, 10000, DecorDesc_RED_TENT, DecorGfx_RED_TENT), + DECORATION(DECOR_BLUE_TENT, _("BLUE TENT"), 1, 8, 3, 10000, DecorDesc_BLUE_TENT, DecorGfx_BLUE_TENT), + DECORATION(DECOR_SOLID_BOARD, _("SOLID BOARD"), 1, 5, 3, 3000, DecorDesc_SOLID_BOARD, DecorGfx_SOLID_BOARD), + DECORATION(DECOR_SLIDE, _("SLIDE"), 1, 7, 3, 8000, DecorDesc_SLIDE, DecorGfx_SLIDE), + DECORATION(DECOR_FENCE_LENGTH, _("FENCE LENGTH"), 0, 0, 3, 500, DecorDesc_FENCE_LENGTH, DecorGfx_FENCE_LENGTH), + DECORATION(DECOR_FENCE_WIDTH, _("FENCE WIDTH"), 0, 0, 3, 500, DecorDesc_FENCE_WIDTH, DecorGfx_FENCE_WIDTH), + DECORATION(DECOR_TIRE, _("TIRE"), 0, 4, 3, 800, DecorDesc_TIRE, DecorGfx_TIRE), + DECORATION(DECOR_STAND, _("STAND"), 1, 3, 3, 7000, DecorDesc_STAND, DecorGfx_STAND), + DECORATION(DECOR_MUD_BALL, _("MUD BALL"), 1, 0, 3, 200, DecorDesc_MUD_BALL, DecorGfx_MUD_BALL), + DECORATION(DECOR_BREAKABLE_DOOR, _("BREAKABLE DOOR"), 1, 5, 3, 3000, DecorDesc_BREAKABLE_DOOR, DecorGfx_BREAKABLE_DOOR), + DECORATION(DECOR_SAND_ORNAMENT, _("SAND ORNAMENT"), 2, 5, 3, 3000, DecorDesc_SAND_ORNAMENT, DecorGfx_SAND_ORNAMENT), + DECORATION(DECOR_SILVER_SHIELD, _("SILVER SHIELD"), 2, 5, 3, 0, DecorDesc_SILVER_SHIELD, DecorGfx_SILVER_SHIELD), + DECORATION(DECOR_GOLD_SHIELD, _("GOLD SHIELD"), 2, 5, 3, 0, DecorDesc_GOLD_SHIELD, DecorGfx_GOLD_SHIELD), + DECORATION(DECOR_GLASS_ORNAMENT, _("GLASS ORNAMENT"), 2, 5, 3, 0, DecorDesc_GLASS_ORNAMENT, DecorGfx_GLASS_ORNAMENT), + DECORATION(DECOR_TV, _("TV"), 0, 0, 3, 3000, DecorDesc_TV, DecorGfx_TV), + DECORATION(DECOR_ROUND_TV, _("ROUND TV"), 0, 0, 3, 4000, DecorDesc_ROUND_TV, DecorGfx_ROUND_TV), + DECORATION(DECOR_CUTE_TV, _("CUTE TV"), 0, 0, 3, 4000, DecorDesc_CUTE_TV, DecorGfx_CUTE_TV), + DECORATION(DECOR_GLITTER_MAT, _("GLITTER MAT"), 1, 0, 4, 2000, DecorDesc_GLITTER_MAT, DecorGfx_GLITTER_MAT), + DECORATION(DECOR_JUMP_MAT, _("JUMP MAT"), 1, 0, 4, 2000, DecorDesc_JUMP_MAT, DecorGfx_JUMP_MAT), + DECORATION(DECOR_SPIN_MAT, _("SPIN MAT"), 1, 0, 4, 2000, DecorDesc_SPIN_MAT, DecorGfx_SPIN_MAT), + DECORATION(DECOR_C_LOW_NOTE_MAT, _("C Low NOTE MAT"), 1, 0, 4, 500, DecorDesc_C_LOW_NOTE_MAT, DecorGfx_C_LOW_NOTE_MAT), + DECORATION(DECOR_D_NOTE_MAT, _("D NOTE MAT"), 1, 0, 4, 500, DecorDesc_D_NOTE_MAT, DecorGfx_D_NOTE_MAT), + DECORATION(DECOR_E_NOTE_MAT, _("E NOTE MAT"), 1, 0, 4, 500, DecorDesc_E_NOTE_MAT, DecorGfx_E_NOTE_MAT), + DECORATION(DECOR_F_NOTE_MAT, _("F NOTE MAT"), 1, 0, 4, 500, DecorDesc_F_NOTE_MAT, DecorGfx_F_NOTE_MAT), + DECORATION(DECOR_G_NOTE_MAT, _("G NOTE MAT"), 1, 0, 4, 500, DecorDesc_G_NOTE_MAT, DecorGfx_G_NOTE_MAT), + DECORATION(DECOR_A_NOTE_MAT, _("A NOTE MAT"), 1, 0, 4, 500, DecorDesc_A_NOTE_MAT, DecorGfx_A_NOTE_MAT), + DECORATION(DECOR_B_NOTE_MAT, _("B NOTE MAT"), 1, 0, 4, 500, DecorDesc_B_NOTE_MAT, DecorGfx_B_NOTE_MAT), + DECORATION(DECOR_C_HIGH_NOTE_MAT, _("C High NOTE MAT"), 1, 0, 4, 500, DecorDesc_C_HIGH_NOTE_MAT, DecorGfx_C_HIGH_NOTE_MAT), + DECORATION(DECOR_SURF_MAT, _("SURF MAT"), 1, 8, 4, 4000, DecorDesc_SURF_MAT, DecorGfx_SURF_MAT), + DECORATION(DECOR_THUNDER_MAT, _("THUNDER MAT"), 1, 8, 4, 4000, DecorDesc_THUNDER_MAT, DecorGfx_THUNDER_MAT), + DECORATION(DECOR_FIRE_BLAST_MAT, _("FIRE BLAST MAT"), 1, 8, 4, 4000, DecorDesc_FIRE_BLAST_MAT, DecorGfx_FIRE_BLAST_MAT), + DECORATION(DECOR_POWDER_SNOW_MAT, _("POWDER SNOW MAT"), 1, 8, 4, 4000, DecorDesc_POWDER_SNOW_MAT, DecorGfx_POWDER_SNOW_MAT), + DECORATION(DECOR_ATTRACT_MAT, _("ATTRACT MAT"), 1, 8, 4, 4000, DecorDesc_ATTRACT_MAT, DecorGfx_ATTRACT_MAT), + DECORATION(DECOR_FISSURE_MAT, _("FISSURE MAT"), 1, 8, 4, 4000, DecorDesc_FISSURE_MAT, DecorGfx_FISSURE_MAT), + DECORATION(DECOR_SPIKES_MAT, _("SPIKES MAT"), 1, 8, 4, 4000, DecorDesc_SPIKES_MAT, DecorGfx_SPIKES_MAT), + DECORATION(DECOR_BALL_POSTER, _("BALL POSTER"), 3, 0, 5, 1000, DecorDesc_BALL_POSTER, DecorGfx_BALL_POSTER), + DECORATION(DECOR_GREEN_POSTER, _("GREEN POSTER"), 3, 0, 5, 1000, DecorDesc_GREEN_POSTER, DecorGfx_GREEN_POSTER), + DECORATION(DECOR_RED_POSTER, _("RED POSTER"), 3, 0, 5, 1000, DecorDesc_RED_POSTER, DecorGfx_RED_POSTER), + DECORATION(DECOR_BLUE_POSTER, _("BLUE POSTER"), 3, 0, 5, 1000, DecorDesc_BLUE_POSTER, DecorGfx_BLUE_POSTER), + DECORATION(DECOR_CUTE_POSTER, _("CUTE POSTER"), 3, 0, 5, 1000, DecorDesc_CUTE_POSTER, DecorGfx_CUTE_POSTER), + DECORATION(DECOR_PIKA_POSTER, _("PIKA POSTER"), 3, 1, 5, 1500, DecorDesc_PIKA_POSTER, DecorGfx_PIKA_POSTER), + DECORATION(DECOR_LONG_POSTER, _("LONG POSTER"), 3, 1, 5, 1500, DecorDesc_LONG_POSTER, DecorGfx_LONG_POSTER), + DECORATION(DECOR_SEA_POSTER, _("SEA POSTER"), 3, 1, 5, 1500, DecorDesc_SEA_POSTER, DecorGfx_SEA_POSTER), + DECORATION(DECOR_SKY_POSTER, _("SKY POSTER"), 3, 1, 5, 1500, DecorDesc_SKY_POSTER, DecorGfx_SKY_POSTER), + DECORATION(DECOR_KISS_POSTER, _("KISS POSTER"), 3, 1, 5, 1500, DecorDesc_KISS_POSTER, DecorGfx_KISS_POSTER), + DECORATION(DECOR_PICHU_DOLL, _("PICHU DOLL"), 4, 0, 6, 3000, DecorDesc_PICHU_DOLL, DecorGfx_PICHU_DOLL), + DECORATION(DECOR_PIKACHU_DOLL, _("PIKACHU DOLL"), 4, 0, 6, 3000, DecorDesc_PIKACHU_DOLL, DecorGfx_PIKACHU_DOLL), + DECORATION(DECOR_MARILL_DOLL, _("MARILL DOLL"), 4, 0, 6, 3000, DecorDesc_MARILL_DOLL, DecorGfx_MARILL_DOLL), + DECORATION(DECOR_TOGEPI_DOLL, _("TOGEPI DOLL"), 4, 0, 6, 3000, DecorDesc_TOGEPI_DOLL, DecorGfx_TOGEPI_DOLL), + DECORATION(DECOR_CYNDAQUIL_DOLL, _("CYNDAQUIL DOLL"), 4, 0, 6, 3000, DecorDesc_CYNDAQUIL_DOLL, DecorGfx_CYNDAQUIL_DOLL), + DECORATION(DECOR_CHIKORITA_DOLL, _("CHIKORITA DOLL"), 4, 0, 6, 3000, DecorDesc_CHIKORITA_DOLL, DecorGfx_CHIKORITA_DOLL), + DECORATION(DECOR_TOTODILE_DOLL, _("TOTODILE DOLL"), 4, 0, 6, 3000, DecorDesc_TOTODILE_DOLL, DecorGfx_TOTODILE_DOLL), + DECORATION(DECOR_JIGGLYPUFF_DOLL, _("JIGGLYPUFF DOLL"), 4, 0, 6, 3000, DecorDesc_JIGGLYPUFF_DOLL, DecorGfx_JIGGLYPUFF_DOLL), + DECORATION(DECOR_MEOWTH_DOLL, _("MEOWTH DOLL"), 4, 0, 6, 3000, DecorDesc_MEOWTH_DOLL, DecorGfx_MEOWTH_DOLL), + DECORATION(DECOR_CLEFAIRY_DOLL, _("CLEFAIRY DOLL"), 4, 0, 6, 3000, DecorDesc_CLEFAIRY_DOLL, DecorGfx_CLEFAIRY_DOLL), + DECORATION(DECOR_DITTO_DOLL, _("DITTO DOLL"), 4, 0, 6, 3000, DecorDesc_DITTO_DOLL, DecorGfx_DITTO_DOLL), + DECORATION(DECOR_SMOOCHUM_DOLL, _("SMOOCHUM DOLL"), 4, 0, 6, 3000, DecorDesc_SMOOCHUM_DOLL, DecorGfx_SMOOCHUM_DOLL), + DECORATION(DECOR_TREECKO_DOLL, _("TREECKO DOLL"), 4, 0, 6, 3000, DecorDesc_TREECKO_DOLL, DecorGfx_TREECKO_DOLL), + DECORATION(DECOR_TORCHIC_DOLL, _("TORCHIC DOLL"), 4, 0, 6, 3000, DecorDesc_TORCHIC_DOLL, DecorGfx_TORCHIC_DOLL), + DECORATION(DECOR_MUDKIP_DOLL, _("MUDKIP DOLL"), 4, 0, 6, 3000, DecorDesc_MUDKIP_DOLL, DecorGfx_MUDKIP_DOLL), + DECORATION(DECOR_DUSKULL_DOLL, _("DUSKULL DOLL"), 4, 0, 6, 3000, DecorDesc_DUSKULL_DOLL, DecorGfx_DUSKULL_DOLL), + DECORATION(DECOR_WYNAUT_DOLL, _("WYNAUT DOLL"), 4, 0, 6, 3000, DecorDesc_WYNAUT_DOLL, DecorGfx_WYNAUT_DOLL), + DECORATION(DECOR_BALTOY_DOLL, _("BALTOY DOLL"), 4, 0, 6, 3000, DecorDesc_BALTOY_DOLL, DecorGfx_BALTOY_DOLL), + DECORATION(DECOR_KECLEON_DOLL, _("KECLEON DOLL"), 4, 0, 6, 3000, DecorDesc_KECLEON_DOLL, DecorGfx_KECLEON_DOLL), + DECORATION(DECOR_AZURILL_DOLL, _("AZURILL DOLL"), 4, 0, 6, 3000, DecorDesc_AZURILL_DOLL, DecorGfx_AZURILL_DOLL), + DECORATION(DECOR_SKITTY_DOLL, _("SKITTY DOLL"), 4, 0, 6, 3000, DecorDesc_SKITTY_DOLL, DecorGfx_SKITTY_DOLL), + DECORATION(DECOR_SWABLU_DOLL, _("SWABLU DOLL"), 4, 0, 6, 3000, DecorDesc_SWABLU_DOLL, DecorGfx_SWABLU_DOLL), + DECORATION(DECOR_GULPIN_DOLL, _("GULPIN DOLL"), 4, 0, 6, 3000, DecorDesc_GULPIN_DOLL, DecorGfx_GULPIN_DOLL), + DECORATION(DECOR_LOTAD_DOLL, _("LOTAD DOLL"), 4, 0, 6, 3000, DecorDesc_LOTAD_DOLL, DecorGfx_LOTAD_DOLL), + DECORATION(DECOR_SEEDOT_DOLL, _("SEEDOT DOLL"), 4, 0, 6, 3000, DecorDesc_SEEDOT_DOLL, DecorGfx_SEEDOT_DOLL), + DECORATION(DECOR_PIKA_CUSHION, _("PIKA CUSHION"), 4, 0, 7, 2000, DecorDesc_PIKA_CUSHION, DecorGfx_PIKA_CUSHION), + DECORATION(DECOR_ROUND_CUSHION, _("ROUND CUSHION"), 4, 0, 7, 2000, DecorDesc_ROUND_CUSHION, DecorGfx_ROUND_CUSHION), + DECORATION(DECOR_KISS_CUSHION, _("KISS CUSHION"), 4, 0, 7, 2000, DecorDesc_KISS_CUSHION, DecorGfx_KISS_CUSHION), + DECORATION(DECOR_ZIGZAG_CUSHION, _("ZIGZAG CUSHION"), 4, 0, 7, 2000, DecorDesc_ZIGZAG_CUSHION, DecorGfx_ZIGZAG_CUSHION), + DECORATION(DECOR_SPIN_CUSHION, _("SPIN CUSHION"), 4, 0, 7, 2000, DecorDesc_SPIN_CUSHION, DecorGfx_SPIN_CUSHION), + DECORATION(DECOR_DIAMOND_CUSHION, _("DIAMOND CUSHION"), 4, 0, 7, 2000, DecorDesc_DIAMOND_CUSHION, DecorGfx_DIAMOND_CUSHION), + DECORATION(DECOR_BALL_CUSHION, _("BALL CUSHION"), 4, 0, 7, 2000, DecorDesc_BALL_CUSHION, DecorGfx_BALL_CUSHION), + DECORATION(DECOR_GRASS_CUSHION, _("GRASS CUSHION"), 4, 0, 7, 2000, DecorDesc_GRASS_CUSHION, DecorGfx_GRASS_CUSHION), + DECORATION(DECOR_FIRE_CUSHION, _("FIRE CUSHION"), 4, 0, 7, 2000, DecorDesc_FIRE_CUSHION, DecorGfx_FIRE_CUSHION), + DECORATION(DECOR_WATER_CUSHION, _("WATER CUSHION"), 4, 0, 7, 2000, DecorDesc_WATER_CUSHION, DecorGfx_WATER_CUSHION), + DECORATION(DECOR_SNORLAX_DOLL, _("SNORLAX DOLL"), 4, 5, 6, 10000, DecorDesc_SNORLAX_DOLL, DecorGfx_SNORLAX_DOLL), + DECORATION(DECOR_RHYDON_DOLL, _("RHYDON DOLL"), 4, 5, 6, 10000, DecorDesc_RHYDON_DOLL, DecorGfx_RHYDON_DOLL), + DECORATION(DECOR_LAPRAS_DOLL, _("LAPRAS DOLL"), 4, 5, 6, 10000, DecorDesc_LAPRAS_DOLL, DecorGfx_LAPRAS_DOLL), + DECORATION(DECOR_VENUSAUR_DOLL, _("VENUSAUR DOLL"), 4, 5, 6, 10000, DecorDesc_VENUSAUR_DOLL, DecorGfx_VENUSAUR_DOLL), + DECORATION(DECOR_CHARIZARD_DOLL, _("CHARIZARD DOLL"), 4, 5, 6, 10000, DecorDesc_CHARIZARD_DOLL, DecorGfx_CHARIZARD_DOLL), + DECORATION(DECOR_BLASTOISE_DOLL, _("BLASTOISE DOLL"), 4, 5, 6, 10000, DecorDesc_BLASTOISE_DOLL, DecorGfx_BLASTOISE_DOLL), + DECORATION(DECOR_WAILMER_DOLL, _("WAILMER DOLL"), 4, 5, 6, 10000, DecorDesc_WAILMER_DOLL, DecorGfx_WAILMER_DOLL), + DECORATION(DECOR_REGIROCK_DOLL, _("REGIROCK DOLL"), 4, 5, 6, 10000, DecorDesc_REGIROCK_DOLL, DecorGfx_REGIROCK_DOLL), + DECORATION(DECOR_REGICE_DOLL, _("REGICE DOLL"), 4, 5, 6, 10000, DecorDesc_REGICE_DOLL, DecorGfx_REGICE_DOLL), + DECORATION(DECOR_REGISTEEL_DOLL, _("REGISTEEL DOLL"), 4, 5, 6, 10000, DecorDesc_REGISTEEL_DOLL, DecorGfx_REGISTEEL_DOLL) +}; + +extern u8 gUnknown_0815F399[]; void sub_80FE1DC(void) { @@ -974,7 +2330,7 @@ bool8 sub_80FFBDC(u16 a0, struct Decoration *decoration) } #ifdef NONMATCHING -bool8 sub_80FFC24(u8 taskId, struct Decoration *decoration) +bool8 sub_80FFC24(u8 taskId, const struct Decoration *decoration) { u8 i; u8 j; @@ -1106,7 +2462,7 @@ bool8 sub_80FFC24(u8 taskId, struct Decoration *decoration) } #else __attribute__((naked)) -bool8 sub_80FFC24(u8 taskId, struct Decoration *decoration) +bool8 sub_80FFC24(u8 taskId, const struct Decoration *decoration) { asm(".syntax unified\n" "\tpush {r4-r7,lr}\n" diff --git a/src/menu.c b/src/menu.c old mode 100644 new mode 100755 index 61eaebb6f..3acac88a0 --- a/src/menu.c +++ b/src/menu.c @@ -611,7 +611,7 @@ u8 unref_sub_8072A5C(u8 *dest, u8 *src, u8 left, u16 top, u8 width, u32 a6) return sub_8004FD0(gMenuWindowPtr, dest, src, gMenuTextTileOffset, left, top, width, a6); } -int sub_8072AB0(u8 *str, u8 left, u16 top, u8 width, u8 height, u32 a6) +int sub_8072AB0(const u8 *str, u8 left, u16 top, u8 width, u8 height, u32 a6) { u8 newlineCount = sub_8004FD0(gMenuWindowPtr, NULL, str, gMenuTextTileOffset, left, top, width, a6); diff --git a/src/scrcmd.c b/src/scrcmd.c old mode 100644 new mode 100755 index 33867b58a..f2b5090af --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -61,7 +61,6 @@ extern u8 *gStdScripts[]; extern u8 *gStdScripts_End[]; extern u8 * const gUnknown_083CE048[]; -extern struct Decoration gDecorations[]; // This is defined in here so the optimizer can't see its value when compiling // script.c. -- cgit v1.2.3 From 1258970db69f686b4a33cd00d9a77ce414f7d225 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 12 Jun 2017 23:17:03 -0400 Subject: data/decoration.s, 1 --- src/decoration.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 5d6c835ff..74f606fd9 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -29,6 +29,9 @@ .tiles = _tiles\ } +#define MENUACTION2(_text, _func) {.text = _text, .func = _func} +#define MENUACTION3(_func1, _func2) {.func1 = _func1, .func2 = _func2} + const u8 DecorDesc_SMALL_DESK[] = _( "A small desk built\n" "for one."); @@ -1373,6 +1376,43 @@ const struct Decoration gDecorations[] = { DECORATION(DECOR_REGISTEEL_DOLL, _("REGISTEEL DOLL"), 4, 5, 6, 10000, DecorDesc_REGISTEEL_DOLL, DecorGfx_REGISTEEL_DOLL) }; +const u8 *const gUnknown_083EC5E4[] = { + SecretBaseText_Desk, + SecretBaseText_Chair, + SecretBaseText_Plant, + SecretBaseText_Ornament, + SecretBaseText_Mat, + SecretBaseText_Poster, + SecretBaseText_Doll, + SecretBaseText_Cushion +}; + +const struct MenuAction2 gUnknown_083EC604[] = { + MENUACTION2(SecretBaseText_Decorate, sub_80FF160), + MENUACTION2(SecretBaseText_PutAway, sub_8100A0C), + MENUACTION2(SecretBaseText_Toss, sub_8101700), + MENUACTION2(gUnknownText_Exit, gpu_pal_decompress_alloc_tag_and_upload) +}; + +const u8 *const gUnknown_083EC624[] = { + SecretBaseText_PutOutDecor, + SecretBaseText_StoreChosenDecor, + SecretBaseText_ThrowAwayDecor, + gMenuText_GoBackToPrev +}; + +const struct MenuAction3 gUnknown_083EC634[] = { + MENUACTION3(sub_80FF5BC, sub_80FF058), + MENUACTION3(sub_81017A0, sub_80FF058), + MENUACTION3(sub_81017A0, sub_80FF058), + MENUACTION3(sub_8109D04, sub_80FF058) +}; + +const u16 gUnknown_083EC654[] = {0x6318, 0x739C, 0x7FFF}; +const u8 gUnknown_083EC65A[] = _("{PALETTE 13}{STR_VAR_1}"); + +// text + extern u8 gUnknown_0815F399[]; void sub_80FE1DC(void) -- cgit v1.2.3 From e9de0f52112375193fe0568cca34d7c2df17c89b Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 12 Jun 2017 23:34:54 -0400 Subject: data/decoration.s, 2 --- src/decoration.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 68 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 74f606fd9..eb932db9e 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -31,6 +31,8 @@ #define MENUACTION2(_text, _func) {.text = _text, .func = _func} #define MENUACTION3(_func1, _func2) {.func1 = _func1, .func2 = _func2} +#define STRUCT_803EC860(_data1, _data2, _data3, _size) {.var0 = _data1, .var4 = _data2, .var8 = _data3, .size = _size} +#define DECOSPRITETEMPLATE(_shape, _size, _x, _y) {.shape = _shape, .size = _size, .x = _x, .y = _y} const u8 DecorDesc_SMALL_DESK[] = _( "A small desk built\n" @@ -1411,6 +1413,66 @@ const struct MenuAction3 gUnknown_083EC634[] = { 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[] = { + STRUCT_803EC860(Unknown_3EC660, Unknown_3EC6F0, Unknown_3EC7A8, 0x4), + STRUCT_803EC860(Unknown_3EC68C, Unknown_3EC6F4, Unknown_3EC7AC, 0x8), + STRUCT_803EC860(Unknown_3EC664, Unknown_3EC6FC, Unknown_3EC7B4, 0xc), + STRUCT_803EC860(Unknown_3EC694, Unknown_3EC708, Unknown_3EC7C0, 0x20), + STRUCT_803EC860(Unknown_3EC670, Unknown_3EC728, Unknown_3EC7E0, 0x10), + STRUCT_803EC860(Unknown_3EC68C, Unknown_3EC738, Unknown_3EC7F0, 0x8), + STRUCT_803EC860(Unknown_3EC680, Unknown_3EC740, Unknown_3EC7F8, 0xc), + STRUCT_803EC860(Unknown_3EC694, Unknown_3EC74C, Unknown_3EC804, 0x20), + STRUCT_803EC860(Unknown_3EC6B4, Unknown_3EC76C, Unknown_3EC824, 0x24), + STRUCT_803EC860(Unknown_3EC6D8, Unknown_3EC790, Unknown_3EC848, 0x18) +}; + +const struct UnkStruct_083EC900 gUnknown_083EC900[] = { + DECOSPRITETEMPLATE(0, 1, 0x78, 0x4e), + DECOSPRITETEMPLATE(1, 2, 0x80, 0x4e), + DECOSPRITETEMPLATE(1, 3, 0x90, 0x56), + DECOSPRITETEMPLATE(1, 3, 0x90, 0x46), + DECOSPRITETEMPLATE(0, 2, 0x80, 0x46), + DECOSPRITETEMPLATE(2, 2, 0x78, 0x46), + DECOSPRITETEMPLATE(2, 3, 0x80, 0x56), + DECOSPRITETEMPLATE(2, 3, 0x80, 0x36), + DECOSPRITETEMPLATE(0, 3, 0x90, 0x46), + DECOSPRITETEMPLATE(1, 3, 0x90, 0x46) +}; + +const union AnimCmd gSpriteAnim_83EC928[] = { + ANIMCMD_FRAME(.imageValue = 0, .duration = 0), + ANIMCMD_END +}; + // text extern u8 gUnknown_0815F399[]; @@ -2240,11 +2302,11 @@ void AddDecorationIconObjectFromFieldObject(struct UnkStruct_02038900 * unk_0203 sub_810070C(unk_02038900->unk_884, ((u16 *)gMapHeader.mapData->secondaryTileset->metatiles + 8 * unk_02038900->decoration->tiles[0])[7] >> 12); LoadSpritePalette(&gUnknown_083EC954); gUnknown_020391A8 = gSprites[gUnknown_03004880.unk4].data0; - gUnknown_03004880.unk4 = CreateSprite(&gSpriteTemplate_83EC93C, gUnknown_083EC900[unk_02038900->decoration->shape].unk_2, gUnknown_083EC900[unk_02038900->decoration->shape].unk_3, 0); + gUnknown_03004880.unk4 = CreateSprite(&gSpriteTemplate_83EC93C, gUnknown_083EC900[unk_02038900->decoration->shape].x, gUnknown_083EC900[unk_02038900->decoration->shape].y, 0); } else { gUnknown_020391A8 = gSprites[gUnknown_03004880.unk4].data0; - gUnknown_03004880.unk4 = AddPseudoFieldObject(unk_02038900->decoration->tiles[0], sub_81009A8, gUnknown_083EC900[unk_02038900->decoration->shape].unk_2, gUnknown_083EC900[unk_02038900->decoration->shape].unk_3, 1); + gUnknown_03004880.unk4 = AddPseudoFieldObject(unk_02038900->decoration->tiles[0], sub_81009A8, gUnknown_083EC900[unk_02038900->decoration->shape].x, gUnknown_083EC900[unk_02038900->decoration->shape].y, 1); gSprites[gUnknown_03004880.unk4].oam.priority = 1; } } @@ -2252,7 +2314,7 @@ void AddDecorationIconObjectFromFieldObject(struct UnkStruct_02038900 * unk_0203 void SetUpPlacingDecorationPlayerAvatar(u8 taskId, struct UnkStruct_02038900 *unk_02038900) { u8 v0; - v0 = 16 * (u8)gTasks[taskId].data[5] + gUnknown_083EC900[unk_02038900->decoration->shape].unk_2 - 8 * ((u8)gTasks[taskId].data[5] - 1); + v0 = 16 * (u8)gTasks[taskId].data[5] + gUnknown_083EC900[unk_02038900->decoration->shape].x - 8 * ((u8)gTasks[taskId].data[5] - 1); if (unk_02038900->decoration->shape == 2 || unk_02038900->decoration->shape == 8 || unk_02038900->decoration->shape == 9) { v0 -= 8; @@ -3376,7 +3438,7 @@ void sub_81008BC(struct UnkStruct_02038900 *unk_02038900) } } -void sub_8100930(u8 unk12) +void sub_8100930(u8 decoShape) /* * This function sets an OAM object not directly referenced anywhere else * in the source. @@ -3387,10 +3449,10 @@ void sub_8100930(u8 unk12) gUnknown_020391AC.objMode = 0; gUnknown_020391AC.mosaic = 0; gUnknown_020391AC.bpp = 0; - gUnknown_020391AC.shape = gUnknown_083EC900[unk12].unk_0; + gUnknown_020391AC.shape = gUnknown_083EC900[decoShape].shape; gUnknown_020391AC.x = 0; gUnknown_020391AC.matrixNum = 0; - gUnknown_020391AC.size = gUnknown_083EC900[unk12].unk_1; + gUnknown_020391AC.size = gUnknown_083EC900[decoShape].size; gUnknown_020391AC.tileNum = 0; gUnknown_020391AC.priority = 1; gUnknown_020391AC.paletteNum = 0; -- cgit v1.2.3 From bd0191d8ca99501214253b2f5165e70a9128a01c Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Mon, 12 Jun 2017 22:46:33 -0500 Subject: decompile sub_80917CC - sub_8091A4C --- src/pokedex.c | 156 +++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 138 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/pokedex.c b/src/pokedex.c index 91ae27a3b..4cd52b2e5 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -12,6 +12,7 @@ #include "rng.h" #include "songs.h" #include "sound.h" +#include "species.h" #include "string_util.h" #include "strings.h" #include "task.h" @@ -57,45 +58,50 @@ struct PokedexEntry extern struct MusicPlayerInfo gMPlay_BGM; extern u8 gReservedSpritePaletteCount; extern struct PokedexView *gPokedexView; +extern struct SpriteTemplate gUnknown_02024E8C; extern u16 gUnknown_0202FFB8; extern u8 gUnknown_0202FFBA; extern struct PokedexListItem *gUnknown_0202FFBC; extern u8 gUnknown_03005CE8; extern IntrCallback gUnknown_03005CEC; +extern u8 gUnknown_03005E98; extern u8 gPokedexMenu_Gfx[]; extern u8 gUnknown_08E96738[]; extern u8 gUnknown_08E9C6DC[]; extern u8 gUnknown_08E96888[]; extern u8 gUnknown_08E96994[]; -extern struct SpriteSheet gUnknown_083A05CC; -extern struct SpritePalette gUnknown_083A05DC[]; extern u8 gUnknown_0839FA7C[]; extern u8 gUnknown_0839F67C[]; extern u16 gPokedexMenu_Pal[]; extern u16 gPokedexMenu2_Pal[]; extern u8 gUnknown_0839F73C[]; -extern u8 gUnknown_083A05EC[]; -extern u8 gUnknown_083A05F1[]; -extern struct SpriteTemplate gSpriteTemplate_83A053C; +extern u8 gUnknown_0839F8A0[]; +extern u8 gUnknown_0839F988[]; extern struct SpriteTemplate gSpriteTemplate_83A0524; +extern struct SpriteTemplate gSpriteTemplate_83A053C; extern struct SpriteTemplate gSpriteTemplate_83A0554; extern struct SpriteTemplate gSpriteTemplate_83A056C; extern struct SpriteTemplate gSpriteTemplate_83A0584; extern struct SpriteTemplate gSpriteTemplate_83A059C; extern struct SpriteTemplate gSpriteTemplate_83A05B4; +extern struct SpriteSheet gUnknown_083A05CC; +extern struct SpritePalette gUnknown_083A05DC[]; +extern u8 gUnknown_083A05EC[]; +extern u8 gUnknown_083A05F1[]; +extern u8 gUnknown_083A05F8[]; +extern u8 gUnknown_083B4EC4[]; extern u8 gUnknown_083B5558[]; +extern void *const gUnknown_083B5584[]; extern u8 gUnknown_08D00524[]; extern u8 gUnknown_08E96BD4[]; -extern u8 gUnknown_083A05F8[]; -extern u8 gUnknown_0839F8A0[]; -extern u8 gUnknown_0839F988[]; -extern u8 gUnknown_03005E98; -extern u8 gUnknown_083B4EC4[]; +extern const struct SpriteTemplate gUnknown_083B57A4; +extern struct SpriteFrameImage *const gUnknown_083B5794[]; extern u8 gUnknown_08E96ACC[]; extern u8 gUnknown_08E96B58[]; extern const u8 *const gMonFootprintTable[]; - -extern struct PokedexEntry gPokedexEntries[]; +extern const struct SpriteSheet gTrainerFrontPicTable[]; +extern const struct MonCoords gTrainerFrontPicCoords[]; +extern const struct PokedexEntry gPokedexEntries[]; extern void sub_800D74C(); extern const u16 *species_and_otid_get_pal(u16, u32, u32); @@ -2153,7 +2159,6 @@ void Task_InitPageScreenMultistep(u8 taskId) sub_8091154(NationalToHoennOrder(gUnknown_0202FFBC->dexNum), 0xD, 3); else sub_8091154(gUnknown_0202FFBC->dexNum, 0xD, 3); - //_0808F45A sub_80911C8(gUnknown_0202FFBC->dexNum, 0x10, 3); MenuPrint(gDexText_UnknownPoke, 11, 5); MenuPrint(gDexText_UnknownHeight, 16, 7); @@ -2166,7 +2171,6 @@ void Task_InitPageScreenMultistep(u8 taskId) MenuPrint(gPokedexEntries[gUnknown_0202FFBC->dexNum].descriptionPage1, 2, 13); sub_80917CC(14, 0x3FC); } - //_0808F50C else { MenuPrint(gUnknown_083A05F8, 2, 13); @@ -2177,7 +2181,6 @@ void Task_InitPageScreenMultistep(u8 taskId) case 5: if (gTasks[taskId].data[1] == 0) { - //_0808F540 gTasks[taskId].data[4] = (u16)sub_80918EC(gUnknown_0202FFBC->dexNum, 0x30, 0x38, 0); gSprites[gTasks[taskId].data[4]].oam.priority = 0; } @@ -2190,9 +2193,7 @@ void Task_InitPageScreenMultistep(u8 taskId) if (gTasks[taskId].data[2] != 0) r3 = 0x14; if (gTasks[taskId].data[1] != 0) - { r3 |= (1 << (gSprites[gTasks[taskId].data[4]].oam.paletteNum + 0x10)); - } BeginNormalPaletteFade(~r3, 0, 0x10, 0, 0); SetVBlankCallback(gUnknown_03005CEC); gMain.state++; @@ -3758,7 +3759,7 @@ u8 sub_8091260(u16 num, u8 b, u8 c, u8 d) return i; } -void sub_8091304(u8 *name, u8 left, u8 top) +void sub_8091304(const u8 *name, u8 left, u8 top) { u8 str[32]; // Not exactly sure how long this needs to be u8 i; @@ -3963,3 +3964,122 @@ void sub_8091738(u16 a, u16 b, u16 c) } CpuCopy16(arr, (u16 *)(VRAM + b * 0x4000 + c * 0x20), 0x80); } + +void sub_80917CC(u16 a, u16 b) +{ + *(u16 *)(VRAM + a * 0x800 + 0x232) = 0xF000 + b + 0; + *(u16 *)(VRAM + a * 0x800 + 0x234) = 0xF000 + b + 1; + *(u16 *)(VRAM + a * 0x800 + 0x272) = 0xF000 + b + 2; + *(u16 *)(VRAM + a * 0x800 + 0x274) = 0xF000 + b + 3; +} + +u16 sub_8091818(u8 a, u16 b, u16 c, u16 d) +{ + switch (a) + { + case 1: + if (b > c) + b--; + break; + case 0: + if (b < d) + b++; + break; + case 3: + if (b > c) + b--; + else + b = d; + break; + case 2: + if (b < d) + b++; + else + b = c; + break; + } + return b; +} + +void nullsub_59(void) +{ +} + +void sub_8091878(u16 a, u8 b) +{ + gUnknown_02024E8C = gUnknown_083B57A4; + gUnknown_02024E8C.paletteTag = a; + gUnknown_02024E8C.images = gUnknown_083B5794[b]; + gUnknown_02024E8C.anims = gSpriteAnimTable_81E7C64; +} + +void sub_80918B0(u16 a, u8 b) +{ + gUnknown_02024E8C = gUnknown_083B57A4; + gUnknown_02024E8C.paletteTag = a; + gUnknown_02024E8C.images = gUnknown_083B5794[b]; + gUnknown_02024E8C.anims = gUnknown_081EC2A4[0]; +} + +u16 sub_80918EC(u16 num, s16 b, s16 c, u16 d) +{ + u8 spriteId; + + num = NationalPokedexNumToSpecies(num); + switch (num) + { + default: + DecompressPicFromTable_2( + &gMonFrontPicTable[num], + gMonFrontPicCoords[num].coords, + gMonFrontPicCoords[num].y_offset, + (void *)0x02000000, + gUnknown_083B5584[d], + num); + break; + case 0x134: + LoadSpecialPokePic( + &gMonFrontPicTable[num], + gMonFrontPicCoords[num].coords, + gMonFrontPicCoords[num].y_offset, + 0x02000000, + gUnknown_083B5584[d], + num, + gSaveBlock2.pokedex.spindaPersonality, + 1); + break; + case SPECIES_UNOWN: + LoadSpecialPokePic( + &gMonFrontPicTable[num], + gMonFrontPicCoords[num].coords, + gMonFrontPicCoords[num].y_offset, + 0x02000000, + gUnknown_083B5584[d], + num, + gSaveBlock2.pokedex.unownPersonality, + 1); + break; + } + LoadCompressedPalette(gMonPaletteTable[num].data, 0x100 + d * 16, 32); + sub_8091878(d, d); + spriteId = CreateSprite(&gUnknown_02024E8C, b, c, 0); + gSprites[spriteId].oam.paletteNum = d; + return spriteId; +} + +u8 sub_8091A4C(u16 gender, u16 b, u16 c, u16 d) +{ + u8 spriteId; + + DecompressPicFromTable_2( + &gTrainerFrontPicTable[gender], + gTrainerFrontPicCoords[gender].coords, + gTrainerFrontPicCoords[gender].y_offset, + (void *)0x02000000, + gUnknown_083B5584[0], + gender); + sub_80918B0(gender, 0); + spriteId = CreateSprite(&gUnknown_02024E8C, b, c, 0); + gSprites[spriteId].oam.paletteNum = d; + return spriteId; +} -- cgit v1.2.3 From a6275b4d7fe2f2d115a6336dc8cbc668008456ab Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Mon, 12 Jun 2017 22:49:08 -0500 Subject: whitespace --- src/pokedex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/pokedex.c b/src/pokedex.c index 4cd52b2e5..3f1bcf14f 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -4024,7 +4024,7 @@ void sub_80918B0(u16 a, u8 b) u16 sub_80918EC(u16 num, s16 b, s16 c, u16 d) { u8 spriteId; - + num = NationalPokedexNumToSpecies(num); switch (num) { @@ -4070,7 +4070,7 @@ u16 sub_80918EC(u16 num, s16 b, s16 c, u16 d) u8 sub_8091A4C(u16 gender, u16 b, u16 c, u16 d) { u8 spriteId; - + DecompressPicFromTable_2( &gTrainerFrontPicTable[gender], gTrainerFrontPicCoords[gender].coords, -- cgit v1.2.3 From 828237e9b46d41860c5d06e8c0cd02296596e179 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Tue, 13 Jun 2017 00:30:24 -0500 Subject: decompile sub_8091AF8 --- src/pokedex.c | 128 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- src/pokemon_3.c | 2 +- 2 files changed, 124 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/pokedex.c b/src/pokedex.c index 3f1bcf14f..bf383275b 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -67,13 +67,11 @@ extern IntrCallback gUnknown_03005CEC; extern u8 gUnknown_03005E98; extern u8 gPokedexMenu_Gfx[]; extern u8 gUnknown_08E96738[]; -extern u8 gUnknown_08E9C6DC[]; extern u8 gUnknown_08E96888[]; extern u8 gUnknown_08E96994[]; +extern u8 gUnknown_08E9C6DC[]; extern u8 gUnknown_0839FA7C[]; extern u8 gUnknown_0839F67C[]; -extern u16 gPokedexMenu_Pal[]; -extern u16 gPokedexMenu2_Pal[]; extern u8 gUnknown_0839F73C[]; extern u8 gUnknown_0839F8A0[]; extern u8 gUnknown_0839F988[]; @@ -92,16 +90,20 @@ extern u8 gUnknown_083A05F8[]; extern u8 gUnknown_083B4EC4[]; extern u8 gUnknown_083B5558[]; extern void *const gUnknown_083B5584[]; +extern struct SpriteFrameImage *const gUnknown_083B5794[]; +extern const struct SpriteTemplate gUnknown_083B57A4; +extern const u8 gUnknown_083B57BC[][4]; extern u8 gUnknown_08D00524[]; extern u8 gUnknown_08E96BD4[]; -extern const struct SpriteTemplate gUnknown_083B57A4; -extern struct SpriteFrameImage *const gUnknown_083B5794[]; extern u8 gUnknown_08E96ACC[]; extern u8 gUnknown_08E96B58[]; +extern u16 gPokedexMenu_Pal[]; +extern u16 gPokedexMenu2_Pal[]; extern const u8 *const gMonFootprintTable[]; extern const struct SpriteSheet gTrainerFrontPicTable[]; extern const struct MonCoords gTrainerFrontPicCoords[]; extern const struct PokedexEntry gPokedexEntries[]; +extern const struct BaseStats gBaseStats[]; extern void sub_800D74C(); extern const u16 *species_and_otid_get_pal(u16, u32, u32); @@ -4083,3 +4085,119 @@ u8 sub_8091A4C(u16 gender, u16 b, u16 c, u16 d) gSprites[spriteId].oam.paletteNum = d; return spriteId; } + +int sub_8091AF8(u8 a, u8 b, u8 abcGroup, u8 bodyColor, u8 type1, u8 type2) +{ + u16 species; + u16 i; + u16 resultsCount; + u8 types[2]; + + SortPokedex(a, b); + + for (i = 0, resultsCount = 0; i < 386; i++) + { + if (gPokedexView->unk0[i].seen) + { + gPokedexView->unk0[resultsCount] = gPokedexView->unk0[i]; + resultsCount++; + } + } + gPokedexView->unk60C = resultsCount; + + // Search by name + if (abcGroup != 0xFF) + { + for (i = 0, resultsCount = 0; i < gPokedexView->unk60C; i++) + { + u8 r3; + + species = NationalPokedexNumToSpecies(gPokedexView->unk0[i].dexNum); + r3 = gSpeciesNames[species][0]; + if ((r3 >= gUnknown_083B57BC[abcGroup][0] && r3 < gUnknown_083B57BC[abcGroup][0] + gUnknown_083B57BC[abcGroup][1]) + || (r3 >= gUnknown_083B57BC[abcGroup][2] && r3 < gUnknown_083B57BC[abcGroup][2] + gUnknown_083B57BC[abcGroup][3])) + { + gPokedexView->unk0[resultsCount] = gPokedexView->unk0[i]; + resultsCount++; + } + } + gPokedexView->unk60C = resultsCount; + } + + // Search by body color + if (bodyColor != 0xFF) + { + for (i = 0, resultsCount = 0; i < gPokedexView->unk60C; i++) + { + species = NationalPokedexNumToSpecies(gPokedexView->unk0[i].dexNum); + + if (bodyColor == gBaseStats[species].bodyColor) + { + gPokedexView->unk0[resultsCount] = gPokedexView->unk0[i]; + resultsCount++; + } + } + gPokedexView->unk60C = resultsCount; + } + + // Search by type + if (type1 != 0xFF || type2 != 0xFF) + { + if (type1 == 0xFF) + { + type1 = type2; + type2 = 0xFF; + } + + if (type2 == 0xFF) + { + for (i = 0, resultsCount = 0; i < gPokedexView->unk60C; i++) + { + if (gPokedexView->unk0[i].owned) + { + species = NationalPokedexNumToSpecies(gPokedexView->unk0[i].dexNum); + + types[0] = gBaseStats[species].type1; + types[1] = gBaseStats[species].type2; + if (types[0] == type1 || types[1] == type1) + { + gPokedexView->unk0[resultsCount] = gPokedexView->unk0[i]; + resultsCount++; + } + } + } + } + else + { + for (i = 0, resultsCount = 0; i < gPokedexView->unk60C; i++) + { + if (gPokedexView->unk0[i].owned) + { + species = NationalPokedexNumToSpecies(gPokedexView->unk0[i].dexNum); + + types[0] = gBaseStats[species].type1; + types[1] = gBaseStats[species].type2; + if ((types[0] == type1 && types[1] == type2) || (types[0] == type2 && types[1] == type1)) + { + gPokedexView->unk0[resultsCount] = gPokedexView->unk0[i]; + resultsCount++; + } + } + } + } + gPokedexView->unk60C = resultsCount; + } + + if (gPokedexView->unk60C != 0) + { + for (i = gPokedexView->unk60C; i < 386; i++) + { + gPokedexView->unk0[i].dexNum = 0xFFFF; + gPokedexView->unk0[i].seen = FALSE; + gPokedexView->unk0[i].owned = FALSE; + + } + } + + return resultsCount; +} diff --git a/src/pokemon_3.c b/src/pokemon_3.c index f9eb3a7e9..f4eac79a7 100644 --- a/src/pokemon_3.c +++ b/src/pokemon_3.c @@ -1255,7 +1255,7 @@ bool8 IsHMMove2(u16 move) bool8 sub_8040A3C(u16 species) { - return gBaseStats[species].bodyColor >> 7; // XXX: should this be a bitfield instead? + return gBaseStats[species].unk19_7; } s8 sub_8040A54(struct Pokemon *mon, u8 a2) -- cgit v1.2.3 From 83f63ae5f641adb4186c0df21a71f92d1dbbfd5e Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Tue, 13 Jun 2017 01:01:44 -0500 Subject: decompile sub_8091E20 - sub_809204C --- src/pokedex.c | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) (limited to 'src') diff --git a/src/pokedex.c b/src/pokedex.c index bf383275b..518982099 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -104,6 +104,9 @@ extern const struct SpriteSheet gTrainerFrontPicTable[]; extern const struct MonCoords gTrainerFrontPicCoords[]; extern const struct PokedexEntry gPokedexEntries[]; extern const struct BaseStats gBaseStats[]; +extern const u8 gPokedexMenuSearch_Gfx[]; +extern const u8 gUnknown_08E96D2C[]; +extern const u16 gPokedexMenuSearch_Pal[]; extern void sub_800D74C(); extern const u16 *species_and_otid_get_pal(u16, u32, u32); @@ -122,6 +125,14 @@ extern u16 gPokedexOrder_Height[]; void sub_8090B8C(u8); void sub_8090C28(struct Sprite *); u16 NationalPokedexNumToSpecies(u16); +void sub_8091E54(u8); +void sub_809204C(u8); +void sub_809207C(u8); + +void sub_8092AB0(u8); +void sub_8092B68(); +void sub_8092EB0(); +void sub_809308C(); // asm/pokedex_area_screen void ShowPokedexAreaScreen(u16 species, u8 *string); @@ -4201,3 +4212,80 @@ int sub_8091AF8(u8 a, u8 b, u8 abcGroup, u8 bodyColor, u8 type1, u8 type2) return resultsCount; } + +void sub_8091E20(u8 *str) +{ + sub_8072AB0(str, 9, 120, 208, 32, 1); +} + +u8 sub_8091E3C(void) +{ + return CreateTask(sub_8091E54, 0); +} + +void sub_8091E54(u8 taskId) +{ + u16 i; + + switch (gMain.state) + { + default: + case 0: + if (!gPaletteFade.active) + { + gPokedexView->unk64A = 2; + sub_8091060(0); + LZ77UnCompVram(gPokedexMenuSearch_Gfx, (void *)VRAM); + LZ77UnCompVram(gUnknown_08E96D2C, (void *)(VRAM + 0x7800)); + LoadPalette(gPokedexMenuSearch_Pal + 1, 1, 0x7E); + if (!IsNationalPokedexEnabled()) + { + for (i = 0; i < 17; i++) + { + ((u16 *)(VRAM + 0x7A80))[i] = ((u16 *)(VRAM + 0x7B00))[i]; + ((u16 *)(VRAM + 0x7AC0))[i] = ((u16 *)(VRAM + 0x7B40))[i]; + ((u16 *)(VRAM + 0x7B00))[i] = 1; + ((u16 *)(VRAM + 0x7B40))[i] = 1; + } + } + gMain.state = 1; + } + break; + case 1: + SetUpWindowConfig(&gWindowConfig_81E7064); + InitMenuWindow(&gWindowConfig_81E7064); + LoadCompressedObjectPic(&gUnknown_083A05CC); + LoadSpritePalettes(gUnknown_083A05DC); + sub_809308C(taskId); + for (i = 0; i < 16; i++) + gTasks[taskId].data[i] = 0; + sub_8092EB0(taskId); + sub_8092AB0(0); + sub_8092B68(taskId); + gMain.state++; + break; + case 2: + BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); + gMain.state++; + break; + case 3: + REG_BG3CNT = 0x0F03; + REG_DISPCNT = 0x1C40; + gMain.state++; + break; + case 4: + if (!gPaletteFade.active) + { + gTasks[taskId].func = sub_809204C; + gMain.state = 0; + } + break; + } +} + +void sub_809204C(u8 taskId) +{ + sub_8092AB0(gTasks[taskId].data[0]); + sub_8092B68(taskId); + gTasks[taskId].func = sub_809207C; +} -- cgit v1.2.3 From 520514d47d13dd912ef649b0b24470bb0a1e8525 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 13 Jun 2017 08:43:43 -0400 Subject: data/decoration.s, 3 --- src/decoration.c | 46 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index eb932db9e..1796c1c2c 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -1473,6 +1473,42 @@ const union AnimCmd gSpriteAnim_83EC928[] = { ANIMCMD_END }; +const union AnimCmd *const gSpriteAnimTable_83EC930[] = { + gSpriteAnim_83EC928 +}; + +const struct SpriteFrameImage gSpriteImageTable_83EC934[] = { + {.data = (u8 *)&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"); + // text extern u8 gUnknown_0815F399[]; @@ -2299,7 +2335,7 @@ void AddDecorationIconObjectFromFieldObject(struct UnkStruct_02038900 * unk_0203 sub_81008BC(unk_02038900); sub_8100930(unk_02038900->decoration->shape); sub_8100874(unk_02038900); - sub_810070C(unk_02038900->unk_884, ((u16 *)gMapHeader.mapData->secondaryTileset->metatiles + 8 * unk_02038900->decoration->tiles[0])[7] >> 12); + sub_810070C(unk_02038900->palette, ((u16 *)gMapHeader.mapData->secondaryTileset->metatiles + 8 * unk_02038900->decoration->tiles[0])[7] >> 12); LoadSpritePalette(&gUnknown_083EC954); gUnknown_020391A8 = gSprites[gUnknown_03004880.unk4].data0; gUnknown_03004880.unk4 = CreateSprite(&gSpriteTemplate_83EC93C, gUnknown_083EC900[unk_02038900->decoration->shape].x, gUnknown_083EC900[unk_02038900->decoration->shape].y, 0); @@ -3270,11 +3306,11 @@ void sub_8100494(u8 taskId) { if (gTasks[taskId].data[10] == 1) { - gUnknown_083EC96C[gTasks[taskId].data[12]][0](taskId); + gUnknown_083EC96C[gTasks[taskId].data[12]].yesFunc(taskId); return; } else if (gTasks[taskId].data[10] == 2) { - gUnknown_083EC96C[gTasks[taskId].data[12]][1](taskId); + gUnknown_083EC96C[gTasks[taskId].data[12]].noFunc(taskId); return; } if ((gMain.heldKeys & DPAD_ANY) == DPAD_UP) @@ -3349,7 +3385,7 @@ void sub_81006D0(struct UnkStruct_02038900 *unk_02038900) u16 i; for (i=0; i<0x800; i++) { - unk_02038900->unk_084[i] = 0; + unk_02038900->image[i] = 0; } for (i=0; i<0x40; i++) { @@ -3419,7 +3455,7 @@ void sub_8100874(struct UnkStruct_02038900 *unk_02038900) { u16 i; for (i=0; i<0x40; i++) - sub_8100740(&unk_02038900->unk_084[i * 32], unk_02038900->unk_004[i]); + sub_8100740(&unk_02038900->image[i * 32], unk_02038900->unk_004[i]); } u16 sub_810089C(u16 a0) -- cgit v1.2.3 From 8ef6c0004cc1093e1533eb2d41fbde71ee93d22c Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 13 Jun 2017 09:34:28 -0400 Subject: Finish converting data/decoration.s to C objects --- src/decoration.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 1796c1c2c..7595477a3 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -1508,6 +1508,38 @@ 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[] = {ewram}; // text -- cgit v1.2.3 From 6d55caed2df44003de0bb3721612c3ee1a2ae187 Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 13 Jun 2017 18:36:04 -0400 Subject: Enum decoration attributes --- src/decoration.c | 372 +++++++++++++++++++++++++++---------------------------- 1 file changed, 184 insertions(+), 188 deletions(-) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 7595477a3..40a27d4b3 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -18,12 +18,12 @@ #include "field_weather.h" #include "decoration.h" -#define DECORATION(_id, _name, _decor_field_11, _shape, _decor_field_13, _price, _description, _tiles) {\ +#define DECORATION(_id, _name, _permission, _shape, _category, _price, _description, _tiles) {\ .id = _id,\ .name = _name,\ -.decor_field_11 = _decor_field_11,\ +.permission = _permission,\ .shape = _shape,\ -.decor_field_13 = _decor_field_13,\ +.category = _category,\ .price = _price,\ .description = _description,\ .tiles = _tiles\ @@ -1255,127 +1255,127 @@ const u16 DecorGfx_REGISTEEL_DOLL[] = { }; const struct Decoration gDecorations[] = { - DECORATION(DECOR_NONE, _("SMALL DESK"), 0, 0, 0, 0, DecorDesc_SMALL_DESK, DecorGfx_SMALL_DESK), - DECORATION(DECOR_SMALL_DESK, _("SMALL DESK"), 0, 0, 0, 3000, DecorDesc_SMALL_DESK, DecorGfx_SMALL_DESK), - DECORATION(DECOR_POKEMON_DESK, _("POKéMON DESK"), 0, 0, 0, 3000, DecorDesc_POKEMON_DESK, DecorGfx_POKEMON_DESK), - DECORATION(DECOR_HEAVY_DESK, _("HEAVY DESK"), 0, 9, 0, 6000, DecorDesc_HEAVY_DESK, DecorGfx_HEAVY_DESK), - DECORATION(DECOR_RAGGED_DESK, _("RAGGED DESK"), 0, 9, 0, 6000, DecorDesc_RAGGED_DESK, DecorGfx_RAGGED_DESK), - DECORATION(DECOR_COMFORT_DESK, _("COMFORT DESK"), 0, 9, 0, 6000, DecorDesc_COMFORT_DESK, DecorGfx_COMFORT_DESK), - DECORATION(DECOR_PRETTY_DESK, _("PRETTY DESK"), 0, 8, 0, 9000, DecorDesc_PRETTY_DESK, DecorGfx_PRETTY_DESK), - DECORATION(DECOR_BRICK_DESK, _("BRICK DESK"), 0, 8, 0, 9000, DecorDesc_BRICK_DESK, DecorGfx_BRICK_DESK), - DECORATION(DECOR_CAMP_DESK, _("CAMP DESK"), 0, 8, 0, 9000, DecorDesc_CAMP_DESK, DecorGfx_CAMP_DESK), - DECORATION(DECOR_HARD_DESK, _("HARD DESK"), 0, 8, 0, 9000, DecorDesc_HARD_DESK, DecorGfx_HARD_DESK), - DECORATION(DECOR_SMALL_CHAIR, _("SMALL CHAIR"), 1, 0, 1, 2000, DecorDesc_SMALL_CHAIR, DecorGfx_SMALL_CHAIR), - DECORATION(DECOR_POKEMON_CHAIR, _("POKéMON CHAIR"), 1, 0, 1, 2000, DecorDesc_POKEMON_CHAIR, DecorGfx_POKEMON_CHAIR), - DECORATION(DECOR_HEAVY_CHAIR, _("HEAVY CHAIR"), 1, 0, 1, 2000, DecorDesc_HEAVY_CHAIR, DecorGfx_HEAVY_CHAIR), - DECORATION(DECOR_PRETTY_CHAIR, _("PRETTY CHAIR"), 1, 0, 1, 2000, DecorDesc_PRETTY_CHAIR, DecorGfx_PRETTY_CHAIR), - DECORATION(DECOR_COMFORT_CHAIR, _("COMFORT CHAIR"), 1, 0, 1, 2000, DecorDesc_COMFORT_CHAIR, DecorGfx_COMFORT_CHAIR), - DECORATION(DECOR_RAGGED_CHAIR, _("RAGGED CHAIR"), 1, 0, 1, 2000, DecorDesc_RAGGED_CHAIR, DecorGfx_RAGGED_CHAIR), - DECORATION(DECOR_BRICK_CHAIR, _("BRICK CHAIR"), 1, 0, 1, 2000, DecorDesc_BRICK_CHAIR, DecorGfx_BRICK_CHAIR), - DECORATION(DECOR_CAMP_CHAIR, _("CAMP CHAIR"), 1, 0, 1, 2000, DecorDesc_CAMP_CHAIR, DecorGfx_CAMP_CHAIR), - DECORATION(DECOR_HARD_CHAIR, _("HARD CHAIR"), 1, 0, 1, 2000, DecorDesc_HARD_CHAIR, DecorGfx_HARD_CHAIR), - DECORATION(DECOR_RED_PLANT, _("RED PLANT"), 2, 5, 2, 3000, DecorDesc_RED_PLANT, DecorGfx_RED_PLANT), - DECORATION(DECOR_TROPICAL_PLANT, _("TROPICAL PLANT"), 2, 5, 2, 3000, DecorDesc_TROPICAL_PLANT, DecorGfx_TROPICAL_PLANT), - DECORATION(DECOR_PRETTY_FLOWERS, _("PRETTY FLOWERS"), 2, 5, 2, 3000, DecorDesc_PRETTY_FLOWERS, DecorGfx_PRETTY_FLOWERS), - DECORATION(DECOR_COLORFUL_PLANT, _("COLORFUL PLANT"), 2, 4, 2, 5000, DecorDesc_COLORFUL_PLANT, DecorGfx_COLORFUL_PLANT), - DECORATION(DECOR_BIG_PLANT, _("BIG PLANT"), 2, 4, 2, 5000, DecorDesc_BIG_PLANT, DecorGfx_BIG_PLANT), - DECORATION(DECOR_GORGEOUS_PLANT, _("GORGEOUS PLANT"), 2, 4, 2, 5000, DecorDesc_GORGEOUS_PLANT, DecorGfx_GORGEOUS_PLANT), - DECORATION(DECOR_RED_BRICK, _("RED BRICK"), 0, 5, 3, 500, DecorDesc_RED_BRICK, DecorGfx_RED_BRICK), - DECORATION(DECOR_YELLOW_BRICK, _("YELLOW BRICK"), 0, 5, 3, 500, DecorDesc_YELLOW_BRICK, DecorGfx_YELLOW_BRICK), - DECORATION(DECOR_BLUE_BRICK, _("BLUE BRICK"), 0, 5, 3, 500, DecorDesc_BLUE_BRICK, DecorGfx_BLUE_BRICK), - DECORATION(DECOR_RED_BALLOON, _("RED BALLOON"), 1, 0, 3, 500, DecorDesc_RED_BALLOON, DecorGfx_RED_BALLOON), - DECORATION(DECOR_BLUE_BALLOON, _("BLUE BALLOON"), 1, 0, 3, 500, DecorDesc_BLUE_BALLOON, DecorGfx_BLUE_BALLOON), - DECORATION(DECOR_YELLOW_BALLOON, _("YELLOW BALLOON"), 1, 0, 3, 500, DecorDesc_YELLOW_BALLOON, DecorGfx_YELLOW_BALLOON), - DECORATION(DECOR_RED_TENT, _("RED TENT"), 1, 8, 3, 10000, DecorDesc_RED_TENT, DecorGfx_RED_TENT), - DECORATION(DECOR_BLUE_TENT, _("BLUE TENT"), 1, 8, 3, 10000, DecorDesc_BLUE_TENT, DecorGfx_BLUE_TENT), - DECORATION(DECOR_SOLID_BOARD, _("SOLID BOARD"), 1, 5, 3, 3000, DecorDesc_SOLID_BOARD, DecorGfx_SOLID_BOARD), - DECORATION(DECOR_SLIDE, _("SLIDE"), 1, 7, 3, 8000, DecorDesc_SLIDE, DecorGfx_SLIDE), - DECORATION(DECOR_FENCE_LENGTH, _("FENCE LENGTH"), 0, 0, 3, 500, DecorDesc_FENCE_LENGTH, DecorGfx_FENCE_LENGTH), - DECORATION(DECOR_FENCE_WIDTH, _("FENCE WIDTH"), 0, 0, 3, 500, DecorDesc_FENCE_WIDTH, DecorGfx_FENCE_WIDTH), - DECORATION(DECOR_TIRE, _("TIRE"), 0, 4, 3, 800, DecorDesc_TIRE, DecorGfx_TIRE), - DECORATION(DECOR_STAND, _("STAND"), 1, 3, 3, 7000, DecorDesc_STAND, DecorGfx_STAND), - DECORATION(DECOR_MUD_BALL, _("MUD BALL"), 1, 0, 3, 200, DecorDesc_MUD_BALL, DecorGfx_MUD_BALL), - DECORATION(DECOR_BREAKABLE_DOOR, _("BREAKABLE DOOR"), 1, 5, 3, 3000, DecorDesc_BREAKABLE_DOOR, DecorGfx_BREAKABLE_DOOR), - DECORATION(DECOR_SAND_ORNAMENT, _("SAND ORNAMENT"), 2, 5, 3, 3000, DecorDesc_SAND_ORNAMENT, DecorGfx_SAND_ORNAMENT), - DECORATION(DECOR_SILVER_SHIELD, _("SILVER SHIELD"), 2, 5, 3, 0, DecorDesc_SILVER_SHIELD, DecorGfx_SILVER_SHIELD), - DECORATION(DECOR_GOLD_SHIELD, _("GOLD SHIELD"), 2, 5, 3, 0, DecorDesc_GOLD_SHIELD, DecorGfx_GOLD_SHIELD), - DECORATION(DECOR_GLASS_ORNAMENT, _("GLASS ORNAMENT"), 2, 5, 3, 0, DecorDesc_GLASS_ORNAMENT, DecorGfx_GLASS_ORNAMENT), - DECORATION(DECOR_TV, _("TV"), 0, 0, 3, 3000, DecorDesc_TV, DecorGfx_TV), - DECORATION(DECOR_ROUND_TV, _("ROUND TV"), 0, 0, 3, 4000, DecorDesc_ROUND_TV, DecorGfx_ROUND_TV), - DECORATION(DECOR_CUTE_TV, _("CUTE TV"), 0, 0, 3, 4000, DecorDesc_CUTE_TV, DecorGfx_CUTE_TV), - DECORATION(DECOR_GLITTER_MAT, _("GLITTER MAT"), 1, 0, 4, 2000, DecorDesc_GLITTER_MAT, DecorGfx_GLITTER_MAT), - DECORATION(DECOR_JUMP_MAT, _("JUMP MAT"), 1, 0, 4, 2000, DecorDesc_JUMP_MAT, DecorGfx_JUMP_MAT), - DECORATION(DECOR_SPIN_MAT, _("SPIN MAT"), 1, 0, 4, 2000, DecorDesc_SPIN_MAT, DecorGfx_SPIN_MAT), - DECORATION(DECOR_C_LOW_NOTE_MAT, _("C Low NOTE MAT"), 1, 0, 4, 500, DecorDesc_C_LOW_NOTE_MAT, DecorGfx_C_LOW_NOTE_MAT), - DECORATION(DECOR_D_NOTE_MAT, _("D NOTE MAT"), 1, 0, 4, 500, DecorDesc_D_NOTE_MAT, DecorGfx_D_NOTE_MAT), - DECORATION(DECOR_E_NOTE_MAT, _("E NOTE MAT"), 1, 0, 4, 500, DecorDesc_E_NOTE_MAT, DecorGfx_E_NOTE_MAT), - DECORATION(DECOR_F_NOTE_MAT, _("F NOTE MAT"), 1, 0, 4, 500, DecorDesc_F_NOTE_MAT, DecorGfx_F_NOTE_MAT), - DECORATION(DECOR_G_NOTE_MAT, _("G NOTE MAT"), 1, 0, 4, 500, DecorDesc_G_NOTE_MAT, DecorGfx_G_NOTE_MAT), - DECORATION(DECOR_A_NOTE_MAT, _("A NOTE MAT"), 1, 0, 4, 500, DecorDesc_A_NOTE_MAT, DecorGfx_A_NOTE_MAT), - DECORATION(DECOR_B_NOTE_MAT, _("B NOTE MAT"), 1, 0, 4, 500, DecorDesc_B_NOTE_MAT, DecorGfx_B_NOTE_MAT), - DECORATION(DECOR_C_HIGH_NOTE_MAT, _("C High NOTE MAT"), 1, 0, 4, 500, DecorDesc_C_HIGH_NOTE_MAT, DecorGfx_C_HIGH_NOTE_MAT), - DECORATION(DECOR_SURF_MAT, _("SURF MAT"), 1, 8, 4, 4000, DecorDesc_SURF_MAT, DecorGfx_SURF_MAT), - DECORATION(DECOR_THUNDER_MAT, _("THUNDER MAT"), 1, 8, 4, 4000, DecorDesc_THUNDER_MAT, DecorGfx_THUNDER_MAT), - DECORATION(DECOR_FIRE_BLAST_MAT, _("FIRE BLAST MAT"), 1, 8, 4, 4000, DecorDesc_FIRE_BLAST_MAT, DecorGfx_FIRE_BLAST_MAT), - DECORATION(DECOR_POWDER_SNOW_MAT, _("POWDER SNOW MAT"), 1, 8, 4, 4000, DecorDesc_POWDER_SNOW_MAT, DecorGfx_POWDER_SNOW_MAT), - DECORATION(DECOR_ATTRACT_MAT, _("ATTRACT MAT"), 1, 8, 4, 4000, DecorDesc_ATTRACT_MAT, DecorGfx_ATTRACT_MAT), - DECORATION(DECOR_FISSURE_MAT, _("FISSURE MAT"), 1, 8, 4, 4000, DecorDesc_FISSURE_MAT, DecorGfx_FISSURE_MAT), - DECORATION(DECOR_SPIKES_MAT, _("SPIKES MAT"), 1, 8, 4, 4000, DecorDesc_SPIKES_MAT, DecorGfx_SPIKES_MAT), - DECORATION(DECOR_BALL_POSTER, _("BALL POSTER"), 3, 0, 5, 1000, DecorDesc_BALL_POSTER, DecorGfx_BALL_POSTER), - DECORATION(DECOR_GREEN_POSTER, _("GREEN POSTER"), 3, 0, 5, 1000, DecorDesc_GREEN_POSTER, DecorGfx_GREEN_POSTER), - DECORATION(DECOR_RED_POSTER, _("RED POSTER"), 3, 0, 5, 1000, DecorDesc_RED_POSTER, DecorGfx_RED_POSTER), - DECORATION(DECOR_BLUE_POSTER, _("BLUE POSTER"), 3, 0, 5, 1000, DecorDesc_BLUE_POSTER, DecorGfx_BLUE_POSTER), - DECORATION(DECOR_CUTE_POSTER, _("CUTE POSTER"), 3, 0, 5, 1000, DecorDesc_CUTE_POSTER, DecorGfx_CUTE_POSTER), - DECORATION(DECOR_PIKA_POSTER, _("PIKA POSTER"), 3, 1, 5, 1500, DecorDesc_PIKA_POSTER, DecorGfx_PIKA_POSTER), - DECORATION(DECOR_LONG_POSTER, _("LONG POSTER"), 3, 1, 5, 1500, DecorDesc_LONG_POSTER, DecorGfx_LONG_POSTER), - DECORATION(DECOR_SEA_POSTER, _("SEA POSTER"), 3, 1, 5, 1500, DecorDesc_SEA_POSTER, DecorGfx_SEA_POSTER), - DECORATION(DECOR_SKY_POSTER, _("SKY POSTER"), 3, 1, 5, 1500, DecorDesc_SKY_POSTER, DecorGfx_SKY_POSTER), - DECORATION(DECOR_KISS_POSTER, _("KISS POSTER"), 3, 1, 5, 1500, DecorDesc_KISS_POSTER, DecorGfx_KISS_POSTER), - DECORATION(DECOR_PICHU_DOLL, _("PICHU DOLL"), 4, 0, 6, 3000, DecorDesc_PICHU_DOLL, DecorGfx_PICHU_DOLL), - DECORATION(DECOR_PIKACHU_DOLL, _("PIKACHU DOLL"), 4, 0, 6, 3000, DecorDesc_PIKACHU_DOLL, DecorGfx_PIKACHU_DOLL), - DECORATION(DECOR_MARILL_DOLL, _("MARILL DOLL"), 4, 0, 6, 3000, DecorDesc_MARILL_DOLL, DecorGfx_MARILL_DOLL), - DECORATION(DECOR_TOGEPI_DOLL, _("TOGEPI DOLL"), 4, 0, 6, 3000, DecorDesc_TOGEPI_DOLL, DecorGfx_TOGEPI_DOLL), - DECORATION(DECOR_CYNDAQUIL_DOLL, _("CYNDAQUIL DOLL"), 4, 0, 6, 3000, DecorDesc_CYNDAQUIL_DOLL, DecorGfx_CYNDAQUIL_DOLL), - DECORATION(DECOR_CHIKORITA_DOLL, _("CHIKORITA DOLL"), 4, 0, 6, 3000, DecorDesc_CHIKORITA_DOLL, DecorGfx_CHIKORITA_DOLL), - DECORATION(DECOR_TOTODILE_DOLL, _("TOTODILE DOLL"), 4, 0, 6, 3000, DecorDesc_TOTODILE_DOLL, DecorGfx_TOTODILE_DOLL), - DECORATION(DECOR_JIGGLYPUFF_DOLL, _("JIGGLYPUFF DOLL"), 4, 0, 6, 3000, DecorDesc_JIGGLYPUFF_DOLL, DecorGfx_JIGGLYPUFF_DOLL), - DECORATION(DECOR_MEOWTH_DOLL, _("MEOWTH DOLL"), 4, 0, 6, 3000, DecorDesc_MEOWTH_DOLL, DecorGfx_MEOWTH_DOLL), - DECORATION(DECOR_CLEFAIRY_DOLL, _("CLEFAIRY DOLL"), 4, 0, 6, 3000, DecorDesc_CLEFAIRY_DOLL, DecorGfx_CLEFAIRY_DOLL), - DECORATION(DECOR_DITTO_DOLL, _("DITTO DOLL"), 4, 0, 6, 3000, DecorDesc_DITTO_DOLL, DecorGfx_DITTO_DOLL), - DECORATION(DECOR_SMOOCHUM_DOLL, _("SMOOCHUM DOLL"), 4, 0, 6, 3000, DecorDesc_SMOOCHUM_DOLL, DecorGfx_SMOOCHUM_DOLL), - DECORATION(DECOR_TREECKO_DOLL, _("TREECKO DOLL"), 4, 0, 6, 3000, DecorDesc_TREECKO_DOLL, DecorGfx_TREECKO_DOLL), - DECORATION(DECOR_TORCHIC_DOLL, _("TORCHIC DOLL"), 4, 0, 6, 3000, DecorDesc_TORCHIC_DOLL, DecorGfx_TORCHIC_DOLL), - DECORATION(DECOR_MUDKIP_DOLL, _("MUDKIP DOLL"), 4, 0, 6, 3000, DecorDesc_MUDKIP_DOLL, DecorGfx_MUDKIP_DOLL), - DECORATION(DECOR_DUSKULL_DOLL, _("DUSKULL DOLL"), 4, 0, 6, 3000, DecorDesc_DUSKULL_DOLL, DecorGfx_DUSKULL_DOLL), - DECORATION(DECOR_WYNAUT_DOLL, _("WYNAUT DOLL"), 4, 0, 6, 3000, DecorDesc_WYNAUT_DOLL, DecorGfx_WYNAUT_DOLL), - DECORATION(DECOR_BALTOY_DOLL, _("BALTOY DOLL"), 4, 0, 6, 3000, DecorDesc_BALTOY_DOLL, DecorGfx_BALTOY_DOLL), - DECORATION(DECOR_KECLEON_DOLL, _("KECLEON DOLL"), 4, 0, 6, 3000, DecorDesc_KECLEON_DOLL, DecorGfx_KECLEON_DOLL), - DECORATION(DECOR_AZURILL_DOLL, _("AZURILL DOLL"), 4, 0, 6, 3000, DecorDesc_AZURILL_DOLL, DecorGfx_AZURILL_DOLL), - DECORATION(DECOR_SKITTY_DOLL, _("SKITTY DOLL"), 4, 0, 6, 3000, DecorDesc_SKITTY_DOLL, DecorGfx_SKITTY_DOLL), - DECORATION(DECOR_SWABLU_DOLL, _("SWABLU DOLL"), 4, 0, 6, 3000, DecorDesc_SWABLU_DOLL, DecorGfx_SWABLU_DOLL), - DECORATION(DECOR_GULPIN_DOLL, _("GULPIN DOLL"), 4, 0, 6, 3000, DecorDesc_GULPIN_DOLL, DecorGfx_GULPIN_DOLL), - DECORATION(DECOR_LOTAD_DOLL, _("LOTAD DOLL"), 4, 0, 6, 3000, DecorDesc_LOTAD_DOLL, DecorGfx_LOTAD_DOLL), - DECORATION(DECOR_SEEDOT_DOLL, _("SEEDOT DOLL"), 4, 0, 6, 3000, DecorDesc_SEEDOT_DOLL, DecorGfx_SEEDOT_DOLL), - DECORATION(DECOR_PIKA_CUSHION, _("PIKA CUSHION"), 4, 0, 7, 2000, DecorDesc_PIKA_CUSHION, DecorGfx_PIKA_CUSHION), - DECORATION(DECOR_ROUND_CUSHION, _("ROUND CUSHION"), 4, 0, 7, 2000, DecorDesc_ROUND_CUSHION, DecorGfx_ROUND_CUSHION), - DECORATION(DECOR_KISS_CUSHION, _("KISS CUSHION"), 4, 0, 7, 2000, DecorDesc_KISS_CUSHION, DecorGfx_KISS_CUSHION), - DECORATION(DECOR_ZIGZAG_CUSHION, _("ZIGZAG CUSHION"), 4, 0, 7, 2000, DecorDesc_ZIGZAG_CUSHION, DecorGfx_ZIGZAG_CUSHION), - DECORATION(DECOR_SPIN_CUSHION, _("SPIN CUSHION"), 4, 0, 7, 2000, DecorDesc_SPIN_CUSHION, DecorGfx_SPIN_CUSHION), - DECORATION(DECOR_DIAMOND_CUSHION, _("DIAMOND CUSHION"), 4, 0, 7, 2000, DecorDesc_DIAMOND_CUSHION, DecorGfx_DIAMOND_CUSHION), - DECORATION(DECOR_BALL_CUSHION, _("BALL CUSHION"), 4, 0, 7, 2000, DecorDesc_BALL_CUSHION, DecorGfx_BALL_CUSHION), - DECORATION(DECOR_GRASS_CUSHION, _("GRASS CUSHION"), 4, 0, 7, 2000, DecorDesc_GRASS_CUSHION, DecorGfx_GRASS_CUSHION), - DECORATION(DECOR_FIRE_CUSHION, _("FIRE CUSHION"), 4, 0, 7, 2000, DecorDesc_FIRE_CUSHION, DecorGfx_FIRE_CUSHION), - DECORATION(DECOR_WATER_CUSHION, _("WATER CUSHION"), 4, 0, 7, 2000, DecorDesc_WATER_CUSHION, DecorGfx_WATER_CUSHION), - DECORATION(DECOR_SNORLAX_DOLL, _("SNORLAX DOLL"), 4, 5, 6, 10000, DecorDesc_SNORLAX_DOLL, DecorGfx_SNORLAX_DOLL), - DECORATION(DECOR_RHYDON_DOLL, _("RHYDON DOLL"), 4, 5, 6, 10000, DecorDesc_RHYDON_DOLL, DecorGfx_RHYDON_DOLL), - DECORATION(DECOR_LAPRAS_DOLL, _("LAPRAS DOLL"), 4, 5, 6, 10000, DecorDesc_LAPRAS_DOLL, DecorGfx_LAPRAS_DOLL), - DECORATION(DECOR_VENUSAUR_DOLL, _("VENUSAUR DOLL"), 4, 5, 6, 10000, DecorDesc_VENUSAUR_DOLL, DecorGfx_VENUSAUR_DOLL), - DECORATION(DECOR_CHARIZARD_DOLL, _("CHARIZARD DOLL"), 4, 5, 6, 10000, DecorDesc_CHARIZARD_DOLL, DecorGfx_CHARIZARD_DOLL), - DECORATION(DECOR_BLASTOISE_DOLL, _("BLASTOISE DOLL"), 4, 5, 6, 10000, DecorDesc_BLASTOISE_DOLL, DecorGfx_BLASTOISE_DOLL), - DECORATION(DECOR_WAILMER_DOLL, _("WAILMER DOLL"), 4, 5, 6, 10000, DecorDesc_WAILMER_DOLL, DecorGfx_WAILMER_DOLL), - DECORATION(DECOR_REGIROCK_DOLL, _("REGIROCK DOLL"), 4, 5, 6, 10000, DecorDesc_REGIROCK_DOLL, DecorGfx_REGIROCK_DOLL), - DECORATION(DECOR_REGICE_DOLL, _("REGICE DOLL"), 4, 5, 6, 10000, DecorDesc_REGICE_DOLL, DecorGfx_REGICE_DOLL), - DECORATION(DECOR_REGISTEEL_DOLL, _("REGISTEEL DOLL"), 4, 5, 6, 10000, DecorDesc_REGISTEEL_DOLL, DecorGfx_REGISTEEL_DOLL) + DECORATION(DECOR_NONE, _("SMALL DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_DESK, 0, DecorDesc_SMALL_DESK, DecorGfx_SMALL_DESK), + DECORATION(DECOR_SMALL_DESK, _("SMALL DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_DESK, 3000, DecorDesc_SMALL_DESK, DecorGfx_SMALL_DESK), + DECORATION(DECOR_POKEMON_DESK, _("POKéMON DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_DESK, 3000, DecorDesc_POKEMON_DESK, DecorGfx_POKEMON_DESK), + DECORATION(DECOR_HEAVY_DESK, _("HEAVY DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_3x2, DECORCAT_DESK, 6000, DecorDesc_HEAVY_DESK, DecorGfx_HEAVY_DESK), + DECORATION(DECOR_RAGGED_DESK, _("RAGGED DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_3x2, DECORCAT_DESK, 6000, DecorDesc_RAGGED_DESK, DecorGfx_RAGGED_DESK), + DECORATION(DECOR_COMFORT_DESK, _("COMFORT DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_3x2, DECORCAT_DESK, 6000, DecorDesc_COMFORT_DESK, DecorGfx_COMFORT_DESK), + DECORATION(DECOR_PRETTY_DESK, _("PRETTY DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_3x3, DECORCAT_DESK, 9000, DecorDesc_PRETTY_DESK, DecorGfx_PRETTY_DESK), + DECORATION(DECOR_BRICK_DESK, _("BRICK DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_3x3, DECORCAT_DESK, 9000, DecorDesc_BRICK_DESK, DecorGfx_BRICK_DESK), + DECORATION(DECOR_CAMP_DESK, _("CAMP DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_3x3, DECORCAT_DESK, 9000, DecorDesc_CAMP_DESK, DecorGfx_CAMP_DESK), + DECORATION(DECOR_HARD_DESK, _("HARD DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_3x3, DECORCAT_DESK, 9000, DecorDesc_HARD_DESK, DecorGfx_HARD_DESK), + DECORATION(DECOR_SMALL_CHAIR, _("SMALL CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_SMALL_CHAIR, DecorGfx_SMALL_CHAIR), + DECORATION(DECOR_POKEMON_CHAIR, _("POKéMON CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_POKEMON_CHAIR, DecorGfx_POKEMON_CHAIR), + DECORATION(DECOR_HEAVY_CHAIR, _("HEAVY CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_HEAVY_CHAIR, DecorGfx_HEAVY_CHAIR), + DECORATION(DECOR_PRETTY_CHAIR, _("PRETTY CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_PRETTY_CHAIR, DecorGfx_PRETTY_CHAIR), + DECORATION(DECOR_COMFORT_CHAIR, _("COMFORT CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_COMFORT_CHAIR, DecorGfx_COMFORT_CHAIR), + DECORATION(DECOR_RAGGED_CHAIR, _("RAGGED CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_RAGGED_CHAIR, DecorGfx_RAGGED_CHAIR), + DECORATION(DECOR_BRICK_CHAIR, _("BRICK CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_BRICK_CHAIR, DecorGfx_BRICK_CHAIR), + DECORATION(DECOR_CAMP_CHAIR, _("CAMP CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_CAMP_CHAIR, DecorGfx_CAMP_CHAIR), + DECORATION(DECOR_HARD_CHAIR, _("HARD CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_HARD_CHAIR, DecorGfx_HARD_CHAIR), + DECORATION(DECOR_RED_PLANT, _("RED PLANT"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_1x2, DECORCAT_PLANT, 3000, DecorDesc_RED_PLANT, DecorGfx_RED_PLANT), + DECORATION(DECOR_TROPICAL_PLANT, _("TROPICAL PLANT"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_1x2, DECORCAT_PLANT, 3000, DecorDesc_TROPICAL_PLANT, DecorGfx_TROPICAL_PLANT), + DECORATION(DECOR_PRETTY_FLOWERS, _("PRETTY FLOWERS"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_1x2, DECORCAT_PLANT, 3000, DecorDesc_PRETTY_FLOWERS, DecorGfx_PRETTY_FLOWERS), + DECORATION(DECOR_COLORFUL_PLANT, _("COLORFUL PLANT"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_2x2, DECORCAT_PLANT, 5000, DecorDesc_COLORFUL_PLANT, DecorGfx_COLORFUL_PLANT), + DECORATION(DECOR_BIG_PLANT, _("BIG PLANT"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_2x2, DECORCAT_PLANT, 5000, DecorDesc_BIG_PLANT, DecorGfx_BIG_PLANT), + DECORATION(DECOR_GORGEOUS_PLANT, _("GORGEOUS PLANT"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_2x2, DECORCAT_PLANT, 5000, DecorDesc_GORGEOUS_PLANT, DecorGfx_GORGEOUS_PLANT), + DECORATION(DECOR_RED_BRICK, _("RED BRICK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 500, DecorDesc_RED_BRICK, DecorGfx_RED_BRICK), + DECORATION(DECOR_YELLOW_BRICK, _("YELLOW BRICK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 500, DecorDesc_YELLOW_BRICK, DecorGfx_YELLOW_BRICK), + DECORATION(DECOR_BLUE_BRICK, _("BLUE BRICK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 500, DecorDesc_BLUE_BRICK, DecorGfx_BLUE_BRICK), + DECORATION(DECOR_RED_BALLOON, _("RED BALLOON"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 500, DecorDesc_RED_BALLOON, DecorGfx_RED_BALLOON), + DECORATION(DECOR_BLUE_BALLOON, _("BLUE BALLOON"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 500, DecorDesc_BLUE_BALLOON, DecorGfx_BLUE_BALLOON), + DECORATION(DECOR_YELLOW_BALLOON, _("YELLOW BALLOON"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 500, DecorDesc_YELLOW_BALLOON, DecorGfx_YELLOW_BALLOON), + DECORATION(DECOR_RED_TENT, _("RED TENT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_ORNAMENT, 10000, DecorDesc_RED_TENT, DecorGfx_RED_TENT), + DECORATION(DECOR_BLUE_TENT, _("BLUE TENT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_ORNAMENT, 10000, DecorDesc_BLUE_TENT, DecorGfx_BLUE_TENT), + DECORATION(DECOR_SOLID_BOARD, _("SOLID BOARD"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 3000, DecorDesc_SOLID_BOARD, DecorGfx_SOLID_BOARD), + DECORATION(DECOR_SLIDE, _("SLIDE"), DECORPERM_PASS_FLOOR, DECORSHAPE_2x4, DECORCAT_ORNAMENT, 8000, DecorDesc_SLIDE, DecorGfx_SLIDE), + DECORATION(DECOR_FENCE_LENGTH, _("FENCE LENGTH"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 500, DecorDesc_FENCE_LENGTH, DecorGfx_FENCE_LENGTH), + DECORATION(DECOR_FENCE_WIDTH, _("FENCE WIDTH"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 500, DecorDesc_FENCE_WIDTH, DecorGfx_FENCE_WIDTH), + DECORATION(DECOR_TIRE, _("TIRE"), DECORPERM_SOLID_FLOOR, DECORSHAPE_2x2, DECORCAT_ORNAMENT, 800, DecorDesc_TIRE, DecorGfx_TIRE), + DECORATION(DECOR_STAND, _("STAND"), DECORPERM_PASS_FLOOR, DECORSHAPE_4x2, DECORCAT_ORNAMENT, 7000, DecorDesc_STAND, DecorGfx_STAND), + DECORATION(DECOR_MUD_BALL, _("MUD BALL"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 200, DecorDesc_MUD_BALL, DecorGfx_MUD_BALL), + DECORATION(DECOR_BREAKABLE_DOOR, _("BREAKABLE DOOR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 3000, DecorDesc_BREAKABLE_DOOR, DecorGfx_BREAKABLE_DOOR), + DECORATION(DECOR_SAND_ORNAMENT, _("SAND ORNAMENT"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 3000, DecorDesc_SAND_ORNAMENT, DecorGfx_SAND_ORNAMENT), + DECORATION(DECOR_SILVER_SHIELD, _("SILVER SHIELD"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 0, DecorDesc_SILVER_SHIELD, DecorGfx_SILVER_SHIELD), + DECORATION(DECOR_GOLD_SHIELD, _("GOLD SHIELD"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 0, DecorDesc_GOLD_SHIELD, DecorGfx_GOLD_SHIELD), + DECORATION(DECOR_GLASS_ORNAMENT, _("GLASS ORNAMENT"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 0, DecorDesc_GLASS_ORNAMENT, DecorGfx_GLASS_ORNAMENT), + DECORATION(DECOR_TV, _("TV"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 3000, DecorDesc_TV, DecorGfx_TV), + DECORATION(DECOR_ROUND_TV, _("ROUND TV"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 4000, DecorDesc_ROUND_TV, DecorGfx_ROUND_TV), + DECORATION(DECOR_CUTE_TV, _("CUTE TV"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 4000, DecorDesc_CUTE_TV, DecorGfx_CUTE_TV), + DECORATION(DECOR_GLITTER_MAT, _("GLITTER MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 2000, DecorDesc_GLITTER_MAT, DecorGfx_GLITTER_MAT), + DECORATION(DECOR_JUMP_MAT, _("JUMP MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 2000, DecorDesc_JUMP_MAT, DecorGfx_JUMP_MAT), + DECORATION(DECOR_SPIN_MAT, _("SPIN MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 2000, DecorDesc_SPIN_MAT, DecorGfx_SPIN_MAT), + DECORATION(DECOR_C_LOW_NOTE_MAT, _("C Low NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_C_LOW_NOTE_MAT, DecorGfx_C_LOW_NOTE_MAT), + DECORATION(DECOR_D_NOTE_MAT, _("D NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_D_NOTE_MAT, DecorGfx_D_NOTE_MAT), + DECORATION(DECOR_E_NOTE_MAT, _("E NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_E_NOTE_MAT, DecorGfx_E_NOTE_MAT), + DECORATION(DECOR_F_NOTE_MAT, _("F NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_F_NOTE_MAT, DecorGfx_F_NOTE_MAT), + DECORATION(DECOR_G_NOTE_MAT, _("G NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_G_NOTE_MAT, DecorGfx_G_NOTE_MAT), + DECORATION(DECOR_A_NOTE_MAT, _("A NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_A_NOTE_MAT, DecorGfx_A_NOTE_MAT), + DECORATION(DECOR_B_NOTE_MAT, _("B NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_B_NOTE_MAT, DecorGfx_B_NOTE_MAT), + DECORATION(DECOR_C_HIGH_NOTE_MAT, _("C High NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_C_HIGH_NOTE_MAT, DecorGfx_C_HIGH_NOTE_MAT), + DECORATION(DECOR_SURF_MAT, _("SURF MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_MAT, 4000, DecorDesc_SURF_MAT, DecorGfx_SURF_MAT), + DECORATION(DECOR_THUNDER_MAT, _("THUNDER MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_MAT, 4000, DecorDesc_THUNDER_MAT, DecorGfx_THUNDER_MAT), + DECORATION(DECOR_FIRE_BLAST_MAT, _("FIRE BLAST MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_MAT, 4000, DecorDesc_FIRE_BLAST_MAT, DecorGfx_FIRE_BLAST_MAT), + DECORATION(DECOR_POWDER_SNOW_MAT, _("POWDER SNOW MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_MAT, 4000, DecorDesc_POWDER_SNOW_MAT, DecorGfx_POWDER_SNOW_MAT), + DECORATION(DECOR_ATTRACT_MAT, _("ATTRACT MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_MAT, 4000, DecorDesc_ATTRACT_MAT, DecorGfx_ATTRACT_MAT), + DECORATION(DECOR_FISSURE_MAT, _("FISSURE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_MAT, 4000, DecorDesc_FISSURE_MAT, DecorGfx_FISSURE_MAT), + DECORATION(DECOR_SPIKES_MAT, _("SPIKES MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_MAT, 4000, DecorDesc_SPIKES_MAT, DecorGfx_SPIKES_MAT), + DECORATION(DECOR_BALL_POSTER, _("BALL POSTER"), DECORPERM_NA_WALL, DECORSHAPE_1x1, DECORCAT_POSTER, 1000, DecorDesc_BALL_POSTER, DecorGfx_BALL_POSTER), + DECORATION(DECOR_GREEN_POSTER, _("GREEN POSTER"), DECORPERM_NA_WALL, DECORSHAPE_1x1, DECORCAT_POSTER, 1000, DecorDesc_GREEN_POSTER, DecorGfx_GREEN_POSTER), + DECORATION(DECOR_RED_POSTER, _("RED POSTER"), DECORPERM_NA_WALL, DECORSHAPE_1x1, DECORCAT_POSTER, 1000, DecorDesc_RED_POSTER, DecorGfx_RED_POSTER), + DECORATION(DECOR_BLUE_POSTER, _("BLUE POSTER"), DECORPERM_NA_WALL, DECORSHAPE_1x1, DECORCAT_POSTER, 1000, DecorDesc_BLUE_POSTER, DecorGfx_BLUE_POSTER), + DECORATION(DECOR_CUTE_POSTER, _("CUTE POSTER"), DECORPERM_NA_WALL, DECORSHAPE_1x1, DECORCAT_POSTER, 1000, DecorDesc_CUTE_POSTER, DecorGfx_CUTE_POSTER), + DECORATION(DECOR_PIKA_POSTER, _("PIKA POSTER"), DECORPERM_NA_WALL, DECORSHAPE_2x1, DECORCAT_POSTER, 1500, DecorDesc_PIKA_POSTER, DecorGfx_PIKA_POSTER), + DECORATION(DECOR_LONG_POSTER, _("LONG POSTER"), DECORPERM_NA_WALL, DECORSHAPE_2x1, DECORCAT_POSTER, 1500, DecorDesc_LONG_POSTER, DecorGfx_LONG_POSTER), + DECORATION(DECOR_SEA_POSTER, _("SEA POSTER"), DECORPERM_NA_WALL, DECORSHAPE_2x1, DECORCAT_POSTER, 1500, DecorDesc_SEA_POSTER, DecorGfx_SEA_POSTER), + DECORATION(DECOR_SKY_POSTER, _("SKY POSTER"), DECORPERM_NA_WALL, DECORSHAPE_2x1, DECORCAT_POSTER, 1500, DecorDesc_SKY_POSTER, DecorGfx_SKY_POSTER), + DECORATION(DECOR_KISS_POSTER, _("KISS POSTER"), DECORPERM_NA_WALL, DECORSHAPE_2x1, DECORCAT_POSTER, 1500, DecorDesc_KISS_POSTER, DecorGfx_KISS_POSTER), + DECORATION(DECOR_PICHU_DOLL, _("PICHU DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_PICHU_DOLL, DecorGfx_PICHU_DOLL), + DECORATION(DECOR_PIKACHU_DOLL, _("PIKACHU DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_PIKACHU_DOLL, DecorGfx_PIKACHU_DOLL), + DECORATION(DECOR_MARILL_DOLL, _("MARILL DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_MARILL_DOLL, DecorGfx_MARILL_DOLL), + DECORATION(DECOR_TOGEPI_DOLL, _("TOGEPI DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_TOGEPI_DOLL, DecorGfx_TOGEPI_DOLL), + DECORATION(DECOR_CYNDAQUIL_DOLL, _("CYNDAQUIL DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_CYNDAQUIL_DOLL, DecorGfx_CYNDAQUIL_DOLL), + DECORATION(DECOR_CHIKORITA_DOLL, _("CHIKORITA DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_CHIKORITA_DOLL, DecorGfx_CHIKORITA_DOLL), + DECORATION(DECOR_TOTODILE_DOLL, _("TOTODILE DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_TOTODILE_DOLL, DecorGfx_TOTODILE_DOLL), + DECORATION(DECOR_JIGGLYPUFF_DOLL, _("JIGGLYPUFF DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_JIGGLYPUFF_DOLL, DecorGfx_JIGGLYPUFF_DOLL), + DECORATION(DECOR_MEOWTH_DOLL, _("MEOWTH DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_MEOWTH_DOLL, DecorGfx_MEOWTH_DOLL), + DECORATION(DECOR_CLEFAIRY_DOLL, _("CLEFAIRY DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_CLEFAIRY_DOLL, DecorGfx_CLEFAIRY_DOLL), + DECORATION(DECOR_DITTO_DOLL, _("DITTO DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_DITTO_DOLL, DecorGfx_DITTO_DOLL), + DECORATION(DECOR_SMOOCHUM_DOLL, _("SMOOCHUM DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_SMOOCHUM_DOLL, DecorGfx_SMOOCHUM_DOLL), + DECORATION(DECOR_TREECKO_DOLL, _("TREECKO DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_TREECKO_DOLL, DecorGfx_TREECKO_DOLL), + DECORATION(DECOR_TORCHIC_DOLL, _("TORCHIC DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_TORCHIC_DOLL, DecorGfx_TORCHIC_DOLL), + DECORATION(DECOR_MUDKIP_DOLL, _("MUDKIP DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_MUDKIP_DOLL, DecorGfx_MUDKIP_DOLL), + DECORATION(DECOR_DUSKULL_DOLL, _("DUSKULL DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_DUSKULL_DOLL, DecorGfx_DUSKULL_DOLL), + DECORATION(DECOR_WYNAUT_DOLL, _("WYNAUT DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_WYNAUT_DOLL, DecorGfx_WYNAUT_DOLL), + DECORATION(DECOR_BALTOY_DOLL, _("BALTOY DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_BALTOY_DOLL, DecorGfx_BALTOY_DOLL), + DECORATION(DECOR_KECLEON_DOLL, _("KECLEON DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_KECLEON_DOLL, DecorGfx_KECLEON_DOLL), + DECORATION(DECOR_AZURILL_DOLL, _("AZURILL DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_AZURILL_DOLL, DecorGfx_AZURILL_DOLL), + DECORATION(DECOR_SKITTY_DOLL, _("SKITTY DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_SKITTY_DOLL, DecorGfx_SKITTY_DOLL), + DECORATION(DECOR_SWABLU_DOLL, _("SWABLU DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_SWABLU_DOLL, DecorGfx_SWABLU_DOLL), + DECORATION(DECOR_GULPIN_DOLL, _("GULPIN DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_GULPIN_DOLL, DecorGfx_GULPIN_DOLL), + DECORATION(DECOR_LOTAD_DOLL, _("LOTAD DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_LOTAD_DOLL, DecorGfx_LOTAD_DOLL), + DECORATION(DECOR_SEEDOT_DOLL, _("SEEDOT DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_SEEDOT_DOLL, DecorGfx_SEEDOT_DOLL), + DECORATION(DECOR_PIKA_CUSHION, _("PIKA CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_PIKA_CUSHION, DecorGfx_PIKA_CUSHION), + DECORATION(DECOR_ROUND_CUSHION, _("ROUND CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_ROUND_CUSHION, DecorGfx_ROUND_CUSHION), + DECORATION(DECOR_KISS_CUSHION, _("KISS CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_KISS_CUSHION, DecorGfx_KISS_CUSHION), + DECORATION(DECOR_ZIGZAG_CUSHION, _("ZIGZAG CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_ZIGZAG_CUSHION, DecorGfx_ZIGZAG_CUSHION), + DECORATION(DECOR_SPIN_CUSHION, _("SPIN CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_SPIN_CUSHION, DecorGfx_SPIN_CUSHION), + DECORATION(DECOR_DIAMOND_CUSHION, _("DIAMOND CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_DIAMOND_CUSHION, DecorGfx_DIAMOND_CUSHION), + DECORATION(DECOR_BALL_CUSHION, _("BALL CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_BALL_CUSHION, DecorGfx_BALL_CUSHION), + DECORATION(DECOR_GRASS_CUSHION, _("GRASS CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_GRASS_CUSHION, DecorGfx_GRASS_CUSHION), + DECORATION(DECOR_FIRE_CUSHION, _("FIRE CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_FIRE_CUSHION, DecorGfx_FIRE_CUSHION), + DECORATION(DECOR_WATER_CUSHION, _("WATER CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_WATER_CUSHION, DecorGfx_WATER_CUSHION), + DECORATION(DECOR_SNORLAX_DOLL, _("SNORLAX DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_SNORLAX_DOLL, DecorGfx_SNORLAX_DOLL), + DECORATION(DECOR_RHYDON_DOLL, _("RHYDON DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_RHYDON_DOLL, DecorGfx_RHYDON_DOLL), + DECORATION(DECOR_LAPRAS_DOLL, _("LAPRAS DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_LAPRAS_DOLL, DecorGfx_LAPRAS_DOLL), + DECORATION(DECOR_VENUSAUR_DOLL, _("VENUSAUR DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_VENUSAUR_DOLL, DecorGfx_VENUSAUR_DOLL), + DECORATION(DECOR_CHARIZARD_DOLL, _("CHARIZARD DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_CHARIZARD_DOLL, DecorGfx_CHARIZARD_DOLL), + DECORATION(DECOR_BLASTOISE_DOLL, _("BLASTOISE DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_BLASTOISE_DOLL, DecorGfx_BLASTOISE_DOLL), + DECORATION(DECOR_WAILMER_DOLL, _("WAILMER DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_WAILMER_DOLL, DecorGfx_WAILMER_DOLL), + DECORATION(DECOR_REGIROCK_DOLL, _("REGIROCK DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_REGIROCK_DOLL, DecorGfx_REGIROCK_DOLL), + DECORATION(DECOR_REGICE_DOLL, _("REGICE DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_REGICE_DOLL, DecorGfx_REGICE_DOLL), + DECORATION(DECOR_REGISTEEL_DOLL, _("REGISTEEL DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_REGISTEEL_DOLL, DecorGfx_REGISTEEL_DOLL) }; const u8 *const gUnknown_083EC5E4[] = { @@ -1656,7 +1656,7 @@ void sub_80FE428(u8 taskId) gTasks[taskId].func = Task_DecorationPCProcessMenuInput; } -void sub_80FE470(u8 decoCat, u8 a1, u8 a2, u8 palIdx) +void sub_80FE470(u8 decoCat, u8 left, u8 top, u8 palIdx) // PrintDecorationCategorySelectionMenuString { u8 *strptr; u8 v0; @@ -1675,21 +1675,21 @@ void sub_80FE470(u8 decoCat, u8 a1, u8 a2, u8 palIdx) strptr[1] = 5; strptr[2] = v0; strptr[3] = EOS; - MenuPrint(gStringVar4, a1, a2); + MenuPrint(gStringVar4, left, top); } -void sub_80FE528(u8 taskId) +void sub_80FE528(u8 taskId) // PrintDecorationCategorySelectionMenuStrings { u8 decoCat; MenuDrawTextWindow(0, 0, 14, 19); for (decoCat=0; decoCat<8; decoCat++) { - if (ewram_1f000.isPlayerRoom == 1 && gTasks[taskId].data[11] == 0 && decoCat != DECOCAT_DOLL && decoCat != DECOCAT_CUSHION) + if (ewram_1f000.isPlayerRoom == 1 && gTasks[taskId].data[11] == 0 && decoCat != DECORCAT_DOLL && decoCat != DECORCAT_CUSHION) { - sub_80FE470(decoCat, 1, 2 * decoCat + 1, 13); + sub_80FE470(decoCat, 1, 2 * decoCat + 1, 13); // Selectable } else { - sub_80FE470(decoCat, 1, 2 * decoCat + 1, 255); + sub_80FE470(decoCat, 1, 2 * decoCat + 1, 255); // Unselectable } } MenuPrint(gUnknownText_Exit, 1, 17); @@ -1914,7 +1914,7 @@ void sub_80FEABC(u8 taskId, u8 dummy1) } if (gUnknown_020388D0[i]) { - if (ewram_1f000.isPlayerRoom == 1 && gUnknown_020388F6 != DECOCAT_DOLL && gUnknown_020388F6 != DECOCAT_CUSHION && gTasks[taskId].data[11] == 0) + if (ewram_1f000.isPlayerRoom == 1 && gUnknown_020388F6 != DECORCAT_DOLL && gUnknown_020388F6 != DECORCAT_CUSHION && gTasks[taskId].data[11] == 0) { StringCopy(gStringVar1, gDecorations[gUnknown_020388D0[i]].name); sub_8072A18(gUnknown_083EC65A, 0x08, 8 * ni, 0x68, 1); @@ -2182,14 +2182,14 @@ void sub_80FF1EC(u16 mapX, u16 mapY, u8 decWidth, u8 decHeight, u16 decIdx) { x = mapX + j; behavior = GetBehaviorByMetatileId(0x200 + gDecorations[decIdx].tiles[i * decWidth + j]); - if (sub_8057288(behavior) == 1 || (gDecorations[decIdx].decor_field_11 != 1 && (behavior >> 12))) + if (sub_8057288(behavior) == 1 || (gDecorations[decIdx].permission != DECORPERM_PASS_FLOOR && (behavior >> 12))) { flags = 0xc00; } else { flags = 0x000; } - if (gDecorations[decIdx].decor_field_11 != 3 && sub_80572B0(MapGridGetMetatileBehaviorAt(x, decBottom)) == 1) + if (gDecorations[decIdx].permission != DECORPERM_NA_WALL && sub_80572B0(MapGridGetMetatileBehaviorAt(x, decBottom)) == 1) { v0 = 1; } else @@ -2212,34 +2212,34 @@ void sub_80FF394(u16 mapX, u16 mapY, u16 decIdx) { switch (gDecorations[decIdx].shape) { - case 0: + case DECORSHAPE_1x1: sub_80FF1EC(mapX, mapY, 1, 1, decIdx); break; - case 1: + case DECORSHAPE_2x1: sub_80FF1EC(mapX, mapY, 2, 1, decIdx); break; - case 2: + case DECORSHAPE_3x1: // unused sub_80FF1EC(mapX, mapY, 3, 1, decIdx); break; - case 3: + case DECORSHAPE_4x2: sub_80FF1EC(mapX, mapY, 4, 2, decIdx); break; - case 4: + case DECORSHAPE_2x2: sub_80FF1EC(mapX, mapY, 2, 2, decIdx); break; - case 5: + case DECORSHAPE_1x2: sub_80FF1EC(mapX, mapY, 1, 2, decIdx); break; - case 6: + case DECORSHAPE_1x3: // unused sub_80FF1EC(mapX, mapY, 1, 3, decIdx); break; - case 7: + case DECORSHAPE_2x4: sub_80FF1EC(mapX, mapY, 2, 4, decIdx); break; - case 8: + case DECORSHAPE_3x3: sub_80FF1EC(mapX, mapY, 3, 3, decIdx); break; - case 9: + case DECORSHAPE_3x2: sub_80FF1EC(mapX, mapY, 3, 2, decIdx); break; } @@ -2288,7 +2288,7 @@ bool8 sub_80FF58C/*IsThereRoomForMoreDecorations*/(void) void sub_80FF5BC(u8 taskId) { - if (ewram_1f000.isPlayerRoom == 1 && gUnknown_020388F6 != DECOCAT_DOLL && gUnknown_020388F6 != DECOCAT_CUSHION) + if (ewram_1f000.isPlayerRoom == 1 && gUnknown_020388F6 != DECORCAT_DOLL && gUnknown_020388F6 != DECORCAT_CUSHION) { sub_80FEF74(); sub_80FED1C(); @@ -2362,7 +2362,7 @@ void AddDecorationIconObjectFromFieldObject(struct UnkStruct_02038900 * unk_0203 sub_80FED1C(); sub_81006D0(unk_02038900); unk_02038900->decoration = &gDecorations[decoIdx]; - if (gDecorations[decoIdx].decor_field_11 != 4) + if (gDecorations[decoIdx].permission != DECORPERM_SOLID_MAT) { sub_81008BC(unk_02038900); sub_8100930(unk_02038900->decoration->shape); @@ -2383,7 +2383,7 @@ void SetUpPlacingDecorationPlayerAvatar(u8 taskId, struct UnkStruct_02038900 *un { u8 v0; v0 = 16 * (u8)gTasks[taskId].data[5] + gUnknown_083EC900[unk_02038900->decoration->shape].x - 8 * ((u8)gTasks[taskId].data[5] - 1); - if (unk_02038900->decoration->shape == 2 || unk_02038900->decoration->shape == 8 || unk_02038900->decoration->shape == 9) + if (unk_02038900->decoration->shape == DECORSHAPE_3x1 || unk_02038900->decoration->shape == DECORSHAPE_3x3 || unk_02038900->decoration->shape == DECORSHAPE_3x2) { v0 -= 8; } @@ -2403,44 +2403,44 @@ void sub_80FF960(u8 taskId) { switch (gDecorations[gUnknown_020388D0[gUnknown_020388F5]].shape) { - case 0: + case DECORSHAPE_1x1: gTasks[taskId].data[5] = 1; gTasks[taskId].data[6] = 1; break; - case 1: + case DECORSHAPE_2x1: gTasks[taskId].data[5] = 2; gTasks[taskId].data[6] = 1; break; - case 2: + case DECORSHAPE_3x1: gTasks[taskId].data[5] = 3; gTasks[taskId].data[6] = 1; break; - case 3: + case DECORSHAPE_4x2: gTasks[taskId].data[5] = 4; gTasks[taskId].data[6] = 2; break; - case 4: + case DECORSHAPE_2x2: gTasks[taskId].data[5] = 2; gTasks[taskId].data[6] = 2; break; - case 5: + case DECORSHAPE_1x2: gTasks[taskId].data[5] = 1; gTasks[taskId].data[6] = 2; break; - case 6: + case DECORSHAPE_1x3: gTasks[taskId].data[5] = 1; gTasks[taskId].data[6] = 3; gTasks[taskId].data[1]++; break; - case 7: + case DECORSHAPE_2x4: gTasks[taskId].data[5] = 2; gTasks[taskId].data[6] = 4; break; - case 8: + case DECORSHAPE_3x3: gTasks[taskId].data[5] = 3; gTasks[taskId].data[6] = 3; break; - case 9: + case DECORSHAPE_3x2: gTasks[taskId].data[5] = 3; gTasks[taskId].data[6] = 2; break; @@ -2513,10 +2513,10 @@ bool8 sub_80FFC24(u8 taskId, const struct Decoration *decoration) s16 curX; mapY = gTasks[taskId].data[6]; mapX = gTasks[taskId].data[5]; - switch (decoration->decor_field_11) + switch (decoration->permission) { - case 0: - case 1: + case DECORPERM_SOLID_FLOOR: + case DECORPERM_PASS_FLOOR: for (i=0; ishape == 5) + if (decoration->shape == DECORSHAPE_1x2) { if (!sub_80572EC(behaviorAt)) { @@ -3187,7 +3187,7 @@ void sub_81000C4(u8 taskId) { MenuZeroFillWindowRect(0, 0, 29, 19); sub_8100174(taskId); - if (gDecorations[gUnknown_020388D0[gUnknown_020388F5]].decor_field_11 != 4) + if (gDecorations[gUnknown_020388D0[gUnknown_020388F5]].permission != DECORPERM_SOLID_MAT) { sub_80FF394(gTasks[taskId].data[0], gTasks[taskId].data[1], gUnknown_020388D0[gUnknown_020388F5]); } else @@ -3498,19 +3498,15 @@ u16 sub_810089C(u16 a0) void sub_81008BC(struct UnkStruct_02038900 *unk_02038900) { u8 i; - u8 idx; - idx = unk_02038900->decoration->shape; - for (i=0; idecoration->shape; + for (i=0; iunk_004[gUnknown_083EC860[idx].var0[i]] = sub_810089C(unk_02038900->decoration->tiles[gUnknown_083EC860[idx].var4[i]] * 8 + gUnknown_083EC860[idx].var8[i]); + unk_02038900->unk_004[gUnknown_083EC860[shape].var0[i]] = sub_810089C(unk_02038900->decoration->tiles[gUnknown_083EC860[shape].var4[i]] * 8 + gUnknown_083EC860[shape].var8[i]); } } void sub_8100930(u8 decoShape) -/* - * This function sets an OAM object not directly referenced anywhere else - * in the source. - */ { gUnknown_020391AC.y = 0; gUnknown_020391AC.affineMode = 0; @@ -3582,7 +3578,7 @@ void sub_8100A7C(void) if (gSpecialVar_0x8004 == gUnknown_02039234) { gScriptResult = 1; - } else if (gDecorations[ewram_1f000.items[gUnknown_020391B4[gSpecialVar_0x8004].var00]].decor_field_11 == 4) + } else if (gDecorations[ewram_1f000.items[gUnknown_020391B4[gSpecialVar_0x8004].var00]].permission == DECORPERM_SOLID_MAT) { gSpecialVar_0x8005 = gUnknown_020391B4[gSpecialVar_0x8004].var04; sub_8100A60(gUnknown_020391B4[gSpecialVar_0x8004].var00); @@ -3617,13 +3613,13 @@ void sub_8100B6C(void) u8 k; u8 x; u8 y; - u8 unk11; + u8 permission; for (i=0; i> 4; y = ewram_1f000.pos[gUnknown_020391B4[i].var00] & 0xf; - if (unk11 != 4) + if (permission != DECORPERM_SOLID_MAT) { if (ewram_1f000.items[gUnknown_020391B4[i].var00] == DECOR_SAND_ORNAMENT && MapGridGetMetatileIdAt(x + 7, y + 7) == 0x28c) { @@ -3801,43 +3797,43 @@ void sub_81010F0(u8 taskId) void sub_8101118(u8 decorIdx, struct UnkStruct_020391B4 *unk_020391B4) { - if (gDecorations[decorIdx].shape == 0) + if (gDecorations[decorIdx].shape == DECORSHAPE_1x1) { unk_020391B4->width = 1; unk_020391B4->height = 1; - } else if (gDecorations[decorIdx].shape == 1) + } else if (gDecorations[decorIdx].shape == DECORSHAPE_2x1) { unk_020391B4->width = 2; unk_020391B4->height = 1; - } else if (gDecorations[decorIdx].shape == 2) + } else if (gDecorations[decorIdx].shape == DECORSHAPE_3x1) { unk_020391B4->width = 3; unk_020391B4->height = 1; - } else if (gDecorations[decorIdx].shape == 3) + } else if (gDecorations[decorIdx].shape == DECORSHAPE_4x2) { unk_020391B4->width = 4; unk_020391B4->height = 2; - } else if (gDecorations[decorIdx].shape == 4) + } else if (gDecorations[decorIdx].shape == DECORSHAPE_2x2) { unk_020391B4->width = 2; unk_020391B4->height = 2; - } else if (gDecorations[decorIdx].shape == 5) + } else if (gDecorations[decorIdx].shape == DECORSHAPE_1x2) { unk_020391B4->width = 1; unk_020391B4->height = 2; - } else if (gDecorations[decorIdx].shape == 6) + } else if (gDecorations[decorIdx].shape == DECORSHAPE_1x3) { unk_020391B4->width = 1; unk_020391B4->height = 3; - } else if (gDecorations[decorIdx].shape == 7) + } else if (gDecorations[decorIdx].shape == DECORSHAPE_2x4) { unk_020391B4->width = 2; unk_020391B4->height = 4; - } else if (gDecorations[decorIdx].shape == 8) + } else if (gDecorations[decorIdx].shape == DECORSHAPE_3x3) { unk_020391B4->width = 3; unk_020391B4->height = 3; - } else if (gDecorations[decorIdx].shape == 9) + } else if (gDecorations[decorIdx].shape == DECORSHAPE_3x2) { unk_020391B4->width = 3; unk_020391B4->height = 2; @@ -3898,7 +3894,7 @@ bool8 sub_8101340(u8 taskId) { if (ewram_1f000.items[i] != 0) { - if (gDecorations[ewram_1f000.items[i]].decor_field_11 == 4) + if (gDecorations[ewram_1f000.items[i]].permission == DECORPERM_SOLID_MAT) { sub_8101118(ewram_1f000.items[i], gUnknown_020391B4); if (sub_8101200(taskId, i, gUnknown_020391B4) == TRUE) @@ -3925,7 +3921,7 @@ void sub_81013B8(u8 a0, u8 a1, u8 a2, u8 a3) decorIdx = ewram_1f000.items[i]; xOff = ewram_1f000.pos[i] >> 4; yOff = ewram_1f000.pos[i] & 0xf; - if (decorIdx != 0 && gDecorations[decorIdx].decor_field_11 == 4 && a0 <= xOff && a1 <= yOff && a2 >= xOff && a3 >= yOff) + if (decorIdx != 0 && gDecorations[decorIdx].permission == DECORPERM_SOLID_MAT && a0 <= xOff && a1 <= yOff && a2 >= xOff && a3 >= yOff) { gUnknown_020391B4[gUnknown_02039234].var00 = i; sub_81012A0(); -- cgit v1.2.3 From ae287a511fd1759fd7a666c43f68279d00da495d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 13 Jun 2017 19:19:58 -0400 Subject: File modes NotLikeThis --- src/decoration.c | 0 src/menu.c | 0 src/scrcmd.c | 0 src/secret_base.c | 0 4 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 src/decoration.c mode change 100755 => 100644 src/menu.c mode change 100755 => 100644 src/scrcmd.c mode change 100755 => 100644 src/secret_base.c (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c old mode 100755 new mode 100644 diff --git a/src/menu.c b/src/menu.c old mode 100755 new mode 100644 diff --git a/src/scrcmd.c b/src/scrcmd.c old mode 100755 new mode 100644 diff --git a/src/secret_base.c b/src/secret_base.c old mode 100755 new mode 100644 -- cgit v1.2.3 From 355498d85b71536580025364ccaa5ceb94c4194d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 13 Jun 2017 19:28:50 -0400 Subject: Decoration inventory data --- src/decoration.c | 28 ++++++++++++++-------------- src/decoration_inventory.c | 13 +++++++++++++ src/menu.c | 0 src/scrcmd.c | 0 4 files changed, 27 insertions(+), 14 deletions(-) mode change 100644 => 100755 src/decoration_inventory.c mode change 100644 => 100755 src/menu.c mode change 100644 => 100755 src/scrcmd.c (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 729f14280..3fa230cd5 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -2105,7 +2105,7 @@ void sub_8100B6C(void) } for (j=0; jmap)[(x + k) + gMapHeader.mapData->width * (y - j)] | 0x3000); } @@ -2277,43 +2277,43 @@ void sub_8101118(u8 decorIdx, struct UnkStruct_020391B4 *unk_020391B4) { if (gDecorations[decorIdx].decor_field_12 == 0) { - unk_020391B4->var01 = 1; + unk_020391B4->width = 1; unk_020391B4->var02 = 1; } else if (gDecorations[decorIdx].decor_field_12 == 1) { - unk_020391B4->var01 = 2; + unk_020391B4->width = 2; unk_020391B4->var02 = 1; } else if (gDecorations[decorIdx].decor_field_12 == 2) { - unk_020391B4->var01 = 3; + unk_020391B4->width = 3; unk_020391B4->var02 = 1; } else if (gDecorations[decorIdx].decor_field_12 == 3) { - unk_020391B4->var01 = 4; + unk_020391B4->width = 4; unk_020391B4->var02 = 2; } else if (gDecorations[decorIdx].decor_field_12 == 4) { - unk_020391B4->var01 = 2; + unk_020391B4->width = 2; unk_020391B4->var02 = 2; } else if (gDecorations[decorIdx].decor_field_12 == 5) { - unk_020391B4->var01 = 1; + unk_020391B4->width = 1; unk_020391B4->var02 = 2; } else if (gDecorations[decorIdx].decor_field_12 == 6) { - unk_020391B4->var01 = 1; + unk_020391B4->width = 1; unk_020391B4->var02 = 3; } else if (gDecorations[decorIdx].decor_field_12 == 7) { - unk_020391B4->var01 = 2; + unk_020391B4->width = 2; unk_020391B4->var02 = 4; } else if (gDecorations[decorIdx].decor_field_12 == 8) { - unk_020391B4->var01 = 3; + unk_020391B4->width = 3; unk_020391B4->var02 = 3; } else if (gDecorations[decorIdx].decor_field_12 == 9) { - unk_020391B4->var01 = 3; + unk_020391B4->width = 3; unk_020391B4->var02 = 2; } } @@ -2340,9 +2340,9 @@ bool8 sub_8101200(u8 taskId, u8 decorIdx, struct UnkStruct_020391B4 *unk_020391B { unk_020391B4->var02--; } - if (x >= xOff && x < xOff + unk_020391B4->var01 && y > yOff - unk_020391B4->var02 && y <= yOff) + if (x >= xOff && x < xOff + unk_020391B4->width && y > yOff - unk_020391B4->var02 && y <= yOff) { - sub_8101198(unk_020391B4->var01 - (x - xOff + 1), yOff - y); + sub_8101198(unk_020391B4->width - (x - xOff + 1), yOff - y); return TRUE; } return FALSE; @@ -2434,7 +2434,7 @@ void sub_8101460(u8 taskId) { xOff = ewram_1f000.pos[gUnknown_020391B4[0].var00] >> 4; yOff = ewram_1f000.pos[gUnknown_020391B4[0].var00] & 0xf; - sub_81013B8(xOff, yOff - gUnknown_020391B4[0].var02 + 1, xOff + gUnknown_020391B4[0].var01 - 1, yOff); + sub_81013B8(xOff, yOff - gUnknown_020391B4[0].var02 + 1, xOff + gUnknown_020391B4[0].width - 1, yOff); } } } diff --git a/src/decoration_inventory.c b/src/decoration_inventory.c old mode 100644 new mode 100755 index a483629b1..c3dfdb2a8 --- a/src/decoration_inventory.c +++ b/src/decoration_inventory.c @@ -8,6 +8,19 @@ #include "decoration.h" #include "decoration_inventory.h" +#define DECOR_INV(ptr) {.items = (u8 *)&ptr, .size = sizeof ptr} + +struct DecorationInventory const gDecorationInventories[] = { + DECOR_INV(gSaveBlock1.decorDesk), + DECOR_INV(gSaveBlock1.decorChair), + DECOR_INV(gSaveBlock1.decorPlant), + DECOR_INV(gSaveBlock1.decorOrnament), + DECOR_INV(gSaveBlock1.decorMat), + DECOR_INV(gSaveBlock1.decorPoster), + DECOR_INV(gSaveBlock1.decorDoll), + DECOR_INV(gSaveBlock1.decorCushion) +}; + void ClearDecorationInventory(u8 invIdx) { u8 i; diff --git a/src/menu.c b/src/menu.c old mode 100644 new mode 100755 diff --git a/src/scrcmd.c b/src/scrcmd.c old mode 100644 new mode 100755 -- cgit v1.2.3 From 14ff366c614790154c023e3141f7019f6f6558de Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 13 Jun 2017 19:50:29 -0400 Subject: Assign names to struct fields --- src/decoration.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) mode change 100644 => 100755 src/decoration.c (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c old mode 100644 new mode 100755 index 40a27d4b3..03be575c4 --- a/src/decoration.c +++ b/src/decoration.c @@ -31,7 +31,7 @@ #define MENUACTION2(_text, _func) {.text = _text, .func = _func} #define MENUACTION3(_func1, _func2) {.func1 = _func1, .func2 = _func2} -#define STRUCT_803EC860(_data1, _data2, _data3, _size) {.var0 = _data1, .var4 = _data2, .var8 = _data3, .size = _size} +#define STRUCT_803EC860(_data1, _data2, _data3, _size) {.tiles = _data1, .y = _data2, .x = _data3, .size = _size} #define DECOSPRITETEMPLATE(_shape, _size, _x, _y) {.shape = _shape, .size = _size, .x = _x, .y = _y} const u8 DecorDesc_SMALL_DESK[] = _( @@ -1421,6 +1421,7 @@ 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}; @@ -1431,6 +1432,7 @@ 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}; @@ -3421,7 +3423,7 @@ void sub_81006D0(struct UnkStruct_02038900 *unk_02038900) } for (i=0; i<0x40; i++) { - unk_02038900->unk_004[i] = 0; + unk_02038900->tiles[i] = 0; } } @@ -3487,7 +3489,7 @@ void sub_8100874(struct UnkStruct_02038900 *unk_02038900) { u16 i; for (i=0; i<0x40; i++) - sub_8100740(&unk_02038900->image[i * 32], unk_02038900->unk_004[i]); + sub_8100740(&unk_02038900->image[i * 32], unk_02038900->tiles[i]); } u16 sub_810089C(u16 a0) @@ -3502,7 +3504,7 @@ void sub_81008BC(struct UnkStruct_02038900 *unk_02038900) shape = unk_02038900->decoration->shape; for (i=0; iunk_004[gUnknown_083EC860[shape].var0[i]] = sub_810089C(unk_02038900->decoration->tiles[gUnknown_083EC860[shape].var4[i]] * 8 + gUnknown_083EC860[shape].var8[i]); + unk_02038900->tiles[gUnknown_083EC860[shape].tiles[i]] = sub_810089C(unk_02038900->decoration->tiles[gUnknown_083EC860[shape].y[i]] * 8 + gUnknown_083EC860[shape].x[i]); } } @@ -3578,10 +3580,10 @@ void sub_8100A7C(void) if (gSpecialVar_0x8004 == gUnknown_02039234) { gScriptResult = 1; - } else if (gDecorations[ewram_1f000.items[gUnknown_020391B4[gSpecialVar_0x8004].var00]].permission == DECORPERM_SOLID_MAT) + } else if (gDecorations[ewram_1f000.items[gUnknown_020391B4[gSpecialVar_0x8004].decorId]].permission == DECORPERM_SOLID_MAT) { - gSpecialVar_0x8005 = gUnknown_020391B4[gSpecialVar_0x8004].var04; - sub_8100A60(gUnknown_020391B4[gSpecialVar_0x8004].var00); + gSpecialVar_0x8005 = gUnknown_020391B4[gSpecialVar_0x8004].flagId; + sub_8100A60(gUnknown_020391B4[gSpecialVar_0x8004].decorId); for (i=0; imapObjectCount; i++) { if (gMapHeader.events->mapObjects[i].flagId == gSpecialVar_0x8005) @@ -3616,12 +3618,12 @@ void sub_8100B6C(void) u8 permission; for (i=0; i> 4; - y = ewram_1f000.pos[gUnknown_020391B4[i].var00] & 0xf; + permission = gDecorations[ewram_1f000.items[gUnknown_020391B4[i].decorId]].permission; + x = ewram_1f000.pos[gUnknown_020391B4[i].decorId] >> 4; + y = ewram_1f000.pos[gUnknown_020391B4[i].decorId] & 0xf; if (permission != DECORPERM_SOLID_MAT) { - if (ewram_1f000.items[gUnknown_020391B4[i].var00] == DECOR_SAND_ORNAMENT && MapGridGetMetatileIdAt(x + 7, y + 7) == 0x28c) + if (ewram_1f000.items[gUnknown_020391B4[i].decorId] == DECOR_SAND_ORNAMENT && MapGridGetMetatileIdAt(x + 7, y + 7) == 0x28c) { gUnknown_020391B4[i].height++; } @@ -3632,7 +3634,7 @@ void sub_8100B6C(void) MapGridSetMetatileEntryAt(x + 7 + k, y + 7 - j, ((u16 *)gMapHeader.mapData->map)[(x + k) + gMapHeader.mapData->width * (y - j)] | 0x3000); } } - sub_8100A60(gUnknown_020391B4[i].var00); + sub_8100A60(gUnknown_020391B4[i].decorId); } } } @@ -3875,13 +3877,13 @@ void sub_81012A0(void) u8 xOff; u8 yOff; u16 i; - xOff = ewram_1f000.pos[gUnknown_020391B4[gUnknown_02039234].var00] >> 4; - yOff = ewram_1f000.pos[gUnknown_020391B4[gUnknown_02039234].var00] & 0xf; + xOff = ewram_1f000.pos[gUnknown_020391B4[gUnknown_02039234].decorId] >> 4; + yOff = ewram_1f000.pos[gUnknown_020391B4[gUnknown_02039234].decorId] & 0xf; for (i=0; i<0x40; i++) { if (gSaveBlock1.mapObjectTemplates[i].x == xOff && gSaveBlock1.mapObjectTemplates[i].y == yOff && !FlagGet(gSaveBlock1.mapObjectTemplates[i].flagId)) { - gUnknown_020391B4[gUnknown_02039234].var04 = gSaveBlock1.mapObjectTemplates[i].flagId; + gUnknown_020391B4[gUnknown_02039234].flagId = gSaveBlock1.mapObjectTemplates[i].flagId; break; } } @@ -3899,7 +3901,7 @@ bool8 sub_8101340(u8 taskId) sub_8101118(ewram_1f000.items[i], gUnknown_020391B4); if (sub_8101200(taskId, i, gUnknown_020391B4) == TRUE) { - gUnknown_020391B4->var00 = i; + gUnknown_020391B4->decorId = i; sub_81012A0(); gUnknown_02039234 = 1; return TRUE; @@ -3923,7 +3925,7 @@ void sub_81013B8(u8 a0, u8 a1, u8 a2, u8 a3) yOff = ewram_1f000.pos[i] & 0xf; if (decorIdx != 0 && gDecorations[decorIdx].permission == DECORPERM_SOLID_MAT && a0 <= xOff && a1 <= yOff && a2 >= xOff && a3 >= yOff) { - gUnknown_020391B4[gUnknown_02039234].var00 = i; + gUnknown_020391B4[gUnknown_02039234].decorId = i; sub_81012A0(); gUnknown_02039234++; } @@ -3946,7 +3948,7 @@ void sub_8101460(u8 taskId) sub_8101118(ewram_1f000.items[i], gUnknown_020391B4); if (sub_8101200(taskId, i, gUnknown_020391B4) == TRUE) { - gUnknown_020391B4[0].var00 = i; + gUnknown_020391B4[0].decorId = i; gUnknown_02039234++; break; } @@ -3954,8 +3956,8 @@ void sub_8101460(u8 taskId) } if (gUnknown_02039234 != 0) { - xOff = ewram_1f000.pos[gUnknown_020391B4[0].var00] >> 4; - yOff = ewram_1f000.pos[gUnknown_020391B4[0].var00] & 0xf; + xOff = ewram_1f000.pos[gUnknown_020391B4[0].decorId] >> 4; + yOff = ewram_1f000.pos[gUnknown_020391B4[0].decorId] & 0xf; sub_81013B8(xOff, yOff - gUnknown_020391B4[0].var02 + 1, xOff + gUnknown_020391B4[0].var01 - 1, yOff); } } -- cgit v1.2.3 From 24165f2bb71c063d05f974acc355536e7393468e Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Tue, 13 Jun 2017 19:08:14 -0500 Subject: decompile sub_809207C - sub_80924A4 --- src/menu.c | 2 +- src/pokedex.c | 183 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 182 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/menu.c b/src/menu.c index db1724855..2932750d8 100644 --- a/src/menu.c +++ b/src/menu.c @@ -611,7 +611,7 @@ u8 unref_sub_8072A5C(u8 *dest, u8 *src, u8 left, u16 top, u8 width, u32 a6) return sub_8004FD0(gMenuWindowPtr, dest, src, gMenuTextTileOffset, left, top, width, a6); } -int sub_8072AB0(u8 *str, u8 left, u16 top, u8 width, u8 height, u32 a6) +int sub_8072AB0(const u8 *str, u8 left, u16 top, u8 width, u8 height, u32 a6) { u8 newlineCount = sub_8004FD0(gMenuWindowPtr, NULL, str, gMenuTextTileOffset, left, top, width, a6); diff --git a/src/pokedex.c b/src/pokedex.c index 518982099..5738db841 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -93,6 +93,10 @@ extern void *const gUnknown_083B5584[]; extern struct SpriteFrameImage *const gUnknown_083B5794[]; extern const struct SpriteTemplate gUnknown_083B57A4; extern const u8 gUnknown_083B57BC[][4]; +extern const u8 gUnknown_083B5850[][4]; +extern const u8 gUnknown_083B586C[][4]; +extern const u8 gUnknown_083B5888[][4]; +extern const u8 gUnknown_083B58A4[][4]; extern u8 gUnknown_08D00524[]; extern u8 gUnknown_08E96BD4[]; extern u8 gUnknown_08E96ACC[]; @@ -128,9 +132,17 @@ u16 NationalPokedexNumToSpecies(u16); void sub_8091E54(u8); void sub_809204C(u8); void sub_809207C(u8); - +void sub_809217C(u8); +void sub_80921B0(u8); +void sub_80923FC(u8); +void sub_80924A4(u8); +void sub_8092508(u8); +void sub_80925CC(u8); +void sub_80927B8(u8); void sub_8092AB0(u8); +void sub_8092AD4(u8, u8); void sub_8092B68(); +u8 sub_8092E10(); void sub_8092EB0(); void sub_809308C(); @@ -4213,7 +4225,7 @@ int sub_8091AF8(u8 a, u8 b, u8 abcGroup, u8 bodyColor, u8 type1, u8 type2) return resultsCount; } -void sub_8091E20(u8 *str) +void sub_8091E20(const u8 *str) { sub_8072AB0(str, 9, 120, 208, 32, 1); } @@ -4289,3 +4301,170 @@ void sub_809204C(u8 taskId) sub_8092B68(taskId); gTasks[taskId].func = sub_809207C; } + +void sub_809207C(u8 taskId) +{ + if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_PC_OFF); + gTasks[taskId].func = sub_80927B8; + return; + } + if (gMain.newKeys & A_BUTTON) + { + switch (gTasks[taskId].data[0]) + { + case 0: + PlaySE(SE_PIN); + gTasks[taskId].data[1] = 0; + gTasks[taskId].func = sub_809217C; + break; + case 1: + PlaySE(SE_PIN); + gTasks[taskId].data[1] = 4; + gTasks[taskId].func = sub_809217C; + break; + case 2: + PlaySE(SE_PC_OFF); + gTasks[taskId].func = sub_80927B8; + break; + } + return; + } + if ((gMain.newKeys & 0x20) && gTasks[taskId].data[0] > 0) + { + PlaySE(SE_Z_PAGE); + gTasks[taskId].data[0]--; + sub_8092AB0(gTasks[taskId].data[0]); + } + if ((gMain.newKeys & 0x10) && gTasks[taskId].data[0] < 2) + { + PlaySE(SE_Z_PAGE); + gTasks[taskId].data[0]++; + sub_8092AB0(gTasks[taskId].data[0]); + } +} + +void sub_809217C(u8 taskId) +{ + sub_8092AD4(gTasks[taskId].data[0], gTasks[taskId].data[1]); + sub_8092B68(taskId); + gTasks[taskId].func = sub_80921B0; +} + +void sub_80921B0(u8 taskId) +{ + const u8 (*r6)[4]; + + if (gTasks[taskId].data[0] != 0) + { + if (!IsNationalPokedexEnabled()) + r6 = gUnknown_083B58A4; + else + r6 = gUnknown_083B586C; + } + else + { + if (!IsNationalPokedexEnabled()) + r6 = gUnknown_083B5888; + else + r6 = gUnknown_083B5850; + } + + if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_BOWA); + sub_8092EB0(taskId); + gTasks[taskId].func = sub_809204C; + return; + } + if (gMain.newKeys & A_BUTTON) + { + if (gTasks[taskId].data[1] == 6) + { + if (gTasks[taskId].data[0] != 0) + { + gUnknown_0202FFBA = 0x40; + gPokedexView->unk62A = 0x40; + gUnknown_0202FFB8 = 0; + gPokedexView->unk610 = 0; + gSaveBlock2.pokedex.unknown1 = sub_8092E10(taskId, 5); + if (!IsNationalPokedexEnabled()) + gSaveBlock2.pokedex.unknown1 = 0; + gPokedexView->unk614 = gSaveBlock2.pokedex.unknown1; + gSaveBlock2.pokedex.order = sub_8092E10(taskId, 4); + gPokedexView->unk618 = gSaveBlock2.pokedex.order; + PlaySE(SE_PC_OFF); + gTasks[taskId].func = sub_80927B8; + } + else + { + sub_8091E20(gDexText_Searching); + gTasks[taskId].func = sub_80923FC; + PlaySE(SE_Z_SEARCH); + } + } + else + { + PlaySE(SE_PIN); + gTasks[taskId].func = sub_80925CC; + } + return; + } + + if ((gMain.newKeys & 0x20) && r6[gTasks[taskId].data[1]][0] != 0xFF) + { + PlaySE(SE_SELECT); + gTasks[taskId].data[1] = r6[gTasks[taskId].data[1]][0]; + sub_8092AD4(gTasks[taskId].data[0], gTasks[taskId].data[1]); + } + if ((gMain.newKeys & 0x10) && r6[gTasks[taskId].data[1]][1] != 0xFF) + { + PlaySE(SE_SELECT); + gTasks[taskId].data[1] = r6[gTasks[taskId].data[1]][1]; + sub_8092AD4(gTasks[taskId].data[0], gTasks[taskId].data[1]); + } + if ((gMain.newKeys & 0x40) && r6[gTasks[taskId].data[1]][2] != 0xFF) + { + PlaySE(SE_SELECT); + gTasks[taskId].data[1] = r6[gTasks[taskId].data[1]][2]; + sub_8092AD4(gTasks[taskId].data[0], gTasks[taskId].data[1]); + } + if ((gMain.newKeys & 0x80) && r6[gTasks[taskId].data[1]][3] != 0xFF) + { + PlaySE(SE_SELECT); + gTasks[taskId].data[1] = r6[gTasks[taskId].data[1]][3]; + sub_8092AD4(gTasks[taskId].data[0], gTasks[taskId].data[1]); + } +} + +void sub_80923FC(u8 taskId) +{ + u8 r10 = sub_8092E10(taskId, 5); + u8 r9 = sub_8092E10(taskId, 4); + u8 r8 = sub_8092E10(taskId, 0); + u8 r6 = sub_8092E10(taskId, 1); + u8 r4 = sub_8092E10(taskId, 2); + u8 r0 = sub_8092E10(taskId, 3); + + sub_8091AF8(r10, r9, r8, r6, r4, r0); + gTasks[taskId].func = sub_80924A4; +} + +void sub_80924A4(u8 taskId) +{ + if (!IsSEPlaying()) + { + if (gPokedexView->unk60C != 0) + { + PlaySE(SE_SEIKAI); + sub_8091E20(gDexText_SearchComplete); + } + else + { + PlaySE(SE_HAZURE); + sub_8091E20(gDexText_NoMatching); + } + gTasks[taskId].func = sub_8092508; + } +} -- cgit v1.2.3 From 811a2fe138af1d08aa94cecfb0513414f08e3d4d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 13 Jun 2017 21:37:51 -0400 Subject: Get sub_80FFC24 closer to matching (but not quite) --- src/decoration.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 03be575c4..8601cb37c 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -2485,7 +2485,7 @@ bool8 sub_80FFB94(u8 taskId, s16 x, s16 y, u16 decoId) return TRUE; } -bool8 sub_80FFBDC(u16 a0, struct Decoration *decoration) +bool8 sub_80FFBDC(u16 a0, const struct Decoration *decoration) { if (sub_8057274(a0) != 1) { @@ -2501,6 +2501,7 @@ bool8 sub_80FFBDC(u16 a0, struct Decoration *decoration) return FALSE; } +// When behaviorBy is set, it is masked by 0xf000. This is the step that fails to match when built. #ifdef NONMATCHING bool8 sub_80FFC24(u8 taskId, const struct Decoration *decoration) { @@ -2508,7 +2509,6 @@ bool8 sub_80FFC24(u8 taskId, const struct Decoration *decoration) u8 j; u8 behaviorAt; u16 behaviorBy; - u8 fieldObjectId; u8 mapY; u8 mapX; s16 curY; @@ -2526,7 +2526,7 @@ bool8 sub_80FFC24(u8 taskId, const struct Decoration *decoration) { curX = gTasks[taskId].data[0] + j; behaviorAt = MapGridGetMetatileBehaviorAt(curX, curY); - behaviorBy = 0xf000 & GetBehaviorByMetatileId(0x200 + decoration->tiles[(mapY - 1 - i) * mapX + j]); + behaviorBy = GetBehaviorByMetatileId(0x200 + decoration->tiles[(mapY - 1 - i) * mapX + j]) & 0xf000; if (!sub_80FFBDC(behaviorAt, decoration)) { return FALSE; @@ -2535,8 +2535,8 @@ bool8 sub_80FFC24(u8 taskId, const struct Decoration *decoration) { return FALSE; } - fieldObjectId = GetFieldObjectIdByXYZ(curX, curY, 0); - if (fieldObjectId != 0 && fieldObjectId != 16) + behaviorAt = GetFieldObjectIdByXYZ(curX, curY, 0); + if (behaviorAt != 0 && behaviorAt != 16) { return FALSE; } @@ -2551,7 +2551,7 @@ bool8 sub_80FFC24(u8 taskId, const struct Decoration *decoration) { curX = gTasks[taskId].data[0] + j; behaviorAt = MapGridGetMetatileBehaviorAt(curX, curY); - behaviorBy = 0xf000 & GetBehaviorByMetatileId(0x200 + decoration->tiles[(mapY - i) * mapX + j]); + behaviorBy = GetBehaviorByMetatileId(0x200 + decoration->tiles[(mapY - 1 - i) * mapX + j]) & 0xf000; if (!sub_805729C(behaviorAt) && !sub_80FFB6C(behaviorAt, behaviorBy)) { return FALSE; @@ -2560,8 +2560,7 @@ bool8 sub_80FFC24(u8 taskId, const struct Decoration *decoration) { return FALSE; } - fieldObjectId = GetFieldObjectIdByXYZ(curX, curY, 0); - if (fieldObjectId != 16) + if (GetFieldObjectIdByXYZ(curX, curY, 0) != 16) { return FALSE; } @@ -2572,7 +2571,7 @@ bool8 sub_80FFC24(u8 taskId, const struct Decoration *decoration) { curX = gTasks[taskId].data[0] + j; behaviorAt = MapGridGetMetatileBehaviorAt(curX, curY); - behaviorBy = 0xf000 & GetBehaviorByMetatileId(0x200 + decoration->tiles[j]); + behaviorBy = GetBehaviorByMetatileId(0x200 + decoration->tiles[j]) & 0xf000; if (!sub_805729C(behaviorAt) && !sub_80572B0(behaviorAt)) { return FALSE; @@ -2581,8 +2580,8 @@ bool8 sub_80FFC24(u8 taskId, const struct Decoration *decoration) { return FALSE; } - fieldObjectId = GetFieldObjectIdByXYZ(curX, curY, 0); - if (fieldObjectId != 0 && fieldObjectId != 16) + behaviorAt = GetFieldObjectIdByXYZ(curX, curY, 0); + if (behaviorAt != 0 && behaviorAt != 16) { return FALSE; } @@ -2595,7 +2594,11 @@ bool8 sub_80FFC24(u8 taskId, const struct Decoration *decoration) for (j=0; j Date: Tue, 13 Jun 2017 21:51:56 -0400 Subject: Somehow these field labels didn't get updated, not that it matters for matching --- src/decoration.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 8601cb37c..73a2a6749 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -3945,28 +3945,28 @@ void sub_8101460(u8 taskId) { for (i=0; i> 4; yOff = ewram_1f000.pos[gUnknown_020391B4[0].decorId] & 0xf; - sub_81013B8(xOff, yOff - gUnknown_020391B4[0].var02 + 1, xOff + gUnknown_020391B4[0].var01 - 1, yOff); + sub_81013B8(xOff, yOff - gUnknown_020391B4[0].height + 1, xOff + gUnknown_020391B4[0].width - 1, yOff); } } } #else __attribute__((naked)) - void sub_8101460(u8 taskId) { asm(".syntax unified\n" -- cgit v1.2.3 From 826664fbdab63fef78bd29d95cf06db5175d9e43 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 13 Jun 2017 21:55:42 -0400 Subject: Propagate decoration category field label --- src/decoration_inventory.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/decoration_inventory.c b/src/decoration_inventory.c index a483629b1..879ceeb82 100644 --- a/src/decoration_inventory.c +++ b/src/decoration_inventory.c @@ -43,7 +43,7 @@ bool8 sub_8133FE4(u8 decorIdx) { u8 invIdx; u8 i; - invIdx = gDecorations[decorIdx].decor_field_13; + invIdx = gDecorations[decorIdx].category; for (i=0; i Date: Tue, 13 Jun 2017 22:09:06 -0400 Subject: Fix mixed whitespace --- src/field_map_obj.c | 274 ++++++------- src/secret_base.c | 890 ++++++++++++++++++++--------------------- src/tv.c | 1112 +++++++++++++++++++++++++-------------------------- src/util.c | 690 ++++++++++++++++---------------- 4 files changed, 1483 insertions(+), 1483 deletions(-) (limited to 'src') diff --git a/src/field_map_obj.c b/src/field_map_obj.c index eaad98cb0..26cd1de02 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -4302,39 +4302,39 @@ __attribute__((naked)) int state_to_direction(u8 a0, u8 a1, u8 a2) { asm(".syntax unified\n\ - push {r4,lr}\n\ - lsls r0, 24\n\ - lsrs r4, r0, 24\n\ - lsls r1, 24\n\ - lsrs r1, 24\n\ - adds r0, r1, 0\n\ - lsls r2, 24\n\ - lsrs r2, 24\n\ - cmp r1, 0\n\ - beq _08060BFC\n\ - cmp r2, 0\n\ - beq _08060BFC\n\ - cmp r1, 0x4\n\ - bhi _08060BFC\n\ - cmp r2, 0x4\n\ - bls _08060C00\n\ + push {r4,lr}\n\ + lsls r0, 24\n\ + lsrs r4, r0, 24\n\ + lsls r1, 24\n\ + lsrs r1, 24\n\ + adds r0, r1, 0\n\ + lsls r2, 24\n\ + lsrs r2, 24\n\ + cmp r1, 0\n\ + beq _08060BFC\n\ + cmp r2, 0\n\ + beq _08060BFC\n\ + cmp r1, 0x4\n\ + bhi _08060BFC\n\ + cmp r2, 0x4\n\ + bls _08060C00\n\ _08060BFC:\n\ - movs r0, 0\n\ - b _08060C12\n\ + movs r0, 0\n\ + b _08060C12\n\ _08060C00:\n\ - adds r1, r2, 0\n\ - bl zffu_offset_calc\n\ - ldr r2, _08060C18 @ =gUnknown_08375767\n\ - lsls r1, r4, 2\n\ - subs r1, 0x5\n\ - adds r0, r1\n\ - adds r0, r2\n\ - ldrb r0, [r0]\n\ + adds r1, r2, 0\n\ + bl zffu_offset_calc\n\ + ldr r2, _08060C18 @ =gUnknown_08375767\n\ + lsls r1, r4, 2\n\ + subs r1, 0x5\n\ + adds r0, r1\n\ + adds r0, r2\n\ + ldrb r0, [r0]\n\ _08060C12:\n\ - pop {r4}\n\ - pop {r1}\n\ - bx r1\n\ - .align 2, 0\n\ + pop {r4}\n\ + pop {r1}\n\ + bx r1\n\ + .align 2, 0\n\ _08060C18: .4byte gUnknown_08375767\n\ .syntax divided\n"); } @@ -6609,121 +6609,121 @@ void sub_80634E8(struct MapObject *mapObject, struct Sprite *sprite) __attribute__((naked)) void sub_80634E8(struct MapObject *mapObject, struct Sprite *sprite) { asm(".syntax unified\n\ - push {r4-r6,lr}\n\ - adds r5, r0, 0\n\ - adds r4, r1, 0\n\ - ldrb r1, [r5, 0x1]\n\ - movs r0, 0x41\n\ - negs r0, r0\n\ - ands r0, r1\n\ - strb r0, [r5, 0x1]\n\ - ldrb r0, [r5, 0x5]\n\ - bl GetFieldObjectGraphicsInfo\n\ - adds r6, r0, 0\n\ - adds r0, r4, 0\n\ - adds r0, 0x3E\n\ - ldrb r1, [r0]\n\ - movs r0, 0x2\n\ - ands r0, r1\n\ - cmp r0, 0\n\ - beq _0806354C\n\ - ldrh r1, [r4, 0x24]\n\ - ldrh r0, [r4, 0x20]\n\ - adds r1, r0\n\ - adds r0, r4, 0\n\ - adds r0, 0x28\n\ - ldrb r0, [r0]\n\ - lsls r0, 24\n\ - asrs r0, 24\n\ - ldr r2, _08063544 @ =gSpriteCoordOffsetX\n\ - adds r0, r1\n\ - ldrh r2, [r2]\n\ - adds r0, r2\n\ - lsls r0, 16\n\ - lsrs r3, r0, 16\n\ - ldrh r1, [r4, 0x26]\n\ - ldrh r0, [r4, 0x22]\n\ - adds r1, r0\n\ - adds r0, r4, 0\n\ - adds r0, 0x29\n\ - ldrb r0, [r0]\n\ - lsls r0, 24\n\ - asrs r0, 24\n\ - ldr r2, _08063548 @ =gSpriteCoordOffsetY\n\ - adds r0, r1\n\ - ldrh r2, [r2]\n\ - adds r0, r2\n\ - b _08063574\n\ - .align 2, 0\n\ + push {r4-r6,lr}\n\ + adds r5, r0, 0\n\ + adds r4, r1, 0\n\ + ldrb r1, [r5, 0x1]\n\ + movs r0, 0x41\n\ + negs r0, r0\n\ + ands r0, r1\n\ + strb r0, [r5, 0x1]\n\ + ldrb r0, [r5, 0x5]\n\ + bl GetFieldObjectGraphicsInfo\n\ + adds r6, r0, 0\n\ + adds r0, r4, 0\n\ + adds r0, 0x3E\n\ + ldrb r1, [r0]\n\ + movs r0, 0x2\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _0806354C\n\ + ldrh r1, [r4, 0x24]\n\ + ldrh r0, [r4, 0x20]\n\ + adds r1, r0\n\ + adds r0, r4, 0\n\ + adds r0, 0x28\n\ + ldrb r0, [r0]\n\ + lsls r0, 24\n\ + asrs r0, 24\n\ + ldr r2, _08063544 @ =gSpriteCoordOffsetX\n\ + adds r0, r1\n\ + ldrh r2, [r2]\n\ + adds r0, r2\n\ + lsls r0, 16\n\ + lsrs r3, r0, 16\n\ + ldrh r1, [r4, 0x26]\n\ + ldrh r0, [r4, 0x22]\n\ + adds r1, r0\n\ + adds r0, r4, 0\n\ + adds r0, 0x29\n\ + ldrb r0, [r0]\n\ + lsls r0, 24\n\ + asrs r0, 24\n\ + ldr r2, _08063548 @ =gSpriteCoordOffsetY\n\ + adds r0, r1\n\ + ldrh r2, [r2]\n\ + adds r0, r2\n\ + b _08063574\n\ + .align 2, 0\n\ _08063544: .4byte gSpriteCoordOffsetX\n\ _08063548: .4byte gSpriteCoordOffsetY\n\ _0806354C:\n\ - ldrh r1, [r4, 0x24]\n\ - ldrh r0, [r4, 0x20]\n\ - adds r1, r0\n\ - adds r0, r4, 0\n\ - adds r0, 0x28\n\ - ldrb r0, [r0]\n\ - lsls r0, 24\n\ - asrs r0, 24\n\ - adds r0, r1\n\ - lsls r0, 16\n\ - lsrs r3, r0, 16\n\ - ldrh r1, [r4, 0x26]\n\ - ldrh r0, [r4, 0x22]\n\ - adds r1, r0\n\ - adds r0, r4, 0\n\ - adds r0, 0x29\n\ - ldrb r0, [r0]\n\ - lsls r0, 24\n\ - asrs r0, 24\n\ - adds r0, r1\n\ + ldrh r1, [r4, 0x24]\n\ + ldrh r0, [r4, 0x20]\n\ + adds r1, r0\n\ + adds r0, r4, 0\n\ + adds r0, 0x28\n\ + ldrb r0, [r0]\n\ + lsls r0, 24\n\ + asrs r0, 24\n\ + adds r0, r1\n\ + lsls r0, 16\n\ + lsrs r3, r0, 16\n\ + ldrh r1, [r4, 0x26]\n\ + ldrh r0, [r4, 0x22]\n\ + adds r1, r0\n\ + adds r0, r4, 0\n\ + adds r0, 0x29\n\ + ldrb r0, [r0]\n\ + lsls r0, 24\n\ + asrs r0, 24\n\ + adds r0, r1\n\ _08063574:\n\ - lsls r0, 16\n\ - lsrs r2, r0, 16\n\ - ldrh r0, [r6, 0x8]\n\ - adds r0, r3\n\ - lsls r0, 16\n\ - lsrs r1, r0, 16\n\ - ldrh r0, [r6, 0xA]\n\ - adds r0, r2\n\ - lsls r0, 16\n\ - lsrs r4, r0, 16\n\ - lsls r0, r3, 16\n\ - asrs r0, 16\n\ - cmp r0, 0xFF\n\ - bgt _0806359C\n\ - lsls r0, r1, 16\n\ - asrs r0, 16\n\ - movs r1, 0x10\n\ - negs r1, r1\n\ - cmp r0, r1\n\ - bge _080635A4\n\ + lsls r0, 16\n\ + lsrs r2, r0, 16\n\ + ldrh r0, [r6, 0x8]\n\ + adds r0, r3\n\ + lsls r0, 16\n\ + lsrs r1, r0, 16\n\ + ldrh r0, [r6, 0xA]\n\ + adds r0, r2\n\ + lsls r0, 16\n\ + lsrs r4, r0, 16\n\ + lsls r0, r3, 16\n\ + asrs r0, 16\n\ + cmp r0, 0xFF\n\ + bgt _0806359C\n\ + lsls r0, r1, 16\n\ + asrs r0, 16\n\ + movs r1, 0x10\n\ + negs r1, r1\n\ + cmp r0, r1\n\ + bge _080635A4\n\ _0806359C:\n\ - ldrb r0, [r5, 0x1]\n\ - movs r1, 0x40\n\ - orrs r0, r1\n\ - strb r0, [r5, 0x1]\n\ + ldrb r0, [r5, 0x1]\n\ + movs r1, 0x40\n\ + orrs r0, r1\n\ + strb r0, [r5, 0x1]\n\ _080635A4:\n\ - lsls r0, r2, 16\n\ - asrs r0, 16\n\ - cmp r0, 0xAF\n\ - bgt _080635B8\n\ - lsls r0, r4, 16\n\ - asrs r0, 16\n\ - movs r1, 0x10\n\ - negs r1, r1\n\ - cmp r0, r1\n\ - bge _080635C0\n\ + lsls r0, r2, 16\n\ + asrs r0, 16\n\ + cmp r0, 0xAF\n\ + bgt _080635B8\n\ + lsls r0, r4, 16\n\ + asrs r0, 16\n\ + movs r1, 0x10\n\ + negs r1, r1\n\ + cmp r0, r1\n\ + bge _080635C0\n\ _080635B8:\n\ - ldrb r0, [r5, 0x1]\n\ - movs r1, 0x40\n\ - orrs r0, r1\n\ - strb r0, [r5, 0x1]\n\ + ldrb r0, [r5, 0x1]\n\ + movs r1, 0x40\n\ + orrs r0, r1\n\ + strb r0, [r5, 0x1]\n\ _080635C0:\n\ - pop {r4-r6}\n\ - pop {r0}\n\ - bx r0\n\ + pop {r4-r6}\n\ + pop {r0}\n\ + bx r0\n\ .syntax divided\n"); } #endif diff --git a/src/secret_base.c b/src/secret_base.c index 4ff0b6b17..aae3853f9 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -392,84 +392,84 @@ void sub_80BBCCC(u8 flagIn) { asm(".syntax unified\n\ push {r4-r7,lr}\n\ - mov r7, r8\n\ - push {r7}\n\ - sub sp, 0x4\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - mov r8, r0\n\ - bl CurrentMapIsSecretBase\n\ - lsls r0, 24\n\ - cmp r0, 0\n\ - beq _080BBDBC\n\ - ldr r0, _080BBD70 @ =0x00004054\n\ - bl VarGet\n\ - lsls r0, 16\n\ - lsrs r5, r0, 16\n\ - movs r1, 0\n\ - mov r0, sp\n\ - strh r1, [r0]\n\ - ldr r6, _080BBD74 @ =gSaveBlock1\n\ - mov r4, sp\n\ - ldr r0, _080BBD78 @ =0x00001a2a\n\ - adds r7, r6, r0\n\ + mov r7, r8\n\ + push {r7}\n\ + sub sp, 0x4\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + mov r8, r0\n\ + bl CurrentMapIsSecretBase\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + beq _080BBDBC\n\ + ldr r0, _080BBD70 @ =0x00004054\n\ + bl VarGet\n\ + lsls r0, 16\n\ + lsrs r5, r0, 16\n\ + movs r1, 0\n\ + mov r0, sp\n\ + strh r1, [r0]\n\ + ldr r6, _080BBD74 @ =gSaveBlock1\n\ + mov r4, sp\n\ + ldr r0, _080BBD78 @ =0x00001a2a\n\ + adds r7, r6, r0\n\ _080BBCFC:\n\ - lsls r0, r5, 2\n\ - adds r0, r5\n\ - lsls r0, 5\n\ - ldrh r1, [r4]\n\ - adds r2, r0, r1\n\ - ldr r1, _080BBD7C @ =0x00001a1a\n\ - adds r0, r6, r1\n\ - adds r1, r2, r0\n\ - ldrb r0, [r1]\n\ - subs r0, 0x1\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - cmp r0, 0x77\n\ - bhi _080BBD3A\n\ - ldr r0, _080BBD80 @ =gDecorations\n\ - ldrb r3, [r1]\n\ - lsls r1, r3, 5\n\ - adds r1, r0\n\ - ldrb r0, [r1, 0x11]\n\ - cmp r0, 0x4\n\ - beq _080BBD3A\n\ - adds r0, r2, r7\n\ - ldrb r2, [r0]\n\ - lsrs r0, r2, 4\n\ - adds r0, 0x7\n\ - movs r1, 0xF\n\ - ands r1, r2\n\ - adds r1, 0x7\n\ - adds r2, r3, 0\n\ - bl sub_80FF394\n\ + lsls r0, r5, 2\n\ + adds r0, r5\n\ + lsls r0, 5\n\ + ldrh r1, [r4]\n\ + adds r2, r0, r1\n\ + ldr r1, _080BBD7C @ =0x00001a1a\n\ + adds r0, r6, r1\n\ + adds r1, r2, r0\n\ + ldrb r0, [r1]\n\ + subs r0, 0x1\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + cmp r0, 0x77\n\ + bhi _080BBD3A\n\ + ldr r0, _080BBD80 @ =gDecorations\n\ + ldrb r3, [r1]\n\ + lsls r1, r3, 5\n\ + adds r1, r0\n\ + ldrb r0, [r1, 0x11]\n\ + cmp r0, 0x4\n\ + beq _080BBD3A\n\ + adds r0, r2, r7\n\ + ldrb r2, [r0]\n\ + lsrs r0, r2, 4\n\ + adds r0, 0x7\n\ + movs r1, 0xF\n\ + ands r1, r2\n\ + adds r1, 0x7\n\ + adds r2, r3, 0\n\ + bl sub_80FF394\n\ _080BBD3A:\n\ - ldrh r0, [r4]\n\ - adds r0, 0x1\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - strh r0, [r4]\n\ - cmp r0, 0xF\n\ - bls _080BBCFC\n\ - cmp r5, 0\n\ - beq _080BBD88\n\ - mov r4, sp\n\ - adds r4, 0x2\n\ - movs r2, 0x88\n\ - lsls r2, 2\n\ - mov r0, sp\n\ - adds r1, r4, 0\n\ - bl sub_80BB764\n\ - mov r0, sp\n\ - ldrh r0, [r0]\n\ - adds r0, 0x7\n\ - ldrh r1, [r4]\n\ - adds r1, 0x7\n\ - ldr r2, _080BBD84 @ =0x00000e21\n\ - bl MapGridSetMetatileIdAt\n\ - b _080BBDBC\n\ - .align 2, 0\n\ + ldrh r0, [r4]\n\ + adds r0, 0x1\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + strh r0, [r4]\n\ + cmp r0, 0xF\n\ + bls _080BBCFC\n\ + cmp r5, 0\n\ + beq _080BBD88\n\ + mov r4, sp\n\ + adds r4, 0x2\n\ + movs r2, 0x88\n\ + lsls r2, 2\n\ + mov r0, sp\n\ + adds r1, r4, 0\n\ + bl sub_80BB764\n\ + mov r0, sp\n\ + ldrh r0, [r0]\n\ + adds r0, 0x7\n\ + ldrh r1, [r4]\n\ + adds r1, 0x7\n\ + ldr r2, _080BBD84 @ =0x00000e21\n\ + bl MapGridSetMetatileIdAt\n\ + b _080BBDBC\n\ + .align 2, 0\n\ _080BBD70: .4byte 0x00004054\n\ _080BBD74: .4byte gSaveBlock1\n\ _080BBD78: .4byte 0x00001a2a\n\ @@ -477,37 +477,37 @@ _080BBD7C: .4byte 0x00001a1a\n\ _080BBD80: .4byte gDecorations\n\ _080BBD84: .4byte 0x00000e21\n\ _080BBD88:\n\ - mov r0, r8\n\ - cmp r0, 0x1\n\ - bne _080BBDBC\n\ - ldr r0, _080BBDC8 @ =0x00004089\n\ - bl VarGet\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - cmp r0, 0x1\n\ - bne _080BBDBC\n\ - mov r4, sp\n\ - adds r4, 0x2\n\ - movs r2, 0x88\n\ - lsls r2, 2\n\ - mov r0, sp\n\ - adds r1, r4, 0\n\ - bl sub_80BB764\n\ - mov r0, sp\n\ - ldrh r0, [r0]\n\ - adds r0, 0x7\n\ - ldrh r1, [r4]\n\ - adds r1, 0x7\n\ - ldr r2, _080BBDCC @ =0x00000e0a\n\ - bl MapGridSetMetatileIdAt\n\ + mov r0, r8\n\ + cmp r0, 0x1\n\ + bne _080BBDBC\n\ + ldr r0, _080BBDC8 @ =0x00004089\n\ + bl VarGet\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + cmp r0, 0x1\n\ + bne _080BBDBC\n\ + mov r4, sp\n\ + adds r4, 0x2\n\ + movs r2, 0x88\n\ + lsls r2, 2\n\ + mov r0, sp\n\ + adds r1, r4, 0\n\ + bl sub_80BB764\n\ + mov r0, sp\n\ + ldrh r0, [r0]\n\ + adds r0, 0x7\n\ + ldrh r1, [r4]\n\ + adds r1, 0x7\n\ + ldr r2, _080BBDCC @ =0x00000e0a\n\ + bl MapGridSetMetatileIdAt\n\ _080BBDBC:\n\ - add sp, 0x4\n\ - pop {r3}\n\ - mov r8, r3\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - .align 2, 0\n\ + add sp, 0x4\n\ + pop {r3}\n\ + mov r8, r3\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .align 2, 0\n\ _080BBDC8: .4byte 0x00004089\n\ _080BBDCC: .4byte 0x00000e0a\n\ .syntax divided\n"); @@ -517,220 +517,220 @@ __attribute__((naked)) void sub_80BBDD0(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, 0x14\n\ - ldr r0, _080BBE00 @ =0x00004054\n\ - bl VarGet\n\ - lsls r0, 16\n\ - lsrs r4, r0, 16\n\ - bl CurrentMapIsSecretBase\n\ - lsls r0, 24\n\ - cmp r0, 0\n\ - bne _080BBE08\n\ - ldr r0, _080BBE04 @ =gSaveBlock1 + 0x2688\n\ - str r0, [sp, 0x4]\n\ - adds r0, 0xC\n\ - str r0, [sp, 0x8]\n\ - movs r1, 0xC\n\ - str r1, [sp, 0xC]\n\ - b _080BBE1E\n\ - .align 2, 0\n\ + push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0x14\n\ + ldr r0, _080BBE00 @ =0x00004054\n\ + bl VarGet\n\ + lsls r0, 16\n\ + lsrs r4, r0, 16\n\ + bl CurrentMapIsSecretBase\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + bne _080BBE08\n\ + ldr r0, _080BBE04 @ =gSaveBlock1 + 0x2688\n\ + str r0, [sp, 0x4]\n\ + adds r0, 0xC\n\ + str r0, [sp, 0x8]\n\ + movs r1, 0xC\n\ + str r1, [sp, 0xC]\n\ + b _080BBE1E\n\ + .align 2, 0\n\ _080BBE00: .4byte 0x00004054\n\ _080BBE04: .4byte gSaveBlock1 + 0x2688\n\ _080BBE08:\n\ - lsls r1, r4, 2\n\ - adds r1, r4\n\ - lsls r1, 5\n\ - ldr r0, _080BBF7C @ =gSaveBlock1 + 0x1A1A\n\ - adds r2, r1, r0\n\ - str r2, [sp, 0x4]\n\ - adds r0, 0x10\n\ - adds r1, r0\n\ - str r1, [sp, 0x8]\n\ - movs r3, 0x10\n\ - str r3, [sp, 0xC]\n\ + lsls r1, r4, 2\n\ + adds r1, r4\n\ + lsls r1, 5\n\ + ldr r0, _080BBF7C @ =gSaveBlock1 + 0x1A1A\n\ + adds r2, r1, r0\n\ + str r2, [sp, 0x4]\n\ + adds r0, 0x10\n\ + adds r1, r0\n\ + str r1, [sp, 0x8]\n\ + movs r3, 0x10\n\ + str r3, [sp, 0xC]\n\ _080BBE1E:\n\ - movs r6, 0\n\ - ldr r4, [sp, 0xC]\n\ - cmp r6, r4\n\ - bcc _080BBE28\n\ - b _080BBF6C\n\ + movs r6, 0\n\ + ldr r4, [sp, 0xC]\n\ + cmp r6, r4\n\ + bcc _080BBE28\n\ + b _080BBF6C\n\ _080BBE28:\n\ - ldr r5, _080BBF80 @ =gSaveBlock1\n\ - mov r10, r5\n\ + ldr r5, _080BBF80 @ =gSaveBlock1\n\ + mov r10, r5\n\ _080BBE2C:\n\ - ldr r1, [sp, 0x4]\n\ - adds r0, r1, r6\n\ - ldrb r1, [r0]\n\ - mov r9, r0\n\ - adds r2, r6, 0x1\n\ - str r2, [sp, 0x10]\n\ - cmp r1, 0\n\ - bne _080BBE3E\n\ - b _080BBF5E\n\ + ldr r1, [sp, 0x4]\n\ + adds r0, r1, r6\n\ + ldrb r1, [r0]\n\ + mov r9, r0\n\ + adds r2, r6, 0x1\n\ + str r2, [sp, 0x10]\n\ + cmp r1, 0\n\ + bne _080BBE3E\n\ + b _080BBF5E\n\ _080BBE3E:\n\ - ldrb r0, [r0]\n\ - lsls r0, 5\n\ - ldr r3, _080BBF84 @ =gDecorations\n\ - adds r0, r3\n\ - ldrb r0, [r0, 0x11]\n\ - cmp r0, 0x4\n\ - beq _080BBE4E\n\ - b _080BBF5E\n\ + ldrb r0, [r0]\n\ + lsls r0, 5\n\ + ldr r3, _080BBF84 @ =gDecorations\n\ + adds r0, r3\n\ + ldrb r0, [r0, 0x11]\n\ + cmp r0, 0x4\n\ + beq _080BBE4E\n\ + b _080BBF5E\n\ _080BBE4E:\n\ - movs r5, 0\n\ - ldr r0, _080BBF88 @ =gMapHeader\n\ - ldr r2, [r0, 0x4]\n\ - ldrb r3, [r2]\n\ - mov r8, r0\n\ - cmp r5, r3\n\ - bcs _080BBE8E\n\ - ldr r0, [r2, 0x4]\n\ - ldrh r1, [r0, 0x14]\n\ - ldr r4, _080BBF8C @ =gSpecialVar_0x8004\n\ - ldrh r0, [r4]\n\ - adds r0, 0xAE\n\ - adds r7, r4, 0\n\ - cmp r1, r0\n\ - beq _080BBE8E\n\ - adds r4, r2, 0\n\ - adds r2, r3, 0\n\ + movs r5, 0\n\ + ldr r0, _080BBF88 @ =gMapHeader\n\ + ldr r2, [r0, 0x4]\n\ + ldrb r3, [r2]\n\ + mov r8, r0\n\ + cmp r5, r3\n\ + bcs _080BBE8E\n\ + ldr r0, [r2, 0x4]\n\ + ldrh r1, [r0, 0x14]\n\ + ldr r4, _080BBF8C @ =gSpecialVar_0x8004\n\ + ldrh r0, [r4]\n\ + adds r0, 0xAE\n\ + adds r7, r4, 0\n\ + cmp r1, r0\n\ + beq _080BBE8E\n\ + adds r4, r2, 0\n\ + adds r2, r3, 0\n\ _080BBE70:\n\ - adds r0, r5, 0x1\n\ - lsls r0, 24\n\ - lsrs r5, r0, 24\n\ - cmp r5, r2\n\ - bcs _080BBE8E\n\ - ldr r1, [r4, 0x4]\n\ - lsls r0, r5, 1\n\ - adds r0, r5\n\ - lsls r0, 3\n\ - adds r0, r1\n\ - ldrh r1, [r0, 0x14]\n\ - ldrh r0, [r7]\n\ - adds r0, 0xAE\n\ - cmp r1, r0\n\ - bne _080BBE70\n\ + adds r0, r5, 0x1\n\ + lsls r0, 24\n\ + lsrs r5, r0, 24\n\ + cmp r5, r2\n\ + bcs _080BBE8E\n\ + ldr r1, [r4, 0x4]\n\ + lsls r0, r5, 1\n\ + adds r0, r5\n\ + lsls r0, 3\n\ + adds r0, r1\n\ + ldrh r1, [r0, 0x14]\n\ + ldrh r0, [r7]\n\ + adds r0, 0xAE\n\ + cmp r1, r0\n\ + bne _080BBE70\n\ _080BBE8E:\n\ - mov r1, r8\n\ - ldr r0, [r1, 0x4]\n\ - ldrb r0, [r0]\n\ - cmp r5, r0\n\ - beq _080BBF5E\n\ - ldr r7, _080BBF90 @ =gSpecialVar_0x8006\n\ - ldr r2, [sp, 0x8]\n\ - adds r1, r2, r6\n\ - ldrb r0, [r1]\n\ - lsrs r0, 4\n\ - strh r0, [r7]\n\ - ldr r6, _080BBF94 @ =gSpecialVar_0x8007\n\ - ldrb r1, [r1]\n\ - movs r0, 0xF\n\ - ands r0, r1\n\ - strh r0, [r6]\n\ - ldrh r0, [r7]\n\ - adds r0, 0x7\n\ - ldrh r1, [r6]\n\ - adds r1, 0x7\n\ - bl MapGridGetMetatileBehaviorAt\n\ - lsls r0, 24\n\ - lsrs r4, r0, 24\n\ - adds r0, r4, 0\n\ - bl sub_80572D8\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - cmp r0, 0x1\n\ - beq _080BBEDA\n\ - adds r0, r4, 0\n\ - bl sub_80572EC\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - cmp r0, 0x1\n\ - bne _080BBF5E\n\ + mov r1, r8\n\ + ldr r0, [r1, 0x4]\n\ + ldrb r0, [r0]\n\ + cmp r5, r0\n\ + beq _080BBF5E\n\ + ldr r7, _080BBF90 @ =gSpecialVar_0x8006\n\ + ldr r2, [sp, 0x8]\n\ + adds r1, r2, r6\n\ + ldrb r0, [r1]\n\ + lsrs r0, 4\n\ + strh r0, [r7]\n\ + ldr r6, _080BBF94 @ =gSpecialVar_0x8007\n\ + ldrb r1, [r1]\n\ + movs r0, 0xF\n\ + ands r0, r1\n\ + strh r0, [r6]\n\ + ldrh r0, [r7]\n\ + adds r0, 0x7\n\ + ldrh r1, [r6]\n\ + adds r1, 0x7\n\ + bl MapGridGetMetatileBehaviorAt\n\ + lsls r0, 24\n\ + lsrs r4, r0, 24\n\ + adds r0, r4, 0\n\ + bl sub_80572D8\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + cmp r0, 0x1\n\ + beq _080BBEDA\n\ + adds r0, r4, 0\n\ + bl sub_80572EC\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + cmp r0, 0x1\n\ + bne _080BBF5E\n\ _080BBEDA:\n\ - mov r3, r8\n\ - ldr r0, [r3, 0x4]\n\ - ldr r1, [r0, 0x4]\n\ - lsls r4, r5, 1\n\ - adds r4, r5\n\ - lsls r4, 3\n\ - adds r1, r4, r1\n\ - ldr r5, _080BBF98 @ =0x00003f20\n\ - adds r0, r5, 0\n\ - ldrb r1, [r1, 0x1]\n\ - adds r0, r1\n\ - ldr r1, _080BBF9C @ =gScriptResult\n\ - strh r0, [r1]\n\ - ldrh r0, [r1]\n\ - mov r2, r9\n\ - ldrb r1, [r2]\n\ - lsls r1, 5\n\ - ldr r3, _080BBFA0 @ =gDecorations + 0x1C\n\ - adds r1, r3\n\ - ldr r1, [r1]\n\ - ldrh r1, [r1]\n\ - bl VarSet\n\ - mov r5, r8\n\ - ldr r0, [r5, 0x4]\n\ - ldr r0, [r0, 0x4]\n\ - adds r4, r0\n\ - ldrb r0, [r4]\n\ - ldr r1, _080BBF9C @ =gScriptResult\n\ - strh r0, [r1]\n\ - ldr r2, _080BBF8C @ =gSpecialVar_0x8004\n\ - ldrh r0, [r2]\n\ - adds r0, 0xAE\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - bl FlagReset\n\ - ldr r3, _080BBF9C @ =gScriptResult\n\ - ldrb r0, [r3]\n\ - mov r4, r10\n\ - ldrb r1, [r4, 0x5]\n\ - ldrb r2, [r4, 0x4]\n\ - bl show_sprite\n\ - ldr r5, _080BBF9C @ =gScriptResult\n\ - ldrb r0, [r5]\n\ - ldrb r1, [r4, 0x5]\n\ - ldrb r2, [r4, 0x4]\n\ - movs r4, 0\n\ - ldrsh r3, [r7, r4]\n\ - movs r5, 0\n\ - ldrsh r4, [r6, r5]\n\ - str r4, [sp]\n\ - bl sub_805C0F8\n\ - ldr r1, _080BBF9C @ =gScriptResult\n\ - ldrb r0, [r1]\n\ - mov r2, r10\n\ - ldrb r1, [r2, 0x5]\n\ - ldrb r2, [r2, 0x4]\n\ - bl sub_805C78C\n\ - ldr r3, _080BBF8C @ =gSpecialVar_0x8004\n\ - ldrh r0, [r3]\n\ - adds r0, 0x1\n\ - strh r0, [r3]\n\ + mov r3, r8\n\ + ldr r0, [r3, 0x4]\n\ + ldr r1, [r0, 0x4]\n\ + lsls r4, r5, 1\n\ + adds r4, r5\n\ + lsls r4, 3\n\ + adds r1, r4, r1\n\ + ldr r5, _080BBF98 @ =0x00003f20\n\ + adds r0, r5, 0\n\ + ldrb r1, [r1, 0x1]\n\ + adds r0, r1\n\ + ldr r1, _080BBF9C @ =gScriptResult\n\ + strh r0, [r1]\n\ + ldrh r0, [r1]\n\ + mov r2, r9\n\ + ldrb r1, [r2]\n\ + lsls r1, 5\n\ + ldr r3, _080BBFA0 @ =gDecorations + 0x1C\n\ + adds r1, r3\n\ + ldr r1, [r1]\n\ + ldrh r1, [r1]\n\ + bl VarSet\n\ + mov r5, r8\n\ + ldr r0, [r5, 0x4]\n\ + ldr r0, [r0, 0x4]\n\ + adds r4, r0\n\ + ldrb r0, [r4]\n\ + ldr r1, _080BBF9C @ =gScriptResult\n\ + strh r0, [r1]\n\ + ldr r2, _080BBF8C @ =gSpecialVar_0x8004\n\ + ldrh r0, [r2]\n\ + adds r0, 0xAE\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + bl FlagReset\n\ + ldr r3, _080BBF9C @ =gScriptResult\n\ + ldrb r0, [r3]\n\ + mov r4, r10\n\ + ldrb r1, [r4, 0x5]\n\ + ldrb r2, [r4, 0x4]\n\ + bl show_sprite\n\ + ldr r5, _080BBF9C @ =gScriptResult\n\ + ldrb r0, [r5]\n\ + ldrb r1, [r4, 0x5]\n\ + ldrb r2, [r4, 0x4]\n\ + movs r4, 0\n\ + ldrsh r3, [r7, r4]\n\ + movs r5, 0\n\ + ldrsh r4, [r6, r5]\n\ + str r4, [sp]\n\ + bl sub_805C0F8\n\ + ldr r1, _080BBF9C @ =gScriptResult\n\ + ldrb r0, [r1]\n\ + mov r2, r10\n\ + ldrb r1, [r2, 0x5]\n\ + ldrb r2, [r2, 0x4]\n\ + bl sub_805C78C\n\ + ldr r3, _080BBF8C @ =gSpecialVar_0x8004\n\ + ldrh r0, [r3]\n\ + adds r0, 0x1\n\ + strh r0, [r3]\n\ _080BBF5E:\n\ - ldr r4, [sp, 0x10]\n\ - lsls r0, r4, 24\n\ - lsrs r6, r0, 24\n\ - ldr r5, [sp, 0xC]\n\ - cmp r6, r5\n\ - bcs _080BBF6C\n\ - b _080BBE2C\n\ + ldr r4, [sp, 0x10]\n\ + lsls r0, r4, 24\n\ + lsrs r6, r0, 24\n\ + ldr r5, [sp, 0xC]\n\ + cmp r6, r5\n\ + bcs _080BBF6C\n\ + b _080BBE2C\n\ _080BBF6C:\n\ - add sp, 0x14\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\ + add sp, 0x14\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\ _080BBF7C: .4byte gSaveBlock1 + 0x1A1A\n\ _080BBF80: .4byte gSaveBlock1\n\ _080BBF84: .4byte gDecorations\n\ @@ -901,148 +901,148 @@ __attribute__((naked)) void sub_80BC300(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, 0xC\n\ - movs r0, 0\n\ - mov r10, r0\n\ - movs r6, 0\n\ - mov r9, r6\n\ + push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0xC\n\ + movs r0, 0\n\ + mov r10, r0\n\ + movs r6, 0\n\ + mov r9, r6\n\ _080BC314:\n\ - movs r4, 0\n\ - lsls r3, r6, 2\n\ - lsls r2, r6, 1\n\ - ldr r7, _080BC424 @ =gPlayerParty\n\ - adds r1, r6, 0x1\n\ - str r1, [sp]\n\ - adds r1, r3, 0\n\ + movs r4, 0\n\ + lsls r3, r6, 2\n\ + lsls r2, r6, 1\n\ + ldr r7, _080BC424 @ =gPlayerParty\n\ + adds r1, r6, 0x1\n\ + str r1, [sp]\n\ + adds r1, r3, 0\n\ _080BC322:\n\ - adds r0, r1, r4\n\ - lsls r0, 1\n\ - ldr r5, _080BC428 @ =gSaveBlock1 + 0x1A54\n\ - adds r0, r5, r0\n\ - mov r5, r9\n\ - strh r5, [r0]\n\ - adds r0, r4, 0x1\n\ - lsls r0, 16\n\ - lsrs r4, r0, 16\n\ - cmp r4, 0x3\n\ - bls _080BC322\n\ - ldr r1, _080BC42C @ =gSaveBlock1 + 0x1A84\n\ - adds r0, r1, r2\n\ - strh r5, [r0]\n\ - ldr r5, _080BC430 @ =gSaveBlock1 + 0x1A90\n\ - adds r0, r5, r2\n\ - mov r1, r9\n\ - strh r1, [r0]\n\ - ldr r2, _080BC434 @ =gSaveBlock1 + 0x1A9C\n\ - adds r0, r2, r6\n\ - mov r5, r9\n\ - strb r5, [r0]\n\ - ldr r1, _080BC438 @ =gSaveBlock1 + 0x1A3C\n\ - adds r0, r1, r3\n\ - mov r2, r9\n\ - str r2, [r0]\n\ - ldr r3, _080BC43C @ =gSaveBlock1 + 0x1AA2\n\ - adds r0, r3, r6\n\ - strb r2, [r0]\n\ - movs r0, 0x64\n\ - adds r5, r6, 0\n\ - muls r5, r0\n\ - adds r4, r5, r7\n\ - adds r0, r4, 0\n\ - movs r1, 0xB\n\ - bl GetMonData\n\ - cmp r0, 0\n\ - beq _080BC408\n\ - adds r0, r4, 0\n\ - movs r1, 0x2D\n\ - bl GetMonData\n\ - cmp r0, 0\n\ - bne _080BC408\n\ - movs r4, 0\n\ - mov r0, r10\n\ - lsls r0, 2\n\ - mov r8, r0\n\ - mov r1, r10\n\ - lsls r7, r1, 1\n\ - adds r1, 0x1\n\ - str r1, [sp, 0x4]\n\ - ldr r2, _080BC424 @ =gPlayerParty\n\ + adds r0, r1, r4\n\ + lsls r0, 1\n\ + ldr r5, _080BC428 @ =gSaveBlock1 + 0x1A54\n\ + adds r0, r5, r0\n\ + mov r5, r9\n\ + strh r5, [r0]\n\ + adds r0, r4, 0x1\n\ + lsls r0, 16\n\ + lsrs r4, r0, 16\n\ + cmp r4, 0x3\n\ + bls _080BC322\n\ + ldr r1, _080BC42C @ =gSaveBlock1 + 0x1A84\n\ + adds r0, r1, r2\n\ + strh r5, [r0]\n\ + ldr r5, _080BC430 @ =gSaveBlock1 + 0x1A90\n\ + adds r0, r5, r2\n\ + mov r1, r9\n\ + strh r1, [r0]\n\ + ldr r2, _080BC434 @ =gSaveBlock1 + 0x1A9C\n\ + adds r0, r2, r6\n\ + mov r5, r9\n\ + strb r5, [r0]\n\ + ldr r1, _080BC438 @ =gSaveBlock1 + 0x1A3C\n\ + adds r0, r1, r3\n\ + mov r2, r9\n\ + str r2, [r0]\n\ + ldr r3, _080BC43C @ =gSaveBlock1 + 0x1AA2\n\ + adds r0, r3, r6\n\ + strb r2, [r0]\n\ + movs r0, 0x64\n\ + adds r5, r6, 0\n\ + muls r5, r0\n\ + adds r4, r5, r7\n\ + adds r0, r4, 0\n\ + movs r1, 0xB\n\ + bl GetMonData\n\ + cmp r0, 0\n\ + beq _080BC408\n\ + adds r0, r4, 0\n\ + movs r1, 0x2D\n\ + bl GetMonData\n\ + cmp r0, 0\n\ + bne _080BC408\n\ + movs r4, 0\n\ + mov r0, r10\n\ + lsls r0, 2\n\ + mov r8, r0\n\ + mov r1, r10\n\ + lsls r7, r1, 1\n\ + adds r1, 0x1\n\ + str r1, [sp, 0x4]\n\ + ldr r2, _080BC424 @ =gPlayerParty\n\ _080BC38E:\n\ - adds r1, r4, 0\n\ - adds r1, 0xD\n\ - adds r0, r5, r2\n\ - str r2, [sp, 0x8]\n\ - bl GetMonData\n\ - mov r3, r8\n\ - adds r1, r3, r4\n\ - lsls r1, 1\n\ - ldr r3, _080BC428 @ =gSaveBlock1 + 0x1A54\n\ - adds r1, r3, r1\n\ - strh r0, [r1]\n\ - adds r0, r4, 0x1\n\ - lsls r0, 16\n\ - lsrs r4, r0, 16\n\ - ldr r2, [sp, 0x8]\n\ - cmp r4, 0x3\n\ - bls _080BC38E\n\ - movs r0, 0x64\n\ - adds r4, r6, 0\n\ - muls r4, r0\n\ - ldr r0, _080BC424 @ =gPlayerParty\n\ - adds r4, r0\n\ - adds r0, r4, 0\n\ - movs r1, 0xB\n\ - bl GetMonData\n\ - ldr r5, _080BC42C @ =gSaveBlock1 + 0x1A84\n\ - adds r1, r5, r7\n\ - strh r0, [r1]\n\ - adds r0, r4, 0\n\ - movs r1, 0xC\n\ - bl GetMonData\n\ - ldr r2, _080BC430 @ =gSaveBlock1 + 0x1A90\n\ - adds r1, r2, r7\n\ - strh r0, [r1]\n\ - adds r0, r4, 0\n\ - movs r1, 0x38\n\ - bl GetMonData\n\ - ldr r1, _080BC434 @ =gSaveBlock1 + 0x1A9C\n\ - add r1, r10\n\ - strb r0, [r1]\n\ - adds r0, r4, 0\n\ - movs r1, 0\n\ - bl GetMonData\n\ - ldr r1, _080BC438 @ =gSaveBlock1 + 0x1A3C\n\ - add r1, r8\n\ - str r0, [r1]\n\ - adds r0, r4, 0\n\ - bl sub_80BC298\n\ - ldr r1, _080BC43C @ =gSaveBlock1 + 0x1AA2\n\ - add r1, r10\n\ - strb r0, [r1]\n\ - ldr r3, [sp, 0x4]\n\ - lsls r0, r3, 16\n\ - lsrs r0, 16\n\ - mov r10, r0\n\ + adds r1, r4, 0\n\ + adds r1, 0xD\n\ + adds r0, r5, r2\n\ + str r2, [sp, 0x8]\n\ + bl GetMonData\n\ + mov r3, r8\n\ + adds r1, r3, r4\n\ + lsls r1, 1\n\ + ldr r3, _080BC428 @ =gSaveBlock1 + 0x1A54\n\ + adds r1, r3, r1\n\ + strh r0, [r1]\n\ + adds r0, r4, 0x1\n\ + lsls r0, 16\n\ + lsrs r4, r0, 16\n\ + ldr r2, [sp, 0x8]\n\ + cmp r4, 0x3\n\ + bls _080BC38E\n\ + movs r0, 0x64\n\ + adds r4, r6, 0\n\ + muls r4, r0\n\ + ldr r0, _080BC424 @ =gPlayerParty\n\ + adds r4, r0\n\ + adds r0, r4, 0\n\ + movs r1, 0xB\n\ + bl GetMonData\n\ + ldr r5, _080BC42C @ =gSaveBlock1 + 0x1A84\n\ + adds r1, r5, r7\n\ + strh r0, [r1]\n\ + adds r0, r4, 0\n\ + movs r1, 0xC\n\ + bl GetMonData\n\ + ldr r2, _080BC430 @ =gSaveBlock1 + 0x1A90\n\ + adds r1, r2, r7\n\ + strh r0, [r1]\n\ + adds r0, r4, 0\n\ + movs r1, 0x38\n\ + bl GetMonData\n\ + ldr r1, _080BC434 @ =gSaveBlock1 + 0x1A9C\n\ + add r1, r10\n\ + strb r0, [r1]\n\ + adds r0, r4, 0\n\ + movs r1, 0\n\ + bl GetMonData\n\ + ldr r1, _080BC438 @ =gSaveBlock1 + 0x1A3C\n\ + add r1, r8\n\ + str r0, [r1]\n\ + adds r0, r4, 0\n\ + bl sub_80BC298\n\ + ldr r1, _080BC43C @ =gSaveBlock1 + 0x1AA2\n\ + add r1, r10\n\ + strb r0, [r1]\n\ + ldr r3, [sp, 0x4]\n\ + lsls r0, r3, 16\n\ + lsrs r0, 16\n\ + mov r10, r0\n\ _080BC408:\n\ - ldr r5, [sp]\n\ - lsls r0, r5, 16\n\ - lsrs r6, r0, 16\n\ - cmp r6, 0x5\n\ - bls _080BC314\n\ - add sp, 0xC\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\ + ldr r5, [sp]\n\ + lsls r0, r5, 16\n\ + lsrs r6, r0, 16\n\ + cmp r6, 0x5\n\ + bls _080BC314\n\ + add sp, 0xC\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\ _080BC424: .4byte gPlayerParty\n\ _080BC428: .4byte gSaveBlock1 + 0x1A54\n\ _080BC42C: .4byte gSaveBlock1 + 0x1A84\n\ diff --git a/src/tv.c b/src/tv.c index 566d547a6..e1bf7c8fe 100644 --- a/src/tv.c +++ b/src/tv.c @@ -182,100 +182,100 @@ __attribute__((naked)) u8 special_0x44(void) { asm(".syntax unified\n" - " push {r4-r7,lr}\n" - " mov r7, r9\n" - " mov r6, r8\n" - " push {r6,r7}\n" - " movs r4, 0x5\n" - " ldr r1, _080BD874 @ =gSaveBlock1\n" - " ldr r2, _080BD878 @ =0x000027ec\n" - " adds r0, r1, r2\n" - " ldrb r0, [r0]\n" - " cmp r0, 0\n" - " beq _080BD834\n" - " adds r2, r1, 0\n" - " ldr r1, _080BD87C @ =0x00002738\n" + " push {r4-r7,lr}\n" + " mov r7, r9\n" + " mov r6, r8\n" + " push {r6,r7}\n" + " movs r4, 0x5\n" + " ldr r1, _080BD874 @ =gSaveBlock1\n" + " ldr r2, _080BD878 @ =0x000027ec\n" + " adds r0, r1, r2\n" + " ldrb r0, [r0]\n" + " cmp r0, 0\n" + " beq _080BD834\n" + " adds r2, r1, 0\n" + " ldr r1, _080BD87C @ =0x00002738\n" "_080BD81A:\n" - " adds r0, r4, 0x1\n" - " lsls r0, 24\n" - " lsrs r4, r0, 24\n" - " cmp r4, 0x17\n" - " bhi _080BD834\n" - " lsls r0, r4, 3\n" - " adds r0, r4\n" - " lsls r0, 2\n" - " adds r0, r2\n" - " adds r0, r1\n" - " ldrb r0, [r0]\n" - " cmp r0, 0\n" - " bne _080BD81A\n" + " adds r0, r4, 0x1\n" + " lsls r0, 24\n" + " lsrs r4, r0, 24\n" + " cmp r4, 0x17\n" + " bhi _080BD834\n" + " lsls r0, r4, 3\n" + " adds r0, r4\n" + " lsls r0, 2\n" + " adds r0, r2\n" + " adds r0, r1\n" + " ldrb r0, [r0]\n" + " cmp r0, 0\n" + " bne _080BD81A\n" "_080BD834:\n" - " bl Random\n" - " lsls r0, 16\n" - " lsrs r0, 16\n" - " adds r1, r4, 0\n" - " bl __modsi3\n" - " lsls r0, 24\n" - " lsrs r4, r0, 24\n" - " mov r8, r4\n" - " ldr r7, _080BD874 @ =gSaveBlock1\n" - " ldr r0, _080BD87C @ =0x00002738\n" - " adds r0, r7\n" - " mov r9, r0\n" + " bl Random\n" + " lsls r0, 16\n" + " lsrs r0, 16\n" + " adds r1, r4, 0\n" + " bl __modsi3\n" + " lsls r0, 24\n" + " lsrs r4, r0, 24\n" + " mov r8, r4\n" + " ldr r7, _080BD874 @ =gSaveBlock1\n" + " ldr r0, _080BD87C @ =0x00002738\n" + " adds r0, r7\n" + " mov r9, r0\n" "_080BD850:\n" - " lsls r0, r4, 3\n" - " adds r0, r4\n" - " lsls r6, r0, 2\n" - " adds r5, r6, r7\n" - " ldr r1, _080BD87C @ =0x00002738\n" - " adds r0, r5, r1\n" - " ldrb r0, [r0]\n" - " bl sub_80BFB54\n" - " lsls r0, 24\n" - " lsrs r0, 24\n" - " cmp r0, 0x4\n" - " beq _080BD884\n" - " ldr r2, _080BD880 @ =0x00002739\n" - " adds r0, r5, r2\n" - " ldrb r0, [r0]\n" - " b _080BD890\n" - " .align 2, 0\n" + " lsls r0, r4, 3\n" + " adds r0, r4\n" + " lsls r6, r0, 2\n" + " adds r5, r6, r7\n" + " ldr r1, _080BD87C @ =0x00002738\n" + " adds r0, r5, r1\n" + " ldrb r0, [r0]\n" + " bl sub_80BFB54\n" + " lsls r0, 24\n" + " lsrs r0, 24\n" + " cmp r0, 0x4\n" + " beq _080BD884\n" + " ldr r2, _080BD880 @ =0x00002739\n" + " adds r0, r5, r2\n" + " ldrb r0, [r0]\n" + " b _080BD890\n" + " .align 2, 0\n" "_080BD874: .4byte gSaveBlock1\n" "_080BD878: .4byte 0x000027ec\n" "_080BD87C: .4byte 0x00002738\n" "_080BD880: .4byte 0x00002739\n" "_080BD884:\n" - " mov r0, r9\n" - " adds r1, r6, r0\n" - " ldrh r0, [r1, 0x16]\n" - " cmp r0, 0\n" - " bne _080BD898\n" - " ldrb r0, [r1, 0x1]\n" + " mov r0, r9\n" + " adds r1, r6, r0\n" + " ldrh r0, [r1, 0x16]\n" + " cmp r0, 0\n" + " bne _080BD898\n" + " ldrb r0, [r1, 0x1]\n" "_080BD890:\n" - " cmp r0, 0x1\n" - " bne _080BD898\n" - " adds r0, r4, 0\n" - " b _080BD8AC\n" + " cmp r0, 0x1\n" + " bne _080BD898\n" + " adds r0, r4, 0\n" + " b _080BD8AC\n" "_080BD898:\n" - " cmp r4, 0\n" - " bne _080BD8A0\n" - " movs r4, 0x17\n" - " b _080BD8A6\n" + " cmp r4, 0\n" + " bne _080BD8A0\n" + " movs r4, 0x17\n" + " b _080BD8A6\n" "_080BD8A0:\n" - " subs r0, r4, 0x1\n" - " lsls r0, 24\n" - " lsrs r4, r0, 24\n" + " subs r0, r4, 0x1\n" + " lsls r0, 24\n" + " lsrs r4, r0, 24\n" "_080BD8A6:\n" - " cmp r4, r8\n" - " bne _080BD850\n" - " movs r0, 0xFF\n" + " cmp r4, r8\n" + " bne _080BD850\n" + " movs r0, 0xFF\n" "_080BD8AC:\n" - " pop {r3,r4}\n" - " mov r8, r3\n" - " mov r9, r4\n" - " pop {r4-r7}\n" - " pop {r1}\n" - " bx r1\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"); } #endif @@ -680,88 +680,88 @@ void sub_80BE074(void) { __attribute__((naked)) void sub_80BE074(void) { asm(".syntax unified\n\ - push {r4-r7,lr}\n\ - ldr r0, _080BE118 @ =0x0000ffff\n\ - bl sub_80BF77C\n\ - lsls r0, 24\n\ - cmp r0, 0\n\ - bne _080BE112\n\ - movs r1, 0\n\ - movs r5, 0\n\ - ldr r2, _080BE11C @ =gUnknown_03004316\n\ + push {r4-r7,lr}\n\ + ldr r0, _080BE118 @ =0x0000ffff\n\ + bl sub_80BF77C\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + bne _080BE112\n\ + movs r1, 0\n\ + movs r5, 0\n\ + ldr r2, _080BE11C @ =gUnknown_03004316\n\ _080BE088:\n\ - adds r0, r1, r2\n\ - ldrb r0, [r0]\n\ - adds r0, r5, r0\n\ - lsls r0, 16\n\ - lsrs r5, r0, 16\n\ - adds r0, r1, 0x1\n\ - lsls r0, 24\n\ - lsrs r1, r0, 24\n\ - cmp r1, 0xA\n\ - bls _080BE088\n\ - cmp r5, 0xFF\n\ - bls _080BE0A2\n\ - movs r5, 0xFF\n\ + adds r0, r1, r2\n\ + ldrb r0, [r0]\n\ + adds r0, r5, r0\n\ + lsls r0, 16\n\ + lsrs r5, r0, 16\n\ + adds r0, r1, 0x1\n\ + lsls r0, 24\n\ + lsrs r1, r0, 24\n\ + cmp r1, 0xA\n\ + bls _080BE088\n\ + cmp r5, 0xFF\n\ + bls _080BE0A2\n\ + movs r5, 0xFF\n\ _080BE0A2:\n\ - cmp r5, 0x2\n\ - bls _080BE112\n\ - ldr r7, _080BE120 @ =gUnknown_02024D26\n\ - ldrb r0, [r7]\n\ - cmp r0, 0x1\n\ - bne _080BE112\n\ - ldr r6, _080BE124 @ =gSaveBlock1 + 0x2738\n\ - adds r0, r6, 0\n\ - bl sub_80BF74C\n\ - ldr r4, _080BE128 @ =gUnknown_03005D38\n\ - strb r0, [r4]\n\ - lsls r0, 24\n\ - asrs r0, 24\n\ - movs r1, 0x1\n\ - negs r1, r1\n\ - cmp r0, r1\n\ - beq _080BE112\n\ - movs r0, 0x17\n\ - bl sub_80BF1B4\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - cmp r0, 0x1\n\ - beq _080BE112\n\ - movs r0, 0\n\ - ldrsb r0, [r4, r0]\n\ - lsls r4, r0, 3\n\ - adds r4, r0\n\ - lsls r4, 2\n\ - adds r4, r6\n\ + cmp r5, 0x2\n\ + bls _080BE112\n\ + ldr r7, _080BE120 @ =gUnknown_02024D26\n\ + ldrb r0, [r7]\n\ + cmp r0, 0x1\n\ + bne _080BE112\n\ + ldr r6, _080BE124 @ =gSaveBlock1 + 0x2738\n\ + adds r0, r6, 0\n\ + bl sub_80BF74C\n\ + ldr r4, _080BE128 @ =gUnknown_03005D38\n\ + strb r0, [r4]\n\ + lsls r0, 24\n\ + asrs r0, 24\n\ + movs r1, 0x1\n\ + negs r1, r1\n\ + cmp r0, r1\n\ + beq _080BE112\n\ + movs r0, 0x17\n\ + bl sub_80BF1B4\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + cmp r0, 0x1\n\ + beq _080BE112\n\ + movs r0, 0\n\ + ldrsb r0, [r4, r0]\n\ + lsls r4, r0, 3\n\ + adds r4, r0\n\ + lsls r4, 2\n\ + adds r4, r6\n\ @ -- Here the compiler puts the status flag in the wrong register. --\n\ - movs r1, 0\n\ - movs r0, 0x17\n\ - strb r0, [r4]\n\ - strb r1, [r4, 0x1]\n\ - ldr r1, _080BE12C @ =gUnknown_030042E0\n\ - ldrh r0, [r1, 0x6]\n\ - strh r0, [r4, 0xC]\n\ - ldrh r0, [r1, 0x20]\n\ - strh r0, [r4, 0xE]\n\ - strb r5, [r4, 0x10]\n\ - ldrb r0, [r7]\n\ - strb r0, [r4, 0x11]\n\ - ldr r0, _080BE130 @ =gMapHeader\n\ - ldrb r0, [r0, 0x14]\n\ - strb r0, [r4, 0x12]\n\ - adds r0, r4, 0\n\ - adds r0, 0x13\n\ - ldr r1, _080BE134 @ =gSaveBlock2\n\ - bl StringCopy\n\ - adds r0, r4, 0\n\ - bl sub_80BE138\n\ - movs r0, 2 @ GAME_LANGUAGE\n\ - strb r0, [r4, 0x2]\n\ + movs r1, 0\n\ + movs r0, 0x17\n\ + strb r0, [r4]\n\ + strb r1, [r4, 0x1]\n\ + ldr r1, _080BE12C @ =gUnknown_030042E0\n\ + ldrh r0, [r1, 0x6]\n\ + strh r0, [r4, 0xC]\n\ + ldrh r0, [r1, 0x20]\n\ + strh r0, [r4, 0xE]\n\ + strb r5, [r4, 0x10]\n\ + ldrb r0, [r7]\n\ + strb r0, [r4, 0x11]\n\ + ldr r0, _080BE130 @ =gMapHeader\n\ + ldrb r0, [r0, 0x14]\n\ + strb r0, [r4, 0x12]\n\ + adds r0, r4, 0\n\ + adds r0, 0x13\n\ + ldr r1, _080BE134 @ =gSaveBlock2\n\ + bl StringCopy\n\ + adds r0, r4, 0\n\ + bl sub_80BE138\n\ + movs r0, 2 @ GAME_LANGUAGE\n\ + strb r0, [r4, 0x2]\n\ _080BE112:\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - .align 2, 0\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .align 2, 0\n\ _080BE118: .4byte 0x0000ffff\n\ _080BE11C: .4byte gUnknown_03004316\n\ _080BE120: .4byte gUnknown_02024D26\n\ @@ -2033,119 +2033,119 @@ __attribute__((naked)) void GetMomOrDadStringForTVMessage(void) { asm(".syntax unified\n\ - push {r4,lr}\n\ - ldr r1, _080BFC40 @ =gSaveBlock1\n\ - movs r0, 0x4\n\ - ldrsb r0, [r1, r0]\n\ - cmp r0, 0x1\n\ - bne _080BFC6C\n\ - ldr r0, _080BFC44 @ =gSaveBlock2\n\ - ldrb r0, [r0, 0x8]\n\ - cmp r0, 0\n\ - bne _080BFC54\n\ - movs r0, 0x5\n\ - ldrsb r0, [r1, r0]\n\ - cmp r0, 0\n\ - bne _080BFC6C\n\ - ldr r0, _080BFC48 @ =gStringVar1\n\ - ldr r1, _080BFC4C @ =gOtherText_Mom\n\ - bl StringCopy\n\ - ldr r0, _080BFC50 @ =0x00004003\n\ - movs r1, 0x1\n\ - bl VarSet\n\ - b _080BFC6C\n\ - .align 2, 0\n\ + push {r4,lr}\n\ + ldr r1, _080BFC40 @ =gSaveBlock1\n\ + movs r0, 0x4\n\ + ldrsb r0, [r1, r0]\n\ + cmp r0, 0x1\n\ + bne _080BFC6C\n\ + ldr r0, _080BFC44 @ =gSaveBlock2\n\ + ldrb r0, [r0, 0x8]\n\ + cmp r0, 0\n\ + bne _080BFC54\n\ + movs r0, 0x5\n\ + ldrsb r0, [r1, r0]\n\ + cmp r0, 0\n\ + bne _080BFC6C\n\ + ldr r0, _080BFC48 @ =gStringVar1\n\ + ldr r1, _080BFC4C @ =gOtherText_Mom\n\ + bl StringCopy\n\ + ldr r0, _080BFC50 @ =0x00004003\n\ + movs r1, 0x1\n\ + bl VarSet\n\ + b _080BFC6C\n\ + .align 2, 0\n\ _080BFC40: .4byte gSaveBlock1\n\ _080BFC44: .4byte gSaveBlock2\n\ _080BFC48: .4byte gStringVar1\n\ _080BFC4C: .4byte gOtherText_Mom\n\ _080BFC50: .4byte 0x00004003\n\ _080BFC54:\n\ - movs r0, 0x5\n\ - ldrsb r0, [r1, r0]\n\ - cmp r0, 0x2\n\ - bne _080BFC6C\n\ - ldr r0, _080BFCB4 @ =gStringVar1\n\ - ldr r1, _080BFCB8 @ =gOtherText_Mom\n\ - bl StringCopy\n\ - ldr r0, _080BFCBC @ =0x00004003\n\ - movs r1, 0x1\n\ - bl VarSet\n\ + movs r0, 0x5\n\ + ldrsb r0, [r1, r0]\n\ + cmp r0, 0x2\n\ + bne _080BFC6C\n\ + ldr r0, _080BFCB4 @ =gStringVar1\n\ + ldr r1, _080BFCB8 @ =gOtherText_Mom\n\ + bl StringCopy\n\ + ldr r0, _080BFCBC @ =0x00004003\n\ + movs r1, 0x1\n\ + bl VarSet\n\ _080BFC6C:\n\ - ldr r4, _080BFCBC @ =0x00004003\n\ - adds r0, r4, 0\n\ - bl VarGet\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - cmp r0, 0x1\n\ - beq _080BFCAA\n\ - adds r0, r4, 0\n\ - bl VarGet\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - cmp r0, 0x2\n\ - beq _080BFCC0\n\ - adds r0, r4, 0\n\ - bl VarGet\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - cmp r0, 0x2\n\ - bls _080BFCD4\n\ - adds r0, r4, 0\n\ - bl VarGet\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - movs r1, 0x1\n\ - ands r0, r1\n\ - cmp r0, 0\n\ - bne _080BFCC0\n\ + ldr r4, _080BFCBC @ =0x00004003\n\ + adds r0, r4, 0\n\ + bl VarGet\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + cmp r0, 0x1\n\ + beq _080BFCAA\n\ + adds r0, r4, 0\n\ + bl VarGet\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + cmp r0, 0x2\n\ + beq _080BFCC0\n\ + adds r0, r4, 0\n\ + bl VarGet\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + cmp r0, 0x2\n\ + bls _080BFCD4\n\ + adds r0, r4, 0\n\ + bl VarGet\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + movs r1, 0x1\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _080BFCC0\n\ _080BFCAA:\n\ - ldr r0, _080BFCB4 @ =gStringVar1\n\ - ldr r1, _080BFCB8 @ =gOtherText_Mom\n\ - bl StringCopy\n\ - b _080BFD10\n\ - .align 2, 0\n\ + ldr r0, _080BFCB4 @ =gStringVar1\n\ + ldr r1, _080BFCB8 @ =gOtherText_Mom\n\ + bl StringCopy\n\ + b _080BFD10\n\ + .align 2, 0\n\ _080BFCB4: .4byte gStringVar1\n\ _080BFCB8: .4byte gOtherText_Mom\n\ _080BFCBC: .4byte 0x00004003\n\ _080BFCC0:\n\ - ldr r0, _080BFCCC @ =gStringVar1\n\ - ldr r1, _080BFCD0 @ =gOtherText_Dad\n\ - bl StringCopy\n\ - b _080BFD10\n\ - .align 2, 0\n\ + ldr r0, _080BFCCC @ =gStringVar1\n\ + ldr r1, _080BFCD0 @ =gOtherText_Dad\n\ + bl StringCopy\n\ + b _080BFD10\n\ + .align 2, 0\n\ _080BFCCC: .4byte gStringVar1\n\ _080BFCD0: .4byte gOtherText_Dad\n\ _080BFCD4:\n\ - bl Random\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - movs r1, 0x1\n\ - ands r0, r1\n\ - cmp r0, 0\n\ - beq _080BFD00\n\ - ldr r0, _080BFCF8 @ =gStringVar1\n\ - ldr r1, _080BFCFC @ =gOtherText_Mom\n\ - bl StringCopy\n\ - adds r0, r4, 0\n\ - movs r1, 0x1\n\ - bl VarSet\n\ - b _080BFD10\n\ - .align 2, 0\n\ + bl Random\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + movs r1, 0x1\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080BFD00\n\ + ldr r0, _080BFCF8 @ =gStringVar1\n\ + ldr r1, _080BFCFC @ =gOtherText_Mom\n\ + bl StringCopy\n\ + adds r0, r4, 0\n\ + movs r1, 0x1\n\ + bl VarSet\n\ + b _080BFD10\n\ + .align 2, 0\n\ _080BFCF8: .4byte gStringVar1\n\ _080BFCFC: .4byte gOtherText_Mom\n\ _080BFD00:\n\ - ldr r0, _080BFD18 @ =gStringVar1\n\ - ldr r1, _080BFD1C @ =gOtherText_Dad\n\ - bl StringCopy\n\ - adds r0, r4, 0\n\ - movs r1, 0x2\n\ - bl VarSet\n\ + ldr r0, _080BFD18 @ =gStringVar1\n\ + ldr r1, _080BFD1C @ =gOtherText_Dad\n\ + bl StringCopy\n\ + adds r0, r4, 0\n\ + movs r1, 0x2\n\ + bl VarSet\n\ _080BFD10:\n\ - pop {r4}\n\ - pop {r0}\n\ - bx r0\n\ - .align 2, 0\n\ + pop {r4}\n\ + pop {r0}\n\ + bx r0\n\ + .align 2, 0\n\ _080BFD18: .4byte gStringVar1\n\ _080BFD1C: .4byte gOtherText_Dad\n\ .syntax divided\n"); @@ -2276,119 +2276,119 @@ bool8 sub_80BFF68(TVShow * arg1[25], TVShow * arg2[25], u8 idx) { __attribute__((naked)) bool8 sub_80BFF68(TVShow * arg1[25], TVShow * arg2[25], u8 idx) { asm(".syntax unified\n\ - push {r4-r7,lr}\n\ - sub sp, 0x4\n\ - lsls r2, 24\n\ - lsrs r7, r2, 24\n\ - ldr r4, [r0]\n\ - ldr r6, [r1]\n\ - movs r5, 0\n\ - ldr r2, _080BFFA4 @ =gUnknown_03000722\n\ - movs r1, 0\n\ - ldrsb r1, [r2, r1]\n\ - lsls r0, r1, 3\n\ - adds r0, r1\n\ - lsls r0, 2\n\ - adds r0, r6 @ this is the only mimsmatch\n\ - ldrb r0, [r0]\n\ - str r2, [sp]\n\ - bl sub_80BFB54\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - adds r1, r0, 0\n\ - ldr r2, [sp]\n\ - cmp r0, 0x3\n\ - beq _080BFFD8\n\ - cmp r0, 0x3\n\ - bgt _080BFFA8\n\ - cmp r0, 0x2\n\ - beq _080BFFAE\n\ - b _080C0026\n\ - .align 2, 0\n\ + push {r4-r7,lr}\n\ + sub sp, 0x4\n\ + lsls r2, 24\n\ + lsrs r7, r2, 24\n\ + ldr r4, [r0]\n\ + ldr r6, [r1]\n\ + movs r5, 0\n\ + ldr r2, _080BFFA4 @ =gUnknown_03000722\n\ + movs r1, 0\n\ + ldrsb r1, [r2, r1]\n\ + lsls r0, r1, 3\n\ + adds r0, r1\n\ + lsls r0, 2\n\ + adds r0, r6 @ this is the only mimsmatch\n\ + ldrb r0, [r0]\n\ + str r2, [sp]\n\ + bl sub_80BFB54\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + adds r1, r0, 0\n\ + ldr r2, [sp]\n\ + cmp r0, 0x3\n\ + beq _080BFFD8\n\ + cmp r0, 0x3\n\ + bgt _080BFFA8\n\ + cmp r0, 0x2\n\ + beq _080BFFAE\n\ + b _080C0026\n\ + .align 2, 0\n\ _080BFFA4: .4byte gUnknown_03000722\n\ _080BFFA8:\n\ - cmp r1, 0x4\n\ - beq _080C0000\n\ - b _080C0026\n\ + cmp r1, 0x4\n\ + beq _080C0000\n\ + b _080C0026\n\ _080BFFAE:\n\ - ldr r0, _080BFFD4 @ =gUnknown_03005D38\n\ - movs r1, 0\n\ - ldrsb r1, [r0, r1]\n\ - lsls r0, r1, 3\n\ - adds r0, r1\n\ - lsls r0, 2\n\ - adds r0, r4, r0\n\ - ldrb r2, [r2]\n\ - lsls r2, 24\n\ - asrs r2, 24\n\ - lsls r1, r2, 3\n\ - adds r1, r2\n\ - lsls r1, 2\n\ - adds r1, r6, r1\n\ - adds r2, r7, 0\n\ - bl sub_80C004C\n\ - b _080C0022\n\ - .align 2, 0\n\ + ldr r0, _080BFFD4 @ =gUnknown_03005D38\n\ + movs r1, 0\n\ + ldrsb r1, [r0, r1]\n\ + lsls r0, r1, 3\n\ + adds r0, r1\n\ + lsls r0, 2\n\ + adds r0, r4, r0\n\ + ldrb r2, [r2]\n\ + lsls r2, 24\n\ + asrs r2, 24\n\ + lsls r1, r2, 3\n\ + adds r1, r2\n\ + lsls r1, 2\n\ + adds r1, r6, r1\n\ + adds r2, r7, 0\n\ + bl sub_80C004C\n\ + b _080C0022\n\ + .align 2, 0\n\ _080BFFD4: .4byte gUnknown_03005D38\n\ _080BFFD8:\n\ - ldr r0, _080BFFFC @ =gUnknown_03005D38\n\ - movs r1, 0\n\ - ldrsb r1, [r0, r1]\n\ - lsls r0, r1, 3\n\ - adds r0, r1\n\ - lsls r0, 2\n\ - adds r0, r4, r0\n\ - ldrb r2, [r2]\n\ - lsls r2, 24\n\ - asrs r2, 24\n\ - lsls r1, r2, 3\n\ - adds r1, r2\n\ - lsls r1, 2\n\ - adds r1, r6, r1\n\ - adds r2, r7, 0\n\ - bl sub_80C00B4\n\ - b _080C0022\n\ - .align 2, 0\n\ + ldr r0, _080BFFFC @ =gUnknown_03005D38\n\ + movs r1, 0\n\ + ldrsb r1, [r0, r1]\n\ + lsls r0, r1, 3\n\ + adds r0, r1\n\ + lsls r0, 2\n\ + adds r0, r4, r0\n\ + ldrb r2, [r2]\n\ + lsls r2, 24\n\ + asrs r2, 24\n\ + lsls r1, r2, 3\n\ + adds r1, r2\n\ + lsls r1, 2\n\ + adds r1, r6, r1\n\ + adds r2, r7, 0\n\ + bl sub_80C00B4\n\ + b _080C0022\n\ + .align 2, 0\n\ _080BFFFC: .4byte gUnknown_03005D38\n\ _080C0000:\n\ - ldr r0, _080C0030 @ =gUnknown_03005D38\n\ - movs r1, 0\n\ - ldrsb r1, [r0, r1]\n\ - lsls r0, r1, 3\n\ - adds r0, r1\n\ - lsls r0, 2\n\ - adds r0, r4, r0\n\ - ldrb r2, [r2]\n\ - lsls r2, 24\n\ - asrs r2, 24\n\ - lsls r1, r2, 3\n\ - adds r1, r2\n\ - lsls r1, 2\n\ - adds r1, r6, r1\n\ - adds r2, r7, 0\n\ - bl sub_80C0134\n\ + ldr r0, _080C0030 @ =gUnknown_03005D38\n\ + movs r1, 0\n\ + ldrsb r1, [r0, r1]\n\ + lsls r0, r1, 3\n\ + adds r0, r1\n\ + lsls r0, 2\n\ + adds r0, r4, r0\n\ + ldrb r2, [r2]\n\ + lsls r2, 24\n\ + asrs r2, 24\n\ + lsls r1, r2, 3\n\ + adds r1, r2\n\ + lsls r1, 2\n\ + adds r1, r6, r1\n\ + adds r2, r7, 0\n\ + bl sub_80C0134\n\ _080C0022:\n\ - lsls r0, 24\n\ - lsrs r5, r0, 24\n\ + lsls r0, 24\n\ + lsrs r5, r0, 24\n\ _080C0026:\n\ - cmp r5, 0x1\n\ - beq _080C0034\n\ - movs r0, 0\n\ - b _080C0040\n\ - .align 2, 0\n\ + cmp r5, 0x1\n\ + beq _080C0034\n\ + movs r0, 0\n\ + b _080C0040\n\ + .align 2, 0\n\ _080C0030: .4byte gUnknown_03005D38\n\ _080C0034:\n\ - ldr r0, _080C0048 @ =gUnknown_03000722\n\ - ldrb r1, [r0]\n\ - adds r0, r6, 0\n\ - bl sub_80BF55C\n\ - movs r0, 0x1\n\ + ldr r0, _080C0048 @ =gUnknown_03000722\n\ + ldrb r1, [r0]\n\ + adds r0, r6, 0\n\ + bl sub_80BF55C\n\ + movs r0, 0x1\n\ _080C0040:\n\ - add sp, 0x4\n\ - pop {r4-r7}\n\ - pop {r1}\n\ - bx r1\n\ - .align 2, 0\n\ + add sp, 0x4\n\ + pop {r4-r7}\n\ + pop {r1}\n\ + bx r1\n\ + .align 2, 0\n\ _080C0048: .4byte gUnknown_03000722\n\ .syntax divided\n"); } @@ -2509,206 +2509,206 @@ void sub_80C01D4(void) __attribute__((naked)) void sub_80C01D4(void) { asm(".syntax unified\n\ - push {r4-r6,lr}\n\ - movs r6, 0\n\ + push {r4-r6,lr}\n\ + movs r6, 0\n\ _080C01D8:\n\ - ldr r0, _080C01F8 @ =gSaveBlock1\n\ - lsls r2, r6, 3\n\ - adds r1, r2, r6\n\ - lsls r1, 2\n\ - adds r1, r0\n\ - ldr r0, _080C01FC @ =0x00002738\n\ - adds r1, r0\n\ - ldrb r0, [r1]\n\ - cmp r0, 0x29\n\ - bls _080C01EE\n\ - b _default\n\ + ldr r0, _080C01F8 @ =gSaveBlock1\n\ + lsls r2, r6, 3\n\ + adds r1, r2, r6\n\ + lsls r1, 2\n\ + adds r1, r0\n\ + ldr r0, _080C01FC @ =0x00002738\n\ + adds r1, r0\n\ + ldrb r0, [r1]\n\ + cmp r0, 0x29\n\ + bls _080C01EE\n\ + b _default\n\ _080C01EE:\n\ - lsls r0, 2\n\ - ldr r1, _080C0200 @ =_080C0204\n\ - adds r0, r1\n\ - ldr r0, [r0]\n\ - mov pc, r0\n\ - .align 2, 0\n\ + lsls r0, 2\n\ + ldr r1, _080C0200 @ =_080C0204\n\ + adds r0, r1\n\ + ldr r0, [r0]\n\ + mov pc, r0\n\ + .align 2, 0\n\ _080C01F8: .4byte gSaveBlock1\n\ _080C01FC: .4byte 0x00002738\n\ _080C0200: .4byte _080C0204\n\ - .align 2, 0\n\ + .align 2, 0\n\ _080C0204:\n\ - .4byte _break\n\ - .4byte _fanclubLetter @ TVSHOW_FAN_CLUB_LETTER\n\ - .4byte _break @ TVSHOW_RECENT_HAPPENINGS\n\ - .4byte _fanclubOpinions @ TVSHOW_PKMN_FAN_CLUB_OPINIONS\n\ - .4byte _showtype4 @ TVSHOW_UNKN_SHOWTYPE_04\n\ - .4byte _nameRater @ TVSHOW_NAME_RATER_SHOW\n\ - .4byte _bravoTrainerContest @ TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE\n\ - .4byte _bravoTrainerTower @ TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _pokemonTodayS @ TVSHOW_POKEMON_TODAY_CAUGHT\n\ - .4byte _break @ TVSHOW_SMART_SHOPPER\n\ - .4byte _pokemonTodayF @ TVSHOW_POKEMON_TODAY_FAILED\n\ - .4byte _fishing @ TVSHOW_FISHING_ADVICE\n\ - .4byte _worldOfMasters @ TVSHOW_WORLD_OF_MASTERS\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _break @ TVSHOW_MASS_OUTBREAK\n\ + .4byte _break\n\ + .4byte _fanclubLetter @ TVSHOW_FAN_CLUB_LETTER\n\ + .4byte _break @ TVSHOW_RECENT_HAPPENINGS\n\ + .4byte _fanclubOpinions @ TVSHOW_PKMN_FAN_CLUB_OPINIONS\n\ + .4byte _showtype4 @ TVSHOW_UNKN_SHOWTYPE_04\n\ + .4byte _nameRater @ TVSHOW_NAME_RATER_SHOW\n\ + .4byte _bravoTrainerContest @ TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE\n\ + .4byte _bravoTrainerTower @ TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _pokemonTodayS @ TVSHOW_POKEMON_TODAY_CAUGHT\n\ + .4byte _break @ TVSHOW_SMART_SHOPPER\n\ + .4byte _pokemonTodayF @ TVSHOW_POKEMON_TODAY_FAILED\n\ + .4byte _fishing @ TVSHOW_FISHING_ADVICE\n\ + .4byte _worldOfMasters @ TVSHOW_WORLD_OF_MASTERS\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _break @ TVSHOW_MASS_OUTBREAK\n\ _fanclubLetter:\n\ - adds r0, r2, r6\n\ - lsls r0, 2\n\ - ldr r1, _080C02B8 @ =gSaveBlock1 + 0x2738\n\ - adds r0, r1\n\ - ldrh r0, [r0, 0x2]\n\ - b _checkSpecies1 @ sub_80C03C8(r0, i)\n\ - .align 2, 0\n\ + adds r0, r2, r6\n\ + lsls r0, 2\n\ + ldr r1, _080C02B8 @ =gSaveBlock1 + 0x2738\n\ + adds r0, r1\n\ + ldrh r0, [r0, 0x2]\n\ + b _checkSpecies1 @ sub_80C03C8(r0, i)\n\ + .align 2, 0\n\ _080C02B8: .4byte gSaveBlock1 + 0x2738\n\ _fanclubOpinions:\n\ - adds r0, r2, r6\n\ - lsls r0, 2\n\ - ldr r1, _080C02C8 @ =gSaveBlock1 + 0x2738\n\ - adds r0, r1\n\ - ldrh r0, [r0, 0x2]\n\ - b _checkSpecies1 @ sub_80C03C8(r0, i)\n\ - .align 2, 0\n\ + adds r0, r2, r6\n\ + lsls r0, 2\n\ + ldr r1, _080C02C8 @ =gSaveBlock1 + 0x2738\n\ + adds r0, r1\n\ + ldrh r0, [r0, 0x2]\n\ + b _checkSpecies1 @ sub_80C03C8(r0, i)\n\ + .align 2, 0\n\ _080C02C8: .4byte gSaveBlock1 + 0x2738\n\ _showtype4:\n\ - adds r0, r2, r6\n\ - lsls r0, 2\n\ - ldr r1, _080C02D8 @ =gSaveBlock1 + 0x2738\n\ - adds r0, r1\n\ - ldrh r0, [r0, 0x6]\n\ - b _checkSpecies1 @ sub_80C03C8(r0, i)\n\ - .align 2, 0\n\ + adds r0, r2, r6\n\ + lsls r0, 2\n\ + ldr r1, _080C02D8 @ =gSaveBlock1 + 0x2738\n\ + adds r0, r1\n\ + ldrh r0, [r0, 0x6]\n\ + b _checkSpecies1 @ sub_80C03C8(r0, i)\n\ + .align 2, 0\n\ _080C02D8: .4byte gSaveBlock1 + 0x2738\n\ _nameRater:\n\ - adds r4, r2, r6\n\ - lsls r4, 2\n\ - ldr r0, _080C02F4 @ =gSaveBlock1 + 0x2738\n\ - adds r4, r0\n\ - ldrh r0, [r4, 0x2]\n\ - lsls r5, r6, 24\n\ - lsrs r5, 24\n\ - adds r1, r5, 0\n\ - bl sub_80C03C8\n\ - ldrh r0, [r4, 0x1C]\n\ - b _checkSpecies2 @ sub_80C03C8(r0, i)\n\ - .align 2, 0\n\ + adds r4, r2, r6\n\ + lsls r4, 2\n\ + ldr r0, _080C02F4 @ =gSaveBlock1 + 0x2738\n\ + adds r4, r0\n\ + ldrh r0, [r4, 0x2]\n\ + lsls r5, r6, 24\n\ + lsrs r5, 24\n\ + adds r1, r5, 0\n\ + bl sub_80C03C8\n\ + ldrh r0, [r4, 0x1C]\n\ + b _checkSpecies2 @ sub_80C03C8(r0, i)\n\ + .align 2, 0\n\ _080C02F4: .4byte gSaveBlock1 + 0x2738\n\ _bravoTrainerContest:\n\ - adds r0, r2, r6\n\ - lsls r0, 2\n\ - ldr r1, _080C0304 @ =gSaveBlock1 + 0x2738\n\ - adds r0, r1\n\ - ldrh r0, [r0, 0x2]\n\ - b _checkSpecies1 @ sub_80C03C8(r0, i)\n\ - .align 2, 0\n\ + adds r0, r2, r6\n\ + lsls r0, 2\n\ + ldr r1, _080C0304 @ =gSaveBlock1 + 0x2738\n\ + adds r0, r1\n\ + ldrh r0, [r0, 0x2]\n\ + b _checkSpecies1 @ sub_80C03C8(r0, i)\n\ + .align 2, 0\n\ _080C0304: .4byte gSaveBlock1 + 0x2738\n\ _bravoTrainerTower:\n\ - adds r4, r2, r6\n\ - lsls r4, 2\n\ - ldr r0, _080C0320 @ =gSaveBlock1 + 0x2738\n\ - adds r4, r0\n\ - ldrh r0, [r4, 0xA]\n\ - lsls r5, r6, 24\n\ - lsrs r5, 24\n\ - adds r1, r5, 0\n\ - bl sub_80C03C8\n\ - ldrh r0, [r4, 0x14]\n\ - b _checkSpecies2 @ sub_80C03C8(r0, i)\n\ - .align 2, 0\n\ + adds r4, r2, r6\n\ + lsls r4, 2\n\ + ldr r0, _080C0320 @ =gSaveBlock1 + 0x2738\n\ + adds r4, r0\n\ + ldrh r0, [r4, 0xA]\n\ + lsls r5, r6, 24\n\ + lsrs r5, 24\n\ + adds r1, r5, 0\n\ + bl sub_80C03C8\n\ + ldrh r0, [r4, 0x14]\n\ + b _checkSpecies2 @ sub_80C03C8(r0, i)\n\ + .align 2, 0\n\ _080C0320: .4byte gSaveBlock1 + 0x2738\n\ _pokemonTodayS:\n\ - adds r0, r2, r6\n\ - lsls r0, 2\n\ - ldr r1, _080C0330 @ =gSaveBlock1 + 0x2738\n\ - adds r0, r1\n\ - ldrh r0, [r0, 0x10]\n\ - b _checkSpecies1 @ sub_80C03C8(r0, i)\n\ - .align 2, 0\n\ + adds r0, r2, r6\n\ + lsls r0, 2\n\ + ldr r1, _080C0330 @ =gSaveBlock1 + 0x2738\n\ + adds r0, r1\n\ + ldrh r0, [r0, 0x10]\n\ + b _checkSpecies1 @ sub_80C03C8(r0, i)\n\ + .align 2, 0\n\ _080C0330: .4byte gSaveBlock1 + 0x2738\n\ _pokemonTodayF:\n\ - adds r4, r2, r6\n\ - lsls r4, 2\n\ - ldr r0, _080C034C @ =gSaveBlock1 + 0x2738\n\ - adds r4, r0\n\ - ldrh r0, [r4, 0xC]\n\ - lsls r5, r6, 24\n\ - lsrs r5, 24\n\ - adds r1, r5, 0\n\ - bl sub_80C03C8\n\ - ldrh r0, [r4, 0xE]\n\ - b _checkSpecies2 @ sub_80C03C8(r0, i)\n\ - .align 2, 0\n\ + adds r4, r2, r6\n\ + lsls r4, 2\n\ + ldr r0, _080C034C @ =gSaveBlock1 + 0x2738\n\ + adds r4, r0\n\ + ldrh r0, [r4, 0xC]\n\ + lsls r5, r6, 24\n\ + lsrs r5, 24\n\ + adds r1, r5, 0\n\ + bl sub_80C03C8\n\ + ldrh r0, [r4, 0xE]\n\ + b _checkSpecies2 @ sub_80C03C8(r0, i)\n\ + .align 2, 0\n\ _080C034C: .4byte gSaveBlock1 + 0x2738\n\ _fishing:\n\ - adds r0, r2, r6\n\ - lsls r0, 2\n\ - ldr r1, _080C0364 @ =gSaveBlock1 + 0x2738\n\ - adds r0, r1\n\ - ldrh r0, [r0, 0x4]\n\ + adds r0, r2, r6\n\ + lsls r0, 2\n\ + ldr r1, _080C0364 @ =gSaveBlock1 + 0x2738\n\ + adds r0, r1\n\ + ldrh r0, [r0, 0x4]\n\ _checkSpecies1:\n\ - lsls r1, r6, 24\n\ - lsrs r1, 24\n\ - bl sub_80C03C8\n\ - b _break\n\ - .align 2, 0\n\ + lsls r1, r6, 24\n\ + lsrs r1, 24\n\ + bl sub_80C03C8\n\ + b _break\n\ + .align 2, 0\n\ _080C0364: .4byte gSaveBlock1 + 0x2738\n\ _worldOfMasters:\n\ - adds r4, r2, r6\n\ - lsls r4, 2\n\ - ldr r0, _080C0388 @ =gSaveBlock1 + 0x2738\n\ - adds r4, r0\n\ - ldrh r0, [r4, 0x8]\n\ - lsls r5, r6, 24\n\ - lsrs r5, 24\n\ - adds r1, r5, 0\n\ - bl sub_80C03C8\n\ - ldrh r0, [r4, 0x4]\n\ + adds r4, r2, r6\n\ + lsls r4, 2\n\ + ldr r0, _080C0388 @ =gSaveBlock1 + 0x2738\n\ + adds r4, r0\n\ + ldrh r0, [r4, 0x8]\n\ + lsls r5, r6, 24\n\ + lsrs r5, 24\n\ + adds r1, r5, 0\n\ + bl sub_80C03C8\n\ + ldrh r0, [r4, 0x4]\n\ _checkSpecies2:\n\ - adds r1, r5, 0\n\ - bl sub_80C03C8\n\ - b _break\n\ - .align 2, 0\n\ + adds r1, r5, 0\n\ + bl sub_80C03C8\n\ + b _break\n\ + .align 2, 0\n\ _080C0388: .4byte gSaveBlock1 + 0x2738\n\ _default:\n\ - lsls r0, r6, 24\n\ - lsrs r0, 24\n\ - bl sub_80C03A8\n\ + lsls r0, r6, 24\n\ + lsrs r0, 24\n\ + bl sub_80C03A8\n\ _break:\n\ - adds r0, r6, 0x1\n\ - lsls r0, 16\n\ - lsrs r6, r0, 16\n\ - cmp r6, 0x17\n\ - bhi _080C03A0\n\ - b _080C01D8\n\ + adds r0, r6, 0x1\n\ + lsls r0, 16\n\ + lsrs r6, r0, 16\n\ + cmp r6, 0x17\n\ + bhi _080C03A0\n\ + b _080C01D8\n\ _080C03A0:\n\ - pop {r4-r6}\n\ - pop {r0}\n\ - bx r0\n\ + pop {r4-r6}\n\ + pop {r0}\n\ + bx r0\n\ .syntax divided\n"); } #endif @@ -2738,43 +2738,43 @@ void sub_80C0408(void) { __attribute__((naked)) void sub_80C0408(void) { asm(".syntax unified\n\ - push {r4-r6,lr}\n\ - ldr r0, _080C044C @ =0x00000804\n\ - bl FlagGet\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - cmp r0, 0x1\n\ - beq _080C0444\n\ - movs r2, 0\n\ - ldr r6, _080C0450 @ =gSaveBlock1\n\ - ldr r4, _080C0454 @ =0x00002739\n\ - movs r3, 0\n\ - ldr r5, _080C0458 @ =0x00002738\n\ + push {r4-r6,lr}\n\ + ldr r0, _080C044C @ =0x00000804\n\ + bl FlagGet\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + cmp r0, 0x1\n\ + beq _080C0444\n\ + movs r2, 0\n\ + ldr r6, _080C0450 @ =gSaveBlock1\n\ + ldr r4, _080C0454 @ =0x00002739\n\ + movs r3, 0\n\ + ldr r5, _080C0458 @ =0x00002738\n\ _080C0422:\n\ - lsls r0, r2, 3\n\ - adds r0, r2\n\ - lsls r0, 2\n\ - adds r1, r0, r6\n\ - adds r0, r1, r5\n\ - ldrb r0, [r0]\n\ - cmp r0, 0x7\n\ - beq _080C0436\n\ - cmp r0, 0x29\n\ - bne _080C043A\n\ + lsls r0, r2, 3\n\ + adds r0, r2\n\ + lsls r0, 2\n\ + adds r1, r0, r6\n\ + adds r0, r1, r5\n\ + ldrb r0, [r0]\n\ + cmp r0, 0x7\n\ + beq _080C0436\n\ + cmp r0, 0x29\n\ + bne _080C043A\n\ _080C0436:\n\ - adds r0, r1, r4\n\ - strb r3, [r0]\n\ + adds r0, r1, r4\n\ + strb r3, [r0]\n\ _080C043A:\n\ - adds r0, r2, 0x1\n\ - lsls r0, 16\n\ - lsrs r2, r0, 16\n\ - cmp r2, 0x17\n\ - bls _080C0422\n\ + adds r0, r2, 0x1\n\ + lsls r0, 16\n\ + lsrs r2, r0, 16\n\ + cmp r2, 0x17\n\ + bls _080C0422\n\ _080C0444:\n\ - pop {r4-r6}\n\ - pop {r0}\n\ - bx r0\n\ - .align 2, 0\n\ + pop {r4-r6}\n\ + pop {r0}\n\ + bx r0\n\ + .align 2, 0\n\ _080C044C: .4byte 0x00000804\n\ _080C0450: .4byte gSaveBlock1\n\ _080C0454: .4byte 0x00002739\n\ diff --git a/src/util.c b/src/util.c index 2278c50fe..55608854c 100644 --- a/src/util.c +++ b/src/util.c @@ -6,41 +6,41 @@ extern const u8 gSpriteDimensions[3][4][2]; extern const u16 gCrc16Table[]; u8 CreateInvisibleSpriteWithCallback(void (*callback)(struct Sprite *)) { - u8 sprite = CreateSprite(&gInvisibleSpriteTemplate, 248, 168, 14); - gSprites[sprite].invisible = TRUE; - gSprites[sprite].callback = callback; - return sprite; + u8 sprite = CreateSprite(&gInvisibleSpriteTemplate, 248, 168, 14); + gSprites[sprite].invisible = TRUE; + gSprites[sprite].callback = callback; + return sprite; } void StoreWordInTwoHalfwords(u16 *h, u32 w) { - h[0] = (u16)(w); - h[1] = (u16)(w >> 16); + h[0] = (u16)(w); + h[1] = (u16)(w >> 16); } void LoadWordFromTwoHalfwords(u16 *h, u32 *w) { - *w = h[0] | (s16)h[1] << 16; + *w = h[0] | (s16)h[1] << 16; } void SetBgAffineStruct(struct BgAffineSrcData *src, u32 texX, u32 texY, s16 scrX, s16 scrY, s16 sx, s16 sy, u16 alpha) { - src->texX = texX; - src->texY = texY; - src->scrX = scrX; - src->scrY = scrY; - src->sx = sx; - src->sy = sy; - src->alpha = alpha; + src->texX = texX; + src->texY = texY; + src->scrX = scrX; + src->scrY = scrY; + src->sx = sx; + src->sy = sy; + src->alpha = alpha; } void DoBgAffineSet(struct BgAffineDstData *dest, u32 texX, u32 texY, s16 scrX, s16 scrY, s16 sx, s16 sy, u16 alpha) { - struct BgAffineSrcData src; - SetBgAffineStruct( - &src, - texX, texY, - scrX, scrY, - sx, sy, - alpha - ); - BgAffineSet(&src, dest, 1); + struct BgAffineSrcData src; + SetBgAffineStruct( + &src, + texX, texY, + scrX, scrY, + sx, sy, + alpha + ); + BgAffineSet(&src, dest, 1); } #ifdef NONMATCHING @@ -48,342 +48,342 @@ void DoBgAffineSet(struct BgAffineDstData *dest, u32 texX, u32 texY, s16 scrX, s // Functionally equivalent. // Only the two yflip loops don't match. void CopySpriteTiles(u8 shape, u8 size, u8 *tiles, u16 *tilemap, u8 *output) { - u8 x, y; - s8 i, j; - u8 xflip[32]; - u8 h = gSpriteDimensions[shape][size][1]; - u8 w = gSpriteDimensions[shape][size][0]; - for (y = 0; y < h; y++) { - int filler = 32 - w; - for (x = 0; x < w; x++) { - int tile = (*tilemap & 0x3ff) * 32; - int attr = *tilemap & 0xc00; - if (attr == 0) { - void *src = tiles + tile; - void *dest = output; - int length = 32; - DmaCopy32(3, src, dest, length); - } else if (attr == 0x800) { // yflip - for (i = 0; i < 8; i++) { - void *src = tiles; - void *dest = output; - int length = 4; - // this is likely wrong, but makes it closer to matching - src += tile + (7 - i) * 4; - dest += i * 4; - DmaCopy32(3, src, dest, length); - } - } else { // xflip - for (i = 0; i < 8; i++) { - for (j = 0; j < 4; j++) { - u8 i2 = i * 4; - xflip[i2 + (3-j)] = (tiles[tile + i2 + j] & 0xf) << 4; - xflip[i2 + (3-j)] |= tiles[tile + i2 + j] >> 4; - } - } - if (*tilemap & 0x800) { // yflip - for (i = 0; i < 8; i++) { - void *src = xflip + (7-i) * 4; - void *dest = output + i*4; - int length = 4; - DmaCopy32(3, src, dest, length); - } - } else { - void *src = xflip; - void *dest = output; - int length = 32; - DmaCopy32(3, src, dest, length); - } - } - tilemap++; - output += 32; - } - tilemap += filler; - } + u8 x, y; + s8 i, j; + u8 xflip[32]; + u8 h = gSpriteDimensions[shape][size][1]; + u8 w = gSpriteDimensions[shape][size][0]; + for (y = 0; y < h; y++) { + int filler = 32 - w; + for (x = 0; x < w; x++) { + int tile = (*tilemap & 0x3ff) * 32; + int attr = *tilemap & 0xc00; + if (attr == 0) { + void *src = tiles + tile; + void *dest = output; + int length = 32; + DmaCopy32(3, src, dest, length); + } else if (attr == 0x800) { // yflip + for (i = 0; i < 8; i++) { + void *src = tiles; + void *dest = output; + int length = 4; + // this is likely wrong, but makes it closer to matching + src += tile + (7 - i) * 4; + dest += i * 4; + DmaCopy32(3, src, dest, length); + } + } else { // xflip + for (i = 0; i < 8; i++) { + for (j = 0; j < 4; j++) { + u8 i2 = i * 4; + xflip[i2 + (3-j)] = (tiles[tile + i2 + j] & 0xf) << 4; + xflip[i2 + (3-j)] |= tiles[tile + i2 + j] >> 4; + } + } + if (*tilemap & 0x800) { // yflip + for (i = 0; i < 8; i++) { + void *src = xflip + (7-i) * 4; + void *dest = output + i*4; + int length = 4; + DmaCopy32(3, src, dest, length); + } + } else { + void *src = xflip; + void *dest = output; + int length = 32; + DmaCopy32(3, src, dest, length); + } + } + tilemap++; + output += 32; + } + tilemap += filler; + } } #else __attribute__((naked)) void CopySpriteTiles(u8 shape, u8 size, u8 *tiles, u16 *tilemap, u8 *output) { - asm("\n" - " .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, 0x3C\n" - " str r2, [sp, 0x20]\n" - " adds r4, r3, 0\n" - " ldr r7, [sp, 0x5C]\n" - " lsls r0, 24\n" - " lsls r1, 24\n" - " ldr r2, _08041008 @ =gSpriteDimensions\n" - " lsrs r1, 23\n" - " lsrs r0, 21\n" - " adds r1, r0\n" - " adds r0, r2, 0x1\n" - " adds r0, r1, r0\n" - " ldrb r0, [r0]\n" - " str r0, [sp, 0x24]\n" - " adds r1, r2\n" - " ldrb r1, [r1]\n" - " str r1, [sp, 0x28]\n" - " movs r1, 0\n" - " cmp r1, r0\n" - " bcc _08040FB4\n" - " b _08041136\n" - "_08040FB4:\n" - " movs r0, 0x20\n" - " ldr r2, [sp, 0x28]\n" - " subs r0, r2\n" - " lsls r0, 1\n" - " str r0, [sp, 0x2C]\n" - "_08040FBE:\n" - " movs r2, 0\n" - " adds r1, 0x1\n" - " str r1, [sp, 0x34]\n" - " ldr r3, [sp, 0x28]\n" - " cmp r2, r3\n" - " bcc _08040FCC\n" - " b _08041124\n" - "_08040FCC:\n" - " ldr r0, _0804100C @ =0x040000d4\n" - " mov r8, r0\n" - "_08040FD0:\n" - " ldrh r1, [r4]\n" - " ldr r0, _08041010 @ =0x000003ff\n" - " ands r0, r1\n" - " lsls r0, 5\n" - " mov r12, r0\n" - " movs r0, 0xC0\n" - " lsls r0, 4\n" - " ands r0, r1\n" - " mov r3, sp\n" - " strh r1, [r3, 0x38]\n" - " cmp r0, 0\n" - " bne _08041018\n" - " ldr r0, [sp, 0x20]\n" - " add r0, r12\n" - " mov r1, r8\n" - " str r0, [r1]\n" - " str r7, [r1, 0x4]\n" - " ldr r3, _08041014 @ =0x84000008\n" - " str r3, [r1, 0x8]\n" - " ldr r0, [r1, 0x8]\n" - " adds r4, 0x2\n" - " str r4, [sp, 0x30]\n" - " adds r7, 0x20\n" - " mov r10, r7\n" - " adds r2, 0x1\n" - " mov r9, r2\n" - " b _08041112\n" - " .align 2, 0\n" - "_08041008: .4byte gSpriteDimensions\n" - "_0804100C: .4byte 0x040000d4\n" - "_08041010: .4byte 0x000003ff\n" - "_08041014: .4byte 0x84000008\n" - "_08041018:\n" - " movs r1, 0x80\n" - " lsls r1, 4\n" - " cmp r0, r1\n" - " bne _08041068\n" - " movs r3, 0\n" - " adds r4, 0x2\n" - " str r4, [sp, 0x30]\n" - " movs r0, 0x20\n" - " adds r0, r7\n" - " mov r10, r0\n" - " adds r2, 0x1\n" - " mov r9, r2\n" - " ldr r4, _08041060 @ =0x040000d4\n" - " ldr r6, _08041064 @ =0x84000001\n" - " movs r5, 0x7\n" - "_08041036:\n" - " lsls r2, r3, 24\n" - " asrs r2, 24\n" - " subs r0, r5, r2\n" - " lsls r0, 2\n" - " add r0, r12\n" - " ldr r1, [sp, 0x20]\n" - " adds r0, r1, r0\n" - " lsls r1, r2, 2\n" - " adds r1, r7, r1\n" - " str r0, [r4]\n" - " str r1, [r4, 0x4]\n" - " str r6, [r4, 0x8]\n" - " ldr r0, [r4, 0x8]\n" - " adds r2, 0x1\n" - " lsls r2, 24\n" - " lsrs r3, r2, 24\n" - " asrs r2, 24\n" - " cmp r2, 0x7\n" - " ble _08041036\n" - " b _08041112\n" - " .align 2, 0\n" - "_08041060: .4byte 0x040000d4\n" - "_08041064: .4byte 0x84000001\n" - "_08041068:\n" - " movs r3, 0\n" - " adds r4, 0x2\n" - " str r4, [sp, 0x30]\n" - " movs r0, 0x20\n" - " adds r0, r7\n" - " mov r10, r0\n" - " adds r2, 0x1\n" - " mov r9, r2\n" - "_08041078:\n" - " movs r2, 0\n" - " lsls r4, r3, 24\n" - " lsls r0, r4, 2\n" - " lsrs r0, 24\n" - " adds r6, r0, 0x3\n" - " mov r1, r12\n" - " adds r5, r1, r0\n" - "_08041086:\n" - " lsls r1, r2, 24\n" - " asrs r1, 24\n" - " subs r0, r6, r1\n" - " mov r2, sp\n" - " adds r3, r2, r0\n" - " adds r0, r5, r1\n" - " ldr r2, [sp, 0x20]\n" - " adds r0, r2, r0\n" - " ldrb r2, [r0]\n" - " movs r0, 0xF\n" - " ands r0, r2\n" - " lsls r0, 4\n" - " lsrs r2, 4\n" - " orrs r0, r2\n" - " strb r0, [r3]\n" - " adds r1, 0x1\n" - " lsls r1, 24\n" - " lsrs r2, r1, 24\n" - " asrs r1, 24\n" - " cmp r1, 0x3\n" - " ble _08041086\n" - " movs r3, 0x80\n" - " lsls r3, 17\n" - " adds r0, r4, r3\n" - " lsrs r3, r0, 24\n" - " asrs r0, 24\n" - " cmp r0, 0x7\n" - " ble _08041078\n" - " movs r0, 0x80\n" - " lsls r0, 4\n" - " mov r1, sp\n" - " ldrh r1, [r1, 0x38]\n" - " ands r0, r1\n" - " cmp r0, 0\n" - " beq _08041104\n" - " movs r3, 0\n" - " ldr r4, _080410FC @ =0x040000d4\n" - " ldr r6, _08041100 @ =0x84000001\n" - " movs r5, 0x7\n" - "_080410D4:\n" - " lsls r1, r3, 24\n" - " asrs r1, 24\n" - " subs r0, r5, r1\n" - " lsls r0, 2\n" - " mov r3, sp\n" - " adds r2, r3, r0\n" - " lsls r0, r1, 2\n" - " adds r0, r7, r0\n" - " str r2, [r4]\n" - " str r0, [r4, 0x4]\n" - " str r6, [r4, 0x8]\n" - " ldr r0, [r4, 0x8]\n" - " adds r1, 0x1\n" - " lsls r1, 24\n" - " lsrs r3, r1, 24\n" - " asrs r1, 24\n" - " cmp r1, 0x7\n" - " ble _080410D4\n" - " b _08041112\n" - " .align 2, 0\n" - "_080410FC: .4byte 0x040000d4\n" - "_08041100: .4byte 0x84000001\n" - "_08041104:\n" - " mov r0, sp\n" - " mov r1, r8\n" - " str r0, [r1]\n" - " str r7, [r1, 0x4]\n" - " ldr r2, _08041148 @ =0x84000008\n" - " str r2, [r1, 0x8]\n" - " ldr r0, [r1, 0x8]\n" - "_08041112:\n" - " ldr r4, [sp, 0x30]\n" - " mov r7, r10\n" - " mov r3, r9\n" - " lsls r0, r3, 24\n" - " lsrs r2, r0, 24\n" - " ldr r0, [sp, 0x28]\n" - " cmp r2, r0\n" - " bcs _08041124\n" - " b _08040FD0\n" - "_08041124:\n" - " ldr r1, [sp, 0x2C]\n" - " adds r4, r1\n" - " ldr r2, [sp, 0x34]\n" - " lsls r0, r2, 24\n" - " lsrs r1, r0, 24\n" - " ldr r3, [sp, 0x24]\n" - " cmp r1, r3\n" - " bcs _08041136\n" - " b _08040FBE\n" - "_08041136:\n" - " add sp, 0x3C\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" - "_08041148: .4byte 0x84000008\n" - " .syntax divided\n" - ); + asm("\n" + " .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, 0x3C\n" + " str r2, [sp, 0x20]\n" + " adds r4, r3, 0\n" + " ldr r7, [sp, 0x5C]\n" + " lsls r0, 24\n" + " lsls r1, 24\n" + " ldr r2, _08041008 @ =gSpriteDimensions\n" + " lsrs r1, 23\n" + " lsrs r0, 21\n" + " adds r1, r0\n" + " adds r0, r2, 0x1\n" + " adds r0, r1, r0\n" + " ldrb r0, [r0]\n" + " str r0, [sp, 0x24]\n" + " adds r1, r2\n" + " ldrb r1, [r1]\n" + " str r1, [sp, 0x28]\n" + " movs r1, 0\n" + " cmp r1, r0\n" + " bcc _08040FB4\n" + " b _08041136\n" + "_08040FB4:\n" + " movs r0, 0x20\n" + " ldr r2, [sp, 0x28]\n" + " subs r0, r2\n" + " lsls r0, 1\n" + " str r0, [sp, 0x2C]\n" + "_08040FBE:\n" + " movs r2, 0\n" + " adds r1, 0x1\n" + " str r1, [sp, 0x34]\n" + " ldr r3, [sp, 0x28]\n" + " cmp r2, r3\n" + " bcc _08040FCC\n" + " b _08041124\n" + "_08040FCC:\n" + " ldr r0, _0804100C @ =0x040000d4\n" + " mov r8, r0\n" + "_08040FD0:\n" + " ldrh r1, [r4]\n" + " ldr r0, _08041010 @ =0x000003ff\n" + " ands r0, r1\n" + " lsls r0, 5\n" + " mov r12, r0\n" + " movs r0, 0xC0\n" + " lsls r0, 4\n" + " ands r0, r1\n" + " mov r3, sp\n" + " strh r1, [r3, 0x38]\n" + " cmp r0, 0\n" + " bne _08041018\n" + " ldr r0, [sp, 0x20]\n" + " add r0, r12\n" + " mov r1, r8\n" + " str r0, [r1]\n" + " str r7, [r1, 0x4]\n" + " ldr r3, _08041014 @ =0x84000008\n" + " str r3, [r1, 0x8]\n" + " ldr r0, [r1, 0x8]\n" + " adds r4, 0x2\n" + " str r4, [sp, 0x30]\n" + " adds r7, 0x20\n" + " mov r10, r7\n" + " adds r2, 0x1\n" + " mov r9, r2\n" + " b _08041112\n" + " .align 2, 0\n" + "_08041008: .4byte gSpriteDimensions\n" + "_0804100C: .4byte 0x040000d4\n" + "_08041010: .4byte 0x000003ff\n" + "_08041014: .4byte 0x84000008\n" + "_08041018:\n" + " movs r1, 0x80\n" + " lsls r1, 4\n" + " cmp r0, r1\n" + " bne _08041068\n" + " movs r3, 0\n" + " adds r4, 0x2\n" + " str r4, [sp, 0x30]\n" + " movs r0, 0x20\n" + " adds r0, r7\n" + " mov r10, r0\n" + " adds r2, 0x1\n" + " mov r9, r2\n" + " ldr r4, _08041060 @ =0x040000d4\n" + " ldr r6, _08041064 @ =0x84000001\n" + " movs r5, 0x7\n" + "_08041036:\n" + " lsls r2, r3, 24\n" + " asrs r2, 24\n" + " subs r0, r5, r2\n" + " lsls r0, 2\n" + " add r0, r12\n" + " ldr r1, [sp, 0x20]\n" + " adds r0, r1, r0\n" + " lsls r1, r2, 2\n" + " adds r1, r7, r1\n" + " str r0, [r4]\n" + " str r1, [r4, 0x4]\n" + " str r6, [r4, 0x8]\n" + " ldr r0, [r4, 0x8]\n" + " adds r2, 0x1\n" + " lsls r2, 24\n" + " lsrs r3, r2, 24\n" + " asrs r2, 24\n" + " cmp r2, 0x7\n" + " ble _08041036\n" + " b _08041112\n" + " .align 2, 0\n" + "_08041060: .4byte 0x040000d4\n" + "_08041064: .4byte 0x84000001\n" + "_08041068:\n" + " movs r3, 0\n" + " adds r4, 0x2\n" + " str r4, [sp, 0x30]\n" + " movs r0, 0x20\n" + " adds r0, r7\n" + " mov r10, r0\n" + " adds r2, 0x1\n" + " mov r9, r2\n" + "_08041078:\n" + " movs r2, 0\n" + " lsls r4, r3, 24\n" + " lsls r0, r4, 2\n" + " lsrs r0, 24\n" + " adds r6, r0, 0x3\n" + " mov r1, r12\n" + " adds r5, r1, r0\n" + "_08041086:\n" + " lsls r1, r2, 24\n" + " asrs r1, 24\n" + " subs r0, r6, r1\n" + " mov r2, sp\n" + " adds r3, r2, r0\n" + " adds r0, r5, r1\n" + " ldr r2, [sp, 0x20]\n" + " adds r0, r2, r0\n" + " ldrb r2, [r0]\n" + " movs r0, 0xF\n" + " ands r0, r2\n" + " lsls r0, 4\n" + " lsrs r2, 4\n" + " orrs r0, r2\n" + " strb r0, [r3]\n" + " adds r1, 0x1\n" + " lsls r1, 24\n" + " lsrs r2, r1, 24\n" + " asrs r1, 24\n" + " cmp r1, 0x3\n" + " ble _08041086\n" + " movs r3, 0x80\n" + " lsls r3, 17\n" + " adds r0, r4, r3\n" + " lsrs r3, r0, 24\n" + " asrs r0, 24\n" + " cmp r0, 0x7\n" + " ble _08041078\n" + " movs r0, 0x80\n" + " lsls r0, 4\n" + " mov r1, sp\n" + " ldrh r1, [r1, 0x38]\n" + " ands r0, r1\n" + " cmp r0, 0\n" + " beq _08041104\n" + " movs r3, 0\n" + " ldr r4, _080410FC @ =0x040000d4\n" + " ldr r6, _08041100 @ =0x84000001\n" + " movs r5, 0x7\n" + "_080410D4:\n" + " lsls r1, r3, 24\n" + " asrs r1, 24\n" + " subs r0, r5, r1\n" + " lsls r0, 2\n" + " mov r3, sp\n" + " adds r2, r3, r0\n" + " lsls r0, r1, 2\n" + " adds r0, r7, r0\n" + " str r2, [r4]\n" + " str r0, [r4, 0x4]\n" + " str r6, [r4, 0x8]\n" + " ldr r0, [r4, 0x8]\n" + " adds r1, 0x1\n" + " lsls r1, 24\n" + " lsrs r3, r1, 24\n" + " asrs r1, 24\n" + " cmp r1, 0x7\n" + " ble _080410D4\n" + " b _08041112\n" + " .align 2, 0\n" + "_080410FC: .4byte 0x040000d4\n" + "_08041100: .4byte 0x84000001\n" + "_08041104:\n" + " mov r0, sp\n" + " mov r1, r8\n" + " str r0, [r1]\n" + " str r7, [r1, 0x4]\n" + " ldr r2, _08041148 @ =0x84000008\n" + " str r2, [r1, 0x8]\n" + " ldr r0, [r1, 0x8]\n" + "_08041112:\n" + " ldr r4, [sp, 0x30]\n" + " mov r7, r10\n" + " mov r3, r9\n" + " lsls r0, r3, 24\n" + " lsrs r2, r0, 24\n" + " ldr r0, [sp, 0x28]\n" + " cmp r2, r0\n" + " bcs _08041124\n" + " b _08040FD0\n" + "_08041124:\n" + " ldr r1, [sp, 0x2C]\n" + " adds r4, r1\n" + " ldr r2, [sp, 0x34]\n" + " lsls r0, r2, 24\n" + " lsrs r1, r0, 24\n" + " ldr r3, [sp, 0x24]\n" + " cmp r1, r3\n" + " bcs _08041136\n" + " b _08040FBE\n" + "_08041136:\n" + " add sp, 0x3C\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" + "_08041148: .4byte 0x84000008\n" + " .syntax divided\n" + ); } #endif int CountTrailingZeroBits(u32 value) { - u8 i; - for (i = 0; i < 32; i++) { - if ((value & 1) == 0) { - value >>= 1; - } else { - return i; - } - } - return 0; + u8 i; + for (i = 0; i < 32; i++) { + if ((value & 1) == 0) { + value >>= 1; + } else { + return i; + } + } + return 0; } u16 CalcCRC16(u8 *data, int length) { - u16 i, j; - u16 crc = 0x1121; - for (i = 0; i < length; i++) { - crc ^= data[i]; - for (j = 0; j < 8; j++) { - if (crc & 1) { - crc = (crc >> 1) ^ 0x8408; - } else { - crc >>= 1; - } - } - } - return ~crc; + u16 i, j; + u16 crc = 0x1121; + for (i = 0; i < length; i++) { + crc ^= data[i]; + for (j = 0; j < 8; j++) { + if (crc & 1) { + crc = (crc >> 1) ^ 0x8408; + } else { + crc >>= 1; + } + } + } + return ~crc; } u16 CalcCRC16WithTable(u8 *data, int length) { - u16 i; - u16 crc = 0x1121; - u8 byte; - for (i = 0; i < length; i++) { - byte = crc >> 8; - crc ^= data[i]; - crc = byte ^ gCrc16Table[(u8)crc]; - } - return ~crc; + u16 i; + u16 crc = 0x1121; + u8 byte; + for (i = 0; i < length; i++) { + byte = crc >> 8; + crc ^= data[i]; + crc = byte ^ gCrc16Table[(u8)crc]; + } + return ~crc; } -- cgit v1.2.3 From ed372b11baf8f09ff5a305b697a859b8c5b7b3f1 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 13 Jun 2017 22:20:21 -0400 Subject: Fix leading whitespace; remove unnecessary data struct macros --- src/decoration.c | 314 +++++++-------- src/field_map_obj.c | 274 ++++++------- src/secret_base.c | 890 ++++++++++++++++++++--------------------- src/tv.c | 1112 +++++++++++++++++++++++++-------------------------- src/util.c | 690 ++++++++++++++++---------------- 5 files changed, 1632 insertions(+), 1648 deletions(-) (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 73a2a6749..a2b0dcd31 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -18,22 +18,6 @@ #include "field_weather.h" #include "decoration.h" -#define DECORATION(_id, _name, _permission, _shape, _category, _price, _description, _tiles) {\ -.id = _id,\ -.name = _name,\ -.permission = _permission,\ -.shape = _shape,\ -.category = _category,\ -.price = _price,\ -.description = _description,\ -.tiles = _tiles\ -} - -#define MENUACTION2(_text, _func) {.text = _text, .func = _func} -#define MENUACTION3(_func1, _func2) {.func1 = _func1, .func2 = _func2} -#define STRUCT_803EC860(_data1, _data2, _data3, _size) {.tiles = _data1, .y = _data2, .x = _data3, .size = _size} -#define DECOSPRITETEMPLATE(_shape, _size, _x, _y) {.shape = _shape, .size = _size, .x = _x, .y = _y} - const u8 DecorDesc_SMALL_DESK[] = _( "A small desk built\n" "for one."); @@ -1255,127 +1239,127 @@ const u16 DecorGfx_REGISTEEL_DOLL[] = { }; const struct Decoration gDecorations[] = { - DECORATION(DECOR_NONE, _("SMALL DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_DESK, 0, DecorDesc_SMALL_DESK, DecorGfx_SMALL_DESK), - DECORATION(DECOR_SMALL_DESK, _("SMALL DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_DESK, 3000, DecorDesc_SMALL_DESK, DecorGfx_SMALL_DESK), - DECORATION(DECOR_POKEMON_DESK, _("POKéMON DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_DESK, 3000, DecorDesc_POKEMON_DESK, DecorGfx_POKEMON_DESK), - DECORATION(DECOR_HEAVY_DESK, _("HEAVY DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_3x2, DECORCAT_DESK, 6000, DecorDesc_HEAVY_DESK, DecorGfx_HEAVY_DESK), - DECORATION(DECOR_RAGGED_DESK, _("RAGGED DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_3x2, DECORCAT_DESK, 6000, DecorDesc_RAGGED_DESK, DecorGfx_RAGGED_DESK), - DECORATION(DECOR_COMFORT_DESK, _("COMFORT DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_3x2, DECORCAT_DESK, 6000, DecorDesc_COMFORT_DESK, DecorGfx_COMFORT_DESK), - DECORATION(DECOR_PRETTY_DESK, _("PRETTY DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_3x3, DECORCAT_DESK, 9000, DecorDesc_PRETTY_DESK, DecorGfx_PRETTY_DESK), - DECORATION(DECOR_BRICK_DESK, _("BRICK DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_3x3, DECORCAT_DESK, 9000, DecorDesc_BRICK_DESK, DecorGfx_BRICK_DESK), - DECORATION(DECOR_CAMP_DESK, _("CAMP DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_3x3, DECORCAT_DESK, 9000, DecorDesc_CAMP_DESK, DecorGfx_CAMP_DESK), - DECORATION(DECOR_HARD_DESK, _("HARD DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_3x3, DECORCAT_DESK, 9000, DecorDesc_HARD_DESK, DecorGfx_HARD_DESK), - DECORATION(DECOR_SMALL_CHAIR, _("SMALL CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_SMALL_CHAIR, DecorGfx_SMALL_CHAIR), - DECORATION(DECOR_POKEMON_CHAIR, _("POKéMON CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_POKEMON_CHAIR, DecorGfx_POKEMON_CHAIR), - DECORATION(DECOR_HEAVY_CHAIR, _("HEAVY CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_HEAVY_CHAIR, DecorGfx_HEAVY_CHAIR), - DECORATION(DECOR_PRETTY_CHAIR, _("PRETTY CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_PRETTY_CHAIR, DecorGfx_PRETTY_CHAIR), - DECORATION(DECOR_COMFORT_CHAIR, _("COMFORT CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_COMFORT_CHAIR, DecorGfx_COMFORT_CHAIR), - DECORATION(DECOR_RAGGED_CHAIR, _("RAGGED CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_RAGGED_CHAIR, DecorGfx_RAGGED_CHAIR), - DECORATION(DECOR_BRICK_CHAIR, _("BRICK CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_BRICK_CHAIR, DecorGfx_BRICK_CHAIR), - DECORATION(DECOR_CAMP_CHAIR, _("CAMP CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_CAMP_CHAIR, DecorGfx_CAMP_CHAIR), - DECORATION(DECOR_HARD_CHAIR, _("HARD CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_HARD_CHAIR, DecorGfx_HARD_CHAIR), - DECORATION(DECOR_RED_PLANT, _("RED PLANT"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_1x2, DECORCAT_PLANT, 3000, DecorDesc_RED_PLANT, DecorGfx_RED_PLANT), - DECORATION(DECOR_TROPICAL_PLANT, _("TROPICAL PLANT"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_1x2, DECORCAT_PLANT, 3000, DecorDesc_TROPICAL_PLANT, DecorGfx_TROPICAL_PLANT), - DECORATION(DECOR_PRETTY_FLOWERS, _("PRETTY FLOWERS"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_1x2, DECORCAT_PLANT, 3000, DecorDesc_PRETTY_FLOWERS, DecorGfx_PRETTY_FLOWERS), - DECORATION(DECOR_COLORFUL_PLANT, _("COLORFUL PLANT"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_2x2, DECORCAT_PLANT, 5000, DecorDesc_COLORFUL_PLANT, DecorGfx_COLORFUL_PLANT), - DECORATION(DECOR_BIG_PLANT, _("BIG PLANT"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_2x2, DECORCAT_PLANT, 5000, DecorDesc_BIG_PLANT, DecorGfx_BIG_PLANT), - DECORATION(DECOR_GORGEOUS_PLANT, _("GORGEOUS PLANT"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_2x2, DECORCAT_PLANT, 5000, DecorDesc_GORGEOUS_PLANT, DecorGfx_GORGEOUS_PLANT), - DECORATION(DECOR_RED_BRICK, _("RED BRICK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 500, DecorDesc_RED_BRICK, DecorGfx_RED_BRICK), - DECORATION(DECOR_YELLOW_BRICK, _("YELLOW BRICK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 500, DecorDesc_YELLOW_BRICK, DecorGfx_YELLOW_BRICK), - DECORATION(DECOR_BLUE_BRICK, _("BLUE BRICK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 500, DecorDesc_BLUE_BRICK, DecorGfx_BLUE_BRICK), - DECORATION(DECOR_RED_BALLOON, _("RED BALLOON"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 500, DecorDesc_RED_BALLOON, DecorGfx_RED_BALLOON), - DECORATION(DECOR_BLUE_BALLOON, _("BLUE BALLOON"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 500, DecorDesc_BLUE_BALLOON, DecorGfx_BLUE_BALLOON), - DECORATION(DECOR_YELLOW_BALLOON, _("YELLOW BALLOON"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 500, DecorDesc_YELLOW_BALLOON, DecorGfx_YELLOW_BALLOON), - DECORATION(DECOR_RED_TENT, _("RED TENT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_ORNAMENT, 10000, DecorDesc_RED_TENT, DecorGfx_RED_TENT), - DECORATION(DECOR_BLUE_TENT, _("BLUE TENT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_ORNAMENT, 10000, DecorDesc_BLUE_TENT, DecorGfx_BLUE_TENT), - DECORATION(DECOR_SOLID_BOARD, _("SOLID BOARD"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 3000, DecorDesc_SOLID_BOARD, DecorGfx_SOLID_BOARD), - DECORATION(DECOR_SLIDE, _("SLIDE"), DECORPERM_PASS_FLOOR, DECORSHAPE_2x4, DECORCAT_ORNAMENT, 8000, DecorDesc_SLIDE, DecorGfx_SLIDE), - DECORATION(DECOR_FENCE_LENGTH, _("FENCE LENGTH"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 500, DecorDesc_FENCE_LENGTH, DecorGfx_FENCE_LENGTH), - DECORATION(DECOR_FENCE_WIDTH, _("FENCE WIDTH"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 500, DecorDesc_FENCE_WIDTH, DecorGfx_FENCE_WIDTH), - DECORATION(DECOR_TIRE, _("TIRE"), DECORPERM_SOLID_FLOOR, DECORSHAPE_2x2, DECORCAT_ORNAMENT, 800, DecorDesc_TIRE, DecorGfx_TIRE), - DECORATION(DECOR_STAND, _("STAND"), DECORPERM_PASS_FLOOR, DECORSHAPE_4x2, DECORCAT_ORNAMENT, 7000, DecorDesc_STAND, DecorGfx_STAND), - DECORATION(DECOR_MUD_BALL, _("MUD BALL"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 200, DecorDesc_MUD_BALL, DecorGfx_MUD_BALL), - DECORATION(DECOR_BREAKABLE_DOOR, _("BREAKABLE DOOR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 3000, DecorDesc_BREAKABLE_DOOR, DecorGfx_BREAKABLE_DOOR), - DECORATION(DECOR_SAND_ORNAMENT, _("SAND ORNAMENT"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 3000, DecorDesc_SAND_ORNAMENT, DecorGfx_SAND_ORNAMENT), - DECORATION(DECOR_SILVER_SHIELD, _("SILVER SHIELD"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 0, DecorDesc_SILVER_SHIELD, DecorGfx_SILVER_SHIELD), - DECORATION(DECOR_GOLD_SHIELD, _("GOLD SHIELD"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 0, DecorDesc_GOLD_SHIELD, DecorGfx_GOLD_SHIELD), - DECORATION(DECOR_GLASS_ORNAMENT, _("GLASS ORNAMENT"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 0, DecorDesc_GLASS_ORNAMENT, DecorGfx_GLASS_ORNAMENT), - DECORATION(DECOR_TV, _("TV"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 3000, DecorDesc_TV, DecorGfx_TV), - DECORATION(DECOR_ROUND_TV, _("ROUND TV"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 4000, DecorDesc_ROUND_TV, DecorGfx_ROUND_TV), - DECORATION(DECOR_CUTE_TV, _("CUTE TV"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 4000, DecorDesc_CUTE_TV, DecorGfx_CUTE_TV), - DECORATION(DECOR_GLITTER_MAT, _("GLITTER MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 2000, DecorDesc_GLITTER_MAT, DecorGfx_GLITTER_MAT), - DECORATION(DECOR_JUMP_MAT, _("JUMP MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 2000, DecorDesc_JUMP_MAT, DecorGfx_JUMP_MAT), - DECORATION(DECOR_SPIN_MAT, _("SPIN MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 2000, DecorDesc_SPIN_MAT, DecorGfx_SPIN_MAT), - DECORATION(DECOR_C_LOW_NOTE_MAT, _("C Low NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_C_LOW_NOTE_MAT, DecorGfx_C_LOW_NOTE_MAT), - DECORATION(DECOR_D_NOTE_MAT, _("D NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_D_NOTE_MAT, DecorGfx_D_NOTE_MAT), - DECORATION(DECOR_E_NOTE_MAT, _("E NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_E_NOTE_MAT, DecorGfx_E_NOTE_MAT), - DECORATION(DECOR_F_NOTE_MAT, _("F NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_F_NOTE_MAT, DecorGfx_F_NOTE_MAT), - DECORATION(DECOR_G_NOTE_MAT, _("G NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_G_NOTE_MAT, DecorGfx_G_NOTE_MAT), - DECORATION(DECOR_A_NOTE_MAT, _("A NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_A_NOTE_MAT, DecorGfx_A_NOTE_MAT), - DECORATION(DECOR_B_NOTE_MAT, _("B NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_B_NOTE_MAT, DecorGfx_B_NOTE_MAT), - DECORATION(DECOR_C_HIGH_NOTE_MAT, _("C High NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_C_HIGH_NOTE_MAT, DecorGfx_C_HIGH_NOTE_MAT), - DECORATION(DECOR_SURF_MAT, _("SURF MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_MAT, 4000, DecorDesc_SURF_MAT, DecorGfx_SURF_MAT), - DECORATION(DECOR_THUNDER_MAT, _("THUNDER MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_MAT, 4000, DecorDesc_THUNDER_MAT, DecorGfx_THUNDER_MAT), - DECORATION(DECOR_FIRE_BLAST_MAT, _("FIRE BLAST MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_MAT, 4000, DecorDesc_FIRE_BLAST_MAT, DecorGfx_FIRE_BLAST_MAT), - DECORATION(DECOR_POWDER_SNOW_MAT, _("POWDER SNOW MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_MAT, 4000, DecorDesc_POWDER_SNOW_MAT, DecorGfx_POWDER_SNOW_MAT), - DECORATION(DECOR_ATTRACT_MAT, _("ATTRACT MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_MAT, 4000, DecorDesc_ATTRACT_MAT, DecorGfx_ATTRACT_MAT), - DECORATION(DECOR_FISSURE_MAT, _("FISSURE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_MAT, 4000, DecorDesc_FISSURE_MAT, DecorGfx_FISSURE_MAT), - DECORATION(DECOR_SPIKES_MAT, _("SPIKES MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_MAT, 4000, DecorDesc_SPIKES_MAT, DecorGfx_SPIKES_MAT), - DECORATION(DECOR_BALL_POSTER, _("BALL POSTER"), DECORPERM_NA_WALL, DECORSHAPE_1x1, DECORCAT_POSTER, 1000, DecorDesc_BALL_POSTER, DecorGfx_BALL_POSTER), - DECORATION(DECOR_GREEN_POSTER, _("GREEN POSTER"), DECORPERM_NA_WALL, DECORSHAPE_1x1, DECORCAT_POSTER, 1000, DecorDesc_GREEN_POSTER, DecorGfx_GREEN_POSTER), - DECORATION(DECOR_RED_POSTER, _("RED POSTER"), DECORPERM_NA_WALL, DECORSHAPE_1x1, DECORCAT_POSTER, 1000, DecorDesc_RED_POSTER, DecorGfx_RED_POSTER), - DECORATION(DECOR_BLUE_POSTER, _("BLUE POSTER"), DECORPERM_NA_WALL, DECORSHAPE_1x1, DECORCAT_POSTER, 1000, DecorDesc_BLUE_POSTER, DecorGfx_BLUE_POSTER), - DECORATION(DECOR_CUTE_POSTER, _("CUTE POSTER"), DECORPERM_NA_WALL, DECORSHAPE_1x1, DECORCAT_POSTER, 1000, DecorDesc_CUTE_POSTER, DecorGfx_CUTE_POSTER), - DECORATION(DECOR_PIKA_POSTER, _("PIKA POSTER"), DECORPERM_NA_WALL, DECORSHAPE_2x1, DECORCAT_POSTER, 1500, DecorDesc_PIKA_POSTER, DecorGfx_PIKA_POSTER), - DECORATION(DECOR_LONG_POSTER, _("LONG POSTER"), DECORPERM_NA_WALL, DECORSHAPE_2x1, DECORCAT_POSTER, 1500, DecorDesc_LONG_POSTER, DecorGfx_LONG_POSTER), - DECORATION(DECOR_SEA_POSTER, _("SEA POSTER"), DECORPERM_NA_WALL, DECORSHAPE_2x1, DECORCAT_POSTER, 1500, DecorDesc_SEA_POSTER, DecorGfx_SEA_POSTER), - DECORATION(DECOR_SKY_POSTER, _("SKY POSTER"), DECORPERM_NA_WALL, DECORSHAPE_2x1, DECORCAT_POSTER, 1500, DecorDesc_SKY_POSTER, DecorGfx_SKY_POSTER), - DECORATION(DECOR_KISS_POSTER, _("KISS POSTER"), DECORPERM_NA_WALL, DECORSHAPE_2x1, DECORCAT_POSTER, 1500, DecorDesc_KISS_POSTER, DecorGfx_KISS_POSTER), - DECORATION(DECOR_PICHU_DOLL, _("PICHU DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_PICHU_DOLL, DecorGfx_PICHU_DOLL), - DECORATION(DECOR_PIKACHU_DOLL, _("PIKACHU DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_PIKACHU_DOLL, DecorGfx_PIKACHU_DOLL), - DECORATION(DECOR_MARILL_DOLL, _("MARILL DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_MARILL_DOLL, DecorGfx_MARILL_DOLL), - DECORATION(DECOR_TOGEPI_DOLL, _("TOGEPI DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_TOGEPI_DOLL, DecorGfx_TOGEPI_DOLL), - DECORATION(DECOR_CYNDAQUIL_DOLL, _("CYNDAQUIL DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_CYNDAQUIL_DOLL, DecorGfx_CYNDAQUIL_DOLL), - DECORATION(DECOR_CHIKORITA_DOLL, _("CHIKORITA DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_CHIKORITA_DOLL, DecorGfx_CHIKORITA_DOLL), - DECORATION(DECOR_TOTODILE_DOLL, _("TOTODILE DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_TOTODILE_DOLL, DecorGfx_TOTODILE_DOLL), - DECORATION(DECOR_JIGGLYPUFF_DOLL, _("JIGGLYPUFF DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_JIGGLYPUFF_DOLL, DecorGfx_JIGGLYPUFF_DOLL), - DECORATION(DECOR_MEOWTH_DOLL, _("MEOWTH DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_MEOWTH_DOLL, DecorGfx_MEOWTH_DOLL), - DECORATION(DECOR_CLEFAIRY_DOLL, _("CLEFAIRY DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_CLEFAIRY_DOLL, DecorGfx_CLEFAIRY_DOLL), - DECORATION(DECOR_DITTO_DOLL, _("DITTO DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_DITTO_DOLL, DecorGfx_DITTO_DOLL), - DECORATION(DECOR_SMOOCHUM_DOLL, _("SMOOCHUM DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_SMOOCHUM_DOLL, DecorGfx_SMOOCHUM_DOLL), - DECORATION(DECOR_TREECKO_DOLL, _("TREECKO DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_TREECKO_DOLL, DecorGfx_TREECKO_DOLL), - DECORATION(DECOR_TORCHIC_DOLL, _("TORCHIC DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_TORCHIC_DOLL, DecorGfx_TORCHIC_DOLL), - DECORATION(DECOR_MUDKIP_DOLL, _("MUDKIP DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_MUDKIP_DOLL, DecorGfx_MUDKIP_DOLL), - DECORATION(DECOR_DUSKULL_DOLL, _("DUSKULL DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_DUSKULL_DOLL, DecorGfx_DUSKULL_DOLL), - DECORATION(DECOR_WYNAUT_DOLL, _("WYNAUT DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_WYNAUT_DOLL, DecorGfx_WYNAUT_DOLL), - DECORATION(DECOR_BALTOY_DOLL, _("BALTOY DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_BALTOY_DOLL, DecorGfx_BALTOY_DOLL), - DECORATION(DECOR_KECLEON_DOLL, _("KECLEON DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_KECLEON_DOLL, DecorGfx_KECLEON_DOLL), - DECORATION(DECOR_AZURILL_DOLL, _("AZURILL DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_AZURILL_DOLL, DecorGfx_AZURILL_DOLL), - DECORATION(DECOR_SKITTY_DOLL, _("SKITTY DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_SKITTY_DOLL, DecorGfx_SKITTY_DOLL), - DECORATION(DECOR_SWABLU_DOLL, _("SWABLU DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_SWABLU_DOLL, DecorGfx_SWABLU_DOLL), - DECORATION(DECOR_GULPIN_DOLL, _("GULPIN DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_GULPIN_DOLL, DecorGfx_GULPIN_DOLL), - DECORATION(DECOR_LOTAD_DOLL, _("LOTAD DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_LOTAD_DOLL, DecorGfx_LOTAD_DOLL), - DECORATION(DECOR_SEEDOT_DOLL, _("SEEDOT DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_SEEDOT_DOLL, DecorGfx_SEEDOT_DOLL), - DECORATION(DECOR_PIKA_CUSHION, _("PIKA CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_PIKA_CUSHION, DecorGfx_PIKA_CUSHION), - DECORATION(DECOR_ROUND_CUSHION, _("ROUND CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_ROUND_CUSHION, DecorGfx_ROUND_CUSHION), - DECORATION(DECOR_KISS_CUSHION, _("KISS CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_KISS_CUSHION, DecorGfx_KISS_CUSHION), - DECORATION(DECOR_ZIGZAG_CUSHION, _("ZIGZAG CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_ZIGZAG_CUSHION, DecorGfx_ZIGZAG_CUSHION), - DECORATION(DECOR_SPIN_CUSHION, _("SPIN CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_SPIN_CUSHION, DecorGfx_SPIN_CUSHION), - DECORATION(DECOR_DIAMOND_CUSHION, _("DIAMOND CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_DIAMOND_CUSHION, DecorGfx_DIAMOND_CUSHION), - DECORATION(DECOR_BALL_CUSHION, _("BALL CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_BALL_CUSHION, DecorGfx_BALL_CUSHION), - DECORATION(DECOR_GRASS_CUSHION, _("GRASS CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_GRASS_CUSHION, DecorGfx_GRASS_CUSHION), - DECORATION(DECOR_FIRE_CUSHION, _("FIRE CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_FIRE_CUSHION, DecorGfx_FIRE_CUSHION), - DECORATION(DECOR_WATER_CUSHION, _("WATER CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_WATER_CUSHION, DecorGfx_WATER_CUSHION), - DECORATION(DECOR_SNORLAX_DOLL, _("SNORLAX DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_SNORLAX_DOLL, DecorGfx_SNORLAX_DOLL), - DECORATION(DECOR_RHYDON_DOLL, _("RHYDON DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_RHYDON_DOLL, DecorGfx_RHYDON_DOLL), - DECORATION(DECOR_LAPRAS_DOLL, _("LAPRAS DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_LAPRAS_DOLL, DecorGfx_LAPRAS_DOLL), - DECORATION(DECOR_VENUSAUR_DOLL, _("VENUSAUR DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_VENUSAUR_DOLL, DecorGfx_VENUSAUR_DOLL), - DECORATION(DECOR_CHARIZARD_DOLL, _("CHARIZARD DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_CHARIZARD_DOLL, DecorGfx_CHARIZARD_DOLL), - DECORATION(DECOR_BLASTOISE_DOLL, _("BLASTOISE DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_BLASTOISE_DOLL, DecorGfx_BLASTOISE_DOLL), - DECORATION(DECOR_WAILMER_DOLL, _("WAILMER DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_WAILMER_DOLL, DecorGfx_WAILMER_DOLL), - DECORATION(DECOR_REGIROCK_DOLL, _("REGIROCK DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_REGIROCK_DOLL, DecorGfx_REGIROCK_DOLL), - DECORATION(DECOR_REGICE_DOLL, _("REGICE DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_REGICE_DOLL, DecorGfx_REGICE_DOLL), - DECORATION(DECOR_REGISTEEL_DOLL, _("REGISTEEL DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_REGISTEEL_DOLL, DecorGfx_REGISTEEL_DOLL) + {DECOR_NONE, _("SMALL DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_DESK, 0, DecorDesc_SMALL_DESK, DecorGfx_SMALL_DESK}, + {DECOR_SMALL_DESK, _("SMALL DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_DESK, 3000, DecorDesc_SMALL_DESK, DecorGfx_SMALL_DESK}, + {DECOR_POKEMON_DESK, _("POKéMON DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_DESK, 3000, DecorDesc_POKEMON_DESK, DecorGfx_POKEMON_DESK}, + {DECOR_HEAVY_DESK, _("HEAVY DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_3x2, DECORCAT_DESK, 6000, DecorDesc_HEAVY_DESK, DecorGfx_HEAVY_DESK}, + {DECOR_RAGGED_DESK, _("RAGGED DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_3x2, DECORCAT_DESK, 6000, DecorDesc_RAGGED_DESK, DecorGfx_RAGGED_DESK}, + {DECOR_COMFORT_DESK, _("COMFORT DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_3x2, DECORCAT_DESK, 6000, DecorDesc_COMFORT_DESK, DecorGfx_COMFORT_DESK}, + {DECOR_PRETTY_DESK, _("PRETTY DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_3x3, DECORCAT_DESK, 9000, DecorDesc_PRETTY_DESK, DecorGfx_PRETTY_DESK}, + {DECOR_BRICK_DESK, _("BRICK DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_3x3, DECORCAT_DESK, 9000, DecorDesc_BRICK_DESK, DecorGfx_BRICK_DESK}, + {DECOR_CAMP_DESK, _("CAMP DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_3x3, DECORCAT_DESK, 9000, DecorDesc_CAMP_DESK, DecorGfx_CAMP_DESK}, + {DECOR_HARD_DESK, _("HARD DESK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_3x3, DECORCAT_DESK, 9000, DecorDesc_HARD_DESK, DecorGfx_HARD_DESK}, + {DECOR_SMALL_CHAIR, _("SMALL CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_SMALL_CHAIR, DecorGfx_SMALL_CHAIR}, + {DECOR_POKEMON_CHAIR, _("POKéMON CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_POKEMON_CHAIR, DecorGfx_POKEMON_CHAIR}, + {DECOR_HEAVY_CHAIR, _("HEAVY CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_HEAVY_CHAIR, DecorGfx_HEAVY_CHAIR}, + {DECOR_PRETTY_CHAIR, _("PRETTY CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_PRETTY_CHAIR, DecorGfx_PRETTY_CHAIR}, + {DECOR_COMFORT_CHAIR, _("COMFORT CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_COMFORT_CHAIR, DecorGfx_COMFORT_CHAIR}, + {DECOR_RAGGED_CHAIR, _("RAGGED CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_RAGGED_CHAIR, DecorGfx_RAGGED_CHAIR}, + {DECOR_BRICK_CHAIR, _("BRICK CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_BRICK_CHAIR, DecorGfx_BRICK_CHAIR}, + {DECOR_CAMP_CHAIR, _("CAMP CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_CAMP_CHAIR, DecorGfx_CAMP_CHAIR}, + {DECOR_HARD_CHAIR, _("HARD CHAIR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_CHAIR, 2000, DecorDesc_HARD_CHAIR, DecorGfx_HARD_CHAIR}, + {DECOR_RED_PLANT, _("RED PLANT"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_1x2, DECORCAT_PLANT, 3000, DecorDesc_RED_PLANT, DecorGfx_RED_PLANT}, + {DECOR_TROPICAL_PLANT, _("TROPICAL PLANT"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_1x2, DECORCAT_PLANT, 3000, DecorDesc_TROPICAL_PLANT, DecorGfx_TROPICAL_PLANT}, + {DECOR_PRETTY_FLOWERS, _("PRETTY FLOWERS"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_1x2, DECORCAT_PLANT, 3000, DecorDesc_PRETTY_FLOWERS, DecorGfx_PRETTY_FLOWERS}, + {DECOR_COLORFUL_PLANT, _("COLORFUL PLANT"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_2x2, DECORCAT_PLANT, 5000, DecorDesc_COLORFUL_PLANT, DecorGfx_COLORFUL_PLANT}, + {DECOR_BIG_PLANT, _("BIG PLANT"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_2x2, DECORCAT_PLANT, 5000, DecorDesc_BIG_PLANT, DecorGfx_BIG_PLANT}, + {DECOR_GORGEOUS_PLANT, _("GORGEOUS PLANT"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_2x2, DECORCAT_PLANT, 5000, DecorDesc_GORGEOUS_PLANT, DecorGfx_GORGEOUS_PLANT}, + {DECOR_RED_BRICK, _("RED BRICK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 500, DecorDesc_RED_BRICK, DecorGfx_RED_BRICK}, + {DECOR_YELLOW_BRICK, _("YELLOW BRICK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 500, DecorDesc_YELLOW_BRICK, DecorGfx_YELLOW_BRICK}, + {DECOR_BLUE_BRICK, _("BLUE BRICK"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 500, DecorDesc_BLUE_BRICK, DecorGfx_BLUE_BRICK}, + {DECOR_RED_BALLOON, _("RED BALLOON"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 500, DecorDesc_RED_BALLOON, DecorGfx_RED_BALLOON}, + {DECOR_BLUE_BALLOON, _("BLUE BALLOON"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 500, DecorDesc_BLUE_BALLOON, DecorGfx_BLUE_BALLOON}, + {DECOR_YELLOW_BALLOON, _("YELLOW BALLOON"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 500, DecorDesc_YELLOW_BALLOON, DecorGfx_YELLOW_BALLOON}, + {DECOR_RED_TENT, _("RED TENT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_ORNAMENT, 10000, DecorDesc_RED_TENT, DecorGfx_RED_TENT}, + {DECOR_BLUE_TENT, _("BLUE TENT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_ORNAMENT, 10000, DecorDesc_BLUE_TENT, DecorGfx_BLUE_TENT}, + {DECOR_SOLID_BOARD, _("SOLID BOARD"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 3000, DecorDesc_SOLID_BOARD, DecorGfx_SOLID_BOARD}, + {DECOR_SLIDE, _("SLIDE"), DECORPERM_PASS_FLOOR, DECORSHAPE_2x4, DECORCAT_ORNAMENT, 8000, DecorDesc_SLIDE, DecorGfx_SLIDE}, + {DECOR_FENCE_LENGTH, _("FENCE LENGTH"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 500, DecorDesc_FENCE_LENGTH, DecorGfx_FENCE_LENGTH}, + {DECOR_FENCE_WIDTH, _("FENCE WIDTH"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 500, DecorDesc_FENCE_WIDTH, DecorGfx_FENCE_WIDTH}, + {DECOR_TIRE, _("TIRE"), DECORPERM_SOLID_FLOOR, DECORSHAPE_2x2, DECORCAT_ORNAMENT, 800, DecorDesc_TIRE, DecorGfx_TIRE}, + {DECOR_STAND, _("STAND"), DECORPERM_PASS_FLOOR, DECORSHAPE_4x2, DECORCAT_ORNAMENT, 7000, DecorDesc_STAND, DecorGfx_STAND}, + {DECOR_MUD_BALL, _("MUD BALL"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 200, DecorDesc_MUD_BALL, DecorGfx_MUD_BALL}, + {DECOR_BREAKABLE_DOOR, _("BREAKABLE DOOR"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 3000, DecorDesc_BREAKABLE_DOOR, DecorGfx_BREAKABLE_DOOR}, + {DECOR_SAND_ORNAMENT, _("SAND ORNAMENT"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 3000, DecorDesc_SAND_ORNAMENT, DecorGfx_SAND_ORNAMENT}, + {DECOR_SILVER_SHIELD, _("SILVER SHIELD"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 0, DecorDesc_SILVER_SHIELD, DecorGfx_SILVER_SHIELD}, + {DECOR_GOLD_SHIELD, _("GOLD SHIELD"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 0, DecorDesc_GOLD_SHIELD, DecorGfx_GOLD_SHIELD}, + {DECOR_GLASS_ORNAMENT, _("GLASS ORNAMENT"), DECORPERM_BEHIND_FLOOR, DECORSHAPE_1x2, DECORCAT_ORNAMENT, 0, DecorDesc_GLASS_ORNAMENT, DecorGfx_GLASS_ORNAMENT}, + {DECOR_TV, _("TV"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 3000, DecorDesc_TV, DecorGfx_TV}, + {DECOR_ROUND_TV, _("ROUND TV"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 4000, DecorDesc_ROUND_TV, DecorGfx_ROUND_TV}, + {DECOR_CUTE_TV, _("CUTE TV"), DECORPERM_SOLID_FLOOR, DECORSHAPE_1x1, DECORCAT_ORNAMENT, 4000, DecorDesc_CUTE_TV, DecorGfx_CUTE_TV}, + {DECOR_GLITTER_MAT, _("GLITTER MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 2000, DecorDesc_GLITTER_MAT, DecorGfx_GLITTER_MAT}, + {DECOR_JUMP_MAT, _("JUMP MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 2000, DecorDesc_JUMP_MAT, DecorGfx_JUMP_MAT}, + {DECOR_SPIN_MAT, _("SPIN MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 2000, DecorDesc_SPIN_MAT, DecorGfx_SPIN_MAT}, + {DECOR_C_LOW_NOTE_MAT, _("C Low NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_C_LOW_NOTE_MAT, DecorGfx_C_LOW_NOTE_MAT}, + {DECOR_D_NOTE_MAT, _("D NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_D_NOTE_MAT, DecorGfx_D_NOTE_MAT}, + {DECOR_E_NOTE_MAT, _("E NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_E_NOTE_MAT, DecorGfx_E_NOTE_MAT}, + {DECOR_F_NOTE_MAT, _("F NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_F_NOTE_MAT, DecorGfx_F_NOTE_MAT}, + {DECOR_G_NOTE_MAT, _("G NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_G_NOTE_MAT, DecorGfx_G_NOTE_MAT}, + {DECOR_A_NOTE_MAT, _("A NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_A_NOTE_MAT, DecorGfx_A_NOTE_MAT}, + {DECOR_B_NOTE_MAT, _("B NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_B_NOTE_MAT, DecorGfx_B_NOTE_MAT}, + {DECOR_C_HIGH_NOTE_MAT, _("C High NOTE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_1x1, DECORCAT_MAT, 500, DecorDesc_C_HIGH_NOTE_MAT, DecorGfx_C_HIGH_NOTE_MAT}, + {DECOR_SURF_MAT, _("SURF MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_MAT, 4000, DecorDesc_SURF_MAT, DecorGfx_SURF_MAT}, + {DECOR_THUNDER_MAT, _("THUNDER MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_MAT, 4000, DecorDesc_THUNDER_MAT, DecorGfx_THUNDER_MAT}, + {DECOR_FIRE_BLAST_MAT, _("FIRE BLAST MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_MAT, 4000, DecorDesc_FIRE_BLAST_MAT, DecorGfx_FIRE_BLAST_MAT}, + {DECOR_POWDER_SNOW_MAT, _("POWDER SNOW MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_MAT, 4000, DecorDesc_POWDER_SNOW_MAT, DecorGfx_POWDER_SNOW_MAT}, + {DECOR_ATTRACT_MAT, _("ATTRACT MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_MAT, 4000, DecorDesc_ATTRACT_MAT, DecorGfx_ATTRACT_MAT}, + {DECOR_FISSURE_MAT, _("FISSURE MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_MAT, 4000, DecorDesc_FISSURE_MAT, DecorGfx_FISSURE_MAT}, + {DECOR_SPIKES_MAT, _("SPIKES MAT"), DECORPERM_PASS_FLOOR, DECORSHAPE_3x3, DECORCAT_MAT, 4000, DecorDesc_SPIKES_MAT, DecorGfx_SPIKES_MAT}, + {DECOR_BALL_POSTER, _("BALL POSTER"), DECORPERM_NA_WALL, DECORSHAPE_1x1, DECORCAT_POSTER, 1000, DecorDesc_BALL_POSTER, DecorGfx_BALL_POSTER}, + {DECOR_GREEN_POSTER, _("GREEN POSTER"), DECORPERM_NA_WALL, DECORSHAPE_1x1, DECORCAT_POSTER, 1000, DecorDesc_GREEN_POSTER, DecorGfx_GREEN_POSTER}, + {DECOR_RED_POSTER, _("RED POSTER"), DECORPERM_NA_WALL, DECORSHAPE_1x1, DECORCAT_POSTER, 1000, DecorDesc_RED_POSTER, DecorGfx_RED_POSTER}, + {DECOR_BLUE_POSTER, _("BLUE POSTER"), DECORPERM_NA_WALL, DECORSHAPE_1x1, DECORCAT_POSTER, 1000, DecorDesc_BLUE_POSTER, DecorGfx_BLUE_POSTER}, + {DECOR_CUTE_POSTER, _("CUTE POSTER"), DECORPERM_NA_WALL, DECORSHAPE_1x1, DECORCAT_POSTER, 1000, DecorDesc_CUTE_POSTER, DecorGfx_CUTE_POSTER}, + {DECOR_PIKA_POSTER, _("PIKA POSTER"), DECORPERM_NA_WALL, DECORSHAPE_2x1, DECORCAT_POSTER, 1500, DecorDesc_PIKA_POSTER, DecorGfx_PIKA_POSTER}, + {DECOR_LONG_POSTER, _("LONG POSTER"), DECORPERM_NA_WALL, DECORSHAPE_2x1, DECORCAT_POSTER, 1500, DecorDesc_LONG_POSTER, DecorGfx_LONG_POSTER}, + {DECOR_SEA_POSTER, _("SEA POSTER"), DECORPERM_NA_WALL, DECORSHAPE_2x1, DECORCAT_POSTER, 1500, DecorDesc_SEA_POSTER, DecorGfx_SEA_POSTER}, + {DECOR_SKY_POSTER, _("SKY POSTER"), DECORPERM_NA_WALL, DECORSHAPE_2x1, DECORCAT_POSTER, 1500, DecorDesc_SKY_POSTER, DecorGfx_SKY_POSTER}, + {DECOR_KISS_POSTER, _("KISS POSTER"), DECORPERM_NA_WALL, DECORSHAPE_2x1, DECORCAT_POSTER, 1500, DecorDesc_KISS_POSTER, DecorGfx_KISS_POSTER}, + {DECOR_PICHU_DOLL, _("PICHU DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_PICHU_DOLL, DecorGfx_PICHU_DOLL}, + {DECOR_PIKACHU_DOLL, _("PIKACHU DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_PIKACHU_DOLL, DecorGfx_PIKACHU_DOLL}, + {DECOR_MARILL_DOLL, _("MARILL DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_MARILL_DOLL, DecorGfx_MARILL_DOLL}, + {DECOR_TOGEPI_DOLL, _("TOGEPI DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_TOGEPI_DOLL, DecorGfx_TOGEPI_DOLL}, + {DECOR_CYNDAQUIL_DOLL, _("CYNDAQUIL DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_CYNDAQUIL_DOLL, DecorGfx_CYNDAQUIL_DOLL}, + {DECOR_CHIKORITA_DOLL, _("CHIKORITA DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_CHIKORITA_DOLL, DecorGfx_CHIKORITA_DOLL}, + {DECOR_TOTODILE_DOLL, _("TOTODILE DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_TOTODILE_DOLL, DecorGfx_TOTODILE_DOLL}, + {DECOR_JIGGLYPUFF_DOLL, _("JIGGLYPUFF DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_JIGGLYPUFF_DOLL, DecorGfx_JIGGLYPUFF_DOLL}, + {DECOR_MEOWTH_DOLL, _("MEOWTH DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_MEOWTH_DOLL, DecorGfx_MEOWTH_DOLL}, + {DECOR_CLEFAIRY_DOLL, _("CLEFAIRY DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_CLEFAIRY_DOLL, DecorGfx_CLEFAIRY_DOLL}, + {DECOR_DITTO_DOLL, _("DITTO DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_DITTO_DOLL, DecorGfx_DITTO_DOLL}, + {DECOR_SMOOCHUM_DOLL, _("SMOOCHUM DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_SMOOCHUM_DOLL, DecorGfx_SMOOCHUM_DOLL}, + {DECOR_TREECKO_DOLL, _("TREECKO DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_TREECKO_DOLL, DecorGfx_TREECKO_DOLL}, + {DECOR_TORCHIC_DOLL, _("TORCHIC DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_TORCHIC_DOLL, DecorGfx_TORCHIC_DOLL}, + {DECOR_MUDKIP_DOLL, _("MUDKIP DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_MUDKIP_DOLL, DecorGfx_MUDKIP_DOLL}, + {DECOR_DUSKULL_DOLL, _("DUSKULL DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_DUSKULL_DOLL, DecorGfx_DUSKULL_DOLL}, + {DECOR_WYNAUT_DOLL, _("WYNAUT DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_WYNAUT_DOLL, DecorGfx_WYNAUT_DOLL}, + {DECOR_BALTOY_DOLL, _("BALTOY DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_BALTOY_DOLL, DecorGfx_BALTOY_DOLL}, + {DECOR_KECLEON_DOLL, _("KECLEON DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_KECLEON_DOLL, DecorGfx_KECLEON_DOLL}, + {DECOR_AZURILL_DOLL, _("AZURILL DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_AZURILL_DOLL, DecorGfx_AZURILL_DOLL}, + {DECOR_SKITTY_DOLL, _("SKITTY DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_SKITTY_DOLL, DecorGfx_SKITTY_DOLL}, + {DECOR_SWABLU_DOLL, _("SWABLU DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_SWABLU_DOLL, DecorGfx_SWABLU_DOLL}, + {DECOR_GULPIN_DOLL, _("GULPIN DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_GULPIN_DOLL, DecorGfx_GULPIN_DOLL}, + {DECOR_LOTAD_DOLL, _("LOTAD DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_LOTAD_DOLL, DecorGfx_LOTAD_DOLL}, + {DECOR_SEEDOT_DOLL, _("SEEDOT DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_DOLL, 3000, DecorDesc_SEEDOT_DOLL, DecorGfx_SEEDOT_DOLL}, + {DECOR_PIKA_CUSHION, _("PIKA CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_PIKA_CUSHION, DecorGfx_PIKA_CUSHION}, + {DECOR_ROUND_CUSHION, _("ROUND CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_ROUND_CUSHION, DecorGfx_ROUND_CUSHION}, + {DECOR_KISS_CUSHION, _("KISS CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_KISS_CUSHION, DecorGfx_KISS_CUSHION}, + {DECOR_ZIGZAG_CUSHION, _("ZIGZAG CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_ZIGZAG_CUSHION, DecorGfx_ZIGZAG_CUSHION}, + {DECOR_SPIN_CUSHION, _("SPIN CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_SPIN_CUSHION, DecorGfx_SPIN_CUSHION}, + {DECOR_DIAMOND_CUSHION, _("DIAMOND CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_DIAMOND_CUSHION, DecorGfx_DIAMOND_CUSHION}, + {DECOR_BALL_CUSHION, _("BALL CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_BALL_CUSHION, DecorGfx_BALL_CUSHION}, + {DECOR_GRASS_CUSHION, _("GRASS CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_GRASS_CUSHION, DecorGfx_GRASS_CUSHION}, + {DECOR_FIRE_CUSHION, _("FIRE CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_FIRE_CUSHION, DecorGfx_FIRE_CUSHION}, + {DECOR_WATER_CUSHION, _("WATER CUSHION"), DECORPERM_SOLID_MAT, DECORSHAPE_1x1, DECORCAT_CUSHION, 2000, DecorDesc_WATER_CUSHION, DecorGfx_WATER_CUSHION}, + {DECOR_SNORLAX_DOLL, _("SNORLAX DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_SNORLAX_DOLL, DecorGfx_SNORLAX_DOLL}, + {DECOR_RHYDON_DOLL, _("RHYDON DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_RHYDON_DOLL, DecorGfx_RHYDON_DOLL}, + {DECOR_LAPRAS_DOLL, _("LAPRAS DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_LAPRAS_DOLL, DecorGfx_LAPRAS_DOLL}, + {DECOR_VENUSAUR_DOLL, _("VENUSAUR DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_VENUSAUR_DOLL, DecorGfx_VENUSAUR_DOLL}, + {DECOR_CHARIZARD_DOLL, _("CHARIZARD DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_CHARIZARD_DOLL, DecorGfx_CHARIZARD_DOLL}, + {DECOR_BLASTOISE_DOLL, _("BLASTOISE DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_BLASTOISE_DOLL, DecorGfx_BLASTOISE_DOLL}, + {DECOR_WAILMER_DOLL, _("WAILMER DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_WAILMER_DOLL, DecorGfx_WAILMER_DOLL}, + {DECOR_REGIROCK_DOLL, _("REGIROCK DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_REGIROCK_DOLL, DecorGfx_REGIROCK_DOLL}, + {DECOR_REGICE_DOLL, _("REGICE DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_REGICE_DOLL, DecorGfx_REGICE_DOLL}, + {DECOR_REGISTEEL_DOLL, _("REGISTEEL DOLL"), DECORPERM_SOLID_MAT, DECORSHAPE_1x2, DECORCAT_DOLL, 10000, DecorDesc_REGISTEEL_DOLL, DecorGfx_REGISTEEL_DOLL} }; const u8 *const gUnknown_083EC5E4[] = { @@ -1390,10 +1374,10 @@ const u8 *const gUnknown_083EC5E4[] = { }; const struct MenuAction2 gUnknown_083EC604[] = { - MENUACTION2(SecretBaseText_Decorate, sub_80FF160), - MENUACTION2(SecretBaseText_PutAway, sub_8100A0C), - MENUACTION2(SecretBaseText_Toss, sub_8101700), - MENUACTION2(gUnknownText_Exit, gpu_pal_decompress_alloc_tag_and_upload) + {SecretBaseText_Decorate, sub_80FF160}, + {SecretBaseText_PutAway, sub_8100A0C}, + {SecretBaseText_Toss, sub_8101700}, + {gUnknownText_Exit, gpu_pal_decompress_alloc_tag_and_upload} }; const u8 *const gUnknown_083EC624[] = { @@ -1404,10 +1388,10 @@ const u8 *const gUnknown_083EC624[] = { }; const struct MenuAction3 gUnknown_083EC634[] = { - MENUACTION3(sub_80FF5BC, sub_80FF058), - MENUACTION3(sub_81017A0, sub_80FF058), - MENUACTION3(sub_81017A0, sub_80FF058), - MENUACTION3(sub_8109D04, sub_80FF058) + {sub_80FF5BC, sub_80FF058}, + {sub_81017A0, sub_80FF058}, + {sub_81017A0, sub_80FF058}, + {sub_8109D04, sub_80FF058} }; const u16 gUnknown_083EC654[] = {0x6318, 0x739C, 0x7FFF}; @@ -1445,29 +1429,29 @@ const u8 Unknown_3EC824[] = {4, 5, 4, 5, 4, 5, 6, 7, 6, 7, 6, 7, 4, 5, 4, 5, 4, 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[] = { - STRUCT_803EC860(Unknown_3EC660, Unknown_3EC6F0, Unknown_3EC7A8, 0x4), - STRUCT_803EC860(Unknown_3EC68C, Unknown_3EC6F4, Unknown_3EC7AC, 0x8), - STRUCT_803EC860(Unknown_3EC664, Unknown_3EC6FC, Unknown_3EC7B4, 0xc), - STRUCT_803EC860(Unknown_3EC694, Unknown_3EC708, Unknown_3EC7C0, 0x20), - STRUCT_803EC860(Unknown_3EC670, Unknown_3EC728, Unknown_3EC7E0, 0x10), - STRUCT_803EC860(Unknown_3EC68C, Unknown_3EC738, Unknown_3EC7F0, 0x8), - STRUCT_803EC860(Unknown_3EC680, Unknown_3EC740, Unknown_3EC7F8, 0xc), - STRUCT_803EC860(Unknown_3EC694, Unknown_3EC74C, Unknown_3EC804, 0x20), - STRUCT_803EC860(Unknown_3EC6B4, Unknown_3EC76C, Unknown_3EC824, 0x24), - STRUCT_803EC860(Unknown_3EC6D8, Unknown_3EC790, Unknown_3EC848, 0x18) + {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[] = { - DECOSPRITETEMPLATE(0, 1, 0x78, 0x4e), - DECOSPRITETEMPLATE(1, 2, 0x80, 0x4e), - DECOSPRITETEMPLATE(1, 3, 0x90, 0x56), - DECOSPRITETEMPLATE(1, 3, 0x90, 0x46), - DECOSPRITETEMPLATE(0, 2, 0x80, 0x46), - DECOSPRITETEMPLATE(2, 2, 0x78, 0x46), - DECOSPRITETEMPLATE(2, 3, 0x80, 0x56), - DECOSPRITETEMPLATE(2, 3, 0x80, 0x36), - DECOSPRITETEMPLATE(0, 3, 0x90, 0x46), - DECOSPRITETEMPLATE(1, 3, 0x90, 0x46) + {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[] = { diff --git a/src/field_map_obj.c b/src/field_map_obj.c index eaad98cb0..26cd1de02 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -4302,39 +4302,39 @@ __attribute__((naked)) int state_to_direction(u8 a0, u8 a1, u8 a2) { asm(".syntax unified\n\ - push {r4,lr}\n\ - lsls r0, 24\n\ - lsrs r4, r0, 24\n\ - lsls r1, 24\n\ - lsrs r1, 24\n\ - adds r0, r1, 0\n\ - lsls r2, 24\n\ - lsrs r2, 24\n\ - cmp r1, 0\n\ - beq _08060BFC\n\ - cmp r2, 0\n\ - beq _08060BFC\n\ - cmp r1, 0x4\n\ - bhi _08060BFC\n\ - cmp r2, 0x4\n\ - bls _08060C00\n\ + push {r4,lr}\n\ + lsls r0, 24\n\ + lsrs r4, r0, 24\n\ + lsls r1, 24\n\ + lsrs r1, 24\n\ + adds r0, r1, 0\n\ + lsls r2, 24\n\ + lsrs r2, 24\n\ + cmp r1, 0\n\ + beq _08060BFC\n\ + cmp r2, 0\n\ + beq _08060BFC\n\ + cmp r1, 0x4\n\ + bhi _08060BFC\n\ + cmp r2, 0x4\n\ + bls _08060C00\n\ _08060BFC:\n\ - movs r0, 0\n\ - b _08060C12\n\ + movs r0, 0\n\ + b _08060C12\n\ _08060C00:\n\ - adds r1, r2, 0\n\ - bl zffu_offset_calc\n\ - ldr r2, _08060C18 @ =gUnknown_08375767\n\ - lsls r1, r4, 2\n\ - subs r1, 0x5\n\ - adds r0, r1\n\ - adds r0, r2\n\ - ldrb r0, [r0]\n\ + adds r1, r2, 0\n\ + bl zffu_offset_calc\n\ + ldr r2, _08060C18 @ =gUnknown_08375767\n\ + lsls r1, r4, 2\n\ + subs r1, 0x5\n\ + adds r0, r1\n\ + adds r0, r2\n\ + ldrb r0, [r0]\n\ _08060C12:\n\ - pop {r4}\n\ - pop {r1}\n\ - bx r1\n\ - .align 2, 0\n\ + pop {r4}\n\ + pop {r1}\n\ + bx r1\n\ + .align 2, 0\n\ _08060C18: .4byte gUnknown_08375767\n\ .syntax divided\n"); } @@ -6609,121 +6609,121 @@ void sub_80634E8(struct MapObject *mapObject, struct Sprite *sprite) __attribute__((naked)) void sub_80634E8(struct MapObject *mapObject, struct Sprite *sprite) { asm(".syntax unified\n\ - push {r4-r6,lr}\n\ - adds r5, r0, 0\n\ - adds r4, r1, 0\n\ - ldrb r1, [r5, 0x1]\n\ - movs r0, 0x41\n\ - negs r0, r0\n\ - ands r0, r1\n\ - strb r0, [r5, 0x1]\n\ - ldrb r0, [r5, 0x5]\n\ - bl GetFieldObjectGraphicsInfo\n\ - adds r6, r0, 0\n\ - adds r0, r4, 0\n\ - adds r0, 0x3E\n\ - ldrb r1, [r0]\n\ - movs r0, 0x2\n\ - ands r0, r1\n\ - cmp r0, 0\n\ - beq _0806354C\n\ - ldrh r1, [r4, 0x24]\n\ - ldrh r0, [r4, 0x20]\n\ - adds r1, r0\n\ - adds r0, r4, 0\n\ - adds r0, 0x28\n\ - ldrb r0, [r0]\n\ - lsls r0, 24\n\ - asrs r0, 24\n\ - ldr r2, _08063544 @ =gSpriteCoordOffsetX\n\ - adds r0, r1\n\ - ldrh r2, [r2]\n\ - adds r0, r2\n\ - lsls r0, 16\n\ - lsrs r3, r0, 16\n\ - ldrh r1, [r4, 0x26]\n\ - ldrh r0, [r4, 0x22]\n\ - adds r1, r0\n\ - adds r0, r4, 0\n\ - adds r0, 0x29\n\ - ldrb r0, [r0]\n\ - lsls r0, 24\n\ - asrs r0, 24\n\ - ldr r2, _08063548 @ =gSpriteCoordOffsetY\n\ - adds r0, r1\n\ - ldrh r2, [r2]\n\ - adds r0, r2\n\ - b _08063574\n\ - .align 2, 0\n\ + push {r4-r6,lr}\n\ + adds r5, r0, 0\n\ + adds r4, r1, 0\n\ + ldrb r1, [r5, 0x1]\n\ + movs r0, 0x41\n\ + negs r0, r0\n\ + ands r0, r1\n\ + strb r0, [r5, 0x1]\n\ + ldrb r0, [r5, 0x5]\n\ + bl GetFieldObjectGraphicsInfo\n\ + adds r6, r0, 0\n\ + adds r0, r4, 0\n\ + adds r0, 0x3E\n\ + ldrb r1, [r0]\n\ + movs r0, 0x2\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _0806354C\n\ + ldrh r1, [r4, 0x24]\n\ + ldrh r0, [r4, 0x20]\n\ + adds r1, r0\n\ + adds r0, r4, 0\n\ + adds r0, 0x28\n\ + ldrb r0, [r0]\n\ + lsls r0, 24\n\ + asrs r0, 24\n\ + ldr r2, _08063544 @ =gSpriteCoordOffsetX\n\ + adds r0, r1\n\ + ldrh r2, [r2]\n\ + adds r0, r2\n\ + lsls r0, 16\n\ + lsrs r3, r0, 16\n\ + ldrh r1, [r4, 0x26]\n\ + ldrh r0, [r4, 0x22]\n\ + adds r1, r0\n\ + adds r0, r4, 0\n\ + adds r0, 0x29\n\ + ldrb r0, [r0]\n\ + lsls r0, 24\n\ + asrs r0, 24\n\ + ldr r2, _08063548 @ =gSpriteCoordOffsetY\n\ + adds r0, r1\n\ + ldrh r2, [r2]\n\ + adds r0, r2\n\ + b _08063574\n\ + .align 2, 0\n\ _08063544: .4byte gSpriteCoordOffsetX\n\ _08063548: .4byte gSpriteCoordOffsetY\n\ _0806354C:\n\ - ldrh r1, [r4, 0x24]\n\ - ldrh r0, [r4, 0x20]\n\ - adds r1, r0\n\ - adds r0, r4, 0\n\ - adds r0, 0x28\n\ - ldrb r0, [r0]\n\ - lsls r0, 24\n\ - asrs r0, 24\n\ - adds r0, r1\n\ - lsls r0, 16\n\ - lsrs r3, r0, 16\n\ - ldrh r1, [r4, 0x26]\n\ - ldrh r0, [r4, 0x22]\n\ - adds r1, r0\n\ - adds r0, r4, 0\n\ - adds r0, 0x29\n\ - ldrb r0, [r0]\n\ - lsls r0, 24\n\ - asrs r0, 24\n\ - adds r0, r1\n\ + ldrh r1, [r4, 0x24]\n\ + ldrh r0, [r4, 0x20]\n\ + adds r1, r0\n\ + adds r0, r4, 0\n\ + adds r0, 0x28\n\ + ldrb r0, [r0]\n\ + lsls r0, 24\n\ + asrs r0, 24\n\ + adds r0, r1\n\ + lsls r0, 16\n\ + lsrs r3, r0, 16\n\ + ldrh r1, [r4, 0x26]\n\ + ldrh r0, [r4, 0x22]\n\ + adds r1, r0\n\ + adds r0, r4, 0\n\ + adds r0, 0x29\n\ + ldrb r0, [r0]\n\ + lsls r0, 24\n\ + asrs r0, 24\n\ + adds r0, r1\n\ _08063574:\n\ - lsls r0, 16\n\ - lsrs r2, r0, 16\n\ - ldrh r0, [r6, 0x8]\n\ - adds r0, r3\n\ - lsls r0, 16\n\ - lsrs r1, r0, 16\n\ - ldrh r0, [r6, 0xA]\n\ - adds r0, r2\n\ - lsls r0, 16\n\ - lsrs r4, r0, 16\n\ - lsls r0, r3, 16\n\ - asrs r0, 16\n\ - cmp r0, 0xFF\n\ - bgt _0806359C\n\ - lsls r0, r1, 16\n\ - asrs r0, 16\n\ - movs r1, 0x10\n\ - negs r1, r1\n\ - cmp r0, r1\n\ - bge _080635A4\n\ + lsls r0, 16\n\ + lsrs r2, r0, 16\n\ + ldrh r0, [r6, 0x8]\n\ + adds r0, r3\n\ + lsls r0, 16\n\ + lsrs r1, r0, 16\n\ + ldrh r0, [r6, 0xA]\n\ + adds r0, r2\n\ + lsls r0, 16\n\ + lsrs r4, r0, 16\n\ + lsls r0, r3, 16\n\ + asrs r0, 16\n\ + cmp r0, 0xFF\n\ + bgt _0806359C\n\ + lsls r0, r1, 16\n\ + asrs r0, 16\n\ + movs r1, 0x10\n\ + negs r1, r1\n\ + cmp r0, r1\n\ + bge _080635A4\n\ _0806359C:\n\ - ldrb r0, [r5, 0x1]\n\ - movs r1, 0x40\n\ - orrs r0, r1\n\ - strb r0, [r5, 0x1]\n\ + ldrb r0, [r5, 0x1]\n\ + movs r1, 0x40\n\ + orrs r0, r1\n\ + strb r0, [r5, 0x1]\n\ _080635A4:\n\ - lsls r0, r2, 16\n\ - asrs r0, 16\n\ - cmp r0, 0xAF\n\ - bgt _080635B8\n\ - lsls r0, r4, 16\n\ - asrs r0, 16\n\ - movs r1, 0x10\n\ - negs r1, r1\n\ - cmp r0, r1\n\ - bge _080635C0\n\ + lsls r0, r2, 16\n\ + asrs r0, 16\n\ + cmp r0, 0xAF\n\ + bgt _080635B8\n\ + lsls r0, r4, 16\n\ + asrs r0, 16\n\ + movs r1, 0x10\n\ + negs r1, r1\n\ + cmp r0, r1\n\ + bge _080635C0\n\ _080635B8:\n\ - ldrb r0, [r5, 0x1]\n\ - movs r1, 0x40\n\ - orrs r0, r1\n\ - strb r0, [r5, 0x1]\n\ + ldrb r0, [r5, 0x1]\n\ + movs r1, 0x40\n\ + orrs r0, r1\n\ + strb r0, [r5, 0x1]\n\ _080635C0:\n\ - pop {r4-r6}\n\ - pop {r0}\n\ - bx r0\n\ + pop {r4-r6}\n\ + pop {r0}\n\ + bx r0\n\ .syntax divided\n"); } #endif diff --git a/src/secret_base.c b/src/secret_base.c index 4ff0b6b17..aae3853f9 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -392,84 +392,84 @@ void sub_80BBCCC(u8 flagIn) { asm(".syntax unified\n\ push {r4-r7,lr}\n\ - mov r7, r8\n\ - push {r7}\n\ - sub sp, 0x4\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - mov r8, r0\n\ - bl CurrentMapIsSecretBase\n\ - lsls r0, 24\n\ - cmp r0, 0\n\ - beq _080BBDBC\n\ - ldr r0, _080BBD70 @ =0x00004054\n\ - bl VarGet\n\ - lsls r0, 16\n\ - lsrs r5, r0, 16\n\ - movs r1, 0\n\ - mov r0, sp\n\ - strh r1, [r0]\n\ - ldr r6, _080BBD74 @ =gSaveBlock1\n\ - mov r4, sp\n\ - ldr r0, _080BBD78 @ =0x00001a2a\n\ - adds r7, r6, r0\n\ + mov r7, r8\n\ + push {r7}\n\ + sub sp, 0x4\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + mov r8, r0\n\ + bl CurrentMapIsSecretBase\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + beq _080BBDBC\n\ + ldr r0, _080BBD70 @ =0x00004054\n\ + bl VarGet\n\ + lsls r0, 16\n\ + lsrs r5, r0, 16\n\ + movs r1, 0\n\ + mov r0, sp\n\ + strh r1, [r0]\n\ + ldr r6, _080BBD74 @ =gSaveBlock1\n\ + mov r4, sp\n\ + ldr r0, _080BBD78 @ =0x00001a2a\n\ + adds r7, r6, r0\n\ _080BBCFC:\n\ - lsls r0, r5, 2\n\ - adds r0, r5\n\ - lsls r0, 5\n\ - ldrh r1, [r4]\n\ - adds r2, r0, r1\n\ - ldr r1, _080BBD7C @ =0x00001a1a\n\ - adds r0, r6, r1\n\ - adds r1, r2, r0\n\ - ldrb r0, [r1]\n\ - subs r0, 0x1\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - cmp r0, 0x77\n\ - bhi _080BBD3A\n\ - ldr r0, _080BBD80 @ =gDecorations\n\ - ldrb r3, [r1]\n\ - lsls r1, r3, 5\n\ - adds r1, r0\n\ - ldrb r0, [r1, 0x11]\n\ - cmp r0, 0x4\n\ - beq _080BBD3A\n\ - adds r0, r2, r7\n\ - ldrb r2, [r0]\n\ - lsrs r0, r2, 4\n\ - adds r0, 0x7\n\ - movs r1, 0xF\n\ - ands r1, r2\n\ - adds r1, 0x7\n\ - adds r2, r3, 0\n\ - bl sub_80FF394\n\ + lsls r0, r5, 2\n\ + adds r0, r5\n\ + lsls r0, 5\n\ + ldrh r1, [r4]\n\ + adds r2, r0, r1\n\ + ldr r1, _080BBD7C @ =0x00001a1a\n\ + adds r0, r6, r1\n\ + adds r1, r2, r0\n\ + ldrb r0, [r1]\n\ + subs r0, 0x1\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + cmp r0, 0x77\n\ + bhi _080BBD3A\n\ + ldr r0, _080BBD80 @ =gDecorations\n\ + ldrb r3, [r1]\n\ + lsls r1, r3, 5\n\ + adds r1, r0\n\ + ldrb r0, [r1, 0x11]\n\ + cmp r0, 0x4\n\ + beq _080BBD3A\n\ + adds r0, r2, r7\n\ + ldrb r2, [r0]\n\ + lsrs r0, r2, 4\n\ + adds r0, 0x7\n\ + movs r1, 0xF\n\ + ands r1, r2\n\ + adds r1, 0x7\n\ + adds r2, r3, 0\n\ + bl sub_80FF394\n\ _080BBD3A:\n\ - ldrh r0, [r4]\n\ - adds r0, 0x1\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - strh r0, [r4]\n\ - cmp r0, 0xF\n\ - bls _080BBCFC\n\ - cmp r5, 0\n\ - beq _080BBD88\n\ - mov r4, sp\n\ - adds r4, 0x2\n\ - movs r2, 0x88\n\ - lsls r2, 2\n\ - mov r0, sp\n\ - adds r1, r4, 0\n\ - bl sub_80BB764\n\ - mov r0, sp\n\ - ldrh r0, [r0]\n\ - adds r0, 0x7\n\ - ldrh r1, [r4]\n\ - adds r1, 0x7\n\ - ldr r2, _080BBD84 @ =0x00000e21\n\ - bl MapGridSetMetatileIdAt\n\ - b _080BBDBC\n\ - .align 2, 0\n\ + ldrh r0, [r4]\n\ + adds r0, 0x1\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + strh r0, [r4]\n\ + cmp r0, 0xF\n\ + bls _080BBCFC\n\ + cmp r5, 0\n\ + beq _080BBD88\n\ + mov r4, sp\n\ + adds r4, 0x2\n\ + movs r2, 0x88\n\ + lsls r2, 2\n\ + mov r0, sp\n\ + adds r1, r4, 0\n\ + bl sub_80BB764\n\ + mov r0, sp\n\ + ldrh r0, [r0]\n\ + adds r0, 0x7\n\ + ldrh r1, [r4]\n\ + adds r1, 0x7\n\ + ldr r2, _080BBD84 @ =0x00000e21\n\ + bl MapGridSetMetatileIdAt\n\ + b _080BBDBC\n\ + .align 2, 0\n\ _080BBD70: .4byte 0x00004054\n\ _080BBD74: .4byte gSaveBlock1\n\ _080BBD78: .4byte 0x00001a2a\n\ @@ -477,37 +477,37 @@ _080BBD7C: .4byte 0x00001a1a\n\ _080BBD80: .4byte gDecorations\n\ _080BBD84: .4byte 0x00000e21\n\ _080BBD88:\n\ - mov r0, r8\n\ - cmp r0, 0x1\n\ - bne _080BBDBC\n\ - ldr r0, _080BBDC8 @ =0x00004089\n\ - bl VarGet\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - cmp r0, 0x1\n\ - bne _080BBDBC\n\ - mov r4, sp\n\ - adds r4, 0x2\n\ - movs r2, 0x88\n\ - lsls r2, 2\n\ - mov r0, sp\n\ - adds r1, r4, 0\n\ - bl sub_80BB764\n\ - mov r0, sp\n\ - ldrh r0, [r0]\n\ - adds r0, 0x7\n\ - ldrh r1, [r4]\n\ - adds r1, 0x7\n\ - ldr r2, _080BBDCC @ =0x00000e0a\n\ - bl MapGridSetMetatileIdAt\n\ + mov r0, r8\n\ + cmp r0, 0x1\n\ + bne _080BBDBC\n\ + ldr r0, _080BBDC8 @ =0x00004089\n\ + bl VarGet\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + cmp r0, 0x1\n\ + bne _080BBDBC\n\ + mov r4, sp\n\ + adds r4, 0x2\n\ + movs r2, 0x88\n\ + lsls r2, 2\n\ + mov r0, sp\n\ + adds r1, r4, 0\n\ + bl sub_80BB764\n\ + mov r0, sp\n\ + ldrh r0, [r0]\n\ + adds r0, 0x7\n\ + ldrh r1, [r4]\n\ + adds r1, 0x7\n\ + ldr r2, _080BBDCC @ =0x00000e0a\n\ + bl MapGridSetMetatileIdAt\n\ _080BBDBC:\n\ - add sp, 0x4\n\ - pop {r3}\n\ - mov r8, r3\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - .align 2, 0\n\ + add sp, 0x4\n\ + pop {r3}\n\ + mov r8, r3\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .align 2, 0\n\ _080BBDC8: .4byte 0x00004089\n\ _080BBDCC: .4byte 0x00000e0a\n\ .syntax divided\n"); @@ -517,220 +517,220 @@ __attribute__((naked)) void sub_80BBDD0(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, 0x14\n\ - ldr r0, _080BBE00 @ =0x00004054\n\ - bl VarGet\n\ - lsls r0, 16\n\ - lsrs r4, r0, 16\n\ - bl CurrentMapIsSecretBase\n\ - lsls r0, 24\n\ - cmp r0, 0\n\ - bne _080BBE08\n\ - ldr r0, _080BBE04 @ =gSaveBlock1 + 0x2688\n\ - str r0, [sp, 0x4]\n\ - adds r0, 0xC\n\ - str r0, [sp, 0x8]\n\ - movs r1, 0xC\n\ - str r1, [sp, 0xC]\n\ - b _080BBE1E\n\ - .align 2, 0\n\ + push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0x14\n\ + ldr r0, _080BBE00 @ =0x00004054\n\ + bl VarGet\n\ + lsls r0, 16\n\ + lsrs r4, r0, 16\n\ + bl CurrentMapIsSecretBase\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + bne _080BBE08\n\ + ldr r0, _080BBE04 @ =gSaveBlock1 + 0x2688\n\ + str r0, [sp, 0x4]\n\ + adds r0, 0xC\n\ + str r0, [sp, 0x8]\n\ + movs r1, 0xC\n\ + str r1, [sp, 0xC]\n\ + b _080BBE1E\n\ + .align 2, 0\n\ _080BBE00: .4byte 0x00004054\n\ _080BBE04: .4byte gSaveBlock1 + 0x2688\n\ _080BBE08:\n\ - lsls r1, r4, 2\n\ - adds r1, r4\n\ - lsls r1, 5\n\ - ldr r0, _080BBF7C @ =gSaveBlock1 + 0x1A1A\n\ - adds r2, r1, r0\n\ - str r2, [sp, 0x4]\n\ - adds r0, 0x10\n\ - adds r1, r0\n\ - str r1, [sp, 0x8]\n\ - movs r3, 0x10\n\ - str r3, [sp, 0xC]\n\ + lsls r1, r4, 2\n\ + adds r1, r4\n\ + lsls r1, 5\n\ + ldr r0, _080BBF7C @ =gSaveBlock1 + 0x1A1A\n\ + adds r2, r1, r0\n\ + str r2, [sp, 0x4]\n\ + adds r0, 0x10\n\ + adds r1, r0\n\ + str r1, [sp, 0x8]\n\ + movs r3, 0x10\n\ + str r3, [sp, 0xC]\n\ _080BBE1E:\n\ - movs r6, 0\n\ - ldr r4, [sp, 0xC]\n\ - cmp r6, r4\n\ - bcc _080BBE28\n\ - b _080BBF6C\n\ + movs r6, 0\n\ + ldr r4, [sp, 0xC]\n\ + cmp r6, r4\n\ + bcc _080BBE28\n\ + b _080BBF6C\n\ _080BBE28:\n\ - ldr r5, _080BBF80 @ =gSaveBlock1\n\ - mov r10, r5\n\ + ldr r5, _080BBF80 @ =gSaveBlock1\n\ + mov r10, r5\n\ _080BBE2C:\n\ - ldr r1, [sp, 0x4]\n\ - adds r0, r1, r6\n\ - ldrb r1, [r0]\n\ - mov r9, r0\n\ - adds r2, r6, 0x1\n\ - str r2, [sp, 0x10]\n\ - cmp r1, 0\n\ - bne _080BBE3E\n\ - b _080BBF5E\n\ + ldr r1, [sp, 0x4]\n\ + adds r0, r1, r6\n\ + ldrb r1, [r0]\n\ + mov r9, r0\n\ + adds r2, r6, 0x1\n\ + str r2, [sp, 0x10]\n\ + cmp r1, 0\n\ + bne _080BBE3E\n\ + b _080BBF5E\n\ _080BBE3E:\n\ - ldrb r0, [r0]\n\ - lsls r0, 5\n\ - ldr r3, _080BBF84 @ =gDecorations\n\ - adds r0, r3\n\ - ldrb r0, [r0, 0x11]\n\ - cmp r0, 0x4\n\ - beq _080BBE4E\n\ - b _080BBF5E\n\ + ldrb r0, [r0]\n\ + lsls r0, 5\n\ + ldr r3, _080BBF84 @ =gDecorations\n\ + adds r0, r3\n\ + ldrb r0, [r0, 0x11]\n\ + cmp r0, 0x4\n\ + beq _080BBE4E\n\ + b _080BBF5E\n\ _080BBE4E:\n\ - movs r5, 0\n\ - ldr r0, _080BBF88 @ =gMapHeader\n\ - ldr r2, [r0, 0x4]\n\ - ldrb r3, [r2]\n\ - mov r8, r0\n\ - cmp r5, r3\n\ - bcs _080BBE8E\n\ - ldr r0, [r2, 0x4]\n\ - ldrh r1, [r0, 0x14]\n\ - ldr r4, _080BBF8C @ =gSpecialVar_0x8004\n\ - ldrh r0, [r4]\n\ - adds r0, 0xAE\n\ - adds r7, r4, 0\n\ - cmp r1, r0\n\ - beq _080BBE8E\n\ - adds r4, r2, 0\n\ - adds r2, r3, 0\n\ + movs r5, 0\n\ + ldr r0, _080BBF88 @ =gMapHeader\n\ + ldr r2, [r0, 0x4]\n\ + ldrb r3, [r2]\n\ + mov r8, r0\n\ + cmp r5, r3\n\ + bcs _080BBE8E\n\ + ldr r0, [r2, 0x4]\n\ + ldrh r1, [r0, 0x14]\n\ + ldr r4, _080BBF8C @ =gSpecialVar_0x8004\n\ + ldrh r0, [r4]\n\ + adds r0, 0xAE\n\ + adds r7, r4, 0\n\ + cmp r1, r0\n\ + beq _080BBE8E\n\ + adds r4, r2, 0\n\ + adds r2, r3, 0\n\ _080BBE70:\n\ - adds r0, r5, 0x1\n\ - lsls r0, 24\n\ - lsrs r5, r0, 24\n\ - cmp r5, r2\n\ - bcs _080BBE8E\n\ - ldr r1, [r4, 0x4]\n\ - lsls r0, r5, 1\n\ - adds r0, r5\n\ - lsls r0, 3\n\ - adds r0, r1\n\ - ldrh r1, [r0, 0x14]\n\ - ldrh r0, [r7]\n\ - adds r0, 0xAE\n\ - cmp r1, r0\n\ - bne _080BBE70\n\ + adds r0, r5, 0x1\n\ + lsls r0, 24\n\ + lsrs r5, r0, 24\n\ + cmp r5, r2\n\ + bcs _080BBE8E\n\ + ldr r1, [r4, 0x4]\n\ + lsls r0, r5, 1\n\ + adds r0, r5\n\ + lsls r0, 3\n\ + adds r0, r1\n\ + ldrh r1, [r0, 0x14]\n\ + ldrh r0, [r7]\n\ + adds r0, 0xAE\n\ + cmp r1, r0\n\ + bne _080BBE70\n\ _080BBE8E:\n\ - mov r1, r8\n\ - ldr r0, [r1, 0x4]\n\ - ldrb r0, [r0]\n\ - cmp r5, r0\n\ - beq _080BBF5E\n\ - ldr r7, _080BBF90 @ =gSpecialVar_0x8006\n\ - ldr r2, [sp, 0x8]\n\ - adds r1, r2, r6\n\ - ldrb r0, [r1]\n\ - lsrs r0, 4\n\ - strh r0, [r7]\n\ - ldr r6, _080BBF94 @ =gSpecialVar_0x8007\n\ - ldrb r1, [r1]\n\ - movs r0, 0xF\n\ - ands r0, r1\n\ - strh r0, [r6]\n\ - ldrh r0, [r7]\n\ - adds r0, 0x7\n\ - ldrh r1, [r6]\n\ - adds r1, 0x7\n\ - bl MapGridGetMetatileBehaviorAt\n\ - lsls r0, 24\n\ - lsrs r4, r0, 24\n\ - adds r0, r4, 0\n\ - bl sub_80572D8\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - cmp r0, 0x1\n\ - beq _080BBEDA\n\ - adds r0, r4, 0\n\ - bl sub_80572EC\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - cmp r0, 0x1\n\ - bne _080BBF5E\n\ + mov r1, r8\n\ + ldr r0, [r1, 0x4]\n\ + ldrb r0, [r0]\n\ + cmp r5, r0\n\ + beq _080BBF5E\n\ + ldr r7, _080BBF90 @ =gSpecialVar_0x8006\n\ + ldr r2, [sp, 0x8]\n\ + adds r1, r2, r6\n\ + ldrb r0, [r1]\n\ + lsrs r0, 4\n\ + strh r0, [r7]\n\ + ldr r6, _080BBF94 @ =gSpecialVar_0x8007\n\ + ldrb r1, [r1]\n\ + movs r0, 0xF\n\ + ands r0, r1\n\ + strh r0, [r6]\n\ + ldrh r0, [r7]\n\ + adds r0, 0x7\n\ + ldrh r1, [r6]\n\ + adds r1, 0x7\n\ + bl MapGridGetMetatileBehaviorAt\n\ + lsls r0, 24\n\ + lsrs r4, r0, 24\n\ + adds r0, r4, 0\n\ + bl sub_80572D8\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + cmp r0, 0x1\n\ + beq _080BBEDA\n\ + adds r0, r4, 0\n\ + bl sub_80572EC\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + cmp r0, 0x1\n\ + bne _080BBF5E\n\ _080BBEDA:\n\ - mov r3, r8\n\ - ldr r0, [r3, 0x4]\n\ - ldr r1, [r0, 0x4]\n\ - lsls r4, r5, 1\n\ - adds r4, r5\n\ - lsls r4, 3\n\ - adds r1, r4, r1\n\ - ldr r5, _080BBF98 @ =0x00003f20\n\ - adds r0, r5, 0\n\ - ldrb r1, [r1, 0x1]\n\ - adds r0, r1\n\ - ldr r1, _080BBF9C @ =gScriptResult\n\ - strh r0, [r1]\n\ - ldrh r0, [r1]\n\ - mov r2, r9\n\ - ldrb r1, [r2]\n\ - lsls r1, 5\n\ - ldr r3, _080BBFA0 @ =gDecorations + 0x1C\n\ - adds r1, r3\n\ - ldr r1, [r1]\n\ - ldrh r1, [r1]\n\ - bl VarSet\n\ - mov r5, r8\n\ - ldr r0, [r5, 0x4]\n\ - ldr r0, [r0, 0x4]\n\ - adds r4, r0\n\ - ldrb r0, [r4]\n\ - ldr r1, _080BBF9C @ =gScriptResult\n\ - strh r0, [r1]\n\ - ldr r2, _080BBF8C @ =gSpecialVar_0x8004\n\ - ldrh r0, [r2]\n\ - adds r0, 0xAE\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - bl FlagReset\n\ - ldr r3, _080BBF9C @ =gScriptResult\n\ - ldrb r0, [r3]\n\ - mov r4, r10\n\ - ldrb r1, [r4, 0x5]\n\ - ldrb r2, [r4, 0x4]\n\ - bl show_sprite\n\ - ldr r5, _080BBF9C @ =gScriptResult\n\ - ldrb r0, [r5]\n\ - ldrb r1, [r4, 0x5]\n\ - ldrb r2, [r4, 0x4]\n\ - movs r4, 0\n\ - ldrsh r3, [r7, r4]\n\ - movs r5, 0\n\ - ldrsh r4, [r6, r5]\n\ - str r4, [sp]\n\ - bl sub_805C0F8\n\ - ldr r1, _080BBF9C @ =gScriptResult\n\ - ldrb r0, [r1]\n\ - mov r2, r10\n\ - ldrb r1, [r2, 0x5]\n\ - ldrb r2, [r2, 0x4]\n\ - bl sub_805C78C\n\ - ldr r3, _080BBF8C @ =gSpecialVar_0x8004\n\ - ldrh r0, [r3]\n\ - adds r0, 0x1\n\ - strh r0, [r3]\n\ + mov r3, r8\n\ + ldr r0, [r3, 0x4]\n\ + ldr r1, [r0, 0x4]\n\ + lsls r4, r5, 1\n\ + adds r4, r5\n\ + lsls r4, 3\n\ + adds r1, r4, r1\n\ + ldr r5, _080BBF98 @ =0x00003f20\n\ + adds r0, r5, 0\n\ + ldrb r1, [r1, 0x1]\n\ + adds r0, r1\n\ + ldr r1, _080BBF9C @ =gScriptResult\n\ + strh r0, [r1]\n\ + ldrh r0, [r1]\n\ + mov r2, r9\n\ + ldrb r1, [r2]\n\ + lsls r1, 5\n\ + ldr r3, _080BBFA0 @ =gDecorations + 0x1C\n\ + adds r1, r3\n\ + ldr r1, [r1]\n\ + ldrh r1, [r1]\n\ + bl VarSet\n\ + mov r5, r8\n\ + ldr r0, [r5, 0x4]\n\ + ldr r0, [r0, 0x4]\n\ + adds r4, r0\n\ + ldrb r0, [r4]\n\ + ldr r1, _080BBF9C @ =gScriptResult\n\ + strh r0, [r1]\n\ + ldr r2, _080BBF8C @ =gSpecialVar_0x8004\n\ + ldrh r0, [r2]\n\ + adds r0, 0xAE\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + bl FlagReset\n\ + ldr r3, _080BBF9C @ =gScriptResult\n\ + ldrb r0, [r3]\n\ + mov r4, r10\n\ + ldrb r1, [r4, 0x5]\n\ + ldrb r2, [r4, 0x4]\n\ + bl show_sprite\n\ + ldr r5, _080BBF9C @ =gScriptResult\n\ + ldrb r0, [r5]\n\ + ldrb r1, [r4, 0x5]\n\ + ldrb r2, [r4, 0x4]\n\ + movs r4, 0\n\ + ldrsh r3, [r7, r4]\n\ + movs r5, 0\n\ + ldrsh r4, [r6, r5]\n\ + str r4, [sp]\n\ + bl sub_805C0F8\n\ + ldr r1, _080BBF9C @ =gScriptResult\n\ + ldrb r0, [r1]\n\ + mov r2, r10\n\ + ldrb r1, [r2, 0x5]\n\ + ldrb r2, [r2, 0x4]\n\ + bl sub_805C78C\n\ + ldr r3, _080BBF8C @ =gSpecialVar_0x8004\n\ + ldrh r0, [r3]\n\ + adds r0, 0x1\n\ + strh r0, [r3]\n\ _080BBF5E:\n\ - ldr r4, [sp, 0x10]\n\ - lsls r0, r4, 24\n\ - lsrs r6, r0, 24\n\ - ldr r5, [sp, 0xC]\n\ - cmp r6, r5\n\ - bcs _080BBF6C\n\ - b _080BBE2C\n\ + ldr r4, [sp, 0x10]\n\ + lsls r0, r4, 24\n\ + lsrs r6, r0, 24\n\ + ldr r5, [sp, 0xC]\n\ + cmp r6, r5\n\ + bcs _080BBF6C\n\ + b _080BBE2C\n\ _080BBF6C:\n\ - add sp, 0x14\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\ + add sp, 0x14\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\ _080BBF7C: .4byte gSaveBlock1 + 0x1A1A\n\ _080BBF80: .4byte gSaveBlock1\n\ _080BBF84: .4byte gDecorations\n\ @@ -901,148 +901,148 @@ __attribute__((naked)) void sub_80BC300(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, 0xC\n\ - movs r0, 0\n\ - mov r10, r0\n\ - movs r6, 0\n\ - mov r9, r6\n\ + push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0xC\n\ + movs r0, 0\n\ + mov r10, r0\n\ + movs r6, 0\n\ + mov r9, r6\n\ _080BC314:\n\ - movs r4, 0\n\ - lsls r3, r6, 2\n\ - lsls r2, r6, 1\n\ - ldr r7, _080BC424 @ =gPlayerParty\n\ - adds r1, r6, 0x1\n\ - str r1, [sp]\n\ - adds r1, r3, 0\n\ + movs r4, 0\n\ + lsls r3, r6, 2\n\ + lsls r2, r6, 1\n\ + ldr r7, _080BC424 @ =gPlayerParty\n\ + adds r1, r6, 0x1\n\ + str r1, [sp]\n\ + adds r1, r3, 0\n\ _080BC322:\n\ - adds r0, r1, r4\n\ - lsls r0, 1\n\ - ldr r5, _080BC428 @ =gSaveBlock1 + 0x1A54\n\ - adds r0, r5, r0\n\ - mov r5, r9\n\ - strh r5, [r0]\n\ - adds r0, r4, 0x1\n\ - lsls r0, 16\n\ - lsrs r4, r0, 16\n\ - cmp r4, 0x3\n\ - bls _080BC322\n\ - ldr r1, _080BC42C @ =gSaveBlock1 + 0x1A84\n\ - adds r0, r1, r2\n\ - strh r5, [r0]\n\ - ldr r5, _080BC430 @ =gSaveBlock1 + 0x1A90\n\ - adds r0, r5, r2\n\ - mov r1, r9\n\ - strh r1, [r0]\n\ - ldr r2, _080BC434 @ =gSaveBlock1 + 0x1A9C\n\ - adds r0, r2, r6\n\ - mov r5, r9\n\ - strb r5, [r0]\n\ - ldr r1, _080BC438 @ =gSaveBlock1 + 0x1A3C\n\ - adds r0, r1, r3\n\ - mov r2, r9\n\ - str r2, [r0]\n\ - ldr r3, _080BC43C @ =gSaveBlock1 + 0x1AA2\n\ - adds r0, r3, r6\n\ - strb r2, [r0]\n\ - movs r0, 0x64\n\ - adds r5, r6, 0\n\ - muls r5, r0\n\ - adds r4, r5, r7\n\ - adds r0, r4, 0\n\ - movs r1, 0xB\n\ - bl GetMonData\n\ - cmp r0, 0\n\ - beq _080BC408\n\ - adds r0, r4, 0\n\ - movs r1, 0x2D\n\ - bl GetMonData\n\ - cmp r0, 0\n\ - bne _080BC408\n\ - movs r4, 0\n\ - mov r0, r10\n\ - lsls r0, 2\n\ - mov r8, r0\n\ - mov r1, r10\n\ - lsls r7, r1, 1\n\ - adds r1, 0x1\n\ - str r1, [sp, 0x4]\n\ - ldr r2, _080BC424 @ =gPlayerParty\n\ + adds r0, r1, r4\n\ + lsls r0, 1\n\ + ldr r5, _080BC428 @ =gSaveBlock1 + 0x1A54\n\ + adds r0, r5, r0\n\ + mov r5, r9\n\ + strh r5, [r0]\n\ + adds r0, r4, 0x1\n\ + lsls r0, 16\n\ + lsrs r4, r0, 16\n\ + cmp r4, 0x3\n\ + bls _080BC322\n\ + ldr r1, _080BC42C @ =gSaveBlock1 + 0x1A84\n\ + adds r0, r1, r2\n\ + strh r5, [r0]\n\ + ldr r5, _080BC430 @ =gSaveBlock1 + 0x1A90\n\ + adds r0, r5, r2\n\ + mov r1, r9\n\ + strh r1, [r0]\n\ + ldr r2, _080BC434 @ =gSaveBlock1 + 0x1A9C\n\ + adds r0, r2, r6\n\ + mov r5, r9\n\ + strb r5, [r0]\n\ + ldr r1, _080BC438 @ =gSaveBlock1 + 0x1A3C\n\ + adds r0, r1, r3\n\ + mov r2, r9\n\ + str r2, [r0]\n\ + ldr r3, _080BC43C @ =gSaveBlock1 + 0x1AA2\n\ + adds r0, r3, r6\n\ + strb r2, [r0]\n\ + movs r0, 0x64\n\ + adds r5, r6, 0\n\ + muls r5, r0\n\ + adds r4, r5, r7\n\ + adds r0, r4, 0\n\ + movs r1, 0xB\n\ + bl GetMonData\n\ + cmp r0, 0\n\ + beq _080BC408\n\ + adds r0, r4, 0\n\ + movs r1, 0x2D\n\ + bl GetMonData\n\ + cmp r0, 0\n\ + bne _080BC408\n\ + movs r4, 0\n\ + mov r0, r10\n\ + lsls r0, 2\n\ + mov r8, r0\n\ + mov r1, r10\n\ + lsls r7, r1, 1\n\ + adds r1, 0x1\n\ + str r1, [sp, 0x4]\n\ + ldr r2, _080BC424 @ =gPlayerParty\n\ _080BC38E:\n\ - adds r1, r4, 0\n\ - adds r1, 0xD\n\ - adds r0, r5, r2\n\ - str r2, [sp, 0x8]\n\ - bl GetMonData\n\ - mov r3, r8\n\ - adds r1, r3, r4\n\ - lsls r1, 1\n\ - ldr r3, _080BC428 @ =gSaveBlock1 + 0x1A54\n\ - adds r1, r3, r1\n\ - strh r0, [r1]\n\ - adds r0, r4, 0x1\n\ - lsls r0, 16\n\ - lsrs r4, r0, 16\n\ - ldr r2, [sp, 0x8]\n\ - cmp r4, 0x3\n\ - bls _080BC38E\n\ - movs r0, 0x64\n\ - adds r4, r6, 0\n\ - muls r4, r0\n\ - ldr r0, _080BC424 @ =gPlayerParty\n\ - adds r4, r0\n\ - adds r0, r4, 0\n\ - movs r1, 0xB\n\ - bl GetMonData\n\ - ldr r5, _080BC42C @ =gSaveBlock1 + 0x1A84\n\ - adds r1, r5, r7\n\ - strh r0, [r1]\n\ - adds r0, r4, 0\n\ - movs r1, 0xC\n\ - bl GetMonData\n\ - ldr r2, _080BC430 @ =gSaveBlock1 + 0x1A90\n\ - adds r1, r2, r7\n\ - strh r0, [r1]\n\ - adds r0, r4, 0\n\ - movs r1, 0x38\n\ - bl GetMonData\n\ - ldr r1, _080BC434 @ =gSaveBlock1 + 0x1A9C\n\ - add r1, r10\n\ - strb r0, [r1]\n\ - adds r0, r4, 0\n\ - movs r1, 0\n\ - bl GetMonData\n\ - ldr r1, _080BC438 @ =gSaveBlock1 + 0x1A3C\n\ - add r1, r8\n\ - str r0, [r1]\n\ - adds r0, r4, 0\n\ - bl sub_80BC298\n\ - ldr r1, _080BC43C @ =gSaveBlock1 + 0x1AA2\n\ - add r1, r10\n\ - strb r0, [r1]\n\ - ldr r3, [sp, 0x4]\n\ - lsls r0, r3, 16\n\ - lsrs r0, 16\n\ - mov r10, r0\n\ + adds r1, r4, 0\n\ + adds r1, 0xD\n\ + adds r0, r5, r2\n\ + str r2, [sp, 0x8]\n\ + bl GetMonData\n\ + mov r3, r8\n\ + adds r1, r3, r4\n\ + lsls r1, 1\n\ + ldr r3, _080BC428 @ =gSaveBlock1 + 0x1A54\n\ + adds r1, r3, r1\n\ + strh r0, [r1]\n\ + adds r0, r4, 0x1\n\ + lsls r0, 16\n\ + lsrs r4, r0, 16\n\ + ldr r2, [sp, 0x8]\n\ + cmp r4, 0x3\n\ + bls _080BC38E\n\ + movs r0, 0x64\n\ + adds r4, r6, 0\n\ + muls r4, r0\n\ + ldr r0, _080BC424 @ =gPlayerParty\n\ + adds r4, r0\n\ + adds r0, r4, 0\n\ + movs r1, 0xB\n\ + bl GetMonData\n\ + ldr r5, _080BC42C @ =gSaveBlock1 + 0x1A84\n\ + adds r1, r5, r7\n\ + strh r0, [r1]\n\ + adds r0, r4, 0\n\ + movs r1, 0xC\n\ + bl GetMonData\n\ + ldr r2, _080BC430 @ =gSaveBlock1 + 0x1A90\n\ + adds r1, r2, r7\n\ + strh r0, [r1]\n\ + adds r0, r4, 0\n\ + movs r1, 0x38\n\ + bl GetMonData\n\ + ldr r1, _080BC434 @ =gSaveBlock1 + 0x1A9C\n\ + add r1, r10\n\ + strb r0, [r1]\n\ + adds r0, r4, 0\n\ + movs r1, 0\n\ + bl GetMonData\n\ + ldr r1, _080BC438 @ =gSaveBlock1 + 0x1A3C\n\ + add r1, r8\n\ + str r0, [r1]\n\ + adds r0, r4, 0\n\ + bl sub_80BC298\n\ + ldr r1, _080BC43C @ =gSaveBlock1 + 0x1AA2\n\ + add r1, r10\n\ + strb r0, [r1]\n\ + ldr r3, [sp, 0x4]\n\ + lsls r0, r3, 16\n\ + lsrs r0, 16\n\ + mov r10, r0\n\ _080BC408:\n\ - ldr r5, [sp]\n\ - lsls r0, r5, 16\n\ - lsrs r6, r0, 16\n\ - cmp r6, 0x5\n\ - bls _080BC314\n\ - add sp, 0xC\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\ + ldr r5, [sp]\n\ + lsls r0, r5, 16\n\ + lsrs r6, r0, 16\n\ + cmp r6, 0x5\n\ + bls _080BC314\n\ + add sp, 0xC\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\ _080BC424: .4byte gPlayerParty\n\ _080BC428: .4byte gSaveBlock1 + 0x1A54\n\ _080BC42C: .4byte gSaveBlock1 + 0x1A84\n\ diff --git a/src/tv.c b/src/tv.c index 566d547a6..e1bf7c8fe 100644 --- a/src/tv.c +++ b/src/tv.c @@ -182,100 +182,100 @@ __attribute__((naked)) u8 special_0x44(void) { asm(".syntax unified\n" - " push {r4-r7,lr}\n" - " mov r7, r9\n" - " mov r6, r8\n" - " push {r6,r7}\n" - " movs r4, 0x5\n" - " ldr r1, _080BD874 @ =gSaveBlock1\n" - " ldr r2, _080BD878 @ =0x000027ec\n" - " adds r0, r1, r2\n" - " ldrb r0, [r0]\n" - " cmp r0, 0\n" - " beq _080BD834\n" - " adds r2, r1, 0\n" - " ldr r1, _080BD87C @ =0x00002738\n" + " push {r4-r7,lr}\n" + " mov r7, r9\n" + " mov r6, r8\n" + " push {r6,r7}\n" + " movs r4, 0x5\n" + " ldr r1, _080BD874 @ =gSaveBlock1\n" + " ldr r2, _080BD878 @ =0x000027ec\n" + " adds r0, r1, r2\n" + " ldrb r0, [r0]\n" + " cmp r0, 0\n" + " beq _080BD834\n" + " adds r2, r1, 0\n" + " ldr r1, _080BD87C @ =0x00002738\n" "_080BD81A:\n" - " adds r0, r4, 0x1\n" - " lsls r0, 24\n" - " lsrs r4, r0, 24\n" - " cmp r4, 0x17\n" - " bhi _080BD834\n" - " lsls r0, r4, 3\n" - " adds r0, r4\n" - " lsls r0, 2\n" - " adds r0, r2\n" - " adds r0, r1\n" - " ldrb r0, [r0]\n" - " cmp r0, 0\n" - " bne _080BD81A\n" + " adds r0, r4, 0x1\n" + " lsls r0, 24\n" + " lsrs r4, r0, 24\n" + " cmp r4, 0x17\n" + " bhi _080BD834\n" + " lsls r0, r4, 3\n" + " adds r0, r4\n" + " lsls r0, 2\n" + " adds r0, r2\n" + " adds r0, r1\n" + " ldrb r0, [r0]\n" + " cmp r0, 0\n" + " bne _080BD81A\n" "_080BD834:\n" - " bl Random\n" - " lsls r0, 16\n" - " lsrs r0, 16\n" - " adds r1, r4, 0\n" - " bl __modsi3\n" - " lsls r0, 24\n" - " lsrs r4, r0, 24\n" - " mov r8, r4\n" - " ldr r7, _080BD874 @ =gSaveBlock1\n" - " ldr r0, _080BD87C @ =0x00002738\n" - " adds r0, r7\n" - " mov r9, r0\n" + " bl Random\n" + " lsls r0, 16\n" + " lsrs r0, 16\n" + " adds r1, r4, 0\n" + " bl __modsi3\n" + " lsls r0, 24\n" + " lsrs r4, r0, 24\n" + " mov r8, r4\n" + " ldr r7, _080BD874 @ =gSaveBlock1\n" + " ldr r0, _080BD87C @ =0x00002738\n" + " adds r0, r7\n" + " mov r9, r0\n" "_080BD850:\n" - " lsls r0, r4, 3\n" - " adds r0, r4\n" - " lsls r6, r0, 2\n" - " adds r5, r6, r7\n" - " ldr r1, _080BD87C @ =0x00002738\n" - " adds r0, r5, r1\n" - " ldrb r0, [r0]\n" - " bl sub_80BFB54\n" - " lsls r0, 24\n" - " lsrs r0, 24\n" - " cmp r0, 0x4\n" - " beq _080BD884\n" - " ldr r2, _080BD880 @ =0x00002739\n" - " adds r0, r5, r2\n" - " ldrb r0, [r0]\n" - " b _080BD890\n" - " .align 2, 0\n" + " lsls r0, r4, 3\n" + " adds r0, r4\n" + " lsls r6, r0, 2\n" + " adds r5, r6, r7\n" + " ldr r1, _080BD87C @ =0x00002738\n" + " adds r0, r5, r1\n" + " ldrb r0, [r0]\n" + " bl sub_80BFB54\n" + " lsls r0, 24\n" + " lsrs r0, 24\n" + " cmp r0, 0x4\n" + " beq _080BD884\n" + " ldr r2, _080BD880 @ =0x00002739\n" + " adds r0, r5, r2\n" + " ldrb r0, [r0]\n" + " b _080BD890\n" + " .align 2, 0\n" "_080BD874: .4byte gSaveBlock1\n" "_080BD878: .4byte 0x000027ec\n" "_080BD87C: .4byte 0x00002738\n" "_080BD880: .4byte 0x00002739\n" "_080BD884:\n" - " mov r0, r9\n" - " adds r1, r6, r0\n" - " ldrh r0, [r1, 0x16]\n" - " cmp r0, 0\n" - " bne _080BD898\n" - " ldrb r0, [r1, 0x1]\n" + " mov r0, r9\n" + " adds r1, r6, r0\n" + " ldrh r0, [r1, 0x16]\n" + " cmp r0, 0\n" + " bne _080BD898\n" + " ldrb r0, [r1, 0x1]\n" "_080BD890:\n" - " cmp r0, 0x1\n" - " bne _080BD898\n" - " adds r0, r4, 0\n" - " b _080BD8AC\n" + " cmp r0, 0x1\n" + " bne _080BD898\n" + " adds r0, r4, 0\n" + " b _080BD8AC\n" "_080BD898:\n" - " cmp r4, 0\n" - " bne _080BD8A0\n" - " movs r4, 0x17\n" - " b _080BD8A6\n" + " cmp r4, 0\n" + " bne _080BD8A0\n" + " movs r4, 0x17\n" + " b _080BD8A6\n" "_080BD8A0:\n" - " subs r0, r4, 0x1\n" - " lsls r0, 24\n" - " lsrs r4, r0, 24\n" + " subs r0, r4, 0x1\n" + " lsls r0, 24\n" + " lsrs r4, r0, 24\n" "_080BD8A6:\n" - " cmp r4, r8\n" - " bne _080BD850\n" - " movs r0, 0xFF\n" + " cmp r4, r8\n" + " bne _080BD850\n" + " movs r0, 0xFF\n" "_080BD8AC:\n" - " pop {r3,r4}\n" - " mov r8, r3\n" - " mov r9, r4\n" - " pop {r4-r7}\n" - " pop {r1}\n" - " bx r1\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"); } #endif @@ -680,88 +680,88 @@ void sub_80BE074(void) { __attribute__((naked)) void sub_80BE074(void) { asm(".syntax unified\n\ - push {r4-r7,lr}\n\ - ldr r0, _080BE118 @ =0x0000ffff\n\ - bl sub_80BF77C\n\ - lsls r0, 24\n\ - cmp r0, 0\n\ - bne _080BE112\n\ - movs r1, 0\n\ - movs r5, 0\n\ - ldr r2, _080BE11C @ =gUnknown_03004316\n\ + push {r4-r7,lr}\n\ + ldr r0, _080BE118 @ =0x0000ffff\n\ + bl sub_80BF77C\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + bne _080BE112\n\ + movs r1, 0\n\ + movs r5, 0\n\ + ldr r2, _080BE11C @ =gUnknown_03004316\n\ _080BE088:\n\ - adds r0, r1, r2\n\ - ldrb r0, [r0]\n\ - adds r0, r5, r0\n\ - lsls r0, 16\n\ - lsrs r5, r0, 16\n\ - adds r0, r1, 0x1\n\ - lsls r0, 24\n\ - lsrs r1, r0, 24\n\ - cmp r1, 0xA\n\ - bls _080BE088\n\ - cmp r5, 0xFF\n\ - bls _080BE0A2\n\ - movs r5, 0xFF\n\ + adds r0, r1, r2\n\ + ldrb r0, [r0]\n\ + adds r0, r5, r0\n\ + lsls r0, 16\n\ + lsrs r5, r0, 16\n\ + adds r0, r1, 0x1\n\ + lsls r0, 24\n\ + lsrs r1, r0, 24\n\ + cmp r1, 0xA\n\ + bls _080BE088\n\ + cmp r5, 0xFF\n\ + bls _080BE0A2\n\ + movs r5, 0xFF\n\ _080BE0A2:\n\ - cmp r5, 0x2\n\ - bls _080BE112\n\ - ldr r7, _080BE120 @ =gUnknown_02024D26\n\ - ldrb r0, [r7]\n\ - cmp r0, 0x1\n\ - bne _080BE112\n\ - ldr r6, _080BE124 @ =gSaveBlock1 + 0x2738\n\ - adds r0, r6, 0\n\ - bl sub_80BF74C\n\ - ldr r4, _080BE128 @ =gUnknown_03005D38\n\ - strb r0, [r4]\n\ - lsls r0, 24\n\ - asrs r0, 24\n\ - movs r1, 0x1\n\ - negs r1, r1\n\ - cmp r0, r1\n\ - beq _080BE112\n\ - movs r0, 0x17\n\ - bl sub_80BF1B4\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - cmp r0, 0x1\n\ - beq _080BE112\n\ - movs r0, 0\n\ - ldrsb r0, [r4, r0]\n\ - lsls r4, r0, 3\n\ - adds r4, r0\n\ - lsls r4, 2\n\ - adds r4, r6\n\ + cmp r5, 0x2\n\ + bls _080BE112\n\ + ldr r7, _080BE120 @ =gUnknown_02024D26\n\ + ldrb r0, [r7]\n\ + cmp r0, 0x1\n\ + bne _080BE112\n\ + ldr r6, _080BE124 @ =gSaveBlock1 + 0x2738\n\ + adds r0, r6, 0\n\ + bl sub_80BF74C\n\ + ldr r4, _080BE128 @ =gUnknown_03005D38\n\ + strb r0, [r4]\n\ + lsls r0, 24\n\ + asrs r0, 24\n\ + movs r1, 0x1\n\ + negs r1, r1\n\ + cmp r0, r1\n\ + beq _080BE112\n\ + movs r0, 0x17\n\ + bl sub_80BF1B4\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + cmp r0, 0x1\n\ + beq _080BE112\n\ + movs r0, 0\n\ + ldrsb r0, [r4, r0]\n\ + lsls r4, r0, 3\n\ + adds r4, r0\n\ + lsls r4, 2\n\ + adds r4, r6\n\ @ -- Here the compiler puts the status flag in the wrong register. --\n\ - movs r1, 0\n\ - movs r0, 0x17\n\ - strb r0, [r4]\n\ - strb r1, [r4, 0x1]\n\ - ldr r1, _080BE12C @ =gUnknown_030042E0\n\ - ldrh r0, [r1, 0x6]\n\ - strh r0, [r4, 0xC]\n\ - ldrh r0, [r1, 0x20]\n\ - strh r0, [r4, 0xE]\n\ - strb r5, [r4, 0x10]\n\ - ldrb r0, [r7]\n\ - strb r0, [r4, 0x11]\n\ - ldr r0, _080BE130 @ =gMapHeader\n\ - ldrb r0, [r0, 0x14]\n\ - strb r0, [r4, 0x12]\n\ - adds r0, r4, 0\n\ - adds r0, 0x13\n\ - ldr r1, _080BE134 @ =gSaveBlock2\n\ - bl StringCopy\n\ - adds r0, r4, 0\n\ - bl sub_80BE138\n\ - movs r0, 2 @ GAME_LANGUAGE\n\ - strb r0, [r4, 0x2]\n\ + movs r1, 0\n\ + movs r0, 0x17\n\ + strb r0, [r4]\n\ + strb r1, [r4, 0x1]\n\ + ldr r1, _080BE12C @ =gUnknown_030042E0\n\ + ldrh r0, [r1, 0x6]\n\ + strh r0, [r4, 0xC]\n\ + ldrh r0, [r1, 0x20]\n\ + strh r0, [r4, 0xE]\n\ + strb r5, [r4, 0x10]\n\ + ldrb r0, [r7]\n\ + strb r0, [r4, 0x11]\n\ + ldr r0, _080BE130 @ =gMapHeader\n\ + ldrb r0, [r0, 0x14]\n\ + strb r0, [r4, 0x12]\n\ + adds r0, r4, 0\n\ + adds r0, 0x13\n\ + ldr r1, _080BE134 @ =gSaveBlock2\n\ + bl StringCopy\n\ + adds r0, r4, 0\n\ + bl sub_80BE138\n\ + movs r0, 2 @ GAME_LANGUAGE\n\ + strb r0, [r4, 0x2]\n\ _080BE112:\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - .align 2, 0\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .align 2, 0\n\ _080BE118: .4byte 0x0000ffff\n\ _080BE11C: .4byte gUnknown_03004316\n\ _080BE120: .4byte gUnknown_02024D26\n\ @@ -2033,119 +2033,119 @@ __attribute__((naked)) void GetMomOrDadStringForTVMessage(void) { asm(".syntax unified\n\ - push {r4,lr}\n\ - ldr r1, _080BFC40 @ =gSaveBlock1\n\ - movs r0, 0x4\n\ - ldrsb r0, [r1, r0]\n\ - cmp r0, 0x1\n\ - bne _080BFC6C\n\ - ldr r0, _080BFC44 @ =gSaveBlock2\n\ - ldrb r0, [r0, 0x8]\n\ - cmp r0, 0\n\ - bne _080BFC54\n\ - movs r0, 0x5\n\ - ldrsb r0, [r1, r0]\n\ - cmp r0, 0\n\ - bne _080BFC6C\n\ - ldr r0, _080BFC48 @ =gStringVar1\n\ - ldr r1, _080BFC4C @ =gOtherText_Mom\n\ - bl StringCopy\n\ - ldr r0, _080BFC50 @ =0x00004003\n\ - movs r1, 0x1\n\ - bl VarSet\n\ - b _080BFC6C\n\ - .align 2, 0\n\ + push {r4,lr}\n\ + ldr r1, _080BFC40 @ =gSaveBlock1\n\ + movs r0, 0x4\n\ + ldrsb r0, [r1, r0]\n\ + cmp r0, 0x1\n\ + bne _080BFC6C\n\ + ldr r0, _080BFC44 @ =gSaveBlock2\n\ + ldrb r0, [r0, 0x8]\n\ + cmp r0, 0\n\ + bne _080BFC54\n\ + movs r0, 0x5\n\ + ldrsb r0, [r1, r0]\n\ + cmp r0, 0\n\ + bne _080BFC6C\n\ + ldr r0, _080BFC48 @ =gStringVar1\n\ + ldr r1, _080BFC4C @ =gOtherText_Mom\n\ + bl StringCopy\n\ + ldr r0, _080BFC50 @ =0x00004003\n\ + movs r1, 0x1\n\ + bl VarSet\n\ + b _080BFC6C\n\ + .align 2, 0\n\ _080BFC40: .4byte gSaveBlock1\n\ _080BFC44: .4byte gSaveBlock2\n\ _080BFC48: .4byte gStringVar1\n\ _080BFC4C: .4byte gOtherText_Mom\n\ _080BFC50: .4byte 0x00004003\n\ _080BFC54:\n\ - movs r0, 0x5\n\ - ldrsb r0, [r1, r0]\n\ - cmp r0, 0x2\n\ - bne _080BFC6C\n\ - ldr r0, _080BFCB4 @ =gStringVar1\n\ - ldr r1, _080BFCB8 @ =gOtherText_Mom\n\ - bl StringCopy\n\ - ldr r0, _080BFCBC @ =0x00004003\n\ - movs r1, 0x1\n\ - bl VarSet\n\ + movs r0, 0x5\n\ + ldrsb r0, [r1, r0]\n\ + cmp r0, 0x2\n\ + bne _080BFC6C\n\ + ldr r0, _080BFCB4 @ =gStringVar1\n\ + ldr r1, _080BFCB8 @ =gOtherText_Mom\n\ + bl StringCopy\n\ + ldr r0, _080BFCBC @ =0x00004003\n\ + movs r1, 0x1\n\ + bl VarSet\n\ _080BFC6C:\n\ - ldr r4, _080BFCBC @ =0x00004003\n\ - adds r0, r4, 0\n\ - bl VarGet\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - cmp r0, 0x1\n\ - beq _080BFCAA\n\ - adds r0, r4, 0\n\ - bl VarGet\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - cmp r0, 0x2\n\ - beq _080BFCC0\n\ - adds r0, r4, 0\n\ - bl VarGet\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - cmp r0, 0x2\n\ - bls _080BFCD4\n\ - adds r0, r4, 0\n\ - bl VarGet\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - movs r1, 0x1\n\ - ands r0, r1\n\ - cmp r0, 0\n\ - bne _080BFCC0\n\ + ldr r4, _080BFCBC @ =0x00004003\n\ + adds r0, r4, 0\n\ + bl VarGet\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + cmp r0, 0x1\n\ + beq _080BFCAA\n\ + adds r0, r4, 0\n\ + bl VarGet\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + cmp r0, 0x2\n\ + beq _080BFCC0\n\ + adds r0, r4, 0\n\ + bl VarGet\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + cmp r0, 0x2\n\ + bls _080BFCD4\n\ + adds r0, r4, 0\n\ + bl VarGet\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + movs r1, 0x1\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _080BFCC0\n\ _080BFCAA:\n\ - ldr r0, _080BFCB4 @ =gStringVar1\n\ - ldr r1, _080BFCB8 @ =gOtherText_Mom\n\ - bl StringCopy\n\ - b _080BFD10\n\ - .align 2, 0\n\ + ldr r0, _080BFCB4 @ =gStringVar1\n\ + ldr r1, _080BFCB8 @ =gOtherText_Mom\n\ + bl StringCopy\n\ + b _080BFD10\n\ + .align 2, 0\n\ _080BFCB4: .4byte gStringVar1\n\ _080BFCB8: .4byte gOtherText_Mom\n\ _080BFCBC: .4byte 0x00004003\n\ _080BFCC0:\n\ - ldr r0, _080BFCCC @ =gStringVar1\n\ - ldr r1, _080BFCD0 @ =gOtherText_Dad\n\ - bl StringCopy\n\ - b _080BFD10\n\ - .align 2, 0\n\ + ldr r0, _080BFCCC @ =gStringVar1\n\ + ldr r1, _080BFCD0 @ =gOtherText_Dad\n\ + bl StringCopy\n\ + b _080BFD10\n\ + .align 2, 0\n\ _080BFCCC: .4byte gStringVar1\n\ _080BFCD0: .4byte gOtherText_Dad\n\ _080BFCD4:\n\ - bl Random\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - movs r1, 0x1\n\ - ands r0, r1\n\ - cmp r0, 0\n\ - beq _080BFD00\n\ - ldr r0, _080BFCF8 @ =gStringVar1\n\ - ldr r1, _080BFCFC @ =gOtherText_Mom\n\ - bl StringCopy\n\ - adds r0, r4, 0\n\ - movs r1, 0x1\n\ - bl VarSet\n\ - b _080BFD10\n\ - .align 2, 0\n\ + bl Random\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + movs r1, 0x1\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080BFD00\n\ + ldr r0, _080BFCF8 @ =gStringVar1\n\ + ldr r1, _080BFCFC @ =gOtherText_Mom\n\ + bl StringCopy\n\ + adds r0, r4, 0\n\ + movs r1, 0x1\n\ + bl VarSet\n\ + b _080BFD10\n\ + .align 2, 0\n\ _080BFCF8: .4byte gStringVar1\n\ _080BFCFC: .4byte gOtherText_Mom\n\ _080BFD00:\n\ - ldr r0, _080BFD18 @ =gStringVar1\n\ - ldr r1, _080BFD1C @ =gOtherText_Dad\n\ - bl StringCopy\n\ - adds r0, r4, 0\n\ - movs r1, 0x2\n\ - bl VarSet\n\ + ldr r0, _080BFD18 @ =gStringVar1\n\ + ldr r1, _080BFD1C @ =gOtherText_Dad\n\ + bl StringCopy\n\ + adds r0, r4, 0\n\ + movs r1, 0x2\n\ + bl VarSet\n\ _080BFD10:\n\ - pop {r4}\n\ - pop {r0}\n\ - bx r0\n\ - .align 2, 0\n\ + pop {r4}\n\ + pop {r0}\n\ + bx r0\n\ + .align 2, 0\n\ _080BFD18: .4byte gStringVar1\n\ _080BFD1C: .4byte gOtherText_Dad\n\ .syntax divided\n"); @@ -2276,119 +2276,119 @@ bool8 sub_80BFF68(TVShow * arg1[25], TVShow * arg2[25], u8 idx) { __attribute__((naked)) bool8 sub_80BFF68(TVShow * arg1[25], TVShow * arg2[25], u8 idx) { asm(".syntax unified\n\ - push {r4-r7,lr}\n\ - sub sp, 0x4\n\ - lsls r2, 24\n\ - lsrs r7, r2, 24\n\ - ldr r4, [r0]\n\ - ldr r6, [r1]\n\ - movs r5, 0\n\ - ldr r2, _080BFFA4 @ =gUnknown_03000722\n\ - movs r1, 0\n\ - ldrsb r1, [r2, r1]\n\ - lsls r0, r1, 3\n\ - adds r0, r1\n\ - lsls r0, 2\n\ - adds r0, r6 @ this is the only mimsmatch\n\ - ldrb r0, [r0]\n\ - str r2, [sp]\n\ - bl sub_80BFB54\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - adds r1, r0, 0\n\ - ldr r2, [sp]\n\ - cmp r0, 0x3\n\ - beq _080BFFD8\n\ - cmp r0, 0x3\n\ - bgt _080BFFA8\n\ - cmp r0, 0x2\n\ - beq _080BFFAE\n\ - b _080C0026\n\ - .align 2, 0\n\ + push {r4-r7,lr}\n\ + sub sp, 0x4\n\ + lsls r2, 24\n\ + lsrs r7, r2, 24\n\ + ldr r4, [r0]\n\ + ldr r6, [r1]\n\ + movs r5, 0\n\ + ldr r2, _080BFFA4 @ =gUnknown_03000722\n\ + movs r1, 0\n\ + ldrsb r1, [r2, r1]\n\ + lsls r0, r1, 3\n\ + adds r0, r1\n\ + lsls r0, 2\n\ + adds r0, r6 @ this is the only mimsmatch\n\ + ldrb r0, [r0]\n\ + str r2, [sp]\n\ + bl sub_80BFB54\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + adds r1, r0, 0\n\ + ldr r2, [sp]\n\ + cmp r0, 0x3\n\ + beq _080BFFD8\n\ + cmp r0, 0x3\n\ + bgt _080BFFA8\n\ + cmp r0, 0x2\n\ + beq _080BFFAE\n\ + b _080C0026\n\ + .align 2, 0\n\ _080BFFA4: .4byte gUnknown_03000722\n\ _080BFFA8:\n\ - cmp r1, 0x4\n\ - beq _080C0000\n\ - b _080C0026\n\ + cmp r1, 0x4\n\ + beq _080C0000\n\ + b _080C0026\n\ _080BFFAE:\n\ - ldr r0, _080BFFD4 @ =gUnknown_03005D38\n\ - movs r1, 0\n\ - ldrsb r1, [r0, r1]\n\ - lsls r0, r1, 3\n\ - adds r0, r1\n\ - lsls r0, 2\n\ - adds r0, r4, r0\n\ - ldrb r2, [r2]\n\ - lsls r2, 24\n\ - asrs r2, 24\n\ - lsls r1, r2, 3\n\ - adds r1, r2\n\ - lsls r1, 2\n\ - adds r1, r6, r1\n\ - adds r2, r7, 0\n\ - bl sub_80C004C\n\ - b _080C0022\n\ - .align 2, 0\n\ + ldr r0, _080BFFD4 @ =gUnknown_03005D38\n\ + movs r1, 0\n\ + ldrsb r1, [r0, r1]\n\ + lsls r0, r1, 3\n\ + adds r0, r1\n\ + lsls r0, 2\n\ + adds r0, r4, r0\n\ + ldrb r2, [r2]\n\ + lsls r2, 24\n\ + asrs r2, 24\n\ + lsls r1, r2, 3\n\ + adds r1, r2\n\ + lsls r1, 2\n\ + adds r1, r6, r1\n\ + adds r2, r7, 0\n\ + bl sub_80C004C\n\ + b _080C0022\n\ + .align 2, 0\n\ _080BFFD4: .4byte gUnknown_03005D38\n\ _080BFFD8:\n\ - ldr r0, _080BFFFC @ =gUnknown_03005D38\n\ - movs r1, 0\n\ - ldrsb r1, [r0, r1]\n\ - lsls r0, r1, 3\n\ - adds r0, r1\n\ - lsls r0, 2\n\ - adds r0, r4, r0\n\ - ldrb r2, [r2]\n\ - lsls r2, 24\n\ - asrs r2, 24\n\ - lsls r1, r2, 3\n\ - adds r1, r2\n\ - lsls r1, 2\n\ - adds r1, r6, r1\n\ - adds r2, r7, 0\n\ - bl sub_80C00B4\n\ - b _080C0022\n\ - .align 2, 0\n\ + ldr r0, _080BFFFC @ =gUnknown_03005D38\n\ + movs r1, 0\n\ + ldrsb r1, [r0, r1]\n\ + lsls r0, r1, 3\n\ + adds r0, r1\n\ + lsls r0, 2\n\ + adds r0, r4, r0\n\ + ldrb r2, [r2]\n\ + lsls r2, 24\n\ + asrs r2, 24\n\ + lsls r1, r2, 3\n\ + adds r1, r2\n\ + lsls r1, 2\n\ + adds r1, r6, r1\n\ + adds r2, r7, 0\n\ + bl sub_80C00B4\n\ + b _080C0022\n\ + .align 2, 0\n\ _080BFFFC: .4byte gUnknown_03005D38\n\ _080C0000:\n\ - ldr r0, _080C0030 @ =gUnknown_03005D38\n\ - movs r1, 0\n\ - ldrsb r1, [r0, r1]\n\ - lsls r0, r1, 3\n\ - adds r0, r1\n\ - lsls r0, 2\n\ - adds r0, r4, r0\n\ - ldrb r2, [r2]\n\ - lsls r2, 24\n\ - asrs r2, 24\n\ - lsls r1, r2, 3\n\ - adds r1, r2\n\ - lsls r1, 2\n\ - adds r1, r6, r1\n\ - adds r2, r7, 0\n\ - bl sub_80C0134\n\ + ldr r0, _080C0030 @ =gUnknown_03005D38\n\ + movs r1, 0\n\ + ldrsb r1, [r0, r1]\n\ + lsls r0, r1, 3\n\ + adds r0, r1\n\ + lsls r0, 2\n\ + adds r0, r4, r0\n\ + ldrb r2, [r2]\n\ + lsls r2, 24\n\ + asrs r2, 24\n\ + lsls r1, r2, 3\n\ + adds r1, r2\n\ + lsls r1, 2\n\ + adds r1, r6, r1\n\ + adds r2, r7, 0\n\ + bl sub_80C0134\n\ _080C0022:\n\ - lsls r0, 24\n\ - lsrs r5, r0, 24\n\ + lsls r0, 24\n\ + lsrs r5, r0, 24\n\ _080C0026:\n\ - cmp r5, 0x1\n\ - beq _080C0034\n\ - movs r0, 0\n\ - b _080C0040\n\ - .align 2, 0\n\ + cmp r5, 0x1\n\ + beq _080C0034\n\ + movs r0, 0\n\ + b _080C0040\n\ + .align 2, 0\n\ _080C0030: .4byte gUnknown_03005D38\n\ _080C0034:\n\ - ldr r0, _080C0048 @ =gUnknown_03000722\n\ - ldrb r1, [r0]\n\ - adds r0, r6, 0\n\ - bl sub_80BF55C\n\ - movs r0, 0x1\n\ + ldr r0, _080C0048 @ =gUnknown_03000722\n\ + ldrb r1, [r0]\n\ + adds r0, r6, 0\n\ + bl sub_80BF55C\n\ + movs r0, 0x1\n\ _080C0040:\n\ - add sp, 0x4\n\ - pop {r4-r7}\n\ - pop {r1}\n\ - bx r1\n\ - .align 2, 0\n\ + add sp, 0x4\n\ + pop {r4-r7}\n\ + pop {r1}\n\ + bx r1\n\ + .align 2, 0\n\ _080C0048: .4byte gUnknown_03000722\n\ .syntax divided\n"); } @@ -2509,206 +2509,206 @@ void sub_80C01D4(void) __attribute__((naked)) void sub_80C01D4(void) { asm(".syntax unified\n\ - push {r4-r6,lr}\n\ - movs r6, 0\n\ + push {r4-r6,lr}\n\ + movs r6, 0\n\ _080C01D8:\n\ - ldr r0, _080C01F8 @ =gSaveBlock1\n\ - lsls r2, r6, 3\n\ - adds r1, r2, r6\n\ - lsls r1, 2\n\ - adds r1, r0\n\ - ldr r0, _080C01FC @ =0x00002738\n\ - adds r1, r0\n\ - ldrb r0, [r1]\n\ - cmp r0, 0x29\n\ - bls _080C01EE\n\ - b _default\n\ + ldr r0, _080C01F8 @ =gSaveBlock1\n\ + lsls r2, r6, 3\n\ + adds r1, r2, r6\n\ + lsls r1, 2\n\ + adds r1, r0\n\ + ldr r0, _080C01FC @ =0x00002738\n\ + adds r1, r0\n\ + ldrb r0, [r1]\n\ + cmp r0, 0x29\n\ + bls _080C01EE\n\ + b _default\n\ _080C01EE:\n\ - lsls r0, 2\n\ - ldr r1, _080C0200 @ =_080C0204\n\ - adds r0, r1\n\ - ldr r0, [r0]\n\ - mov pc, r0\n\ - .align 2, 0\n\ + lsls r0, 2\n\ + ldr r1, _080C0200 @ =_080C0204\n\ + adds r0, r1\n\ + ldr r0, [r0]\n\ + mov pc, r0\n\ + .align 2, 0\n\ _080C01F8: .4byte gSaveBlock1\n\ _080C01FC: .4byte 0x00002738\n\ _080C0200: .4byte _080C0204\n\ - .align 2, 0\n\ + .align 2, 0\n\ _080C0204:\n\ - .4byte _break\n\ - .4byte _fanclubLetter @ TVSHOW_FAN_CLUB_LETTER\n\ - .4byte _break @ TVSHOW_RECENT_HAPPENINGS\n\ - .4byte _fanclubOpinions @ TVSHOW_PKMN_FAN_CLUB_OPINIONS\n\ - .4byte _showtype4 @ TVSHOW_UNKN_SHOWTYPE_04\n\ - .4byte _nameRater @ TVSHOW_NAME_RATER_SHOW\n\ - .4byte _bravoTrainerContest @ TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE\n\ - .4byte _bravoTrainerTower @ TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _pokemonTodayS @ TVSHOW_POKEMON_TODAY_CAUGHT\n\ - .4byte _break @ TVSHOW_SMART_SHOPPER\n\ - .4byte _pokemonTodayF @ TVSHOW_POKEMON_TODAY_FAILED\n\ - .4byte _fishing @ TVSHOW_FISHING_ADVICE\n\ - .4byte _worldOfMasters @ TVSHOW_WORLD_OF_MASTERS\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _default\n\ - .4byte _break @ TVSHOW_MASS_OUTBREAK\n\ + .4byte _break\n\ + .4byte _fanclubLetter @ TVSHOW_FAN_CLUB_LETTER\n\ + .4byte _break @ TVSHOW_RECENT_HAPPENINGS\n\ + .4byte _fanclubOpinions @ TVSHOW_PKMN_FAN_CLUB_OPINIONS\n\ + .4byte _showtype4 @ TVSHOW_UNKN_SHOWTYPE_04\n\ + .4byte _nameRater @ TVSHOW_NAME_RATER_SHOW\n\ + .4byte _bravoTrainerContest @ TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE\n\ + .4byte _bravoTrainerTower @ TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _pokemonTodayS @ TVSHOW_POKEMON_TODAY_CAUGHT\n\ + .4byte _break @ TVSHOW_SMART_SHOPPER\n\ + .4byte _pokemonTodayF @ TVSHOW_POKEMON_TODAY_FAILED\n\ + .4byte _fishing @ TVSHOW_FISHING_ADVICE\n\ + .4byte _worldOfMasters @ TVSHOW_WORLD_OF_MASTERS\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _default\n\ + .4byte _break @ TVSHOW_MASS_OUTBREAK\n\ _fanclubLetter:\n\ - adds r0, r2, r6\n\ - lsls r0, 2\n\ - ldr r1, _080C02B8 @ =gSaveBlock1 + 0x2738\n\ - adds r0, r1\n\ - ldrh r0, [r0, 0x2]\n\ - b _checkSpecies1 @ sub_80C03C8(r0, i)\n\ - .align 2, 0\n\ + adds r0, r2, r6\n\ + lsls r0, 2\n\ + ldr r1, _080C02B8 @ =gSaveBlock1 + 0x2738\n\ + adds r0, r1\n\ + ldrh r0, [r0, 0x2]\n\ + b _checkSpecies1 @ sub_80C03C8(r0, i)\n\ + .align 2, 0\n\ _080C02B8: .4byte gSaveBlock1 + 0x2738\n\ _fanclubOpinions:\n\ - adds r0, r2, r6\n\ - lsls r0, 2\n\ - ldr r1, _080C02C8 @ =gSaveBlock1 + 0x2738\n\ - adds r0, r1\n\ - ldrh r0, [r0, 0x2]\n\ - b _checkSpecies1 @ sub_80C03C8(r0, i)\n\ - .align 2, 0\n\ + adds r0, r2, r6\n\ + lsls r0, 2\n\ + ldr r1, _080C02C8 @ =gSaveBlock1 + 0x2738\n\ + adds r0, r1\n\ + ldrh r0, [r0, 0x2]\n\ + b _checkSpecies1 @ sub_80C03C8(r0, i)\n\ + .align 2, 0\n\ _080C02C8: .4byte gSaveBlock1 + 0x2738\n\ _showtype4:\n\ - adds r0, r2, r6\n\ - lsls r0, 2\n\ - ldr r1, _080C02D8 @ =gSaveBlock1 + 0x2738\n\ - adds r0, r1\n\ - ldrh r0, [r0, 0x6]\n\ - b _checkSpecies1 @ sub_80C03C8(r0, i)\n\ - .align 2, 0\n\ + adds r0, r2, r6\n\ + lsls r0, 2\n\ + ldr r1, _080C02D8 @ =gSaveBlock1 + 0x2738\n\ + adds r0, r1\n\ + ldrh r0, [r0, 0x6]\n\ + b _checkSpecies1 @ sub_80C03C8(r0, i)\n\ + .align 2, 0\n\ _080C02D8: .4byte gSaveBlock1 + 0x2738\n\ _nameRater:\n\ - adds r4, r2, r6\n\ - lsls r4, 2\n\ - ldr r0, _080C02F4 @ =gSaveBlock1 + 0x2738\n\ - adds r4, r0\n\ - ldrh r0, [r4, 0x2]\n\ - lsls r5, r6, 24\n\ - lsrs r5, 24\n\ - adds r1, r5, 0\n\ - bl sub_80C03C8\n\ - ldrh r0, [r4, 0x1C]\n\ - b _checkSpecies2 @ sub_80C03C8(r0, i)\n\ - .align 2, 0\n\ + adds r4, r2, r6\n\ + lsls r4, 2\n\ + ldr r0, _080C02F4 @ =gSaveBlock1 + 0x2738\n\ + adds r4, r0\n\ + ldrh r0, [r4, 0x2]\n\ + lsls r5, r6, 24\n\ + lsrs r5, 24\n\ + adds r1, r5, 0\n\ + bl sub_80C03C8\n\ + ldrh r0, [r4, 0x1C]\n\ + b _checkSpecies2 @ sub_80C03C8(r0, i)\n\ + .align 2, 0\n\ _080C02F4: .4byte gSaveBlock1 + 0x2738\n\ _bravoTrainerContest:\n\ - adds r0, r2, r6\n\ - lsls r0, 2\n\ - ldr r1, _080C0304 @ =gSaveBlock1 + 0x2738\n\ - adds r0, r1\n\ - ldrh r0, [r0, 0x2]\n\ - b _checkSpecies1 @ sub_80C03C8(r0, i)\n\ - .align 2, 0\n\ + adds r0, r2, r6\n\ + lsls r0, 2\n\ + ldr r1, _080C0304 @ =gSaveBlock1 + 0x2738\n\ + adds r0, r1\n\ + ldrh r0, [r0, 0x2]\n\ + b _checkSpecies1 @ sub_80C03C8(r0, i)\n\ + .align 2, 0\n\ _080C0304: .4byte gSaveBlock1 + 0x2738\n\ _bravoTrainerTower:\n\ - adds r4, r2, r6\n\ - lsls r4, 2\n\ - ldr r0, _080C0320 @ =gSaveBlock1 + 0x2738\n\ - adds r4, r0\n\ - ldrh r0, [r4, 0xA]\n\ - lsls r5, r6, 24\n\ - lsrs r5, 24\n\ - adds r1, r5, 0\n\ - bl sub_80C03C8\n\ - ldrh r0, [r4, 0x14]\n\ - b _checkSpecies2 @ sub_80C03C8(r0, i)\n\ - .align 2, 0\n\ + adds r4, r2, r6\n\ + lsls r4, 2\n\ + ldr r0, _080C0320 @ =gSaveBlock1 + 0x2738\n\ + adds r4, r0\n\ + ldrh r0, [r4, 0xA]\n\ + lsls r5, r6, 24\n\ + lsrs r5, 24\n\ + adds r1, r5, 0\n\ + bl sub_80C03C8\n\ + ldrh r0, [r4, 0x14]\n\ + b _checkSpecies2 @ sub_80C03C8(r0, i)\n\ + .align 2, 0\n\ _080C0320: .4byte gSaveBlock1 + 0x2738\n\ _pokemonTodayS:\n\ - adds r0, r2, r6\n\ - lsls r0, 2\n\ - ldr r1, _080C0330 @ =gSaveBlock1 + 0x2738\n\ - adds r0, r1\n\ - ldrh r0, [r0, 0x10]\n\ - b _checkSpecies1 @ sub_80C03C8(r0, i)\n\ - .align 2, 0\n\ + adds r0, r2, r6\n\ + lsls r0, 2\n\ + ldr r1, _080C0330 @ =gSaveBlock1 + 0x2738\n\ + adds r0, r1\n\ + ldrh r0, [r0, 0x10]\n\ + b _checkSpecies1 @ sub_80C03C8(r0, i)\n\ + .align 2, 0\n\ _080C0330: .4byte gSaveBlock1 + 0x2738\n\ _pokemonTodayF:\n\ - adds r4, r2, r6\n\ - lsls r4, 2\n\ - ldr r0, _080C034C @ =gSaveBlock1 + 0x2738\n\ - adds r4, r0\n\ - ldrh r0, [r4, 0xC]\n\ - lsls r5, r6, 24\n\ - lsrs r5, 24\n\ - adds r1, r5, 0\n\ - bl sub_80C03C8\n\ - ldrh r0, [r4, 0xE]\n\ - b _checkSpecies2 @ sub_80C03C8(r0, i)\n\ - .align 2, 0\n\ + adds r4, r2, r6\n\ + lsls r4, 2\n\ + ldr r0, _080C034C @ =gSaveBlock1 + 0x2738\n\ + adds r4, r0\n\ + ldrh r0, [r4, 0xC]\n\ + lsls r5, r6, 24\n\ + lsrs r5, 24\n\ + adds r1, r5, 0\n\ + bl sub_80C03C8\n\ + ldrh r0, [r4, 0xE]\n\ + b _checkSpecies2 @ sub_80C03C8(r0, i)\n\ + .align 2, 0\n\ _080C034C: .4byte gSaveBlock1 + 0x2738\n\ _fishing:\n\ - adds r0, r2, r6\n\ - lsls r0, 2\n\ - ldr r1, _080C0364 @ =gSaveBlock1 + 0x2738\n\ - adds r0, r1\n\ - ldrh r0, [r0, 0x4]\n\ + adds r0, r2, r6\n\ + lsls r0, 2\n\ + ldr r1, _080C0364 @ =gSaveBlock1 + 0x2738\n\ + adds r0, r1\n\ + ldrh r0, [r0, 0x4]\n\ _checkSpecies1:\n\ - lsls r1, r6, 24\n\ - lsrs r1, 24\n\ - bl sub_80C03C8\n\ - b _break\n\ - .align 2, 0\n\ + lsls r1, r6, 24\n\ + lsrs r1, 24\n\ + bl sub_80C03C8\n\ + b _break\n\ + .align 2, 0\n\ _080C0364: .4byte gSaveBlock1 + 0x2738\n\ _worldOfMasters:\n\ - adds r4, r2, r6\n\ - lsls r4, 2\n\ - ldr r0, _080C0388 @ =gSaveBlock1 + 0x2738\n\ - adds r4, r0\n\ - ldrh r0, [r4, 0x8]\n\ - lsls r5, r6, 24\n\ - lsrs r5, 24\n\ - adds r1, r5, 0\n\ - bl sub_80C03C8\n\ - ldrh r0, [r4, 0x4]\n\ + adds r4, r2, r6\n\ + lsls r4, 2\n\ + ldr r0, _080C0388 @ =gSaveBlock1 + 0x2738\n\ + adds r4, r0\n\ + ldrh r0, [r4, 0x8]\n\ + lsls r5, r6, 24\n\ + lsrs r5, 24\n\ + adds r1, r5, 0\n\ + bl sub_80C03C8\n\ + ldrh r0, [r4, 0x4]\n\ _checkSpecies2:\n\ - adds r1, r5, 0\n\ - bl sub_80C03C8\n\ - b _break\n\ - .align 2, 0\n\ + adds r1, r5, 0\n\ + bl sub_80C03C8\n\ + b _break\n\ + .align 2, 0\n\ _080C0388: .4byte gSaveBlock1 + 0x2738\n\ _default:\n\ - lsls r0, r6, 24\n\ - lsrs r0, 24\n\ - bl sub_80C03A8\n\ + lsls r0, r6, 24\n\ + lsrs r0, 24\n\ + bl sub_80C03A8\n\ _break:\n\ - adds r0, r6, 0x1\n\ - lsls r0, 16\n\ - lsrs r6, r0, 16\n\ - cmp r6, 0x17\n\ - bhi _080C03A0\n\ - b _080C01D8\n\ + adds r0, r6, 0x1\n\ + lsls r0, 16\n\ + lsrs r6, r0, 16\n\ + cmp r6, 0x17\n\ + bhi _080C03A0\n\ + b _080C01D8\n\ _080C03A0:\n\ - pop {r4-r6}\n\ - pop {r0}\n\ - bx r0\n\ + pop {r4-r6}\n\ + pop {r0}\n\ + bx r0\n\ .syntax divided\n"); } #endif @@ -2738,43 +2738,43 @@ void sub_80C0408(void) { __attribute__((naked)) void sub_80C0408(void) { asm(".syntax unified\n\ - push {r4-r6,lr}\n\ - ldr r0, _080C044C @ =0x00000804\n\ - bl FlagGet\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - cmp r0, 0x1\n\ - beq _080C0444\n\ - movs r2, 0\n\ - ldr r6, _080C0450 @ =gSaveBlock1\n\ - ldr r4, _080C0454 @ =0x00002739\n\ - movs r3, 0\n\ - ldr r5, _080C0458 @ =0x00002738\n\ + push {r4-r6,lr}\n\ + ldr r0, _080C044C @ =0x00000804\n\ + bl FlagGet\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + cmp r0, 0x1\n\ + beq _080C0444\n\ + movs r2, 0\n\ + ldr r6, _080C0450 @ =gSaveBlock1\n\ + ldr r4, _080C0454 @ =0x00002739\n\ + movs r3, 0\n\ + ldr r5, _080C0458 @ =0x00002738\n\ _080C0422:\n\ - lsls r0, r2, 3\n\ - adds r0, r2\n\ - lsls r0, 2\n\ - adds r1, r0, r6\n\ - adds r0, r1, r5\n\ - ldrb r0, [r0]\n\ - cmp r0, 0x7\n\ - beq _080C0436\n\ - cmp r0, 0x29\n\ - bne _080C043A\n\ + lsls r0, r2, 3\n\ + adds r0, r2\n\ + lsls r0, 2\n\ + adds r1, r0, r6\n\ + adds r0, r1, r5\n\ + ldrb r0, [r0]\n\ + cmp r0, 0x7\n\ + beq _080C0436\n\ + cmp r0, 0x29\n\ + bne _080C043A\n\ _080C0436:\n\ - adds r0, r1, r4\n\ - strb r3, [r0]\n\ + adds r0, r1, r4\n\ + strb r3, [r0]\n\ _080C043A:\n\ - adds r0, r2, 0x1\n\ - lsls r0, 16\n\ - lsrs r2, r0, 16\n\ - cmp r2, 0x17\n\ - bls _080C0422\n\ + adds r0, r2, 0x1\n\ + lsls r0, 16\n\ + lsrs r2, r0, 16\n\ + cmp r2, 0x17\n\ + bls _080C0422\n\ _080C0444:\n\ - pop {r4-r6}\n\ - pop {r0}\n\ - bx r0\n\ - .align 2, 0\n\ + pop {r4-r6}\n\ + pop {r0}\n\ + bx r0\n\ + .align 2, 0\n\ _080C044C: .4byte 0x00000804\n\ _080C0450: .4byte gSaveBlock1\n\ _080C0454: .4byte 0x00002739\n\ diff --git a/src/util.c b/src/util.c index 2278c50fe..55608854c 100644 --- a/src/util.c +++ b/src/util.c @@ -6,41 +6,41 @@ extern const u8 gSpriteDimensions[3][4][2]; extern const u16 gCrc16Table[]; u8 CreateInvisibleSpriteWithCallback(void (*callback)(struct Sprite *)) { - u8 sprite = CreateSprite(&gInvisibleSpriteTemplate, 248, 168, 14); - gSprites[sprite].invisible = TRUE; - gSprites[sprite].callback = callback; - return sprite; + u8 sprite = CreateSprite(&gInvisibleSpriteTemplate, 248, 168, 14); + gSprites[sprite].invisible = TRUE; + gSprites[sprite].callback = callback; + return sprite; } void StoreWordInTwoHalfwords(u16 *h, u32 w) { - h[0] = (u16)(w); - h[1] = (u16)(w >> 16); + h[0] = (u16)(w); + h[1] = (u16)(w >> 16); } void LoadWordFromTwoHalfwords(u16 *h, u32 *w) { - *w = h[0] | (s16)h[1] << 16; + *w = h[0] | (s16)h[1] << 16; } void SetBgAffineStruct(struct BgAffineSrcData *src, u32 texX, u32 texY, s16 scrX, s16 scrY, s16 sx, s16 sy, u16 alpha) { - src->texX = texX; - src->texY = texY; - src->scrX = scrX; - src->scrY = scrY; - src->sx = sx; - src->sy = sy; - src->alpha = alpha; + src->texX = texX; + src->texY = texY; + src->scrX = scrX; + src->scrY = scrY; + src->sx = sx; + src->sy = sy; + src->alpha = alpha; } void DoBgAffineSet(struct BgAffineDstData *dest, u32 texX, u32 texY, s16 scrX, s16 scrY, s16 sx, s16 sy, u16 alpha) { - struct BgAffineSrcData src; - SetBgAffineStruct( - &src, - texX, texY, - scrX, scrY, - sx, sy, - alpha - ); - BgAffineSet(&src, dest, 1); + struct BgAffineSrcData src; + SetBgAffineStruct( + &src, + texX, texY, + scrX, scrY, + sx, sy, + alpha + ); + BgAffineSet(&src, dest, 1); } #ifdef NONMATCHING @@ -48,342 +48,342 @@ void DoBgAffineSet(struct BgAffineDstData *dest, u32 texX, u32 texY, s16 scrX, s // Functionally equivalent. // Only the two yflip loops don't match. void CopySpriteTiles(u8 shape, u8 size, u8 *tiles, u16 *tilemap, u8 *output) { - u8 x, y; - s8 i, j; - u8 xflip[32]; - u8 h = gSpriteDimensions[shape][size][1]; - u8 w = gSpriteDimensions[shape][size][0]; - for (y = 0; y < h; y++) { - int filler = 32 - w; - for (x = 0; x < w; x++) { - int tile = (*tilemap & 0x3ff) * 32; - int attr = *tilemap & 0xc00; - if (attr == 0) { - void *src = tiles + tile; - void *dest = output; - int length = 32; - DmaCopy32(3, src, dest, length); - } else if (attr == 0x800) { // yflip - for (i = 0; i < 8; i++) { - void *src = tiles; - void *dest = output; - int length = 4; - // this is likely wrong, but makes it closer to matching - src += tile + (7 - i) * 4; - dest += i * 4; - DmaCopy32(3, src, dest, length); - } - } else { // xflip - for (i = 0; i < 8; i++) { - for (j = 0; j < 4; j++) { - u8 i2 = i * 4; - xflip[i2 + (3-j)] = (tiles[tile + i2 + j] & 0xf) << 4; - xflip[i2 + (3-j)] |= tiles[tile + i2 + j] >> 4; - } - } - if (*tilemap & 0x800) { // yflip - for (i = 0; i < 8; i++) { - void *src = xflip + (7-i) * 4; - void *dest = output + i*4; - int length = 4; - DmaCopy32(3, src, dest, length); - } - } else { - void *src = xflip; - void *dest = output; - int length = 32; - DmaCopy32(3, src, dest, length); - } - } - tilemap++; - output += 32; - } - tilemap += filler; - } + u8 x, y; + s8 i, j; + u8 xflip[32]; + u8 h = gSpriteDimensions[shape][size][1]; + u8 w = gSpriteDimensions[shape][size][0]; + for (y = 0; y < h; y++) { + int filler = 32 - w; + for (x = 0; x < w; x++) { + int tile = (*tilemap & 0x3ff) * 32; + int attr = *tilemap & 0xc00; + if (attr == 0) { + void *src = tiles + tile; + void *dest = output; + int length = 32; + DmaCopy32(3, src, dest, length); + } else if (attr == 0x800) { // yflip + for (i = 0; i < 8; i++) { + void *src = tiles; + void *dest = output; + int length = 4; + // this is likely wrong, but makes it closer to matching + src += tile + (7 - i) * 4; + dest += i * 4; + DmaCopy32(3, src, dest, length); + } + } else { // xflip + for (i = 0; i < 8; i++) { + for (j = 0; j < 4; j++) { + u8 i2 = i * 4; + xflip[i2 + (3-j)] = (tiles[tile + i2 + j] & 0xf) << 4; + xflip[i2 + (3-j)] |= tiles[tile + i2 + j] >> 4; + } + } + if (*tilemap & 0x800) { // yflip + for (i = 0; i < 8; i++) { + void *src = xflip + (7-i) * 4; + void *dest = output + i*4; + int length = 4; + DmaCopy32(3, src, dest, length); + } + } else { + void *src = xflip; + void *dest = output; + int length = 32; + DmaCopy32(3, src, dest, length); + } + } + tilemap++; + output += 32; + } + tilemap += filler; + } } #else __attribute__((naked)) void CopySpriteTiles(u8 shape, u8 size, u8 *tiles, u16 *tilemap, u8 *output) { - asm("\n" - " .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, 0x3C\n" - " str r2, [sp, 0x20]\n" - " adds r4, r3, 0\n" - " ldr r7, [sp, 0x5C]\n" - " lsls r0, 24\n" - " lsls r1, 24\n" - " ldr r2, _08041008 @ =gSpriteDimensions\n" - " lsrs r1, 23\n" - " lsrs r0, 21\n" - " adds r1, r0\n" - " adds r0, r2, 0x1\n" - " adds r0, r1, r0\n" - " ldrb r0, [r0]\n" - " str r0, [sp, 0x24]\n" - " adds r1, r2\n" - " ldrb r1, [r1]\n" - " str r1, [sp, 0x28]\n" - " movs r1, 0\n" - " cmp r1, r0\n" - " bcc _08040FB4\n" - " b _08041136\n" - "_08040FB4:\n" - " movs r0, 0x20\n" - " ldr r2, [sp, 0x28]\n" - " subs r0, r2\n" - " lsls r0, 1\n" - " str r0, [sp, 0x2C]\n" - "_08040FBE:\n" - " movs r2, 0\n" - " adds r1, 0x1\n" - " str r1, [sp, 0x34]\n" - " ldr r3, [sp, 0x28]\n" - " cmp r2, r3\n" - " bcc _08040FCC\n" - " b _08041124\n" - "_08040FCC:\n" - " ldr r0, _0804100C @ =0x040000d4\n" - " mov r8, r0\n" - "_08040FD0:\n" - " ldrh r1, [r4]\n" - " ldr r0, _08041010 @ =0x000003ff\n" - " ands r0, r1\n" - " lsls r0, 5\n" - " mov r12, r0\n" - " movs r0, 0xC0\n" - " lsls r0, 4\n" - " ands r0, r1\n" - " mov r3, sp\n" - " strh r1, [r3, 0x38]\n" - " cmp r0, 0\n" - " bne _08041018\n" - " ldr r0, [sp, 0x20]\n" - " add r0, r12\n" - " mov r1, r8\n" - " str r0, [r1]\n" - " str r7, [r1, 0x4]\n" - " ldr r3, _08041014 @ =0x84000008\n" - " str r3, [r1, 0x8]\n" - " ldr r0, [r1, 0x8]\n" - " adds r4, 0x2\n" - " str r4, [sp, 0x30]\n" - " adds r7, 0x20\n" - " mov r10, r7\n" - " adds r2, 0x1\n" - " mov r9, r2\n" - " b _08041112\n" - " .align 2, 0\n" - "_08041008: .4byte gSpriteDimensions\n" - "_0804100C: .4byte 0x040000d4\n" - "_08041010: .4byte 0x000003ff\n" - "_08041014: .4byte 0x84000008\n" - "_08041018:\n" - " movs r1, 0x80\n" - " lsls r1, 4\n" - " cmp r0, r1\n" - " bne _08041068\n" - " movs r3, 0\n" - " adds r4, 0x2\n" - " str r4, [sp, 0x30]\n" - " movs r0, 0x20\n" - " adds r0, r7\n" - " mov r10, r0\n" - " adds r2, 0x1\n" - " mov r9, r2\n" - " ldr r4, _08041060 @ =0x040000d4\n" - " ldr r6, _08041064 @ =0x84000001\n" - " movs r5, 0x7\n" - "_08041036:\n" - " lsls r2, r3, 24\n" - " asrs r2, 24\n" - " subs r0, r5, r2\n" - " lsls r0, 2\n" - " add r0, r12\n" - " ldr r1, [sp, 0x20]\n" - " adds r0, r1, r0\n" - " lsls r1, r2, 2\n" - " adds r1, r7, r1\n" - " str r0, [r4]\n" - " str r1, [r4, 0x4]\n" - " str r6, [r4, 0x8]\n" - " ldr r0, [r4, 0x8]\n" - " adds r2, 0x1\n" - " lsls r2, 24\n" - " lsrs r3, r2, 24\n" - " asrs r2, 24\n" - " cmp r2, 0x7\n" - " ble _08041036\n" - " b _08041112\n" - " .align 2, 0\n" - "_08041060: .4byte 0x040000d4\n" - "_08041064: .4byte 0x84000001\n" - "_08041068:\n" - " movs r3, 0\n" - " adds r4, 0x2\n" - " str r4, [sp, 0x30]\n" - " movs r0, 0x20\n" - " adds r0, r7\n" - " mov r10, r0\n" - " adds r2, 0x1\n" - " mov r9, r2\n" - "_08041078:\n" - " movs r2, 0\n" - " lsls r4, r3, 24\n" - " lsls r0, r4, 2\n" - " lsrs r0, 24\n" - " adds r6, r0, 0x3\n" - " mov r1, r12\n" - " adds r5, r1, r0\n" - "_08041086:\n" - " lsls r1, r2, 24\n" - " asrs r1, 24\n" - " subs r0, r6, r1\n" - " mov r2, sp\n" - " adds r3, r2, r0\n" - " adds r0, r5, r1\n" - " ldr r2, [sp, 0x20]\n" - " adds r0, r2, r0\n" - " ldrb r2, [r0]\n" - " movs r0, 0xF\n" - " ands r0, r2\n" - " lsls r0, 4\n" - " lsrs r2, 4\n" - " orrs r0, r2\n" - " strb r0, [r3]\n" - " adds r1, 0x1\n" - " lsls r1, 24\n" - " lsrs r2, r1, 24\n" - " asrs r1, 24\n" - " cmp r1, 0x3\n" - " ble _08041086\n" - " movs r3, 0x80\n" - " lsls r3, 17\n" - " adds r0, r4, r3\n" - " lsrs r3, r0, 24\n" - " asrs r0, 24\n" - " cmp r0, 0x7\n" - " ble _08041078\n" - " movs r0, 0x80\n" - " lsls r0, 4\n" - " mov r1, sp\n" - " ldrh r1, [r1, 0x38]\n" - " ands r0, r1\n" - " cmp r0, 0\n" - " beq _08041104\n" - " movs r3, 0\n" - " ldr r4, _080410FC @ =0x040000d4\n" - " ldr r6, _08041100 @ =0x84000001\n" - " movs r5, 0x7\n" - "_080410D4:\n" - " lsls r1, r3, 24\n" - " asrs r1, 24\n" - " subs r0, r5, r1\n" - " lsls r0, 2\n" - " mov r3, sp\n" - " adds r2, r3, r0\n" - " lsls r0, r1, 2\n" - " adds r0, r7, r0\n" - " str r2, [r4]\n" - " str r0, [r4, 0x4]\n" - " str r6, [r4, 0x8]\n" - " ldr r0, [r4, 0x8]\n" - " adds r1, 0x1\n" - " lsls r1, 24\n" - " lsrs r3, r1, 24\n" - " asrs r1, 24\n" - " cmp r1, 0x7\n" - " ble _080410D4\n" - " b _08041112\n" - " .align 2, 0\n" - "_080410FC: .4byte 0x040000d4\n" - "_08041100: .4byte 0x84000001\n" - "_08041104:\n" - " mov r0, sp\n" - " mov r1, r8\n" - " str r0, [r1]\n" - " str r7, [r1, 0x4]\n" - " ldr r2, _08041148 @ =0x84000008\n" - " str r2, [r1, 0x8]\n" - " ldr r0, [r1, 0x8]\n" - "_08041112:\n" - " ldr r4, [sp, 0x30]\n" - " mov r7, r10\n" - " mov r3, r9\n" - " lsls r0, r3, 24\n" - " lsrs r2, r0, 24\n" - " ldr r0, [sp, 0x28]\n" - " cmp r2, r0\n" - " bcs _08041124\n" - " b _08040FD0\n" - "_08041124:\n" - " ldr r1, [sp, 0x2C]\n" - " adds r4, r1\n" - " ldr r2, [sp, 0x34]\n" - " lsls r0, r2, 24\n" - " lsrs r1, r0, 24\n" - " ldr r3, [sp, 0x24]\n" - " cmp r1, r3\n" - " bcs _08041136\n" - " b _08040FBE\n" - "_08041136:\n" - " add sp, 0x3C\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" - "_08041148: .4byte 0x84000008\n" - " .syntax divided\n" - ); + asm("\n" + " .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, 0x3C\n" + " str r2, [sp, 0x20]\n" + " adds r4, r3, 0\n" + " ldr r7, [sp, 0x5C]\n" + " lsls r0, 24\n" + " lsls r1, 24\n" + " ldr r2, _08041008 @ =gSpriteDimensions\n" + " lsrs r1, 23\n" + " lsrs r0, 21\n" + " adds r1, r0\n" + " adds r0, r2, 0x1\n" + " adds r0, r1, r0\n" + " ldrb r0, [r0]\n" + " str r0, [sp, 0x24]\n" + " adds r1, r2\n" + " ldrb r1, [r1]\n" + " str r1, [sp, 0x28]\n" + " movs r1, 0\n" + " cmp r1, r0\n" + " bcc _08040FB4\n" + " b _08041136\n" + "_08040FB4:\n" + " movs r0, 0x20\n" + " ldr r2, [sp, 0x28]\n" + " subs r0, r2\n" + " lsls r0, 1\n" + " str r0, [sp, 0x2C]\n" + "_08040FBE:\n" + " movs r2, 0\n" + " adds r1, 0x1\n" + " str r1, [sp, 0x34]\n" + " ldr r3, [sp, 0x28]\n" + " cmp r2, r3\n" + " bcc _08040FCC\n" + " b _08041124\n" + "_08040FCC:\n" + " ldr r0, _0804100C @ =0x040000d4\n" + " mov r8, r0\n" + "_08040FD0:\n" + " ldrh r1, [r4]\n" + " ldr r0, _08041010 @ =0x000003ff\n" + " ands r0, r1\n" + " lsls r0, 5\n" + " mov r12, r0\n" + " movs r0, 0xC0\n" + " lsls r0, 4\n" + " ands r0, r1\n" + " mov r3, sp\n" + " strh r1, [r3, 0x38]\n" + " cmp r0, 0\n" + " bne _08041018\n" + " ldr r0, [sp, 0x20]\n" + " add r0, r12\n" + " mov r1, r8\n" + " str r0, [r1]\n" + " str r7, [r1, 0x4]\n" + " ldr r3, _08041014 @ =0x84000008\n" + " str r3, [r1, 0x8]\n" + " ldr r0, [r1, 0x8]\n" + " adds r4, 0x2\n" + " str r4, [sp, 0x30]\n" + " adds r7, 0x20\n" + " mov r10, r7\n" + " adds r2, 0x1\n" + " mov r9, r2\n" + " b _08041112\n" + " .align 2, 0\n" + "_08041008: .4byte gSpriteDimensions\n" + "_0804100C: .4byte 0x040000d4\n" + "_08041010: .4byte 0x000003ff\n" + "_08041014: .4byte 0x84000008\n" + "_08041018:\n" + " movs r1, 0x80\n" + " lsls r1, 4\n" + " cmp r0, r1\n" + " bne _08041068\n" + " movs r3, 0\n" + " adds r4, 0x2\n" + " str r4, [sp, 0x30]\n" + " movs r0, 0x20\n" + " adds r0, r7\n" + " mov r10, r0\n" + " adds r2, 0x1\n" + " mov r9, r2\n" + " ldr r4, _08041060 @ =0x040000d4\n" + " ldr r6, _08041064 @ =0x84000001\n" + " movs r5, 0x7\n" + "_08041036:\n" + " lsls r2, r3, 24\n" + " asrs r2, 24\n" + " subs r0, r5, r2\n" + " lsls r0, 2\n" + " add r0, r12\n" + " ldr r1, [sp, 0x20]\n" + " adds r0, r1, r0\n" + " lsls r1, r2, 2\n" + " adds r1, r7, r1\n" + " str r0, [r4]\n" + " str r1, [r4, 0x4]\n" + " str r6, [r4, 0x8]\n" + " ldr r0, [r4, 0x8]\n" + " adds r2, 0x1\n" + " lsls r2, 24\n" + " lsrs r3, r2, 24\n" + " asrs r2, 24\n" + " cmp r2, 0x7\n" + " ble _08041036\n" + " b _08041112\n" + " .align 2, 0\n" + "_08041060: .4byte 0x040000d4\n" + "_08041064: .4byte 0x84000001\n" + "_08041068:\n" + " movs r3, 0\n" + " adds r4, 0x2\n" + " str r4, [sp, 0x30]\n" + " movs r0, 0x20\n" + " adds r0, r7\n" + " mov r10, r0\n" + " adds r2, 0x1\n" + " mov r9, r2\n" + "_08041078:\n" + " movs r2, 0\n" + " lsls r4, r3, 24\n" + " lsls r0, r4, 2\n" + " lsrs r0, 24\n" + " adds r6, r0, 0x3\n" + " mov r1, r12\n" + " adds r5, r1, r0\n" + "_08041086:\n" + " lsls r1, r2, 24\n" + " asrs r1, 24\n" + " subs r0, r6, r1\n" + " mov r2, sp\n" + " adds r3, r2, r0\n" + " adds r0, r5, r1\n" + " ldr r2, [sp, 0x20]\n" + " adds r0, r2, r0\n" + " ldrb r2, [r0]\n" + " movs r0, 0xF\n" + " ands r0, r2\n" + " lsls r0, 4\n" + " lsrs r2, 4\n" + " orrs r0, r2\n" + " strb r0, [r3]\n" + " adds r1, 0x1\n" + " lsls r1, 24\n" + " lsrs r2, r1, 24\n" + " asrs r1, 24\n" + " cmp r1, 0x3\n" + " ble _08041086\n" + " movs r3, 0x80\n" + " lsls r3, 17\n" + " adds r0, r4, r3\n" + " lsrs r3, r0, 24\n" + " asrs r0, 24\n" + " cmp r0, 0x7\n" + " ble _08041078\n" + " movs r0, 0x80\n" + " lsls r0, 4\n" + " mov r1, sp\n" + " ldrh r1, [r1, 0x38]\n" + " ands r0, r1\n" + " cmp r0, 0\n" + " beq _08041104\n" + " movs r3, 0\n" + " ldr r4, _080410FC @ =0x040000d4\n" + " ldr r6, _08041100 @ =0x84000001\n" + " movs r5, 0x7\n" + "_080410D4:\n" + " lsls r1, r3, 24\n" + " asrs r1, 24\n" + " subs r0, r5, r1\n" + " lsls r0, 2\n" + " mov r3, sp\n" + " adds r2, r3, r0\n" + " lsls r0, r1, 2\n" + " adds r0, r7, r0\n" + " str r2, [r4]\n" + " str r0, [r4, 0x4]\n" + " str r6, [r4, 0x8]\n" + " ldr r0, [r4, 0x8]\n" + " adds r1, 0x1\n" + " lsls r1, 24\n" + " lsrs r3, r1, 24\n" + " asrs r1, 24\n" + " cmp r1, 0x7\n" + " ble _080410D4\n" + " b _08041112\n" + " .align 2, 0\n" + "_080410FC: .4byte 0x040000d4\n" + "_08041100: .4byte 0x84000001\n" + "_08041104:\n" + " mov r0, sp\n" + " mov r1, r8\n" + " str r0, [r1]\n" + " str r7, [r1, 0x4]\n" + " ldr r2, _08041148 @ =0x84000008\n" + " str r2, [r1, 0x8]\n" + " ldr r0, [r1, 0x8]\n" + "_08041112:\n" + " ldr r4, [sp, 0x30]\n" + " mov r7, r10\n" + " mov r3, r9\n" + " lsls r0, r3, 24\n" + " lsrs r2, r0, 24\n" + " ldr r0, [sp, 0x28]\n" + " cmp r2, r0\n" + " bcs _08041124\n" + " b _08040FD0\n" + "_08041124:\n" + " ldr r1, [sp, 0x2C]\n" + " adds r4, r1\n" + " ldr r2, [sp, 0x34]\n" + " lsls r0, r2, 24\n" + " lsrs r1, r0, 24\n" + " ldr r3, [sp, 0x24]\n" + " cmp r1, r3\n" + " bcs _08041136\n" + " b _08040FBE\n" + "_08041136:\n" + " add sp, 0x3C\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" + "_08041148: .4byte 0x84000008\n" + " .syntax divided\n" + ); } #endif int CountTrailingZeroBits(u32 value) { - u8 i; - for (i = 0; i < 32; i++) { - if ((value & 1) == 0) { - value >>= 1; - } else { - return i; - } - } - return 0; + u8 i; + for (i = 0; i < 32; i++) { + if ((value & 1) == 0) { + value >>= 1; + } else { + return i; + } + } + return 0; } u16 CalcCRC16(u8 *data, int length) { - u16 i, j; - u16 crc = 0x1121; - for (i = 0; i < length; i++) { - crc ^= data[i]; - for (j = 0; j < 8; j++) { - if (crc & 1) { - crc = (crc >> 1) ^ 0x8408; - } else { - crc >>= 1; - } - } - } - return ~crc; + u16 i, j; + u16 crc = 0x1121; + for (i = 0; i < length; i++) { + crc ^= data[i]; + for (j = 0; j < 8; j++) { + if (crc & 1) { + crc = (crc >> 1) ^ 0x8408; + } else { + crc >>= 1; + } + } + } + return ~crc; } u16 CalcCRC16WithTable(u8 *data, int length) { - u16 i; - u16 crc = 0x1121; - u8 byte; - for (i = 0; i < length; i++) { - byte = crc >> 8; - crc ^= data[i]; - crc = byte ^ gCrc16Table[(u8)crc]; - } - return ~crc; + u16 i; + u16 crc = 0x1121; + u8 byte; + for (i = 0; i < length; i++) { + byte = crc >> 8; + crc ^= data[i]; + crc = byte ^ gCrc16Table[(u8)crc]; + } + return ~crc; } -- cgit v1.2.3 From 75957d8f7347c487662fdf7d63cfb10a8c727249 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 14 Jun 2017 01:03:57 -0500 Subject: decompile sub_8092508 - sub_80927F0 --- src/pokedex.c | 159 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 159 insertions(+) (limited to 'src') diff --git a/src/pokedex.c b/src/pokedex.c index 5738db841..d88252aa8 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -8,6 +8,7 @@ #include "m4a.h" #include "main.h" #include "menu.h" +#include "menu_cursor.h" #include "palette.h" #include "rng.h" #include "songs.h" @@ -55,6 +56,20 @@ struct PokedexEntry /*0x20*/ u16 trainerOffset; }; /*size = 0x24*/ +struct UnknownStruct2 +{ + const u8 *text1; + const u8 *text2; +}; + +struct UnknownStruct1 +{ + const struct UnknownStruct2 *unk0; + u8 unk4; + u8 unk5; + u16 unk6; +}; + extern struct MusicPlayerInfo gMPlay_BGM; extern u8 gReservedSpritePaletteCount; extern struct PokedexView *gPokedexView; @@ -97,6 +112,7 @@ extern const u8 gUnknown_083B5850[][4]; extern const u8 gUnknown_083B586C[][4]; extern const u8 gUnknown_083B5888[][4]; extern const u8 gUnknown_083B58A4[][4]; +extern const struct UnknownStruct1 gUnknown_083B5A7C[]; extern u8 gUnknown_08D00524[]; extern u8 gUnknown_08E96BD4[]; extern u8 gUnknown_08E96ACC[]; @@ -112,6 +128,7 @@ extern const u8 gPokedexMenuSearch_Gfx[]; extern const u8 gUnknown_08E96D2C[]; extern const u16 gPokedexMenuSearch_Pal[]; +extern void sub_814AD7C(u8, u8); extern void sub_800D74C(); extern const u16 *species_and_otid_get_pal(u16, u32, u32); extern void m4aMPlayVolumeControl(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u16 volume); @@ -138,10 +155,14 @@ void sub_80923FC(u8); void sub_80924A4(u8); void sub_8092508(u8); void sub_80925CC(u8); +void sub_8092644(u8); void sub_80927B8(u8); +void sub_80927F0(u8); void sub_8092AB0(u8); void sub_8092AD4(u8, u8); void sub_8092B68(); +void sub_8092C8C(); +void sub_8092D78(); u8 sub_8092E10(); void sub_8092EB0(); void sub_809308C(); @@ -4468,3 +4489,141 @@ void sub_80924A4(u8 taskId) gTasks[taskId].func = sub_8092508; } } + +void sub_8092508(u8 taskId) +{ + if (gMain.newKeys & A_BUTTON) + { + if (gPokedexView->unk60C != 0) + { + gPokedexView->unk64F = 1; + gPokedexView->unk612 = sub_8092E10(taskId, 5); + gPokedexView->unk616 = sub_8092E10(taskId, 4); + gTasks[taskId].func = sub_80927B8; + PlaySE(SE_PC_OFF); + } + else + { + gTasks[taskId].func = sub_809217C; + PlaySE(SE_BOWA); + } + } +} + +void sub_80925B4(u16 a, int unused) +{ + sub_814AD7C(0x90, (a * 2 + 1) * 8); +} + +void sub_80925CC(u8 taskId) +{ + u8 r0; + u16 *p1; + u16 *p2; + + sub_8092C8C(0); + r0 = gTasks[taskId].data[1]; + p1 = &gTasks[taskId].data[gUnknown_083B5A7C[r0].unk4]; + p2 = &gTasks[taskId].data[gUnknown_083B5A7C[r0].unk5]; + gTasks[taskId].data[14] = *p1; + gTasks[taskId].data[15] = *p2; + sub_8092D78(taskId); + CreateBlendedOutlineCursor(16, 0xFFFF, 12, 0x2D9F, 11); + sub_80925B4(*p1, 1); + gTasks[taskId].func = sub_8092644; +} + +void sub_8092644(u8 taskId) +{ + u8 r1; + const struct UnknownStruct2 *r8; + u16 *p1; + u16 *p2; + u16 r2; + bool8 r3; + + r1 = gTasks[taskId].data[1]; + r8 = gUnknown_083B5A7C[r1].unk0; + p1 = &gTasks[taskId].data[gUnknown_083B5A7C[r1].unk4]; + p2 = &gTasks[taskId].data[gUnknown_083B5A7C[r1].unk5]; + r2 = gUnknown_083B5A7C[r1].unk6 - 1; + if (gMain.newKeys & A_BUTTON) + { + sub_814ADC8(); + PlaySE(SE_PIN); + MenuZeroFillWindowRect(18, 1, 28, 12); + sub_8092C8C(1); + gTasks[taskId].func = sub_809217C; + return; + } + if (gMain.newKeys & B_BUTTON) + { + sub_814ADC8(); + PlaySE(SE_BOWA); + MenuZeroFillWindowRect(18, 1, 28, 12); + sub_8092C8C(1); + *p1 = gTasks[taskId].data[14]; + *p2 = gTasks[taskId].data[15]; + gTasks[taskId].func = sub_809217C; + return; + } + r3 = FALSE; + if (gMain.newAndRepeatedKeys & 0x40) + { + if (*p1 != 0) + { + sub_80925B4(*p1, 0); + (*p1)--; + sub_80925B4(*p1, 1); + r3 = TRUE; + } + else if (*p2 != 0) + { + (*p2)--; + sub_8092D78(taskId); + sub_80925B4(*p1, 1); + r3 = TRUE; + } + if (r3) + { + PlaySE(SE_SELECT); + sub_8091E20(r8[*p1 + *p2].text1); + } + return; + } + if (gMain.newAndRepeatedKeys & 0x80) + { + if (*p1 < 5 && *p1 < r2) + { + sub_80925B4(*p1, 0); + (*p1)++; + sub_80925B4(*p1, 1); + r3 = TRUE; + } + else if (r2 > 5 && *p2 < r2 - 5) + { + (*p2)++; + sub_8092D78(taskId); + sub_80925B4(5, 1); + r3 = TRUE; + } + if (r3) + { + PlaySE(SE_SELECT); + sub_8091E20(r8[*p1 + *p2].text1); + } + return; + } +} + +void sub_80927B8(u8 taskId) +{ + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0); + gTasks[taskId].func = sub_80927F0; +} + +void sub_80927F0(u8 taskId) +{ + if (!gPaletteFade.active) + DestroyTask(taskId); +} -- cgit v1.2.3 From b7031c448aa22422a5e409d545c9da12325381cf Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 14 Jun 2017 17:36:31 -0500 Subject: finish decompiling pokedex.s --- src/pokedex.c | 481 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 462 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/pokedex.c b/src/pokedex.c index d88252aa8..d799f6a19 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -70,6 +70,25 @@ struct UnknownStruct1 u16 unk6; }; +struct UnknownStruct3 +{ + const u8 *text; + u8 unk4; + u8 unk5; + u8 unk6; +}; + +struct UnknownStruct4 +{ + const u8 *text; + u8 unk4; + u8 unk5; + u8 unk6; + u8 unk7; + u8 unk8; + u8 unk9; +}; + extern struct MusicPlayerInfo gMPlay_BGM; extern u8 gReservedSpritePaletteCount; extern struct PokedexView *gPokedexView; @@ -86,7 +105,7 @@ extern u8 gUnknown_08E96888[]; extern u8 gUnknown_08E96994[]; extern u8 gUnknown_08E9C6DC[]; extern u8 gUnknown_0839FA7C[]; -extern u8 gUnknown_0839F67C[]; +extern u16 gUnknown_0839F67C[]; extern u8 gUnknown_0839F73C[]; extern u8 gUnknown_0839F8A0[]; extern u8 gUnknown_0839F988[]; @@ -108,11 +127,23 @@ extern void *const gUnknown_083B5584[]; extern struct SpriteFrameImage *const gUnknown_083B5794[]; extern const struct SpriteTemplate gUnknown_083B57A4; extern const u8 gUnknown_083B57BC[][4]; +extern const struct UnknownStruct3 gUnknown_083B57E4[]; +extern const struct UnknownStruct4 gUnknown_083B57FC[]; extern const u8 gUnknown_083B5850[][4]; extern const u8 gUnknown_083B586C[][4]; extern const u8 gUnknown_083B5888[][4]; extern const u8 gUnknown_083B58A4[][4]; +extern const struct UnknownStruct2 gUnknown_083B58C0[]; +extern const struct UnknownStruct2 gUnknown_083B58D8[]; +extern const struct UnknownStruct2 gUnknown_083B5910[]; +extern const struct UnknownStruct2 gUnknown_083B5968[]; +extern const struct UnknownStruct2 gUnknown_083B59C8[]; +extern const u8 gUnknown_083B5A60[]; +extern const u8 gUnknown_083B5A62[]; +extern const u8 gUnknown_083B5A68[]; extern const struct UnknownStruct1 gUnknown_083B5A7C[]; +extern const u8 gUnknown_083B5AAC[]; +extern const u8 gUnknown_083B5AB2[]; extern u8 gUnknown_08D00524[]; extern u8 gUnknown_08E96BD4[]; extern u8 gUnknown_08E96ACC[]; @@ -160,12 +191,12 @@ void sub_80927B8(u8); void sub_80927F0(u8); void sub_8092AB0(u8); void sub_8092AD4(u8, u8); -void sub_8092B68(); -void sub_8092C8C(); -void sub_8092D78(); -u8 sub_8092E10(); -void sub_8092EB0(); -void sub_809308C(); +void sub_8092B68(u8); +void sub_8092C8C(u8); +void sub_8092D78(u8); +u8 sub_8092E10(u8, u8); +void sub_8092EB0(u8); +void sub_809308C(u8); // asm/pokedex_area_screen void ShowPokedexAreaScreen(u16 species, u8 *string); @@ -865,7 +896,7 @@ bool8 sub_808D344(u8 a) void sub_808D640(void) { if (gPokedexView->unk64C_1) - LoadPalette(gUnknown_0839F67C + 0x2, 1, 0xBE); + LoadPalette(gUnknown_0839F67C + 1, 1, 0xBE); else if (!IsNationalPokedexEnabled()) LoadPalette(gPokedexMenu_Pal + 1, 1, 0xBE); else @@ -2692,7 +2723,6 @@ void Task_SizeScreenProcessInput(u8 taskId) gTasks[taskId].func = sub_8090498; PlaySE(SE_PC_OFF); } - //_08090430 else if ((gMain.newKeys & DPAD_LEFT) || ((gMain.newKeys & L_BUTTON) && gSaveBlock2.optionsButtonMode == OPTIONS_BUTTON_MODE_LR)) { @@ -3457,7 +3487,7 @@ _08090A38: .4byte sub_8090A3C\n\ void sub_8090A3C(u8 taskId) { - if (gMain.newKeys & 2) + if (gMain.newKeys & B_BUTTON) { BeginNormalPaletteFade(0x0000FFFC, 0, 0, 16, 0); gSprites[gTasks[taskId].data[3]].callback = sub_8090C28; @@ -3502,7 +3532,7 @@ void sub_8090B8C(u8 taskId) u8 paletteNum; const u16 *palette; - REG_DISPCNT = 0x1940; + REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | DISPCNT_BG3_ON | DISPCNT_OBJ_ON; CpuCopy16(gUnknown_08D00524, (void *)(VRAM + 0xC000), 0x1000); sub_800D74C(); species = NationalPokedexNumToSpecies(gTasks[taskId].data[1]); @@ -4352,13 +4382,13 @@ void sub_809207C(u8 taskId) } return; } - if ((gMain.newKeys & 0x20) && gTasks[taskId].data[0] > 0) + if ((gMain.newKeys & DPAD_LEFT) && gTasks[taskId].data[0] > 0) { PlaySE(SE_Z_PAGE); gTasks[taskId].data[0]--; sub_8092AB0(gTasks[taskId].data[0]); } - if ((gMain.newKeys & 0x10) && gTasks[taskId].data[0] < 2) + if ((gMain.newKeys & DPAD_RIGHT) && gTasks[taskId].data[0] < 2) { PlaySE(SE_Z_PAGE); gTasks[taskId].data[0]++; @@ -4433,25 +4463,25 @@ void sub_80921B0(u8 taskId) return; } - if ((gMain.newKeys & 0x20) && r6[gTasks[taskId].data[1]][0] != 0xFF) + if ((gMain.newKeys & DPAD_LEFT) && r6[gTasks[taskId].data[1]][0] != 0xFF) { PlaySE(SE_SELECT); gTasks[taskId].data[1] = r6[gTasks[taskId].data[1]][0]; sub_8092AD4(gTasks[taskId].data[0], gTasks[taskId].data[1]); } - if ((gMain.newKeys & 0x10) && r6[gTasks[taskId].data[1]][1] != 0xFF) + if ((gMain.newKeys & DPAD_RIGHT) && r6[gTasks[taskId].data[1]][1] != 0xFF) { PlaySE(SE_SELECT); gTasks[taskId].data[1] = r6[gTasks[taskId].data[1]][1]; sub_8092AD4(gTasks[taskId].data[0], gTasks[taskId].data[1]); } - if ((gMain.newKeys & 0x40) && r6[gTasks[taskId].data[1]][2] != 0xFF) + if ((gMain.newKeys & DPAD_UP) && r6[gTasks[taskId].data[1]][2] != 0xFF) { PlaySE(SE_SELECT); gTasks[taskId].data[1] = r6[gTasks[taskId].data[1]][2]; sub_8092AD4(gTasks[taskId].data[0], gTasks[taskId].data[1]); } - if ((gMain.newKeys & 0x80) && r6[gTasks[taskId].data[1]][3] != 0xFF) + if ((gMain.newKeys & DPAD_DOWN) && r6[gTasks[taskId].data[1]][3] != 0xFF) { PlaySE(SE_SELECT); gTasks[taskId].data[1] = r6[gTasks[taskId].data[1]][3]; @@ -4568,7 +4598,7 @@ void sub_8092644(u8 taskId) return; } r3 = FALSE; - if (gMain.newAndRepeatedKeys & 0x40) + if (gMain.newAndRepeatedKeys & DPAD_UP) { if (*p1 != 0) { @@ -4591,7 +4621,7 @@ void sub_8092644(u8 taskId) } return; } - if (gMain.newAndRepeatedKeys & 0x80) + if (gMain.newAndRepeatedKeys & DPAD_DOWN) { if (*p1 < 5 && *p1 < r2) { @@ -4627,3 +4657,416 @@ void sub_80927F0(u8 taskId) if (!gPaletteFade.active) DestroyTask(taskId); } + +#ifdef NONMATCHING +void sub_8092810(u8 a, u8 b, u8 c, u8 d) +{ + u16 i; + + for (i = 0; i < d; i++) + { + ((u16 *)VRAM)[15 * 0x400 + c * 32 + i + b] &= 0xFFF; + ((u16 *)VRAM)[15 * 0x400 + c * 32 + i + b] |= a << 12; + + ((u16 *)VRAM)[15 * 0x400 + (c + 1) * 32 + i + b] &= 0xFFF; + ((u16 *)VRAM)[15 * 0x400 + (c + 1) * 32 + i + b] |= a << 12; + } +} +#else +__attribute__((naked)) +void sub_8092810(u8 a, u8 b, u8 c, u8 d) +{ + asm(".syntax unified\n\ + push {r4-r7,lr}\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + lsls r1, 24\n\ + lsrs r1, 24\n\ + mov r12, r1\n\ + lsls r2, 24\n\ + lsrs r1, r2, 24\n\ + lsls r3, 24\n\ + lsrs r5, r3, 8\n\ + movs r3, 0\n\ + cmp r5, 0\n\ + beq _0809285A\n\ + lsls r7, r1, 6\n\ + ldr r6, _08092860 @ =0x00000fff\n\ + lsls r4, r0, 12\n\ +_08092830:\n\ + mov r0, r12\n\ + adds r1, r0, r3\n\ + lsls r1, 1\n\ + adds r1, r7, r1\n\ + ldr r0, _08092864 @ =0x06007800\n\ + adds r2, r1, r0\n\ + ldrh r0, [r2]\n\ + ands r0, r6\n\ + orrs r0, r4\n\ + strh r0, [r2]\n\ + ldr r0, _08092868 @ =0x06007840\n\ + adds r1, r0\n\ + ldrh r0, [r1]\n\ + ands r0, r6\n\ + orrs r0, r4\n\ + strh r0, [r1]\n\ + adds r0, r3, 0x1\n\ + lsls r0, 16\n\ + lsrs r3, r0, 16\n\ + cmp r0, r5\n\ + bcc _08092830\n\ +_0809285A:\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .align 2, 0\n\ +_08092860: .4byte 0x00000fff\n\ +_08092864: .4byte 0x06007800\n\ +_08092868: .4byte 0x06007840\n\ + .syntax divided\n"); +} +#endif + +void sub_809286C(u8 a, u8 b, u8 c) +{ + u8 r5 = (b & 1) | ((c & 1) << 1); + + switch (a) + { + case 0: + case 1: + case 2: + sub_8092810(r5, gUnknown_083B57E4[a].unk4, gUnknown_083B57E4[a].unk5, gUnknown_083B57E4[a].unk6); + break; + case 3: + case 4: + case 7: + case 8: + sub_8092810(r5, gUnknown_083B57FC[a - 3].unk4, gUnknown_083B57FC[a - 3].unk5, gUnknown_083B57FC[a - 3].unk6); + // fall through + case 5: + case 6: + sub_8092810(r5, gUnknown_083B57FC[a - 3].unk7, gUnknown_083B57FC[a - 3].unk8, gUnknown_083B57FC[a - 3].unk9); + break; + case 10: + sub_8092810(r5, gUnknown_083B57FC[2].unk4, gUnknown_083B57FC[2].unk5, gUnknown_083B57FC[2].unk6); + break; + case 9: + if (!IsNationalPokedexEnabled()) + sub_8092810(r5, gUnknown_083B57FC[a - 3].unk4, gUnknown_083B57FC[a - 3].unk5 - 2, gUnknown_083B57FC[a - 3].unk6); + else + sub_8092810(r5, gUnknown_083B57FC[a - 3].unk4, gUnknown_083B57FC[a - 3].unk5, gUnknown_083B57FC[a - 3].unk6); + break; + } +} + +void sub_8092964(u8 a) +{ + switch (a) + { + case 0: + sub_809286C(0, 0, 0); + sub_809286C(1, 1, 0); + sub_809286C(2, 1, 0); + sub_809286C(3, 1, 0); + sub_809286C(4, 1, 0); + sub_809286C(10, 1, 0); + sub_809286C(5, 1, 0); + sub_809286C(6, 1, 0); + sub_809286C(7, 1, 0); + sub_809286C(8, 1, 0); + sub_809286C(9, 1, 0); + break; + case 1: + sub_809286C(0, 1, 0); + sub_809286C(1, 0, 0); + sub_809286C(2, 1, 0); + sub_809286C(3, 1, 1); + sub_809286C(4, 1, 1); + sub_809286C(10, 1, 1); + sub_809286C(5, 1, 1); + sub_809286C(6, 1, 1); + sub_809286C(7, 1, 0); + sub_809286C(8, 1, 0); + sub_809286C(9, 1, 0); + break; + case 2: + sub_809286C(0, 1, 0); + sub_809286C(1, 1, 0); + sub_809286C(2, 0, 0); + sub_809286C(3, 1, 1); + sub_809286C(4, 1, 1); + sub_809286C(10, 1, 1); + sub_809286C(5, 1, 1); + sub_809286C(6, 1, 1); + sub_809286C(7, 1, 1); + sub_809286C(8, 1, 1); + sub_809286C(9, 1, 1); + break; + } +} + +void sub_8092AB0(u8 a) +{ + sub_8092964(a); + sub_8091E20(gUnknown_083B57E4[a].text); +} + +void sub_8092AD4(u8 a, u8 b) +{ + sub_8092964(a); + switch (b) + { + case 0: + sub_809286C(3, 0, 0); + break; + case 1: + sub_809286C(4, 0, 0); + break; + case 2: + sub_809286C(10, 0, 0); + sub_809286C(5, 0, 0); + break; + case 3: + sub_809286C(10, 0, 0); + sub_809286C(6, 0, 0); + break; + case 4: + sub_809286C(7, 0, 0); + break; + case 5: + sub_809286C(8, 0, 0); + break; + case 6: + sub_809286C(9, 0, 0); + break; + } + sub_8091E20(gUnknown_083B57FC[b].text); +} + +void sub_8092B68(u8 taskId) +{ + u16 var; + + var = gTasks[taskId].data[6] + gTasks[taskId].data[7]; + StringCopy(gStringVar1, gUnknown_083B5910[var].text2); + MenuPrint_PixelCoords(gUnknown_083B5AB2, 45, 16, 1); + + var = gTasks[taskId].data[8] + gTasks[taskId].data[9]; + StringCopy(gStringVar1, gUnknown_083B5968[var].text2); + MenuPrint_PixelCoords(gUnknown_083B5AB2, 45, 32, 1); + + var = gTasks[taskId].data[10] + gTasks[taskId].data[11]; + StringCopy(gStringVar1, gUnknown_083B59C8[var].text2); + MenuPrint_PixelCoords(gUnknown_083B5AAC, 45, 48, 1); + + var = gTasks[taskId].data[12] + gTasks[taskId].data[13]; + StringCopy(gStringVar1, gUnknown_083B59C8[var].text2); + MenuPrint_PixelCoords(gUnknown_083B5AAC, 93, 48, 1); + + var = gTasks[taskId].data[4] + gTasks[taskId].data[5]; + StringCopy(gStringVar1, gUnknown_083B58D8[var].text2); + MenuPrint_PixelCoords(gUnknown_083B5AB2, 45, 64, 1); + + if (IsNationalPokedexEnabled()) + { + var = gTasks[taskId].data[2] + gTasks[taskId].data[3]; + StringCopy(gStringVar1, gUnknown_083B58C0[var].text2); + MenuPrint_PixelCoords(gUnknown_083B5AB2, 45, 80, 1); + } +} + +void sub_8092C8C(u8 a) +{ + u16 i; + u16 j; + + if (a == 0) + { + *((u16 *)(VRAM + 0x7800 + 0x22)) = 0xC0B; + for (i = 0x12; i < 0x1D; i++) + *((u16 *)(VRAM + 0x7800 + i * 2)) = 0x80D; + *((u16 *)(VRAM + 0x7800 + 0x3A)) = 0x80B; + for (j = 1; j < 13; j++) + { + *((u16 *)(VRAM + 0x7800 + 0x22 + j * 64)) = 0x40A; + for (i = 0x12; i < 0x1D; i++) + *((u16 *)(VRAM + 0x7800 + j * 64 + i * 2)) = 2; + *((u16 *)(VRAM + 0x7800 + 0x3A + j * 64)) = 0xA; + } + *((u16 *)(VRAM + 0x7800 + 0x362)) = 0x40B; + for (i = 0x12; i < 0x1D; i++) + *((u16 *)(VRAM + 0x7800 + 0x340 + i * 2)) = 0xD; + *((u16 *)(VRAM + 0x7800 + 0x37A)) = 0xB; + } + else + { + for (j = 0; j < 14; j++) + { + for (i = 0x11; i < 0x1E; i++) + { + *((u16 *)(VRAM + 0x7800 + j * 64 + i * 2)) = 0x4F; + } + } + } +} + +void sub_8092D78(u8 taskId) +{ + const struct UnknownStruct2 *r6 = gUnknown_083B5A7C[gTasks[taskId].data[1]].unk0; + const u16 *r8 = &gTasks[taskId].data[gUnknown_083B5A7C[gTasks[taskId].data[1]].unk4]; + const u16 *r7 = &gTasks[taskId].data[gUnknown_083B5A7C[gTasks[taskId].data[1]].unk5]; + u16 i; + u16 j; + + MenuZeroFillWindowRect(18, 1, 28, 12); + for (i = 0, j = *r7; i < 6 && r6[j].text2 != NULL; i++, j++) + { +#ifndef NONMATCHING + j += 0; // Useless statement needed to match +#endif + MenuPrint(r6[j].text2, 18, i * 2 + 1); + } + sub_8091E20(r6[*r8 + *r7].text1); +} + +u8 sub_8092E10(u8 taskId, u8 b) +{ + const u16 *ptr1 = &gTasks[taskId].data[gUnknown_083B5A7C[b].unk4]; + const u16 *ptr2 = &gTasks[taskId].data[gUnknown_083B5A7C[b].unk5]; + u16 r2 = *ptr1 + *ptr2; + + switch (b) + { + default: + return 0; + case 5: + return gUnknown_083B5A60[r2]; + case 4: + return gUnknown_083B5A62[r2]; + case 0: + if (r2 == 0) + return 0xFF; + else + return r2; + case 1: + if (r2 == 0) + return 0xFF; + else + return r2 - 1; + case 2: + case 3: + return gUnknown_083B5A68[r2]; + } +} + +void sub_8092EB0(u8 taskId) +{ + u16 r3; + + switch (gPokedexView->unk614) + { + default: + case 0: + r3 = 0; + break; + case 1: + r3 = 1; + break; + } + gTasks[taskId].data[2] = r3; + + switch (gPokedexView->unk618) + { + default: + case 0: + r3 = 0; + break; + case 1: + r3 = 1; + break; + case 2: + r3 = 2; + break; + case 3: + r3 = 3; + break; + case 4: + r3 = 4; + break; + case 5: + r3 = 5; + break; + } + gTasks[taskId].data[4] = r3; +} + +bool8 sub_8092F44(u8 taskId) +{ + u8 val1 = gTasks[taskId].data[1]; + const u16 *ptr = &gTasks[taskId].data[gUnknown_083B5A7C[val1].unk5]; + u16 val2 = gUnknown_083B5A7C[val1].unk6 - 1; + + if (val2 > 5 && *ptr != 0) + return FALSE; + else + return TRUE; +} + +bool8 sub_8092F8C(u8 taskId) +{ + u8 val1 = gTasks[taskId].data[1]; + const u16 *ptr = &gTasks[taskId].data[gUnknown_083B5A7C[val1].unk5]; + u16 val2 = gUnknown_083B5A7C[val1].unk6 - 1; + + if (val2 > 5 && *ptr < val2 - 5) + return FALSE; + else + return TRUE; +} + +void sub_8092FD8(struct Sprite *sprite) +{ + if (gTasks[sprite->data0].func == sub_8092644) + { + u8 val; + + if (sprite->data1 != 0) + { + if (sub_8092F8C(sprite->data0)) + sprite->invisible = TRUE; + else + sprite->invisible = FALSE; + } + else + { + if (sub_8092F44(sprite->data0)) + sprite->invisible = TRUE; + else + sprite->invisible = FALSE; + } + val = sprite->data2 + sprite->data1 * 128; + sprite->pos2.y = gSineTable[val] / 128; + sprite->data2 += 8; + } + else + { + sprite->invisible = TRUE; + } +} + +void sub_809308C(u8 taskId) +{ + u8 spriteId; + + spriteId = CreateSprite(&gSpriteTemplate_83A053C, 184, 4, 0); + gSprites[spriteId].data0 = taskId; + gSprites[spriteId].data1 = 0; + gSprites[spriteId].callback = sub_8092FD8; + + spriteId = CreateSprite(&gSpriteTemplate_83A053C, 184, 108, 0); + gSprites[spriteId].data0 = taskId; + gSprites[spriteId].data1 = 1; + gSprites[spriteId].vFlip = TRUE; + gSprites[spriteId].callback = sub_8092FD8; +} -- cgit v1.2.3 From aba52dbd95939761886a918f2a4c5ddad34b70a1 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 14 Jun 2017 18:15:36 -0500 Subject: convert some data to C --- src/pokedex.c | 2090 ++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 1759 insertions(+), 331 deletions(-) (limited to 'src') diff --git a/src/pokedex.c b/src/pokedex.c index d799f6a19..dd0c669d4 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -104,11 +104,6 @@ extern u8 gUnknown_08E96738[]; extern u8 gUnknown_08E96888[]; extern u8 gUnknown_08E96994[]; extern u8 gUnknown_08E9C6DC[]; -extern u8 gUnknown_0839FA7C[]; -extern u16 gUnknown_0839F67C[]; -extern u8 gUnknown_0839F73C[]; -extern u8 gUnknown_0839F8A0[]; -extern u8 gUnknown_0839F988[]; extern struct SpriteTemplate gSpriteTemplate_83A0524; extern struct SpriteTemplate gSpriteTemplate_83A053C; extern struct SpriteTemplate gSpriteTemplate_83A0554; @@ -170,9 +165,1442 @@ extern void DisableNationalPokedex(void); extern void sub_805469C(void); extern u16 HoennToNationalOrder(u16); extern u16 NationalToHoennOrder(u16); -extern u16 gPokedexOrder_Alphabetical[]; -extern u16 gPokedexOrder_Weight[]; -extern u16 gPokedexOrder_Height[]; + +const u16 gUnknown_0839F67C[] = INCBIN_U16("graphics/pokedex/search.gbapal"); +const u16 gUnknown_0839F73C[] = INCBIN_U16("graphics/pokedex/national.gbapal"); +const u8 gEmptySpacce_839F7FC[0xA4] = {0}; +const u8 gUnknown_0839F8A0[] = INCBIN_U8("graphics/pokedex/pokedex_cry_layout.bin.lz"); +const u8 gUnknown_0839F988[] = INCBIN_U8("graphics/pokedex/pokedex_size_layout.bin.lz"); +const u8 gUnknown_0839FA7C[] = INCBIN_U8("graphics/pokedex/noball.4bpp.lz"); +const u16 gPokedexOrder_Alphabetical[] = +{ + 387, + 388, + 389, + 390, + 391, + 392, + 393, + 394, + 395, + 396, + 397, + 398, + 399, + 400, + 401, + 402, + 403, + 404, + 405, + 406, + 407, + 408, + 409, + 410, + 411, + 63, // Abra + 359, // Absol + 142, // Aerodactyl + 306, // Aggron + 190, // Aipom + 65, // Alakazam + 334, // Altaria + 181, // Ampharos + 347, // Anorith + 24, // Arbok + 59, // Arcanine + 168, // Ariados + 348, // Armaldo + 304, // Aron + 144, // Articuno + 184, // Azumarill + 298, // Azurill + 371, // Bagon + 343, // Baltoy + 354, // Banette + 339, // Barboach + 153, // Bayleef + 267, // Beautifly + 15, // Beedrill + 374, // Beldum + 182, // Bellossom + 69, // Bellsprout + 9, // Blastoise + 257, // Blaziken + 242, // Blissey + 286, // Breloom + 1, // Bulbasaur + 12, // Butterfree + 331, // Cacnea + 332, // Cacturne + 323, // Camerupt + 318, // Carvanha + 268, // Cascoon + 351, // Castform + 10, // Caterpie + 251, // Celebi + 113, // Chansey + 6, // Charizard + 4, // Charmander + 5, // Charmeleon + 152, // Chikorita + 358, // Chimecho + 170, // Chinchou + 366, // Clamperl + 344, // Claydol + 36, // Clefable + 35, // Clefairy + 173, // Cleffa + 91, // Cloyster + 256, // Combusken + 341, // Corphish + 222, // Corsola + 346, // Cradily + 342, // Crawdaunt + 169, // Crobat + 159, // Croconaw + 104, // Cubone + 155, // Cyndaquil + 301, // Delcatty + 225, // Delibird + 386, // Deoxys + 87, // Dewgong + 50, // Diglett + 132, // Ditto + 85, // Dodrio + 84, // Doduo + 232, // Donphan + 148, // Dragonair + 149, // Dragonite + 147, // Dratini + 96, // Drowzee + 51, // Dugtrio + 206, // Dunsparce + 356, // Dusclops + 355, // Duskull + 269, // Dustox + 133, // Eevee + 23, // Ekans + 125, // Electabuzz + 309, // Electrike + 101, // Electrode + 239, // Elekid + 244, // Entei + 196, // Espeon + 102, // Exeggcute + 103, // Exeggutor + 295, // Exploud + 83, // Farfetch’d + 22, // Fearow + 349, // Feebas + 160, // Feraligatr + 180, // Flaaffy + 136, // Flareon + 330, // Flygon + 205, // Forretress + 162, // Furret + 282, // Gardevoir + 92, // Gastly + 94, // Gengar + 74, // Geodude + 203, // Girafarig + 362, // Glalie + 207, // Gligar + 44, // Gloom + 42, // Golbat + 118, // Goldeen + 55, // Golduck + 76, // Golem + 368, // Gorebyss + 210, // Granbull + 75, // Graveler + 88, // Grimer + 383, // Groudon + 253, // Grovyle + 58, // Growlithe + 326, // Grumpig + 316, // Gulpin + 130, // Gyarados + 297, // Hariyama + 93, // Haunter + 214, // Heracross + 107, // Hitmonchan + 106, // Hitmonlee + 237, // Hitmontop + 250, // Ho-Oh + 163, // Hoothoot + 187, // Hoppip + 116, // Horsea + 229, // Houndoom + 228, // Houndour + 367, // Huntail + 97, // Hypno + 174, // Igglybuff + 314, // Illumise + 2, // Ivysaur + 39, // Jigglypuff + 385, // Jirachi + 135, // Jolteon + 189, // Jumpluff + 124, // Jynx + 140, // Kabuto + 141, // Kabutops + 64, // Kadabra + 14, // Kakuna + 115, // Kangaskhan + 352, // Kecleon + 230, // Kingdra + 99, // Kingler + 281, // Kirlia + 109, // Koffing + 98, // Krabby + 382, // Kyogre + 305, // Lairon + 171, // Lanturn + 131, // Lapras + 246, // Larvitar + 380, // Latias + 381, // Latios + 166, // Ledian + 165, // Ledyba + 108, // Lickitung + 345, // Lileep + 264, // Linoone + 271, // Lombre + 270, // Lotad + 294, // Loudred + 272, // Ludicolo + 249, // Lugia + 337, // Lunatone + 370, // Luvdisc + 68, // Machamp + 67, // Machoke + 66, // Machop + 240, // Magby + 219, // Magcargo + 129, // Magikarp + 126, // Magmar + 81, // Magnemite + 82, // Magneton + 296, // Makuhita + 310, // Manectric + 56, // Mankey + 226, // Mantine + 179, // Mareep + 183, // Marill + 105, // Marowak + 259, // Marshtomp + 284, // Masquerain + 303, // Mawile + 308, // Medicham + 307, // Meditite + 154, // Meganium + 52, // Meowth + 376, // Metagross + 375, // Metang + 11, // Metapod + 151, // Mew + 150, // Mewtwo + 262, // Mightyena + 350, // Milotic + 241, // Miltank + 312, // Minun + 200, // Misdreavus + 146, // Moltres + 122, // Mr. mime + 258, // Mudkip + 89, // Muk + 198, // Murkrow + 177, // Natu + 34, // Nidoking + 31, // Nidoqueen + 29, // Nidoran♀ + 32, // Nidoran♂ + 30, // Nidorina + 33, // Nidorino + 290, // Nincada + 38, // Ninetales + 291, // Ninjask + 164, // Noctowl + 299, // Nosepass + 322, // Numel + 274, // Nuzleaf + 224, // Octillery + 43, // Oddish + 138, // Omanyte + 139, // Omastar + 95, // Onix + 46, // Paras + 47, // Parasect + 279, // Pelipper + 53, // Persian + 231, // Phanpy + 172, // Pichu + 18, // Pidgeot + 17, // Pidgeotto + 16, // Pidgey + 25, // Pikachu + 221, // Piloswine + 204, // Pineco + 127, // Pinsir + 311, // Plusle + 186, // Politoed + 60, // Poliwag + 61, // Poliwhirl + 62, // Poliwrath + 77, // Ponyta + 261, // Poochyena + 137, // Porygon + 233, // Porygon2 + 57, // Primeape + 54, // Psyduck + 247, // Pupitar + 195, // Quagsire + 156, // Quilava + 211, // Qwilfish + 26, // Raichu + 243, // Raikou + 280, // Ralts + 78, // Rapidash + 20, // Raticate + 19, // Rattata + 384, // Rayquaza + 378, // Regice + 377, // Regirock + 379, // Registeel + 369, // Relicanth + 223, // Remoraid + 112, // Rhydon + 111, // Rhyhorn + 315, // Roselia + 302, // Sableye + 373, // Salamence + 27, // Sandshrew + 28, // Sandslash + 254, // Sceptile + 212, // Scizor + 123, // Scyther + 117, // Seadra + 119, // Seaking + 364, // Sealeo + 273, // Seedot + 86, // Seel + 161, // Sentret + 336, // Seviper + 319, // Sharpedo + 292, // Shedinja + 372, // Shelgon + 90, // Shellder + 275, // Shiftry + 285, // Shroomish + 213, // Shuckle + 353, // Shuppet + 266, // Silcoon + 227, // Skarmory + 188, // Skiploom + 300, // Skitty + 289, // Slaking + 287, // Slakoth + 80, // Slowbro + 199, // Slowking + 79, // Slowpoke + 218, // Slugma + 235, // Smeargle + 238, // Smoochum + 215, // Sneasel + 143, // Snorlax + 361, // Snorunt + 209, // Snubbull + 338, // Solrock + 21, // Spearow + 363, // Spheal + 167, // Spinarak + 327, // Spinda + 325, // Spoink + 7, // Squirtle + 234, // Stantler + 121, // Starmie + 120, // Staryu + 208, // Steelix + 185, // Sudowoodo + 245, // Suicune + 192, // Sunflora + 191, // Sunkern + 283, // Surskit + 333, // Swablu + 317, // Swalot + 260, // Swampert + 277, // Swellow + 220, // Swinub + 276, // Taillow + 114, // Tangela + 128, // Tauros + 216, // Teddiursa + 72, // Tentacool + 73, // Tentacruel + 175, // Togepi + 176, // Togetic + 255, // Torchic + 324, // Torkoal + 158, // Totodile + 328, // Trapinch + 252, // Treecko + 357, // Tropius + 157, // Typhlosion + 248, // Tyranitar + 236, // Tyrogue + 197, // Umbreon + 201, // Unown + 217, // Ursaring + 134, // Vaporeon + 49, // Venomoth + 48, // Venonat + 3, // Venusaur + 329, // Vibrava + 71, // Victreebel + 288, // Vigoroth + 45, // Vileplume + 313, // Volbeat + 100, // Voltorb + 37, // Vulpix + 320, // Wailmer + 321, // Wailord + 365, // Walrein + 8, // Wartortle + 13, // Weedle + 70, // Weepinbell + 110, // Weezing + 340, // Whiscash + 293, // Whismur + 40, // Wigglytuff + 278, // Wingull + 202, // Wobbuffet + 194, // Wooper + 265, // Wurmple + 360, // Wynaut + 178, // Xatu + 193, // Yanma + 335, // Zangoose + 145, // Zapdos + 263, // Zigzagoon + 41, // Zubat +}; +const u16 gPokedexOrder_Weight[] = +{ + 92, // Gastly + 93, // Haunter + 187, // Hoppip + 50, // Diglett + 351, // Castform + 109, // Koffing + 174, // Igglybuff + 200, // Misdreavus + 358, // Chimecho + 188, // Skiploom + 385, // Jirachi + 333, // Swablu + 292, // Shedinja + 175, // Togepi + 283, // Surskit + 16, // Pidgey + 191, // Sunkern + 339, // Barboach + 172, // Pichu + 298, // Azurill + 315, // Roselia + 177, // Natu + 21, // Spearow + 198, // Murkrow + 353, // Shuppet + 276, // Taillow + 102, // Exeggcute + 255, // Torchic + 270, // Lotad + 10, // Caterpie + 189, // Jumpluff + 173, // Cleffa + 13, // Weedle + 176, // Togetic + 147, // Dratini + 19, // Rattata + 284, // Masquerain + 265, // Wurmple + 211, // Qwilfish + 151, // Mew + 90, // Shellder + 273, // Seedot + 132, // Ditto + 69, // Bellsprout + 311, // Plusle + 52, // Meowth + 312, // Minun + 285, // Shroomish + 251, // Celebi + 222, // Corsola + 252, // Treecko + 327, // Spinda + 201, // Unown + 46, // Paras + 43, // Oddish + 39, // Jigglypuff + 290, // Nincada + 182, // Bellossom + 81, // Magnemite + 25, // Pikachu + 238, // Smoochum + 161, // Sentret + 70, // Weepinbell + 152, // Chikorita + 220, // Swinub + 133, // Eevee + 98, // Krabby + 104, // Cubone + 280, // Ralts + 1, // Bulbasaur + 23, // Ekans + 29, // Nidoran♀ + 204, // Pineco + 349, // Feebas + 138, // Omanyte + 41, // Zubat + 35, // Clefairy + 258, // Mudkip + 209, // Snubbull + 179, // Mareep + 155, // Cyndaquil + 116, // Horsea + 4, // Charmander + 192, // Sunflora + 183, // Marill + 194, // Wooper + 167, // Spinarak + 44, // Gloom + 370, // Luvdisc + 216, // Teddiursa + 32, // Nidoran♂ + 7, // Squirtle + 278, // Wingull + 158, // Totodile + 110, // Weezing + 37, // Vulpix + 11, // Metapod + 266, // Silcoon + 129, // Magikarp + 14, // Kakuna + 316, // Gulpin + 100, // Voltorb + 165, // Ledyba + 228, // Houndour + 300, // Skitty + 302, // Sableye + 307, // Meditite + 341, // Corphish + 190, // Aipom + 268, // Cascoon + 303, // Mawile + 140, // Kabuto + 40, // Wigglytuff + 27, // Sandshrew + 223, // Remoraid + 291, // Ninjask + 170, // Chinchou + 60, // Poliwag + 347, // Anorith + 49, // Venomoth + 354, // Banette + 2, // Ivysaur + 180, // Flaaffy + 261, // Poochyena + 360, // Wynaut + 206, // Dunsparce + 178, // Xatu + 355, // Duskull + 83, // Farfetch’d + 328, // Trapinch + 118, // Goldeen + 309, // Electrike + 329, // Vibrava + 71, // Victreebel + 153, // Bayleef + 225, // Delibird + 293, // Whismur + 148, // Dragonair + 361, // Snorunt + 263, // Zigzagoon + 314, // Illumise + 313, // Volbeat + 20, // Raticate + 45, // Vileplume + 156, // Quilava + 5, // Charmeleon + 58, // Growlithe + 256, // Combusken + 66, // Machop + 63, // Abra + 33, // Nidorino + 54, // Psyduck + 277, // Swellow + 38, // Ninetales + 30, // Nidorina + 61, // Poliwhirl + 74, // Geodude + 281, // Kirlia + 213, // Shuckle + 334, // Altaria + 318, // Carvanha + 236, // Tyrogue + 163, // Hoothoot + 240, // Magby + 343, // Baltoy + 253, // Grovyle + 352, // Kecleon + 171, // Lanturn + 8, // Wartortle + 368, // Gorebyss + 369, // Relicanth + 239, // Elekid + 340, // Whiscash + 345, // Lileep + 322, // Numel + 287, // Slakoth + 135, // Jolteon + 159, // Croconaw + 136, // Flareon + 117, // Seadra + 196, // Espeon + 367, // Huntail + 197, // Umbreon + 259, // Marshtomp + 274, // Nuzleaf + 215, // Sneasel + 56, // Mankey + 279, // Pelipper + 267, // Beautifly + 224, // Octillery + 184, // Azumarill + 202, // Wobbuffet + 134, // Vaporeon + 28, // Sandslash + 47, // Parasect + 15, // Beedrill + 89, // Muk + 17, // Pidgeotto + 88, // Grimer + 26, // Raichu + 77, // Ponyta + 125, // Electabuzz + 48, // Venonat + 325, // Spoink + 356, // Dusclops + 308, // Medicham + 269, // Dustox + 53, // Persian + 12, // Butterfree + 57, // Primeape + 96, // Drowzee + 162, // Furret + 233, // Porygon2 + 271, // Lombre + 264, // Linoone + 301, // Delcatty + 342, // Crawdaunt + 51, // Dugtrio + 168, // Ariados + 231, // Phanpy + 186, // Politoed + 120, // Staryu + 113, // Chansey + 139, // Omastar + 114, // Tangela + 218, // Slugma + 229, // Houndoom + 166, // Ledian + 79, // Slowpoke + 137, // Porygon + 262, // Mightyena + 193, // Yanma + 22, // Fearow + 185, // Sudowoodo + 119, // Seaking + 286, // Breloom + 84, // Doduo + 18, // Pidgeot + 363, // Spheal + 36, // Clefable + 380, // Latias + 310, // Manectric + 335, // Zangoose + 141, // Kabutops + 94, // Gengar + 294, // Loudred + 124, // Jynx + 164, // Noctowl + 203, // Girafarig + 371, // Bagon + 126, // Magmar + 105, // Marowak + 72, // Tentacool + 288, // Vigoroth + 242, // Blissey + 359, // Absol + 65, // Alakazam + 237, // Hitmontop + 282, // Gardevoir + 210, // Granbull + 106, // Hitmonlee + 107, // Hitmonchan + 227, // Skarmory + 331, // Cacnea + 257, // Blaziken + 254, // Sceptile + 336, // Seviper + 366, // Clamperl + 145, // Zapdos + 214, // Heracross + 62, // Poliwrath + 122, // Mr. mime + 127, // Pinsir + 272, // Ludicolo + 73, // Tentacruel + 42, // Golbat + 219, // Magcargo + 144, // Articuno + 221, // Piloswine + 123, // Scyther + 64, // Kadabra + 235, // Smeargle + 142, // Aerodactyl + 275, // Shiftry + 99, // Kingler + 31, // Nidoqueen + 82, // Magneton + 304, // Aron + 381, // Latios + 146, // Moltres + 346, // Cradily + 386, // Deoxys + 181, // Ampharos + 34, // Nidoking + 207, // Gligar + 24, // Arbok + 108, // Lickitung + 101, // Electrode + 348, // Armaldo + 67, // Machoke + 234, // Stantler + 326, // Grumpig + 246, // Larvitar + 169, // Crobat + 195, // Quagsire + 241, // Miltank + 97, // Hypno + 55, // Golduck + 332, // Cacturne + 80, // Slowbro + 157, // Typhlosion + 199, // Slowking + 115, // Kangaskhan + 121, // Starmie + 317, // Swalot + 324, // Torkoal + 260, // Swampert + 330, // Flygon + 295, // Exploud + 85, // Dodrio + 9, // Blastoise + 296, // Makuhita + 364, // Sealeo + 128, // Tauros + 319, // Sharpedo + 160, // Feraligatr + 86, // Seel + 6, // Charizard + 78, // Rapidash + 374, // Beldum + 299, // Nosepass + 3, // Venusaur + 357, // Tropius + 154, // Meganium + 373, // Salamence + 75, // Graveler + 344, // Claydol + 372, // Shelgon + 111, // Rhyhorn + 212, // Scizor + 87, // Dewgong + 112, // Rhydon + 232, // Donphan + 103, // Exeggutor + 305, // Lairon + 150, // Mewtwo + 217, // Ursaring + 205, // Forretress + 68, // Machamp + 320, // Wailmer + 289, // Slaking + 91, // Cloyster + 365, // Walrein + 247, // Pupitar + 230, // Kingdra + 338, // Solrock + 59, // Arcanine + 350, // Milotic + 337, // Lunatone + 378, // Regice + 243, // Raikou + 245, // Suicune + 244, // Entei + 250, // Ho-Oh + 248, // Tyranitar + 375, // Metang + 379, // Registeel + 384, // Rayquaza + 95, // Onix + 149, // Dragonite + 249, // Lugia + 131, // Lapras + 323, // Camerupt + 226, // Mantine + 377, // Regirock + 130, // Gyarados + 297, // Hariyama + 362, // Glalie + 76, // Golem + 382, // Kyogre + 306, // Aggron + 321, // Wailord + 208, // Steelix + 143, // Snorlax + 376, // Metagross + 383, // Groudon +}; +const u16 gPokedexOrder_Height[] = +{ + 50, // Diglett + 298, // Azurill + 177, // Natu + 13, // Weedle + 172, // Pichu + 173, // Cleffa + 175, // Togepi + 351, // Castform + 174, // Igglybuff + 10, // Caterpie + 276, // Taillow + 132, // Ditto + 133, // Eevee + 315, // Roselia + 21, // Spearow + 16, // Pidgey + 191, // Sunkern + 90, // Shellder + 19, // Rattata + 81, // Magnemite + 46, // Paras + 265, // Wurmple + 385, // Jirachi + 104, // Cubone + 258, // Mudkip + 194, // Wooper + 116, // Horsea + 52, // Meowth + 29, // Nidoran♀ + 220, // Swinub + 151, // Mew + 333, // Swablu + 304, // Aron + 311, // Plusle + 312, // Minun + 102, // Exeggcute + 25, // Pikachu + 182, // Bellossom + 316, // Gulpin + 263, // Zigzagoon + 285, // Shroomish + 138, // Omanyte + 331, // Cacnea + 98, // Krabby + 280, // Ralts + 187, // Hoppip + 255, // Torchic + 366, // Clamperl + 74, // Geodude + 183, // Marill + 339, // Barboach + 238, // Smoochum + 100, // Voltorb + 290, // Nincada + 302, // Sableye + 198, // Murkrow + 211, // Qwilfish + 7, // Squirtle + 252, // Treecko + 343, // Baltoy + 43, // Oddish + 270, // Lotad + 39, // Jigglypuff + 283, // Surskit + 155, // Cyndaquil + 140, // Kabuto + 264, // Linoone + 324, // Torkoal + 32, // Nidoran♂ + 167, // Spinarak + 56, // Mankey + 273, // Seedot + 261, // Poochyena + 231, // Phanpy + 201, // Unown + 170, // Chinchou + 233, // Porygon2 + 60, // Poliwag + 371, // Bagon + 349, // Feebas + 353, // Shuppet + 158, // Totodile + 251, // Celebi + 360, // Wynaut + 27, // Sandshrew + 358, // Chimecho + 370, // Luvdisc + 228, // Houndour + 266, // Silcoon + 309, // Electrike + 4, // Charmander + 307, // Meditite + 278, // Wingull + 223, // Remoraid + 341, // Corphish + 222, // Corsola + 314, // Illumise + 209, // Snubbull + 37, // Vulpix + 246, // Larvitar + 374, // Beldum + 293, // Whismur + 204, // Pineco + 239, // Elekid + 35, // Clefairy + 213, // Shuckle + 216, // Teddiursa + 14, // Kakuna + 300, // Skitty + 176, // Togetic + 118, // Goldeen + 303, // Mawile + 179, // Mareep + 188, // Skiploom + 109, // Koffing + 51, // Dugtrio + 268, // Cascoon + 322, // Numel + 347, // Anorith + 313, // Volbeat + 163, // Hoothoot + 328, // Trapinch + 325, // Spoink + 11, // Metapod + 69, // Bellsprout + 361, // Snorunt + 20, // Raticate + 259, // Marshtomp + 277, // Swellow + 240, // Magby + 58, // Growlithe + 200, // Misdreavus + 1, // Bulbasaur + 236, // Tyrogue + 218, // Slugma + 287, // Slakoth + 281, // Kirlia + 190, // Aipom + 135, // Jolteon + 30, // Nidorina + 184, // Azumarill + 292, // Shedinja + 66, // Machop + 291, // Ninjask + 284, // Masquerain + 355, // Duskull + 192, // Sunflora + 189, // Jumpluff + 120, // Staryu + 180, // Flaaffy + 363, // Spheal + 54, // Psyduck + 219, // Magcargo + 83, // Farfetch’d + 41, // Zubat + 137, // Porygon + 161, // Sentret + 318, // Carvanha + 44, // Gloom + 26, // Raichu + 129, // Magikarp + 215, // Sneasel + 305, // Lairon + 256, // Combusken + 224, // Octillery + 33, // Nidorino + 136, // Flareon + 225, // Delibird + 72, // Tentacool + 63, // Abra + 253, // Grovyle + 340, // Whiscash + 156, // Quilava + 196, // Espeon + 88, // Grimer + 152, // Chikorita + 326, // Grumpig + 299, // Nosepass + 53, // Persian + 262, // Mightyena + 48, // Venonat + 82, // Magneton + 77, // Ponyta + 296, // Makuhita + 337, // Lunatone + 28, // Sandslash + 96, // Drowzee + 114, // Tangela + 57, // Primeape + 165, // Ledyba + 40, // Wigglytuff + 47, // Parasect + 139, // Omastar + 294, // Loudred + 8, // Wartortle + 75, // Graveler + 197, // Umbreon + 345, // Lileep + 61, // Poliwhirl + 134, // Vaporeon + 15, // Beedrill + 105, // Marowak + 70, // Weepinbell + 369, // Relicanth + 111, // Rhyhorn + 2, // Ivysaur + 352, // Kecleon + 274, // Nuzleaf + 267, // Beautifly + 17, // Pidgeotto + 168, // Ariados + 86, // Seel + 186, // Politoed + 159, // Croconaw + 113, // Chansey + 354, // Banette + 232, // Donphan + 121, // Starmie + 5, // Charmeleon + 221, // Piloswine + 12, // Butterfree + 329, // Vibrava + 125, // Electabuzz + 342, // Crawdaunt + 301, // Delcatty + 334, // Altaria + 372, // Shelgon + 38, // Ninetales + 207, // Gligar + 364, // Sealeo + 327, // Spinda + 247, // Pupitar + 79, // Slowpoke + 338, // Solrock + 241, // Miltank + 22, // Fearow + 45, // Vileplume + 89, // Muk + 205, // Forretress + 185, // Sudowoodo + 359, // Absol + 193, // Yanma + 269, // Dustox + 108, // Lickitung + 235, // Smeargle + 171, // Lanturn + 101, // Electrode + 271, // Lombre + 286, // Breloom + 153, // Bayleef + 117, // Seadra + 110, // Weezing + 279, // Pelipper + 375, // Metang + 31, // Nidoqueen + 332, // Cacturne + 275, // Shiftry + 308, // Medicham + 335, // Zangoose + 141, // Kabutops + 99, // Kingler + 64, // Kadabra + 119, // Seaking + 36, // Clefable + 126, // Magmar + 202, // Wobbuffet + 92, // Gastly + 122, // Mr. mime + 62, // Poliwrath + 128, // Tauros + 380, // Latias + 181, // Ampharos + 288, // Vigoroth + 166, // Ledian + 76, // Golem + 365, // Walrein + 84, // Doduo + 229, // Houndoom + 34, // Nidoking + 124, // Jynx + 107, // Hitmonchan + 234, // Stantler + 210, // Granbull + 237, // Hitmontop + 195, // Quagsire + 344, // Claydol + 260, // Swampert + 242, // Blissey + 272, // Ludicolo + 295, // Exploud + 206, // Dunsparce + 127, // Pinsir + 91, // Cloyster + 67, // Machoke + 203, // Girafarig + 18, // Pidgeot + 178, // Xatu + 346, // Cradily + 106, // Hitmonlee + 49, // Venomoth + 94, // Gengar + 214, // Heracross + 362, // Glalie + 123, // Scyther + 373, // Salamence + 310, // Manectric + 348, // Armaldo + 65, // Alakazam + 97, // Hypno + 164, // Noctowl + 73, // Tentacruel + 356, // Dusclops + 145, // Zapdos + 42, // Golbat + 376, // Metagross + 282, // Gardevoir + 9, // Blastoise + 80, // Slowbro + 93, // Haunter + 68, // Machamp + 377, // Regirock + 317, // Swalot + 254, // Sceptile + 227, // Skarmory + 55, // Golduck + 386, // Deoxys + 71, // Victreebel + 78, // Rapidash + 6, // Charizard + 367, // Huntail + 87, // Dewgong + 144, // Articuno + 157, // Typhlosion + 142, // Aerodactyl + 368, // Gorebyss + 217, // Ursaring + 154, // Meganium + 378, // Regice + 212, // Scizor + 230, // Kingdra + 147, // Dratini + 85, // Dodrio + 319, // Sharpedo + 169, // Crobat + 162, // Furret + 59, // Arcanine + 243, // Raikou + 257, // Blaziken + 323, // Camerupt + 112, // Rhydon + 379, // Registeel + 23, // Ekans + 330, // Flygon + 357, // Tropius + 381, // Latios + 245, // Suicune + 146, // Moltres + 3, // Venusaur + 103, // Exeggutor + 199, // Slowking + 248, // Tyranitar + 289, // Slaking + 320, // Wailmer + 150, // Mewtwo + 306, // Aggron + 143, // Snorlax + 226, // Mantine + 244, // Entei + 149, // Dragonite + 115, // Kangaskhan + 297, // Hariyama + 160, // Feraligatr + 131, // Lapras + 336, // Seviper + 24, // Arbok + 383, // Groudon + 250, // Ho-Oh + 148, // Dragonair + 382, // Kyogre + 249, // Lugia + 350, // Milotic + 130, // Gyarados + 384, // Rayquaza + 95, // Onix + 208, // Steelix + 321, // Wailord +}; +const struct OamData gOamData_83A0404 = +{ + .y = 160, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 0, + .tileNum = 0, + .priority = 1, + .paletteNum = 0, + .affineParam = 0, +}; +const struct OamData gOamData_83A040C = +{ + .y = 160, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 1, + .x = 0, + .matrixNum = 0, + .size = 0, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0, +}; +const struct OamData gOamData_83A0414 = +{ + .y = 160, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 1, + .x = 0, + .matrixNum = 0, + .size = 3, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0, +}; +const struct OamData gOamData_83A041C = +{ + .y = 160, + .affineMode = 0, + .objMode = 2, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 2, + .tileNum = 0, + .priority = 1, + .paletteNum = 0, + .affineParam = 0, +}; +const struct OamData gOamData_83A0424 = +{ + .y = 160, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 1, + .x = 0, + .matrixNum = 0, + .size = 3, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0, +}; +const struct OamData gOamData_83A042C = +{ + .y = 160, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 2, + .x = 0, + .matrixNum = 0, + .size = 0, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0, +}; +const union AnimCmd gSpriteAnim_83A0434[] = +{ + ANIMCMD_FRAME(3, 30), + ANIMCMD_END, +}; +const union AnimCmd gSpriteAnim_83A043C[] = +{ + ANIMCMD_FRAME(1, 30), + ANIMCMD_END, +}; +const union AnimCmd gSpriteAnim_83A0444[] = +{ + ANIMCMD_FRAME(16, 30), + ANIMCMD_END, +}; +const union AnimCmd gSpriteAnim_83A044C[] = +{ + ANIMCMD_FRAME(32, 30), + ANIMCMD_END, +}; +const union AnimCmd gSpriteAnim_83A0454[] = +{ + ANIMCMD_FRAME(64, 30), + ANIMCMD_END, +}; +const union AnimCmd gSpriteAnim_83A045C[] = +{ + ANIMCMD_FRAME(96, 30), + ANIMCMD_END, +}; +const union AnimCmd gSpriteAnim_83A0464[] = +{ + ANIMCMD_FRAME(128, 30), + ANIMCMD_END, +}; +const union AnimCmd gSpriteAnim_83A046C[] = +{ + ANIMCMD_FRAME(160, 30), + ANIMCMD_END, +}; +const union AnimCmd gSpriteAnim_83A0474[] = +{ + ANIMCMD_FRAME(192, 30), + ANIMCMD_END, +}; +const union AnimCmd gSpriteAnim_83A047C[] = +{ + ANIMCMD_FRAME(224, 30), + ANIMCMD_END, +}; +const union AnimCmd gSpriteAnim_83A0484[] = +{ + ANIMCMD_FRAME(226, 30), + ANIMCMD_END, +}; +const union AnimCmd gSpriteAnim_83A048C[] = +{ + ANIMCMD_FRAME(228, 30), + ANIMCMD_END, +}; +const union AnimCmd gSpriteAnim_83A0494[] = +{ + ANIMCMD_FRAME(230, 30), + ANIMCMD_END, +}; +const union AnimCmd gSpriteAnim_83A049C[] = +{ + ANIMCMD_FRAME(232, 30), + ANIMCMD_END, +}; +const union AnimCmd gSpriteAnim_83A04A4[] = +{ + ANIMCMD_FRAME(234, 30), + ANIMCMD_END, +}; +const union AnimCmd gSpriteAnim_83A04AC[] = +{ + ANIMCMD_FRAME(236, 30), + ANIMCMD_END, +}; +const union AnimCmd gSpriteAnim_83A04B4[] = +{ + ANIMCMD_FRAME(238, 30), + ANIMCMD_END, +}; +const union AnimCmd gSpriteAnim_83A04BC[] = +{ + ANIMCMD_FRAME(240, 30), + ANIMCMD_END, +}; +const union AnimCmd gSpriteAnim_83A04C4[] = +{ + ANIMCMD_FRAME(242, 30), + ANIMCMD_END, +}; +const union AnimCmd gSpriteAnim_83A04CC[] = +{ + ANIMCMD_FRAME(4, 30), + ANIMCMD_END, +}; +const union AnimCmd *const gSpriteAnimTable_83A04D4[] = +{ + gSpriteAnim_83A0434, +}; +const union AnimCmd *const gSpriteAnimTable_83A04D8[] = +{ + gSpriteAnim_83A043C, +}; +const union AnimCmd *const gSpriteAnimTable_83A04DC[] = +{ + gSpriteAnim_83A0444, +}; +const union AnimCmd *const gSpriteAnimTable_83A04E0[] = +{ + gSpriteAnim_83A044C, + gSpriteAnim_83A0454, + gSpriteAnim_83A045C, + gSpriteAnim_83A0464, +}; +const union AnimCmd *const gSpriteAnimTable_83A04F0[] = +{ + gSpriteAnim_83A046C, + gSpriteAnim_83A0474, +}; +const union AnimCmd *const gSpriteAnimTable_83A04F8[] = +{ + gSpriteAnim_83A047C, + gSpriteAnim_83A0484, + gSpriteAnim_83A048C, + gSpriteAnim_83A0494, + gSpriteAnim_83A049C, + gSpriteAnim_83A04A4, + gSpriteAnim_83A04AC, + gSpriteAnim_83A04B4, + gSpriteAnim_83A04BC, + gSpriteAnim_83A04C4, +}; +const union AnimCmd *const gSpriteAnimTable_83A0520[] = +{ + gSpriteAnim_83A04CC, +}; void sub_8090B8C(u8); void sub_8090C28(struct Sprite *); @@ -896,11 +2324,11 @@ bool8 sub_808D344(u8 a) void sub_808D640(void) { if (gPokedexView->unk64C_1) - LoadPalette(gUnknown_0839F67C + 1, 1, 0xBE); + LoadPalette(gUnknown_0839F67C + 1, 1, sizeof(gUnknown_0839F67C) - sizeof(u16)); else if (!IsNationalPokedexEnabled()) LoadPalette(gPokedexMenu_Pal + 1, 1, 0xBE); else - LoadPalette(gUnknown_0839F73C + 0x2, 1, 0xBE); + LoadPalette(gUnknown_0839F73C + 1, 1, sizeof(gUnknown_0839F73C) - sizeof(u16)); } void SortPokedex(u8 dexMode, u8 sortMode) @@ -3154,115 +4582,115 @@ __attribute__((naked)) void sub_8090750(u8 taskId) { asm(".syntax unified\n\ - push {r4-r7,lr}\n\ - sub sp, 0x8\n\ - lsls r0, 24\n\ - lsrs r7, r0, 24\n\ - ldr r1, _08090778 @ =gTasks\n\ - lsls r0, r7, 2\n\ - adds r0, r7\n\ - lsls r0, 3\n\ - adds r0, r1\n\ - ldrh r6, [r0, 0xA]\n\ - movs r2, 0x8\n\ - ldrsh r0, [r0, r2]\n\ - adds r4, r1, 0\n\ - cmp r0, 0x6\n\ - bhi _0809079C\n\ - lsls r0, 2\n\ - ldr r1, _0809077C @ =_08090780\n\ - adds r0, r1\n\ - ldr r0, [r0]\n\ - mov pc, r0\n\ - .align 2, 0\n\ + push {r4-r7,lr}\n\ + sub sp, 0x8\n\ + lsls r0, 24\n\ + lsrs r7, r0, 24\n\ + ldr r1, _08090778 @ =gTasks\n\ + lsls r0, r7, 2\n\ + adds r0, r7\n\ + lsls r0, 3\n\ + adds r0, r1\n\ + ldrh r6, [r0, 0xA]\n\ + movs r2, 0x8\n\ + ldrsh r0, [r0, r2]\n\ + adds r4, r1, 0\n\ + cmp r0, 0x6\n\ + bhi _0809079C\n\ + lsls r0, 2\n\ + ldr r1, _0809077C @ =_08090780\n\ + adds r0, r1\n\ + ldr r0, [r0]\n\ + mov pc, r0\n\ + .align 2, 0\n\ _08090778: .4byte gTasks\n\ _0809077C: .4byte _08090780\n\ - .align 2, 0\n\ + .align 2, 0\n\ _08090780:\n\ - .4byte _0809079C\n\ - .4byte _080907E0\n\ - .4byte _0809085C\n\ - .4byte _080908A0\n\ - .4byte _08090960\n\ - .4byte _080909B8\n\ - .4byte _080909F4\n\ + .4byte _0809079C\n\ + .4byte _080907E0\n\ + .4byte _0809085C\n\ + .4byte _080908A0\n\ + .4byte _08090960\n\ + .4byte _080909B8\n\ + .4byte _080909F4\n\ _0809079C:\n\ - ldr r0, _080907D0 @ =gPaletteFade\n\ - ldrb r1, [r0, 0x7]\n\ - movs r0, 0x80\n\ - ands r0, r1\n\ - cmp r0, 0\n\ - beq _080907AA\n\ - b _08090A26\n\ + ldr r0, _080907D0 @ =gPaletteFade\n\ + ldrb r1, [r0, 0x7]\n\ + movs r0, 0x80\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080907AA\n\ + b _08090A26\n\ _080907AA:\n\ - ldr r1, _080907D4 @ =gUnknown_03005CEC\n\ - ldr r0, _080907D8 @ =gMain\n\ - ldr r0, [r0, 0xC]\n\ - str r0, [r1]\n\ - movs r0, 0\n\ - bl SetVBlankCallback\n\ - movs r0, 0x80\n\ - lsls r0, 1\n\ - bl sub_8091060\n\ - ldr r1, _080907DC @ =gTasks\n\ - lsls r0, r7, 2\n\ - adds r0, r7\n\ - lsls r0, 3\n\ - adds r0, r1\n\ - movs r1, 0x1\n\ - strh r1, [r0, 0x8]\n\ - b _08090A26\n\ - .align 2, 0\n\ + ldr r1, _080907D4 @ =gUnknown_03005CEC\n\ + ldr r0, _080907D8 @ =gMain\n\ + ldr r0, [r0, 0xC]\n\ + str r0, [r1]\n\ + movs r0, 0\n\ + bl SetVBlankCallback\n\ + movs r0, 0x80\n\ + lsls r0, 1\n\ + bl sub_8091060\n\ + ldr r1, _080907DC @ =gTasks\n\ + lsls r0, r7, 2\n\ + adds r0, r7\n\ + lsls r0, 3\n\ + adds r0, r1\n\ + movs r1, 0x1\n\ + strh r1, [r0, 0x8]\n\ + b _08090A26\n\ + .align 2, 0\n\ _080907D0: .4byte gPaletteFade\n\ _080907D4: .4byte gUnknown_03005CEC\n\ _080907D8: .4byte gMain\n\ _080907DC: .4byte gTasks\n\ _080907E0:\n\ - ldr r0, _08090840 @ =gPokedexMenu_Gfx\n\ - ldr r1, _08090844 @ =0x06004000\n\ - bl LZ77UnCompVram\n\ - ldr r0, _08090848 @ =gUnknown_08E96BD4\n\ - ldr r4, _0809084C @ =0x06007800\n\ - adds r1, r4, 0\n\ - bl LZ77UnCompVram\n\ - movs r2, 0\n\ - lsls r5, r7, 2\n\ - mov r12, r5\n\ - movs r0, 0x80\n\ - lsls r0, 6\n\ - adds r6, r0, 0\n\ - ldr r3, _08090850 @ =0x0000027f\n\ + ldr r0, _08090840 @ =gPokedexMenu_Gfx\n\ + ldr r1, _08090844 @ =0x06004000\n\ + bl LZ77UnCompVram\n\ + ldr r0, _08090848 @ =gUnknown_08E96BD4\n\ + ldr r4, _0809084C @ =0x06007800\n\ + adds r1, r4, 0\n\ + bl LZ77UnCompVram\n\ + movs r2, 0\n\ + lsls r5, r7, 2\n\ + mov r12, r5\n\ + movs r0, 0x80\n\ + lsls r0, 6\n\ + adds r6, r0, 0\n\ + ldr r3, _08090850 @ =0x0000027f\n\ _08090800:\n\ - lsls r0, r2, 1\n\ - adds r0, r4\n\ - ldrh r5, [r0]\n\ - adds r1, r6, r5\n\ - strh r1, [r0]\n\ - adds r0, r2, 0x1\n\ - lsls r0, 16\n\ - lsrs r2, r0, 16\n\ - cmp r2, r3\n\ - bls _08090800\n\ - ldr r0, _08090854 @ =gTasks\n\ - mov r1, r12\n\ - adds r4, r1, r7\n\ - lsls r4, 3\n\ - adds r4, r0\n\ - ldrh r0, [r4, 0xA]\n\ - movs r2, 0xFF\n\ - lsls r2, 2\n\ - movs r1, 0x2\n\ - bl sub_8091738\n\ - bl ResetPaletteFade\n\ - ldr r0, _08090858 @ =gPokedexMenu_Pal + 0x2\n\ - movs r1, 0x21\n\ - movs r2, 0x9E\n\ - bl LoadPalette\n\ - ldrh r0, [r4, 0x8]\n\ - adds r0, 0x1\n\ - strh r0, [r4, 0x8]\n\ - b _08090A26\n\ - .align 2, 0\n\ + lsls r0, r2, 1\n\ + adds r0, r4\n\ + ldrh r5, [r0]\n\ + adds r1, r6, r5\n\ + strh r1, [r0]\n\ + adds r0, r2, 0x1\n\ + lsls r0, 16\n\ + lsrs r2, r0, 16\n\ + cmp r2, r3\n\ + bls _08090800\n\ + ldr r0, _08090854 @ =gTasks\n\ + mov r1, r12\n\ + adds r4, r1, r7\n\ + lsls r4, 3\n\ + adds r4, r0\n\ + ldrh r0, [r4, 0xA]\n\ + movs r2, 0xFF\n\ + lsls r2, 2\n\ + movs r1, 0x2\n\ + bl sub_8091738\n\ + bl ResetPaletteFade\n\ + ldr r0, _08090858 @ =gPokedexMenu_Pal + 0x2\n\ + movs r1, 0x21\n\ + movs r2, 0x9E\n\ + bl LoadPalette\n\ + ldrh r0, [r4, 0x8]\n\ + adds r0, 0x1\n\ + strh r0, [r4, 0x8]\n\ + b _08090A26\n\ + .align 2, 0\n\ _08090840: .4byte gPokedexMenu_Gfx\n\ _08090844: .4byte 0x06004000\n\ _08090848: .4byte gUnknown_08E96BD4\n\ @@ -3271,213 +4699,213 @@ _08090850: .4byte 0x0000027f\n\ _08090854: .4byte gTasks\n\ _08090858: .4byte gPokedexMenu_Pal + 0x2\n\ _0809085C:\n\ - ldr r4, _0809088C @ =gWindowConfig_81E7064\n\ - adds r0, r4, 0\n\ - bl SetUpWindowConfig\n\ - adds r0, r4, 0\n\ - bl InitMenuWindow\n\ - ldr r2, _08090890 @ =0x0600c000\n\ - add r1, sp, 0x4\n\ - movs r0, 0\n\ - strh r0, [r1]\n\ - ldr r0, _08090894 @ =0x040000d4\n\ - str r1, [r0]\n\ - str r2, [r0, 0x4]\n\ - ldr r1, _08090898 @ =0x81000100\n\ - str r1, [r0, 0x8]\n\ - ldr r0, [r0, 0x8]\n\ - ldr r1, _0809089C @ =gTasks\n\ - lsls r0, r7, 2\n\ - adds r0, r7\n\ - lsls r0, 3\n\ - adds r0, r1\n\ - b _080909E0\n\ - .align 2, 0\n\ + ldr r4, _0809088C @ =gWindowConfig_81E7064\n\ + adds r0, r4, 0\n\ + bl SetUpWindowConfig\n\ + adds r0, r4, 0\n\ + bl InitMenuWindow\n\ + ldr r2, _08090890 @ =0x0600c000\n\ + add r1, sp, 0x4\n\ + movs r0, 0\n\ + strh r0, [r1]\n\ + ldr r0, _08090894 @ =0x040000d4\n\ + str r1, [r0]\n\ + str r2, [r0, 0x4]\n\ + ldr r1, _08090898 @ =0x81000100\n\ + str r1, [r0, 0x8]\n\ + ldr r0, [r0, 0x8]\n\ + ldr r1, _0809089C @ =gTasks\n\ + lsls r0, r7, 2\n\ + adds r0, r7\n\ + lsls r0, 3\n\ + adds r0, r1\n\ + b _080909E0\n\ + .align 2, 0\n\ _0809088C: .4byte gWindowConfig_81E7064\n\ _08090890: .4byte 0x0600c000\n\ _08090894: .4byte 0x040000d4\n\ _08090898: .4byte 0x81000100\n\ _0809089C: .4byte gTasks\n\ _080908A0:\n\ - ldr r0, _080908C8 @ =gDexText_RegisterComplete\n\ - movs r1, 0x2\n\ - movs r2, 0\n\ - movs r3, 0xD0\n\ - bl sub_8072BD8\n\ - bl IsNationalPokedexEnabled\n\ - cmp r0, 0\n\ - bne _080908CC\n\ - adds r0, r6, 0\n\ - bl NationalToHoennOrder\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - movs r1, 0xD\n\ - movs r2, 0x3\n\ - bl sub_8091154\n\ - b _080908D6\n\ - .align 2, 0\n\ + ldr r0, _080908C8 @ =gDexText_RegisterComplete\n\ + movs r1, 0x2\n\ + movs r2, 0\n\ + movs r3, 0xD0\n\ + bl sub_8072BD8\n\ + bl IsNationalPokedexEnabled\n\ + cmp r0, 0\n\ + bne _080908CC\n\ + adds r0, r6, 0\n\ + bl NationalToHoennOrder\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + movs r1, 0xD\n\ + movs r2, 0x3\n\ + bl sub_8091154\n\ + b _080908D6\n\ + .align 2, 0\n\ _080908C8: .4byte gDexText_RegisterComplete\n\ _080908CC:\n\ - adds r0, r6, 0\n\ - movs r1, 0xD\n\ - movs r2, 0x3\n\ - bl sub_8091154\n\ + adds r0, r6, 0\n\ + movs r1, 0xD\n\ + movs r2, 0x3\n\ + bl sub_8091154\n\ _080908D6:\n\ - adds r0, r6, 0\n\ - movs r1, 0x10\n\ - movs r2, 0x3\n\ - bl sub_80911C8\n\ - ldr r0, _0809094C @ =gDexText_UnknownPoke\n\ - movs r1, 0xB\n\ - movs r2, 0x5\n\ - bl MenuPrint\n\ - ldr r0, _08090950 @ =gDexText_UnknownHeight\n\ - movs r1, 0x10\n\ - movs r2, 0x7\n\ - bl MenuPrint\n\ - ldr r0, _08090954 @ =gDexText_UnknownWeight\n\ - movs r1, 0x10\n\ - movs r2, 0x9\n\ - bl MenuPrint\n\ - lsls r4, r6, 3\n\ - adds r4, r6\n\ - lsls r4, 2\n\ - ldr r6, _08090958 @ =gPokedexEntries\n\ - adds r5, r4, r6\n\ - adds r0, r5, 0\n\ - movs r1, 0xB\n\ - movs r2, 0x5\n\ - bl sub_8091304\n\ - ldrh r0, [r5, 0xC]\n\ - movs r1, 0x10\n\ - movs r2, 0x7\n\ - bl sub_8091458\n\ - ldrh r0, [r5, 0xE]\n\ - movs r1, 0x10\n\ - movs r2, 0x9\n\ - bl sub_8091564\n\ - adds r6, 0x10\n\ - adds r4, r6\n\ - ldr r0, [r4]\n\ - movs r1, 0x2\n\ - movs r2, 0xD\n\ - bl MenuPrint\n\ - movs r1, 0xFF\n\ - lsls r1, 2\n\ - movs r0, 0xE\n\ - bl sub_80917CC\n\ - ldr r1, _0809095C @ =gTasks\n\ - lsls r0, r7, 2\n\ - adds r0, r7\n\ - lsls r0, 3\n\ - adds r0, r1\n\ - b _080909E0\n\ - .align 2, 0\n\ + adds r0, r6, 0\n\ + movs r1, 0x10\n\ + movs r2, 0x3\n\ + bl sub_80911C8\n\ + ldr r0, _0809094C @ =gDexText_UnknownPoke\n\ + movs r1, 0xB\n\ + movs r2, 0x5\n\ + bl MenuPrint\n\ + ldr r0, _08090950 @ =gDexText_UnknownHeight\n\ + movs r1, 0x10\n\ + movs r2, 0x7\n\ + bl MenuPrint\n\ + ldr r0, _08090954 @ =gDexText_UnknownWeight\n\ + movs r1, 0x10\n\ + movs r2, 0x9\n\ + bl MenuPrint\n\ + lsls r4, r6, 3\n\ + adds r4, r6\n\ + lsls r4, 2\n\ + ldr r6, _08090958 @ =gPokedexEntries\n\ + adds r5, r4, r6\n\ + adds r0, r5, 0\n\ + movs r1, 0xB\n\ + movs r2, 0x5\n\ + bl sub_8091304\n\ + ldrh r0, [r5, 0xC]\n\ + movs r1, 0x10\n\ + movs r2, 0x7\n\ + bl sub_8091458\n\ + ldrh r0, [r5, 0xE]\n\ + movs r1, 0x10\n\ + movs r2, 0x9\n\ + bl sub_8091564\n\ + adds r6, 0x10\n\ + adds r4, r6\n\ + ldr r0, [r4]\n\ + movs r1, 0x2\n\ + movs r2, 0xD\n\ + bl MenuPrint\n\ + movs r1, 0xFF\n\ + lsls r1, 2\n\ + movs r0, 0xE\n\ + bl sub_80917CC\n\ + ldr r1, _0809095C @ =gTasks\n\ + lsls r0, r7, 2\n\ + adds r0, r7\n\ + lsls r0, 3\n\ + adds r0, r1\n\ + b _080909E0\n\ + .align 2, 0\n\ _0809094C: .4byte gDexText_UnknownPoke\n\ _08090950: .4byte gDexText_UnknownHeight\n\ _08090954: .4byte gDexText_UnknownWeight\n\ _08090958: .4byte gPokedexEntries\n\ _0809095C: .4byte gTasks\n\ _08090960:\n\ - adds r0, r6, 0\n\ - movs r1, 0x30\n\ - movs r2, 0x38\n\ - movs r3, 0\n\ - bl sub_80918EC\n\ - adds r4, r0, 0\n\ - lsls r4, 24\n\ - lsrs r4, 24\n\ - ldr r0, _080909AC @ =gSprites\n\ - lsls r1, r4, 4\n\ - adds r1, r4\n\ - lsls r1, 2\n\ - adds r1, r0\n\ - ldrb r2, [r1, 0x5]\n\ - movs r0, 0xD\n\ - negs r0, r0\n\ - ands r0, r2\n\ - strb r0, [r1, 0x5]\n\ - movs r0, 0x1\n\ - negs r0, r0\n\ - movs r1, 0\n\ - str r1, [sp]\n\ - movs r2, 0x10\n\ - movs r3, 0\n\ - bl BeginNormalPaletteFade\n\ - ldr r0, _080909B0 @ =gUnknown_03005CEC\n\ - ldr r0, [r0]\n\ - bl SetVBlankCallback\n\ - ldr r1, _080909B4 @ =gTasks\n\ - lsls r0, r7, 2\n\ - adds r0, r7\n\ - lsls r0, 3\n\ - adds r0, r1\n\ - strh r4, [r0, 0xE]\n\ - b _080909E0\n\ - .align 2, 0\n\ + adds r0, r6, 0\n\ + movs r1, 0x30\n\ + movs r2, 0x38\n\ + movs r3, 0\n\ + bl sub_80918EC\n\ + adds r4, r0, 0\n\ + lsls r4, 24\n\ + lsrs r4, 24\n\ + ldr r0, _080909AC @ =gSprites\n\ + lsls r1, r4, 4\n\ + adds r1, r4\n\ + lsls r1, 2\n\ + adds r1, r0\n\ + ldrb r2, [r1, 0x5]\n\ + movs r0, 0xD\n\ + negs r0, r0\n\ + ands r0, r2\n\ + strb r0, [r1, 0x5]\n\ + movs r0, 0x1\n\ + negs r0, r0\n\ + movs r1, 0\n\ + str r1, [sp]\n\ + movs r2, 0x10\n\ + movs r3, 0\n\ + bl BeginNormalPaletteFade\n\ + ldr r0, _080909B0 @ =gUnknown_03005CEC\n\ + ldr r0, [r0]\n\ + bl SetVBlankCallback\n\ + ldr r1, _080909B4 @ =gTasks\n\ + lsls r0, r7, 2\n\ + adds r0, r7\n\ + lsls r0, 3\n\ + adds r0, r1\n\ + strh r4, [r0, 0xE]\n\ + b _080909E0\n\ + .align 2, 0\n\ _080909AC: .4byte gSprites\n\ _080909B0: .4byte gUnknown_03005CEC\n\ _080909B4: .4byte gTasks\n\ _080909B8:\n\ - ldr r0, _080909E8 @ =REG_BLDCNT\n\ - movs r1, 0\n\ - strh r1, [r0]\n\ - adds r0, 0x2\n\ - strh r1, [r0]\n\ - adds r0, 0x2\n\ - strh r1, [r0]\n\ - ldr r1, _080909EC @ =REG_BG3CNT\n\ - ldr r2, _080909F0 @ =0x00000f07\n\ - adds r0, r2, 0\n\ - strh r0, [r1]\n\ - subs r1, 0xE\n\ - movs r5, 0xE2\n\ - lsls r5, 5\n\ - adds r0, r5, 0\n\ - strh r0, [r1]\n\ - lsls r0, r7, 2\n\ - adds r0, r7\n\ - lsls r0, 3\n\ - adds r0, r4\n\ + ldr r0, _080909E8 @ =REG_BLDCNT\n\ + movs r1, 0\n\ + strh r1, [r0]\n\ + adds r0, 0x2\n\ + strh r1, [r0]\n\ + adds r0, 0x2\n\ + strh r1, [r0]\n\ + ldr r1, _080909EC @ =REG_BG3CNT\n\ + ldr r2, _080909F0 @ =0x00000f07\n\ + adds r0, r2, 0\n\ + strh r0, [r1]\n\ + subs r1, 0xE\n\ + movs r5, 0xE2\n\ + lsls r5, 5\n\ + adds r0, r5, 0\n\ + strh r0, [r1]\n\ + lsls r0, r7, 2\n\ + adds r0, r7\n\ + lsls r0, 3\n\ + adds r0, r4\n\ _080909E0:\n\ - ldrh r1, [r0, 0x8]\n\ - adds r1, 0x1\n\ - strh r1, [r0, 0x8]\n\ - b _08090A26\n\ - .align 2, 0\n\ + ldrh r1, [r0, 0x8]\n\ + adds r1, 0x1\n\ + strh r1, [r0, 0x8]\n\ + b _08090A26\n\ + .align 2, 0\n\ _080909E8: .4byte 0x04000050\n\ _080909EC: .4byte 0x0400000E\n\ _080909F0: .4byte 0x00000f07\n\ _080909F4:\n\ - ldr r0, _08090A30 @ =gPaletteFade\n\ - ldrb r1, [r0, 0x7]\n\ - movs r0, 0x80\n\ - ands r0, r1\n\ - lsls r0, 24\n\ - lsrs r5, r0, 24\n\ - cmp r5, 0\n\ - bne _08090A26\n\ - adds r0, r6, 0\n\ - bl NationalPokedexNumToSpecies\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - movs r1, 0\n\ - bl PlayCry1\n\ - ldr r1, _08090A34 @ =gTasks\n\ - lsls r0, r7, 2\n\ - adds r0, r7\n\ - lsls r0, 3\n\ - adds r0, r1\n\ - strh r5, [r0, 0xC]\n\ - strh r5, [r0, 0x10]\n\ - ldr r1, _08090A38 @ =sub_8090A3C\n\ - str r1, [r0]\n\ + ldr r0, _08090A30 @ =gPaletteFade\n\ + ldrb r1, [r0, 0x7]\n\ + movs r0, 0x80\n\ + ands r0, r1\n\ + lsls r0, 24\n\ + lsrs r5, r0, 24\n\ + cmp r5, 0\n\ + bne _08090A26\n\ + adds r0, r6, 0\n\ + bl NationalPokedexNumToSpecies\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + movs r1, 0\n\ + bl PlayCry1\n\ + ldr r1, _08090A34 @ =gTasks\n\ + lsls r0, r7, 2\n\ + adds r0, r7\n\ + lsls r0, 3\n\ + adds r0, r1\n\ + strh r5, [r0, 0xC]\n\ + strh r5, [r0, 0x10]\n\ + ldr r1, _08090A38 @ =sub_8090A3C\n\ + str r1, [r0]\n\ _08090A26:\n\ - add sp, 0x8\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - .align 2, 0\n\ + add sp, 0x8\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .align 2, 0\n\ _08090A30: .4byte gPaletteFade\n\ _08090A34: .4byte gTasks\n\ _08090A38: .4byte sub_8090A3C\n\ @@ -4677,49 +6105,49 @@ __attribute__((naked)) void sub_8092810(u8 a, u8 b, u8 c, u8 d) { asm(".syntax unified\n\ - push {r4-r7,lr}\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - lsls r1, 24\n\ - lsrs r1, 24\n\ - mov r12, r1\n\ - lsls r2, 24\n\ - lsrs r1, r2, 24\n\ - lsls r3, 24\n\ - lsrs r5, r3, 8\n\ - movs r3, 0\n\ - cmp r5, 0\n\ - beq _0809285A\n\ - lsls r7, r1, 6\n\ - ldr r6, _08092860 @ =0x00000fff\n\ - lsls r4, r0, 12\n\ + push {r4-r7,lr}\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + lsls r1, 24\n\ + lsrs r1, 24\n\ + mov r12, r1\n\ + lsls r2, 24\n\ + lsrs r1, r2, 24\n\ + lsls r3, 24\n\ + lsrs r5, r3, 8\n\ + movs r3, 0\n\ + cmp r5, 0\n\ + beq _0809285A\n\ + lsls r7, r1, 6\n\ + ldr r6, _08092860 @ =0x00000fff\n\ + lsls r4, r0, 12\n\ _08092830:\n\ - mov r0, r12\n\ - adds r1, r0, r3\n\ - lsls r1, 1\n\ - adds r1, r7, r1\n\ - ldr r0, _08092864 @ =0x06007800\n\ - adds r2, r1, r0\n\ - ldrh r0, [r2]\n\ - ands r0, r6\n\ - orrs r0, r4\n\ - strh r0, [r2]\n\ - ldr r0, _08092868 @ =0x06007840\n\ - adds r1, r0\n\ - ldrh r0, [r1]\n\ - ands r0, r6\n\ - orrs r0, r4\n\ - strh r0, [r1]\n\ - adds r0, r3, 0x1\n\ - lsls r0, 16\n\ - lsrs r3, r0, 16\n\ - cmp r0, r5\n\ - bcc _08092830\n\ + mov r0, r12\n\ + adds r1, r0, r3\n\ + lsls r1, 1\n\ + adds r1, r7, r1\n\ + ldr r0, _08092864 @ =0x06007800\n\ + adds r2, r1, r0\n\ + ldrh r0, [r2]\n\ + ands r0, r6\n\ + orrs r0, r4\n\ + strh r0, [r2]\n\ + ldr r0, _08092868 @ =0x06007840\n\ + adds r1, r0\n\ + ldrh r0, [r1]\n\ + ands r0, r6\n\ + orrs r0, r4\n\ + strh r0, [r1]\n\ + adds r0, r3, 0x1\n\ + lsls r0, 16\n\ + lsrs r3, r0, 16\n\ + cmp r0, r5\n\ + bcc _08092830\n\ _0809285A:\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - .align 2, 0\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .align 2, 0\n\ _08092860: .4byte 0x00000fff\n\ _08092864: .4byte 0x06007800\n\ _08092868: .4byte 0x06007840\n\ -- cgit v1.2.3 From f37f616252c89d9138489d13c79ca630d5477afd Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 14 Jun 2017 18:43:32 -0500 Subject: remove gPokedexView from pokedex.h --- src/pokedex.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/pokedex.c b/src/pokedex.c index dd0c669d4..b6333b8fa 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -19,6 +19,58 @@ #include "task.h" #include "trig.h" +struct PokedexListItem +{ + u16 dexNum; + u16 seen:1; + u16 owned:1; +}; + +struct PokedexView +{ + struct PokedexListItem unk0[386]; + u16 unk608; + u8 unk60A_1:1; + u8 unk60A_2:1; + u8 unk60B; + u16 unk60C; + u16 selectedPokemon; + u16 unk610; + u16 dexMode; //National or Hoenn + u16 unk614; + u16 dexOrder; + u16 unk618; + u16 unk61A; + u16 unk61C; + u16 unk61E[4]; + u16 unk626; //sprite id of selected Pokemon + u16 unk628; + u16 unk62A; + u8 unk62C; + u8 unk62D; + u8 unk62E; + u8 unk62F; + s16 unk630; + s16 unk632; + u16 unk634; + u16 unk636; + u16 unk638; + u16 unk63A[4]; + u8 filler642[8]; + u8 unk64A; + u8 unk64B; + u8 unk64C_1:1; + u8 selectedScreen; + u8 unk64E; // description page + u8 unk64F; + u8 menuIsOpen; //menuIsOpen + u8 unk651; + u16 menuCursorPos; //Menu cursor position + s16 menuY; //Menu Y position (inverted because we use REG_BG0VOFS for this) + u8 unk656[8]; + u8 unk65E[8]; +}; + // I'm #define-ing these just for now so I can keep using the old unkXXX member names #define unk60E selectedPokemon #define unk612 dexMode @@ -1602,6 +1654,8 @@ const union AnimCmd *const gSpriteAnimTable_83A0520[] = gSpriteAnim_83A04CC, }; +static u8 sub_808F210(struct PokedexListItem *, u8); +static u8 sub_808F284(struct PokedexListItem *, u8); void sub_8090B8C(u8); void sub_8090C28(struct Sprite *); u16 NationalPokedexNumToSpecies(u16); @@ -1666,7 +1720,7 @@ void sub_808C0B8(void) TransferPlttBuffer(); } -void ClearPokedexView(struct PokedexView *pokedexView) +static void ClearPokedexView(struct PokedexView *pokedexView) { u16 i; @@ -3587,7 +3641,7 @@ void sub_808F168(struct Sprite *sprite) } } -u8 sub_808F210(struct PokedexListItem *item, u8 b) +static u8 sub_808F210(struct PokedexListItem *item, u8 b) { u8 taskId; @@ -3609,7 +3663,7 @@ bool8 sub_808F250(u8 taskId) return 1; } -u8 sub_808F284(struct PokedexListItem *item, u8 b) +static u8 sub_808F284(struct PokedexListItem *item, u8 b) { gUnknown_0202FFBC = item; gTasks[b].data[0] = 1; -- cgit v1.2.3 From f8765c07ab36bd009036e44a97a131b0a7d8fe27 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 14 Jun 2017 20:52:56 -0500 Subject: style and formatting --- src/pokedex.c | 545 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 275 insertions(+), 270 deletions(-) (limited to 'src') diff --git a/src/pokedex.c b/src/pokedex.c index b6333b8fa..5f34a57c2 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -19,6 +19,8 @@ #include "task.h" #include "trig.h" +#define NATIONAL_DEX_COUNT 386 + struct PokedexListItem { u16 dexNum; @@ -28,22 +30,22 @@ struct PokedexListItem struct PokedexView { - struct PokedexListItem unk0[386]; + struct PokedexListItem unk0[NATIONAL_DEX_COUNT]; u16 unk608; u8 unk60A_1:1; u8 unk60A_2:1; u8 unk60B; - u16 unk60C; + u16 pokemonListCount; u16 selectedPokemon; u16 unk610; - u16 dexMode; //National or Hoenn + u16 dexMode; u16 unk614; u16 dexOrder; u16 unk618; u16 unk61A; u16 unk61C; u16 unk61E[4]; - u16 unk626; //sprite id of selected Pokemon + u16 selectedMonSpriteId; u16 unk628; u16 unk62A; u8 unk62C; @@ -61,7 +63,7 @@ struct PokedexView u8 unk64B; u8 unk64C_1:1; u8 selectedScreen; - u8 unk64E; // description page + u8 descriptionPageNum; u8 unk64F; u8 menuIsOpen; //menuIsOpen u8 unk651; @@ -71,15 +73,6 @@ struct PokedexView u8 unk65E[8]; }; -// I'm #define-ing these just for now so I can keep using the old unkXXX member names -#define unk60E selectedPokemon -#define unk612 dexMode -#define unk616 dexOrder -#define unk64D selectedScreen -#define unk650 menuIsOpen -#define unk652 menuCursorPos -#define unk654 menuY - enum { DEX_MODE_HOENN, @@ -1654,11 +1647,12 @@ const union AnimCmd *const gSpriteAnimTable_83A0520[] = gSpriteAnim_83A04CC, }; +static u32 sub_808E8C8(u16 a, s16 b, s16 c); static u8 sub_808F210(struct PokedexListItem *, u8); static u8 sub_808F284(struct PokedexListItem *, u8); void sub_8090B8C(u8); void sub_8090C28(struct Sprite *); -u16 NationalPokedexNumToSpecies(u16); +u16 sub_80918EC(u16 a, s16 b, s16 c, u16 d); //Not sure of return type void sub_8091E54(u8); void sub_809204C(u8); void sub_809207C(u8); @@ -1680,7 +1674,7 @@ u8 sub_8092E10(u8, u8); void sub_8092EB0(u8); void sub_809308C(u8); -// asm/pokedex_area_screen +extern u16 NationalPokedexNumToSpecies(u16); void ShowPokedexAreaScreen(u16 species, u8 *string); void ResetPokedex(void) @@ -1724,7 +1718,7 @@ static void ClearPokedexView(struct PokedexView *pokedexView) { u16 i; - for (i = 0; i <= 385; i++) + for (i = 0; i < NATIONAL_DEX_COUNT; i++) { pokedexView->unk0[i].dexNum |= 0xFFFF; pokedexView->unk0[i].seen = 0; @@ -1733,7 +1727,7 @@ static void ClearPokedexView(struct PokedexView *pokedexView) pokedexView->unk608 = 0; pokedexView->unk60A_1 = 0; pokedexView->unk60A_2 = 0; - pokedexView->unk60C = 0; + pokedexView->pokemonListCount = 0; pokedexView->selectedPokemon = 0; pokedexView->unk610 = 0; pokedexView->dexMode = 0; @@ -1838,7 +1832,7 @@ void CB2_InitPokedex(void) gPokedexView->selectedPokemon = gUnknown_0202FFB8; gPokedexView->unk62C = gUnknown_0202FFBA; gPokedexView->selectedScreen = PAGE_SCREEN; - gPokedexView->unk64E = 0; + gPokedexView->descriptionPageNum = 0; if (!IsNationalPokedexEnabled()) { gPokedexView->unk61A = GetHoennPokedexCount(0); @@ -1925,9 +1919,9 @@ void Task_PokedexMainScreen(u8 taskId) { sub_808E6BC(); BeginNormalPaletteFade( - ~(1 << (gSprites[gPokedexView->unk626].oam.paletteNum + 16)), + ~(1 << (gSprites[gPokedexView->selectedMonSpriteId].oam.paletteNum + 16)), 0, 0, 0x10, 0); - gSprites[gPokedexView->unk626].callback = sub_808EDB8; + gSprites[gPokedexView->selectedMonSpriteId].callback = sub_808EDB8; gTasks[taskId].func = sub_808CA64; PlaySE(SE_PIN); } @@ -1972,9 +1966,7 @@ void Task_PokedexMainScreen(u8 taskId) void sub_808C898(u8 taskId) { if (sub_808E208(gPokedexView->unk62F, gPokedexView->unk634, gPokedexView->unk636)) - { gTasks[taskId].func = Task_PokedexMainScreen; - } } //Bring up menu and process menu input @@ -2003,8 +1995,8 @@ void Task_PokedexMainScreenMenu(u8 taskId) gMain.newKeys |= START_BUTTON; //Exit menu break; case 2: //LIST BOTTOM - gPokedexView->selectedPokemon = gPokedexView->unk60C - 1; - gPokedexView->unk62C = gPokedexView->unk60C * 16 + 0x30; + gPokedexView->selectedPokemon = gPokedexView->pokemonListCount - 1; + gPokedexView->unk62C = gPokedexView->pokemonListCount * 16 + 0x30; sub_808E82C(); sub_808E0CC(gPokedexView->selectedPokemon, 0xE); gMain.newKeys |= START_BUTTON; //Exit menu @@ -2039,11 +2031,11 @@ void Task_PokedexMainScreenMenu(u8 taskId) void sub_808CA64(u8 taskId) { - if (gSprites[gPokedexView->unk626].pos1.x == 0x30 && - gSprites[gPokedexView->unk626].pos1.y == 0x38) + if (gSprites[gPokedexView->selectedMonSpriteId].pos1.x == 48 + && gSprites[gPokedexView->selectedMonSpriteId].pos1.y == 56) { gPokedexView->unk64B = gPokedexView->unk64A; - gTasks[taskId].data[0] = sub_808F210(&gPokedexView->unk0[gPokedexView->selectedPokemon], gPokedexView->unk626); + gTasks[taskId].data[0] = sub_808F210(&gPokedexView->unk0[gPokedexView->selectedPokemon], gPokedexView->selectedMonSpriteId); gTasks[taskId].func = sub_808CAE4; } } @@ -2052,12 +2044,8 @@ void sub_808CAE4(u8 taskId) { if (gTasks[gTasks[taskId].data[0]].isActive) { - if (gPokedexView->unk64A == 1 && - !sub_808F250(gTasks[taskId].data[0]) && - sub_808E71C()) - { + if (gPokedexView->unk64A == 1 && !sub_808F250(gTasks[taskId].data[0]) && sub_808E71C()) sub_808F284(&gPokedexView->unk0[gPokedexView->selectedPokemon], gTasks[taskId].data[0]); - } } else { @@ -2073,7 +2061,7 @@ void sub_808CB8C(u8 taskId) if (!isActive) { - if (gPokedexView->unk64F) + if (gPokedexView->unk64F != 0) { gPokedexView->selectedPokemon = isActive; gPokedexView->unk62C = 0x40; @@ -2118,7 +2106,9 @@ void Task_PokedexResultsScreen(u8 taskId) REG_BG0VOFS = gPokedexView->menuY; if (gPokedexView->menuY) + { gPokedexView->menuY -= 8; + } else { if ((gMain.newKeys & A_BUTTON) && gPokedexView->unk0[gPokedexView->selectedPokemon].seen) @@ -2126,8 +2116,8 @@ void Task_PokedexResultsScreen(u8 taskId) u32 a; sub_808E6BC(); - a = (1 << (gSprites[gPokedexView->unk626].oam.paletteNum + 16)); - gSprites[gPokedexView->unk626].callback = sub_808EDB8; + a = (1 << (gSprites[gPokedexView->selectedMonSpriteId].oam.paletteNum + 16)); + gSprites[gPokedexView->selectedMonSpriteId].callback = sub_808EDB8; BeginNormalPaletteFade(~a, 0, 0, 0x10, 0); gTasks[taskId].func = sub_808D118; PlaySE(SE_PIN); @@ -2174,8 +2164,10 @@ void Task_PokedexResultsScreenMenu(u8 taskId) { REG_BG0VOFS = gPokedexView->menuY; - if (gPokedexView->menuY != 0x60) + if (gPokedexView->menuY != 96) + { gPokedexView->menuY += 8; + } else { if (gMain.newKeys & A_BUTTON) @@ -2194,8 +2186,8 @@ void Task_PokedexResultsScreenMenu(u8 taskId) gMain.newKeys |= START_BUTTON; break; case 2: //LIST BOTTOM - gPokedexView->selectedPokemon = gPokedexView->unk60C - 1; - gPokedexView->unk62C = gPokedexView->unk60C * 16 + 0x30; + gPokedexView->selectedPokemon = gPokedexView->pokemonListCount - 1; + gPokedexView->unk62C = gPokedexView->pokemonListCount * 16 + 0x30; sub_808E82C(); sub_808E0CC(gPokedexView->selectedPokemon, 0xE); gMain.newKeys |= START_BUTTON; @@ -2235,11 +2227,11 @@ void Task_PokedexResultsScreenMenu(u8 taskId) void sub_808D118(u8 taskId) { - if (gSprites[gPokedexView->unk626].pos1.x == 0x30 && - gSprites[gPokedexView->unk626].pos1.y == 0x38) + if (gSprites[gPokedexView->selectedMonSpriteId].pos1.x == 48 + && gSprites[gPokedexView->selectedMonSpriteId].pos1.y == 56) { gPokedexView->unk64B = gPokedexView->unk64A; - gTasks[taskId].data[0] = sub_808F210(&gPokedexView->unk0[gPokedexView->selectedPokemon], gPokedexView->unk626); + gTasks[taskId].data[0] = sub_808F210(&gPokedexView->unk0[gPokedexView->selectedPokemon], gPokedexView->selectedMonSpriteId); gTasks[taskId].func = sub_808D198; } } @@ -2248,12 +2240,8 @@ void sub_808D198(u8 taskId) { if (gTasks[gTasks[taskId].data[0]].isActive) { - if (gPokedexView->unk64A == 1 && - !sub_808F250(gTasks[taskId].data[0]) && - sub_808E71C()) - { + if (gPokedexView->unk64A == 1 && !sub_808F250(gTasks[taskId].data[0]) && sub_808E71C()) sub_808F284(&gPokedexView->unk0[gPokedexView->selectedPokemon], gTasks[taskId].data[0]); - } } else { @@ -2298,7 +2286,6 @@ bool8 sub_808D344(u8 a) default: if (gPaletteFade.active) return 0; - //_0808D39E SetVBlankCallback(NULL); gPokedexView->unk64A = a; sub_8091060(0); @@ -2367,12 +2354,11 @@ bool8 sub_808D344(u8 a) if (!gPaletteFade.active) { gMain.state = 0; - return 1; + return TRUE; } - else - return 0; + break; } - return 0; + return FALSE; } void sub_808D640(void) @@ -2390,7 +2376,7 @@ void SortPokedex(u8 dexMode, u8 sortMode) u16 vars[3]; //I have no idea why three regular variables are stored in an array, but whatever. s16 i; - gPokedexView->unk60C = 0; + gPokedexView->pokemonListCount = 0; switch (dexMode) { @@ -2402,7 +2388,7 @@ void SortPokedex(u8 dexMode, u8 sortMode) case DEX_MODE_NATIONAL: if (IsNationalPokedexEnabled()) { - vars[0] = 386; + vars[0] = NATIONAL_DEX_COUNT; vars[1] = 0; } else @@ -2416,7 +2402,6 @@ void SortPokedex(u8 dexMode, u8 sortMode) switch (sortMode) { case 0: - { if (vars[1]) { for (i = 0; i < vars[0]; i++) @@ -2426,7 +2411,7 @@ void SortPokedex(u8 dexMode, u8 sortMode) gPokedexView->unk0[i].seen = sub_8090D90(vars[2], 0); gPokedexView->unk0[i].owned = sub_8090D90(vars[2], 1); if (gPokedexView->unk0[i].seen) - gPokedexView->unk60C = i + 1; + gPokedexView->pokemonListCount = i + 1; } } else @@ -2447,13 +2432,12 @@ void SortPokedex(u8 dexMode, u8 sortMode) gPokedexView->unk0[r5].seen = sub_8090D90(vars[2], 0); gPokedexView->unk0[r5].owned = sub_8090D90(vars[2], 1); if (gPokedexView->unk0[r5].seen) - gPokedexView->unk60C = r5 + 1; + gPokedexView->pokemonListCount = r5 + 1; r5++; } } } break; - } case 1: for (i = 0; i < 411; i++) { @@ -2461,71 +2445,72 @@ void SortPokedex(u8 dexMode, u8 sortMode) if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 0)) { - gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2]; - gPokedexView->unk0[gPokedexView->unk60C].seen = 1; - gPokedexView->unk0[gPokedexView->unk60C].owned = sub_8090D90(vars[2], 1); - gPokedexView->unk60C++; + gPokedexView->unk0[gPokedexView->pokemonListCount].dexNum = vars[2]; + gPokedexView->unk0[gPokedexView->pokemonListCount].seen = 1; + gPokedexView->unk0[gPokedexView->pokemonListCount].owned = sub_8090D90(vars[2], 1); + gPokedexView->pokemonListCount++; } } break; case 2: - for (i = 385; i >= 0; i--) + for (i = NATIONAL_DEX_COUNT - 1; i >= 0; i--) { vars[2] = gPokedexOrder_Weight[i]; if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 1)) { - gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2]; - gPokedexView->unk0[gPokedexView->unk60C].seen = 1; - gPokedexView->unk0[gPokedexView->unk60C].owned = 1; - gPokedexView->unk60C++; + gPokedexView->unk0[gPokedexView->pokemonListCount].dexNum = vars[2]; + gPokedexView->unk0[gPokedexView->pokemonListCount].seen = 1; + gPokedexView->unk0[gPokedexView->pokemonListCount].owned = 1; + gPokedexView->pokemonListCount++; } } break; case 3: - for (i = 0; i < 386; i++) + for (i = 0; i < NATIONAL_DEX_COUNT; i++) { vars[2] = gPokedexOrder_Weight[i]; if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 1)) { - gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2]; - gPokedexView->unk0[gPokedexView->unk60C].seen = 1; - gPokedexView->unk0[gPokedexView->unk60C].owned = 1; - gPokedexView->unk60C++; + gPokedexView->unk0[gPokedexView->pokemonListCount].dexNum = vars[2]; + gPokedexView->unk0[gPokedexView->pokemonListCount].seen = 1; + gPokedexView->unk0[gPokedexView->pokemonListCount].owned = 1; + gPokedexView->pokemonListCount++; } } break; case 4: - for (i = 385; i >=0; i--) + for (i = NATIONAL_DEX_COUNT - 1; i >=0; i--) { vars[2] = gPokedexOrder_Height[i]; if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 1)) { - gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2]; - gPokedexView->unk0[gPokedexView->unk60C].seen = 1; - gPokedexView->unk0[gPokedexView->unk60C].owned = 1; - gPokedexView->unk60C++; + gPokedexView->unk0[gPokedexView->pokemonListCount].dexNum = vars[2]; + gPokedexView->unk0[gPokedexView->pokemonListCount].seen = 1; + gPokedexView->unk0[gPokedexView->pokemonListCount].owned = 1; + gPokedexView->pokemonListCount++; } } break; case 5: - for (i = 0; i < 386; i++) + for (i = 0; i < NATIONAL_DEX_COUNT; i++) { vars[2] = gPokedexOrder_Height[i]; if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 1)) { - gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2]; - gPokedexView->unk0[gPokedexView->unk60C].seen = 1; - gPokedexView->unk0[gPokedexView->unk60C].owned = 1; - gPokedexView->unk60C++; + gPokedexView->unk0[gPokedexView->pokemonListCount].dexNum = vars[2]; + gPokedexView->unk0[gPokedexView->pokemonListCount].seen = 1; + gPokedexView->unk0[gPokedexView->pokemonListCount].owned = 1; + gPokedexView->pokemonListCount++; } } break; } - for (i = gPokedexView->unk60C; i < 386; i++) + + for (i = gPokedexView->pokemonListCount; i < NATIONAL_DEX_COUNT; i++) { gPokedexView->unk0[i].dexNum |= 0xFFFF; gPokedexView->unk0[i].seen = 0; @@ -2535,18 +2520,21 @@ void SortPokedex(u8 dexMode, u8 sortMode) void sub_808DBE8(u8 a, u16 b, u16 c) { + s16 _b; + u16 i; + u16 r2; + switch (a) { case 0: default: - { - u16 i; - s16 _b = b - 5; - + _b = b - 5; for (i = 0; i <= 10; i++) { - if ((u16)_b > 385 || gPokedexView->unk0[_b].dexNum == 0xFFFF) + if (_b < 0 || _b >= NATIONAL_DEX_COUNT || gPokedexView->unk0[_b].dexNum == 0xFFFF) + { sub_808E090(0x11, i * 2, c); + } else { sub_808E090(0x11, i * 2, c); @@ -2566,13 +2554,12 @@ void sub_808DBE8(u8 a, u16 b, u16 c) _b++; } break; - } case 1: - { - s16 _b = b - 5; - - if ((u16)_b > 385 || gPokedexView->unk0[_b].dexNum == 0xFFFF) + _b = b - 5; + if (_b < 0 || _b >= NATIONAL_DEX_COUNT || gPokedexView->unk0[_b].dexNum == 0xFFFF) + { sub_808E090(0x11, gPokedexView->unk630 * 2, c); + } else { sub_808E090(0x11, gPokedexView->unk630 * 2, c); @@ -2590,15 +2577,12 @@ void sub_808DBE8(u8 a, u16 b, u16 c) } } break; - } case 2: - { - s16 _b = b + 5; - u16 r2 = gPokedexView->unk630 + 10; - + _b = b + 5; + r2 = gPokedexView->unk630 + 10; if (r2 > 15) r2 -= 16; - if ((u16)_b > 385 || gPokedexView->unk0[_b].dexNum == 0xFFFF) + if (_b < 0 || _b >= NATIONAL_DEX_COUNT || gPokedexView->unk0[_b].dexNum == 0xFFFF) sub_808E090(0x11, r2 * 2, c); else { @@ -2618,7 +2602,6 @@ void sub_808DBE8(u8 a, u16 b, u16 c) } break; } - } } void sub_808DEB0(u16 a, u8 b, u8 c, u16 d) @@ -2631,12 +2614,12 @@ void sub_808DEB0(u16 a, u8 b, u8 c, u16 d) r7 = NationalToHoennOrder(r7); unk[0] = 0x3FC; unk[1] = 0x3FD; - text[0] = r7 / 100 + 0xA1; - text[1] = (r7 % 100) / 10 + 0xA1; - text[2] = (r7 % 100) % 10 + 0xA1; - text[3] = 0xFF; + text[0] = CHAR_0 + r7 / 100; + text[1] = CHAR_0 + (r7 % 100) / 10; + text[2] = CHAR_0 + (r7 % 100) % 10; + text[3] = EOS; *(u16 *)(VRAM + d * 0x800 + c * 0x40 + b * 2) = unk[0]; - *(u16 *)(VRAM + 0x40 + d * 0x800 + c * 0x40 + b * 2) = unk[1]; + *(u16 *)(VRAM + d * 0x800 + (c + 1) * 0x40 + b * 2) = unk[1]; MenuPrint(text, b - 15, c); } @@ -2655,7 +2638,7 @@ void sub_808DF88(u16 a, u8 b, u8 c, u16 d) unk[1] = 0; } *(u16 *)(VRAM + d * 0x800 + c * 0x40 + b * 2) = unk[0]; - *(u16 *)(VRAM + 0x40 + d * 0x800 + c * 0x40 + b * 2) = unk[1]; + *(u16 *)(VRAM + d * 0x800 + (c + 1) * 0x40 + b * 2) = unk[1]; } u8 sub_808DFE4(u16 num, u8 b, u8 c) @@ -2664,8 +2647,9 @@ u8 sub_808DFE4(u16 num, u8 b, u8 c) u8 i; for (i = 0; i < 10; i++) - text[i] = 0; + text[i] = CHAR_SPACE; text[i] = EOS; + num = NationalPokedexNumToSpecies(num); switch (num) { @@ -2675,7 +2659,7 @@ u8 sub_808DFE4(u16 num, u8 b, u8 c) break; case 0: for (i = 0; i < 10; i++) - text[i] = 0xAE; + text[i] = CHAR_HYPHEN; break; } MenuPrint_PixelCoords(text, (b - 0x11) * 8 + 0xFC, c * 8, 0); @@ -2689,7 +2673,7 @@ void sub_808E090(u8 a, u8 b, u16 c) for (i = 0; i < 12; i++) { *(u16 *)(VRAM + c * 0x800 + b * 64 + (a + i) * 2) = 0; - *(u16 *)(VRAM + 0x40 + c * 0x800 + b * 64 + (a + i) * 2) = 0; + *(u16 *)(VRAM + c * 0x800 + (b + 1) * 64 + (a + i) * 2) = 0; } } @@ -2700,10 +2684,11 @@ void sub_808E0CC(u16 a, u16 b) u8 spriteId; for (i = 0; i < 4; i++) - gPokedexView->unk61E[i] |= 0xFFFF; - gPokedexView->unk626 = 0xFFFF; + gPokedexView->unk61E[i] = 0xFFFF; + gPokedexView->selectedMonSpriteId = 0xFFFF; sub_808DBE8(0, a, b); REG_BG2VOFS = gPokedexView->unk62D; + unk = sub_808E888(a - 1); if (unk != 0xFFFF) { @@ -2711,6 +2696,7 @@ void sub_808E0CC(u16 a, u16 b) gSprites[spriteId].callback = sub_808EE28; gSprites[spriteId].data5 = -32; } + unk = sub_808E888(a); if (unk != 0xFFFF) { @@ -2718,6 +2704,7 @@ void sub_808E0CC(u16 a, u16 b) gSprites[spriteId].callback = sub_808EE28; gSprites[spriteId].data5 = 0; } + unk = sub_808E888(a + 1); if (unk != 0xFFFF) { @@ -2725,6 +2712,7 @@ void sub_808E0CC(u16 a, u16 b) gSprites[spriteId].callback = sub_808EE28; gSprites[spriteId].data5 = 32; } + gPokedexView->unk630 = 0; gPokedexView->unk632 = 0; } @@ -2760,13 +2748,12 @@ bool8 sub_808E208(u8 a, u8 b, u8 c) gPokedexView->unk62C += gPokedexView->unk628; break; } - return 0; + return FALSE; } - //_0808E36C else { REG_BG2VOFS = gPokedexView->unk62D + gPokedexView->unk630 * 16; - return 1; + return TRUE; } } @@ -2785,12 +2772,12 @@ void sub_808E398(u8 a, u16 b) { spriteId = sub_808E8C8(unk, 0x60, 0x50); gSprites[spriteId].callback = sub_808EE28; - gSprites[spriteId].data5 = 0xFFC0; + gSprites[spriteId].data5 = -64; } if (gPokedexView->unk630 > 0) gPokedexView->unk630--; else - gPokedexView->unk630 = 0xF; + gPokedexView->unk630 = 15; break; } case 2: @@ -2825,7 +2812,7 @@ u16 sub_808E48C(u16 a, u16 b) //_0808E4B6 if (gMain.heldKeys & 0x80) { - if (a < gPokedexView->unk60C - 1) + if (a < gPokedexView->pokemonListCount - 1) goto _0808E5C4; } //_0808E4CE @@ -2836,7 +2823,7 @@ u16 sub_808E48C(u16 a, u16 b) //_0808E4E0 for (i = 0; i < 7; i++) { - a = sub_8091818(1, a, 0, gPokedexView->unk60C - 1); + a = sub_8091818(1, a, 0, gPokedexView->pokemonListCount - 1); } gPokedexView->unk62C += (a - r6) * 16; @@ -2846,13 +2833,13 @@ u16 sub_808E48C(u16 a, u16 b) goto _0808E5A2; } //_0808E53C - if (!(gMain.newKeys & 0x10) || a >= gPokedexView->unk60C - 1) + if (!(gMain.newKeys & 0x10) || a >= gPokedexView->pokemonListCount - 1) goto _0808E5A2; r6 = a; for (i = 0; i < 7; i++) { - a = sub_8091818(0, a, 0, gPokedexView->unk60C - 1); + a = sub_8091818(0, a, 0, gPokedexView->pokemonListCount - 1); } gPokedexView->unk62C += (a - r6) * 16; @@ -2869,7 +2856,7 @@ u16 sub_808E48C(u16 a, u16 b) _0808E5C4: r10 = 2; - a = sub_8091818(0, a, 0, gPokedexView->unk60C - 1); + a = sub_8091818(0, a, 0, gPokedexView->pokemonListCount - 1); sub_808E398(2, a); //goto _0808E60E sub_808DBE8(2, a, b); @@ -2879,7 +2866,7 @@ u16 sub_808E48C(u16 a, u16 b) else { r10 = 1; - a = sub_8091818(1, a, 0, gPokedexView->unk60C - 1); + a = sub_8091818(1, a, 0, gPokedexView->pokemonListCount - 1); sub_808E398(1, a); //_0808E60E sub_808DBE8(1, a, b); @@ -3180,7 +3167,7 @@ void sub_808E6BC(void) u16 spriteId = gPokedexView->unk61E[i]; if (gSprites[spriteId].pos2.x == 0 && gSprites[spriteId].pos2.y == 0 && spriteId != 0xFFFF) - gPokedexView->unk626 = spriteId; + gPokedexView->selectedMonSpriteId = spriteId; } } @@ -3194,7 +3181,7 @@ u8 sub_808E71C(void) r2 = r4; while (r2 != 0) { - r2 = sub_8091818(1, r2, 0, gPokedexView->unk60C - 1); + r2 = sub_8091818(1, r2, 0, gPokedexView->pokemonListCount - 1); if (gPokedexView->unk0[r2].seen) { @@ -3212,12 +3199,12 @@ u8 sub_808E71C(void) return 1; } } - else if ((gMain.newKeys & DPAD_DOWN) && r4 < gPokedexView->unk60C - 1) + else if ((gMain.newKeys & DPAD_DOWN) && r4 < gPokedexView->pokemonListCount - 1) { r2 = r4; - while (r2 < gPokedexView->unk60C - 1) + while (r2 < gPokedexView->pokemonListCount - 1) { - r2 = sub_8091818(0, r2, 0, gPokedexView->unk60C - 1); + r2 = sub_8091818(0, r2, 0, gPokedexView->pokemonListCount - 1); if (gPokedexView->unk0[r2].seen) { @@ -3255,7 +3242,7 @@ u8 sub_808E82C(void) u16 sub_808E888(u16 a1) { - if (a1 > 385 || gPokedexView->unk0[a1].dexNum == 0xFFFF) + if (a1 >= NATIONAL_DEX_COUNT || gPokedexView->unk0[a1].dexNum == 0xFFFF) return 0xFFFF; else if (gPokedexView->unk0[a1].seen) return gPokedexView->unk0[a1].dexNum; @@ -3263,7 +3250,7 @@ u16 sub_808E888(u16 a1) return 0; } -u32 sub_808E8C8(u16 a, u16 b, u16 c) +static u32 sub_808E8C8(u16 a, s16 b, s16 c) { u8 i; @@ -3271,7 +3258,7 @@ u32 sub_808E8C8(u16 a, u16 b, u16 c) { if (gPokedexView->unk61E[i] == 0xFFFF) { - u8 spriteId = sub_80918EC(a, (s16)b, (s16)c, i); + u8 spriteId = sub_80918EC(a, b, c, i); gSprites[spriteId].oam.affineMode = 1; gSprites[spriteId].oam.priority = 3; @@ -3290,33 +3277,33 @@ void sub_808E978(u8 a) u8 spriteId; u16 r5; - spriteId = CreateSprite(&gSpriteTemplate_83A053C, 0xB8, 4, 0); + spriteId = CreateSprite(&gSpriteTemplate_83A053C, 184, 4, 0); gSprites[spriteId].data1 = 0; - spriteId = CreateSprite(&gSpriteTemplate_83A053C, 0xB8, 0x9C, 0); + spriteId = CreateSprite(&gSpriteTemplate_83A053C, 184, 156, 0); gSprites[spriteId].data1 = 1; gSprites[spriteId].vFlip = 1; - CreateSprite(&gSpriteTemplate_83A0524, 0xEA, 0x14, 0); - CreateSprite(&gSpriteTemplate_83A0554, 0x10, 0x8A, 0); + CreateSprite(&gSpriteTemplate_83A0524, 234, 20, 0); + CreateSprite(&gSpriteTemplate_83A0554, 16, 138, 0); - spriteId = CreateSprite(&gSpriteTemplate_83A0554, 0x30, 0x8A, 0); + spriteId = CreateSprite(&gSpriteTemplate_83A0554, 48, 138, 0); StartSpriteAnim(&gSprites[spriteId], 3); - spriteId = CreateSprite(&gSpriteTemplate_83A0554, 0x10, 0x9E, 0); + spriteId = CreateSprite(&gSpriteTemplate_83A0554, 16, 158, 0); StartSpriteAnim(&gSprites[spriteId], 2); gSprites[spriteId].data2 = 0x80; - spriteId = CreateSprite(&gSpriteTemplate_83A0554, 0x30, 0x9E, 0); + spriteId = CreateSprite(&gSpriteTemplate_83A0554, 48, 158, 0); StartSpriteAnim(&gSprites[spriteId], 1); - spriteId = CreateSprite(&gSpriteTemplate_83A056C, 0, 0x50, 2); + spriteId = CreateSprite(&gSpriteTemplate_83A056C, 0, 80, 2); gSprites[spriteId].oam.affineMode = 1; gSprites[spriteId].oam.matrixNum = 30; gSprites[spriteId].data0 = 0x1E; gSprites[spriteId].data1 = 0; - spriteId = CreateSprite(&gSpriteTemplate_83A056C, 0, 0x50, 2); + spriteId = CreateSprite(&gSpriteTemplate_83A056C, 0, 80, 2); gSprites[spriteId].oam.affineMode = 1; gSprites[spriteId].oam.matrixNum = 31; gSprites[spriteId].data0 = 0x1F; @@ -3326,58 +3313,58 @@ void sub_808E978(u8 a) { u32 _a; - CreateSprite(&gSpriteTemplate_83A0584, 0x20, 0x28, 1); + CreateSprite(&gSpriteTemplate_83A0584, 32, 40, 1); - spriteId = CreateSprite(&gSpriteTemplate_83A0584, 0x20, 0x48, 1); + spriteId = CreateSprite(&gSpriteTemplate_83A0584, 32, 72, 1); StartSpriteAnim(&gSprites[spriteId], 1); _a = 0; - spriteId = CreateSprite(&gSpriteTemplate_83A059C, 0x1C, 0x30, 1); + spriteId = CreateSprite(&gSpriteTemplate_83A059C, 28, 48, 1); r5 = gPokedexView->unk61A / 100; StartSpriteAnim(&gSprites[spriteId], r5); if (r5 != 0) _a = 1; else - gSprites[spriteId].invisible = 1; + gSprites[spriteId].invisible = TRUE; - spriteId = CreateSprite(&gSpriteTemplate_83A059C, 0x22, 0x30, 1); + spriteId = CreateSprite(&gSpriteTemplate_83A059C, 34, 48, 1); r5 = (gPokedexView->unk61A % 100) / 10; if (r5 != 0 || _a != 0) StartSpriteAnim(&gSprites[spriteId], r5); else - gSprites[spriteId].invisible = 1; + gSprites[spriteId].invisible = TRUE; - spriteId = CreateSprite(&gSpriteTemplate_83A059C, 0x28, 0x30, 1); + spriteId = CreateSprite(&gSpriteTemplate_83A059C, 40, 48, 1); r5 = (gPokedexView->unk61A % 100) % 10; StartSpriteAnim(&gSprites[spriteId], r5); _a = 0; - spriteId = CreateSprite(&gSpriteTemplate_83A059C, 0x1C, 0x50, 1); + spriteId = CreateSprite(&gSpriteTemplate_83A059C, 28, 80, 1); r5 = gPokedexView->unk61C / 100; StartSpriteAnim(&gSprites[spriteId], r5); if (r5 != 0) _a = 1; else - gSprites[spriteId].invisible = 1; + gSprites[spriteId].invisible = TRUE; - spriteId = CreateSprite(&gSpriteTemplate_83A059C, 0x22, 0x50, 1); + spriteId = CreateSprite(&gSpriteTemplate_83A059C, 34, 80, 1); r5 = (gPokedexView->unk61C % 100) / 10; if (r5 != 0 || _a != 0) StartSpriteAnim(&gSprites[spriteId], r5); else - gSprites[spriteId].invisible = 1; + gSprites[spriteId].invisible = TRUE; - spriteId = CreateSprite(&gSpriteTemplate_83A059C, 0x28, 0x50, 1); + spriteId = CreateSprite(&gSpriteTemplate_83A059C, 40, 80, 1); r5 = (gPokedexView->unk61C % 100) % 10; StartSpriteAnim(&gSprites[spriteId], r5); - spriteId = CreateSprite(&gSpriteTemplate_83A05B4, 0x8C, 0x60, 1); - gSprites[spriteId].invisible = 1; + spriteId = CreateSprite(&gSpriteTemplate_83A05B4, 140, 96, 1); + gSprites[spriteId].invisible = TRUE; } else { - spriteId = CreateSprite(&gSpriteTemplate_83A05B4, 0x8C, 0x50, 1); - gSprites[spriteId].invisible = 1; + spriteId = CreateSprite(&gSpriteTemplate_83A05B4, 140, 80, 1); + gSprites[spriteId].invisible = TRUE; } } @@ -3398,20 +3385,22 @@ void sub_808EDB8(struct Sprite *sprite) sprite->oam.affineMode = 0; sprite->pos2.x = 0; sprite->pos2.y = 0; - if (sprite->pos1.x != 0x30 || sprite->pos1.y != 0x38) + if (sprite->pos1.x != 48 || sprite->pos1.y != 56) { - if (sprite->pos1.x > 0x30) + if (sprite->pos1.x > 48) sprite->pos1.x--; - if (sprite->pos1.x < 0x30) + if (sprite->pos1.x < 48) sprite->pos1.x++; - if (sprite->pos1.y > 0x38) + + if (sprite->pos1.y > 56) sprite->pos1.y--; - if (sprite->pos1.y <0x38) + if (sprite->pos1.y < 56) sprite->pos1.y++; } - //_0808EE1C else + { sprite->callback = nullsub_58; + } } void sub_808EE28(struct Sprite *sprite) @@ -3425,34 +3414,31 @@ void sub_808EE28(struct Sprite *sprite) } else { - //_0808EE58 - s32 var; + u32 var; sprite->pos2.y = gSineTable[(u8)sprite->data5] * 76 / 256; var = 0x10000 / gSineTable[sprite->data5 + 0x40]; - if ((u32)var > 0xFFFF) + if (var > 0xFFFF) var = 0xFFFF; SetOamMatrix(sprite->data1 + 1, 0x100, 0, 0, var); sprite->oam.matrixNum = data1 + 1; - //ToDo: clean up these inequalities - if ((u16)(sprite->data5 + 0x3F) <= 0x7E) + if (sprite->data5 > -64 && sprite->data5 < 64) { - sprite->invisible = 0; + sprite->invisible = FALSE; sprite->data0 = 1; } else { - sprite->invisible = 1; + sprite->invisible = TRUE; } - //_0808EEF8 - if ((u16)(sprite->data5 + 0x3F) > 0x7E && sprite->data0 != 0) + + if ((sprite->data5 <= -64 || sprite->data5 >= 64) && sprite->data0 != 0) { DestroySprite(sprite); gPokedexView->unk61E[data1] = 0xFFFF; } } - //_0808EF16 } void sub_808EF38(struct Sprite *sprite) @@ -3460,39 +3446,41 @@ void sub_808EF38(struct Sprite *sprite) if (gPokedexView->unk64A != 0 && gPokedexView->unk64A != 3) DestroySprite(sprite); else - sprite->pos2.y = gPokedexView->selectedPokemon * 120 / (gPokedexView->unk60C - 1); + sprite->pos2.y = gPokedexView->selectedPokemon * 120 / (gPokedexView->pokemonListCount - 1); } void sub_808EF8C(struct Sprite *sprite) { if (gPokedexView->unk64A != 0 && gPokedexView->unk64A != 3) + { DestroySprite(sprite); + } else { u8 r0; if (sprite->data1 != 0) { - if (gPokedexView->selectedPokemon == gPokedexView->unk60C - 1) - sprite->invisible = 1; + if (gPokedexView->selectedPokemon == gPokedexView->pokemonListCount - 1) + sprite->invisible = TRUE; else - sprite->invisible = 0; + sprite->invisible = FALSE; r0 = sprite->data2; } else { if (gPokedexView->selectedPokemon == 0) - sprite->invisible = 1; + sprite->invisible = TRUE; else - sprite->invisible = 0; - r0 = sprite->data2 - 0x80; + sprite->invisible = FALSE; + r0 = sprite->data2 - 128; } sprite->pos2.y = gSineTable[r0] / 64; sprite->data2 = sprite->data2 + 8; if (gPokedexView->menuIsOpen == 0 && gPokedexView->menuY == 0 && sprite->invisible == 0) - sprite->invisible = 0; + sprite->invisible = FALSE; else - sprite->invisible = 1; + sprite->invisible = TRUE; } } @@ -3624,20 +3612,24 @@ _0808F164: .4byte gSineTable\n\ void sub_808F168(struct Sprite *sprite) { if (gPokedexView->unk64A != 0 && gPokedexView->unk64A != 3) + { DestroySprite(sprite); + } else { - u16 r1 = gPokedexView->unk64A == 0 ? 0x50 : 0x60; + u16 r1 = gPokedexView->unk64A == 0 ? 80 : 96; if (gPokedexView->menuIsOpen != 0 && gPokedexView->menuY == r1) { - sprite->invisible = 0; + sprite->invisible = FALSE; sprite->pos2.y = gPokedexView->menuCursorPos * 16; sprite->pos2.x = gSineTable[(u8)sprite->data2] / 64; sprite->data2 += 8; } else - sprite->invisible = 1; + { + sprite->invisible = TRUE; + } } } @@ -3658,9 +3650,9 @@ static u8 sub_808F210(struct PokedexListItem *item, u8 b) bool8 sub_808F250(u8 taskId) { if (gTasks[taskId].data[0] == 0 && gTasks[taskId].func == Task_PageScreenProcessInput) - return 0; + return FALSE; else - return 1; + return TRUE; } static u8 sub_808F284(struct PokedexListItem *item, u8 b) @@ -3684,7 +3676,7 @@ void Task_InitPageScreenMultistep(u8 taskId) u16 r2; gPokedexView->unk64A = 1; - gPokedexView->unk64E = 0; + gPokedexView->descriptionPageNum = 0; gUnknown_03005CEC = gMain.vblankCallback; SetVBlankCallback(NULL); r2 = 0; @@ -3746,18 +3738,18 @@ void Task_InitPageScreenMultistep(u8 taskId) gMain.state++; break; case 6: - { - u32 r3 = 0; + { + u32 r3 = 0; - if (gTasks[taskId].data[2] != 0) - r3 = 0x14; - if (gTasks[taskId].data[1] != 0) - r3 |= (1 << (gSprites[gTasks[taskId].data[4]].oam.paletteNum + 0x10)); - BeginNormalPaletteFade(~r3, 0, 0x10, 0, 0); - SetVBlankCallback(gUnknown_03005CEC); - gMain.state++; + if (gTasks[taskId].data[2] != 0) + r3 = 0x14; + if (gTasks[taskId].data[1] != 0) + r3 |= (1 << (gSprites[gTasks[taskId].data[4]].oam.paletteNum + 16)); + BeginNormalPaletteFade(~r3, 0, 16, 0, 0); + SetVBlankCallback(gUnknown_03005CEC); + gMain.state++; + } break; - } case 7: REG_BLDCNT = 0; REG_BLDALPHA = 0; @@ -3777,7 +3769,9 @@ void Task_InitPageScreenMultistep(u8 taskId) PlayCry2(NationalPokedexNumToSpecies(gUnknown_0202FFBC->dexNum), 0, 0x7D, 0xA); } else + { gMain.state++; + } } break; case 9: @@ -3799,17 +3793,19 @@ void Task_PageScreenProcessInput(u8 taskId) { if (gTasks[taskId].data[0] != 0) { - BeginNormalPaletteFade(-1, 0, 0, 0x10, 0); + BeginNormalPaletteFade(-1, 0, 0, 16, 0); gTasks[taskId].func = sub_808F888; PlaySE(SE_Z_SCROLL); + return; } - else if (gMain.newKeys & B_BUTTON) + if (gMain.newKeys & B_BUTTON) { - BeginNormalPaletteFade(-1, 0, 0, 0x10, 0); + BeginNormalPaletteFade(-1, 0, 0, 16, 0); gTasks[taskId].func = Task_ClosePageScreen; PlaySE(SE_PC_OFF); + return; } - else if (gMain.newKeys & A_BUTTON) + if (gMain.newKeys & A_BUTTON) { switch (gPokedexView->selectedScreen) { @@ -3828,7 +3824,9 @@ void Task_PageScreenProcessInput(u8 taskId) break; case SIZE_SCREEN: if (!gUnknown_0202FFBC->owned) + { PlaySE(SE_HAZURE); + } else { BeginNormalPaletteFade(-0x15, 0, 0, 0x10, 0); @@ -3837,22 +3835,25 @@ void Task_PageScreenProcessInput(u8 taskId) } break; } + return; } - else if (((gMain.newKeys & DPAD_LEFT) + if (((gMain.newKeys & DPAD_LEFT) || ((gMain.newKeys & L_BUTTON) && gSaveBlock2.optionsButtonMode == OPTIONS_BUTTON_MODE_LR)) && gPokedexView->selectedScreen > 0) { gPokedexView->selectedScreen--; sub_8090584(gPokedexView->selectedScreen, 0xD); PlaySE(SE_Z_PAGE); + return; } - else if (((gMain.newKeys & DPAD_RIGHT) + if (((gMain.newKeys & DPAD_RIGHT) || ((gMain.newKeys & R_BUTTON) && gSaveBlock2.optionsButtonMode == OPTIONS_BUTTON_MODE_LR)) && gPokedexView->selectedScreen < 3) { gPokedexView->selectedScreen++; sub_8090584(gPokedexView->selectedScreen, 0xD); PlaySE(SE_Z_PAGE); + return; } } @@ -3971,36 +3972,34 @@ void Task_InitCryScreenMultistep(u8 taskId) gMain.state++; break; case 6: - { - struct CryRelatedStruct sp8; - - sp8.unk0 = 0x4020; - sp8.unk2 = 0x1F; - sp8.paletteNo = 8; - sp8.yPos = 0x1E; - sp8.xPos = 0xC; - if (sub_8119E3C(&sp8, 0) != 0) { - gMain.state++; - gUnknown_03005E98 = 0; + struct CryRelatedStruct sp8; + + sp8.unk0 = 0x4020; + sp8.unk2 = 0x1F; + sp8.paletteNo = 8; + sp8.yPos = 0x1E; + sp8.xPos = 0xC; + if (sub_8119E3C(&sp8, 0) != 0) + { + gMain.state++; + gUnknown_03005E98 = 0; + } } break; - } case 7: - { - struct CryRelatedStruct sp10; - - sp10.unk0 = 0x3000; - sp10.unk2 = 0xE; - sp10.paletteNo = 9; - sp10.xPos = 0x12; - sp10.yPos = 3; - if (ShowPokedexCryScreen(&sp10, 1) != 0) { - gMain.state++; + struct CryRelatedStruct sp10; + + sp10.unk0 = 0x3000; + sp10.unk2 = 0xE; + sp10.paletteNo = 9; + sp10.xPos = 0x12; + sp10.yPos = 3; + if (ShowPokedexCryScreen(&sp10, 1) != 0) + gMain.state++; } break; - } case 8: BeginNormalPaletteFade(-0x15, 0, 0x10, 0, 0); SetVBlankCallback(gUnknown_03005CEC); @@ -4048,8 +4047,9 @@ void Task_CryScreenProcessInput(u8 taskId) gPokedexView->unk64F = 1; gTasks[taskId].func = sub_808FFBC; PlaySE(SE_PC_OFF); + return; } - else if ((gMain.newKeys & DPAD_LEFT) + if ((gMain.newKeys & DPAD_LEFT) || ((gMain.newKeys & L_BUTTON) && gSaveBlock2.optionsButtonMode == OPTIONS_BUTTON_MODE_LR)) { BeginNormalPaletteFade(-0x15, 0, 0, 0x10, 0); @@ -4057,12 +4057,15 @@ void Task_CryScreenProcessInput(u8 taskId) gPokedexView->unk64F = 2; gTasks[taskId].func = sub_808FFBC; PlaySE(SE_Z_PAGE); + return; } - else if ((gMain.newKeys & DPAD_RIGHT) + if ((gMain.newKeys & DPAD_RIGHT) || ((gMain.newKeys & R_BUTTON) && gSaveBlock2.optionsButtonMode == OPTIONS_BUTTON_MODE_LR)) { if (!gUnknown_0202FFBC->owned) + { PlaySE(SE_HAZURE); + } else { BeginNormalPaletteFade(-0x15, 0, 0, 0x10, 0); @@ -4071,6 +4074,7 @@ void Task_CryScreenProcessInput(u8 taskId) gTasks[taskId].func = sub_808FFBC; PlaySE(SE_Z_PAGE); } + return; } } } @@ -4091,6 +4095,7 @@ void sub_808FFBC(u8 taskId) break; case 3: gTasks[taskId].func = Task_InitSizeScreenMultistep; + break; } } } @@ -4136,24 +4141,24 @@ void Task_InitSizeScreenMultistep(u8 taskId) gMain.state++; break; case 3: - { - u8 string[40]; //I hope this is the correct size - - SetUpWindowConfig(&gWindowConfig_81E702C); - InitMenuWindow(&gWindowConfig_81E702C); - string[0] = EOS; - StringAppend(string, gDexText_SizeComparedTo); - StringAppend(string, gSaveBlock2.playerName); - sub_8072BD8(string, 3, 15, 0xC0); - gMain.state++; + { + u8 string[40]; //I hope this is the correct size + + SetUpWindowConfig(&gWindowConfig_81E702C); + InitMenuWindow(&gWindowConfig_81E702C); + string[0] = EOS; + StringAppend(string, gDexText_SizeComparedTo); + StringAppend(string, gSaveBlock2.playerName); + sub_8072BD8(string, 3, 15, 0xC0); + gMain.state++; + } break; - } case 4: ResetPaletteFade(); gMain.state++; break; case 5: - spriteId = sub_8091A4C(gSaveBlock2.playerGender, 0x98, 0x38, 0); + spriteId = sub_8091A4C(gSaveBlock2.playerGender, 152, 56, 0); gSprites[spriteId].oam.affineMode = 1; gSprites[spriteId].oam.matrixNum = 1; gSprites[spriteId].oam.priority = 0; @@ -4163,7 +4168,7 @@ void Task_InitSizeScreenMultistep(u8 taskId) gMain.state++; break; case 6: - spriteId = sub_80918EC(gUnknown_0202FFBC->dexNum, 0x58, 0x38, 1); + spriteId = sub_80918EC(gUnknown_0202FFBC->dexNum, 88, 56, 1); gSprites[spriteId].oam.affineMode = 1; gSprites[spriteId].oam.matrixNum = 2; gSprites[spriteId].oam.priority = 0; @@ -5044,11 +5049,11 @@ void sub_8090C68(void) { if (gUnknown_0202FFBC->owned) { - if (gPokedexView->unk64E == 0) + if (gPokedexView->descriptionPageNum == 0) { MenuZeroFillWindowRect(2, 13, 27, 19); MenuPrint(gPokedexEntries[gUnknown_0202FFBC->dexNum].descriptionPage2, 2, 13); - gPokedexView->unk64E = 1; + gPokedexView->descriptionPageNum = 1; (*(u16 *)(VRAM + 0x7ACA))++; (*(u16 *)(VRAM + 0x7B0A))++; PlaySE(SE_PIN); @@ -5057,7 +5062,7 @@ void sub_8090C68(void) { MenuZeroFillWindowRect(2, 13, 27, 19); MenuPrint(gPokedexEntries[gUnknown_0202FFBC->dexNum].descriptionPage1, 2, 13); - gPokedexView->unk64E = 0; + gPokedexView->descriptionPageNum = 0; (*(u16 *)(VRAM + 0x7ACA))--; (*(u16 *)(VRAM + 0x7B0A))--; PlaySE(SE_PIN); @@ -5146,7 +5151,7 @@ u16 GetNationalPokedexCount(u8 a) u16 count = 0; u16 i; - for (i = 0; i < 386; i++) + for (i = 0; i < NATIONAL_DEX_COUNT; i++) { switch (a) { @@ -5579,7 +5584,7 @@ void sub_80918B0(u16 a, u8 b) gUnknown_02024E8C.anims = gUnknown_081EC2A4[0]; } -u16 sub_80918EC(u16 num, s16 b, s16 c, u16 d) +u16 sub_80918EC(u16 num, s16 x, s16 y, u16 paletteNum) { u8 spriteId; @@ -5592,7 +5597,7 @@ u16 sub_80918EC(u16 num, s16 b, s16 c, u16 d) gMonFrontPicCoords[num].coords, gMonFrontPicCoords[num].y_offset, (void *)0x02000000, - gUnknown_083B5584[d], + gUnknown_083B5584[paletteNum], num); break; case 0x134: @@ -5601,7 +5606,7 @@ u16 sub_80918EC(u16 num, s16 b, s16 c, u16 d) gMonFrontPicCoords[num].coords, gMonFrontPicCoords[num].y_offset, 0x02000000, - gUnknown_083B5584[d], + gUnknown_083B5584[paletteNum], num, gSaveBlock2.pokedex.spindaPersonality, 1); @@ -5612,20 +5617,20 @@ u16 sub_80918EC(u16 num, s16 b, s16 c, u16 d) gMonFrontPicCoords[num].coords, gMonFrontPicCoords[num].y_offset, 0x02000000, - gUnknown_083B5584[d], + gUnknown_083B5584[paletteNum], num, gSaveBlock2.pokedex.unownPersonality, 1); break; } - LoadCompressedPalette(gMonPaletteTable[num].data, 0x100 + d * 16, 32); - sub_8091878(d, d); - spriteId = CreateSprite(&gUnknown_02024E8C, b, c, 0); - gSprites[spriteId].oam.paletteNum = d; + LoadCompressedPalette(gMonPaletteTable[num].data, 0x100 + paletteNum * 16, 32); + sub_8091878(paletteNum, paletteNum); + spriteId = CreateSprite(&gUnknown_02024E8C, x, y, 0); + gSprites[spriteId].oam.paletteNum = paletteNum; return spriteId; } -u8 sub_8091A4C(u16 gender, u16 b, u16 c, u16 d) +u8 sub_8091A4C(u16 gender, s16 x, s16 y, u16 paletteNum) { u8 spriteId; @@ -5637,8 +5642,8 @@ u8 sub_8091A4C(u16 gender, u16 b, u16 c, u16 d) gUnknown_083B5584[0], gender); sub_80918B0(gender, 0); - spriteId = CreateSprite(&gUnknown_02024E8C, b, c, 0); - gSprites[spriteId].oam.paletteNum = d; + spriteId = CreateSprite(&gUnknown_02024E8C, x, y, 0); + gSprites[spriteId].oam.paletteNum = paletteNum; return spriteId; } @@ -5651,7 +5656,7 @@ int sub_8091AF8(u8 a, u8 b, u8 abcGroup, u8 bodyColor, u8 type1, u8 type2) SortPokedex(a, b); - for (i = 0, resultsCount = 0; i < 386; i++) + for (i = 0, resultsCount = 0; i < NATIONAL_DEX_COUNT; i++) { if (gPokedexView->unk0[i].seen) { @@ -5659,12 +5664,12 @@ int sub_8091AF8(u8 a, u8 b, u8 abcGroup, u8 bodyColor, u8 type1, u8 type2) resultsCount++; } } - gPokedexView->unk60C = resultsCount; + gPokedexView->pokemonListCount = resultsCount; // Search by name if (abcGroup != 0xFF) { - for (i = 0, resultsCount = 0; i < gPokedexView->unk60C; i++) + for (i = 0, resultsCount = 0; i < gPokedexView->pokemonListCount; i++) { u8 r3; @@ -5677,13 +5682,13 @@ int sub_8091AF8(u8 a, u8 b, u8 abcGroup, u8 bodyColor, u8 type1, u8 type2) resultsCount++; } } - gPokedexView->unk60C = resultsCount; + gPokedexView->pokemonListCount = resultsCount; } // Search by body color if (bodyColor != 0xFF) { - for (i = 0, resultsCount = 0; i < gPokedexView->unk60C; i++) + for (i = 0, resultsCount = 0; i < gPokedexView->pokemonListCount; i++) { species = NationalPokedexNumToSpecies(gPokedexView->unk0[i].dexNum); @@ -5693,7 +5698,7 @@ int sub_8091AF8(u8 a, u8 b, u8 abcGroup, u8 bodyColor, u8 type1, u8 type2) resultsCount++; } } - gPokedexView->unk60C = resultsCount; + gPokedexView->pokemonListCount = resultsCount; } // Search by type @@ -5707,7 +5712,7 @@ int sub_8091AF8(u8 a, u8 b, u8 abcGroup, u8 bodyColor, u8 type1, u8 type2) if (type2 == 0xFF) { - for (i = 0, resultsCount = 0; i < gPokedexView->unk60C; i++) + for (i = 0, resultsCount = 0; i < gPokedexView->pokemonListCount; i++) { if (gPokedexView->unk0[i].owned) { @@ -5725,7 +5730,7 @@ int sub_8091AF8(u8 a, u8 b, u8 abcGroup, u8 bodyColor, u8 type1, u8 type2) } else { - for (i = 0, resultsCount = 0; i < gPokedexView->unk60C; i++) + for (i = 0, resultsCount = 0; i < gPokedexView->pokemonListCount; i++) { if (gPokedexView->unk0[i].owned) { @@ -5741,12 +5746,12 @@ int sub_8091AF8(u8 a, u8 b, u8 abcGroup, u8 bodyColor, u8 type1, u8 type2) } } } - gPokedexView->unk60C = resultsCount; + gPokedexView->pokemonListCount = resultsCount; } - if (gPokedexView->unk60C != 0) + if (gPokedexView->pokemonListCount != 0) { - for (i = gPokedexView->unk60C; i < 386; i++) + for (i = gPokedexView->pokemonListCount; i < NATIONAL_DEX_COUNT; i++) { gPokedexView->unk0[i].dexNum = 0xFFFF; gPokedexView->unk0[i].seen = FALSE; @@ -5988,7 +5993,7 @@ void sub_80924A4(u8 taskId) { if (!IsSEPlaying()) { - if (gPokedexView->unk60C != 0) + if (gPokedexView->pokemonListCount != 0) { PlaySE(SE_SEIKAI); sub_8091E20(gDexText_SearchComplete); @@ -6006,11 +6011,11 @@ void sub_8092508(u8 taskId) { if (gMain.newKeys & A_BUTTON) { - if (gPokedexView->unk60C != 0) + if (gPokedexView->pokemonListCount != 0) { gPokedexView->unk64F = 1; - gPokedexView->unk612 = sub_8092E10(taskId, 5); - gPokedexView->unk616 = sub_8092E10(taskId, 4); + gPokedexView->dexMode = sub_8092E10(taskId, 5); + gPokedexView->dexOrder = sub_8092E10(taskId, 4); gTasks[taskId].func = sub_80927B8; PlaySE(SE_PC_OFF); } -- cgit v1.2.3 From 3d4c2f73cb19ef1f5215600c15272dd4d54c4fc0 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 14 Jun 2017 22:54:42 -0400 Subject: FILE MODES BrokeBack --- src/decoration.c | 0 src/decoration_inventory.c | 0 src/field_effect.c | 0 src/menu.c | 0 src/scrcmd.c | 0 5 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 src/decoration.c mode change 100755 => 100644 src/decoration_inventory.c mode change 100755 => 100644 src/field_effect.c mode change 100755 => 100644 src/menu.c mode change 100755 => 100644 src/scrcmd.c (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c old mode 100755 new mode 100644 diff --git a/src/decoration_inventory.c b/src/decoration_inventory.c old mode 100755 new mode 100644 diff --git a/src/field_effect.c b/src/field_effect.c old mode 100755 new mode 100644 diff --git a/src/menu.c b/src/menu.c old mode 100755 new mode 100644 diff --git a/src/scrcmd.c b/src/scrcmd.c old mode 100755 new mode 100644 -- cgit v1.2.3 From d8f4d3da44d52ac56d93a41edb24cf0a803f5c67 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 14 Jun 2017 23:02:07 -0400 Subject: Remove unnecessary macros --- src/daycare.c | 2 -- src/field_effect.c | 1 - 2 files changed, 3 deletions(-) mode change 100644 => 100755 src/daycare.c mode change 100644 => 100755 src/field_effect.c (limited to 'src') diff --git a/src/daycare.c b/src/daycare.c old mode 100644 new mode 100755 index 5bcbff6af..381450a0b --- a/src/daycare.c +++ b/src/daycare.c @@ -35,7 +35,6 @@ u8 Daycare_CountPokemon(struct BoxPokemon *daycare_data) return count; } -#ifndef ASDF void sub_8041324(struct BoxPokemon * box_pokemon, struct RecordMixing_UnknownStruct * void_pointer) { u8 i; @@ -60,7 +59,6 @@ void sub_8041324(struct BoxPokemon * box_pokemon, struct RecordMixing_UnknownStr } void_pointer->unk70 = specCount; } -#endif s8 Daycare_FindEmptySpot(struct BoxPokemon * daycare_data) { diff --git a/src/field_effect.c b/src/field_effect.c old mode 100644 new mode 100755 index 8728155e1..2bf9b3dc9 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -674,7 +674,6 @@ void FreeResourcesAndDestroySprite(struct Sprite *sprite) DestroySprite(sprite); } -#undef NONMATCHING #ifdef NONMATCHING void MultiplyInvertedPaletteRGBComponents(u16 i, u8 r, u8 g, u8 b) { -- cgit v1.2.3 From 86a26c9282f03c751fc67e7da6e0d4014f69a688 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Thu, 15 Jun 2017 01:26:40 -0500 Subject: finish converting pokedex data to C --- src/data/pokedex_entries_en.h | 9651 +++++++++++++++++++++++++++++++++++++++++ src/data/pokedex_orders.h | 1192 +++++ src/pokedex.c | 2072 ++++----- 3 files changed, 11661 insertions(+), 1254 deletions(-) create mode 100644 src/data/pokedex_entries_en.h create mode 100644 src/data/pokedex_orders.h (limited to 'src') diff --git a/src/data/pokedex_entries_en.h b/src/data/pokedex_entries_en.h new file mode 100644 index 000000000..2d9eaf617 --- /dev/null +++ b/src/data/pokedex_entries_en.h @@ -0,0 +1,9651 @@ +const u8 DexDescription_Dummy_1[] = _( + "This is a newly discovered POKéMON.\n" + "It is currently under investigation."); +const u8 DexDescription_Dummy_2[] = _( + "No detailed information is available\n" + "at this time."); + +const u8 DexDescription_Bulbasaur_1[] = _( + "BULBASAUR can be seen napping in\n" + "bright sunlight.\n" + "There is a seed on its back."); +const u8 DexDescription_Bulbasaur_2[] = _( + "By soaking up the sun’s rays, the seed\n" + "grows progressively larger."); + +const u8 DexDescription_Ivysaur_1[] = _( + "There is a bud on this POKéMON’s back.\n" + "To support its weight, IVYSAUR’s legs\n" + "and trunk grow thick and strong."); +const u8 DexDescription_Ivysaur_2[] = _( + "If it starts spending more time lying\n" + "in the sunlight, it’s a sign that the\n" + "bud will bloom into a large flower soon."); + +const u8 DexDescription_Venusaur_1[] = _( + "There is a large flower on VENUSAUR’s\n" + "back. The flower is said to take on vivid\n" + "colors if it gets plenty of nutrition"); +const u8 DexDescription_Venusaur_2[] = _( + "and sunlight. The flower’s aroma\n" + "soothes the emotions of people."); + +const u8 DexDescription_Charmander_1[] = _( + "The flame that burns at the tip of its\n" + "tail is an indication of its emotions.\n" + "The flame wavers when CHARMANDER is"); +const u8 DexDescription_Charmander_2[] = _( + "enjoying itself. If the POKéMON becomes\n" + "enraged, the flame burns fiercely."); + +const u8 DexDescription_Charmeleon_1[] = _( + "CHARMELEON mercilessly destroys its\n" + "foes using its sharp claws.\n" + "If it encounters a strong foe, it turns"); +const u8 DexDescription_Charmeleon_2[] = _( + "aggressive. In this excited state, the\n" + "flame at the tip of its tail flares with a\n" + "bluish white color."); + +const u8 DexDescription_Charizard_1[] = _( + "CHARIZARD flies around the sky in\n" + "search of powerful opponents.\n" + "It breathes fire of such great heat"); +const u8 DexDescription_Charizard_2[] = _( + "that it melts anything. However, it\n" + "never turns its fiery breath on any\n" + "opponent weaker than itself."); + +const u8 DexDescription_Squirtle_1[] = _( + "SQUIRTLE’s shell is not merely used\n" + "for protection.\n" + "The shell’s rounded shape and the"); +const u8 DexDescription_Squirtle_2[] = _( + "grooves on its surface help minimize\n" + "resistance in water, enabling this\n" + "POKéMON to swim at high speeds."); + +const u8 DexDescription_Wartortle_1[] = _( + "Its tail is large and covered with a rich,\n" + "thick fur. The tail becomes increasingly\n" + "deeper in color as WARTORTLE ages."); +const u8 DexDescription_Wartortle_2[] = _( + "The scratches on its shell are evidence\n" + "of this POKéMON’s toughness as a\n" + "battler."); + +const u8 DexDescription_Blastoise_1[] = _( + "BLASTOISE has water spouts that\n" + "protrude from its shell. The water\n" + "spouts are very accurate."); +const u8 DexDescription_Blastoise_2[] = _( + "They can shoot bullets of water with\n" + "enough accuracy to strike empty cans\n" + "from a distance of over 160 feet."); + +const u8 DexDescription_Caterpie_1[] = _( + "CATERPIE has a voracious appetite.\n" + "It can devour leaves bigger than its\n" + "body right before your eyes."); +const u8 DexDescription_Caterpie_2[] = _( + "From its antenna, this POKéMON releases\n" + "a terrifically strong odor."); + +const u8 DexDescription_Metapod_1[] = _( + "The shell covering this POKéMON’s body\n" + "is as hard as an iron slab.\n" + "METAPOD does not move very much."); +const u8 DexDescription_Metapod_2[] = _( + "It stays still because it is preparing\n" + "its soft innards for evolution inside\n" + "the hard shell."); + +const u8 DexDescription_Butterfree_1[] = _( + "BUTTERFREE has a superior ability to\n" + "search for delicious honey from\n" + "flowers."); +const u8 DexDescription_Butterfree_2[] = _( + "It can even search out, extract, and\n" + "carry honey from flowers that are\n" + "blooming over six miles from its nest."); + +const u8 DexDescription_Weedle_1[] = _( + "WEEDLE has an extremely acute sense\n" + "of smell.\n" + "It is capable of distinguishing its"); +const u8 DexDescription_Weedle_2[] = _( + "favorite kinds of leaves from those it\n" + "dislikes just by sniffing with its big\n" + "red proboscis (nose)."); + +const u8 DexDescription_Kakuna_1[] = _( + "KAKUNA remains virtually immobile as it\n" + "clings to a tree. However, on the\n" + "inside, it is extremely busy as it"); +const u8 DexDescription_Kakuna_2[] = _( + "prepares for its coming evolution.\n" + "This is evident from how hot the shell\n" + "becomes to the touch."); + +const u8 DexDescription_Beedrill_1[] = _( + "BEEDRILL is extremely territorial.\n" + "No one should ever approach its nest -\n" + "this is for their own safety."); +const u8 DexDescription_Beedrill_2[] = _( + "If angered, they will attack in a furious\n" + "swarm."); + +const u8 DexDescription_Pidgey_1[] = _( + "PIDGEY has an extremely sharp sense\n" + "of direction.\n" + "It is capable of unerringly returning"); +const u8 DexDescription_Pidgey_2[] = _( + "home to its nest, however far it may be\n" + "removed from its familiar surroundings."); + +const u8 DexDescription_Pidgeotto_1[] = _( + "PIDGEOTTO claims a large area as its\n" + "own territory. This POKéMON flies\n" + "around, patrolling its living space."); +const u8 DexDescription_Pidgeotto_2[] = _( + "If its territory is violated, it shows\n" + "no mercy in thoroughly punishing the\n" + "foe with its sharp claws."); + +const u8 DexDescription_Pidgeot_1[] = _( + "This POKéMON has a dazzling plumage of\n" + "beautifully glossy feathers.\n" + "Many TRAINERS are captivated by the"); +const u8 DexDescription_Pidgeot_2[] = _( + "striking beauty of the feathers on its\n" + "head, compelling them to choose PIDGEOT\n" + "as their POKéMON."); + +const u8 DexDescription_Rattata_1[] = _( + "RATTATA is cautious in the extreme.\n" + "Even while it is asleep, it constantly\n" + "listens by moving its ears around."); +const u8 DexDescription_Rattata_2[] = _( + "It is not picky about where it lives -\n" + "it will make its nest anywhere."); + +const u8 DexDescription_Raticate_1[] = _( + "RATICATE’s sturdy fangs grow steadily.\n" + "To keep them ground down, it gnaws\n" + "on rocks and logs."); +const u8 DexDescription_Raticate_2[] = _( + "It may even chew on the walls of\n" + "houses."); + +const u8 DexDescription_Spearow_1[] = _( + "SPEAROW has a very loud cry that can\n" + "be heard over half a mile away.\n" + "If its high, keening cry is heard"); +const u8 DexDescription_Spearow_2[] = _( + "echoing all around, it is a sign that\n" + "they are warning each other of danger."); + +const u8 DexDescription_Fearow_1[] = _( + "FEAROW is recognized by its long neck\n" + "and elongated beak.\n" + "They are conveniently shaped for"); +const u8 DexDescription_Fearow_2[] = _( + "catching prey in soil or water.\n" + "It deftly moves its long and skinny\n" + "beak to pluck prey."); + +const u8 DexDescription_Ekans_1[] = _( + "EKANS curls itself up in a spiral while\n" + "it rests.\n" + "Assuming this position allows it to"); +const u8 DexDescription_Ekans_2[] = _( + "quickly respond to a threat from any\n" + "direction with a glare from its upraised\n" + "head."); + +const u8 DexDescription_Arbok_1[] = _( + "This POKéMON is terrifically strong in\n" + "order to constrict things with its body.\n" + "It can even flatten steel oil drums."); +const u8 DexDescription_Arbok_2[] = _( + "Once ARBOK wraps its body around its\n" + "foe, escaping its crunching embrace is\n" + "impossible."); + +#ifdef SAPPHIRE +const u8 DexDescription_Pikachu_1[] = _( + "This POKéMON has electricity-storing\n" + "pouches on its cheeks. These appear to\n" + "become electrically charged during the"); +const u8 DexDescription_Pikachu_2[] = _( + "night while PIKACHU sleeps.\n" + "It occasionally discharges electricity\n" + "when it is dozy after waking up."); +#else +const u8 DexDescription_Pikachu_1[] = _( + "Whenever PIKACHU comes across\n" + "something new, it blasts it with a jolt\n" + "of electricity."); +const u8 DexDescription_Pikachu_2[] = _( + "If you come across a blackened berry,\n" + "it’s evidence that this POKéMON\n" + "mistook the intensity of its charge."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Raichu_1[] = _( + "This POKéMON exudes a weak electrical\n" + "charge from all over its body that makes\n" + "it take on a slight glow in darkness."); +const u8 DexDescription_Raichu_2[] = _( + "RAICHU searches for electricity by\n" + "planting its tail in the ground."); +#else +const u8 DexDescription_Raichu_1[] = _( + "If the electrical sacks become\n" + "excessively charged, RAICHU plants its\n" + "tail in the ground and discharges."); +const u8 DexDescription_Raichu_2[] = _( + "Scorched patches of ground will be\n" + "found near this POKéMON’s nest."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Sandshrew_1[] = _( + "SANDSHREW has a very dry hide that is\n" + "extremely tough. The POKéMON can roll\n" + "into a ball that repels any attack."); +const u8 DexDescription_Sandshrew_2[] = _( + "At night, it burrows into the desert\n" + "sand to sleep."); +#else +const u8 DexDescription_Sandshrew_1[] = _( + "SANDSHREW’s body is configured to\n" + "absorb water without waste, enabling it\n" + "to survive in an arid desert."); +const u8 DexDescription_Sandshrew_2[] = _( + "This POKéMON curls up to protect itself\n" + "from its enemies."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Sandslash_1[] = _( + "SANDSLASH can roll up its body as if it\n" + "were a ball covered with large spikes.\n" + "In battle, this POKéMON will try to make"); +const u8 DexDescription_Sandslash_2[] = _( + "the foe flinch by jabbing it with its\n" + "spines. It then leaps at the stunned\n" + "foe to tear wildly with its sharp claws."); +#else +const u8 DexDescription_Sandslash_1[] = _( + "SANDSLASH’s body is covered by tough\n" + "spikes, which are hardened sections of\n" + "its hide. Once a year, the old spikes fall"); +const u8 DexDescription_Sandslash_2[] = _( + "out, to be replaced with new spikes that\n" + "grow out from beneath the old ones."); +#endif + +const u8 DexDescription_NidoranF_1[] = _( + "NIDORAN has barbs that secrete a\n" + "powerful poison. They are thought to\n" + "have developed as protection for this"); +const u8 DexDescription_NidoranF_2[] = _( + "small-bodied POKéMON.\n" + "When enraged, it releases a horrible\n" + "toxin from its horn."); + +const u8 DexDescription_Nidorina_1[] = _( + "When NIDORINA are with their friends or\n" + "family, they keep their barbs tucked\n" + "away to prevent hurting each other."); +const u8 DexDescription_Nidorina_2[] = _( + "This POKéMON appears to become\n" + "nervous if separated from the others."); + +const u8 DexDescription_Nidoqueen_1[] = _( + "NIDOQUEEN’s body is encased in\n" + "extremely hard scales. It is adept at\n" + "sending foes flying with harsh tackles."); +const u8 DexDescription_Nidoqueen_2[] = _( + "This POKéMON is at its strongest when\n" + "it is defending its young."); + +const u8 DexDescription_NidoranM_1[] = _( + "The male NIDORAN has developed\n" + "muscles for moving its ears. Thanks to\n" + "them, the ears can be freely moved in"); +const u8 DexDescription_NidoranM_2[] = _( + "any direction. Even the slightest sound\n" + "does not escape this POKéMON’s notice."); + +const u8 DexDescription_Nidorino_1[] = _( + "NIDORINO has a horn that is harder than\n" + "a diamond. If it senses a hostile\n" + "presence, all the barbs on its back"); +const u8 DexDescription_Nidorino_2[] = _( + "bristle up at once, and it challenges\n" + "the foe with all its might."); + +const u8 DexDescription_Nidoking_1[] = _( + "NIDOKING’s thick tail packs enormously\n" + "destructive power. With one swing, it\n" + "can topple a metal transmission tower."); +const u8 DexDescription_Nidoking_2[] = _( + "Once this POKéMON goes on a rampage,\n" + "there is no stopping it."); + +const u8 DexDescription_Clefairy_1[] = _( + "On every night of a full moon, groups of\n" + "this POKéMON come out to play.\n" + "When dawn arrives, the tired CLEFAIRY"); +const u8 DexDescription_Clefairy_2[] = _( + "return to their quiet mountain retreats\n" + "and go to sleep nestled up against each\n" + "other."); + +const u8 DexDescription_Clefable_1[] = _( + "CLEFABLE moves by skipping lightly as if\n" + "it were flying using its wings. Its\n" + "bouncy step lets it even walk on water."); +const u8 DexDescription_Clefable_2[] = _( + "It is known to take strolls on lakes on\n" + "quiet, moonlit nights."); + +#ifdef SAPPHIRE +const u8 DexDescription_Vulpix_1[] = _( + "Inside VULPIX’s body burns a flame that\n" + "never goes out. During the daytime,\n" + "when the temperatures rise, this"); +const u8 DexDescription_Vulpix_2[] = _( + "POKéMON releases flames from its mouth\n" + "to prevent its body from growing too\n" + "hot."); +#else +const u8 DexDescription_Vulpix_1[] = _( + "At the time of its birth, VULPIX has one\n" + "white tail. The tail separates into six\n" + "if this POKéMON receives plenty of love"); +const u8 DexDescription_Vulpix_2[] = _( + "from its TRAINER.\n" + "The six tails become magnificently\n" + "curled."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Ninetales_1[] = _( + "Legend has it that NINETALES came into\n" + "being when nine wizards possessing\n" + "sacred powers merged into one."); +const u8 DexDescription_Ninetales_2[] = _( + "This POKéMON is highly intelligent - it\n" + "can understand human speech."); +#else +const u8 DexDescription_Ninetales_1[] = _( + "NINETALES casts a sinister light from\n" + "its bright red eyes to gain total\n" + "control over its foe’s mind."); +const u8 DexDescription_Ninetales_2[] = _( + "This POKéMON is said to live for a\n" + "thousand years."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Jigglypuff_1[] = _( + "When this POKéMON sings, it never\n" + "pauses to breathe. If it is in a battle\n" + "against an opponent that does not"); +const u8 DexDescription_Jigglypuff_2[] = _( + "easily fall asleep, JIGGLYPUFF cannot\n" + "breathe, endangering its life."); +#else +const u8 DexDescription_Jigglypuff_1[] = _( + "JIGGLYPUFF’s vocal chords can freely\n" + "adjust the wavelength of its voice.\n" + "This POKéMON uses this ability to sing"); +const u8 DexDescription_Jigglypuff_2[] = _( + "at precisely the right wavelength to\n" + "make its foes most drowsy."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Wigglytuff_1[] = _( + "WIGGLYTUFF’s body is very flexible.\n" + "By inhaling deeply, this POKéMON can\n" + "inflate itself seemingly without end."); +const u8 DexDescription_Wigglytuff_2[] = _( + "Once inflated, WIGGLYTUFF bounces\n" + "along lightly like a balloon."); +#else +const u8 DexDescription_Wigglytuff_1[] = _( + "WIGGLYTUFF has large, saucerlike eyes.\n" + "The surfaces of its eyes are always\n" + "covered with a thin layer of tears."); +const u8 DexDescription_Wigglytuff_2[] = _( + "If any dust gets in this POKéMON’s\n" + "eyes, it is quickly washed away."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Zubat_1[] = _( + "ZUBAT avoids sunlight because exposure\n" + "causes it to become unhealthy.\n" + "During the daytime, it stays in caves or"); +const u8 DexDescription_Zubat_2[] = _( + "under the eaves of old houses, sleeping\n" + "while hanging upside down."); +#else +const u8 DexDescription_Zubat_1[] = _( + "ZUBAT remains quietly unmoving in a\n" + "dark spot during the bright daylight\n" + "hours. It does so because prolonged"); +const u8 DexDescription_Zubat_2[] = _( + "exposure to the sun causes its body to\n" + "become slightly burned."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Golbat_1[] = _( + "GOLBAT bites down on prey with its four\n" + "fangs and drinks the victim’s blood.\n" + "It becomes active on inky dark"); +const u8 DexDescription_Golbat_2[] = _( + "moonless nights, flying around to\n" + "attack people and POKéMON."); +#else +const u8 DexDescription_Golbat_1[] = _( + "GOLBAT loves to drink the blood of\n" + "living things. It is particularly active\n" + "in the pitch black of night."); +const u8 DexDescription_Golbat_2[] = _( + "This POKéMON flits around in the night\n" + "skies, seeking fresh blood."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Oddish_1[] = _( + "ODDISH searches for fertile, nutrient-\n" + "rich soil, then plants itself.\n" + "During the daytime, while it is planted,"); +const u8 DexDescription_Oddish_2[] = _( + "this POKéMON’s feet are thought to\n" + "change shape and become similar to\n" + "the roots of trees."); +#else +const u8 DexDescription_Oddish_1[] = _( + "During the daytime, ODDISH buries\n" + "itself in soil to absorb nutrients from \n" + "the ground using its entire body."); +const u8 DexDescription_Oddish_2[] = _( + "The more fertile the soil, the glossier\n" + "its leaves become."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Gloom_1[] = _( + "From its mouth GLOOM drips honey that\n" + "smells absolutely horrible.\n" + "Apparently, it loves the horrid stench."); +const u8 DexDescription_Gloom_2[] = _( + "It sniffs the noxious fumes and then \n" + "drools even more of its honey."); +#else +const u8 DexDescription_Gloom_1[] = _( + "GLOOM releases a foul fragrance from\n" + "the pistil of its flower. When faced\n" + "with danger, the stench worsens."); +const u8 DexDescription_Gloom_2[] = _( + "If this POKéMON is feeling calm and\n" + "secure, it does not release its usual\n" + "stinky aroma."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Vileplume_1[] = _( + "VILEPLUME has the world’s largest\n" + "petals. They are used to attract prey\n" + "that are then doused with toxic spores."); +const u8 DexDescription_Vileplume_2[] = _( + "Once the prey are immobilized, this\n" + "POKéMON catches and devours them."); +#else +const u8 DexDescription_Vileplume_1[] = _( + "VILEPLUME’s toxic pollen triggers\n" + "atrocious allergy attacks. That’s why\n" + "it is advisable never to approach any"); +const u8 DexDescription_Vileplume_2[] = _( + "attractive flowers in a jungle, however\n" + "pretty they may be."); +#endif + +#ifdef SAPPHIRE +#if REVISION >= 1 +const u8 DexDescription_Paras_1[] = _( + "PARAS has parasitic mushrooms growing\n" + "on its back called tochukaso. They grow\n" + "large by drawing nutrients from this"); +const u8 DexDescription_Paras_2[] = _( + "BUG/GRASS POKéMON host. They are\n" // Identify Paras as BUG/GRASS type rather than just BUG + "highly valued as a medicine for\n" + "extending life."); +#else +const u8 DexDescription_Paras_1[] = _( + "PARAS has parasitic mushrooms growing\n" + "on its back called tochukaso. They grow\n" + "large by drawing nutrients from this"); +const u8 DexDescription_Paras_2[] = _( + "BUG POKéMON host. They are highly\n" + "valued as a medicine for extending life."); +#endif +#else +#if REVISION >= 1 +const u8 DexDescription_Paras_1[] = _( + "PARAS has parasitic mushrooms growing\n" + "on its back called tochukaso. They grow\n" + "large by drawing nutrients from this"); +const u8 DexDescription_Paras_2[] = _( + "BUG/GRASS POKéMON host. They are\n" + "highly valued as a medicine for\n" + "extending life."); +#else +const u8 DexDescription_Paras_1[] = _( + "PARAS has parasitic mushrooms growing\n" + "on its back called tochukaso. They grow\n" + "large by drawing nutrients from the BUG"); +const u8 DexDescription_Paras_2[] = _( + "POKéMON host. They are highly valued as\n" + "a medicine for extending life."); +#endif +#endif + +const u8 DexDescription_Parasect_1[] = _( + "PARASECT is known to infest large trees\n" + "en masse and drain nutrients from the\n" + "lower trunk and roots."); +const u8 DexDescription_Parasect_2[] = _( + "When an infested tree dies, they move\n" + "onto another tree all at once."); + +const u8 DexDescription_Venonat_1[] = _( + "VENONAT is said to have evolved with\n" + "a coat of thin, stiff hair that covers\n" + "its entire body for protection."); +const u8 DexDescription_Venonat_2[] = _( + "It possesses large eyes that never fail\n" + "to spot even miniscule prey."); + +const u8 DexDescription_Venomoth_1[] = _( + "VENOMOTH is nocturnal - it is a POKéMON\n" + "that only becomes active at night.\n" + "Its favorite prey are small insects"); +const u8 DexDescription_Venomoth_2[] = _( + "that gather around streetlights,\n" + "attracted by the light in the darkness."); + +const u8 DexDescription_Diglett_1[] = _( + "DIGLETT are raised in most farms.\n" + "The reason is simple - wherever this\n" + "POKéMON burrows, the soil is left"); +const u8 DexDescription_Diglett_2[] = _( + "perfectly tilled for planting crops.\n" + "This soil is made ideal for growing\n" + "delicious vegetables."); + +const u8 DexDescription_Dugtrio_1[] = _( + "DUGTRIO are actually triplets that\n" + "emerged from one body. As a result,\n" + "each triplet thinks exactly like the"); +const u8 DexDescription_Dugtrio_2[] = _( + "other two triplets.\n" + "They work cooperatively to burrow\n" + "endlessly."); + +const u8 DexDescription_Meowth_1[] = _( + "MEOWTH withdraws its sharp claws into\n" + "its paws to slinkily sneak about without\n" + "making any incriminating footsteps."); +const u8 DexDescription_Meowth_2[] = _( + "For some reason, this POKéMON loves\n" + "shiny coins that glitter with light."); + +const u8 DexDescription_Persian_1[] = _( + "PERSIAN has six bold whiskers that give\n" + "it a look of toughness. The whiskers \n" + "sense air movements to determine what"); +const u8 DexDescription_Persian_2[] = _( + "is in the POKéMON’s surrounding\n" + "vicinity. It becomes docile if grabbed\n" + "by the whiskers."); + +#ifdef SAPPHIRE +const u8 DexDescription_Psyduck_1[] = _( + "If it uses its mysterious power,\n" + "PSYDUCK can’t remember having done so.\n" + "It apparently can’t form a memory of"); +const u8 DexDescription_Psyduck_2[] = _( + "such an event because it goes into\n" + "an altered state that is much like\n" + "deep sleep."); +#else +const u8 DexDescription_Psyduck_1[] = _( + "PSYDUCK uses a mysterious power.\n" + "When it does so, this POKéMON \n" + "generates brain waves that are"); +const u8 DexDescription_Psyduck_2[] = _( + "supposedly only seen in sleepers.\n" + "This discovery spurred controversy\n" + "among scholars."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Golduck_1[] = _( + "GOLDUCK is the fastest swimmer among\n" + "all POKéMON. It swims effortlessly, even\n" + "in a rough, stormy sea."); +const u8 DexDescription_Golduck_2[] = _( + "It sometimes rescues people from\n" + "wrecked ships floundering in high seas."); +#else +const u8 DexDescription_Golduck_1[] = _( + "The webbed flippers on its forelegs and\n" + "hind legs and the streamlined body of\n" + "GOLDUCK give it frightening speed."); +const u8 DexDescription_Golduck_2[] = _( + "This POKéMON is definitely much faster\n" + "than even the most athletic swimmer."); +#endif + +const u8 DexDescription_Mankey_1[] = _( + "When MANKEY starts shaking and its\n" + "nasal breathing turns rough, it’s a sure\n" + "sign that it is becoming angry."); +const u8 DexDescription_Mankey_2[] = _( + "However, because it goes into a\n" + "towering rage almost instantly, it is\n" + "impossible for anyone to flee its wrath."); + +const u8 DexDescription_Primeape_1[] = _( + "When PRIMEAPE becomes furious, its\n" + "blood circulation is boosted. In turn,\n" + "its muscles are made even stronger."); +const u8 DexDescription_Primeape_2[] = _( + "However, it also becomes much less\n" + "intelligent at the same time."); + +const u8 DexDescription_Growlithe_1[] = _( + "GROWLITHE has a superb sense of smell.\n" + "Once it smells anything, this POKéMON\n" + "won’t forget the scent, no matter what."); +const u8 DexDescription_Growlithe_2[] = _( + "It uses its advanced olfactory sense\n" + "to determine the emotions of other\n" + "living things."); + +const u8 DexDescription_Arcanine_1[] = _( + "ARCANINE is known for its high speed.\n" + "It is said to be capable of running over\n" + "6,200 miles in a single day and night."); +const u8 DexDescription_Arcanine_2[] = _( + "The fire that blazes wildly within this\n" + "POKéMON’s body is its source of power."); + +const u8 DexDescription_Poliwag_1[] = _( + "POLIWAG has a very thin skin. It is\n" + "possible to see the POKéMON’s spiral\n" + "innards right through the skin."); +const u8 DexDescription_Poliwag_2[] = _( + "Despite its thinness, however, the skin\n" + "is also very flexible. Even sharp fangs\n" + "bounce right off it."); + +const u8 DexDescription_Poliwhirl_1[] = _( + "The surface of POLIWHIRL’s body is\n" + "always wet and slick with an oily fluid.\n" + "Because of this greasy covering, it can"); +const u8 DexDescription_Poliwhirl_2[] = _( + "easily slip and slide out of the clutches\n" + "of any enemy in battle."); + +const u8 DexDescription_Poliwrath_1[] = _( + "POLIWRATH’s highly developed, brawny\n" + "muscles never grow fatigued, however\n" + "much it exercises."); +const u8 DexDescription_Poliwrath_2[] = _( + "It is so tirelessly strong, this POKéMON\n" + "can swim back and forth across the\n" + "Pacific Ocean without effort."); + +#ifdef SAPPHIRE +const u8 DexDescription_Abra_1[] = _( + "ABRA needs to sleep for eighteen hours\n" + "a day. If it doesn’t, this POKéMON loses\n" + "its ability to use telekinetic powers."); +const u8 DexDescription_Abra_2[] = _( + "If it is attacked, ABRA escapes using\n" + "TELEPORT while it is still sleeping."); +#else +const u8 DexDescription_Abra_1[] = _( + "ABRA sleeps for eighteen hours a day.\n" + "However, it can sense the presence of\n" + "foes even while it is sleeping."); +const u8 DexDescription_Abra_2[] = _( + "In such a situation, this POKéMON\n" + "immediately teleports to safety."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Kadabra_1[] = _( + "KADABRA holds a silver spoon in its\n" + "hand. The spoon is used to amplify the\n" + "alpha waves in its brain."); +const u8 DexDescription_Kadabra_2[] = _( + "Without the spoon, the POKéMON is said\n" + "to be limited to half the usual amount\n" + "of its telekinetic powers."); +#else +const u8 DexDescription_Kadabra_1[] = _( + "KADABRA emits a peculiar alpha wave\n" + "if it develops a headache. Only those\n" + "people with a particularly strong"); +const u8 DexDescription_Kadabra_2[] = _( + "psyche can hope to become a TRAINER\n" + "of this POKéMON."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Alakazam_1[] = _( + "ALAKAZAM’s brain continually grows,\n" + "infinitely multiplying brain cells.\n" + "This amazing brain gives this POKéMON"); +const u8 DexDescription_Alakazam_2[] = _( + "an astoundingly high IQ of 5,000.\n" + "It has a thorough memory of everything\n" + "that has occurred in the world."); +#else +const u8 DexDescription_Alakazam_1[] = _( + "ALAKAZAM’s brain continually grows,\n" + "making its head far too heavy to\n" + "support with its neck."); +const u8 DexDescription_Alakazam_2[] = _( + "This POKéMON holds its head up using\n" + "its psychokinetic power instead."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Machop_1[] = _( + "MACHOP exercises by hefting around\n" + "a GRAVELER as if it were a barbell.\n" + "There are some MACHOP that travel"); +const u8 DexDescription_Machop_2[] = _( + "the world in a quest to master all\n" + "kinds of martial arts."); +#else +const u8 DexDescription_Machop_1[] = _( + "MACHOP’s muscles are special - they\n" + "never get sore no matter how much they\n" + "are used in exercise."); +const u8 DexDescription_Machop_2[] = _( + "This POKéMON has sufficient power to\n" + "hurl a hundred adult humans."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Machoke_1[] = _( + "MACHOKE undertakes bodybuilding every\n" + "day even as it helps people with tough,\n" + "physically demanding labor."); +const u8 DexDescription_Machoke_2[] = _( + "On its days off, this POKéMON heads to\n" + "the fields and mountains to exercise\n" + "and train."); +#else +const u8 DexDescription_Machoke_1[] = _( + "MACHOKE’s thoroughly toned muscles\n" + "possess the hardness of steel.\n" + "This POKéMON has so much strength,"); +const u8 DexDescription_Machoke_2[] = _( + "it can easily hold aloft a sumo wrestler\n" + "on just one finger."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Machamp_1[] = _( + "MACHAMP is known as the POKéMON that\n" + "has mastered every kind of martial arts.\n" + "If it grabs hold of the foe with its four"); +const u8 DexDescription_Machamp_2[] = _( + "arms, the battle is all but over.\n" + "The hapless foe is thrown far over the\n" + "horizon."); +#else +const u8 DexDescription_Machamp_1[] = _( + "MACHAMP has the power to hurl anything\n" + "aside. However, trying to do any work\n" + "requiring care and dexterity causes"); +const u8 DexDescription_Machamp_2[] = _( + "its arms to get tangled.\n" + "This POKéMON tends to leap into action\n" + "before it thinks."); +#endif + +const u8 DexDescription_Bellsprout_1[] = _( + "BELLSPROUT’s thin and flexible body\n" + "lets it bend and sway to avoid any\n" + "attack, however strong it may be."); +const u8 DexDescription_Bellsprout_2[] = _( + "From its mouth, this POKéMON spits a\n" + "corrosive fluid that melts even iron."); + +const u8 DexDescription_Weepinbell_1[] = _( + "WEEPINBELL has a large hook on its rear\n" + "end. At night, the POKéMON hooks on to\n" + "a tree branch and goes to sleep."); +const u8 DexDescription_Weepinbell_2[] = _( + "If it moves around in its sleep, it may\n" + "wake up to find itself on the ground."); + +const u8 DexDescription_Victreebel_1[] = _( + "VICTREEBEL has a long vine that\n" + "extends from its head. This vine is\n" + "waved and flicked about as if it were"); +const u8 DexDescription_Victreebel_2[] = _( + "an animal to attract prey. When an\n" + "unsuspecting prey draws near, this\n" + "POKéMON swallows it whole."); + +#ifdef SAPPHIRE +const u8 DexDescription_Tentacool_1[] = _( + "TENTACOOL absorbs sunlight and\n" + "refracts it using water inside its body\n" + "to convert it into beam energy."); +const u8 DexDescription_Tentacool_2[] = _( + "This POKéMON shoots beams from its\n" + "crystal-like eyes."); +#else +const u8 DexDescription_Tentacool_1[] = _( + "TENTACOOL’s body is largely composed\n" + "of water. If it is removed from the\n" + "sea, it dries up like parchment."); +const u8 DexDescription_Tentacool_2[] = _( + "If this POKéMON happens to become\n" + "dehydrated, put it back into the sea."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Tentacruel_1[] = _( + "TENTACRUEL has tentacles that can be\n" + "freely elongated and shortened at will.\n" + "It ensnares prey with its tentacles and"); +const u8 DexDescription_Tentacruel_2[] = _( + "weakens the prey by dosing it with a\n" + "harsh toxin. It can catch up to 80\n" + "prey at the same time."); +#else +const u8 DexDescription_Tentacruel_1[] = _( + "TENTACRUEL has large red orbs on its\n" + "head. The orbs glow before lashing the\n" + "vicinity with a harsh ultrasonic blast."); +const u8 DexDescription_Tentacruel_2[] = _( + "This POKéMON’s outburst creates rough\n" + "waves around it."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Geodude_1[] = _( + "When GEODUDE sleeps deeply, it buries\n" + "itself halfway into the ground.\n" + "It will not awaken even if hikers step"); +const u8 DexDescription_Geodude_2[] = _( + "on it unwittingly.\n" + "In the morning, this POKéMON rolls\n" + "downhill in search of food."); +#else +const u8 DexDescription_Geodude_1[] = _( + "The longer a GEODUDE lives, the more\n" + "its edges are chipped and worn away,\n" + "making it more rounded in appearance."); +const u8 DexDescription_Geodude_2[] = _( + "However, this POKéMON’s heart will\n" + "remain hard, craggy, and rough always."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Graveler_1[] = _( + "Rocks are GRAVELER’s favorite food.\n" + "This POKéMON will climb a mountain from\n" + "the base to the summit, crunchingly"); +const u8 DexDescription_Graveler_2[] = _( + "feasting on rocks all the while.\n" + "Upon reaching the peak, it rolls back\n" + "down to the bottom."); +#else +const u8 DexDescription_Graveler_1[] = _( + "GRAVELER grows by feeding on rocks.\n" + "Apparently, it prefers to eat rocks\n" + "that are covered in moss."); +const u8 DexDescription_Graveler_2[] = _( + "This POKéMON eats its way through\n" + "a ton of rocks on a daily basis."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Golem_1[] = _( + "GOLEM is known for rolling down from\n" + "mountains. To prevent them from rolling\n" + "into the homes of people downhill,"); +const u8 DexDescription_Golem_2[] = _( + "grooves have been dug into the sides of\n" + "mountains to serve as guideways for\n" + "diverting this POKéMON’s course."); +#else +const u8 DexDescription_Golem_1[] = _( + "GOLEM live up on mountains.\n" + "If there is a large earthquake, these\n" + "POKéMON will come rolling down off"); +const u8 DexDescription_Golem_2[] = _( + "the mountains en masse to the\n" + "foothills below."); +#endif + +const u8 DexDescription_Ponyta_1[] = _( + "PONYTA is very weak at birth.\n" + "It can barely stand up.\n" + "This POKéMON becomes stronger by"); +const u8 DexDescription_Ponyta_2[] = _( + "stumbling and falling to keep up with\n" + "its parent."); + +const u8 DexDescription_Rapidash_1[] = _( + "RAPIDASH usually can be seen casually\n" + "cantering in the fields and plains.\n" + "However, when this POKéMON turns"); +const u8 DexDescription_Rapidash_2[] = _( + "serious, its fiery manes flare and blaze\n" + "as it gallops its way up to 150 mph."); + +const u8 DexDescription_Slowpoke_1[] = _( + "SLOWPOKE uses its tail to catch prey by\n" + "dipping it in water at the side of a\n" + "river."); +const u8 DexDescription_Slowpoke_2[] = _( + "However, this POKéMON often forgets\n" + "what it’s doing and often spends entire\n" + "days just loafing at water’s edge."); + +const u8 DexDescription_Slowbro_1[] = _( + "SLOWBRO’s tail has a SHELLDER firmly\n" + "attached with a bite. As a result, the\n" + "tail can’t be used for fishing anymore."); +const u8 DexDescription_Slowbro_2[] = _( + "This causes SLOWBRO to grudgingly swim\n" + "and catch prey instead."); + +#ifdef SAPPHIRE +const u8 DexDescription_Magnemite_1[] = _( + "MAGNEMITE floats in the air by emitting\n" + "electromagnetic waves from the units\n" + "at its sides. These waves block gravity."); +const u8 DexDescription_Magnemite_2[] = _( + "This POKéMON becomes incapable of\n" + "flight if its internal electrical supply\n" + "is depleted."); +#else +const u8 DexDescription_Magnemite_1[] = _( + "MAGNEMITE attaches itself to power\n" + "lines to feed on electricity.\n" + "If your house has a power outage,"); +const u8 DexDescription_Magnemite_2[] = _( + "check your circuit breakers. You may\n" + "find a large number of this POKéMON\n" + "clinging to the breaker box."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Magneton_1[] = _( + "MAGNETON emits a powerful magnetic\n" + "force that is fatal to electronics and\n" + "precision instruments. Because of"); +const u8 DexDescription_Magneton_2[] = _( + "this, it is said that some towns warn\n" + "people to keep this POKéMON inside\n" + "a POKé BALL."); +#else +const u8 DexDescription_Magneton_1[] = _( + "MAGNETON emits a powerful magnetic\n" + "force that is fatal to mechanical\n" + "devices. As a result, large cities sound"); +const u8 DexDescription_Magneton_2[] = _( + "sirens to warn citizens of large-scale\n" + "outbreaks of this POKéMON."); +#endif + +const u8 DexDescription_Farfetchd_1[] = _( + "FARFETCH’D is always seen with a stick\n" + "from a plant of some sort. Apparently,\n" + "there are good sticks and bad sticks."); +const u8 DexDescription_Farfetchd_2[] = _( + "This POKéMON has been known to fight\n" + "with others over sticks."); + +#ifdef SAPPHIRE +const u8 DexDescription_Doduo_1[] = _( + "DODUO’s two heads contain completely\n" + "identical brains.\n" + "A scientific study reported that on"); +const u8 DexDescription_Doduo_2[] = _( + "rare occasions, there will be examples\n" + "of this POKéMON possessing different\n" + "sets of brains."); +#else +const u8 DexDescription_Doduo_1[] = _( + "DODUO’s two heads never sleep at the\n" + "same time.\n" + "Its two heads take turns sleeping,"); +const u8 DexDescription_Doduo_2[] = _( + "so one head can always keep watch for\n" + "enemies while the other one sleeps."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Dodrio_1[] = _( + "Apparently, the heads aren’t the only\n" + "parts of the body that DODRIO has\n" + "three of."); +const u8 DexDescription_Dodrio_2[] = _( + "It has three sets of hearts and lungs\n" + "as well, so it is capable of running long\n" + "distances without rest."); +#else +const u8 DexDescription_Dodrio_1[] = _( + "Watch out if DODRIO’s three heads are\n" + "looking in three separate directions.\n" + "It’s a sure sign that it is on its guard."); +const u8 DexDescription_Dodrio_2[] = _( + "Don’t go near this POKéMON if it’s being\n" + "wary - it may decide to peck you."); +#endif + +const u8 DexDescription_Seel_1[] = _( + "SEEL hunts for prey in the frigid sea\n" + "underneath sheets of ice.\n" + "When it needs to breathe, it punches"); +const u8 DexDescription_Seel_2[] = _( + "a hole through the ice with the\n" + "sharply protruding section of its head."); + +const u8 DexDescription_Dewgong_1[] = _( + "DEWGONG loves to snooze on bitterly\n" + "cold ice.\n" + "The sight of this POKéMON sleeping on"); +const u8 DexDescription_Dewgong_2[] = _( + "a glacier was mistakenly thought to be\n" + "a mermaid by a mariner long ago."); + +#ifdef SAPPHIRE +const u8 DexDescription_Grimer_1[] = _( + "GRIMER emerged from the sludge that\n" + "settled on a polluted seabed.\n" + "This POKéMON loves anything filthy."); +const u8 DexDescription_Grimer_2[] = _( + "It constantly leaks a horribly germ-\n" + "infested fluid from all over its body."); +#else +const u8 DexDescription_Grimer_1[] = _( + "GRIMER’s sludgy and rubbery body can\n" + "be forced through any opening, however\n" + "small it may be."); +const u8 DexDescription_Grimer_2[] = _( + "This POKéMON enters sewer pipes to\n" + "drink filthy wastewater."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Muk_1[] = _( + "This POKéMON’s favorite food is\n" + "anything that is repugnantly filthy.\n" + "In dirty towns where people think"); +const u8 DexDescription_Muk_2[] = _( + "nothing of throwing away litter on the\n" + "streets, MUK are certain to gather."); +#else +const u8 DexDescription_Muk_1[] = _( + "From MUK’s body seeps a foul fluid that\n" + "gives off a nose-bendingly horrible\n" + "stench."); +const u8 DexDescription_Muk_2[] = _( + "Just one drop of this POKéMON’s body\n" + "fluid can turn a pool stagnant and\n" + "rancid."); +#endif + +const u8 DexDescription_Shellder_1[] = _( + "At night, this POKéMON uses its broad\n" + "tongue to burrow a hole in the seafloor\n" + "sand and then sleep in it."); +const u8 DexDescription_Shellder_2[] = _( + "While it is sleeping, SHELLDER closes its\n" + "shell, but leaves its tongue hanging\n" + "out."); + +const u8 DexDescription_Cloyster_1[] = _( + "CLOYSTER is capable of swimming in the\n" + "sea. It does so by swallowing water,\n" + "then jetting it out toward the rear."); +const u8 DexDescription_Cloyster_2[] = _( + "This POKéMON shoots spikes from its\n" + "shell using the same system."); + +const u8 DexDescription_Gastly_1[] = _( + "GASTLY is largely composed of gaseous\n" + "matter. When exposed to a strong wind,\n" + "the gaseous body quickly dwindles away."); +const u8 DexDescription_Gastly_2[] = _( + "Groups of this POKéMON cluster under\n" + "the eaves of houses to escape the\n" + "ravages of wind."); + +const u8 DexDescription_Haunter_1[] = _( + "HAUNTER is a dangerous POKéMON.\n" + "If one beckons you while floating in\n" + "darkness, you must never approach it."); +const u8 DexDescription_Haunter_2[] = _( + "This POKéMON will try to lick you with its\n" + "tongue and steal your life away."); + +const u8 DexDescription_Gengar_1[] = _( + "Sometimes, on a dark night, your shadow\n" + "thrown by a streetlight will suddenly\n" + "and startlingly overtake you."); +const u8 DexDescription_Gengar_2[] = _( + "It is actually a GENGAR running past\n" + "you, pretending to be your shadow."); + +const u8 DexDescription_Onix_1[] = _( + "ONIX has a magnet in its brain. It acts\n" + "as a compass so that this POKéMON does\n" + "not lose direction while it is tunneling."); +const u8 DexDescription_Onix_2[] = _( + "As it grows older, its body becomes\n" + "increasingly rounder and smoother."); + +const u8 DexDescription_Drowzee_1[] = _( + "If your nose becomes itchy while you\n" + "are sleeping, it’s a sure sign that one\n" + "of these POKéMON is standing above"); +const u8 DexDescription_Drowzee_2[] = _( + "your pillow and trying to eat your dream\n" + "through your nostrils."); + +const u8 DexDescription_Hypno_1[] = _( + "HYPNO holds a pendulum in its hand.\n" + "The arcing movement and glitter of the\n" + "pendulum lull the foe into a deep state"); +const u8 DexDescription_Hypno_2[] = _( + "of hypnosis.\n" + "While this POKéMON searches for prey,\n" + "it polishes the pendulum."); + +const u8 DexDescription_Krabby_1[] = _( + "KRABBY live on beaches, burrowed inside\n" + "holes dug into the sand.\n" + "On sandy beaches with little in the way"); +const u8 DexDescription_Krabby_2[] = _( + "of food, these POKéMON can be seen\n" + "squabbling with each other over\n" + "territory."); + +const u8 DexDescription_Kingler_1[] = _( + "KINGLER has an enormous, oversized\n" + "claw. It waves this huge claw in the\n" + "air to communicate with others."); +const u8 DexDescription_Kingler_2[] = _( + "However, because the claw is so heavy,\n" + "the POKéMON quickly tires."); + +#ifdef SAPPHIRE +const u8 DexDescription_Voltorb_1[] = _( + "VOLTORB is extremely sensitive - it\n" + "explodes at the slightest of shocks.\n" + "It is rumored that it was first created"); +const u8 DexDescription_Voltorb_2[] = _( + "when a POKé BALL was exposed to a\n" + "powerful pulse of energy."); +#else +const u8 DexDescription_Voltorb_1[] = _( + "VOLTORB was first sighted at a company\n" + "that manufactures POKé BALLS.\n" + "The link between that sighting and"); +const u8 DexDescription_Voltorb_2[] = _( + "the fact that this POKéMON looks very\n" + "similar to a POKé BALL remains a\n" + "mystery."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Electrode_1[] = _( + "One of ELECTRODE’s characteristics is\n" + "its attraction to electricity.\n" + "It is a problematical POKéMON that"); +const u8 DexDescription_Electrode_2[] = _( + "congregates mostly at electrical\n" + "power plants to feed on electricity\n" + "that has just been generated."); +#else +const u8 DexDescription_Electrode_1[] = _( + "ELECTRODE eats electricity in the\n" + "atmosphere. On days when lightning\n" + "strikes, you can see this POKéMON"); +const u8 DexDescription_Electrode_2[] = _( + "exploding all over the place from\n" + "eating too much electricity."); +#endif + +const u8 DexDescription_Exeggcute_1[] = _( + "This POKéMON consists of six eggs that\n" + "form a closely knit cluster. The six eggs\n" + "attract each other and spin around."); +const u8 DexDescription_Exeggcute_2[] = _( + "When cracks increasingly appear on the\n" + "eggs, EXEGGCUTE is close to evolution."); + +const u8 DexDescription_Exeggutor_1[] = _( + "EXEGGUTOR originally came from the\n" + "tropics. Its heads steadily grow larger\n" + "from exposure to strong sunlight."); +const u8 DexDescription_Exeggutor_2[] = _( + "It is said that when the heads fall off,\n" + "they group together to form EXEGGCUTE."); + +const u8 DexDescription_Cubone_1[] = _( + "CUBONE pines for the mother it will\n" + "never see again. Seeing a likeness of\n" + "its mother in the full moon, it cries."); +const u8 DexDescription_Cubone_2[] = _( + "The stains on the skull the POKéMON\n" + "wears are made by the tears it sheds."); + +const u8 DexDescription_Marowak_1[] = _( + "MAROWAK is the evolved form of a CUBONE\n" + "that has overcome its sadness at the\n" + "loss of its mother and grown tough."); +const u8 DexDescription_Marowak_2[] = _( + "This POKéMON’s tempered and hardened\n" + "spirit is not easily broken."); + +const u8 DexDescription_Hitmonlee_1[] = _( + "HITMONLEE’s legs freely contract and\n" + "stretch. Using these springlike legs, it\n" + "bowls over foes with devastating kicks."); +const u8 DexDescription_Hitmonlee_2[] = _( + "After battle, it rubs down its legs and\n" + "loosens the muscles to overcome\n" + "fatigue."); + +const u8 DexDescription_Hitmonchan_1[] = _( + "HITMONCHAN is said to possess the\n" + "spirit of a boxer who had been working\n" + "towards a world championship."); +const u8 DexDescription_Hitmonchan_2[] = _( + "This POKéMON has an indomitable spirit\n" + "and will never give up in the face of\n" + "adversity."); + +const u8 DexDescription_Lickitung_1[] = _( + "Whenever LICKITUNG comes across\n" + "something new, it will unfailingly give it\n" + "a lick. It does so because it memorizes"); +const u8 DexDescription_Lickitung_2[] = _( + "things by texture and by taste.\n" + "It is somewhat put off by sour things."); + +#ifdef SAPPHIRE +const u8 DexDescription_Koffing_1[] = _( + "KOFFING embodies toxic substances.\n" + "It mixes the toxins with raw garbage to\n" + "set off a chemical reaction that"); +const u8 DexDescription_Koffing_2[] = _( + "results in a terribly powerful poison\n" + "gas. The higher the temperature, the\n" + "more gas is concocted by this POKéMON."); +#else +const u8 DexDescription_Koffing_1[] = _( + "If KOFFING becomes agitated, it raises\n" + "the toxicity of its internal gases and\n" + "jets them out from all over its body."); +const u8 DexDescription_Koffing_2[] = _( + "This POKéMON may also overinflate its\n" + "round body, then explode."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Weezing_1[] = _( + "WEEZING alternately shrinks and\n" + "inflates its twin bodies to mix together\n" + "toxic gases inside."); +const u8 DexDescription_Weezing_2[] = _( + "The more the gases are mixed, the more\n" + "powerful the toxins become. The\n" + "POKéMON also becomes more putrid."); +#else +const u8 DexDescription_Weezing_1[] = _( + "WEEZING loves the gases given off by\n" + "rotted kitchen garbage. This POKéMON\n" + "will find a dirty, unkempt house and"); +const u8 DexDescription_Weezing_2[] = _( + "make it its home. At night, when the\n" + "people in the house are asleep, it will\n" + "go through the trash."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Rhyhorn_1[] = _( + "RHYHORN’s brain is very small. It is so\n" + "dense, while on a run it forgets why it\n" + "started running in the first place."); +const u8 DexDescription_Rhyhorn_2[] = _( + "It apparently remembers sometimes if it\n" + "demolishes something."); +#else +const u8 DexDescription_Rhyhorn_1[] = _( + "RHYHORN runs in a straight line,\n" + "smashing everything in its path.\n" + "It is not bothered even if it rushes"); +const u8 DexDescription_Rhyhorn_2[] = _( + "headlong into a block of steel.\n" + "This POKéMON may feel some pain from\n" + "the collision the next day, however."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Rhydon_1[] = _( + "RHYDON has a horn that serves as a\n" + "drill. It is used for destroying rocks\n" + "and boulders."); +const u8 DexDescription_Rhydon_2[] = _( + "This POKéMON occasionally rams into\n" + "streams of magma, but the armor-like\n" + "hide prevents it from feeling the heat."); +#else +const u8 DexDescription_Rhydon_1[] = _( + "RHYDON’s horn can crush even uncut\n" + "diamonds. One sweeping blow of its tail\n" + "can topple a building."); +const u8 DexDescription_Rhydon_2[] = _( + "This POKéMON’s hide is extremely tough.\n" + "Even direct cannon hits don’t leave\n" + "a scratch."); +#endif + +const u8 DexDescription_Chansey_1[] = _( + "CHANSEY lays nutritionally excellent\n" + "eggs on an everyday basis.\n" + "The eggs are so delicious, they are"); +const u8 DexDescription_Chansey_2[] = _( + "easily and eagerly devoured by even\n" + "those people who have lost their\n" + "appetite."); + +const u8 DexDescription_Tangela_1[] = _( + "TANGELA’s vines snap off easily if they\n" + "are grabbed. This happens without pain,\n" + "allowing it to make a quick getaway."); +const u8 DexDescription_Tangela_2[] = _( + "The lost vines are replaced by newly\n" + "grown vines the very next day."); + +const u8 DexDescription_Kangaskhan_1[] = _( + "If you come across a young KANGASKHAN\n" + "playing by itself, you must never\n" + "disturb it or attempt to catch it."); +const u8 DexDescription_Kangaskhan_2[] = _( + "The baby POKéMON’s parent is sure to\n" + "be in the area, and it will become\n" + "violently enraged at you."); + +#ifdef SAPPHIRE +const u8 DexDescription_Horsea_1[] = _( + "If HORSEA senses danger, it will\n" + "reflexively spray a dense black ink\n" + "from its mouth and try to escape."); +const u8 DexDescription_Horsea_2[] = _( + "This POKéMON swims by cleverly flapping\n" + "the fins on its back."); +#else +const u8 DexDescription_Horsea_1[] = _( + "HORSEA eats small insects and moss off\n" + "of rocks. If the ocean current turns\n" + "fast, this POKéMON anchors itself by"); +const u8 DexDescription_Horsea_2[] = _( + "wrapping its tail around rocks or coral\n" + "to prevent being washed away."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Seadra_1[] = _( + "SEADRA generates whirlpools by spinning\n" + "its body. The whirlpools are strong\n" + "enough to swallow even fishing boats."); +const u8 DexDescription_Seadra_2[] = _( + "This POKéMON weakens prey with these\n" + "currents, then swallows it whole."); +#else +const u8 DexDescription_Seadra_1[] = _( + "SEADRA sleeps after wriggling itself\n" + "between the branches of coral.\n" + "Those trying to harvest coral are"); +const u8 DexDescription_Seadra_2[] = _( + "occasionally stung by this POKéMON’s\n" + "poison barbs if they fail to notice it."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Goldeen_1[] = _( + "GOLDEEN loves swimming wild and free\n" + "in rivers and ponds.\n" + "If one of these POKéMON is placed in an"); +const u8 DexDescription_Goldeen_2[] = _( + "aquarium, it will shatter even the\n" + "thickest glass with one ram of its horn\n" + "and make its escape."); +#else +const u8 DexDescription_Goldeen_1[] = _( + "GOLDEEN is a very beautiful POKéMON\n" + "with fins that billow elegantly in water.\n" + "However, don’t let your guard down"); +const u8 DexDescription_Goldeen_2[] = _( + "around this POKéMON - it could ram you\n" + "powerfully with its horn."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Seaking_1[] = _( + "SEAKING is very protective of its eggs.\n" + "The male and female will take turns\n" + "patrolling around their nest and eggs."); +const u8 DexDescription_Seaking_2[] = _( + "The guarding of eggs by these POKéMON\n" + "goes on for over a month."); +#else +const u8 DexDescription_Seaking_1[] = _( + "In the autumn, SEAKING males can be\n" + "seen performing courtship dances in\n" + "riverbeds to woo females."); +const u8 DexDescription_Seaking_2[] = _( + "During this season, this POKéMON’s body\n" + "coloration is at its most beautiful."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Staryu_1[] = _( + "STARYU apparently communicates with\n" + "the stars in the night sky by flashing\n" + "the red core at the center of its body."); +const u8 DexDescription_Staryu_2[] = _( + "If parts of its body are torn, this\n" + "POKéMON simply regenerates the\n" + "missing pieces and limbs."); +#else +const u8 DexDescription_Staryu_1[] = _( + "STARYU’s center section has an organ\n" + "called the core that shines bright red.\n" + "If you go to a beach toward the"); +const u8 DexDescription_Staryu_2[] = _( + "end of summer, the glowing cores of\n" + "these POKéMON look like the stars\n" + "in the sky."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Starmie_1[] = _( + "STARMIE swims through water by\n" + "spinning its star-shaped body as if it\n" + "were a propeller on a ship."); +const u8 DexDescription_Starmie_2[] = _( + "The core at the center of this\n" + "POKéMON’s body glows in seven colors."); +#else +const u8 DexDescription_Starmie_1[] = _( + "STARMIE’s center section - the core -\n" + "glows brightly in seven colors.\n" + "Because of its luminous nature, this"); +const u8 DexDescription_Starmie_2[] = _( + "POKéMON has been given the nickname\n" + "“the gem of the sea.â€"); +#endif + +const u8 DexDescription_Mrmime_1[] = _( + "MR. MIME is a master of pantomime.\n" + "Its gestures and motions convince\n" + "watchers that something unseeable"); +const u8 DexDescription_Mrmime_2[] = _( + "actually exists. Once it is believed,\n" + "it will exist as if it were a real thing."); + +const u8 DexDescription_Scyther_1[] = _( + "SCYTHER is blindingly fast. Its blazing\n" + "speed enhances the effectiveness of\n" + "the twin scythes on its forearms."); +const u8 DexDescription_Scyther_2[] = _( + "This POKéMON’s scythes are so\n" + "effective, they can slice through thick\n" + "logs in one wicked stroke."); + +const u8 DexDescription_Jynx_1[] = _( + "JYNX walks rhythmically, swaying and\n" + "shaking its hips as if it were dancing.\n" + "Its motions are so bouncingly alluring,"); +const u8 DexDescription_Jynx_2[] = _( + "people seeing it are compelled to shake\n" + "their hips without giving any thought\n" + "to what they are doing."); + +const u8 DexDescription_Electabuzz_1[] = _( + "When a storm arrives, gangs of this\n" + "POKéMON compete with each other to\n" + "scale heights that are likely to be"); +const u8 DexDescription_Electabuzz_2[] = _( + "stricken by lightning bolts.\n" + "Some towns use ELECTABUZZ in place of\n" + "lightning rods."); + +const u8 DexDescription_Magmar_1[] = _( + "In battle, MAGMAR blows out intensely\n" + "hot flames from all over its body to\n" + "intimidate its opponent."); +const u8 DexDescription_Magmar_2[] = _( + "This POKéMON’s fiery bursts create\n" + "heat waves that ignite grass and trees\n" + "in its surroundings."); + +#ifdef SAPPHIRE +const u8 DexDescription_Pinsir_1[] = _( + "PINSIR has a pair of massive horns \n" + "Protruding from the surface of these\n" + "horns are thorns."); +const u8 DexDescription_Pinsir_2[] = _( + "These thorns are driven deeply into the\n" + "foe’s body when the pincer closes,\n" + "making it tough for the foe to escape."); +#else +const u8 DexDescription_Pinsir_1[] = _( + "PINSIR is astoundingly strong. It can\n" + "grip a foe weighing twice its weight\n" + "in its horns and easily lift it."); +const u8 DexDescription_Pinsir_2[] = _( + "This POKéMON’s movements turn sluggish\n" + "in cold places."); +#endif + +const u8 DexDescription_Tauros_1[] = _( + "This POKéMON is not satisfied unless\n" + "it is rampaging at all times.\n" + "If there is no opponent for TAUROS to"); +const u8 DexDescription_Tauros_2[] = _( + "battle, it will charge at thick trees and\n" + "knock them down to calm itself."); + +#ifdef SAPPHIRE +const u8 DexDescription_Magikarp_1[] = _( + "MAGIKARP is virtually useless in battle\n" + "as it can only splash around.\n" + "As a result, it is considered to be weak."); +const u8 DexDescription_Magikarp_2[] = _( + "However, it is actually a very hardy\n" + "POKéMON that can survive in any body of\n" + "water no matter how polluted it is."); +#else +const u8 DexDescription_Magikarp_1[] = _( + "MAGIKARP is a pathetic excuse for a\n" + "POKéMON that is only capable of\n" + "flopping and splashing."); +const u8 DexDescription_Magikarp_2[] = _( + "This behavior prompted scientists to\n" + "undertake research into it."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Gyarados_1[] = _( + "Once GYARADOS goes on a rampage, its\n" + "ferociously violent blood doesn’t calm\n" + "until it has burned everything down."); +const u8 DexDescription_Gyarados_2[] = _( + "There are records of this POKéMON’s\n" + "rampages lasting a whole month."); +#else +const u8 DexDescription_Gyarados_1[] = _( + "When MAGIKARP evolves into GYARADOS,\n" + "its brain cells undergo a structural\n" + "transformation. It is said that this"); +const u8 DexDescription_Gyarados_2[] = _( + "transformation is to blame for this\n" + "POKéMON’s wildly violent nature."); +#endif + +const u8 DexDescription_Lapras_1[] = _( + "People have driven LAPRAS almost to the\n" + "point of extinction. In the evenings,\n" + "this POKéMON is said to sing plaintively"); +const u8 DexDescription_Lapras_2[] = _( + "as it seeks what few others of its kind\n" + "still remain."); + +const u8 DexDescription_Ditto_1[] = _( + "DITTO rearranges its cell structure to\n" + "transform itself into other shapes.\n" + "However, if it tries to transform itself"); +const u8 DexDescription_Ditto_2[] = _( + "into something by relying on its memory,\n" + "this POKéMON manages to get details\n" + "wrong."); + +const u8 DexDescription_Eevee_1[] = _( + "EEVEE has an unstable genetic makeup\n" + "that suddenly mutates due to the\n" + "environment in which it lives."); +const u8 DexDescription_Eevee_2[] = _( + "Radiation from various STONES causes\n" + "this POKéMON to evolve."); + +const u8 DexDescription_Vaporeon_1[] = _( + "VAPOREON underwent a spontaneous\n" + "mutation and grew fins and gills that\n" + "allow it to live underwater."); +const u8 DexDescription_Vaporeon_2[] = _( + "This POKéMON has the ability to freely\n" + "control water."); + +const u8 DexDescription_Jolteon_1[] = _( + "JOLTEON’s cells generate a low level of\n" + "electricity. This power is amplified by\n" + "the static electricity of its fur,"); +const u8 DexDescription_Jolteon_2[] = _( + "enabling the POKéMON to drop\n" + "thunderbolts. The bristling fur is made\n" + "of electrically charged needles."); + +const u8 DexDescription_Flareon_1[] = _( + "FLAREON’s fluffy fur has a functional\n" + "purpose - it releases heat into the air\n" + "so that its body does not get"); +const u8 DexDescription_Flareon_2[] = _( + "excessively hot.\n" + "This POKéMON’s body temperature can\n" + "rise to a maximum of 1,650 degrees F."); + +const u8 DexDescription_Porygon_1[] = _( + "PORYGON is capable of reverting itself\n" + "entirely back to program data and\n" + "entering cyberspace."); +const u8 DexDescription_Porygon_2[] = _( + "This POKéMON is copy-protected so it\n" + "cannot be duplicated by copying."); + +const u8 DexDescription_Omanyte_1[] = _( + "OMANYTE is one of the ancient and long-\n" + "since-extinct POKéMON that have been\n" + "regenerated from fossils by people."); +const u8 DexDescription_Omanyte_2[] = _( + "If attacked by an enemy, it withdraws\n" + "itself inside its hard shell."); + +const u8 DexDescription_Omastar_1[] = _( + "OMASTAR uses its tentacles to capture\n" + "its prey. It is believed to have become\n" + "extinct because its shell grew too large"); +const u8 DexDescription_Omastar_2[] = _( + "and heavy, causing its movements to\n" + "become too slow and ponderous."); + +const u8 DexDescription_Kabuto_1[] = _( + "KABUTO is a POKéMON that has been\n" + "regenerated from a fossil. However, in\n" + "extremely rare cases, living examples"); +const u8 DexDescription_Kabuto_2[] = _( + "have been discovered.\n" + "The POKéMON has not changed at all for\n" + "300 million years."); + +const u8 DexDescription_Kabutops_1[] = _( + "KABUTOPS swam underwater to hunt for\n" + "its prey in ancient times.\n" + "The POKéMON was apparently evolving"); +const u8 DexDescription_Kabutops_2[] = _( + "from being a water-dweller to living on\n" + "land as evident from the beginnings of\n" + "change in its gills and legs."); + +const u8 DexDescription_Aerodactyl_1[] = _( + "AERODACTYL is a POKéMON from the age\n" + "of dinosaurs. It was regenerated from\n" + "genetic material extracted from amber."); +const u8 DexDescription_Aerodactyl_2[] = _( + "It is imagined to have been the king of\n" + "the skies in ancient times."); + +const u8 DexDescription_Snorlax_1[] = _( + "SNORLAX’s typical day consists of\n" + "nothing more than eating and sleeping.\n" + "It is such a docile POKéMON that there"); +const u8 DexDescription_Snorlax_2[] = _( + "are children who use its expansive belly\n" + "as a place to play."); + +const u8 DexDescription_Articuno_1[] = _( + "ARTICUNO is a legendary bird POKéMON\n" + "that can control ice.\n" + "The flapping of its wings chills the air."); +const u8 DexDescription_Articuno_2[] = _( + "As a result, it is said that when this\n" + "POKéMON flies, snow will fall."); + +const u8 DexDescription_Zapdos_1[] = _( + "ZAPDOS is a legendary bird POKéMON that\n" + "has the ability to control electricity.\n" + "It usually lives in thunderclouds."); +const u8 DexDescription_Zapdos_2[] = _( + "The POKéMON gains power if it is\n" + "stricken by lightning bolts."); + +const u8 DexDescription_Moltres_1[] = _( + "MOLTRES is a legendary bird POKéMON\n" + "that has the ability to control fire.\n" + "If this POKéMON is injured, it is said to"); +const u8 DexDescription_Moltres_2[] = _( + "dip its body in the molten magma of a\n" + "volcano to burn and heal itself."); + +const u8 DexDescription_Dratini_1[] = _( + "DRATINI continually molts and sloughs\n" + "off its old skin.\n" + "It does so because the life energy"); +const u8 DexDescription_Dratini_2[] = _( + "within its body steadily builds to reach\n" + "uncontrollable levels."); + +const u8 DexDescription_Dragonair_1[] = _( + "DRAGONAIR stores an enormous amount\n" + "of energy inside its body.\n" + "It is said to alter weather conditions"); +const u8 DexDescription_Dragonair_2[] = _( + "in its vicinity by discharging energy\n" + "from the crystals on its neck and tail."); + +const u8 DexDescription_Dragonite_1[] = _( + "DRAGONITE is capable of circling the\n" + "globe in just sixteen hours.\n" + "It is a kindhearted POKéMON that leads"); +const u8 DexDescription_Dragonite_2[] = _( + "lost and foundering ships in a storm to\n" + "the safety of land."); + +const u8 DexDescription_Mewtwo_1[] = _( + "MEWTWO is a POKéMON that was created\n" + "by genetic manipulation.\n" + "However, even though the scientific"); +const u8 DexDescription_Mewtwo_2[] = _( + "power of humans created this POKéMON’s\n" + "body, they failed to endow MEWTWO with\n" + "a compassionate heart."); + +const u8 DexDescription_Mew_1[] = _( + "MEW is said to possess the genetic\n" + "composition of all POKéMON.\n" + "It is capable of making itself invisible"); +const u8 DexDescription_Mew_2[] = _( + "at will, so it entirely avoids notice even\n" + "if it approaches people."); + +const u8 DexDescription_Chikorita_1[] = _( + "In battle, CHIKORITA waves its leaf\n" + "around to keep the foe at bay.\n" + "However, a sweet fragrance also wafts"); +const u8 DexDescription_Chikorita_2[] = _( + "from the leaf, becalming the battling\n" + "POKéMON and creating a cozy, friendly\n" + "atmosphere all around."); + +const u8 DexDescription_Bayleef_1[] = _( + "BAYLEEF’s neck is ringed by curled-up\n" + "leaves. Inside each tubular leaf is a\n" + "small shoot of a tree."); +const u8 DexDescription_Bayleef_2[] = _( + "The fragrance of this shoot makes\n" + "people peppy."); + +const u8 DexDescription_Meganium_1[] = _( + "The fragrance of MEGANIUM’s flower\n" + "soothes and calms emotions.\n" + "In battle, this POKéMON gives off more"); +const u8 DexDescription_Meganium_2[] = _( + "of its becalming scent to blunt the\n" + "foe’s fighting spirit."); + +const u8 DexDescription_Cyndaquil_1[] = _( + "CYNDAQUIL protects itself by flaring up\n" + "the flames on its back.\n" + "The flames are vigorous if the POKéMON"); +const u8 DexDescription_Cyndaquil_2[] = _( + "is angry. However, if it is tired, the\n" + "flames splutter fitfully with incomplete\n" + "combustion."); + +const u8 DexDescription_Quilava_1[] = _( + "QUILAVA keeps its foes at bay with the\n" + "intensity of its flames and gusts of\n" + "superheated air."); +const u8 DexDescription_Quilava_2[] = _( + "This POKéMON applies its outstanding\n" + "nimbleness to dodge attacks even while\n" + "scorching the foe with flames."); + +const u8 DexDescription_Typhlosion_1[] = _( + "TYPHLOSION obscures itself behind a\n" + "shimmering heat haze that it creates\n" + "using its intensely hot flames."); +const u8 DexDescription_Typhlosion_2[] = _( + "This POKéMON creates blazing explosive\n" + "blasts that burn everything to cinders."); + +const u8 DexDescription_Totodile_1[] = _( + "Despite the smallness of its body,\n" + "TOTODILE’s jaws are very powerful.\n" + "While the POKéMON may think it is just"); +const u8 DexDescription_Totodile_2[] = _( + "playfully nipping, its bite has enough\n" + "power to cause serious injury."); + +const u8 DexDescription_Croconaw_1[] = _( + "Once CROCONAW has clamped its jaws on\n" + "its foe, it will absolutely not let go.\n" + "Because the tips of its fangs are"); +const u8 DexDescription_Croconaw_2[] = _( + "forked back like barbed fishhooks, they\n" + "become impossible to remove when \n" + "they have sunk in."); + +const u8 DexDescription_Feraligatr_1[] = _( + "FERALIGATR intimidates its foes by\n" + "opening its huge mouth.\n" + "In battle, it will kick the ground hard"); +const u8 DexDescription_Feraligatr_2[] = _( + "with its thick and powerful hind legs to\n" + "charge at the foe at an incredible\n" + "speed."); + +const u8 DexDescription_Sentret_1[] = _( + "When SENTRET sleeps, it does so while\n" + "another stands guard. The sentry wakes\n" + "the others at the first sign of danger."); +const u8 DexDescription_Sentret_2[] = _( + "When this POKéMON becomes separated\n" + "from its pack, it becomes incapable of\n" + "sleep due to fear."); + +const u8 DexDescription_Furret_1[] = _( + "FURRET has a very slim build.\n" + "When under attack, it can slickly squirm\n" + "through narrow spaces and get away."); +const u8 DexDescription_Furret_2[] = _( + "In spite of its short limbs, this\n" + "POKéMON is very nimble and fleet."); + +const u8 DexDescription_Hoothoot_1[] = _( + "HOOTHOOT has an internal organ that\n" + "senses and tracks the earth’s rotation.\n" + "Using this special organ, this POKéMON"); +const u8 DexDescription_Hoothoot_2[] = _( + "begins hooting at precisely the same\n" + "time every day."); + +const u8 DexDescription_Noctowl_1[] = _( + "NOCTOWL never fails at catching prey in\n" + "darkness. This POKéMON owes its\n" + "success to its superior vision that"); +const u8 DexDescription_Noctowl_2[] = _( + "allows it to see in minimal light, and to\n" + "its soft, supple wings that make no\n" + "sound in flight."); + +const u8 DexDescription_Ledyba_1[] = _( + "LEDYBA secretes an aromatic fluid from\n" + "where its legs join its body. This fluid\n" + "is used for communicating with others."); +const u8 DexDescription_Ledyba_2[] = _( + "This POKéMON conveys its feelings to\n" + "others by altering the fluid’s scent."); + +const u8 DexDescription_Ledian_1[] = _( + "It is said that in lands with clean air,\n" + "where the stars fill the sky, there live\n" + "LEDIAN in countless numbers."); +const u8 DexDescription_Ledian_2[] = _( + "There is a good reason for this - the\n" + "POKéMON uses the light of the stars\n" + "as its energy."); + +const u8 DexDescription_Spinarak_1[] = _( + "The web spun by SPINARAK can be\n" + "considered its second nervous system.\n" + "It is said that this POKéMON can"); +const u8 DexDescription_Spinarak_2[] = _( + "determine what kind of prey is touching\n" + "its web just by the tiny vibrations it\n" + "feels through the web’s strands."); + +const u8 DexDescription_Ariados_1[] = _( + "ARIADOS’s feet are tipped with tiny\n" + "hooked claws that enable it to scuttle\n" + "on ceilings and vertical walls."); +const u8 DexDescription_Ariados_2[] = _( + "This POKéMON constricts the foe with\n" + "thin and strong silk webbing."); + +#ifdef SAPPHIRE +const u8 DexDescription_Crobat_1[] = _( + "CROBAT sneaks up on its intended prey\n" + "using wings that barely make a sound.\n" + "This POKéMON rests by hanging on a"); +const u8 DexDescription_Crobat_2[] = _( + "tree branch with its rear legs that\n" + "serve as wings."); +#else +const u8 DexDescription_Crobat_1[] = _( + "If this POKéMON is flying by fluttering\n" + "only a pair of wings on either the\n" + "forelegs or hind legs, it’s proof that"); +const u8 DexDescription_Crobat_2[] = _( + "CROBAT has been flying a long distance.\n" + "It switches the wings it uses if it is\n" + "tired."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Chinchou_1[] = _( + "CHINCHOU’s two antennas are filled with\n" + "cells that generate strong electricity.\n" + "This POKéMON’s cells create so much"); +const u8 DexDescription_Chinchou_2[] = _( + "electrical power, it even makes itself\n" + "tingle slightly."); +#else +const u8 DexDescription_Chinchou_1[] = _( + "CHINCHOU lets loose positive and\n" + "negative electrical charges from its\n" + "two antennas to make its prey faint."); +const u8 DexDescription_Chinchou_2[] = _( + "This POKéMON flashes its electric\n" + "lights to exchange signals with others."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Lanturn_1[] = _( + "LANTURN is known to emit light.\n" + "If you peer down into the dark sea from\n" + "a ship at night, you can sometimes see"); +const u8 DexDescription_Lanturn_2[] = _( + "this POKéMON’s light rising from the\n" + "depths where it swims. It gives the sea\n" + "an appearance of a starlit night."); +#else +const u8 DexDescription_Lanturn_1[] = _( + "LANTURN is nicknamed “the deep-sea\n" + "star†for its illuminated antenna.\n" + "This POKéMON produces light by"); +const u8 DexDescription_Lanturn_2[] = _( + "causing a chemical reaction between\n" + "bacteria and its bodily fluids inside\n" + "the antenna."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Pichu_1[] = _( + "When PICHU plays with others, it may\n" + "short out electricity with another\n" + "PICHU, creating a shower of sparks."); +const u8 DexDescription_Pichu_2[] = _( + "In that event, this POKéMON will begin\n" + "crying, startled by the flash of sparks."); +#else +const u8 DexDescription_Pichu_1[] = _( + "PICHU charges itself with electricity\n" + "more easily on days with thunderclouds\n" + "or when the air is very dry."); +const u8 DexDescription_Pichu_2[] = _( + "You can hear the crackling of static\n" + "electricity coming off this POKéMON."); +#endif + +const u8 DexDescription_Cleffa_1[] = _( + "On nights with many shooting stars,\n" + "CLEFFA can be seen dancing in a ring.\n" + "They dance through the night and stop"); +const u8 DexDescription_Cleffa_2[] = _( + "only at the break of day, when these\n" + "POKéMON quench their thirst with the\n" + "morning dew."); + +#ifdef SAPPHIRE +const u8 DexDescription_Igglybuff_1[] = _( + "IGGLYBUFF has a soft and plushy body\n" + "that feels very much like a marshmallow.\n" + "From this body wafts a gently sweet"); +const u8 DexDescription_Igglybuff_2[] = _( + "fragrance that soothes and calms the\n" + "emotions of its foes."); +#else +const u8 DexDescription_Igglybuff_1[] = _( + "IGGLYBUFF’s vocal chords are not\n" + "sufficiently developed. It would hurt\n" + "its throat if it were to sing too much."); +const u8 DexDescription_Igglybuff_2[] = _( + "This POKéMON gargles with freshwater\n" + "from a clean stream."); +#endif + +const u8 DexDescription_Togepi_1[] = _( + "As its energy, TOGEPI uses the positive\n" + "emotions of compassion and pleasure\n" + "exuded by people and POKéMON."); +const u8 DexDescription_Togepi_2[] = _( + "This POKéMON stores up feelings of\n" + "happiness inside its shell, then shares\n" + "them with others."); + +const u8 DexDescription_Togetic_1[] = _( + "TOGETIC is said to be a POKéMON that\n" + "brings good fortune. When the POKéMON\n" + "spots someone who is pure of heart,"); +const u8 DexDescription_Togetic_2[] = _( + "it is said to appear and share its\n" + "happiness with that person."); + +#ifdef SAPPHIRE +const u8 DexDescription_Natu_1[] = _( + "NATU has a highly developed jumping\n" + "ability. The POKéMON flaps and leaps\n" + "onto tree branches that are taller than"); +const u8 DexDescription_Natu_2[] = _( + "grown-up people to pick at the tree’s\n" + "new shoots."); +#else +const u8 DexDescription_Natu_1[] = _( + "NATU cannot fly because its wings are\n" + "not yet fully grown. If your eyes meet\n" + "with this POKéMON’s eyes, it will stare"); +const u8 DexDescription_Natu_2[] = _( + "back intently at you. But if you move\n" + "even slightly, it will hop away to safety."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Xatu_1[] = _( + "XATU is known to stand motionless while\n" + "staring at the sun all day long.\n" + "Some people revere it as a mystical"); +const u8 DexDescription_Xatu_2[] = _( + "POKéMON out of their belief that XATU\n" + "is in possession of the power to see\n" + "into the future."); +#else +const u8 DexDescription_Xatu_1[] = _( + "XATU stands rooted and still in one\n" + "spot all day long. People believe that\n" + "this POKéMON does so out of fear of"); +const u8 DexDescription_Xatu_2[] = _( + "the terrible things it has foreseen in\n" + "the future."); +#endif + +const u8 DexDescription_Mareep_1[] = _( + "MAREEP’s fluffy coat of wool rubs\n" + "together and builds a static charge.\n" + "The more static electricity is charged,"); +const u8 DexDescription_Mareep_2[] = _( + "the more brightly the lightbulb at the\n" + "tip of its tail grows."); + +const u8 DexDescription_Flaaffy_1[] = _( + "FLAAFFY’s wool quality changes so that\n" + "it can generate a high amount of static\n" + "electricity with a small amount of wool."); +const u8 DexDescription_Flaaffy_2[] = _( + "The bare and slick parts of its hide are\n" + "shielded against electricity."); + +const u8 DexDescription_Ampharos_1[] = _( + "AMPHAROS gives off so much light that\n" + "it can be seen even from space.\n" + "People in the old days used the light of"); +const u8 DexDescription_Ampharos_2[] = _( + "this POKéMON to send signals back and\n" + "forth with others far away."); + +#ifdef SAPPHIRE +const u8 DexDescription_Bellossom_1[] = _( + "A BELLOSSOM grows flowers more\n" + "beautifully if it has evolved from a\n" + "smelly GLOOM - the stinkier the better."); +const u8 DexDescription_Bellossom_2[] = _( + "At night, this POKéMON closes its\n" + "petals and goes to sleep."); +#else +const u8 DexDescription_Bellossom_1[] = _( + "When BELLOSSOM gets exposed to plenty\n" + "of sunlight, the leaves ringing its body\n" + "begin to spin around."); +const u8 DexDescription_Bellossom_2[] = _( + "This POKéMON’s dancing is renowned in\n" + "the southern lands."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Marill_1[] = _( + "When fishing for food at the edge of a\n" + "fast-running stream, MARILL wraps its\n" + "tail around the trunk of a tree."); +const u8 DexDescription_Marill_2[] = _( + "This POKéMON’s tail is flexible and\n" + "configured to stretch."); +#else +const u8 DexDescription_Marill_1[] = _( + "MARILL’s oil-filled tail acts much like\n" + "a life preserver. If you see just its\n" + "tail bobbing on the water’s surface,"); +const u8 DexDescription_Marill_2[] = _( + "it’s a sure indication that this POKéMON\n" + "is diving beneath the water to feed on\n" + "aquatic plants."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Azumarill_1[] = _( + "AZUMARILL can make balloons out of\n" + "air. It makes these air balloons if it\n" + "spots a drowning POKéMON."); +const u8 DexDescription_Azumarill_2[] = _( + "The air balloons enable the POKéMON in\n" + "trouble to breathe."); +#else +const u8 DexDescription_Azumarill_1[] = _( + "AZUMARILL’s long ears are indispensable\n" + "sensors. By focusing its hearing, this\n" + "POKéMON can identify what kinds of"); +const u8 DexDescription_Azumarill_2[] = _( + "prey are around, even in rough and\n" + "fast-running rivers."); +#endif + +const u8 DexDescription_Sudowoodo_1[] = _( + "SUDOWOODO camouflages itself as a tree\n" + "to avoid being attacked by enemies.\n" + "However, because the forelegs remain"); +const u8 DexDescription_Sudowoodo_2[] = _( + "green throughout the year, the POKéMON\n" + "is easily identified as a fake during\n" + "the winter."); + +const u8 DexDescription_Politoed_1[] = _( + "The curled hair on POLITOED’s head is\n" + "proof of its status as a king. It is said\n" + "that the longer and more curled the"); +const u8 DexDescription_Politoed_2[] = _( + "hair, the more respect this POKéMON\n" + "earns from its peers."); + +const u8 DexDescription_Hoppip_1[] = _( + "This POKéMON drifts and floats with the\n" + "wind. If it senses the approach of\n" + "strong winds, HOPPIP links its leaves"); +const u8 DexDescription_Hoppip_2[] = _( + "with other HOPPIP to prepare against\n" + "being blown away."); + +const u8 DexDescription_Skiploom_1[] = _( + "SKIPLOOM’s flower blossoms when the\n" + "temperature rises above 64 degrees F.\n" + "How much the flower opens depends on"); +const u8 DexDescription_Skiploom_2[] = _( + "the temperature. For that reason, this\n" + "POKéMON is sometimes used as a\n" + "thermometer."); + +const u8 DexDescription_Jumpluff_1[] = _( + "JUMPLUFF rides warm southern winds to\n" + "cross the sea and fly to foreign lands.\n" + "The POKéMON descends to the ground"); +const u8 DexDescription_Jumpluff_2[] = _( + "when it encounters cold air while it is\n" + "floating."); + +const u8 DexDescription_Aipom_1[] = _( + "AIPOM’s tail ends in a hand-like\n" + "appendage that can be cleverly\n" + "manipulated."); +const u8 DexDescription_Aipom_2[] = _( + "However, because the POKéMON uses its\n" + "tail so much, its real hands have become\n" + "rather clumsy."); + +const u8 DexDescription_Sunkern_1[] = _( + "SUNKERN tries to move as little as it\n" + "possibly can. It does so because it\n" + "tries to conserve all the nutrients it"); +const u8 DexDescription_Sunkern_2[] = _( + "has stored in its body for its\n" + "evolution. It will not eat a thing, \n" + "subsisting only on morning dew."); + +const u8 DexDescription_Sunflora_1[] = _( + "SUNFLORA converts solar energy into\n" + "nutrition. It moves around actively in\n" + "the daytime when it is warm."); +const u8 DexDescription_Sunflora_2[] = _( + "It stops moving as soon as the sun goes\n" + "down for the night."); + +const u8 DexDescription_Yanma_1[] = _( + "YANMA is capable of seeing 360 degrees\n" + "without having to move its eyes.\n" + "It is a great flier that is adept at"); +const u8 DexDescription_Yanma_2[] = _( + "making sudden stops and turning midair.\n" + "This POKéMON uses its flying ability to\n" + "quickly chase down targeted prey."); + +const u8 DexDescription_Wooper_1[] = _( + "WOOPER usually lives in water.\n" + "However, it occasionally comes out onto\n" + "land in search of food."); +const u8 DexDescription_Wooper_2[] = _( + "On land, it coats its body with a gooey,\n" + "toxic film."); + +const u8 DexDescription_Quagsire_1[] = _( + "QUAGSIRE hunts for food by leaving\n" + "its mouth wide open in water and waiting\n" + "for its prey to blunder in unaware."); +const u8 DexDescription_Quagsire_2[] = _( + "Because the POKéMON does not move,\n" + "it does not get very hungry."); + +const u8 DexDescription_Espeon_1[] = _( + "ESPEON is extremely loyal to any\n" + "TRAINER it considers to be worthy.\n" + "It is said that this POKéMON developed"); +const u8 DexDescription_Espeon_2[] = _( + "its precognitive powers to protect its\n" + "TRAINER from harm."); + +const u8 DexDescription_Umbreon_1[] = _( + "UMBREON evolved as a result of exposure\n" + "to the moon’s waves.\n" + "It hides silently in darkness and waits"); +const u8 DexDescription_Umbreon_2[] = _( + "for its foes to make a move.\n" + "The rings on its body glow when it leaps\n" + "to attack."); + +const u8 DexDescription_Murkrow_1[] = _( + "MURKROW was feared and loathed as the\n" + "alleged bearer of ill fortune.\n" + "This POKéMON shows strong interest in"); +const u8 DexDescription_Murkrow_2[] = _( + "anything that sparkles or glitters.\n" + "It will even try to steal rings from\n" + "women."); + +const u8 DexDescription_Slowking_1[] = _( + "SLOWKING undertakes research every\n" + "day in an effort to solve the mysteries\n" + "of the world."); +const u8 DexDescription_Slowking_2[] = _( + "However, this POKéMON apparently\n" + "forgets everything it has learned if\n" + "the SHELLDER on its head comes off."); + +const u8 DexDescription_Misdreavus_1[] = _( + "MISDREAVUS frightens people with a\n" + "creepy, sobbing cry. The POKéMON\n" + "apparently uses its red spheres to"); +const u8 DexDescription_Misdreavus_2[] = _( + "absorb the fearful feelings of foes and\n" + "turn them into nutrition."); + +const u8 DexDescription_Unown_1[] = _( + "This POKéMON is shaped like ancient\n" + "writing. It is a mystery as to which\n" + "came first, the ancient writings or the"); +const u8 DexDescription_Unown_2[] = _( + "various UNOWN. Research into this\n" + "topic is ongoing but nothing is known."); + +#ifdef SAPPHIRE +const u8 DexDescription_Wobbuffet_1[] = _( + "WOBBUFFET does nothing but endure\n" + "attacks - it won’t attack on its own.\n" + "However, it won’t endure an attack on"); +const u8 DexDescription_Wobbuffet_2[] = _( + "its tail. When that happens, the\n" + "POKéMON will try to take the foe with it\n" + "using DESTINY BOND."); +#else +const u8 DexDescription_Wobbuffet_1[] = _( + "If two or more WOBBUFFET meet, they will\n" + "turn competitive and try to outdo each\n" + "other’s endurance."); +const u8 DexDescription_Wobbuffet_2[] = _( + "However, they may try to see which one\n" + "can endure the longest without food.\n" + "TRAINERS need to beware of this habit."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Girafarig_1[] = _( + "GIRAFARIG’s rear head contains a tiny\n" + "brain that is too small for thinking.\n" + "However, the rear head doesn’t need to"); +const u8 DexDescription_Girafarig_2[] = _( + "sleep, so it can keep watch over its\n" + "surroundings 24 hours a day."); +#else +const u8 DexDescription_Girafarig_1[] = _( + "GIRAFARIG’s rear head also has a brain,\n" + "but it is small. The rear head attacks in\n" + "response to smells and sounds."); +const u8 DexDescription_Girafarig_2[] = _( + "Approaching this POKéMON from behind\n" + "can cause the rear head to suddenly\n" + "lash out and bite."); +#endif + +const u8 DexDescription_Pineco_1[] = _( + "PINECO hangs from a tree branch and\n" + "patiently waits for prey to come along.\n" + "If the POKéMON is disturbed while"); +const u8 DexDescription_Pineco_2[] = _( + "eating by someone shaking its tree, it\n" + "drops down to the ground and explodes\n" + "with no warning."); + +const u8 DexDescription_Forretress_1[] = _( + "FORRETRESS conceals itself inside its\n" + "hardened steel shell. The shell is opened\n" + "when the POKéMON is catching prey,"); +const u8 DexDescription_Forretress_2[] = _( + "but it does so at such a quick pace\n" + "that the shell’s inside cannot be seen."); + +const u8 DexDescription_Dunsparce_1[] = _( + "DUNSPARCE has a drill for its tail.\n" + "It uses this tail to burrow into the\n" + "ground backwards."); +const u8 DexDescription_Dunsparce_2[] = _( + "This POKéMON is known to make its nest\n" + "in complex shapes deep under the\n" + "ground."); + +const u8 DexDescription_Gligar_1[] = _( + "GLIGAR glides through the air without\n" + "a sound as if it were sliding.\n" + "This POKéMON hangs on to the face of"); +const u8 DexDescription_Gligar_2[] = _( + "its foe using its clawed hind legs and\n" + "the large pincers on its forelegs, then\n" + "injects the prey with its poison barb."); + +const u8 DexDescription_Steelix_1[] = _( + "STEELIX lives even further underground\n" + "than ONIX. This POKéMON is known to dig\n" + "towards the earth’s core."); +const u8 DexDescription_Steelix_2[] = _( + "There are records of this POKéMON\n" + "reaching a depth of over six-tenths\n" + "of a mile underground."); + +const u8 DexDescription_Snubbull_1[] = _( + "By baring its fangs and making a scary\n" + "face, SNUBBULL sends smaller POKéMON\n" + "scurrying away in terror."); +const u8 DexDescription_Snubbull_2[] = _( + "However, this POKéMON seems a little\n" + "sad at making its foes flee."); + +const u8 DexDescription_Granbull_1[] = _( + "GRANBULL has a particularly well-\n" + "developed lower jaw. The enormous fangs\n" + "are heavy, causing the POKéMON to tip"); +const u8 DexDescription_Granbull_2[] = _( + "its head back for balance.\n" + "Unless it is startled, it will not try to\n" + "bite indiscriminately."); + +const u8 DexDescription_Qwilfish_1[] = _( + "QWILFISH sucks in water, inflating\n" + "itself. This POKéMON uses the pressure\n" + "of the water it swallowed to shoot"); +const u8 DexDescription_Qwilfish_2[] = _( + "toxic quills all at once from all over\n" + "its body. It finds swimming somewhat\n" + "challenging."); + +const u8 DexDescription_Scizor_1[] = _( + "SCIZOR has a body with the hardness of\n" + "steel. It is not easily fazed by ordinary\n" + "sorts of attacks."); +const u8 DexDescription_Scizor_2[] = _( + "This POKéMON flaps its wings to\n" + "regulate its body temperature."); + +const u8 DexDescription_Shuckle_1[] = _( + "SHUCKLE quietly hides itself under\n" + "rocks, keeping its body concealed\n" + "inside its hard shell while eating"); +const u8 DexDescription_Shuckle_2[] = _( + "berries it has stored away.\n" + "The berries mix with its body fluids to\n" + "become a juice."); + +#ifdef SAPPHIRE +const u8 DexDescription_Heracross_1[] = _( + "HERACROSS has sharp claws on its feet.\n" + "These are planted firmly into the\n" + "ground or the bark of a tree, giving the"); +const u8 DexDescription_Heracross_2[] = _( + "POKéMON a secure and solid footing\n" + "to forcefully fling away foes with\n" + "its proud horn."); +#else +const u8 DexDescription_Heracross_1[] = _( + "HERACROSS charges in a straight line at\n" + "its foe, slips beneath the foe’s grasp,\n" + "and then scoops up and hurls the"); +const u8 DexDescription_Heracross_2[] = _( + "opponent with its mighty horn.\n" + "This POKéMON even has enough power\n" + "to topple a massive tree."); +#endif + +const u8 DexDescription_Sneasel_1[] = _( + "SNEASEL scales trees by punching its\n" + "hooked claws into the bark.\n" + "This POKéMON seeks out unguarded"); +const u8 DexDescription_Sneasel_2[] = _( + "nests and steals eggs for food while\n" + "the parents are away."); + +const u8 DexDescription_Teddiursa_1[] = _( + "This POKéMON likes to lick its palms that\n" + "are sweetened by being soaked in honey.\n" + "TEDDIURSA concocts its own honey by"); +const u8 DexDescription_Teddiursa_2[] = _( + "blending fruits and pollen collected by\n" + "BEEDRILL."); + +const u8 DexDescription_Ursaring_1[] = _( + "In the forests inhabited by URSARING,\n" + "it is said that there are many streams\n" + "and towering trees where they"); +const u8 DexDescription_Ursaring_2[] = _( + "gather food. This POKéMON walks\n" + "through its forest gathering food\n" + "every day."); + +#ifdef SAPPHIRE +const u8 DexDescription_Slugma_1[] = _( + "SLUGMA does not have any blood in its\n" + "body. Instead, intensely hot magma\n" + "circulates throughout this POKéMON’s"); +const u8 DexDescription_Slugma_2[] = _( + "body, carrying essential nutrients and\n" + "oxygen to its organs."); +#else +const u8 DexDescription_Slugma_1[] = _( + "Molten magma courses throughout\n" + "SLUGMA’s circulatory system.\n" + "If this POKéMON is chilled, the magma"); +const u8 DexDescription_Slugma_2[] = _( + "cools and hardens. Its body turns\n" + "brittle and chunks fall off, reducing\n" + "its size."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Magcargo_1[] = _( + "MAGCARGO’s body temperature is\n" + "approximately 18,000 degrees F.\n" + "Water is vaporized on contact."); +const u8 DexDescription_Magcargo_2[] = _( + "If this POKéMON is caught in the rain,\n" + "the raindrops instantly turn into\n" + "steam, cloaking the area in a thick fog."); +#else +const u8 DexDescription_Magcargo_1[] = _( + "MAGCARGO’s shell is actually its skin\n" + "that hardened as a result of cooling.\n" + "Its shell is very brittle and fragile -"); +const u8 DexDescription_Magcargo_2[] = _( + "just touching it causes it to crumble\n" + "apart. This POKéMON returns to its\n" + "original size by dipping itself in magma."); +#endif + +const u8 DexDescription_Swinub_1[] = _( + "SWINUB roots for food by rubbing its\n" + "snout against the ground. Its favorite\n" + "food is a mushroom that grows under"); +const u8 DexDescription_Swinub_2[] = _( + "the cover of dead grass.\n" + "This POKéMON occasionally roots out\n" + "hot springs."); + +const u8 DexDescription_Piloswine_1[] = _( + "PILOSWINE is covered by a thick coat\n" + "of long hair that enables it to endure\n" + "the freezing cold."); +const u8 DexDescription_Piloswine_2[] = _( + "This POKéMON uses its tusks to dig up\n" + "food that has been buried under ice."); + +#ifdef SAPPHIRE +const u8 DexDescription_Corsola_1[] = _( + "Clusters of CORSOLA congregate in warm\n" + "seas where they serve as ideal hiding\n" + "places for smaller POKéMON."); +const u8 DexDescription_Corsola_2[] = _( + "When the water temperature falls, this\n" + "POKéMON migrates to the southern seas."); +#else +const u8 DexDescription_Corsola_1[] = _( + "CORSOLA’s branches glitter very\n" + "beautifully in seven colors when they\n" + "catch sunlight."); +const u8 DexDescription_Corsola_2[] = _( + "If any branch breaks off, this POKéMON\n" + "grows it back in just one night."); +#endif + +const u8 DexDescription_Remoraid_1[] = _( + "REMORAID sucks in water, then expels it\n" + "at high velocity using its abdominal\n" + "muscles to shoot down flying prey."); +const u8 DexDescription_Remoraid_2[] = _( + "When evolution draws near, this POKéMON\n" + "travels downstream from rivers."); + +const u8 DexDescription_Octillery_1[] = _( + "OCTILLERY grabs onto its foe using\n" + "its tentacles. This POKéMON tries to\n" + "immobilize it before delivering the"); +const u8 DexDescription_Octillery_2[] = _( + "finishing blow.\n" + "If the foe turns out to be too strong,\n" + "OCTILLERY spews ink to escape."); + +const u8 DexDescription_Delibird_1[] = _( + "DELIBIRD carries its food bundled up\n" + "in its tail. There once was a famous\n" + "explorer who managed to reach the peak"); +const u8 DexDescription_Delibird_2[] = _( + "of Mt. Everest thanks to one of these\n" + "POKéMON sharing its food."); + +const u8 DexDescription_Mantine_1[] = _( + "On sunny days, schools of MANTINE can\n" + "be seen elegantly leaping over the\n" + "sea’s waves."); +const u8 DexDescription_Mantine_2[] = _( + "This POKéMON is not bothered by the\n" + "REMORAID that hitches rides."); + +#ifdef SAPPHIRE +const u8 DexDescription_Skarmory_1[] = _( + "SKARMORY’s steel wings become tattered\n" + "and bashed in from repeated battles.\n" + "Once a year, the battered wings grow"); +const u8 DexDescription_Skarmory_2[] = _( + "back completely, restoring the cutting\n" + "edges to their pristine state."); +#else +const u8 DexDescription_Skarmory_1[] = _( + "SKARMORY is entirely encased in hard,\n" + "protective armor. This POKéMON flies at\n" + "close to 190 mph."); +const u8 DexDescription_Skarmory_2[] = _( + "It slashes foes with its wings that\n" + "possess swordlike cutting edges."); +#endif + +const u8 DexDescription_Houndour_1[] = _( + "HOUNDOUR hunt as a coordinated pack.\n" + "They communicate with each other using\n" + "a variety of cries to corner their prey."); +const u8 DexDescription_Houndour_2[] = _( + "This POKéMON’s remarkable teamwork is\n" + "unparalleled."); + +const u8 DexDescription_Houndoom_1[] = _( + "In a HOUNDOOM pack, the one with its\n" + "horns raked sharply towards the back\n" + "serves a leadership role."); +const u8 DexDescription_Houndoom_2[] = _( + "These POKéMON choose their leader by\n" + "fighting amongst themselves."); + +#ifdef SAPPHIRE +const u8 DexDescription_Kingdra_1[] = _( + "KINGDRA sleeps on the seafloor where\n" + "it is otherwise devoid of life.\n" + "When a storm arrives, the POKéMON is"); +const u8 DexDescription_Kingdra_2[] = _( + "said to awaken and wander about in\n" + "search of prey."); +#else +const u8 DexDescription_Kingdra_1[] = _( + "KINGDRA lives at extreme ocean depths\n" + "that are otherwise uninhabited.\n" + "It has long been believed that the"); +const u8 DexDescription_Kingdra_2[] = _( + "yawning of this POKéMON creates\n" + "spiraling ocean currents."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Phanpy_1[] = _( + "PHANPY uses its long nose to shower\n" + "itself. When others gather around, they\n" + "thoroughly douse each other with water."); +const u8 DexDescription_Phanpy_2[] = _( + "These POKéMON can be seen drying their\n" + "soaking-wet bodies at the edge of\n" + "water."); +#else +const u8 DexDescription_Phanpy_1[] = _( + "For its nest, PHANPY digs a vertical pit \n" + "in the ground at the edge of a river.\n" + "It marks the area around its nest with"); +const u8 DexDescription_Phanpy_2[] = _( + "its trunk to let the others know that\n" + "the area has been claimed."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Donphan_1[] = _( + "If DONPHAN were to tackle with its hard\n" + "body, even a house could be destroyed.\n" + "Using its massive strength, the"); +const u8 DexDescription_Donphan_2[] = _( + "POKéMON helps clear rock and mud slides\n" + "that block mountain trails."); +#else +const u8 DexDescription_Donphan_1[] = _( + "DONPHAN’s favorite attack is curling\n" + "its body into a ball, then charging at\n" + "its foe while rolling at high speed."); +const u8 DexDescription_Donphan_2[] = _( + "Once it starts rolling, this POKéMON\n" + "can’t stop very easily."); +#endif + +const u8 DexDescription_Porygon2_1[] = _( + "PORYGON2 was created by humans using\n" + "the power of science. The man-made\n" + "POKéMON has been endowed with"); +const u8 DexDescription_Porygon2_2[] = _( + "artificial intelligence that enables it\n" + "to learn new gestures and emotions\n" + "on its own."); + +const u8 DexDescription_Stantler_1[] = _( + "STANTLER’s magnificent antlers were\n" + "traded at high prices as works of art.\n" + "As a result, this POKéMON was hunted"); +const u8 DexDescription_Stantler_2[] = _( + "close to extinction by those who were\n" + "after the priceless antlers."); + +const u8 DexDescription_Smeargle_1[] = _( + "SMEARGLE marks the boundaries of its\n" + "territory using a body fluid that leaks\n" + "out from the tip of its tail."); +const u8 DexDescription_Smeargle_2[] = _( + "Over 5,000 different marks left by this\n" + "POKéMON have been found."); + +const u8 DexDescription_Tyrogue_1[] = _( + "TYROGUE becomes stressed out if it\n" + "does not get to train every day.\n" + "When raising this POKéMON, the TRAINER"); +const u8 DexDescription_Tyrogue_2[] = _( + "must establish and uphold various\n" + "training methods."); + +const u8 DexDescription_Hitmontop_1[] = _( + "HITMONTOP spins on its head at high\n" + "speed, all the while delivering kicks.\n" + "This technique is a remarkable mix of"); +const u8 DexDescription_Hitmontop_2[] = _( + "both offense and defense at the same\n" + "time. The POKéMON travels faster\n" + "spinning than it does walking."); + +const u8 DexDescription_Smoochum_1[] = _( + "SMOOCHUM actively runs about, but\n" + "also falls quite often.\n" + "Whenever the chance arrives, it will"); +const u8 DexDescription_Smoochum_2[] = _( + "look for its reflection to make sure its\n" + "face hasn’t become dirty."); + +const u8 DexDescription_Elekid_1[] = _( + "ELEKID stores electricity in its body.\n" + "If it touches metal and accidentally\n" + "discharges all its built-up electricity,"); +const u8 DexDescription_Elekid_2[] = _( + "this POKéMON begins swinging its arms\n" + "in circles to recharge itself."); + +const u8 DexDescription_Magby_1[] = _( + "MAGBY’s state of health is determined\n" + "by observing the fire it breathes.\n" + "If the POKéMON is spouting yellow"); +const u8 DexDescription_Magby_2[] = _( + "flames from its mouth, it is in good\n" + "health. When it is fatigued, black smoke\n" + "will be mixed in with the flames."); + +const u8 DexDescription_Miltank_1[] = _( + "MILTANK gives over five gallons of milk\n" + "on a daily basis. Its sweet milk is\n" + "enjoyed by children and grown-ups alike."); +const u8 DexDescription_Miltank_2[] = _( + "People who can’t drink milk turn it into\n" + "yogurt and eat it instead."); + +const u8 DexDescription_Blissey_1[] = _( + "BLISSEY senses sadness with its fluffy\n" + "coat of fur. If it does so, this POKéMON\n" + "will rush over to the sad person,"); +const u8 DexDescription_Blissey_2[] = _( + "however far they may be, to share an\n" + "egg of happiness that brings a smile\n" + "to any face."); + +const u8 DexDescription_Raikou_1[] = _( + "RAIKOU embodies the speed of lightning.\n" + "The roars of this POKéMON send shock\n" + "waves shuddering through the air and"); +const u8 DexDescription_Raikou_2[] = _( + "shake the ground as if lightning bolts\n" + "had come crashing down."); + +const u8 DexDescription_Entei_1[] = _( + "ENTEI embodies the passion of magma.\n" + "This POKéMON is thought to have been\n" + "born in the eruption of a volcano."); +const u8 DexDescription_Entei_2[] = _( + "It sends up massive bursts of fire that\n" + "utterly consume all that they touch."); + +const u8 DexDescription_Suicune_1[] = _( + "SUICUNE embodies the compassion of\n" + "a pure spring of water. It runs across\n" + "the land with gracefulness."); +const u8 DexDescription_Suicune_2[] = _( + "This POKéMON has the power to purify\n" + "dirty water."); + +const u8 DexDescription_Larvitar_1[] = _( + "LARVITAR is born deep under the ground.\n" + "To come up to the surface, this POKéMON\n" + "must eat its way through the soil above."); +const u8 DexDescription_Larvitar_2[] = _( + "Until it does so, LARVITAR cannot see\n" + "its parent’s face."); + +const u8 DexDescription_Pupitar_1[] = _( + "PUPITAR creates a gas inside its body\n" + "that it compresses and forcefully\n" + "ejects to propel itself like a jet."); +const u8 DexDescription_Pupitar_2[] = _( + "The body is very durable - it avoids\n" + "damage even if it hits solid steel."); + +const u8 DexDescription_Tyranitar_1[] = _( + "TYRANITAR is so overwhelmingly\n" + "powerful, it can bring down a whole\n" + "mountain to make its nest."); +const u8 DexDescription_Tyranitar_2[] = _( + "This POKéMON wanders about in\n" + "mountains seeking new opponents to\n" + "fight."); + +const u8 DexDescription_Lugia_1[] = _( + "LUGIA’s wings pack devastating power -\n" + "a light fluttering of its wings can blow\n" + "apart regular houses."); +const u8 DexDescription_Lugia_2[] = _( + "As a result, this POKéMON chooses to\n" + "live out of sight deep under the sea."); + +const u8 DexDescription_HoOh_1[] = _( + "HO-OH’s feathers glow in seven colors\n" + "depending on the angle at which they\n" + "are struck by light."); +const u8 DexDescription_HoOh_2[] = _( + "These feathers are said to bring\n" + "happiness to the bearers. This POKéMON\n" + "is said to live at the foot of a rainbow."); + +const u8 DexDescription_Celebi_1[] = _( + "This POKéMON came from the future by\n" + "crossing over time.\n" + "It is thought that so long as CELEBI"); +const u8 DexDescription_Celebi_2[] = _( + "appears, a bright and shining future\n" + "awaits us."); + +#ifdef SAPPHIRE +const u8 DexDescription_Treecko_1[] = _( + "TREECKO is cool, calm, and collected -\n" + "it never panics under any situation.\n" + "If a bigger foe were to glare at this"); +const u8 DexDescription_Treecko_2[] = _( + "POKéMON, it would glare right back\n" + "without conceding an inch of ground."); +#else +const u8 DexDescription_Treecko_1[] = _( + "TREECKO has small hooks on the bottom\n" + "of its feet that enable it to scale\n" + "vertical walls."); +const u8 DexDescription_Treecko_2[] = _( + "This POKéMON attacks by slamming foes\n" + "with its thick tail."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Grovyle_1[] = _( + "This POKéMON adeptly flies from branch\n" + "to branch in trees.\n" + "In a forest, no POKéMON can ever hope"); +const u8 DexDescription_Grovyle_2[] = _( + "to catch a fleeing GROVYLE however\n" + "fast they may be."); +#else +const u8 DexDescription_Grovyle_1[] = _( + "The leaves growing out of GROVYLE’s\n" + "body are convenient for camouflaging\n" + "it from enemies in the forest."); +const u8 DexDescription_Grovyle_2[] = _( + "This POKéMON is a master at climbing\n" + "trees in jungles."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Sceptile_1[] = _( + "SCEPTILE has seeds growing on its back.\n" + "They are said to be bursting with\n" + "nutrients that revitalize trees."); +const u8 DexDescription_Sceptile_2[] = _( + "This POKéMON raises the trees in a\n" + "forest with loving care."); +#else +const u8 DexDescription_Sceptile_1[] = _( + "The leaves growing on SCEPTILE’s body\n" + "are very sharp edged. This POKéMON is\n" + "very agile - it leaps all over the"); +const u8 DexDescription_Sceptile_2[] = _( + "branches of trees and jumps on its foe\n" + "from above or behind."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Torchic_1[] = _( + "TORCHIC has a place inside its body\n" + "where it keeps its flame. Give it a hug -\n" + "it will be glowing with warmth."); +const u8 DexDescription_Torchic_2[] = _( + "This POKéMON is covered all over by a\n" + "fluffy coat of down."); +#else +const u8 DexDescription_Torchic_1[] = _( + "TORCHIC sticks with its TRAINER,\n" + "following behind with unsteady\n" + "steps."); +const u8 DexDescription_Torchic_2[] = _( + "This POKéMON breathes fire of over\n" + "1,800 degrees F, including fireballs\n" + "that leave the foe scorched black."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Combusken_1[] = _( + "COMBUSKEN battles with the intensely\n" + "hot flames it spews from its beak and\n" + "with outstandingly destructive kicks."); +const u8 DexDescription_Combusken_2[] = _( + "This POKéMON’s cry is very loud and\n" + "distracting."); +#else +const u8 DexDescription_Combusken_1[] = _( + "COMBUSKEN toughens up its legs and\n" + "thighs by running through fields and\n" + "mountains."); +const u8 DexDescription_Combusken_2[] = _( + "This POKéMON’s legs possess both speed\n" + "and power, enabling it to dole out ten\n" + "kicks in one second."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Blaziken_1[] = _( + "BLAZIKEN has incredibly strong legs -\n" + "it can easily clear a 30-story building\n" + "in one leap."); +const u8 DexDescription_Blaziken_2[] = _( + "This POKéMON’s blazing punches leave\n" + "its foes scorched and blackened."); +#else +const u8 DexDescription_Blaziken_1[] = _( + "In battle, BLAZIKEN blows out intense\n" + "flames from its wrists and attacks foes\n" + "courageously."); +const u8 DexDescription_Blaziken_2[] = _( + "The stronger the foe, the more\n" + "intensely this POKéMON’s wrists burn."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Mudkip_1[] = _( + "In water, MUDKIP breathes using the\n" + "gills on its cheeks.\n" + "If it is faced with a tight situation in"); +const u8 DexDescription_Mudkip_2[] = _( + "battle, this POKéMON will unleash its\n" + "amazing power - it can crush rocks\n" + "bigger than itself."); +#else +const u8 DexDescription_Mudkip_1[] = _( + "The fin on MUDKIP’s head acts as highly\n" + "sensitive radar. Using this fin to sense\n" + "movements of water and air, this"); +const u8 DexDescription_Mudkip_2[] = _( + "POKéMON can determine what is taking\n" + "place around it without using its eyes."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Marshtomp_1[] = _( + "MARSHTOMP is much faster at traveling\n" + "through mud than it is at swimming.\n" + "This POKéMON’s hindquarters exhibit"); +const u8 DexDescription_Marshtomp_2[] = _( + "obvious development, giving it the\n" + "ability to walk on just its hind legs."); +#else +const u8 DexDescription_Marshtomp_1[] = _( + "The surface of MARSHTOMP’s body is\n" + "enveloped by a thin, sticky film that\n" + "enables it to live on land."); +const u8 DexDescription_Marshtomp_2[] = _( + "This POKéMON plays in mud on beaches\n" + "when the ocean tide is low."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Swampert_1[] = _( + "SWAMPERT predicts storms by sensing\n" + "subtle differences in the sounds of\n" + "waves and tidal winds with its fins."); +const u8 DexDescription_Swampert_2[] = _( + "If a storm is approaching, it piles up\n" + "boulders to protect itself."); +#else +const u8 DexDescription_Swampert_1[] = _( + "SWAMPERT is very strong. It has enough\n" + "power to easily drag a boulder weighing\n" + "more than a ton."); +const u8 DexDescription_Swampert_2[] = _( + "This POKéMON also has powerful vision\n" + "that lets it see even in murky water."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Poochyena_1[] = _( + "POOCHYENA is an omnivore - it will eat\n" + "anything. A distinguishing feature is\n" + "how large its fangs are compared to"); +const u8 DexDescription_Poochyena_2[] = _( + "its body. This POKéMON tries to\n" + "intimidate its foes by making the hair\n" + "on its tail bristle out."); +#else +const u8 DexDescription_Poochyena_1[] = _( + "At first sight, POOCHYENA takes a bite\n" + "at anything that moves.\n" + "This POKéMON chases after prey until"); +const u8 DexDescription_Poochyena_2[] = _( + "the victim becomes exhausted.\n" + "However, it may turn tail if the prey\n" + "strikes back."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Mightyena_1[] = _( + "MIGHTYENA travel and act as a pack\n" + "in the wild. The memory of its life in the\n" + "wild compels the POKéMON to obey only"); +const u8 DexDescription_Mightyena_2[] = _( + "those TRAINERS that it recognizes to\n" + "possess superior skill."); +#else +const u8 DexDescription_Mightyena_1[] = _( + "MIGHTYENA gives obvious signals when\n" + "it is preparing to attack. It starts to\n" + "growl deeply and then flattens its body."); +const u8 DexDescription_Mightyena_2[] = _( + "This POKéMON will bite savagely with its\n" + "sharply pointed fangs."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Zigzagoon_1[] = _( + "The hair on ZIGZAGOON’s back is \n" + "bristly. It rubs the hard back hair\n" + "against trees to leave its territorial"); +const u8 DexDescription_Zigzagoon_2[] = _( + "markings.\n" + "This POKéMON may play dead to fool foes\n" + "in battle."); +#else +const u8 DexDescription_Zigzagoon_1[] = _( + "ZIGZAGOON restlessly wanders\n" + "everywhere at all times. This POKéMON\n" + "does so because it is very curious."); +const u8 DexDescription_Zigzagoon_2[] = _( + "It becomes interested in anything\n" + "that it happens to see."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Linoone_1[] = _( + "When hunting, LINOONE will make a\n" + "beeline straight for the prey at a full\n" + "run. While this POKéMON is capable of"); +const u8 DexDescription_Linoone_2[] = _( + "topping 60 mph, it has to come to a\n" + "screeching halt before it can turn."); +#else +const u8 DexDescription_Linoone_1[] = _( + "LINOONE always runs full speed and only\n" + "in straight lines. If facing an obstacle,\n" + "it makes a right-angle turn to evade it."); +const u8 DexDescription_Linoone_2[] = _( + "This POKéMON is very challenged by\n" + "gently curving roads."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Wurmple_1[] = _( + "WURMPLE is targeted by SWELLOW as\n" + "prey. This POKéMON will try to resist by\n" + "pointing the spikes on its rear at the"); +const u8 DexDescription_Wurmple_2[] = _( + "attacking predator.\n" + "It will weaken the foe by leaking poison\n" + "from the spikes."); +#else +const u8 DexDescription_Wurmple_1[] = _( + "Using the spikes on its rear end, \n" + "WURMPLE peels the bark off trees and\n" + "feeds on the sap that oozes out."); +const u8 DexDescription_Wurmple_2[] = _( + "This POKéMON’s feet are tipped with\n" + "suction pads that allow it to cling to\n" + "glass without slipping."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Silcoon_1[] = _( + "SILCOON was thought to endure hunger\n" + "and not consume anything before its\n" + "evolution. However, it is now thought"); +const u8 DexDescription_Silcoon_2[] = _( + "that this POKéMON slakes its thirst by\n" + "drinking rainwater that collects on its\n" + "silk."); +#else +const u8 DexDescription_Silcoon_1[] = _( + "SILCOON tethers itself to a tree branch\n" + "using silk to keep from falling. There, \n" + "this POKéMON hangs quietly while it"); +const u8 DexDescription_Silcoon_2[] = _( + "awaits evolution.\n" + "It peers out of the silk cocoon through\n" + "a small hole."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Beautifly_1[] = _( + "BEAUTIFLY has a long mouth like a coiled\n" + "needle, which is very convenient for\n" + "collecting pollen from flowers."); +const u8 DexDescription_Beautifly_2[] = _( + "This POKéMON rides the spring winds as\n" + "it flits around gathering pollen."); +#else +const u8 DexDescription_Beautifly_1[] = _( + "BEAUTIFLY’s favorite food is the sweet\n" + "pollen of flowers. If you want to see\n" + "this POKéMON, just leave a potted"); +const u8 DexDescription_Beautifly_2[] = _( + "flower by an open window. BEAUTIFLY\n" + "is sure to come looking for pollen."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Cascoon_1[] = _( + "If it is attacked, CASCOON remains\n" + "motionless however badly it may be\n" + "hurt. It does so because if it were to"); +const u8 DexDescription_Cascoon_2[] = _( + "move, its body would be weak upon\n" + "evolution. This POKéMON will also not\n" + "forget the pain it endured."); +#else +const u8 DexDescription_Cascoon_1[] = _( + "CASCOON makes its protective cocoon\n" + "by wrapping its body entirely with a\n" + "fine silk from its mouth. Once the silk"); +const u8 DexDescription_Cascoon_2[] = _( + "goes around its body, it hardens.\n" + "This POKéMON prepares for its evolution\n" + "inside the cocoon."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Dustox_1[] = _( + "When DUSTOX flaps its wings, a fine\n" + "dust is scattered all over. This dust is\n" + "actually a powerful poison that will"); +const u8 DexDescription_Dustox_2[] = _( + "even make a pro wrestler sick.\n" + "This POKéMON searches for food using\n" + "its antennae like radar."); +#else +const u8 DexDescription_Dustox_1[] = _( + "DUSTOX is instinctively drawn to light.\n" + "Swarms of this POKéMON are attracted\n" + "by the bright lights of cities, where"); +const u8 DexDescription_Dustox_2[] = _( + "they wreak havoc by stripping the\n" + "leaves off roadside trees for food."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Lotad_1[] = _( + "LOTAD is said to have dwelled on land\n" + "before. However, this POKéMON is\n" + "thought to have returned to water"); +const u8 DexDescription_Lotad_2[] = _( + "because the leaf on its head grew large\n" + "and heavy. It now lives by floating\n" + "atop the water."); +#else +const u8 DexDescription_Lotad_1[] = _( + "LOTAD live in ponds and lakes, where\n" + "they float on the surface.\n" + "It grows weak if its broad leaf dies."); +const u8 DexDescription_Lotad_2[] = _( + "On rare occasions, this POKéMON travels\n" + "on land in search of clean water."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Lombre_1[] = _( + "LOMBRE’s entire body is covered by a\n" + "slippery, slimy film. It feels horribly\n" + "unpleasant to be touched by this"); +const u8 DexDescription_Lombre_2[] = _( + "POKéMON’s hands.\n" + "LOMBRE is often mistaken for a human\n" + "child."); +#else +const u8 DexDescription_Lombre_1[] = _( + "LOMBRE is nocturnal - it will get active\n" + "after dusk. It is also a mischief-maker.\n" + "When this POKéMON spots anglers,"); +const u8 DexDescription_Lombre_2[] = _( + "it tugs on their fishing lines from\n" + "beneath the surface and enjoys their\n" + "consternation."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Ludicolo_1[] = _( + "Upon hearing an upbeat and cheerful\n" + "rhythm, the cells in LUDICOLO’s body\n" + "become very energetic and active."); +const u8 DexDescription_Ludicolo_2[] = _( + "Even in battle, this POKéMON will\n" + "exhibit an amazing amount of power."); +#else +const u8 DexDescription_Ludicolo_1[] = _( + "LUDICOLO begins dancing as soon as\n" + "it hears cheerful, festive music.\n" + "This POKéMON is said to appear when it"); +const u8 DexDescription_Ludicolo_2[] = _( + "hears the singing of children on hiking\n" + "outings."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Seedot_1[] = _( + "SEEDOT looks exactly like an acorn\n" + "when it is dangling from a tree branch.\n" + "It startles other POKéMON by suddenly"); +const u8 DexDescription_Seedot_2[] = _( + "moving.\n" + "This POKéMON polishes its body once a\n" + "day using leaves."); +#else +const u8 DexDescription_Seedot_1[] = _( + "SEEDOT attaches itself to a tree\n" + "branch using the top of its head.\n" + "It sucks moisture from the tree while"); +const u8 DexDescription_Seedot_2[] = _( + "hanging off the branch.\n" + "The more water it drinks, the glossier\n" + "this POKéMON’s body becomes."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Nuzleaf_1[] = _( + "This POKéMON pulls out the leaf on its\n" + "head and makes a flute with it.\n" + "The sound of NUZLEAF’s flute strikes"); +const u8 DexDescription_Nuzleaf_2[] = _( + "fear and uncertainty in the hearts of\n" + "people lost in a forest."); +#else +const u8 DexDescription_Nuzleaf_1[] = _( + "NUZLEAF live in densely overgrown\n" + "forests. They occasionally venture out\n" + "of the forest to startle people."); +const u8 DexDescription_Nuzleaf_2[] = _( + "This POKéMON dislikes having its long\n" + "nose pinched."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Shiftry_1[] = _( + "SHIFTRY’s large fans generate awesome\n" + "gusts of wind at a speed close to 100\n" + "feet per second. The whipped-up wind"); +const u8 DexDescription_Shiftry_2[] = _( + "blows anything away.\n" + "This POKéMON chooses to live quietly\n" + "deep in forests."); +#else +const u8 DexDescription_Shiftry_1[] = _( + "SHIFTRY is a mysterious POKéMON that\n" + "is said to live atop towering trees \n" + "dating back over a thousand years."); +const u8 DexDescription_Shiftry_2[] = _( + "It creates terrific windstorms with\n" + "the fans it holds."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Taillow_1[] = _( + "TAILLOW is young - it has only just\n" + "left its nest. As a result, it sometimes\n" + "becomes lonesome and cries at night."); +const u8 DexDescription_Taillow_2[] = _( + "This POKéMON feeds on WURMPLE that\n" + "live in forests."); +#else +const u8 DexDescription_Taillow_1[] = _( + "TAILLOW courageously stands its\n" + "ground against foes, however strong\n" + "they may be."); +const u8 DexDescription_Taillow_2[] = _( + "This gutsy POKéMON will remain defiant\n" + "even after a loss. On the other hand,\n" + "it cries loudly if it becomes hungry."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Swellow_1[] = _( + "SWELLOW is very conscientious about\n" + "the upkeep of its glossy wings.\n" + "Once two SWELLOW are gathered, they"); +const u8 DexDescription_Swellow_2[] = _( + "diligently take care of cleaning each\n" + "other’s wings."); +#else +const u8 DexDescription_Swellow_1[] = _( + "SWELLOW flies high above our heads,\n" + "making graceful arcs in the sky.\n" + "This POKéMON dives at a steep angle as"); +const u8 DexDescription_Swellow_2[] = _( + "soon as it spots its prey. The hapless\n" + "prey is tightly grasped by SWELLOW’s\n" + "clawed feet, preventing escape."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Wingull_1[] = _( + "WINGULL rides updrafts rising from the\n" + "sea by extending its long and narrow\n" + "wings to glide."); +const u8 DexDescription_Wingull_2[] = _( + "This POKéMON’s long beak is useful for\n" + "catching prey."); +#else +const u8 DexDescription_Wingull_1[] = _( + "WINGULL has the habit of carrying prey\n" + "and valuables in its beak and hiding\n" + "them in all sorts of locations."); +const u8 DexDescription_Wingull_2[] = _( + "This POKéMON rides the winds and flies\n" + "as if it were skating across the sky."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Pelipper_1[] = _( + "PELIPPER searches for food while in\n" + "flight by skimming the wave tops.\n" + "This POKéMON dips its large bill in the"); +const u8 DexDescription_Pelipper_2[] = _( + "sea to scoop up food, then swallows\n" + "everything in one big gulp."); +#else +const u8 DexDescription_Pelipper_1[] = _( + "PELIPPER is a flying transporter that\n" + "carries small POKéMON and eggs inside\n" + "its massive bill."); +const u8 DexDescription_Pelipper_2[] = _( + "This POKéMON builds its nest on steep\n" + "cliffs facing the sea."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Ralts_1[] = _( + "RALTS has the ability to sense the\n" + "emotions of people.\n" + "If its TRAINER is in a cheerful mood,"); +const u8 DexDescription_Ralts_2[] = _( + "this POKéMON grows cheerful and joyous\n" + "in the same way."); +#else +const u8 DexDescription_Ralts_1[] = _( + "RALTS senses the emotions of\n" + "people using the horns on its head.\n" + "This POKéMON rarely appears before"); +const u8 DexDescription_Ralts_2[] = _( + "people. But when it does, it draws\n" + "closer if it senses that the person has\n" + "a positive disposition."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Kirlia_1[] = _( + "KIRLIA uses the horns on its head\n" + "to amplify its psychokinetic power.\n" + "When the POKéMON uses its power,"); +const u8 DexDescription_Kirlia_2[] = _( + "the air around it becomes distorted,\n" + "creating mirages of nonexistent\n" + "scenery."); +#else +const u8 DexDescription_Kirlia_1[] = _( + "It is said that a KIRLIA that is\n" + "exposed to the positive emotions of\n" + "its TRAINER grows beautiful."); +const u8 DexDescription_Kirlia_2[] = _( + "This POKéMON controls psychokinetic\n" + "powers with its highly developed brain."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Gardevoir_1[] = _( + "GARDEVOIR has the psychokinetic\n" + "power to distort the dimensions and\n" + "create a small black hole."); +const u8 DexDescription_Gardevoir_2[] = _( + "This POKéMON will try to protect its\n" + "TRAINER even at the risk of its own\n" + "life."); +#else +const u8 DexDescription_Gardevoir_1[] = _( + "GARDEVOIR has the ability to read the\n" + "future. If it senses impending danger\n" + "to its TRAINER, this POKéMON is said to"); +const u8 DexDescription_Gardevoir_2[] = _( + "unleash its psychokinetic energy at\n" + "full power."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Surskit_1[] = _( + "If SURSKIT senses danger, it secretes\n" + "a thick, sugary syrup from the tip of\n" + "its head."); +const u8 DexDescription_Surskit_2[] = _( + "There are some POKéMON that love\n" + "eating this syrup."); +#else +const u8 DexDescription_Surskit_1[] = _( + "From the tips of its feet, SURSKIT\n" + "secretes an oil that enables it to walk\n" + "on water as if it were skating."); +const u8 DexDescription_Surskit_2[] = _( + "This POKéMON feeds on microscopic\n" + "organisms in ponds and lakes."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Masquerain_1[] = _( + "MASQUERAIN’s antennas have eyelike\n" + "patterns that usually give it an angry\n" + "look. If the “eyes†are droopy and"); +const u8 DexDescription_Masquerain_2[] = _( + "appear sad, it is said to be a sign\n" + "that a heavy rainfall is on its way."); +#else +const u8 DexDescription_Masquerain_1[] = _( + "MASQUERAIN intimidates enemies with\n" + "the eyelike patterns on its antennas.\n" + "This POKéMON flaps its four wings to"); +const u8 DexDescription_Masquerain_2[] = _( + "freely fly in any direction - even\n" + "sideways and backwards - as if it were\n" + "a helicopter."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Shroomish_1[] = _( + "If SHROOMISH senses danger, it shakes\n" + "its body and scatters spores from the\n" + "top of its head."); +const u8 DexDescription_Shroomish_2[] = _( + "This POKéMON’s spores are so toxic,\n" + "they make trees and weeds wilt."); +#else +const u8 DexDescription_Shroomish_1[] = _( + "SHROOMISH live in damp soil in the dark\n" + "depths of forests. They are often\n" + "found keeping still under fallen leaves."); +const u8 DexDescription_Shroomish_2[] = _( + "This POKéMON feeds on compost that\n" + "is made up of fallen, rotted leaves."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Breloom_1[] = _( + "The seeds ringing BRELOOM’s tail are\n" + "made of hardened toxic spores. It is\n" + "horrible to eat the seeds."); +const u8 DexDescription_Breloom_2[] = _( + "Just taking a bite of this POKéMON’s\n" + "seed will cause your stomach to rumble."); +#else +const u8 DexDescription_Breloom_1[] = _( + "BRELOOM closes in on its foe with light\n" + "and sprightly footwork, then throws\n" + "punches with its stretchy arms."); +const u8 DexDescription_Breloom_2[] = _( + "This POKéMON’s fighting technique puts\n" + "boxers to shame."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Slakoth_1[] = _( + "SLAKOTH’s heart beats just once a\n" + "minute. Whatever happens, it is\n" + "content to loaf around motionless."); +const u8 DexDescription_Slakoth_2[] = _( + "It is rare to see this POKéMON in\n" + "motion."); +#else +const u8 DexDescription_Slakoth_1[] = _( + "SLAKOTH lolls around for over twenty\n" + "hours every day. Because it moves so\n" + "little, it does not need much food."); +const u8 DexDescription_Slakoth_2[] = _( + "This POKéMON’s sole daily meal consists\n" + "of just three leaves."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Vigoroth_1[] = _( + "VIGOROTH is simply incapable of\n" + "remaining still. Even when it tries to\n" + "sleep, the blood in its veins grows"); +const u8 DexDescription_Vigoroth_2[] = _( + "agitated, compelling this POKéMON to\n" + "run wild throughout the jungle before\n" + "it can settle down."); +#else +const u8 DexDescription_Vigoroth_1[] = _( + "VIGOROTH is always itching and agitated\n" + "to go on a wild rampage. It simply can’t\n" + "tolerate sitting still for even a minute."); +const u8 DexDescription_Vigoroth_2[] = _( + "This POKéMON’s stress level rises if it\n" + "can’t be moving constantly."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Slaking_1[] = _( + "Wherever SLAKING live, rings of over\n" + "a yard in diameter appear in grassy\n" + "fields. They are made by the POKéMON"); +const u8 DexDescription_Slaking_2[] = _( + "as it eats all the grass within reach\n" + "while lying prone on the ground."); +#else +const u8 DexDescription_Slaking_1[] = _( + "SLAKING spends all day lying down and\n" + "lolling about.\n" + "It eats grass growing within its reach."); +const u8 DexDescription_Slaking_2[] = _( + "If it eats all the grass it can reach,\n" + "this POKéMON reluctantly moves to\n" + "another spot."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Nincada_1[] = _( + "NINCADA lives underground. It uses its\n" + "sharp claws to carve the roots of trees\n" + "and absorb moisture and nutrients."); +const u8 DexDescription_Nincada_2[] = _( + "This POKéMON can’t withstand bright\n" + "sunlight so avoids it."); +#else +const u8 DexDescription_Nincada_1[] = _( + "NINCADA lives underground for many\n" + "years in complete darkness.\n" + "This POKéMON absorbs nutrients from"); +const u8 DexDescription_Nincada_2[] = _( + "the roots of trees. It stays motionless\n" + "as it waits for evolution."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Ninjask_1[] = _( + "If NINJASK is not trained properly,\n" + "it will refuse to obey the TRAINER and\n" + "cry loudly continuously."); +const u8 DexDescription_Ninjask_2[] = _( + "Because of this quality, this POKéMON\n" + "is said to be one that puts the\n" + "TRAINER’s abilities to the test."); +#else +const u8 DexDescription_Ninjask_1[] = _( + "NINJASK moves around at such a high\n" + "speed that it cannot be seen, even\n" + "while its crying can be clearly heard."); +const u8 DexDescription_Ninjask_2[] = _( + "For that reason, this POKéMON was long\n" + "believed to be invisible."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Shedinja_1[] = _( + "SHEDINJA is a peculiar POKéMON.\n" + "It seems to appear unsought in a POKé\n" + "BALL after a NINCADA evolves."); +const u8 DexDescription_Shedinja_2[] = _( + "This bizarre POKéMON is entirely\n" + "immobile - it doesn’t even breathe."); +#else +const u8 DexDescription_Shedinja_1[] = _( + "SHEDINJA’s hard body doesn’t move -\n" + "not even a twitch. In fact, its body\n" + "appears to be merely a hollow shell."); +const u8 DexDescription_Shedinja_2[] = _( + "It is believed that this POKéMON will\n" + "steal the spirit of anyone peering into\n" + "its hollow body from its back."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Whismur_1[] = _( + "WHISMUR is very timid. If it starts to\n" + "cry loudly, it becomes startled by its\n" + "own crying and cries even harder."); +const u8 DexDescription_Whismur_2[] = _( + "When it finally stops crying, the\n" + "POKéMON goes to sleep, all tired out."); +#else +const u8 DexDescription_Whismur_1[] = _( + "Normally, WHISMUR’s voice is very quiet -\n" + "it is barely audible even if one is\n" + "paying close attention."); +const u8 DexDescription_Whismur_2[] = _( + "However, if this POKéMON senses danger,\n" + "it starts crying at an earsplitting\n" + "volume."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Loudred_1[] = _( + "LOUDRED shouts while stamping its feet.\n" + "After it finishes shouting, this\n" + "POKéMON becomes incapable of hearing"); +const u8 DexDescription_Loudred_2[] = _( + "anything for a while. This is considered\n" + "to be a weak point."); +#else +const u8 DexDescription_Loudred_1[] = _( + "LOUDRED’s bellowing can completely\n" + "decimate a wood-frame house. It uses\n" + "its voice to punish its foes."); +const u8 DexDescription_Loudred_2[] = _( + "This POKéMON’s round ears serve as\n" + "loudspeakers."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Exploud_1[] = _( + "EXPLOUD communicates its feelings to\n" + "the others by emitting whistle-like\n" + "sounds from the tubes on its body."); +const u8 DexDescription_Exploud_2[] = _( + "This POKéMON only raises its voice when\n" + "it is in battle."); +#else +const u8 DexDescription_Exploud_1[] = _( + "EXPLOUD triggers earthquakes with the\n" + "tremors it creates by bellowing. If this\n" + "POKéMON violently inhales from the"); +const u8 DexDescription_Exploud_2[] = _( + "ports on its body, it’s a sign that it is\n" + "preparing to let loose a huge bellow."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Makuhita_1[] = _( + "MAKUHITA has a tireless spirit -\n" + "it will never give up hope. It eats a lot\n" + "of food, gets plenty of sleep, and it"); +const u8 DexDescription_Makuhita_2[] = _( + "trains very rigorously. By living that\n" + "way, this POKéMON packs its body with\n" + "energy."); +#else +const u8 DexDescription_Makuhita_1[] = _( + "MAKUHITA is tenacious - it will keep\n" + "getting up and attacking its foe\n" + "however many times it is knocked down."); +const u8 DexDescription_Makuhita_2[] = _( + "Every time it gets back up, this\n" + "POKéMON stores more energy in its body\n" + "for evolving."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Hariyama_1[] = _( + "HARIYAMA’s thick body may appear fat,\n" + "but it is actually a hunk of solid muscle.\n" + "If this POKéMON bears down and"); +const u8 DexDescription_Hariyama_2[] = _( + "tightens all its muscles, its body\n" + "becomes as hard as a rock."); +#else +const u8 DexDescription_Hariyama_1[] = _( + "HARIYAMA practices its straight-arm\n" + "slaps in any number of locations.\n" + "One hit of this POKéMON’s powerful,"); +const u8 DexDescription_Hariyama_2[] = _( + "openhanded, straight-arm punches\n" + "could snap a telephone pole in two."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Azurill_1[] = _( + "AZURILL’s tail is large and bouncy.\n" + "It is packed full of the nutrients this\n" + "POKéMON needs to grow."); +const u8 DexDescription_Azurill_2[] = _( + "AZURILL can be seen bouncing and\n" + "playing on its big, rubbery tail."); +#else +const u8 DexDescription_Azurill_1[] = _( + "AZURILL spins its tail as if it were a\n" + "lasso, then hurls it far. The momentum\n" + "of the throw sends its body flying, too."); +const u8 DexDescription_Azurill_2[] = _( + "Using this unique action, one of these\n" + "POKéMON managed to hurl itself a record\n" + "33 feet."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Nosepass_1[] = _( + "NOSEPASS had been said to be completely\n" + "unmoving, with its magnetic nose\n" + "pointed due north."); +const u8 DexDescription_Nosepass_2[] = _( + "However, close observation has revealed\n" + "that the POKéMON actually moves by a\n" + "little over 3/8 of an inch every year."); +#else +const u8 DexDescription_Nosepass_1[] = _( + "NOSEPASS’s magnetic nose is always\n" + "pointed to the north. If two of these\n" + "POKéMON meet, they cannot turn"); +const u8 DexDescription_Nosepass_2[] = _( + "their faces to each other when they\n" + "are close because their magnetic noses\n" + "repel one another."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Skitty_1[] = _( + "SKITTY is known to chase around\n" + "playfully after its own tail. In the wild,\n" + "this POKéMON lives in holes in the trees"); +const u8 DexDescription_Skitty_2[] = _( + "of forests. It is very popular as a pet\n" + "because of its adorable looks."); +#else +const u8 DexDescription_Skitty_1[] = _( + "SKITTY has the habit of becoming\n" + "fascinated by moving objects and\n" + "chasing them around."); +const u8 DexDescription_Skitty_2[] = _( + "This POKéMON is known to chase after\n" + "its own tail and become dizzy."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Delcatty_1[] = _( + "DELCATTY sleeps anywhere it wants\n" + "without keeping a permanent nest.\n" + "If other POKéMON approach it as it"); +const u8 DexDescription_Delcatty_2[] = _( + "sleeps, this POKéMON will never fight -\n" + "it will just move away somewhere else."); +#else +const u8 DexDescription_Delcatty_1[] = _( + "DELCATTY prefers to live an unfettered\n" + "existence in which it can do as it\n" + "pleases at its own pace."); +const u8 DexDescription_Delcatty_2[] = _( + "Because this POKéMON eats and sleeps\n" + "whenever it decides, its daily routines\n" + "are completely random."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Sableye_1[] = _( + "SABLEYE digs the ground with sharpened\n" + "claws to find rocks that it eats.\n" + "Substances in the eaten rocks"); +const u8 DexDescription_Sableye_2[] = _( + "crystallize and rise up to the POKéMON’s\n" + "body surface."); +#else +const u8 DexDescription_Sableye_1[] = _( + "SABLEYE lead quiet lives deep inside\n" + "caverns. They are feared, however,\n" + "because these POKéMON are thought to"); +const u8 DexDescription_Sableye_2[] = _( + "steal the spirits of people when their\n" + "eyes burn with a sinister glow in the\n" + "darkness."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Mawile_1[] = _( + "Don’t be taken in by this POKéMON’s\n" + "cute face - it’s very dangerous. MAWILE\n" + "fools the foe into letting down its"); +const u8 DexDescription_Mawile_2[] = _( + "guard, then chomps down with its\n" + "massive jaws. The steel jaws are really\n" + "horns that have been transformed."); +#else +#if REVISION >= 1 +const u8 DexDescription_Mawile_1[] = _( + "MAWILE’s huge jaws are actually steel\n" + "horns that have been transformed.\n" + "Its docile-looking face serves to lull"); +const u8 DexDescription_Mawile_2[] = _( + "its foe into letting down its guard.\n" + "When the foe least expects it, MAWILE\n" // Correct spelling of MAWILE + "chomps it with its gaping jaws."); +#else +const u8 DexDescription_Mawile_1[] = _( + "MAWHILE’s huge jaws are actually steel\n" + "horns that have been transformed.\n" + "Its docile-looking face serves to lull"); +const u8 DexDescription_Mawile_2[] = _( + "its foe into letting down its guard.\n" + "When the foe least expects it, MAWHILE\n" + "chomps it with its gaping jaws."); +#endif +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Aron_1[] = _( + "ARON has a body of steel.\n" + "With one all-out charge, this POKéMON\n" + "can demolish even a heavy dump truck."); +const u8 DexDescription_Aron_2[] = _( + "The destroyed dump truck then becomes\n" + "a handy meal for the POKéMON."); +#else +const u8 DexDescription_Aron_1[] = _( + "This POKéMON has a body of steel.\n" + "To make its body, ARON feeds on\n" + "iron ore that it digs from mountains."); +const u8 DexDescription_Aron_2[] = _( + "Occasionally, it causes major trouble by\n" + "eating bridges and rails."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Lairon_1[] = _( + "LAIRON feeds on iron contained in\n" + "rocks and water. It makes its nest on\n" + "mountains where iron ore is buried."); +const u8 DexDescription_Lairon_2[] = _( + "As a result, the POKéMON often clashes\n" + "with humans mining the iron ore."); +#else +const u8 DexDescription_Lairon_1[] = _( + "LAIRON tempers its steel body by\n" + "drinking highly nutritious mineral\n" + "springwater until it is bloated."); +const u8 DexDescription_Lairon_2[] = _( + "This POKéMON makes its nest close to\n" + "springs of delicious water."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Aggron_1[] = _( + "AGGRON is surprisingly protective\n" + "of its environment. If its mountain\n" + "is ravaged by a landslide or a fire, this"); +const u8 DexDescription_Aggron_2[] = _( + "POKéMON will haul topsoil to the area,\n" + "plant trees, and beautifully restore its\n" + "own territory."); +#else +const u8 DexDescription_Aggron_1[] = _( + "AGGRON claims an entire mountain as its\n" + "own territory. It mercilessly beats up\n" + "anything that violates its environment."); +const u8 DexDescription_Aggron_2[] = _( + "This POKéMON vigilantly patrols its\n" + "territory at all times."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Meditite_1[] = _( + "MEDITITE heightens its inner energy\n" + "through meditation. It survives on\n" + "just one berry a day."); +const u8 DexDescription_Meditite_2[] = _( + "Minimal eating is another aspect of\n" + "this POKéMON’s training."); +#else +const u8 DexDescription_Meditite_1[] = _( + "MEDITITE undertakes rigorous mental\n" + "training deep in the mountains.\n" + "However, whenever it meditates, this"); +const u8 DexDescription_Meditite_2[] = _( + "POKéMON always loses its concentration\n" + "and focus. As a result, its training\n" + "never ends."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Medicham_1[] = _( + "Through the power of meditation,\n" + "MEDICHAM developed its sixth sense.\n" + "It gained the ability to use"); +const u8 DexDescription_Medicham_2[] = _( + "psychokinetic powers. This POKéMON is\n" + "known to meditate for a whole month\n" + "without eating."); +#else +const u8 DexDescription_Medicham_1[] = _( + "It is said that through meditation,\n" + "MEDICHAM heightens energy inside\n" + "its body and sharpens its sixth sense."); +const u8 DexDescription_Medicham_2[] = _( + "This POKéMON hides its presence by\n" + "merging itself with fields and\n" + "mountains."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Electrike_1[] = _( + "ELECTRIKE runs faster than the human\n" + "eye can follow. The friction from\n" + "running is converted into electricity,"); +const u8 DexDescription_Electrike_2[] = _( + "which is then stored in this POKéMON’s\n" + "fur."); +#else +const u8 DexDescription_Electrike_1[] = _( + "ELECTRIKE stores electricity in its\n" + "long body hair. This POKéMON stimulates\n" + "its leg muscles with electric charges."); +const u8 DexDescription_Electrike_2[] = _( + "These jolts of power give its legs\n" + "explosive acceleration performance."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Manectric_1[] = _( + "MANECTRIC discharges strong\n" + "electricity from its mane. The mane is\n" + "used for collecting electricity in the"); +const u8 DexDescription_Manectric_2[] = _( + "atmosphere. This POKéMON creates\n" + "thunderclouds above its head."); +#else +const u8 DexDescription_Manectric_1[] = _( + "MANECTRIC is constantly discharging\n" + "electricity from its mane. The sparks\n" + "sometimes ignite forest fires."); +const u8 DexDescription_Manectric_2[] = _( + "When it enters a battle, this POKéMON\n" + "creates thunderclouds."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Plusle_1[] = _( + "When PLUSLE is cheering on its partner,\n" + "it flashes with electric sparks from all\n" + "over its body."); +const u8 DexDescription_Plusle_2[] = _( + "If its partner loses, this POKéMON cries\n" + "loudly."); +#else +const u8 DexDescription_Plusle_1[] = _( + "PLUSLE always acts as a cheerleader\n" + "for its partners. Whenever a teammate\n" + "puts out a good effort in battle, this"); +const u8 DexDescription_Plusle_2[] = _( + "POKéMON shorts out its body to create\n" + "the crackling noises of sparks to show\n" + "its joy."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Minun_1[] = _( + "MINUN loves to cheer on its partner in\n" + "battle. It gives off sparks from its\n" + "body while it is doing so."); +const u8 DexDescription_Minun_2[] = _( + "If its partner is in trouble, this\n" + "POKéMON gives off increasing amounts\n" + "of sparks."); +#else +const u8 DexDescription_Minun_1[] = _( + "MINUN is more concerned about cheering\n" + "on its partners than its own safety.\n" + "It shorts out the electricity in its"); +const u8 DexDescription_Minun_2[] = _( + "body to create brilliant showers of\n" + "sparks to cheer on its teammates."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Volbeat_1[] = _( + "VOLBEAT’s tail glows like a lightbulb.\n" + "With other VOLBEAT, it uses its tail to\n" + "draw geometric shapes in the night sky."); +const u8 DexDescription_Volbeat_2[] = _( + "This POKéMON loves the sweet aroma\n" + "given off by ILLUMISE."); +#else +const u8 DexDescription_Volbeat_1[] = _( + "With the arrival of night, VOLBEAT emits\n" + "light from its tail. It communicates with\n" + "others by adjusting the intensity and"); +const u8 DexDescription_Volbeat_2[] = _( + "flashing of its light.\n" + "This POKéMON is attracted by the sweet\n" + "aroma of ILLUMISE."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Illumise_1[] = _( + "ILLUMISE leads a flight of illuminated\n" + "VOLBEAT to draw signs in the night sky.\n" + "This POKéMON is said to earn greater"); +const u8 DexDescription_Illumise_2[] = _( + "respect from its peers by composing\n" + "more complex designs in the sky."); +#else +const u8 DexDescription_Illumise_1[] = _( + "ILLUMISE attracts a swarm of VOLBEAT\n" + "using a sweet fragrance. Once the\n" + "VOLBEAT have gathered, this POKéMON"); +const u8 DexDescription_Illumise_2[] = _( + "leads the lit-up swarm in drawing\n" + "geometric designs on the canvas of\n" + "the night sky."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Roselia_1[] = _( + "On extremely rare occasions, a ROSELIA\n" + "is said to appear with its flowers in\n" + "unusual colors."); +const u8 DexDescription_Roselia_2[] = _( + "The thorns on this POKéMON’s head\n" + "contain a vicious poison."); +#else +const u8 DexDescription_Roselia_1[] = _( + "ROSELIA shoots sharp thorns as\n" + "projectiles at any opponent that tries\n" + "to steal the flowers on its arms."); +const u8 DexDescription_Roselia_2[] = _( + "The aroma of this POKéMON brings\n" + "serenity to living things."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Gulpin_1[] = _( + "Most of GULPIN’s body is made up of its\n" + "stomach - its heart and brain are very\n" + "small in comparison."); +const u8 DexDescription_Gulpin_2[] = _( + "This POKéMON’s stomach contains\n" + "special enzymes that dissolve anything."); +#else +const u8 DexDescription_Gulpin_1[] = _( + "Virtually all of GULPIN’s body is its\n" + "stomach. As a result, it can swallow\n" + "something its own size."); +const u8 DexDescription_Gulpin_2[] = _( + "This POKéMON’s stomach contains a\n" + "special fluid that digests anything."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Swalot_1[] = _( + "SWALOT has no teeth, so what it\n" + "eats, it swallows whole, no matter what.\n" + "Its cavernous mouth yawns widely."); +const u8 DexDescription_Swalot_2[] = _( + "An automobile tire could easily fit\n" + "inside this POKéMON’s mouth."); +#else +const u8 DexDescription_Swalot_1[] = _( + "When SWALOT spots prey, it spurts out\n" + "a hideously toxic fluid from its pores\n" + "and sprays the target."); +const u8 DexDescription_Swalot_2[] = _( + "Once the prey has weakened, this\n" + "POKéMON gulps it down whole with its\n" + "cavernous mouth."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Carvanha_1[] = _( + "If anything invades CARVANHA’s\n" + "territory, it will swarm and tear at the\n" + "intruder with its pointed fangs."); +const u8 DexDescription_Carvanha_2[] = _( + "On its own, however, this POKéMON turns\n" + "suddenly timid."); +#else +const u8 DexDescription_Carvanha_1[] = _( + "CARVANHA’s strongly developed jaws\n" + "and its sharply pointed fangs pack the\n" + "destructive power to rip out boat hulls."); +const u8 DexDescription_Carvanha_2[] = _( + "Many boats have been attacked and\n" + "sunk by this POKéMON."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Sharpedo_1[] = _( + "SHARPEDO can swim at speeds of up to\n" + "75 mph by jetting seawater out of its\n" + "backside."); +const u8 DexDescription_Sharpedo_2[] = _( + "This POKéMON’s drawback is its inability\n" + "to swim long distances."); +#else +const u8 DexDescription_Sharpedo_1[] = _( + "Nicknamed “the bully of the sea,â€\n" + "SHARPEDO is widely feared.\n" + "Its cruel fangs grow back immediately"); +const u8 DexDescription_Sharpedo_2[] = _( + "if they snap off.\n" + "Just one of these POKéMON can\n" + "thoroughly tear apart a supertanker."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Wailmer_1[] = _( + "WAILMER can store water inside its body\n" + "to transform itself into a ball for\n" + "bouncing around on the ground."); +const u8 DexDescription_Wailmer_2[] = _( + "By filling itself up with more water, this\n" + "POKéMON can elevate the height of its\n" + "bounces."); +#else +const u8 DexDescription_Wailmer_1[] = _( + "WAILMER’s nostrils are located above\n" + "its eyes. This playful POKéMON loves\n" + "to startle people by forcefully snorting"); +const u8 DexDescription_Wailmer_2[] = _( + "out seawater it stores inside its body\n" + "out of its nostrils."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Wailord_1[] = _( + "When chasing prey, WAILORD herds them\n" + "by leaping out of the water and making\n" + "a humongous splash."); +const u8 DexDescription_Wailord_2[] = _( + "It is breathtaking to see this POKéMON\n" + "leaping out of the sea with others in\n" + "its pod."); +#else +const u8 DexDescription_Wailord_1[] = _( + "WAILORD is the largest of all identified\n" + "POKéMON up to now.\n" + "This giant POKéMON swims languorously"); +const u8 DexDescription_Wailord_2[] = _( + "in the vast open sea, eating massive\n" + "amounts of food at once with its\n" + "enormous mouth."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Numel_1[] = _( + "NUMEL stores magma of almost 2,200\n" + "degrees F within its body. If it gets\n" + "wet, the magma cools and hardens."); +const u8 DexDescription_Numel_2[] = _( + "In that event, the POKéMON’s body\n" + "grows heavy and its movements become\n" + "sluggish."); +#else +const u8 DexDescription_Numel_1[] = _( + "NUMEL is extremely dull witted - it\n" + "doesn’t notice being hit. However, it\n" + "can’t stand hunger for even a second."); +const u8 DexDescription_Numel_2[] = _( + "This POKéMON’s body is a seething\n" + "cauldron of boiling magma."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Camerupt_1[] = _( + "The humps on CAMERUPT’s back are\n" + "formed by a transformation of its\n" + "bones. They sometimes blast out molten"); +const u8 DexDescription_Camerupt_2[] = _( + "magma. This POKéMON apparently erupts\n" + "often when it is enraged."); +#else +const u8 DexDescription_Camerupt_1[] = _( + "CAMERUPT has a volcano inside its body.\n" + "Magma of 18,000 degrees F courses\n" + "through its body."); +const u8 DexDescription_Camerupt_2[] = _( + "Occasionally, the humps on this\n" + "POKéMON’s back erupt, spewing the\n" + "superheated magma."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Torkoal_1[] = _( + "TORKOAL generates energy by burning\n" + "coal. It grows weaker as the fire\n" + "dies down."); +const u8 DexDescription_Torkoal_2[] = _( + "When it is preparing for battle, this\n" + "POKéMON burns more coal."); +#else +const u8 DexDescription_Torkoal_1[] = _( + "TORKOAL digs through mountains in\n" + "search of coal. If it finds some, it fills\n" + "hollow spaces on its shell with the coal"); +const u8 DexDescription_Torkoal_2[] = _( + "and burns it.\n" + "If it is attacked, this POKéMON spouts\n" + "thick black smoke to beat a retreat."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Spoink_1[] = _( + "SPOINK keeps a pearl on top of its head.\n" + "The pearl functions to amplify this\n" + "POKéMON’s psychokinetic powers."); +const u8 DexDescription_Spoink_2[] = _( + "It is therefore on a constant search\n" + "for a bigger pearl."); +#else +const u8 DexDescription_Spoink_1[] = _( + "SPOINK bounces around on its tail.\n" + "The shock of its bouncing makes its\n" + "heart pump. As a result, this POKéMON"); +const u8 DexDescription_Spoink_2[] = _( + "cannot afford to stop bouncing - if it\n" + "stops, its heart will stop."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Grumpig_1[] = _( + "GRUMPIG uses the black pearls on its\n" + "body to wield its fantastic powers.\n" + "When it is doing so, it dances bizarrely."); +const u8 DexDescription_Grumpig_2[] = _( + "This POKéMON’s black pearls are valuable\n" + "as works of art."); +#else +const u8 DexDescription_Grumpig_1[] = _( + "GRUMPIG uses the black pearls on its\n" + "body to amplify its psychic power waves\n" + "for gaining total control over its foe."); +const u8 DexDescription_Grumpig_2[] = _( + "When this POKéMON uses its special\n" + "power, its snorting breath grows\n" + "labored."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Spinda_1[] = _( + "No two SPINDA are said to have\n" + "identical spot patterns on their hides.\n" + "This POKéMON moves in a curious manner"); +const u8 DexDescription_Spinda_2[] = _( + "as if it is stumbling in dizziness.\n" + "Its lurching movements can cause the\n" + "opponent to become confused."); +#else +const u8 DexDescription_Spinda_1[] = _( + "All the SPINDA that exist in the\n" + "world are said to have utterly unique\n" + "spot patterns."); +const u8 DexDescription_Spinda_2[] = _( + "The shaky, tottering steps of this\n" + "POKéMON give it the appearance of\n" + "dancing."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Trapinch_1[] = _( + "TRAPINCH is a patient hunter. It digs\n" + "an inescapable pit in a desert and waits\n" + "for its prey to come tumbling down."); +const u8 DexDescription_Trapinch_2[] = _( + "This POKéMON can go a whole week\n" + "without access to any water."); +#else +const u8 DexDescription_Trapinch_1[] = _( + "TRAPINCH’s nest is a sloped, bowl-like\n" + "pit dug in sand. This POKéMON patiently\n" + "waits for prey to tumble down the pit."); +const u8 DexDescription_Trapinch_2[] = _( + "Its giant jaws have enough strength\n" + "to crush even boulders."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Vibrava_1[] = _( + "VIBRAVA’s wings have not yet\n" + "completed the process of growing.\n" + "Rather than flying long distances,"); +const u8 DexDescription_Vibrava_2[] = _( + "they are more useful for generating\n" + "ultrasonic waves by vibrating."); +#else +const u8 DexDescription_Vibrava_1[] = _( + "To make prey faint, VIBRAVA generates\n" + "ultrasonic waves by vigorously making\n" + "its two wings vibrate."); +const u8 DexDescription_Vibrava_2[] = _( + "This POKéMON’s ultrasonic waves are so\n" + "powerful, they can bring on headaches\n" + "in people."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Flygon_1[] = _( + "FLYGON whips up a sandstorm by\n" + "flapping its wings. The wings create a\n" + "series of notes that sound like singing."); +const u8 DexDescription_Flygon_2[] = _( + "Because the “singing†is the only thing\n" + "that can be heard in a sandstorm, this\n" + "POKéMON is said to be the desert spirit."); +#else +const u8 DexDescription_Flygon_1[] = _( + "FLYGON is nicknamed “the elemental \n" + "spirit of the desert.†Because its\n" + "flapping wings whip up a cloud of sand,"); +const u8 DexDescription_Flygon_2[] = _( + "this POKéMON is always enveloped in a\n" + "sandstorm while flying."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Cacnea_1[] = _( + "The more arid and harsh the\n" + "environment, the more pretty and\n" + "fragrant a flower CACNEA grows."); +const u8 DexDescription_Cacnea_2[] = _( + "This POKéMON battles by wildly swinging\n" + "its thorny arms."); +#else +const u8 DexDescription_Cacnea_1[] = _( + "CACNEA lives in arid locations such\n" + "as deserts. It releases a strong aroma\n" + "from its flower to attract prey."); +const u8 DexDescription_Cacnea_2[] = _( + "When prey comes near, this POKéMON\n" + "shoots sharp thorns from its body to\n" + "bring the victim down."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Cacturne_1[] = _( + "If a traveler is going through a desert\n" + "in the thick of night, CACTURNE\n" + "will follow in a ragtag group."); +const u8 DexDescription_Cacturne_2[] = _( + "The POKéMON are biding their time,\n" + "waiting for the traveler to tire and\n" + "become incapable of moving."); +#else +const u8 DexDescription_Cacturne_1[] = _( + "During the daytime, CACTURNE remains\n" + "unmoving so that it does not lose any\n" + "moisture to the harsh desert sun."); +const u8 DexDescription_Cacturne_2[] = _( + "This POKéMON becomes active at night\n" + "when the temperature drops."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Swablu_1[] = _( + "SWABLU loves to make things clean.\n" + "If it spots something dirty, it will wipe\n" + "and polish it with its cottony wings."); +const u8 DexDescription_Swablu_2[] = _( + "If its wings become dirty, this POKéMON\n" + "finds a stream and showers itself."); +#else +const u8 DexDescription_Swablu_1[] = _( + "SWABLU has light and fluffy wings that\n" + "are like cottony clouds. This POKéMON\n" + "is not frightened of people."); +const u8 DexDescription_Swablu_2[] = _( + "It lands on the heads of people and\n" + "sits there like a cotton-fluff hat."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Altaria_1[] = _( + "ALTARIA sings in a gorgeous soprano.\n" + "Its wings are like cotton clouds.\n" + "This POKéMON catches updrafts with its"); +const u8 DexDescription_Altaria_2[] = _( + "buoyant wings and soars way up into\n" + "the wild blue yonder."); +#else +const u8 DexDescription_Altaria_1[] = _( + "ALTARIA dances and wheels through the\n" + "sky among billowing, cotton-like clouds.\n" + "By singing melodies in its crystal-clear"); +const u8 DexDescription_Altaria_2[] = _( + "voice, this POKéMON makes its listeners\n" + "experience dreamy wonderment."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Zangoose_1[] = _( + "ZANGOOSE usually stays on all fours,\n" + "but when angered, it gets up on its\n" + "hind legs and extends its claws."); +const u8 DexDescription_Zangoose_2[] = _( + "This POKéMON shares a bitter rivalry\n" + "with SEVIPER that dates back over\n" + "generations."); +#else +const u8 DexDescription_Zangoose_1[] = _( + "Memories of battling its arch-rival\n" + "SEVIPER are etched into every cell of\n" + "ZANGOOSE’s body."); +const u8 DexDescription_Zangoose_2[] = _( + "This POKéMON adroitly dodges attacks\n" + "with incredible agility."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Seviper_1[] = _( + "SEVIPER’s swordlike tail serves two\n" + "purposes - it slashes foes and douses\n" + "them with secreted poison."); +const u8 DexDescription_Seviper_2[] = _( + "This POKéMON will not give up its long-\n" + "running blood feud with ZANGOOSE."); +#else +const u8 DexDescription_Seviper_1[] = _( + "SEVIPER shares a generations-long\n" + "feud with ZANGOOSE. The scars on its\n" + "body are evidence of vicious battles."); +const u8 DexDescription_Seviper_2[] = _( + "This POKéMON attacks using its sword-\n" + "edged tail."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Lunatone_1[] = _( + "LUNATONE becomes active around the\n" + "time of the full moon. Instead of\n" + "walking, it moves by floating in midair."); +const u8 DexDescription_Lunatone_2[] = _( + "The POKéMON’s intimidating red eyes\n" + "cause all those who see it to become\n" + "transfixed with fear."); +#else +const u8 DexDescription_Lunatone_1[] = _( + "LUNATONE was discovered at a location\n" + "where a meteorite fell. As a result, some\n" + "people theorize that this POKéMON"); +const u8 DexDescription_Lunatone_2[] = _( + "came from space. However, no one has\n" + "been able to prove this theory so far."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Solrock_1[] = _( + "Sunlight is the source of SOLROCK’s\n" + "power. It is said to possess the ability\n" + "to read the emotions of others."); +const u8 DexDescription_Solrock_2[] = _( + "This POKéMON gives off intense heat\n" + "while rotating its body."); +#else +const u8 DexDescription_Solrock_1[] = _( + "SOLROCK is a new species of POKéMON\n" + "that is said to have fallen from space.\n" + "It floats in air and moves silently."); +const u8 DexDescription_Solrock_2[] = _( + "In battle, this POKéMON releases\n" + "intensely bright light."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Barboach_1[] = _( + "BARBOACH’s body is covered with a\n" + "slimy film. If a foe grabs it, this\n" + "POKéMON just slips out of the enemy’s"); +const u8 DexDescription_Barboach_2[] = _( + "grip.\n" + "This POKéMON grows weak if the slimy\n" + "coating dries up."); +#else +const u8 DexDescription_Barboach_1[] = _( + "BARBOACH’s sensitive whiskers serve\n" + "as a superb radar system.\n" + "This POKéMON hides in mud, leaving only"); +const u8 DexDescription_Barboach_2[] = _( + "its two whiskers exposed while it waits\n" + "for prey to come along."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Whiscash_1[] = _( + "If WHISCASH goes on a wild rampage,\n" + "it sets off a quake-like tremor with a\n" + "radius of over three miles."); +const u8 DexDescription_Whiscash_2[] = _( + "This POKéMON has the ability to predict\n" + "real earthquakes."); +#else +const u8 DexDescription_Whiscash_1[] = _( + "WHISCASH is extremely territorial.\n" + "Just one of these POKéMON will claim a\n" + "large pond as its exclusive territory."); +const u8 DexDescription_Whiscash_2[] = _( + "If a foe approaches it, it thrashes\n" + "about and triggers a massive\n" + "earthquake."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Corphish_1[] = _( + "CORPHISH catches prey with its sharp\n" + "claws. It has no likes or dislikes when it\n" + "comes to food - it will eat anything."); +const u8 DexDescription_Corphish_2[] = _( + "This POKéMON has no trouble living in\n" + "filthy water."); +#else +const u8 DexDescription_Corphish_1[] = _( + "CORPHISH were originally foreign\n" + "POKéMON that were imported as pets.\n" + "They eventually turned up in the wild."); +const u8 DexDescription_Corphish_2[] = _( + "This POKéMON is very hardy and has\n" + "greatly increased its population."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Crawdaunt_1[] = _( + "CRAWDAUNT molts (sheds) its shell\n" + "regularly. Immediately after molting,\n" + "its shell is soft and tender."); +const u8 DexDescription_Crawdaunt_2[] = _( + "Until the shell hardens, this POKéMON\n" + "hides in its streambed burrow to avoid\n" + "attack from its foes."); +#else +const u8 DexDescription_Crawdaunt_1[] = _( + "CRAWDAUNT has an extremely violent\n" + "nature that compels it to challenge\n" + "other living things to battle."); +const u8 DexDescription_Crawdaunt_2[] = _( + "Other life-forms refuse to live in\n" + "ponds inhabited by this POKéMON,\n" + "making them desolate places."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Baltoy_1[] = _( + "As soon as it spots others of its kind,\n" + "BALTOY congregates with them and\n" + "then begins crying noisily in unison."); +const u8 DexDescription_Baltoy_2[] = _( + "This POKéMON sleeps while cleverly\n" + "balancing itself on its one foot."); +#else +const u8 DexDescription_Baltoy_1[] = _( + "BALTOY moves while spinning around on\n" + "its one foot. Primitive wall paintings\n" + "depicting this POKéMON living among"); +const u8 DexDescription_Baltoy_2[] = _( + "people were discovered in some ancient\n" + "ruins."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Claydol_1[] = _( + "CLAYDOL is an enigma that appeared\n" + "from a clay statue made by an ancient\n" + "civilization dating back 20,000 years."); +const u8 DexDescription_Claydol_2[] = _( + "This POKéMON shoots beams from both\n" + "its hands."); +#else +const u8 DexDescription_Claydol_1[] = _( + "CLAYDOL are said to be dolls of mud made\n" + "by primitive humans and brought to life\n" + "by exposure to a mysterious ray."); +const u8 DexDescription_Claydol_2[] = _( + "This POKéMON moves about while\n" + "levitating."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Lileep_1[] = _( + "LILEEP is an ancient POKéMON that was\n" + "regenerated from a fossil. It remains\n" + "permanently anchored to a rock."); +const u8 DexDescription_Lileep_2[] = _( + "From its immobile perch, this POKéMON\n" + "intently scans for prey with its two\n" + "eyes."); +#else +const u8 DexDescription_Lileep_1[] = _( + "LILEEP became extinct approximately\n" + "a hundred million years ago.\n" + "This ancient POKéMON attaches itself"); +const u8 DexDescription_Lileep_2[] = _( + "to a rock on the seafloor and catches\n" + "approaching prey using tentacles \n" + "shaped like flower petals."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Cradily_1[] = _( + "CRADILY’s body serves as an anchor,\n" + "preventing it from being washed away in\n" + "rough seas."); +const u8 DexDescription_Cradily_2[] = _( + "This POKéMON secretes a strong\n" + "digestive fluid from its tentacles."); +#else +const u8 DexDescription_Cradily_1[] = _( + "CRADILY roams around the ocean floor\n" + "in search of food. This POKéMON freely\n" + "extends its tree trunk-like neck and"); +const u8 DexDescription_Cradily_2[] = _( + "captures unwary prey using its eight\n" + "tentacles."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Anorith_1[] = _( + "ANORITH is said to be a type of \n" + "POKéMON predecessor, with eight wings\n" + "at the sides of its body."); +const u8 DexDescription_Anorith_2[] = _( + "This POKéMON swam in the primordial sea\n" + "by undulating these eight wings."); +#else +const u8 DexDescription_Anorith_1[] = _( + "ANORITH was regenerated from a\n" + "prehistoric fossil. This primitive\n" + "POKéMON once lived in warm seas."); +const u8 DexDescription_Anorith_2[] = _( + "It grips its prey firmly between its\n" + "two large claws."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Armaldo_1[] = _( + "ARMALDO is a POKéMON species that\n" + "became extinct in prehistoric times.\n" + "This POKéMON is said to have walked on"); +const u8 DexDescription_Armaldo_2[] = _( + "its hind legs, which would have been\n" + "more convenient for life on land."); +#else +const u8 DexDescription_Armaldo_1[] = _( + "ARMALDO’s tough armor makes all attacks\n" + "bounce off. This POKéMON’s two\n" + "enormous claws can be freely extended"); +const u8 DexDescription_Armaldo_2[] = _( + "or contracted. They have the power to\n" + "punch right through a steel slab."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Feebas_1[] = _( + "While FEEBAS’s body is in tatters,\n" + "it has a hardy and tenacious life force\n" + "that enables it to live anywhere."); +const u8 DexDescription_Feebas_2[] = _( + "However, this POKéMON is also slow and\n" + "dimwitted, making it an easy catch."); +#else +const u8 DexDescription_Feebas_1[] = _( + "FEEBAS’s fins are ragged and\n" + "tattered from the start of its life.\n" + "Because of its shoddy appearance, this"); +const u8 DexDescription_Feebas_2[] = _( + "POKéMON is largely ignored.\n" + "It is capable of living in both the sea\n" + "and in rivers."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Milotic_1[] = _( + "MILOTIC live at the bottom of large\n" + "lakes. When this POKéMON’s body glows a\n" + "vivid pink, it releases a pulsing wave of"); +const u8 DexDescription_Milotic_2[] = _( + "energy that brings soothing calm to\n" + "restless spirits."); +#else +const u8 DexDescription_Milotic_1[] = _( + "MILOTIC is said to be the most\n" + "beautiful of all the POKéMON.\n" + "It has the power to becalm such"); +const u8 DexDescription_Milotic_2[] = _( + "emotions as anger and hostility to quell\n" + "bitter feuding."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Castform_1[] = _( + "CASTFORM borrows the power of nature\n" + "to transform itself into the guises of\n" + "the sun, rain clouds, and snow clouds."); +const u8 DexDescription_Castform_2[] = _( + "This POKéMON’s feelings change with the\n" + "weather."); +#else +const u8 DexDescription_Castform_1[] = _( + "CASTFORM’s appearance changes with\n" + "the weather.\n" + "This POKéMON gained the ability to use"); +const u8 DexDescription_Castform_2[] = _( + "the vast power of nature to protect\n" + "its tiny body."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Kecleon_1[] = _( + "KECLEON alters its body coloration to\n" + "blend in with its surroundings, allowing\n" + "it to sneak up on its prey unnoticed."); +const u8 DexDescription_Kecleon_2[] = _( + "Then it lashes out with its long,\n" + "stretchy tongue to instantly ensnare\n" + "the unsuspecting target."); +#else +const u8 DexDescription_Kecleon_1[] = _( + "KECLEON is capable of changing its body\n" + "colors at will to blend in with its\n" + "surroundings."); +const u8 DexDescription_Kecleon_2[] = _( + "There is one exception - this POKéMON\n" + "can’t change the zigzag pattern on its\n" + "belly."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Shuppet_1[] = _( + "SHUPPET grows by feeding on dark\n" + "emotions, such as vengefulness and \n" + "envy, in the hearts of people."); +const u8 DexDescription_Shuppet_2[] = _( + "It roams through cities in search of\n" + "grudges that taint people."); +#else +const u8 DexDescription_Shuppet_1[] = _( + "SHUPPET is attracted by feelings\n" + "of jealousy and vindictiveness.\n" + "If someone develops strong feelings of"); +const u8 DexDescription_Shuppet_2[] = _( + "vengeance, this POKéMON will appear\n" + "in a swarm and line up beneath the eaves\n" + "of that person’s home."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Banette_1[] = _( + "A cursed energy permeated the stuffing\n" + "of a discarded and forgotten plush doll,\n" + "giving it new life as BANETTE."); +const u8 DexDescription_Banette_2[] = _( + "The POKéMON’s energy would escape if it\n" + "were to ever open its mouth."); +#else +const u8 DexDescription_Banette_1[] = _( + "BANETTE generates energy for laying\n" + "strong curses by sticking pins into its\n" + "own body."); +const u8 DexDescription_Banette_2[] = _( + "This POKéMON was originally a pitiful\n" + "plush doll that was thrown away."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Duskull_1[] = _( + "DUSKULL wanders lost among the deep\n" + "darkness of midnight. There is an oft-\n" + "told admonishment given to misbehaving"); +const u8 DexDescription_Duskull_2[] = _( + "children that this POKéMON will spirit\n" + "away bad children who earn scoldings\n" + "from their mothers."); +#else +const u8 DexDescription_Duskull_1[] = _( + "DUSKULL can pass through any wall no\n" + "matter how thick it may be.\n" + "Once this POKéMON chooses a target,"); +const u8 DexDescription_Duskull_2[] = _( + "it will doggedly pursue the intended\n" + "victim until the break of dawn."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Dusclops_1[] = _( + "DUSCLOPS absorbs anything, however\n" + "large the object may be. This POKéMON\n" + "hypnotizes its foe by waving its hands"); +const u8 DexDescription_Dusclops_2[] = _( + "in a macabre manner and by bringing its\n" + "single eye to bear. The hypnotized foe\n" + "is made to do DUSCLOPS’s bidding."); +#else +const u8 DexDescription_Dusclops_1[] = _( + "DUSCLOPS’s body is completely hollow -\n" + "there is nothing at all inside.\n" + "It is said that its body is like a black"); +const u8 DexDescription_Dusclops_2[] = _( + "hole. This POKéMON will absorb anything\n" + "into its body, but nothing will ever come\n" + "back out."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Tropius_1[] = _( + "Children of the southern tropics eat\n" + "as snacks the fruit that grows in\n" + "bunches around the neck of TROPIUS."); +const u8 DexDescription_Tropius_2[] = _( + "This POKéMON flies by flapping the\n" + "leaves on its back as if they were\n" + "wings."); +#else +const u8 DexDescription_Tropius_1[] = _( + "The bunches of fruit around TROPIUS’s\n" + "neck are very popular with children.\n" + "This POKéMON loves fruit, and eats it"); +const u8 DexDescription_Tropius_2[] = _( + "continuously. Apparently, its love for\n" + "fruit resulted in its own outgrowth\n" + "of fruit."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Chimecho_1[] = _( + "In high winds, CHIMECHO cries as it\n" + "hangs from a tree branch or the eaves\n" + "of a building using a suction cup on its"); +const u8 DexDescription_Chimecho_2[] = _( + "head.\n" + "This POKéMON plucks berries with its\n" + "long tail and eats them."); +#else +const u8 DexDescription_Chimecho_1[] = _( + "CHIMECHO makes its cries echo\n" + "inside its hollow body. When this\n" + "POKéMON becomes enraged, its cries"); +const u8 DexDescription_Chimecho_2[] = _( + "result in ultrasonic waves that have\n" + "the power to knock foes flying."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Absol_1[] = _( + "ABSOL has the ability to foretell the\n" + "coming of natural disasters.\n" + "It lives in a harsh, rugged mountain"); +const u8 DexDescription_Absol_2[] = _( + "environment. This POKéMON very rarely\n" + "ventures down from the mountains."); +#else +const u8 DexDescription_Absol_1[] = _( + "Every time ABSOL appears before people,\n" + "it is followed by a disaster such as an\n" + "earthquake or a tidal wave."); +const u8 DexDescription_Absol_2[] = _( + "As a result, it came to be known as the\n" + "disaster POKéMON."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Wynaut_1[] = _( + "WYNAUT gather on moonlit nights to play\n" + "by squeezing up against each other.\n" + "By being squeezed, this POKéMON gains"); +const u8 DexDescription_Wynaut_2[] = _( + "endurance and is trained to dole out\n" + "powerful counterattacks."); +#else +const u8 DexDescription_Wynaut_1[] = _( + "WYNAUT can always be seen with a big,\n" + "happy smile on its face. Look at its tail\n" + "to determine if it is angry."); +const u8 DexDescription_Wynaut_2[] = _( + "When angered, this POKéMON will be\n" + "slapping the ground with its tail."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Snorunt_1[] = _( + "SNORUNT survives by eating only snow\n" + "and ice.\n" + "Old folklore claims that a house visited"); +const u8 DexDescription_Snorunt_2[] = _( + "by this POKéMON is sure to prosper for\n" + "many generations to come."); +#else +const u8 DexDescription_Snorunt_1[] = _( + "SNORUNT live in regions with heavy\n" + "snowfall. In seasons without snow, such\n" + "as spring and summer, this POKéMON"); +const u8 DexDescription_Snorunt_2[] = _( + "steals away to live quietly among\n" + "stalactites and stalagmites deep in\n" + "caverns."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Glalie_1[] = _( + "GLALIE has the ability to freely\n" + "control ice. For example, it can\n" + "instantly freeze its foe solid."); +const u8 DexDescription_Glalie_2[] = _( + "After immobilizing its foe in ice, this\n" + "POKéMON enjoys eating it in leisurely\n" + "fashion."); +#else +const u8 DexDescription_Glalie_1[] = _( + "GLALIE has a body made of rock, which it\n" + "hardens with an armor of ice.\n" + "This POKéMON has the ability to freeze"); +const u8 DexDescription_Glalie_2[] = _( + "moisture in the atmosphere into any\n" + "shape it desires."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Spheal_1[] = _( + "SPHEAL always travels by rolling\n" + "around on its ball-like body. When the\n" + "season for ice floes arrives, this"); +const u8 DexDescription_Spheal_2[] = _( + "POKéMON can be seen rolling about on\n" + "ice and crossing the sea."); +#else +const u8 DexDescription_Spheal_1[] = _( + "SPHEAL is much faster rolling than \n" + "walking to get around. When groups of\n" + "this POKéMON eat, they all clap at once"); +const u8 DexDescription_Spheal_2[] = _( + "to show their pleasure. Because of this,\n" + "their mealtimes are noisy."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Sealeo_1[] = _( + "SEALEO often balances and rolls\n" + "things on the tip of its nose. While the\n" + "POKéMON is rolling something, it checks"); +const u8 DexDescription_Sealeo_2[] = _( + "the object’s aroma and texture to\n" + "determine whether it likes the object\n" + "or not."); +#else +const u8 DexDescription_Sealeo_1[] = _( + "SEALEO has the habit of always juggling\n" + "on the tip of its nose anything it sees\n" + "for the first time."); +const u8 DexDescription_Sealeo_2[] = _( + "This POKéMON occasionally entertains\n" + "itself by balancing and rolling a SPHEAL\n" + "on its nose."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Walrein_1[] = _( + "WALREIN swims all over in frigid\n" + "seawater while crushing icebergs with\n" + "its grand, imposing tusks."); +const u8 DexDescription_Walrein_2[] = _( + "Its thick layer of blubber makes enemy\n" + "attacks bounce off harmlessly."); +#else +const u8 DexDescription_Walrein_1[] = _( + "WALREIN’s two massively developed\n" + "tusks can totally shatter blocks of\n" + "ice weighing ten tons with one blow."); +const u8 DexDescription_Walrein_2[] = _( + "This POKéMON’s thick coat of blubber\n" + "insulates it from subzero temperatures."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Clamperl_1[] = _( + "CLAMPERL grows while being protected\n" + "by its rock-hard shell. When its body\n" + "becomes too large to fit inside the"); +const u8 DexDescription_Clamperl_2[] = _( + "shell, it is sure evidence that this\n" + "POKéMON is getting close to evolution."); +#else +const u8 DexDescription_Clamperl_1[] = _( + "CLAMPERL’s sturdy shell is not only good\n" + "for protection - it is also used for\n" + "clamping and catching prey."); +const u8 DexDescription_Clamperl_2[] = _( + "A fully grown CLAMPERL’s shell will be\n" + "scored with nicks and scratches all\n" + "over."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Huntail_1[] = _( + "HUNTAIL’s tail is shaped like a fish.\n" + "It uses the tail to attract prey, then\n" + "swallows the prey whole with its large,"); +const u8 DexDescription_Huntail_2[] = _( + "gaping mouth.\n" + "This POKéMON swims by wiggling its\n" + "slender body like a snake."); +#else +const u8 DexDescription_Huntail_1[] = _( + "HUNTAIL’s presence went unnoticed by\n" + "people for a long time because it lives\n" + "at extreme depths in the sea."); +const u8 DexDescription_Huntail_2[] = _( + "This POKéMON’s eyes can see clearly\n" + "even in the murky dark depths of the\n" + "ocean."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Gorebyss_1[] = _( + "Although GOREBYSS is the very picture\n" + "of elegance and beauty while swimming,\n" + "it is also cruel. When it spots prey, this"); +const u8 DexDescription_Gorebyss_2[] = _( + "POKéMON inserts its thin mouth into the\n" + "prey’s body and drains the prey of its\n" + "body fluids."); +#else +const u8 DexDescription_Gorebyss_1[] = _( + "GOREBYSS lives in the southern seas\n" + "at extreme depths. Its body is built to\n" + "withstand the enormous pressure of"); +const u8 DexDescription_Gorebyss_2[] = _( + "water at incredible depths. Because of\n" + "this, this POKéMON’s body is unharmed\n" + "by ordinary attacks."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Relicanth_1[] = _( + "RELICANTH is a rare species that was\n" + "discovered in deep-sea explorations.\n" + "This POKéMON’s body withstands the"); +const u8 DexDescription_Relicanth_2[] = _( + "enormous water pressure of the ocean\n" + "depths. Its body is covered in tough\n" + "scales that are like craggy rocks."); +#else +const u8 DexDescription_Relicanth_1[] = _( + "RELICANTH is a POKéMON species that\n" + "existed for a hundred million years\n" + "without ever changing its form."); +const u8 DexDescription_Relicanth_2[] = _( + "This ancient POKéMON feeds on\n" + "microscopic organisms with its\n" + "toothless mouth."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Luvdisc_1[] = _( + "LUVDISC’s heart-shaped body is a\n" + "symbol of love and romance.\n" + "It is said that any couple meeting this"); +const u8 DexDescription_Luvdisc_2[] = _( + "POKéMON is promised a loving\n" + "relationship that never ends."); +#else +const u8 DexDescription_Luvdisc_1[] = _( + "LUVDISC live in shallow seas in the\n" + "tropics. This heart-shaped POKéMON\n" + "earned its name by swimming after"); +const u8 DexDescription_Luvdisc_2[] = _( + "loving couples it spotted in the\n" + "ocean’s waves."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Bagon_1[] = _( + "BAGON harbors a never-ending dream of\n" + "one day soaring high among the clouds.\n" + "As if trying to dispel its frustration"); +const u8 DexDescription_Bagon_2[] = _( + "over its inability to fly, this POKéMON\n" + "slams its hard head against huge rocks\n" + "and shatters them into pebbles."); +#else +const u8 DexDescription_Bagon_1[] = _( + "BAGON has a dream of one day soaring\n" + "in the sky. In doomed efforts to fly,\n" + "this POKéMON hurls itself off cliffs."); +const u8 DexDescription_Bagon_2[] = _( + "As a result of its dives, its head has \n" + "grown tough and as hard as tempered\n" + "steel."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Shelgon_1[] = _( + "Covering SHELGON’s body are outgrowths\n" + "much like bones. The shell is very hard\n" + "and bounces off enemy attacks."); +const u8 DexDescription_Shelgon_2[] = _( + "When awaiting evolution, this POKéMON\n" + "hides away in a cavern."); +#else +const u8 DexDescription_Shelgon_1[] = _( + "Inside SHELGON’s armor-like shell, cells\n" + "are in the midst of transformation\n" + "to create an entirely new body."); +const u8 DexDescription_Shelgon_2[] = _( + "This POKéMON’s shell is extremely heavy,\n" + "making its movements sluggish."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Salamence_1[] = _( + "By evolving into SALAMENCE, this\n" + "POKéMON finally realizes its long-held\n" + "dream of growing wings."); +const u8 DexDescription_Salamence_2[] = _( + "To express its joy, it flies and wheels\n" + "all over the sky while spouting flames\n" + "from its mouth."); +#else +const u8 DexDescription_Salamence_1[] = _( + "SALAMENCE came about as a result of a\n" + "strong, long-held dream of growing\n" + "wings. It is said that this powerful"); +const u8 DexDescription_Salamence_2[] = _( + "desire triggered a sudden mutation in\n" + "this POKéMON’s cells, causing it to\n" + "sprout its magnificent wings."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Beldum_1[] = _( + "BELDUM keeps itself floating by\n" + "generating a magnetic force that\n" + "repels earth’s natural magnetism."); +const u8 DexDescription_Beldum_2[] = _( + "When it sleeps, this POKéMON anchors\n" + "itself to a cliff using the hooks on\n" + "its rear."); +#else +const u8 DexDescription_Beldum_1[] = _( + "Instead of blood, a powerful magnetic\n" + "force courses throughout BELDUM’s\n" + "body. This POKéMON communicates with"); +const u8 DexDescription_Beldum_2[] = _( + "others by sending controlled pulses of\n" + "magnetism."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Metang_1[] = _( + "When two BELDUM fuse together, METANG\n" + "is formed. The brains of the BELDUM are\n" + "joined by a magnetic nervous system."); +const u8 DexDescription_Metang_2[] = _( + "This POKéMON turns its arms to the rear\n" + "for traveling at high speed."); +#else +const u8 DexDescription_Metang_1[] = _( + "When two BELDUM fuse together, METANG\n" + "is formed. The brains of the BELDUM are\n" + "joined by a magnetic nervous system."); +const u8 DexDescription_Metang_2[] = _( + "By linking its brains magnetically,\n" + "this POKéMON generates strong\n" + "psychokinetic power."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Metagross_1[] = _( + "METAGROSS is the result of two METANG\n" + "achieving fusion. When hunting, this\n" + "POKéMON pins the prey to the ground"); +const u8 DexDescription_Metagross_2[] = _( + "under its massive body. It then eats\n" + "the helpless victim using the large \n" + "mouth on its stomach."); +#else +const u8 DexDescription_Metagross_1[] = _( + "METAGROSS has four brains in total.\n" + "Combined, the four brains can breeze\n" + "through difficult calculations faster"); +const u8 DexDescription_Metagross_2[] = _( + "than a supercomputer.\n" + "This POKéMON can float in the air by\n" + "tucking in its four legs."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Regirock_1[] = _( + "REGIROCK’s body is composed entirely of\n" + "rocks. Recently, a study made the\n" + "startling discovery that the rocks"); +const u8 DexDescription_Regirock_2[] = _( + "were all unearthed from different\n" + "locations."); +#else +const u8 DexDescription_Regirock_1[] = _( + "REGIROCK was sealed away by people\n" + "long ago. If this POKéMON’s body is\n" + "damaged in battle, it is said to seek"); +const u8 DexDescription_Regirock_2[] = _( + "out suitable rocks on its own to repair\n" + "itself."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Regice_1[] = _( + "REGICE cloaks itself with frigid air of\n" + "negative 328 degrees F.\n" + "Things will freeze solid just by going"); +const u8 DexDescription_Regice_2[] = _( + "near this POKéMON.\n" + "Its icy body is so cold, it will not melt\n" + "even if it is immersed in magma."); +#else +const u8 DexDescription_Regice_1[] = _( + "REGICE’s body was made during an ice\n" + "age. The deep-frozen body can’t be\n" + "melted, even by fire."); +const u8 DexDescription_Regice_2[] = _( + "This POKéMON controls frigid air of\n" + "minus 328 degrees F."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Registeel_1[] = _( + "REGISTEEL was imprisoned by people\n" + "in ancient times.\n" + "The metal composing its body is thought"); +const u8 DexDescription_Registeel_2[] = _( + "to be a curious substance that is not\n" + "of this earth."); +#else +const u8 DexDescription_Registeel_1[] = _( + "REGISTEEL has a body that is harder\n" + "than any kind of metal.\n" + "Its body is apparently hollow."); +const u8 DexDescription_Registeel_2[] = _( + "No one has any idea what this POKéMON\n" + "eats."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Latias_1[] = _( + "LATIAS is highly intelligent and capable\n" + "of understanding human speech.\n" + "It is covered with a glass-like down."); +const u8 DexDescription_Latias_2[] = _( + "The POKéMON enfolds its body with its\n" + "down and refracts light to alter its\n" + "appearance."); +#else +const u8 DexDescription_Latias_1[] = _( + "LATIAS is highly sensitive to the\n" + "emotions of people. If it senses any\n" + "hostility, this POKéMON ruffles the"); +const u8 DexDescription_Latias_2[] = _( + "feathers all over its body and cries\n" + "shrilly to intimidate the foe."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Latios_1[] = _( + "LATIOS will only open its heart to a\n" + "TRAINER with a compassionate spirit.\n" + "This POKéMON can fly faster than a jet"); +const u8 DexDescription_Latios_2[] = _( + "plane by folding its forelegs to minimize\n" + "air resistance."); +#else +const u8 DexDescription_Latios_1[] = _( + "LATIOS has the ability to make its foe\n" + "see an image of what it has seen or\n" + "imagines in its head."); +const u8 DexDescription_Latios_2[] = _( + "This POKéMON is intelligent and\n" + "understands human speech."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Kyogre_1[] = _( + "KYOGRE is named in mythology as the\n" + "POKéMON that expanded the sea by\n" + "covering the land with torrential rains"); +const u8 DexDescription_Kyogre_2[] = _( + "and towering tidal waves.\n" + "It took to sleep after a cataclysmic\n" + "battle with GROUDON."); +#else +const u8 DexDescription_Kyogre_1[] = _( + "KYOGRE has the power to create massive\n" + "rain clouds that cover the entire sky\n" + "and bring about torrential downpours."); +const u8 DexDescription_Kyogre_2[] = _( + "This POKéMON saved people who were\n" + "suffering from droughts."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Groudon_1[] = _( + "GROUDON has the power to scatter rain\n" + "clouds and make water evaporate with\n" + "light and heat."); +const u8 DexDescription_Groudon_2[] = _( + "It came as a savior to people who had\n" + "been suffering from terrible floods."); +#else +const u8 DexDescription_Groudon_1[] = _( + "GROUDON has long been described in \n" + "mythology as the POKéMON that raised\n" + "lands and expanded continents."); +const u8 DexDescription_Groudon_2[] = _( + "This POKéMON took to sleep after a\n" + "cataclysmic battle with KYOGRE."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Rayquaza_1[] = _( + "RAYQUAZA is said to have lived for\n" + "hundreds of millions of years in the\n" + "earth’s ozone layer, above the clouds."); +const u8 DexDescription_Rayquaza_2[] = _( + "Its existence had been completely\n" + "unknown because it lived so high in\n" + "the sky."); +#else +const u8 DexDescription_Rayquaza_1[] = _( + "RAYQUAZA lived for hundreds of millions\n" + "of years in the earth’s ozone layer, \n" + "never descending to the ground."); +const u8 DexDescription_Rayquaza_2[] = _( + "This POKéMON appears to feed on water\n" + "and particles in the atmosphere."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Jirachi_1[] = _( + "JIRACHI will awaken from its sleep of\n" + "a thousand years if you sing to it in a\n" + "voice of purity."); +const u8 DexDescription_Jirachi_2[] = _( + "It is said to make true any wish that\n" + "people desire."); +#else +const u8 DexDescription_Jirachi_1[] = _( + "A legend states that JIRACHI will make\n" + "true any wish that is written on notes\n" + "attached to its head when it awakens."); +const u8 DexDescription_Jirachi_2[] = _( + "If this POKéMON senses danger, it will\n" + "fight without awakening."); +#endif + +#ifdef SAPPHIRE +const u8 DexDescription_Deoxys_1[] = _( + "DEOXYS emerged from a virus that came\n" + "from space. It is highly intelligent and\n" + "wields psychokinetic powers."); +const u8 DexDescription_Deoxys_2[] = _( + "This POKéMON shoots lasers from the\n" + "crystalline organ on its chest."); +#else +const u8 DexDescription_Deoxys_1[] = _( + "The DNA of a space virus underwent a\n" + "sudden mutation upon exposure to a\n" + "laser beam and resulted in DEOXYS."); +const u8 DexDescription_Deoxys_2[] = _( + "The crystalline organ on this POKéMON’s\n" + "chest appears to be its brain."); +#endif + +const struct PokedexEntry gPokedexEntries[] = +{ + { //Dummy + .categoryName = _("UNKNOWN"), + .height = 0, + .weight = 0, + .descriptionPage1 = DexDescription_Dummy_1, + .descriptionPage2 = DexDescription_Dummy_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Bulbasaur + .categoryName = _("SEED"), + .height = 7, + .weight = 69, + .descriptionPage1 = DexDescription_Bulbasaur_1, + .descriptionPage2 = DexDescription_Bulbasaur_2, + .pokemonScale = 356, + .pokemonOffset = 17, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Ivysaur + .categoryName = _("SEED"), + .height = 10, + .weight = 130, + .descriptionPage1 = DexDescription_Ivysaur_1, + .descriptionPage2 = DexDescription_Ivysaur_2, + .pokemonScale = 335, + .pokemonOffset = 13, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Venusaur + .categoryName = _("SEED"), + .height = 20, + .weight = 1000, + .descriptionPage1 = DexDescription_Venusaur_1, + .descriptionPage2 = DexDescription_Venusaur_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 388, + .trainerOffset = 6, + }, + { //Charmander + .categoryName = _("LIZARD"), + .height = 6, + .weight = 85, + .descriptionPage1 = DexDescription_Charmander_1, + .descriptionPage2 = DexDescription_Charmander_2, + .pokemonScale = 444, + .pokemonOffset = 18, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Charmeleon + .categoryName = _("FLAME"), + .height = 11, + .weight = 190, + .descriptionPage1 = DexDescription_Charmeleon_1, + .descriptionPage2 = DexDescription_Charmeleon_2, + .pokemonScale = 302, + .pokemonOffset = 9, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Charizard + .categoryName = _("FLAME"), + .height = 17, + .weight = 905, + .descriptionPage1 = DexDescription_Charizard_1, + .descriptionPage2 = DexDescription_Charizard_2, + .pokemonScale = 256, + .pokemonOffset = 1, + .trainerScale = 302, + .trainerOffset = 3, + }, + { //Squirtle + .categoryName = _("TINY TURTLE"), + .height = 5, + .weight = 90, + .descriptionPage1 = DexDescription_Squirtle_1, + .descriptionPage2 = DexDescription_Squirtle_2, + .pokemonScale = 412, + .pokemonOffset = 18, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Wartortle + .categoryName = _("TURTLE"), + .height = 10, + .weight = 225, + .descriptionPage1 = DexDescription_Wartortle_1, + .descriptionPage2 = DexDescription_Wartortle_2, + .pokemonScale = 332, + .pokemonOffset = 10, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Blastoise + .categoryName = _("SHELLFISH"), + .height = 16, + .weight = 855, + .descriptionPage1 = DexDescription_Blastoise_1, + .descriptionPage2 = DexDescription_Blastoise_2, + .pokemonScale = 256, + .pokemonOffset = -1, + .trainerScale = 293, + .trainerOffset = 2, + }, + { //Caterpie + .categoryName = _("WORM"), + .height = 3, + .weight = 29, + .descriptionPage1 = DexDescription_Caterpie_1, + .descriptionPage2 = DexDescription_Caterpie_2, + .pokemonScale = 549, + .pokemonOffset = 22, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Metapod + .categoryName = _("COCOON"), + .height = 7, + .weight = 99, + .descriptionPage1 = DexDescription_Metapod_1, + .descriptionPage2 = DexDescription_Metapod_2, + .pokemonScale = 350, + .pokemonOffset = 18, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Butterfree + .categoryName = _("BUTTERFLY"), + .height = 11, + .weight = 320, + .descriptionPage1 = DexDescription_Butterfree_1, + .descriptionPage2 = DexDescription_Butterfree_2, + .pokemonScale = 312, + .pokemonOffset = 2, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Weedle + .categoryName = _("HAIRY BUG"), + .height = 3, + .weight = 32, + .descriptionPage1 = DexDescription_Weedle_1, + .descriptionPage2 = DexDescription_Weedle_2, + .pokemonScale = 455, + .pokemonOffset = 22, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Kakuna + .categoryName = _("COCOON"), + .height = 6, + .weight = 100, + .descriptionPage1 = DexDescription_Kakuna_1, + .descriptionPage2 = DexDescription_Kakuna_2, + .pokemonScale = 424, + .pokemonOffset = 17, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Beedrill + .categoryName = _("POISON BEE"), + .height = 10, + .weight = 295, + .descriptionPage1 = DexDescription_Beedrill_1, + .descriptionPage2 = DexDescription_Beedrill_2, + .pokemonScale = 366, + .pokemonOffset = 2, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Pidgey + .categoryName = _("TINY BIRD"), + .height = 3, + .weight = 18, + .descriptionPage1 = DexDescription_Pidgey_1, + .descriptionPage2 = DexDescription_Pidgey_2, + .pokemonScale = 508, + .pokemonOffset = -3, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Pidgeotto + .categoryName = _("BIRD"), + .height = 11, + .weight = 300, + .descriptionPage1 = DexDescription_Pidgeotto_1, + .descriptionPage2 = DexDescription_Pidgeotto_2, + .pokemonScale = 331, + .pokemonOffset = 10, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Pidgeot + .categoryName = _("BIRD"), + .height = 15, + .weight = 395, + .descriptionPage1 = DexDescription_Pidgeot_1, + .descriptionPage2 = DexDescription_Pidgeot_2, + .pokemonScale = 269, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Rattata + .categoryName = _("MOUSE"), + .height = 3, + .weight = 35, + .descriptionPage1 = DexDescription_Rattata_1, + .descriptionPage2 = DexDescription_Rattata_2, + .pokemonScale = 481, + .pokemonOffset = 21, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Raticate + .categoryName = _("MOUSE"), + .height = 7, + .weight = 185, + .descriptionPage1 = DexDescription_Raticate_1, + .descriptionPage2 = DexDescription_Raticate_2, + .pokemonScale = 459, + .pokemonOffset = 18, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Spearow + .categoryName = _("TINY BIRD"), + .height = 3, + .weight = 20, + .descriptionPage1 = DexDescription_Spearow_1, + .descriptionPage2 = DexDescription_Spearow_2, + .pokemonScale = 571, + .pokemonOffset = 22, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Fearow + .categoryName = _("BEAK"), + .height = 12, + .weight = 380, + .descriptionPage1 = DexDescription_Fearow_1, + .descriptionPage2 = DexDescription_Fearow_2, + .pokemonScale = 278, + .pokemonOffset = 1, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Ekans + .categoryName = _("SNAKE"), + .height = 20, + .weight = 69, + .descriptionPage1 = DexDescription_Ekans_1, + .descriptionPage2 = DexDescription_Ekans_2, + .pokemonScale = 298, + .pokemonOffset = 12, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Arbok + .categoryName = _("COBRA"), + .height = 35, + .weight = 650, + .descriptionPage1 = DexDescription_Arbok_1, + .descriptionPage2 = DexDescription_Arbok_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 296, + .trainerOffset = 2, + }, + { //Pikachu + .categoryName = _("MOUSE"), + .height = 4, + .weight = 60, + .descriptionPage1 = DexDescription_Pikachu_1, + .descriptionPage2 = DexDescription_Pikachu_2, + .pokemonScale = 479, + .pokemonOffset = 19, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Raichu + .categoryName = _("MOUSE"), + .height = 8, + .weight = 300, + .descriptionPage1 = DexDescription_Raichu_1, + .descriptionPage2 = DexDescription_Raichu_2, + .pokemonScale = 426, + .pokemonOffset = 13, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Sandshrew + .categoryName = _("MOUSE"), + .height = 6, + .weight = 120, + .descriptionPage1 = DexDescription_Sandshrew_1, + .descriptionPage2 = DexDescription_Sandshrew_2, + .pokemonScale = 365, + .pokemonOffset = 18, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Sandslash + .categoryName = _("MOUSE"), + .height = 10, + .weight = 295, + .descriptionPage1 = DexDescription_Sandslash_1, + .descriptionPage2 = DexDescription_Sandslash_2, + .pokemonScale = 341, + .pokemonOffset = 11, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //NidoranF + .categoryName = _("POISON PIN"), + .height = 4, + .weight = 70, + .descriptionPage1 = DexDescription_NidoranF_1, + .descriptionPage2 = DexDescription_NidoranF_2, + .pokemonScale = 488, + .pokemonOffset = 21, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Nidorina + .categoryName = _("POISON PIN"), + .height = 8, + .weight = 200, + .descriptionPage1 = DexDescription_Nidorina_1, + .descriptionPage2 = DexDescription_Nidorina_2, + .pokemonScale = 381, + .pokemonOffset = 15, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Nidoqueen + .categoryName = _("DRILL"), + .height = 13, + .weight = 600, + .descriptionPage1 = DexDescription_Nidoqueen_1, + .descriptionPage2 = DexDescription_Nidoqueen_2, + .pokemonScale = 293, + .pokemonOffset = 4, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //NidoranM + .categoryName = _("POISON PIN"), + .height = 5, + .weight = 90, + .descriptionPage1 = DexDescription_NidoranM_1, + .descriptionPage2 = DexDescription_NidoranM_2, + .pokemonScale = 511, + .pokemonOffset = 20, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Nidorino + .categoryName = _("POISON PIN"), + .height = 9, + .weight = 195, + .descriptionPage1 = DexDescription_Nidorino_1, + .descriptionPage2 = DexDescription_Nidorino_2, + .pokemonScale = 408, + .pokemonOffset = 15, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Nidoking + .categoryName = _("DRILL"), + .height = 14, + .weight = 620, + .descriptionPage1 = DexDescription_Nidoking_1, + .descriptionPage2 = DexDescription_Nidoking_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Clefairy + .categoryName = _("FAIRY"), + .height = 6, + .weight = 75, + .descriptionPage1 = DexDescription_Clefairy_1, + .descriptionPage2 = DexDescription_Clefairy_2, + .pokemonScale = 441, + .pokemonOffset = 20, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Clefable + .categoryName = _("FAIRY"), + .height = 13, + .weight = 400, + .descriptionPage1 = DexDescription_Clefable_1, + .descriptionPage2 = DexDescription_Clefable_2, + .pokemonScale = 256, + .pokemonOffset = 5, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Vulpix + .categoryName = _("FOX"), + .height = 6, + .weight = 99, + .descriptionPage1 = DexDescription_Vulpix_1, + .descriptionPage2 = DexDescription_Vulpix_2, + .pokemonScale = 542, + .pokemonOffset = 19, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Ninetales + .categoryName = _("FOX"), + .height = 11, + .weight = 199, + .descriptionPage1 = DexDescription_Ninetales_1, + .descriptionPage2 = DexDescription_Ninetales_2, + .pokemonScale = 339, + .pokemonOffset = 10, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Jigglypuff + .categoryName = _("BALLOON"), + .height = 5, + .weight = 55, + .descriptionPage1 = DexDescription_Jigglypuff_1, + .descriptionPage2 = DexDescription_Jigglypuff_2, + .pokemonScale = 433, + .pokemonOffset = 2, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Wigglytuff + .categoryName = _("BALLOON"), + .height = 10, + .weight = 120, + .descriptionPage1 = DexDescription_Wigglytuff_1, + .descriptionPage2 = DexDescription_Wigglytuff_2, + .pokemonScale = 328, + .pokemonOffset = 11, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Zubat + .categoryName = _("BAT"), + .height = 8, + .weight = 75, + .descriptionPage1 = DexDescription_Zubat_1, + .descriptionPage2 = DexDescription_Zubat_2, + .pokemonScale = 362, + .pokemonOffset = -5, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Golbat + .categoryName = _("BAT"), + .height = 16, + .weight = 550, + .descriptionPage1 = DexDescription_Golbat_1, + .descriptionPage2 = DexDescription_Golbat_2, + .pokemonScale = 256, + .pokemonOffset = 1, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Oddish + .categoryName = _("WEED"), + .height = 5, + .weight = 54, + .descriptionPage1 = DexDescription_Oddish_1, + .descriptionPage2 = DexDescription_Oddish_2, + .pokemonScale = 423, + .pokemonOffset = 19, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Gloom + .categoryName = _("WEED"), + .height = 8, + .weight = 86, + .descriptionPage1 = DexDescription_Gloom_1, + .descriptionPage2 = DexDescription_Gloom_2, + .pokemonScale = 329, + .pokemonOffset = 13, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Vileplume + .categoryName = _("FLOWER"), + .height = 12, + .weight = 186, + .descriptionPage1 = DexDescription_Vileplume_1, + .descriptionPage2 = DexDescription_Vileplume_2, + .pokemonScale = 256, + .pokemonOffset = 4, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Paras + .categoryName = _("MUSHROOM"), + .height = 3, + .weight = 54, + .descriptionPage1 = DexDescription_Paras_1, + .descriptionPage2 = DexDescription_Paras_2, + .pokemonScale = 593, + .pokemonOffset = 22, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Parasect + .categoryName = _("MUSHROOM"), + .height = 10, + .weight = 295, + .descriptionPage1 = DexDescription_Parasect_1, + .descriptionPage2 = DexDescription_Parasect_2, + .pokemonScale = 307, + .pokemonOffset = 8, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Venonat + .categoryName = _("INSECT"), + .height = 10, + .weight = 300, + .descriptionPage1 = DexDescription_Venonat_1, + .descriptionPage2 = DexDescription_Venonat_2, + .pokemonScale = 360, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = -1, + }, + { //Venomoth + .categoryName = _("POISON MOTH"), + .height = 15, + .weight = 125, + .descriptionPage1 = DexDescription_Venomoth_1, + .descriptionPage2 = DexDescription_Venomoth_2, + .pokemonScale = 285, + .pokemonOffset = 2, + .trainerScale = 256, + .trainerOffset = 1, + }, + { //Diglett + .categoryName = _("MOLE"), + .height = 2, + .weight = 8, + .descriptionPage1 = DexDescription_Diglett_1, + .descriptionPage2 = DexDescription_Diglett_2, + .pokemonScale = 833, + .pokemonOffset = 25, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Dugtrio + .categoryName = _("MOLE"), + .height = 7, + .weight = 333, + .descriptionPage1 = DexDescription_Dugtrio_1, + .descriptionPage2 = DexDescription_Dugtrio_2, + .pokemonScale = 406, + .pokemonOffset = 18, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Meowth + .categoryName = _("SCRATCH CAT"), + .height = 4, + .weight = 42, + .descriptionPage1 = DexDescription_Meowth_1, + .descriptionPage2 = DexDescription_Meowth_2, + .pokemonScale = 480, + .pokemonOffset = 19, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Persian + .categoryName = _("CLASSY CAT"), + .height = 10, + .weight = 320, + .descriptionPage1 = DexDescription_Persian_1, + .descriptionPage2 = DexDescription_Persian_2, + .pokemonScale = 320, + .pokemonOffset = 10, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Psyduck + .categoryName = _("DUCK"), + .height = 8, + .weight = 196, + .descriptionPage1 = DexDescription_Psyduck_1, + .descriptionPage2 = DexDescription_Psyduck_2, + .pokemonScale = 369, + .pokemonOffset = 15, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Golduck + .categoryName = _("DUCK"), + .height = 17, + .weight = 766, + .descriptionPage1 = DexDescription_Golduck_1, + .descriptionPage2 = DexDescription_Golduck_2, + .pokemonScale = 256, + .pokemonOffset = 1, + .trainerScale = 273, + .trainerOffset = 1, + }, + { //Mankey + .categoryName = _("PIG MONKEY"), + .height = 5, + .weight = 280, + .descriptionPage1 = DexDescription_Mankey_1, + .descriptionPage2 = DexDescription_Mankey_2, + .pokemonScale = 404, + .pokemonOffset = 19, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Primeape + .categoryName = _("PIG MONKEY"), + .height = 10, + .weight = 320, + .descriptionPage1 = DexDescription_Primeape_1, + .descriptionPage2 = DexDescription_Primeape_2, + .pokemonScale = 326, + .pokemonOffset = 10, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Growlithe + .categoryName = _("PUPPY"), + .height = 7, + .weight = 190, + .descriptionPage1 = DexDescription_Growlithe_1, + .descriptionPage2 = DexDescription_Growlithe_2, + .pokemonScale = 346, + .pokemonOffset = 14, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Arcanine + .categoryName = _("LEGENDARY"), + .height = 19, + .weight = 1550, + .descriptionPage1 = DexDescription_Arcanine_1, + .descriptionPage2 = DexDescription_Arcanine_2, + .pokemonScale = 256, + .pokemonOffset = 1, + .trainerScale = 312, + .trainerOffset = 4, + }, + { //Poliwag + .categoryName = _("TADPOLE"), + .height = 6, + .weight = 124, + .descriptionPage1 = DexDescription_Poliwag_1, + .descriptionPage2 = DexDescription_Poliwag_2, + .pokemonScale = 369, + .pokemonOffset = 20, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Poliwhirl + .categoryName = _("TADPOLE"), + .height = 10, + .weight = 200, + .descriptionPage1 = DexDescription_Poliwhirl_1, + .descriptionPage2 = DexDescription_Poliwhirl_2, + .pokemonScale = 288, + .pokemonOffset = 11, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Poliwrath + .categoryName = _("TADPOLE"), + .height = 13, + .weight = 540, + .descriptionPage1 = DexDescription_Poliwrath_1, + .descriptionPage2 = DexDescription_Poliwrath_2, + .pokemonScale = 256, + .pokemonOffset = 6, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Abra + .categoryName = _("PSI"), + .height = 9, + .weight = 195, + .descriptionPage1 = DexDescription_Abra_1, + .descriptionPage2 = DexDescription_Abra_2, + .pokemonScale = 363, + .pokemonOffset = 14, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Kadabra + .categoryName = _("PSI"), + .height = 13, + .weight = 565, + .descriptionPage1 = DexDescription_Kadabra_1, + .descriptionPage2 = DexDescription_Kadabra_2, + .pokemonScale = 256, + .pokemonOffset = 3, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Alakazam + .categoryName = _("PSI"), + .height = 15, + .weight = 480, + .descriptionPage1 = DexDescription_Alakazam_1, + .descriptionPage2 = DexDescription_Alakazam_2, + .pokemonScale = 256, + .pokemonOffset = 3, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Machop + .categoryName = _("SUPERPOWER"), + .height = 8, + .weight = 195, + .descriptionPage1 = DexDescription_Machop_1, + .descriptionPage2 = DexDescription_Machop_2, + .pokemonScale = 342, + .pokemonOffset = 14, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Machoke + .categoryName = _("SUPERPOWER"), + .height = 15, + .weight = 705, + .descriptionPage1 = DexDescription_Machoke_1, + .descriptionPage2 = DexDescription_Machoke_2, + .pokemonScale = 323, + .pokemonOffset = 9, + .trainerScale = 257, + .trainerOffset = 0, + }, + { //Machamp + .categoryName = _("SUPERPOWER"), + .height = 16, + .weight = 1300, + .descriptionPage1 = DexDescription_Machamp_1, + .descriptionPage2 = DexDescription_Machamp_2, + .pokemonScale = 280, + .pokemonOffset = 1, + .trainerScale = 269, + .trainerOffset = -1, + }, + { //Bellsprout + .categoryName = _("FLOWER"), + .height = 7, + .weight = 40, + .descriptionPage1 = DexDescription_Bellsprout_1, + .descriptionPage2 = DexDescription_Bellsprout_2, + .pokemonScale = 354, + .pokemonOffset = 16, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Weepinbell + .categoryName = _("FLYCATCHER"), + .height = 10, + .weight = 64, + .descriptionPage1 = DexDescription_Weepinbell_1, + .descriptionPage2 = DexDescription_Weepinbell_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Victreebel + .categoryName = _("FLYCATCHER"), + .height = 17, + .weight = 155, + .descriptionPage1 = DexDescription_Victreebel_1, + .descriptionPage2 = DexDescription_Victreebel_2, + .pokemonScale = 256, + .pokemonOffset = 1, + .trainerScale = 312, + .trainerOffset = 3, + }, + { //Tentacool + .categoryName = _("JELLYFISH"), + .height = 9, + .weight = 455, + .descriptionPage1 = DexDescription_Tentacool_1, + .descriptionPage2 = DexDescription_Tentacool_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Tentacruel + .categoryName = _("JELLYFISH"), + .height = 16, + .weight = 550, + .descriptionPage1 = DexDescription_Tentacruel_1, + .descriptionPage2 = DexDescription_Tentacruel_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 312, + .trainerOffset = 1, + }, + { //Geodude + .categoryName = _("ROCK"), + .height = 4, + .weight = 200, + .descriptionPage1 = DexDescription_Geodude_1, + .descriptionPage2 = DexDescription_Geodude_2, + .pokemonScale = 347, + .pokemonOffset = 18, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Graveler + .categoryName = _("ROCK"), + .height = 10, + .weight = 1050, + .descriptionPage1 = DexDescription_Graveler_1, + .descriptionPage2 = DexDescription_Graveler_2, + .pokemonScale = 256, + .pokemonOffset = 2, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Golem + .categoryName = _("MEGATON"), + .height = 14, + .weight = 3000, + .descriptionPage1 = DexDescription_Golem_1, + .descriptionPage2 = DexDescription_Golem_2, + .pokemonScale = 256, + .pokemonOffset = 3, + .trainerScale = 296, + .trainerOffset = 2, + }, + { //Ponyta + .categoryName = _("FIRE HORSE"), + .height = 10, + .weight = 300, + .descriptionPage1 = DexDescription_Ponyta_1, + .descriptionPage2 = DexDescription_Ponyta_2, + .pokemonScale = 283, + .pokemonOffset = 8, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Rapidash + .categoryName = _("FIRE HORSE"), + .height = 17, + .weight = 950, + .descriptionPage1 = DexDescription_Rapidash_1, + .descriptionPage2 = DexDescription_Rapidash_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 289, + .trainerOffset = 1, + }, + { //Slowpoke + .categoryName = _("DOPEY"), + .height = 12, + .weight = 360, + .descriptionPage1 = DexDescription_Slowpoke_1, + .descriptionPage2 = DexDescription_Slowpoke_2, + .pokemonScale = 256, + .pokemonOffset = 10, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Slowbro + .categoryName = _("HERMIT CRAB"), + .height = 16, + .weight = 785, + .descriptionPage1 = DexDescription_Slowbro_1, + .descriptionPage2 = DexDescription_Slowbro_2, + .pokemonScale = 256, + .pokemonOffset = 6, + .trainerScale = 296, + .trainerOffset = 2, + }, + { //Magnemite + .categoryName = _("MAGNET"), + .height = 3, + .weight = 60, + .descriptionPage1 = DexDescription_Magnemite_1, + .descriptionPage2 = DexDescription_Magnemite_2, + .pokemonScale = 288, + .pokemonOffset = -9, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Magneton + .categoryName = _("MAGNET"), + .height = 10, + .weight = 600, + .descriptionPage1 = DexDescription_Magneton_1, + .descriptionPage2 = DexDescription_Magneton_2, + .pokemonScale = 292, + .pokemonOffset = 1, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Farfetchd + .categoryName = _("WILD DUCK"), + .height = 8, + .weight = 150, + .descriptionPage1 = DexDescription_Farfetchd_1, + .descriptionPage2 = DexDescription_Farfetchd_2, + .pokemonScale = 330, + .pokemonOffset = 2, + .trainerScale = 293, + .trainerOffset = 2, + }, + { //Doduo + .categoryName = _("TWIN BIRD"), + .height = 14, + .weight = 392, + .descriptionPage1 = DexDescription_Doduo_1, + .descriptionPage2 = DexDescription_Doduo_2, + .pokemonScale = 256, + .pokemonOffset = 3, + .trainerScale = 257, + .trainerOffset = -1, + }, + { //Dodrio + .categoryName = _("TRIPLE BIRD"), + .height = 18, + .weight = 852, + .descriptionPage1 = DexDescription_Dodrio_1, + .descriptionPage2 = DexDescription_Dodrio_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 268, + .trainerOffset = 0, + }, + { //Seel + .categoryName = _("SEA LION"), + .height = 11, + .weight = 900, + .descriptionPage1 = DexDescription_Seel_1, + .descriptionPage2 = DexDescription_Seel_2, + .pokemonScale = 297, + .pokemonOffset = 8, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Dewgong + .categoryName = _("SEA LION"), + .height = 17, + .weight = 1200, + .descriptionPage1 = DexDescription_Dewgong_1, + .descriptionPage2 = DexDescription_Dewgong_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 275, + .trainerOffset = 0, + }, + { //Grimer + .categoryName = _("SLUDGE"), + .height = 9, + .weight = 300, + .descriptionPage1 = DexDescription_Grimer_1, + .descriptionPage2 = DexDescription_Grimer_2, + .pokemonScale = 258, + .pokemonOffset = 10, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Muk + .categoryName = _("SLUDGE"), + .height = 12, + .weight = 300, + .descriptionPage1 = DexDescription_Muk_1, + .descriptionPage2 = DexDescription_Muk_2, + .pokemonScale = 256, + .pokemonOffset = 2, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Shellder + .categoryName = _("BIVALVE"), + .height = 3, + .weight = 40, + .descriptionPage1 = DexDescription_Shellder_1, + .descriptionPage2 = DexDescription_Shellder_2, + .pokemonScale = 675, + .pokemonOffset = 24, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Cloyster + .categoryName = _("BIVALVE"), + .height = 15, + .weight = 1325, + .descriptionPage1 = DexDescription_Cloyster_1, + .descriptionPage2 = DexDescription_Cloyster_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 269, + .trainerOffset = 1, + }, + { //Gastly + .categoryName = _("GAS"), + .height = 13, + .weight = 1, + .descriptionPage1 = DexDescription_Gastly_1, + .descriptionPage2 = DexDescription_Gastly_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Haunter + .categoryName = _("GAS"), + .height = 16, + .weight = 1, + .descriptionPage1 = DexDescription_Haunter_1, + .descriptionPage2 = DexDescription_Haunter_2, + .pokemonScale = 256, + .pokemonOffset = 2, + .trainerScale = 293, + .trainerOffset = 2, + }, + { //Gengar + .categoryName = _("SHADOW"), + .height = 15, + .weight = 405, + .descriptionPage1 = DexDescription_Gengar_1, + .descriptionPage2 = DexDescription_Gengar_2, + .pokemonScale = 256, + .pokemonOffset = 2, + .trainerScale = 302, + .trainerOffset = 2, + }, + { //Onix + .categoryName = _("ROCK SNAKE"), + .height = 88, + .weight = 2100, + .descriptionPage1 = DexDescription_Onix_1, + .descriptionPage2 = DexDescription_Onix_2, + .pokemonScale = 256, + .pokemonOffset = 1, + .trainerScale = 515, + .trainerOffset = 14, + }, + { //Drowzee + .categoryName = _("HYPNOSIS"), + .height = 10, + .weight = 324, + .descriptionPage1 = DexDescription_Drowzee_1, + .descriptionPage2 = DexDescription_Drowzee_2, + .pokemonScale = 274, + .pokemonOffset = 6, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Hypno + .categoryName = _("HYPNOSIS"), + .height = 16, + .weight = 756, + .descriptionPage1 = DexDescription_Hypno_1, + .descriptionPage2 = DexDescription_Hypno_2, + .pokemonScale = 256, + .pokemonOffset = 3, + .trainerScale = 257, + .trainerOffset = 0, + }, + { //Krabby + .categoryName = _("RIVER CRAB"), + .height = 4, + .weight = 65, + .descriptionPage1 = DexDescription_Krabby_1, + .descriptionPage2 = DexDescription_Krabby_2, + .pokemonScale = 469, + .pokemonOffset = 20, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Kingler + .categoryName = _("PINCER"), + .height = 13, + .weight = 600, + .descriptionPage1 = DexDescription_Kingler_1, + .descriptionPage2 = DexDescription_Kingler_2, + .pokemonScale = 256, + .pokemonOffset = 2, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Voltorb + .categoryName = _("BALL"), + .height = 5, + .weight = 104, + .descriptionPage1 = DexDescription_Voltorb_1, + .descriptionPage2 = DexDescription_Voltorb_2, + .pokemonScale = 364, + .pokemonOffset = -8, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Electrode + .categoryName = _("BALL"), + .height = 12, + .weight = 666, + .descriptionPage1 = DexDescription_Electrode_1, + .descriptionPage2 = DexDescription_Electrode_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Exeggcute + .categoryName = _("EGG"), + .height = 4, + .weight = 25, + .descriptionPage1 = DexDescription_Exeggcute_1, + .descriptionPage2 = DexDescription_Exeggcute_2, + .pokemonScale = 489, + .pokemonOffset = -4, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Exeggutor + .categoryName = _("COCONUT"), + .height = 20, + .weight = 1200, + .descriptionPage1 = DexDescription_Exeggutor_1, + .descriptionPage2 = DexDescription_Exeggutor_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 309, + .trainerOffset = 5, + }, + { //Cubone + .categoryName = _("LONELY"), + .height = 4, + .weight = 65, + .descriptionPage1 = DexDescription_Cubone_1, + .descriptionPage2 = DexDescription_Cubone_2, + .pokemonScale = 545, + .pokemonOffset = 21, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Marowak + .categoryName = _("BONE KEEPER"), + .height = 10, + .weight = 450, + .descriptionPage1 = DexDescription_Marowak_1, + .descriptionPage2 = DexDescription_Marowak_2, + .pokemonScale = 293, + .pokemonOffset = 12, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Hitmonlee + .categoryName = _("KICKING"), + .height = 15, + .weight = 498, + .descriptionPage1 = DexDescription_Hitmonlee_1, + .descriptionPage2 = DexDescription_Hitmonlee_2, + .pokemonScale = 256, + .pokemonOffset = 3, + .trainerScale = 259, + .trainerOffset = 1, + }, + { //Hitmonchan + .categoryName = _("PUNCHING"), + .height = 14, + .weight = 502, + .descriptionPage1 = DexDescription_Hitmonchan_1, + .descriptionPage2 = DexDescription_Hitmonchan_2, + .pokemonScale = 256, + .pokemonOffset = 2, + .trainerScale = 277, + .trainerOffset = 2, + }, + { //Lickitung + .categoryName = _("LICKING"), + .height = 12, + .weight = 655, + .descriptionPage1 = DexDescription_Lickitung_1, + .descriptionPage2 = DexDescription_Lickitung_2, + .pokemonScale = 256, + .pokemonOffset = 4, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Koffing + .categoryName = _("POISON GAS"), + .height = 6, + .weight = 10, + .descriptionPage1 = DexDescription_Koffing_1, + .descriptionPage2 = DexDescription_Koffing_2, + .pokemonScale = 369, + .pokemonOffset = -1, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Weezing + .categoryName = _("POISON GAS"), + .height = 12, + .weight = 95, + .descriptionPage1 = DexDescription_Weezing_1, + .descriptionPage2 = DexDescription_Weezing_2, + .pokemonScale = 305, + .pokemonOffset = 3, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Rhyhorn + .categoryName = _("SPIKES"), + .height = 10, + .weight = 1150, + .descriptionPage1 = DexDescription_Rhyhorn_1, + .descriptionPage2 = DexDescription_Rhyhorn_2, + .pokemonScale = 267, + .pokemonOffset = 6, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Rhydon + .categoryName = _("DRILL"), + .height = 19, + .weight = 1200, + .descriptionPage1 = DexDescription_Rhydon_1, + .descriptionPage2 = DexDescription_Rhydon_2, + .pokemonScale = 256, + .pokemonOffset = 1, + .trainerScale = 299, + .trainerOffset = 2, + }, + { //Chansey + .categoryName = _("EGG"), + .height = 11, + .weight = 346, + .descriptionPage1 = DexDescription_Chansey_1, + .descriptionPage2 = DexDescription_Chansey_2, + .pokemonScale = 257, + .pokemonOffset = 7, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Tangela + .categoryName = _("VINE"), + .height = 10, + .weight = 350, + .descriptionPage1 = DexDescription_Tangela_1, + .descriptionPage2 = DexDescription_Tangela_2, + .pokemonScale = 304, + .pokemonOffset = 1, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Kangaskhan + .categoryName = _("PARENT"), + .height = 22, + .weight = 800, + .descriptionPage1 = DexDescription_Kangaskhan_1, + .descriptionPage2 = DexDescription_Kangaskhan_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 387, + .trainerOffset = 8, + }, + { //Horsea + .categoryName = _("DRAGON"), + .height = 4, + .weight = 80, + .descriptionPage1 = DexDescription_Horsea_1, + .descriptionPage2 = DexDescription_Horsea_2, + .pokemonScale = 399, + .pokemonOffset = -1, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Seadra + .categoryName = _("DRAGON"), + .height = 12, + .weight = 250, + .descriptionPage1 = DexDescription_Seadra_1, + .descriptionPage2 = DexDescription_Seadra_2, + .pokemonScale = 299, + .pokemonOffset = 3, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Goldeen + .categoryName = _("GOLDFISH"), + .height = 6, + .weight = 150, + .descriptionPage1 = DexDescription_Goldeen_1, + .descriptionPage2 = DexDescription_Goldeen_2, + .pokemonScale = 379, + .pokemonOffset = 4, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Seaking + .categoryName = _("GOLDFISH"), + .height = 13, + .weight = 390, + .descriptionPage1 = DexDescription_Seaking_1, + .descriptionPage2 = DexDescription_Seaking_2, + .pokemonScale = 256, + .pokemonOffset = 3, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Staryu + .categoryName = _("STAR SHAPE"), + .height = 8, + .weight = 345, + .descriptionPage1 = DexDescription_Staryu_1, + .descriptionPage2 = DexDescription_Staryu_2, + .pokemonScale = 326, + .pokemonOffset = 1, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Starmie + .categoryName = _("MYSTERIOUS"), + .height = 11, + .weight = 800, + .descriptionPage1 = DexDescription_Starmie_1, + .descriptionPage2 = DexDescription_Starmie_2, + .pokemonScale = 301, + .pokemonOffset = 3, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Mrmime + .categoryName = _("BARRIER"), + .height = 13, + .weight = 545, + .descriptionPage1 = DexDescription_Mrmime_1, + .descriptionPage2 = DexDescription_Mrmime_2, + .pokemonScale = 258, + .pokemonOffset = 6, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Scyther + .categoryName = _("MANTIS"), + .height = 15, + .weight = 560, + .descriptionPage1 = DexDescription_Scyther_1, + .descriptionPage2 = DexDescription_Scyther_2, + .pokemonScale = 256, + .pokemonOffset = 1, + .trainerScale = 293, + .trainerOffset = 2, + }, + { //Jynx + .categoryName = _("HUMAN SHAPE"), + .height = 14, + .weight = 406, + .descriptionPage1 = DexDescription_Jynx_1, + .descriptionPage2 = DexDescription_Jynx_2, + .pokemonScale = 256, + .pokemonOffset = 3, + .trainerScale = 300, + .trainerOffset = 1, + }, + { //Electabuzz + .categoryName = _("ELECTRIC"), + .height = 11, + .weight = 300, + .descriptionPage1 = DexDescription_Electabuzz_1, + .descriptionPage2 = DexDescription_Electabuzz_2, + .pokemonScale = 351, + .pokemonOffset = 8, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Magmar + .categoryName = _("SPITFIRE"), + .height = 13, + .weight = 445, + .descriptionPage1 = DexDescription_Magmar_1, + .descriptionPage2 = DexDescription_Magmar_2, + .pokemonScale = 277, + .pokemonOffset = 5, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Pinsir + .categoryName = _("STAG BEETLE"), + .height = 15, + .weight = 550, + .descriptionPage1 = DexDescription_Pinsir_1, + .descriptionPage2 = DexDescription_Pinsir_2, + .pokemonScale = 256, + .pokemonOffset = 2, + .trainerScale = 257, + .trainerOffset = 0, + }, + { //Tauros + .categoryName = _("WILD BULL"), + .height = 14, + .weight = 884, + .descriptionPage1 = DexDescription_Tauros_1, + .descriptionPage2 = DexDescription_Tauros_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Magikarp + .categoryName = _("FISH"), + .height = 9, + .weight = 100, + .descriptionPage1 = DexDescription_Magikarp_1, + .descriptionPage2 = DexDescription_Magikarp_2, + .pokemonScale = 310, + .pokemonOffset = 4, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Gyarados + .categoryName = _("ATROCIOUS"), + .height = 65, + .weight = 2350, + .descriptionPage1 = DexDescription_Gyarados_1, + .descriptionPage2 = DexDescription_Gyarados_2, + .pokemonScale = 256, + .pokemonOffset = 6, + .trainerScale = 481, + .trainerOffset = 13, + }, + { //Lapras + .categoryName = _("TRANSPORT"), + .height = 25, + .weight = 2200, + .descriptionPage1 = DexDescription_Lapras_1, + .descriptionPage2 = DexDescription_Lapras_2, + .pokemonScale = 257, + .pokemonOffset = 10, + .trainerScale = 423, + .trainerOffset = 8, + }, + { //Ditto + .categoryName = _("TRANSFORM"), + .height = 3, + .weight = 40, + .descriptionPage1 = DexDescription_Ditto_1, + .descriptionPage2 = DexDescription_Ditto_2, + .pokemonScale = 633, + .pokemonOffset = 23, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Eevee + .categoryName = _("EVOLUTION"), + .height = 3, + .weight = 65, + .descriptionPage1 = DexDescription_Eevee_1, + .descriptionPage2 = DexDescription_Eevee_2, + .pokemonScale = 476, + .pokemonOffset = 18, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Vaporeon + .categoryName = _("BUBBLE JET"), + .height = 10, + .weight = 290, + .descriptionPage1 = DexDescription_Vaporeon_1, + .descriptionPage2 = DexDescription_Vaporeon_2, + .pokemonScale = 316, + .pokemonOffset = 8, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Jolteon + .categoryName = _("LIGHTNING"), + .height = 8, + .weight = 245, + .descriptionPage1 = DexDescription_Jolteon_1, + .descriptionPage2 = DexDescription_Jolteon_2, + .pokemonScale = 283, + .pokemonOffset = 8, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Flareon + .categoryName = _("FLAME"), + .height = 9, + .weight = 250, + .descriptionPage1 = DexDescription_Flareon_1, + .descriptionPage2 = DexDescription_Flareon_2, + .pokemonScale = 306, + .pokemonOffset = 12, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Porygon + .categoryName = _("VIRTUAL"), + .height = 8, + .weight = 365, + .descriptionPage1 = DexDescription_Porygon_1, + .descriptionPage2 = DexDescription_Porygon_2, + .pokemonScale = 328, + .pokemonOffset = 15, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Omanyte + .categoryName = _("SPIRAL"), + .height = 4, + .weight = 75, + .descriptionPage1 = DexDescription_Omanyte_1, + .descriptionPage2 = DexDescription_Omanyte_2, + .pokemonScale = 521, + .pokemonOffset = 22, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Omastar + .categoryName = _("SPIRAL"), + .height = 10, + .weight = 350, + .descriptionPage1 = DexDescription_Omastar_1, + .descriptionPage2 = DexDescription_Omastar_2, + .pokemonScale = 307, + .pokemonOffset = 7, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Kabuto + .categoryName = _("SHELLFISH"), + .height = 5, + .weight = 115, + .descriptionPage1 = DexDescription_Kabuto_1, + .descriptionPage2 = DexDescription_Kabuto_2, + .pokemonScale = 454, + .pokemonOffset = 21, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Kabutops + .categoryName = _("SHELLFISH"), + .height = 13, + .weight = 405, + .descriptionPage1 = DexDescription_Kabutops_1, + .descriptionPage2 = DexDescription_Kabutops_2, + .pokemonScale = 271, + .pokemonOffset = 3, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Aerodactyl + .categoryName = _("FOSSIL"), + .height = 18, + .weight = 590, + .descriptionPage1 = DexDescription_Aerodactyl_1, + .descriptionPage2 = DexDescription_Aerodactyl_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 302, + .trainerOffset = 4, + }, + { //Snorlax + .categoryName = _("SLEEPING"), + .height = 21, + .weight = 4600, + .descriptionPage1 = DexDescription_Snorlax_1, + .descriptionPage2 = DexDescription_Snorlax_2, + .pokemonScale = 256, + .pokemonOffset = 4, + .trainerScale = 423, + .trainerOffset = 11, + }, + { //Articuno + .categoryName = _("FREEZE"), + .height = 17, + .weight = 554, + .descriptionPage1 = DexDescription_Articuno_1, + .descriptionPage2 = DexDescription_Articuno_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 309, + .trainerOffset = 2, + }, + { //Zapdos + .categoryName = _("ELECTRIC"), + .height = 16, + .weight = 526, + .descriptionPage1 = DexDescription_Zapdos_1, + .descriptionPage2 = DexDescription_Zapdos_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 318, + .trainerOffset = 3, + }, + { //Moltres + .categoryName = _("FLAME"), + .height = 20, + .weight = 600, + .descriptionPage1 = DexDescription_Moltres_1, + .descriptionPage2 = DexDescription_Moltres_2, + .pokemonScale = 270, + .pokemonOffset = 0, + .trainerScale = 387, + .trainerOffset = 8, + }, + { //Dratini + .categoryName = _("DRAGON"), + .height = 18, + .weight = 33, + .descriptionPage1 = DexDescription_Dratini_1, + .descriptionPage2 = DexDescription_Dratini_2, + .pokemonScale = 256, + .pokemonOffset = 8, + .trainerScale = 386, + .trainerOffset = 6, + }, + { //Dragonair + .categoryName = _("DRAGON"), + .height = 40, + .weight = 165, + .descriptionPage1 = DexDescription_Dragonair_1, + .descriptionPage2 = DexDescription_Dragonair_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 411, + .trainerOffset = 5, + }, + { //Dragonite + .categoryName = _("DRAGON"), + .height = 22, + .weight = 2100, + .descriptionPage1 = DexDescription_Dragonite_1, + .descriptionPage2 = DexDescription_Dragonite_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 309, + .trainerOffset = 4, + }, + { //Mewtwo + .categoryName = _("GENETIC"), + .height = 20, + .weight = 1220, + .descriptionPage1 = DexDescription_Mewtwo_1, + .descriptionPage2 = DexDescription_Mewtwo_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 309, + .trainerOffset = 4, + }, + { //Mew + .categoryName = _("NEW SPECIES"), + .height = 4, + .weight = 40, + .descriptionPage1 = DexDescription_Mew_1, + .descriptionPage2 = DexDescription_Mew_2, + .pokemonScale = 457, + .pokemonOffset = -2, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Chikorita + .categoryName = _("LEAF"), + .height = 9, + .weight = 64, + .descriptionPage1 = DexDescription_Chikorita_1, + .descriptionPage2 = DexDescription_Chikorita_2, + .pokemonScale = 512, + .pokemonOffset = 20, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Bayleef + .categoryName = _("LEAF"), + .height = 12, + .weight = 158, + .descriptionPage1 = DexDescription_Bayleef_1, + .descriptionPage2 = DexDescription_Bayleef_2, + .pokemonScale = 296, + .pokemonOffset = 4, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Meganium + .categoryName = _("HERB"), + .height = 18, + .weight = 1005, + .descriptionPage1 = DexDescription_Meganium_1, + .descriptionPage2 = DexDescription_Meganium_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 277, + .trainerOffset = 1, + }, + { //Cyndaquil + .categoryName = _("FIRE MOUSE"), + .height = 5, + .weight = 79, + .descriptionPage1 = DexDescription_Cyndaquil_1, + .descriptionPage2 = DexDescription_Cyndaquil_2, + .pokemonScale = 539, + .pokemonOffset = 21, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Quilava + .categoryName = _("VOLCANO"), + .height = 9, + .weight = 190, + .descriptionPage1 = DexDescription_Quilava_1, + .descriptionPage2 = DexDescription_Quilava_2, + .pokemonScale = 329, + .pokemonOffset = 11, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Typhlosion + .categoryName = _("VOLCANO"), + .height = 17, + .weight = 795, + .descriptionPage1 = DexDescription_Typhlosion_1, + .descriptionPage2 = DexDescription_Typhlosion_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 268, + .trainerOffset = 1, + }, + { //Totodile + .categoryName = _("BIG JAW"), + .height = 6, + .weight = 95, + .descriptionPage1 = DexDescription_Totodile_1, + .descriptionPage2 = DexDescription_Totodile_2, + .pokemonScale = 487, + .pokemonOffset = 20, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Croconaw + .categoryName = _("BIG JAW"), + .height = 11, + .weight = 250, + .descriptionPage1 = DexDescription_Croconaw_1, + .descriptionPage2 = DexDescription_Croconaw_2, + .pokemonScale = 378, + .pokemonOffset = 13, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Feraligatr + .categoryName = _("BIG JAW"), + .height = 23, + .weight = 888, + .descriptionPage1 = DexDescription_Feraligatr_1, + .descriptionPage2 = DexDescription_Feraligatr_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 342, + .trainerOffset = 7, + }, + { //Sentret + .categoryName = _("SCOUT"), + .height = 8, + .weight = 60, + .descriptionPage1 = DexDescription_Sentret_1, + .descriptionPage2 = DexDescription_Sentret_2, + .pokemonScale = 439, + .pokemonOffset = 12, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Furret + .categoryName = _("LONG BODY"), + .height = 18, + .weight = 325, + .descriptionPage1 = DexDescription_Furret_1, + .descriptionPage2 = DexDescription_Furret_2, + .pokemonScale = 346, + .pokemonOffset = 11, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Hoothoot + .categoryName = _("OWL"), + .height = 7, + .weight = 212, + .descriptionPage1 = DexDescription_Hoothoot_1, + .descriptionPage2 = DexDescription_Hoothoot_2, + .pokemonScale = 380, + .pokemonOffset = -2, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Noctowl + .categoryName = _("OWL"), + .height = 16, + .weight = 408, + .descriptionPage1 = DexDescription_Noctowl_1, + .descriptionPage2 = DexDescription_Noctowl_2, + .pokemonScale = 278, + .pokemonOffset = 3, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Ledyba + .categoryName = _("FIVE STAR"), + .height = 10, + .weight = 108, + .descriptionPage1 = DexDescription_Ledyba_1, + .descriptionPage2 = DexDescription_Ledyba_2, + .pokemonScale = 256, + .pokemonOffset = 4, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Ledian + .categoryName = _("FIVE STAR"), + .height = 14, + .weight = 356, + .descriptionPage1 = DexDescription_Ledian_1, + .descriptionPage2 = DexDescription_Ledian_2, + .pokemonScale = 256, + .pokemonOffset = 2, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Spinarak + .categoryName = _("STRING SPIT"), + .height = 5, + .weight = 85, + .descriptionPage1 = DexDescription_Spinarak_1, + .descriptionPage2 = DexDescription_Spinarak_2, + .pokemonScale = 414, + .pokemonOffset = 21, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Ariados + .categoryName = _("LONG LEG"), + .height = 11, + .weight = 335, + .descriptionPage1 = DexDescription_Ariados_1, + .descriptionPage2 = DexDescription_Ariados_2, + .pokemonScale = 316, + .pokemonOffset = 8, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Crobat + .categoryName = _("BAT"), + .height = 18, + .weight = 750, + .descriptionPage1 = DexDescription_Crobat_1, + .descriptionPage2 = DexDescription_Crobat_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 281, + .trainerOffset = 1, + }, + { //Chinchou + .categoryName = _("ANGLER"), + .height = 5, + .weight = 120, + .descriptionPage1 = DexDescription_Chinchou_1, + .descriptionPage2 = DexDescription_Chinchou_2, + .pokemonScale = 424, + .pokemonOffset = -2, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Lanturn + .categoryName = _("LIGHT"), + .height = 12, + .weight = 225, + .descriptionPage1 = DexDescription_Lanturn_1, + .descriptionPage2 = DexDescription_Lanturn_2, + .pokemonScale = 269, + .pokemonOffset = 6, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Pichu + .categoryName = _("TINY MOUSE"), + .height = 3, + .weight = 20, + .descriptionPage1 = DexDescription_Pichu_1, + .descriptionPage2 = DexDescription_Pichu_2, + .pokemonScale = 508, + .pokemonOffset = 20, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Cleffa + .categoryName = _("STAR SHAPE"), + .height = 3, + .weight = 30, + .descriptionPage1 = DexDescription_Cleffa_1, + .descriptionPage2 = DexDescription_Cleffa_2, + .pokemonScale = 462, + .pokemonOffset = 23, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Igglybuff + .categoryName = _("BALLOON"), + .height = 3, + .weight = 10, + .descriptionPage1 = DexDescription_Igglybuff_1, + .descriptionPage2 = DexDescription_Igglybuff_2, + .pokemonScale = 457, + .pokemonOffset = -1, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Togepi + .categoryName = _("SPIKE BALL"), + .height = 3, + .weight = 15, + .descriptionPage1 = DexDescription_Togepi_1, + .descriptionPage2 = DexDescription_Togepi_2, + .pokemonScale = 507, + .pokemonOffset = 23, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Togetic + .categoryName = _("HAPPINESS"), + .height = 6, + .weight = 32, + .descriptionPage1 = DexDescription_Togetic_1, + .descriptionPage2 = DexDescription_Togetic_2, + .pokemonScale = 424, + .pokemonOffset = 17, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Natu + .categoryName = _("TINY BIRD"), + .height = 2, + .weight = 20, + .descriptionPage1 = DexDescription_Natu_1, + .descriptionPage2 = DexDescription_Natu_2, + .pokemonScale = 610, + .pokemonOffset = 25, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Xatu + .categoryName = _("MYSTIC"), + .height = 15, + .weight = 150, + .descriptionPage1 = DexDescription_Xatu_1, + .descriptionPage2 = DexDescription_Xatu_2, + .pokemonScale = 256, + .pokemonOffset = 6, + .trainerScale = 318, + .trainerOffset = 4, + }, + { //Mareep + .categoryName = _("WOOL"), + .height = 6, + .weight = 78, + .descriptionPage1 = DexDescription_Mareep_1, + .descriptionPage2 = DexDescription_Mareep_2, + .pokemonScale = 379, + .pokemonOffset = 18, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Flaaffy + .categoryName = _("WOOL"), + .height = 8, + .weight = 133, + .descriptionPage1 = DexDescription_Flaaffy_1, + .descriptionPage2 = DexDescription_Flaaffy_2, + .pokemonScale = 372, + .pokemonOffset = 15, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Ampharos + .categoryName = _("LIGHT"), + .height = 14, + .weight = 615, + .descriptionPage1 = DexDescription_Ampharos_1, + .descriptionPage2 = DexDescription_Ampharos_2, + .pokemonScale = 256, + .pokemonOffset = 4, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Bellossom + .categoryName = _("FLOWER"), + .height = 4, + .weight = 58, + .descriptionPage1 = DexDescription_Bellossom_1, + .descriptionPage2 = DexDescription_Bellossom_2, + .pokemonScale = 472, + .pokemonOffset = 21, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Marill + .categoryName = _("AQUA MOUSE"), + .height = 4, + .weight = 85, + .descriptionPage1 = DexDescription_Marill_1, + .descriptionPage2 = DexDescription_Marill_2, + .pokemonScale = 476, + .pokemonOffset = 20, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Azumarill + .categoryName = _("AQUA RABBIT"), + .height = 8, + .weight = 285, + .descriptionPage1 = DexDescription_Azumarill_1, + .descriptionPage2 = DexDescription_Azumarill_2, + .pokemonScale = 448, + .pokemonOffset = 16, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Sudowoodo + .categoryName = _("IMITATION"), + .height = 12, + .weight = 380, + .descriptionPage1 = DexDescription_Sudowoodo_1, + .descriptionPage2 = DexDescription_Sudowoodo_2, + .pokemonScale = 305, + .pokemonOffset = 8, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Politoed + .categoryName = _("FROG"), + .height = 11, + .weight = 339, + .descriptionPage1 = DexDescription_Politoed_1, + .descriptionPage2 = DexDescription_Politoed_2, + .pokemonScale = 289, + .pokemonOffset = 6, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Hoppip + .categoryName = _("COTTONWEED"), + .height = 4, + .weight = 5, + .descriptionPage1 = DexDescription_Hoppip_1, + .descriptionPage2 = DexDescription_Hoppip_2, + .pokemonScale = 562, + .pokemonOffset = -7, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Skiploom + .categoryName = _("COTTONWEED"), + .height = 6, + .weight = 10, + .descriptionPage1 = DexDescription_Skiploom_1, + .descriptionPage2 = DexDescription_Skiploom_2, + .pokemonScale = 387, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Jumpluff + .categoryName = _("COTTONWEED"), + .height = 8, + .weight = 30, + .descriptionPage1 = DexDescription_Jumpluff_1, + .descriptionPage2 = DexDescription_Jumpluff_2, + .pokemonScale = 418, + .pokemonOffset = -4, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Aipom + .categoryName = _("LONG TAIL"), + .height = 8, + .weight = 115, + .descriptionPage1 = DexDescription_Aipom_1, + .descriptionPage2 = DexDescription_Aipom_2, + .pokemonScale = 363, + .pokemonOffset = 6, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Sunkern + .categoryName = _("SEED"), + .height = 3, + .weight = 18, + .descriptionPage1 = DexDescription_Sunkern_1, + .descriptionPage2 = DexDescription_Sunkern_2, + .pokemonScale = 541, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Sunflora + .categoryName = _("SUN"), + .height = 8, + .weight = 85, + .descriptionPage1 = DexDescription_Sunflora_1, + .descriptionPage2 = DexDescription_Sunflora_2, + .pokemonScale = 444, + .pokemonOffset = 15, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Yanma + .categoryName = _("CLEAR WING"), + .height = 12, + .weight = 380, + .descriptionPage1 = DexDescription_Yanma_1, + .descriptionPage2 = DexDescription_Yanma_2, + .pokemonScale = 274, + .pokemonOffset = -1, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Wooper + .categoryName = _("WATER FISH"), + .height = 4, + .weight = 85, + .descriptionPage1 = DexDescription_Wooper_1, + .descriptionPage2 = DexDescription_Wooper_2, + .pokemonScale = 479, + .pokemonOffset = 21, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Quagsire + .categoryName = _("WATER FISH"), + .height = 14, + .weight = 750, + .descriptionPage1 = DexDescription_Quagsire_1, + .descriptionPage2 = DexDescription_Quagsire_2, + .pokemonScale = 256, + .pokemonOffset = 4, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Espeon + .categoryName = _("SUN"), + .height = 9, + .weight = 265, + .descriptionPage1 = DexDescription_Espeon_1, + .descriptionPage2 = DexDescription_Espeon_2, + .pokemonScale = 363, + .pokemonOffset = 14, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Umbreon + .categoryName = _("MOONLIGHT"), + .height = 10, + .weight = 270, + .descriptionPage1 = DexDescription_Umbreon_1, + .descriptionPage2 = DexDescription_Umbreon_2, + .pokemonScale = 317, + .pokemonOffset = 11, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Murkrow + .categoryName = _("DARKNESS"), + .height = 5, + .weight = 21, + .descriptionPage1 = DexDescription_Murkrow_1, + .descriptionPage2 = DexDescription_Murkrow_2, + .pokemonScale = 401, + .pokemonOffset = -8, + .trainerScale = 256, + .trainerOffset = 1, + }, + { //Slowking + .categoryName = _("ROYAL"), + .height = 20, + .weight = 795, + .descriptionPage1 = DexDescription_Slowking_1, + .descriptionPage2 = DexDescription_Slowking_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 309, + .trainerOffset = 5, + }, + { //Misdreavus + .categoryName = _("SCREECH"), + .height = 7, + .weight = 10, + .descriptionPage1 = DexDescription_Misdreavus_1, + .descriptionPage2 = DexDescription_Misdreavus_2, + .pokemonScale = 407, + .pokemonOffset = -8, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Unown + .categoryName = _("SYMBOL"), + .height = 5, + .weight = 50, + .descriptionPage1 = DexDescription_Unown_1, + .descriptionPage2 = DexDescription_Unown_2, + .pokemonScale = 411, + .pokemonOffset = 2, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Wobbuffet + .categoryName = _("PATIENT"), + .height = 13, + .weight = 285, + .descriptionPage1 = DexDescription_Wobbuffet_1, + .descriptionPage2 = DexDescription_Wobbuffet_2, + .pokemonScale = 274, + .pokemonOffset = 4, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Girafarig + .categoryName = _("LONG NECK"), + .height = 15, + .weight = 415, + .descriptionPage1 = DexDescription_Girafarig_1, + .descriptionPage2 = DexDescription_Girafarig_2, + .pokemonScale = 281, + .pokemonOffset = 1, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Pineco + .categoryName = _("BAGWORM"), + .height = 6, + .weight = 72, + .descriptionPage1 = DexDescription_Pineco_1, + .descriptionPage2 = DexDescription_Pineco_2, + .pokemonScale = 445, + .pokemonOffset = 2, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Forretress + .categoryName = _("BAGWORM"), + .height = 12, + .weight = 1258, + .descriptionPage1 = DexDescription_Forretress_1, + .descriptionPage2 = DexDescription_Forretress_2, + .pokemonScale = 293, + .pokemonOffset = 5, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Dunsparce + .categoryName = _("LAND SNAKE"), + .height = 15, + .weight = 140, + .descriptionPage1 = DexDescription_Dunsparce_1, + .descriptionPage2 = DexDescription_Dunsparce_2, + .pokemonScale = 316, + .pokemonOffset = 17, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Gligar + .categoryName = _("FLYSCORPION"), + .height = 11, + .weight = 648, + .descriptionPage1 = DexDescription_Gligar_1, + .descriptionPage2 = DexDescription_Gligar_2, + .pokemonScale = 350, + .pokemonOffset = -1, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Steelix + .categoryName = _("IRON SNAKE"), + .height = 92, + .weight = 4000, + .descriptionPage1 = DexDescription_Steelix_1, + .descriptionPage2 = DexDescription_Steelix_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 516, + .trainerOffset = 13, + }, + { //Snubbull + .categoryName = _("FAIRY"), + .height = 6, + .weight = 78, + .descriptionPage1 = DexDescription_Snubbull_1, + .descriptionPage2 = DexDescription_Snubbull_2, + .pokemonScale = 465, + .pokemonOffset = 19, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Granbull + .categoryName = _("FAIRY"), + .height = 14, + .weight = 487, + .descriptionPage1 = DexDescription_Granbull_1, + .descriptionPage2 = DexDescription_Granbull_2, + .pokemonScale = 256, + .pokemonOffset = 4, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Qwilfish + .categoryName = _("BALLOON"), + .height = 5, + .weight = 39, + .descriptionPage1 = DexDescription_Qwilfish_1, + .descriptionPage2 = DexDescription_Qwilfish_2, + .pokemonScale = 430, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Scizor + .categoryName = _("PINCER"), + .height = 18, + .weight = 1180, + .descriptionPage1 = DexDescription_Scizor_1, + .descriptionPage2 = DexDescription_Scizor_2, + .pokemonScale = 278, + .pokemonOffset = 1, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Shuckle + .categoryName = _("MOLD"), + .height = 6, + .weight = 205, + .descriptionPage1 = DexDescription_Shuckle_1, + .descriptionPage2 = DexDescription_Shuckle_2, + .pokemonScale = 485, + .pokemonOffset = 18, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Heracross + .categoryName = _("SINGLE HORN"), + .height = 15, + .weight = 540, + .descriptionPage1 = DexDescription_Heracross_1, + .descriptionPage2 = DexDescription_Heracross_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Sneasel + .categoryName = _("SHARP CLAW"), + .height = 9, + .weight = 280, + .descriptionPage1 = DexDescription_Sneasel_1, + .descriptionPage2 = DexDescription_Sneasel_2, + .pokemonScale = 413, + .pokemonOffset = -3, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Teddiursa + .categoryName = _("LITTLE BEAR"), + .height = 6, + .weight = 88, + .descriptionPage1 = DexDescription_Teddiursa_1, + .descriptionPage2 = DexDescription_Teddiursa_2, + .pokemonScale = 455, + .pokemonOffset = 19, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Ursaring + .categoryName = _("HIBERNATOR"), + .height = 18, + .weight = 1258, + .descriptionPage1 = DexDescription_Ursaring_1, + .descriptionPage2 = DexDescription_Ursaring_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Slugma + .categoryName = _("LAVA"), + .height = 7, + .weight = 350, + .descriptionPage1 = DexDescription_Slugma_1, + .descriptionPage2 = DexDescription_Slugma_2, + .pokemonScale = 329, + .pokemonOffset = 15, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Magcargo + .categoryName = _("LAVA"), + .height = 8, + .weight = 550, + .descriptionPage1 = DexDescription_Magcargo_1, + .descriptionPage2 = DexDescription_Magcargo_2, + .pokemonScale = 332, + .pokemonOffset = 15, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Swinub + .categoryName = _("PIG"), + .height = 4, + .weight = 65, + .descriptionPage1 = DexDescription_Swinub_1, + .descriptionPage2 = DexDescription_Swinub_2, + .pokemonScale = 324, + .pokemonOffset = 20, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Piloswine + .categoryName = _("SWINE"), + .height = 11, + .weight = 558, + .descriptionPage1 = DexDescription_Piloswine_1, + .descriptionPage2 = DexDescription_Piloswine_2, + .pokemonScale = 306, + .pokemonOffset = 10, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Corsola + .categoryName = _("CORAL"), + .height = 6, + .weight = 50, + .descriptionPage1 = DexDescription_Corsola_1, + .descriptionPage2 = DexDescription_Corsola_2, + .pokemonScale = 410, + .pokemonOffset = 15, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Remoraid + .categoryName = _("JET"), + .height = 6, + .weight = 120, + .descriptionPage1 = DexDescription_Remoraid_1, + .descriptionPage2 = DexDescription_Remoraid_2, + .pokemonScale = 316, + .pokemonOffset = 4, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Octillery + .categoryName = _("JET"), + .height = 9, + .weight = 285, + .descriptionPage1 = DexDescription_Octillery_1, + .descriptionPage2 = DexDescription_Octillery_2, + .pokemonScale = 296, + .pokemonOffset = 3, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Delibird + .categoryName = _("DELIVERY"), + .height = 9, + .weight = 160, + .descriptionPage1 = DexDescription_Delibird_1, + .descriptionPage2 = DexDescription_Delibird_2, + .pokemonScale = 293, + .pokemonOffset = 11, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Mantine + .categoryName = _("KITE"), + .height = 21, + .weight = 2200, + .descriptionPage1 = DexDescription_Mantine_1, + .descriptionPage2 = DexDescription_Mantine_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 342, + .trainerOffset = 7, + }, + { //Skarmory + .categoryName = _("ARMOR BIRD"), + .height = 17, + .weight = 505, + .descriptionPage1 = DexDescription_Skarmory_1, + .descriptionPage2 = DexDescription_Skarmory_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 271, + .trainerOffset = 1, + }, + { //Houndour + .categoryName = _("DARK"), + .height = 6, + .weight = 108, + .descriptionPage1 = DexDescription_Houndour_1, + .descriptionPage2 = DexDescription_Houndour_2, + .pokemonScale = 393, + .pokemonOffset = 16, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Houndoom + .categoryName = _("DARK"), + .height = 14, + .weight = 350, + .descriptionPage1 = DexDescription_Houndoom_1, + .descriptionPage2 = DexDescription_Houndoom_2, + .pokemonScale = 256, + .pokemonOffset = 4, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Kingdra + .categoryName = _("DRAGON"), + .height = 18, + .weight = 1520, + .descriptionPage1 = DexDescription_Kingdra_1, + .descriptionPage2 = DexDescription_Kingdra_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 287, + .trainerOffset = 0, + }, + { //Phanpy + .categoryName = _("LONG NOSE"), + .height = 5, + .weight = 335, + .descriptionPage1 = DexDescription_Phanpy_1, + .descriptionPage2 = DexDescription_Phanpy_2, + .pokemonScale = 465, + .pokemonOffset = 21, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Donphan + .categoryName = _("ARMOR"), + .height = 11, + .weight = 1200, + .descriptionPage1 = DexDescription_Donphan_1, + .descriptionPage2 = DexDescription_Donphan_2, + .pokemonScale = 313, + .pokemonOffset = 9, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Porygon2 + .categoryName = _("VIRTUAL"), + .height = 6, + .weight = 325, + .descriptionPage1 = DexDescription_Porygon2_1, + .descriptionPage2 = DexDescription_Porygon2_2, + .pokemonScale = 320, + .pokemonOffset = 17, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Stantler + .categoryName = _("BIG HORN"), + .height = 14, + .weight = 712, + .descriptionPage1 = DexDescription_Stantler_1, + .descriptionPage2 = DexDescription_Stantler_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Smeargle + .categoryName = _("PAINTER"), + .height = 12, + .weight = 580, + .descriptionPage1 = DexDescription_Smeargle_1, + .descriptionPage2 = DexDescription_Smeargle_2, + .pokemonScale = 287, + .pokemonOffset = 5, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Tyrogue + .categoryName = _("SCUFFLE"), + .height = 7, + .weight = 210, + .descriptionPage1 = DexDescription_Tyrogue_1, + .descriptionPage2 = DexDescription_Tyrogue_2, + .pokemonScale = 292, + .pokemonOffset = 9, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Hitmontop + .categoryName = _("HANDSTAND"), + .height = 14, + .weight = 480, + .descriptionPage1 = DexDescription_Hitmontop_1, + .descriptionPage2 = DexDescription_Hitmontop_2, + .pokemonScale = 256, + .pokemonOffset = 2, + .trainerScale = 257, + .trainerOffset = 0, + }, + { //Smoochum + .categoryName = _("KISS"), + .height = 4, + .weight = 60, + .descriptionPage1 = DexDescription_Smoochum_1, + .descriptionPage2 = DexDescription_Smoochum_2, + .pokemonScale = 440, + .pokemonOffset = 20, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Elekid + .categoryName = _("ELECTRIC"), + .height = 6, + .weight = 235, + .descriptionPage1 = DexDescription_Elekid_1, + .descriptionPage2 = DexDescription_Elekid_2, + .pokemonScale = 363, + .pokemonOffset = 14, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Magby + .categoryName = _("LIVE COAL"), + .height = 7, + .weight = 214, + .descriptionPage1 = DexDescription_Magby_1, + .descriptionPage2 = DexDescription_Magby_2, + .pokemonScale = 284, + .pokemonOffset = 13, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Miltank + .categoryName = _("MILK COW"), + .height = 12, + .weight = 755, + .descriptionPage1 = DexDescription_Miltank_1, + .descriptionPage2 = DexDescription_Miltank_2, + .pokemonScale = 280, + .pokemonOffset = 5, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Blissey + .categoryName = _("HAPPINESS"), + .height = 15, + .weight = 468, + .descriptionPage1 = DexDescription_Blissey_1, + .descriptionPage2 = DexDescription_Blissey_2, + .pokemonScale = 256, + .pokemonOffset = 4, + .trainerScale = 310, + .trainerOffset = 3, + }, + { //Raikou + .categoryName = _("THUNDER"), + .height = 19, + .weight = 1780, + .descriptionPage1 = DexDescription_Raikou_1, + .descriptionPage2 = DexDescription_Raikou_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 345, + .trainerOffset = 7, + }, + { //Entei + .categoryName = _("VOLCANO"), + .height = 21, + .weight = 1980, + .descriptionPage1 = DexDescription_Entei_1, + .descriptionPage2 = DexDescription_Entei_2, + .pokemonScale = 259, + .pokemonOffset = 0, + .trainerScale = 345, + .trainerOffset = 7, + }, + { //Suicune + .categoryName = _("AURORA"), + .height = 20, + .weight = 1870, + .descriptionPage1 = DexDescription_Suicune_1, + .descriptionPage2 = DexDescription_Suicune_2, + .pokemonScale = 269, + .pokemonOffset = 0, + .trainerScale = 345, + .trainerOffset = 7, + }, + { //Larvitar + .categoryName = _("ROCK SKIN"), + .height = 6, + .weight = 720, + .descriptionPage1 = DexDescription_Larvitar_1, + .descriptionPage2 = DexDescription_Larvitar_2, + .pokemonScale = 472, + .pokemonOffset = 18, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Pupitar + .categoryName = _("HARD SHELL"), + .height = 12, + .weight = 1520, + .descriptionPage1 = DexDescription_Pupitar_1, + .descriptionPage2 = DexDescription_Pupitar_2, + .pokemonScale = 292, + .pokemonOffset = 8, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Tyranitar + .categoryName = _("ARMOR"), + .height = 20, + .weight = 2020, + .descriptionPage1 = DexDescription_Tyranitar_1, + .descriptionPage2 = DexDescription_Tyranitar_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 345, + .trainerOffset = 7, + }, + { //Lugia + .categoryName = _("DIVING"), + .height = 52, + .weight = 2160, + .descriptionPage1 = DexDescription_Lugia_1, + .descriptionPage2 = DexDescription_Lugia_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 721, + .trainerOffset = 19, + }, + { //HoOh + .categoryName = _("RAINBOW"), + .height = 38, + .weight = 1990, + .descriptionPage1 = DexDescription_HoOh_1, + .descriptionPage2 = DexDescription_HoOh_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 610, + .trainerOffset = 17, + }, + { //Celebi + .categoryName = _("TIME TRAVEL"), + .height = 6, + .weight = 50, + .descriptionPage1 = DexDescription_Celebi_1, + .descriptionPage2 = DexDescription_Celebi_2, + .pokemonScale = 393, + .pokemonOffset = -10, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Treecko + .categoryName = _("WOOD GECKO"), + .height = 5, + .weight = 50, + .descriptionPage1 = DexDescription_Treecko_1, + .descriptionPage2 = DexDescription_Treecko_2, + .pokemonScale = 541, + .pokemonOffset = 19, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Grovyle + .categoryName = _("WOOD GECKO"), + .height = 9, + .weight = 216, + .descriptionPage1 = DexDescription_Grovyle_1, + .descriptionPage2 = DexDescription_Grovyle_2, + .pokemonScale = 360, + .pokemonOffset = 5, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Sceptile + .categoryName = _("FOREST"), + .height = 17, + .weight = 522, + .descriptionPage1 = DexDescription_Sceptile_1, + .descriptionPage2 = DexDescription_Sceptile_2, + .pokemonScale = 256, + .pokemonOffset = -1, + .trainerScale = 275, + .trainerOffset = 2, + }, + { //Torchic + .categoryName = _("CHICK"), + .height = 4, + .weight = 25, + .descriptionPage1 = DexDescription_Torchic_1, + .descriptionPage2 = DexDescription_Torchic_2, + .pokemonScale = 566, + .pokemonOffset = 19, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Combusken + .categoryName = _("YOUNG FOWL"), + .height = 9, + .weight = 195, + .descriptionPage1 = DexDescription_Combusken_1, + .descriptionPage2 = DexDescription_Combusken_2, + .pokemonScale = 343, + .pokemonOffset = 5, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Blaziken + .categoryName = _("BLAZE"), + .height = 19, + .weight = 520, + .descriptionPage1 = DexDescription_Blaziken_1, + .descriptionPage2 = DexDescription_Blaziken_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 301, + .trainerOffset = 4, + }, + { //Mudkip + .categoryName = _("MUD FISH"), + .height = 4, + .weight = 76, + .descriptionPage1 = DexDescription_Mudkip_1, + .descriptionPage2 = DexDescription_Mudkip_2, + .pokemonScale = 535, + .pokemonOffset = 20, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Marshtomp + .categoryName = _("MUD FISH"), + .height = 7, + .weight = 280, + .descriptionPage1 = DexDescription_Marshtomp_1, + .descriptionPage2 = DexDescription_Marshtomp_2, + .pokemonScale = 340, + .pokemonOffset = 7, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Swampert + .categoryName = _("MUD FISH"), + .height = 15, + .weight = 819, + .descriptionPage1 = DexDescription_Swampert_1, + .descriptionPage2 = DexDescription_Swampert_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Poochyena + .categoryName = _("BITE"), + .height = 5, + .weight = 136, + .descriptionPage1 = DexDescription_Poochyena_1, + .descriptionPage2 = DexDescription_Poochyena_2, + .pokemonScale = 481, + .pokemonOffset = 19, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Mightyena + .categoryName = _("BITE"), + .height = 10, + .weight = 370, + .descriptionPage1 = DexDescription_Mightyena_1, + .descriptionPage2 = DexDescription_Mightyena_2, + .pokemonScale = 362, + .pokemonOffset = 9, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Zigzagoon + .categoryName = _("TINYRACCOON"), + .height = 4, + .weight = 175, + .descriptionPage1 = DexDescription_Zigzagoon_1, + .descriptionPage2 = DexDescription_Zigzagoon_2, + .pokemonScale = 560, + .pokemonOffset = 22, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Linoone + .categoryName = _("RUSHING"), + .height = 5, + .weight = 325, + .descriptionPage1 = DexDescription_Linoone_1, + .descriptionPage2 = DexDescription_Linoone_2, + .pokemonScale = 321, + .pokemonOffset = 7, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Wurmple + .categoryName = _("WORM"), + .height = 3, + .weight = 36, + .descriptionPage1 = DexDescription_Wurmple_1, + .descriptionPage2 = DexDescription_Wurmple_2, + .pokemonScale = 711, + .pokemonOffset = 24, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Silcoon + .categoryName = _("COCOON"), + .height = 6, + .weight = 100, + .descriptionPage1 = DexDescription_Silcoon_1, + .descriptionPage2 = DexDescription_Silcoon_2, + .pokemonScale = 431, + .pokemonOffset = 19, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Beautifly + .categoryName = _("BUTTERFLY"), + .height = 10, + .weight = 284, + .descriptionPage1 = DexDescription_Beautifly_1, + .descriptionPage2 = DexDescription_Beautifly_2, + .pokemonScale = 298, + .pokemonOffset = -1, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Cascoon + .categoryName = _("COCOON"), + .height = 7, + .weight = 115, + .descriptionPage1 = DexDescription_Cascoon_1, + .descriptionPage2 = DexDescription_Cascoon_2, + .pokemonScale = 391, + .pokemonOffset = 20, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Dustox + .categoryName = _("POISON MOTH"), + .height = 12, + .weight = 316, + .descriptionPage1 = DexDescription_Dustox_1, + .descriptionPage2 = DexDescription_Dustox_2, + .pokemonScale = 269, + .pokemonOffset = 1, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Lotad + .categoryName = _("WATER WEED"), + .height = 5, + .weight = 26, + .descriptionPage1 = DexDescription_Lotad_1, + .descriptionPage2 = DexDescription_Lotad_2, + .pokemonScale = 406, + .pokemonOffset = 19, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Lombre + .categoryName = _("JOLLY"), + .height = 12, + .weight = 325, + .descriptionPage1 = DexDescription_Lombre_1, + .descriptionPage2 = DexDescription_Lombre_2, + .pokemonScale = 277, + .pokemonOffset = 9, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Ludicolo + .categoryName = _("CAREFREE"), + .height = 15, + .weight = 550, + .descriptionPage1 = DexDescription_Ludicolo_1, + .descriptionPage2 = DexDescription_Ludicolo_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 268, + .trainerOffset = -1, + }, + { //Seedot + .categoryName = _("ACORN"), + .height = 5, + .weight = 40, + .descriptionPage1 = DexDescription_Seedot_1, + .descriptionPage2 = DexDescription_Seedot_2, + .pokemonScale = 472, + .pokemonOffset = 20, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Nuzleaf + .categoryName = _("WILY"), + .height = 10, + .weight = 280, + .descriptionPage1 = DexDescription_Nuzleaf_1, + .descriptionPage2 = DexDescription_Nuzleaf_2, + .pokemonScale = 299, + .pokemonOffset = 10, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Shiftry + .categoryName = _("WICKED"), + .height = 13, + .weight = 596, + .descriptionPage1 = DexDescription_Shiftry_1, + .descriptionPage2 = DexDescription_Shiftry_2, + .pokemonScale = 290, + .pokemonOffset = 4, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Taillow + .categoryName = _("TINYSWALLOW"), + .height = 3, + .weight = 23, + .descriptionPage1 = DexDescription_Taillow_1, + .descriptionPage2 = DexDescription_Taillow_2, + .pokemonScale = 465, + .pokemonOffset = 21, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Swellow + .categoryName = _("SWALLOW"), + .height = 7, + .weight = 198, + .descriptionPage1 = DexDescription_Swellow_1, + .descriptionPage2 = DexDescription_Swellow_2, + .pokemonScale = 428, + .pokemonOffset = 15, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Wingull + .categoryName = _("SEAGULL"), + .height = 6, + .weight = 95, + .descriptionPage1 = DexDescription_Wingull_1, + .descriptionPage2 = DexDescription_Wingull_2, + .pokemonScale = 295, + .pokemonOffset = -2, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Pelipper + .categoryName = _("WATER BIRD"), + .height = 12, + .weight = 280, + .descriptionPage1 = DexDescription_Pelipper_1, + .descriptionPage2 = DexDescription_Pelipper_2, + .pokemonScale = 288, + .pokemonOffset = 1, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Ralts + .categoryName = _("FEELING"), + .height = 4, + .weight = 66, + .descriptionPage1 = DexDescription_Ralts_1, + .descriptionPage2 = DexDescription_Ralts_2, + .pokemonScale = 457, + .pokemonOffset = -3, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Kirlia + .categoryName = _("EMOTION"), + .height = 8, + .weight = 202, + .descriptionPage1 = DexDescription_Kirlia_1, + .descriptionPage2 = DexDescription_Kirlia_2, + .pokemonScale = 354, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Gardevoir + .categoryName = _("EMBRACE"), + .height = 16, + .weight = 484, + .descriptionPage1 = DexDescription_Gardevoir_1, + .descriptionPage2 = DexDescription_Gardevoir_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Surskit + .categoryName = _("POND SKATER"), + .height = 5, + .weight = 17, + .descriptionPage1 = DexDescription_Surskit_1, + .descriptionPage2 = DexDescription_Surskit_2, + .pokemonScale = 375, + .pokemonOffset = 17, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Masquerain + .categoryName = _("EYEBALL"), + .height = 8, + .weight = 36, + .descriptionPage1 = DexDescription_Masquerain_1, + .descriptionPage2 = DexDescription_Masquerain_2, + .pokemonScale = 378, + .pokemonOffset = 8, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Shroomish + .categoryName = _("MUSHROOM"), + .height = 4, + .weight = 45, + .descriptionPage1 = DexDescription_Shroomish_1, + .descriptionPage2 = DexDescription_Shroomish_2, + .pokemonScale = 513, + .pokemonOffset = 22, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Breloom + .categoryName = _("MUSHROOM"), + .height = 12, + .weight = 392, + .descriptionPage1 = DexDescription_Breloom_1, + .descriptionPage2 = DexDescription_Breloom_2, + .pokemonScale = 324, + .pokemonOffset = 6, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Slakoth + .categoryName = _("SLACKER"), + .height = 8, + .weight = 240, + .descriptionPage1 = DexDescription_Slakoth_1, + .descriptionPage2 = DexDescription_Slakoth_2, + .pokemonScale = 291, + .pokemonOffset = 16, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Vigoroth + .categoryName = _("WILD MONKEY"), + .height = 14, + .weight = 465, + .descriptionPage1 = DexDescription_Vigoroth_1, + .descriptionPage2 = DexDescription_Vigoroth_2, + .pokemonScale = 301, + .pokemonOffset = 2, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Slaking + .categoryName = _("LAZY"), + .height = 20, + .weight = 1305, + .descriptionPage1 = DexDescription_Slaking_1, + .descriptionPage2 = DexDescription_Slaking_2, + .pokemonScale = 256, + .pokemonOffset = 2, + .trainerScale = 300, + .trainerOffset = 1, + }, + { //Nincada + .categoryName = _("TRAINEE"), + .height = 5, + .weight = 55, + .descriptionPage1 = DexDescription_Nincada_1, + .descriptionPage2 = DexDescription_Nincada_2, + .pokemonScale = 405, + .pokemonOffset = 21, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Ninjask + .categoryName = _("NINJA"), + .height = 8, + .weight = 120, + .descriptionPage1 = DexDescription_Ninjask_1, + .descriptionPage2 = DexDescription_Ninjask_2, + .pokemonScale = 383, + .pokemonOffset = -9, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Shedinja + .categoryName = _("SHED"), + .height = 8, + .weight = 12, + .descriptionPage1 = DexDescription_Shedinja_1, + .descriptionPage2 = DexDescription_Shedinja_2, + .pokemonScale = 372, + .pokemonOffset = -8, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Whismur + .categoryName = _("WHISPER"), + .height = 6, + .weight = 163, + .descriptionPage1 = DexDescription_Whismur_1, + .descriptionPage2 = DexDescription_Whismur_2, + .pokemonScale = 373, + .pokemonOffset = 17, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Loudred + .categoryName = _("BIG VOICE"), + .height = 10, + .weight = 405, + .descriptionPage1 = DexDescription_Loudred_1, + .descriptionPage2 = DexDescription_Loudred_2, + .pokemonScale = 356, + .pokemonOffset = 10, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Exploud + .categoryName = _("LOUD NOISE"), + .height = 15, + .weight = 840, + .descriptionPage1 = DexDescription_Exploud_1, + .descriptionPage2 = DexDescription_Exploud_2, + .pokemonScale = 284, + .pokemonOffset = 1, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Makuhita + .categoryName = _("GUTS"), + .height = 10, + .weight = 864, + .descriptionPage1 = DexDescription_Makuhita_1, + .descriptionPage2 = DexDescription_Makuhita_2, + .pokemonScale = 256, + .pokemonOffset = 10, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Hariyama + .categoryName = _("ARM THRUST"), + .height = 23, + .weight = 2538, + .descriptionPage1 = DexDescription_Hariyama_1, + .descriptionPage2 = DexDescription_Hariyama_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 343, + .trainerOffset = 7, + }, + { //Azurill + .categoryName = _("POLKA DOT"), + .height = 2, + .weight = 20, + .descriptionPage1 = DexDescription_Azurill_1, + .descriptionPage2 = DexDescription_Azurill_2, + .pokemonScale = 603, + .pokemonOffset = 23, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Nosepass + .categoryName = _("COMPASS"), + .height = 10, + .weight = 970, + .descriptionPage1 = DexDescription_Nosepass_1, + .descriptionPage2 = DexDescription_Nosepass_2, + .pokemonScale = 256, + .pokemonOffset = 9, + .trainerScale = 289, + .trainerOffset = 3, + }, + { //Skitty + .categoryName = _("KITTEN"), + .height = 6, + .weight = 110, + .descriptionPage1 = DexDescription_Skitty_1, + .descriptionPage2 = DexDescription_Skitty_2, + .pokemonScale = 492, + .pokemonOffset = 19, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Delcatty + .categoryName = _("PRIM"), + .height = 11, + .weight = 326, + .descriptionPage1 = DexDescription_Delcatty_1, + .descriptionPage2 = DexDescription_Delcatty_2, + .pokemonScale = 322, + .pokemonOffset = 10, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Sableye + .categoryName = _("DARKNESS"), + .height = 5, + .weight = 110, + .descriptionPage1 = DexDescription_Sableye_1, + .descriptionPage2 = DexDescription_Sableye_2, + .pokemonScale = 451, + .pokemonOffset = 17, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Mawile + .categoryName = _("DECEIVER"), + .height = 6, + .weight = 115, + .descriptionPage1 = DexDescription_Mawile_1, + .descriptionPage2 = DexDescription_Mawile_2, + .pokemonScale = 466, + .pokemonOffset = 17, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Aron + .categoryName = _("IRON ARMOR"), + .height = 4, + .weight = 600, + .descriptionPage1 = DexDescription_Aron_1, + .descriptionPage2 = DexDescription_Aron_2, + .pokemonScale = 419, + .pokemonOffset = 23, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Lairon + .categoryName = _("IRON ARMOR"), + .height = 9, + .weight = 1200, + .descriptionPage1 = DexDescription_Lairon_1, + .descriptionPage2 = DexDescription_Lairon_2, + .pokemonScale = 275, + .pokemonOffset = 12, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Aggron + .categoryName = _("IRON ARMOR"), + .height = 21, + .weight = 3600, + .descriptionPage1 = DexDescription_Aggron_1, + .descriptionPage2 = DexDescription_Aggron_2, + .pokemonScale = 256, + .pokemonOffset = -1, + .trainerScale = 350, + .trainerOffset = 6, + }, + { //Meditite + .categoryName = _("MEDITATE"), + .height = 6, + .weight = 112, + .descriptionPage1 = DexDescription_Meditite_1, + .descriptionPage2 = DexDescription_Meditite_2, + .pokemonScale = 465, + .pokemonOffset = 17, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Medicham + .categoryName = _("MEDITATE"), + .height = 13, + .weight = 315, + .descriptionPage1 = DexDescription_Medicham_1, + .descriptionPage2 = DexDescription_Medicham_2, + .pokemonScale = 298, + .pokemonOffset = 5, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Electrike + .categoryName = _("LIGHTNING"), + .height = 6, + .weight = 152, + .descriptionPage1 = DexDescription_Electrike_1, + .descriptionPage2 = DexDescription_Electrike_2, + .pokemonScale = 290, + .pokemonOffset = 15, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Manectric + .categoryName = _("DISCHARGE"), + .height = 15, + .weight = 402, + .descriptionPage1 = DexDescription_Manectric_1, + .descriptionPage2 = DexDescription_Manectric_2, + .pokemonScale = 256, + .pokemonOffset = 3, + .trainerScale = 257, + .trainerOffset = 0, + }, + { //Plusle + .categoryName = _("CHEERING"), + .height = 4, + .weight = 42, + .descriptionPage1 = DexDescription_Plusle_1, + .descriptionPage2 = DexDescription_Plusle_2, + .pokemonScale = 515, + .pokemonOffset = -9, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Minun + .categoryName = _("CHEERING"), + .height = 4, + .weight = 42, + .descriptionPage1 = DexDescription_Minun_1, + .descriptionPage2 = DexDescription_Minun_2, + .pokemonScale = 512, + .pokemonOffset = -7, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Volbeat + .categoryName = _("FIREFLY"), + .height = 7, + .weight = 177, + .descriptionPage1 = DexDescription_Volbeat_1, + .descriptionPage2 = DexDescription_Volbeat_2, + .pokemonScale = 442, + .pokemonOffset = 16, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Illumise + .categoryName = _("FIREFLY"), + .height = 6, + .weight = 177, + .descriptionPage1 = DexDescription_Illumise_1, + .descriptionPage2 = DexDescription_Illumise_2, + .pokemonScale = 572, + .pokemonOffset = 19, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Roselia + .categoryName = _("THORN"), + .height = 3, + .weight = 20, + .descriptionPage1 = DexDescription_Roselia_1, + .descriptionPage2 = DexDescription_Roselia_2, + .pokemonScale = 677, + .pokemonOffset = 20, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Gulpin + .categoryName = _("STOMACH"), + .height = 4, + .weight = 103, + .descriptionPage1 = DexDescription_Gulpin_1, + .descriptionPage2 = DexDescription_Gulpin_2, + .pokemonScale = 593, + .pokemonOffset = 23, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Swalot + .categoryName = _("POISON BAG"), + .height = 17, + .weight = 800, + .descriptionPage1 = DexDescription_Swalot_1, + .descriptionPage2 = DexDescription_Swalot_2, + .pokemonScale = 256, + .pokemonOffset = 6, + .trainerScale = 345, + .trainerOffset = 3, + }, + { //Carvanha + .categoryName = _("SAVAGE"), + .height = 8, + .weight = 208, + .descriptionPage1 = DexDescription_Carvanha_1, + .descriptionPage2 = DexDescription_Carvanha_2, + .pokemonScale = 362, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Sharpedo + .categoryName = _("BRUTAL"), + .height = 18, + .weight = 888, + .descriptionPage1 = DexDescription_Sharpedo_1, + .descriptionPage2 = DexDescription_Sharpedo_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 317, + .trainerOffset = 3, + }, + { //Wailmer + .categoryName = _("BALL WHALE"), + .height = 20, + .weight = 1300, + .descriptionPage1 = DexDescription_Wailmer_1, + .descriptionPage2 = DexDescription_Wailmer_2, + .pokemonScale = 256, + .pokemonOffset = 2, + .trainerScale = 493, + .trainerOffset = 0, + }, + { //Wailord + .categoryName = _("FLOAT WHALE"), + .height = 145, + .weight = 3980, + .descriptionPage1 = DexDescription_Wailord_1, + .descriptionPage2 = DexDescription_Wailord_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 1352, + .trainerOffset = 18, + }, + { //Numel + .categoryName = _("NUMB"), + .height = 7, + .weight = 240, + .descriptionPage1 = DexDescription_Numel_1, + .descriptionPage2 = DexDescription_Numel_2, + .pokemonScale = 342, + .pokemonOffset = 17, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Camerupt + .categoryName = _("ERUPTION"), + .height = 19, + .weight = 2200, + .descriptionPage1 = DexDescription_Camerupt_1, + .descriptionPage2 = DexDescription_Camerupt_2, + .pokemonScale = 256, + .pokemonOffset = 7, + .trainerScale = 345, + .trainerOffset = 6, + }, + { //Torkoal + .categoryName = _("COAL"), + .height = 5, + .weight = 804, + .descriptionPage1 = DexDescription_Torkoal_1, + .descriptionPage2 = DexDescription_Torkoal_2, + .pokemonScale = 390, + .pokemonOffset = 9, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Spoink + .categoryName = _("BOUNCE"), + .height = 7, + .weight = 306, + .descriptionPage1 = DexDescription_Spoink_1, + .descriptionPage2 = DexDescription_Spoink_2, + .pokemonScale = 423, + .pokemonOffset = 17, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Grumpig + .categoryName = _("MANIPULATE"), + .height = 9, + .weight = 715, + .descriptionPage1 = DexDescription_Grumpig_1, + .descriptionPage2 = DexDescription_Grumpig_2, + .pokemonScale = 358, + .pokemonOffset = 10, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Spinda + .categoryName = _("SPOT PANDA"), + .height = 11, + .weight = 50, + .descriptionPage1 = DexDescription_Spinda_1, + .descriptionPage2 = DexDescription_Spinda_2, + .pokemonScale = 321, + .pokemonOffset = 4, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Trapinch + .categoryName = _("ANT PIT"), + .height = 7, + .weight = 150, + .descriptionPage1 = DexDescription_Trapinch_1, + .descriptionPage2 = DexDescription_Trapinch_2, + .pokemonScale = 298, + .pokemonOffset = 17, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Vibrava + .categoryName = _("VIBRATION"), + .height = 11, + .weight = 153, + .descriptionPage1 = DexDescription_Vibrava_1, + .descriptionPage2 = DexDescription_Vibrava_2, + .pokemonScale = 370, + .pokemonOffset = 11, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Flygon + .categoryName = _("MYSTIC"), + .height = 20, + .weight = 820, + .descriptionPage1 = DexDescription_Flygon_1, + .descriptionPage2 = DexDescription_Flygon_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 268, + .trainerOffset = 1, + }, + { //Cacnea + .categoryName = _("CACTUS"), + .height = 4, + .weight = 513, + .descriptionPage1 = DexDescription_Cacnea_1, + .descriptionPage2 = DexDescription_Cacnea_2, + .pokemonScale = 455, + .pokemonOffset = 20, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Cacturne + .categoryName = _("SCARECROW"), + .height = 13, + .weight = 774, + .descriptionPage1 = DexDescription_Cacturne_1, + .descriptionPage2 = DexDescription_Cacturne_2, + .pokemonScale = 327, + .pokemonOffset = 5, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Swablu + .categoryName = _("COTTON BIRD"), + .height = 4, + .weight = 12, + .descriptionPage1 = DexDescription_Swablu_1, + .descriptionPage2 = DexDescription_Swablu_2, + .pokemonScale = 422, + .pokemonOffset = -8, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Altaria + .categoryName = _("HUMMING"), + .height = 11, + .weight = 206, + .descriptionPage1 = DexDescription_Altaria_1, + .descriptionPage2 = DexDescription_Altaria_2, + .pokemonScale = 327, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Zangoose + .categoryName = _("CAT FERRET"), + .height = 13, + .weight = 403, + .descriptionPage1 = DexDescription_Zangoose_1, + .descriptionPage2 = DexDescription_Zangoose_2, + .pokemonScale = 256, + .pokemonOffset = 3, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Seviper + .categoryName = _("FANG SNAKE"), + .height = 27, + .weight = 525, + .descriptionPage1 = DexDescription_Seviper_1, + .descriptionPage2 = DexDescription_Seviper_2, + .pokemonScale = 275, + .pokemonOffset = 7, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Lunatone + .categoryName = _("METEORITE"), + .height = 10, + .weight = 1680, + .descriptionPage1 = DexDescription_Lunatone_1, + .descriptionPage2 = DexDescription_Lunatone_2, + .pokemonScale = 300, + .pokemonOffset = 3, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Solrock + .categoryName = _("METEORITE"), + .height = 12, + .weight = 1540, + .descriptionPage1 = DexDescription_Solrock_1, + .descriptionPage2 = DexDescription_Solrock_2, + .pokemonScale = 328, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Barboach + .categoryName = _("WHISKERS"), + .height = 4, + .weight = 19, + .descriptionPage1 = DexDescription_Barboach_1, + .descriptionPage2 = DexDescription_Barboach_2, + .pokemonScale = 581, + .pokemonOffset = -3, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Whiscash + .categoryName = _("WHISKERS"), + .height = 9, + .weight = 236, + .descriptionPage1 = DexDescription_Whiscash_1, + .descriptionPage2 = DexDescription_Whiscash_2, + .pokemonScale = 317, + .pokemonOffset = 1, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Corphish + .categoryName = _("RUFFIAN"), + .height = 6, + .weight = 115, + .descriptionPage1 = DexDescription_Corphish_1, + .descriptionPage2 = DexDescription_Corphish_2, + .pokemonScale = 484, + .pokemonOffset = 19, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Crawdaunt + .categoryName = _("ROGUE"), + .height = 11, + .weight = 328, + .descriptionPage1 = DexDescription_Crawdaunt_1, + .descriptionPage2 = DexDescription_Crawdaunt_2, + .pokemonScale = 365, + .pokemonOffset = 9, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Baltoy + .categoryName = _("CLAY DOLL"), + .height = 5, + .weight = 215, + .descriptionPage1 = DexDescription_Baltoy_1, + .descriptionPage2 = DexDescription_Baltoy_2, + .pokemonScale = 457, + .pokemonOffset = 21, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Claydol + .categoryName = _("CLAY DOLL"), + .height = 15, + .weight = 1080, + .descriptionPage1 = DexDescription_Claydol_1, + .descriptionPage2 = DexDescription_Claydol_2, + .pokemonScale = 256, + .pokemonOffset = 3, + .trainerScale = 280, + .trainerOffset = 1, + }, + { //Lileep + .categoryName = _("SEA LILY"), + .height = 10, + .weight = 238, + .descriptionPage1 = DexDescription_Lileep_1, + .descriptionPage2 = DexDescription_Lileep_2, + .pokemonScale = 305, + .pokemonOffset = 8, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Cradily + .categoryName = _("BARNACLE"), + .height = 15, + .weight = 604, + .descriptionPage1 = DexDescription_Cradily_1, + .descriptionPage2 = DexDescription_Cradily_2, + .pokemonScale = 267, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Anorith + .categoryName = _("OLD SHRIMP"), + .height = 7, + .weight = 125, + .descriptionPage1 = DexDescription_Anorith_1, + .descriptionPage2 = DexDescription_Anorith_2, + .pokemonScale = 296, + .pokemonOffset = 4, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Armaldo + .categoryName = _("PLATE"), + .height = 15, + .weight = 682, + .descriptionPage1 = DexDescription_Armaldo_1, + .descriptionPage2 = DexDescription_Armaldo_2, + .pokemonScale = 312, + .pokemonOffset = 3, + .trainerScale = 271, + .trainerOffset = 0, + }, + { //Feebas + .categoryName = _("FISH"), + .height = 6, + .weight = 74, + .descriptionPage1 = DexDescription_Feebas_1, + .descriptionPage2 = DexDescription_Feebas_2, + .pokemonScale = 423, + .pokemonOffset = -4, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Milotic + .categoryName = _("TENDER"), + .height = 62, + .weight = 1620, + .descriptionPage1 = DexDescription_Milotic_1, + .descriptionPage2 = DexDescription_Milotic_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 360, + .trainerOffset = 7, + }, + { //Castform + .categoryName = _("WEATHER"), + .height = 3, + .weight = 8, + .descriptionPage1 = DexDescription_Castform_1, + .descriptionPage2 = DexDescription_Castform_2, + .pokemonScale = 435, + .pokemonOffset = -5, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Kecleon + .categoryName = _("COLOR SWAP"), + .height = 10, + .weight = 220, + .descriptionPage1 = DexDescription_Kecleon_1, + .descriptionPage2 = DexDescription_Kecleon_2, + .pokemonScale = 316, + .pokemonOffset = 10, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Shuppet + .categoryName = _("PUPPET"), + .height = 6, + .weight = 23, + .descriptionPage1 = DexDescription_Shuppet_1, + .descriptionPage2 = DexDescription_Shuppet_2, + .pokemonScale = 440, + .pokemonOffset = 20, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Banette + .categoryName = _("MARIONETTE"), + .height = 11, + .weight = 125, + .descriptionPage1 = DexDescription_Banette_1, + .descriptionPage2 = DexDescription_Banette_2, + .pokemonScale = 262, + .pokemonOffset = 9, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Duskull + .categoryName = _("REQUIEM"), + .height = 8, + .weight = 150, + .descriptionPage1 = DexDescription_Duskull_1, + .descriptionPage2 = DexDescription_Duskull_2, + .pokemonScale = 406, + .pokemonOffset = -4, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Dusclops + .categoryName = _("BECKON"), + .height = 16, + .weight = 306, + .descriptionPage1 = DexDescription_Dusclops_1, + .descriptionPage2 = DexDescription_Dusclops_2, + .pokemonScale = 256, + .pokemonOffset = 3, + .trainerScale = 299, + .trainerOffset = 1, + }, + { //Tropius + .categoryName = _("FRUIT"), + .height = 20, + .weight = 1000, + .descriptionPage1 = DexDescription_Tropius_1, + .descriptionPage2 = DexDescription_Tropius_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 344, + .trainerOffset = 7, + }, + { //Chimecho + .categoryName = _("WIND CHIME"), + .height = 6, + .weight = 10, + .descriptionPage1 = DexDescription_Chimecho_1, + .descriptionPage2 = DexDescription_Chimecho_2, + .pokemonScale = 505, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Absol + .categoryName = _("DISASTER"), + .height = 12, + .weight = 470, + .descriptionPage1 = DexDescription_Absol_1, + .descriptionPage2 = DexDescription_Absol_2, + .pokemonScale = 301, + .pokemonOffset = 3, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Wynaut + .categoryName = _("BRIGHT"), + .height = 6, + .weight = 140, + .descriptionPage1 = DexDescription_Wynaut_1, + .descriptionPage2 = DexDescription_Wynaut_2, + .pokemonScale = 484, + .pokemonOffset = 19, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Snorunt + .categoryName = _("SNOW HAT"), + .height = 7, + .weight = 168, + .descriptionPage1 = DexDescription_Snorunt_1, + .descriptionPage2 = DexDescription_Snorunt_2, + .pokemonScale = 380, + .pokemonOffset = 15, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Glalie + .categoryName = _("FACE"), + .height = 15, + .weight = 2565, + .descriptionPage1 = DexDescription_Glalie_1, + .descriptionPage2 = DexDescription_Glalie_2, + .pokemonScale = 256, + .pokemonOffset = 3, + .trainerScale = 344, + .trainerOffset = 0, + }, + { //Spheal + .categoryName = _("CLAP"), + .height = 8, + .weight = 395, + .descriptionPage1 = DexDescription_Spheal_1, + .descriptionPage2 = DexDescription_Spheal_2, + .pokemonScale = 315, + .pokemonOffset = 16, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Sealeo + .categoryName = _("BALL ROLL"), + .height = 11, + .weight = 876, + .descriptionPage1 = DexDescription_Sealeo_1, + .descriptionPage2 = DexDescription_Sealeo_2, + .pokemonScale = 338, + .pokemonOffset = 13, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Walrein + .categoryName = _("ICE BREAK"), + .height = 14, + .weight = 1506, + .descriptionPage1 = DexDescription_Walrein_1, + .descriptionPage2 = DexDescription_Walrein_2, + .pokemonScale = 316, + .pokemonOffset = 4, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Clamperl + .categoryName = _("BIVALVE"), + .height = 4, + .weight = 525, + .descriptionPage1 = DexDescription_Clamperl_1, + .descriptionPage2 = DexDescription_Clamperl_2, + .pokemonScale = 691, + .pokemonOffset = 22, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Huntail + .categoryName = _("DEEP SEA"), + .height = 17, + .weight = 270, + .descriptionPage1 = DexDescription_Huntail_1, + .descriptionPage2 = DexDescription_Huntail_2, + .pokemonScale = 307, + .pokemonOffset = 1, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Gorebyss + .categoryName = _("SOUTH SEA"), + .height = 18, + .weight = 226, + .descriptionPage1 = DexDescription_Gorebyss_1, + .descriptionPage2 = DexDescription_Gorebyss_2, + .pokemonScale = 278, + .pokemonOffset = 5, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Relicanth + .categoryName = _("LONGEVITY"), + .height = 10, + .weight = 234, + .descriptionPage1 = DexDescription_Relicanth_1, + .descriptionPage2 = DexDescription_Relicanth_2, + .pokemonScale = 316, + .pokemonOffset = 7, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Luvdisc + .categoryName = _("RENDEZVOUS"), + .height = 6, + .weight = 87, + .descriptionPage1 = DexDescription_Luvdisc_1, + .descriptionPage2 = DexDescription_Luvdisc_2, + .pokemonScale = 371, + .pokemonOffset = 2, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Bagon + .categoryName = _("ROCK HEAD"), + .height = 6, + .weight = 421, + .descriptionPage1 = DexDescription_Bagon_1, + .descriptionPage2 = DexDescription_Bagon_2, + .pokemonScale = 448, + .pokemonOffset = 18, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Shelgon + .categoryName = _("ENDURANCE"), + .height = 11, + .weight = 1105, + .descriptionPage1 = DexDescription_Shelgon_1, + .descriptionPage2 = DexDescription_Shelgon_2, + .pokemonScale = 311, + .pokemonOffset = 12, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Salamence + .categoryName = _("DRAGON"), + .height = 15, + .weight = 1026, + .descriptionPage1 = DexDescription_Salamence_1, + .descriptionPage2 = DexDescription_Salamence_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Beldum + .categoryName = _("IRON BALL"), + .height = 6, + .weight = 952, + .descriptionPage1 = DexDescription_Beldum_1, + .descriptionPage2 = DexDescription_Beldum_2, + .pokemonScale = 414, + .pokemonOffset = -1, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Metang + .categoryName = _("IRON CLAW"), + .height = 12, + .weight = 2025, + .descriptionPage1 = DexDescription_Metang_1, + .descriptionPage2 = DexDescription_Metang_2, + .pokemonScale = 256, + .pokemonOffset = 6, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Metagross + .categoryName = _("IRON LEG"), + .height = 16, + .weight = 5500, + .descriptionPage1 = DexDescription_Metagross_1, + .descriptionPage2 = DexDescription_Metagross_2, + .pokemonScale = 256, + .pokemonOffset = 4, + .trainerScale = 447, + .trainerOffset = 9, + }, + { //Regirock + .categoryName = _("ROCK PEAK"), + .height = 17, + .weight = 2300, + .descriptionPage1 = DexDescription_Regirock_1, + .descriptionPage2 = DexDescription_Regirock_2, + .pokemonScale = 256, + .pokemonOffset = 2, + .trainerScale = 309, + .trainerOffset = 1, + }, + { //Regice + .categoryName = _("ICEBERG"), + .height = 18, + .weight = 1750, + .descriptionPage1 = DexDescription_Regice_1, + .descriptionPage2 = DexDescription_Regice_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 301, + .trainerOffset = 2, + }, + { //Registeel + .categoryName = _("IRON"), + .height = 19, + .weight = 2050, + .descriptionPage1 = DexDescription_Registeel_1, + .descriptionPage2 = DexDescription_Registeel_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 359, + .trainerOffset = 6, + }, + { //Latias + .categoryName = _("EON"), + .height = 14, + .weight = 400, + .descriptionPage1 = DexDescription_Latias_1, + .descriptionPage2 = DexDescription_Latias_2, + .pokemonScale = 304, + .pokemonOffset = 3, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Latios + .categoryName = _("EON"), + .height = 20, + .weight = 600, + .descriptionPage1 = DexDescription_Latios_1, + .descriptionPage2 = DexDescription_Latios_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 294, + .trainerOffset = 3, + }, + { //Kyogre + .categoryName = _("SEA BASIN"), + .height = 45, + .weight = 3520, + .descriptionPage1 = DexDescription_Kyogre_1, + .descriptionPage2 = DexDescription_Kyogre_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 614, + .trainerOffset = 13, + }, + { //Groudon + .categoryName = _("CONTINENT"), + .height = 35, + .weight = 9500, + .descriptionPage1 = DexDescription_Groudon_1, + .descriptionPage2 = DexDescription_Groudon_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 515, + .trainerOffset = 14, + }, + { //Rayquaza + .categoryName = _("SKY HIGH"), + .height = 70, + .weight = 2065, + .descriptionPage1 = DexDescription_Rayquaza_1, + .descriptionPage2 = DexDescription_Rayquaza_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 448, + .trainerOffset = 12, + }, + { //Jirachi + .categoryName = _("WISH"), + .height = 3, + .weight = 11, + .descriptionPage1 = DexDescription_Jirachi_1, + .descriptionPage2 = DexDescription_Jirachi_2, + .pokemonScale = 608, + .pokemonOffset = -8, + .trainerScale = 256, + .trainerOffset = 0, + }, + { //Deoxys + .categoryName = _("DNA"), + .height = 17, + .weight = 608, + .descriptionPage1 = DexDescription_Deoxys_1, + .descriptionPage2 = DexDescription_Deoxys_2, + .pokemonScale = 256, + .pokemonOffset = 0, + .trainerScale = 290, + .trainerOffset = 2, + }, +}; diff --git a/src/data/pokedex_orders.h b/src/data/pokedex_orders.h new file mode 100644 index 000000000..8abb1acd3 --- /dev/null +++ b/src/data/pokedex_orders.h @@ -0,0 +1,1192 @@ +const u16 gPokedexOrder_Alphabetical[] = +{ + 387, + 388, + 389, + 390, + 391, + 392, + 393, + 394, + 395, + 396, + 397, + 398, + 399, + 400, + 401, + 402, + 403, + 404, + 405, + 406, + 407, + 408, + 409, + 410, + 411, + 63, // Abra + 359, // Absol + 142, // Aerodactyl + 306, // Aggron + 190, // Aipom + 65, // Alakazam + 334, // Altaria + 181, // Ampharos + 347, // Anorith + 24, // Arbok + 59, // Arcanine + 168, // Ariados + 348, // Armaldo + 304, // Aron + 144, // Articuno + 184, // Azumarill + 298, // Azurill + 371, // Bagon + 343, // Baltoy + 354, // Banette + 339, // Barboach + 153, // Bayleef + 267, // Beautifly + 15, // Beedrill + 374, // Beldum + 182, // Bellossom + 69, // Bellsprout + 9, // Blastoise + 257, // Blaziken + 242, // Blissey + 286, // Breloom + 1, // Bulbasaur + 12, // Butterfree + 331, // Cacnea + 332, // Cacturne + 323, // Camerupt + 318, // Carvanha + 268, // Cascoon + 351, // Castform + 10, // Caterpie + 251, // Celebi + 113, // Chansey + 6, // Charizard + 4, // Charmander + 5, // Charmeleon + 152, // Chikorita + 358, // Chimecho + 170, // Chinchou + 366, // Clamperl + 344, // Claydol + 36, // Clefable + 35, // Clefairy + 173, // Cleffa + 91, // Cloyster + 256, // Combusken + 341, // Corphish + 222, // Corsola + 346, // Cradily + 342, // Crawdaunt + 169, // Crobat + 159, // Croconaw + 104, // Cubone + 155, // Cyndaquil + 301, // Delcatty + 225, // Delibird + 386, // Deoxys + 87, // Dewgong + 50, // Diglett + 132, // Ditto + 85, // Dodrio + 84, // Doduo + 232, // Donphan + 148, // Dragonair + 149, // Dragonite + 147, // Dratini + 96, // Drowzee + 51, // Dugtrio + 206, // Dunsparce + 356, // Dusclops + 355, // Duskull + 269, // Dustox + 133, // Eevee + 23, // Ekans + 125, // Electabuzz + 309, // Electrike + 101, // Electrode + 239, // Elekid + 244, // Entei + 196, // Espeon + 102, // Exeggcute + 103, // Exeggutor + 295, // Exploud + 83, // Farfetch’d + 22, // Fearow + 349, // Feebas + 160, // Feraligatr + 180, // Flaaffy + 136, // Flareon + 330, // Flygon + 205, // Forretress + 162, // Furret + 282, // Gardevoir + 92, // Gastly + 94, // Gengar + 74, // Geodude + 203, // Girafarig + 362, // Glalie + 207, // Gligar + 44, // Gloom + 42, // Golbat + 118, // Goldeen + 55, // Golduck + 76, // Golem + 368, // Gorebyss + 210, // Granbull + 75, // Graveler + 88, // Grimer + 383, // Groudon + 253, // Grovyle + 58, // Growlithe + 326, // Grumpig + 316, // Gulpin + 130, // Gyarados + 297, // Hariyama + 93, // Haunter + 214, // Heracross + 107, // Hitmonchan + 106, // Hitmonlee + 237, // Hitmontop + 250, // Ho-Oh + 163, // Hoothoot + 187, // Hoppip + 116, // Horsea + 229, // Houndoom + 228, // Houndour + 367, // Huntail + 97, // Hypno + 174, // Igglybuff + 314, // Illumise + 2, // Ivysaur + 39, // Jigglypuff + 385, // Jirachi + 135, // Jolteon + 189, // Jumpluff + 124, // Jynx + 140, // Kabuto + 141, // Kabutops + 64, // Kadabra + 14, // Kakuna + 115, // Kangaskhan + 352, // Kecleon + 230, // Kingdra + 99, // Kingler + 281, // Kirlia + 109, // Koffing + 98, // Krabby + 382, // Kyogre + 305, // Lairon + 171, // Lanturn + 131, // Lapras + 246, // Larvitar + 380, // Latias + 381, // Latios + 166, // Ledian + 165, // Ledyba + 108, // Lickitung + 345, // Lileep + 264, // Linoone + 271, // Lombre + 270, // Lotad + 294, // Loudred + 272, // Ludicolo + 249, // Lugia + 337, // Lunatone + 370, // Luvdisc + 68, // Machamp + 67, // Machoke + 66, // Machop + 240, // Magby + 219, // Magcargo + 129, // Magikarp + 126, // Magmar + 81, // Magnemite + 82, // Magneton + 296, // Makuhita + 310, // Manectric + 56, // Mankey + 226, // Mantine + 179, // Mareep + 183, // Marill + 105, // Marowak + 259, // Marshtomp + 284, // Masquerain + 303, // Mawile + 308, // Medicham + 307, // Meditite + 154, // Meganium + 52, // Meowth + 376, // Metagross + 375, // Metang + 11, // Metapod + 151, // Mew + 150, // Mewtwo + 262, // Mightyena + 350, // Milotic + 241, // Miltank + 312, // Minun + 200, // Misdreavus + 146, // Moltres + 122, // Mr. mime + 258, // Mudkip + 89, // Muk + 198, // Murkrow + 177, // Natu + 34, // Nidoking + 31, // Nidoqueen + 29, // Nidoran? + 32, // Nidoran? + 30, // Nidorina + 33, // Nidorino + 290, // Nincada + 38, // Ninetales + 291, // Ninjask + 164, // Noctowl + 299, // Nosepass + 322, // Numel + 274, // Nuzleaf + 224, // Octillery + 43, // Oddish + 138, // Omanyte + 139, // Omastar + 95, // Onix + 46, // Paras + 47, // Parasect + 279, // Pelipper + 53, // Persian + 231, // Phanpy + 172, // Pichu + 18, // Pidgeot + 17, // Pidgeotto + 16, // Pidgey + 25, // Pikachu + 221, // Piloswine + 204, // Pineco + 127, // Pinsir + 311, // Plusle + 186, // Politoed + 60, // Poliwag + 61, // Poliwhirl + 62, // Poliwrath + 77, // Ponyta + 261, // Poochyena + 137, // Porygon + 233, // Porygon2 + 57, // Primeape + 54, // Psyduck + 247, // Pupitar + 195, // Quagsire + 156, // Quilava + 211, // Qwilfish + 26, // Raichu + 243, // Raikou + 280, // Ralts + 78, // Rapidash + 20, // Raticate + 19, // Rattata + 384, // Rayquaza + 378, // Regice + 377, // Regirock + 379, // Registeel + 369, // Relicanth + 223, // Remoraid + 112, // Rhydon + 111, // Rhyhorn + 315, // Roselia + 302, // Sableye + 373, // Salamence + 27, // Sandshrew + 28, // Sandslash + 254, // Sceptile + 212, // Scizor + 123, // Scyther + 117, // Seadra + 119, // Seaking + 364, // Sealeo + 273, // Seedot + 86, // Seel + 161, // Sentret + 336, // Seviper + 319, // Sharpedo + 292, // Shedinja + 372, // Shelgon + 90, // Shellder + 275, // Shiftry + 285, // Shroomish + 213, // Shuckle + 353, // Shuppet + 266, // Silcoon + 227, // Skarmory + 188, // Skiploom + 300, // Skitty + 289, // Slaking + 287, // Slakoth + 80, // Slowbro + 199, // Slowking + 79, // Slowpoke + 218, // Slugma + 235, // Smeargle + 238, // Smoochum + 215, // Sneasel + 143, // Snorlax + 361, // Snorunt + 209, // Snubbull + 338, // Solrock + 21, // Spearow + 363, // Spheal + 167, // Spinarak + 327, // Spinda + 325, // Spoink + 7, // Squirtle + 234, // Stantler + 121, // Starmie + 120, // Staryu + 208, // Steelix + 185, // Sudowoodo + 245, // Suicune + 192, // Sunflora + 191, // Sunkern + 283, // Surskit + 333, // Swablu + 317, // Swalot + 260, // Swampert + 277, // Swellow + 220, // Swinub + 276, // Taillow + 114, // Tangela + 128, // Tauros + 216, // Teddiursa + 72, // Tentacool + 73, // Tentacruel + 175, // Togepi + 176, // Togetic + 255, // Torchic + 324, // Torkoal + 158, // Totodile + 328, // Trapinch + 252, // Treecko + 357, // Tropius + 157, // Typhlosion + 248, // Tyranitar + 236, // Tyrogue + 197, // Umbreon + 201, // Unown + 217, // Ursaring + 134, // Vaporeon + 49, // Venomoth + 48, // Venonat + 3, // Venusaur + 329, // Vibrava + 71, // Victreebel + 288, // Vigoroth + 45, // Vileplume + 313, // Volbeat + 100, // Voltorb + 37, // Vulpix + 320, // Wailmer + 321, // Wailord + 365, // Walrein + 8, // Wartortle + 13, // Weedle + 70, // Weepinbell + 110, // Weezing + 340, // Whiscash + 293, // Whismur + 40, // Wigglytuff + 278, // Wingull + 202, // Wobbuffet + 194, // Wooper + 265, // Wurmple + 360, // Wynaut + 178, // Xatu + 193, // Yanma + 335, // Zangoose + 145, // Zapdos + 263, // Zigzagoon + 41, // Zubat +}; +const u16 gPokedexOrder_Weight[] = +{ + 92, // Gastly + 93, // Haunter + 187, // Hoppip + 50, // Diglett + 351, // Castform + 109, // Koffing + 174, // Igglybuff + 200, // Misdreavus + 358, // Chimecho + 188, // Skiploom + 385, // Jirachi + 333, // Swablu + 292, // Shedinja + 175, // Togepi + 283, // Surskit + 16, // Pidgey + 191, // Sunkern + 339, // Barboach + 172, // Pichu + 298, // Azurill + 315, // Roselia + 177, // Natu + 21, // Spearow + 198, // Murkrow + 353, // Shuppet + 276, // Taillow + 102, // Exeggcute + 255, // Torchic + 270, // Lotad + 10, // Caterpie + 189, // Jumpluff + 173, // Cleffa + 13, // Weedle + 176, // Togetic + 147, // Dratini + 19, // Rattata + 284, // Masquerain + 265, // Wurmple + 211, // Qwilfish + 151, // Mew + 90, // Shellder + 273, // Seedot + 132, // Ditto + 69, // Bellsprout + 311, // Plusle + 52, // Meowth + 312, // Minun + 285, // Shroomish + 251, // Celebi + 222, // Corsola + 252, // Treecko + 327, // Spinda + 201, // Unown + 46, // Paras + 43, // Oddish + 39, // Jigglypuff + 290, // Nincada + 182, // Bellossom + 81, // Magnemite + 25, // Pikachu + 238, // Smoochum + 161, // Sentret + 70, // Weepinbell + 152, // Chikorita + 220, // Swinub + 133, // Eevee + 98, // Krabby + 104, // Cubone + 280, // Ralts + 1, // Bulbasaur + 23, // Ekans + 29, // Nidoran? + 204, // Pineco + 349, // Feebas + 138, // Omanyte + 41, // Zubat + 35, // Clefairy + 258, // Mudkip + 209, // Snubbull + 179, // Mareep + 155, // Cyndaquil + 116, // Horsea + 4, // Charmander + 192, // Sunflora + 183, // Marill + 194, // Wooper + 167, // Spinarak + 44, // Gloom + 370, // Luvdisc + 216, // Teddiursa + 32, // Nidoran? + 7, // Squirtle + 278, // Wingull + 158, // Totodile + 110, // Weezing + 37, // Vulpix + 11, // Metapod + 266, // Silcoon + 129, // Magikarp + 14, // Kakuna + 316, // Gulpin + 100, // Voltorb + 165, // Ledyba + 228, // Houndour + 300, // Skitty + 302, // Sableye + 307, // Meditite + 341, // Corphish + 190, // Aipom + 268, // Cascoon + 303, // Mawile + 140, // Kabuto + 40, // Wigglytuff + 27, // Sandshrew + 223, // Remoraid + 291, // Ninjask + 170, // Chinchou + 60, // Poliwag + 347, // Anorith + 49, // Venomoth + 354, // Banette + 2, // Ivysaur + 180, // Flaaffy + 261, // Poochyena + 360, // Wynaut + 206, // Dunsparce + 178, // Xatu + 355, // Duskull + 83, // Farfetch’d + 328, // Trapinch + 118, // Goldeen + 309, // Electrike + 329, // Vibrava + 71, // Victreebel + 153, // Bayleef + 225, // Delibird + 293, // Whismur + 148, // Dragonair + 361, // Snorunt + 263, // Zigzagoon + 314, // Illumise + 313, // Volbeat + 20, // Raticate + 45, // Vileplume + 156, // Quilava + 5, // Charmeleon + 58, // Growlithe + 256, // Combusken + 66, // Machop + 63, // Abra + 33, // Nidorino + 54, // Psyduck + 277, // Swellow + 38, // Ninetales + 30, // Nidorina + 61, // Poliwhirl + 74, // Geodude + 281, // Kirlia + 213, // Shuckle + 334, // Altaria + 318, // Carvanha + 236, // Tyrogue + 163, // Hoothoot + 240, // Magby + 343, // Baltoy + 253, // Grovyle + 352, // Kecleon + 171, // Lanturn + 8, // Wartortle + 368, // Gorebyss + 369, // Relicanth + 239, // Elekid + 340, // Whiscash + 345, // Lileep + 322, // Numel + 287, // Slakoth + 135, // Jolteon + 159, // Croconaw + 136, // Flareon + 117, // Seadra + 196, // Espeon + 367, // Huntail + 197, // Umbreon + 259, // Marshtomp + 274, // Nuzleaf + 215, // Sneasel + 56, // Mankey + 279, // Pelipper + 267, // Beautifly + 224, // Octillery + 184, // Azumarill + 202, // Wobbuffet + 134, // Vaporeon + 28, // Sandslash + 47, // Parasect + 15, // Beedrill + 89, // Muk + 17, // Pidgeotto + 88, // Grimer + 26, // Raichu + 77, // Ponyta + 125, // Electabuzz + 48, // Venonat + 325, // Spoink + 356, // Dusclops + 308, // Medicham + 269, // Dustox + 53, // Persian + 12, // Butterfree + 57, // Primeape + 96, // Drowzee + 162, // Furret + 233, // Porygon2 + 271, // Lombre + 264, // Linoone + 301, // Delcatty + 342, // Crawdaunt + 51, // Dugtrio + 168, // Ariados + 231, // Phanpy + 186, // Politoed + 120, // Staryu + 113, // Chansey + 139, // Omastar + 114, // Tangela + 218, // Slugma + 229, // Houndoom + 166, // Ledian + 79, // Slowpoke + 137, // Porygon + 262, // Mightyena + 193, // Yanma + 22, // Fearow + 185, // Sudowoodo + 119, // Seaking + 286, // Breloom + 84, // Doduo + 18, // Pidgeot + 363, // Spheal + 36, // Clefable + 380, // Latias + 310, // Manectric + 335, // Zangoose + 141, // Kabutops + 94, // Gengar + 294, // Loudred + 124, // Jynx + 164, // Noctowl + 203, // Girafarig + 371, // Bagon + 126, // Magmar + 105, // Marowak + 72, // Tentacool + 288, // Vigoroth + 242, // Blissey + 359, // Absol + 65, // Alakazam + 237, // Hitmontop + 282, // Gardevoir + 210, // Granbull + 106, // Hitmonlee + 107, // Hitmonchan + 227, // Skarmory + 331, // Cacnea + 257, // Blaziken + 254, // Sceptile + 336, // Seviper + 366, // Clamperl + 145, // Zapdos + 214, // Heracross + 62, // Poliwrath + 122, // Mr. mime + 127, // Pinsir + 272, // Ludicolo + 73, // Tentacruel + 42, // Golbat + 219, // Magcargo + 144, // Articuno + 221, // Piloswine + 123, // Scyther + 64, // Kadabra + 235, // Smeargle + 142, // Aerodactyl + 275, // Shiftry + 99, // Kingler + 31, // Nidoqueen + 82, // Magneton + 304, // Aron + 381, // Latios + 146, // Moltres + 346, // Cradily + 386, // Deoxys + 181, // Ampharos + 34, // Nidoking + 207, // Gligar + 24, // Arbok + 108, // Lickitung + 101, // Electrode + 348, // Armaldo + 67, // Machoke + 234, // Stantler + 326, // Grumpig + 246, // Larvitar + 169, // Crobat + 195, // Quagsire + 241, // Miltank + 97, // Hypno + 55, // Golduck + 332, // Cacturne + 80, // Slowbro + 157, // Typhlosion + 199, // Slowking + 115, // Kangaskhan + 121, // Starmie + 317, // Swalot + 324, // Torkoal + 260, // Swampert + 330, // Flygon + 295, // Exploud + 85, // Dodrio + 9, // Blastoise + 296, // Makuhita + 364, // Sealeo + 128, // Tauros + 319, // Sharpedo + 160, // Feraligatr + 86, // Seel + 6, // Charizard + 78, // Rapidash + 374, // Beldum + 299, // Nosepass + 3, // Venusaur + 357, // Tropius + 154, // Meganium + 373, // Salamence + 75, // Graveler + 344, // Claydol + 372, // Shelgon + 111, // Rhyhorn + 212, // Scizor + 87, // Dewgong + 112, // Rhydon + 232, // Donphan + 103, // Exeggutor + 305, // Lairon + 150, // Mewtwo + 217, // Ursaring + 205, // Forretress + 68, // Machamp + 320, // Wailmer + 289, // Slaking + 91, // Cloyster + 365, // Walrein + 247, // Pupitar + 230, // Kingdra + 338, // Solrock + 59, // Arcanine + 350, // Milotic + 337, // Lunatone + 378, // Regice + 243, // Raikou + 245, // Suicune + 244, // Entei + 250, // Ho-Oh + 248, // Tyranitar + 375, // Metang + 379, // Registeel + 384, // Rayquaza + 95, // Onix + 149, // Dragonite + 249, // Lugia + 131, // Lapras + 323, // Camerupt + 226, // Mantine + 377, // Regirock + 130, // Gyarados + 297, // Hariyama + 362, // Glalie + 76, // Golem + 382, // Kyogre + 306, // Aggron + 321, // Wailord + 208, // Steelix + 143, // Snorlax + 376, // Metagross + 383, // Groudon +}; +const u16 gPokedexOrder_Height[] = +{ + 50, // Diglett + 298, // Azurill + 177, // Natu + 13, // Weedle + 172, // Pichu + 173, // Cleffa + 175, // Togepi + 351, // Castform + 174, // Igglybuff + 10, // Caterpie + 276, // Taillow + 132, // Ditto + 133, // Eevee + 315, // Roselia + 21, // Spearow + 16, // Pidgey + 191, // Sunkern + 90, // Shellder + 19, // Rattata + 81, // Magnemite + 46, // Paras + 265, // Wurmple + 385, // Jirachi + 104, // Cubone + 258, // Mudkip + 194, // Wooper + 116, // Horsea + 52, // Meowth + 29, // Nidoran? + 220, // Swinub + 151, // Mew + 333, // Swablu + 304, // Aron + 311, // Plusle + 312, // Minun + 102, // Exeggcute + 25, // Pikachu + 182, // Bellossom + 316, // Gulpin + 263, // Zigzagoon + 285, // Shroomish + 138, // Omanyte + 331, // Cacnea + 98, // Krabby + 280, // Ralts + 187, // Hoppip + 255, // Torchic + 366, // Clamperl + 74, // Geodude + 183, // Marill + 339, // Barboach + 238, // Smoochum + 100, // Voltorb + 290, // Nincada + 302, // Sableye + 198, // Murkrow + 211, // Qwilfish + 7, // Squirtle + 252, // Treecko + 343, // Baltoy + 43, // Oddish + 270, // Lotad + 39, // Jigglypuff + 283, // Surskit + 155, // Cyndaquil + 140, // Kabuto + 264, // Linoone + 324, // Torkoal + 32, // Nidoran? + 167, // Spinarak + 56, // Mankey + 273, // Seedot + 261, // Poochyena + 231, // Phanpy + 201, // Unown + 170, // Chinchou + 233, // Porygon2 + 60, // Poliwag + 371, // Bagon + 349, // Feebas + 353, // Shuppet + 158, // Totodile + 251, // Celebi + 360, // Wynaut + 27, // Sandshrew + 358, // Chimecho + 370, // Luvdisc + 228, // Houndour + 266, // Silcoon + 309, // Electrike + 4, // Charmander + 307, // Meditite + 278, // Wingull + 223, // Remoraid + 341, // Corphish + 222, // Corsola + 314, // Illumise + 209, // Snubbull + 37, // Vulpix + 246, // Larvitar + 374, // Beldum + 293, // Whismur + 204, // Pineco + 239, // Elekid + 35, // Clefairy + 213, // Shuckle + 216, // Teddiursa + 14, // Kakuna + 300, // Skitty + 176, // Togetic + 118, // Goldeen + 303, // Mawile + 179, // Mareep + 188, // Skiploom + 109, // Koffing + 51, // Dugtrio + 268, // Cascoon + 322, // Numel + 347, // Anorith + 313, // Volbeat + 163, // Hoothoot + 328, // Trapinch + 325, // Spoink + 11, // Metapod + 69, // Bellsprout + 361, // Snorunt + 20, // Raticate + 259, // Marshtomp + 277, // Swellow + 240, // Magby + 58, // Growlithe + 200, // Misdreavus + 1, // Bulbasaur + 236, // Tyrogue + 218, // Slugma + 287, // Slakoth + 281, // Kirlia + 190, // Aipom + 135, // Jolteon + 30, // Nidorina + 184, // Azumarill + 292, // Shedinja + 66, // Machop + 291, // Ninjask + 284, // Masquerain + 355, // Duskull + 192, // Sunflora + 189, // Jumpluff + 120, // Staryu + 180, // Flaaffy + 363, // Spheal + 54, // Psyduck + 219, // Magcargo + 83, // Farfetch’d + 41, // Zubat + 137, // Porygon + 161, // Sentret + 318, // Carvanha + 44, // Gloom + 26, // Raichu + 129, // Magikarp + 215, // Sneasel + 305, // Lairon + 256, // Combusken + 224, // Octillery + 33, // Nidorino + 136, // Flareon + 225, // Delibird + 72, // Tentacool + 63, // Abra + 253, // Grovyle + 340, // Whiscash + 156, // Quilava + 196, // Espeon + 88, // Grimer + 152, // Chikorita + 326, // Grumpig + 299, // Nosepass + 53, // Persian + 262, // Mightyena + 48, // Venonat + 82, // Magneton + 77, // Ponyta + 296, // Makuhita + 337, // Lunatone + 28, // Sandslash + 96, // Drowzee + 114, // Tangela + 57, // Primeape + 165, // Ledyba + 40, // Wigglytuff + 47, // Parasect + 139, // Omastar + 294, // Loudred + 8, // Wartortle + 75, // Graveler + 197, // Umbreon + 345, // Lileep + 61, // Poliwhirl + 134, // Vaporeon + 15, // Beedrill + 105, // Marowak + 70, // Weepinbell + 369, // Relicanth + 111, // Rhyhorn + 2, // Ivysaur + 352, // Kecleon + 274, // Nuzleaf + 267, // Beautifly + 17, // Pidgeotto + 168, // Ariados + 86, // Seel + 186, // Politoed + 159, // Croconaw + 113, // Chansey + 354, // Banette + 232, // Donphan + 121, // Starmie + 5, // Charmeleon + 221, // Piloswine + 12, // Butterfree + 329, // Vibrava + 125, // Electabuzz + 342, // Crawdaunt + 301, // Delcatty + 334, // Altaria + 372, // Shelgon + 38, // Ninetales + 207, // Gligar + 364, // Sealeo + 327, // Spinda + 247, // Pupitar + 79, // Slowpoke + 338, // Solrock + 241, // Miltank + 22, // Fearow + 45, // Vileplume + 89, // Muk + 205, // Forretress + 185, // Sudowoodo + 359, // Absol + 193, // Yanma + 269, // Dustox + 108, // Lickitung + 235, // Smeargle + 171, // Lanturn + 101, // Electrode + 271, // Lombre + 286, // Breloom + 153, // Bayleef + 117, // Seadra + 110, // Weezing + 279, // Pelipper + 375, // Metang + 31, // Nidoqueen + 332, // Cacturne + 275, // Shiftry + 308, // Medicham + 335, // Zangoose + 141, // Kabutops + 99, // Kingler + 64, // Kadabra + 119, // Seaking + 36, // Clefable + 126, // Magmar + 202, // Wobbuffet + 92, // Gastly + 122, // Mr. mime + 62, // Poliwrath + 128, // Tauros + 380, // Latias + 181, // Ampharos + 288, // Vigoroth + 166, // Ledian + 76, // Golem + 365, // Walrein + 84, // Doduo + 229, // Houndoom + 34, // Nidoking + 124, // Jynx + 107, // Hitmonchan + 234, // Stantler + 210, // Granbull + 237, // Hitmontop + 195, // Quagsire + 344, // Claydol + 260, // Swampert + 242, // Blissey + 272, // Ludicolo + 295, // Exploud + 206, // Dunsparce + 127, // Pinsir + 91, // Cloyster + 67, // Machoke + 203, // Girafarig + 18, // Pidgeot + 178, // Xatu + 346, // Cradily + 106, // Hitmonlee + 49, // Venomoth + 94, // Gengar + 214, // Heracross + 362, // Glalie + 123, // Scyther + 373, // Salamence + 310, // Manectric + 348, // Armaldo + 65, // Alakazam + 97, // Hypno + 164, // Noctowl + 73, // Tentacruel + 356, // Dusclops + 145, // Zapdos + 42, // Golbat + 376, // Metagross + 282, // Gardevoir + 9, // Blastoise + 80, // Slowbro + 93, // Haunter + 68, // Machamp + 377, // Regirock + 317, // Swalot + 254, // Sceptile + 227, // Skarmory + 55, // Golduck + 386, // Deoxys + 71, // Victreebel + 78, // Rapidash + 6, // Charizard + 367, // Huntail + 87, // Dewgong + 144, // Articuno + 157, // Typhlosion + 142, // Aerodactyl + 368, // Gorebyss + 217, // Ursaring + 154, // Meganium + 378, // Regice + 212, // Scizor + 230, // Kingdra + 147, // Dratini + 85, // Dodrio + 319, // Sharpedo + 169, // Crobat + 162, // Furret + 59, // Arcanine + 243, // Raikou + 257, // Blaziken + 323, // Camerupt + 112, // Rhydon + 379, // Registeel + 23, // Ekans + 330, // Flygon + 357, // Tropius + 381, // Latios + 245, // Suicune + 146, // Moltres + 3, // Venusaur + 103, // Exeggutor + 199, // Slowking + 248, // Tyranitar + 289, // Slaking + 320, // Wailmer + 150, // Mewtwo + 306, // Aggron + 143, // Snorlax + 226, // Mantine + 244, // Entei + 149, // Dragonite + 115, // Kangaskhan + 297, // Hariyama + 160, // Feraligatr + 131, // Lapras + 336, // Seviper + 24, // Arbok + 383, // Groudon + 250, // Ho-Oh + 148, // Dragonair + 382, // Kyogre + 249, // Lugia + 350, // Milotic + 130, // Gyarados + 384, // Rayquaza + 95, // Onix + 208, // Steelix + 321, // Wailord +}; diff --git a/src/pokedex.c b/src/pokedex.c index 5f34a57c2..9e7ad1da0 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -5,6 +5,7 @@ #include "data2.h" #include "decompress.h" #include "event_data.h" +#include "graphics.h" #include "m4a.h" #include "main.h" #include "menu.h" @@ -92,8 +93,8 @@ struct PokedexEntry /*0x00*/ u8 categoryName[12]; /*0x0C*/ u16 height; //in decimeters /*0x0E*/ u16 weight; //in hectograms - /*0x10*/ u8 *descriptionPage1; - /*0x14*/ u8 *descriptionPage2; + /*0x10*/ const u8 *descriptionPage1; + /*0x14*/ const u8 *descriptionPage2; /*0x18*/ u16 unused; /*0x1A*/ u16 pokemonScale; /*0x1C*/ u16 pokemonOffset; @@ -149,27 +150,9 @@ extern u8 gUnknown_08E96738[]; extern u8 gUnknown_08E96888[]; extern u8 gUnknown_08E96994[]; extern u8 gUnknown_08E9C6DC[]; -extern struct SpriteTemplate gSpriteTemplate_83A0524; -extern struct SpriteTemplate gSpriteTemplate_83A053C; -extern struct SpriteTemplate gSpriteTemplate_83A0554; -extern struct SpriteTemplate gSpriteTemplate_83A056C; -extern struct SpriteTemplate gSpriteTemplate_83A0584; -extern struct SpriteTemplate gSpriteTemplate_83A059C; -extern struct SpriteTemplate gSpriteTemplate_83A05B4; -extern struct SpriteSheet gUnknown_083A05CC; -extern struct SpritePalette gUnknown_083A05DC[]; -extern u8 gUnknown_083A05EC[]; -extern u8 gUnknown_083A05F1[]; -extern u8 gUnknown_083A05F8[]; -extern u8 gUnknown_083B4EC4[]; -extern u8 gUnknown_083B5558[]; -extern void *const gUnknown_083B5584[]; -extern struct SpriteFrameImage *const gUnknown_083B5794[]; extern const struct SpriteTemplate gUnknown_083B57A4; -extern const u8 gUnknown_083B57BC[][4]; extern const struct UnknownStruct3 gUnknown_083B57E4[]; extern const struct UnknownStruct4 gUnknown_083B57FC[]; -extern const u8 gUnknown_083B5850[][4]; extern const u8 gUnknown_083B586C[][4]; extern const u8 gUnknown_083B5888[][4]; extern const u8 gUnknown_083B58A4[][4]; @@ -188,8 +171,8 @@ extern u8 gUnknown_08D00524[]; extern u8 gUnknown_08E96BD4[]; extern u8 gUnknown_08E96ACC[]; extern u8 gUnknown_08E96B58[]; -extern u16 gPokedexMenu_Pal[]; -extern u16 gPokedexMenu2_Pal[]; +extern const u16 gPokedexMenu_Pal[]; +extern const u16 gPokedexMenu2_Pal[]; extern const u8 *const gMonFootprintTable[]; extern const struct SpriteSheet gTrainerFrontPicTable[]; extern const struct MonCoords gTrainerFrontPicCoords[]; @@ -198,6 +181,8 @@ extern const struct BaseStats gBaseStats[]; extern const u8 gPokedexMenuSearch_Gfx[]; extern const u8 gUnknown_08E96D2C[]; extern const u16 gPokedexMenuSearch_Pal[]; +extern const u8 gTypeNames[][7]; +extern const u8 gPokedexMenu2_Gfx[]; extern void sub_814AD7C(u8, u8); extern void sub_800D74C(); @@ -217,1198 +202,7 @@ const u8 gEmptySpacce_839F7FC[0xA4] = {0}; const u8 gUnknown_0839F8A0[] = INCBIN_U8("graphics/pokedex/pokedex_cry_layout.bin.lz"); const u8 gUnknown_0839F988[] = INCBIN_U8("graphics/pokedex/pokedex_size_layout.bin.lz"); const u8 gUnknown_0839FA7C[] = INCBIN_U8("graphics/pokedex/noball.4bpp.lz"); -const u16 gPokedexOrder_Alphabetical[] = -{ - 387, - 388, - 389, - 390, - 391, - 392, - 393, - 394, - 395, - 396, - 397, - 398, - 399, - 400, - 401, - 402, - 403, - 404, - 405, - 406, - 407, - 408, - 409, - 410, - 411, - 63, // Abra - 359, // Absol - 142, // Aerodactyl - 306, // Aggron - 190, // Aipom - 65, // Alakazam - 334, // Altaria - 181, // Ampharos - 347, // Anorith - 24, // Arbok - 59, // Arcanine - 168, // Ariados - 348, // Armaldo - 304, // Aron - 144, // Articuno - 184, // Azumarill - 298, // Azurill - 371, // Bagon - 343, // Baltoy - 354, // Banette - 339, // Barboach - 153, // Bayleef - 267, // Beautifly - 15, // Beedrill - 374, // Beldum - 182, // Bellossom - 69, // Bellsprout - 9, // Blastoise - 257, // Blaziken - 242, // Blissey - 286, // Breloom - 1, // Bulbasaur - 12, // Butterfree - 331, // Cacnea - 332, // Cacturne - 323, // Camerupt - 318, // Carvanha - 268, // Cascoon - 351, // Castform - 10, // Caterpie - 251, // Celebi - 113, // Chansey - 6, // Charizard - 4, // Charmander - 5, // Charmeleon - 152, // Chikorita - 358, // Chimecho - 170, // Chinchou - 366, // Clamperl - 344, // Claydol - 36, // Clefable - 35, // Clefairy - 173, // Cleffa - 91, // Cloyster - 256, // Combusken - 341, // Corphish - 222, // Corsola - 346, // Cradily - 342, // Crawdaunt - 169, // Crobat - 159, // Croconaw - 104, // Cubone - 155, // Cyndaquil - 301, // Delcatty - 225, // Delibird - 386, // Deoxys - 87, // Dewgong - 50, // Diglett - 132, // Ditto - 85, // Dodrio - 84, // Doduo - 232, // Donphan - 148, // Dragonair - 149, // Dragonite - 147, // Dratini - 96, // Drowzee - 51, // Dugtrio - 206, // Dunsparce - 356, // Dusclops - 355, // Duskull - 269, // Dustox - 133, // Eevee - 23, // Ekans - 125, // Electabuzz - 309, // Electrike - 101, // Electrode - 239, // Elekid - 244, // Entei - 196, // Espeon - 102, // Exeggcute - 103, // Exeggutor - 295, // Exploud - 83, // Farfetch’d - 22, // Fearow - 349, // Feebas - 160, // Feraligatr - 180, // Flaaffy - 136, // Flareon - 330, // Flygon - 205, // Forretress - 162, // Furret - 282, // Gardevoir - 92, // Gastly - 94, // Gengar - 74, // Geodude - 203, // Girafarig - 362, // Glalie - 207, // Gligar - 44, // Gloom - 42, // Golbat - 118, // Goldeen - 55, // Golduck - 76, // Golem - 368, // Gorebyss - 210, // Granbull - 75, // Graveler - 88, // Grimer - 383, // Groudon - 253, // Grovyle - 58, // Growlithe - 326, // Grumpig - 316, // Gulpin - 130, // Gyarados - 297, // Hariyama - 93, // Haunter - 214, // Heracross - 107, // Hitmonchan - 106, // Hitmonlee - 237, // Hitmontop - 250, // Ho-Oh - 163, // Hoothoot - 187, // Hoppip - 116, // Horsea - 229, // Houndoom - 228, // Houndour - 367, // Huntail - 97, // Hypno - 174, // Igglybuff - 314, // Illumise - 2, // Ivysaur - 39, // Jigglypuff - 385, // Jirachi - 135, // Jolteon - 189, // Jumpluff - 124, // Jynx - 140, // Kabuto - 141, // Kabutops - 64, // Kadabra - 14, // Kakuna - 115, // Kangaskhan - 352, // Kecleon - 230, // Kingdra - 99, // Kingler - 281, // Kirlia - 109, // Koffing - 98, // Krabby - 382, // Kyogre - 305, // Lairon - 171, // Lanturn - 131, // Lapras - 246, // Larvitar - 380, // Latias - 381, // Latios - 166, // Ledian - 165, // Ledyba - 108, // Lickitung - 345, // Lileep - 264, // Linoone - 271, // Lombre - 270, // Lotad - 294, // Loudred - 272, // Ludicolo - 249, // Lugia - 337, // Lunatone - 370, // Luvdisc - 68, // Machamp - 67, // Machoke - 66, // Machop - 240, // Magby - 219, // Magcargo - 129, // Magikarp - 126, // Magmar - 81, // Magnemite - 82, // Magneton - 296, // Makuhita - 310, // Manectric - 56, // Mankey - 226, // Mantine - 179, // Mareep - 183, // Marill - 105, // Marowak - 259, // Marshtomp - 284, // Masquerain - 303, // Mawile - 308, // Medicham - 307, // Meditite - 154, // Meganium - 52, // Meowth - 376, // Metagross - 375, // Metang - 11, // Metapod - 151, // Mew - 150, // Mewtwo - 262, // Mightyena - 350, // Milotic - 241, // Miltank - 312, // Minun - 200, // Misdreavus - 146, // Moltres - 122, // Mr. mime - 258, // Mudkip - 89, // Muk - 198, // Murkrow - 177, // Natu - 34, // Nidoking - 31, // Nidoqueen - 29, // Nidoran♀ - 32, // Nidoran♂ - 30, // Nidorina - 33, // Nidorino - 290, // Nincada - 38, // Ninetales - 291, // Ninjask - 164, // Noctowl - 299, // Nosepass - 322, // Numel - 274, // Nuzleaf - 224, // Octillery - 43, // Oddish - 138, // Omanyte - 139, // Omastar - 95, // Onix - 46, // Paras - 47, // Parasect - 279, // Pelipper - 53, // Persian - 231, // Phanpy - 172, // Pichu - 18, // Pidgeot - 17, // Pidgeotto - 16, // Pidgey - 25, // Pikachu - 221, // Piloswine - 204, // Pineco - 127, // Pinsir - 311, // Plusle - 186, // Politoed - 60, // Poliwag - 61, // Poliwhirl - 62, // Poliwrath - 77, // Ponyta - 261, // Poochyena - 137, // Porygon - 233, // Porygon2 - 57, // Primeape - 54, // Psyduck - 247, // Pupitar - 195, // Quagsire - 156, // Quilava - 211, // Qwilfish - 26, // Raichu - 243, // Raikou - 280, // Ralts - 78, // Rapidash - 20, // Raticate - 19, // Rattata - 384, // Rayquaza - 378, // Regice - 377, // Regirock - 379, // Registeel - 369, // Relicanth - 223, // Remoraid - 112, // Rhydon - 111, // Rhyhorn - 315, // Roselia - 302, // Sableye - 373, // Salamence - 27, // Sandshrew - 28, // Sandslash - 254, // Sceptile - 212, // Scizor - 123, // Scyther - 117, // Seadra - 119, // Seaking - 364, // Sealeo - 273, // Seedot - 86, // Seel - 161, // Sentret - 336, // Seviper - 319, // Sharpedo - 292, // Shedinja - 372, // Shelgon - 90, // Shellder - 275, // Shiftry - 285, // Shroomish - 213, // Shuckle - 353, // Shuppet - 266, // Silcoon - 227, // Skarmory - 188, // Skiploom - 300, // Skitty - 289, // Slaking - 287, // Slakoth - 80, // Slowbro - 199, // Slowking - 79, // Slowpoke - 218, // Slugma - 235, // Smeargle - 238, // Smoochum - 215, // Sneasel - 143, // Snorlax - 361, // Snorunt - 209, // Snubbull - 338, // Solrock - 21, // Spearow - 363, // Spheal - 167, // Spinarak - 327, // Spinda - 325, // Spoink - 7, // Squirtle - 234, // Stantler - 121, // Starmie - 120, // Staryu - 208, // Steelix - 185, // Sudowoodo - 245, // Suicune - 192, // Sunflora - 191, // Sunkern - 283, // Surskit - 333, // Swablu - 317, // Swalot - 260, // Swampert - 277, // Swellow - 220, // Swinub - 276, // Taillow - 114, // Tangela - 128, // Tauros - 216, // Teddiursa - 72, // Tentacool - 73, // Tentacruel - 175, // Togepi - 176, // Togetic - 255, // Torchic - 324, // Torkoal - 158, // Totodile - 328, // Trapinch - 252, // Treecko - 357, // Tropius - 157, // Typhlosion - 248, // Tyranitar - 236, // Tyrogue - 197, // Umbreon - 201, // Unown - 217, // Ursaring - 134, // Vaporeon - 49, // Venomoth - 48, // Venonat - 3, // Venusaur - 329, // Vibrava - 71, // Victreebel - 288, // Vigoroth - 45, // Vileplume - 313, // Volbeat - 100, // Voltorb - 37, // Vulpix - 320, // Wailmer - 321, // Wailord - 365, // Walrein - 8, // Wartortle - 13, // Weedle - 70, // Weepinbell - 110, // Weezing - 340, // Whiscash - 293, // Whismur - 40, // Wigglytuff - 278, // Wingull - 202, // Wobbuffet - 194, // Wooper - 265, // Wurmple - 360, // Wynaut - 178, // Xatu - 193, // Yanma - 335, // Zangoose - 145, // Zapdos - 263, // Zigzagoon - 41, // Zubat -}; -const u16 gPokedexOrder_Weight[] = -{ - 92, // Gastly - 93, // Haunter - 187, // Hoppip - 50, // Diglett - 351, // Castform - 109, // Koffing - 174, // Igglybuff - 200, // Misdreavus - 358, // Chimecho - 188, // Skiploom - 385, // Jirachi - 333, // Swablu - 292, // Shedinja - 175, // Togepi - 283, // Surskit - 16, // Pidgey - 191, // Sunkern - 339, // Barboach - 172, // Pichu - 298, // Azurill - 315, // Roselia - 177, // Natu - 21, // Spearow - 198, // Murkrow - 353, // Shuppet - 276, // Taillow - 102, // Exeggcute - 255, // Torchic - 270, // Lotad - 10, // Caterpie - 189, // Jumpluff - 173, // Cleffa - 13, // Weedle - 176, // Togetic - 147, // Dratini - 19, // Rattata - 284, // Masquerain - 265, // Wurmple - 211, // Qwilfish - 151, // Mew - 90, // Shellder - 273, // Seedot - 132, // Ditto - 69, // Bellsprout - 311, // Plusle - 52, // Meowth - 312, // Minun - 285, // Shroomish - 251, // Celebi - 222, // Corsola - 252, // Treecko - 327, // Spinda - 201, // Unown - 46, // Paras - 43, // Oddish - 39, // Jigglypuff - 290, // Nincada - 182, // Bellossom - 81, // Magnemite - 25, // Pikachu - 238, // Smoochum - 161, // Sentret - 70, // Weepinbell - 152, // Chikorita - 220, // Swinub - 133, // Eevee - 98, // Krabby - 104, // Cubone - 280, // Ralts - 1, // Bulbasaur - 23, // Ekans - 29, // Nidoran♀ - 204, // Pineco - 349, // Feebas - 138, // Omanyte - 41, // Zubat - 35, // Clefairy - 258, // Mudkip - 209, // Snubbull - 179, // Mareep - 155, // Cyndaquil - 116, // Horsea - 4, // Charmander - 192, // Sunflora - 183, // Marill - 194, // Wooper - 167, // Spinarak - 44, // Gloom - 370, // Luvdisc - 216, // Teddiursa - 32, // Nidoran♂ - 7, // Squirtle - 278, // Wingull - 158, // Totodile - 110, // Weezing - 37, // Vulpix - 11, // Metapod - 266, // Silcoon - 129, // Magikarp - 14, // Kakuna - 316, // Gulpin - 100, // Voltorb - 165, // Ledyba - 228, // Houndour - 300, // Skitty - 302, // Sableye - 307, // Meditite - 341, // Corphish - 190, // Aipom - 268, // Cascoon - 303, // Mawile - 140, // Kabuto - 40, // Wigglytuff - 27, // Sandshrew - 223, // Remoraid - 291, // Ninjask - 170, // Chinchou - 60, // Poliwag - 347, // Anorith - 49, // Venomoth - 354, // Banette - 2, // Ivysaur - 180, // Flaaffy - 261, // Poochyena - 360, // Wynaut - 206, // Dunsparce - 178, // Xatu - 355, // Duskull - 83, // Farfetch’d - 328, // Trapinch - 118, // Goldeen - 309, // Electrike - 329, // Vibrava - 71, // Victreebel - 153, // Bayleef - 225, // Delibird - 293, // Whismur - 148, // Dragonair - 361, // Snorunt - 263, // Zigzagoon - 314, // Illumise - 313, // Volbeat - 20, // Raticate - 45, // Vileplume - 156, // Quilava - 5, // Charmeleon - 58, // Growlithe - 256, // Combusken - 66, // Machop - 63, // Abra - 33, // Nidorino - 54, // Psyduck - 277, // Swellow - 38, // Ninetales - 30, // Nidorina - 61, // Poliwhirl - 74, // Geodude - 281, // Kirlia - 213, // Shuckle - 334, // Altaria - 318, // Carvanha - 236, // Tyrogue - 163, // Hoothoot - 240, // Magby - 343, // Baltoy - 253, // Grovyle - 352, // Kecleon - 171, // Lanturn - 8, // Wartortle - 368, // Gorebyss - 369, // Relicanth - 239, // Elekid - 340, // Whiscash - 345, // Lileep - 322, // Numel - 287, // Slakoth - 135, // Jolteon - 159, // Croconaw - 136, // Flareon - 117, // Seadra - 196, // Espeon - 367, // Huntail - 197, // Umbreon - 259, // Marshtomp - 274, // Nuzleaf - 215, // Sneasel - 56, // Mankey - 279, // Pelipper - 267, // Beautifly - 224, // Octillery - 184, // Azumarill - 202, // Wobbuffet - 134, // Vaporeon - 28, // Sandslash - 47, // Parasect - 15, // Beedrill - 89, // Muk - 17, // Pidgeotto - 88, // Grimer - 26, // Raichu - 77, // Ponyta - 125, // Electabuzz - 48, // Venonat - 325, // Spoink - 356, // Dusclops - 308, // Medicham - 269, // Dustox - 53, // Persian - 12, // Butterfree - 57, // Primeape - 96, // Drowzee - 162, // Furret - 233, // Porygon2 - 271, // Lombre - 264, // Linoone - 301, // Delcatty - 342, // Crawdaunt - 51, // Dugtrio - 168, // Ariados - 231, // Phanpy - 186, // Politoed - 120, // Staryu - 113, // Chansey - 139, // Omastar - 114, // Tangela - 218, // Slugma - 229, // Houndoom - 166, // Ledian - 79, // Slowpoke - 137, // Porygon - 262, // Mightyena - 193, // Yanma - 22, // Fearow - 185, // Sudowoodo - 119, // Seaking - 286, // Breloom - 84, // Doduo - 18, // Pidgeot - 363, // Spheal - 36, // Clefable - 380, // Latias - 310, // Manectric - 335, // Zangoose - 141, // Kabutops - 94, // Gengar - 294, // Loudred - 124, // Jynx - 164, // Noctowl - 203, // Girafarig - 371, // Bagon - 126, // Magmar - 105, // Marowak - 72, // Tentacool - 288, // Vigoroth - 242, // Blissey - 359, // Absol - 65, // Alakazam - 237, // Hitmontop - 282, // Gardevoir - 210, // Granbull - 106, // Hitmonlee - 107, // Hitmonchan - 227, // Skarmory - 331, // Cacnea - 257, // Blaziken - 254, // Sceptile - 336, // Seviper - 366, // Clamperl - 145, // Zapdos - 214, // Heracross - 62, // Poliwrath - 122, // Mr. mime - 127, // Pinsir - 272, // Ludicolo - 73, // Tentacruel - 42, // Golbat - 219, // Magcargo - 144, // Articuno - 221, // Piloswine - 123, // Scyther - 64, // Kadabra - 235, // Smeargle - 142, // Aerodactyl - 275, // Shiftry - 99, // Kingler - 31, // Nidoqueen - 82, // Magneton - 304, // Aron - 381, // Latios - 146, // Moltres - 346, // Cradily - 386, // Deoxys - 181, // Ampharos - 34, // Nidoking - 207, // Gligar - 24, // Arbok - 108, // Lickitung - 101, // Electrode - 348, // Armaldo - 67, // Machoke - 234, // Stantler - 326, // Grumpig - 246, // Larvitar - 169, // Crobat - 195, // Quagsire - 241, // Miltank - 97, // Hypno - 55, // Golduck - 332, // Cacturne - 80, // Slowbro - 157, // Typhlosion - 199, // Slowking - 115, // Kangaskhan - 121, // Starmie - 317, // Swalot - 324, // Torkoal - 260, // Swampert - 330, // Flygon - 295, // Exploud - 85, // Dodrio - 9, // Blastoise - 296, // Makuhita - 364, // Sealeo - 128, // Tauros - 319, // Sharpedo - 160, // Feraligatr - 86, // Seel - 6, // Charizard - 78, // Rapidash - 374, // Beldum - 299, // Nosepass - 3, // Venusaur - 357, // Tropius - 154, // Meganium - 373, // Salamence - 75, // Graveler - 344, // Claydol - 372, // Shelgon - 111, // Rhyhorn - 212, // Scizor - 87, // Dewgong - 112, // Rhydon - 232, // Donphan - 103, // Exeggutor - 305, // Lairon - 150, // Mewtwo - 217, // Ursaring - 205, // Forretress - 68, // Machamp - 320, // Wailmer - 289, // Slaking - 91, // Cloyster - 365, // Walrein - 247, // Pupitar - 230, // Kingdra - 338, // Solrock - 59, // Arcanine - 350, // Milotic - 337, // Lunatone - 378, // Regice - 243, // Raikou - 245, // Suicune - 244, // Entei - 250, // Ho-Oh - 248, // Tyranitar - 375, // Metang - 379, // Registeel - 384, // Rayquaza - 95, // Onix - 149, // Dragonite - 249, // Lugia - 131, // Lapras - 323, // Camerupt - 226, // Mantine - 377, // Regirock - 130, // Gyarados - 297, // Hariyama - 362, // Glalie - 76, // Golem - 382, // Kyogre - 306, // Aggron - 321, // Wailord - 208, // Steelix - 143, // Snorlax - 376, // Metagross - 383, // Groudon -}; -const u16 gPokedexOrder_Height[] = -{ - 50, // Diglett - 298, // Azurill - 177, // Natu - 13, // Weedle - 172, // Pichu - 173, // Cleffa - 175, // Togepi - 351, // Castform - 174, // Igglybuff - 10, // Caterpie - 276, // Taillow - 132, // Ditto - 133, // Eevee - 315, // Roselia - 21, // Spearow - 16, // Pidgey - 191, // Sunkern - 90, // Shellder - 19, // Rattata - 81, // Magnemite - 46, // Paras - 265, // Wurmple - 385, // Jirachi - 104, // Cubone - 258, // Mudkip - 194, // Wooper - 116, // Horsea - 52, // Meowth - 29, // Nidoran♀ - 220, // Swinub - 151, // Mew - 333, // Swablu - 304, // Aron - 311, // Plusle - 312, // Minun - 102, // Exeggcute - 25, // Pikachu - 182, // Bellossom - 316, // Gulpin - 263, // Zigzagoon - 285, // Shroomish - 138, // Omanyte - 331, // Cacnea - 98, // Krabby - 280, // Ralts - 187, // Hoppip - 255, // Torchic - 366, // Clamperl - 74, // Geodude - 183, // Marill - 339, // Barboach - 238, // Smoochum - 100, // Voltorb - 290, // Nincada - 302, // Sableye - 198, // Murkrow - 211, // Qwilfish - 7, // Squirtle - 252, // Treecko - 343, // Baltoy - 43, // Oddish - 270, // Lotad - 39, // Jigglypuff - 283, // Surskit - 155, // Cyndaquil - 140, // Kabuto - 264, // Linoone - 324, // Torkoal - 32, // Nidoran♂ - 167, // Spinarak - 56, // Mankey - 273, // Seedot - 261, // Poochyena - 231, // Phanpy - 201, // Unown - 170, // Chinchou - 233, // Porygon2 - 60, // Poliwag - 371, // Bagon - 349, // Feebas - 353, // Shuppet - 158, // Totodile - 251, // Celebi - 360, // Wynaut - 27, // Sandshrew - 358, // Chimecho - 370, // Luvdisc - 228, // Houndour - 266, // Silcoon - 309, // Electrike - 4, // Charmander - 307, // Meditite - 278, // Wingull - 223, // Remoraid - 341, // Corphish - 222, // Corsola - 314, // Illumise - 209, // Snubbull - 37, // Vulpix - 246, // Larvitar - 374, // Beldum - 293, // Whismur - 204, // Pineco - 239, // Elekid - 35, // Clefairy - 213, // Shuckle - 216, // Teddiursa - 14, // Kakuna - 300, // Skitty - 176, // Togetic - 118, // Goldeen - 303, // Mawile - 179, // Mareep - 188, // Skiploom - 109, // Koffing - 51, // Dugtrio - 268, // Cascoon - 322, // Numel - 347, // Anorith - 313, // Volbeat - 163, // Hoothoot - 328, // Trapinch - 325, // Spoink - 11, // Metapod - 69, // Bellsprout - 361, // Snorunt - 20, // Raticate - 259, // Marshtomp - 277, // Swellow - 240, // Magby - 58, // Growlithe - 200, // Misdreavus - 1, // Bulbasaur - 236, // Tyrogue - 218, // Slugma - 287, // Slakoth - 281, // Kirlia - 190, // Aipom - 135, // Jolteon - 30, // Nidorina - 184, // Azumarill - 292, // Shedinja - 66, // Machop - 291, // Ninjask - 284, // Masquerain - 355, // Duskull - 192, // Sunflora - 189, // Jumpluff - 120, // Staryu - 180, // Flaaffy - 363, // Spheal - 54, // Psyduck - 219, // Magcargo - 83, // Farfetch’d - 41, // Zubat - 137, // Porygon - 161, // Sentret - 318, // Carvanha - 44, // Gloom - 26, // Raichu - 129, // Magikarp - 215, // Sneasel - 305, // Lairon - 256, // Combusken - 224, // Octillery - 33, // Nidorino - 136, // Flareon - 225, // Delibird - 72, // Tentacool - 63, // Abra - 253, // Grovyle - 340, // Whiscash - 156, // Quilava - 196, // Espeon - 88, // Grimer - 152, // Chikorita - 326, // Grumpig - 299, // Nosepass - 53, // Persian - 262, // Mightyena - 48, // Venonat - 82, // Magneton - 77, // Ponyta - 296, // Makuhita - 337, // Lunatone - 28, // Sandslash - 96, // Drowzee - 114, // Tangela - 57, // Primeape - 165, // Ledyba - 40, // Wigglytuff - 47, // Parasect - 139, // Omastar - 294, // Loudred - 8, // Wartortle - 75, // Graveler - 197, // Umbreon - 345, // Lileep - 61, // Poliwhirl - 134, // Vaporeon - 15, // Beedrill - 105, // Marowak - 70, // Weepinbell - 369, // Relicanth - 111, // Rhyhorn - 2, // Ivysaur - 352, // Kecleon - 274, // Nuzleaf - 267, // Beautifly - 17, // Pidgeotto - 168, // Ariados - 86, // Seel - 186, // Politoed - 159, // Croconaw - 113, // Chansey - 354, // Banette - 232, // Donphan - 121, // Starmie - 5, // Charmeleon - 221, // Piloswine - 12, // Butterfree - 329, // Vibrava - 125, // Electabuzz - 342, // Crawdaunt - 301, // Delcatty - 334, // Altaria - 372, // Shelgon - 38, // Ninetales - 207, // Gligar - 364, // Sealeo - 327, // Spinda - 247, // Pupitar - 79, // Slowpoke - 338, // Solrock - 241, // Miltank - 22, // Fearow - 45, // Vileplume - 89, // Muk - 205, // Forretress - 185, // Sudowoodo - 359, // Absol - 193, // Yanma - 269, // Dustox - 108, // Lickitung - 235, // Smeargle - 171, // Lanturn - 101, // Electrode - 271, // Lombre - 286, // Breloom - 153, // Bayleef - 117, // Seadra - 110, // Weezing - 279, // Pelipper - 375, // Metang - 31, // Nidoqueen - 332, // Cacturne - 275, // Shiftry - 308, // Medicham - 335, // Zangoose - 141, // Kabutops - 99, // Kingler - 64, // Kadabra - 119, // Seaking - 36, // Clefable - 126, // Magmar - 202, // Wobbuffet - 92, // Gastly - 122, // Mr. mime - 62, // Poliwrath - 128, // Tauros - 380, // Latias - 181, // Ampharos - 288, // Vigoroth - 166, // Ledian - 76, // Golem - 365, // Walrein - 84, // Doduo - 229, // Houndoom - 34, // Nidoking - 124, // Jynx - 107, // Hitmonchan - 234, // Stantler - 210, // Granbull - 237, // Hitmontop - 195, // Quagsire - 344, // Claydol - 260, // Swampert - 242, // Blissey - 272, // Ludicolo - 295, // Exploud - 206, // Dunsparce - 127, // Pinsir - 91, // Cloyster - 67, // Machoke - 203, // Girafarig - 18, // Pidgeot - 178, // Xatu - 346, // Cradily - 106, // Hitmonlee - 49, // Venomoth - 94, // Gengar - 214, // Heracross - 362, // Glalie - 123, // Scyther - 373, // Salamence - 310, // Manectric - 348, // Armaldo - 65, // Alakazam - 97, // Hypno - 164, // Noctowl - 73, // Tentacruel - 356, // Dusclops - 145, // Zapdos - 42, // Golbat - 376, // Metagross - 282, // Gardevoir - 9, // Blastoise - 80, // Slowbro - 93, // Haunter - 68, // Machamp - 377, // Regirock - 317, // Swalot - 254, // Sceptile - 227, // Skarmory - 55, // Golduck - 386, // Deoxys - 71, // Victreebel - 78, // Rapidash - 6, // Charizard - 367, // Huntail - 87, // Dewgong - 144, // Articuno - 157, // Typhlosion - 142, // Aerodactyl - 368, // Gorebyss - 217, // Ursaring - 154, // Meganium - 378, // Regice - 212, // Scizor - 230, // Kingdra - 147, // Dratini - 85, // Dodrio - 319, // Sharpedo - 169, // Crobat - 162, // Furret - 59, // Arcanine - 243, // Raikou - 257, // Blaziken - 323, // Camerupt - 112, // Rhydon - 379, // Registeel - 23, // Ekans - 330, // Flygon - 357, // Tropius - 381, // Latios - 245, // Suicune - 146, // Moltres - 3, // Venusaur - 103, // Exeggutor - 199, // Slowking - 248, // Tyranitar - 289, // Slaking - 320, // Wailmer - 150, // Mewtwo - 306, // Aggron - 143, // Snorlax - 226, // Mantine - 244, // Entei - 149, // Dragonite - 115, // Kangaskhan - 297, // Hariyama - 160, // Feraligatr - 131, // Lapras - 336, // Seviper - 24, // Arbok - 383, // Groudon - 250, // Ho-Oh - 148, // Dragonair - 382, // Kyogre - 249, // Lugia - 350, // Milotic - 130, // Gyarados - 384, // Rayquaza - 95, // Onix - 208, // Steelix - 321, // Wailord -}; +#include "data/pokedex_orders.h" const struct OamData gOamData_83A0404 = { .y = 160, @@ -1646,6 +440,778 @@ const union AnimCmd *const gSpriteAnimTable_83A0520[] = { gSpriteAnim_83A04CC, }; +const struct SpriteTemplate gSpriteTemplate_83A0524 = +{ + .tileTag = 4096, + .paletteTag = 4096, + .oam = &gOamData_83A0404, + .anims = gSpriteAnimTable_83A04D4, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_808EF38, +}; +const struct SpriteTemplate gSpriteTemplate_83A053C = +{ + .tileTag = 4096, + .paletteTag = 4096, + .oam = &gOamData_83A040C, + .anims = gSpriteAnimTable_83A04D8, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_808EF8C, +}; +const struct SpriteTemplate gSpriteTemplate_83A0554 = +{ + .tileTag = 4096, + .paletteTag = 4096, + .oam = &gOamData_83A0414, + .anims = gSpriteAnimTable_83A04E0, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_808F08C, +}; +const struct SpriteTemplate gSpriteTemplate_83A056C = +{ + .tileTag = 4096, + .paletteTag = 4096, + .oam = &gOamData_83A041C, + .anims = gSpriteAnimTable_83A04DC, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_808F0B4, +}; +const struct SpriteTemplate gSpriteTemplate_83A0584 = +{ + .tileTag = 4096, + .paletteTag = 4096, + .oam = &gOamData_83A0424, + .anims = gSpriteAnimTable_83A04F0, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_808ED94, +}; +const struct SpriteTemplate gSpriteTemplate_83A059C = +{ + .tileTag = 4096, + .paletteTag = 4096, + .oam = &gOamData_83A042C, + .anims = gSpriteAnimTable_83A04F8, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_808ED94, +}; +const struct SpriteTemplate gSpriteTemplate_83A05B4 = +{ + .tileTag = 4096, + .paletteTag = 4096, + .oam = &gOamData_83A042C, + .anims = gSpriteAnimTable_83A0520, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_808F168, +}; +const struct SpriteSheet gUnknown_083A05CC[] = +{ + {gPokedexMenu2_Gfx, 0x1F00, 0x1000}, + {NULL, 0, 0}, +}; +const struct SpritePalette gUnknown_083A05DC[] = +{ + {gPokedexMenu_Pal, 0x1000}, + {NULL, 0}, +}; +const u8 gUnknown_083A05EC[] = {2, 4, 8, 16, 32}; +const u8 gUnknown_083A05F1[] = {16, 8, 4, 2, 1}; +const u8 gEmptySpacce_83A05F6[] = {0, 0}; // Padding, maybe? +const u8 gUnknown_083A05F8[] = _(""); +// TODO: include German entries +#include "data/pokedex_entries_en.h" +const u16 gUnknown_083B4EC4[16] = {0}; +const u8 *const gMonFootprintTable[] = +{ + gMonFootprint_Bulbasaur, + gMonFootprint_Bulbasaur, + gMonFootprint_Ivysaur, + gMonFootprint_Venusaur, + gMonFootprint_Charmander, + gMonFootprint_Charmeleon, + gMonFootprint_Charizard, + gMonFootprint_Squirtle, + gMonFootprint_Wartortle, + gMonFootprint_Blastoise, + gMonFootprint_Caterpie, + gMonFootprint_Metapod, + gMonFootprint_Butterfree, + gMonFootprint_Weedle, + gMonFootprint_Kakuna, + gMonFootprint_Beedrill, + gMonFootprint_Pidgey, + gMonFootprint_Pidgeotto, + gMonFootprint_Pidgeot, + gMonFootprint_Rattata, + gMonFootprint_Raticate, + gMonFootprint_Spearow, + gMonFootprint_Fearow, + gMonFootprint_Ekans, + gMonFootprint_Arbok, + gMonFootprint_Pikachu, + gMonFootprint_Raichu, + gMonFootprint_Sandshrew, + gMonFootprint_Sandslash, + gMonFootprint_NidoranF, + gMonFootprint_Nidorina, + gMonFootprint_Nidoqueen, + gMonFootprint_NidoranM, + gMonFootprint_Nidorino, + gMonFootprint_Nidoking, + gMonFootprint_Clefairy, + gMonFootprint_Clefable, + gMonFootprint_Vulpix, + gMonFootprint_Ninetales, + gMonFootprint_Jigglypuff, + gMonFootprint_Wigglytuff, + gMonFootprint_Zubat, + gMonFootprint_Golbat, + gMonFootprint_Oddish, + gMonFootprint_Gloom, + gMonFootprint_Vileplume, + gMonFootprint_Paras, + gMonFootprint_Parasect, + gMonFootprint_Venonat, + gMonFootprint_Venomoth, + gMonFootprint_Diglett, + gMonFootprint_Dugtrio, + gMonFootprint_Meowth, + gMonFootprint_Persian, + gMonFootprint_Psyduck, + gMonFootprint_Golduck, + gMonFootprint_Mankey, + gMonFootprint_Primeape, + gMonFootprint_Growlithe, + gMonFootprint_Arcanine, + gMonFootprint_Poliwag, + gMonFootprint_Poliwhirl, + gMonFootprint_Poliwrath, + gMonFootprint_Abra, + gMonFootprint_Kadabra, + gMonFootprint_Alakazam, + gMonFootprint_Machop, + gMonFootprint_Machoke, + gMonFootprint_Machamp, + gMonFootprint_Bellsprout, + gMonFootprint_Weepinbell, + gMonFootprint_Victreebel, + gMonFootprint_Tentacool, + gMonFootprint_Tentacruel, + gMonFootprint_Geodude, + gMonFootprint_Graveler, + gMonFootprint_Golem, + gMonFootprint_Ponyta, + gMonFootprint_Rapidash, + gMonFootprint_Slowpoke, + gMonFootprint_Slowbro, + gMonFootprint_Magnemite, + gMonFootprint_Magneton, + gMonFootprint_Farfetchd, + gMonFootprint_Doduo, + gMonFootprint_Dodrio, + gMonFootprint_Seel, + gMonFootprint_Dewgong, + gMonFootprint_Grimer, + gMonFootprint_Muk, + gMonFootprint_Shellder, + gMonFootprint_Cloyster, + gMonFootprint_Gastly, + gMonFootprint_Haunter, + gMonFootprint_Gengar, + gMonFootprint_Onix, + gMonFootprint_Drowzee, + gMonFootprint_Hypno, + gMonFootprint_Krabby, + gMonFootprint_Kingler, + gMonFootprint_Voltorb, + gMonFootprint_Electrode, + gMonFootprint_Exeggcute, + gMonFootprint_Exeggutor, + gMonFootprint_Cubone, + gMonFootprint_Marowak, + gMonFootprint_Hitmonlee, + gMonFootprint_Hitmonchan, + gMonFootprint_Lickitung, + gMonFootprint_Koffing, + gMonFootprint_Weezing, + gMonFootprint_Rhyhorn, + gMonFootprint_Rhydon, + gMonFootprint_Chansey, + gMonFootprint_Tangela, + gMonFootprint_Kangaskhan, + gMonFootprint_Horsea, + gMonFootprint_Seadra, + gMonFootprint_Goldeen, + gMonFootprint_Seaking, + gMonFootprint_Staryu, + gMonFootprint_Starmie, + gMonFootprint_Mrmime, + gMonFootprint_Scyther, + gMonFootprint_Jynx, + gMonFootprint_Electabuzz, + gMonFootprint_Magmar, + gMonFootprint_Pinsir, + gMonFootprint_Tauros, + gMonFootprint_Magikarp, + gMonFootprint_Gyarados, + gMonFootprint_Lapras, + gMonFootprint_Ditto, + gMonFootprint_Eevee, + gMonFootprint_Vaporeon, + gMonFootprint_Jolteon, + gMonFootprint_Flareon, + gMonFootprint_Porygon, + gMonFootprint_Omanyte, + gMonFootprint_Omastar, + gMonFootprint_Kabuto, + gMonFootprint_Kabutops, + gMonFootprint_Aerodactyl, + gMonFootprint_Snorlax, + gMonFootprint_Articuno, + gMonFootprint_Zapdos, + gMonFootprint_Moltres, + gMonFootprint_Dratini, + gMonFootprint_Dragonair, + gMonFootprint_Dragonite, + gMonFootprint_Mewtwo, + gMonFootprint_Mew, + gMonFootprint_Chikorita, + gMonFootprint_Bayleef, + gMonFootprint_Meganium, + gMonFootprint_Cyndaquil, + gMonFootprint_Quilava, + gMonFootprint_Typhlosion, + gMonFootprint_Totodile, + gMonFootprint_Croconaw, + gMonFootprint_Feraligatr, + gMonFootprint_Sentret, + gMonFootprint_Furret, + gMonFootprint_Hoothoot, + gMonFootprint_Noctowl, + gMonFootprint_Ledyba, + gMonFootprint_Ledian, + gMonFootprint_Spinarak, + gMonFootprint_Ariados, + gMonFootprint_Crobat, + gMonFootprint_Chinchou, + gMonFootprint_Lanturn, + gMonFootprint_Pichu, + gMonFootprint_Cleffa, + gMonFootprint_Igglybuff, + gMonFootprint_Togepi, + gMonFootprint_Togetic, + gMonFootprint_Natu, + gMonFootprint_Xatu, + gMonFootprint_Mareep, + gMonFootprint_Flaaffy, + gMonFootprint_Ampharos, + gMonFootprint_Bellossom, + gMonFootprint_Marill, + gMonFootprint_Azumarill, + gMonFootprint_Sudowoodo, + gMonFootprint_Politoed, + gMonFootprint_Hoppip, + gMonFootprint_Skiploom, + gMonFootprint_Jumpluff, + gMonFootprint_Aipom, + gMonFootprint_Sunkern, + gMonFootprint_Sunflora, + gMonFootprint_Yanma, + gMonFootprint_Wooper, + gMonFootprint_Quagsire, + gMonFootprint_Espeon, + gMonFootprint_Umbreon, + gMonFootprint_Murkrow, + gMonFootprint_Slowking, + gMonFootprint_Misdreavus, + gMonFootprint_Unown, + gMonFootprint_Wobbuffet, + gMonFootprint_Girafarig, + gMonFootprint_Pineco, + gMonFootprint_Forretress, + gMonFootprint_Dunsparce, + gMonFootprint_Gligar, + gMonFootprint_Steelix, + gMonFootprint_Snubbull, + gMonFootprint_Granbull, + gMonFootprint_Qwilfish, + gMonFootprint_Scizor, + gMonFootprint_Shuckle, + gMonFootprint_Heracross, + gMonFootprint_Sneasel, + gMonFootprint_Teddiursa, + gMonFootprint_Ursaring, + gMonFootprint_Slugma, + gMonFootprint_Magcargo, + gMonFootprint_Swinub, + gMonFootprint_Piloswine, + gMonFootprint_Corsola, + gMonFootprint_Remoraid, + gMonFootprint_Octillery, + gMonFootprint_Delibird, + gMonFootprint_Mantine, + gMonFootprint_Skarmory, + gMonFootprint_Houndour, + gMonFootprint_Houndoom, + gMonFootprint_Kingdra, + gMonFootprint_Phanpy, + gMonFootprint_Donphan, + gMonFootprint_Porygon2, + gMonFootprint_Stantler, + gMonFootprint_Smeargle, + gMonFootprint_Tyrogue, + gMonFootprint_Hitmontop, + gMonFootprint_Smoochum, + gMonFootprint_Elekid, + gMonFootprint_Magby, + gMonFootprint_Miltank, + gMonFootprint_Blissey, + gMonFootprint_Raikou, + gMonFootprint_Entei, + gMonFootprint_Suicune, + gMonFootprint_Larvitar, + gMonFootprint_Pupitar, + gMonFootprint_Tyranitar, + gMonFootprint_Lugia, + gMonFootprint_HoOh, + gMonFootprint_Celebi, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_QuestionMark, + gMonFootprint_Treecko, + gMonFootprint_Grovyle, + gMonFootprint_Sceptile, + gMonFootprint_Torchic, + gMonFootprint_Combusken, + gMonFootprint_Blaziken, + gMonFootprint_Mudkip, + gMonFootprint_Marshtomp, + gMonFootprint_Swampert, + gMonFootprint_Poochyena, + gMonFootprint_Mightyena, + gMonFootprint_Zigzagoon, + gMonFootprint_Linoone, + gMonFootprint_Wurmple, + gMonFootprint_Silcoon, + gMonFootprint_Beautifly, + gMonFootprint_Cascoon, + gMonFootprint_Dustox, + gMonFootprint_Lotad, + gMonFootprint_Lombre, + gMonFootprint_Ludicolo, + gMonFootprint_Seedot, + gMonFootprint_Nuzleaf, + gMonFootprint_Shiftry, + gMonFootprint_Nincada, + gMonFootprint_Ninjask, + gMonFootprint_Shedinja, + gMonFootprint_Taillow, + gMonFootprint_Swellow, + gMonFootprint_Shroomish, + gMonFootprint_Breloom, + gMonFootprint_Spinda, + gMonFootprint_Wingull, + gMonFootprint_Pelipper, + gMonFootprint_Surskit, + gMonFootprint_Masquerain, + gMonFootprint_Wailmer, + gMonFootprint_Wailord, + gMonFootprint_Skitty, + gMonFootprint_Delcatty, + gMonFootprint_Kecleon, + gMonFootprint_Baltoy, + gMonFootprint_Claydol, + gMonFootprint_Nosepass, + gMonFootprint_Torkoal, + gMonFootprint_Sableye, + gMonFootprint_Barboach, + gMonFootprint_Whiscash, + gMonFootprint_Luvdisc, + gMonFootprint_Corphish, + gMonFootprint_Crawdaunt, + gMonFootprint_Feebas, + gMonFootprint_Milotic, + gMonFootprint_Carvanha, + gMonFootprint_Sharpedo, + gMonFootprint_Trapinch, + gMonFootprint_Vibrava, + gMonFootprint_Flygon, + gMonFootprint_Makuhita, + gMonFootprint_Hariyama, + gMonFootprint_Electrike, + gMonFootprint_Manectric, + gMonFootprint_Numel, + gMonFootprint_Camerupt, + gMonFootprint_Spheal, + gMonFootprint_Sealeo, + gMonFootprint_Walrein, + gMonFootprint_Cacnea, + gMonFootprint_Cacturne, + gMonFootprint_Snorunt, + gMonFootprint_Glalie, + gMonFootprint_Lunatone, + gMonFootprint_Solrock, + gMonFootprint_Azurill, + gMonFootprint_Spoink, + gMonFootprint_Grumpig, + gMonFootprint_Plusle, + gMonFootprint_Minun, + gMonFootprint_Mawile, + gMonFootprint_Meditite, + gMonFootprint_Medicham, + gMonFootprint_Swablu, + gMonFootprint_Altaria, + gMonFootprint_Wynaut, + gMonFootprint_Duskull, + gMonFootprint_Dusclops, + gMonFootprint_Roselia, + gMonFootprint_Slakoth, + gMonFootprint_Vigoroth, + gMonFootprint_Slaking, + gMonFootprint_Gulpin, + gMonFootprint_Swalot, + gMonFootprint_Tropius, + gMonFootprint_Whismur, + gMonFootprint_Loudred, + gMonFootprint_Exploud, + gMonFootprint_Clamperl, + gMonFootprint_Huntail, + gMonFootprint_Gorebyss, + gMonFootprint_Absol, + gMonFootprint_Shuppet, + gMonFootprint_Banette, + gMonFootprint_Seviper, + gMonFootprint_Zangoose, + gMonFootprint_Relicanth, + gMonFootprint_Aron, + gMonFootprint_Lairon, + gMonFootprint_Aggron, + gMonFootprint_Castform, + gMonFootprint_Volbeat, + gMonFootprint_Illumise, + gMonFootprint_Lileep, + gMonFootprint_Cradily, + gMonFootprint_Anorith, + gMonFootprint_Armaldo, + gMonFootprint_Ralts, + gMonFootprint_Kirlia, + gMonFootprint_Gardevoir, + gMonFootprint_Bagon, + gMonFootprint_Shelgon, + gMonFootprint_Salamence, + gMonFootprint_Beldum, + gMonFootprint_Metang, + gMonFootprint_Metagross, + gMonFootprint_Regirock, + gMonFootprint_Regice, + gMonFootprint_Registeel, + gMonFootprint_Kyogre, + gMonFootprint_Groudon, + gMonFootprint_Rayquaza, + gMonFootprint_Latias, + gMonFootprint_Latios, + gMonFootprint_Jirachi, + gMonFootprint_Deoxys, + gMonFootprint_Chimecho, + gMonFootprint_Bulbasaur, +}; +const u8 gUnknown_083B5558[] = _("{CLEAR_TO 0}"); +const u8 gUnknown_083B555C[] = INCBIN_U8("graphics/unknown/unknown_3B555C.bin"); +const struct OamData gOamData_83B557C = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 3, + .tileNum = 0, + .priority = 1, + .paletteNum = 0, + .affineParam = 0, +}; +void *const gUnknown_083B5584[] = +{ + (void *)0x02008000, + (void *)0x0200C000, + (void *)0x02010000, + (void *)0x02014000, +}; +const struct SpriteFrameImage gSpriteImageTable_83B5594[] = +{ + {(u8 *)0x02008000, 0x800}, + {(u8 *)0x02008800, 0x800}, + {(u8 *)0x02009000, 0x800}, + {(u8 *)0x02009800, 0x800}, + {(u8 *)0x0200A000, 0x800}, + {(u8 *)0x0200A800, 0x800}, + {(u8 *)0x0200B000, 0x800}, + {(u8 *)0x0200B800, 0x800}, + {(u8 *)0x0200C000, 0x800}, + {(u8 *)0x0200C800, 0x800}, + {(u8 *)0x0200D000, 0x800}, + {(u8 *)0x0200D800, 0x800}, + {(u8 *)0x0200E000, 0x800}, + {(u8 *)0x0200E800, 0x800}, + {(u8 *)0x0200F000, 0x800}, + {(u8 *)0x0200F800, 0x800}, +}; +const struct SpriteFrameImage gSpriteImageTable_83B5614[] = +{ + {(u8 *)0x0200C000, 0x800}, + {(u8 *)0x0200C800, 0x800}, + {(u8 *)0x0200D000, 0x800}, + {(u8 *)0x0200D800, 0x800}, + {(u8 *)0x0200E000, 0x800}, + {(u8 *)0x0200E800, 0x800}, + {(u8 *)0x0200F000, 0x800}, + {(u8 *)0x0200F800, 0x800}, + {(u8 *)0x02010000, 0x800}, + {(u8 *)0x02010800, 0x800}, + {(u8 *)0x02011000, 0x800}, + {(u8 *)0x02011800, 0x800}, + {(u8 *)0x02012000, 0x800}, + {(u8 *)0x02012800, 0x800}, + {(u8 *)0x02013000, 0x800}, + {(u8 *)0x02013800, 0x800}, +}; +const struct SpriteFrameImage gSpriteImageTable_83B5694[] = +{ + {(u8 *)0x02010000, 0x800}, + {(u8 *)0x02010800, 0x800}, + {(u8 *)0x02011000, 0x800}, + {(u8 *)0x02011800, 0x800}, + {(u8 *)0x02012000, 0x800}, + {(u8 *)0x02012800, 0x800}, + {(u8 *)0x02013000, 0x800}, + {(u8 *)0x02013800, 0x800}, + {(u8 *)0x02014000, 0x800}, + {(u8 *)0x02014800, 0x800}, + {(u8 *)0x02015000, 0x800}, + {(u8 *)0x02015800, 0x800}, + {(u8 *)0x02016000, 0x800}, + {(u8 *)0x02016800, 0x800}, + {(u8 *)0x02017000, 0x800}, + {(u8 *)0x02017800, 0x800}, +}; +const struct SpriteFrameImage gSpriteImageTable_83B5714[] = +{ + {(u8 *)0x02014000, 0x800}, + {(u8 *)0x02014800, 0x800}, + {(u8 *)0x02015000, 0x800}, + {(u8 *)0x02015800, 0x800}, + {(u8 *)0x02016000, 0x800}, + {(u8 *)0x02016800, 0x800}, + {(u8 *)0x02017000, 0x800}, + {(u8 *)0x02017800, 0x800}, + {(u8 *)0x02018000, 0x800}, + {(u8 *)0x02018800, 0x800}, + {(u8 *)0x02019000, 0x800}, + {(u8 *)0x02019800, 0x800}, + {(u8 *)0x0201A000, 0x800}, + {(u8 *)0x0201A800, 0x800}, + {(u8 *)0x0201B000, 0x800}, + {(u8 *)0x0201B800, 0x800}, +}; +const struct SpriteFrameImage *const gUnknown_083B5794[] = +{ + gSpriteImageTable_83B5594, + gSpriteImageTable_83B5614, + gSpriteImageTable_83B5694, + gSpriteImageTable_83B5714, +}; +static void nullsub_59(struct Sprite *); +const struct SpriteTemplate gUnknown_083B57A4 = +{ + .tileTag = 0xFFFF, + .paletteTag = 0, + .oam = &gOamData_83B557C, + .anims = NULL, + .images = gSpriteImageTable_83B5594, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = nullsub_59, +}; +const u8 gUnknown_083B57BC[][4] = +{ + {0, 0, 0, 0}, + {CHAR_A, 3, CHAR_a, 3}, + {CHAR_D, 3, CHAR_d, 3}, + {CHAR_G, 3, CHAR_g, 3}, + {CHAR_J, 3, CHAR_j, 3}, + {CHAR_M, 3, CHAR_m, 3}, + {CHAR_P, 3, CHAR_p, 3}, + {CHAR_S, 3, CHAR_s, 3}, + {CHAR_V, 3, CHAR_v, 3}, + {CHAR_Y, 2, CHAR_y, 2}, +}; +const struct UnknownStruct3 gUnknown_083B57E4[] = +{ + {DexText_SearchForPoke, 0, 0, 5}, + {DexText_SwitchDex, 6, 0, 5}, + {DexText_ReturnToDex, 12, 0, 5}, +}; +const struct UnknownStruct4 gUnknown_083B57FC[] = +{ + {DexText_ListByABC, 0, 2, 5, 5, 2, 12}, + {DexText_ListByColor, 0, 4, 5, 5, 4, 12}, + {DexText_ListByType, 0, 6, 5, 5, 6, 6}, + {DexText_ListByType, 0, 6, 5, 11, 6, 6}, + {DexText_SelectDexList, 0, 8, 5, 5, 8, 12}, + {DexText_SelectDexMode, 0, 10, 5, 5, 10, 12}, + {DexText_ExecuteSearchSwitch, 0, 12, 5, 0, 0, 0}, +}; +const u8 gUnknown_083B5850[][4] = +{ + {0xFF, 0xFF, 0xFF, 1}, + {0xFF, 0xFF, 0, 2}, + {0xFF, 3, 1, 4}, + { 2, 0xFF, 1, 4}, + {0xFF, 0xFF, 2, 5}, + {0xFF, 0xFF, 4, 6}, + {0xFF, 0xFF, 5, 0xFF}, +}; +const u8 gUnknown_083B586C[][4] = +{ + {0xFF, 0xFF, 0xFF, 0xFF}, + {0xFF, 0xFF, 0xFF, 0xFF}, + {0xFF, 0xFF, 0xFF, 0xFF}, + {0xFF, 0xFF, 0xFF, 0xFF}, + {0xFF, 0xFF, 0xFF, 5}, + {0xFF, 0xFF, 4, 6}, + {0xFF, 0xFF, 5, 0xFF}, +}; +const u8 gUnknown_083B5888[][4] = +{ + {0xFF, 0xFF, 0xFF, 1}, + {0xFF, 0xFF, 0, 2}, + {0xFF, 3, 1, 4}, + { 2, 0xFF, 1, 4}, + {0xFF, 0xFF, 2, 6}, + {0xFF, 0xFF, 0xFF, 0xFF}, + {0xFF, 0xFF, 4, 0xFF}, +}; +const u8 gUnknown_083B58A4[][4] = +{ + {0xFF, 0xFF, 0xFF, 0xFF}, + {0xFF, 0xFF, 0xFF, 0xFF}, + {0xFF, 0xFF, 0xFF, 0xFF}, + {0xFF, 0xFF, 0xFF, 0xFF}, + {0xFF, 0xFF, 0xFF, 6}, + {0xFF, 0xFF, 0xFF, 0xFF}, + {0xFF, 0xFF, 4, 0xFF}, +}; +const struct UnknownStruct2 gUnknown_083B58C0[] = +{ + {DexText_HoennDex2, DexText_HoennDex}, + {DexText_NationalDex2, DexText_NationalDex}, + {NULL, NULL}, +}; +const struct UnknownStruct2 gUnknown_083B58D8[] = +{ + {DexText_ListByNumber, DexText_NumericalMode}, + {DexText_ListByABC2, DexText_ABCMode}, + {DexText_ListByHeavyToLightest, DexText_HeaviestMode}, + {DexText_ListByLightToHeaviest, DexText_LightestMode}, + {DexText_ListByTallToSmallest, DexText_TallestMode}, + {DexText_ListBySmallToTallest, DexText_SmallestMode}, + {NULL, NULL}, +}; +const struct UnknownStruct2 gUnknown_083B5910[] = +{ + {DexText_Terminator5, DexText_DontSpecify}, + {DexText_Terminator5, DexText_ABC}, + {DexText_Terminator5, DexText_DEF}, + {DexText_Terminator5, DexText_GHI}, + {DexText_Terminator5, DexText_JKL}, + {DexText_Terminator5, DexText_MNO}, + {DexText_Terminator5, DexText_PQR}, + {DexText_Terminator5, DexText_STU}, + {DexText_Terminator5, DexText_VWX}, + {DexText_Terminator5, DexText_YZ}, + {NULL, NULL}, +}; +const struct UnknownStruct2 gUnknown_083B5968[] = +{ + {DexText_Terminator5, DexText_DontSpecify}, + {DexText_Terminator5, DexText_Red}, + {DexText_Terminator5, DexText_Blue}, + {DexText_Terminator5, DexText_Yellow}, + {DexText_Terminator5, DexText_Green}, + {DexText_Terminator5, DexText_Black}, + {DexText_Terminator5, DexText_Brown}, + {DexText_Terminator5, DexText_Purple}, + {DexText_Terminator5, DexText_Gray}, + {DexText_Terminator5, DexText_White}, + {DexText_Terminator5, DexText_Pink}, + {NULL, NULL}, +}; +const struct UnknownStruct2 gUnknown_083B59C8[] = +{ + {DexText_Terminator5, DexText_None}, + {DexText_Terminator5, gTypeNames[TYPE_NORMAL]}, + {DexText_Terminator5, gTypeNames[TYPE_FIGHTING]}, + {DexText_Terminator5, gTypeNames[TYPE_FLYING]}, + {DexText_Terminator5, gTypeNames[TYPE_POISON]}, + {DexText_Terminator5, gTypeNames[TYPE_GROUND]}, + {DexText_Terminator5, gTypeNames[TYPE_ROCK]}, + {DexText_Terminator5, gTypeNames[TYPE_BUG]}, + {DexText_Terminator5, gTypeNames[TYPE_GHOST]}, + {DexText_Terminator5, gTypeNames[TYPE_STEEL]}, + {DexText_Terminator5, gTypeNames[TYPE_FIRE]}, + {DexText_Terminator5, gTypeNames[TYPE_WATER]}, + {DexText_Terminator5, gTypeNames[TYPE_GRASS]}, + {DexText_Terminator5, gTypeNames[TYPE_ELECTRIC]}, + {DexText_Terminator5, gTypeNames[TYPE_PSYCHIC]}, + {DexText_Terminator5, gTypeNames[TYPE_ICE]}, + {DexText_Terminator5, gTypeNames[TYPE_DRAGON]}, + {DexText_Terminator5, gTypeNames[TYPE_DARK]}, + {NULL, NULL}, +}; +const u8 gUnknown_083B5A60[] = {0, 1}; +const u8 gUnknown_083B5A62[] = {0, 1, 2, 3, 4, 5}; +const u8 gUnknown_083B5A68[] = {0xFF, 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17}; +const struct UnknownStruct1 gUnknown_083B5A7C[] = +{ + {gUnknown_083B5910, 6, 7, 10}, + {gUnknown_083B5968, 8, 9, 11}, + {gUnknown_083B59C8, 10, 11, 18}, + {gUnknown_083B59C8, 12, 13, 18}, + {gUnknown_083B58D8, 4, 5, 6}, + {gUnknown_083B58C0, 2, 3, 2}, +}; +const u8 gUnknown_083B5AAC[] = _("{STR_VAR_1}{CLEAR_TO 43}"); +const u8 gUnknown_083B5AB2[] = _("{STR_VAR_1}{CLEAR_TO 96}"); static u32 sub_808E8C8(u16 a, s16 b, s16 c); static u8 sub_808F210(struct PokedexListItem *, u8); @@ -1771,30 +1337,30 @@ void CB2_InitPokedex(void) { case 0: default: - { - u8 *addr; - u32 size; - - SetVBlankCallback(NULL); - sub_8091060(0); - addr = (u8 *)VRAM; - size = VRAM_SIZE; - while (1) { - DmaFill16(3, 0, addr, 0x1000); - addr += 0x1000; - size -= 0x1000; - if (size <= 0x1000) + u8 *addr; + u32 size; + + SetVBlankCallback(NULL); + sub_8091060(0); + addr = (u8 *)VRAM; + size = VRAM_SIZE; + while (1) { - DmaFill16(3, 0, addr, size); - break; + DmaFill16(3, 0, addr, 0x1000); + addr += 0x1000; + size -= 0x1000; + if (size <= 0x1000) + { + DmaFill16(3, 0, addr, size); + break; + } } + DmaClear32(3, OAM, OAM_SIZE); + DmaClear16(3, PLTT, PLTT_SIZE); + gMain.state = 1; } - DmaClear32(3, OAM, OAM_SIZE); - DmaClear16(3, PLTT, PLTT_SIZE); - gMain.state = 1; break; - } case 1: remove_some_task(); ResetTasks(); @@ -1847,19 +1413,20 @@ void CB2_InitPokedex(void) gMain.state++; break; case 3: - { - u16 savedIme; - - savedIme = REG_IME; - REG_IME = 0; - REG_IE |= 1; - REG_IME = savedIme; - REG_DISPSTAT |= 8; - SetVBlankCallback(sub_808C0B8); - SetMainCallback2(MainCB); - SortPokedex(gPokedexView->dexMode, gPokedexView->dexOrder); - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x80); - } + { + u16 savedIme; + + savedIme = REG_IME; + REG_IME = 0; + REG_IE |= 1; + REG_IME = savedIme; + REG_DISPSTAT |= 8; + SetVBlankCallback(sub_808C0B8); + SetMainCallback2(MainCB); + SortPokedex(gPokedexView->dexMode, gPokedexView->dexOrder); + m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x80); + } + break; } } @@ -2310,7 +1877,7 @@ bool8 sub_808D344(u8 a) ResetSpriteData(); FreeAllSpritePalettes(); gReservedSpritePaletteCount = 8; - LoadCompressedObjectPic(&gUnknown_083A05CC); + LoadCompressedObjectPic(&gUnknown_083A05CC[0]); LoadSpritePalettes(gUnknown_083A05DC); sub_808E978(a); gMain.state++; @@ -4164,7 +3731,7 @@ void Task_InitSizeScreenMultistep(u8 taskId) gSprites[spriteId].oam.priority = 0; gSprites[spriteId].pos2.y = gPokedexEntries[gUnknown_0202FFBC->dexNum].trainerOffset; SetOamMatrix(1, gPokedexEntries[gUnknown_0202FFBC->dexNum].trainerScale, 0, 0, gPokedexEntries[gUnknown_0202FFBC->dexNum].trainerScale); - LoadPalette(gUnknown_083B4EC4, (gSprites[spriteId].oam.paletteNum + 16) * 16, 0x20); + LoadPalette(gUnknown_083B4EC4, (gSprites[spriteId].oam.paletteNum + 16) * 16, sizeof(gUnknown_083B4EC4)); gMain.state++; break; case 6: @@ -4174,7 +3741,7 @@ void Task_InitSizeScreenMultistep(u8 taskId) gSprites[spriteId].oam.priority = 0; gSprites[spriteId].pos2.y = gPokedexEntries[gUnknown_0202FFBC->dexNum].pokemonOffset; SetOamMatrix(2, gPokedexEntries[gUnknown_0202FFBC->dexNum].pokemonScale, 0, 0, gPokedexEntries[gUnknown_0202FFBC->dexNum].pokemonScale); - LoadPalette(gUnknown_083B4EC4, (gSprites[spriteId].oam.paletteNum + 16) * 16, 0x20); + LoadPalette(gUnknown_083B4EC4, (gSprites[spriteId].oam.paletteNum + 16) * 16, sizeof(gUnknown_083B4EC4)); gMain.state++; break; case 7: @@ -5423,9 +4990,6 @@ void sub_8091458(u16 height, u8 left, u8 top) #endif #ifdef UNITS_IMPERIAL -#define CHAR_b (0xD6) -#define CHAR_l (0xE0) -#define CHAR_s (0xE7) void sub_8091564(u16 weight, u8 left, u8 top) { u8 buffer[16]; @@ -5564,7 +5128,7 @@ u16 sub_8091818(u8 a, u16 b, u16 c, u16 d) return b; } -void nullsub_59(void) +static void nullsub_59(struct Sprite *sprite) { } @@ -5804,7 +5368,7 @@ void sub_8091E54(u8 taskId) case 1: SetUpWindowConfig(&gWindowConfig_81E7064); InitMenuWindow(&gWindowConfig_81E7064); - LoadCompressedObjectPic(&gUnknown_083A05CC); + LoadCompressedObjectPic(&gUnknown_083A05CC[0]); LoadSpritePalettes(gUnknown_083A05DC); sub_809308C(taskId); for (i = 0; i < 16; i++) -- cgit v1.2.3 From c8f941f5e3604c8cf1929d30890f935e2a47c450 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Thu, 15 Jun 2017 01:41:20 -0500 Subject: make it build again --- src/pokedex.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/pokedex.c b/src/pokedex.c index e676dfbe4..97818eacb 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -1218,6 +1218,7 @@ static u8 sub_808F210(struct PokedexListItem *, u8); static u8 sub_808F284(struct PokedexListItem *, u8); void sub_8090B8C(u8); void sub_8090C28(struct Sprite *); +s8 GetNationalPokedexFlag(u16, u8); u16 sub_80918EC(u16 a, s16 b, s16 c, u16 d); //Not sure of return type void sub_8091E54(u8); void sub_809204C(u8); @@ -1273,7 +1274,7 @@ void sub_808C0A0(void) gUnknown_0202FFBA = 0x40; } -void sub_808C0B8(void) +static void sub_808C0B8(void) { LoadOam(); ProcessSpriteCopyRequests(); @@ -2014,7 +2015,7 @@ void SortPokedex(u8 dexMode, u8 sortMode) { gPokedexView->unk0[gPokedexView->pokemonListCount].dexNum = vars[2]; gPokedexView->unk0[gPokedexView->pokemonListCount].seen = 1; - gPokedexView->unk0[gPokedexView->pokemonListCount].owned = sub_8090D90(vars[2], 1); + gPokedexView->unk0[gPokedexView->pokemonListCount].owned = GetNationalPokedexFlag(vars[2], 1); gPokedexView->pokemonListCount++; } } @@ -4655,7 +4656,7 @@ u16 GetPokedexHeightWeight(u16 dexNum, u8 data) } } -s8 sub_8090D90(u16 a, u8 b) +s8 GetNationalPokedexFlag(u16 a, u8 b) { u8 index; u8 bit; @@ -4723,11 +4724,11 @@ u16 GetNationalPokedexCount(u8 a) switch (a) { case 0: - if (sub_8090D90(i + 1, 0) != 0) + if (GetNationalPokedexFlag(i + 1, 0) != 0) count++; break; case 1: - if (sub_8090D90(i + 1, 1) != 0) + if (GetNationalPokedexFlag(i + 1, 1) != 0) count++; break; } @@ -4745,11 +4746,11 @@ u16 GetHoennPokedexCount(u8 a) switch (a) { case 0: - if (sub_8090D90(HoennToNationalOrder(i + 1), 0) != 0) + if (GetNationalPokedexFlag(HoennToNationalOrder(i + 1), 0) != 0) count++; break; case 1: - if (sub_8090D90(HoennToNationalOrder(i + 1), 1) != 0) + if (GetNationalPokedexFlag(HoennToNationalOrder(i + 1), 1) != 0) count++; break; } @@ -4763,7 +4764,7 @@ bool8 sub_8090FC0(void) for (i = 0; i < 200; i++) { - if (sub_8090D90(HoennToNationalOrder(i + 1), 1) == 0) + if (GetNationalPokedexFlag(HoennToNationalOrder(i + 1), 1) == 0) return FALSE; } return TRUE; @@ -4775,17 +4776,17 @@ u16 sub_8090FF4(void) for (i = 0; i < 150; i++) { - if (sub_8090D90(i + 1, 1) == 0) + if (GetNationalPokedexFlag(i + 1, 1) == 0) return 0; } for (i = 152; i < 250; i++) { - if (sub_8090D90(i + 1, 1) == 0) + if (GetNationalPokedexFlag(i + 1, 1) == 0) return 0; } for (i = 252; i < 384; i++) { - if (sub_8090D90(i + 1, 1) == 0) + if (GetNationalPokedexFlag(i + 1, 1) == 0) return 0; } return 1; -- cgit v1.2.3 From 8435b8835a9b5c5348b2849e943e36ffdd8c76b3 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Thu, 15 Jun 2017 03:34:11 -0400 Subject: move player_pc data to C file and do a lot of labeling --- src/battle_setup.c | 4 +- src/decoration.c | 14 +- src/fldeff_cut.c | 6 +- src/fldeff_strength.c | 6 +- src/fldeff_sweetscent.c | 4 +- src/fldeff_teleport.c | 4 +- src/hof_pc.c | 4 +- src/item_use.c | 10 +- src/player_pc.c | 598 ++++++++++++++++++++------------------ src/rom4.c | 26 +- src/rom6.c | 6 +- src/safari_zone.c | 4 +- src/script_pokemon_util_80F99CC.c | 4 +- src/secret_base.c | 6 +- 14 files changed, 357 insertions(+), 339 deletions(-) (limited to 'src') diff --git a/src/battle_setup.c b/src/battle_setup.c index a70157a43..cb99bf5f5 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -31,7 +31,7 @@ extern u16 gScriptResult; -extern void (*gUnknown_0300485C)(void); +extern void (*gFieldCallback)(void); extern struct Pokemon gEnemyParty[]; extern struct Pokemon gPlayerParty[]; @@ -580,7 +580,7 @@ void HandleWildBattleEnd(void) else { SetMainCallback2(c2_exit_to_overworld_2_switch); - gUnknown_0300485C = sub_8080E44; + gFieldCallback = sub_8080E44; } } diff --git a/src/decoration.c b/src/decoration.c index d33931206..6974f7c92 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -3168,7 +3168,7 @@ void sub_8100038(u8 taskId) void sub_81000A0(u8 taskId) { DisplayYesNoMenu(20, 8, 1); - sub_80F914C(taskId, &gUnknown_083EC95C); + DoYesNoFuncWithChoice(taskId, &gUnknown_083EC95C); } void sub_81000C4(u8 taskId) @@ -3226,7 +3226,7 @@ void sub_8100174(u8 taskId) void sub_8100248(u8 taskId) { DisplayYesNoMenu(20, 8, 1); - sub_80F914C(taskId, &gUnknown_083EC964); + DoYesNoFuncWithChoice(taskId, &gUnknown_083EC964); } void sub_810026C(u8 taskId) @@ -3257,7 +3257,7 @@ void c1_overworld_prev_quest(u8 taskId) case 1: sub_81016F4(); FreeSpritePaletteByTag(0xbb8); - gUnknown_0300485C = &sub_8100364; + gFieldCallback = &sub_8100364; SetMainCallback2(c2_exit_to_overworld_2_switch); DestroyTask(taskId); break; @@ -4047,7 +4047,7 @@ void sub_8101460(u8 taskId) void sub_8101518(u8 taskId) { DisplayYesNoMenu(20, 8, 1); - sub_80F914C(taskId, &gUnknown_083EC9CC); + DoYesNoFuncWithChoice(taskId, &gUnknown_083EC9CC); } void sub_810153C(u8 taskId) @@ -4060,7 +4060,7 @@ void sub_810153C(u8 taskId) void sub_810156C(u8 taskId) { DisplayYesNoMenu(20, 8, 1); - sub_80F914C(taskId, &gUnknown_083EC9D4); + DoYesNoFuncWithChoice(taskId, &gUnknown_083EC9D4); } void sub_8101590(u8 taskId) @@ -4089,7 +4089,7 @@ void sub_81015E0(u8 taskId) break; case 1: sub_81016F4(); - gUnknown_0300485C = sub_8101678; + gFieldCallback = sub_8101678; SetMainCallback2(c2_exit_to_overworld_2_switch); DestroyTask(taskId); break; @@ -4184,7 +4184,7 @@ void sub_81017A0(u8 taskId) void sub_8101824(u8 taskId) { DisplayYesNoMenu(20, 8, 1); - sub_80F914C(taskId, &gUnknown_083ECAA0); + DoYesNoFuncWithChoice(taskId, &gUnknown_083ECAA0); } void sub_8101848(u8 taskId) diff --git a/src/fldeff_cut.c b/src/fldeff_cut.c index 8fde74852..4a2313499 100644 --- a/src/fldeff_cut.c +++ b/src/fldeff_cut.c @@ -16,7 +16,7 @@ extern u8 gCutGrassSpriteArray[8]; // seems to be an array of 8 sprite IDs -extern void (*gUnknown_0300485C)(void); +extern void (*gFieldCallback)(void); extern void (*gUnknown_03005CE4)(void); extern struct SpriteTemplate gSpriteTemplate_CutGrass; @@ -48,7 +48,7 @@ bool8 SetUpFieldMove_Cut(void) if(npc_before_player_of_type(0x52) == TRUE) // is in front of tree? { - gUnknown_0300485C = sub_808AB90; + gFieldCallback = sub_808AB90; gUnknown_03005CE4 = sub_80A2634; return TRUE; } @@ -67,7 +67,7 @@ bool8 SetUpFieldMove_Cut(void) if(MetatileBehavior_IsPokeGrass(tileBehavior) == TRUE || MetatileBehavior_IsAshGrass(tileBehavior) == TRUE) { - gUnknown_0300485C = sub_808AB90; + gFieldCallback = sub_808AB90; gUnknown_03005CE4 = sub_80A25E8; return TRUE; } diff --git a/src/fldeff_strength.c b/src/fldeff_strength.c index f9db40a67..a831676b8 100644 --- a/src/fldeff_strength.c +++ b/src/fldeff_strength.c @@ -16,7 +16,7 @@ extern u32 gUnknown_0202FF84[]; extern u8 gLastFieldPokeMenuOpened; extern u16 gScriptResult; -extern void (*gUnknown_0300485C)(void); +extern void (*gFieldCallback)(void); extern void (*gUnknown_03005CE4)(void); extern u8 UseStrengthScript[]; @@ -26,7 +26,7 @@ bool8 SetUpFieldMove_Strength(void) if (ShouldDoBrailleStrengthEffect()) { gScriptResult = gLastFieldPokeMenuOpened; - gUnknown_0300485C = sub_808AB90; + gFieldCallback = sub_808AB90; gUnknown_03005CE4 = sub_811AA38; } else @@ -34,7 +34,7 @@ bool8 SetUpFieldMove_Strength(void) if (npc_before_player_of_type(87) != TRUE) return 0; gScriptResult = gLastFieldPokeMenuOpened; - gUnknown_0300485C = sub_808AB90; + gFieldCallback = sub_808AB90; gUnknown_03005CE4 = sub_811AA18; } diff --git a/src/fldeff_sweetscent.c b/src/fldeff_sweetscent.c index 4e8214b07..3a9281ac2 100644 --- a/src/fldeff_sweetscent.c +++ b/src/fldeff_sweetscent.c @@ -18,14 +18,14 @@ static void sub_812C118(u8); extern u32 gUnknown_0202FF84[]; extern u8 gLastFieldPokeMenuOpened; -extern void (*gUnknown_0300485C)(void); +extern void (*gFieldCallback)(void); extern void (*gUnknown_03005CE4)(void); extern u8 SweetScentNothingHereScript[]; bool8 SetUpFieldMove_SweetScent(void) { - gUnknown_0300485C = sub_808AB90; + gFieldCallback = sub_808AB90; gUnknown_03005CE4 = sub_812BFD4; return TRUE; } diff --git a/src/fldeff_teleport.c b/src/fldeff_teleport.c index 0e6933649..952193ff0 100644 --- a/src/fldeff_teleport.c +++ b/src/fldeff_teleport.c @@ -9,7 +9,7 @@ extern void sub_8087BA8(void); extern u32 gUnknown_0202FF84[]; -extern void (*gUnknown_0300485C)(void); +extern void (*gFieldCallback)(void); extern u8 gLastFieldPokeMenuOpened; extern void (*gUnknown_03005CE4)(void); @@ -20,7 +20,7 @@ bool8 SetUpFieldMove_Teleport(void) { if (is_light_level_1_2_3_or_6(gMapHeader.mapType) == TRUE) { - gUnknown_0300485C = sub_808AB90; + gFieldCallback = sub_808AB90; gUnknown_03005CE4 = hm_teleport_run_dp02scr; return TRUE; } diff --git a/src/hof_pc.c b/src/hof_pc.c index fcbc3f7e1..ca0c2f370 100644 --- a/src/hof_pc.c +++ b/src/hof_pc.c @@ -7,7 +7,7 @@ #include "task.h" extern void sub_81428CC(void); -extern void (*gUnknown_0300485C)(void); +extern void (*gFieldCallback)(void); static void ReshowPCMenuAfterHallOfFamePC(void); static void Task_WaitForPaletteFade(u8); @@ -21,7 +21,7 @@ void AccessHallOfFamePC(void) void ReturnFromHallOfFamePC(void) { SetMainCallback2(c2_exit_to_overworld_2_switch); - gUnknown_0300485C = ReshowPCMenuAfterHallOfFamePC; + gFieldCallback = ReshowPCMenuAfterHallOfFamePC; } static void ReshowPCMenuAfterHallOfFamePC(void) diff --git a/src/item_use.c b/src/item_use.c index d1c1dbf2a..c04cf9d7a 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -28,7 +28,7 @@ #include "vars.h" extern void (* gUnknown_03005D00)(u8); -extern void (* gUnknown_0300485C)(void); +extern void (* gFieldCallback)(void); extern void (* gUnknown_03004AE4)(u8); extern u8 gUnknown_02038561; @@ -150,7 +150,7 @@ void SetUpItemUseOnFieldCallback(u8 taskId) { if (gTasks[taskId].data[2] != 1) { - gUnknown_0300485C = (void *)ExecuteItemUseFromBlackPalette; + gFieldCallback = (void *)ExecuteItemUseFromBlackPalette; ItemMenu_ConfirmNormalFade(taskId); } else @@ -772,7 +772,7 @@ void ItemUseOutOfBattle_PokeblockCase(u8 taskId) } else { - gUnknown_0300485C = (void *)sub_8080E28; + gFieldCallback = (void *)sub_8080E28; sub_810BA7C(1); ItemMenu_ConfirmComplexFade(taskId); } @@ -825,7 +825,7 @@ void sub_80C9C7C(u8 taskId) if(IsPlayerFacingPlantedBerryTree() == TRUE) { gUnknown_03005D00 = sub_80C9D00; - gUnknown_0300485C = ExecuteItemUseFromBlackPalette; + gFieldCallback = ExecuteItemUseFromBlackPalette; gTasks[taskId].data[8] = (u32)c2_exit_to_overworld_2_switch >> 16; gTasks[taskId].data[9] = (u32)c2_exit_to_overworld_2_switch; gTasks[taskId].func = HandleItemMenuPaletteFade; @@ -944,7 +944,7 @@ void sub_80C9F80(u8 var) { DisplayYesNoMenu(7, 7, 1); sub_80A3FA0(gBGTilemapBuffers[1], 8, 8, 5, 4, 1); - sub_80F914C(var, &gUnknown_083D61F4); + DoYesNoFuncWithChoice(var, &gUnknown_083D61F4); } void sub_80C9FC0(u8 var) diff --git a/src/player_pc.c b/src/player_pc.c index f39d812b6..26dc8ccdc 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -16,152 +16,169 @@ #include "name_string_util.h" #include "mail.h" #include "rom4.h" +#include "player_pc.h" -// task defines -#define PAGE_INDEX data[0] -#define ITEMS_ABOVE_TOP data[1] -#define NUM_ITEMS data[2] -#define NUM_QUANTITY_ROLLER data[3] -#define NUM_PAGE_ITEMS data[4] -// not used -#define CURRENT_ITEM_STORAGE_MENU data[6] -// not used -#define SWAP_ITEM_INDEX data[8] -#define SWITCH_MODE_ACTIVE data[9] - -#define NEW_GAME_PC_ITEMS(i, type) ((u16)(gNewGamePCItems + type)[i * 2]) - -// defined and used in the above macro -enum -{ - ITEM_ID, - QUANTITY +extern void DisplayItemMessageOnField(u8, const u8*, TaskFunc, u16); +extern void DoPlayerPCDecoration(u8); +extern void BuyMenuFreeMemory(void); +extern void DestroyVerticalScrollIndicator(u8); +extern void PauseVerticalScrollIndicator(u8); +extern void StartVerticalScrollIndicators(int); +extern void CreateVerticalScrollIndicators(u32, u32, u32); // unknown args +extern void LoadScrollIndicatorPalette(void); +extern void ClearMailStruct(struct MailStruct *); +extern u8 sub_807D770(void); +extern void sub_808B020(void); +extern void sub_80A4164(u8 *, u16, enum StringConvertMode, u8); +extern void sub_80A418C(u16, enum StringConvertMode, int, int, int); +extern void sub_80A6A30(void); +extern void sub_80F944C(void); + +extern u8 *gPcItemMenuOptionOrder; +extern u8 gPcItemMenuOptionsNum; + +extern u8 gUnknown_02038561; + +// event scripts +extern u8 gBrendanHouse_TurnPCOff[]; +extern u8 gMayHouse_TurnPCOff[]; + +extern void (*gFieldCallback)(void); + +static void InitPlayerPCMenu(u8 taskId); +static void PlayerPCProcessMenuInput(u8 taskId); +static void InitItemStorageMenu(u8); +static void ItemStorageMenuPrint(const u8 *); +static void ItemStorageMenuProcessInput(u8); +static void ItemStorage_ProcessInput(u8); +static void ItemStorage_SetItemAndMailCount(u8); +static void ItemStorage_DoItemAction(u8); +static void ItemStorage_GoBackToPlayerPCMenu(u8); +static void ItemStorage_HandleQuantityRolling(u8); +static void ItemStorage_DoItemWithdraw(u8); +static void ItemStorage_DoItemToss(u8); +static void ItemStorage_HandleRemoveItem(u8); +static void ItemStorage_WaitPressHandleResumeProcessInput(u8); +static void ItemStorage_HandleResumeProcessInput(u8); +static void ItemStorage_DoItemSwap(u8, bool8); +static void ItemStorage_DrawItemList(u8); +static void ItemStorage_PrintItemPcResponse(u16); +static void ItemStorage_DrawBothListAndDescription(u8); +static void ItemStorage_GoBackToItemPCMenu(u8, u8); +static void ItemStorage_LoadPalette(void); +static u8 GetMailboxMailCount(void); +static void Mailbox_UpdateMailList(void); +static void Mailbox_DrawMailboxMenu(u8); +static void Mailbox_ProcessInput(u8); +static void Mailbox_CloseScrollIndicators(void); +static void Mailbox_PrintWhatToDoWithPlayerMailText(u8); +static void Mailbox_TurnOff(u8); +static void Mailbox_PrintMailOptions(u8); +static void Mailbox_MailOptionsProcessInput(u8); +static void Mailbox_FadeAndReadMail(u8); +static void Mailbox_ReturnToFieldFromReadMail(void); +static void Mailbox_DrawYesNoBeforeMove(u8); +static void Mailbox_DoGiveMailPokeMenu(u8); +static void Mailbox_NoPokemonForMail(u8); +static void Mailbox_Cancel(u8); +static void Mailbox_DrawMailMenuAndDoProcessInput(u8); +static void PlayerPC_ItemStorage(u8 taskId); +static void PlayerPC_Mailbox(u8 taskId); +static void PlayerPC_Decoration(u8 var); +static void PlayerPC_TurnOff(u8 taskId); +static void ItemStorage_Withdraw(u8); +static void ItemStorage_Deposit(u8); +static void ItemStorage_Toss(u8); +static void ItemStorage_Exit(u8); +static void ItemStorage_ResumeInputFromYesToss(u8); +static void ItemStorage_ResumeInputFromNoToss(u8); +static void Mailbox_DoMailMoveToBag(u8); +static void Mailbox_ReturnToInputAfterNo(u8); +static void Mailbox_DoMailRead(u8); +static void Mailbox_MoveToBag(u8); +static void Mailbox_Give(u8); +static void Mailbox_Cancel(u8); + +static const struct TextStruct gPCText_OptionDescList[] = +{ + PCText_TakeOutItems, + PCText_StoreItems, + PCText_ThrowAwayItems, + gMenuText_GoBackToPrev }; -// player PC menu options -enum +static const struct MenuAction2 gPCText_PlayerPCOptionsText[] = { + { SecretBaseText_ItemStorage, PlayerPC_ItemStorage }, + { gPCText_Mailbox, PlayerPC_Mailbox }, + { SecretBaseText_Decoration, PlayerPC_Decoration }, + { SecretBaseText_TurnOff, PlayerPC_TurnOff } +}; + +static const u8 gBedroomPC_OptionOrder[] = +{ PLAYERPC_MENU_ITEMSTORAGE, PLAYERPC_MENU_MAILBOX, PLAYERPC_MENU_DECORATION, PLAYERPC_MENU_TURNOFF }; -// item storage menus -enum +static const u8 gPlayerPC_OptionOrder[] = { - ITEMPC_MENU_WITHDRAW, - ITEMPC_MENU_DEPOSIT, - ITEMPC_MENU_TOSS, - ITEMPC_MENU_EXIT + PLAYERPC_MENU_ITEMSTORAGE, + PLAYERPC_MENU_MAILBOX, + PLAYERPC_MENU_TURNOFF }; -// special item description handlers -enum -{ - ITEMPC_SWITCH_WHICH_ITEM = 0xFFF7, - ITEMPC_OKAY_TO_THROW_AWAY, - ITEMPC_TOO_IMPORTANT, - ITEMPC_NO_MORE_ROOM, - ITEMPC_THREW_AWAY_ITEM, - ITEMPC_HOW_MANY_TO_TOSS, - ITEMPC_WITHDREW_THING, - ITEMPC_HOW_MANY_TO_WITHDRAW, - ITEMPC_GO_BACK_TO_PREV +static const struct MenuAction2 gPCText_ItemPCOptionsText[] = +{ + { PCText_WithdrawItem, ItemStorage_Withdraw }, + { PCText_DepositItem, ItemStorage_Deposit }, + { PCText_TossItem, ItemStorage_Toss }, + { gUnknownText_Exit, ItemStorage_Exit } }; -struct MailboxStruct +static const struct YesNoFuncTable ResumeFromTossYesNoFuncList[] = // ResumeFromTossYesNoFuncList { - /*0x00*/ u8 cursorPos; - /*0x01*/ u8 pageItems; // number of items (not including Cancel) on the current page. - /*0x02*/ u8 itemsAbove; // number of items above the top item on the page. - /*0x03*/ u8 count; // total number of items in mailbox storage. + ItemStorage_ResumeInputFromYesToss, + ItemStorage_ResumeInputFromNoToss }; -extern struct MailboxStruct gMailboxInfo; - -extern void DisplayItemMessageOnField(u8, const u8*, TaskFunc, u16); -extern void DoPlayerPCDecoration(u8); -extern void BuyMenuFreeMemory(void); -extern void DestroyVerticalScrollIndicator(u8); -extern void sub_80A6A30(void); -extern u8 sub_807D770(void); -extern void sub_80F996C(u8); -extern void sub_80A418C(u16, enum StringConvertMode, int, int, int); -extern void sub_80F98DC(int); -extern void sub_80A4164(u8 *, u16, enum StringConvertMode, u8); -extern void CreateVerticalScrollIndicators(u32, u32, u32); // unknown args -extern void sub_80F944C(void); -extern void LoadScrollIndicatorPalette(void); -extern void ClearMailStruct(struct MailStruct *); -extern void sub_808B020(void); +static const struct YesNoFuncTable ResumeFromWithdrawYesNoFuncList[] = // ResumeFromWithdrawYesNoFuncList +{ + Mailbox_DoMailMoveToBag, + Mailbox_ReturnToInputAfterNo +}; -extern u16 gNewGamePCItems[]; -extern u16 gUnknown_08406334[3]; +// the use of this struct is meant to be an ItemSlot struct, but NewGameInitPCItems refuses to match without a weird pointer access. +static const struct ItemSlot gNewGamePCItems[] = +{ + { ITEM_POTION, 1 }, + { ITEM_NONE, 0 } +}; -extern u8 *gPcItemMenuOptionOrder; -extern struct MenuAction gPCText_PlayerPCOptionsText[]; +static const struct MenuAction2 gMailboxMailOptions[] = +{ + { OtherText_Read, Mailbox_DoMailRead }, + { gOtherText_MoveToBag, Mailbox_MoveToBag }, + { OtherText_Give, Mailbox_Give }, + { gOtherText_CancelNoTerminator, Mailbox_Cancel } +}; -extern u8 gBedroomPC_OptionOrder[]; -extern u8 gPlayerPC_OptionOrder[]; -extern u8 gUnknown_0840632A[]; -extern u8 gUnknown_08406327[]; -extern u8 gUnknown_08406330[]; -extern u8 gUnknown_0840631E[]; -extern u8 gUnknown_08406318[]; -extern u8 gUnknown_0840633A[]; +static const u8 gNonSelectedItemFormattedText[] = _("{STR_VAR_1}{CLEAR_TO 80}"); +static const u8 gSelectedItemFormattedText[] = _("{COLOR RED}{STR_VAR_1}{CLEAR_TO 80}"); +static const u8 gNonSelectedItemQuantityFormatText[] = _("{STR_VAR_1}"); +static const u8 gSelectedItemQuantityFormatText[] = _("{COLOR RED}{STR_VAR_1}"); +static const u8 gUnknown_08406330[] = _("{CLEAR_TO 32}"); -extern u8 gPcItemMenuOptionsNum; +static const u16 gUnknown_08406334[3] = +{ + 0x5294, + 0x6B5A, + 0x7FFF +}; -extern u8 gUnknown_02038561; -extern u8 gUnknown_08152850; -extern u8 gUnknown_08152C75; - -extern void (*gUnknown_0300485C)(void); - -extern u32 gPCText_OptionDescList[]; -extern const struct MenuAction gPCText_ItemPCOptionsText[]; -extern const struct MenuAction gUnknown_084062F8[]; -extern const struct YesNoFuncTable gUnknown_084062E0; -extern const struct YesNoFuncTable gUnknown_084062E8; - -void InitPlayerPCMenu(u8 taskId); -void PlayerPCProcessMenuInput(u8 taskId); -void InitItemStorageMenu(u8); -void ItemStorageMenuPrint(u8 *); -void ItemStorageMenuProcessInput(u8); -void ItemStorage_ProcessInput(u8); -void ItemStorage_SetItemAndMailCount(u8); -void ItemStorage_DoItemAction(u8); -void ItemStorage_GoBackToPlayerPCMenu(u8); -void ItemStorage_HandleQuantityRolling(u8); -void ItemStorage_DoItemWithdraw(u8); -void ItemStorage_DoItemToss(u8); -void ItemStorage_HandleRemoveItem(u8); -void ItemStorage_WaitPressHandleResumeProcessInput(u8); -void ItemStorage_HandleResumeProcessInput(u8); -void ItemStorage_DoItemSwap(u8, bool8); -void ItemStorage_DrawItemList(u8); -void ItemStorage_PrintItemPcResponse(u16); -void ItemStorage_DrawBothListAndDescription(u8); -void ItemStorage_GoBackToItemPCMenu(u8, u8); -void ItemStorage_LoadPalette(void); -u8 GetMailboxMailCount(void); -void Mailbox_UpdateMailList(void); -void Mailbox_DrawMailboxMenu(u8); -void Mailbox_ProcessInput(u8); -void sub_813B27C(void); -void sub_813B294(u8); -void sub_813B320(u8); -void sub_813B348(u8); -void sub_813B3A0(u8); -void sub_813B454(u8); -void sub_813B4F0(void); -void sub_813B554(u8); -void sub_813B66C(u8); -void sub_813B718(u8); -void Mailbox_Cancel(u8); -void sub_813B758(u8); +static const u8 gHighlightedMoveToBagFormatText[] = _("{COLOR RED}{STR_VAR_1}"); void NewGameInitPCItems(void) { @@ -175,27 +192,27 @@ void NewGameInitPCItems(void) void BedroomPC(void) { - gPcItemMenuOptionOrder = gBedroomPC_OptionOrder; + gPcItemMenuOptionOrder = (u8 *)gBedroomPC_OptionOrder; gPcItemMenuOptionsNum = 4; DisplayItemMessageOnField(CreateTask(TaskDummy, 0), gOtherText_WhatWillYouDo, InitPlayerPCMenu, 0); } void PlayerPC(void) { - gPcItemMenuOptionOrder = gPlayerPC_OptionOrder; + gPcItemMenuOptionOrder = (u8 *)gPlayerPC_OptionOrder; gPcItemMenuOptionsNum = 3; DisplayItemMessageOnField(CreateTask(TaskDummy, 0), gOtherText_WhatWillYouDo, InitPlayerPCMenu, 0); } -void InitPlayerPCMenu(u8 taskId) +static void InitPlayerPCMenu(u8 taskId) { MenuDrawTextWindow(0, 0, 10, gPcItemMenuOptionsNum * 2 + 1); - PrintMenuItemsReordered(1, 1, gPcItemMenuOptionsNum, gPCText_PlayerPCOptionsText, gPcItemMenuOptionOrder); + PrintMenuItemsReordered(1, 1, gPcItemMenuOptionsNum, (struct MenuAction *)gPCText_PlayerPCOptionsText, gPcItemMenuOptionOrder); InitMenu(0, 1, 1, gPcItemMenuOptionsNum, 0, 9); - gTasks[taskId].func = PlayerPCProcessMenuInput; + TASK.FUNC = PlayerPCProcessMenuInput; } -void PlayerPCProcessMenuInput(u8 taskId) +static void PlayerPCProcessMenuInput(u8 taskId) { if (gMain.newAndRepeatedKeys & DPAD_UP) { @@ -226,13 +243,13 @@ void ReshowPlayerPC(u8 var) DisplayItemMessageOnField(var, gOtherText_WhatWillYouDo, InitPlayerPCMenu, 0); } -void PlayerPC_ItemStorage(u8 taskId) +static void PlayerPC_ItemStorage(u8 taskId) { - InitItemStorageMenu(0); - gTasks[taskId].func = ItemStorageMenuProcessInput; + InitItemStorageMenu(ITEMPC_MENU_WITHDRAW); + TASK.FUNC = ItemStorageMenuProcessInput; } -void PlayerPC_Mailbox(u8 taskId) +static void PlayerPC_Mailbox(u8 taskId) { MenuZeroFillWindowRect(0, 0, 10, 9); gMailboxInfo.count = GetMailboxMailCount(); @@ -246,26 +263,26 @@ void PlayerPC_Mailbox(u8 taskId) Mailbox_UpdateMailList(); ItemStorage_SetItemAndMailCount(taskId); Mailbox_DrawMailboxMenu(taskId); - gTasks[taskId].func = Mailbox_ProcessInput; + TASK.FUNC = Mailbox_ProcessInput; } } -void PlayerPC_Decoration(u8 var) +static void PlayerPC_Decoration(u8 var) { MenuZeroFillWindowRect(0, 0, 10, 9); DoPlayerPCDecoration(var); } -void PlayerPC_TurnOff(u8 taskId) +static void PlayerPC_TurnOff(u8 taskId) { if (gPcItemMenuOptionsNum == 4) // if the option count is 4, we are at the bedroom PC and not player PC, so do gender specific handling. { MenuZeroFillWindowRect(0, 0, 0x1D, 0x13); if (gSaveBlock2.playerGender == MALE) - ScriptContext1_SetupScript(&gUnknown_08152850); + ScriptContext1_SetupScript(gBrendanHouse_TurnPCOff); else - ScriptContext1_SetupScript(&gUnknown_08152C75); + ScriptContext1_SetupScript(gMayHouse_TurnPCOff); } else { @@ -275,34 +292,34 @@ void PlayerPC_TurnOff(u8 taskId) DestroyTask(taskId); } -void InitItemStorageMenu(u8 var) +static void InitItemStorageMenu(u8 var) { MenuZeroFillWindowRect(0, 0, 10, 9); MenuDrawTextWindow(0, 0, 11, 9); - PrintMenuItems(1, 1, 4, gPCText_ItemPCOptionsText); + PrintMenuItems(1, 1, 4, (struct MenuAction *)gPCText_ItemPCOptionsText); InitMenu(0, 1, 1, 4, var, 10); - ItemStorageMenuPrint((u8 *)gPCText_OptionDescList[var]); + ItemStorageMenuPrint(gPCText_OptionDescList[var].text); } -void ItemStorageMenuPrint(u8 *textPtr) +static void ItemStorageMenuPrint(const u8 *textPtr) { MenuFillWindowRectWithBlankTile(2, 15, 27, 18); MenuPrint(textPtr, 2, 15); } -void ItemStorageMenuProcessInput(u8 var) +static void ItemStorageMenuProcessInput(u8 var) { if (gMain.newAndRepeatedKeys & DPAD_UP) { PlaySE(SE_SELECT); MoveMenuCursor(-1); - ItemStorageMenuPrint((u8 *)gPCText_OptionDescList[GetMenuCursorPos()]); + ItemStorageMenuPrint(gPCText_OptionDescList[GetMenuCursorPos()].text); } else if (gMain.newAndRepeatedKeys & DPAD_DOWN) { PlaySE(SE_SELECT); MoveMenuCursor(1); - ItemStorageMenuPrint((u8 *)gPCText_OptionDescList[GetMenuCursorPos()]); + ItemStorageMenuPrint(gPCText_OptionDescList[GetMenuCursorPos()].text); } else if (gMain.newKeys & A_BUTTON) { @@ -317,7 +334,7 @@ void ItemStorageMenuProcessInput(u8 var) } } -void Task_ItemStorage_Deposit(u8 taskId) +static void Task_ItemStorage_Deposit(u8 taskId) { if (!gPaletteFade.active) { @@ -326,29 +343,29 @@ void Task_ItemStorage_Deposit(u8 taskId) } } -void ItemStorage_Deposit(u8 taskId) +static void ItemStorage_Deposit(u8 taskId) { - gTasks[taskId].func = Task_ItemStorage_Deposit; + TASK.FUNC = Task_ItemStorage_Deposit; fade_screen(1, 0); } -void sub_813A0C8(u8 taskId) +static void ItemStorage_HandleReturnToProcessInput(u8 taskId) { - if (sub_807D770() == 1) - gTasks[taskId].func = ItemStorageMenuProcessInput; + if (sub_807D770() == TRUE) + TASK.FUNC = ItemStorageMenuProcessInput; } -void sub_813A0F8(void) +void ItemStorage_ReturnToMenuAfterDeposit(void) { MenuDisplayMessageBox(); - InitItemStorageMenu(1); - CreateTask(sub_813A0C8, 0); + InitItemStorageMenu(ITEMPC_MENU_DEPOSIT); + CreateTask(ItemStorage_HandleReturnToProcessInput, 0); pal_fill_black(); } -void ItemStorage_Withdraw(u8 taskId) +static void ItemStorage_Withdraw(u8 taskId) { - s16 *data = gTasks[taskId].data; + s16 *data = TASK.data; HandleDestroyMenuCursors(); MenuZeroFillWindowRect(0, 0, 11, 9); @@ -362,15 +379,15 @@ void ItemStorage_Withdraw(u8 taskId) ITEMS_ABOVE_TOP = 0; ItemStorage_SetItemAndMailCount(taskId); ItemStorage_GoBackToItemPCMenu(taskId, 0); - gTasks[taskId].func = ItemStorage_ProcessInput; + TASK.FUNC = ItemStorage_ProcessInput; } else DisplayItemMessageOnField(taskId, gOtherText_NoItems, PlayerPC_ItemStorage, 0); } -void ItemStorage_Toss(u8 taskId) +static void ItemStorage_Toss(u8 taskId) { - s16 *data = gTasks[taskId].data; + s16 *data = TASK.data; HandleDestroyMenuCursors(); MenuZeroFillWindowRect(0, 0, 11, 9); @@ -384,22 +401,22 @@ void ItemStorage_Toss(u8 taskId) ITEMS_ABOVE_TOP = 0; ItemStorage_SetItemAndMailCount(taskId); ItemStorage_GoBackToItemPCMenu(taskId, 2); - gTasks[taskId].func = ItemStorage_ProcessInput; + TASK.FUNC = ItemStorage_ProcessInput; } else DisplayItemMessageOnField(taskId, gOtherText_NoItems, PlayerPC_ItemStorage, 0); } -void ItemStorage_Exit(u8 var) +static void ItemStorage_Exit(u8 var) { HandleDestroyMenuCursors(); MenuZeroFillWindowRect(0, 0, 11, 9); ReshowPlayerPC(var); } -void ItemStorage_SetItemAndMailCount(u8 taskId) +static void ItemStorage_SetItemAndMailCount(u8 taskId) { - s16 *data = gTasks[taskId].data; + s16 *data = TASK.data; if (NUM_ITEMS > 7) // we have a full page, so set the num of page items appropriately. NUM_PAGE_ITEMS = 8; @@ -412,9 +429,9 @@ void ItemStorage_SetItemAndMailCount(u8 taskId) gMailboxInfo.pageItems = gMailboxInfo.count + 1; } -void ItemStorage_ProcessInput(u8 taskId) +static void ItemStorage_ProcessInput(u8 taskId) { - s16 *data = gTasks[taskId].data; + s16 *data = TASK.data; s16 trueIndex; if (gMain.newAndRepeatedKeys & DPAD_UP) @@ -532,24 +549,24 @@ void ItemStorage_ProcessInput(u8 taskId) } } -void ItemStorage_GoBackToPlayerPCMenu(u8 taskId) +static void ItemStorage_GoBackToPlayerPCMenu(u8 taskId) { BuyMenuFreeMemory(); DestroyVerticalScrollIndicator(0); DestroyVerticalScrollIndicator(1); MenuZeroFillWindowRect(0, 0, 29, 19); MenuDisplayMessageBox(); - InitItemStorageMenu(gTasks[taskId].CURRENT_ITEM_STORAGE_MENU); - gTasks[taskId].func = ItemStorageMenuProcessInput; + InitItemStorageMenu(TASK.CURRENT_ITEM_STORAGE_MENU); + TASK.FUNC = ItemStorageMenuProcessInput; } -void ItemStorage_DoItemAction(u8 taskId) +static void ItemStorage_DoItemAction(u8 taskId) { - s16 *data = gTasks[taskId].data; + s16 *data = TASK.data; u8 trueIndex = PAGE_INDEX + ITEMS_ABOVE_TOP; - sub_80F996C(0); - sub_80F996C(1); + PauseVerticalScrollIndicator(0); + PauseVerticalScrollIndicator(1); // PauseVerticalScrollIndicator if(CURRENT_ITEM_STORAGE_MENU == ITEMPC_MENU_WITHDRAW) { @@ -577,12 +594,12 @@ void ItemStorage_DoItemAction(u8 taskId) NUM_QUANTITY_ROLLER = 1; MenuDrawTextWindow(6, 8, 13, 11); sub_80A418C(NUM_QUANTITY_ROLLER, STR_CONV_MODE_RIGHT_ALIGN, 8, 9, 3); - gTasks[taskId].func = ItemStorage_HandleQuantityRolling; + TASK.FUNC = ItemStorage_HandleQuantityRolling; } -void ItemStorage_HandleQuantityRolling(u8 taskId) +static void ItemStorage_HandleQuantityRolling(u8 taskId) { - s16 *data = gTasks[taskId].data; + s16 *data = TASK.data; u8 trueIndex = PAGE_INDEX + ITEMS_ABOVE_TOP; if(gMain.newAndRepeatedKeys & DPAD_UP) @@ -635,16 +652,16 @@ void ItemStorage_HandleQuantityRolling(u8 taskId) { PlaySE(SE_SELECT); MenuZeroFillWindowRect(6, 6, 0xD, 0xB); - sub_80F98DC(0); - sub_80F98DC(1); + StartVerticalScrollIndicators(0); + StartVerticalScrollIndicators(1); ItemStorage_PrintItemPcResponse(gSaveBlock1.pcItems[ITEMS_ABOVE_TOP + PAGE_INDEX].itemId); // why not use trueIndex? - gTasks[taskId].func = ItemStorage_ProcessInput; + TASK.FUNC = ItemStorage_ProcessInput; } } -void ItemStorage_DoItemWithdraw(u8 taskId) +static void ItemStorage_DoItemWithdraw(u8 taskId) { - s16 *data = gTasks[taskId].data; + s16 *data = TASK.data; u8 trueIndex = PAGE_INDEX + ITEMS_ABOVE_TOP; if(AddBagItem(gSaveBlock1.pcItems[trueIndex].itemId, NUM_QUANTITY_ROLLER) == TRUE) // add item works. @@ -652,19 +669,19 @@ void ItemStorage_DoItemWithdraw(u8 taskId) CopyItemName(gSaveBlock1.pcItems[trueIndex].itemId, gStringVar1); ConvertIntToDecimalStringN(gStringVar2, NUM_QUANTITY_ROLLER, 0, 3); ItemStorage_PrintItemPcResponse(ITEMPC_WITHDREW_THING); - gTasks[taskId].func = ItemStorage_HandleRemoveItem; + TASK.FUNC = ItemStorage_HandleRemoveItem; } else { NUM_QUANTITY_ROLLER = 0; ItemStorage_PrintItemPcResponse(ITEMPC_NO_MORE_ROOM); - gTasks[taskId].func = ItemStorage_WaitPressHandleResumeProcessInput; + TASK.FUNC = ItemStorage_WaitPressHandleResumeProcessInput; } } -void ItemStorage_DoItemToss(u8 taskId) +static void ItemStorage_DoItemToss(u8 taskId) { - s16 *data = gTasks[taskId].data; + s16 *data = TASK.data; u8 var = PAGE_INDEX + ITEMS_ABOVE_TOP; if(ItemId_GetImportance(gSaveBlock1.pcItems[var].itemId) == FALSE) @@ -673,38 +690,38 @@ void ItemStorage_DoItemToss(u8 taskId) ConvertIntToDecimalStringN(gStringVar2, NUM_QUANTITY_ROLLER, 0, 3); ItemStorage_PrintItemPcResponse(ITEMPC_OKAY_TO_THROW_AWAY); DisplayYesNoMenu(7, 6, 1); - sub_80F914C(taskId, &gUnknown_084062E0); + DoYesNoFuncWithChoice(taskId, (struct YesNoFuncTable *)&ResumeFromTossYesNoFuncList); } else { NUM_QUANTITY_ROLLER = 0; ItemStorage_PrintItemPcResponse(ITEMPC_TOO_IMPORTANT); - gTasks[taskId].func = ItemStorage_HandleRemoveItem; + TASK.FUNC = ItemStorage_HandleRemoveItem; } } -void ItemStorage_ResumeInputFromYesToss(u8 taskId) +static void ItemStorage_ResumeInputFromYesToss(u8 taskId) { MenuZeroFillWindowRect(0x6, 0x6, 0xD, 0xB); ItemStorage_PrintItemPcResponse(ITEMPC_THREW_AWAY_ITEM); - gTasks[taskId].func = ItemStorage_HandleRemoveItem; + TASK.FUNC = ItemStorage_HandleRemoveItem; } -void ItemStorage_ResumeInputFromNoToss(u8 taskId) +static void ItemStorage_ResumeInputFromNoToss(u8 taskId) { - s16 *data = gTasks[taskId].data; + s16 *data = TASK.data; MenuZeroFillWindowRect(0x6, 0x6, 0xD, 0xB); InitMenu(0, 16, 2, NUM_PAGE_ITEMS, PAGE_INDEX, 0xD); - sub_80F98DC(0); - sub_80F98DC(1); + StartVerticalScrollIndicators(0); + StartVerticalScrollIndicators(1); ItemStorage_PrintItemPcResponse(gSaveBlock1.pcItems[ITEMS_ABOVE_TOP + PAGE_INDEX].itemId); - gTasks[taskId].func = ItemStorage_ProcessInput; + TASK.FUNC = ItemStorage_ProcessInput; } -void ItemStorage_HandleRemoveItem(u8 taskId) +static void ItemStorage_HandleRemoveItem(u8 taskId) { - s16 *data = gTasks[taskId].data; + s16 *data = TASK.data; s16 oldNumItems; if(gMain.newKeys & A_BUTTON || gMain.newKeys == B_BUTTON) @@ -722,31 +739,31 @@ void ItemStorage_HandleRemoveItem(u8 taskId) } } -void ItemStorage_WaitPressHandleResumeProcessInput(u8 taskId) +static void ItemStorage_WaitPressHandleResumeProcessInput(u8 taskId) { - s16 *data = gTasks[taskId].data; + s16 *data = TASK.data; if(gMain.newKeys & A_BUTTON || gMain.newKeys == B_BUTTON) { ItemStorage_PrintItemPcResponse(gSaveBlock1.pcItems[ITEMS_ABOVE_TOP + PAGE_INDEX].itemId); - sub_80F98DC(0); - sub_80F98DC(1); - gTasks[taskId].func = ItemStorage_ProcessInput; + StartVerticalScrollIndicators(0); + StartVerticalScrollIndicators(1); + TASK.FUNC = ItemStorage_ProcessInput; } } -void ItemStorage_HandleResumeProcessInput(u8 taskId) +static void ItemStorage_HandleResumeProcessInput(u8 taskId) { MenuZeroFillWindowRect(0x6, 0x6, 0xD, 0xB); - sub_80F98DC(0); - sub_80F98DC(1); + StartVerticalScrollIndicators(0); + StartVerticalScrollIndicators(1); ItemStorage_DrawBothListAndDescription(taskId); - gTasks[taskId].func = ItemStorage_ProcessInput; + TASK.FUNC = ItemStorage_ProcessInput; } -void ItemStorage_DoItemSwap(u8 taskId, bool8 switchModeDisabled) +static void ItemStorage_DoItemSwap(u8 taskId, bool8 switchModeDisabled) { - s16 *data = gTasks[taskId].data; + s16 *data = TASK.data; u8 trueIndex = ITEMS_ABOVE_TOP + PAGE_INDEX; SWITCH_MODE_ACTIVE = FALSE; @@ -784,44 +801,44 @@ void ItemStorage_DoItemSwap(u8 taskId, bool8 switchModeDisabled) } } -void ItemStorage_DrawItemQuantity(u16 arg1, enum StringConvertMode arg2, u8 arg3, u8 arg4, int isSwapSelected) +static void ItemStorage_DrawItemQuantity(u16 arg1, enum StringConvertMode arg2, u8 arg3, u8 arg4, int isSwapSelected) { sub_80A4164(gStringVar1, arg1, arg2, arg4); if(isSwapSelected != FALSE) - MenuPrint(gUnknown_0840632A, 0x1A, arg3); + MenuPrint(gSelectedItemQuantityFormatText, 0x1A, arg3); else - MenuPrint(gUnknown_08406327, 0x1A, arg3); + MenuPrint(gNonSelectedItemQuantityFormatText, 0x1A, arg3); } -void ItemStorage_DrawItemVoidQuantity(u8 var) +static void ItemStorage_DrawItemVoidQuantity(u8 var) { MenuPrint(gUnknown_08406330, 0x19, var); } -void ItemStorage_DrawItemName(struct ItemSlot *itemSlot, u8 var, int isSwapSelected) +static void ItemStorage_DrawItemName(struct ItemSlot *itemSlot, u8 var, int isSwapSelected) { CopyItemName(itemSlot->itemId, gStringVar1); if(isSwapSelected != FALSE) - MenuPrint(gUnknown_0840631E, 16, var); + MenuPrint(gSelectedItemFormattedText, 16, var); else - MenuPrint(gUnknown_08406318, 16, var); + MenuPrint(gNonSelectedItemFormattedText, 16, var); } -void ItemStorage_DrawNormalItemEntry(struct ItemSlot *itemSlot, u8 var, int var2) +static void ItemStorage_DrawNormalItemEntry(struct ItemSlot *itemSlot, u8 var, int var2) { ItemStorage_DrawItemName(itemSlot, var, var2); ItemStorage_DrawItemQuantity(itemSlot->quantity, STR_CONV_MODE_RIGHT_ALIGN, var, 3, var2); } -void ItemStorage_DrawKeyItemEntry(struct ItemSlot *itemSlot, u8 var, int var2) +static void ItemStorage_DrawKeyItemEntry(struct ItemSlot *itemSlot, u8 var, int var2) { ItemStorage_DrawItemName(itemSlot, var, var2); ItemStorage_DrawItemVoidQuantity(var); } -void ItemStorage_DrawTMHMEntry(struct ItemSlot *itemSlot, u8 var, int var2) +static void ItemStorage_DrawTMHMEntry(struct ItemSlot *itemSlot, u8 var, int var2) { ItemStorage_DrawItemName(itemSlot, var, var2); @@ -831,9 +848,9 @@ void ItemStorage_DrawTMHMEntry(struct ItemSlot *itemSlot, u8 var, int var2) ItemStorage_DrawItemVoidQuantity(var); // HMs do not have a quantity. } -void ItemStorage_DrawItemList(u8 taskId) +static void ItemStorage_DrawItemList(u8 taskId) { - s16 *data = gTasks[taskId].data; + s16 *data = TASK.data; int tempArg; u16 i; u16 yCoord = 0; @@ -895,7 +912,7 @@ weirdCase: DestroyVerticalScrollIndicator(1); } -void ItemStorage_PrintItemPcResponse(u16 itemId) +static void ItemStorage_PrintItemPcResponse(u16 itemId) { u8 *string; @@ -936,9 +953,9 @@ void ItemStorage_PrintItemPcResponse(u16 itemId) sub_8072AB0(string, 8, 0x68, 0x68, 0x30, 1); } -void ItemStorage_DrawBothListAndDescription(u8 taskId) +static void ItemStorage_DrawBothListAndDescription(u8 taskId) { - s16 *data = gTasks[taskId].data; + s16 *data = TASK.data; s16 trueIndex = ITEMS_ABOVE_TOP + PAGE_INDEX; ItemStorage_DrawItemList(taskId); @@ -952,9 +969,9 @@ void ItemStorage_DrawBothListAndDescription(u8 taskId) } } -void ItemStorage_GoBackToItemPCMenu(u8 taskId, u8 var) +static void ItemStorage_GoBackToItemPCMenu(u8 taskId, u8 var) { - s16 *data = gTasks[taskId].data; + s16 *data = TASK.data; sub_80F944C(); LoadScrollIndicatorPalette(); @@ -968,7 +985,7 @@ void ItemStorage_GoBackToItemPCMenu(u8 taskId, u8 var) InitMenu(0, 0x10, 2, NUM_PAGE_ITEMS, PAGE_INDEX, 0xD); } -void ItemStorage_LoadPalette(void) +static void ItemStorage_LoadPalette(void) { u16 arr[3]; @@ -978,7 +995,7 @@ void ItemStorage_LoadPalette(void) LoadPalette(&arr[0], 0xD8, 2); } -u8 GetMailboxMailCount(void) +static u8 GetMailboxMailCount(void) { u8 i, j; @@ -989,7 +1006,7 @@ u8 GetMailboxMailCount(void) return i; } -void Mailbox_UpdateMailList(void) +static void Mailbox_UpdateMailList(void) { struct MailStruct mailBuffer; u8 i, j; @@ -1009,7 +1026,7 @@ void Mailbox_UpdateMailList(void) } // WWHHHHHYYYYYYYY SOMEBODY PLEASE FIX THIS -void Mailbox_DrawMailList(u8 taskId) // taskId is unused +static void Mailbox_DrawMailList(u8 taskId) // taskId is unused { u16 yCoord = 0; u16 i = gMailboxInfo.itemsAbove; @@ -1062,7 +1079,7 @@ weirdCase: DestroyVerticalScrollIndicator(1); } -void Mailbox_DrawMailboxMenu(u8 taskId) +static void Mailbox_DrawMailboxMenu(u8 taskId) { sub_80F944C(); LoadScrollIndicatorPalette(); @@ -1075,7 +1092,7 @@ void Mailbox_DrawMailboxMenu(u8 taskId) } // Mailbox_ProcessInput -void Mailbox_ProcessInput(u8 taskId) +static void Mailbox_ProcessInput(u8 taskId) { if(!gPaletteFade.active) { @@ -1083,12 +1100,12 @@ void Mailbox_ProcessInput(u8 taskId) { if(gMailboxInfo.cursorPos != 0) { - PlaySE(5); + PlaySE(SE_SELECT); gMailboxInfo.cursorPos = MoveMenuCursor(-1); } else if(gMailboxInfo.itemsAbove != 0) { - PlaySE(5); + PlaySE(SE_SELECT); gMailboxInfo.itemsAbove--; Mailbox_DrawMailList(taskId); } @@ -1097,12 +1114,12 @@ void Mailbox_ProcessInput(u8 taskId) { if(gMailboxInfo.cursorPos != gMailboxInfo.pageItems - 1) { - PlaySE(5); + PlaySE(SE_SELECT); gMailboxInfo.cursorPos = MoveMenuCursor(1); } else if(gMailboxInfo.itemsAbove + gMailboxInfo.cursorPos != gMailboxInfo.count) { - PlaySE(5); + PlaySE(SE_SELECT); gMailboxInfo.itemsAbove++; Mailbox_DrawMailList(taskId); } @@ -1110,135 +1127,135 @@ void Mailbox_ProcessInput(u8 taskId) else if(gMain.newKeys & A_BUTTON) { HandleDestroyMenuCursors(); - PlaySE(5); + PlaySE(SE_SELECT); if(gMailboxInfo.itemsAbove + gMailboxInfo.cursorPos == gMailboxInfo.count) { - sub_813B320(taskId); + Mailbox_TurnOff(taskId); } else { - sub_813B27C(); - gTasks[taskId].func = sub_813B294; + Mailbox_CloseScrollIndicators(); + TASK.FUNC = Mailbox_PrintWhatToDoWithPlayerMailText; } } else if(gMain.newKeys & B_BUTTON) { HandleDestroyMenuCursors(); - PlaySE(5); - sub_813B320(taskId); + PlaySE(SE_SELECT); + Mailbox_TurnOff(taskId); } } } -void sub_813B27C(void) +static void Mailbox_CloseScrollIndicators(void) { BuyMenuFreeMemory(); DestroyVerticalScrollIndicator(0); DestroyVerticalScrollIndicator(1); } -void sub_813B294(u8 taskId) +static void Mailbox_PrintWhatToDoWithPlayerMailText(u8 taskId) { MenuZeroFillWindowRect(0, 0, 0x1D, 0x13); StringCopy(gStringVar1, gSaveBlock1.mail[gMailboxInfo.itemsAbove + 6 + gMailboxInfo.cursorPos].playerName); SanitizeNameString(gStringVar1); StringExpandPlaceholders(gStringVar4, gOtherText_WhatWillYouDoMail); - DisplayItemMessageOnField(taskId, gStringVar4, sub_813B348, 0); + DisplayItemMessageOnField(taskId, gStringVar4, Mailbox_PrintMailOptions, 0); } -void sub_813B300(u8 taskId) +static void Mailbox_ReturnToPlayerPC(u8 taskId) { MenuZeroFillWindowRect(0, 0, 0x1D, 0x13); ReshowPlayerPC(taskId); } -void sub_813B320(u8 taskId) +static void Mailbox_TurnOff(u8 taskId) { - sub_813B27C(); - gTasks[taskId].func = sub_813B300; + Mailbox_CloseScrollIndicators(); + TASK.FUNC = Mailbox_ReturnToPlayerPC; } -void sub_813B348(u8 taskId) +static void Mailbox_PrintMailOptions(u8 taskId) // Mailbox_PrintMailOptions { MenuDrawTextWindow(0, 0, 0xC, 0x9); - PrintMenuItems(1, 1, 4, gUnknown_084062F8); + PrintMenuItems(1, 1, 4, (struct MenuAction *)gMailboxMailOptions); InitMenu(0, 1, 1, 4, 0, 0xB); - gTasks[taskId].func = sub_813B3A0; + TASK.FUNC = Mailbox_MailOptionsProcessInput; } -void sub_813B3A0(u8 taskId) +static void Mailbox_MailOptionsProcessInput(u8 taskId) { if(gMain.newAndRepeatedKeys & DPAD_UP) { - PlaySE(5); + PlaySE(SE_SELECT); MoveMenuCursor(-1); } else if(gMain.newAndRepeatedKeys & DPAD_DOWN) { - PlaySE(5); + PlaySE(SE_SELECT); MoveMenuCursor(1); } else if(gMain.newKeys & A_BUTTON) { - PlaySE(5); - gUnknown_084062F8[GetMenuCursorPos()].func(taskId); + PlaySE(SE_SELECT); + gMailboxMailOptions[GetMenuCursorPos()].func(taskId); } else if(gMain.newKeys & B_BUTTON) { - PlaySE(5); + PlaySE(SE_SELECT); Mailbox_Cancel(taskId); } } -void Mailbox_Read(u8 taskId) +static void Mailbox_DoMailRead(u8 taskId) { fade_screen(1, 0); - gTasks[taskId].func = sub_813B454; + TASK.FUNC = Mailbox_FadeAndReadMail; } -void sub_813B454(u8 taskId) +static void Mailbox_FadeAndReadMail(u8 taskId) { if(!gPaletteFade.active) { - HandleReadMail(&gSaveBlock1.mail[gMailboxInfo.itemsAbove + 6 + gMailboxInfo.cursorPos], sub_813B4F0, 1); + HandleReadMail(&gSaveBlock1.mail[gMailboxInfo.itemsAbove + 6 + gMailboxInfo.cursorPos], Mailbox_ReturnToFieldFromReadMail, 1); DestroyTask(taskId); } } -void sub_813B4A0(u8 taskId) +static void Mailbox_HandleReturnToProcessInput(u8 taskId) // Mailbox_HandleReturnToProcessInput { - if(sub_807D770() == TRUE) - gTasks[taskId].func = Mailbox_ProcessInput; + if(sub_807D770() == TRUE) // is black fade finished? why not gPaletteFade.active? + TASK.FUNC = Mailbox_ProcessInput; } -void sub_813B4D0(void) +static void Mailbox_DoRedrawMailboxMenuAfterReturn(void) { - Mailbox_DrawMailboxMenu(CreateTask(sub_813B4A0, 0)); + Mailbox_DrawMailboxMenu(CreateTask(Mailbox_HandleReturnToProcessInput, 0)); pal_fill_black(); } -void sub_813B4F0(void) +static void Mailbox_ReturnToFieldFromReadMail(void) { - gUnknown_0300485C = sub_813B4D0; + gFieldCallback = Mailbox_DoRedrawMailboxMenuAfterReturn; SetMainCallback2(c2_exit_to_overworld_2_switch); } -void Mailbox_MoveToBag(u8 taskId) +static void Mailbox_MoveToBag(u8 taskId) { HandleDestroyMenuCursors(); StringCopy(gStringVar1, gOtherText_MoveToBag); - MenuPrint(gUnknown_0840633A, 1, 3); - DisplayItemMessageOnField(taskId, gOtherText_MessageWillBeLost, sub_813B554, 0); + MenuPrint(gHighlightedMoveToBagFormatText, 1, 3); // gHighlightedMoveToBagFormatText + DisplayItemMessageOnField(taskId, gOtherText_MessageWillBeLost, Mailbox_DrawYesNoBeforeMove, 0); } -void sub_813B554(u8 taskId) +static void Mailbox_DrawYesNoBeforeMove(u8 taskId) { DisplayYesNoMenu(0x14, 0x8, 0x1); - sub_80F914C(taskId, &gUnknown_084062E8); + DoYesNoFuncWithChoice(taskId, (struct YesNoFuncTable *)&ResumeFromWithdrawYesNoFuncList); } -void sub_813B578(u8 taskId) +static void Mailbox_DoMailMoveToBag(u8 taskId) { struct MailStruct *mail = &gSaveBlock1.mail[gMailboxInfo.itemsAbove + 6 + gMailboxInfo.cursorPos]; @@ -1246,11 +1263,11 @@ void sub_813B578(u8 taskId) if(AddBagItem(mail->itemId, 1) == FALSE) { - DisplayItemMessageOnField(taskId, gOtherText_BagIsFull, sub_813B758, 0); + DisplayItemMessageOnField(taskId, gOtherText_BagIsFull, Mailbox_DrawMailMenuAndDoProcessInput, 0); } else { - DisplayItemMessageOnField(taskId, gOtherText_MailWasReturned, sub_813B758, 0); + DisplayItemMessageOnField(taskId, gOtherText_MailWasReturned, Mailbox_DrawMailMenuAndDoProcessInput, 0); ClearMailStruct(mail); Mailbox_UpdateMailList(); @@ -1263,24 +1280,24 @@ void sub_813B578(u8 taskId) } } -void sub_813B610(u8 taskId) +static void Mailbox_ReturnToInputAfterNo(u8 taskId) // Mailbox_ReturnToInputAfterNo { MenuZeroFillWindowRect(0x14, 0x8, 0x1A, 0xD); - sub_813B758(taskId); + Mailbox_DrawMailMenuAndDoProcessInput(taskId); } -void Mailbox_Give(u8 taskId) +static void Mailbox_Give(u8 taskId) { if(CalculatePlayerPartyCount() == 0) - sub_813B718(taskId); + Mailbox_NoPokemonForMail(taskId); // cannot be reached normally else { fade_screen(1, 0); - gTasks[taskId].func = sub_813B66C; + TASK.FUNC = Mailbox_DoGiveMailPokeMenu; } } -void sub_813B66C(u8 taskId) +static void Mailbox_DoGiveMailPokeMenu(u8 taskId) // Mailbox_DoGiveMailPokeMenu { if(!gPaletteFade.active) { @@ -1290,9 +1307,9 @@ void sub_813B66C(u8 taskId) } } -void sub_813B6A4(void) +static void Mailbox_UpdateMailListAfterDeposit(void) { - u8 taskId = CreateTask(sub_813B4A0, 0); + u8 taskId = CreateTask(Mailbox_HandleReturnToProcessInput, 0); u8 oldCount = gMailboxInfo.count; gMailboxInfo.count = GetMailboxMailCount(); @@ -1306,26 +1323,27 @@ void sub_813B6A4(void) pal_fill_black(); } -void sub_813B6F8(void) +void Mailbox_ReturnToMailListAfterDeposit(void) { - gUnknown_0300485C = sub_813B6A4; + gFieldCallback = Mailbox_UpdateMailListAfterDeposit; SetMainCallback2(c2_exit_to_overworld_2_switch); } -void sub_813B718(u8 taskId) +// you always have at least 1 POKeMON and you cannot receive mail before you leave Littleroot: therefore this function cannot be reached normally. +static void Mailbox_NoPokemonForMail(u8 taskId) { - DisplayItemMessageOnField(taskId, gOtherText_NoPokemon, sub_813B758, 0); + DisplayItemMessageOnField(taskId, gOtherText_NoPokemon, Mailbox_DrawMailMenuAndDoProcessInput, 0); } -void Mailbox_Cancel(u8 taskId) +static void Mailbox_Cancel(u8 taskId) { HandleDestroyMenuCursors(); MenuZeroFillWindowRect(0, 0, 0xC, 0x9); - sub_813B758(taskId); + Mailbox_DrawMailMenuAndDoProcessInput(taskId); } -void sub_813B758(u8 taskId) +static void Mailbox_DrawMailMenuAndDoProcessInput(u8 taskId) { Mailbox_DrawMailboxMenu(taskId); - gTasks[taskId].func = Mailbox_ProcessInput; + TASK.FUNC = Mailbox_ProcessInput; } diff --git a/src/rom4.c b/src/rom4.c index 79ac6d769..98060c3b1 100644 --- a/src/rom4.c +++ b/src/rom4.c @@ -67,7 +67,7 @@ extern u16 (*gUnknown_03000584)(u32); extern u8 gUnknown_03000588; extern u16 word_3004858; -extern void (*gUnknown_0300485C)(void); +extern void (*gFieldCallback)(void); extern u8 gUnknown_03004860; extern u8 gFieldLinkPlayerCount; @@ -1082,11 +1082,11 @@ void sub_80543DC(u16 (*a1)(u32)) void sub_80543E8(void) { - if (gUnknown_0300485C) - gUnknown_0300485C(); + if (gFieldCallback) + gFieldCallback(); else mapldr_default(); - gUnknown_0300485C = NULL; + gFieldCallback = NULL; } void CB2_NewGame(void) @@ -1099,7 +1099,7 @@ void CB2_NewGame(void) PlayTimeCounter_Start(); ScriptContext1_Init(); ScriptContext2_Disable(); - gUnknown_0300485C = ExecuteTruckSequence; + gFieldCallback = ExecuteTruckSequence; do_load_map_stuff_loop(&gMain.state); SetFieldVBlankCallback(); set_callback1(c1_overworld); @@ -1119,7 +1119,7 @@ void CB2_WhiteOut(void) player_avatar_init_params_reset(); ScriptContext1_Init(); ScriptContext2_Disable(); - gUnknown_0300485C = sub_8080B60; + gFieldCallback = sub_8080B60; val = 0; do_load_map_stuff_loop(&val); SetFieldVBlankCallback(); @@ -1166,7 +1166,7 @@ void sub_8054534(void) void sub_8054588(void) { FieldClearVBlankHBlankCallbacks(); - gUnknown_0300485C = sub_8080AC4; + gFieldCallback = sub_8080AC4; SetMainCallback2(c2_80567AC); } @@ -1216,7 +1216,7 @@ void sub_805465C(void) sub_8054F70(); set_callback1(sub_8055354); sub_80543DC(sub_8055390); - gUnknown_0300485C = sub_8080A3C; + gFieldCallback = sub_8080A3C; ScriptContext1_Init(); ScriptContext2_Disable(); c2_exit_to_overworld_2_switch(); @@ -1225,28 +1225,28 @@ void sub_805465C(void) void sub_805469C(void) { FieldClearVBlankHBlankCallbacks(); - gUnknown_0300485C = atk17_seteffectuser; + gFieldCallback = atk17_seteffectuser; c2_exit_to_overworld_2_switch(); } void sub_80546B8(void) { FieldClearVBlankHBlankCallbacks(); - gUnknown_0300485C = sub_80809B0; + gFieldCallback = sub_80809B0; c2_exit_to_overworld_2_switch(); } void c2_exit_to_overworld_1_continue_scripts_restart_music(void) { FieldClearVBlankHBlankCallbacks(); - gUnknown_0300485C = sub_8080990; + gFieldCallback = sub_8080990; c2_exit_to_overworld_2_switch(); } void sub_80546F0(void) { FieldClearVBlankHBlankCallbacks(); - gUnknown_0300485C = sub_8080B60; + gFieldCallback = sub_8080B60; c2_exit_to_overworld_2_switch(); } @@ -1280,7 +1280,7 @@ void CB2_ContinueSavedGame(void) } else { - gUnknown_0300485C = sub_805470C; + gFieldCallback = sub_805470C; set_callback1(c1_overworld); c2_exit_to_overworld_2_switch(); } diff --git a/src/rom6.c b/src/rom6.c index a2b52c9aa..a8233eb5b 100644 --- a/src/rom6.c +++ b/src/rom6.c @@ -14,7 +14,7 @@ extern u16 gScriptLastTalked; extern u32 gUnknown_0202FF84[]; extern struct MapPosition gUnknown_0203923C; -extern void (*gUnknown_0300485C)(void); +extern void (*gFieldCallback)(void); extern u8 gLastFieldPokeMenuOpened; extern void (*gUnknown_03005CE4)(void); extern u8 UseRockSmashScript[]; @@ -122,7 +122,7 @@ bool8 SetUpFieldMove_RockSmash(void) { if (npc_before_player_of_type(0x56) == TRUE) { - gUnknown_0300485C = sub_808AB90; + gFieldCallback = sub_808AB90; gUnknown_03005CE4 = sub_810B53C; return TRUE; } @@ -159,7 +159,7 @@ int SetUpFieldMove_Dig(void) { if (sub_80CA1C8() == TRUE) { - gUnknown_0300485C = sub_808AB90; + gFieldCallback = sub_808AB90; gUnknown_03005CE4 = sub_810B5D8; return TRUE; } diff --git a/src/safari_zone.c b/src/safari_zone.c index 8c2b63469..986412826 100644 --- a/src/safari_zone.c +++ b/src/safari_zone.c @@ -29,7 +29,7 @@ EWRAM_DATA u8 gNumSafariBalls = 0; EWRAM_DATA static u16 gSafariZoneStepCounter = 0; EWRAM_DATA static struct PokeblockFeeder gPokeblockFeeders[NUM_POKEBLOCK_FEEDERS] = {0}; -extern void (*gUnknown_0300485C)(void); +extern void (*gFieldCallback)(void); extern u8 gUnknown_081C340A; extern u8 gUnknown_081C342D; @@ -103,7 +103,7 @@ void sub_80C824C(void) { ScriptContext2_RunNewScript(&gUnknown_081C340A); warp_in(); - gUnknown_0300485C = sub_8080E44; + gFieldCallback = sub_8080E44; SetMainCallback2(CB2_LoadMap); } else if (gUnknown_02024D26 == 7) diff --git a/src/script_pokemon_util_80F99CC.c b/src/script_pokemon_util_80F99CC.c index 9e833ec34..ee140187f 100644 --- a/src/script_pokemon_util_80F99CC.c +++ b/src/script_pokemon_util_80F99CC.c @@ -18,7 +18,7 @@ extern u16 gSpecialVar_0x8005; extern u8 gUnknown_02038694; extern u16 gScriptResult; -extern void (*gUnknown_0300485C)(void); +extern void (*gFieldCallback)(void); extern void OpenPartyMenu(u8, u8); extern void TryCreatePartyMenuMonIcon(u8, u8, struct Pokemon *); @@ -284,7 +284,7 @@ void sub_80F9EEC(void) { sub_809D9F0(&gPlayerParty[0], gSpecialVar_0x8004, gPlayerPartyCount - 1, c2_exit_to_overworld_2_switch, 0); unk_2018000.unk8 = 3; - gUnknown_0300485C = sub_8080990; + gFieldCallback = sub_8080990; } void sub_80F9F3C(void) // count pokemon moves diff --git a/src/secret_base.c b/src/secret_base.c index aae3853f9..adcd47d66 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -250,7 +250,7 @@ void sub_80BBA48(u8 taskid) gSaveBlock1.secretBases[curbaseid].sbr_field_10 ++; sub_80BBA14(); warp_in(); - gUnknown_0300485C = sub_8080990; + gFieldCallback = sub_8080990; SetMainCallback2(CB2_LoadMap); DestroyTask(taskid); break; @@ -299,7 +299,7 @@ void sub_80BBBEC(u8 taskid) idx = 4 * (gUnknown_020387DC / 10); warp1_set(gSaveBlock1.location.mapGroup, gSaveBlock1.location.mapNum, -1, gUnknown_083D1374[idx + 2], gUnknown_083D1374[idx + 3]); warp_in(); - gUnknown_0300485C = sub_80BBB90; + gFieldCallback = sub_80BBB90; SetMainCallback2(CB2_LoadMap); DestroyTask(taskid); } @@ -793,7 +793,7 @@ void sub_80BC074(u8 taskid) case 2: copy_saved_warp2_bank_and_enter_x_to_warp1(0x7E); warp_in(); - gUnknown_0300485C = mapldr_default; + gFieldCallback = mapldr_default; SetMainCallback2(CB2_LoadMap); ScriptContext2_Disable(); DestroyTask(taskid); -- cgit v1.2.3 From 4b1f25117c0fbb08d93e5d45ada81feee9d37a48 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Thu, 15 Jun 2017 03:48:20 -0400 Subject: whitespace 3: revenge of the tabs --- src/player_pc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/player_pc.c b/src/player_pc.c index 26dc8ccdc..1d4165c17 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -107,7 +107,7 @@ static const struct TextStruct gPCText_OptionDescList[] = gMenuText_GoBackToPrev }; -static const struct MenuAction2 gPCText_PlayerPCOptionsText[] = +static const struct MenuAction2 gPCText_PlayerPCOptionsText[] = { { SecretBaseText_ItemStorage, PlayerPC_ItemStorage }, { gPCText_Mailbox, PlayerPC_Mailbox }, @@ -115,8 +115,8 @@ static const struct MenuAction2 gPCText_PlayerPCOptionsText[] = { SecretBaseText_TurnOff, PlayerPC_TurnOff } }; -static const u8 gBedroomPC_OptionOrder[] = -{ +static const u8 gBedroomPC_OptionOrder[] = +{ PLAYERPC_MENU_ITEMSTORAGE, PLAYERPC_MENU_MAILBOX, PLAYERPC_MENU_DECORATION, @@ -130,7 +130,7 @@ static const u8 gPlayerPC_OptionOrder[] = PLAYERPC_MENU_TURNOFF }; -static const struct MenuAction2 gPCText_ItemPCOptionsText[] = +static const struct MenuAction2 gPCText_ItemPCOptionsText[] = { { PCText_WithdrawItem, ItemStorage_Withdraw }, { PCText_DepositItem, ItemStorage_Deposit }, @@ -171,7 +171,7 @@ 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] = +static const u16 gUnknown_08406334[3] = { 0x5294, 0x6B5A, -- cgit v1.2.3 From 376e4f138497424d8b6061e03862128f54740dd9 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Thu, 15 Jun 2017 15:50:43 -0500 Subject: finish later --- src/data/pokedex_orders.h | 6 +- src/pokedex.c | 1094 ++++++++++----------------------------------- 2 files changed, 245 insertions(+), 855 deletions(-) (limited to 'src') diff --git a/src/data/pokedex_orders.h b/src/data/pokedex_orders.h index 8abb1acd3..3577e6793 100644 --- a/src/data/pokedex_orders.h +++ b/src/data/pokedex_orders.h @@ -1,4 +1,4 @@ -const u16 gPokedexOrder_Alphabetical[] = +static const u16 gPokedexOrder_Alphabetical[] = { 387, 388, @@ -412,7 +412,7 @@ const u16 gPokedexOrder_Alphabetical[] = 263, // Zigzagoon 41, // Zubat }; -const u16 gPokedexOrder_Weight[] = +static const u16 gPokedexOrder_Weight[] = { 92, // Gastly 93, // Haunter @@ -801,7 +801,7 @@ const u16 gPokedexOrder_Weight[] = 376, // Metagross 383, // Groudon }; -const u16 gPokedexOrder_Height[] = +static const u16 gPokedexOrder_Height[] = { 50, // Diglett 298, // Azurill diff --git a/src/pokedex.c b/src/pokedex.c index 97818eacb..e74cf5a39 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -145,35 +145,17 @@ extern struct PokedexListItem *gUnknown_0202FFBC; extern u8 gUnknown_03005CE8; extern IntrCallback gUnknown_03005CEC; extern u8 gUnknown_03005E98; -extern u8 gPokedexMenu_Gfx[]; -extern u8 gUnknown_08E96738[]; -extern u8 gUnknown_08E96888[]; -extern u8 gUnknown_08E96994[]; -extern u8 gUnknown_08E9C6DC[]; -extern const struct SpriteTemplate gUnknown_083B57A4; -extern const struct UnknownStruct3 gUnknown_083B57E4[]; -extern const struct UnknownStruct4 gUnknown_083B57FC[]; -extern const u8 gUnknown_083B586C[][4]; -extern const u8 gUnknown_083B5888[][4]; -extern const u8 gUnknown_083B58A4[][4]; -extern const struct UnknownStruct2 gUnknown_083B58C0[]; -extern const struct UnknownStruct2 gUnknown_083B58D8[]; -extern const struct UnknownStruct2 gUnknown_083B5910[]; -extern const struct UnknownStruct2 gUnknown_083B5968[]; -extern const struct UnknownStruct2 gUnknown_083B59C8[]; -extern const u8 gUnknown_083B5A60[]; -extern const u8 gUnknown_083B5A62[]; -extern const u8 gUnknown_083B5A68[]; -extern const struct UnknownStruct1 gUnknown_083B5A7C[]; -extern const u8 gUnknown_083B5AAC[]; -extern const u8 gUnknown_083B5AB2[]; -extern u8 gUnknown_08D00524[]; -extern u8 gUnknown_08E96BD4[]; -extern u8 gUnknown_08E96ACC[]; -extern u8 gUnknown_08E96B58[]; +extern const u8 gPokedexMenu_Gfx[]; +extern const u8 gUnknown_08E96738[]; +extern const u8 gUnknown_08E96888[]; +extern const u8 gUnknown_08E96994[]; +extern const u8 gUnknown_08E9C6DC[]; +extern const u8 gUnknown_08D00524[]; +extern const u8 gUnknown_08E96BD4[]; +extern const u8 gUnknown_08E96ACC[]; +extern const u8 gUnknown_08E96B58[]; extern const u16 gPokedexMenu_Pal[]; extern const u16 gPokedexMenu2_Pal[]; -extern const u8 *const gMonFootprintTable[]; extern const struct SpriteSheet gTrainerFrontPicTable[]; extern const struct MonCoords gTrainerFrontPicCoords[]; extern const struct PokedexEntry gPokedexEntries[]; @@ -196,14 +178,14 @@ extern void sub_805469C(void); extern u16 HoennToNationalOrder(u16); extern u16 NationalToHoennOrder(u16); -const u16 gUnknown_0839F67C[] = INCBIN_U16("graphics/pokedex/search.gbapal"); -const u16 gUnknown_0839F73C[] = INCBIN_U16("graphics/pokedex/national.gbapal"); +static const u16 sPokedexSearchPalette[] = INCBIN_U16("graphics/pokedex/search.gbapal"); +static const u16 sNationalPokedexPalette[] = INCBIN_U16("graphics/pokedex/national.gbapal"); const u8 gEmptySpacce_839F7FC[0xA4] = {0}; -const u8 gUnknown_0839F8A0[] = INCBIN_U8("graphics/pokedex/pokedex_cry_layout.bin.lz"); -const u8 gUnknown_0839F988[] = INCBIN_U8("graphics/pokedex/pokedex_size_layout.bin.lz"); -const u8 gUnknown_0839FA7C[] = INCBIN_U8("graphics/pokedex/noball.4bpp.lz"); +static const u8 gUnknown_0839F8A0[] = INCBIN_U8("graphics/pokedex/pokedex_cry_layout.bin.lz"); +static const u8 gUnknown_0839F988[] = INCBIN_U8("graphics/pokedex/pokedex_size_layout.bin.lz"); +static const u8 gUnknown_0839FA7C[] = INCBIN_U8("graphics/pokedex/noball.4bpp.lz"); #include "data/pokedex_orders.h" -const struct OamData gOamData_83A0404 = +static const struct OamData gOamData_83A0404 = { .y = 160, .affineMode = 0, @@ -219,7 +201,7 @@ const struct OamData gOamData_83A0404 = .paletteNum = 0, .affineParam = 0, }; -const struct OamData gOamData_83A040C = +static const struct OamData gOamData_83A040C = { .y = 160, .affineMode = 0, @@ -235,7 +217,7 @@ const struct OamData gOamData_83A040C = .paletteNum = 0, .affineParam = 0, }; -const struct OamData gOamData_83A0414 = +static const struct OamData gOamData_83A0414 = { .y = 160, .affineMode = 0, @@ -251,7 +233,7 @@ const struct OamData gOamData_83A0414 = .paletteNum = 0, .affineParam = 0, }; -const struct OamData gOamData_83A041C = +static const struct OamData gOamData_83A041C = { .y = 160, .affineMode = 0, @@ -267,7 +249,7 @@ const struct OamData gOamData_83A041C = .paletteNum = 0, .affineParam = 0, }; -const struct OamData gOamData_83A0424 = +static const struct OamData gOamData_83A0424 = { .y = 160, .affineMode = 0, @@ -283,7 +265,7 @@ const struct OamData gOamData_83A0424 = .paletteNum = 0, .affineParam = 0, }; -const struct OamData gOamData_83A042C = +static const struct OamData gOamData_83A042C = { .y = 160, .affineMode = 0, @@ -299,131 +281,131 @@ const struct OamData gOamData_83A042C = .paletteNum = 0, .affineParam = 0, }; -const union AnimCmd gSpriteAnim_83A0434[] = +static const union AnimCmd gSpriteAnim_83A0434[] = { ANIMCMD_FRAME(3, 30), ANIMCMD_END, }; -const union AnimCmd gSpriteAnim_83A043C[] = +static const union AnimCmd gSpriteAnim_83A043C[] = { ANIMCMD_FRAME(1, 30), ANIMCMD_END, }; -const union AnimCmd gSpriteAnim_83A0444[] = +static const union AnimCmd gSpriteAnim_83A0444[] = { ANIMCMD_FRAME(16, 30), ANIMCMD_END, }; -const union AnimCmd gSpriteAnim_83A044C[] = +static const union AnimCmd gSpriteAnim_83A044C[] = { ANIMCMD_FRAME(32, 30), ANIMCMD_END, }; -const union AnimCmd gSpriteAnim_83A0454[] = +static const union AnimCmd gSpriteAnim_83A0454[] = { ANIMCMD_FRAME(64, 30), ANIMCMD_END, }; -const union AnimCmd gSpriteAnim_83A045C[] = +static const union AnimCmd gSpriteAnim_83A045C[] = { ANIMCMD_FRAME(96, 30), ANIMCMD_END, }; -const union AnimCmd gSpriteAnim_83A0464[] = +static const union AnimCmd gSpriteAnim_83A0464[] = { ANIMCMD_FRAME(128, 30), ANIMCMD_END, }; -const union AnimCmd gSpriteAnim_83A046C[] = +static const union AnimCmd gSpriteAnim_83A046C[] = { ANIMCMD_FRAME(160, 30), ANIMCMD_END, }; -const union AnimCmd gSpriteAnim_83A0474[] = +static const union AnimCmd gSpriteAnim_83A0474[] = { ANIMCMD_FRAME(192, 30), ANIMCMD_END, }; -const union AnimCmd gSpriteAnim_83A047C[] = +static const union AnimCmd gSpriteAnim_83A047C[] = { ANIMCMD_FRAME(224, 30), ANIMCMD_END, }; -const union AnimCmd gSpriteAnim_83A0484[] = +static const union AnimCmd gSpriteAnim_83A0484[] = { ANIMCMD_FRAME(226, 30), ANIMCMD_END, }; -const union AnimCmd gSpriteAnim_83A048C[] = +static const union AnimCmd gSpriteAnim_83A048C[] = { ANIMCMD_FRAME(228, 30), ANIMCMD_END, }; -const union AnimCmd gSpriteAnim_83A0494[] = +static const union AnimCmd gSpriteAnim_83A0494[] = { ANIMCMD_FRAME(230, 30), ANIMCMD_END, }; -const union AnimCmd gSpriteAnim_83A049C[] = +static const union AnimCmd gSpriteAnim_83A049C[] = { ANIMCMD_FRAME(232, 30), ANIMCMD_END, }; -const union AnimCmd gSpriteAnim_83A04A4[] = +static const union AnimCmd gSpriteAnim_83A04A4[] = { ANIMCMD_FRAME(234, 30), ANIMCMD_END, }; -const union AnimCmd gSpriteAnim_83A04AC[] = +static const union AnimCmd gSpriteAnim_83A04AC[] = { ANIMCMD_FRAME(236, 30), ANIMCMD_END, }; -const union AnimCmd gSpriteAnim_83A04B4[] = +static const union AnimCmd gSpriteAnim_83A04B4[] = { ANIMCMD_FRAME(238, 30), ANIMCMD_END, }; -const union AnimCmd gSpriteAnim_83A04BC[] = +static const union AnimCmd gSpriteAnim_83A04BC[] = { ANIMCMD_FRAME(240, 30), ANIMCMD_END, }; -const union AnimCmd gSpriteAnim_83A04C4[] = +static const union AnimCmd gSpriteAnim_83A04C4[] = { ANIMCMD_FRAME(242, 30), ANIMCMD_END, }; -const union AnimCmd gSpriteAnim_83A04CC[] = +static const union AnimCmd gSpriteAnim_83A04CC[] = { ANIMCMD_FRAME(4, 30), ANIMCMD_END, }; -const union AnimCmd *const gSpriteAnimTable_83A04D4[] = +static const union AnimCmd *const gSpriteAnimTable_83A04D4[] = { gSpriteAnim_83A0434, }; -const union AnimCmd *const gSpriteAnimTable_83A04D8[] = +static const union AnimCmd *const gSpriteAnimTable_83A04D8[] = { gSpriteAnim_83A043C, }; -const union AnimCmd *const gSpriteAnimTable_83A04DC[] = +static const union AnimCmd *const gSpriteAnimTable_83A04DC[] = { gSpriteAnim_83A0444, }; -const union AnimCmd *const gSpriteAnimTable_83A04E0[] = +static const union AnimCmd *const gSpriteAnimTable_83A04E0[] = { gSpriteAnim_83A044C, gSpriteAnim_83A0454, gSpriteAnim_83A045C, gSpriteAnim_83A0464, }; -const union AnimCmd *const gSpriteAnimTable_83A04F0[] = +static const union AnimCmd *const gSpriteAnimTable_83A04F0[] = { gSpriteAnim_83A046C, gSpriteAnim_83A0474, }; -const union AnimCmd *const gSpriteAnimTable_83A04F8[] = +static const union AnimCmd *const gSpriteAnimTable_83A04F8[] = { gSpriteAnim_83A047C, gSpriteAnim_83A0484, @@ -436,11 +418,11 @@ const union AnimCmd *const gSpriteAnimTable_83A04F8[] = gSpriteAnim_83A04BC, gSpriteAnim_83A04C4, }; -const union AnimCmd *const gSpriteAnimTable_83A0520[] = +static const union AnimCmd *const gSpriteAnimTable_83A0520[] = { gSpriteAnim_83A04CC, }; -const struct SpriteTemplate gSpriteTemplate_83A0524 = +static const struct SpriteTemplate gSpriteTemplate_83A0524 = { .tileTag = 4096, .paletteTag = 4096, @@ -450,7 +432,7 @@ const struct SpriteTemplate gSpriteTemplate_83A0524 = .affineAnims = gDummySpriteAffineAnimTable, .callback = sub_808EF38, }; -const struct SpriteTemplate gSpriteTemplate_83A053C = +static const struct SpriteTemplate gSpriteTemplate_83A053C = { .tileTag = 4096, .paletteTag = 4096, @@ -460,7 +442,7 @@ const struct SpriteTemplate gSpriteTemplate_83A053C = .affineAnims = gDummySpriteAffineAnimTable, .callback = sub_808EF8C, }; -const struct SpriteTemplate gSpriteTemplate_83A0554 = +static const struct SpriteTemplate gSpriteTemplate_83A0554 = { .tileTag = 4096, .paletteTag = 4096, @@ -470,7 +452,7 @@ const struct SpriteTemplate gSpriteTemplate_83A0554 = .affineAnims = gDummySpriteAffineAnimTable, .callback = sub_808F08C, }; -const struct SpriteTemplate gSpriteTemplate_83A056C = +static const struct SpriteTemplate gSpriteTemplate_83A056C = { .tileTag = 4096, .paletteTag = 4096, @@ -480,7 +462,7 @@ const struct SpriteTemplate gSpriteTemplate_83A056C = .affineAnims = gDummySpriteAffineAnimTable, .callback = sub_808F0B4, }; -const struct SpriteTemplate gSpriteTemplate_83A0584 = +static const struct SpriteTemplate gSpriteTemplate_83A0584 = { .tileTag = 4096, .paletteTag = 4096, @@ -490,7 +472,7 @@ const struct SpriteTemplate gSpriteTemplate_83A0584 = .affineAnims = gDummySpriteAffineAnimTable, .callback = sub_808ED94, }; -const struct SpriteTemplate gSpriteTemplate_83A059C = +static const struct SpriteTemplate gSpriteTemplate_83A059C = { .tileTag = 4096, .paletteTag = 4096, @@ -500,7 +482,7 @@ const struct SpriteTemplate gSpriteTemplate_83A059C = .affineAnims = gDummySpriteAffineAnimTable, .callback = sub_808ED94, }; -const struct SpriteTemplate gSpriteTemplate_83A05B4 = +static const struct SpriteTemplate gSpriteTemplate_83A05B4 = { .tileTag = 4096, .paletteTag = 4096, @@ -510,24 +492,24 @@ const struct SpriteTemplate gSpriteTemplate_83A05B4 = .affineAnims = gDummySpriteAffineAnimTable, .callback = sub_808F168, }; -const struct SpriteSheet gUnknown_083A05CC[] = +static const struct SpriteSheet gUnknown_083A05CC[] = { {gPokedexMenu2_Gfx, 0x1F00, 0x1000}, {NULL, 0, 0}, }; -const struct SpritePalette gUnknown_083A05DC[] = +static const struct SpritePalette gUnknown_083A05DC[] = { {gPokedexMenu_Pal, 0x1000}, {NULL, 0}, }; -const u8 gUnknown_083A05EC[] = {2, 4, 8, 16, 32}; -const u8 gUnknown_083A05F1[] = {16, 8, 4, 2, 1}; +static const u8 gUnknown_083A05EC[] = {2, 4, 8, 16, 32}; +static const u8 gUnknown_083A05F1[] = {16, 8, 4, 2, 1}; const u8 gEmptySpacce_83A05F6[] = {0, 0}; // Padding, maybe? -const u8 gUnknown_083A05F8[] = _(""); +static const u8 gUnknown_083A05F8[] = _(""); // TODO: include German entries #include "data/pokedex_entries_en.h" -const u16 gUnknown_083B4EC4[16] = {0}; -const u8 *const gMonFootprintTable[] = +static const u16 gUnknown_083B4EC4[16] = {0}; +static const u8 *const sMonFootprintTable[] = { gMonFootprint_Bulbasaur, gMonFootprint_Bulbasaur, @@ -943,9 +925,9 @@ const u8 *const gMonFootprintTable[] = gMonFootprint_Chimecho, gMonFootprint_Bulbasaur, }; -const u8 gUnknown_083B5558[] = _("{CLEAR_TO 0}"); +static const u8 gUnknown_083B5558[] = _("{CLEAR_TO 0}"); const u8 gUnknown_083B555C[] = INCBIN_U8("graphics/unknown/unknown_3B555C.bin"); -const struct OamData gOamData_83B557C = +static const struct OamData gOamData_83B557C = { .y = 0, .affineMode = 0, @@ -961,14 +943,14 @@ const struct OamData gOamData_83B557C = .paletteNum = 0, .affineParam = 0, }; -void *const gUnknown_083B5584[] = +static void *const gUnknown_083B5584[] = { (void *)0x02008000, (void *)0x0200C000, (void *)0x02010000, (void *)0x02014000, }; -const struct SpriteFrameImage gSpriteImageTable_83B5594[] = +static const struct SpriteFrameImage gSpriteImageTable_83B5594[] = { {(u8 *)0x02008000, 0x800}, {(u8 *)0x02008800, 0x800}, @@ -987,7 +969,7 @@ const struct SpriteFrameImage gSpriteImageTable_83B5594[] = {(u8 *)0x0200F000, 0x800}, {(u8 *)0x0200F800, 0x800}, }; -const struct SpriteFrameImage gSpriteImageTable_83B5614[] = +static const struct SpriteFrameImage gSpriteImageTable_83B5614[] = { {(u8 *)0x0200C000, 0x800}, {(u8 *)0x0200C800, 0x800}, @@ -1006,7 +988,7 @@ const struct SpriteFrameImage gSpriteImageTable_83B5614[] = {(u8 *)0x02013000, 0x800}, {(u8 *)0x02013800, 0x800}, }; -const struct SpriteFrameImage gSpriteImageTable_83B5694[] = +static const struct SpriteFrameImage gSpriteImageTable_83B5694[] = { {(u8 *)0x02010000, 0x800}, {(u8 *)0x02010800, 0x800}, @@ -1025,7 +1007,7 @@ const struct SpriteFrameImage gSpriteImageTable_83B5694[] = {(u8 *)0x02017000, 0x800}, {(u8 *)0x02017800, 0x800}, }; -const struct SpriteFrameImage gSpriteImageTable_83B5714[] = +static const struct SpriteFrameImage gSpriteImageTable_83B5714[] = { {(u8 *)0x02014000, 0x800}, {(u8 *)0x02014800, 0x800}, @@ -1044,7 +1026,7 @@ const struct SpriteFrameImage gSpriteImageTable_83B5714[] = {(u8 *)0x0201B000, 0x800}, {(u8 *)0x0201B800, 0x800}, }; -const struct SpriteFrameImage *const gUnknown_083B5794[] = +static const struct SpriteFrameImage *const gUnknown_083B5794[] = { gSpriteImageTable_83B5594, gSpriteImageTable_83B5614, @@ -1052,7 +1034,7 @@ const struct SpriteFrameImage *const gUnknown_083B5794[] = gSpriteImageTable_83B5714, }; static void nullsub_59(struct Sprite *); -const struct SpriteTemplate gUnknown_083B57A4 = +static const struct SpriteTemplate gUnknown_083B57A4 = { .tileTag = 0xFFFF, .paletteTag = 0, @@ -1062,7 +1044,7 @@ const struct SpriteTemplate gUnknown_083B57A4 = .affineAnims = gDummySpriteAffineAnimTable, .callback = nullsub_59, }; -const u8 gUnknown_083B57BC[][4] = +static const u8 gUnknown_083B57BC[][4] = { {0, 0, 0, 0}, {CHAR_A, 3, CHAR_a, 3}, @@ -1075,13 +1057,13 @@ const u8 gUnknown_083B57BC[][4] = {CHAR_V, 3, CHAR_v, 3}, {CHAR_Y, 2, CHAR_y, 2}, }; -const struct UnknownStruct3 gUnknown_083B57E4[] = +static const struct UnknownStruct3 gUnknown_083B57E4[] = { {DexText_SearchForPoke, 0, 0, 5}, {DexText_SwitchDex, 6, 0, 5}, {DexText_ReturnToDex, 12, 0, 5}, }; -const struct UnknownStruct4 gUnknown_083B57FC[] = +static const struct UnknownStruct4 gUnknown_083B57FC[] = { {DexText_ListByABC, 0, 2, 5, 5, 2, 12}, {DexText_ListByColor, 0, 4, 5, 5, 4, 12}, @@ -1091,7 +1073,7 @@ const struct UnknownStruct4 gUnknown_083B57FC[] = {DexText_SelectDexMode, 0, 10, 5, 5, 10, 12}, {DexText_ExecuteSearchSwitch, 0, 12, 5, 0, 0, 0}, }; -const u8 gUnknown_083B5850[][4] = +static const u8 gUnknown_083B5850[][4] = { {0xFF, 0xFF, 0xFF, 1}, {0xFF, 0xFF, 0, 2}, @@ -1101,7 +1083,7 @@ const u8 gUnknown_083B5850[][4] = {0xFF, 0xFF, 4, 6}, {0xFF, 0xFF, 5, 0xFF}, }; -const u8 gUnknown_083B586C[][4] = +static const u8 gUnknown_083B586C[][4] = { {0xFF, 0xFF, 0xFF, 0xFF}, {0xFF, 0xFF, 0xFF, 0xFF}, @@ -1111,7 +1093,7 @@ const u8 gUnknown_083B586C[][4] = {0xFF, 0xFF, 4, 6}, {0xFF, 0xFF, 5, 0xFF}, }; -const u8 gUnknown_083B5888[][4] = +static const u8 gUnknown_083B5888[][4] = { {0xFF, 0xFF, 0xFF, 1}, {0xFF, 0xFF, 0, 2}, @@ -1121,7 +1103,7 @@ const u8 gUnknown_083B5888[][4] = {0xFF, 0xFF, 0xFF, 0xFF}, {0xFF, 0xFF, 4, 0xFF}, }; -const u8 gUnknown_083B58A4[][4] = +static const u8 gUnknown_083B58A4[][4] = { {0xFF, 0xFF, 0xFF, 0xFF}, {0xFF, 0xFF, 0xFF, 0xFF}, @@ -1131,13 +1113,13 @@ const u8 gUnknown_083B58A4[][4] = {0xFF, 0xFF, 0xFF, 0xFF}, {0xFF, 0xFF, 4, 0xFF}, }; -const struct UnknownStruct2 gUnknown_083B58C0[] = +static const struct UnknownStruct2 gUnknown_083B58C0[] = { {DexText_HoennDex2, DexText_HoennDex}, {DexText_NationalDex2, DexText_NationalDex}, {NULL, NULL}, }; -const struct UnknownStruct2 gUnknown_083B58D8[] = +static const struct UnknownStruct2 gUnknown_083B58D8[] = { {DexText_ListByNumber, DexText_NumericalMode}, {DexText_ListByABC2, DexText_ABCMode}, @@ -1147,7 +1129,7 @@ const struct UnknownStruct2 gUnknown_083B58D8[] = {DexText_ListBySmallToTallest, DexText_SmallestMode}, {NULL, NULL}, }; -const struct UnknownStruct2 gUnknown_083B5910[] = +static const struct UnknownStruct2 gUnknown_083B5910[] = { {DexText_Terminator5, DexText_DontSpecify}, {DexText_Terminator5, DexText_ABC}, @@ -1161,7 +1143,7 @@ const struct UnknownStruct2 gUnknown_083B5910[] = {DexText_Terminator5, DexText_YZ}, {NULL, NULL}, }; -const struct UnknownStruct2 gUnknown_083B5968[] = +static const struct UnknownStruct2 gUnknown_083B5968[] = { {DexText_Terminator5, DexText_DontSpecify}, {DexText_Terminator5, DexText_Red}, @@ -1176,7 +1158,7 @@ const struct UnknownStruct2 gUnknown_083B5968[] = {DexText_Terminator5, DexText_Pink}, {NULL, NULL}, }; -const struct UnknownStruct2 gUnknown_083B59C8[] = +static const struct UnknownStruct2 gUnknown_083B59C8[] = { {DexText_Terminator5, DexText_None}, {DexText_Terminator5, gTypeNames[TYPE_NORMAL]}, @@ -1198,10 +1180,10 @@ const struct UnknownStruct2 gUnknown_083B59C8[] = {DexText_Terminator5, gTypeNames[TYPE_DARK]}, {NULL, NULL}, }; -const u8 gUnknown_083B5A60[] = {0, 1}; -const u8 gUnknown_083B5A62[] = {0, 1, 2, 3, 4, 5}; -const u8 gUnknown_083B5A68[] = {0xFF, 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17}; -const struct UnknownStruct1 gUnknown_083B5A7C[] = +static const u8 gUnknown_083B5A60[] = {0, 1}; +static const u8 gUnknown_083B5A62[] = {0, 1, 2, 3, 4, 5}; +static const u8 gUnknown_083B5A68[] = {0xFF, 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17}; +static const struct UnknownStruct1 gUnknown_083B5A7C[] = { {gUnknown_083B5910, 6, 7, 10}, {gUnknown_083B5968, 8, 9, 11}, @@ -1210,36 +1192,62 @@ const struct UnknownStruct1 gUnknown_083B5A7C[] = {gUnknown_083B58D8, 4, 5, 6}, {gUnknown_083B58C0, 2, 3, 2}, }; -const u8 gUnknown_083B5AAC[] = _("{STR_VAR_1}{CLEAR_TO 43}"); -const u8 gUnknown_083B5AB2[] = _("{STR_VAR_1}{CLEAR_TO 96}"); - +static const u8 gUnknown_083B5AAC[] = _("{STR_VAR_1}{CLEAR_TO 43}"); +static const u8 gUnknown_083B5AB2[] = _("{STR_VAR_1}{CLEAR_TO 96}"); + +static void MainCB(void); +static void Task_PokedexShowMainScreen(u8 taskId); +static void Task_PokedexMainScreen(u8 taskId); +static void sub_808C898(u8 taskId); +static void Task_PokedexMainScreenMenu(u8 taskId); +static void sub_808CA64(u8 taskId); +static void sub_808CAE4(u8 taskId); +static void sub_808CB8C(u8 taskId); +static void Task_ClosePokedex(u8 taskId); +static void sub_808CCC4(u8 taskId); +static void Task_PokedexResultsScreen(u8 taskId); +static void sub_808CEF8(u8 taskId); +static void Task_PokedexResultsScreenMenu(u8 taskId); +static void sub_808D118(u8 taskId); +static void sub_808D198(u8 taskId); +static void Task_PokedexResultsScreenReturnToMainScreen(u8 taskId); +static void Task_PokedexResultsScreenExitPokedex(u8 taskId); +static bool8 sub_808D344(u8 a); +static void sub_808D640(void); +static void SortPokedex(u8 dexMode, u8 sortMode); +static void sub_808DEB0(u16 a, u8 b, u8 c, u16 d); +static void sub_808DF88(u16 a, u8 b, u8 c, u16 d); +static u8 sub_808DFE4(u16 num, u8 b, u8 c); +static void sub_808E090(u8 a, u8 b, u16 c); +static void sub_808E0CC(u16 a, u16 b); static u32 sub_808E8C8(u16 a, s16 b, s16 c); static u8 sub_808F210(struct PokedexListItem *, u8); static u8 sub_808F284(struct PokedexListItem *, u8); void sub_8090B8C(u8); void sub_8090C28(struct Sprite *); s8 GetNationalPokedexFlag(u16, u8); +static void sub_8091738(u16, u16, u16); u16 sub_80918EC(u16 a, s16 b, s16 c, u16 d); //Not sure of return type -void sub_8091E54(u8); -void sub_809204C(u8); -void sub_809207C(u8); -void sub_809217C(u8); -void sub_80921B0(u8); -void sub_80923FC(u8); -void sub_80924A4(u8); -void sub_8092508(u8); -void sub_80925CC(u8); -void sub_8092644(u8); -void sub_80927B8(u8); -void sub_80927F0(u8); -void sub_8092AB0(u8); -void sub_8092AD4(u8, u8); -void sub_8092B68(u8); -void sub_8092C8C(u8); -void sub_8092D78(u8); -u8 sub_8092E10(u8, u8); -void sub_8092EB0(u8); -void sub_809308C(u8); +static void sub_8091E54(u8); +static void sub_809204C(u8); +static void sub_809207C(u8); +static void sub_809217C(u8); +static void sub_80921B0(u8); +static void sub_80923FC(u8); +static void sub_80924A4(u8); +static void sub_8092508(u8); +static void sub_80925CC(u8); +static void sub_8092644(u8); +static void sub_80927B8(u8); +static void sub_80927F0(u8); +static void sub_8092AB0(u8); +static void sub_8092AD4(u8, u8); +static void sub_8092B68(u8); +static void sub_8092C8C(u8); +static void sub_8092D78(u8); +static u8 sub_8092E10(u8, u8); +static void sub_8092EB0(u8); +static void sub_809308C(u8); extern u16 NationalPokedexNumToSpecies(u16); void ShowPokedexAreaScreen(u16 species, u8 *string); @@ -1456,7 +1464,7 @@ u8 unref_sub_808C540(void (*func)(u8)) return gTasks[taskId].data[0]; } -void MainCB(void) +static void MainCB(void) { RunTasks(); AnimateSprites(); @@ -1464,13 +1472,11 @@ void MainCB(void) UpdatePaletteFade(); } -void Task_PokedexShowMainScreen(u8 taskId) +static void Task_PokedexShowMainScreen(u8 taskId) { gPokedexView->unk64C_1 = 0; if (sub_808D344(0)) - { gTasks[taskId].func = Task_PokedexMainScreen; - } } //Hide menu and process input on main screen @@ -1531,14 +1537,14 @@ void Task_PokedexMainScreen(u8 taskId) } } -void sub_808C898(u8 taskId) +static void sub_808C898(u8 taskId) { if (sub_808E208(gPokedexView->unk62F, gPokedexView->unk634, gPokedexView->unk636)) gTasks[taskId].func = Task_PokedexMainScreen; } //Bring up menu and process menu input -void Task_PokedexMainScreenMenu(u8 taskId) +static void Task_PokedexMainScreenMenu(u8 taskId) { REG_BG0VOFS = gPokedexView->menuY; @@ -1597,7 +1603,7 @@ void Task_PokedexMainScreenMenu(u8 taskId) } } -void sub_808CA64(u8 taskId) +static void sub_808CA64(u8 taskId) { if (gSprites[gPokedexView->selectedMonSpriteId].pos1.x == 48 && gSprites[gPokedexView->selectedMonSpriteId].pos1.y == 56) @@ -1608,7 +1614,7 @@ void sub_808CA64(u8 taskId) } } -void sub_808CAE4(u8 taskId) +static void sub_808CAE4(u8 taskId) { if (gTasks[gTasks[taskId].data[0]].isActive) { @@ -1623,7 +1629,7 @@ void sub_808CAE4(u8 taskId) } } -void sub_808CB8C(u8 taskId) +static void sub_808CB8C(u8 taskId) { bool8 isActive = gTasks[gTasks[taskId].data[0]].isActive; @@ -1648,7 +1654,7 @@ void sub_808CB8C(u8 taskId) } } -void Task_ClosePokedex(u8 taskId) +static void Task_ClosePokedex(u8 taskId) { if (!gPaletteFade.active) { @@ -1662,14 +1668,14 @@ void Task_ClosePokedex(u8 taskId) } } -void sub_808CCC4(u8 taskId) +static void sub_808CCC4(u8 taskId) { gPokedexView->unk64C_1 = 1; if (sub_808D344(3)) gTasks[taskId].func = Task_PokedexResultsScreen; } -void Task_PokedexResultsScreen(u8 taskId) +static void Task_PokedexResultsScreen(u8 taskId) { REG_BG0VOFS = gPokedexView->menuY; @@ -1722,13 +1728,13 @@ void Task_PokedexResultsScreen(u8 taskId) } } -void sub_808CEF8(u8 taskId) +static void sub_808CEF8(u8 taskId) { if (sub_808E208(gPokedexView->unk62F, gPokedexView->unk634, gPokedexView->unk636)) gTasks[taskId].func = Task_PokedexResultsScreen; } -void Task_PokedexResultsScreenMenu(u8 taskId) +static void Task_PokedexResultsScreenMenu(u8 taskId) { REG_BG0VOFS = gPokedexView->menuY; @@ -1793,7 +1799,7 @@ void Task_PokedexResultsScreenMenu(u8 taskId) } } -void sub_808D118(u8 taskId) +static void sub_808D118(u8 taskId) { if (gSprites[gPokedexView->selectedMonSpriteId].pos1.x == 48 && gSprites[gPokedexView->selectedMonSpriteId].pos1.y == 56) @@ -1804,7 +1810,7 @@ void sub_808D118(u8 taskId) } } -void sub_808D198(u8 taskId) +static void sub_808D198(u8 taskId) { if (gTasks[gTasks[taskId].data[0]].isActive) { @@ -1817,7 +1823,7 @@ void sub_808D198(u8 taskId) } } -void Task_PokedexResultsScreenReturnToMainScreen(u8 taskId) +static void Task_PokedexResultsScreenReturnToMainScreen(u8 taskId) { if (!gPaletteFade.active) { @@ -1831,7 +1837,7 @@ void Task_PokedexResultsScreenReturnToMainScreen(u8 taskId) } } -void Task_PokedexResultsScreenExitPokedex(u8 taskId) +static void Task_PokedexResultsScreenExitPokedex(u8 taskId) { if (!gPaletteFade.active) { @@ -1845,8 +1851,7 @@ void Task_PokedexResultsScreenExitPokedex(u8 taskId) } } - -bool8 sub_808D344(u8 a) +static bool8 sub_808D344(u8 a) { switch (gMain.state) { @@ -1929,17 +1934,17 @@ bool8 sub_808D344(u8 a) return FALSE; } -void sub_808D640(void) +static void sub_808D640(void) { if (gPokedexView->unk64C_1) - LoadPalette(gUnknown_0839F67C + 1, 1, sizeof(gUnknown_0839F67C) - sizeof(u16)); + LoadPalette(sPokedexSearchPalette + 1, 1, sizeof(sPokedexSearchPalette) - sizeof(u16)); else if (!IsNationalPokedexEnabled()) LoadPalette(gPokedexMenu_Pal + 1, 1, 0xBE); else - LoadPalette(gUnknown_0839F73C + 1, 1, sizeof(gUnknown_0839F73C) - sizeof(u16)); + LoadPalette(sNationalPokedexPalette + 1, 1, sizeof(sNationalPokedexPalette) - sizeof(u16)); } -void SortPokedex(u8 dexMode, u8 sortMode) +static void SortPokedex(u8 dexMode, u8 sortMode) { u16 vars[3]; //I have no idea why three regular variables are stored in an array, but whatever. s16 i; @@ -2086,7 +2091,7 @@ void SortPokedex(u8 dexMode, u8 sortMode) } } -void sub_808DBE8(u8 a, u16 b, u16 c) +static void sub_808DBE8(u8 a, u16 b, u16 c) { s16 _b; u16 i; @@ -2172,7 +2177,7 @@ void sub_808DBE8(u8 a, u16 b, u16 c) } } -void sub_808DEB0(u16 a, u8 b, u8 c, u16 d) +static void sub_808DEB0(u16 a, u8 b, u8 c, u16 d) { u8 text[4]; u16 unk[2]; @@ -2191,7 +2196,7 @@ void sub_808DEB0(u16 a, u8 b, u8 c, u16 d) MenuPrint(text, b - 15, c); } -void sub_808DF88(u16 a, u8 b, u8 c, u16 d) +static void sub_808DF88(u16 a, u8 b, u8 c, u16 d) { u16 unk[2]; @@ -2209,7 +2214,7 @@ void sub_808DF88(u16 a, u8 b, u8 c, u16 d) *(u16 *)(VRAM + d * 0x800 + (c + 1) * 0x40 + b * 2) = unk[1]; } -u8 sub_808DFE4(u16 num, u8 b, u8 c) +static u8 sub_808DFE4(u16 num, u8 b, u8 c) { u8 text[10]; u8 i; @@ -2234,7 +2239,7 @@ u8 sub_808DFE4(u16 num, u8 b, u8 c) return i; } -void sub_808E090(u8 a, u8 b, u16 c) +static void sub_808E090(u8 a, u8 b, u16 c) { u8 i; @@ -2245,7 +2250,7 @@ void sub_808E090(u8 a, u8 b, u16 c) } } -void sub_808E0CC(u16 a, u16 b) +static void sub_808E0CC(u16 a, u16 b) { u8 i; u16 unk; @@ -2334,7 +2339,6 @@ void sub_808E398(u8 a, u16 b) switch (a) { case 1: - { unk = sub_808E888(b - 1); if (unk != 0xFFFF) { @@ -2347,9 +2351,7 @@ void sub_808E398(u8 a, u16 b) else gPokedexView->unk630 = 15; break; - } case 2: - { unk = sub_808E888(b + 1); if (unk != 0xFFFF) { @@ -2363,368 +2365,87 @@ void sub_808E398(u8 a, u16 b) gPokedexView->unk630 = 0; break; } - } } -#ifdef NONMATCHING -//This one's ridiculous. Fix later + u16 sub_808E48C(u16 a, u16 b) { u8 r3; u8 r5; - u32 r10 = 0; - if (!(gMain.heldKeys & 0x40) || a == 0) + u8 i; + u16 r6; + u8 r10 = 0; + + if (!((gMain.heldKeys & 0x40) && (a > 0))) { - u8 i; - u16 r6; - //_0808E4B6 - if (gMain.heldKeys & 0x80) - { - if (a < gPokedexView->pokemonListCount - 1) - goto _0808E5C4; - } + if (!((gMain.heldKeys & 0x80) && (a < gPokedexView->pokemonListCount - 1))) //_0808E4CE - - if ((gMain.newKeys & 0x20) && a != 0) { - r6 = a; - //_0808E4E0 - for (i = 0; i < 7; i++) + if ((gMain.newKeys & 0x20) && (a > 0)) { - a = sub_8091818(1, a, 0, gPokedexView->pokemonListCount - 1); + r6 = a; + //_0808E4E0 + for (i = 0; i < 7; i++) + a = sub_8091818(1, a, 0, gPokedexView->pokemonListCount - 1); + gPokedexView->unk62C += 16 * (a - r6); + sub_808E82C(); + sub_808E0CC(a, 0xE); + PlaySE(0x6D); + } + //_0808E53C + else if ((gMain.newKeys & 0x10) && (a < gPokedexView->pokemonListCount - 1)) + { + r6 = a; + for (i = 0; i < 7; i++) + a = sub_8091818(0, a, 0, gPokedexView->pokemonListCount - 1); + gPokedexView->unk62C += (a - r6) * 16; + sub_808E82C(); + sub_808E0CC(a, 0xE); + PlaySE(0x6D); + } + _0808E5A2: + if (r10 == 0) + { + gPokedexView->unk638 = 0; + return a; } - - gPokedexView->unk62C += (a - r6) * 16; - sub_808E82C(); - sub_808E0CC(a, 0xE); - PlaySE(SE_Z_PAGE); - goto _0808E5A2; } - //_0808E53C - if (!(gMain.newKeys & 0x10) || a >= gPokedexView->pokemonListCount - 1) - goto _0808E5A2; - - r6 = a; - for (i = 0; i < 7; i++) + else { + // to _0808E5C4 + r10 = 2; a = sub_8091818(0, a, 0, gPokedexView->pokemonListCount - 1); + sub_808E398(2, a); + //goto _0808E60E + sub_808DBE8(2, a, b); + PlaySE(0x6C); + goto _0808E5A2; } - - gPokedexView->unk62C += (a - r6) * 16; - sub_808E82C(); - sub_808E0CC(a, 0xE); - PlaySE(SE_Z_PAGE); - goto _0808E5A2; - - _0808E5A2: - if (r10 != 0) - goto _0808E628; - gPokedexView->unk638 = r10; - return a; - - _0808E5C4: - r10 = 2; - a = sub_8091818(0, a, 0, gPokedexView->pokemonListCount - 1); - sub_808E398(2, a); - //goto _0808E60E - sub_808DBE8(2, a, b); - PlaySE(SE_Z_SCROLL); } - //_0808E5E4 else { + //to _0808E5E4 r10 = 1; a = sub_8091818(1, a, 0, gPokedexView->pokemonListCount - 1); sub_808E398(1, a); //_0808E60E sub_808DBE8(1, a, b); - PlaySE(SE_Z_SCROLL); + PlaySE(0x6C); + goto _0808E5A2; } - //_0808E60E - goto _0808E5A2; - - _0808E628: + //_0808E628 r5 = gUnknown_083A05EC[gPokedexView->unk638 / 4]; r3 = gUnknown_083A05F1[gPokedexView->unk638 / 4]; gPokedexView->unk62E = r3; gPokedexView->unk636 = r3; gPokedexView->unk634 = r5; gPokedexView->unk62F = r10; - gPokedexView->unk628 = r5; + gPokedexView->unk628 = r5 / 2; sub_808E208(gPokedexView->unk62F, gPokedexView->unk634, gPokedexView->unk636); if (gPokedexView->unk638 <= 0xB) gPokedexView->unk638++; return a; } -#else -__attribute__((naked)) -u16 sub_808E48C(u16 a, u16 b) -{ - 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\ - lsls r0, 16\n\ - lsrs r7, r0, 16\n\ - lsls r1, 16\n\ - lsrs r4, r1, 16\n\ - movs r0, 0\n\ - mov r10, r0\n\ - ldr r1, _0808E52C\n\ - ldrh r2, [r1, 0x2C]\n\ - movs r0, 0x40\n\ - ands r0, r2\n\ - adds r3, r1, 0\n\ - cmp r0, 0\n\ - beq _0808E4B6\n\ - cmp r7, 0\n\ - beq _0808E4B6\n\ - b _0808E5E4\n\ -_0808E4B6:\n\ - movs r0, 0x80\n\ - ands r0, r2\n\ - cmp r0, 0\n\ - beq _0808E4CE\n\ - ldr r0, _0808E530\n\ - ldr r0, [r0]\n\ - ldr r1, _0808E534\n\ - adds r0, r1\n\ - ldrh r0, [r0]\n\ - subs r0, 0x1\n\ - cmp r7, r0\n\ - blt _0808E5C4\n\ -_0808E4CE:\n\ - ldrh r1, [r3, 0x2E]\n\ - movs r0, 0x20\n\ - ands r0, r1\n\ - cmp r0, 0\n\ - beq _0808E53C\n\ - cmp r7, 0\n\ - beq _0808E53C\n\ - adds r6, r7, 0\n\ - movs r4, 0\n\ -_0808E4E0:\n\ - ldr r5, _0808E530\n\ - ldr r0, [r5]\n\ - ldr r2, _0808E534\n\ - adds r0, r2\n\ - ldrh r3, [r0]\n\ - subs r3, 0x1\n\ - lsls r3, 16\n\ - lsrs r3, 16\n\ - movs r0, 0x1\n\ - adds r1, r7, 0\n\ - movs r2, 0\n\ - bl sub_8091818\n\ - adds r7, r0, 0\n\ - adds r0, r4, 0x1\n\ - lsls r0, 24\n\ - lsrs r4, r0, 24\n\ - cmp r4, 0x6\n\ - bls _0808E4E0\n\ - ldr r1, [r5]\n\ - ldr r3, _0808E538\n\ - adds r1, r3\n\ - subs r0, r7, r6\n\ - lsls r0, 4\n\ - ldrb r2, [r1]\n\ - adds r0, r2\n\ - strb r0, [r1]\n\ - bl sub_808E82C\n\ - adds r0, r7, 0\n\ - movs r1, 0xE\n\ - bl sub_808E0CC\n\ - movs r0, 0x6D\n\ - bl PlaySE\n\ - b _0808E5A2\n\ - .align 2, 0\n\ -_0808E52C: .4byte gMain\n\ -_0808E530: .4byte gPokedexView\n\ -_0808E534: .4byte 0x0000060c\n\ -_0808E538: .4byte 0x0000062c\n\ -_0808E53C:\n\ - ldrh r1, [r3, 0x2E]\n\ - movs r0, 0x10\n\ - ands r0, r1\n\ - cmp r0, 0\n\ - beq _0808E5A2\n\ - ldr r0, _0808E5B8\n\ - ldr r0, [r0]\n\ - ldr r3, _0808E5BC\n\ - adds r0, r3\n\ - ldrh r0, [r0]\n\ - subs r0, 0x1\n\ - cmp r7, r0\n\ - bge _0808E5A2\n\ - adds r6, r7, 0\n\ - movs r4, 0\n\ -_0808E55A:\n\ - ldr r5, _0808E5B8\n\ - ldr r0, [r5]\n\ - ldr r1, _0808E5BC\n\ - adds r0, r1\n\ - ldrh r3, [r0]\n\ - subs r3, 0x1\n\ - lsls r3, 16\n\ - lsrs r3, 16\n\ - movs r0, 0\n\ - adds r1, r7, 0\n\ - movs r2, 0\n\ - bl sub_8091818\n\ - adds r7, r0, 0\n\ - adds r0, r4, 0x1\n\ - lsls r0, 24\n\ - lsrs r4, r0, 24\n\ - cmp r4, 0x6\n\ - bls _0808E55A\n\ - ldr r1, [r5]\n\ - ldr r2, _0808E5C0\n\ - adds r1, r2\n\ - subs r0, r7, r6\n\ - lsls r0, 4\n\ - ldrb r3, [r1]\n\ - adds r0, r3\n\ - strb r0, [r1]\n\ - bl sub_808E82C\n\ - adds r0, r7, 0\n\ - movs r1, 0xE\n\ - bl sub_808E0CC\n\ - movs r0, 0x6D\n\ - bl PlaySE\n\ -_0808E5A2:\n\ - mov r0, r10\n\ - cmp r0, 0\n\ - bne _0808E628\n\ - ldr r0, _0808E5B8\n\ - ldr r0, [r0]\n\ - movs r1, 0xC7\n\ - lsls r1, 3\n\ - adds r0, r1\n\ - mov r2, r10\n\ - strh r2, [r0]\n\ - b _0808E68E\n\ - .align 2, 0\n\ -_0808E5B8: .4byte gPokedexView\n\ -_0808E5BC: .4byte 0x0000060c\n\ -_0808E5C0: .4byte 0x0000062c\n\ -_0808E5C4:\n\ - movs r3, 0x2\n\ - mov r10, r3\n\ - lsls r3, r0, 16\n\ - lsrs r3, 16\n\ - movs r0, 0\n\ - adds r1, r7, 0\n\ - movs r2, 0\n\ - bl sub_8091818\n\ - adds r7, r0, 0\n\ - movs r0, 0x2\n\ - adds r1, r7, 0\n\ - bl sub_808E398\n\ - movs r0, 0x2\n\ - b _0808E60E\n\ -_0808E5E4:\n\ - movs r0, 0x1\n\ - mov r10, r0\n\ - ldr r0, _0808E620\n\ - ldr r0, [r0]\n\ - ldr r1, _0808E624\n\ - adds r0, r1\n\ - ldrh r3, [r0]\n\ - subs r3, 0x1\n\ - lsls r3, 16\n\ - lsrs r3, 16\n\ - movs r0, 0x1\n\ - adds r1, r7, 0\n\ - movs r2, 0\n\ - bl sub_8091818\n\ - adds r7, r0, 0\n\ - movs r0, 0x1\n\ - adds r1, r7, 0\n\ - bl sub_808E398\n\ - movs r0, 0x1\n\ -_0808E60E:\n\ - adds r1, r7, 0\n\ - adds r2, r4, 0\n\ - bl sub_808DBE8\n\ - movs r0, 0x6C\n\ - bl PlaySE\n\ - b _0808E5A2\n\ - .align 2, 0\n\ -_0808E620: .4byte gPokedexView\n\ -_0808E624: .4byte 0x0000060c\n\ -_0808E628:\n\ - ldr r1, _0808E6A0\n\ - ldr r6, _0808E6A4\n\ - ldr r2, [r6]\n\ - movs r3, 0xC7\n\ - lsls r3, 3\n\ - mov r9, r3\n\ - adds r0, r2, r3\n\ - ldrh r0, [r0]\n\ - lsrs r0, 2\n\ - adds r1, r0, r1\n\ - ldrb r5, [r1]\n\ - ldr r1, _0808E6A8\n\ - adds r0, r1\n\ - ldrb r3, [r0]\n\ - ldr r0, _0808E6AC\n\ - adds r2, r0\n\ - strb r3, [r2]\n\ - ldr r1, [r6]\n\ - ldr r2, _0808E6B0\n\ - mov r8, r2\n\ - adds r0, r1, r2\n\ - strh r3, [r0]\n\ - ldr r4, _0808E6B4\n\ - adds r0, r1, r4\n\ - strh r5, [r0]\n\ - ldr r3, _0808E6B8\n\ - adds r1, r3\n\ - mov r0, r10\n\ - strb r0, [r1]\n\ - ldr r2, [r6]\n\ - lsrs r5, 1\n\ - movs r1, 0xC5\n\ - lsls r1, 3\n\ - adds r0, r2, r1\n\ - strh r5, [r0]\n\ - adds r3, r2, r3\n\ - ldrb r0, [r3]\n\ - adds r4, r2, r4\n\ - ldrb r1, [r4]\n\ - add r2, r8\n\ - ldrb r2, [r2]\n\ - bl sub_808E208\n\ - ldr r0, [r6]\n\ - mov r2, r9\n\ - adds r1, r0, r2\n\ - ldrh r0, [r1]\n\ - cmp r0, 0xB\n\ - bhi _0808E68E\n\ - adds r0, 0x1\n\ - strh r0, [r1]\n\ -_0808E68E:\n\ - adds r0, r7, 0\n\ - pop {r3-r5}\n\ - mov r8, r3\n\ - mov r9, r4\n\ - mov r10, r5\n\ - pop {r4-r7}\n\ - pop {r1}\n\ - bx r1\n\ - .align 2, 0\n\ -_0808E6A0: .4byte gUnknown_083A05EC\n\ -_0808E6A4: .4byte gPokedexView\n\ -_0808E6A8: .4byte gUnknown_083A05F1\n\ -_0808E6AC: .4byte 0x0000062e\n\ -_0808E6B0: .4byte 0x00000636\n\ -_0808E6B4: .4byte 0x00000634\n\ -_0808E6B8: .4byte 0x0000062f\n\ - .syntax divided\n"); -} -#endif void sub_808E6BC(void) { @@ -4125,7 +3846,6 @@ u8 sub_809070C(u16 dexNum, u32 b, u32 c) return taskId; } -#ifdef NONMATCHING // yet again... void sub_8090750(u8 taskId) { u8 spriteId; @@ -4148,7 +3868,12 @@ void sub_8090750(u8 taskId) LZ77UnCompVram(gPokedexMenu_Gfx, (void *)(VRAM + 0x4000)); LZ77UnCompVram(gUnknown_08E96BD4, (void *)(VRAM + 0x7800)); for (i = 0; i < 0x280; i++) - ((u16 *)(VRAM + 0x7800))[i] += 0x2000; + { +#ifndef NONMATCHING + asm(""); +#endif + *(u16 *)(VRAM + 0x7800 + 2 * i) += 0x2000; + } sub_8091738(gTasks[taskId].data[1], 2, 0x3FC); ResetPaletteFade(); LoadPalette(gPokedexMenu_Pal + 1, 0x21, 0x9E); @@ -4204,341 +3929,6 @@ void sub_8090750(u8 taskId) break; } } -#else -__attribute__((naked)) -void sub_8090750(u8 taskId) -{ - asm(".syntax unified\n\ - push {r4-r7,lr}\n\ - sub sp, 0x8\n\ - lsls r0, 24\n\ - lsrs r7, r0, 24\n\ - ldr r1, _08090778 @ =gTasks\n\ - lsls r0, r7, 2\n\ - adds r0, r7\n\ - lsls r0, 3\n\ - adds r0, r1\n\ - ldrh r6, [r0, 0xA]\n\ - movs r2, 0x8\n\ - ldrsh r0, [r0, r2]\n\ - adds r4, r1, 0\n\ - cmp r0, 0x6\n\ - bhi _0809079C\n\ - lsls r0, 2\n\ - ldr r1, _0809077C @ =_08090780\n\ - adds r0, r1\n\ - ldr r0, [r0]\n\ - mov pc, r0\n\ - .align 2, 0\n\ -_08090778: .4byte gTasks\n\ -_0809077C: .4byte _08090780\n\ - .align 2, 0\n\ -_08090780:\n\ - .4byte _0809079C\n\ - .4byte _080907E0\n\ - .4byte _0809085C\n\ - .4byte _080908A0\n\ - .4byte _08090960\n\ - .4byte _080909B8\n\ - .4byte _080909F4\n\ -_0809079C:\n\ - ldr r0, _080907D0 @ =gPaletteFade\n\ - ldrb r1, [r0, 0x7]\n\ - movs r0, 0x80\n\ - ands r0, r1\n\ - cmp r0, 0\n\ - beq _080907AA\n\ - b _08090A26\n\ -_080907AA:\n\ - ldr r1, _080907D4 @ =gUnknown_03005CEC\n\ - ldr r0, _080907D8 @ =gMain\n\ - ldr r0, [r0, 0xC]\n\ - str r0, [r1]\n\ - movs r0, 0\n\ - bl SetVBlankCallback\n\ - movs r0, 0x80\n\ - lsls r0, 1\n\ - bl sub_8091060\n\ - ldr r1, _080907DC @ =gTasks\n\ - lsls r0, r7, 2\n\ - adds r0, r7\n\ - lsls r0, 3\n\ - adds r0, r1\n\ - movs r1, 0x1\n\ - strh r1, [r0, 0x8]\n\ - b _08090A26\n\ - .align 2, 0\n\ -_080907D0: .4byte gPaletteFade\n\ -_080907D4: .4byte gUnknown_03005CEC\n\ -_080907D8: .4byte gMain\n\ -_080907DC: .4byte gTasks\n\ -_080907E0:\n\ - ldr r0, _08090840 @ =gPokedexMenu_Gfx\n\ - ldr r1, _08090844 @ =0x06004000\n\ - bl LZ77UnCompVram\n\ - ldr r0, _08090848 @ =gUnknown_08E96BD4\n\ - ldr r4, _0809084C @ =0x06007800\n\ - adds r1, r4, 0\n\ - bl LZ77UnCompVram\n\ - movs r2, 0\n\ - lsls r5, r7, 2\n\ - mov r12, r5\n\ - movs r0, 0x80\n\ - lsls r0, 6\n\ - adds r6, r0, 0\n\ - ldr r3, _08090850 @ =0x0000027f\n\ -_08090800:\n\ - lsls r0, r2, 1\n\ - adds r0, r4\n\ - ldrh r5, [r0]\n\ - adds r1, r6, r5\n\ - strh r1, [r0]\n\ - adds r0, r2, 0x1\n\ - lsls r0, 16\n\ - lsrs r2, r0, 16\n\ - cmp r2, r3\n\ - bls _08090800\n\ - ldr r0, _08090854 @ =gTasks\n\ - mov r1, r12\n\ - adds r4, r1, r7\n\ - lsls r4, 3\n\ - adds r4, r0\n\ - ldrh r0, [r4, 0xA]\n\ - movs r2, 0xFF\n\ - lsls r2, 2\n\ - movs r1, 0x2\n\ - bl sub_8091738\n\ - bl ResetPaletteFade\n\ - ldr r0, _08090858 @ =gPokedexMenu_Pal + 0x2\n\ - movs r1, 0x21\n\ - movs r2, 0x9E\n\ - bl LoadPalette\n\ - ldrh r0, [r4, 0x8]\n\ - adds r0, 0x1\n\ - strh r0, [r4, 0x8]\n\ - b _08090A26\n\ - .align 2, 0\n\ -_08090840: .4byte gPokedexMenu_Gfx\n\ -_08090844: .4byte 0x06004000\n\ -_08090848: .4byte gUnknown_08E96BD4\n\ -_0809084C: .4byte 0x06007800\n\ -_08090850: .4byte 0x0000027f\n\ -_08090854: .4byte gTasks\n\ -_08090858: .4byte gPokedexMenu_Pal + 0x2\n\ -_0809085C:\n\ - ldr r4, _0809088C @ =gWindowConfig_81E7064\n\ - adds r0, r4, 0\n\ - bl SetUpWindowConfig\n\ - adds r0, r4, 0\n\ - bl InitMenuWindow\n\ - ldr r2, _08090890 @ =0x0600c000\n\ - add r1, sp, 0x4\n\ - movs r0, 0\n\ - strh r0, [r1]\n\ - ldr r0, _08090894 @ =0x040000d4\n\ - str r1, [r0]\n\ - str r2, [r0, 0x4]\n\ - ldr r1, _08090898 @ =0x81000100\n\ - str r1, [r0, 0x8]\n\ - ldr r0, [r0, 0x8]\n\ - ldr r1, _0809089C @ =gTasks\n\ - lsls r0, r7, 2\n\ - adds r0, r7\n\ - lsls r0, 3\n\ - adds r0, r1\n\ - b _080909E0\n\ - .align 2, 0\n\ -_0809088C: .4byte gWindowConfig_81E7064\n\ -_08090890: .4byte 0x0600c000\n\ -_08090894: .4byte 0x040000d4\n\ -_08090898: .4byte 0x81000100\n\ -_0809089C: .4byte gTasks\n\ -_080908A0:\n\ - ldr r0, _080908C8 @ =gDexText_RegisterComplete\n\ - movs r1, 0x2\n\ - movs r2, 0\n\ - movs r3, 0xD0\n\ - bl sub_8072BD8\n\ - bl IsNationalPokedexEnabled\n\ - cmp r0, 0\n\ - bne _080908CC\n\ - adds r0, r6, 0\n\ - bl NationalToHoennOrder\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - movs r1, 0xD\n\ - movs r2, 0x3\n\ - bl sub_8091154\n\ - b _080908D6\n\ - .align 2, 0\n\ -_080908C8: .4byte gDexText_RegisterComplete\n\ -_080908CC:\n\ - adds r0, r6, 0\n\ - movs r1, 0xD\n\ - movs r2, 0x3\n\ - bl sub_8091154\n\ -_080908D6:\n\ - adds r0, r6, 0\n\ - movs r1, 0x10\n\ - movs r2, 0x3\n\ - bl sub_80911C8\n\ - ldr r0, _0809094C @ =gDexText_UnknownPoke\n\ - movs r1, 0xB\n\ - movs r2, 0x5\n\ - bl MenuPrint\n\ - ldr r0, _08090950 @ =gDexText_UnknownHeight\n\ - movs r1, 0x10\n\ - movs r2, 0x7\n\ - bl MenuPrint\n\ - ldr r0, _08090954 @ =gDexText_UnknownWeight\n\ - movs r1, 0x10\n\ - movs r2, 0x9\n\ - bl MenuPrint\n\ - lsls r4, r6, 3\n\ - adds r4, r6\n\ - lsls r4, 2\n\ - ldr r6, _08090958 @ =gPokedexEntries\n\ - adds r5, r4, r6\n\ - adds r0, r5, 0\n\ - movs r1, 0xB\n\ - movs r2, 0x5\n\ - bl sub_8091304\n\ - ldrh r0, [r5, 0xC]\n\ - movs r1, 0x10\n\ - movs r2, 0x7\n\ - bl sub_8091458\n\ - ldrh r0, [r5, 0xE]\n\ - movs r1, 0x10\n\ - movs r2, 0x9\n\ - bl sub_8091564\n\ - adds r6, 0x10\n\ - adds r4, r6\n\ - ldr r0, [r4]\n\ - movs r1, 0x2\n\ - movs r2, 0xD\n\ - bl MenuPrint\n\ - movs r1, 0xFF\n\ - lsls r1, 2\n\ - movs r0, 0xE\n\ - bl sub_80917CC\n\ - ldr r1, _0809095C @ =gTasks\n\ - lsls r0, r7, 2\n\ - adds r0, r7\n\ - lsls r0, 3\n\ - adds r0, r1\n\ - b _080909E0\n\ - .align 2, 0\n\ -_0809094C: .4byte gDexText_UnknownPoke\n\ -_08090950: .4byte gDexText_UnknownHeight\n\ -_08090954: .4byte gDexText_UnknownWeight\n\ -_08090958: .4byte gPokedexEntries\n\ -_0809095C: .4byte gTasks\n\ -_08090960:\n\ - adds r0, r6, 0\n\ - movs r1, 0x30\n\ - movs r2, 0x38\n\ - movs r3, 0\n\ - bl sub_80918EC\n\ - adds r4, r0, 0\n\ - lsls r4, 24\n\ - lsrs r4, 24\n\ - ldr r0, _080909AC @ =gSprites\n\ - lsls r1, r4, 4\n\ - adds r1, r4\n\ - lsls r1, 2\n\ - adds r1, r0\n\ - ldrb r2, [r1, 0x5]\n\ - movs r0, 0xD\n\ - negs r0, r0\n\ - ands r0, r2\n\ - strb r0, [r1, 0x5]\n\ - movs r0, 0x1\n\ - negs r0, r0\n\ - movs r1, 0\n\ - str r1, [sp]\n\ - movs r2, 0x10\n\ - movs r3, 0\n\ - bl BeginNormalPaletteFade\n\ - ldr r0, _080909B0 @ =gUnknown_03005CEC\n\ - ldr r0, [r0]\n\ - bl SetVBlankCallback\n\ - ldr r1, _080909B4 @ =gTasks\n\ - lsls r0, r7, 2\n\ - adds r0, r7\n\ - lsls r0, 3\n\ - adds r0, r1\n\ - strh r4, [r0, 0xE]\n\ - b _080909E0\n\ - .align 2, 0\n\ -_080909AC: .4byte gSprites\n\ -_080909B0: .4byte gUnknown_03005CEC\n\ -_080909B4: .4byte gTasks\n\ -_080909B8:\n\ - ldr r0, _080909E8 @ =REG_BLDCNT\n\ - movs r1, 0\n\ - strh r1, [r0]\n\ - adds r0, 0x2\n\ - strh r1, [r0]\n\ - adds r0, 0x2\n\ - strh r1, [r0]\n\ - ldr r1, _080909EC @ =REG_BG3CNT\n\ - ldr r2, _080909F0 @ =0x00000f07\n\ - adds r0, r2, 0\n\ - strh r0, [r1]\n\ - subs r1, 0xE\n\ - movs r5, 0xE2\n\ - lsls r5, 5\n\ - adds r0, r5, 0\n\ - strh r0, [r1]\n\ - lsls r0, r7, 2\n\ - adds r0, r7\n\ - lsls r0, 3\n\ - adds r0, r4\n\ -_080909E0:\n\ - ldrh r1, [r0, 0x8]\n\ - adds r1, 0x1\n\ - strh r1, [r0, 0x8]\n\ - b _08090A26\n\ - .align 2, 0\n\ -_080909E8: .4byte 0x04000050\n\ -_080909EC: .4byte 0x0400000E\n\ -_080909F0: .4byte 0x00000f07\n\ -_080909F4:\n\ - ldr r0, _08090A30 @ =gPaletteFade\n\ - ldrb r1, [r0, 0x7]\n\ - movs r0, 0x80\n\ - ands r0, r1\n\ - lsls r0, 24\n\ - lsrs r5, r0, 24\n\ - cmp r5, 0\n\ - bne _08090A26\n\ - adds r0, r6, 0\n\ - bl NationalPokedexNumToSpecies\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - movs r1, 0\n\ - bl PlayCry1\n\ - ldr r1, _08090A34 @ =gTasks\n\ - lsls r0, r7, 2\n\ - adds r0, r7\n\ - lsls r0, 3\n\ - adds r0, r1\n\ - strh r5, [r0, 0xC]\n\ - strh r5, [r0, 0x10]\n\ - ldr r1, _08090A38 @ =sub_8090A3C\n\ - str r1, [r0]\n\ -_08090A26:\n\ - add sp, 0x8\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - .align 2, 0\n\ -_08090A30: .4byte gPaletteFade\n\ -_08090A34: .4byte gTasks\n\ -_08090A38: .4byte sub_8090A3C\n\ - .syntax divided\n"); -} -#endif void sub_8090A3C(u8 taskId) { @@ -5060,7 +4450,7 @@ void sub_8091564(u16 arg0, u8 left, u8 top) } #endif -void sub_8091738(u16 a, u16 b, u16 c) +static void sub_8091738(u16 num, u16 b, u16 c) { u8 arr[0x80]; u16 i; @@ -5069,7 +4459,7 @@ void sub_8091738(u16 a, u16 b, u16 c) u16 r7; u8 r3; - r12 = gMonFootprintTable[NationalPokedexNumToSpecies(a)]; + r12 = sMonFootprintTable[NationalPokedexNumToSpecies(num)]; for (r7 = 0, i = 0; i < 32; i++) { r3 = r12[i]; @@ -5338,7 +4728,7 @@ u8 sub_8091E3C(void) return CreateTask(sub_8091E54, 0); } -void sub_8091E54(u8 taskId) +static void sub_8091E54(u8 taskId) { u16 i; @@ -5398,14 +4788,14 @@ void sub_8091E54(u8 taskId) } } -void sub_809204C(u8 taskId) +static void sub_809204C(u8 taskId) { sub_8092AB0(gTasks[taskId].data[0]); sub_8092B68(taskId); gTasks[taskId].func = sub_809207C; } -void sub_809207C(u8 taskId) +static void sub_809207C(u8 taskId) { if (gMain.newKeys & B_BUTTON) { @@ -5448,14 +4838,14 @@ void sub_809207C(u8 taskId) } } -void sub_809217C(u8 taskId) +static void sub_809217C(u8 taskId) { sub_8092AD4(gTasks[taskId].data[0], gTasks[taskId].data[1]); sub_8092B68(taskId); gTasks[taskId].func = sub_80921B0; } -void sub_80921B0(u8 taskId) +static void sub_80921B0(u8 taskId) { const u8 (*r6)[4]; @@ -5541,7 +4931,7 @@ void sub_80921B0(u8 taskId) } } -void sub_80923FC(u8 taskId) +static void sub_80923FC(u8 taskId) { u8 r10 = sub_8092E10(taskId, 5); u8 r9 = sub_8092E10(taskId, 4); @@ -5554,7 +4944,7 @@ void sub_80923FC(u8 taskId) gTasks[taskId].func = sub_80924A4; } -void sub_80924A4(u8 taskId) +static void sub_80924A4(u8 taskId) { if (!IsSEPlaying()) { @@ -5572,7 +4962,7 @@ void sub_80924A4(u8 taskId) } } -void sub_8092508(u8 taskId) +static void sub_8092508(u8 taskId) { if (gMain.newKeys & A_BUTTON) { @@ -5592,12 +4982,12 @@ void sub_8092508(u8 taskId) } } -void sub_80925B4(u16 a, int unused) +static void sub_80925B4(u16 a, int unused) { sub_814AD7C(0x90, (a * 2 + 1) * 8); } -void sub_80925CC(u8 taskId) +static void sub_80925CC(u8 taskId) { u8 r0; u16 *p1; @@ -5615,7 +5005,7 @@ void sub_80925CC(u8 taskId) gTasks[taskId].func = sub_8092644; } -void sub_8092644(u8 taskId) +static void sub_8092644(u8 taskId) { u8 r1; const struct UnknownStruct2 *r8; @@ -5698,13 +5088,13 @@ void sub_8092644(u8 taskId) } } -void sub_80927B8(u8 taskId) +static void sub_80927B8(u8 taskId) { BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0); gTasks[taskId].func = sub_80927F0; } -void sub_80927F0(u8 taskId) +static void sub_80927F0(u8 taskId) { if (!gPaletteFade.active) DestroyTask(taskId); @@ -5779,7 +5169,7 @@ _08092868: .4byte 0x06007840\n\ } #endif -void sub_809286C(u8 a, u8 b, u8 c) +static void sub_809286C(u8 a, u8 b, u8 c) { u8 r5 = (b & 1) | ((c & 1) << 1); @@ -5812,7 +5202,7 @@ void sub_809286C(u8 a, u8 b, u8 c) } } -void sub_8092964(u8 a) +static void sub_8092964(u8 a) { switch (a) { @@ -5858,13 +5248,13 @@ void sub_8092964(u8 a) } } -void sub_8092AB0(u8 a) +static void sub_8092AB0(u8 a) { sub_8092964(a); sub_8091E20(gUnknown_083B57E4[a].text); } -void sub_8092AD4(u8 a, u8 b) +static void sub_8092AD4(u8 a, u8 b) { sub_8092964(a); switch (b) @@ -5896,7 +5286,7 @@ void sub_8092AD4(u8 a, u8 b) sub_8091E20(gUnknown_083B57FC[b].text); } -void sub_8092B68(u8 taskId) +static void sub_8092B68(u8 taskId) { u16 var; @@ -5928,7 +5318,7 @@ void sub_8092B68(u8 taskId) } } -void sub_8092C8C(u8 a) +static void sub_8092C8C(u8 a) { u16 i; u16 j; @@ -5963,7 +5353,7 @@ void sub_8092C8C(u8 a) } } -void sub_8092D78(u8 taskId) +static void sub_8092D78(u8 taskId) { const struct UnknownStruct2 *r6 = gUnknown_083B5A7C[gTasks[taskId].data[1]].unk0; const u16 *r8 = &gTasks[taskId].data[gUnknown_083B5A7C[gTasks[taskId].data[1]].unk4]; @@ -5982,7 +5372,7 @@ void sub_8092D78(u8 taskId) sub_8091E20(r6[*r8 + *r7].text1); } -u8 sub_8092E10(u8 taskId, u8 b) +static u8 sub_8092E10(u8 taskId, u8 b) { const u16 *ptr1 = &gTasks[taskId].data[gUnknown_083B5A7C[b].unk4]; const u16 *ptr2 = &gTasks[taskId].data[gUnknown_083B5A7C[b].unk5]; @@ -6012,7 +5402,7 @@ u8 sub_8092E10(u8 taskId, u8 b) } } -void sub_8092EB0(u8 taskId) +static void sub_8092EB0(u8 taskId) { u16 r3; @@ -6053,7 +5443,7 @@ void sub_8092EB0(u8 taskId) gTasks[taskId].data[4] = r3; } -bool8 sub_8092F44(u8 taskId) +static bool8 sub_8092F44(u8 taskId) { u8 val1 = gTasks[taskId].data[1]; const u16 *ptr = &gTasks[taskId].data[gUnknown_083B5A7C[val1].unk5]; @@ -6065,7 +5455,7 @@ bool8 sub_8092F44(u8 taskId) return TRUE; } -bool8 sub_8092F8C(u8 taskId) +static bool8 sub_8092F8C(u8 taskId) { u8 val1 = gTasks[taskId].data[1]; const u16 *ptr = &gTasks[taskId].data[gUnknown_083B5A7C[val1].unk5]; @@ -6077,7 +5467,7 @@ bool8 sub_8092F8C(u8 taskId) return TRUE; } -void sub_8092FD8(struct Sprite *sprite) +static void sub_8092FD8(struct Sprite *sprite) { if (gTasks[sprite->data0].func == sub_8092644) { @@ -6107,7 +5497,7 @@ void sub_8092FD8(struct Sprite *sprite) } } -void sub_809308C(u8 taskId) +static void sub_809308C(u8 taskId) { u8 spriteId; -- cgit v1.2.3 From 9fbdcdbc706f264c1a3a61ff7cd0499675b6a76c Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Thu, 15 Jun 2017 18:42:10 -0500 Subject: use static and fix a few nonmatching functions --- src/data/pokedex_entries_en.h | 2374 ++++++++++++++++++++--------------------- src/pokedex.c | 306 +++--- 2 files changed, 1316 insertions(+), 1364 deletions(-) (limited to 'src') diff --git a/src/data/pokedex_entries_en.h b/src/data/pokedex_entries_en.h index 2d9eaf617..86da3d67b 100644 --- a/src/data/pokedex_entries_en.h +++ b/src/data/pokedex_entries_en.h @@ -1,3830 +1,3830 @@ -const u8 DexDescription_Dummy_1[] = _( +static const u8 DexDescription_Dummy_1[] = _( "This is a newly discovered POKéMON.\n" "It is currently under investigation."); -const u8 DexDescription_Dummy_2[] = _( +static const u8 DexDescription_Dummy_2[] = _( "No detailed information is available\n" "at this time."); -const u8 DexDescription_Bulbasaur_1[] = _( +static const u8 DexDescription_Bulbasaur_1[] = _( "BULBASAUR can be seen napping in\n" "bright sunlight.\n" "There is a seed on its back."); -const u8 DexDescription_Bulbasaur_2[] = _( +static const u8 DexDescription_Bulbasaur_2[] = _( "By soaking up the sun’s rays, the seed\n" "grows progressively larger."); -const u8 DexDescription_Ivysaur_1[] = _( +static const u8 DexDescription_Ivysaur_1[] = _( "There is a bud on this POKéMON’s back.\n" "To support its weight, IVYSAUR’s legs\n" "and trunk grow thick and strong."); -const u8 DexDescription_Ivysaur_2[] = _( +static const u8 DexDescription_Ivysaur_2[] = _( "If it starts spending more time lying\n" "in the sunlight, it’s a sign that the\n" "bud will bloom into a large flower soon."); -const u8 DexDescription_Venusaur_1[] = _( +static const u8 DexDescription_Venusaur_1[] = _( "There is a large flower on VENUSAUR’s\n" "back. The flower is said to take on vivid\n" "colors if it gets plenty of nutrition"); -const u8 DexDescription_Venusaur_2[] = _( +static const u8 DexDescription_Venusaur_2[] = _( "and sunlight. The flower’s aroma\n" "soothes the emotions of people."); -const u8 DexDescription_Charmander_1[] = _( +static const u8 DexDescription_Charmander_1[] = _( "The flame that burns at the tip of its\n" "tail is an indication of its emotions.\n" "The flame wavers when CHARMANDER is"); -const u8 DexDescription_Charmander_2[] = _( +static const u8 DexDescription_Charmander_2[] = _( "enjoying itself. If the POKéMON becomes\n" "enraged, the flame burns fiercely."); -const u8 DexDescription_Charmeleon_1[] = _( +static const u8 DexDescription_Charmeleon_1[] = _( "CHARMELEON mercilessly destroys its\n" "foes using its sharp claws.\n" "If it encounters a strong foe, it turns"); -const u8 DexDescription_Charmeleon_2[] = _( +static const u8 DexDescription_Charmeleon_2[] = _( "aggressive. In this excited state, the\n" "flame at the tip of its tail flares with a\n" "bluish white color."); -const u8 DexDescription_Charizard_1[] = _( +static const u8 DexDescription_Charizard_1[] = _( "CHARIZARD flies around the sky in\n" "search of powerful opponents.\n" "It breathes fire of such great heat"); -const u8 DexDescription_Charizard_2[] = _( +static const u8 DexDescription_Charizard_2[] = _( "that it melts anything. However, it\n" "never turns its fiery breath on any\n" "opponent weaker than itself."); -const u8 DexDescription_Squirtle_1[] = _( +static const u8 DexDescription_Squirtle_1[] = _( "SQUIRTLE’s shell is not merely used\n" "for protection.\n" "The shell’s rounded shape and the"); -const u8 DexDescription_Squirtle_2[] = _( +static const u8 DexDescription_Squirtle_2[] = _( "grooves on its surface help minimize\n" "resistance in water, enabling this\n" "POKéMON to swim at high speeds."); -const u8 DexDescription_Wartortle_1[] = _( +static const u8 DexDescription_Wartortle_1[] = _( "Its tail is large and covered with a rich,\n" "thick fur. The tail becomes increasingly\n" "deeper in color as WARTORTLE ages."); -const u8 DexDescription_Wartortle_2[] = _( +static const u8 DexDescription_Wartortle_2[] = _( "The scratches on its shell are evidence\n" "of this POKéMON’s toughness as a\n" "battler."); -const u8 DexDescription_Blastoise_1[] = _( +static const u8 DexDescription_Blastoise_1[] = _( "BLASTOISE has water spouts that\n" "protrude from its shell. The water\n" "spouts are very accurate."); -const u8 DexDescription_Blastoise_2[] = _( +static const u8 DexDescription_Blastoise_2[] = _( "They can shoot bullets of water with\n" "enough accuracy to strike empty cans\n" "from a distance of over 160 feet."); -const u8 DexDescription_Caterpie_1[] = _( +static const u8 DexDescription_Caterpie_1[] = _( "CATERPIE has a voracious appetite.\n" "It can devour leaves bigger than its\n" "body right before your eyes."); -const u8 DexDescription_Caterpie_2[] = _( +static const u8 DexDescription_Caterpie_2[] = _( "From its antenna, this POKéMON releases\n" "a terrifically strong odor."); -const u8 DexDescription_Metapod_1[] = _( +static const u8 DexDescription_Metapod_1[] = _( "The shell covering this POKéMON’s body\n" "is as hard as an iron slab.\n" "METAPOD does not move very much."); -const u8 DexDescription_Metapod_2[] = _( +static const u8 DexDescription_Metapod_2[] = _( "It stays still because it is preparing\n" "its soft innards for evolution inside\n" "the hard shell."); -const u8 DexDescription_Butterfree_1[] = _( +static const u8 DexDescription_Butterfree_1[] = _( "BUTTERFREE has a superior ability to\n" "search for delicious honey from\n" "flowers."); -const u8 DexDescription_Butterfree_2[] = _( +static const u8 DexDescription_Butterfree_2[] = _( "It can even search out, extract, and\n" "carry honey from flowers that are\n" "blooming over six miles from its nest."); -const u8 DexDescription_Weedle_1[] = _( +static const u8 DexDescription_Weedle_1[] = _( "WEEDLE has an extremely acute sense\n" "of smell.\n" "It is capable of distinguishing its"); -const u8 DexDescription_Weedle_2[] = _( +static const u8 DexDescription_Weedle_2[] = _( "favorite kinds of leaves from those it\n" "dislikes just by sniffing with its big\n" "red proboscis (nose)."); -const u8 DexDescription_Kakuna_1[] = _( +static const u8 DexDescription_Kakuna_1[] = _( "KAKUNA remains virtually immobile as it\n" "clings to a tree. However, on the\n" "inside, it is extremely busy as it"); -const u8 DexDescription_Kakuna_2[] = _( +static const u8 DexDescription_Kakuna_2[] = _( "prepares for its coming evolution.\n" "This is evident from how hot the shell\n" "becomes to the touch."); -const u8 DexDescription_Beedrill_1[] = _( +static const u8 DexDescription_Beedrill_1[] = _( "BEEDRILL is extremely territorial.\n" "No one should ever approach its nest -\n" "this is for their own safety."); -const u8 DexDescription_Beedrill_2[] = _( +static const u8 DexDescription_Beedrill_2[] = _( "If angered, they will attack in a furious\n" "swarm."); -const u8 DexDescription_Pidgey_1[] = _( +static const u8 DexDescription_Pidgey_1[] = _( "PIDGEY has an extremely sharp sense\n" "of direction.\n" "It is capable of unerringly returning"); -const u8 DexDescription_Pidgey_2[] = _( +static const u8 DexDescription_Pidgey_2[] = _( "home to its nest, however far it may be\n" "removed from its familiar surroundings."); -const u8 DexDescription_Pidgeotto_1[] = _( +static const u8 DexDescription_Pidgeotto_1[] = _( "PIDGEOTTO claims a large area as its\n" "own territory. This POKéMON flies\n" "around, patrolling its living space."); -const u8 DexDescription_Pidgeotto_2[] = _( +static const u8 DexDescription_Pidgeotto_2[] = _( "If its territory is violated, it shows\n" "no mercy in thoroughly punishing the\n" "foe with its sharp claws."); -const u8 DexDescription_Pidgeot_1[] = _( +static const u8 DexDescription_Pidgeot_1[] = _( "This POKéMON has a dazzling plumage of\n" "beautifully glossy feathers.\n" "Many TRAINERS are captivated by the"); -const u8 DexDescription_Pidgeot_2[] = _( +static const u8 DexDescription_Pidgeot_2[] = _( "striking beauty of the feathers on its\n" "head, compelling them to choose PIDGEOT\n" "as their POKéMON."); -const u8 DexDescription_Rattata_1[] = _( +static const u8 DexDescription_Rattata_1[] = _( "RATTATA is cautious in the extreme.\n" "Even while it is asleep, it constantly\n" "listens by moving its ears around."); -const u8 DexDescription_Rattata_2[] = _( +static const u8 DexDescription_Rattata_2[] = _( "It is not picky about where it lives -\n" "it will make its nest anywhere."); -const u8 DexDescription_Raticate_1[] = _( +static const u8 DexDescription_Raticate_1[] = _( "RATICATE’s sturdy fangs grow steadily.\n" "To keep them ground down, it gnaws\n" "on rocks and logs."); -const u8 DexDescription_Raticate_2[] = _( +static const u8 DexDescription_Raticate_2[] = _( "It may even chew on the walls of\n" "houses."); -const u8 DexDescription_Spearow_1[] = _( +static const u8 DexDescription_Spearow_1[] = _( "SPEAROW has a very loud cry that can\n" "be heard over half a mile away.\n" "If its high, keening cry is heard"); -const u8 DexDescription_Spearow_2[] = _( +static const u8 DexDescription_Spearow_2[] = _( "echoing all around, it is a sign that\n" "they are warning each other of danger."); -const u8 DexDescription_Fearow_1[] = _( +static const u8 DexDescription_Fearow_1[] = _( "FEAROW is recognized by its long neck\n" "and elongated beak.\n" "They are conveniently shaped for"); -const u8 DexDescription_Fearow_2[] = _( +static const u8 DexDescription_Fearow_2[] = _( "catching prey in soil or water.\n" "It deftly moves its long and skinny\n" "beak to pluck prey."); -const u8 DexDescription_Ekans_1[] = _( +static const u8 DexDescription_Ekans_1[] = _( "EKANS curls itself up in a spiral while\n" "it rests.\n" "Assuming this position allows it to"); -const u8 DexDescription_Ekans_2[] = _( +static const u8 DexDescription_Ekans_2[] = _( "quickly respond to a threat from any\n" "direction with a glare from its upraised\n" "head."); -const u8 DexDescription_Arbok_1[] = _( +static const u8 DexDescription_Arbok_1[] = _( "This POKéMON is terrifically strong in\n" "order to constrict things with its body.\n" "It can even flatten steel oil drums."); -const u8 DexDescription_Arbok_2[] = _( +static const u8 DexDescription_Arbok_2[] = _( "Once ARBOK wraps its body around its\n" "foe, escaping its crunching embrace is\n" "impossible."); #ifdef SAPPHIRE -const u8 DexDescription_Pikachu_1[] = _( +static const u8 DexDescription_Pikachu_1[] = _( "This POKéMON has electricity-storing\n" "pouches on its cheeks. These appear to\n" "become electrically charged during the"); -const u8 DexDescription_Pikachu_2[] = _( +static const u8 DexDescription_Pikachu_2[] = _( "night while PIKACHU sleeps.\n" "It occasionally discharges electricity\n" "when it is dozy after waking up."); #else -const u8 DexDescription_Pikachu_1[] = _( +static const u8 DexDescription_Pikachu_1[] = _( "Whenever PIKACHU comes across\n" "something new, it blasts it with a jolt\n" "of electricity."); -const u8 DexDescription_Pikachu_2[] = _( +static const u8 DexDescription_Pikachu_2[] = _( "If you come across a blackened berry,\n" "it’s evidence that this POKéMON\n" "mistook the intensity of its charge."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Raichu_1[] = _( +static const u8 DexDescription_Raichu_1[] = _( "This POKéMON exudes a weak electrical\n" "charge from all over its body that makes\n" "it take on a slight glow in darkness."); -const u8 DexDescription_Raichu_2[] = _( +static const u8 DexDescription_Raichu_2[] = _( "RAICHU searches for electricity by\n" "planting its tail in the ground."); #else -const u8 DexDescription_Raichu_1[] = _( +static const u8 DexDescription_Raichu_1[] = _( "If the electrical sacks become\n" "excessively charged, RAICHU plants its\n" "tail in the ground and discharges."); -const u8 DexDescription_Raichu_2[] = _( +static const u8 DexDescription_Raichu_2[] = _( "Scorched patches of ground will be\n" "found near this POKéMON’s nest."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Sandshrew_1[] = _( +static const u8 DexDescription_Sandshrew_1[] = _( "SANDSHREW has a very dry hide that is\n" "extremely tough. The POKéMON can roll\n" "into a ball that repels any attack."); -const u8 DexDescription_Sandshrew_2[] = _( +static const u8 DexDescription_Sandshrew_2[] = _( "At night, it burrows into the desert\n" "sand to sleep."); #else -const u8 DexDescription_Sandshrew_1[] = _( +static const u8 DexDescription_Sandshrew_1[] = _( "SANDSHREW’s body is configured to\n" "absorb water without waste, enabling it\n" "to survive in an arid desert."); -const u8 DexDescription_Sandshrew_2[] = _( +static const u8 DexDescription_Sandshrew_2[] = _( "This POKéMON curls up to protect itself\n" "from its enemies."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Sandslash_1[] = _( +static const u8 DexDescription_Sandslash_1[] = _( "SANDSLASH can roll up its body as if it\n" "were a ball covered with large spikes.\n" "In battle, this POKéMON will try to make"); -const u8 DexDescription_Sandslash_2[] = _( +static const u8 DexDescription_Sandslash_2[] = _( "the foe flinch by jabbing it with its\n" "spines. It then leaps at the stunned\n" "foe to tear wildly with its sharp claws."); #else -const u8 DexDescription_Sandslash_1[] = _( +static const u8 DexDescription_Sandslash_1[] = _( "SANDSLASH’s body is covered by tough\n" "spikes, which are hardened sections of\n" "its hide. Once a year, the old spikes fall"); -const u8 DexDescription_Sandslash_2[] = _( +static const u8 DexDescription_Sandslash_2[] = _( "out, to be replaced with new spikes that\n" "grow out from beneath the old ones."); #endif -const u8 DexDescription_NidoranF_1[] = _( +static const u8 DexDescription_NidoranF_1[] = _( "NIDORAN has barbs that secrete a\n" "powerful poison. They are thought to\n" "have developed as protection for this"); -const u8 DexDescription_NidoranF_2[] = _( +static const u8 DexDescription_NidoranF_2[] = _( "small-bodied POKéMON.\n" "When enraged, it releases a horrible\n" "toxin from its horn."); -const u8 DexDescription_Nidorina_1[] = _( +static const u8 DexDescription_Nidorina_1[] = _( "When NIDORINA are with their friends or\n" "family, they keep their barbs tucked\n" "away to prevent hurting each other."); -const u8 DexDescription_Nidorina_2[] = _( +static const u8 DexDescription_Nidorina_2[] = _( "This POKéMON appears to become\n" "nervous if separated from the others."); -const u8 DexDescription_Nidoqueen_1[] = _( +static const u8 DexDescription_Nidoqueen_1[] = _( "NIDOQUEEN’s body is encased in\n" "extremely hard scales. It is adept at\n" "sending foes flying with harsh tackles."); -const u8 DexDescription_Nidoqueen_2[] = _( +static const u8 DexDescription_Nidoqueen_2[] = _( "This POKéMON is at its strongest when\n" "it is defending its young."); -const u8 DexDescription_NidoranM_1[] = _( +static const u8 DexDescription_NidoranM_1[] = _( "The male NIDORAN has developed\n" "muscles for moving its ears. Thanks to\n" "them, the ears can be freely moved in"); -const u8 DexDescription_NidoranM_2[] = _( +static const u8 DexDescription_NidoranM_2[] = _( "any direction. Even the slightest sound\n" "does not escape this POKéMON’s notice."); -const u8 DexDescription_Nidorino_1[] = _( +static const u8 DexDescription_Nidorino_1[] = _( "NIDORINO has a horn that is harder than\n" "a diamond. If it senses a hostile\n" "presence, all the barbs on its back"); -const u8 DexDescription_Nidorino_2[] = _( +static const u8 DexDescription_Nidorino_2[] = _( "bristle up at once, and it challenges\n" "the foe with all its might."); -const u8 DexDescription_Nidoking_1[] = _( +static const u8 DexDescription_Nidoking_1[] = _( "NIDOKING’s thick tail packs enormously\n" "destructive power. With one swing, it\n" "can topple a metal transmission tower."); -const u8 DexDescription_Nidoking_2[] = _( +static const u8 DexDescription_Nidoking_2[] = _( "Once this POKéMON goes on a rampage,\n" "there is no stopping it."); -const u8 DexDescription_Clefairy_1[] = _( +static const u8 DexDescription_Clefairy_1[] = _( "On every night of a full moon, groups of\n" "this POKéMON come out to play.\n" "When dawn arrives, the tired CLEFAIRY"); -const u8 DexDescription_Clefairy_2[] = _( +static const u8 DexDescription_Clefairy_2[] = _( "return to their quiet mountain retreats\n" "and go to sleep nestled up against each\n" "other."); -const u8 DexDescription_Clefable_1[] = _( +static const u8 DexDescription_Clefable_1[] = _( "CLEFABLE moves by skipping lightly as if\n" "it were flying using its wings. Its\n" "bouncy step lets it even walk on water."); -const u8 DexDescription_Clefable_2[] = _( +static const u8 DexDescription_Clefable_2[] = _( "It is known to take strolls on lakes on\n" "quiet, moonlit nights."); #ifdef SAPPHIRE -const u8 DexDescription_Vulpix_1[] = _( +static const u8 DexDescription_Vulpix_1[] = _( "Inside VULPIX’s body burns a flame that\n" "never goes out. During the daytime,\n" "when the temperatures rise, this"); -const u8 DexDescription_Vulpix_2[] = _( +static const u8 DexDescription_Vulpix_2[] = _( "POKéMON releases flames from its mouth\n" "to prevent its body from growing too\n" "hot."); #else -const u8 DexDescription_Vulpix_1[] = _( +static const u8 DexDescription_Vulpix_1[] = _( "At the time of its birth, VULPIX has one\n" "white tail. The tail separates into six\n" "if this POKéMON receives plenty of love"); -const u8 DexDescription_Vulpix_2[] = _( +static const u8 DexDescription_Vulpix_2[] = _( "from its TRAINER.\n" "The six tails become magnificently\n" "curled."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Ninetales_1[] = _( +static const u8 DexDescription_Ninetales_1[] = _( "Legend has it that NINETALES came into\n" "being when nine wizards possessing\n" "sacred powers merged into one."); -const u8 DexDescription_Ninetales_2[] = _( +static const u8 DexDescription_Ninetales_2[] = _( "This POKéMON is highly intelligent - it\n" "can understand human speech."); #else -const u8 DexDescription_Ninetales_1[] = _( +static const u8 DexDescription_Ninetales_1[] = _( "NINETALES casts a sinister light from\n" "its bright red eyes to gain total\n" "control over its foe’s mind."); -const u8 DexDescription_Ninetales_2[] = _( +static const u8 DexDescription_Ninetales_2[] = _( "This POKéMON is said to live for a\n" "thousand years."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Jigglypuff_1[] = _( +static const u8 DexDescription_Jigglypuff_1[] = _( "When this POKéMON sings, it never\n" "pauses to breathe. If it is in a battle\n" "against an opponent that does not"); -const u8 DexDescription_Jigglypuff_2[] = _( +static const u8 DexDescription_Jigglypuff_2[] = _( "easily fall asleep, JIGGLYPUFF cannot\n" "breathe, endangering its life."); #else -const u8 DexDescription_Jigglypuff_1[] = _( +static const u8 DexDescription_Jigglypuff_1[] = _( "JIGGLYPUFF’s vocal chords can freely\n" "adjust the wavelength of its voice.\n" "This POKéMON uses this ability to sing"); -const u8 DexDescription_Jigglypuff_2[] = _( +static const u8 DexDescription_Jigglypuff_2[] = _( "at precisely the right wavelength to\n" "make its foes most drowsy."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Wigglytuff_1[] = _( +static const u8 DexDescription_Wigglytuff_1[] = _( "WIGGLYTUFF’s body is very flexible.\n" "By inhaling deeply, this POKéMON can\n" "inflate itself seemingly without end."); -const u8 DexDescription_Wigglytuff_2[] = _( +static const u8 DexDescription_Wigglytuff_2[] = _( "Once inflated, WIGGLYTUFF bounces\n" "along lightly like a balloon."); #else -const u8 DexDescription_Wigglytuff_1[] = _( +static const u8 DexDescription_Wigglytuff_1[] = _( "WIGGLYTUFF has large, saucerlike eyes.\n" "The surfaces of its eyes are always\n" "covered with a thin layer of tears."); -const u8 DexDescription_Wigglytuff_2[] = _( +static const u8 DexDescription_Wigglytuff_2[] = _( "If any dust gets in this POKéMON’s\n" "eyes, it is quickly washed away."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Zubat_1[] = _( +static const u8 DexDescription_Zubat_1[] = _( "ZUBAT avoids sunlight because exposure\n" "causes it to become unhealthy.\n" "During the daytime, it stays in caves or"); -const u8 DexDescription_Zubat_2[] = _( +static const u8 DexDescription_Zubat_2[] = _( "under the eaves of old houses, sleeping\n" "while hanging upside down."); #else -const u8 DexDescription_Zubat_1[] = _( +static const u8 DexDescription_Zubat_1[] = _( "ZUBAT remains quietly unmoving in a\n" "dark spot during the bright daylight\n" "hours. It does so because prolonged"); -const u8 DexDescription_Zubat_2[] = _( +static const u8 DexDescription_Zubat_2[] = _( "exposure to the sun causes its body to\n" "become slightly burned."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Golbat_1[] = _( +static const u8 DexDescription_Golbat_1[] = _( "GOLBAT bites down on prey with its four\n" "fangs and drinks the victim’s blood.\n" "It becomes active on inky dark"); -const u8 DexDescription_Golbat_2[] = _( +static const u8 DexDescription_Golbat_2[] = _( "moonless nights, flying around to\n" "attack people and POKéMON."); #else -const u8 DexDescription_Golbat_1[] = _( +static const u8 DexDescription_Golbat_1[] = _( "GOLBAT loves to drink the blood of\n" "living things. It is particularly active\n" "in the pitch black of night."); -const u8 DexDescription_Golbat_2[] = _( +static const u8 DexDescription_Golbat_2[] = _( "This POKéMON flits around in the night\n" "skies, seeking fresh blood."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Oddish_1[] = _( +static const u8 DexDescription_Oddish_1[] = _( "ODDISH searches for fertile, nutrient-\n" "rich soil, then plants itself.\n" "During the daytime, while it is planted,"); -const u8 DexDescription_Oddish_2[] = _( +static const u8 DexDescription_Oddish_2[] = _( "this POKéMON’s feet are thought to\n" "change shape and become similar to\n" "the roots of trees."); #else -const u8 DexDescription_Oddish_1[] = _( +static const u8 DexDescription_Oddish_1[] = _( "During the daytime, ODDISH buries\n" "itself in soil to absorb nutrients from \n" "the ground using its entire body."); -const u8 DexDescription_Oddish_2[] = _( +static const u8 DexDescription_Oddish_2[] = _( "The more fertile the soil, the glossier\n" "its leaves become."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Gloom_1[] = _( +static const u8 DexDescription_Gloom_1[] = _( "From its mouth GLOOM drips honey that\n" "smells absolutely horrible.\n" "Apparently, it loves the horrid stench."); -const u8 DexDescription_Gloom_2[] = _( +static const u8 DexDescription_Gloom_2[] = _( "It sniffs the noxious fumes and then \n" "drools even more of its honey."); #else -const u8 DexDescription_Gloom_1[] = _( +static const u8 DexDescription_Gloom_1[] = _( "GLOOM releases a foul fragrance from\n" "the pistil of its flower. When faced\n" "with danger, the stench worsens."); -const u8 DexDescription_Gloom_2[] = _( +static const u8 DexDescription_Gloom_2[] = _( "If this POKéMON is feeling calm and\n" "secure, it does not release its usual\n" "stinky aroma."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Vileplume_1[] = _( +static const u8 DexDescription_Vileplume_1[] = _( "VILEPLUME has the world’s largest\n" "petals. They are used to attract prey\n" "that are then doused with toxic spores."); -const u8 DexDescription_Vileplume_2[] = _( +static const u8 DexDescription_Vileplume_2[] = _( "Once the prey are immobilized, this\n" "POKéMON catches and devours them."); #else -const u8 DexDescription_Vileplume_1[] = _( +static const u8 DexDescription_Vileplume_1[] = _( "VILEPLUME’s toxic pollen triggers\n" "atrocious allergy attacks. That’s why\n" "it is advisable never to approach any"); -const u8 DexDescription_Vileplume_2[] = _( +static const u8 DexDescription_Vileplume_2[] = _( "attractive flowers in a jungle, however\n" "pretty they may be."); #endif #ifdef SAPPHIRE #if REVISION >= 1 -const u8 DexDescription_Paras_1[] = _( +static const u8 DexDescription_Paras_1[] = _( "PARAS has parasitic mushrooms growing\n" "on its back called tochukaso. They grow\n" "large by drawing nutrients from this"); -const u8 DexDescription_Paras_2[] = _( +static const u8 DexDescription_Paras_2[] = _( "BUG/GRASS POKéMON host. They are\n" // Identify Paras as BUG/GRASS type rather than just BUG "highly valued as a medicine for\n" "extending life."); #else -const u8 DexDescription_Paras_1[] = _( +static const u8 DexDescription_Paras_1[] = _( "PARAS has parasitic mushrooms growing\n" "on its back called tochukaso. They grow\n" "large by drawing nutrients from this"); -const u8 DexDescription_Paras_2[] = _( +static const u8 DexDescription_Paras_2[] = _( "BUG POKéMON host. They are highly\n" "valued as a medicine for extending life."); #endif #else #if REVISION >= 1 -const u8 DexDescription_Paras_1[] = _( +static const u8 DexDescription_Paras_1[] = _( "PARAS has parasitic mushrooms growing\n" "on its back called tochukaso. They grow\n" "large by drawing nutrients from this"); -const u8 DexDescription_Paras_2[] = _( +static const u8 DexDescription_Paras_2[] = _( "BUG/GRASS POKéMON host. They are\n" "highly valued as a medicine for\n" "extending life."); #else -const u8 DexDescription_Paras_1[] = _( +static const u8 DexDescription_Paras_1[] = _( "PARAS has parasitic mushrooms growing\n" "on its back called tochukaso. They grow\n" "large by drawing nutrients from the BUG"); -const u8 DexDescription_Paras_2[] = _( +static const u8 DexDescription_Paras_2[] = _( "POKéMON host. They are highly valued as\n" "a medicine for extending life."); #endif #endif -const u8 DexDescription_Parasect_1[] = _( +static const u8 DexDescription_Parasect_1[] = _( "PARASECT is known to infest large trees\n" "en masse and drain nutrients from the\n" "lower trunk and roots."); -const u8 DexDescription_Parasect_2[] = _( +static const u8 DexDescription_Parasect_2[] = _( "When an infested tree dies, they move\n" "onto another tree all at once."); -const u8 DexDescription_Venonat_1[] = _( +static const u8 DexDescription_Venonat_1[] = _( "VENONAT is said to have evolved with\n" "a coat of thin, stiff hair that covers\n" "its entire body for protection."); -const u8 DexDescription_Venonat_2[] = _( +static const u8 DexDescription_Venonat_2[] = _( "It possesses large eyes that never fail\n" "to spot even miniscule prey."); -const u8 DexDescription_Venomoth_1[] = _( +static const u8 DexDescription_Venomoth_1[] = _( "VENOMOTH is nocturnal - it is a POKéMON\n" "that only becomes active at night.\n" "Its favorite prey are small insects"); -const u8 DexDescription_Venomoth_2[] = _( +static const u8 DexDescription_Venomoth_2[] = _( "that gather around streetlights,\n" "attracted by the light in the darkness."); -const u8 DexDescription_Diglett_1[] = _( +static const u8 DexDescription_Diglett_1[] = _( "DIGLETT are raised in most farms.\n" "The reason is simple - wherever this\n" "POKéMON burrows, the soil is left"); -const u8 DexDescription_Diglett_2[] = _( +static const u8 DexDescription_Diglett_2[] = _( "perfectly tilled for planting crops.\n" "This soil is made ideal for growing\n" "delicious vegetables."); -const u8 DexDescription_Dugtrio_1[] = _( +static const u8 DexDescription_Dugtrio_1[] = _( "DUGTRIO are actually triplets that\n" "emerged from one body. As a result,\n" "each triplet thinks exactly like the"); -const u8 DexDescription_Dugtrio_2[] = _( +static const u8 DexDescription_Dugtrio_2[] = _( "other two triplets.\n" "They work cooperatively to burrow\n" "endlessly."); -const u8 DexDescription_Meowth_1[] = _( +static const u8 DexDescription_Meowth_1[] = _( "MEOWTH withdraws its sharp claws into\n" "its paws to slinkily sneak about without\n" "making any incriminating footsteps."); -const u8 DexDescription_Meowth_2[] = _( +static const u8 DexDescription_Meowth_2[] = _( "For some reason, this POKéMON loves\n" "shiny coins that glitter with light."); -const u8 DexDescription_Persian_1[] = _( +static const u8 DexDescription_Persian_1[] = _( "PERSIAN has six bold whiskers that give\n" "it a look of toughness. The whiskers \n" "sense air movements to determine what"); -const u8 DexDescription_Persian_2[] = _( +static const u8 DexDescription_Persian_2[] = _( "is in the POKéMON’s surrounding\n" "vicinity. It becomes docile if grabbed\n" "by the whiskers."); #ifdef SAPPHIRE -const u8 DexDescription_Psyduck_1[] = _( +static const u8 DexDescription_Psyduck_1[] = _( "If it uses its mysterious power,\n" "PSYDUCK can’t remember having done so.\n" "It apparently can’t form a memory of"); -const u8 DexDescription_Psyduck_2[] = _( +static const u8 DexDescription_Psyduck_2[] = _( "such an event because it goes into\n" "an altered state that is much like\n" "deep sleep."); #else -const u8 DexDescription_Psyduck_1[] = _( +static const u8 DexDescription_Psyduck_1[] = _( "PSYDUCK uses a mysterious power.\n" "When it does so, this POKéMON \n" "generates brain waves that are"); -const u8 DexDescription_Psyduck_2[] = _( +static const u8 DexDescription_Psyduck_2[] = _( "supposedly only seen in sleepers.\n" "This discovery spurred controversy\n" "among scholars."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Golduck_1[] = _( +static const u8 DexDescription_Golduck_1[] = _( "GOLDUCK is the fastest swimmer among\n" "all POKéMON. It swims effortlessly, even\n" "in a rough, stormy sea."); -const u8 DexDescription_Golduck_2[] = _( +static const u8 DexDescription_Golduck_2[] = _( "It sometimes rescues people from\n" "wrecked ships floundering in high seas."); #else -const u8 DexDescription_Golduck_1[] = _( +static const u8 DexDescription_Golduck_1[] = _( "The webbed flippers on its forelegs and\n" "hind legs and the streamlined body of\n" "GOLDUCK give it frightening speed."); -const u8 DexDescription_Golduck_2[] = _( +static const u8 DexDescription_Golduck_2[] = _( "This POKéMON is definitely much faster\n" "than even the most athletic swimmer."); #endif -const u8 DexDescription_Mankey_1[] = _( +static const u8 DexDescription_Mankey_1[] = _( "When MANKEY starts shaking and its\n" "nasal breathing turns rough, it’s a sure\n" "sign that it is becoming angry."); -const u8 DexDescription_Mankey_2[] = _( +static const u8 DexDescription_Mankey_2[] = _( "However, because it goes into a\n" "towering rage almost instantly, it is\n" "impossible for anyone to flee its wrath."); -const u8 DexDescription_Primeape_1[] = _( +static const u8 DexDescription_Primeape_1[] = _( "When PRIMEAPE becomes furious, its\n" "blood circulation is boosted. In turn,\n" "its muscles are made even stronger."); -const u8 DexDescription_Primeape_2[] = _( +static const u8 DexDescription_Primeape_2[] = _( "However, it also becomes much less\n" "intelligent at the same time."); -const u8 DexDescription_Growlithe_1[] = _( +static const u8 DexDescription_Growlithe_1[] = _( "GROWLITHE has a superb sense of smell.\n" "Once it smells anything, this POKéMON\n" "won’t forget the scent, no matter what."); -const u8 DexDescription_Growlithe_2[] = _( +static const u8 DexDescription_Growlithe_2[] = _( "It uses its advanced olfactory sense\n" "to determine the emotions of other\n" "living things."); -const u8 DexDescription_Arcanine_1[] = _( +static const u8 DexDescription_Arcanine_1[] = _( "ARCANINE is known for its high speed.\n" "It is said to be capable of running over\n" "6,200 miles in a single day and night."); -const u8 DexDescription_Arcanine_2[] = _( +static const u8 DexDescription_Arcanine_2[] = _( "The fire that blazes wildly within this\n" "POKéMON’s body is its source of power."); -const u8 DexDescription_Poliwag_1[] = _( +static const u8 DexDescription_Poliwag_1[] = _( "POLIWAG has a very thin skin. It is\n" "possible to see the POKéMON’s spiral\n" "innards right through the skin."); -const u8 DexDescription_Poliwag_2[] = _( +static const u8 DexDescription_Poliwag_2[] = _( "Despite its thinness, however, the skin\n" "is also very flexible. Even sharp fangs\n" "bounce right off it."); -const u8 DexDescription_Poliwhirl_1[] = _( +static const u8 DexDescription_Poliwhirl_1[] = _( "The surface of POLIWHIRL’s body is\n" "always wet and slick with an oily fluid.\n" "Because of this greasy covering, it can"); -const u8 DexDescription_Poliwhirl_2[] = _( +static const u8 DexDescription_Poliwhirl_2[] = _( "easily slip and slide out of the clutches\n" "of any enemy in battle."); -const u8 DexDescription_Poliwrath_1[] = _( +static const u8 DexDescription_Poliwrath_1[] = _( "POLIWRATH’s highly developed, brawny\n" "muscles never grow fatigued, however\n" "much it exercises."); -const u8 DexDescription_Poliwrath_2[] = _( +static const u8 DexDescription_Poliwrath_2[] = _( "It is so tirelessly strong, this POKéMON\n" "can swim back and forth across the\n" "Pacific Ocean without effort."); #ifdef SAPPHIRE -const u8 DexDescription_Abra_1[] = _( +static const u8 DexDescription_Abra_1[] = _( "ABRA needs to sleep for eighteen hours\n" "a day. If it doesn’t, this POKéMON loses\n" "its ability to use telekinetic powers."); -const u8 DexDescription_Abra_2[] = _( +static const u8 DexDescription_Abra_2[] = _( "If it is attacked, ABRA escapes using\n" "TELEPORT while it is still sleeping."); #else -const u8 DexDescription_Abra_1[] = _( +static const u8 DexDescription_Abra_1[] = _( "ABRA sleeps for eighteen hours a day.\n" "However, it can sense the presence of\n" "foes even while it is sleeping."); -const u8 DexDescription_Abra_2[] = _( +static const u8 DexDescription_Abra_2[] = _( "In such a situation, this POKéMON\n" "immediately teleports to safety."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Kadabra_1[] = _( +static const u8 DexDescription_Kadabra_1[] = _( "KADABRA holds a silver spoon in its\n" "hand. The spoon is used to amplify the\n" "alpha waves in its brain."); -const u8 DexDescription_Kadabra_2[] = _( +static const u8 DexDescription_Kadabra_2[] = _( "Without the spoon, the POKéMON is said\n" "to be limited to half the usual amount\n" "of its telekinetic powers."); #else -const u8 DexDescription_Kadabra_1[] = _( +static const u8 DexDescription_Kadabra_1[] = _( "KADABRA emits a peculiar alpha wave\n" "if it develops a headache. Only those\n" "people with a particularly strong"); -const u8 DexDescription_Kadabra_2[] = _( +static const u8 DexDescription_Kadabra_2[] = _( "psyche can hope to become a TRAINER\n" "of this POKéMON."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Alakazam_1[] = _( +static const u8 DexDescription_Alakazam_1[] = _( "ALAKAZAM’s brain continually grows,\n" "infinitely multiplying brain cells.\n" "This amazing brain gives this POKéMON"); -const u8 DexDescription_Alakazam_2[] = _( +static const u8 DexDescription_Alakazam_2[] = _( "an astoundingly high IQ of 5,000.\n" "It has a thorough memory of everything\n" "that has occurred in the world."); #else -const u8 DexDescription_Alakazam_1[] = _( +static const u8 DexDescription_Alakazam_1[] = _( "ALAKAZAM’s brain continually grows,\n" "making its head far too heavy to\n" "support with its neck."); -const u8 DexDescription_Alakazam_2[] = _( +static const u8 DexDescription_Alakazam_2[] = _( "This POKéMON holds its head up using\n" "its psychokinetic power instead."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Machop_1[] = _( +static const u8 DexDescription_Machop_1[] = _( "MACHOP exercises by hefting around\n" "a GRAVELER as if it were a barbell.\n" "There are some MACHOP that travel"); -const u8 DexDescription_Machop_2[] = _( +static const u8 DexDescription_Machop_2[] = _( "the world in a quest to master all\n" "kinds of martial arts."); #else -const u8 DexDescription_Machop_1[] = _( +static const u8 DexDescription_Machop_1[] = _( "MACHOP’s muscles are special - they\n" "never get sore no matter how much they\n" "are used in exercise."); -const u8 DexDescription_Machop_2[] = _( +static const u8 DexDescription_Machop_2[] = _( "This POKéMON has sufficient power to\n" "hurl a hundred adult humans."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Machoke_1[] = _( +static const u8 DexDescription_Machoke_1[] = _( "MACHOKE undertakes bodybuilding every\n" "day even as it helps people with tough,\n" "physically demanding labor."); -const u8 DexDescription_Machoke_2[] = _( +static const u8 DexDescription_Machoke_2[] = _( "On its days off, this POKéMON heads to\n" "the fields and mountains to exercise\n" "and train."); #else -const u8 DexDescription_Machoke_1[] = _( +static const u8 DexDescription_Machoke_1[] = _( "MACHOKE’s thoroughly toned muscles\n" "possess the hardness of steel.\n" "This POKéMON has so much strength,"); -const u8 DexDescription_Machoke_2[] = _( +static const u8 DexDescription_Machoke_2[] = _( "it can easily hold aloft a sumo wrestler\n" "on just one finger."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Machamp_1[] = _( +static const u8 DexDescription_Machamp_1[] = _( "MACHAMP is known as the POKéMON that\n" "has mastered every kind of martial arts.\n" "If it grabs hold of the foe with its four"); -const u8 DexDescription_Machamp_2[] = _( +static const u8 DexDescription_Machamp_2[] = _( "arms, the battle is all but over.\n" "The hapless foe is thrown far over the\n" "horizon."); #else -const u8 DexDescription_Machamp_1[] = _( +static const u8 DexDescription_Machamp_1[] = _( "MACHAMP has the power to hurl anything\n" "aside. However, trying to do any work\n" "requiring care and dexterity causes"); -const u8 DexDescription_Machamp_2[] = _( +static const u8 DexDescription_Machamp_2[] = _( "its arms to get tangled.\n" "This POKéMON tends to leap into action\n" "before it thinks."); #endif -const u8 DexDescription_Bellsprout_1[] = _( +static const u8 DexDescription_Bellsprout_1[] = _( "BELLSPROUT’s thin and flexible body\n" "lets it bend and sway to avoid any\n" "attack, however strong it may be."); -const u8 DexDescription_Bellsprout_2[] = _( +static const u8 DexDescription_Bellsprout_2[] = _( "From its mouth, this POKéMON spits a\n" "corrosive fluid that melts even iron."); -const u8 DexDescription_Weepinbell_1[] = _( +static const u8 DexDescription_Weepinbell_1[] = _( "WEEPINBELL has a large hook on its rear\n" "end. At night, the POKéMON hooks on to\n" "a tree branch and goes to sleep."); -const u8 DexDescription_Weepinbell_2[] = _( +static const u8 DexDescription_Weepinbell_2[] = _( "If it moves around in its sleep, it may\n" "wake up to find itself on the ground."); -const u8 DexDescription_Victreebel_1[] = _( +static const u8 DexDescription_Victreebel_1[] = _( "VICTREEBEL has a long vine that\n" "extends from its head. This vine is\n" "waved and flicked about as if it were"); -const u8 DexDescription_Victreebel_2[] = _( +static const u8 DexDescription_Victreebel_2[] = _( "an animal to attract prey. When an\n" "unsuspecting prey draws near, this\n" "POKéMON swallows it whole."); #ifdef SAPPHIRE -const u8 DexDescription_Tentacool_1[] = _( +static const u8 DexDescription_Tentacool_1[] = _( "TENTACOOL absorbs sunlight and\n" "refracts it using water inside its body\n" "to convert it into beam energy."); -const u8 DexDescription_Tentacool_2[] = _( +static const u8 DexDescription_Tentacool_2[] = _( "This POKéMON shoots beams from its\n" "crystal-like eyes."); #else -const u8 DexDescription_Tentacool_1[] = _( +static const u8 DexDescription_Tentacool_1[] = _( "TENTACOOL’s body is largely composed\n" "of water. If it is removed from the\n" "sea, it dries up like parchment."); -const u8 DexDescription_Tentacool_2[] = _( +static const u8 DexDescription_Tentacool_2[] = _( "If this POKéMON happens to become\n" "dehydrated, put it back into the sea."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Tentacruel_1[] = _( +static const u8 DexDescription_Tentacruel_1[] = _( "TENTACRUEL has tentacles that can be\n" "freely elongated and shortened at will.\n" "It ensnares prey with its tentacles and"); -const u8 DexDescription_Tentacruel_2[] = _( +static const u8 DexDescription_Tentacruel_2[] = _( "weakens the prey by dosing it with a\n" "harsh toxin. It can catch up to 80\n" "prey at the same time."); #else -const u8 DexDescription_Tentacruel_1[] = _( +static const u8 DexDescription_Tentacruel_1[] = _( "TENTACRUEL has large red orbs on its\n" "head. The orbs glow before lashing the\n" "vicinity with a harsh ultrasonic blast."); -const u8 DexDescription_Tentacruel_2[] = _( +static const u8 DexDescription_Tentacruel_2[] = _( "This POKéMON’s outburst creates rough\n" "waves around it."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Geodude_1[] = _( +static const u8 DexDescription_Geodude_1[] = _( "When GEODUDE sleeps deeply, it buries\n" "itself halfway into the ground.\n" "It will not awaken even if hikers step"); -const u8 DexDescription_Geodude_2[] = _( +static const u8 DexDescription_Geodude_2[] = _( "on it unwittingly.\n" "In the morning, this POKéMON rolls\n" "downhill in search of food."); #else -const u8 DexDescription_Geodude_1[] = _( +static const u8 DexDescription_Geodude_1[] = _( "The longer a GEODUDE lives, the more\n" "its edges are chipped and worn away,\n" "making it more rounded in appearance."); -const u8 DexDescription_Geodude_2[] = _( +static const u8 DexDescription_Geodude_2[] = _( "However, this POKéMON’s heart will\n" "remain hard, craggy, and rough always."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Graveler_1[] = _( +static const u8 DexDescription_Graveler_1[] = _( "Rocks are GRAVELER’s favorite food.\n" "This POKéMON will climb a mountain from\n" "the base to the summit, crunchingly"); -const u8 DexDescription_Graveler_2[] = _( +static const u8 DexDescription_Graveler_2[] = _( "feasting on rocks all the while.\n" "Upon reaching the peak, it rolls back\n" "down to the bottom."); #else -const u8 DexDescription_Graveler_1[] = _( +static const u8 DexDescription_Graveler_1[] = _( "GRAVELER grows by feeding on rocks.\n" "Apparently, it prefers to eat rocks\n" "that are covered in moss."); -const u8 DexDescription_Graveler_2[] = _( +static const u8 DexDescription_Graveler_2[] = _( "This POKéMON eats its way through\n" "a ton of rocks on a daily basis."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Golem_1[] = _( +static const u8 DexDescription_Golem_1[] = _( "GOLEM is known for rolling down from\n" "mountains. To prevent them from rolling\n" "into the homes of people downhill,"); -const u8 DexDescription_Golem_2[] = _( +static const u8 DexDescription_Golem_2[] = _( "grooves have been dug into the sides of\n" "mountains to serve as guideways for\n" "diverting this POKéMON’s course."); #else -const u8 DexDescription_Golem_1[] = _( +static const u8 DexDescription_Golem_1[] = _( "GOLEM live up on mountains.\n" "If there is a large earthquake, these\n" "POKéMON will come rolling down off"); -const u8 DexDescription_Golem_2[] = _( +static const u8 DexDescription_Golem_2[] = _( "the mountains en masse to the\n" "foothills below."); #endif -const u8 DexDescription_Ponyta_1[] = _( +static const u8 DexDescription_Ponyta_1[] = _( "PONYTA is very weak at birth.\n" "It can barely stand up.\n" "This POKéMON becomes stronger by"); -const u8 DexDescription_Ponyta_2[] = _( +static const u8 DexDescription_Ponyta_2[] = _( "stumbling and falling to keep up with\n" "its parent."); -const u8 DexDescription_Rapidash_1[] = _( +static const u8 DexDescription_Rapidash_1[] = _( "RAPIDASH usually can be seen casually\n" "cantering in the fields and plains.\n" "However, when this POKéMON turns"); -const u8 DexDescription_Rapidash_2[] = _( +static const u8 DexDescription_Rapidash_2[] = _( "serious, its fiery manes flare and blaze\n" "as it gallops its way up to 150 mph."); -const u8 DexDescription_Slowpoke_1[] = _( +static const u8 DexDescription_Slowpoke_1[] = _( "SLOWPOKE uses its tail to catch prey by\n" "dipping it in water at the side of a\n" "river."); -const u8 DexDescription_Slowpoke_2[] = _( +static const u8 DexDescription_Slowpoke_2[] = _( "However, this POKéMON often forgets\n" "what it’s doing and often spends entire\n" "days just loafing at water’s edge."); -const u8 DexDescription_Slowbro_1[] = _( +static const u8 DexDescription_Slowbro_1[] = _( "SLOWBRO’s tail has a SHELLDER firmly\n" "attached with a bite. As a result, the\n" "tail can’t be used for fishing anymore."); -const u8 DexDescription_Slowbro_2[] = _( +static const u8 DexDescription_Slowbro_2[] = _( "This causes SLOWBRO to grudgingly swim\n" "and catch prey instead."); #ifdef SAPPHIRE -const u8 DexDescription_Magnemite_1[] = _( +static const u8 DexDescription_Magnemite_1[] = _( "MAGNEMITE floats in the air by emitting\n" "electromagnetic waves from the units\n" "at its sides. These waves block gravity."); -const u8 DexDescription_Magnemite_2[] = _( +static const u8 DexDescription_Magnemite_2[] = _( "This POKéMON becomes incapable of\n" "flight if its internal electrical supply\n" "is depleted."); #else -const u8 DexDescription_Magnemite_1[] = _( +static const u8 DexDescription_Magnemite_1[] = _( "MAGNEMITE attaches itself to power\n" "lines to feed on electricity.\n" "If your house has a power outage,"); -const u8 DexDescription_Magnemite_2[] = _( +static const u8 DexDescription_Magnemite_2[] = _( "check your circuit breakers. You may\n" "find a large number of this POKéMON\n" "clinging to the breaker box."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Magneton_1[] = _( +static const u8 DexDescription_Magneton_1[] = _( "MAGNETON emits a powerful magnetic\n" "force that is fatal to electronics and\n" "precision instruments. Because of"); -const u8 DexDescription_Magneton_2[] = _( +static const u8 DexDescription_Magneton_2[] = _( "this, it is said that some towns warn\n" "people to keep this POKéMON inside\n" "a POKé BALL."); #else -const u8 DexDescription_Magneton_1[] = _( +static const u8 DexDescription_Magneton_1[] = _( "MAGNETON emits a powerful magnetic\n" "force that is fatal to mechanical\n" "devices. As a result, large cities sound"); -const u8 DexDescription_Magneton_2[] = _( +static const u8 DexDescription_Magneton_2[] = _( "sirens to warn citizens of large-scale\n" "outbreaks of this POKéMON."); #endif -const u8 DexDescription_Farfetchd_1[] = _( +static const u8 DexDescription_Farfetchd_1[] = _( "FARFETCH’D is always seen with a stick\n" "from a plant of some sort. Apparently,\n" "there are good sticks and bad sticks."); -const u8 DexDescription_Farfetchd_2[] = _( +static const u8 DexDescription_Farfetchd_2[] = _( "This POKéMON has been known to fight\n" "with others over sticks."); #ifdef SAPPHIRE -const u8 DexDescription_Doduo_1[] = _( +static const u8 DexDescription_Doduo_1[] = _( "DODUO’s two heads contain completely\n" "identical brains.\n" "A scientific study reported that on"); -const u8 DexDescription_Doduo_2[] = _( +static const u8 DexDescription_Doduo_2[] = _( "rare occasions, there will be examples\n" "of this POKéMON possessing different\n" "sets of brains."); #else -const u8 DexDescription_Doduo_1[] = _( +static const u8 DexDescription_Doduo_1[] = _( "DODUO’s two heads never sleep at the\n" "same time.\n" "Its two heads take turns sleeping,"); -const u8 DexDescription_Doduo_2[] = _( +static const u8 DexDescription_Doduo_2[] = _( "so one head can always keep watch for\n" "enemies while the other one sleeps."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Dodrio_1[] = _( +static const u8 DexDescription_Dodrio_1[] = _( "Apparently, the heads aren’t the only\n" "parts of the body that DODRIO has\n" "three of."); -const u8 DexDescription_Dodrio_2[] = _( +static const u8 DexDescription_Dodrio_2[] = _( "It has three sets of hearts and lungs\n" "as well, so it is capable of running long\n" "distances without rest."); #else -const u8 DexDescription_Dodrio_1[] = _( +static const u8 DexDescription_Dodrio_1[] = _( "Watch out if DODRIO’s three heads are\n" "looking in three separate directions.\n" "It’s a sure sign that it is on its guard."); -const u8 DexDescription_Dodrio_2[] = _( +static const u8 DexDescription_Dodrio_2[] = _( "Don’t go near this POKéMON if it’s being\n" "wary - it may decide to peck you."); #endif -const u8 DexDescription_Seel_1[] = _( +static const u8 DexDescription_Seel_1[] = _( "SEEL hunts for prey in the frigid sea\n" "underneath sheets of ice.\n" "When it needs to breathe, it punches"); -const u8 DexDescription_Seel_2[] = _( +static const u8 DexDescription_Seel_2[] = _( "a hole through the ice with the\n" "sharply protruding section of its head."); -const u8 DexDescription_Dewgong_1[] = _( +static const u8 DexDescription_Dewgong_1[] = _( "DEWGONG loves to snooze on bitterly\n" "cold ice.\n" "The sight of this POKéMON sleeping on"); -const u8 DexDescription_Dewgong_2[] = _( +static const u8 DexDescription_Dewgong_2[] = _( "a glacier was mistakenly thought to be\n" "a mermaid by a mariner long ago."); #ifdef SAPPHIRE -const u8 DexDescription_Grimer_1[] = _( +static const u8 DexDescription_Grimer_1[] = _( "GRIMER emerged from the sludge that\n" "settled on a polluted seabed.\n" "This POKéMON loves anything filthy."); -const u8 DexDescription_Grimer_2[] = _( +static const u8 DexDescription_Grimer_2[] = _( "It constantly leaks a horribly germ-\n" "infested fluid from all over its body."); #else -const u8 DexDescription_Grimer_1[] = _( +static const u8 DexDescription_Grimer_1[] = _( "GRIMER’s sludgy and rubbery body can\n" "be forced through any opening, however\n" "small it may be."); -const u8 DexDescription_Grimer_2[] = _( +static const u8 DexDescription_Grimer_2[] = _( "This POKéMON enters sewer pipes to\n" "drink filthy wastewater."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Muk_1[] = _( +static const u8 DexDescription_Muk_1[] = _( "This POKéMON’s favorite food is\n" "anything that is repugnantly filthy.\n" "In dirty towns where people think"); -const u8 DexDescription_Muk_2[] = _( +static const u8 DexDescription_Muk_2[] = _( "nothing of throwing away litter on the\n" "streets, MUK are certain to gather."); #else -const u8 DexDescription_Muk_1[] = _( +static const u8 DexDescription_Muk_1[] = _( "From MUK’s body seeps a foul fluid that\n" "gives off a nose-bendingly horrible\n" "stench."); -const u8 DexDescription_Muk_2[] = _( +static const u8 DexDescription_Muk_2[] = _( "Just one drop of this POKéMON’s body\n" "fluid can turn a pool stagnant and\n" "rancid."); #endif -const u8 DexDescription_Shellder_1[] = _( +static const u8 DexDescription_Shellder_1[] = _( "At night, this POKéMON uses its broad\n" "tongue to burrow a hole in the seafloor\n" "sand and then sleep in it."); -const u8 DexDescription_Shellder_2[] = _( +static const u8 DexDescription_Shellder_2[] = _( "While it is sleeping, SHELLDER closes its\n" "shell, but leaves its tongue hanging\n" "out."); -const u8 DexDescription_Cloyster_1[] = _( +static const u8 DexDescription_Cloyster_1[] = _( "CLOYSTER is capable of swimming in the\n" "sea. It does so by swallowing water,\n" "then jetting it out toward the rear."); -const u8 DexDescription_Cloyster_2[] = _( +static const u8 DexDescription_Cloyster_2[] = _( "This POKéMON shoots spikes from its\n" "shell using the same system."); -const u8 DexDescription_Gastly_1[] = _( +static const u8 DexDescription_Gastly_1[] = _( "GASTLY is largely composed of gaseous\n" "matter. When exposed to a strong wind,\n" "the gaseous body quickly dwindles away."); -const u8 DexDescription_Gastly_2[] = _( +static const u8 DexDescription_Gastly_2[] = _( "Groups of this POKéMON cluster under\n" "the eaves of houses to escape the\n" "ravages of wind."); -const u8 DexDescription_Haunter_1[] = _( +static const u8 DexDescription_Haunter_1[] = _( "HAUNTER is a dangerous POKéMON.\n" "If one beckons you while floating in\n" "darkness, you must never approach it."); -const u8 DexDescription_Haunter_2[] = _( +static const u8 DexDescription_Haunter_2[] = _( "This POKéMON will try to lick you with its\n" "tongue and steal your life away."); -const u8 DexDescription_Gengar_1[] = _( +static const u8 DexDescription_Gengar_1[] = _( "Sometimes, on a dark night, your shadow\n" "thrown by a streetlight will suddenly\n" "and startlingly overtake you."); -const u8 DexDescription_Gengar_2[] = _( +static const u8 DexDescription_Gengar_2[] = _( "It is actually a GENGAR running past\n" "you, pretending to be your shadow."); -const u8 DexDescription_Onix_1[] = _( +static const u8 DexDescription_Onix_1[] = _( "ONIX has a magnet in its brain. It acts\n" "as a compass so that this POKéMON does\n" "not lose direction while it is tunneling."); -const u8 DexDescription_Onix_2[] = _( +static const u8 DexDescription_Onix_2[] = _( "As it grows older, its body becomes\n" "increasingly rounder and smoother."); -const u8 DexDescription_Drowzee_1[] = _( +static const u8 DexDescription_Drowzee_1[] = _( "If your nose becomes itchy while you\n" "are sleeping, it’s a sure sign that one\n" "of these POKéMON is standing above"); -const u8 DexDescription_Drowzee_2[] = _( +static const u8 DexDescription_Drowzee_2[] = _( "your pillow and trying to eat your dream\n" "through your nostrils."); -const u8 DexDescription_Hypno_1[] = _( +static const u8 DexDescription_Hypno_1[] = _( "HYPNO holds a pendulum in its hand.\n" "The arcing movement and glitter of the\n" "pendulum lull the foe into a deep state"); -const u8 DexDescription_Hypno_2[] = _( +static const u8 DexDescription_Hypno_2[] = _( "of hypnosis.\n" "While this POKéMON searches for prey,\n" "it polishes the pendulum."); -const u8 DexDescription_Krabby_1[] = _( +static const u8 DexDescription_Krabby_1[] = _( "KRABBY live on beaches, burrowed inside\n" "holes dug into the sand.\n" "On sandy beaches with little in the way"); -const u8 DexDescription_Krabby_2[] = _( +static const u8 DexDescription_Krabby_2[] = _( "of food, these POKéMON can be seen\n" "squabbling with each other over\n" "territory."); -const u8 DexDescription_Kingler_1[] = _( +static const u8 DexDescription_Kingler_1[] = _( "KINGLER has an enormous, oversized\n" "claw. It waves this huge claw in the\n" "air to communicate with others."); -const u8 DexDescription_Kingler_2[] = _( +static const u8 DexDescription_Kingler_2[] = _( "However, because the claw is so heavy,\n" "the POKéMON quickly tires."); #ifdef SAPPHIRE -const u8 DexDescription_Voltorb_1[] = _( +static const u8 DexDescription_Voltorb_1[] = _( "VOLTORB is extremely sensitive - it\n" "explodes at the slightest of shocks.\n" "It is rumored that it was first created"); -const u8 DexDescription_Voltorb_2[] = _( +static const u8 DexDescription_Voltorb_2[] = _( "when a POKé BALL was exposed to a\n" "powerful pulse of energy."); #else -const u8 DexDescription_Voltorb_1[] = _( +static const u8 DexDescription_Voltorb_1[] = _( "VOLTORB was first sighted at a company\n" "that manufactures POKé BALLS.\n" "The link between that sighting and"); -const u8 DexDescription_Voltorb_2[] = _( +static const u8 DexDescription_Voltorb_2[] = _( "the fact that this POKéMON looks very\n" "similar to a POKé BALL remains a\n" "mystery."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Electrode_1[] = _( +static const u8 DexDescription_Electrode_1[] = _( "One of ELECTRODE’s characteristics is\n" "its attraction to electricity.\n" "It is a problematical POKéMON that"); -const u8 DexDescription_Electrode_2[] = _( +static const u8 DexDescription_Electrode_2[] = _( "congregates mostly at electrical\n" "power plants to feed on electricity\n" "that has just been generated."); #else -const u8 DexDescription_Electrode_1[] = _( +static const u8 DexDescription_Electrode_1[] = _( "ELECTRODE eats electricity in the\n" "atmosphere. On days when lightning\n" "strikes, you can see this POKéMON"); -const u8 DexDescription_Electrode_2[] = _( +static const u8 DexDescription_Electrode_2[] = _( "exploding all over the place from\n" "eating too much electricity."); #endif -const u8 DexDescription_Exeggcute_1[] = _( +static const u8 DexDescription_Exeggcute_1[] = _( "This POKéMON consists of six eggs that\n" "form a closely knit cluster. The six eggs\n" "attract each other and spin around."); -const u8 DexDescription_Exeggcute_2[] = _( +static const u8 DexDescription_Exeggcute_2[] = _( "When cracks increasingly appear on the\n" "eggs, EXEGGCUTE is close to evolution."); -const u8 DexDescription_Exeggutor_1[] = _( +static const u8 DexDescription_Exeggutor_1[] = _( "EXEGGUTOR originally came from the\n" "tropics. Its heads steadily grow larger\n" "from exposure to strong sunlight."); -const u8 DexDescription_Exeggutor_2[] = _( +static const u8 DexDescription_Exeggutor_2[] = _( "It is said that when the heads fall off,\n" "they group together to form EXEGGCUTE."); -const u8 DexDescription_Cubone_1[] = _( +static const u8 DexDescription_Cubone_1[] = _( "CUBONE pines for the mother it will\n" "never see again. Seeing a likeness of\n" "its mother in the full moon, it cries."); -const u8 DexDescription_Cubone_2[] = _( +static const u8 DexDescription_Cubone_2[] = _( "The stains on the skull the POKéMON\n" "wears are made by the tears it sheds."); -const u8 DexDescription_Marowak_1[] = _( +static const u8 DexDescription_Marowak_1[] = _( "MAROWAK is the evolved form of a CUBONE\n" "that has overcome its sadness at the\n" "loss of its mother and grown tough."); -const u8 DexDescription_Marowak_2[] = _( +static const u8 DexDescription_Marowak_2[] = _( "This POKéMON’s tempered and hardened\n" "spirit is not easily broken."); -const u8 DexDescription_Hitmonlee_1[] = _( +static const u8 DexDescription_Hitmonlee_1[] = _( "HITMONLEE’s legs freely contract and\n" "stretch. Using these springlike legs, it\n" "bowls over foes with devastating kicks."); -const u8 DexDescription_Hitmonlee_2[] = _( +static const u8 DexDescription_Hitmonlee_2[] = _( "After battle, it rubs down its legs and\n" "loosens the muscles to overcome\n" "fatigue."); -const u8 DexDescription_Hitmonchan_1[] = _( +static const u8 DexDescription_Hitmonchan_1[] = _( "HITMONCHAN is said to possess the\n" "spirit of a boxer who had been working\n" "towards a world championship."); -const u8 DexDescription_Hitmonchan_2[] = _( +static const u8 DexDescription_Hitmonchan_2[] = _( "This POKéMON has an indomitable spirit\n" "and will never give up in the face of\n" "adversity."); -const u8 DexDescription_Lickitung_1[] = _( +static const u8 DexDescription_Lickitung_1[] = _( "Whenever LICKITUNG comes across\n" "something new, it will unfailingly give it\n" "a lick. It does so because it memorizes"); -const u8 DexDescription_Lickitung_2[] = _( +static const u8 DexDescription_Lickitung_2[] = _( "things by texture and by taste.\n" "It is somewhat put off by sour things."); #ifdef SAPPHIRE -const u8 DexDescription_Koffing_1[] = _( +static const u8 DexDescription_Koffing_1[] = _( "KOFFING embodies toxic substances.\n" "It mixes the toxins with raw garbage to\n" "set off a chemical reaction that"); -const u8 DexDescription_Koffing_2[] = _( +static const u8 DexDescription_Koffing_2[] = _( "results in a terribly powerful poison\n" "gas. The higher the temperature, the\n" "more gas is concocted by this POKéMON."); #else -const u8 DexDescription_Koffing_1[] = _( +static const u8 DexDescription_Koffing_1[] = _( "If KOFFING becomes agitated, it raises\n" "the toxicity of its internal gases and\n" "jets them out from all over its body."); -const u8 DexDescription_Koffing_2[] = _( +static const u8 DexDescription_Koffing_2[] = _( "This POKéMON may also overinflate its\n" "round body, then explode."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Weezing_1[] = _( +static const u8 DexDescription_Weezing_1[] = _( "WEEZING alternately shrinks and\n" "inflates its twin bodies to mix together\n" "toxic gases inside."); -const u8 DexDescription_Weezing_2[] = _( +static const u8 DexDescription_Weezing_2[] = _( "The more the gases are mixed, the more\n" "powerful the toxins become. The\n" "POKéMON also becomes more putrid."); #else -const u8 DexDescription_Weezing_1[] = _( +static const u8 DexDescription_Weezing_1[] = _( "WEEZING loves the gases given off by\n" "rotted kitchen garbage. This POKéMON\n" "will find a dirty, unkempt house and"); -const u8 DexDescription_Weezing_2[] = _( +static const u8 DexDescription_Weezing_2[] = _( "make it its home. At night, when the\n" "people in the house are asleep, it will\n" "go through the trash."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Rhyhorn_1[] = _( +static const u8 DexDescription_Rhyhorn_1[] = _( "RHYHORN’s brain is very small. It is so\n" "dense, while on a run it forgets why it\n" "started running in the first place."); -const u8 DexDescription_Rhyhorn_2[] = _( +static const u8 DexDescription_Rhyhorn_2[] = _( "It apparently remembers sometimes if it\n" "demolishes something."); #else -const u8 DexDescription_Rhyhorn_1[] = _( +static const u8 DexDescription_Rhyhorn_1[] = _( "RHYHORN runs in a straight line,\n" "smashing everything in its path.\n" "It is not bothered even if it rushes"); -const u8 DexDescription_Rhyhorn_2[] = _( +static const u8 DexDescription_Rhyhorn_2[] = _( "headlong into a block of steel.\n" "This POKéMON may feel some pain from\n" "the collision the next day, however."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Rhydon_1[] = _( +static const u8 DexDescription_Rhydon_1[] = _( "RHYDON has a horn that serves as a\n" "drill. It is used for destroying rocks\n" "and boulders."); -const u8 DexDescription_Rhydon_2[] = _( +static const u8 DexDescription_Rhydon_2[] = _( "This POKéMON occasionally rams into\n" "streams of magma, but the armor-like\n" "hide prevents it from feeling the heat."); #else -const u8 DexDescription_Rhydon_1[] = _( +static const u8 DexDescription_Rhydon_1[] = _( "RHYDON’s horn can crush even uncut\n" "diamonds. One sweeping blow of its tail\n" "can topple a building."); -const u8 DexDescription_Rhydon_2[] = _( +static const u8 DexDescription_Rhydon_2[] = _( "This POKéMON’s hide is extremely tough.\n" "Even direct cannon hits don’t leave\n" "a scratch."); #endif -const u8 DexDescription_Chansey_1[] = _( +static const u8 DexDescription_Chansey_1[] = _( "CHANSEY lays nutritionally excellent\n" "eggs on an everyday basis.\n" "The eggs are so delicious, they are"); -const u8 DexDescription_Chansey_2[] = _( +static const u8 DexDescription_Chansey_2[] = _( "easily and eagerly devoured by even\n" "those people who have lost their\n" "appetite."); -const u8 DexDescription_Tangela_1[] = _( +static const u8 DexDescription_Tangela_1[] = _( "TANGELA’s vines snap off easily if they\n" "are grabbed. This happens without pain,\n" "allowing it to make a quick getaway."); -const u8 DexDescription_Tangela_2[] = _( +static const u8 DexDescription_Tangela_2[] = _( "The lost vines are replaced by newly\n" "grown vines the very next day."); -const u8 DexDescription_Kangaskhan_1[] = _( +static const u8 DexDescription_Kangaskhan_1[] = _( "If you come across a young KANGASKHAN\n" "playing by itself, you must never\n" "disturb it or attempt to catch it."); -const u8 DexDescription_Kangaskhan_2[] = _( +static const u8 DexDescription_Kangaskhan_2[] = _( "The baby POKéMON’s parent is sure to\n" "be in the area, and it will become\n" "violently enraged at you."); #ifdef SAPPHIRE -const u8 DexDescription_Horsea_1[] = _( +static const u8 DexDescription_Horsea_1[] = _( "If HORSEA senses danger, it will\n" "reflexively spray a dense black ink\n" "from its mouth and try to escape."); -const u8 DexDescription_Horsea_2[] = _( +static const u8 DexDescription_Horsea_2[] = _( "This POKéMON swims by cleverly flapping\n" "the fins on its back."); #else -const u8 DexDescription_Horsea_1[] = _( +static const u8 DexDescription_Horsea_1[] = _( "HORSEA eats small insects and moss off\n" "of rocks. If the ocean current turns\n" "fast, this POKéMON anchors itself by"); -const u8 DexDescription_Horsea_2[] = _( +static const u8 DexDescription_Horsea_2[] = _( "wrapping its tail around rocks or coral\n" "to prevent being washed away."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Seadra_1[] = _( +static const u8 DexDescription_Seadra_1[] = _( "SEADRA generates whirlpools by spinning\n" "its body. The whirlpools are strong\n" "enough to swallow even fishing boats."); -const u8 DexDescription_Seadra_2[] = _( +static const u8 DexDescription_Seadra_2[] = _( "This POKéMON weakens prey with these\n" "currents, then swallows it whole."); #else -const u8 DexDescription_Seadra_1[] = _( +static const u8 DexDescription_Seadra_1[] = _( "SEADRA sleeps after wriggling itself\n" "between the branches of coral.\n" "Those trying to harvest coral are"); -const u8 DexDescription_Seadra_2[] = _( +static const u8 DexDescription_Seadra_2[] = _( "occasionally stung by this POKéMON’s\n" "poison barbs if they fail to notice it."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Goldeen_1[] = _( +static const u8 DexDescription_Goldeen_1[] = _( "GOLDEEN loves swimming wild and free\n" "in rivers and ponds.\n" "If one of these POKéMON is placed in an"); -const u8 DexDescription_Goldeen_2[] = _( +static const u8 DexDescription_Goldeen_2[] = _( "aquarium, it will shatter even the\n" "thickest glass with one ram of its horn\n" "and make its escape."); #else -const u8 DexDescription_Goldeen_1[] = _( +static const u8 DexDescription_Goldeen_1[] = _( "GOLDEEN is a very beautiful POKéMON\n" "with fins that billow elegantly in water.\n" "However, don’t let your guard down"); -const u8 DexDescription_Goldeen_2[] = _( +static const u8 DexDescription_Goldeen_2[] = _( "around this POKéMON - it could ram you\n" "powerfully with its horn."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Seaking_1[] = _( +static const u8 DexDescription_Seaking_1[] = _( "SEAKING is very protective of its eggs.\n" "The male and female will take turns\n" "patrolling around their nest and eggs."); -const u8 DexDescription_Seaking_2[] = _( +static const u8 DexDescription_Seaking_2[] = _( "The guarding of eggs by these POKéMON\n" "goes on for over a month."); #else -const u8 DexDescription_Seaking_1[] = _( +static const u8 DexDescription_Seaking_1[] = _( "In the autumn, SEAKING males can be\n" "seen performing courtship dances in\n" "riverbeds to woo females."); -const u8 DexDescription_Seaking_2[] = _( +static const u8 DexDescription_Seaking_2[] = _( "During this season, this POKéMON’s body\n" "coloration is at its most beautiful."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Staryu_1[] = _( +static const u8 DexDescription_Staryu_1[] = _( "STARYU apparently communicates with\n" "the stars in the night sky by flashing\n" "the red core at the center of its body."); -const u8 DexDescription_Staryu_2[] = _( +static const u8 DexDescription_Staryu_2[] = _( "If parts of its body are torn, this\n" "POKéMON simply regenerates the\n" "missing pieces and limbs."); #else -const u8 DexDescription_Staryu_1[] = _( +static const u8 DexDescription_Staryu_1[] = _( "STARYU’s center section has an organ\n" "called the core that shines bright red.\n" "If you go to a beach toward the"); -const u8 DexDescription_Staryu_2[] = _( +static const u8 DexDescription_Staryu_2[] = _( "end of summer, the glowing cores of\n" "these POKéMON look like the stars\n" "in the sky."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Starmie_1[] = _( +static const u8 DexDescription_Starmie_1[] = _( "STARMIE swims through water by\n" "spinning its star-shaped body as if it\n" "were a propeller on a ship."); -const u8 DexDescription_Starmie_2[] = _( +static const u8 DexDescription_Starmie_2[] = _( "The core at the center of this\n" "POKéMON’s body glows in seven colors."); #else -const u8 DexDescription_Starmie_1[] = _( +static const u8 DexDescription_Starmie_1[] = _( "STARMIE’s center section - the core -\n" "glows brightly in seven colors.\n" "Because of its luminous nature, this"); -const u8 DexDescription_Starmie_2[] = _( +static const u8 DexDescription_Starmie_2[] = _( "POKéMON has been given the nickname\n" "“the gem of the sea.â€"); #endif -const u8 DexDescription_Mrmime_1[] = _( +static const u8 DexDescription_Mrmime_1[] = _( "MR. MIME is a master of pantomime.\n" "Its gestures and motions convince\n" "watchers that something unseeable"); -const u8 DexDescription_Mrmime_2[] = _( +static const u8 DexDescription_Mrmime_2[] = _( "actually exists. Once it is believed,\n" "it will exist as if it were a real thing."); -const u8 DexDescription_Scyther_1[] = _( +static const u8 DexDescription_Scyther_1[] = _( "SCYTHER is blindingly fast. Its blazing\n" "speed enhances the effectiveness of\n" "the twin scythes on its forearms."); -const u8 DexDescription_Scyther_2[] = _( +static const u8 DexDescription_Scyther_2[] = _( "This POKéMON’s scythes are so\n" "effective, they can slice through thick\n" "logs in one wicked stroke."); -const u8 DexDescription_Jynx_1[] = _( +static const u8 DexDescription_Jynx_1[] = _( "JYNX walks rhythmically, swaying and\n" "shaking its hips as if it were dancing.\n" "Its motions are so bouncingly alluring,"); -const u8 DexDescription_Jynx_2[] = _( +static const u8 DexDescription_Jynx_2[] = _( "people seeing it are compelled to shake\n" "their hips without giving any thought\n" "to what they are doing."); -const u8 DexDescription_Electabuzz_1[] = _( +static const u8 DexDescription_Electabuzz_1[] = _( "When a storm arrives, gangs of this\n" "POKéMON compete with each other to\n" "scale heights that are likely to be"); -const u8 DexDescription_Electabuzz_2[] = _( +static const u8 DexDescription_Electabuzz_2[] = _( "stricken by lightning bolts.\n" "Some towns use ELECTABUZZ in place of\n" "lightning rods."); -const u8 DexDescription_Magmar_1[] = _( +static const u8 DexDescription_Magmar_1[] = _( "In battle, MAGMAR blows out intensely\n" "hot flames from all over its body to\n" "intimidate its opponent."); -const u8 DexDescription_Magmar_2[] = _( +static const u8 DexDescription_Magmar_2[] = _( "This POKéMON’s fiery bursts create\n" "heat waves that ignite grass and trees\n" "in its surroundings."); #ifdef SAPPHIRE -const u8 DexDescription_Pinsir_1[] = _( +static const u8 DexDescription_Pinsir_1[] = _( "PINSIR has a pair of massive horns \n" "Protruding from the surface of these\n" "horns are thorns."); -const u8 DexDescription_Pinsir_2[] = _( +static const u8 DexDescription_Pinsir_2[] = _( "These thorns are driven deeply into the\n" "foe’s body when the pincer closes,\n" "making it tough for the foe to escape."); #else -const u8 DexDescription_Pinsir_1[] = _( +static const u8 DexDescription_Pinsir_1[] = _( "PINSIR is astoundingly strong. It can\n" "grip a foe weighing twice its weight\n" "in its horns and easily lift it."); -const u8 DexDescription_Pinsir_2[] = _( +static const u8 DexDescription_Pinsir_2[] = _( "This POKéMON’s movements turn sluggish\n" "in cold places."); #endif -const u8 DexDescription_Tauros_1[] = _( +static const u8 DexDescription_Tauros_1[] = _( "This POKéMON is not satisfied unless\n" "it is rampaging at all times.\n" "If there is no opponent for TAUROS to"); -const u8 DexDescription_Tauros_2[] = _( +static const u8 DexDescription_Tauros_2[] = _( "battle, it will charge at thick trees and\n" "knock them down to calm itself."); #ifdef SAPPHIRE -const u8 DexDescription_Magikarp_1[] = _( +static const u8 DexDescription_Magikarp_1[] = _( "MAGIKARP is virtually useless in battle\n" "as it can only splash around.\n" "As a result, it is considered to be weak."); -const u8 DexDescription_Magikarp_2[] = _( +static const u8 DexDescription_Magikarp_2[] = _( "However, it is actually a very hardy\n" "POKéMON that can survive in any body of\n" "water no matter how polluted it is."); #else -const u8 DexDescription_Magikarp_1[] = _( +static const u8 DexDescription_Magikarp_1[] = _( "MAGIKARP is a pathetic excuse for a\n" "POKéMON that is only capable of\n" "flopping and splashing."); -const u8 DexDescription_Magikarp_2[] = _( +static const u8 DexDescription_Magikarp_2[] = _( "This behavior prompted scientists to\n" "undertake research into it."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Gyarados_1[] = _( +static const u8 DexDescription_Gyarados_1[] = _( "Once GYARADOS goes on a rampage, its\n" "ferociously violent blood doesn’t calm\n" "until it has burned everything down."); -const u8 DexDescription_Gyarados_2[] = _( +static const u8 DexDescription_Gyarados_2[] = _( "There are records of this POKéMON’s\n" "rampages lasting a whole month."); #else -const u8 DexDescription_Gyarados_1[] = _( +static const u8 DexDescription_Gyarados_1[] = _( "When MAGIKARP evolves into GYARADOS,\n" "its brain cells undergo a structural\n" "transformation. It is said that this"); -const u8 DexDescription_Gyarados_2[] = _( +static const u8 DexDescription_Gyarados_2[] = _( "transformation is to blame for this\n" "POKéMON’s wildly violent nature."); #endif -const u8 DexDescription_Lapras_1[] = _( +static const u8 DexDescription_Lapras_1[] = _( "People have driven LAPRAS almost to the\n" "point of extinction. In the evenings,\n" "this POKéMON is said to sing plaintively"); -const u8 DexDescription_Lapras_2[] = _( +static const u8 DexDescription_Lapras_2[] = _( "as it seeks what few others of its kind\n" "still remain."); -const u8 DexDescription_Ditto_1[] = _( +static const u8 DexDescription_Ditto_1[] = _( "DITTO rearranges its cell structure to\n" "transform itself into other shapes.\n" "However, if it tries to transform itself"); -const u8 DexDescription_Ditto_2[] = _( +static const u8 DexDescription_Ditto_2[] = _( "into something by relying on its memory,\n" "this POKéMON manages to get details\n" "wrong."); -const u8 DexDescription_Eevee_1[] = _( +static const u8 DexDescription_Eevee_1[] = _( "EEVEE has an unstable genetic makeup\n" "that suddenly mutates due to the\n" "environment in which it lives."); -const u8 DexDescription_Eevee_2[] = _( +static const u8 DexDescription_Eevee_2[] = _( "Radiation from various STONES causes\n" "this POKéMON to evolve."); -const u8 DexDescription_Vaporeon_1[] = _( +static const u8 DexDescription_Vaporeon_1[] = _( "VAPOREON underwent a spontaneous\n" "mutation and grew fins and gills that\n" "allow it to live underwater."); -const u8 DexDescription_Vaporeon_2[] = _( +static const u8 DexDescription_Vaporeon_2[] = _( "This POKéMON has the ability to freely\n" "control water."); -const u8 DexDescription_Jolteon_1[] = _( +static const u8 DexDescription_Jolteon_1[] = _( "JOLTEON’s cells generate a low level of\n" "electricity. This power is amplified by\n" "the static electricity of its fur,"); -const u8 DexDescription_Jolteon_2[] = _( +static const u8 DexDescription_Jolteon_2[] = _( "enabling the POKéMON to drop\n" "thunderbolts. The bristling fur is made\n" "of electrically charged needles."); -const u8 DexDescription_Flareon_1[] = _( +static const u8 DexDescription_Flareon_1[] = _( "FLAREON’s fluffy fur has a functional\n" "purpose - it releases heat into the air\n" "so that its body does not get"); -const u8 DexDescription_Flareon_2[] = _( +static const u8 DexDescription_Flareon_2[] = _( "excessively hot.\n" "This POKéMON’s body temperature can\n" "rise to a maximum of 1,650 degrees F."); -const u8 DexDescription_Porygon_1[] = _( +static const u8 DexDescription_Porygon_1[] = _( "PORYGON is capable of reverting itself\n" "entirely back to program data and\n" "entering cyberspace."); -const u8 DexDescription_Porygon_2[] = _( +static const u8 DexDescription_Porygon_2[] = _( "This POKéMON is copy-protected so it\n" "cannot be duplicated by copying."); -const u8 DexDescription_Omanyte_1[] = _( +static const u8 DexDescription_Omanyte_1[] = _( "OMANYTE is one of the ancient and long-\n" "since-extinct POKéMON that have been\n" "regenerated from fossils by people."); -const u8 DexDescription_Omanyte_2[] = _( +static const u8 DexDescription_Omanyte_2[] = _( "If attacked by an enemy, it withdraws\n" "itself inside its hard shell."); -const u8 DexDescription_Omastar_1[] = _( +static const u8 DexDescription_Omastar_1[] = _( "OMASTAR uses its tentacles to capture\n" "its prey. It is believed to have become\n" "extinct because its shell grew too large"); -const u8 DexDescription_Omastar_2[] = _( +static const u8 DexDescription_Omastar_2[] = _( "and heavy, causing its movements to\n" "become too slow and ponderous."); -const u8 DexDescription_Kabuto_1[] = _( +static const u8 DexDescription_Kabuto_1[] = _( "KABUTO is a POKéMON that has been\n" "regenerated from a fossil. However, in\n" "extremely rare cases, living examples"); -const u8 DexDescription_Kabuto_2[] = _( +static const u8 DexDescription_Kabuto_2[] = _( "have been discovered.\n" "The POKéMON has not changed at all for\n" "300 million years."); -const u8 DexDescription_Kabutops_1[] = _( +static const u8 DexDescription_Kabutops_1[] = _( "KABUTOPS swam underwater to hunt for\n" "its prey in ancient times.\n" "The POKéMON was apparently evolving"); -const u8 DexDescription_Kabutops_2[] = _( +static const u8 DexDescription_Kabutops_2[] = _( "from being a water-dweller to living on\n" "land as evident from the beginnings of\n" "change in its gills and legs."); -const u8 DexDescription_Aerodactyl_1[] = _( +static const u8 DexDescription_Aerodactyl_1[] = _( "AERODACTYL is a POKéMON from the age\n" "of dinosaurs. It was regenerated from\n" "genetic material extracted from amber."); -const u8 DexDescription_Aerodactyl_2[] = _( +static const u8 DexDescription_Aerodactyl_2[] = _( "It is imagined to have been the king of\n" "the skies in ancient times."); -const u8 DexDescription_Snorlax_1[] = _( +static const u8 DexDescription_Snorlax_1[] = _( "SNORLAX’s typical day consists of\n" "nothing more than eating and sleeping.\n" "It is such a docile POKéMON that there"); -const u8 DexDescription_Snorlax_2[] = _( +static const u8 DexDescription_Snorlax_2[] = _( "are children who use its expansive belly\n" "as a place to play."); -const u8 DexDescription_Articuno_1[] = _( +static const u8 DexDescription_Articuno_1[] = _( "ARTICUNO is a legendary bird POKéMON\n" "that can control ice.\n" "The flapping of its wings chills the air."); -const u8 DexDescription_Articuno_2[] = _( +static const u8 DexDescription_Articuno_2[] = _( "As a result, it is said that when this\n" "POKéMON flies, snow will fall."); -const u8 DexDescription_Zapdos_1[] = _( +static const u8 DexDescription_Zapdos_1[] = _( "ZAPDOS is a legendary bird POKéMON that\n" "has the ability to control electricity.\n" "It usually lives in thunderclouds."); -const u8 DexDescription_Zapdos_2[] = _( +static const u8 DexDescription_Zapdos_2[] = _( "The POKéMON gains power if it is\n" "stricken by lightning bolts."); -const u8 DexDescription_Moltres_1[] = _( +static const u8 DexDescription_Moltres_1[] = _( "MOLTRES is a legendary bird POKéMON\n" "that has the ability to control fire.\n" "If this POKéMON is injured, it is said to"); -const u8 DexDescription_Moltres_2[] = _( +static const u8 DexDescription_Moltres_2[] = _( "dip its body in the molten magma of a\n" "volcano to burn and heal itself."); -const u8 DexDescription_Dratini_1[] = _( +static const u8 DexDescription_Dratini_1[] = _( "DRATINI continually molts and sloughs\n" "off its old skin.\n" "It does so because the life energy"); -const u8 DexDescription_Dratini_2[] = _( +static const u8 DexDescription_Dratini_2[] = _( "within its body steadily builds to reach\n" "uncontrollable levels."); -const u8 DexDescription_Dragonair_1[] = _( +static const u8 DexDescription_Dragonair_1[] = _( "DRAGONAIR stores an enormous amount\n" "of energy inside its body.\n" "It is said to alter weather conditions"); -const u8 DexDescription_Dragonair_2[] = _( +static const u8 DexDescription_Dragonair_2[] = _( "in its vicinity by discharging energy\n" "from the crystals on its neck and tail."); -const u8 DexDescription_Dragonite_1[] = _( +static const u8 DexDescription_Dragonite_1[] = _( "DRAGONITE is capable of circling the\n" "globe in just sixteen hours.\n" "It is a kindhearted POKéMON that leads"); -const u8 DexDescription_Dragonite_2[] = _( +static const u8 DexDescription_Dragonite_2[] = _( "lost and foundering ships in a storm to\n" "the safety of land."); -const u8 DexDescription_Mewtwo_1[] = _( +static const u8 DexDescription_Mewtwo_1[] = _( "MEWTWO is a POKéMON that was created\n" "by genetic manipulation.\n" "However, even though the scientific"); -const u8 DexDescription_Mewtwo_2[] = _( +static const u8 DexDescription_Mewtwo_2[] = _( "power of humans created this POKéMON’s\n" "body, they failed to endow MEWTWO with\n" "a compassionate heart."); -const u8 DexDescription_Mew_1[] = _( +static const u8 DexDescription_Mew_1[] = _( "MEW is said to possess the genetic\n" "composition of all POKéMON.\n" "It is capable of making itself invisible"); -const u8 DexDescription_Mew_2[] = _( +static const u8 DexDescription_Mew_2[] = _( "at will, so it entirely avoids notice even\n" "if it approaches people."); -const u8 DexDescription_Chikorita_1[] = _( +static const u8 DexDescription_Chikorita_1[] = _( "In battle, CHIKORITA waves its leaf\n" "around to keep the foe at bay.\n" "However, a sweet fragrance also wafts"); -const u8 DexDescription_Chikorita_2[] = _( +static const u8 DexDescription_Chikorita_2[] = _( "from the leaf, becalming the battling\n" "POKéMON and creating a cozy, friendly\n" "atmosphere all around."); -const u8 DexDescription_Bayleef_1[] = _( +static const u8 DexDescription_Bayleef_1[] = _( "BAYLEEF’s neck is ringed by curled-up\n" "leaves. Inside each tubular leaf is a\n" "small shoot of a tree."); -const u8 DexDescription_Bayleef_2[] = _( +static const u8 DexDescription_Bayleef_2[] = _( "The fragrance of this shoot makes\n" "people peppy."); -const u8 DexDescription_Meganium_1[] = _( +static const u8 DexDescription_Meganium_1[] = _( "The fragrance of MEGANIUM’s flower\n" "soothes and calms emotions.\n" "In battle, this POKéMON gives off more"); -const u8 DexDescription_Meganium_2[] = _( +static const u8 DexDescription_Meganium_2[] = _( "of its becalming scent to blunt the\n" "foe’s fighting spirit."); -const u8 DexDescription_Cyndaquil_1[] = _( +static const u8 DexDescription_Cyndaquil_1[] = _( "CYNDAQUIL protects itself by flaring up\n" "the flames on its back.\n" "The flames are vigorous if the POKéMON"); -const u8 DexDescription_Cyndaquil_2[] = _( +static const u8 DexDescription_Cyndaquil_2[] = _( "is angry. However, if it is tired, the\n" "flames splutter fitfully with incomplete\n" "combustion."); -const u8 DexDescription_Quilava_1[] = _( +static const u8 DexDescription_Quilava_1[] = _( "QUILAVA keeps its foes at bay with the\n" "intensity of its flames and gusts of\n" "superheated air."); -const u8 DexDescription_Quilava_2[] = _( +static const u8 DexDescription_Quilava_2[] = _( "This POKéMON applies its outstanding\n" "nimbleness to dodge attacks even while\n" "scorching the foe with flames."); -const u8 DexDescription_Typhlosion_1[] = _( +static const u8 DexDescription_Typhlosion_1[] = _( "TYPHLOSION obscures itself behind a\n" "shimmering heat haze that it creates\n" "using its intensely hot flames."); -const u8 DexDescription_Typhlosion_2[] = _( +static const u8 DexDescription_Typhlosion_2[] = _( "This POKéMON creates blazing explosive\n" "blasts that burn everything to cinders."); -const u8 DexDescription_Totodile_1[] = _( +static const u8 DexDescription_Totodile_1[] = _( "Despite the smallness of its body,\n" "TOTODILE’s jaws are very powerful.\n" "While the POKéMON may think it is just"); -const u8 DexDescription_Totodile_2[] = _( +static const u8 DexDescription_Totodile_2[] = _( "playfully nipping, its bite has enough\n" "power to cause serious injury."); -const u8 DexDescription_Croconaw_1[] = _( +static const u8 DexDescription_Croconaw_1[] = _( "Once CROCONAW has clamped its jaws on\n" "its foe, it will absolutely not let go.\n" "Because the tips of its fangs are"); -const u8 DexDescription_Croconaw_2[] = _( +static const u8 DexDescription_Croconaw_2[] = _( "forked back like barbed fishhooks, they\n" "become impossible to remove when \n" "they have sunk in."); -const u8 DexDescription_Feraligatr_1[] = _( +static const u8 DexDescription_Feraligatr_1[] = _( "FERALIGATR intimidates its foes by\n" "opening its huge mouth.\n" "In battle, it will kick the ground hard"); -const u8 DexDescription_Feraligatr_2[] = _( +static const u8 DexDescription_Feraligatr_2[] = _( "with its thick and powerful hind legs to\n" "charge at the foe at an incredible\n" "speed."); -const u8 DexDescription_Sentret_1[] = _( +static const u8 DexDescription_Sentret_1[] = _( "When SENTRET sleeps, it does so while\n" "another stands guard. The sentry wakes\n" "the others at the first sign of danger."); -const u8 DexDescription_Sentret_2[] = _( +static const u8 DexDescription_Sentret_2[] = _( "When this POKéMON becomes separated\n" "from its pack, it becomes incapable of\n" "sleep due to fear."); -const u8 DexDescription_Furret_1[] = _( +static const u8 DexDescription_Furret_1[] = _( "FURRET has a very slim build.\n" "When under attack, it can slickly squirm\n" "through narrow spaces and get away."); -const u8 DexDescription_Furret_2[] = _( +static const u8 DexDescription_Furret_2[] = _( "In spite of its short limbs, this\n" "POKéMON is very nimble and fleet."); -const u8 DexDescription_Hoothoot_1[] = _( +static const u8 DexDescription_Hoothoot_1[] = _( "HOOTHOOT has an internal organ that\n" "senses and tracks the earth’s rotation.\n" "Using this special organ, this POKéMON"); -const u8 DexDescription_Hoothoot_2[] = _( +static const u8 DexDescription_Hoothoot_2[] = _( "begins hooting at precisely the same\n" "time every day."); -const u8 DexDescription_Noctowl_1[] = _( +static const u8 DexDescription_Noctowl_1[] = _( "NOCTOWL never fails at catching prey in\n" "darkness. This POKéMON owes its\n" "success to its superior vision that"); -const u8 DexDescription_Noctowl_2[] = _( +static const u8 DexDescription_Noctowl_2[] = _( "allows it to see in minimal light, and to\n" "its soft, supple wings that make no\n" "sound in flight."); -const u8 DexDescription_Ledyba_1[] = _( +static const u8 DexDescription_Ledyba_1[] = _( "LEDYBA secretes an aromatic fluid from\n" "where its legs join its body. This fluid\n" "is used for communicating with others."); -const u8 DexDescription_Ledyba_2[] = _( +static const u8 DexDescription_Ledyba_2[] = _( "This POKéMON conveys its feelings to\n" "others by altering the fluid’s scent."); -const u8 DexDescription_Ledian_1[] = _( +static const u8 DexDescription_Ledian_1[] = _( "It is said that in lands with clean air,\n" "where the stars fill the sky, there live\n" "LEDIAN in countless numbers."); -const u8 DexDescription_Ledian_2[] = _( +static const u8 DexDescription_Ledian_2[] = _( "There is a good reason for this - the\n" "POKéMON uses the light of the stars\n" "as its energy."); -const u8 DexDescription_Spinarak_1[] = _( +static const u8 DexDescription_Spinarak_1[] = _( "The web spun by SPINARAK can be\n" "considered its second nervous system.\n" "It is said that this POKéMON can"); -const u8 DexDescription_Spinarak_2[] = _( +static const u8 DexDescription_Spinarak_2[] = _( "determine what kind of prey is touching\n" "its web just by the tiny vibrations it\n" "feels through the web’s strands."); -const u8 DexDescription_Ariados_1[] = _( +static const u8 DexDescription_Ariados_1[] = _( "ARIADOS’s feet are tipped with tiny\n" "hooked claws that enable it to scuttle\n" "on ceilings and vertical walls."); -const u8 DexDescription_Ariados_2[] = _( +static const u8 DexDescription_Ariados_2[] = _( "This POKéMON constricts the foe with\n" "thin and strong silk webbing."); #ifdef SAPPHIRE -const u8 DexDescription_Crobat_1[] = _( +static const u8 DexDescription_Crobat_1[] = _( "CROBAT sneaks up on its intended prey\n" "using wings that barely make a sound.\n" "This POKéMON rests by hanging on a"); -const u8 DexDescription_Crobat_2[] = _( +static const u8 DexDescription_Crobat_2[] = _( "tree branch with its rear legs that\n" "serve as wings."); #else -const u8 DexDescription_Crobat_1[] = _( +static const u8 DexDescription_Crobat_1[] = _( "If this POKéMON is flying by fluttering\n" "only a pair of wings on either the\n" "forelegs or hind legs, it’s proof that"); -const u8 DexDescription_Crobat_2[] = _( +static const u8 DexDescription_Crobat_2[] = _( "CROBAT has been flying a long distance.\n" "It switches the wings it uses if it is\n" "tired."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Chinchou_1[] = _( +static const u8 DexDescription_Chinchou_1[] = _( "CHINCHOU’s two antennas are filled with\n" "cells that generate strong electricity.\n" "This POKéMON’s cells create so much"); -const u8 DexDescription_Chinchou_2[] = _( +static const u8 DexDescription_Chinchou_2[] = _( "electrical power, it even makes itself\n" "tingle slightly."); #else -const u8 DexDescription_Chinchou_1[] = _( +static const u8 DexDescription_Chinchou_1[] = _( "CHINCHOU lets loose positive and\n" "negative electrical charges from its\n" "two antennas to make its prey faint."); -const u8 DexDescription_Chinchou_2[] = _( +static const u8 DexDescription_Chinchou_2[] = _( "This POKéMON flashes its electric\n" "lights to exchange signals with others."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Lanturn_1[] = _( +static const u8 DexDescription_Lanturn_1[] = _( "LANTURN is known to emit light.\n" "If you peer down into the dark sea from\n" "a ship at night, you can sometimes see"); -const u8 DexDescription_Lanturn_2[] = _( +static const u8 DexDescription_Lanturn_2[] = _( "this POKéMON’s light rising from the\n" "depths where it swims. It gives the sea\n" "an appearance of a starlit night."); #else -const u8 DexDescription_Lanturn_1[] = _( +static const u8 DexDescription_Lanturn_1[] = _( "LANTURN is nicknamed “the deep-sea\n" "star†for its illuminated antenna.\n" "This POKéMON produces light by"); -const u8 DexDescription_Lanturn_2[] = _( +static const u8 DexDescription_Lanturn_2[] = _( "causing a chemical reaction between\n" "bacteria and its bodily fluids inside\n" "the antenna."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Pichu_1[] = _( +static const u8 DexDescription_Pichu_1[] = _( "When PICHU plays with others, it may\n" "short out electricity with another\n" "PICHU, creating a shower of sparks."); -const u8 DexDescription_Pichu_2[] = _( +static const u8 DexDescription_Pichu_2[] = _( "In that event, this POKéMON will begin\n" "crying, startled by the flash of sparks."); #else -const u8 DexDescription_Pichu_1[] = _( +static const u8 DexDescription_Pichu_1[] = _( "PICHU charges itself with electricity\n" "more easily on days with thunderclouds\n" "or when the air is very dry."); -const u8 DexDescription_Pichu_2[] = _( +static const u8 DexDescription_Pichu_2[] = _( "You can hear the crackling of static\n" "electricity coming off this POKéMON."); #endif -const u8 DexDescription_Cleffa_1[] = _( +static const u8 DexDescription_Cleffa_1[] = _( "On nights with many shooting stars,\n" "CLEFFA can be seen dancing in a ring.\n" "They dance through the night and stop"); -const u8 DexDescription_Cleffa_2[] = _( +static const u8 DexDescription_Cleffa_2[] = _( "only at the break of day, when these\n" "POKéMON quench their thirst with the\n" "morning dew."); #ifdef SAPPHIRE -const u8 DexDescription_Igglybuff_1[] = _( +static const u8 DexDescription_Igglybuff_1[] = _( "IGGLYBUFF has a soft and plushy body\n" "that feels very much like a marshmallow.\n" "From this body wafts a gently sweet"); -const u8 DexDescription_Igglybuff_2[] = _( +static const u8 DexDescription_Igglybuff_2[] = _( "fragrance that soothes and calms the\n" "emotions of its foes."); #else -const u8 DexDescription_Igglybuff_1[] = _( +static const u8 DexDescription_Igglybuff_1[] = _( "IGGLYBUFF’s vocal chords are not\n" "sufficiently developed. It would hurt\n" "its throat if it were to sing too much."); -const u8 DexDescription_Igglybuff_2[] = _( +static const u8 DexDescription_Igglybuff_2[] = _( "This POKéMON gargles with freshwater\n" "from a clean stream."); #endif -const u8 DexDescription_Togepi_1[] = _( +static const u8 DexDescription_Togepi_1[] = _( "As its energy, TOGEPI uses the positive\n" "emotions of compassion and pleasure\n" "exuded by people and POKéMON."); -const u8 DexDescription_Togepi_2[] = _( +static const u8 DexDescription_Togepi_2[] = _( "This POKéMON stores up feelings of\n" "happiness inside its shell, then shares\n" "them with others."); -const u8 DexDescription_Togetic_1[] = _( +static const u8 DexDescription_Togetic_1[] = _( "TOGETIC is said to be a POKéMON that\n" "brings good fortune. When the POKéMON\n" "spots someone who is pure of heart,"); -const u8 DexDescription_Togetic_2[] = _( +static const u8 DexDescription_Togetic_2[] = _( "it is said to appear and share its\n" "happiness with that person."); #ifdef SAPPHIRE -const u8 DexDescription_Natu_1[] = _( +static const u8 DexDescription_Natu_1[] = _( "NATU has a highly developed jumping\n" "ability. The POKéMON flaps and leaps\n" "onto tree branches that are taller than"); -const u8 DexDescription_Natu_2[] = _( +static const u8 DexDescription_Natu_2[] = _( "grown-up people to pick at the tree’s\n" "new shoots."); #else -const u8 DexDescription_Natu_1[] = _( +static const u8 DexDescription_Natu_1[] = _( "NATU cannot fly because its wings are\n" "not yet fully grown. If your eyes meet\n" "with this POKéMON’s eyes, it will stare"); -const u8 DexDescription_Natu_2[] = _( +static const u8 DexDescription_Natu_2[] = _( "back intently at you. But if you move\n" "even slightly, it will hop away to safety."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Xatu_1[] = _( +static const u8 DexDescription_Xatu_1[] = _( "XATU is known to stand motionless while\n" "staring at the sun all day long.\n" "Some people revere it as a mystical"); -const u8 DexDescription_Xatu_2[] = _( +static const u8 DexDescription_Xatu_2[] = _( "POKéMON out of their belief that XATU\n" "is in possession of the power to see\n" "into the future."); #else -const u8 DexDescription_Xatu_1[] = _( +static const u8 DexDescription_Xatu_1[] = _( "XATU stands rooted and still in one\n" "spot all day long. People believe that\n" "this POKéMON does so out of fear of"); -const u8 DexDescription_Xatu_2[] = _( +static const u8 DexDescription_Xatu_2[] = _( "the terrible things it has foreseen in\n" "the future."); #endif -const u8 DexDescription_Mareep_1[] = _( +static const u8 DexDescription_Mareep_1[] = _( "MAREEP’s fluffy coat of wool rubs\n" "together and builds a static charge.\n" "The more static electricity is charged,"); -const u8 DexDescription_Mareep_2[] = _( +static const u8 DexDescription_Mareep_2[] = _( "the more brightly the lightbulb at the\n" "tip of its tail grows."); -const u8 DexDescription_Flaaffy_1[] = _( +static const u8 DexDescription_Flaaffy_1[] = _( "FLAAFFY’s wool quality changes so that\n" "it can generate a high amount of static\n" "electricity with a small amount of wool."); -const u8 DexDescription_Flaaffy_2[] = _( +static const u8 DexDescription_Flaaffy_2[] = _( "The bare and slick parts of its hide are\n" "shielded against electricity."); -const u8 DexDescription_Ampharos_1[] = _( +static const u8 DexDescription_Ampharos_1[] = _( "AMPHAROS gives off so much light that\n" "it can be seen even from space.\n" "People in the old days used the light of"); -const u8 DexDescription_Ampharos_2[] = _( +static const u8 DexDescription_Ampharos_2[] = _( "this POKéMON to send signals back and\n" "forth with others far away."); #ifdef SAPPHIRE -const u8 DexDescription_Bellossom_1[] = _( +static const u8 DexDescription_Bellossom_1[] = _( "A BELLOSSOM grows flowers more\n" "beautifully if it has evolved from a\n" "smelly GLOOM - the stinkier the better."); -const u8 DexDescription_Bellossom_2[] = _( +static const u8 DexDescription_Bellossom_2[] = _( "At night, this POKéMON closes its\n" "petals and goes to sleep."); #else -const u8 DexDescription_Bellossom_1[] = _( +static const u8 DexDescription_Bellossom_1[] = _( "When BELLOSSOM gets exposed to plenty\n" "of sunlight, the leaves ringing its body\n" "begin to spin around."); -const u8 DexDescription_Bellossom_2[] = _( +static const u8 DexDescription_Bellossom_2[] = _( "This POKéMON’s dancing is renowned in\n" "the southern lands."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Marill_1[] = _( +static const u8 DexDescription_Marill_1[] = _( "When fishing for food at the edge of a\n" "fast-running stream, MARILL wraps its\n" "tail around the trunk of a tree."); -const u8 DexDescription_Marill_2[] = _( +static const u8 DexDescription_Marill_2[] = _( "This POKéMON’s tail is flexible and\n" "configured to stretch."); #else -const u8 DexDescription_Marill_1[] = _( +static const u8 DexDescription_Marill_1[] = _( "MARILL’s oil-filled tail acts much like\n" "a life preserver. If you see just its\n" "tail bobbing on the water’s surface,"); -const u8 DexDescription_Marill_2[] = _( +static const u8 DexDescription_Marill_2[] = _( "it’s a sure indication that this POKéMON\n" "is diving beneath the water to feed on\n" "aquatic plants."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Azumarill_1[] = _( +static const u8 DexDescription_Azumarill_1[] = _( "AZUMARILL can make balloons out of\n" "air. It makes these air balloons if it\n" "spots a drowning POKéMON."); -const u8 DexDescription_Azumarill_2[] = _( +static const u8 DexDescription_Azumarill_2[] = _( "The air balloons enable the POKéMON in\n" "trouble to breathe."); #else -const u8 DexDescription_Azumarill_1[] = _( +static const u8 DexDescription_Azumarill_1[] = _( "AZUMARILL’s long ears are indispensable\n" "sensors. By focusing its hearing, this\n" "POKéMON can identify what kinds of"); -const u8 DexDescription_Azumarill_2[] = _( +static const u8 DexDescription_Azumarill_2[] = _( "prey are around, even in rough and\n" "fast-running rivers."); #endif -const u8 DexDescription_Sudowoodo_1[] = _( +static const u8 DexDescription_Sudowoodo_1[] = _( "SUDOWOODO camouflages itself as a tree\n" "to avoid being attacked by enemies.\n" "However, because the forelegs remain"); -const u8 DexDescription_Sudowoodo_2[] = _( +static const u8 DexDescription_Sudowoodo_2[] = _( "green throughout the year, the POKéMON\n" "is easily identified as a fake during\n" "the winter."); -const u8 DexDescription_Politoed_1[] = _( +static const u8 DexDescription_Politoed_1[] = _( "The curled hair on POLITOED’s head is\n" "proof of its status as a king. It is said\n" "that the longer and more curled the"); -const u8 DexDescription_Politoed_2[] = _( +static const u8 DexDescription_Politoed_2[] = _( "hair, the more respect this POKéMON\n" "earns from its peers."); -const u8 DexDescription_Hoppip_1[] = _( +static const u8 DexDescription_Hoppip_1[] = _( "This POKéMON drifts and floats with the\n" "wind. If it senses the approach of\n" "strong winds, HOPPIP links its leaves"); -const u8 DexDescription_Hoppip_2[] = _( +static const u8 DexDescription_Hoppip_2[] = _( "with other HOPPIP to prepare against\n" "being blown away."); -const u8 DexDescription_Skiploom_1[] = _( +static const u8 DexDescription_Skiploom_1[] = _( "SKIPLOOM’s flower blossoms when the\n" "temperature rises above 64 degrees F.\n" "How much the flower opens depends on"); -const u8 DexDescription_Skiploom_2[] = _( +static const u8 DexDescription_Skiploom_2[] = _( "the temperature. For that reason, this\n" "POKéMON is sometimes used as a\n" "thermometer."); -const u8 DexDescription_Jumpluff_1[] = _( +static const u8 DexDescription_Jumpluff_1[] = _( "JUMPLUFF rides warm southern winds to\n" "cross the sea and fly to foreign lands.\n" "The POKéMON descends to the ground"); -const u8 DexDescription_Jumpluff_2[] = _( +static const u8 DexDescription_Jumpluff_2[] = _( "when it encounters cold air while it is\n" "floating."); -const u8 DexDescription_Aipom_1[] = _( +static const u8 DexDescription_Aipom_1[] = _( "AIPOM’s tail ends in a hand-like\n" "appendage that can be cleverly\n" "manipulated."); -const u8 DexDescription_Aipom_2[] = _( +static const u8 DexDescription_Aipom_2[] = _( "However, because the POKéMON uses its\n" "tail so much, its real hands have become\n" "rather clumsy."); -const u8 DexDescription_Sunkern_1[] = _( +static const u8 DexDescription_Sunkern_1[] = _( "SUNKERN tries to move as little as it\n" "possibly can. It does so because it\n" "tries to conserve all the nutrients it"); -const u8 DexDescription_Sunkern_2[] = _( +static const u8 DexDescription_Sunkern_2[] = _( "has stored in its body for its\n" "evolution. It will not eat a thing, \n" "subsisting only on morning dew."); -const u8 DexDescription_Sunflora_1[] = _( +static const u8 DexDescription_Sunflora_1[] = _( "SUNFLORA converts solar energy into\n" "nutrition. It moves around actively in\n" "the daytime when it is warm."); -const u8 DexDescription_Sunflora_2[] = _( +static const u8 DexDescription_Sunflora_2[] = _( "It stops moving as soon as the sun goes\n" "down for the night."); -const u8 DexDescription_Yanma_1[] = _( +static const u8 DexDescription_Yanma_1[] = _( "YANMA is capable of seeing 360 degrees\n" "without having to move its eyes.\n" "It is a great flier that is adept at"); -const u8 DexDescription_Yanma_2[] = _( +static const u8 DexDescription_Yanma_2[] = _( "making sudden stops and turning midair.\n" "This POKéMON uses its flying ability to\n" "quickly chase down targeted prey."); -const u8 DexDescription_Wooper_1[] = _( +static const u8 DexDescription_Wooper_1[] = _( "WOOPER usually lives in water.\n" "However, it occasionally comes out onto\n" "land in search of food."); -const u8 DexDescription_Wooper_2[] = _( +static const u8 DexDescription_Wooper_2[] = _( "On land, it coats its body with a gooey,\n" "toxic film."); -const u8 DexDescription_Quagsire_1[] = _( +static const u8 DexDescription_Quagsire_1[] = _( "QUAGSIRE hunts for food by leaving\n" "its mouth wide open in water and waiting\n" "for its prey to blunder in unaware."); -const u8 DexDescription_Quagsire_2[] = _( +static const u8 DexDescription_Quagsire_2[] = _( "Because the POKéMON does not move,\n" "it does not get very hungry."); -const u8 DexDescription_Espeon_1[] = _( +static const u8 DexDescription_Espeon_1[] = _( "ESPEON is extremely loyal to any\n" "TRAINER it considers to be worthy.\n" "It is said that this POKéMON developed"); -const u8 DexDescription_Espeon_2[] = _( +static const u8 DexDescription_Espeon_2[] = _( "its precognitive powers to protect its\n" "TRAINER from harm."); -const u8 DexDescription_Umbreon_1[] = _( +static const u8 DexDescription_Umbreon_1[] = _( "UMBREON evolved as a result of exposure\n" "to the moon’s waves.\n" "It hides silently in darkness and waits"); -const u8 DexDescription_Umbreon_2[] = _( +static const u8 DexDescription_Umbreon_2[] = _( "for its foes to make a move.\n" "The rings on its body glow when it leaps\n" "to attack."); -const u8 DexDescription_Murkrow_1[] = _( +static const u8 DexDescription_Murkrow_1[] = _( "MURKROW was feared and loathed as the\n" "alleged bearer of ill fortune.\n" "This POKéMON shows strong interest in"); -const u8 DexDescription_Murkrow_2[] = _( +static const u8 DexDescription_Murkrow_2[] = _( "anything that sparkles or glitters.\n" "It will even try to steal rings from\n" "women."); -const u8 DexDescription_Slowking_1[] = _( +static const u8 DexDescription_Slowking_1[] = _( "SLOWKING undertakes research every\n" "day in an effort to solve the mysteries\n" "of the world."); -const u8 DexDescription_Slowking_2[] = _( +static const u8 DexDescription_Slowking_2[] = _( "However, this POKéMON apparently\n" "forgets everything it has learned if\n" "the SHELLDER on its head comes off."); -const u8 DexDescription_Misdreavus_1[] = _( +static const u8 DexDescription_Misdreavus_1[] = _( "MISDREAVUS frightens people with a\n" "creepy, sobbing cry. The POKéMON\n" "apparently uses its red spheres to"); -const u8 DexDescription_Misdreavus_2[] = _( +static const u8 DexDescription_Misdreavus_2[] = _( "absorb the fearful feelings of foes and\n" "turn them into nutrition."); -const u8 DexDescription_Unown_1[] = _( +static const u8 DexDescription_Unown_1[] = _( "This POKéMON is shaped like ancient\n" "writing. It is a mystery as to which\n" "came first, the ancient writings or the"); -const u8 DexDescription_Unown_2[] = _( +static const u8 DexDescription_Unown_2[] = _( "various UNOWN. Research into this\n" "topic is ongoing but nothing is known."); #ifdef SAPPHIRE -const u8 DexDescription_Wobbuffet_1[] = _( +static const u8 DexDescription_Wobbuffet_1[] = _( "WOBBUFFET does nothing but endure\n" "attacks - it won’t attack on its own.\n" "However, it won’t endure an attack on"); -const u8 DexDescription_Wobbuffet_2[] = _( +static const u8 DexDescription_Wobbuffet_2[] = _( "its tail. When that happens, the\n" "POKéMON will try to take the foe with it\n" "using DESTINY BOND."); #else -const u8 DexDescription_Wobbuffet_1[] = _( +static const u8 DexDescription_Wobbuffet_1[] = _( "If two or more WOBBUFFET meet, they will\n" "turn competitive and try to outdo each\n" "other’s endurance."); -const u8 DexDescription_Wobbuffet_2[] = _( +static const u8 DexDescription_Wobbuffet_2[] = _( "However, they may try to see which one\n" "can endure the longest without food.\n" "TRAINERS need to beware of this habit."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Girafarig_1[] = _( +static const u8 DexDescription_Girafarig_1[] = _( "GIRAFARIG’s rear head contains a tiny\n" "brain that is too small for thinking.\n" "However, the rear head doesn’t need to"); -const u8 DexDescription_Girafarig_2[] = _( +static const u8 DexDescription_Girafarig_2[] = _( "sleep, so it can keep watch over its\n" "surroundings 24 hours a day."); #else -const u8 DexDescription_Girafarig_1[] = _( +static const u8 DexDescription_Girafarig_1[] = _( "GIRAFARIG’s rear head also has a brain,\n" "but it is small. The rear head attacks in\n" "response to smells and sounds."); -const u8 DexDescription_Girafarig_2[] = _( +static const u8 DexDescription_Girafarig_2[] = _( "Approaching this POKéMON from behind\n" "can cause the rear head to suddenly\n" "lash out and bite."); #endif -const u8 DexDescription_Pineco_1[] = _( +static const u8 DexDescription_Pineco_1[] = _( "PINECO hangs from a tree branch and\n" "patiently waits for prey to come along.\n" "If the POKéMON is disturbed while"); -const u8 DexDescription_Pineco_2[] = _( +static const u8 DexDescription_Pineco_2[] = _( "eating by someone shaking its tree, it\n" "drops down to the ground and explodes\n" "with no warning."); -const u8 DexDescription_Forretress_1[] = _( +static const u8 DexDescription_Forretress_1[] = _( "FORRETRESS conceals itself inside its\n" "hardened steel shell. The shell is opened\n" "when the POKéMON is catching prey,"); -const u8 DexDescription_Forretress_2[] = _( +static const u8 DexDescription_Forretress_2[] = _( "but it does so at such a quick pace\n" "that the shell’s inside cannot be seen."); -const u8 DexDescription_Dunsparce_1[] = _( +static const u8 DexDescription_Dunsparce_1[] = _( "DUNSPARCE has a drill for its tail.\n" "It uses this tail to burrow into the\n" "ground backwards."); -const u8 DexDescription_Dunsparce_2[] = _( +static const u8 DexDescription_Dunsparce_2[] = _( "This POKéMON is known to make its nest\n" "in complex shapes deep under the\n" "ground."); -const u8 DexDescription_Gligar_1[] = _( +static const u8 DexDescription_Gligar_1[] = _( "GLIGAR glides through the air without\n" "a sound as if it were sliding.\n" "This POKéMON hangs on to the face of"); -const u8 DexDescription_Gligar_2[] = _( +static const u8 DexDescription_Gligar_2[] = _( "its foe using its clawed hind legs and\n" "the large pincers on its forelegs, then\n" "injects the prey with its poison barb."); -const u8 DexDescription_Steelix_1[] = _( +static const u8 DexDescription_Steelix_1[] = _( "STEELIX lives even further underground\n" "than ONIX. This POKéMON is known to dig\n" "towards the earth’s core."); -const u8 DexDescription_Steelix_2[] = _( +static const u8 DexDescription_Steelix_2[] = _( "There are records of this POKéMON\n" "reaching a depth of over six-tenths\n" "of a mile underground."); -const u8 DexDescription_Snubbull_1[] = _( +static const u8 DexDescription_Snubbull_1[] = _( "By baring its fangs and making a scary\n" "face, SNUBBULL sends smaller POKéMON\n" "scurrying away in terror."); -const u8 DexDescription_Snubbull_2[] = _( +static const u8 DexDescription_Snubbull_2[] = _( "However, this POKéMON seems a little\n" "sad at making its foes flee."); -const u8 DexDescription_Granbull_1[] = _( +static const u8 DexDescription_Granbull_1[] = _( "GRANBULL has a particularly well-\n" "developed lower jaw. The enormous fangs\n" "are heavy, causing the POKéMON to tip"); -const u8 DexDescription_Granbull_2[] = _( +static const u8 DexDescription_Granbull_2[] = _( "its head back for balance.\n" "Unless it is startled, it will not try to\n" "bite indiscriminately."); -const u8 DexDescription_Qwilfish_1[] = _( +static const u8 DexDescription_Qwilfish_1[] = _( "QWILFISH sucks in water, inflating\n" "itself. This POKéMON uses the pressure\n" "of the water it swallowed to shoot"); -const u8 DexDescription_Qwilfish_2[] = _( +static const u8 DexDescription_Qwilfish_2[] = _( "toxic quills all at once from all over\n" "its body. It finds swimming somewhat\n" "challenging."); -const u8 DexDescription_Scizor_1[] = _( +static const u8 DexDescription_Scizor_1[] = _( "SCIZOR has a body with the hardness of\n" "steel. It is not easily fazed by ordinary\n" "sorts of attacks."); -const u8 DexDescription_Scizor_2[] = _( +static const u8 DexDescription_Scizor_2[] = _( "This POKéMON flaps its wings to\n" "regulate its body temperature."); -const u8 DexDescription_Shuckle_1[] = _( +static const u8 DexDescription_Shuckle_1[] = _( "SHUCKLE quietly hides itself under\n" "rocks, keeping its body concealed\n" "inside its hard shell while eating"); -const u8 DexDescription_Shuckle_2[] = _( +static const u8 DexDescription_Shuckle_2[] = _( "berries it has stored away.\n" "The berries mix with its body fluids to\n" "become a juice."); #ifdef SAPPHIRE -const u8 DexDescription_Heracross_1[] = _( +static const u8 DexDescription_Heracross_1[] = _( "HERACROSS has sharp claws on its feet.\n" "These are planted firmly into the\n" "ground or the bark of a tree, giving the"); -const u8 DexDescription_Heracross_2[] = _( +static const u8 DexDescription_Heracross_2[] = _( "POKéMON a secure and solid footing\n" "to forcefully fling away foes with\n" "its proud horn."); #else -const u8 DexDescription_Heracross_1[] = _( +static const u8 DexDescription_Heracross_1[] = _( "HERACROSS charges in a straight line at\n" "its foe, slips beneath the foe’s grasp,\n" "and then scoops up and hurls the"); -const u8 DexDescription_Heracross_2[] = _( +static const u8 DexDescription_Heracross_2[] = _( "opponent with its mighty horn.\n" "This POKéMON even has enough power\n" "to topple a massive tree."); #endif -const u8 DexDescription_Sneasel_1[] = _( +static const u8 DexDescription_Sneasel_1[] = _( "SNEASEL scales trees by punching its\n" "hooked claws into the bark.\n" "This POKéMON seeks out unguarded"); -const u8 DexDescription_Sneasel_2[] = _( +static const u8 DexDescription_Sneasel_2[] = _( "nests and steals eggs for food while\n" "the parents are away."); -const u8 DexDescription_Teddiursa_1[] = _( +static const u8 DexDescription_Teddiursa_1[] = _( "This POKéMON likes to lick its palms that\n" "are sweetened by being soaked in honey.\n" "TEDDIURSA concocts its own honey by"); -const u8 DexDescription_Teddiursa_2[] = _( +static const u8 DexDescription_Teddiursa_2[] = _( "blending fruits and pollen collected by\n" "BEEDRILL."); -const u8 DexDescription_Ursaring_1[] = _( +static const u8 DexDescription_Ursaring_1[] = _( "In the forests inhabited by URSARING,\n" "it is said that there are many streams\n" "and towering trees where they"); -const u8 DexDescription_Ursaring_2[] = _( +static const u8 DexDescription_Ursaring_2[] = _( "gather food. This POKéMON walks\n" "through its forest gathering food\n" "every day."); #ifdef SAPPHIRE -const u8 DexDescription_Slugma_1[] = _( +static const u8 DexDescription_Slugma_1[] = _( "SLUGMA does not have any blood in its\n" "body. Instead, intensely hot magma\n" "circulates throughout this POKéMON’s"); -const u8 DexDescription_Slugma_2[] = _( +static const u8 DexDescription_Slugma_2[] = _( "body, carrying essential nutrients and\n" "oxygen to its organs."); #else -const u8 DexDescription_Slugma_1[] = _( +static const u8 DexDescription_Slugma_1[] = _( "Molten magma courses throughout\n" "SLUGMA’s circulatory system.\n" "If this POKéMON is chilled, the magma"); -const u8 DexDescription_Slugma_2[] = _( +static const u8 DexDescription_Slugma_2[] = _( "cools and hardens. Its body turns\n" "brittle and chunks fall off, reducing\n" "its size."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Magcargo_1[] = _( +static const u8 DexDescription_Magcargo_1[] = _( "MAGCARGO’s body temperature is\n" "approximately 18,000 degrees F.\n" "Water is vaporized on contact."); -const u8 DexDescription_Magcargo_2[] = _( +static const u8 DexDescription_Magcargo_2[] = _( "If this POKéMON is caught in the rain,\n" "the raindrops instantly turn into\n" "steam, cloaking the area in a thick fog."); #else -const u8 DexDescription_Magcargo_1[] = _( +static const u8 DexDescription_Magcargo_1[] = _( "MAGCARGO’s shell is actually its skin\n" "that hardened as a result of cooling.\n" "Its shell is very brittle and fragile -"); -const u8 DexDescription_Magcargo_2[] = _( +static const u8 DexDescription_Magcargo_2[] = _( "just touching it causes it to crumble\n" "apart. This POKéMON returns to its\n" "original size by dipping itself in magma."); #endif -const u8 DexDescription_Swinub_1[] = _( +static const u8 DexDescription_Swinub_1[] = _( "SWINUB roots for food by rubbing its\n" "snout against the ground. Its favorite\n" "food is a mushroom that grows under"); -const u8 DexDescription_Swinub_2[] = _( +static const u8 DexDescription_Swinub_2[] = _( "the cover of dead grass.\n" "This POKéMON occasionally roots out\n" "hot springs."); -const u8 DexDescription_Piloswine_1[] = _( +static const u8 DexDescription_Piloswine_1[] = _( "PILOSWINE is covered by a thick coat\n" "of long hair that enables it to endure\n" "the freezing cold."); -const u8 DexDescription_Piloswine_2[] = _( +static const u8 DexDescription_Piloswine_2[] = _( "This POKéMON uses its tusks to dig up\n" "food that has been buried under ice."); #ifdef SAPPHIRE -const u8 DexDescription_Corsola_1[] = _( +static const u8 DexDescription_Corsola_1[] = _( "Clusters of CORSOLA congregate in warm\n" "seas where they serve as ideal hiding\n" "places for smaller POKéMON."); -const u8 DexDescription_Corsola_2[] = _( +static const u8 DexDescription_Corsola_2[] = _( "When the water temperature falls, this\n" "POKéMON migrates to the southern seas."); #else -const u8 DexDescription_Corsola_1[] = _( +static const u8 DexDescription_Corsola_1[] = _( "CORSOLA’s branches glitter very\n" "beautifully in seven colors when they\n" "catch sunlight."); -const u8 DexDescription_Corsola_2[] = _( +static const u8 DexDescription_Corsola_2[] = _( "If any branch breaks off, this POKéMON\n" "grows it back in just one night."); #endif -const u8 DexDescription_Remoraid_1[] = _( +static const u8 DexDescription_Remoraid_1[] = _( "REMORAID sucks in water, then expels it\n" "at high velocity using its abdominal\n" "muscles to shoot down flying prey."); -const u8 DexDescription_Remoraid_2[] = _( +static const u8 DexDescription_Remoraid_2[] = _( "When evolution draws near, this POKéMON\n" "travels downstream from rivers."); -const u8 DexDescription_Octillery_1[] = _( +static const u8 DexDescription_Octillery_1[] = _( "OCTILLERY grabs onto its foe using\n" "its tentacles. This POKéMON tries to\n" "immobilize it before delivering the"); -const u8 DexDescription_Octillery_2[] = _( +static const u8 DexDescription_Octillery_2[] = _( "finishing blow.\n" "If the foe turns out to be too strong,\n" "OCTILLERY spews ink to escape."); -const u8 DexDescription_Delibird_1[] = _( +static const u8 DexDescription_Delibird_1[] = _( "DELIBIRD carries its food bundled up\n" "in its tail. There once was a famous\n" "explorer who managed to reach the peak"); -const u8 DexDescription_Delibird_2[] = _( +static const u8 DexDescription_Delibird_2[] = _( "of Mt. Everest thanks to one of these\n" "POKéMON sharing its food."); -const u8 DexDescription_Mantine_1[] = _( +static const u8 DexDescription_Mantine_1[] = _( "On sunny days, schools of MANTINE can\n" "be seen elegantly leaping over the\n" "sea’s waves."); -const u8 DexDescription_Mantine_2[] = _( +static const u8 DexDescription_Mantine_2[] = _( "This POKéMON is not bothered by the\n" "REMORAID that hitches rides."); #ifdef SAPPHIRE -const u8 DexDescription_Skarmory_1[] = _( +static const u8 DexDescription_Skarmory_1[] = _( "SKARMORY’s steel wings become tattered\n" "and bashed in from repeated battles.\n" "Once a year, the battered wings grow"); -const u8 DexDescription_Skarmory_2[] = _( +static const u8 DexDescription_Skarmory_2[] = _( "back completely, restoring the cutting\n" "edges to their pristine state."); #else -const u8 DexDescription_Skarmory_1[] = _( +static const u8 DexDescription_Skarmory_1[] = _( "SKARMORY is entirely encased in hard,\n" "protective armor. This POKéMON flies at\n" "close to 190 mph."); -const u8 DexDescription_Skarmory_2[] = _( +static const u8 DexDescription_Skarmory_2[] = _( "It slashes foes with its wings that\n" "possess swordlike cutting edges."); #endif -const u8 DexDescription_Houndour_1[] = _( +static const u8 DexDescription_Houndour_1[] = _( "HOUNDOUR hunt as a coordinated pack.\n" "They communicate with each other using\n" "a variety of cries to corner their prey."); -const u8 DexDescription_Houndour_2[] = _( +static const u8 DexDescription_Houndour_2[] = _( "This POKéMON’s remarkable teamwork is\n" "unparalleled."); -const u8 DexDescription_Houndoom_1[] = _( +static const u8 DexDescription_Houndoom_1[] = _( "In a HOUNDOOM pack, the one with its\n" "horns raked sharply towards the back\n" "serves a leadership role."); -const u8 DexDescription_Houndoom_2[] = _( +static const u8 DexDescription_Houndoom_2[] = _( "These POKéMON choose their leader by\n" "fighting amongst themselves."); #ifdef SAPPHIRE -const u8 DexDescription_Kingdra_1[] = _( +static const u8 DexDescription_Kingdra_1[] = _( "KINGDRA sleeps on the seafloor where\n" "it is otherwise devoid of life.\n" "When a storm arrives, the POKéMON is"); -const u8 DexDescription_Kingdra_2[] = _( +static const u8 DexDescription_Kingdra_2[] = _( "said to awaken and wander about in\n" "search of prey."); #else -const u8 DexDescription_Kingdra_1[] = _( +static const u8 DexDescription_Kingdra_1[] = _( "KINGDRA lives at extreme ocean depths\n" "that are otherwise uninhabited.\n" "It has long been believed that the"); -const u8 DexDescription_Kingdra_2[] = _( +static const u8 DexDescription_Kingdra_2[] = _( "yawning of this POKéMON creates\n" "spiraling ocean currents."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Phanpy_1[] = _( +static const u8 DexDescription_Phanpy_1[] = _( "PHANPY uses its long nose to shower\n" "itself. When others gather around, they\n" "thoroughly douse each other with water."); -const u8 DexDescription_Phanpy_2[] = _( +static const u8 DexDescription_Phanpy_2[] = _( "These POKéMON can be seen drying their\n" "soaking-wet bodies at the edge of\n" "water."); #else -const u8 DexDescription_Phanpy_1[] = _( +static const u8 DexDescription_Phanpy_1[] = _( "For its nest, PHANPY digs a vertical pit \n" "in the ground at the edge of a river.\n" "It marks the area around its nest with"); -const u8 DexDescription_Phanpy_2[] = _( +static const u8 DexDescription_Phanpy_2[] = _( "its trunk to let the others know that\n" "the area has been claimed."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Donphan_1[] = _( +static const u8 DexDescription_Donphan_1[] = _( "If DONPHAN were to tackle with its hard\n" "body, even a house could be destroyed.\n" "Using its massive strength, the"); -const u8 DexDescription_Donphan_2[] = _( +static const u8 DexDescription_Donphan_2[] = _( "POKéMON helps clear rock and mud slides\n" "that block mountain trails."); #else -const u8 DexDescription_Donphan_1[] = _( +static const u8 DexDescription_Donphan_1[] = _( "DONPHAN’s favorite attack is curling\n" "its body into a ball, then charging at\n" "its foe while rolling at high speed."); -const u8 DexDescription_Donphan_2[] = _( +static const u8 DexDescription_Donphan_2[] = _( "Once it starts rolling, this POKéMON\n" "can’t stop very easily."); #endif -const u8 DexDescription_Porygon2_1[] = _( +static const u8 DexDescription_Porygon2_1[] = _( "PORYGON2 was created by humans using\n" "the power of science. The man-made\n" "POKéMON has been endowed with"); -const u8 DexDescription_Porygon2_2[] = _( +static const u8 DexDescription_Porygon2_2[] = _( "artificial intelligence that enables it\n" "to learn new gestures and emotions\n" "on its own."); -const u8 DexDescription_Stantler_1[] = _( +static const u8 DexDescription_Stantler_1[] = _( "STANTLER’s magnificent antlers were\n" "traded at high prices as works of art.\n" "As a result, this POKéMON was hunted"); -const u8 DexDescription_Stantler_2[] = _( +static const u8 DexDescription_Stantler_2[] = _( "close to extinction by those who were\n" "after the priceless antlers."); -const u8 DexDescription_Smeargle_1[] = _( +static const u8 DexDescription_Smeargle_1[] = _( "SMEARGLE marks the boundaries of its\n" "territory using a body fluid that leaks\n" "out from the tip of its tail."); -const u8 DexDescription_Smeargle_2[] = _( +static const u8 DexDescription_Smeargle_2[] = _( "Over 5,000 different marks left by this\n" "POKéMON have been found."); -const u8 DexDescription_Tyrogue_1[] = _( +static const u8 DexDescription_Tyrogue_1[] = _( "TYROGUE becomes stressed out if it\n" "does not get to train every day.\n" "When raising this POKéMON, the TRAINER"); -const u8 DexDescription_Tyrogue_2[] = _( +static const u8 DexDescription_Tyrogue_2[] = _( "must establish and uphold various\n" "training methods."); -const u8 DexDescription_Hitmontop_1[] = _( +static const u8 DexDescription_Hitmontop_1[] = _( "HITMONTOP spins on its head at high\n" "speed, all the while delivering kicks.\n" "This technique is a remarkable mix of"); -const u8 DexDescription_Hitmontop_2[] = _( +static const u8 DexDescription_Hitmontop_2[] = _( "both offense and defense at the same\n" "time. The POKéMON travels faster\n" "spinning than it does walking."); -const u8 DexDescription_Smoochum_1[] = _( +static const u8 DexDescription_Smoochum_1[] = _( "SMOOCHUM actively runs about, but\n" "also falls quite often.\n" "Whenever the chance arrives, it will"); -const u8 DexDescription_Smoochum_2[] = _( +static const u8 DexDescription_Smoochum_2[] = _( "look for its reflection to make sure its\n" "face hasn’t become dirty."); -const u8 DexDescription_Elekid_1[] = _( +static const u8 DexDescription_Elekid_1[] = _( "ELEKID stores electricity in its body.\n" "If it touches metal and accidentally\n" "discharges all its built-up electricity,"); -const u8 DexDescription_Elekid_2[] = _( +static const u8 DexDescription_Elekid_2[] = _( "this POKéMON begins swinging its arms\n" "in circles to recharge itself."); -const u8 DexDescription_Magby_1[] = _( +static const u8 DexDescription_Magby_1[] = _( "MAGBY’s state of health is determined\n" "by observing the fire it breathes.\n" "If the POKéMON is spouting yellow"); -const u8 DexDescription_Magby_2[] = _( +static const u8 DexDescription_Magby_2[] = _( "flames from its mouth, it is in good\n" "health. When it is fatigued, black smoke\n" "will be mixed in with the flames."); -const u8 DexDescription_Miltank_1[] = _( +static const u8 DexDescription_Miltank_1[] = _( "MILTANK gives over five gallons of milk\n" "on a daily basis. Its sweet milk is\n" "enjoyed by children and grown-ups alike."); -const u8 DexDescription_Miltank_2[] = _( +static const u8 DexDescription_Miltank_2[] = _( "People who can’t drink milk turn it into\n" "yogurt and eat it instead."); -const u8 DexDescription_Blissey_1[] = _( +static const u8 DexDescription_Blissey_1[] = _( "BLISSEY senses sadness with its fluffy\n" "coat of fur. If it does so, this POKéMON\n" "will rush over to the sad person,"); -const u8 DexDescription_Blissey_2[] = _( +static const u8 DexDescription_Blissey_2[] = _( "however far they may be, to share an\n" "egg of happiness that brings a smile\n" "to any face."); -const u8 DexDescription_Raikou_1[] = _( +static const u8 DexDescription_Raikou_1[] = _( "RAIKOU embodies the speed of lightning.\n" "The roars of this POKéMON send shock\n" "waves shuddering through the air and"); -const u8 DexDescription_Raikou_2[] = _( +static const u8 DexDescription_Raikou_2[] = _( "shake the ground as if lightning bolts\n" "had come crashing down."); -const u8 DexDescription_Entei_1[] = _( +static const u8 DexDescription_Entei_1[] = _( "ENTEI embodies the passion of magma.\n" "This POKéMON is thought to have been\n" "born in the eruption of a volcano."); -const u8 DexDescription_Entei_2[] = _( +static const u8 DexDescription_Entei_2[] = _( "It sends up massive bursts of fire that\n" "utterly consume all that they touch."); -const u8 DexDescription_Suicune_1[] = _( +static const u8 DexDescription_Suicune_1[] = _( "SUICUNE embodies the compassion of\n" "a pure spring of water. It runs across\n" "the land with gracefulness."); -const u8 DexDescription_Suicune_2[] = _( +static const u8 DexDescription_Suicune_2[] = _( "This POKéMON has the power to purify\n" "dirty water."); -const u8 DexDescription_Larvitar_1[] = _( +static const u8 DexDescription_Larvitar_1[] = _( "LARVITAR is born deep under the ground.\n" "To come up to the surface, this POKéMON\n" "must eat its way through the soil above."); -const u8 DexDescription_Larvitar_2[] = _( +static const u8 DexDescription_Larvitar_2[] = _( "Until it does so, LARVITAR cannot see\n" "its parent’s face."); -const u8 DexDescription_Pupitar_1[] = _( +static const u8 DexDescription_Pupitar_1[] = _( "PUPITAR creates a gas inside its body\n" "that it compresses and forcefully\n" "ejects to propel itself like a jet."); -const u8 DexDescription_Pupitar_2[] = _( +static const u8 DexDescription_Pupitar_2[] = _( "The body is very durable - it avoids\n" "damage even if it hits solid steel."); -const u8 DexDescription_Tyranitar_1[] = _( +static const u8 DexDescription_Tyranitar_1[] = _( "TYRANITAR is so overwhelmingly\n" "powerful, it can bring down a whole\n" "mountain to make its nest."); -const u8 DexDescription_Tyranitar_2[] = _( +static const u8 DexDescription_Tyranitar_2[] = _( "This POKéMON wanders about in\n" "mountains seeking new opponents to\n" "fight."); -const u8 DexDescription_Lugia_1[] = _( +static const u8 DexDescription_Lugia_1[] = _( "LUGIA’s wings pack devastating power -\n" "a light fluttering of its wings can blow\n" "apart regular houses."); -const u8 DexDescription_Lugia_2[] = _( +static const u8 DexDescription_Lugia_2[] = _( "As a result, this POKéMON chooses to\n" "live out of sight deep under the sea."); -const u8 DexDescription_HoOh_1[] = _( +static const u8 DexDescription_HoOh_1[] = _( "HO-OH’s feathers glow in seven colors\n" "depending on the angle at which they\n" "are struck by light."); -const u8 DexDescription_HoOh_2[] = _( +static const u8 DexDescription_HoOh_2[] = _( "These feathers are said to bring\n" "happiness to the bearers. This POKéMON\n" "is said to live at the foot of a rainbow."); -const u8 DexDescription_Celebi_1[] = _( +static const u8 DexDescription_Celebi_1[] = _( "This POKéMON came from the future by\n" "crossing over time.\n" "It is thought that so long as CELEBI"); -const u8 DexDescription_Celebi_2[] = _( +static const u8 DexDescription_Celebi_2[] = _( "appears, a bright and shining future\n" "awaits us."); #ifdef SAPPHIRE -const u8 DexDescription_Treecko_1[] = _( +static const u8 DexDescription_Treecko_1[] = _( "TREECKO is cool, calm, and collected -\n" "it never panics under any situation.\n" "If a bigger foe were to glare at this"); -const u8 DexDescription_Treecko_2[] = _( +static const u8 DexDescription_Treecko_2[] = _( "POKéMON, it would glare right back\n" "without conceding an inch of ground."); #else -const u8 DexDescription_Treecko_1[] = _( +static const u8 DexDescription_Treecko_1[] = _( "TREECKO has small hooks on the bottom\n" "of its feet that enable it to scale\n" "vertical walls."); -const u8 DexDescription_Treecko_2[] = _( +static const u8 DexDescription_Treecko_2[] = _( "This POKéMON attacks by slamming foes\n" "with its thick tail."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Grovyle_1[] = _( +static const u8 DexDescription_Grovyle_1[] = _( "This POKéMON adeptly flies from branch\n" "to branch in trees.\n" "In a forest, no POKéMON can ever hope"); -const u8 DexDescription_Grovyle_2[] = _( +static const u8 DexDescription_Grovyle_2[] = _( "to catch a fleeing GROVYLE however\n" "fast they may be."); #else -const u8 DexDescription_Grovyle_1[] = _( +static const u8 DexDescription_Grovyle_1[] = _( "The leaves growing out of GROVYLE’s\n" "body are convenient for camouflaging\n" "it from enemies in the forest."); -const u8 DexDescription_Grovyle_2[] = _( +static const u8 DexDescription_Grovyle_2[] = _( "This POKéMON is a master at climbing\n" "trees in jungles."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Sceptile_1[] = _( +static const u8 DexDescription_Sceptile_1[] = _( "SCEPTILE has seeds growing on its back.\n" "They are said to be bursting with\n" "nutrients that revitalize trees."); -const u8 DexDescription_Sceptile_2[] = _( +static const u8 DexDescription_Sceptile_2[] = _( "This POKéMON raises the trees in a\n" "forest with loving care."); #else -const u8 DexDescription_Sceptile_1[] = _( +static const u8 DexDescription_Sceptile_1[] = _( "The leaves growing on SCEPTILE’s body\n" "are very sharp edged. This POKéMON is\n" "very agile - it leaps all over the"); -const u8 DexDescription_Sceptile_2[] = _( +static const u8 DexDescription_Sceptile_2[] = _( "branches of trees and jumps on its foe\n" "from above or behind."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Torchic_1[] = _( +static const u8 DexDescription_Torchic_1[] = _( "TORCHIC has a place inside its body\n" "where it keeps its flame. Give it a hug -\n" "it will be glowing with warmth."); -const u8 DexDescription_Torchic_2[] = _( +static const u8 DexDescription_Torchic_2[] = _( "This POKéMON is covered all over by a\n" "fluffy coat of down."); #else -const u8 DexDescription_Torchic_1[] = _( +static const u8 DexDescription_Torchic_1[] = _( "TORCHIC sticks with its TRAINER,\n" "following behind with unsteady\n" "steps."); -const u8 DexDescription_Torchic_2[] = _( +static const u8 DexDescription_Torchic_2[] = _( "This POKéMON breathes fire of over\n" "1,800 degrees F, including fireballs\n" "that leave the foe scorched black."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Combusken_1[] = _( +static const u8 DexDescription_Combusken_1[] = _( "COMBUSKEN battles with the intensely\n" "hot flames it spews from its beak and\n" "with outstandingly destructive kicks."); -const u8 DexDescription_Combusken_2[] = _( +static const u8 DexDescription_Combusken_2[] = _( "This POKéMON’s cry is very loud and\n" "distracting."); #else -const u8 DexDescription_Combusken_1[] = _( +static const u8 DexDescription_Combusken_1[] = _( "COMBUSKEN toughens up its legs and\n" "thighs by running through fields and\n" "mountains."); -const u8 DexDescription_Combusken_2[] = _( +static const u8 DexDescription_Combusken_2[] = _( "This POKéMON’s legs possess both speed\n" "and power, enabling it to dole out ten\n" "kicks in one second."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Blaziken_1[] = _( +static const u8 DexDescription_Blaziken_1[] = _( "BLAZIKEN has incredibly strong legs -\n" "it can easily clear a 30-story building\n" "in one leap."); -const u8 DexDescription_Blaziken_2[] = _( +static const u8 DexDescription_Blaziken_2[] = _( "This POKéMON’s blazing punches leave\n" "its foes scorched and blackened."); #else -const u8 DexDescription_Blaziken_1[] = _( +static const u8 DexDescription_Blaziken_1[] = _( "In battle, BLAZIKEN blows out intense\n" "flames from its wrists and attacks foes\n" "courageously."); -const u8 DexDescription_Blaziken_2[] = _( +static const u8 DexDescription_Blaziken_2[] = _( "The stronger the foe, the more\n" "intensely this POKéMON’s wrists burn."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Mudkip_1[] = _( +static const u8 DexDescription_Mudkip_1[] = _( "In water, MUDKIP breathes using the\n" "gills on its cheeks.\n" "If it is faced with a tight situation in"); -const u8 DexDescription_Mudkip_2[] = _( +static const u8 DexDescription_Mudkip_2[] = _( "battle, this POKéMON will unleash its\n" "amazing power - it can crush rocks\n" "bigger than itself."); #else -const u8 DexDescription_Mudkip_1[] = _( +static const u8 DexDescription_Mudkip_1[] = _( "The fin on MUDKIP’s head acts as highly\n" "sensitive radar. Using this fin to sense\n" "movements of water and air, this"); -const u8 DexDescription_Mudkip_2[] = _( +static const u8 DexDescription_Mudkip_2[] = _( "POKéMON can determine what is taking\n" "place around it without using its eyes."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Marshtomp_1[] = _( +static const u8 DexDescription_Marshtomp_1[] = _( "MARSHTOMP is much faster at traveling\n" "through mud than it is at swimming.\n" "This POKéMON’s hindquarters exhibit"); -const u8 DexDescription_Marshtomp_2[] = _( +static const u8 DexDescription_Marshtomp_2[] = _( "obvious development, giving it the\n" "ability to walk on just its hind legs."); #else -const u8 DexDescription_Marshtomp_1[] = _( +static const u8 DexDescription_Marshtomp_1[] = _( "The surface of MARSHTOMP’s body is\n" "enveloped by a thin, sticky film that\n" "enables it to live on land."); -const u8 DexDescription_Marshtomp_2[] = _( +static const u8 DexDescription_Marshtomp_2[] = _( "This POKéMON plays in mud on beaches\n" "when the ocean tide is low."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Swampert_1[] = _( +static const u8 DexDescription_Swampert_1[] = _( "SWAMPERT predicts storms by sensing\n" "subtle differences in the sounds of\n" "waves and tidal winds with its fins."); -const u8 DexDescription_Swampert_2[] = _( +static const u8 DexDescription_Swampert_2[] = _( "If a storm is approaching, it piles up\n" "boulders to protect itself."); #else -const u8 DexDescription_Swampert_1[] = _( +static const u8 DexDescription_Swampert_1[] = _( "SWAMPERT is very strong. It has enough\n" "power to easily drag a boulder weighing\n" "more than a ton."); -const u8 DexDescription_Swampert_2[] = _( +static const u8 DexDescription_Swampert_2[] = _( "This POKéMON also has powerful vision\n" "that lets it see even in murky water."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Poochyena_1[] = _( +static const u8 DexDescription_Poochyena_1[] = _( "POOCHYENA is an omnivore - it will eat\n" "anything. A distinguishing feature is\n" "how large its fangs are compared to"); -const u8 DexDescription_Poochyena_2[] = _( +static const u8 DexDescription_Poochyena_2[] = _( "its body. This POKéMON tries to\n" "intimidate its foes by making the hair\n" "on its tail bristle out."); #else -const u8 DexDescription_Poochyena_1[] = _( +static const u8 DexDescription_Poochyena_1[] = _( "At first sight, POOCHYENA takes a bite\n" "at anything that moves.\n" "This POKéMON chases after prey until"); -const u8 DexDescription_Poochyena_2[] = _( +static const u8 DexDescription_Poochyena_2[] = _( "the victim becomes exhausted.\n" "However, it may turn tail if the prey\n" "strikes back."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Mightyena_1[] = _( +static const u8 DexDescription_Mightyena_1[] = _( "MIGHTYENA travel and act as a pack\n" "in the wild. The memory of its life in the\n" "wild compels the POKéMON to obey only"); -const u8 DexDescription_Mightyena_2[] = _( +static const u8 DexDescription_Mightyena_2[] = _( "those TRAINERS that it recognizes to\n" "possess superior skill."); #else -const u8 DexDescription_Mightyena_1[] = _( +static const u8 DexDescription_Mightyena_1[] = _( "MIGHTYENA gives obvious signals when\n" "it is preparing to attack. It starts to\n" "growl deeply and then flattens its body."); -const u8 DexDescription_Mightyena_2[] = _( +static const u8 DexDescription_Mightyena_2[] = _( "This POKéMON will bite savagely with its\n" "sharply pointed fangs."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Zigzagoon_1[] = _( +static const u8 DexDescription_Zigzagoon_1[] = _( "The hair on ZIGZAGOON’s back is \n" "bristly. It rubs the hard back hair\n" "against trees to leave its territorial"); -const u8 DexDescription_Zigzagoon_2[] = _( +static const u8 DexDescription_Zigzagoon_2[] = _( "markings.\n" "This POKéMON may play dead to fool foes\n" "in battle."); #else -const u8 DexDescription_Zigzagoon_1[] = _( +static const u8 DexDescription_Zigzagoon_1[] = _( "ZIGZAGOON restlessly wanders\n" "everywhere at all times. This POKéMON\n" "does so because it is very curious."); -const u8 DexDescription_Zigzagoon_2[] = _( +static const u8 DexDescription_Zigzagoon_2[] = _( "It becomes interested in anything\n" "that it happens to see."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Linoone_1[] = _( +static const u8 DexDescription_Linoone_1[] = _( "When hunting, LINOONE will make a\n" "beeline straight for the prey at a full\n" "run. While this POKéMON is capable of"); -const u8 DexDescription_Linoone_2[] = _( +static const u8 DexDescription_Linoone_2[] = _( "topping 60 mph, it has to come to a\n" "screeching halt before it can turn."); #else -const u8 DexDescription_Linoone_1[] = _( +static const u8 DexDescription_Linoone_1[] = _( "LINOONE always runs full speed and only\n" "in straight lines. If facing an obstacle,\n" "it makes a right-angle turn to evade it."); -const u8 DexDescription_Linoone_2[] = _( +static const u8 DexDescription_Linoone_2[] = _( "This POKéMON is very challenged by\n" "gently curving roads."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Wurmple_1[] = _( +static const u8 DexDescription_Wurmple_1[] = _( "WURMPLE is targeted by SWELLOW as\n" "prey. This POKéMON will try to resist by\n" "pointing the spikes on its rear at the"); -const u8 DexDescription_Wurmple_2[] = _( +static const u8 DexDescription_Wurmple_2[] = _( "attacking predator.\n" "It will weaken the foe by leaking poison\n" "from the spikes."); #else -const u8 DexDescription_Wurmple_1[] = _( +static const u8 DexDescription_Wurmple_1[] = _( "Using the spikes on its rear end, \n" "WURMPLE peels the bark off trees and\n" "feeds on the sap that oozes out."); -const u8 DexDescription_Wurmple_2[] = _( +static const u8 DexDescription_Wurmple_2[] = _( "This POKéMON’s feet are tipped with\n" "suction pads that allow it to cling to\n" "glass without slipping."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Silcoon_1[] = _( +static const u8 DexDescription_Silcoon_1[] = _( "SILCOON was thought to endure hunger\n" "and not consume anything before its\n" "evolution. However, it is now thought"); -const u8 DexDescription_Silcoon_2[] = _( +static const u8 DexDescription_Silcoon_2[] = _( "that this POKéMON slakes its thirst by\n" "drinking rainwater that collects on its\n" "silk."); #else -const u8 DexDescription_Silcoon_1[] = _( +static const u8 DexDescription_Silcoon_1[] = _( "SILCOON tethers itself to a tree branch\n" "using silk to keep from falling. There, \n" "this POKéMON hangs quietly while it"); -const u8 DexDescription_Silcoon_2[] = _( +static const u8 DexDescription_Silcoon_2[] = _( "awaits evolution.\n" "It peers out of the silk cocoon through\n" "a small hole."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Beautifly_1[] = _( +static const u8 DexDescription_Beautifly_1[] = _( "BEAUTIFLY has a long mouth like a coiled\n" "needle, which is very convenient for\n" "collecting pollen from flowers."); -const u8 DexDescription_Beautifly_2[] = _( +static const u8 DexDescription_Beautifly_2[] = _( "This POKéMON rides the spring winds as\n" "it flits around gathering pollen."); #else -const u8 DexDescription_Beautifly_1[] = _( +static const u8 DexDescription_Beautifly_1[] = _( "BEAUTIFLY’s favorite food is the sweet\n" "pollen of flowers. If you want to see\n" "this POKéMON, just leave a potted"); -const u8 DexDescription_Beautifly_2[] = _( +static const u8 DexDescription_Beautifly_2[] = _( "flower by an open window. BEAUTIFLY\n" "is sure to come looking for pollen."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Cascoon_1[] = _( +static const u8 DexDescription_Cascoon_1[] = _( "If it is attacked, CASCOON remains\n" "motionless however badly it may be\n" "hurt. It does so because if it were to"); -const u8 DexDescription_Cascoon_2[] = _( +static const u8 DexDescription_Cascoon_2[] = _( "move, its body would be weak upon\n" "evolution. This POKéMON will also not\n" "forget the pain it endured."); #else -const u8 DexDescription_Cascoon_1[] = _( +static const u8 DexDescription_Cascoon_1[] = _( "CASCOON makes its protective cocoon\n" "by wrapping its body entirely with a\n" "fine silk from its mouth. Once the silk"); -const u8 DexDescription_Cascoon_2[] = _( +static const u8 DexDescription_Cascoon_2[] = _( "goes around its body, it hardens.\n" "This POKéMON prepares for its evolution\n" "inside the cocoon."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Dustox_1[] = _( +static const u8 DexDescription_Dustox_1[] = _( "When DUSTOX flaps its wings, a fine\n" "dust is scattered all over. This dust is\n" "actually a powerful poison that will"); -const u8 DexDescription_Dustox_2[] = _( +static const u8 DexDescription_Dustox_2[] = _( "even make a pro wrestler sick.\n" "This POKéMON searches for food using\n" "its antennae like radar."); #else -const u8 DexDescription_Dustox_1[] = _( +static const u8 DexDescription_Dustox_1[] = _( "DUSTOX is instinctively drawn to light.\n" "Swarms of this POKéMON are attracted\n" "by the bright lights of cities, where"); -const u8 DexDescription_Dustox_2[] = _( +static const u8 DexDescription_Dustox_2[] = _( "they wreak havoc by stripping the\n" "leaves off roadside trees for food."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Lotad_1[] = _( +static const u8 DexDescription_Lotad_1[] = _( "LOTAD is said to have dwelled on land\n" "before. However, this POKéMON is\n" "thought to have returned to water"); -const u8 DexDescription_Lotad_2[] = _( +static const u8 DexDescription_Lotad_2[] = _( "because the leaf on its head grew large\n" "and heavy. It now lives by floating\n" "atop the water."); #else -const u8 DexDescription_Lotad_1[] = _( +static const u8 DexDescription_Lotad_1[] = _( "LOTAD live in ponds and lakes, where\n" "they float on the surface.\n" "It grows weak if its broad leaf dies."); -const u8 DexDescription_Lotad_2[] = _( +static const u8 DexDescription_Lotad_2[] = _( "On rare occasions, this POKéMON travels\n" "on land in search of clean water."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Lombre_1[] = _( +static const u8 DexDescription_Lombre_1[] = _( "LOMBRE’s entire body is covered by a\n" "slippery, slimy film. It feels horribly\n" "unpleasant to be touched by this"); -const u8 DexDescription_Lombre_2[] = _( +static const u8 DexDescription_Lombre_2[] = _( "POKéMON’s hands.\n" "LOMBRE is often mistaken for a human\n" "child."); #else -const u8 DexDescription_Lombre_1[] = _( +static const u8 DexDescription_Lombre_1[] = _( "LOMBRE is nocturnal - it will get active\n" "after dusk. It is also a mischief-maker.\n" "When this POKéMON spots anglers,"); -const u8 DexDescription_Lombre_2[] = _( +static const u8 DexDescription_Lombre_2[] = _( "it tugs on their fishing lines from\n" "beneath the surface and enjoys their\n" "consternation."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Ludicolo_1[] = _( +static const u8 DexDescription_Ludicolo_1[] = _( "Upon hearing an upbeat and cheerful\n" "rhythm, the cells in LUDICOLO’s body\n" "become very energetic and active."); -const u8 DexDescription_Ludicolo_2[] = _( +static const u8 DexDescription_Ludicolo_2[] = _( "Even in battle, this POKéMON will\n" "exhibit an amazing amount of power."); #else -const u8 DexDescription_Ludicolo_1[] = _( +static const u8 DexDescription_Ludicolo_1[] = _( "LUDICOLO begins dancing as soon as\n" "it hears cheerful, festive music.\n" "This POKéMON is said to appear when it"); -const u8 DexDescription_Ludicolo_2[] = _( +static const u8 DexDescription_Ludicolo_2[] = _( "hears the singing of children on hiking\n" "outings."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Seedot_1[] = _( +static const u8 DexDescription_Seedot_1[] = _( "SEEDOT looks exactly like an acorn\n" "when it is dangling from a tree branch.\n" "It startles other POKéMON by suddenly"); -const u8 DexDescription_Seedot_2[] = _( +static const u8 DexDescription_Seedot_2[] = _( "moving.\n" "This POKéMON polishes its body once a\n" "day using leaves."); #else -const u8 DexDescription_Seedot_1[] = _( +static const u8 DexDescription_Seedot_1[] = _( "SEEDOT attaches itself to a tree\n" "branch using the top of its head.\n" "It sucks moisture from the tree while"); -const u8 DexDescription_Seedot_2[] = _( +static const u8 DexDescription_Seedot_2[] = _( "hanging off the branch.\n" "The more water it drinks, the glossier\n" "this POKéMON’s body becomes."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Nuzleaf_1[] = _( +static const u8 DexDescription_Nuzleaf_1[] = _( "This POKéMON pulls out the leaf on its\n" "head and makes a flute with it.\n" "The sound of NUZLEAF’s flute strikes"); -const u8 DexDescription_Nuzleaf_2[] = _( +static const u8 DexDescription_Nuzleaf_2[] = _( "fear and uncertainty in the hearts of\n" "people lost in a forest."); #else -const u8 DexDescription_Nuzleaf_1[] = _( +static const u8 DexDescription_Nuzleaf_1[] = _( "NUZLEAF live in densely overgrown\n" "forests. They occasionally venture out\n" "of the forest to startle people."); -const u8 DexDescription_Nuzleaf_2[] = _( +static const u8 DexDescription_Nuzleaf_2[] = _( "This POKéMON dislikes having its long\n" "nose pinched."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Shiftry_1[] = _( +static const u8 DexDescription_Shiftry_1[] = _( "SHIFTRY’s large fans generate awesome\n" "gusts of wind at a speed close to 100\n" "feet per second. The whipped-up wind"); -const u8 DexDescription_Shiftry_2[] = _( +static const u8 DexDescription_Shiftry_2[] = _( "blows anything away.\n" "This POKéMON chooses to live quietly\n" "deep in forests."); #else -const u8 DexDescription_Shiftry_1[] = _( +static const u8 DexDescription_Shiftry_1[] = _( "SHIFTRY is a mysterious POKéMON that\n" "is said to live atop towering trees \n" "dating back over a thousand years."); -const u8 DexDescription_Shiftry_2[] = _( +static const u8 DexDescription_Shiftry_2[] = _( "It creates terrific windstorms with\n" "the fans it holds."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Taillow_1[] = _( +static const u8 DexDescription_Taillow_1[] = _( "TAILLOW is young - it has only just\n" "left its nest. As a result, it sometimes\n" "becomes lonesome and cries at night."); -const u8 DexDescription_Taillow_2[] = _( +static const u8 DexDescription_Taillow_2[] = _( "This POKéMON feeds on WURMPLE that\n" "live in forests."); #else -const u8 DexDescription_Taillow_1[] = _( +static const u8 DexDescription_Taillow_1[] = _( "TAILLOW courageously stands its\n" "ground against foes, however strong\n" "they may be."); -const u8 DexDescription_Taillow_2[] = _( +static const u8 DexDescription_Taillow_2[] = _( "This gutsy POKéMON will remain defiant\n" "even after a loss. On the other hand,\n" "it cries loudly if it becomes hungry."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Swellow_1[] = _( +static const u8 DexDescription_Swellow_1[] = _( "SWELLOW is very conscientious about\n" "the upkeep of its glossy wings.\n" "Once two SWELLOW are gathered, they"); -const u8 DexDescription_Swellow_2[] = _( +static const u8 DexDescription_Swellow_2[] = _( "diligently take care of cleaning each\n" "other’s wings."); #else -const u8 DexDescription_Swellow_1[] = _( +static const u8 DexDescription_Swellow_1[] = _( "SWELLOW flies high above our heads,\n" "making graceful arcs in the sky.\n" "This POKéMON dives at a steep angle as"); -const u8 DexDescription_Swellow_2[] = _( +static const u8 DexDescription_Swellow_2[] = _( "soon as it spots its prey. The hapless\n" "prey is tightly grasped by SWELLOW’s\n" "clawed feet, preventing escape."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Wingull_1[] = _( +static const u8 DexDescription_Wingull_1[] = _( "WINGULL rides updrafts rising from the\n" "sea by extending its long and narrow\n" "wings to glide."); -const u8 DexDescription_Wingull_2[] = _( +static const u8 DexDescription_Wingull_2[] = _( "This POKéMON’s long beak is useful for\n" "catching prey."); #else -const u8 DexDescription_Wingull_1[] = _( +static const u8 DexDescription_Wingull_1[] = _( "WINGULL has the habit of carrying prey\n" "and valuables in its beak and hiding\n" "them in all sorts of locations."); -const u8 DexDescription_Wingull_2[] = _( +static const u8 DexDescription_Wingull_2[] = _( "This POKéMON rides the winds and flies\n" "as if it were skating across the sky."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Pelipper_1[] = _( +static const u8 DexDescription_Pelipper_1[] = _( "PELIPPER searches for food while in\n" "flight by skimming the wave tops.\n" "This POKéMON dips its large bill in the"); -const u8 DexDescription_Pelipper_2[] = _( +static const u8 DexDescription_Pelipper_2[] = _( "sea to scoop up food, then swallows\n" "everything in one big gulp."); #else -const u8 DexDescription_Pelipper_1[] = _( +static const u8 DexDescription_Pelipper_1[] = _( "PELIPPER is a flying transporter that\n" "carries small POKéMON and eggs inside\n" "its massive bill."); -const u8 DexDescription_Pelipper_2[] = _( +static const u8 DexDescription_Pelipper_2[] = _( "This POKéMON builds its nest on steep\n" "cliffs facing the sea."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Ralts_1[] = _( +static const u8 DexDescription_Ralts_1[] = _( "RALTS has the ability to sense the\n" "emotions of people.\n" "If its TRAINER is in a cheerful mood,"); -const u8 DexDescription_Ralts_2[] = _( +static const u8 DexDescription_Ralts_2[] = _( "this POKéMON grows cheerful and joyous\n" "in the same way."); #else -const u8 DexDescription_Ralts_1[] = _( +static const u8 DexDescription_Ralts_1[] = _( "RALTS senses the emotions of\n" "people using the horns on its head.\n" "This POKéMON rarely appears before"); -const u8 DexDescription_Ralts_2[] = _( +static const u8 DexDescription_Ralts_2[] = _( "people. But when it does, it draws\n" "closer if it senses that the person has\n" "a positive disposition."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Kirlia_1[] = _( +static const u8 DexDescription_Kirlia_1[] = _( "KIRLIA uses the horns on its head\n" "to amplify its psychokinetic power.\n" "When the POKéMON uses its power,"); -const u8 DexDescription_Kirlia_2[] = _( +static const u8 DexDescription_Kirlia_2[] = _( "the air around it becomes distorted,\n" "creating mirages of nonexistent\n" "scenery."); #else -const u8 DexDescription_Kirlia_1[] = _( +static const u8 DexDescription_Kirlia_1[] = _( "It is said that a KIRLIA that is\n" "exposed to the positive emotions of\n" "its TRAINER grows beautiful."); -const u8 DexDescription_Kirlia_2[] = _( +static const u8 DexDescription_Kirlia_2[] = _( "This POKéMON controls psychokinetic\n" "powers with its highly developed brain."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Gardevoir_1[] = _( +static const u8 DexDescription_Gardevoir_1[] = _( "GARDEVOIR has the psychokinetic\n" "power to distort the dimensions and\n" "create a small black hole."); -const u8 DexDescription_Gardevoir_2[] = _( +static const u8 DexDescription_Gardevoir_2[] = _( "This POKéMON will try to protect its\n" "TRAINER even at the risk of its own\n" "life."); #else -const u8 DexDescription_Gardevoir_1[] = _( +static const u8 DexDescription_Gardevoir_1[] = _( "GARDEVOIR has the ability to read the\n" "future. If it senses impending danger\n" "to its TRAINER, this POKéMON is said to"); -const u8 DexDescription_Gardevoir_2[] = _( +static const u8 DexDescription_Gardevoir_2[] = _( "unleash its psychokinetic energy at\n" "full power."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Surskit_1[] = _( +static const u8 DexDescription_Surskit_1[] = _( "If SURSKIT senses danger, it secretes\n" "a thick, sugary syrup from the tip of\n" "its head."); -const u8 DexDescription_Surskit_2[] = _( +static const u8 DexDescription_Surskit_2[] = _( "There are some POKéMON that love\n" "eating this syrup."); #else -const u8 DexDescription_Surskit_1[] = _( +static const u8 DexDescription_Surskit_1[] = _( "From the tips of its feet, SURSKIT\n" "secretes an oil that enables it to walk\n" "on water as if it were skating."); -const u8 DexDescription_Surskit_2[] = _( +static const u8 DexDescription_Surskit_2[] = _( "This POKéMON feeds on microscopic\n" "organisms in ponds and lakes."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Masquerain_1[] = _( +static const u8 DexDescription_Masquerain_1[] = _( "MASQUERAIN’s antennas have eyelike\n" "patterns that usually give it an angry\n" "look. If the “eyes†are droopy and"); -const u8 DexDescription_Masquerain_2[] = _( +static const u8 DexDescription_Masquerain_2[] = _( "appear sad, it is said to be a sign\n" "that a heavy rainfall is on its way."); #else -const u8 DexDescription_Masquerain_1[] = _( +static const u8 DexDescription_Masquerain_1[] = _( "MASQUERAIN intimidates enemies with\n" "the eyelike patterns on its antennas.\n" "This POKéMON flaps its four wings to"); -const u8 DexDescription_Masquerain_2[] = _( +static const u8 DexDescription_Masquerain_2[] = _( "freely fly in any direction - even\n" "sideways and backwards - as if it were\n" "a helicopter."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Shroomish_1[] = _( +static const u8 DexDescription_Shroomish_1[] = _( "If SHROOMISH senses danger, it shakes\n" "its body and scatters spores from the\n" "top of its head."); -const u8 DexDescription_Shroomish_2[] = _( +static const u8 DexDescription_Shroomish_2[] = _( "This POKéMON’s spores are so toxic,\n" "they make trees and weeds wilt."); #else -const u8 DexDescription_Shroomish_1[] = _( +static const u8 DexDescription_Shroomish_1[] = _( "SHROOMISH live in damp soil in the dark\n" "depths of forests. They are often\n" "found keeping still under fallen leaves."); -const u8 DexDescription_Shroomish_2[] = _( +static const u8 DexDescription_Shroomish_2[] = _( "This POKéMON feeds on compost that\n" "is made up of fallen, rotted leaves."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Breloom_1[] = _( +static const u8 DexDescription_Breloom_1[] = _( "The seeds ringing BRELOOM’s tail are\n" "made of hardened toxic spores. It is\n" "horrible to eat the seeds."); -const u8 DexDescription_Breloom_2[] = _( +static const u8 DexDescription_Breloom_2[] = _( "Just taking a bite of this POKéMON’s\n" "seed will cause your stomach to rumble."); #else -const u8 DexDescription_Breloom_1[] = _( +static const u8 DexDescription_Breloom_1[] = _( "BRELOOM closes in on its foe with light\n" "and sprightly footwork, then throws\n" "punches with its stretchy arms."); -const u8 DexDescription_Breloom_2[] = _( +static const u8 DexDescription_Breloom_2[] = _( "This POKéMON’s fighting technique puts\n" "boxers to shame."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Slakoth_1[] = _( +static const u8 DexDescription_Slakoth_1[] = _( "SLAKOTH’s heart beats just once a\n" "minute. Whatever happens, it is\n" "content to loaf around motionless."); -const u8 DexDescription_Slakoth_2[] = _( +static const u8 DexDescription_Slakoth_2[] = _( "It is rare to see this POKéMON in\n" "motion."); #else -const u8 DexDescription_Slakoth_1[] = _( +static const u8 DexDescription_Slakoth_1[] = _( "SLAKOTH lolls around for over twenty\n" "hours every day. Because it moves so\n" "little, it does not need much food."); -const u8 DexDescription_Slakoth_2[] = _( +static const u8 DexDescription_Slakoth_2[] = _( "This POKéMON’s sole daily meal consists\n" "of just three leaves."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Vigoroth_1[] = _( +static const u8 DexDescription_Vigoroth_1[] = _( "VIGOROTH is simply incapable of\n" "remaining still. Even when it tries to\n" "sleep, the blood in its veins grows"); -const u8 DexDescription_Vigoroth_2[] = _( +static const u8 DexDescription_Vigoroth_2[] = _( "agitated, compelling this POKéMON to\n" "run wild throughout the jungle before\n" "it can settle down."); #else -const u8 DexDescription_Vigoroth_1[] = _( +static const u8 DexDescription_Vigoroth_1[] = _( "VIGOROTH is always itching and agitated\n" "to go on a wild rampage. It simply can’t\n" "tolerate sitting still for even a minute."); -const u8 DexDescription_Vigoroth_2[] = _( +static const u8 DexDescription_Vigoroth_2[] = _( "This POKéMON’s stress level rises if it\n" "can’t be moving constantly."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Slaking_1[] = _( +static const u8 DexDescription_Slaking_1[] = _( "Wherever SLAKING live, rings of over\n" "a yard in diameter appear in grassy\n" "fields. They are made by the POKéMON"); -const u8 DexDescription_Slaking_2[] = _( +static const u8 DexDescription_Slaking_2[] = _( "as it eats all the grass within reach\n" "while lying prone on the ground."); #else -const u8 DexDescription_Slaking_1[] = _( +static const u8 DexDescription_Slaking_1[] = _( "SLAKING spends all day lying down and\n" "lolling about.\n" "It eats grass growing within its reach."); -const u8 DexDescription_Slaking_2[] = _( +static const u8 DexDescription_Slaking_2[] = _( "If it eats all the grass it can reach,\n" "this POKéMON reluctantly moves to\n" "another spot."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Nincada_1[] = _( +static const u8 DexDescription_Nincada_1[] = _( "NINCADA lives underground. It uses its\n" "sharp claws to carve the roots of trees\n" "and absorb moisture and nutrients."); -const u8 DexDescription_Nincada_2[] = _( +static const u8 DexDescription_Nincada_2[] = _( "This POKéMON can’t withstand bright\n" "sunlight so avoids it."); #else -const u8 DexDescription_Nincada_1[] = _( +static const u8 DexDescription_Nincada_1[] = _( "NINCADA lives underground for many\n" "years in complete darkness.\n" "This POKéMON absorbs nutrients from"); -const u8 DexDescription_Nincada_2[] = _( +static const u8 DexDescription_Nincada_2[] = _( "the roots of trees. It stays motionless\n" "as it waits for evolution."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Ninjask_1[] = _( +static const u8 DexDescription_Ninjask_1[] = _( "If NINJASK is not trained properly,\n" "it will refuse to obey the TRAINER and\n" "cry loudly continuously."); -const u8 DexDescription_Ninjask_2[] = _( +static const u8 DexDescription_Ninjask_2[] = _( "Because of this quality, this POKéMON\n" "is said to be one that puts the\n" "TRAINER’s abilities to the test."); #else -const u8 DexDescription_Ninjask_1[] = _( +static const u8 DexDescription_Ninjask_1[] = _( "NINJASK moves around at such a high\n" "speed that it cannot be seen, even\n" "while its crying can be clearly heard."); -const u8 DexDescription_Ninjask_2[] = _( +static const u8 DexDescription_Ninjask_2[] = _( "For that reason, this POKéMON was long\n" "believed to be invisible."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Shedinja_1[] = _( +static const u8 DexDescription_Shedinja_1[] = _( "SHEDINJA is a peculiar POKéMON.\n" "It seems to appear unsought in a POKé\n" "BALL after a NINCADA evolves."); -const u8 DexDescription_Shedinja_2[] = _( +static const u8 DexDescription_Shedinja_2[] = _( "This bizarre POKéMON is entirely\n" "immobile - it doesn’t even breathe."); #else -const u8 DexDescription_Shedinja_1[] = _( +static const u8 DexDescription_Shedinja_1[] = _( "SHEDINJA’s hard body doesn’t move -\n" "not even a twitch. In fact, its body\n" "appears to be merely a hollow shell."); -const u8 DexDescription_Shedinja_2[] = _( +static const u8 DexDescription_Shedinja_2[] = _( "It is believed that this POKéMON will\n" "steal the spirit of anyone peering into\n" "its hollow body from its back."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Whismur_1[] = _( +static const u8 DexDescription_Whismur_1[] = _( "WHISMUR is very timid. If it starts to\n" "cry loudly, it becomes startled by its\n" "own crying and cries even harder."); -const u8 DexDescription_Whismur_2[] = _( +static const u8 DexDescription_Whismur_2[] = _( "When it finally stops crying, the\n" "POKéMON goes to sleep, all tired out."); #else -const u8 DexDescription_Whismur_1[] = _( +static const u8 DexDescription_Whismur_1[] = _( "Normally, WHISMUR’s voice is very quiet -\n" "it is barely audible even if one is\n" "paying close attention."); -const u8 DexDescription_Whismur_2[] = _( +static const u8 DexDescription_Whismur_2[] = _( "However, if this POKéMON senses danger,\n" "it starts crying at an earsplitting\n" "volume."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Loudred_1[] = _( +static const u8 DexDescription_Loudred_1[] = _( "LOUDRED shouts while stamping its feet.\n" "After it finishes shouting, this\n" "POKéMON becomes incapable of hearing"); -const u8 DexDescription_Loudred_2[] = _( +static const u8 DexDescription_Loudred_2[] = _( "anything for a while. This is considered\n" "to be a weak point."); #else -const u8 DexDescription_Loudred_1[] = _( +static const u8 DexDescription_Loudred_1[] = _( "LOUDRED’s bellowing can completely\n" "decimate a wood-frame house. It uses\n" "its voice to punish its foes."); -const u8 DexDescription_Loudred_2[] = _( +static const u8 DexDescription_Loudred_2[] = _( "This POKéMON’s round ears serve as\n" "loudspeakers."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Exploud_1[] = _( +static const u8 DexDescription_Exploud_1[] = _( "EXPLOUD communicates its feelings to\n" "the others by emitting whistle-like\n" "sounds from the tubes on its body."); -const u8 DexDescription_Exploud_2[] = _( +static const u8 DexDescription_Exploud_2[] = _( "This POKéMON only raises its voice when\n" "it is in battle."); #else -const u8 DexDescription_Exploud_1[] = _( +static const u8 DexDescription_Exploud_1[] = _( "EXPLOUD triggers earthquakes with the\n" "tremors it creates by bellowing. If this\n" "POKéMON violently inhales from the"); -const u8 DexDescription_Exploud_2[] = _( +static const u8 DexDescription_Exploud_2[] = _( "ports on its body, it’s a sign that it is\n" "preparing to let loose a huge bellow."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Makuhita_1[] = _( +static const u8 DexDescription_Makuhita_1[] = _( "MAKUHITA has a tireless spirit -\n" "it will never give up hope. It eats a lot\n" "of food, gets plenty of sleep, and it"); -const u8 DexDescription_Makuhita_2[] = _( +static const u8 DexDescription_Makuhita_2[] = _( "trains very rigorously. By living that\n" "way, this POKéMON packs its body with\n" "energy."); #else -const u8 DexDescription_Makuhita_1[] = _( +static const u8 DexDescription_Makuhita_1[] = _( "MAKUHITA is tenacious - it will keep\n" "getting up and attacking its foe\n" "however many times it is knocked down."); -const u8 DexDescription_Makuhita_2[] = _( +static const u8 DexDescription_Makuhita_2[] = _( "Every time it gets back up, this\n" "POKéMON stores more energy in its body\n" "for evolving."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Hariyama_1[] = _( +static const u8 DexDescription_Hariyama_1[] = _( "HARIYAMA’s thick body may appear fat,\n" "but it is actually a hunk of solid muscle.\n" "If this POKéMON bears down and"); -const u8 DexDescription_Hariyama_2[] = _( +static const u8 DexDescription_Hariyama_2[] = _( "tightens all its muscles, its body\n" "becomes as hard as a rock."); #else -const u8 DexDescription_Hariyama_1[] = _( +static const u8 DexDescription_Hariyama_1[] = _( "HARIYAMA practices its straight-arm\n" "slaps in any number of locations.\n" "One hit of this POKéMON’s powerful,"); -const u8 DexDescription_Hariyama_2[] = _( +static const u8 DexDescription_Hariyama_2[] = _( "openhanded, straight-arm punches\n" "could snap a telephone pole in two."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Azurill_1[] = _( +static const u8 DexDescription_Azurill_1[] = _( "AZURILL’s tail is large and bouncy.\n" "It is packed full of the nutrients this\n" "POKéMON needs to grow."); -const u8 DexDescription_Azurill_2[] = _( +static const u8 DexDescription_Azurill_2[] = _( "AZURILL can be seen bouncing and\n" "playing on its big, rubbery tail."); #else -const u8 DexDescription_Azurill_1[] = _( +static const u8 DexDescription_Azurill_1[] = _( "AZURILL spins its tail as if it were a\n" "lasso, then hurls it far. The momentum\n" "of the throw sends its body flying, too."); -const u8 DexDescription_Azurill_2[] = _( +static const u8 DexDescription_Azurill_2[] = _( "Using this unique action, one of these\n" "POKéMON managed to hurl itself a record\n" "33 feet."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Nosepass_1[] = _( +static const u8 DexDescription_Nosepass_1[] = _( "NOSEPASS had been said to be completely\n" "unmoving, with its magnetic nose\n" "pointed due north."); -const u8 DexDescription_Nosepass_2[] = _( +static const u8 DexDescription_Nosepass_2[] = _( "However, close observation has revealed\n" "that the POKéMON actually moves by a\n" "little over 3/8 of an inch every year."); #else -const u8 DexDescription_Nosepass_1[] = _( +static const u8 DexDescription_Nosepass_1[] = _( "NOSEPASS’s magnetic nose is always\n" "pointed to the north. If two of these\n" "POKéMON meet, they cannot turn"); -const u8 DexDescription_Nosepass_2[] = _( +static const u8 DexDescription_Nosepass_2[] = _( "their faces to each other when they\n" "are close because their magnetic noses\n" "repel one another."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Skitty_1[] = _( +static const u8 DexDescription_Skitty_1[] = _( "SKITTY is known to chase around\n" "playfully after its own tail. In the wild,\n" "this POKéMON lives in holes in the trees"); -const u8 DexDescription_Skitty_2[] = _( +static const u8 DexDescription_Skitty_2[] = _( "of forests. It is very popular as a pet\n" "because of its adorable looks."); #else -const u8 DexDescription_Skitty_1[] = _( +static const u8 DexDescription_Skitty_1[] = _( "SKITTY has the habit of becoming\n" "fascinated by moving objects and\n" "chasing them around."); -const u8 DexDescription_Skitty_2[] = _( +static const u8 DexDescription_Skitty_2[] = _( "This POKéMON is known to chase after\n" "its own tail and become dizzy."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Delcatty_1[] = _( +static const u8 DexDescription_Delcatty_1[] = _( "DELCATTY sleeps anywhere it wants\n" "without keeping a permanent nest.\n" "If other POKéMON approach it as it"); -const u8 DexDescription_Delcatty_2[] = _( +static const u8 DexDescription_Delcatty_2[] = _( "sleeps, this POKéMON will never fight -\n" "it will just move away somewhere else."); #else -const u8 DexDescription_Delcatty_1[] = _( +static const u8 DexDescription_Delcatty_1[] = _( "DELCATTY prefers to live an unfettered\n" "existence in which it can do as it\n" "pleases at its own pace."); -const u8 DexDescription_Delcatty_2[] = _( +static const u8 DexDescription_Delcatty_2[] = _( "Because this POKéMON eats and sleeps\n" "whenever it decides, its daily routines\n" "are completely random."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Sableye_1[] = _( +static const u8 DexDescription_Sableye_1[] = _( "SABLEYE digs the ground with sharpened\n" "claws to find rocks that it eats.\n" "Substances in the eaten rocks"); -const u8 DexDescription_Sableye_2[] = _( +static const u8 DexDescription_Sableye_2[] = _( "crystallize and rise up to the POKéMON’s\n" "body surface."); #else -const u8 DexDescription_Sableye_1[] = _( +static const u8 DexDescription_Sableye_1[] = _( "SABLEYE lead quiet lives deep inside\n" "caverns. They are feared, however,\n" "because these POKéMON are thought to"); -const u8 DexDescription_Sableye_2[] = _( +static const u8 DexDescription_Sableye_2[] = _( "steal the spirits of people when their\n" "eyes burn with a sinister glow in the\n" "darkness."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Mawile_1[] = _( +static const u8 DexDescription_Mawile_1[] = _( "Don’t be taken in by this POKéMON’s\n" "cute face - it’s very dangerous. MAWILE\n" "fools the foe into letting down its"); -const u8 DexDescription_Mawile_2[] = _( +static const u8 DexDescription_Mawile_2[] = _( "guard, then chomps down with its\n" "massive jaws. The steel jaws are really\n" "horns that have been transformed."); #else #if REVISION >= 1 -const u8 DexDescription_Mawile_1[] = _( +static const u8 DexDescription_Mawile_1[] = _( "MAWILE’s huge jaws are actually steel\n" "horns that have been transformed.\n" "Its docile-looking face serves to lull"); -const u8 DexDescription_Mawile_2[] = _( +static const u8 DexDescription_Mawile_2[] = _( "its foe into letting down its guard.\n" "When the foe least expects it, MAWILE\n" // Correct spelling of MAWILE "chomps it with its gaping jaws."); #else -const u8 DexDescription_Mawile_1[] = _( +static const u8 DexDescription_Mawile_1[] = _( "MAWHILE’s huge jaws are actually steel\n" "horns that have been transformed.\n" "Its docile-looking face serves to lull"); -const u8 DexDescription_Mawile_2[] = _( +static const u8 DexDescription_Mawile_2[] = _( "its foe into letting down its guard.\n" "When the foe least expects it, MAWHILE\n" "chomps it with its gaping jaws."); @@ -3832,1564 +3832,1564 @@ const u8 DexDescription_Mawile_2[] = _( #endif #ifdef SAPPHIRE -const u8 DexDescription_Aron_1[] = _( +static const u8 DexDescription_Aron_1[] = _( "ARON has a body of steel.\n" "With one all-out charge, this POKéMON\n" "can demolish even a heavy dump truck."); -const u8 DexDescription_Aron_2[] = _( +static const u8 DexDescription_Aron_2[] = _( "The destroyed dump truck then becomes\n" "a handy meal for the POKéMON."); #else -const u8 DexDescription_Aron_1[] = _( +static const u8 DexDescription_Aron_1[] = _( "This POKéMON has a body of steel.\n" "To make its body, ARON feeds on\n" "iron ore that it digs from mountains."); -const u8 DexDescription_Aron_2[] = _( +static const u8 DexDescription_Aron_2[] = _( "Occasionally, it causes major trouble by\n" "eating bridges and rails."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Lairon_1[] = _( +static const u8 DexDescription_Lairon_1[] = _( "LAIRON feeds on iron contained in\n" "rocks and water. It makes its nest on\n" "mountains where iron ore is buried."); -const u8 DexDescription_Lairon_2[] = _( +static const u8 DexDescription_Lairon_2[] = _( "As a result, the POKéMON often clashes\n" "with humans mining the iron ore."); #else -const u8 DexDescription_Lairon_1[] = _( +static const u8 DexDescription_Lairon_1[] = _( "LAIRON tempers its steel body by\n" "drinking highly nutritious mineral\n" "springwater until it is bloated."); -const u8 DexDescription_Lairon_2[] = _( +static const u8 DexDescription_Lairon_2[] = _( "This POKéMON makes its nest close to\n" "springs of delicious water."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Aggron_1[] = _( +static const u8 DexDescription_Aggron_1[] = _( "AGGRON is surprisingly protective\n" "of its environment. If its mountain\n" "is ravaged by a landslide or a fire, this"); -const u8 DexDescription_Aggron_2[] = _( +static const u8 DexDescription_Aggron_2[] = _( "POKéMON will haul topsoil to the area,\n" "plant trees, and beautifully restore its\n" "own territory."); #else -const u8 DexDescription_Aggron_1[] = _( +static const u8 DexDescription_Aggron_1[] = _( "AGGRON claims an entire mountain as its\n" "own territory. It mercilessly beats up\n" "anything that violates its environment."); -const u8 DexDescription_Aggron_2[] = _( +static const u8 DexDescription_Aggron_2[] = _( "This POKéMON vigilantly patrols its\n" "territory at all times."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Meditite_1[] = _( +static const u8 DexDescription_Meditite_1[] = _( "MEDITITE heightens its inner energy\n" "through meditation. It survives on\n" "just one berry a day."); -const u8 DexDescription_Meditite_2[] = _( +static const u8 DexDescription_Meditite_2[] = _( "Minimal eating is another aspect of\n" "this POKéMON’s training."); #else -const u8 DexDescription_Meditite_1[] = _( +static const u8 DexDescription_Meditite_1[] = _( "MEDITITE undertakes rigorous mental\n" "training deep in the mountains.\n" "However, whenever it meditates, this"); -const u8 DexDescription_Meditite_2[] = _( +static const u8 DexDescription_Meditite_2[] = _( "POKéMON always loses its concentration\n" "and focus. As a result, its training\n" "never ends."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Medicham_1[] = _( +static const u8 DexDescription_Medicham_1[] = _( "Through the power of meditation,\n" "MEDICHAM developed its sixth sense.\n" "It gained the ability to use"); -const u8 DexDescription_Medicham_2[] = _( +static const u8 DexDescription_Medicham_2[] = _( "psychokinetic powers. This POKéMON is\n" "known to meditate for a whole month\n" "without eating."); #else -const u8 DexDescription_Medicham_1[] = _( +static const u8 DexDescription_Medicham_1[] = _( "It is said that through meditation,\n" "MEDICHAM heightens energy inside\n" "its body and sharpens its sixth sense."); -const u8 DexDescription_Medicham_2[] = _( +static const u8 DexDescription_Medicham_2[] = _( "This POKéMON hides its presence by\n" "merging itself with fields and\n" "mountains."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Electrike_1[] = _( +static const u8 DexDescription_Electrike_1[] = _( "ELECTRIKE runs faster than the human\n" "eye can follow. The friction from\n" "running is converted into electricity,"); -const u8 DexDescription_Electrike_2[] = _( +static const u8 DexDescription_Electrike_2[] = _( "which is then stored in this POKéMON’s\n" "fur."); #else -const u8 DexDescription_Electrike_1[] = _( +static const u8 DexDescription_Electrike_1[] = _( "ELECTRIKE stores electricity in its\n" "long body hair. This POKéMON stimulates\n" "its leg muscles with electric charges."); -const u8 DexDescription_Electrike_2[] = _( +static const u8 DexDescription_Electrike_2[] = _( "These jolts of power give its legs\n" "explosive acceleration performance."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Manectric_1[] = _( +static const u8 DexDescription_Manectric_1[] = _( "MANECTRIC discharges strong\n" "electricity from its mane. The mane is\n" "used for collecting electricity in the"); -const u8 DexDescription_Manectric_2[] = _( +static const u8 DexDescription_Manectric_2[] = _( "atmosphere. This POKéMON creates\n" "thunderclouds above its head."); #else -const u8 DexDescription_Manectric_1[] = _( +static const u8 DexDescription_Manectric_1[] = _( "MANECTRIC is constantly discharging\n" "electricity from its mane. The sparks\n" "sometimes ignite forest fires."); -const u8 DexDescription_Manectric_2[] = _( +static const u8 DexDescription_Manectric_2[] = _( "When it enters a battle, this POKéMON\n" "creates thunderclouds."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Plusle_1[] = _( +static const u8 DexDescription_Plusle_1[] = _( "When PLUSLE is cheering on its partner,\n" "it flashes with electric sparks from all\n" "over its body."); -const u8 DexDescription_Plusle_2[] = _( +static const u8 DexDescription_Plusle_2[] = _( "If its partner loses, this POKéMON cries\n" "loudly."); #else -const u8 DexDescription_Plusle_1[] = _( +static const u8 DexDescription_Plusle_1[] = _( "PLUSLE always acts as a cheerleader\n" "for its partners. Whenever a teammate\n" "puts out a good effort in battle, this"); -const u8 DexDescription_Plusle_2[] = _( +static const u8 DexDescription_Plusle_2[] = _( "POKéMON shorts out its body to create\n" "the crackling noises of sparks to show\n" "its joy."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Minun_1[] = _( +static const u8 DexDescription_Minun_1[] = _( "MINUN loves to cheer on its partner in\n" "battle. It gives off sparks from its\n" "body while it is doing so."); -const u8 DexDescription_Minun_2[] = _( +static const u8 DexDescription_Minun_2[] = _( "If its partner is in trouble, this\n" "POKéMON gives off increasing amounts\n" "of sparks."); #else -const u8 DexDescription_Minun_1[] = _( +static const u8 DexDescription_Minun_1[] = _( "MINUN is more concerned about cheering\n" "on its partners than its own safety.\n" "It shorts out the electricity in its"); -const u8 DexDescription_Minun_2[] = _( +static const u8 DexDescription_Minun_2[] = _( "body to create brilliant showers of\n" "sparks to cheer on its teammates."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Volbeat_1[] = _( +static const u8 DexDescription_Volbeat_1[] = _( "VOLBEAT’s tail glows like a lightbulb.\n" "With other VOLBEAT, it uses its tail to\n" "draw geometric shapes in the night sky."); -const u8 DexDescription_Volbeat_2[] = _( +static const u8 DexDescription_Volbeat_2[] = _( "This POKéMON loves the sweet aroma\n" "given off by ILLUMISE."); #else -const u8 DexDescription_Volbeat_1[] = _( +static const u8 DexDescription_Volbeat_1[] = _( "With the arrival of night, VOLBEAT emits\n" "light from its tail. It communicates with\n" "others by adjusting the intensity and"); -const u8 DexDescription_Volbeat_2[] = _( +static const u8 DexDescription_Volbeat_2[] = _( "flashing of its light.\n" "This POKéMON is attracted by the sweet\n" "aroma of ILLUMISE."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Illumise_1[] = _( +static const u8 DexDescription_Illumise_1[] = _( "ILLUMISE leads a flight of illuminated\n" "VOLBEAT to draw signs in the night sky.\n" "This POKéMON is said to earn greater"); -const u8 DexDescription_Illumise_2[] = _( +static const u8 DexDescription_Illumise_2[] = _( "respect from its peers by composing\n" "more complex designs in the sky."); #else -const u8 DexDescription_Illumise_1[] = _( +static const u8 DexDescription_Illumise_1[] = _( "ILLUMISE attracts a swarm of VOLBEAT\n" "using a sweet fragrance. Once the\n" "VOLBEAT have gathered, this POKéMON"); -const u8 DexDescription_Illumise_2[] = _( +static const u8 DexDescription_Illumise_2[] = _( "leads the lit-up swarm in drawing\n" "geometric designs on the canvas of\n" "the night sky."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Roselia_1[] = _( +static const u8 DexDescription_Roselia_1[] = _( "On extremely rare occasions, a ROSELIA\n" "is said to appear with its flowers in\n" "unusual colors."); -const u8 DexDescription_Roselia_2[] = _( +static const u8 DexDescription_Roselia_2[] = _( "The thorns on this POKéMON’s head\n" "contain a vicious poison."); #else -const u8 DexDescription_Roselia_1[] = _( +static const u8 DexDescription_Roselia_1[] = _( "ROSELIA shoots sharp thorns as\n" "projectiles at any opponent that tries\n" "to steal the flowers on its arms."); -const u8 DexDescription_Roselia_2[] = _( +static const u8 DexDescription_Roselia_2[] = _( "The aroma of this POKéMON brings\n" "serenity to living things."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Gulpin_1[] = _( +static const u8 DexDescription_Gulpin_1[] = _( "Most of GULPIN’s body is made up of its\n" "stomach - its heart and brain are very\n" "small in comparison."); -const u8 DexDescription_Gulpin_2[] = _( +static const u8 DexDescription_Gulpin_2[] = _( "This POKéMON’s stomach contains\n" "special enzymes that dissolve anything."); #else -const u8 DexDescription_Gulpin_1[] = _( +static const u8 DexDescription_Gulpin_1[] = _( "Virtually all of GULPIN’s body is its\n" "stomach. As a result, it can swallow\n" "something its own size."); -const u8 DexDescription_Gulpin_2[] = _( +static const u8 DexDescription_Gulpin_2[] = _( "This POKéMON’s stomach contains a\n" "special fluid that digests anything."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Swalot_1[] = _( +static const u8 DexDescription_Swalot_1[] = _( "SWALOT has no teeth, so what it\n" "eats, it swallows whole, no matter what.\n" "Its cavernous mouth yawns widely."); -const u8 DexDescription_Swalot_2[] = _( +static const u8 DexDescription_Swalot_2[] = _( "An automobile tire could easily fit\n" "inside this POKéMON’s mouth."); #else -const u8 DexDescription_Swalot_1[] = _( +static const u8 DexDescription_Swalot_1[] = _( "When SWALOT spots prey, it spurts out\n" "a hideously toxic fluid from its pores\n" "and sprays the target."); -const u8 DexDescription_Swalot_2[] = _( +static const u8 DexDescription_Swalot_2[] = _( "Once the prey has weakened, this\n" "POKéMON gulps it down whole with its\n" "cavernous mouth."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Carvanha_1[] = _( +static const u8 DexDescription_Carvanha_1[] = _( "If anything invades CARVANHA’s\n" "territory, it will swarm and tear at the\n" "intruder with its pointed fangs."); -const u8 DexDescription_Carvanha_2[] = _( +static const u8 DexDescription_Carvanha_2[] = _( "On its own, however, this POKéMON turns\n" "suddenly timid."); #else -const u8 DexDescription_Carvanha_1[] = _( +static const u8 DexDescription_Carvanha_1[] = _( "CARVANHA’s strongly developed jaws\n" "and its sharply pointed fangs pack the\n" "destructive power to rip out boat hulls."); -const u8 DexDescription_Carvanha_2[] = _( +static const u8 DexDescription_Carvanha_2[] = _( "Many boats have been attacked and\n" "sunk by this POKéMON."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Sharpedo_1[] = _( +static const u8 DexDescription_Sharpedo_1[] = _( "SHARPEDO can swim at speeds of up to\n" "75 mph by jetting seawater out of its\n" "backside."); -const u8 DexDescription_Sharpedo_2[] = _( +static const u8 DexDescription_Sharpedo_2[] = _( "This POKéMON’s drawback is its inability\n" "to swim long distances."); #else -const u8 DexDescription_Sharpedo_1[] = _( +static const u8 DexDescription_Sharpedo_1[] = _( "Nicknamed “the bully of the sea,â€\n" "SHARPEDO is widely feared.\n" "Its cruel fangs grow back immediately"); -const u8 DexDescription_Sharpedo_2[] = _( +static const u8 DexDescription_Sharpedo_2[] = _( "if they snap off.\n" "Just one of these POKéMON can\n" "thoroughly tear apart a supertanker."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Wailmer_1[] = _( +static const u8 DexDescription_Wailmer_1[] = _( "WAILMER can store water inside its body\n" "to transform itself into a ball for\n" "bouncing around on the ground."); -const u8 DexDescription_Wailmer_2[] = _( +static const u8 DexDescription_Wailmer_2[] = _( "By filling itself up with more water, this\n" "POKéMON can elevate the height of its\n" "bounces."); #else -const u8 DexDescription_Wailmer_1[] = _( +static const u8 DexDescription_Wailmer_1[] = _( "WAILMER’s nostrils are located above\n" "its eyes. This playful POKéMON loves\n" "to startle people by forcefully snorting"); -const u8 DexDescription_Wailmer_2[] = _( +static const u8 DexDescription_Wailmer_2[] = _( "out seawater it stores inside its body\n" "out of its nostrils."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Wailord_1[] = _( +static const u8 DexDescription_Wailord_1[] = _( "When chasing prey, WAILORD herds them\n" "by leaping out of the water and making\n" "a humongous splash."); -const u8 DexDescription_Wailord_2[] = _( +static const u8 DexDescription_Wailord_2[] = _( "It is breathtaking to see this POKéMON\n" "leaping out of the sea with others in\n" "its pod."); #else -const u8 DexDescription_Wailord_1[] = _( +static const u8 DexDescription_Wailord_1[] = _( "WAILORD is the largest of all identified\n" "POKéMON up to now.\n" "This giant POKéMON swims languorously"); -const u8 DexDescription_Wailord_2[] = _( +static const u8 DexDescription_Wailord_2[] = _( "in the vast open sea, eating massive\n" "amounts of food at once with its\n" "enormous mouth."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Numel_1[] = _( +static const u8 DexDescription_Numel_1[] = _( "NUMEL stores magma of almost 2,200\n" "degrees F within its body. If it gets\n" "wet, the magma cools and hardens."); -const u8 DexDescription_Numel_2[] = _( +static const u8 DexDescription_Numel_2[] = _( "In that event, the POKéMON’s body\n" "grows heavy and its movements become\n" "sluggish."); #else -const u8 DexDescription_Numel_1[] = _( +static const u8 DexDescription_Numel_1[] = _( "NUMEL is extremely dull witted - it\n" "doesn’t notice being hit. However, it\n" "can’t stand hunger for even a second."); -const u8 DexDescription_Numel_2[] = _( +static const u8 DexDescription_Numel_2[] = _( "This POKéMON’s body is a seething\n" "cauldron of boiling magma."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Camerupt_1[] = _( +static const u8 DexDescription_Camerupt_1[] = _( "The humps on CAMERUPT’s back are\n" "formed by a transformation of its\n" "bones. They sometimes blast out molten"); -const u8 DexDescription_Camerupt_2[] = _( +static const u8 DexDescription_Camerupt_2[] = _( "magma. This POKéMON apparently erupts\n" "often when it is enraged."); #else -const u8 DexDescription_Camerupt_1[] = _( +static const u8 DexDescription_Camerupt_1[] = _( "CAMERUPT has a volcano inside its body.\n" "Magma of 18,000 degrees F courses\n" "through its body."); -const u8 DexDescription_Camerupt_2[] = _( +static const u8 DexDescription_Camerupt_2[] = _( "Occasionally, the humps on this\n" "POKéMON’s back erupt, spewing the\n" "superheated magma."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Torkoal_1[] = _( +static const u8 DexDescription_Torkoal_1[] = _( "TORKOAL generates energy by burning\n" "coal. It grows weaker as the fire\n" "dies down."); -const u8 DexDescription_Torkoal_2[] = _( +static const u8 DexDescription_Torkoal_2[] = _( "When it is preparing for battle, this\n" "POKéMON burns more coal."); #else -const u8 DexDescription_Torkoal_1[] = _( +static const u8 DexDescription_Torkoal_1[] = _( "TORKOAL digs through mountains in\n" "search of coal. If it finds some, it fills\n" "hollow spaces on its shell with the coal"); -const u8 DexDescription_Torkoal_2[] = _( +static const u8 DexDescription_Torkoal_2[] = _( "and burns it.\n" "If it is attacked, this POKéMON spouts\n" "thick black smoke to beat a retreat."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Spoink_1[] = _( +static const u8 DexDescription_Spoink_1[] = _( "SPOINK keeps a pearl on top of its head.\n" "The pearl functions to amplify this\n" "POKéMON’s psychokinetic powers."); -const u8 DexDescription_Spoink_2[] = _( +static const u8 DexDescription_Spoink_2[] = _( "It is therefore on a constant search\n" "for a bigger pearl."); #else -const u8 DexDescription_Spoink_1[] = _( +static const u8 DexDescription_Spoink_1[] = _( "SPOINK bounces around on its tail.\n" "The shock of its bouncing makes its\n" "heart pump. As a result, this POKéMON"); -const u8 DexDescription_Spoink_2[] = _( +static const u8 DexDescription_Spoink_2[] = _( "cannot afford to stop bouncing - if it\n" "stops, its heart will stop."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Grumpig_1[] = _( +static const u8 DexDescription_Grumpig_1[] = _( "GRUMPIG uses the black pearls on its\n" "body to wield its fantastic powers.\n" "When it is doing so, it dances bizarrely."); -const u8 DexDescription_Grumpig_2[] = _( +static const u8 DexDescription_Grumpig_2[] = _( "This POKéMON’s black pearls are valuable\n" "as works of art."); #else -const u8 DexDescription_Grumpig_1[] = _( +static const u8 DexDescription_Grumpig_1[] = _( "GRUMPIG uses the black pearls on its\n" "body to amplify its psychic power waves\n" "for gaining total control over its foe."); -const u8 DexDescription_Grumpig_2[] = _( +static const u8 DexDescription_Grumpig_2[] = _( "When this POKéMON uses its special\n" "power, its snorting breath grows\n" "labored."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Spinda_1[] = _( +static const u8 DexDescription_Spinda_1[] = _( "No two SPINDA are said to have\n" "identical spot patterns on their hides.\n" "This POKéMON moves in a curious manner"); -const u8 DexDescription_Spinda_2[] = _( +static const u8 DexDescription_Spinda_2[] = _( "as if it is stumbling in dizziness.\n" "Its lurching movements can cause the\n" "opponent to become confused."); #else -const u8 DexDescription_Spinda_1[] = _( +static const u8 DexDescription_Spinda_1[] = _( "All the SPINDA that exist in the\n" "world are said to have utterly unique\n" "spot patterns."); -const u8 DexDescription_Spinda_2[] = _( +static const u8 DexDescription_Spinda_2[] = _( "The shaky, tottering steps of this\n" "POKéMON give it the appearance of\n" "dancing."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Trapinch_1[] = _( +static const u8 DexDescription_Trapinch_1[] = _( "TRAPINCH is a patient hunter. It digs\n" "an inescapable pit in a desert and waits\n" "for its prey to come tumbling down."); -const u8 DexDescription_Trapinch_2[] = _( +static const u8 DexDescription_Trapinch_2[] = _( "This POKéMON can go a whole week\n" "without access to any water."); #else -const u8 DexDescription_Trapinch_1[] = _( +static const u8 DexDescription_Trapinch_1[] = _( "TRAPINCH’s nest is a sloped, bowl-like\n" "pit dug in sand. This POKéMON patiently\n" "waits for prey to tumble down the pit."); -const u8 DexDescription_Trapinch_2[] = _( +static const u8 DexDescription_Trapinch_2[] = _( "Its giant jaws have enough strength\n" "to crush even boulders."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Vibrava_1[] = _( +static const u8 DexDescription_Vibrava_1[] = _( "VIBRAVA’s wings have not yet\n" "completed the process of growing.\n" "Rather than flying long distances,"); -const u8 DexDescription_Vibrava_2[] = _( +static const u8 DexDescription_Vibrava_2[] = _( "they are more useful for generating\n" "ultrasonic waves by vibrating."); #else -const u8 DexDescription_Vibrava_1[] = _( +static const u8 DexDescription_Vibrava_1[] = _( "To make prey faint, VIBRAVA generates\n" "ultrasonic waves by vigorously making\n" "its two wings vibrate."); -const u8 DexDescription_Vibrava_2[] = _( +static const u8 DexDescription_Vibrava_2[] = _( "This POKéMON’s ultrasonic waves are so\n" "powerful, they can bring on headaches\n" "in people."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Flygon_1[] = _( +static const u8 DexDescription_Flygon_1[] = _( "FLYGON whips up a sandstorm by\n" "flapping its wings. The wings create a\n" "series of notes that sound like singing."); -const u8 DexDescription_Flygon_2[] = _( +static const u8 DexDescription_Flygon_2[] = _( "Because the “singing†is the only thing\n" "that can be heard in a sandstorm, this\n" "POKéMON is said to be the desert spirit."); #else -const u8 DexDescription_Flygon_1[] = _( +static const u8 DexDescription_Flygon_1[] = _( "FLYGON is nicknamed “the elemental \n" "spirit of the desert.†Because its\n" "flapping wings whip up a cloud of sand,"); -const u8 DexDescription_Flygon_2[] = _( +static const u8 DexDescription_Flygon_2[] = _( "this POKéMON is always enveloped in a\n" "sandstorm while flying."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Cacnea_1[] = _( +static const u8 DexDescription_Cacnea_1[] = _( "The more arid and harsh the\n" "environment, the more pretty and\n" "fragrant a flower CACNEA grows."); -const u8 DexDescription_Cacnea_2[] = _( +static const u8 DexDescription_Cacnea_2[] = _( "This POKéMON battles by wildly swinging\n" "its thorny arms."); #else -const u8 DexDescription_Cacnea_1[] = _( +static const u8 DexDescription_Cacnea_1[] = _( "CACNEA lives in arid locations such\n" "as deserts. It releases a strong aroma\n" "from its flower to attract prey."); -const u8 DexDescription_Cacnea_2[] = _( +static const u8 DexDescription_Cacnea_2[] = _( "When prey comes near, this POKéMON\n" "shoots sharp thorns from its body to\n" "bring the victim down."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Cacturne_1[] = _( +static const u8 DexDescription_Cacturne_1[] = _( "If a traveler is going through a desert\n" "in the thick of night, CACTURNE\n" "will follow in a ragtag group."); -const u8 DexDescription_Cacturne_2[] = _( +static const u8 DexDescription_Cacturne_2[] = _( "The POKéMON are biding their time,\n" "waiting for the traveler to tire and\n" "become incapable of moving."); #else -const u8 DexDescription_Cacturne_1[] = _( +static const u8 DexDescription_Cacturne_1[] = _( "During the daytime, CACTURNE remains\n" "unmoving so that it does not lose any\n" "moisture to the harsh desert sun."); -const u8 DexDescription_Cacturne_2[] = _( +static const u8 DexDescription_Cacturne_2[] = _( "This POKéMON becomes active at night\n" "when the temperature drops."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Swablu_1[] = _( +static const u8 DexDescription_Swablu_1[] = _( "SWABLU loves to make things clean.\n" "If it spots something dirty, it will wipe\n" "and polish it with its cottony wings."); -const u8 DexDescription_Swablu_2[] = _( +static const u8 DexDescription_Swablu_2[] = _( "If its wings become dirty, this POKéMON\n" "finds a stream and showers itself."); #else -const u8 DexDescription_Swablu_1[] = _( +static const u8 DexDescription_Swablu_1[] = _( "SWABLU has light and fluffy wings that\n" "are like cottony clouds. This POKéMON\n" "is not frightened of people."); -const u8 DexDescription_Swablu_2[] = _( +static const u8 DexDescription_Swablu_2[] = _( "It lands on the heads of people and\n" "sits there like a cotton-fluff hat."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Altaria_1[] = _( +static const u8 DexDescription_Altaria_1[] = _( "ALTARIA sings in a gorgeous soprano.\n" "Its wings are like cotton clouds.\n" "This POKéMON catches updrafts with its"); -const u8 DexDescription_Altaria_2[] = _( +static const u8 DexDescription_Altaria_2[] = _( "buoyant wings and soars way up into\n" "the wild blue yonder."); #else -const u8 DexDescription_Altaria_1[] = _( +static const u8 DexDescription_Altaria_1[] = _( "ALTARIA dances and wheels through the\n" "sky among billowing, cotton-like clouds.\n" "By singing melodies in its crystal-clear"); -const u8 DexDescription_Altaria_2[] = _( +static const u8 DexDescription_Altaria_2[] = _( "voice, this POKéMON makes its listeners\n" "experience dreamy wonderment."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Zangoose_1[] = _( +static const u8 DexDescription_Zangoose_1[] = _( "ZANGOOSE usually stays on all fours,\n" "but when angered, it gets up on its\n" "hind legs and extends its claws."); -const u8 DexDescription_Zangoose_2[] = _( +static const u8 DexDescription_Zangoose_2[] = _( "This POKéMON shares a bitter rivalry\n" "with SEVIPER that dates back over\n" "generations."); #else -const u8 DexDescription_Zangoose_1[] = _( +static const u8 DexDescription_Zangoose_1[] = _( "Memories of battling its arch-rival\n" "SEVIPER are etched into every cell of\n" "ZANGOOSE’s body."); -const u8 DexDescription_Zangoose_2[] = _( +static const u8 DexDescription_Zangoose_2[] = _( "This POKéMON adroitly dodges attacks\n" "with incredible agility."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Seviper_1[] = _( +static const u8 DexDescription_Seviper_1[] = _( "SEVIPER’s swordlike tail serves two\n" "purposes - it slashes foes and douses\n" "them with secreted poison."); -const u8 DexDescription_Seviper_2[] = _( +static const u8 DexDescription_Seviper_2[] = _( "This POKéMON will not give up its long-\n" "running blood feud with ZANGOOSE."); #else -const u8 DexDescription_Seviper_1[] = _( +static const u8 DexDescription_Seviper_1[] = _( "SEVIPER shares a generations-long\n" "feud with ZANGOOSE. The scars on its\n" "body are evidence of vicious battles."); -const u8 DexDescription_Seviper_2[] = _( +static const u8 DexDescription_Seviper_2[] = _( "This POKéMON attacks using its sword-\n" "edged tail."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Lunatone_1[] = _( +static const u8 DexDescription_Lunatone_1[] = _( "LUNATONE becomes active around the\n" "time of the full moon. Instead of\n" "walking, it moves by floating in midair."); -const u8 DexDescription_Lunatone_2[] = _( +static const u8 DexDescription_Lunatone_2[] = _( "The POKéMON’s intimidating red eyes\n" "cause all those who see it to become\n" "transfixed with fear."); #else -const u8 DexDescription_Lunatone_1[] = _( +static const u8 DexDescription_Lunatone_1[] = _( "LUNATONE was discovered at a location\n" "where a meteorite fell. As a result, some\n" "people theorize that this POKéMON"); -const u8 DexDescription_Lunatone_2[] = _( +static const u8 DexDescription_Lunatone_2[] = _( "came from space. However, no one has\n" "been able to prove this theory so far."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Solrock_1[] = _( +static const u8 DexDescription_Solrock_1[] = _( "Sunlight is the source of SOLROCK’s\n" "power. It is said to possess the ability\n" "to read the emotions of others."); -const u8 DexDescription_Solrock_2[] = _( +static const u8 DexDescription_Solrock_2[] = _( "This POKéMON gives off intense heat\n" "while rotating its body."); #else -const u8 DexDescription_Solrock_1[] = _( +static const u8 DexDescription_Solrock_1[] = _( "SOLROCK is a new species of POKéMON\n" "that is said to have fallen from space.\n" "It floats in air and moves silently."); -const u8 DexDescription_Solrock_2[] = _( +static const u8 DexDescription_Solrock_2[] = _( "In battle, this POKéMON releases\n" "intensely bright light."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Barboach_1[] = _( +static const u8 DexDescription_Barboach_1[] = _( "BARBOACH’s body is covered with a\n" "slimy film. If a foe grabs it, this\n" "POKéMON just slips out of the enemy’s"); -const u8 DexDescription_Barboach_2[] = _( +static const u8 DexDescription_Barboach_2[] = _( "grip.\n" "This POKéMON grows weak if the slimy\n" "coating dries up."); #else -const u8 DexDescription_Barboach_1[] = _( +static const u8 DexDescription_Barboach_1[] = _( "BARBOACH’s sensitive whiskers serve\n" "as a superb radar system.\n" "This POKéMON hides in mud, leaving only"); -const u8 DexDescription_Barboach_2[] = _( +static const u8 DexDescription_Barboach_2[] = _( "its two whiskers exposed while it waits\n" "for prey to come along."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Whiscash_1[] = _( +static const u8 DexDescription_Whiscash_1[] = _( "If WHISCASH goes on a wild rampage,\n" "it sets off a quake-like tremor with a\n" "radius of over three miles."); -const u8 DexDescription_Whiscash_2[] = _( +static const u8 DexDescription_Whiscash_2[] = _( "This POKéMON has the ability to predict\n" "real earthquakes."); #else -const u8 DexDescription_Whiscash_1[] = _( +static const u8 DexDescription_Whiscash_1[] = _( "WHISCASH is extremely territorial.\n" "Just one of these POKéMON will claim a\n" "large pond as its exclusive territory."); -const u8 DexDescription_Whiscash_2[] = _( +static const u8 DexDescription_Whiscash_2[] = _( "If a foe approaches it, it thrashes\n" "about and triggers a massive\n" "earthquake."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Corphish_1[] = _( +static const u8 DexDescription_Corphish_1[] = _( "CORPHISH catches prey with its sharp\n" "claws. It has no likes or dislikes when it\n" "comes to food - it will eat anything."); -const u8 DexDescription_Corphish_2[] = _( +static const u8 DexDescription_Corphish_2[] = _( "This POKéMON has no trouble living in\n" "filthy water."); #else -const u8 DexDescription_Corphish_1[] = _( +static const u8 DexDescription_Corphish_1[] = _( "CORPHISH were originally foreign\n" "POKéMON that were imported as pets.\n" "They eventually turned up in the wild."); -const u8 DexDescription_Corphish_2[] = _( +static const u8 DexDescription_Corphish_2[] = _( "This POKéMON is very hardy and has\n" "greatly increased its population."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Crawdaunt_1[] = _( +static const u8 DexDescription_Crawdaunt_1[] = _( "CRAWDAUNT molts (sheds) its shell\n" "regularly. Immediately after molting,\n" "its shell is soft and tender."); -const u8 DexDescription_Crawdaunt_2[] = _( +static const u8 DexDescription_Crawdaunt_2[] = _( "Until the shell hardens, this POKéMON\n" "hides in its streambed burrow to avoid\n" "attack from its foes."); #else -const u8 DexDescription_Crawdaunt_1[] = _( +static const u8 DexDescription_Crawdaunt_1[] = _( "CRAWDAUNT has an extremely violent\n" "nature that compels it to challenge\n" "other living things to battle."); -const u8 DexDescription_Crawdaunt_2[] = _( +static const u8 DexDescription_Crawdaunt_2[] = _( "Other life-forms refuse to live in\n" "ponds inhabited by this POKéMON,\n" "making them desolate places."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Baltoy_1[] = _( +static const u8 DexDescription_Baltoy_1[] = _( "As soon as it spots others of its kind,\n" "BALTOY congregates with them and\n" "then begins crying noisily in unison."); -const u8 DexDescription_Baltoy_2[] = _( +static const u8 DexDescription_Baltoy_2[] = _( "This POKéMON sleeps while cleverly\n" "balancing itself on its one foot."); #else -const u8 DexDescription_Baltoy_1[] = _( +static const u8 DexDescription_Baltoy_1[] = _( "BALTOY moves while spinning around on\n" "its one foot. Primitive wall paintings\n" "depicting this POKéMON living among"); -const u8 DexDescription_Baltoy_2[] = _( +static const u8 DexDescription_Baltoy_2[] = _( "people were discovered in some ancient\n" "ruins."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Claydol_1[] = _( +static const u8 DexDescription_Claydol_1[] = _( "CLAYDOL is an enigma that appeared\n" "from a clay statue made by an ancient\n" "civilization dating back 20,000 years."); -const u8 DexDescription_Claydol_2[] = _( +static const u8 DexDescription_Claydol_2[] = _( "This POKéMON shoots beams from both\n" "its hands."); #else -const u8 DexDescription_Claydol_1[] = _( +static const u8 DexDescription_Claydol_1[] = _( "CLAYDOL are said to be dolls of mud made\n" "by primitive humans and brought to life\n" "by exposure to a mysterious ray."); -const u8 DexDescription_Claydol_2[] = _( +static const u8 DexDescription_Claydol_2[] = _( "This POKéMON moves about while\n" "levitating."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Lileep_1[] = _( +static const u8 DexDescription_Lileep_1[] = _( "LILEEP is an ancient POKéMON that was\n" "regenerated from a fossil. It remains\n" "permanently anchored to a rock."); -const u8 DexDescription_Lileep_2[] = _( +static const u8 DexDescription_Lileep_2[] = _( "From its immobile perch, this POKéMON\n" "intently scans for prey with its two\n" "eyes."); #else -const u8 DexDescription_Lileep_1[] = _( +static const u8 DexDescription_Lileep_1[] = _( "LILEEP became extinct approximately\n" "a hundred million years ago.\n" "This ancient POKéMON attaches itself"); -const u8 DexDescription_Lileep_2[] = _( +static const u8 DexDescription_Lileep_2[] = _( "to a rock on the seafloor and catches\n" "approaching prey using tentacles \n" "shaped like flower petals."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Cradily_1[] = _( +static const u8 DexDescription_Cradily_1[] = _( "CRADILY’s body serves as an anchor,\n" "preventing it from being washed away in\n" "rough seas."); -const u8 DexDescription_Cradily_2[] = _( +static const u8 DexDescription_Cradily_2[] = _( "This POKéMON secretes a strong\n" "digestive fluid from its tentacles."); #else -const u8 DexDescription_Cradily_1[] = _( +static const u8 DexDescription_Cradily_1[] = _( "CRADILY roams around the ocean floor\n" "in search of food. This POKéMON freely\n" "extends its tree trunk-like neck and"); -const u8 DexDescription_Cradily_2[] = _( +static const u8 DexDescription_Cradily_2[] = _( "captures unwary prey using its eight\n" "tentacles."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Anorith_1[] = _( +static const u8 DexDescription_Anorith_1[] = _( "ANORITH is said to be a type of \n" "POKéMON predecessor, with eight wings\n" "at the sides of its body."); -const u8 DexDescription_Anorith_2[] = _( +static const u8 DexDescription_Anorith_2[] = _( "This POKéMON swam in the primordial sea\n" "by undulating these eight wings."); #else -const u8 DexDescription_Anorith_1[] = _( +static const u8 DexDescription_Anorith_1[] = _( "ANORITH was regenerated from a\n" "prehistoric fossil. This primitive\n" "POKéMON once lived in warm seas."); -const u8 DexDescription_Anorith_2[] = _( +static const u8 DexDescription_Anorith_2[] = _( "It grips its prey firmly between its\n" "two large claws."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Armaldo_1[] = _( +static const u8 DexDescription_Armaldo_1[] = _( "ARMALDO is a POKéMON species that\n" "became extinct in prehistoric times.\n" "This POKéMON is said to have walked on"); -const u8 DexDescription_Armaldo_2[] = _( +static const u8 DexDescription_Armaldo_2[] = _( "its hind legs, which would have been\n" "more convenient for life on land."); #else -const u8 DexDescription_Armaldo_1[] = _( +static const u8 DexDescription_Armaldo_1[] = _( "ARMALDO’s tough armor makes all attacks\n" "bounce off. This POKéMON’s two\n" "enormous claws can be freely extended"); -const u8 DexDescription_Armaldo_2[] = _( +static const u8 DexDescription_Armaldo_2[] = _( "or contracted. They have the power to\n" "punch right through a steel slab."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Feebas_1[] = _( +static const u8 DexDescription_Feebas_1[] = _( "While FEEBAS’s body is in tatters,\n" "it has a hardy and tenacious life force\n" "that enables it to live anywhere."); -const u8 DexDescription_Feebas_2[] = _( +static const u8 DexDescription_Feebas_2[] = _( "However, this POKéMON is also slow and\n" "dimwitted, making it an easy catch."); #else -const u8 DexDescription_Feebas_1[] = _( +static const u8 DexDescription_Feebas_1[] = _( "FEEBAS’s fins are ragged and\n" "tattered from the start of its life.\n" "Because of its shoddy appearance, this"); -const u8 DexDescription_Feebas_2[] = _( +static const u8 DexDescription_Feebas_2[] = _( "POKéMON is largely ignored.\n" "It is capable of living in both the sea\n" "and in rivers."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Milotic_1[] = _( +static const u8 DexDescription_Milotic_1[] = _( "MILOTIC live at the bottom of large\n" "lakes. When this POKéMON’s body glows a\n" "vivid pink, it releases a pulsing wave of"); -const u8 DexDescription_Milotic_2[] = _( +static const u8 DexDescription_Milotic_2[] = _( "energy that brings soothing calm to\n" "restless spirits."); #else -const u8 DexDescription_Milotic_1[] = _( +static const u8 DexDescription_Milotic_1[] = _( "MILOTIC is said to be the most\n" "beautiful of all the POKéMON.\n" "It has the power to becalm such"); -const u8 DexDescription_Milotic_2[] = _( +static const u8 DexDescription_Milotic_2[] = _( "emotions as anger and hostility to quell\n" "bitter feuding."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Castform_1[] = _( +static const u8 DexDescription_Castform_1[] = _( "CASTFORM borrows the power of nature\n" "to transform itself into the guises of\n" "the sun, rain clouds, and snow clouds."); -const u8 DexDescription_Castform_2[] = _( +static const u8 DexDescription_Castform_2[] = _( "This POKéMON’s feelings change with the\n" "weather."); #else -const u8 DexDescription_Castform_1[] = _( +static const u8 DexDescription_Castform_1[] = _( "CASTFORM’s appearance changes with\n" "the weather.\n" "This POKéMON gained the ability to use"); -const u8 DexDescription_Castform_2[] = _( +static const u8 DexDescription_Castform_2[] = _( "the vast power of nature to protect\n" "its tiny body."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Kecleon_1[] = _( +static const u8 DexDescription_Kecleon_1[] = _( "KECLEON alters its body coloration to\n" "blend in with its surroundings, allowing\n" "it to sneak up on its prey unnoticed."); -const u8 DexDescription_Kecleon_2[] = _( +static const u8 DexDescription_Kecleon_2[] = _( "Then it lashes out with its long,\n" "stretchy tongue to instantly ensnare\n" "the unsuspecting target."); #else -const u8 DexDescription_Kecleon_1[] = _( +static const u8 DexDescription_Kecleon_1[] = _( "KECLEON is capable of changing its body\n" "colors at will to blend in with its\n" "surroundings."); -const u8 DexDescription_Kecleon_2[] = _( +static const u8 DexDescription_Kecleon_2[] = _( "There is one exception - this POKéMON\n" "can’t change the zigzag pattern on its\n" "belly."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Shuppet_1[] = _( +static const u8 DexDescription_Shuppet_1[] = _( "SHUPPET grows by feeding on dark\n" "emotions, such as vengefulness and \n" "envy, in the hearts of people."); -const u8 DexDescription_Shuppet_2[] = _( +static const u8 DexDescription_Shuppet_2[] = _( "It roams through cities in search of\n" "grudges that taint people."); #else -const u8 DexDescription_Shuppet_1[] = _( +static const u8 DexDescription_Shuppet_1[] = _( "SHUPPET is attracted by feelings\n" "of jealousy and vindictiveness.\n" "If someone develops strong feelings of"); -const u8 DexDescription_Shuppet_2[] = _( +static const u8 DexDescription_Shuppet_2[] = _( "vengeance, this POKéMON will appear\n" "in a swarm and line up beneath the eaves\n" "of that person’s home."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Banette_1[] = _( +static const u8 DexDescription_Banette_1[] = _( "A cursed energy permeated the stuffing\n" "of a discarded and forgotten plush doll,\n" "giving it new life as BANETTE."); -const u8 DexDescription_Banette_2[] = _( +static const u8 DexDescription_Banette_2[] = _( "The POKéMON’s energy would escape if it\n" "were to ever open its mouth."); #else -const u8 DexDescription_Banette_1[] = _( +static const u8 DexDescription_Banette_1[] = _( "BANETTE generates energy for laying\n" "strong curses by sticking pins into its\n" "own body."); -const u8 DexDescription_Banette_2[] = _( +static const u8 DexDescription_Banette_2[] = _( "This POKéMON was originally a pitiful\n" "plush doll that was thrown away."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Duskull_1[] = _( +static const u8 DexDescription_Duskull_1[] = _( "DUSKULL wanders lost among the deep\n" "darkness of midnight. There is an oft-\n" "told admonishment given to misbehaving"); -const u8 DexDescription_Duskull_2[] = _( +static const u8 DexDescription_Duskull_2[] = _( "children that this POKéMON will spirit\n" "away bad children who earn scoldings\n" "from their mothers."); #else -const u8 DexDescription_Duskull_1[] = _( +static const u8 DexDescription_Duskull_1[] = _( "DUSKULL can pass through any wall no\n" "matter how thick it may be.\n" "Once this POKéMON chooses a target,"); -const u8 DexDescription_Duskull_2[] = _( +static const u8 DexDescription_Duskull_2[] = _( "it will doggedly pursue the intended\n" "victim until the break of dawn."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Dusclops_1[] = _( +static const u8 DexDescription_Dusclops_1[] = _( "DUSCLOPS absorbs anything, however\n" "large the object may be. This POKéMON\n" "hypnotizes its foe by waving its hands"); -const u8 DexDescription_Dusclops_2[] = _( +static const u8 DexDescription_Dusclops_2[] = _( "in a macabre manner and by bringing its\n" "single eye to bear. The hypnotized foe\n" "is made to do DUSCLOPS’s bidding."); #else -const u8 DexDescription_Dusclops_1[] = _( +static const u8 DexDescription_Dusclops_1[] = _( "DUSCLOPS’s body is completely hollow -\n" "there is nothing at all inside.\n" "It is said that its body is like a black"); -const u8 DexDescription_Dusclops_2[] = _( +static const u8 DexDescription_Dusclops_2[] = _( "hole. This POKéMON will absorb anything\n" "into its body, but nothing will ever come\n" "back out."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Tropius_1[] = _( +static const u8 DexDescription_Tropius_1[] = _( "Children of the southern tropics eat\n" "as snacks the fruit that grows in\n" "bunches around the neck of TROPIUS."); -const u8 DexDescription_Tropius_2[] = _( +static const u8 DexDescription_Tropius_2[] = _( "This POKéMON flies by flapping the\n" "leaves on its back as if they were\n" "wings."); #else -const u8 DexDescription_Tropius_1[] = _( +static const u8 DexDescription_Tropius_1[] = _( "The bunches of fruit around TROPIUS’s\n" "neck are very popular with children.\n" "This POKéMON loves fruit, and eats it"); -const u8 DexDescription_Tropius_2[] = _( +static const u8 DexDescription_Tropius_2[] = _( "continuously. Apparently, its love for\n" "fruit resulted in its own outgrowth\n" "of fruit."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Chimecho_1[] = _( +static const u8 DexDescription_Chimecho_1[] = _( "In high winds, CHIMECHO cries as it\n" "hangs from a tree branch or the eaves\n" "of a building using a suction cup on its"); -const u8 DexDescription_Chimecho_2[] = _( +static const u8 DexDescription_Chimecho_2[] = _( "head.\n" "This POKéMON plucks berries with its\n" "long tail and eats them."); #else -const u8 DexDescription_Chimecho_1[] = _( +static const u8 DexDescription_Chimecho_1[] = _( "CHIMECHO makes its cries echo\n" "inside its hollow body. When this\n" "POKéMON becomes enraged, its cries"); -const u8 DexDescription_Chimecho_2[] = _( +static const u8 DexDescription_Chimecho_2[] = _( "result in ultrasonic waves that have\n" "the power to knock foes flying."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Absol_1[] = _( +static const u8 DexDescription_Absol_1[] = _( "ABSOL has the ability to foretell the\n" "coming of natural disasters.\n" "It lives in a harsh, rugged mountain"); -const u8 DexDescription_Absol_2[] = _( +static const u8 DexDescription_Absol_2[] = _( "environment. This POKéMON very rarely\n" "ventures down from the mountains."); #else -const u8 DexDescription_Absol_1[] = _( +static const u8 DexDescription_Absol_1[] = _( "Every time ABSOL appears before people,\n" "it is followed by a disaster such as an\n" "earthquake or a tidal wave."); -const u8 DexDescription_Absol_2[] = _( +static const u8 DexDescription_Absol_2[] = _( "As a result, it came to be known as the\n" "disaster POKéMON."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Wynaut_1[] = _( +static const u8 DexDescription_Wynaut_1[] = _( "WYNAUT gather on moonlit nights to play\n" "by squeezing up against each other.\n" "By being squeezed, this POKéMON gains"); -const u8 DexDescription_Wynaut_2[] = _( +static const u8 DexDescription_Wynaut_2[] = _( "endurance and is trained to dole out\n" "powerful counterattacks."); #else -const u8 DexDescription_Wynaut_1[] = _( +static const u8 DexDescription_Wynaut_1[] = _( "WYNAUT can always be seen with a big,\n" "happy smile on its face. Look at its tail\n" "to determine if it is angry."); -const u8 DexDescription_Wynaut_2[] = _( +static const u8 DexDescription_Wynaut_2[] = _( "When angered, this POKéMON will be\n" "slapping the ground with its tail."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Snorunt_1[] = _( +static const u8 DexDescription_Snorunt_1[] = _( "SNORUNT survives by eating only snow\n" "and ice.\n" "Old folklore claims that a house visited"); -const u8 DexDescription_Snorunt_2[] = _( +static const u8 DexDescription_Snorunt_2[] = _( "by this POKéMON is sure to prosper for\n" "many generations to come."); #else -const u8 DexDescription_Snorunt_1[] = _( +static const u8 DexDescription_Snorunt_1[] = _( "SNORUNT live in regions with heavy\n" "snowfall. In seasons without snow, such\n" "as spring and summer, this POKéMON"); -const u8 DexDescription_Snorunt_2[] = _( +static const u8 DexDescription_Snorunt_2[] = _( "steals away to live quietly among\n" "stalactites and stalagmites deep in\n" "caverns."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Glalie_1[] = _( +static const u8 DexDescription_Glalie_1[] = _( "GLALIE has the ability to freely\n" "control ice. For example, it can\n" "instantly freeze its foe solid."); -const u8 DexDescription_Glalie_2[] = _( +static const u8 DexDescription_Glalie_2[] = _( "After immobilizing its foe in ice, this\n" "POKéMON enjoys eating it in leisurely\n" "fashion."); #else -const u8 DexDescription_Glalie_1[] = _( +static const u8 DexDescription_Glalie_1[] = _( "GLALIE has a body made of rock, which it\n" "hardens with an armor of ice.\n" "This POKéMON has the ability to freeze"); -const u8 DexDescription_Glalie_2[] = _( +static const u8 DexDescription_Glalie_2[] = _( "moisture in the atmosphere into any\n" "shape it desires."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Spheal_1[] = _( +static const u8 DexDescription_Spheal_1[] = _( "SPHEAL always travels by rolling\n" "around on its ball-like body. When the\n" "season for ice floes arrives, this"); -const u8 DexDescription_Spheal_2[] = _( +static const u8 DexDescription_Spheal_2[] = _( "POKéMON can be seen rolling about on\n" "ice and crossing the sea."); #else -const u8 DexDescription_Spheal_1[] = _( +static const u8 DexDescription_Spheal_1[] = _( "SPHEAL is much faster rolling than \n" "walking to get around. When groups of\n" "this POKéMON eat, they all clap at once"); -const u8 DexDescription_Spheal_2[] = _( +static const u8 DexDescription_Spheal_2[] = _( "to show their pleasure. Because of this,\n" "their mealtimes are noisy."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Sealeo_1[] = _( +static const u8 DexDescription_Sealeo_1[] = _( "SEALEO often balances and rolls\n" "things on the tip of its nose. While the\n" "POKéMON is rolling something, it checks"); -const u8 DexDescription_Sealeo_2[] = _( +static const u8 DexDescription_Sealeo_2[] = _( "the object’s aroma and texture to\n" "determine whether it likes the object\n" "or not."); #else -const u8 DexDescription_Sealeo_1[] = _( +static const u8 DexDescription_Sealeo_1[] = _( "SEALEO has the habit of always juggling\n" "on the tip of its nose anything it sees\n" "for the first time."); -const u8 DexDescription_Sealeo_2[] = _( +static const u8 DexDescription_Sealeo_2[] = _( "This POKéMON occasionally entertains\n" "itself by balancing and rolling a SPHEAL\n" "on its nose."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Walrein_1[] = _( +static const u8 DexDescription_Walrein_1[] = _( "WALREIN swims all over in frigid\n" "seawater while crushing icebergs with\n" "its grand, imposing tusks."); -const u8 DexDescription_Walrein_2[] = _( +static const u8 DexDescription_Walrein_2[] = _( "Its thick layer of blubber makes enemy\n" "attacks bounce off harmlessly."); #else -const u8 DexDescription_Walrein_1[] = _( +static const u8 DexDescription_Walrein_1[] = _( "WALREIN’s two massively developed\n" "tusks can totally shatter blocks of\n" "ice weighing ten tons with one blow."); -const u8 DexDescription_Walrein_2[] = _( +static const u8 DexDescription_Walrein_2[] = _( "This POKéMON’s thick coat of blubber\n" "insulates it from subzero temperatures."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Clamperl_1[] = _( +static const u8 DexDescription_Clamperl_1[] = _( "CLAMPERL grows while being protected\n" "by its rock-hard shell. When its body\n" "becomes too large to fit inside the"); -const u8 DexDescription_Clamperl_2[] = _( +static const u8 DexDescription_Clamperl_2[] = _( "shell, it is sure evidence that this\n" "POKéMON is getting close to evolution."); #else -const u8 DexDescription_Clamperl_1[] = _( +static const u8 DexDescription_Clamperl_1[] = _( "CLAMPERL’s sturdy shell is not only good\n" "for protection - it is also used for\n" "clamping and catching prey."); -const u8 DexDescription_Clamperl_2[] = _( +static const u8 DexDescription_Clamperl_2[] = _( "A fully grown CLAMPERL’s shell will be\n" "scored with nicks and scratches all\n" "over."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Huntail_1[] = _( +static const u8 DexDescription_Huntail_1[] = _( "HUNTAIL’s tail is shaped like a fish.\n" "It uses the tail to attract prey, then\n" "swallows the prey whole with its large,"); -const u8 DexDescription_Huntail_2[] = _( +static const u8 DexDescription_Huntail_2[] = _( "gaping mouth.\n" "This POKéMON swims by wiggling its\n" "slender body like a snake."); #else -const u8 DexDescription_Huntail_1[] = _( +static const u8 DexDescription_Huntail_1[] = _( "HUNTAIL’s presence went unnoticed by\n" "people for a long time because it lives\n" "at extreme depths in the sea."); -const u8 DexDescription_Huntail_2[] = _( +static const u8 DexDescription_Huntail_2[] = _( "This POKéMON’s eyes can see clearly\n" "even in the murky dark depths of the\n" "ocean."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Gorebyss_1[] = _( +static const u8 DexDescription_Gorebyss_1[] = _( "Although GOREBYSS is the very picture\n" "of elegance and beauty while swimming,\n" "it is also cruel. When it spots prey, this"); -const u8 DexDescription_Gorebyss_2[] = _( +static const u8 DexDescription_Gorebyss_2[] = _( "POKéMON inserts its thin mouth into the\n" "prey’s body and drains the prey of its\n" "body fluids."); #else -const u8 DexDescription_Gorebyss_1[] = _( +static const u8 DexDescription_Gorebyss_1[] = _( "GOREBYSS lives in the southern seas\n" "at extreme depths. Its body is built to\n" "withstand the enormous pressure of"); -const u8 DexDescription_Gorebyss_2[] = _( +static const u8 DexDescription_Gorebyss_2[] = _( "water at incredible depths. Because of\n" "this, this POKéMON’s body is unharmed\n" "by ordinary attacks."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Relicanth_1[] = _( +static const u8 DexDescription_Relicanth_1[] = _( "RELICANTH is a rare species that was\n" "discovered in deep-sea explorations.\n" "This POKéMON’s body withstands the"); -const u8 DexDescription_Relicanth_2[] = _( +static const u8 DexDescription_Relicanth_2[] = _( "enormous water pressure of the ocean\n" "depths. Its body is covered in tough\n" "scales that are like craggy rocks."); #else -const u8 DexDescription_Relicanth_1[] = _( +static const u8 DexDescription_Relicanth_1[] = _( "RELICANTH is a POKéMON species that\n" "existed for a hundred million years\n" "without ever changing its form."); -const u8 DexDescription_Relicanth_2[] = _( +static const u8 DexDescription_Relicanth_2[] = _( "This ancient POKéMON feeds on\n" "microscopic organisms with its\n" "toothless mouth."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Luvdisc_1[] = _( +static const u8 DexDescription_Luvdisc_1[] = _( "LUVDISC’s heart-shaped body is a\n" "symbol of love and romance.\n" "It is said that any couple meeting this"); -const u8 DexDescription_Luvdisc_2[] = _( +static const u8 DexDescription_Luvdisc_2[] = _( "POKéMON is promised a loving\n" "relationship that never ends."); #else -const u8 DexDescription_Luvdisc_1[] = _( +static const u8 DexDescription_Luvdisc_1[] = _( "LUVDISC live in shallow seas in the\n" "tropics. This heart-shaped POKéMON\n" "earned its name by swimming after"); -const u8 DexDescription_Luvdisc_2[] = _( +static const u8 DexDescription_Luvdisc_2[] = _( "loving couples it spotted in the\n" "ocean’s waves."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Bagon_1[] = _( +static const u8 DexDescription_Bagon_1[] = _( "BAGON harbors a never-ending dream of\n" "one day soaring high among the clouds.\n" "As if trying to dispel its frustration"); -const u8 DexDescription_Bagon_2[] = _( +static const u8 DexDescription_Bagon_2[] = _( "over its inability to fly, this POKéMON\n" "slams its hard head against huge rocks\n" "and shatters them into pebbles."); #else -const u8 DexDescription_Bagon_1[] = _( +static const u8 DexDescription_Bagon_1[] = _( "BAGON has a dream of one day soaring\n" "in the sky. In doomed efforts to fly,\n" "this POKéMON hurls itself off cliffs."); -const u8 DexDescription_Bagon_2[] = _( +static const u8 DexDescription_Bagon_2[] = _( "As a result of its dives, its head has \n" "grown tough and as hard as tempered\n" "steel."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Shelgon_1[] = _( +static const u8 DexDescription_Shelgon_1[] = _( "Covering SHELGON’s body are outgrowths\n" "much like bones. The shell is very hard\n" "and bounces off enemy attacks."); -const u8 DexDescription_Shelgon_2[] = _( +static const u8 DexDescription_Shelgon_2[] = _( "When awaiting evolution, this POKéMON\n" "hides away in a cavern."); #else -const u8 DexDescription_Shelgon_1[] = _( +static const u8 DexDescription_Shelgon_1[] = _( "Inside SHELGON’s armor-like shell, cells\n" "are in the midst of transformation\n" "to create an entirely new body."); -const u8 DexDescription_Shelgon_2[] = _( +static const u8 DexDescription_Shelgon_2[] = _( "This POKéMON’s shell is extremely heavy,\n" "making its movements sluggish."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Salamence_1[] = _( +static const u8 DexDescription_Salamence_1[] = _( "By evolving into SALAMENCE, this\n" "POKéMON finally realizes its long-held\n" "dream of growing wings."); -const u8 DexDescription_Salamence_2[] = _( +static const u8 DexDescription_Salamence_2[] = _( "To express its joy, it flies and wheels\n" "all over the sky while spouting flames\n" "from its mouth."); #else -const u8 DexDescription_Salamence_1[] = _( +static const u8 DexDescription_Salamence_1[] = _( "SALAMENCE came about as a result of a\n" "strong, long-held dream of growing\n" "wings. It is said that this powerful"); -const u8 DexDescription_Salamence_2[] = _( +static const u8 DexDescription_Salamence_2[] = _( "desire triggered a sudden mutation in\n" "this POKéMON’s cells, causing it to\n" "sprout its magnificent wings."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Beldum_1[] = _( +static const u8 DexDescription_Beldum_1[] = _( "BELDUM keeps itself floating by\n" "generating a magnetic force that\n" "repels earth’s natural magnetism."); -const u8 DexDescription_Beldum_2[] = _( +static const u8 DexDescription_Beldum_2[] = _( "When it sleeps, this POKéMON anchors\n" "itself to a cliff using the hooks on\n" "its rear."); #else -const u8 DexDescription_Beldum_1[] = _( +static const u8 DexDescription_Beldum_1[] = _( "Instead of blood, a powerful magnetic\n" "force courses throughout BELDUM’s\n" "body. This POKéMON communicates with"); -const u8 DexDescription_Beldum_2[] = _( +static const u8 DexDescription_Beldum_2[] = _( "others by sending controlled pulses of\n" "magnetism."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Metang_1[] = _( +static const u8 DexDescription_Metang_1[] = _( "When two BELDUM fuse together, METANG\n" "is formed. The brains of the BELDUM are\n" "joined by a magnetic nervous system."); -const u8 DexDescription_Metang_2[] = _( +static const u8 DexDescription_Metang_2[] = _( "This POKéMON turns its arms to the rear\n" "for traveling at high speed."); #else -const u8 DexDescription_Metang_1[] = _( +static const u8 DexDescription_Metang_1[] = _( "When two BELDUM fuse together, METANG\n" "is formed. The brains of the BELDUM are\n" "joined by a magnetic nervous system."); -const u8 DexDescription_Metang_2[] = _( +static const u8 DexDescription_Metang_2[] = _( "By linking its brains magnetically,\n" "this POKéMON generates strong\n" "psychokinetic power."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Metagross_1[] = _( +static const u8 DexDescription_Metagross_1[] = _( "METAGROSS is the result of two METANG\n" "achieving fusion. When hunting, this\n" "POKéMON pins the prey to the ground"); -const u8 DexDescription_Metagross_2[] = _( +static const u8 DexDescription_Metagross_2[] = _( "under its massive body. It then eats\n" "the helpless victim using the large \n" "mouth on its stomach."); #else -const u8 DexDescription_Metagross_1[] = _( +static const u8 DexDescription_Metagross_1[] = _( "METAGROSS has four brains in total.\n" "Combined, the four brains can breeze\n" "through difficult calculations faster"); -const u8 DexDescription_Metagross_2[] = _( +static const u8 DexDescription_Metagross_2[] = _( "than a supercomputer.\n" "This POKéMON can float in the air by\n" "tucking in its four legs."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Regirock_1[] = _( +static const u8 DexDescription_Regirock_1[] = _( "REGIROCK’s body is composed entirely of\n" "rocks. Recently, a study made the\n" "startling discovery that the rocks"); -const u8 DexDescription_Regirock_2[] = _( +static const u8 DexDescription_Regirock_2[] = _( "were all unearthed from different\n" "locations."); #else -const u8 DexDescription_Regirock_1[] = _( +static const u8 DexDescription_Regirock_1[] = _( "REGIROCK was sealed away by people\n" "long ago. If this POKéMON’s body is\n" "damaged in battle, it is said to seek"); -const u8 DexDescription_Regirock_2[] = _( +static const u8 DexDescription_Regirock_2[] = _( "out suitable rocks on its own to repair\n" "itself."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Regice_1[] = _( +static const u8 DexDescription_Regice_1[] = _( "REGICE cloaks itself with frigid air of\n" "negative 328 degrees F.\n" "Things will freeze solid just by going"); -const u8 DexDescription_Regice_2[] = _( +static const u8 DexDescription_Regice_2[] = _( "near this POKéMON.\n" "Its icy body is so cold, it will not melt\n" "even if it is immersed in magma."); #else -const u8 DexDescription_Regice_1[] = _( +static const u8 DexDescription_Regice_1[] = _( "REGICE’s body was made during an ice\n" "age. The deep-frozen body can’t be\n" "melted, even by fire."); -const u8 DexDescription_Regice_2[] = _( +static const u8 DexDescription_Regice_2[] = _( "This POKéMON controls frigid air of\n" "minus 328 degrees F."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Registeel_1[] = _( +static const u8 DexDescription_Registeel_1[] = _( "REGISTEEL was imprisoned by people\n" "in ancient times.\n" "The metal composing its body is thought"); -const u8 DexDescription_Registeel_2[] = _( +static const u8 DexDescription_Registeel_2[] = _( "to be a curious substance that is not\n" "of this earth."); #else -const u8 DexDescription_Registeel_1[] = _( +static const u8 DexDescription_Registeel_1[] = _( "REGISTEEL has a body that is harder\n" "than any kind of metal.\n" "Its body is apparently hollow."); -const u8 DexDescription_Registeel_2[] = _( +static const u8 DexDescription_Registeel_2[] = _( "No one has any idea what this POKéMON\n" "eats."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Latias_1[] = _( +static const u8 DexDescription_Latias_1[] = _( "LATIAS is highly intelligent and capable\n" "of understanding human speech.\n" "It is covered with a glass-like down."); -const u8 DexDescription_Latias_2[] = _( +static const u8 DexDescription_Latias_2[] = _( "The POKéMON enfolds its body with its\n" "down and refracts light to alter its\n" "appearance."); #else -const u8 DexDescription_Latias_1[] = _( +static const u8 DexDescription_Latias_1[] = _( "LATIAS is highly sensitive to the\n" "emotions of people. If it senses any\n" "hostility, this POKéMON ruffles the"); -const u8 DexDescription_Latias_2[] = _( +static const u8 DexDescription_Latias_2[] = _( "feathers all over its body and cries\n" "shrilly to intimidate the foe."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Latios_1[] = _( +static const u8 DexDescription_Latios_1[] = _( "LATIOS will only open its heart to a\n" "TRAINER with a compassionate spirit.\n" "This POKéMON can fly faster than a jet"); -const u8 DexDescription_Latios_2[] = _( +static const u8 DexDescription_Latios_2[] = _( "plane by folding its forelegs to minimize\n" "air resistance."); #else -const u8 DexDescription_Latios_1[] = _( +static const u8 DexDescription_Latios_1[] = _( "LATIOS has the ability to make its foe\n" "see an image of what it has seen or\n" "imagines in its head."); -const u8 DexDescription_Latios_2[] = _( +static const u8 DexDescription_Latios_2[] = _( "This POKéMON is intelligent and\n" "understands human speech."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Kyogre_1[] = _( +static const u8 DexDescription_Kyogre_1[] = _( "KYOGRE is named in mythology as the\n" "POKéMON that expanded the sea by\n" "covering the land with torrential rains"); -const u8 DexDescription_Kyogre_2[] = _( +static const u8 DexDescription_Kyogre_2[] = _( "and towering tidal waves.\n" "It took to sleep after a cataclysmic\n" "battle with GROUDON."); #else -const u8 DexDescription_Kyogre_1[] = _( +static const u8 DexDescription_Kyogre_1[] = _( "KYOGRE has the power to create massive\n" "rain clouds that cover the entire sky\n" "and bring about torrential downpours."); -const u8 DexDescription_Kyogre_2[] = _( +static const u8 DexDescription_Kyogre_2[] = _( "This POKéMON saved people who were\n" "suffering from droughts."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Groudon_1[] = _( +static const u8 DexDescription_Groudon_1[] = _( "GROUDON has the power to scatter rain\n" "clouds and make water evaporate with\n" "light and heat."); -const u8 DexDescription_Groudon_2[] = _( +static const u8 DexDescription_Groudon_2[] = _( "It came as a savior to people who had\n" "been suffering from terrible floods."); #else -const u8 DexDescription_Groudon_1[] = _( +static const u8 DexDescription_Groudon_1[] = _( "GROUDON has long been described in \n" "mythology as the POKéMON that raised\n" "lands and expanded continents."); -const u8 DexDescription_Groudon_2[] = _( +static const u8 DexDescription_Groudon_2[] = _( "This POKéMON took to sleep after a\n" "cataclysmic battle with KYOGRE."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Rayquaza_1[] = _( +static const u8 DexDescription_Rayquaza_1[] = _( "RAYQUAZA is said to have lived for\n" "hundreds of millions of years in the\n" "earth’s ozone layer, above the clouds."); -const u8 DexDescription_Rayquaza_2[] = _( +static const u8 DexDescription_Rayquaza_2[] = _( "Its existence had been completely\n" "unknown because it lived so high in\n" "the sky."); #else -const u8 DexDescription_Rayquaza_1[] = _( +static const u8 DexDescription_Rayquaza_1[] = _( "RAYQUAZA lived for hundreds of millions\n" "of years in the earth’s ozone layer, \n" "never descending to the ground."); -const u8 DexDescription_Rayquaza_2[] = _( +static const u8 DexDescription_Rayquaza_2[] = _( "This POKéMON appears to feed on water\n" "and particles in the atmosphere."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Jirachi_1[] = _( +static const u8 DexDescription_Jirachi_1[] = _( "JIRACHI will awaken from its sleep of\n" "a thousand years if you sing to it in a\n" "voice of purity."); -const u8 DexDescription_Jirachi_2[] = _( +static const u8 DexDescription_Jirachi_2[] = _( "It is said to make true any wish that\n" "people desire."); #else -const u8 DexDescription_Jirachi_1[] = _( +static const u8 DexDescription_Jirachi_1[] = _( "A legend states that JIRACHI will make\n" "true any wish that is written on notes\n" "attached to its head when it awakens."); -const u8 DexDescription_Jirachi_2[] = _( +static const u8 DexDescription_Jirachi_2[] = _( "If this POKéMON senses danger, it will\n" "fight without awakening."); #endif #ifdef SAPPHIRE -const u8 DexDescription_Deoxys_1[] = _( +static const u8 DexDescription_Deoxys_1[] = _( "DEOXYS emerged from a virus that came\n" "from space. It is highly intelligent and\n" "wields psychokinetic powers."); -const u8 DexDescription_Deoxys_2[] = _( +static const u8 DexDescription_Deoxys_2[] = _( "This POKéMON shoots lasers from the\n" "crystalline organ on its chest."); #else -const u8 DexDescription_Deoxys_1[] = _( +static const u8 DexDescription_Deoxys_1[] = _( "The DNA of a space virus underwent a\n" "sudden mutation upon exposure to a\n" "laser beam and resulted in DEOXYS."); -const u8 DexDescription_Deoxys_2[] = _( +static const u8 DexDescription_Deoxys_2[] = _( "The crystalline organ on this POKéMON’s\n" "chest appears to be its brain."); #endif -const struct PokedexEntry gPokedexEntries[] = +static const struct PokedexEntry gPokedexEntries[] = { { //Dummy .categoryName = _("UNKNOWN"), diff --git a/src/pokedex.c b/src/pokedex.c index e74cf5a39..92db38da9 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -166,6 +166,8 @@ extern const u16 gPokedexMenuSearch_Pal[]; extern const u8 gTypeNames[][7]; extern const u8 gPokedexMenu2_Gfx[]; +extern u16 NationalPokedexNumToSpecies(u16); +extern void ShowPokedexAreaScreen(u16 species, u8 *string); extern void sub_814AD7C(u8, u8); extern void sub_800D74C(); extern const u16 *species_and_otid_get_pal(u16, u32, u32); @@ -422,6 +424,7 @@ static const union AnimCmd *const gSpriteAnimTable_83A0520[] = { gSpriteAnim_83A04CC, }; +static void sub_808EF38(struct Sprite *); static const struct SpriteTemplate gSpriteTemplate_83A0524 = { .tileTag = 4096, @@ -432,6 +435,7 @@ static const struct SpriteTemplate gSpriteTemplate_83A0524 = .affineAnims = gDummySpriteAffineAnimTable, .callback = sub_808EF38, }; +static void sub_808EF8C(struct Sprite *); static const struct SpriteTemplate gSpriteTemplate_83A053C = { .tileTag = 4096, @@ -442,6 +446,7 @@ static const struct SpriteTemplate gSpriteTemplate_83A053C = .affineAnims = gDummySpriteAffineAnimTable, .callback = sub_808EF8C, }; +static void sub_808F08C(struct Sprite *); static const struct SpriteTemplate gSpriteTemplate_83A0554 = { .tileTag = 4096, @@ -452,6 +457,7 @@ static const struct SpriteTemplate gSpriteTemplate_83A0554 = .affineAnims = gDummySpriteAffineAnimTable, .callback = sub_808F08C, }; +static void sub_808F0B4(struct Sprite *); static const struct SpriteTemplate gSpriteTemplate_83A056C = { .tileTag = 4096, @@ -462,6 +468,7 @@ static const struct SpriteTemplate gSpriteTemplate_83A056C = .affineAnims = gDummySpriteAffineAnimTable, .callback = sub_808F0B4, }; +static void sub_808ED94(struct Sprite *); static const struct SpriteTemplate gSpriteTemplate_83A0584 = { .tileTag = 4096, @@ -482,6 +489,7 @@ static const struct SpriteTemplate gSpriteTemplate_83A059C = .affineAnims = gDummySpriteAffineAnimTable, .callback = sub_808ED94, }; +static void sub_808F168(struct Sprite *); static const struct SpriteTemplate gSpriteTemplate_83A05B4 = { .tileTag = 4096, @@ -1220,14 +1228,54 @@ static void sub_808DF88(u16 a, u8 b, u8 c, u16 d); static u8 sub_808DFE4(u16 num, u8 b, u8 c); static void sub_808E090(u8 a, u8 b, u16 c); static void sub_808E0CC(u16 a, u16 b); +static bool8 sub_808E208(u8 a, u8 b, u8 c); +static u16 sub_808E48C(u16 a, u16 b); +static void sub_808E6BC(void); +static u8 sub_808E71C(void); +static u8 sub_808E82C(void); +static u16 sub_808E888(u16 a1); static u32 sub_808E8C8(u16 a, s16 b, s16 c); +static void sub_808E978(u8 a); +static void sub_808EDB8(struct Sprite *sprite); +static void sub_808EE28(struct Sprite *sprite); static u8 sub_808F210(struct PokedexListItem *, u8); +static bool8 sub_808F250(u8 taskId); static u8 sub_808F284(struct PokedexListItem *, u8); -void sub_8090B8C(u8); -void sub_8090C28(struct Sprite *); -s8 GetNationalPokedexFlag(u16, u8); +static void Task_InitPageScreenMultistep(u8 taskId); +static void Task_PageScreenProcessInput(u8 taskId); +static void sub_808F888(u8 taskId); +static void Task_ClosePageScreen(u8 taskId); +static void Task_InitAreaScreenMultistep(u8 taskId); +static void Task_AreaScreenProcessInput(u8 taskId); +static void sub_808FA00(u8 taskId); +static void Task_InitCryScreenMultistep(u8 taskId); +static void Task_CryScreenProcessInput(u8 taskId); +static void sub_808FFBC(u8 taskId); +static void sub_8090040(u8 a); +static void Task_InitSizeScreenMultistep(u8 taskId); +static void Task_SizeScreenProcessInput(u8 taskId); +static void sub_8090498(u8 taskId); +static void sub_80904FC(u16 a); +static void sub_8090540(u16 a); +static void sub_8090584(u8 a, u16 b); +static void sub_8090644(u8 a, u16 b); +static void sub_8090750(u8); +static void sub_8090A3C(u8); +static void sub_8090B8C(u8); +static void sub_8090C28(struct Sprite *); +static void sub_8090C68(void); +static void sub_8091060(u16); +static void sub_8091154(u16 order, u8, u8); +static u8 sub_80911C8(u16 num, u8, u8); +static u8 sub_8091260(u16 num, u8, u8, u8); +static void sub_8091304(const u8 *name, u8, u8); +static void sub_8091458(u16 height, u8 i, u8 i1); +static void sub_8091564(u16 weight, u8 i, u8 i1); static void sub_8091738(u16, u16, u16); -u16 sub_80918EC(u16 a, s16 b, s16 c, u16 d); //Not sure of return type +static void sub_80917CC(u16 i, u16 i1); +static u16 sub_8091818(u8, u16, u16, u16); +static u16 sub_80918EC(u16 a, s16 b, s16 c, u16 d); +static u8 sub_8091A4C(u16 gender, s16, s16, u16); static void sub_8091E54(u8); static void sub_809204C(u8); static void sub_809207C(u8); @@ -1249,9 +1297,6 @@ static u8 sub_8092E10(u8, u8); static void sub_8092EB0(u8); static void sub_809308C(u8); -extern u16 NationalPokedexNumToSpecies(u16); -void ShowPokedexAreaScreen(u16 species, u8 *string); - void ResetPokedex(void) { u16 i; @@ -2290,7 +2335,7 @@ static void sub_808E0CC(u16 a, u16 b) gPokedexView->unk632 = 0; } -bool8 sub_808E208(u8 a, u8 b, u8 c) +static bool8 sub_808E208(u8 a, u8 b, u8 c) { u16 i; u8 foo; @@ -2330,7 +2375,7 @@ bool8 sub_808E208(u8 a, u8 b, u8 c) } } -void sub_808E398(u8 a, u16 b) +static void sub_808E398(u8 a, u16 b) { u16 unk; u8 spriteId; @@ -2367,14 +2412,15 @@ void sub_808E398(u8 a, u16 b) } } -u16 sub_808E48C(u16 a, u16 b) +// Ugly, ugly, ugly. I couldn't get it to match otherwise. +static u16 sub_808E48C(u16 a, u16 b) { u8 r3; u8 r5; u8 i; u16 r6; u8 r10 = 0; - + if (!((gMain.heldKeys & 0x40) && (a > 0))) { //_0808E4B6 @@ -2447,7 +2493,7 @@ u16 sub_808E48C(u16 a, u16 b) return a; } -void sub_808E6BC(void) +static void sub_808E6BC(void) { u16 i; @@ -2460,7 +2506,7 @@ void sub_808E6BC(void) } } -u8 sub_808E71C(void) +static u8 sub_808E71C(void) { u16 r2; u16 r4 = gPokedexView->selectedPokemon; @@ -2514,7 +2560,7 @@ u8 sub_808E71C(void) return 0; } -u8 sub_808E82C(void) +static u8 sub_808E82C(void) { u16 i; @@ -2529,7 +2575,7 @@ u8 sub_808E82C(void) return 0; } -u16 sub_808E888(u16 a1) +static u16 sub_808E888(u16 a1) { if (a1 >= NATIONAL_DEX_COUNT || gPokedexView->unk0[a1].dexNum == 0xFFFF) return 0xFFFF; @@ -2561,7 +2607,7 @@ static u32 sub_808E8C8(u16 a, s16 b, s16 c) return 0xFFFF; } -void sub_808E978(u8 a) +static void sub_808E978(u8 a) { u8 spriteId; u16 r5; @@ -2571,7 +2617,7 @@ void sub_808E978(u8 a) spriteId = CreateSprite(&gSpriteTemplate_83A053C, 184, 156, 0); gSprites[spriteId].data1 = 1; - gSprites[spriteId].vFlip = 1; + gSprites[spriteId].vFlip = TRUE; CreateSprite(&gSpriteTemplate_83A0524, 234, 20, 0); CreateSprite(&gSpriteTemplate_83A0554, 16, 138, 0); @@ -2657,18 +2703,18 @@ void sub_808E978(u8 a) } } -void nullsub_58(struct Sprite *sprite) +static void nullsub_58(struct Sprite *sprite) { } -void sub_808ED94(struct Sprite *sprite) +static void sub_808ED94(struct Sprite *sprite) { if (gPokedexView->unk64A != 0) DestroySprite(sprite); } //Move Pokemon into position for description page -void sub_808EDB8(struct Sprite *sprite) +static void sub_808EDB8(struct Sprite *sprite) { sprite->oam.priority = 0; sprite->oam.affineMode = 0; @@ -2692,7 +2738,7 @@ void sub_808EDB8(struct Sprite *sprite) } } -void sub_808EE28(struct Sprite *sprite) +static void sub_808EE28(struct Sprite *sprite) { u8 data1 = sprite->data1; @@ -2730,7 +2776,7 @@ void sub_808EE28(struct Sprite *sprite) } } -void sub_808EF38(struct Sprite *sprite) +static void sub_808EF38(struct Sprite *sprite) { if (gPokedexView->unk64A != 0 && gPokedexView->unk64A != 3) DestroySprite(sprite); @@ -2738,7 +2784,7 @@ void sub_808EF38(struct Sprite *sprite) sprite->pos2.y = gPokedexView->selectedPokemon * 120 / (gPokedexView->pokemonListCount - 1); } -void sub_808EF8C(struct Sprite *sprite) +static void sub_808EF8C(struct Sprite *sprite) { if (gPokedexView->unk64A != 0 && gPokedexView->unk64A != 3) { @@ -2773,132 +2819,38 @@ void sub_808EF8C(struct Sprite *sprite) } } -void sub_808F08C(struct Sprite *sprite) +static void sub_808F08C(struct Sprite *sprite) { if (gPokedexView->unk64A != 0 && gPokedexView->unk64A != 3) DestroySprite(sprite); } -#ifdef NONMATCHING -void sub_808F0B4(struct Sprite *sprite) +static void sub_808F0B4(struct Sprite *sprite) { if (gPokedexView->unk64A != 0 && gPokedexView->unk64A != 3) + { DestroySprite(sprite); + } else { + u8 val; s16 r3; + s16 r0; - u8 unk = gPokedexView->unk62C + sprite->data1; - u16 foo = gSineTable[unk]; - //u8 unk2 = sprite->data0; - //u16 bar = gSineTable[unk + 0x40]; - - SetOamMatrix(sprite->data0, foo, gSineTable[unk + 0x40], (-(u16)foo) >> 16, gSineTable[unk + 0x40]); + val = gPokedexView->unk62C + sprite->data1; + r3 = gSineTable[val]; + r0 = gSineTable[val + 0x40]; + SetOamMatrix(sprite->data0, r0, r3, -r3, r0); - r3 = gSineTable[sprite->data1 + gPokedexView->unk62C]; - sprite->pos2.x = gSineTable[sprite->data1 + gPokedexView->unk62C + 0x40] * 5 / 256; + val = gPokedexView->unk62C + (sprite->data1 + 0x40); + r3 = gSineTable[val]; + r0 = gSineTable[val + 0x40]; + sprite->pos2.x = r0 * 40 / 256; sprite->pos2.y = r3 * 40 / 256; } } -#else -__attribute__((naked)) -void sub_808F0B4(struct Sprite *sprite) -{ - asm(".syntax unified\n\ - push {r4-r7,lr}\n\ - sub sp, 0x4\n\ - adds r6, r0, 0\n\ - ldr r1, _0808F0D8 @ =gPokedexView\n\ - ldr r0, [r1]\n\ - ldr r2, _0808F0DC @ =0x0000064a\n\ - adds r0, r2\n\ - ldrb r0, [r0]\n\ - adds r7, r1, 0\n\ - cmp r0, 0\n\ - beq _0808F0E0\n\ - cmp r0, 0x3\n\ - beq _0808F0E0\n\ - adds r0, r6, 0\n\ - bl DestroySprite\n\ - b _0808F158\n\ - .align 2, 0\n\ -_0808F0D8: .4byte gPokedexView\n\ -_0808F0DC: .4byte 0x0000064a\n\ -_0808F0E0:\n\ - ldr r0, [r7]\n\ - ldr r5, _0808F160 @ =0x0000062c\n\ - adds r0, r5\n\ - ldrb r1, [r0]\n\ - ldrh r0, [r6, 0x30]\n\ - adds r1, r0\n\ - lsls r1, 24\n\ - lsrs r1, 24\n\ - ldr r4, _0808F164 @ =gSineTable\n\ - lsls r0, r1, 1\n\ - adds r0, r4\n\ - ldrh r3, [r0]\n\ - adds r1, 0x40\n\ - lsls r1, 1\n\ - adds r1, r4\n\ - ldrh r0, [r6, 0x2E]\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - ldrh r1, [r1]\n\ - lsls r3, 16\n\ - lsrs r2, r3, 16\n\ - negs r3, r3\n\ - lsrs r3, 16\n\ - str r1, [sp]\n\ - bl SetOamMatrix\n\ - ldr r1, [r7]\n\ - adds r1, r5\n\ - ldrh r0, [r6, 0x30]\n\ - adds r0, 0x40\n\ - ldrb r1, [r1]\n\ - adds r0, r1\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - lsls r1, r0, 1\n\ - adds r1, r4\n\ - ldrh r3, [r1]\n\ - adds r0, 0x40\n\ - lsls r0, 1\n\ - adds r0, r4\n\ - movs r2, 0\n\ - ldrsh r1, [r0, r2]\n\ - lsls r0, r1, 2\n\ - adds r0, r1\n\ - lsls r0, 3\n\ - cmp r0, 0\n\ - bge _0808F140\n\ - adds r0, 0xFF\n\ -_0808F140:\n\ - asrs r0, 8\n\ - strh r0, [r6, 0x24]\n\ - lsls r1, r3, 16\n\ - asrs r1, 16\n\ - lsls r0, r1, 2\n\ - adds r0, r1\n\ - lsls r0, 3\n\ - cmp r0, 0\n\ - bge _0808F154\n\ - adds r0, 0xFF\n\ -_0808F154:\n\ - asrs r0, 8\n\ - strh r0, [r6, 0x26]\n\ -_0808F158:\n\ - add sp, 0x4\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - .align 2, 0\n\ -_0808F160: .4byte 0x0000062c\n\ -_0808F164: .4byte gSineTable\n\ - .syntax divided\n"); -} -#endif -void sub_808F168(struct Sprite *sprite) +static void sub_808F168(struct Sprite *sprite) { if (gPokedexView->unk64A != 0 && gPokedexView->unk64A != 3) { @@ -2936,7 +2888,7 @@ static u8 sub_808F210(struct PokedexListItem *item, u8 b) return taskId; } -bool8 sub_808F250(u8 taskId) +static bool8 sub_808F250(u8 taskId) { if (gTasks[taskId].data[0] == 0 && gTasks[taskId].func == Task_PageScreenProcessInput) return FALSE; @@ -2954,7 +2906,7 @@ static u8 sub_808F284(struct PokedexListItem *item, u8 b) return b; } -void Task_InitPageScreenMultistep(u8 taskId) +static void Task_InitPageScreenMultistep(u8 taskId) { switch (gMain.state) { @@ -3078,7 +3030,7 @@ void Task_InitPageScreenMultistep(u8 taskId) } } -void Task_PageScreenProcessInput(u8 taskId) +static void Task_PageScreenProcessInput(u8 taskId) { if (gTasks[taskId].data[0] != 0) { @@ -3146,19 +3098,19 @@ void Task_PageScreenProcessInput(u8 taskId) } } -void sub_808F888(u8 taskId) +static void sub_808F888(u8 taskId) { if (!gPaletteFade.active) gTasks[taskId].func = Task_InitPageScreenMultistep; } -void Task_ClosePageScreen(u8 taskId) +static void Task_ClosePageScreen(u8 taskId) { if (!gPaletteFade.active) DestroyTask(taskId); } -void Task_InitAreaScreenMultistep(u8 taskId) +static void Task_InitAreaScreenMultistep(u8 taskId) { switch (gMain.state) { @@ -3191,13 +3143,13 @@ void Task_InitAreaScreenMultistep(u8 taskId) } } -void Task_AreaScreenProcessInput(u8 taskId) +static void Task_AreaScreenProcessInput(u8 taskId) { if (gPokedexView->unk64F != 0) gTasks[taskId].func = sub_808FA00; } -void sub_808FA00(u8 taskId) +static void sub_808FA00(u8 taskId) { if (!gPaletteFade.active) { @@ -3214,7 +3166,7 @@ void sub_808FA00(u8 taskId) } } -void Task_InitCryScreenMultistep(u8 taskId) +static void Task_InitCryScreenMultistep(u8 taskId) { switch (gMain.state) { @@ -3312,7 +3264,7 @@ void Task_InitCryScreenMultistep(u8 taskId) } } -void Task_CryScreenProcessInput(u8 taskId) +static void Task_CryScreenProcessInput(u8 taskId) { sub_8119F88(0); @@ -3368,7 +3320,7 @@ void Task_CryScreenProcessInput(u8 taskId) } } -void sub_808FFBC(u8 taskId) +static void sub_808FFBC(u8 taskId) { if (!gPaletteFade.active) { @@ -3389,7 +3341,7 @@ void sub_808FFBC(u8 taskId) } } -void sub_8090040(u8 a) +static void sub_8090040(u8 a) { u16 unk; @@ -3400,7 +3352,7 @@ void sub_8090040(u8 a) LoadPalette(&unk, 0x5D, 2); } -void Task_InitSizeScreenMultistep(u8 taskId) +static void Task_InitSizeScreenMultistep(u8 taskId) { u8 spriteId; @@ -3490,7 +3442,7 @@ void Task_InitSizeScreenMultistep(u8 taskId) } } -void Task_SizeScreenProcessInput(u8 taskId) +static void Task_SizeScreenProcessInput(u8 taskId) { if (gMain.newKeys & B_BUTTON) { @@ -3509,7 +3461,7 @@ void Task_SizeScreenProcessInput(u8 taskId) } } -void sub_8090498(u8 taskId) +static void sub_8090498(u8 taskId) { if (!gPaletteFade.active) { @@ -3526,20 +3478,20 @@ void sub_8090498(u8 taskId) } } -void sub_80904FC(u16 a) +static void sub_80904FC(u16 a) { LZ77UnCompVram(gUnknown_08E96ACC, (void *)(VRAM + a * 0x800)); DmaClear16(3, (void *)(VRAM + a * 0x800 + 0xC0), 0x440); } -void sub_8090540(u16 a) +static void sub_8090540(u16 a) { LZ77UnCompVram(gUnknown_08E96B58, (void *)(VRAM + a * 0x800)); DmaClear16(3, (void *)(VRAM + a * 0x800 + 0xC0), 0x440); } #ifdef NONMATCHING -void sub_8090584(u8 a, u16 b) +static void sub_8090584(u8 a, u16 b) { u8 i; //r1 u8 j; //r3 @@ -3579,7 +3531,7 @@ void sub_8090584(u8 a, u16 b) } #else __attribute__((naked)) -void sub_8090584(u8 a, u16 b) +static void sub_8090584(u8 a, u16 b) { asm(".syntax unified\n\ push {r4-r7,lr}\n\ @@ -3685,7 +3637,7 @@ _08090640: .4byte 0x06000072\n\ //Nope, can't get this one to match, either. #ifdef NONMATCHING -void sub_8090644(u8 a, u16 b) +static void sub_8090644(u8 a, u16 b) { u8 i; u8 j; @@ -3723,7 +3675,7 @@ void sub_8090644(u8 a, u16 b) } #else __attribute__((naked)) -void sub_8090644(u8 a, u16 b) +static void sub_8090644(u8 a, u16 b) { asm(".syntax unified\n\ push {r4-r7,lr}\n\ @@ -3846,7 +3798,7 @@ u8 sub_809070C(u16 dexNum, u32 b, u32 c) return taskId; } -void sub_8090750(u8 taskId) +static void sub_8090750(u8 taskId) { u8 spriteId; u16 dexNum = gTasks[taskId].data[1]; @@ -3930,7 +3882,7 @@ void sub_8090750(u8 taskId) } } -void sub_8090A3C(u8 taskId) +static void sub_8090A3C(u8 taskId) { if (gMain.newKeys & B_BUTTON) { @@ -3967,7 +3919,7 @@ void sub_8090A3C(u8 taskId) LoadPalette(gPokedexMenu2_Pal + 1, 0x51, 14); } -void sub_8090B8C(u8 taskId) +static void sub_8090B8C(u8 taskId) { if (!gPaletteFade.active) { @@ -3990,7 +3942,7 @@ void sub_8090B8C(u8 taskId) } } -void sub_8090C28(struct Sprite *sprite) +static void sub_8090C28(struct Sprite *sprite) { if (sprite->pos1.x < 0x78) sprite->pos1.x += 2; @@ -4003,7 +3955,7 @@ void sub_8090C28(struct Sprite *sprite) sprite->pos1.y -= 1; } -void sub_8090C68(void) +static void sub_8090C68(void) { if (gUnknown_0202FFBC->owned) { @@ -4182,7 +4134,7 @@ u16 sub_8090FF4(void) return 1; } -void sub_8091060(u16 a) +static void sub_8091060(u16 a) { if (!(a & 0x100)) { @@ -4221,18 +4173,18 @@ void sub_8091060(u16 a) } } -void sub_8091154(u16 order, u8 b, u8 c) +static void sub_8091154(u16 order, u8 b, u8 c) { u8 str[4]; - str[0] = 0xA1 + order / 100; - str[1] = 0xA1 + (order % 100) / 10; - str[2] = 0xA1 + (order % 100) % 10; + str[0] = CHAR_0 + order / 100; + str[1] = CHAR_0 + (order % 100) / 10; + str[2] = CHAR_0 + (order % 100) % 10; str[3] = EOS; MenuPrint(str, b, c); } -u8 sub_80911C8(u16 num, u8 b, u8 c) +static u8 sub_80911C8(u16 num, u8 b, u8 c) { u8 str[11]; u8 i; @@ -4255,9 +4207,9 @@ u8 sub_80911C8(u16 num, u8 b, u8 c) return i; } -u8 sub_8091260(u16 num, u8 b, u8 c, u8 d) +static u8 sub_8091260(u16 num, u8 b, u8 c, u8 d) { - u8 str[40]; // Not exactly sure how long this needs to be + u8 str[40]; u8 *end; u8 i; @@ -4280,9 +4232,9 @@ u8 sub_8091260(u16 num, u8 b, u8 c, u8 d) return i; } -void sub_8091304(const u8 *name, u8 left, u8 top) +static void sub_8091304(const u8 *name, u8 left, u8 top) { - u8 str[32]; // Not exactly sure how long this needs to be + u8 str[32]; u8 i; #if ENGLISH u8 j; @@ -4341,7 +4293,7 @@ void unref_sub_80913A4(u16 a, u8 left, u8 top) #ifdef UNITS_IMPERIAL #define CHAR_PRIME (0xB4) #define CHAR_DOUBLE_PRIME (0xB2) -void sub_8091458(u16 height, u8 left, u8 top) +static void sub_8091458(u16 height, u8 left, u8 top) { u8 buffer[16]; u32 inches, feet; @@ -4374,14 +4326,14 @@ void sub_8091458(u16 height, u8 left, u8 top) MenuPrint(buffer, left, top); } #else -void sub_8091458(u16 height, u8 left, u8 top) +static void sub_8091458(u16 height, u8 left, u8 top) { unref_sub_80913A4(height, left, top); } #endif #ifdef UNITS_IMPERIAL -void sub_8091564(u16 weight, u8 left, u8 top) +static void sub_8091564(u16 weight, u8 left, u8 top) { u8 buffer[16]; u32 lbs; @@ -4444,7 +4396,7 @@ void sub_8091564(u16 weight, u8 left, u8 top) MenuPrint(buffer, left, top); } #else -void sub_8091564(u16 arg0, u8 left, u8 top) +static void sub_8091564(u16 arg0, u8 left, u8 top) { unref_sub_80913A4(arg0, left, top); } @@ -4483,7 +4435,7 @@ static void sub_8091738(u16 num, u16 b, u16 c) CpuCopy16(arr, (u16 *)(VRAM + b * 0x4000 + c * 0x20), 0x80); } -void sub_80917CC(u16 a, u16 b) +static void sub_80917CC(u16 a, u16 b) { *(u16 *)(VRAM + a * 0x800 + 0x232) = 0xF000 + b + 0; *(u16 *)(VRAM + a * 0x800 + 0x234) = 0xF000 + b + 1; @@ -4491,7 +4443,7 @@ void sub_80917CC(u16 a, u16 b) *(u16 *)(VRAM + a * 0x800 + 0x274) = 0xF000 + b + 3; } -u16 sub_8091818(u8 a, u16 b, u16 c, u16 d) +static u16 sub_8091818(u8 a, u16 b, u16 c, u16 d) { switch (a) { @@ -4523,7 +4475,7 @@ static void nullsub_59(struct Sprite *sprite) { } -void sub_8091878(u16 a, u8 b) +static void sub_8091878(u16 a, u8 b) { gUnknown_02024E8C = gUnknown_083B57A4; gUnknown_02024E8C.paletteTag = a; @@ -4531,7 +4483,7 @@ void sub_8091878(u16 a, u8 b) gUnknown_02024E8C.anims = gSpriteAnimTable_81E7C64; } -void sub_80918B0(u16 a, u8 b) +static void sub_80918B0(u16 a, u8 b) { gUnknown_02024E8C = gUnknown_083B57A4; gUnknown_02024E8C.paletteTag = a; @@ -4585,7 +4537,7 @@ u16 sub_80918EC(u16 num, s16 x, s16 y, u16 paletteNum) return spriteId; } -u8 sub_8091A4C(u16 gender, s16 x, s16 y, u16 paletteNum) +static u8 sub_8091A4C(u16 gender, s16 x, s16 y, u16 paletteNum) { u8 spriteId; -- cgit v1.2.3 From 3344d86d906405843827c098b3da98b7f7855df1 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Thu, 15 Jun 2017 19:37:42 -0500 Subject: move trig data to C --- src/trig.c | 510 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 509 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/trig.c b/src/trig.c index d64231087..bfaeb16e8 100644 --- a/src/trig.c +++ b/src/trig.c @@ -1,7 +1,515 @@ #include "global.h" #include "trig.h" -extern s16 gSineDegreeTable[]; +// values of sin(x*(Ï€/128)) as Q8.8 fixed-point numbers from x = 0 to x = 319 +const s16 gSineTable[] = +{ + 0x0000, // sin(0*(Ï€/128)) = 0 + 0x0006, // sin(1*(Ï€/128)) = 0.0234375 + 0x000C, // sin(2*(Ï€/128)) = 0.046875 + 0x0012, // sin(3*(Ï€/128)) = 0.0703125 + 0x0019, // sin(4*(Ï€/128)) = 0.09765625 + 0x001F, // sin(5*(Ï€/128)) = 0.12109375 + 0x0025, // sin(6*(Ï€/128)) = 0.14453125 + 0x002B, // sin(7*(Ï€/128)) = 0.16796875 + 0x0031, // sin(8*(Ï€/128)) = 0.19140625 + 0x0038, // sin(9*(Ï€/128)) = 0.21875 + 0x003E, // sin(10*(Ï€/128)) = 0.2421875 + 0x0044, // sin(11*(Ï€/128)) = 0.265625 + 0x004A, // sin(12*(Ï€/128)) = 0.2890625 + 0x0050, // sin(13*(Ï€/128)) = 0.3125 + 0x0056, // sin(14*(Ï€/128)) = 0.3359375 + 0x005C, // sin(15*(Ï€/128)) = 0.359375 + 0x0061, // sin(16*(Ï€/128)) = 0.37890625 + 0x0067, // sin(17*(Ï€/128)) = 0.40234375 + 0x006D, // sin(18*(Ï€/128)) = 0.42578125 + 0x0073, // sin(19*(Ï€/128)) = 0.44921875 + 0x0078, // sin(20*(Ï€/128)) = 0.46875 + 0x007E, // sin(21*(Ï€/128)) = 0.4921875 + 0x0083, // sin(22*(Ï€/128)) = 0.51171875 + 0x0088, // sin(23*(Ï€/128)) = 0.53125 + 0x008E, // sin(24*(Ï€/128)) = 0.5546875 + 0x0093, // sin(25*(Ï€/128)) = 0.57421875 + 0x0098, // sin(26*(Ï€/128)) = 0.59375 + 0x009D, // sin(27*(Ï€/128)) = 0.61328125 + 0x00A2, // sin(28*(Ï€/128)) = 0.6328125 + 0x00A7, // sin(29*(Ï€/128)) = 0.65234375 + 0x00AB, // sin(30*(Ï€/128)) = 0.66796875 + 0x00B0, // sin(31*(Ï€/128)) = 0.6875 + 0x00B5, // sin(32*(Ï€/128)) = 0.70703125 + 0x00B9, // sin(33*(Ï€/128)) = 0.72265625 + 0x00BD, // sin(34*(Ï€/128)) = 0.73828125 + 0x00C1, // sin(35*(Ï€/128)) = 0.75390625 + 0x00C5, // sin(36*(Ï€/128)) = 0.76953125 + 0x00C9, // sin(37*(Ï€/128)) = 0.78515625 + 0x00CD, // sin(38*(Ï€/128)) = 0.80078125 + 0x00D1, // sin(39*(Ï€/128)) = 0.81640625 + 0x00D4, // sin(40*(Ï€/128)) = 0.828125 + 0x00D8, // sin(41*(Ï€/128)) = 0.84375 + 0x00DB, // sin(42*(Ï€/128)) = 0.85546875 + 0x00DE, // sin(43*(Ï€/128)) = 0.8671875 + 0x00E1, // sin(44*(Ï€/128)) = 0.87890625 + 0x00E4, // sin(45*(Ï€/128)) = 0.890625 + 0x00E7, // sin(46*(Ï€/128)) = 0.90234375 + 0x00EA, // sin(47*(Ï€/128)) = 0.9140625 + 0x00EC, // sin(48*(Ï€/128)) = 0.921875 + 0x00EE, // sin(49*(Ï€/128)) = 0.9296875 + 0x00F1, // sin(50*(Ï€/128)) = 0.94140625 + 0x00F3, // sin(51*(Ï€/128)) = 0.94921875 + 0x00F4, // sin(52*(Ï€/128)) = 0.953125 + 0x00F6, // sin(53*(Ï€/128)) = 0.9609375 + 0x00F8, // sin(54*(Ï€/128)) = 0.96875 + 0x00F9, // sin(55*(Ï€/128)) = 0.97265625 + 0x00FB, // sin(56*(Ï€/128)) = 0.98046875 + 0x00FC, // sin(57*(Ï€/128)) = 0.984375 + 0x00FD, // sin(58*(Ï€/128)) = 0.98828125 + 0x00FE, // sin(59*(Ï€/128)) = 0.9921875 + 0x00FE, // sin(60*(Ï€/128)) = 0.9921875 + 0x00FF, // sin(61*(Ï€/128)) = 0.99609375 + 0x00FF, // sin(62*(Ï€/128)) = 0.99609375 + 0x00FF, // sin(63*(Ï€/128)) = 0.99609375 + 0x0100, // sin(64*(Ï€/128)) = 1 + 0x00FF, // sin(65*(Ï€/128)) = 0.99609375 + 0x00FF, // sin(66*(Ï€/128)) = 0.99609375 + 0x00FF, // sin(67*(Ï€/128)) = 0.99609375 + 0x00FE, // sin(68*(Ï€/128)) = 0.9921875 + 0x00FE, // sin(69*(Ï€/128)) = 0.9921875 + 0x00FD, // sin(70*(Ï€/128)) = 0.98828125 + 0x00FC, // sin(71*(Ï€/128)) = 0.984375 + 0x00FB, // sin(72*(Ï€/128)) = 0.98046875 + 0x00F9, // sin(73*(Ï€/128)) = 0.97265625 + 0x00F8, // sin(74*(Ï€/128)) = 0.96875 + 0x00F6, // sin(75*(Ï€/128)) = 0.9609375 + 0x00F4, // sin(76*(Ï€/128)) = 0.953125 + 0x00F3, // sin(77*(Ï€/128)) = 0.94921875 + 0x00F1, // sin(78*(Ï€/128)) = 0.94140625 + 0x00EE, // sin(79*(Ï€/128)) = 0.9296875 + 0x00EC, // sin(80*(Ï€/128)) = 0.921875 + 0x00EA, // sin(81*(Ï€/128)) = 0.9140625 + 0x00E7, // sin(82*(Ï€/128)) = 0.90234375 + 0x00E4, // sin(83*(Ï€/128)) = 0.890625 + 0x00E1, // sin(84*(Ï€/128)) = 0.87890625 + 0x00DE, // sin(85*(Ï€/128)) = 0.8671875 + 0x00DB, // sin(86*(Ï€/128)) = 0.85546875 + 0x00D8, // sin(87*(Ï€/128)) = 0.84375 + 0x00D4, // sin(88*(Ï€/128)) = 0.828125 + 0x00D1, // sin(89*(Ï€/128)) = 0.81640625 + 0x00CD, // sin(90*(Ï€/128)) = 0.80078125 + 0x00C9, // sin(91*(Ï€/128)) = 0.78515625 + 0x00C5, // sin(92*(Ï€/128)) = 0.76953125 + 0x00C1, // sin(93*(Ï€/128)) = 0.75390625 + 0x00BD, // sin(94*(Ï€/128)) = 0.73828125 + 0x00B9, // sin(95*(Ï€/128)) = 0.72265625 + 0x00B5, // sin(96*(Ï€/128)) = 0.70703125 + 0x00B0, // sin(97*(Ï€/128)) = 0.6875 + 0x00AB, // sin(98*(Ï€/128)) = 0.66796875 + 0x00A7, // sin(99*(Ï€/128)) = 0.65234375 + 0x00A2, // sin(100*(Ï€/128)) = 0.6328125 + 0x009D, // sin(101*(Ï€/128)) = 0.61328125 + 0x0098, // sin(102*(Ï€/128)) = 0.59375 + 0x0093, // sin(103*(Ï€/128)) = 0.57421875 + 0x008E, // sin(104*(Ï€/128)) = 0.5546875 + 0x0088, // sin(105*(Ï€/128)) = 0.53125 + 0x0083, // sin(106*(Ï€/128)) = 0.51171875 + 0x007E, // sin(107*(Ï€/128)) = 0.4921875 + 0x0078, // sin(108*(Ï€/128)) = 0.46875 + 0x0073, // sin(109*(Ï€/128)) = 0.44921875 + 0x006D, // sin(110*(Ï€/128)) = 0.42578125 + 0x0067, // sin(111*(Ï€/128)) = 0.40234375 + 0x0061, // sin(112*(Ï€/128)) = 0.37890625 + 0x005C, // sin(113*(Ï€/128)) = 0.359375 + 0x0056, // sin(114*(Ï€/128)) = 0.3359375 + 0x0050, // sin(115*(Ï€/128)) = 0.3125 + 0x004A, // sin(116*(Ï€/128)) = 0.2890625 + 0x0044, // sin(117*(Ï€/128)) = 0.265625 + 0x003E, // sin(118*(Ï€/128)) = 0.2421875 + 0x0038, // sin(119*(Ï€/128)) = 0.21875 + 0x0031, // sin(120*(Ï€/128)) = 0.19140625 + 0x002B, // sin(121*(Ï€/128)) = 0.16796875 + 0x0025, // sin(122*(Ï€/128)) = 0.14453125 + 0x001F, // sin(123*(Ï€/128)) = 0.12109375 + 0x0019, // sin(124*(Ï€/128)) = 0.09765625 + 0x0012, // sin(125*(Ï€/128)) = 0.0703125 + 0x000C, // sin(126*(Ï€/128)) = 0.046875 + 0x0006, // sin(127*(Ï€/128)) = 0.0234375 + 0x0000, // sin(128*(Ï€/128)) = 0 + 0xFFFA, // sin(129*(Ï€/128)) = -0.0234375 + 0xFFF4, // sin(130*(Ï€/128)) = -0.046875 + 0xFFEE, // sin(131*(Ï€/128)) = -0.0703125 + 0xFFE7, // sin(132*(Ï€/128)) = -0.09765625 + 0xFFE1, // sin(133*(Ï€/128)) = -0.12109375 + 0xFFDB, // sin(134*(Ï€/128)) = -0.14453125 + 0xFFD5, // sin(135*(Ï€/128)) = -0.16796875 + 0xFFCF, // sin(136*(Ï€/128)) = -0.19140625 + 0xFFC8, // sin(137*(Ï€/128)) = -0.21875 + 0xFFC2, // sin(138*(Ï€/128)) = -0.2421875 + 0xFFBC, // sin(139*(Ï€/128)) = -0.265625 + 0xFFB6, // sin(140*(Ï€/128)) = -0.2890625 + 0xFFB0, // sin(141*(Ï€/128)) = -0.3125 + 0xFFAA, // sin(142*(Ï€/128)) = -0.3359375 + 0xFFA4, // sin(143*(Ï€/128)) = -0.359375 + 0xFF9F, // sin(144*(Ï€/128)) = -0.37890625 + 0xFF99, // sin(145*(Ï€/128)) = -0.40234375 + 0xFF93, // sin(146*(Ï€/128)) = -0.42578125 + 0xFF8D, // sin(147*(Ï€/128)) = -0.44921875 + 0xFF88, // sin(148*(Ï€/128)) = -0.46875 + 0xFF82, // sin(149*(Ï€/128)) = -0.4921875 + 0xFF7D, // sin(150*(Ï€/128)) = -0.51171875 + 0xFF78, // sin(151*(Ï€/128)) = -0.53125 + 0xFF72, // sin(152*(Ï€/128)) = -0.5546875 + 0xFF6D, // sin(153*(Ï€/128)) = -0.57421875 + 0xFF68, // sin(154*(Ï€/128)) = -0.59375 + 0xFF63, // sin(155*(Ï€/128)) = -0.61328125 + 0xFF5E, // sin(156*(Ï€/128)) = -0.6328125 + 0xFF59, // sin(157*(Ï€/128)) = -0.65234375 + 0xFF55, // sin(158*(Ï€/128)) = -0.66796875 + 0xFF50, // sin(159*(Ï€/128)) = -0.6875 + 0xFF4B, // sin(160*(Ï€/128)) = -0.70703125 + 0xFF47, // sin(161*(Ï€/128)) = -0.72265625 + 0xFF43, // sin(162*(Ï€/128)) = -0.73828125 + 0xFF3F, // sin(163*(Ï€/128)) = -0.75390625 + 0xFF3B, // sin(164*(Ï€/128)) = -0.76953125 + 0xFF37, // sin(165*(Ï€/128)) = -0.78515625 + 0xFF33, // sin(166*(Ï€/128)) = -0.80078125 + 0xFF2F, // sin(167*(Ï€/128)) = -0.81640625 + 0xFF2C, // sin(168*(Ï€/128)) = -0.828125 + 0xFF28, // sin(169*(Ï€/128)) = -0.84375 + 0xFF25, // sin(170*(Ï€/128)) = -0.85546875 + 0xFF22, // sin(171*(Ï€/128)) = -0.8671875 + 0xFF1F, // sin(172*(Ï€/128)) = -0.87890625 + 0xFF1C, // sin(173*(Ï€/128)) = -0.890625 + 0xFF19, // sin(174*(Ï€/128)) = -0.90234375 + 0xFF16, // sin(175*(Ï€/128)) = -0.9140625 + 0xFF14, // sin(176*(Ï€/128)) = -0.921875 + 0xFF12, // sin(177*(Ï€/128)) = -0.9296875 + 0xFF0F, // sin(178*(Ï€/128)) = -0.94140625 + 0xFF0D, // sin(179*(Ï€/128)) = -0.94921875 + 0xFF0C, // sin(180*(Ï€/128)) = -0.953125 + 0xFF0A, // sin(181*(Ï€/128)) = -0.9609375 + 0xFF08, // sin(182*(Ï€/128)) = -0.96875 + 0xFF07, // sin(183*(Ï€/128)) = -0.97265625 + 0xFF05, // sin(184*(Ï€/128)) = -0.98046875 + 0xFF04, // sin(185*(Ï€/128)) = -0.984375 + 0xFF03, // sin(186*(Ï€/128)) = -0.98828125 + 0xFF02, // sin(187*(Ï€/128)) = -0.9921875 + 0xFF02, // sin(188*(Ï€/128)) = -0.9921875 + 0xFF01, // sin(189*(Ï€/128)) = -0.99609375 + 0xFF01, // sin(190*(Ï€/128)) = -0.99609375 + 0xFF01, // sin(191*(Ï€/128)) = -0.99609375 + 0xFF00, // sin(192*(Ï€/128)) = -1 + 0xFF01, // sin(193*(Ï€/128)) = -0.99609375 + 0xFF01, // sin(194*(Ï€/128)) = -0.99609375 + 0xFF01, // sin(195*(Ï€/128)) = -0.99609375 + 0xFF02, // sin(196*(Ï€/128)) = -0.9921875 + 0xFF02, // sin(197*(Ï€/128)) = -0.9921875 + 0xFF03, // sin(198*(Ï€/128)) = -0.98828125 + 0xFF04, // sin(199*(Ï€/128)) = -0.984375 + 0xFF05, // sin(200*(Ï€/128)) = -0.98046875 + 0xFF07, // sin(201*(Ï€/128)) = -0.97265625 + 0xFF08, // sin(202*(Ï€/128)) = -0.96875 + 0xFF0A, // sin(203*(Ï€/128)) = -0.9609375 + 0xFF0C, // sin(204*(Ï€/128)) = -0.953125 + 0xFF0D, // sin(205*(Ï€/128)) = -0.94921875 + 0xFF0F, // sin(206*(Ï€/128)) = -0.94140625 + 0xFF12, // sin(207*(Ï€/128)) = -0.9296875 + 0xFF14, // sin(208*(Ï€/128)) = -0.921875 + 0xFF16, // sin(209*(Ï€/128)) = -0.9140625 + 0xFF19, // sin(210*(Ï€/128)) = -0.90234375 + 0xFF1C, // sin(211*(Ï€/128)) = -0.890625 + 0xFF1F, // sin(212*(Ï€/128)) = -0.87890625 + 0xFF22, // sin(213*(Ï€/128)) = -0.8671875 + 0xFF25, // sin(214*(Ï€/128)) = -0.85546875 + 0xFF28, // sin(215*(Ï€/128)) = -0.84375 + 0xFF2C, // sin(216*(Ï€/128)) = -0.828125 + 0xFF2F, // sin(217*(Ï€/128)) = -0.81640625 + 0xFF33, // sin(218*(Ï€/128)) = -0.80078125 + 0xFF37, // sin(219*(Ï€/128)) = -0.78515625 + 0xFF3B, // sin(220*(Ï€/128)) = -0.76953125 + 0xFF3F, // sin(221*(Ï€/128)) = -0.75390625 + 0xFF43, // sin(222*(Ï€/128)) = -0.73828125 + 0xFF47, // sin(223*(Ï€/128)) = -0.72265625 + 0xFF4B, // sin(224*(Ï€/128)) = -0.70703125 + 0xFF50, // sin(225*(Ï€/128)) = -0.6875 + 0xFF55, // sin(226*(Ï€/128)) = -0.66796875 + 0xFF59, // sin(227*(Ï€/128)) = -0.65234375 + 0xFF5E, // sin(228*(Ï€/128)) = -0.6328125 + 0xFF63, // sin(229*(Ï€/128)) = -0.61328125 + 0xFF68, // sin(230*(Ï€/128)) = -0.59375 + 0xFF6D, // sin(231*(Ï€/128)) = -0.57421875 + 0xFF72, // sin(232*(Ï€/128)) = -0.5546875 + 0xFF78, // sin(233*(Ï€/128)) = -0.53125 + 0xFF7D, // sin(234*(Ï€/128)) = -0.51171875 + 0xFF82, // sin(235*(Ï€/128)) = -0.4921875 + 0xFF88, // sin(236*(Ï€/128)) = -0.46875 + 0xFF8D, // sin(237*(Ï€/128)) = -0.44921875 + 0xFF93, // sin(238*(Ï€/128)) = -0.42578125 + 0xFF99, // sin(239*(Ï€/128)) = -0.40234375 + 0xFF9F, // sin(240*(Ï€/128)) = -0.37890625 + 0xFFA4, // sin(241*(Ï€/128)) = -0.359375 + 0xFFAA, // sin(242*(Ï€/128)) = -0.3359375 + 0xFFB0, // sin(243*(Ï€/128)) = -0.3125 + 0xFFB6, // sin(244*(Ï€/128)) = -0.2890625 + 0xFFBC, // sin(245*(Ï€/128)) = -0.265625 + 0xFFC2, // sin(246*(Ï€/128)) = -0.2421875 + 0xFFC8, // sin(247*(Ï€/128)) = -0.21875 + 0xFFCF, // sin(248*(Ï€/128)) = -0.19140625 + 0xFFD5, // sin(249*(Ï€/128)) = -0.16796875 + 0xFFDB, // sin(250*(Ï€/128)) = -0.14453125 + 0xFFE1, // sin(251*(Ï€/128)) = -0.12109375 + 0xFFE7, // sin(252*(Ï€/128)) = -0.09765625 + 0xFFEE, // sin(253*(Ï€/128)) = -0.0703125 + 0xFFF4, // sin(254*(Ï€/128)) = -0.046875 + 0xFFFA, // sin(255*(Ï€/128)) = -0.0234375 + 0x0000, // sin(256*(Ï€/128)) = 0 + 0x0006, // sin(257*(Ï€/128)) = 0.0234375 + 0x000C, // sin(258*(Ï€/128)) = 0.046875 + 0x0012, // sin(259*(Ï€/128)) = 0.0703125 + 0x0019, // sin(260*(Ï€/128)) = 0.09765625 + 0x001F, // sin(261*(Ï€/128)) = 0.12109375 + 0x0025, // sin(262*(Ï€/128)) = 0.14453125 + 0x002B, // sin(263*(Ï€/128)) = 0.16796875 + 0x0031, // sin(264*(Ï€/128)) = 0.19140625 + 0x0038, // sin(265*(Ï€/128)) = 0.21875 + 0x003E, // sin(266*(Ï€/128)) = 0.2421875 + 0x0044, // sin(267*(Ï€/128)) = 0.265625 + 0x004A, // sin(268*(Ï€/128)) = 0.2890625 + 0x0050, // sin(269*(Ï€/128)) = 0.3125 + 0x0056, // sin(270*(Ï€/128)) = 0.3359375 + 0x005C, // sin(271*(Ï€/128)) = 0.359375 + 0x0061, // sin(272*(Ï€/128)) = 0.37890625 + 0x0067, // sin(273*(Ï€/128)) = 0.40234375 + 0x006D, // sin(274*(Ï€/128)) = 0.42578125 + 0x0073, // sin(275*(Ï€/128)) = 0.44921875 + 0x0078, // sin(276*(Ï€/128)) = 0.46875 + 0x007E, // sin(277*(Ï€/128)) = 0.4921875 + 0x0083, // sin(278*(Ï€/128)) = 0.51171875 + 0x0088, // sin(279*(Ï€/128)) = 0.53125 + 0x008E, // sin(280*(Ï€/128)) = 0.5546875 + 0x0093, // sin(281*(Ï€/128)) = 0.57421875 + 0x0098, // sin(282*(Ï€/128)) = 0.59375 + 0x009D, // sin(283*(Ï€/128)) = 0.61328125 + 0x00A2, // sin(284*(Ï€/128)) = 0.6328125 + 0x00A7, // sin(285*(Ï€/128)) = 0.65234375 + 0x00AB, // sin(286*(Ï€/128)) = 0.66796875 + 0x00B0, // sin(287*(Ï€/128)) = 0.6875 + 0x00B5, // sin(288*(Ï€/128)) = 0.70703125 + 0x00B9, // sin(289*(Ï€/128)) = 0.72265625 + 0x00BD, // sin(290*(Ï€/128)) = 0.73828125 + 0x00C1, // sin(291*(Ï€/128)) = 0.75390625 + 0x00C5, // sin(292*(Ï€/128)) = 0.76953125 + 0x00C9, // sin(293*(Ï€/128)) = 0.78515625 + 0x00CD, // sin(294*(Ï€/128)) = 0.80078125 + 0x00D1, // sin(295*(Ï€/128)) = 0.81640625 + 0x00D4, // sin(296*(Ï€/128)) = 0.828125 + 0x00D8, // sin(297*(Ï€/128)) = 0.84375 + 0x00DB, // sin(298*(Ï€/128)) = 0.85546875 + 0x00DE, // sin(299*(Ï€/128)) = 0.8671875 + 0x00E1, // sin(300*(Ï€/128)) = 0.87890625 + 0x00E4, // sin(301*(Ï€/128)) = 0.890625 + 0x00E7, // sin(302*(Ï€/128)) = 0.90234375 + 0x00EA, // sin(303*(Ï€/128)) = 0.9140625 + 0x00EC, // sin(304*(Ï€/128)) = 0.921875 + 0x00EE, // sin(305*(Ï€/128)) = 0.9296875 + 0x00F1, // sin(306*(Ï€/128)) = 0.94140625 + 0x00F3, // sin(307*(Ï€/128)) = 0.94921875 + 0x00F4, // sin(308*(Ï€/128)) = 0.953125 + 0x00F6, // sin(309*(Ï€/128)) = 0.9609375 + 0x00F8, // sin(310*(Ï€/128)) = 0.96875 + 0x00F9, // sin(311*(Ï€/128)) = 0.97265625 + 0x00FB, // sin(312*(Ï€/128)) = 0.98046875 + 0x00FC, // sin(313*(Ï€/128)) = 0.984375 + 0x00FD, // sin(314*(Ï€/128)) = 0.98828125 + 0x00FE, // sin(315*(Ï€/128)) = 0.9921875 + 0x00FE, // sin(316*(Ï€/128)) = 0.9921875 + 0x00FF, // sin(317*(Ï€/128)) = 0.99609375 + 0x00FF, // sin(318*(Ï€/128)) = 0.99609375 + 0x00FF, // sin(319*(Ï€/128)) = 0.99609375 +}; + +// values of sin(x) as Q4.12 fixed-point numbers from x = 0° to x = 179° +const s16 gSineDegreeTable[] = +{ + 0x0000, // sin(0°) = 0 + 0x0047, // sin(1°) = 0.017333984375 + 0x008F, // sin(2°) = 0.034912109375 + 0x00D6, // sin(3°) = 0.05224609375 + 0x011E, // sin(4°) = 0.06982421875 + 0x0165, // sin(5°) = 0.087158203125 + 0x01AC, // sin(6°) = 0.1044921875 + 0x01F3, // sin(7°) = 0.121826171875 + 0x023A, // sin(8°) = 0.13916015625 + 0x0281, // sin(9°) = 0.156494140625 + 0x02C7, // sin(10°) = 0.173583984375 + 0x030E, // sin(11°) = 0.19091796875 + 0x0354, // sin(12°) = 0.2080078125 + 0x0399, // sin(13°) = 0.224853515625 + 0x03DF, // sin(14°) = 0.241943359375 + 0x0424, // sin(15°) = 0.2587890625 + 0x0469, // sin(16°) = 0.275634765625 + 0x04AE, // sin(17°) = 0.29248046875 + 0x04F2, // sin(18°) = 0.30908203125 + 0x0536, // sin(19°) = 0.32568359375 + 0x0579, // sin(20°) = 0.342041015625 + 0x05BC, // sin(21°) = 0.3583984375 + 0x05FE, // sin(22°) = 0.37451171875 + 0x0640, // sin(23°) = 0.390625 + 0x0682, // sin(24°) = 0.40673828125 + 0x06C3, // sin(25°) = 0.422607421875 + 0x0704, // sin(26°) = 0.4384765625 + 0x0744, // sin(27°) = 0.4541015625 + 0x0783, // sin(28°) = 0.469482421875 + 0x07C2, // sin(29°) = 0.48486328125 + 0x0800, // sin(30°) = 0.5 + 0x083E, // sin(31°) = 0.51513671875 + 0x087B, // sin(32°) = 0.530029296875 + 0x08B7, // sin(33°) = 0.544677734375 + 0x08F2, // sin(34°) = 0.55908203125 + 0x092D, // sin(35°) = 0.573486328125 + 0x0968, // sin(36°) = 0.587890625 + 0x09A1, // sin(37°) = 0.601806640625 + 0x09DA, // sin(38°) = 0.61572265625 + 0x0A12, // sin(39°) = 0.62939453125 + 0x0A49, // sin(40°) = 0.642822265625 + 0x0A7F, // sin(41°) = 0.656005859375 + 0x0AB5, // sin(42°) = 0.669189453125 + 0x0AE9, // sin(43°) = 0.681884765625 + 0x0B1D, // sin(44°) = 0.694580078125 + 0x0B50, // sin(45°) = 0.70703125 + 0x0B82, // sin(46°) = 0.71923828125 + 0x0BB4, // sin(47°) = 0.7314453125 + 0x0BE4, // sin(48°) = 0.7431640625 + 0x0C13, // sin(49°) = 0.754638671875 + 0x0C42, // sin(50°) = 0.76611328125 + 0x0C6F, // sin(51°) = 0.777099609375 + 0x0C9C, // sin(52°) = 0.7880859375 + 0x0CC7, // sin(53°) = 0.798583984375 + 0x0CF2, // sin(54°) = 0.80908203125 + 0x0D1B, // sin(55°) = 0.819091796875 + 0x0D44, // sin(56°) = 0.8291015625 + 0x0D6B, // sin(57°) = 0.838623046875 + 0x0D92, // sin(58°) = 0.84814453125 + 0x0DB7, // sin(59°) = 0.857177734375 + 0x0DDB, // sin(60°) = 0.865966796875 + 0x0DFE, // sin(61°) = 0.87451171875 + 0x0E21, // sin(62°) = 0.883056640625 + 0x0E42, // sin(63°) = 0.89111328125 + 0x0E61, // sin(64°) = 0.898681640625 + 0x0E80, // sin(65°) = 0.90625 + 0x0E9E, // sin(66°) = 0.91357421875 + 0x0EBA, // sin(67°) = 0.92041015625 + 0x0ED6, // sin(68°) = 0.92724609375 + 0x0EF0, // sin(69°) = 0.93359375 + 0x0F09, // sin(70°) = 0.939697265625 + 0x0F21, // sin(71°) = 0.945556640625 + 0x0F38, // sin(72°) = 0.951171875 + 0x0F4D, // sin(73°) = 0.956298828125 + 0x0F61, // sin(74°) = 0.961181640625 + 0x0F74, // sin(75°) = 0.9658203125 + 0x0F86, // sin(76°) = 0.97021484375 + 0x0F97, // sin(77°) = 0.974365234375 + 0x0FA6, // sin(78°) = 0.97802734375 + 0x0FB5, // sin(79°) = 0.981689453125 + 0x0FC2, // sin(80°) = 0.98486328125 + 0x0FCE, // sin(81°) = 0.98779296875 + 0x0FD8, // sin(82°) = 0.990234375 + 0x0FE1, // sin(83°) = 0.992431640625 + 0x0FE9, // sin(84°) = 0.994384765625 + 0x0FF0, // sin(85°) = 0.99609375 + 0x0FF6, // sin(86°) = 0.99755859375 + 0x0FFA, // sin(87°) = 0.99853515625 + 0x0FFD, // sin(88°) = 0.999267578125 + 0x0FFF, // sin(89°) = 0.999755859375 + 0x1000, // sin(90°) = 1 + 0x0FFF, // sin(91°) = 0.999755859375 + 0x0FFD, // sin(92°) = 0.999267578125 + 0x0FFA, // sin(93°) = 0.99853515625 + 0x0FF6, // sin(94°) = 0.99755859375 + 0x0FF0, // sin(95°) = 0.99609375 + 0x0FE9, // sin(96°) = 0.994384765625 + 0x0FE1, // sin(97°) = 0.992431640625 + 0x0FD8, // sin(98°) = 0.990234375 + 0x0FCE, // sin(99°) = 0.98779296875 + 0x0FC2, // sin(100°) = 0.98486328125 + 0x0FB5, // sin(101°) = 0.981689453125 + 0x0FA6, // sin(102°) = 0.97802734375 + 0x0F97, // sin(103°) = 0.974365234375 + 0x0F86, // sin(104°) = 0.97021484375 + 0x0F74, // sin(105°) = 0.9658203125 + 0x0F61, // sin(106°) = 0.961181640625 + 0x0F4D, // sin(107°) = 0.956298828125 + 0x0F38, // sin(108°) = 0.951171875 + 0x0F21, // sin(109°) = 0.945556640625 + 0x0F09, // sin(110°) = 0.939697265625 + 0x0EF0, // sin(111°) = 0.93359375 + 0x0ED6, // sin(112°) = 0.92724609375 + 0x0EBA, // sin(113°) = 0.92041015625 + 0x0E9E, // sin(114°) = 0.91357421875 + 0x0E80, // sin(115°) = 0.90625 + 0x0E61, // sin(116°) = 0.898681640625 + 0x0E42, // sin(117°) = 0.89111328125 + 0x0E21, // sin(118°) = 0.883056640625 + 0x0DFE, // sin(119°) = 0.87451171875 + 0x0DDB, // sin(120°) = 0.865966796875 + 0x0DB7, // sin(121°) = 0.857177734375 + 0x0D92, // sin(122°) = 0.84814453125 + 0x0D6B, // sin(123°) = 0.838623046875 + 0x0D44, // sin(124°) = 0.8291015625 + 0x0D1B, // sin(125°) = 0.819091796875 + 0x0CF2, // sin(126°) = 0.80908203125 + 0x0CC7, // sin(127°) = 0.798583984375 + 0x0C9C, // sin(128°) = 0.7880859375 + 0x0C6F, // sin(129°) = 0.777099609375 + 0x0C42, // sin(130°) = 0.76611328125 + 0x0C13, // sin(131°) = 0.754638671875 + 0x0BE4, // sin(132°) = 0.7431640625 + 0x0BB4, // sin(133°) = 0.7314453125 + 0x0B82, // sin(134°) = 0.71923828125 + 0x0B50, // sin(135°) = 0.70703125 + 0x0B1D, // sin(136°) = 0.694580078125 + 0x0AE9, // sin(137°) = 0.681884765625 + 0x0AB5, // sin(138°) = 0.669189453125 + 0x0A7F, // sin(139°) = 0.656005859375 + 0x0A49, // sin(140°) = 0.642822265625 + 0x0A12, // sin(141°) = 0.62939453125 + 0x09DA, // sin(142°) = 0.61572265625 + 0x09A1, // sin(143°) = 0.601806640625 + 0x0968, // sin(144°) = 0.587890625 + 0x092D, // sin(145°) = 0.573486328125 + 0x08F2, // sin(146°) = 0.55908203125 + 0x08B7, // sin(147°) = 0.544677734375 + 0x087B, // sin(148°) = 0.530029296875 + 0x083E, // sin(149°) = 0.51513671875 + 0x0800, // sin(150°) = 0.5 + 0x07C2, // sin(151°) = 0.48486328125 + 0x0783, // sin(152°) = 0.469482421875 + 0x0744, // sin(153°) = 0.4541015625 + 0x0704, // sin(154°) = 0.4384765625 + 0x06C3, // sin(155°) = 0.422607421875 + 0x0682, // sin(156°) = 0.40673828125 + 0x0640, // sin(157°) = 0.390625 + 0x05FE, // sin(158°) = 0.37451171875 + 0x05BC, // sin(159°) = 0.3583984375 + 0x0579, // sin(160°) = 0.342041015625 + 0x0536, // sin(161°) = 0.32568359375 + 0x04F2, // sin(162°) = 0.30908203125 + 0x04AE, // sin(163°) = 0.29248046875 + 0x0469, // sin(164°) = 0.275634765625 + 0x0424, // sin(165°) = 0.2587890625 + 0x03DF, // sin(166°) = 0.241943359375 + 0x0399, // sin(167°) = 0.224853515625 + 0x0354, // sin(168°) = 0.2080078125 + 0x030E, // sin(169°) = 0.19091796875 + 0x02C7, // sin(170°) = 0.173583984375 + 0x0281, // sin(171°) = 0.156494140625 + 0x023A, // sin(172°) = 0.13916015625 + 0x01F3, // sin(173°) = 0.121826171875 + 0x01AC, // sin(174°) = 0.1044921875 + 0x0165, // sin(175°) = 0.087158203125 + 0x011E, // sin(176°) = 0.06982421875 + 0x00D6, // sin(177°) = 0.05224609375 + 0x008F, // sin(178°) = 0.034912109375 + 0x0047, // sin(179°) = 0.017333984375 +}; // amplitude * sin(index*(Ï€/128)) s16 Sin(s16 index, s16 amplitude) -- cgit v1.2.3 From 61e65d1b8e266bfa8909ba0d010947dcbc70979c Mon Sep 17 00:00:00 2001 From: yenatch Date: Thu, 15 Jun 2017 21:57:45 -0400 Subject: 0x134 -> SPECIES_SPINDA --- src/pokedex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/pokedex.c b/src/pokedex.c index 92db38da9..be6ef03a9 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -4507,7 +4507,7 @@ u16 sub_80918EC(u16 num, s16 x, s16 y, u16 paletteNum) gUnknown_083B5584[paletteNum], num); break; - case 0x134: + case SPECIES_SPINDA: LoadSpecialPokePic( &gMonFrontPicTable[num], gMonFrontPicCoords[num].coords, -- cgit v1.2.3 From 2c6e9e9bc5c4a88ae50f17c5bd22e59328da074b Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Thu, 15 Jun 2017 21:29:45 -0500 Subject: use macros to convert floating point to fixed point --- src/trig.c | 1008 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 507 insertions(+), 501 deletions(-) (limited to 'src') diff --git a/src/trig.c b/src/trig.c index bfaeb16e8..e16a69e63 100644 --- a/src/trig.c +++ b/src/trig.c @@ -1,514 +1,520 @@ #include "global.h" #include "trig.h" -// values of sin(x*(Ï€/128)) as Q8.8 fixed-point numbers from x = 0 to x = 319 +// Converts a number to Q8.8 fixed-point format +#define Q_8_8(n) ((s16)((n) * 256)) + +// Converts a number to Q4.12 fixed-point format +#define Q_4_12(n) ((s16)((n) * 4096)) + +// Values of sin(x*(Ï€/128)) as Q8.8 fixed-point numbers from x = 0 to x = 319 const s16 gSineTable[] = { - 0x0000, // sin(0*(Ï€/128)) = 0 - 0x0006, // sin(1*(Ï€/128)) = 0.0234375 - 0x000C, // sin(2*(Ï€/128)) = 0.046875 - 0x0012, // sin(3*(Ï€/128)) = 0.0703125 - 0x0019, // sin(4*(Ï€/128)) = 0.09765625 - 0x001F, // sin(5*(Ï€/128)) = 0.12109375 - 0x0025, // sin(6*(Ï€/128)) = 0.14453125 - 0x002B, // sin(7*(Ï€/128)) = 0.16796875 - 0x0031, // sin(8*(Ï€/128)) = 0.19140625 - 0x0038, // sin(9*(Ï€/128)) = 0.21875 - 0x003E, // sin(10*(Ï€/128)) = 0.2421875 - 0x0044, // sin(11*(Ï€/128)) = 0.265625 - 0x004A, // sin(12*(Ï€/128)) = 0.2890625 - 0x0050, // sin(13*(Ï€/128)) = 0.3125 - 0x0056, // sin(14*(Ï€/128)) = 0.3359375 - 0x005C, // sin(15*(Ï€/128)) = 0.359375 - 0x0061, // sin(16*(Ï€/128)) = 0.37890625 - 0x0067, // sin(17*(Ï€/128)) = 0.40234375 - 0x006D, // sin(18*(Ï€/128)) = 0.42578125 - 0x0073, // sin(19*(Ï€/128)) = 0.44921875 - 0x0078, // sin(20*(Ï€/128)) = 0.46875 - 0x007E, // sin(21*(Ï€/128)) = 0.4921875 - 0x0083, // sin(22*(Ï€/128)) = 0.51171875 - 0x0088, // sin(23*(Ï€/128)) = 0.53125 - 0x008E, // sin(24*(Ï€/128)) = 0.5546875 - 0x0093, // sin(25*(Ï€/128)) = 0.57421875 - 0x0098, // sin(26*(Ï€/128)) = 0.59375 - 0x009D, // sin(27*(Ï€/128)) = 0.61328125 - 0x00A2, // sin(28*(Ï€/128)) = 0.6328125 - 0x00A7, // sin(29*(Ï€/128)) = 0.65234375 - 0x00AB, // sin(30*(Ï€/128)) = 0.66796875 - 0x00B0, // sin(31*(Ï€/128)) = 0.6875 - 0x00B5, // sin(32*(Ï€/128)) = 0.70703125 - 0x00B9, // sin(33*(Ï€/128)) = 0.72265625 - 0x00BD, // sin(34*(Ï€/128)) = 0.73828125 - 0x00C1, // sin(35*(Ï€/128)) = 0.75390625 - 0x00C5, // sin(36*(Ï€/128)) = 0.76953125 - 0x00C9, // sin(37*(Ï€/128)) = 0.78515625 - 0x00CD, // sin(38*(Ï€/128)) = 0.80078125 - 0x00D1, // sin(39*(Ï€/128)) = 0.81640625 - 0x00D4, // sin(40*(Ï€/128)) = 0.828125 - 0x00D8, // sin(41*(Ï€/128)) = 0.84375 - 0x00DB, // sin(42*(Ï€/128)) = 0.85546875 - 0x00DE, // sin(43*(Ï€/128)) = 0.8671875 - 0x00E1, // sin(44*(Ï€/128)) = 0.87890625 - 0x00E4, // sin(45*(Ï€/128)) = 0.890625 - 0x00E7, // sin(46*(Ï€/128)) = 0.90234375 - 0x00EA, // sin(47*(Ï€/128)) = 0.9140625 - 0x00EC, // sin(48*(Ï€/128)) = 0.921875 - 0x00EE, // sin(49*(Ï€/128)) = 0.9296875 - 0x00F1, // sin(50*(Ï€/128)) = 0.94140625 - 0x00F3, // sin(51*(Ï€/128)) = 0.94921875 - 0x00F4, // sin(52*(Ï€/128)) = 0.953125 - 0x00F6, // sin(53*(Ï€/128)) = 0.9609375 - 0x00F8, // sin(54*(Ï€/128)) = 0.96875 - 0x00F9, // sin(55*(Ï€/128)) = 0.97265625 - 0x00FB, // sin(56*(Ï€/128)) = 0.98046875 - 0x00FC, // sin(57*(Ï€/128)) = 0.984375 - 0x00FD, // sin(58*(Ï€/128)) = 0.98828125 - 0x00FE, // sin(59*(Ï€/128)) = 0.9921875 - 0x00FE, // sin(60*(Ï€/128)) = 0.9921875 - 0x00FF, // sin(61*(Ï€/128)) = 0.99609375 - 0x00FF, // sin(62*(Ï€/128)) = 0.99609375 - 0x00FF, // sin(63*(Ï€/128)) = 0.99609375 - 0x0100, // sin(64*(Ï€/128)) = 1 - 0x00FF, // sin(65*(Ï€/128)) = 0.99609375 - 0x00FF, // sin(66*(Ï€/128)) = 0.99609375 - 0x00FF, // sin(67*(Ï€/128)) = 0.99609375 - 0x00FE, // sin(68*(Ï€/128)) = 0.9921875 - 0x00FE, // sin(69*(Ï€/128)) = 0.9921875 - 0x00FD, // sin(70*(Ï€/128)) = 0.98828125 - 0x00FC, // sin(71*(Ï€/128)) = 0.984375 - 0x00FB, // sin(72*(Ï€/128)) = 0.98046875 - 0x00F9, // sin(73*(Ï€/128)) = 0.97265625 - 0x00F8, // sin(74*(Ï€/128)) = 0.96875 - 0x00F6, // sin(75*(Ï€/128)) = 0.9609375 - 0x00F4, // sin(76*(Ï€/128)) = 0.953125 - 0x00F3, // sin(77*(Ï€/128)) = 0.94921875 - 0x00F1, // sin(78*(Ï€/128)) = 0.94140625 - 0x00EE, // sin(79*(Ï€/128)) = 0.9296875 - 0x00EC, // sin(80*(Ï€/128)) = 0.921875 - 0x00EA, // sin(81*(Ï€/128)) = 0.9140625 - 0x00E7, // sin(82*(Ï€/128)) = 0.90234375 - 0x00E4, // sin(83*(Ï€/128)) = 0.890625 - 0x00E1, // sin(84*(Ï€/128)) = 0.87890625 - 0x00DE, // sin(85*(Ï€/128)) = 0.8671875 - 0x00DB, // sin(86*(Ï€/128)) = 0.85546875 - 0x00D8, // sin(87*(Ï€/128)) = 0.84375 - 0x00D4, // sin(88*(Ï€/128)) = 0.828125 - 0x00D1, // sin(89*(Ï€/128)) = 0.81640625 - 0x00CD, // sin(90*(Ï€/128)) = 0.80078125 - 0x00C9, // sin(91*(Ï€/128)) = 0.78515625 - 0x00C5, // sin(92*(Ï€/128)) = 0.76953125 - 0x00C1, // sin(93*(Ï€/128)) = 0.75390625 - 0x00BD, // sin(94*(Ï€/128)) = 0.73828125 - 0x00B9, // sin(95*(Ï€/128)) = 0.72265625 - 0x00B5, // sin(96*(Ï€/128)) = 0.70703125 - 0x00B0, // sin(97*(Ï€/128)) = 0.6875 - 0x00AB, // sin(98*(Ï€/128)) = 0.66796875 - 0x00A7, // sin(99*(Ï€/128)) = 0.65234375 - 0x00A2, // sin(100*(Ï€/128)) = 0.6328125 - 0x009D, // sin(101*(Ï€/128)) = 0.61328125 - 0x0098, // sin(102*(Ï€/128)) = 0.59375 - 0x0093, // sin(103*(Ï€/128)) = 0.57421875 - 0x008E, // sin(104*(Ï€/128)) = 0.5546875 - 0x0088, // sin(105*(Ï€/128)) = 0.53125 - 0x0083, // sin(106*(Ï€/128)) = 0.51171875 - 0x007E, // sin(107*(Ï€/128)) = 0.4921875 - 0x0078, // sin(108*(Ï€/128)) = 0.46875 - 0x0073, // sin(109*(Ï€/128)) = 0.44921875 - 0x006D, // sin(110*(Ï€/128)) = 0.42578125 - 0x0067, // sin(111*(Ï€/128)) = 0.40234375 - 0x0061, // sin(112*(Ï€/128)) = 0.37890625 - 0x005C, // sin(113*(Ï€/128)) = 0.359375 - 0x0056, // sin(114*(Ï€/128)) = 0.3359375 - 0x0050, // sin(115*(Ï€/128)) = 0.3125 - 0x004A, // sin(116*(Ï€/128)) = 0.2890625 - 0x0044, // sin(117*(Ï€/128)) = 0.265625 - 0x003E, // sin(118*(Ï€/128)) = 0.2421875 - 0x0038, // sin(119*(Ï€/128)) = 0.21875 - 0x0031, // sin(120*(Ï€/128)) = 0.19140625 - 0x002B, // sin(121*(Ï€/128)) = 0.16796875 - 0x0025, // sin(122*(Ï€/128)) = 0.14453125 - 0x001F, // sin(123*(Ï€/128)) = 0.12109375 - 0x0019, // sin(124*(Ï€/128)) = 0.09765625 - 0x0012, // sin(125*(Ï€/128)) = 0.0703125 - 0x000C, // sin(126*(Ï€/128)) = 0.046875 - 0x0006, // sin(127*(Ï€/128)) = 0.0234375 - 0x0000, // sin(128*(Ï€/128)) = 0 - 0xFFFA, // sin(129*(Ï€/128)) = -0.0234375 - 0xFFF4, // sin(130*(Ï€/128)) = -0.046875 - 0xFFEE, // sin(131*(Ï€/128)) = -0.0703125 - 0xFFE7, // sin(132*(Ï€/128)) = -0.09765625 - 0xFFE1, // sin(133*(Ï€/128)) = -0.12109375 - 0xFFDB, // sin(134*(Ï€/128)) = -0.14453125 - 0xFFD5, // sin(135*(Ï€/128)) = -0.16796875 - 0xFFCF, // sin(136*(Ï€/128)) = -0.19140625 - 0xFFC8, // sin(137*(Ï€/128)) = -0.21875 - 0xFFC2, // sin(138*(Ï€/128)) = -0.2421875 - 0xFFBC, // sin(139*(Ï€/128)) = -0.265625 - 0xFFB6, // sin(140*(Ï€/128)) = -0.2890625 - 0xFFB0, // sin(141*(Ï€/128)) = -0.3125 - 0xFFAA, // sin(142*(Ï€/128)) = -0.3359375 - 0xFFA4, // sin(143*(Ï€/128)) = -0.359375 - 0xFF9F, // sin(144*(Ï€/128)) = -0.37890625 - 0xFF99, // sin(145*(Ï€/128)) = -0.40234375 - 0xFF93, // sin(146*(Ï€/128)) = -0.42578125 - 0xFF8D, // sin(147*(Ï€/128)) = -0.44921875 - 0xFF88, // sin(148*(Ï€/128)) = -0.46875 - 0xFF82, // sin(149*(Ï€/128)) = -0.4921875 - 0xFF7D, // sin(150*(Ï€/128)) = -0.51171875 - 0xFF78, // sin(151*(Ï€/128)) = -0.53125 - 0xFF72, // sin(152*(Ï€/128)) = -0.5546875 - 0xFF6D, // sin(153*(Ï€/128)) = -0.57421875 - 0xFF68, // sin(154*(Ï€/128)) = -0.59375 - 0xFF63, // sin(155*(Ï€/128)) = -0.61328125 - 0xFF5E, // sin(156*(Ï€/128)) = -0.6328125 - 0xFF59, // sin(157*(Ï€/128)) = -0.65234375 - 0xFF55, // sin(158*(Ï€/128)) = -0.66796875 - 0xFF50, // sin(159*(Ï€/128)) = -0.6875 - 0xFF4B, // sin(160*(Ï€/128)) = -0.70703125 - 0xFF47, // sin(161*(Ï€/128)) = -0.72265625 - 0xFF43, // sin(162*(Ï€/128)) = -0.73828125 - 0xFF3F, // sin(163*(Ï€/128)) = -0.75390625 - 0xFF3B, // sin(164*(Ï€/128)) = -0.76953125 - 0xFF37, // sin(165*(Ï€/128)) = -0.78515625 - 0xFF33, // sin(166*(Ï€/128)) = -0.80078125 - 0xFF2F, // sin(167*(Ï€/128)) = -0.81640625 - 0xFF2C, // sin(168*(Ï€/128)) = -0.828125 - 0xFF28, // sin(169*(Ï€/128)) = -0.84375 - 0xFF25, // sin(170*(Ï€/128)) = -0.85546875 - 0xFF22, // sin(171*(Ï€/128)) = -0.8671875 - 0xFF1F, // sin(172*(Ï€/128)) = -0.87890625 - 0xFF1C, // sin(173*(Ï€/128)) = -0.890625 - 0xFF19, // sin(174*(Ï€/128)) = -0.90234375 - 0xFF16, // sin(175*(Ï€/128)) = -0.9140625 - 0xFF14, // sin(176*(Ï€/128)) = -0.921875 - 0xFF12, // sin(177*(Ï€/128)) = -0.9296875 - 0xFF0F, // sin(178*(Ï€/128)) = -0.94140625 - 0xFF0D, // sin(179*(Ï€/128)) = -0.94921875 - 0xFF0C, // sin(180*(Ï€/128)) = -0.953125 - 0xFF0A, // sin(181*(Ï€/128)) = -0.9609375 - 0xFF08, // sin(182*(Ï€/128)) = -0.96875 - 0xFF07, // sin(183*(Ï€/128)) = -0.97265625 - 0xFF05, // sin(184*(Ï€/128)) = -0.98046875 - 0xFF04, // sin(185*(Ï€/128)) = -0.984375 - 0xFF03, // sin(186*(Ï€/128)) = -0.98828125 - 0xFF02, // sin(187*(Ï€/128)) = -0.9921875 - 0xFF02, // sin(188*(Ï€/128)) = -0.9921875 - 0xFF01, // sin(189*(Ï€/128)) = -0.99609375 - 0xFF01, // sin(190*(Ï€/128)) = -0.99609375 - 0xFF01, // sin(191*(Ï€/128)) = -0.99609375 - 0xFF00, // sin(192*(Ï€/128)) = -1 - 0xFF01, // sin(193*(Ï€/128)) = -0.99609375 - 0xFF01, // sin(194*(Ï€/128)) = -0.99609375 - 0xFF01, // sin(195*(Ï€/128)) = -0.99609375 - 0xFF02, // sin(196*(Ï€/128)) = -0.9921875 - 0xFF02, // sin(197*(Ï€/128)) = -0.9921875 - 0xFF03, // sin(198*(Ï€/128)) = -0.98828125 - 0xFF04, // sin(199*(Ï€/128)) = -0.984375 - 0xFF05, // sin(200*(Ï€/128)) = -0.98046875 - 0xFF07, // sin(201*(Ï€/128)) = -0.97265625 - 0xFF08, // sin(202*(Ï€/128)) = -0.96875 - 0xFF0A, // sin(203*(Ï€/128)) = -0.9609375 - 0xFF0C, // sin(204*(Ï€/128)) = -0.953125 - 0xFF0D, // sin(205*(Ï€/128)) = -0.94921875 - 0xFF0F, // sin(206*(Ï€/128)) = -0.94140625 - 0xFF12, // sin(207*(Ï€/128)) = -0.9296875 - 0xFF14, // sin(208*(Ï€/128)) = -0.921875 - 0xFF16, // sin(209*(Ï€/128)) = -0.9140625 - 0xFF19, // sin(210*(Ï€/128)) = -0.90234375 - 0xFF1C, // sin(211*(Ï€/128)) = -0.890625 - 0xFF1F, // sin(212*(Ï€/128)) = -0.87890625 - 0xFF22, // sin(213*(Ï€/128)) = -0.8671875 - 0xFF25, // sin(214*(Ï€/128)) = -0.85546875 - 0xFF28, // sin(215*(Ï€/128)) = -0.84375 - 0xFF2C, // sin(216*(Ï€/128)) = -0.828125 - 0xFF2F, // sin(217*(Ï€/128)) = -0.81640625 - 0xFF33, // sin(218*(Ï€/128)) = -0.80078125 - 0xFF37, // sin(219*(Ï€/128)) = -0.78515625 - 0xFF3B, // sin(220*(Ï€/128)) = -0.76953125 - 0xFF3F, // sin(221*(Ï€/128)) = -0.75390625 - 0xFF43, // sin(222*(Ï€/128)) = -0.73828125 - 0xFF47, // sin(223*(Ï€/128)) = -0.72265625 - 0xFF4B, // sin(224*(Ï€/128)) = -0.70703125 - 0xFF50, // sin(225*(Ï€/128)) = -0.6875 - 0xFF55, // sin(226*(Ï€/128)) = -0.66796875 - 0xFF59, // sin(227*(Ï€/128)) = -0.65234375 - 0xFF5E, // sin(228*(Ï€/128)) = -0.6328125 - 0xFF63, // sin(229*(Ï€/128)) = -0.61328125 - 0xFF68, // sin(230*(Ï€/128)) = -0.59375 - 0xFF6D, // sin(231*(Ï€/128)) = -0.57421875 - 0xFF72, // sin(232*(Ï€/128)) = -0.5546875 - 0xFF78, // sin(233*(Ï€/128)) = -0.53125 - 0xFF7D, // sin(234*(Ï€/128)) = -0.51171875 - 0xFF82, // sin(235*(Ï€/128)) = -0.4921875 - 0xFF88, // sin(236*(Ï€/128)) = -0.46875 - 0xFF8D, // sin(237*(Ï€/128)) = -0.44921875 - 0xFF93, // sin(238*(Ï€/128)) = -0.42578125 - 0xFF99, // sin(239*(Ï€/128)) = -0.40234375 - 0xFF9F, // sin(240*(Ï€/128)) = -0.37890625 - 0xFFA4, // sin(241*(Ï€/128)) = -0.359375 - 0xFFAA, // sin(242*(Ï€/128)) = -0.3359375 - 0xFFB0, // sin(243*(Ï€/128)) = -0.3125 - 0xFFB6, // sin(244*(Ï€/128)) = -0.2890625 - 0xFFBC, // sin(245*(Ï€/128)) = -0.265625 - 0xFFC2, // sin(246*(Ï€/128)) = -0.2421875 - 0xFFC8, // sin(247*(Ï€/128)) = -0.21875 - 0xFFCF, // sin(248*(Ï€/128)) = -0.19140625 - 0xFFD5, // sin(249*(Ï€/128)) = -0.16796875 - 0xFFDB, // sin(250*(Ï€/128)) = -0.14453125 - 0xFFE1, // sin(251*(Ï€/128)) = -0.12109375 - 0xFFE7, // sin(252*(Ï€/128)) = -0.09765625 - 0xFFEE, // sin(253*(Ï€/128)) = -0.0703125 - 0xFFF4, // sin(254*(Ï€/128)) = -0.046875 - 0xFFFA, // sin(255*(Ï€/128)) = -0.0234375 - 0x0000, // sin(256*(Ï€/128)) = 0 - 0x0006, // sin(257*(Ï€/128)) = 0.0234375 - 0x000C, // sin(258*(Ï€/128)) = 0.046875 - 0x0012, // sin(259*(Ï€/128)) = 0.0703125 - 0x0019, // sin(260*(Ï€/128)) = 0.09765625 - 0x001F, // sin(261*(Ï€/128)) = 0.12109375 - 0x0025, // sin(262*(Ï€/128)) = 0.14453125 - 0x002B, // sin(263*(Ï€/128)) = 0.16796875 - 0x0031, // sin(264*(Ï€/128)) = 0.19140625 - 0x0038, // sin(265*(Ï€/128)) = 0.21875 - 0x003E, // sin(266*(Ï€/128)) = 0.2421875 - 0x0044, // sin(267*(Ï€/128)) = 0.265625 - 0x004A, // sin(268*(Ï€/128)) = 0.2890625 - 0x0050, // sin(269*(Ï€/128)) = 0.3125 - 0x0056, // sin(270*(Ï€/128)) = 0.3359375 - 0x005C, // sin(271*(Ï€/128)) = 0.359375 - 0x0061, // sin(272*(Ï€/128)) = 0.37890625 - 0x0067, // sin(273*(Ï€/128)) = 0.40234375 - 0x006D, // sin(274*(Ï€/128)) = 0.42578125 - 0x0073, // sin(275*(Ï€/128)) = 0.44921875 - 0x0078, // sin(276*(Ï€/128)) = 0.46875 - 0x007E, // sin(277*(Ï€/128)) = 0.4921875 - 0x0083, // sin(278*(Ï€/128)) = 0.51171875 - 0x0088, // sin(279*(Ï€/128)) = 0.53125 - 0x008E, // sin(280*(Ï€/128)) = 0.5546875 - 0x0093, // sin(281*(Ï€/128)) = 0.57421875 - 0x0098, // sin(282*(Ï€/128)) = 0.59375 - 0x009D, // sin(283*(Ï€/128)) = 0.61328125 - 0x00A2, // sin(284*(Ï€/128)) = 0.6328125 - 0x00A7, // sin(285*(Ï€/128)) = 0.65234375 - 0x00AB, // sin(286*(Ï€/128)) = 0.66796875 - 0x00B0, // sin(287*(Ï€/128)) = 0.6875 - 0x00B5, // sin(288*(Ï€/128)) = 0.70703125 - 0x00B9, // sin(289*(Ï€/128)) = 0.72265625 - 0x00BD, // sin(290*(Ï€/128)) = 0.73828125 - 0x00C1, // sin(291*(Ï€/128)) = 0.75390625 - 0x00C5, // sin(292*(Ï€/128)) = 0.76953125 - 0x00C9, // sin(293*(Ï€/128)) = 0.78515625 - 0x00CD, // sin(294*(Ï€/128)) = 0.80078125 - 0x00D1, // sin(295*(Ï€/128)) = 0.81640625 - 0x00D4, // sin(296*(Ï€/128)) = 0.828125 - 0x00D8, // sin(297*(Ï€/128)) = 0.84375 - 0x00DB, // sin(298*(Ï€/128)) = 0.85546875 - 0x00DE, // sin(299*(Ï€/128)) = 0.8671875 - 0x00E1, // sin(300*(Ï€/128)) = 0.87890625 - 0x00E4, // sin(301*(Ï€/128)) = 0.890625 - 0x00E7, // sin(302*(Ï€/128)) = 0.90234375 - 0x00EA, // sin(303*(Ï€/128)) = 0.9140625 - 0x00EC, // sin(304*(Ï€/128)) = 0.921875 - 0x00EE, // sin(305*(Ï€/128)) = 0.9296875 - 0x00F1, // sin(306*(Ï€/128)) = 0.94140625 - 0x00F3, // sin(307*(Ï€/128)) = 0.94921875 - 0x00F4, // sin(308*(Ï€/128)) = 0.953125 - 0x00F6, // sin(309*(Ï€/128)) = 0.9609375 - 0x00F8, // sin(310*(Ï€/128)) = 0.96875 - 0x00F9, // sin(311*(Ï€/128)) = 0.97265625 - 0x00FB, // sin(312*(Ï€/128)) = 0.98046875 - 0x00FC, // sin(313*(Ï€/128)) = 0.984375 - 0x00FD, // sin(314*(Ï€/128)) = 0.98828125 - 0x00FE, // sin(315*(Ï€/128)) = 0.9921875 - 0x00FE, // sin(316*(Ï€/128)) = 0.9921875 - 0x00FF, // sin(317*(Ï€/128)) = 0.99609375 - 0x00FF, // sin(318*(Ï€/128)) = 0.99609375 - 0x00FF, // sin(319*(Ï€/128)) = 0.99609375 + Q_8_8(0), // sin(0*(Ï€/128)) + Q_8_8(0.0234375), // sin(1*(Ï€/128)) + Q_8_8(0.046875), // sin(2*(Ï€/128)) + Q_8_8(0.0703125), // sin(3*(Ï€/128)) + Q_8_8(0.09765625), // sin(4*(Ï€/128)) + Q_8_8(0.12109375), // sin(5*(Ï€/128)) + Q_8_8(0.14453125), // sin(6*(Ï€/128)) + Q_8_8(0.16796875), // sin(7*(Ï€/128)) + Q_8_8(0.19140625), // sin(8*(Ï€/128)) + Q_8_8(0.21875), // sin(9*(Ï€/128)) + Q_8_8(0.2421875), // sin(10*(Ï€/128)) + Q_8_8(0.265625), // sin(11*(Ï€/128)) + Q_8_8(0.2890625), // sin(12*(Ï€/128)) + Q_8_8(0.3125), // sin(13*(Ï€/128)) + Q_8_8(0.3359375), // sin(14*(Ï€/128)) + Q_8_8(0.359375), // sin(15*(Ï€/128)) + Q_8_8(0.37890625), // sin(16*(Ï€/128)) + Q_8_8(0.40234375), // sin(17*(Ï€/128)) + Q_8_8(0.42578125), // sin(18*(Ï€/128)) + Q_8_8(0.44921875), // sin(19*(Ï€/128)) + Q_8_8(0.46875), // sin(20*(Ï€/128)) + Q_8_8(0.4921875), // sin(21*(Ï€/128)) + Q_8_8(0.51171875), // sin(22*(Ï€/128)) + Q_8_8(0.53125), // sin(23*(Ï€/128)) + Q_8_8(0.5546875), // sin(24*(Ï€/128)) + Q_8_8(0.57421875), // sin(25*(Ï€/128)) + Q_8_8(0.59375), // sin(26*(Ï€/128)) + Q_8_8(0.61328125), // sin(27*(Ï€/128)) + Q_8_8(0.6328125), // sin(28*(Ï€/128)) + Q_8_8(0.65234375), // sin(29*(Ï€/128)) + Q_8_8(0.66796875), // sin(30*(Ï€/128)) + Q_8_8(0.6875), // sin(31*(Ï€/128)) + Q_8_8(0.70703125), // sin(32*(Ï€/128)) + Q_8_8(0.72265625), // sin(33*(Ï€/128)) + Q_8_8(0.73828125), // sin(34*(Ï€/128)) + Q_8_8(0.75390625), // sin(35*(Ï€/128)) + Q_8_8(0.76953125), // sin(36*(Ï€/128)) + Q_8_8(0.78515625), // sin(37*(Ï€/128)) + Q_8_8(0.80078125), // sin(38*(Ï€/128)) + Q_8_8(0.81640625), // sin(39*(Ï€/128)) + Q_8_8(0.828125), // sin(40*(Ï€/128)) + Q_8_8(0.84375), // sin(41*(Ï€/128)) + Q_8_8(0.85546875), // sin(42*(Ï€/128)) + Q_8_8(0.8671875), // sin(43*(Ï€/128)) + Q_8_8(0.87890625), // sin(44*(Ï€/128)) + Q_8_8(0.890625), // sin(45*(Ï€/128)) + Q_8_8(0.90234375), // sin(46*(Ï€/128)) + Q_8_8(0.9140625), // sin(47*(Ï€/128)) + Q_8_8(0.921875), // sin(48*(Ï€/128)) + Q_8_8(0.9296875), // sin(49*(Ï€/128)) + Q_8_8(0.94140625), // sin(50*(Ï€/128)) + Q_8_8(0.94921875), // sin(51*(Ï€/128)) + Q_8_8(0.953125), // sin(52*(Ï€/128)) + Q_8_8(0.9609375), // sin(53*(Ï€/128)) + Q_8_8(0.96875), // sin(54*(Ï€/128)) + Q_8_8(0.97265625), // sin(55*(Ï€/128)) + Q_8_8(0.98046875), // sin(56*(Ï€/128)) + Q_8_8(0.984375), // sin(57*(Ï€/128)) + Q_8_8(0.98828125), // sin(58*(Ï€/128)) + Q_8_8(0.9921875), // sin(59*(Ï€/128)) + Q_8_8(0.9921875), // sin(60*(Ï€/128)) + Q_8_8(0.99609375), // sin(61*(Ï€/128)) + Q_8_8(0.99609375), // sin(62*(Ï€/128)) + Q_8_8(0.99609375), // sin(63*(Ï€/128)) + Q_8_8(1), // sin(64*(Ï€/128)) + Q_8_8(0.99609375), // sin(65*(Ï€/128)) + Q_8_8(0.99609375), // sin(66*(Ï€/128)) + Q_8_8(0.99609375), // sin(67*(Ï€/128)) + Q_8_8(0.9921875), // sin(68*(Ï€/128)) + Q_8_8(0.9921875), // sin(69*(Ï€/128)) + Q_8_8(0.98828125), // sin(70*(Ï€/128)) + Q_8_8(0.984375), // sin(71*(Ï€/128)) + Q_8_8(0.98046875), // sin(72*(Ï€/128)) + Q_8_8(0.97265625), // sin(73*(Ï€/128)) + Q_8_8(0.96875), // sin(74*(Ï€/128)) + Q_8_8(0.9609375), // sin(75*(Ï€/128)) + Q_8_8(0.953125), // sin(76*(Ï€/128)) + Q_8_8(0.94921875), // sin(77*(Ï€/128)) + Q_8_8(0.94140625), // sin(78*(Ï€/128)) + Q_8_8(0.9296875), // sin(79*(Ï€/128)) + Q_8_8(0.921875), // sin(80*(Ï€/128)) + Q_8_8(0.9140625), // sin(81*(Ï€/128)) + Q_8_8(0.90234375), // sin(82*(Ï€/128)) + Q_8_8(0.890625), // sin(83*(Ï€/128)) + Q_8_8(0.87890625), // sin(84*(Ï€/128)) + Q_8_8(0.8671875), // sin(85*(Ï€/128)) + Q_8_8(0.85546875), // sin(86*(Ï€/128)) + Q_8_8(0.84375), // sin(87*(Ï€/128)) + Q_8_8(0.828125), // sin(88*(Ï€/128)) + Q_8_8(0.81640625), // sin(89*(Ï€/128)) + Q_8_8(0.80078125), // sin(90*(Ï€/128)) + Q_8_8(0.78515625), // sin(91*(Ï€/128)) + Q_8_8(0.76953125), // sin(92*(Ï€/128)) + Q_8_8(0.75390625), // sin(93*(Ï€/128)) + Q_8_8(0.73828125), // sin(94*(Ï€/128)) + Q_8_8(0.72265625), // sin(95*(Ï€/128)) + Q_8_8(0.70703125), // sin(96*(Ï€/128)) + Q_8_8(0.6875), // sin(97*(Ï€/128)) + Q_8_8(0.66796875), // sin(98*(Ï€/128)) + Q_8_8(0.65234375), // sin(99*(Ï€/128)) + Q_8_8(0.6328125), // sin(100*(Ï€/128)) + Q_8_8(0.61328125), // sin(101*(Ï€/128)) + Q_8_8(0.59375), // sin(102*(Ï€/128)) + Q_8_8(0.57421875), // sin(103*(Ï€/128)) + Q_8_8(0.5546875), // sin(104*(Ï€/128)) + Q_8_8(0.53125), // sin(105*(Ï€/128)) + Q_8_8(0.51171875), // sin(106*(Ï€/128)) + Q_8_8(0.4921875), // sin(107*(Ï€/128)) + Q_8_8(0.46875), // sin(108*(Ï€/128)) + Q_8_8(0.44921875), // sin(109*(Ï€/128)) + Q_8_8(0.42578125), // sin(110*(Ï€/128)) + Q_8_8(0.40234375), // sin(111*(Ï€/128)) + Q_8_8(0.37890625), // sin(112*(Ï€/128)) + Q_8_8(0.359375), // sin(113*(Ï€/128)) + Q_8_8(0.3359375), // sin(114*(Ï€/128)) + Q_8_8(0.3125), // sin(115*(Ï€/128)) + Q_8_8(0.2890625), // sin(116*(Ï€/128)) + Q_8_8(0.265625), // sin(117*(Ï€/128)) + Q_8_8(0.2421875), // sin(118*(Ï€/128)) + Q_8_8(0.21875), // sin(119*(Ï€/128)) + Q_8_8(0.19140625), // sin(120*(Ï€/128)) + Q_8_8(0.16796875), // sin(121*(Ï€/128)) + Q_8_8(0.14453125), // sin(122*(Ï€/128)) + Q_8_8(0.12109375), // sin(123*(Ï€/128)) + Q_8_8(0.09765625), // sin(124*(Ï€/128)) + Q_8_8(0.0703125), // sin(125*(Ï€/128)) + Q_8_8(0.046875), // sin(126*(Ï€/128)) + Q_8_8(0.0234375), // sin(127*(Ï€/128)) + Q_8_8(0), // sin(128*(Ï€/128)) + Q_8_8(-0.0234375), // sin(129*(Ï€/128)) + Q_8_8(-0.046875), // sin(130*(Ï€/128)) + Q_8_8(-0.0703125), // sin(131*(Ï€/128)) + Q_8_8(-0.09765625), // sin(132*(Ï€/128)) + Q_8_8(-0.12109375), // sin(133*(Ï€/128)) + Q_8_8(-0.14453125), // sin(134*(Ï€/128)) + Q_8_8(-0.16796875), // sin(135*(Ï€/128)) + Q_8_8(-0.19140625), // sin(136*(Ï€/128)) + Q_8_8(-0.21875), // sin(137*(Ï€/128)) + Q_8_8(-0.2421875), // sin(138*(Ï€/128)) + Q_8_8(-0.265625), // sin(139*(Ï€/128)) + Q_8_8(-0.2890625), // sin(140*(Ï€/128)) + Q_8_8(-0.3125), // sin(141*(Ï€/128)) + Q_8_8(-0.3359375), // sin(142*(Ï€/128)) + Q_8_8(-0.359375), // sin(143*(Ï€/128)) + Q_8_8(-0.37890625), // sin(144*(Ï€/128)) + Q_8_8(-0.40234375), // sin(145*(Ï€/128)) + Q_8_8(-0.42578125), // sin(146*(Ï€/128)) + Q_8_8(-0.44921875), // sin(147*(Ï€/128)) + Q_8_8(-0.46875), // sin(148*(Ï€/128)) + Q_8_8(-0.4921875), // sin(149*(Ï€/128)) + Q_8_8(-0.51171875), // sin(150*(Ï€/128)) + Q_8_8(-0.53125), // sin(151*(Ï€/128)) + Q_8_8(-0.5546875), // sin(152*(Ï€/128)) + Q_8_8(-0.57421875), // sin(153*(Ï€/128)) + Q_8_8(-0.59375), // sin(154*(Ï€/128)) + Q_8_8(-0.61328125), // sin(155*(Ï€/128)) + Q_8_8(-0.6328125), // sin(156*(Ï€/128)) + Q_8_8(-0.65234375), // sin(157*(Ï€/128)) + Q_8_8(-0.66796875), // sin(158*(Ï€/128)) + Q_8_8(-0.6875), // sin(159*(Ï€/128)) + Q_8_8(-0.70703125), // sin(160*(Ï€/128)) + Q_8_8(-0.72265625), // sin(161*(Ï€/128)) + Q_8_8(-0.73828125), // sin(162*(Ï€/128)) + Q_8_8(-0.75390625), // sin(163*(Ï€/128)) + Q_8_8(-0.76953125), // sin(164*(Ï€/128)) + Q_8_8(-0.78515625), // sin(165*(Ï€/128)) + Q_8_8(-0.80078125), // sin(166*(Ï€/128)) + Q_8_8(-0.81640625), // sin(167*(Ï€/128)) + Q_8_8(-0.828125), // sin(168*(Ï€/128)) + Q_8_8(-0.84375), // sin(169*(Ï€/128)) + Q_8_8(-0.85546875), // sin(170*(Ï€/128)) + Q_8_8(-0.8671875), // sin(171*(Ï€/128)) + Q_8_8(-0.87890625), // sin(172*(Ï€/128)) + Q_8_8(-0.890625), // sin(173*(Ï€/128)) + Q_8_8(-0.90234375), // sin(174*(Ï€/128)) + Q_8_8(-0.9140625), // sin(175*(Ï€/128)) + Q_8_8(-0.921875), // sin(176*(Ï€/128)) + Q_8_8(-0.9296875), // sin(177*(Ï€/128)) + Q_8_8(-0.94140625), // sin(178*(Ï€/128)) + Q_8_8(-0.94921875), // sin(179*(Ï€/128)) + Q_8_8(-0.953125), // sin(180*(Ï€/128)) + Q_8_8(-0.9609375), // sin(181*(Ï€/128)) + Q_8_8(-0.96875), // sin(182*(Ï€/128)) + Q_8_8(-0.97265625), // sin(183*(Ï€/128)) + Q_8_8(-0.98046875), // sin(184*(Ï€/128)) + Q_8_8(-0.984375), // sin(185*(Ï€/128)) + Q_8_8(-0.98828125), // sin(186*(Ï€/128)) + Q_8_8(-0.9921875), // sin(187*(Ï€/128)) + Q_8_8(-0.9921875), // sin(188*(Ï€/128)) + Q_8_8(-0.99609375), // sin(189*(Ï€/128)) + Q_8_8(-0.99609375), // sin(190*(Ï€/128)) + Q_8_8(-0.99609375), // sin(191*(Ï€/128)) + Q_8_8(-1), // sin(192*(Ï€/128)) + Q_8_8(-0.99609375), // sin(193*(Ï€/128)) + Q_8_8(-0.99609375), // sin(194*(Ï€/128)) + Q_8_8(-0.99609375), // sin(195*(Ï€/128)) + Q_8_8(-0.9921875), // sin(196*(Ï€/128)) + Q_8_8(-0.9921875), // sin(197*(Ï€/128)) + Q_8_8(-0.98828125), // sin(198*(Ï€/128)) + Q_8_8(-0.984375), // sin(199*(Ï€/128)) + Q_8_8(-0.98046875), // sin(200*(Ï€/128)) + Q_8_8(-0.97265625), // sin(201*(Ï€/128)) + Q_8_8(-0.96875), // sin(202*(Ï€/128)) + Q_8_8(-0.9609375), // sin(203*(Ï€/128)) + Q_8_8(-0.953125), // sin(204*(Ï€/128)) + Q_8_8(-0.94921875), // sin(205*(Ï€/128)) + Q_8_8(-0.94140625), // sin(206*(Ï€/128)) + Q_8_8(-0.9296875), // sin(207*(Ï€/128)) + Q_8_8(-0.921875), // sin(208*(Ï€/128)) + Q_8_8(-0.9140625), // sin(209*(Ï€/128)) + Q_8_8(-0.90234375), // sin(210*(Ï€/128)) + Q_8_8(-0.890625), // sin(211*(Ï€/128)) + Q_8_8(-0.87890625), // sin(212*(Ï€/128)) + Q_8_8(-0.8671875), // sin(213*(Ï€/128)) + Q_8_8(-0.85546875), // sin(214*(Ï€/128)) + Q_8_8(-0.84375), // sin(215*(Ï€/128)) + Q_8_8(-0.828125), // sin(216*(Ï€/128)) + Q_8_8(-0.81640625), // sin(217*(Ï€/128)) + Q_8_8(-0.80078125), // sin(218*(Ï€/128)) + Q_8_8(-0.78515625), // sin(219*(Ï€/128)) + Q_8_8(-0.76953125), // sin(220*(Ï€/128)) + Q_8_8(-0.75390625), // sin(221*(Ï€/128)) + Q_8_8(-0.73828125), // sin(222*(Ï€/128)) + Q_8_8(-0.72265625), // sin(223*(Ï€/128)) + Q_8_8(-0.70703125), // sin(224*(Ï€/128)) + Q_8_8(-0.6875), // sin(225*(Ï€/128)) + Q_8_8(-0.66796875), // sin(226*(Ï€/128)) + Q_8_8(-0.65234375), // sin(227*(Ï€/128)) + Q_8_8(-0.6328125), // sin(228*(Ï€/128)) + Q_8_8(-0.61328125), // sin(229*(Ï€/128)) + Q_8_8(-0.59375), // sin(230*(Ï€/128)) + Q_8_8(-0.57421875), // sin(231*(Ï€/128)) + Q_8_8(-0.5546875), // sin(232*(Ï€/128)) + Q_8_8(-0.53125), // sin(233*(Ï€/128)) + Q_8_8(-0.51171875), // sin(234*(Ï€/128)) + Q_8_8(-0.4921875), // sin(235*(Ï€/128)) + Q_8_8(-0.46875), // sin(236*(Ï€/128)) + Q_8_8(-0.44921875), // sin(237*(Ï€/128)) + Q_8_8(-0.42578125), // sin(238*(Ï€/128)) + Q_8_8(-0.40234375), // sin(239*(Ï€/128)) + Q_8_8(-0.37890625), // sin(240*(Ï€/128)) + Q_8_8(-0.359375), // sin(241*(Ï€/128)) + Q_8_8(-0.3359375), // sin(242*(Ï€/128)) + Q_8_8(-0.3125), // sin(243*(Ï€/128)) + Q_8_8(-0.2890625), // sin(244*(Ï€/128)) + Q_8_8(-0.265625), // sin(245*(Ï€/128)) + Q_8_8(-0.2421875), // sin(246*(Ï€/128)) + Q_8_8(-0.21875), // sin(247*(Ï€/128)) + Q_8_8(-0.19140625), // sin(248*(Ï€/128)) + Q_8_8(-0.16796875), // sin(249*(Ï€/128)) + Q_8_8(-0.14453125), // sin(250*(Ï€/128)) + Q_8_8(-0.12109375), // sin(251*(Ï€/128)) + Q_8_8(-0.09765625), // sin(252*(Ï€/128)) + Q_8_8(-0.0703125), // sin(253*(Ï€/128)) + Q_8_8(-0.046875), // sin(254*(Ï€/128)) + Q_8_8(-0.0234375), // sin(255*(Ï€/128)) + Q_8_8(0), // sin(256*(Ï€/128)) + Q_8_8(0.0234375), // sin(257*(Ï€/128)) + Q_8_8(0.046875), // sin(258*(Ï€/128)) + Q_8_8(0.0703125), // sin(259*(Ï€/128)) + Q_8_8(0.09765625), // sin(260*(Ï€/128)) + Q_8_8(0.12109375), // sin(261*(Ï€/128)) + Q_8_8(0.14453125), // sin(262*(Ï€/128)) + Q_8_8(0.16796875), // sin(263*(Ï€/128)) + Q_8_8(0.19140625), // sin(264*(Ï€/128)) + Q_8_8(0.21875), // sin(265*(Ï€/128)) + Q_8_8(0.2421875), // sin(266*(Ï€/128)) + Q_8_8(0.265625), // sin(267*(Ï€/128)) + Q_8_8(0.2890625), // sin(268*(Ï€/128)) + Q_8_8(0.3125), // sin(269*(Ï€/128)) + Q_8_8(0.3359375), // sin(270*(Ï€/128)) + Q_8_8(0.359375), // sin(271*(Ï€/128)) + Q_8_8(0.37890625), // sin(272*(Ï€/128)) + Q_8_8(0.40234375), // sin(273*(Ï€/128)) + Q_8_8(0.42578125), // sin(274*(Ï€/128)) + Q_8_8(0.44921875), // sin(275*(Ï€/128)) + Q_8_8(0.46875), // sin(276*(Ï€/128)) + Q_8_8(0.4921875), // sin(277*(Ï€/128)) + Q_8_8(0.51171875), // sin(278*(Ï€/128)) + Q_8_8(0.53125), // sin(279*(Ï€/128)) + Q_8_8(0.5546875), // sin(280*(Ï€/128)) + Q_8_8(0.57421875), // sin(281*(Ï€/128)) + Q_8_8(0.59375), // sin(282*(Ï€/128)) + Q_8_8(0.61328125), // sin(283*(Ï€/128)) + Q_8_8(0.6328125), // sin(284*(Ï€/128)) + Q_8_8(0.65234375), // sin(285*(Ï€/128)) + Q_8_8(0.66796875), // sin(286*(Ï€/128)) + Q_8_8(0.6875), // sin(287*(Ï€/128)) + Q_8_8(0.70703125), // sin(288*(Ï€/128)) + Q_8_8(0.72265625), // sin(289*(Ï€/128)) + Q_8_8(0.73828125), // sin(290*(Ï€/128)) + Q_8_8(0.75390625), // sin(291*(Ï€/128)) + Q_8_8(0.76953125), // sin(292*(Ï€/128)) + Q_8_8(0.78515625), // sin(293*(Ï€/128)) + Q_8_8(0.80078125), // sin(294*(Ï€/128)) + Q_8_8(0.81640625), // sin(295*(Ï€/128)) + Q_8_8(0.828125), // sin(296*(Ï€/128)) + Q_8_8(0.84375), // sin(297*(Ï€/128)) + Q_8_8(0.85546875), // sin(298*(Ï€/128)) + Q_8_8(0.8671875), // sin(299*(Ï€/128)) + Q_8_8(0.87890625), // sin(300*(Ï€/128)) + Q_8_8(0.890625), // sin(301*(Ï€/128)) + Q_8_8(0.90234375), // sin(302*(Ï€/128)) + Q_8_8(0.9140625), // sin(303*(Ï€/128)) + Q_8_8(0.921875), // sin(304*(Ï€/128)) + Q_8_8(0.9296875), // sin(305*(Ï€/128)) + Q_8_8(0.94140625), // sin(306*(Ï€/128)) + Q_8_8(0.94921875), // sin(307*(Ï€/128)) + Q_8_8(0.953125), // sin(308*(Ï€/128)) + Q_8_8(0.9609375), // sin(309*(Ï€/128)) + Q_8_8(0.96875), // sin(310*(Ï€/128)) + Q_8_8(0.97265625), // sin(311*(Ï€/128)) + Q_8_8(0.98046875), // sin(312*(Ï€/128)) + Q_8_8(0.984375), // sin(313*(Ï€/128)) + Q_8_8(0.98828125), // sin(314*(Ï€/128)) + Q_8_8(0.9921875), // sin(315*(Ï€/128)) + Q_8_8(0.9921875), // sin(316*(Ï€/128)) + Q_8_8(0.99609375), // sin(317*(Ï€/128)) + Q_8_8(0.99609375), // sin(318*(Ï€/128)) + Q_8_8(0.99609375), // sin(319*(Ï€/128)) }; // values of sin(x) as Q4.12 fixed-point numbers from x = 0° to x = 179° const s16 gSineDegreeTable[] = { - 0x0000, // sin(0°) = 0 - 0x0047, // sin(1°) = 0.017333984375 - 0x008F, // sin(2°) = 0.034912109375 - 0x00D6, // sin(3°) = 0.05224609375 - 0x011E, // sin(4°) = 0.06982421875 - 0x0165, // sin(5°) = 0.087158203125 - 0x01AC, // sin(6°) = 0.1044921875 - 0x01F3, // sin(7°) = 0.121826171875 - 0x023A, // sin(8°) = 0.13916015625 - 0x0281, // sin(9°) = 0.156494140625 - 0x02C7, // sin(10°) = 0.173583984375 - 0x030E, // sin(11°) = 0.19091796875 - 0x0354, // sin(12°) = 0.2080078125 - 0x0399, // sin(13°) = 0.224853515625 - 0x03DF, // sin(14°) = 0.241943359375 - 0x0424, // sin(15°) = 0.2587890625 - 0x0469, // sin(16°) = 0.275634765625 - 0x04AE, // sin(17°) = 0.29248046875 - 0x04F2, // sin(18°) = 0.30908203125 - 0x0536, // sin(19°) = 0.32568359375 - 0x0579, // sin(20°) = 0.342041015625 - 0x05BC, // sin(21°) = 0.3583984375 - 0x05FE, // sin(22°) = 0.37451171875 - 0x0640, // sin(23°) = 0.390625 - 0x0682, // sin(24°) = 0.40673828125 - 0x06C3, // sin(25°) = 0.422607421875 - 0x0704, // sin(26°) = 0.4384765625 - 0x0744, // sin(27°) = 0.4541015625 - 0x0783, // sin(28°) = 0.469482421875 - 0x07C2, // sin(29°) = 0.48486328125 - 0x0800, // sin(30°) = 0.5 - 0x083E, // sin(31°) = 0.51513671875 - 0x087B, // sin(32°) = 0.530029296875 - 0x08B7, // sin(33°) = 0.544677734375 - 0x08F2, // sin(34°) = 0.55908203125 - 0x092D, // sin(35°) = 0.573486328125 - 0x0968, // sin(36°) = 0.587890625 - 0x09A1, // sin(37°) = 0.601806640625 - 0x09DA, // sin(38°) = 0.61572265625 - 0x0A12, // sin(39°) = 0.62939453125 - 0x0A49, // sin(40°) = 0.642822265625 - 0x0A7F, // sin(41°) = 0.656005859375 - 0x0AB5, // sin(42°) = 0.669189453125 - 0x0AE9, // sin(43°) = 0.681884765625 - 0x0B1D, // sin(44°) = 0.694580078125 - 0x0B50, // sin(45°) = 0.70703125 - 0x0B82, // sin(46°) = 0.71923828125 - 0x0BB4, // sin(47°) = 0.7314453125 - 0x0BE4, // sin(48°) = 0.7431640625 - 0x0C13, // sin(49°) = 0.754638671875 - 0x0C42, // sin(50°) = 0.76611328125 - 0x0C6F, // sin(51°) = 0.777099609375 - 0x0C9C, // sin(52°) = 0.7880859375 - 0x0CC7, // sin(53°) = 0.798583984375 - 0x0CF2, // sin(54°) = 0.80908203125 - 0x0D1B, // sin(55°) = 0.819091796875 - 0x0D44, // sin(56°) = 0.8291015625 - 0x0D6B, // sin(57°) = 0.838623046875 - 0x0D92, // sin(58°) = 0.84814453125 - 0x0DB7, // sin(59°) = 0.857177734375 - 0x0DDB, // sin(60°) = 0.865966796875 - 0x0DFE, // sin(61°) = 0.87451171875 - 0x0E21, // sin(62°) = 0.883056640625 - 0x0E42, // sin(63°) = 0.89111328125 - 0x0E61, // sin(64°) = 0.898681640625 - 0x0E80, // sin(65°) = 0.90625 - 0x0E9E, // sin(66°) = 0.91357421875 - 0x0EBA, // sin(67°) = 0.92041015625 - 0x0ED6, // sin(68°) = 0.92724609375 - 0x0EF0, // sin(69°) = 0.93359375 - 0x0F09, // sin(70°) = 0.939697265625 - 0x0F21, // sin(71°) = 0.945556640625 - 0x0F38, // sin(72°) = 0.951171875 - 0x0F4D, // sin(73°) = 0.956298828125 - 0x0F61, // sin(74°) = 0.961181640625 - 0x0F74, // sin(75°) = 0.9658203125 - 0x0F86, // sin(76°) = 0.97021484375 - 0x0F97, // sin(77°) = 0.974365234375 - 0x0FA6, // sin(78°) = 0.97802734375 - 0x0FB5, // sin(79°) = 0.981689453125 - 0x0FC2, // sin(80°) = 0.98486328125 - 0x0FCE, // sin(81°) = 0.98779296875 - 0x0FD8, // sin(82°) = 0.990234375 - 0x0FE1, // sin(83°) = 0.992431640625 - 0x0FE9, // sin(84°) = 0.994384765625 - 0x0FF0, // sin(85°) = 0.99609375 - 0x0FF6, // sin(86°) = 0.99755859375 - 0x0FFA, // sin(87°) = 0.99853515625 - 0x0FFD, // sin(88°) = 0.999267578125 - 0x0FFF, // sin(89°) = 0.999755859375 - 0x1000, // sin(90°) = 1 - 0x0FFF, // sin(91°) = 0.999755859375 - 0x0FFD, // sin(92°) = 0.999267578125 - 0x0FFA, // sin(93°) = 0.99853515625 - 0x0FF6, // sin(94°) = 0.99755859375 - 0x0FF0, // sin(95°) = 0.99609375 - 0x0FE9, // sin(96°) = 0.994384765625 - 0x0FE1, // sin(97°) = 0.992431640625 - 0x0FD8, // sin(98°) = 0.990234375 - 0x0FCE, // sin(99°) = 0.98779296875 - 0x0FC2, // sin(100°) = 0.98486328125 - 0x0FB5, // sin(101°) = 0.981689453125 - 0x0FA6, // sin(102°) = 0.97802734375 - 0x0F97, // sin(103°) = 0.974365234375 - 0x0F86, // sin(104°) = 0.97021484375 - 0x0F74, // sin(105°) = 0.9658203125 - 0x0F61, // sin(106°) = 0.961181640625 - 0x0F4D, // sin(107°) = 0.956298828125 - 0x0F38, // sin(108°) = 0.951171875 - 0x0F21, // sin(109°) = 0.945556640625 - 0x0F09, // sin(110°) = 0.939697265625 - 0x0EF0, // sin(111°) = 0.93359375 - 0x0ED6, // sin(112°) = 0.92724609375 - 0x0EBA, // sin(113°) = 0.92041015625 - 0x0E9E, // sin(114°) = 0.91357421875 - 0x0E80, // sin(115°) = 0.90625 - 0x0E61, // sin(116°) = 0.898681640625 - 0x0E42, // sin(117°) = 0.89111328125 - 0x0E21, // sin(118°) = 0.883056640625 - 0x0DFE, // sin(119°) = 0.87451171875 - 0x0DDB, // sin(120°) = 0.865966796875 - 0x0DB7, // sin(121°) = 0.857177734375 - 0x0D92, // sin(122°) = 0.84814453125 - 0x0D6B, // sin(123°) = 0.838623046875 - 0x0D44, // sin(124°) = 0.8291015625 - 0x0D1B, // sin(125°) = 0.819091796875 - 0x0CF2, // sin(126°) = 0.80908203125 - 0x0CC7, // sin(127°) = 0.798583984375 - 0x0C9C, // sin(128°) = 0.7880859375 - 0x0C6F, // sin(129°) = 0.777099609375 - 0x0C42, // sin(130°) = 0.76611328125 - 0x0C13, // sin(131°) = 0.754638671875 - 0x0BE4, // sin(132°) = 0.7431640625 - 0x0BB4, // sin(133°) = 0.7314453125 - 0x0B82, // sin(134°) = 0.71923828125 - 0x0B50, // sin(135°) = 0.70703125 - 0x0B1D, // sin(136°) = 0.694580078125 - 0x0AE9, // sin(137°) = 0.681884765625 - 0x0AB5, // sin(138°) = 0.669189453125 - 0x0A7F, // sin(139°) = 0.656005859375 - 0x0A49, // sin(140°) = 0.642822265625 - 0x0A12, // sin(141°) = 0.62939453125 - 0x09DA, // sin(142°) = 0.61572265625 - 0x09A1, // sin(143°) = 0.601806640625 - 0x0968, // sin(144°) = 0.587890625 - 0x092D, // sin(145°) = 0.573486328125 - 0x08F2, // sin(146°) = 0.55908203125 - 0x08B7, // sin(147°) = 0.544677734375 - 0x087B, // sin(148°) = 0.530029296875 - 0x083E, // sin(149°) = 0.51513671875 - 0x0800, // sin(150°) = 0.5 - 0x07C2, // sin(151°) = 0.48486328125 - 0x0783, // sin(152°) = 0.469482421875 - 0x0744, // sin(153°) = 0.4541015625 - 0x0704, // sin(154°) = 0.4384765625 - 0x06C3, // sin(155°) = 0.422607421875 - 0x0682, // sin(156°) = 0.40673828125 - 0x0640, // sin(157°) = 0.390625 - 0x05FE, // sin(158°) = 0.37451171875 - 0x05BC, // sin(159°) = 0.3583984375 - 0x0579, // sin(160°) = 0.342041015625 - 0x0536, // sin(161°) = 0.32568359375 - 0x04F2, // sin(162°) = 0.30908203125 - 0x04AE, // sin(163°) = 0.29248046875 - 0x0469, // sin(164°) = 0.275634765625 - 0x0424, // sin(165°) = 0.2587890625 - 0x03DF, // sin(166°) = 0.241943359375 - 0x0399, // sin(167°) = 0.224853515625 - 0x0354, // sin(168°) = 0.2080078125 - 0x030E, // sin(169°) = 0.19091796875 - 0x02C7, // sin(170°) = 0.173583984375 - 0x0281, // sin(171°) = 0.156494140625 - 0x023A, // sin(172°) = 0.13916015625 - 0x01F3, // sin(173°) = 0.121826171875 - 0x01AC, // sin(174°) = 0.1044921875 - 0x0165, // sin(175°) = 0.087158203125 - 0x011E, // sin(176°) = 0.06982421875 - 0x00D6, // sin(177°) = 0.05224609375 - 0x008F, // sin(178°) = 0.034912109375 - 0x0047, // sin(179°) = 0.017333984375 + Q_4_12(0), // sin(0°) + Q_4_12(0.017333984375), // sin(1°) + Q_4_12(0.034912109375), // sin(2°) + Q_4_12(0.05224609375), // sin(3°) + Q_4_12(0.06982421875), // sin(4°) + Q_4_12(0.087158203125), // sin(5°) + Q_4_12(0.1044921875), // sin(6°) + Q_4_12(0.121826171875), // sin(7°) + Q_4_12(0.13916015625), // sin(8°) + Q_4_12(0.156494140625), // sin(9°) + Q_4_12(0.173583984375), // sin(10°) + Q_4_12(0.19091796875), // sin(11°) + Q_4_12(0.2080078125), // sin(12°) + Q_4_12(0.224853515625), // sin(13°) + Q_4_12(0.241943359375), // sin(14°) + Q_4_12(0.2587890625), // sin(15°) + Q_4_12(0.275634765625), // sin(16°) + Q_4_12(0.29248046875), // sin(17°) + Q_4_12(0.30908203125), // sin(18°) + Q_4_12(0.32568359375), // sin(19°) + Q_4_12(0.342041015625), // sin(20°) + Q_4_12(0.3583984375), // sin(21°) + Q_4_12(0.37451171875), // sin(22°) + Q_4_12(0.390625), // sin(23°) + Q_4_12(0.40673828125), // sin(24°) + Q_4_12(0.422607421875), // sin(25°) + Q_4_12(0.4384765625), // sin(26°) + Q_4_12(0.4541015625), // sin(27°) + Q_4_12(0.469482421875), // sin(28°) + Q_4_12(0.48486328125), // sin(29°) + Q_4_12(0.5), // sin(30°) + Q_4_12(0.51513671875), // sin(31°) + Q_4_12(0.530029296875), // sin(32°) + Q_4_12(0.544677734375), // sin(33°) + Q_4_12(0.55908203125), // sin(34°) + Q_4_12(0.573486328125), // sin(35°) + Q_4_12(0.587890625), // sin(36°) + Q_4_12(0.601806640625), // sin(37°) + Q_4_12(0.61572265625), // sin(38°) + Q_4_12(0.62939453125), // sin(39°) + Q_4_12(0.642822265625), // sin(40°) + Q_4_12(0.656005859375), // sin(41°) + Q_4_12(0.669189453125), // sin(42°) + Q_4_12(0.681884765625), // sin(43°) + Q_4_12(0.694580078125), // sin(44°) + Q_4_12(0.70703125), // sin(45°) + Q_4_12(0.71923828125), // sin(46°) + Q_4_12(0.7314453125), // sin(47°) + Q_4_12(0.7431640625), // sin(48°) + Q_4_12(0.754638671875), // sin(49°) + Q_4_12(0.76611328125), // sin(50°) + Q_4_12(0.777099609375), // sin(51°) + Q_4_12(0.7880859375), // sin(52°) + Q_4_12(0.798583984375), // sin(53°) + Q_4_12(0.80908203125), // sin(54°) + Q_4_12(0.819091796875), // sin(55°) + Q_4_12(0.8291015625), // sin(56°) + Q_4_12(0.838623046875), // sin(57°) + Q_4_12(0.84814453125), // sin(58°) + Q_4_12(0.857177734375), // sin(59°) + Q_4_12(0.865966796875), // sin(60°) + Q_4_12(0.87451171875), // sin(61°) + Q_4_12(0.883056640625), // sin(62°) + Q_4_12(0.89111328125), // sin(63°) + Q_4_12(0.898681640625), // sin(64°) + Q_4_12(0.90625), // sin(65°) + Q_4_12(0.91357421875), // sin(66°) + Q_4_12(0.92041015625), // sin(67°) + Q_4_12(0.92724609375), // sin(68°) + Q_4_12(0.93359375), // sin(69°) + Q_4_12(0.939697265625), // sin(70°) + Q_4_12(0.945556640625), // sin(71°) + Q_4_12(0.951171875), // sin(72°) + Q_4_12(0.956298828125), // sin(73°) + Q_4_12(0.961181640625), // sin(74°) + Q_4_12(0.9658203125), // sin(75°) + Q_4_12(0.97021484375), // sin(76°) + Q_4_12(0.974365234375), // sin(77°) + Q_4_12(0.97802734375), // sin(78°) + Q_4_12(0.981689453125), // sin(79°) + Q_4_12(0.98486328125), // sin(80°) + Q_4_12(0.98779296875), // sin(81°) + Q_4_12(0.990234375), // sin(82°) + Q_4_12(0.992431640625), // sin(83°) + Q_4_12(0.994384765625), // sin(84°) + Q_4_12(0.99609375), // sin(85°) + Q_4_12(0.99755859375), // sin(86°) + Q_4_12(0.99853515625), // sin(87°) + Q_4_12(0.999267578125), // sin(88°) + Q_4_12(0.999755859375), // sin(89°) + Q_4_12(1), // sin(90°) + Q_4_12(0.999755859375), // sin(91°) + Q_4_12(0.999267578125), // sin(92°) + Q_4_12(0.99853515625), // sin(93°) + Q_4_12(0.99755859375), // sin(94°) + Q_4_12(0.99609375), // sin(95°) + Q_4_12(0.994384765625), // sin(96°) + Q_4_12(0.992431640625), // sin(97°) + Q_4_12(0.990234375), // sin(98°) + Q_4_12(0.98779296875), // sin(99°) + Q_4_12(0.98486328125), // sin(100°) + Q_4_12(0.981689453125), // sin(101°) + Q_4_12(0.97802734375), // sin(102°) + Q_4_12(0.974365234375), // sin(103°) + Q_4_12(0.97021484375), // sin(104°) + Q_4_12(0.9658203125), // sin(105°) + Q_4_12(0.961181640625), // sin(106°) + Q_4_12(0.956298828125), // sin(107°) + Q_4_12(0.951171875), // sin(108°) + Q_4_12(0.945556640625), // sin(109°) + Q_4_12(0.939697265625), // sin(110°) + Q_4_12(0.93359375), // sin(111°) + Q_4_12(0.92724609375), // sin(112°) + Q_4_12(0.92041015625), // sin(113°) + Q_4_12(0.91357421875), // sin(114°) + Q_4_12(0.90625), // sin(115°) + Q_4_12(0.898681640625), // sin(116°) + Q_4_12(0.89111328125), // sin(117°) + Q_4_12(0.883056640625), // sin(118°) + Q_4_12(0.87451171875), // sin(119°) + Q_4_12(0.865966796875), // sin(120°) + Q_4_12(0.857177734375), // sin(121°) + Q_4_12(0.84814453125), // sin(122°) + Q_4_12(0.838623046875), // sin(123°) + Q_4_12(0.8291015625), // sin(124°) + Q_4_12(0.819091796875), // sin(125°) + Q_4_12(0.80908203125), // sin(126°) + Q_4_12(0.798583984375), // sin(127°) + Q_4_12(0.7880859375), // sin(128°) + Q_4_12(0.777099609375), // sin(129°) + Q_4_12(0.76611328125), // sin(130°) + Q_4_12(0.754638671875), // sin(131°) + Q_4_12(0.7431640625), // sin(132°) + Q_4_12(0.7314453125), // sin(133°) + Q_4_12(0.71923828125), // sin(134°) + Q_4_12(0.70703125), // sin(135°) + Q_4_12(0.694580078125), // sin(136°) + Q_4_12(0.681884765625), // sin(137°) + Q_4_12(0.669189453125), // sin(138°) + Q_4_12(0.656005859375), // sin(139°) + Q_4_12(0.642822265625), // sin(140°) + Q_4_12(0.62939453125), // sin(141°) + Q_4_12(0.61572265625), // sin(142°) + Q_4_12(0.601806640625), // sin(143°) + Q_4_12(0.587890625), // sin(144°) + Q_4_12(0.573486328125), // sin(145°) + Q_4_12(0.55908203125), // sin(146°) + Q_4_12(0.544677734375), // sin(147°) + Q_4_12(0.530029296875), // sin(148°) + Q_4_12(0.51513671875), // sin(149°) + Q_4_12(0.5), // sin(150°) + Q_4_12(0.48486328125), // sin(151°) + Q_4_12(0.469482421875), // sin(152°) + Q_4_12(0.4541015625), // sin(153°) + Q_4_12(0.4384765625), // sin(154°) + Q_4_12(0.422607421875), // sin(155°) + Q_4_12(0.40673828125), // sin(156°) + Q_4_12(0.390625), // sin(157°) + Q_4_12(0.37451171875), // sin(158°) + Q_4_12(0.3583984375), // sin(159°) + Q_4_12(0.342041015625), // sin(160°) + Q_4_12(0.32568359375), // sin(161°) + Q_4_12(0.30908203125), // sin(162°) + Q_4_12(0.29248046875), // sin(163°) + Q_4_12(0.275634765625), // sin(164°) + Q_4_12(0.2587890625), // sin(165°) + Q_4_12(0.241943359375), // sin(166°) + Q_4_12(0.224853515625), // sin(167°) + Q_4_12(0.2080078125), // sin(168°) + Q_4_12(0.19091796875), // sin(169°) + Q_4_12(0.173583984375), // sin(170°) + Q_4_12(0.156494140625), // sin(171°) + Q_4_12(0.13916015625), // sin(172°) + Q_4_12(0.121826171875), // sin(173°) + Q_4_12(0.1044921875), // sin(174°) + Q_4_12(0.087158203125), // sin(175°) + Q_4_12(0.06982421875), // sin(176°) + Q_4_12(0.05224609375), // sin(177°) + Q_4_12(0.034912109375), // sin(178°) + Q_4_12(0.017333984375), // sin(179°) }; // amplitude * sin(index*(Ï€/128)) -- cgit v1.2.3 From 102f5b1e15e7295e30a3cebfbbad3c8af4cc1d37 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 20 Jun 2017 05:46:48 +0200 Subject: Battle labels named (#333) * Changed battle labels --- src/battle_2.c | 828 ++++++++++++++++----------------- src/battle_6.c | 16 +- src/battle_7.c | 396 ++++++++-------- src/battle_811DA74.c | 864 +++++++++++++++++----------------- src/battle_ai.c | 312 ++++++------- src/battle_anim.c | 120 ++--- src/battle_anim_80A7E7C.c | 60 +-- src/battle_anim_81258BC.c | 16 +- src/battle_interface.c | 148 +++--- src/battle_party_menu.c | 40 +- src/battle_setup.c | 10 +- src/calculate_base_damage.c | 70 +-- src/item_use.c | 6 +- src/pokemon_2.c | 52 +-- src/pokemon_3.c | 72 +-- src/rom3.c | 950 +++++++++++++++++++------------------- src/rom_800D42C.c | 8 +- src/rom_8077ABC.c | 112 ++--- src/safari_zone.c | 6 +- src/script_pokemon_util_80C4BF0.c | 10 +- src/tv.c | 64 +-- src/unknown_debug_menu.c | 8 +- 22 files changed, 2084 insertions(+), 2084 deletions(-) (limited to 'src') diff --git a/src/battle_2.c b/src/battle_2.c index 451c4f108..2b13fc45d 100644 --- a/src/battle_2.c +++ b/src/battle_2.c @@ -140,46 +140,46 @@ extern u8 ewram[]; #define ewram1D000 ((struct Pokemon *)(ewram + 0x1D000)) extern struct UnknownPokemonStruct2 gUnknown_02023A00[]; -extern u8 gUnknown_02024260[][0x200]; -extern u8 gUnknown_02024A60; -extern u32 gUnknown_02024A64; -extern u8 gUnknown_02024A68; -extern u16 gUnknown_02024A6A[]; -extern u8 gUnknown_02024A7F; -extern u8 gUnknown_02024A7A[]; +extern u8 gBattleBufferB[][0x200]; +extern u8 gActiveBank; +extern u32 gBattleExecBuffer; +extern u8 gNoOfAllBanks; +extern u16 gBattlePartyID[]; +extern u8 gFightStateTracker; +extern u8 gTurnOrder[]; extern struct UnknownStruct12 gUnknown_02024AD0[]; -extern u8 gUnknown_02024BE0[]; -extern u16 gUnknown_02024BE6; -extern u8 byte_2024C06; -extern u8 gUnknown_02024C0B; -extern u8 gUnknown_02024C0C; -extern u8 gUnknown_02024C0E; -extern u8 gUnknown_02024C18[]; +extern u8 gObjectBankIDs[]; +extern u16 gCurrentMove; +extern u8 gLastUsedAbility; +extern u8 gStringBank; +extern u8 gAbsentBankFlags; +extern u8 gMultiHitCounter; +extern u8 gActionForBanks[]; extern u16 gUnknown_02024C2C[]; -extern u16 gUnknown_02024C34[]; -extern u16 gUnknown_02024C3C[]; +extern u16 gLastUsedMove[]; +extern u16 gMoveHitWith[]; extern u16 gUnknown_02024C44[]; extern u16 gUnknown_02024C4C[]; -extern u16 gUnknown_02024C54[]; +extern u16 gLockedMove[]; extern u8 gUnknown_02024C5C[]; -extern u16 gUnknown_02024C60[]; -extern u32 gUnknown_02024C6C; +extern u16 gChosenMovesByBanks[]; +extern u32 gHitMarker; extern u8 gUnknown_02024C70[]; -extern u16 gUnknown_02024C7A[]; -extern u8 gUnknown_02024C80[][12]; -extern u32 gUnknown_02024C98[]; -//extern u8 gUnknown_02024CA8[][0x1C]; -extern u16 gUnknown_02024D18; -extern u16 gUnknown_02024D1A; -extern u16 gUnknown_02024D1C; -extern u8 gUnknown_02024D1E[]; +extern u16 gSideAffecting[]; +extern u8 gSideTimer[][12]; +extern u32 gStatuses3[]; +//extern u8 gDisableStructs[][0x1C]; +extern u16 gPauseCounterBattle; +extern u16 gPaydayMoney; +extern u16 gRandomTurnNumber; +extern u8 gBattleCommunication[]; extern u8 gUnknown_02024D1F[]; // I don't actually know what type this is. -extern u8 gUnknown_02024D26; -extern struct UnknownStruct13 gUnknown_02024D28[]; -extern u8 gUnknown_02024DBC[]; +extern u8 gBattleOutcome; +extern struct UnknownStruct13 gProtectStructs[]; +extern u8 gWishFutureKnock[]; extern u16 gUnknown_02024DE8; -extern u8 gUnknown_02024E60[]; -extern u8 gUnknown_02024E64[]; +extern u8 gActionSelectionCursor[]; +extern u8 gMoveSelectionCursor[]; extern u8 gUnknown_02038470[]; extern u16 gUnknown_030041B0; extern u16 gUnknown_030041B4; @@ -197,12 +197,12 @@ extern u16 gUnknown_030042A0; extern u16 gUnknown_030042A4; extern u16 gUnknown_030042C0; extern u16 gUnknown_030042C4; -extern MainCallback gUnknown_030042D0; -extern void (*gUnknown_030042D4)(void); -extern struct Struct30042E0 gUnknown_030042E0; -extern u8 gUnknown_03004324; -extern void (*gUnknown_03004330[])(void); -extern u8 gUnknown_03004340[]; +extern MainCallback gPreBattleCallback1; +extern void (*gBattleMainFunc)(void); +extern struct Struct30042E0 gBattleResults; +extern u8 gLeveledUpInBattle; +extern void (*gBattleBankFunc[])(void); +extern u8 gHealthboxIDs[]; extern struct UnknownStruct6 gUnknown_03004DE0; //extern u16 gUnknown_03004DE0[][0xA0]; // possibly? extern u16 gBattleTypeFlags; @@ -212,8 +212,8 @@ extern u16 gTrainerBattleOpponent; extern struct BattleEnigmaBerry gEnigmaBerries[]; extern u16 gBlockRecvBuffer[MAX_LINK_PLAYERS][BLOCK_BUFFER_SIZE / 2]; extern u8 gBattleMonForms[]; -extern u8 gPlayerMonIndex; -extern u8 gEnemyMonIndex; +extern u8 gBankAttacker; +extern u8 gBankTarget; extern u16 gBattleWeather; extern u32 gBattleMoveDamage; extern struct BattlePokemon gBattleMons[]; @@ -226,7 +226,7 @@ void sub_800E7C4(void) { sub_800B858(); SetMainCallback2(sub_800F104); - gUnknown_02024D1E[0] = 0; + gBattleCommunication[0] = 0; } else { @@ -299,7 +299,7 @@ void InitBattle(void) gMain.inBattle = TRUE; for (i = 0; i < 6; i++) AdjustFriendship(&gPlayerParty[i], 3); - gUnknown_02024D1E[0] = 0; + gBattleCommunication[0] = 0; } void sub_800E9EC(void) @@ -421,7 +421,7 @@ void sub_800EC9C(void) ewram160CB = playerId; enemyId = playerId ^ 1; - switch (gUnknown_02024D1E[0]) + switch (gBattleCommunication[0]) { case 0: if (gBattleTypeFlags & BATTLE_TYPE_LINK) @@ -433,13 +433,13 @@ void sub_800EC9C(void) sub_800E9EC(); sub_800EAAC(); SendBlock(bitmask_all_link_players_but_self(), &ewram0, 32); - gUnknown_02024D1E[0] = 1; + gBattleCommunication[0] = 1; } } else { gBattleTypeFlags |= BATTLE_TYPE_WILD; - gUnknown_02024D1E[0] = 8; + gBattleCommunication[0] = 8; sub_800EB08(); } break; @@ -490,14 +490,14 @@ void sub_800EC9C(void) gTasks[taskId].data[5] = 0; gTasks[taskId].data[3] = ewram0.unk2 | (ewram0.unk3 << 8); gTasks[taskId].data[4] = gBlockRecvBuffer[enemyId][1]; - gUnknown_02024D1E[0]++; + gBattleCommunication[0]++; } break; case 2: if (sub_8007ECC()) { SendBlock(bitmask_all_link_players_but_self(), gPlayerParty, sizeof(*gPlayerParty) * 2); - gUnknown_02024D1E[0]++; + gBattleCommunication[0]++; } break; case 3: @@ -505,14 +505,14 @@ void sub_800EC9C(void) { ResetBlockReceivedFlags(); memcpy(gEnemyParty, gBlockRecvBuffer[enemyId], sizeof(*gEnemyParty) * 2); - gUnknown_02024D1E[0]++; + gBattleCommunication[0]++; } break; case 4: if (sub_8007ECC()) { SendBlock(bitmask_all_link_players_but_self(), gPlayerParty + 2, sizeof(*gPlayerParty) * 2); - gUnknown_02024D1E[0]++; + gBattleCommunication[0]++; } break; case 5: @@ -520,14 +520,14 @@ void sub_800EC9C(void) { ResetBlockReceivedFlags(); memcpy(gEnemyParty + 2, gBlockRecvBuffer[enemyId], sizeof(*gEnemyParty) * 2); - gUnknown_02024D1E[0]++; + gBattleCommunication[0]++; } break; case 6: if (sub_8007ECC()) { SendBlock(bitmask_all_link_players_but_self(), gPlayerParty + 4, sizeof(*gPlayerParty) * 2); - gUnknown_02024D1E[0]++; + gBattleCommunication[0]++; } break; case 7: @@ -541,19 +541,19 @@ void sub_800EC9C(void) shedinja_something(&gEnemyParty[3]); shedinja_something(&gEnemyParty[4]); shedinja_something(&gEnemyParty[5]); - gUnknown_02024D1E[0]++; + gBattleCommunication[0]++; } break; case 8: sub_800B950(); - gUnknown_02024D1E[0]++; - gUnknown_02024D1E[1] = 0; - gUnknown_02024D1E[2] = 0; + gBattleCommunication[0]++; + gBattleCommunication[1] = 0; + gBattleCommunication[2] = 0; break; case 9: if (battle_load_something(gUnknown_02024D1F, gUnknown_02024D1F + 1) != 0) { - gUnknown_030042D0 = gMain.callback1; + gPreBattleCallback1 = gMain.callback1; gMain.callback1 = sub_8010824; SetMainCallback2(sub_800F808); if (gBattleTypeFlags & BATTLE_TYPE_LINK) @@ -606,14 +606,14 @@ void sub_800F104(void) AnimateSprites(); BuildOamBuffer(); - switch (gUnknown_02024D1E[0]) + switch (gBattleCommunication[0]) { case 0: if (gReceivedRemoteLinkPlayers != 0 && sub_8007ECC()) { sub_800F02C(); SendBlock(bitmask_all_link_players_but_self(), ewram, 0x60); - gUnknown_02024D1E[0]++; + gBattleCommunication[0]++; } break; case 1: @@ -631,7 +631,7 @@ void sub_800F104(void) memcpy(gUnknown_02023A00, gBlockRecvBuffer[i], 0x60); } } - gUnknown_02024D1E[0]++; + gBattleCommunication[0]++; *pSavedCallback = gMain.savedCallback; *pSavedBattleTypeFlags = gBattleTypeFlags; gMain.savedCallback = sub_800F104; @@ -641,7 +641,7 @@ void sub_800F104(void) case 2: if (!gPaletteFade.active) { - gUnknown_02024D1E[0] = 3; + gBattleCommunication[0] = 3; sub_800832C(); } break; @@ -666,7 +666,7 @@ void sub_800F298(void) RunTasks(); AnimateSprites(); BuildOamBuffer(); - switch (gUnknown_02024D1E[0]) + switch (gBattleCommunication[0]) { case 0: if (gReceivedRemoteLinkPlayers != 0 && sub_8007ECC()) @@ -676,7 +676,7 @@ void sub_800F298(void) sub_800E9EC(); sub_800EAAC(); SendBlock(bitmask_all_link_players_but_self(), ewram, 0x20); - gUnknown_02024D1E[0]++; + gBattleCommunication[0]++; } break; case 1: @@ -756,7 +756,7 @@ void sub_800F298(void) } ZeroPlayerPartyMons(); ZeroEnemyPartyMons(); - gUnknown_02024D1E[0]++; + gBattleCommunication[0]++; goto step_2; } break; @@ -765,7 +765,7 @@ void sub_800F298(void) if (sub_8007ECC()) { SendBlock(bitmask_all_link_players_but_self(), ewram1D000, sizeof(struct Pokemon) * 2); - gUnknown_02024D1E[0]++; + gBattleCommunication[0]++; } break; case 3: @@ -821,14 +821,14 @@ void sub_800F298(void) } } } - gUnknown_02024D1E[0]++; + gBattleCommunication[0]++; } break; case 4: if (sub_8007ECC()) { SendBlock(bitmask_all_link_players_but_self(), ewram1D000 + 2, sizeof(struct Pokemon)); - gUnknown_02024D1E[0]++; + gBattleCommunication[0]++; } break; case 5: @@ -899,19 +899,19 @@ void sub_800F298(void) shedinja_something(&gEnemyParty[4]); shedinja_something(&gEnemyParty[5]); - gUnknown_02024D1E[0]++; + gBattleCommunication[0]++; } break; case 6: sub_800B950(); - gUnknown_02024D1E[0]++; - gUnknown_02024D1E[1] = 0; - gUnknown_02024D1E[2] = 0; + gBattleCommunication[0]++; + gBattleCommunication[1] = 0; + gBattleCommunication[2] = 0; break; case 7: if (battle_load_something(gUnknown_02024D1F, gUnknown_02024D1F + 1) != 0) { - gUnknown_030042D0 = gMain.callback1; + gPreBattleCallback1 = gMain.callback1; gMain.callback1 = sub_8010824; SetMainCallback2(sub_800F808); if (gBattleTypeFlags & BATTLE_TYPE_LINK) @@ -1270,7 +1270,7 @@ void c2_8011A1C(void) gTasks[taskId].data[5] = 1; sub_800FE40(taskId); SetMainCallback2(sub_80101B8); - gUnknown_02024D1E[0] = 0; + gBattleCommunication[0] = 0; } void sub_80101B8(void) @@ -1284,18 +1284,18 @@ void sub_80101B8(void) void c2_081284E0(void) { - switch (gUnknown_02024D1E[0]) + switch (gBattleCommunication[0]) { case 0: - gUnknown_02024D1E[1] = 0xFF; - gUnknown_02024D1E[0]++; + gBattleCommunication[1] = 0xFF; + gBattleCommunication[0]++; break; case 1: - gUnknown_02024D1E[1]--; - if (gUnknown_02024D1E[1] == 0) + gBattleCommunication[1]--; + if (gBattleCommunication[1] == 0) { BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0); - gUnknown_02024D1E[0]++; + gBattleCommunication[0]++; } break; case 2: @@ -1330,7 +1330,7 @@ void sub_80102AC(struct Sprite *sprite) if (sprite->animEnded) { sub_804777C(sprite->data0); - sub_8043DFC(gUnknown_03004340[sprite->data0]); + sub_8043DFC(gHealthboxIDs[sprite->data0]); sprite->callback = nullsub_37; StartSpriteAnimIfDifferent(sprite, 0); BeginNormalPaletteFade(0x00020000, 0, 10, 0, 0x3DEF); @@ -1376,11 +1376,11 @@ void sub_8010384(struct Sprite *sprite) else species = sprite->data2; - GetMonData(&gEnemyParty[gUnknown_02024A6A[r6]], MON_DATA_PERSONALITY); // Unused return value + GetMonData(&gEnemyParty[gBattlePartyID[r6]], MON_DATA_PERSONALITY); // Unused return value if (species == SPECIES_UNOWN) { - u32 personalityValue = GetMonData(&gEnemyParty[gUnknown_02024A6A[r6]], MON_DATA_PERSONALITY); + u32 personalityValue = GetMonData(&gEnemyParty[gBattlePartyID[r6]], MON_DATA_PERSONALITY); u16 unownForm = ((((personalityValue & 0x3000000) >> 18) | ((personalityValue & 0x30000) >> 12) | ((personalityValue & 0x300) >> 6) | (personalityValue & 3)) % 0x1C); u16 unownSpecies; @@ -1426,7 +1426,7 @@ void sub_8010494(struct Sprite *sprite) } else { - u8 *dst = (u8 *)gUnknown_081FAF4C[battle_get_per_side_status(sprite->data0)] + (gBattleMonForms[sprite->data0] << 11) + (sprite->data3 << 8); + u8 *dst = (u8 *)gUnknown_081FAF4C[GetBankIdentity(sprite->data0)] + (gBattleMonForms[sprite->data0] << 11) + (sprite->data3 << 8); for (i = 0; i < 0x100; i++) *(dst++) = 0; @@ -1514,14 +1514,14 @@ void dp11b_obj_instanciate(u8 a, u8 b, s8 c, s8 d) spriteId = CreateInvisibleSpriteWithCallback(objc_dp11b_pingpong); if (b == TRUE) { - r7 = gUnknown_03004340[a]; + r7 = gHealthboxIDs[a]; ewram17810[a].unk2 = spriteId; ewram17810[a].unk0_1 = 1; gSprites[spriteId].data0 = 0x80; } else { - r7 = gUnknown_02024BE0[a]; + r7 = gObjectBankIDs[a]; ewram17810[a].unk3 = spriteId; ewram17810[a].unk0_2 = 1; gSprites[spriteId].data0 = 0xC0; @@ -1579,17 +1579,17 @@ void nullsub_41(void) void sub_8010800(void) { sub_8010874(); - gUnknown_02024D1E[1] = 0; - gUnknown_030042D4 = bc_8012FAC; + gBattleCommunication[1] = 0; + gBattleMainFunc = bc_8012FAC; } void sub_8010824(void) { - gUnknown_030042D4(); - gUnknown_02024A60 = 0; + gBattleMainFunc(); + gActiveBank = 0; - for (gUnknown_02024A60 = 0; gUnknown_02024A60 < gUnknown_02024A68; gUnknown_02024A60++) - gUnknown_03004330[gUnknown_02024A60](); + for (gActiveBank = 0; gActiveBank < gNoOfAllBanks; gActiveBank++) + gBattleBankFunc[gActiveBank](); } void sub_8010874(void) @@ -1598,65 +1598,65 @@ void sub_8010874(void) s32 j; u8 *r4; - sub_801365C(0); - sub_801377C(); + TurnValuesCleanUp(0); + SpecialStatusesClear(); for (i = 0; i < 4; i++) { - gUnknown_02024C98[i] = 0; + gStatuses3[i] = 0; - r4 = (u8 *)&gUnknown_02024CA8[i]; + r4 = (u8 *)&gDisableStructs[i]; for (j = 0; j < (u32)0x1C; j++) r4[j] = 0; - gUnknown_02024CA8[i].unk16 = 2; + gDisableStructs[i].unk16 = 2; gUnknown_02024C70[i] = 0; - gUnknown_02024C34[i] = 0; - gUnknown_02024C3C[i] = 0; + gLastUsedMove[i] = 0; + gMoveHitWith[i] = 0; gUnknown_02024C44[i] = 0; gUnknown_02024C4C[i] = 0; gUnknown_02024C5C[i] = 0xFF; - gUnknown_02024C54[i] = 0; + gLockedMove[i] = 0; gUnknown_02024C2C[i] = 0; ewram17100[i] = 0; } for (i = 0; i < 2; i++) { - gUnknown_02024C7A[i] = 0; + gSideAffecting[i] = 0; - r4 = (u8 *)&gUnknown_02024C80[i]; + r4 = (u8 *)&gSideTimer[i]; for (j = 0; j < (u32)12; j++) r4[j] = 0; } - gPlayerMonIndex = 0; - gEnemyMonIndex = 0; + gBankAttacker = 0; + gBankTarget = 0; gBattleWeather = 0; - r4 = (u8 *)&gUnknown_02024DBC; + r4 = (u8 *)&gWishFutureKnock; for (i = 0; i < (u32)0x2C; i++) r4[i] = 0; - gUnknown_02024C6C = 0; + gHitMarker = 0; if ((gBattleTypeFlags & 2) == 0 && gSaveBlock2.optionsBattleSceneOff == TRUE) - gUnknown_02024C6C = 0x80; + gHitMarker = 0x80; ewram16084 = gSaveBlock2.optionsBattleStyle; - gUnknown_02024C0E = 0; - gUnknown_02024D26 = 0; - gUnknown_02024A64 = 0; - gUnknown_02024D1A = 0; + gMultiHitCounter = 0; + gBattleOutcome = 0; + gBattleExecBuffer = 0; + gPaydayMoney = 0; ewram17130 = 0; ewram17160 = 0; for (i = 0; i < 8; i++) - gUnknown_02024D1E[i] = 0; - gUnknown_02024D18 = 0; + gBattleCommunication[i] = 0; + gPauseCounterBattle = 0; gBattleMoveDamage = 0; gUnknown_02024DE8 = 0; ewram16002 = 0; ewram160A1 = 0; - gUnknown_03004324 = 0; - gUnknown_02024C0C = 0; + gLeveledUpInBattle = 0; + gAbsentBankFlags = 0; ewram16078 = 0; ewram16086 = 0; ewram16087 = 0; @@ -1679,208 +1679,208 @@ void sub_8010874(void) ewram160C9 = 6; ewram16113 = 0; for (i = 0; i < 11; i++) - gUnknown_030042E0.unk36[i] = 0; - gUnknown_030042E0.unk13 = 0; - gUnknown_030042E0.unk0 = 0; - gUnknown_030042E0.unk1 = 0; - gUnknown_030042E0.unk2 = 0; - gUnknown_030042E0.unk3 = 0; - gUnknown_030042E0.unk4 = 0; - gUnknown_030042E0.unk5_0 = 0; - gUnknown_030042E0.unk5_1 = 0; - gUnknown_030042E0.unk20 = 0; - gUnknown_030042E0.unk22 = 0; - gUnknown_030042E0.unk24 = 0; - gUnknown_030042E0.unk6 = 0; - gUnknown_030042E0.unk26 = 0; - gUnknown_030042E0.unk28 = 0; + gBattleResults.unk36[i] = 0; + gBattleResults.unk13 = 0; + gBattleResults.unk0 = 0; + gBattleResults.unk1 = 0; + gBattleResults.unk2 = 0; + gBattleResults.unk3 = 0; + gBattleResults.unk4 = 0; + gBattleResults.unk5_0 = 0; + gBattleResults.unk5_1 = 0; + gBattleResults.unk20 = 0; + gBattleResults.unk22 = 0; + gBattleResults.unk24 = 0; + gBattleResults.unk6 = 0; + gBattleResults.unk26 = 0; + gBattleResults.unk28 = 0; for (i = 0; i < 10; i++) { - gUnknown_030042E0.unk8[i] = 0; - gUnknown_030042E0.unk14[i] = 0; - gUnknown_030042E0.unk2A[i] = 0; + gBattleResults.unk8[i] = 0; + gBattleResults.unk14[i] = 0; + gBattleResults.unk2A[i] = 0; } } void sub_8010B88(void) { - struct UnkBattleStruct4 sp0 = gUnknown_02024CA8[gUnknown_02024A60]; + struct UnkBattleStruct4 sp0 = gDisableStructs[gActiveBank]; s32 i; u8 *ptr; u32 *ptr2; - if (gBattleMoves[gUnknown_02024BE6].effect != 0x7F) + if (gBattleMoves[gCurrentMove].effect != 0x7F) { for (i = 0; i < 8; i++) - gBattleMons[gUnknown_02024A60].statStages[i] = 6; - for (i = 0; i < gUnknown_02024A68; i++) + gBattleMons[gActiveBank].statStages[i] = 6; + for (i = 0; i < gNoOfAllBanks; i++) { struct UnknownStruct12 *sp20 = &gUnknown_02024AD0[i]; - if ((sp20->unk0 & 0x04000000) && gUnknown_02024CA8[i].unk14 == gUnknown_02024A60) + if ((sp20->unk0 & 0x04000000) && gDisableStructs[i].unk14 == gActiveBank) sp20->unk0 &= ~0x04000000; - if ((gUnknown_02024C98[i] & 0x18) && gUnknown_02024CA8[i].unk15 == gUnknown_02024A60) + if ((gStatuses3[i] & 0x18) && gDisableStructs[i].unk15 == gActiveBank) { - gUnknown_02024C98[i] &= ~0x18; - gUnknown_02024CA8[i].unk15 = 0; + gStatuses3[i] &= ~0x18; + gDisableStructs[i].unk15 = 0; } } } - if (gBattleMoves[gUnknown_02024BE6].effect == 0x7F) + if (gBattleMoves[gCurrentMove].effect == 0x7F) { - gBattleMons[gUnknown_02024A60].status2 &= 0x15100007; - gUnknown_02024C98[gUnknown_02024A60] &= 0x3043F; + gBattleMons[gActiveBank].status2 &= 0x15100007; + gStatuses3[gActiveBank] &= 0x3043F; - for (i = 0; i < gUnknown_02024A68; i++) + for (i = 0; i < gNoOfAllBanks; i++) { - if (battle_side_get_owner(gUnknown_02024A60) != battle_side_get_owner(i) - && (gUnknown_02024C98[i] & 0x18) != 0 - && (gUnknown_02024CA8[i].unk15 == gUnknown_02024A60)) + if (GetBankSide(gActiveBank) != GetBankSide(i) + && (gStatuses3[i] & 0x18) != 0 + && (gDisableStructs[i].unk15 == gActiveBank)) { - gUnknown_02024C98[i] &= ~0x18; - gUnknown_02024C98[i] |= 0x10; + gStatuses3[i] &= ~0x18; + gStatuses3[i] |= 0x10; } } } else { - gBattleMons[gUnknown_02024A60].status2 = 0; - gUnknown_02024C98[gUnknown_02024A60] = 0; + gBattleMons[gActiveBank].status2 = 0; + gStatuses3[gActiveBank] = 0; } - for (i = 0; i < gUnknown_02024A68; i++) + for (i = 0; i < gNoOfAllBanks; i++) { - if (gUnknown_02024AD0[i].unk0 & (gBitTable[gUnknown_02024A60] << 16)) - gUnknown_02024AD0[i].unk0 &= ~(gBitTable[gUnknown_02024A60] << 16); - if ((gUnknown_02024AD0[i].unk0 & 0xE000) && ewram[0x16020 + i] == gUnknown_02024A60) + if (gUnknown_02024AD0[i].unk0 & (gBitTable[gActiveBank] << 16)) + gUnknown_02024AD0[i].unk0 &= ~(gBitTable[gActiveBank] << 16); + if ((gUnknown_02024AD0[i].unk0 & 0xE000) && ewram[0x16020 + i] == gActiveBank) gUnknown_02024AD0[i].unk0 &= ~0xE000; } - gUnknown_02024E60[gUnknown_02024A60] = 0; - gUnknown_02024E64[gUnknown_02024A60] = 0; + gActionSelectionCursor[gActiveBank] = 0; + gMoveSelectionCursor[gActiveBank] = 0; - ptr = (u8 *)&gUnknown_02024CA8[gUnknown_02024A60]; + ptr = (u8 *)&gDisableStructs[gActiveBank]; for (i = 0; i < (u32)0x1C; i++) ptr[i] = 0; - if (gBattleMoves[gUnknown_02024BE6].effect == 0x7F) + if (gBattleMoves[gCurrentMove].effect == 0x7F) { - gUnknown_02024CA8[gUnknown_02024A60].unkA = sp0.unkA; - gUnknown_02024CA8[gUnknown_02024A60].unk15 = sp0.unk15; - gUnknown_02024CA8[gUnknown_02024A60].unkF_0 = sp0.unkF_0; - gUnknown_02024CA8[gUnknown_02024A60].unkF_4 = sp0.unkF_4; + gDisableStructs[gActiveBank].unkA = sp0.unkA; + gDisableStructs[gActiveBank].unk15 = sp0.unk15; + gDisableStructs[gActiveBank].unkF_0 = sp0.unkF_0; + gDisableStructs[gActiveBank].unkF_4 = sp0.unkF_4; } - gUnknown_02024CA8[gUnknown_02024A60].unk16 = 2; - gUnknown_02024C34[gUnknown_02024A60] = 0; - gUnknown_02024C3C[gUnknown_02024A60] = 0; - gUnknown_02024C44[gUnknown_02024A60] = 0; - gUnknown_02024C4C[gUnknown_02024A60] = 0; - gUnknown_02024C2C[gUnknown_02024A60] = 0; - gUnknown_02024C5C[gUnknown_02024A60] = 0xFF; + gDisableStructs[gActiveBank].unk16 = 2; + gLastUsedMove[gActiveBank] = 0; + gMoveHitWith[gActiveBank] = 0; + gUnknown_02024C44[gActiveBank] = 0; + gUnknown_02024C4C[gActiveBank] = 0; + gUnknown_02024C2C[gActiveBank] = 0; + gUnknown_02024C5C[gActiveBank] = 0xFF; - ewram[0x160AC + gUnknown_02024A60 * 2 + 0] = 0; - ewram[0x160AC + gUnknown_02024A60 * 2 + 1] = 0; - ewram[0x16100 + gUnknown_02024A60 * 4 + 0] = 0; - ewram[0x16100 + gUnknown_02024A60 * 4 + 1] = 0; - ewram[0x16100 + gUnknown_02024A60 * 4 + 2] = 0; - ewram[0x16100 + gUnknown_02024A60 * 4 + 3] = 0; - ewram[0x160E8 + gUnknown_02024A60 * 2 + 0] = 0; - ewram[0x160E8 + gUnknown_02024A60 * 2 + 1] = 0; + ewram[0x160AC + gActiveBank * 2 + 0] = 0; + ewram[0x160AC + gActiveBank * 2 + 1] = 0; + ewram[0x16100 + gActiveBank * 4 + 0] = 0; + ewram[0x16100 + gActiveBank * 4 + 1] = 0; + ewram[0x16100 + gActiveBank * 4 + 2] = 0; + ewram[0x16100 + gActiveBank * 4 + 3] = 0; + ewram[0x160E8 + gActiveBank * 2 + 0] = 0; + ewram[0x160E8 + gActiveBank * 2 + 1] = 0; ptr2 = (u32 *)(ewram + 0x17100); - ptr2[gUnknown_02024A60] = 0; + ptr2[gActiveBank] = 0; - gUnknown_02024BE6 = 0; + gCurrentMove = 0; } -void sub_8010F48(void) +void UndoEffectsAfterFainting(void) { s32 i; u8 *ptr; u32 *ptr2; for (i = 0; i < 8; i++) - gBattleMons[gUnknown_02024A60].statStages[i] = 6; - gBattleMons[gUnknown_02024A60].status2 = 0; - gUnknown_02024C98[gUnknown_02024A60] = 0; - for (i = 0; i < gUnknown_02024A68; i++) + gBattleMons[gActiveBank].statStages[i] = 6; + gBattleMons[gActiveBank].status2 = 0; + gStatuses3[gActiveBank] = 0; + for (i = 0; i < gNoOfAllBanks; i++) { - if ((gBattleMons[i].status2 & 0x4000000) && gUnknown_02024CA8[i].unk14 == gUnknown_02024A60) + if ((gBattleMons[i].status2 & 0x4000000) && gDisableStructs[i].unk14 == gActiveBank) gBattleMons[i].status2 &= ~0x4000000; - if (gBattleMons[i].status2 & (gBitTable[gUnknown_02024A60] << 16)) - gBattleMons[i].status2 &= ~(gBitTable[gUnknown_02024A60] << 16); - if ((gBattleMons[i].status2 & 0xE000) && ewram[0x16020 + i] == gUnknown_02024A60) + if (gBattleMons[i].status2 & (gBitTable[gActiveBank] << 16)) + gBattleMons[i].status2 &= ~(gBitTable[gActiveBank] << 16); + if ((gBattleMons[i].status2 & 0xE000) && ewram[0x16020 + i] == gActiveBank) gBattleMons[i].status2 &= ~0xE000; } - gUnknown_02024E60[gUnknown_02024A60] = 0; - gUnknown_02024E64[gUnknown_02024A60] = 0; + gActionSelectionCursor[gActiveBank] = 0; + gMoveSelectionCursor[gActiveBank] = 0; - ptr = (u8 *)&gUnknown_02024CA8[gUnknown_02024A60]; + ptr = (u8 *)&gDisableStructs[gActiveBank]; for (i = 0; i < (u32)0x1C; i++) ptr[i] = 0; - gUnknown_02024D28[gUnknown_02024A60].unk0_0 = 0; - gUnknown_02024D28[gUnknown_02024A60].unk0_1 = 0; - gUnknown_02024D28[gUnknown_02024A60].unk0_2 = 0; - gUnknown_02024D28[gUnknown_02024A60].unk0_3 = 0; - gUnknown_02024D28[gUnknown_02024A60].unk0_4 = 0; - gUnknown_02024D28[gUnknown_02024A60].unk0_5 = 0; - gUnknown_02024D28[gUnknown_02024A60].unk0_6 = 0; - gUnknown_02024D28[gUnknown_02024A60].unk0_7 = 0; - gUnknown_02024D28[gUnknown_02024A60].unk1_0 = 0; - gUnknown_02024D28[gUnknown_02024A60].unk1_1 = 0; - gUnknown_02024D28[gUnknown_02024A60].unk1_2 = 0; - gUnknown_02024D28[gUnknown_02024A60].unk1_3 = 0; - gUnknown_02024D28[gUnknown_02024A60].unk1_5 = 0; - gUnknown_02024D28[gUnknown_02024A60].unk1_6 = 0; - gUnknown_02024D28[gUnknown_02024A60].unk1_7 = 0; - gUnknown_02024D28[gUnknown_02024A60].unk2_0 = 0; - gUnknown_02024D28[gUnknown_02024A60].unk2_1 = 0; - gUnknown_02024D28[gUnknown_02024A60].unk2_2 = 0; - gUnknown_02024D28[gUnknown_02024A60].unk2_3 = 0; - - gUnknown_02024CA8[gUnknown_02024A60].unk16 = 2; - gUnknown_02024C34[gUnknown_02024A60] = 0; - gUnknown_02024C3C[gUnknown_02024A60] = 0; - gUnknown_02024C44[gUnknown_02024A60] = 0; - gUnknown_02024C4C[gUnknown_02024A60] = 0; - gUnknown_02024C2C[gUnknown_02024A60] = 0; - gUnknown_02024C5C[gUnknown_02024A60] = 0xFF; - - ewram[0x160E8 + gUnknown_02024A60 * 2 + 0] = 0; - ewram[0x160E8 + gUnknown_02024A60 * 2 + 1] = 0; - ewram[0x160AC + gUnknown_02024A60 * 2 + 0] = 0; - ewram[0x160AC + gUnknown_02024A60 * 2 + 1] = 0; - ewram[0x16100 + gUnknown_02024A60 * 4 + 0] = 0; - ewram[0x16100 + gUnknown_02024A60 * 4 + 1] = 0; - ewram[0x16100 + gUnknown_02024A60 * 4 + 2] = 0; - ewram[0x16100 + gUnknown_02024A60 * 4 + 3] = 0; + gProtectStructs[gActiveBank].unk0_0 = 0; + gProtectStructs[gActiveBank].unk0_1 = 0; + gProtectStructs[gActiveBank].unk0_2 = 0; + gProtectStructs[gActiveBank].unk0_3 = 0; + gProtectStructs[gActiveBank].unk0_4 = 0; + gProtectStructs[gActiveBank].unk0_5 = 0; + gProtectStructs[gActiveBank].unk0_6 = 0; + gProtectStructs[gActiveBank].unk0_7 = 0; + gProtectStructs[gActiveBank].unk1_0 = 0; + gProtectStructs[gActiveBank].unk1_1 = 0; + gProtectStructs[gActiveBank].unk1_2 = 0; + gProtectStructs[gActiveBank].unk1_3 = 0; + gProtectStructs[gActiveBank].unk1_5 = 0; + gProtectStructs[gActiveBank].unk1_6 = 0; + gProtectStructs[gActiveBank].unk1_7 = 0; + gProtectStructs[gActiveBank].unk2_0 = 0; + gProtectStructs[gActiveBank].unk2_1 = 0; + gProtectStructs[gActiveBank].unk2_2 = 0; + gProtectStructs[gActiveBank].unk2_3 = 0; + + gDisableStructs[gActiveBank].unk16 = 2; + gLastUsedMove[gActiveBank] = 0; + gMoveHitWith[gActiveBank] = 0; + gUnknown_02024C44[gActiveBank] = 0; + gUnknown_02024C4C[gActiveBank] = 0; + gUnknown_02024C2C[gActiveBank] = 0; + gUnknown_02024C5C[gActiveBank] = 0xFF; + + ewram[0x160E8 + gActiveBank * 2 + 0] = 0; + ewram[0x160E8 + gActiveBank * 2 + 1] = 0; + ewram[0x160AC + gActiveBank * 2 + 0] = 0; + ewram[0x160AC + gActiveBank * 2 + 1] = 0; + ewram[0x16100 + gActiveBank * 4 + 0] = 0; + ewram[0x16100 + gActiveBank * 4 + 1] = 0; + ewram[0x16100 + gActiveBank * 4 + 2] = 0; + ewram[0x16100 + gActiveBank * 4 + 3] = 0; ptr2 = (u32 *)(ewram + 0x17100); - ptr2[gUnknown_02024A60] = 0; + ptr2[gActiveBank] = 0; - gBattleMons[gUnknown_02024A60].type1 = gBaseStats[gBattleMons[gUnknown_02024A60].species].type1; - gBattleMons[gUnknown_02024A60].type2 = gBaseStats[gBattleMons[gUnknown_02024A60].species].type2; + gBattleMons[gActiveBank].type1 = gBaseStats[gBattleMons[gActiveBank].species].type1; + gBattleMons[gActiveBank].type2 = gBaseStats[gBattleMons[gActiveBank].species].type2; } void bc_8012FAC(void) { - switch (gUnknown_02024D1E[0]) + switch (gBattleCommunication[0]) { case 0: - gUnknown_02024A60 = gUnknown_02024D1E[1]; - dp01_build_cmdbuf_x00_a_b_0(0, 0, 0); - dp01_battle_side_mark_buffer_for_execution(gUnknown_02024A60); - gUnknown_02024D1E[0]++; + gActiveBank = gBattleCommunication[1]; + EmitGetAttributes(0, 0, 0); + MarkBufferBankForExecution(gActiveBank); + gBattleCommunication[0]++; break; case 1: - if (gUnknown_02024A64 == 0) + if (gBattleExecBuffer == 0) { - gUnknown_02024D1E[1]++; - if (gUnknown_02024D1E[1] == gUnknown_02024A68) - gUnknown_030042D4 = bc_load_battlefield; + gBattleCommunication[1]++; + if (gBattleCommunication[1] == gNoOfAllBanks) + gBattleMainFunc = bc_load_battlefield; else - gUnknown_02024D1E[0] = 0; + gBattleCommunication[0] = 0; } break; } @@ -1888,14 +1888,14 @@ void bc_8012FAC(void) void bc_load_battlefield(void) { - if (gUnknown_02024A64 == 0) + if (gBattleExecBuffer == 0) { - gUnknown_02024A60 = battle_get_side_with_given_state(0); - dp01_build_cmdbuf_x2E_a(0, gBattleTerrain); - dp01_battle_side_mark_buffer_for_execution(gUnknown_02024A60); - gUnknown_030042D4 = sub_8011384; - gUnknown_02024D1E[0] = 0; - gUnknown_02024D1E[1] = 0; + gActiveBank = GetBankByPlayerAI(0); + EmitBattleIntroSlide(0, gBattleTerrain); + MarkBufferBankForExecution(gActiveBank); + gBattleMainFunc = sub_8011384; + gBattleCommunication[0] = 0; + gBattleCommunication[1] = 0; } } @@ -1904,14 +1904,14 @@ void sub_8011384(void) u8 *ptr; s32 i; - if (gUnknown_02024A64 == 0) + if (gBattleExecBuffer == 0) { - for (gUnknown_02024A60 = 0; gUnknown_02024A60 < gUnknown_02024A68; gUnknown_02024A60++) + for (gActiveBank = 0; gActiveBank < gNoOfAllBanks; gActiveBank++) { if ((gBattleTypeFlags & BATTLE_TYPE_SAFARI) - && battle_side_get_owner(gUnknown_02024A60) == 0) + && GetBankSide(gActiveBank) == 0) { - ptr = (u8 *)&gBattleMons[gUnknown_02024A60]; + ptr = (u8 *)&gBattleMons[gActiveBank]; for (i = 0; i < (u32)0x58; i++) ptr[i] = 0; } @@ -1919,59 +1919,59 @@ void sub_8011384(void) { u8 r0; - ptr = (u8 *)&gBattleMons[gUnknown_02024A60]; + ptr = (u8 *)&gBattleMons[gActiveBank]; for (i = 0; i < (u32)0x58; i++) - ptr[i] = gUnknown_02024260[gUnknown_02024A60][4 + i]; + ptr[i] = gBattleBufferB[gActiveBank][4 + i]; - gBattleMons[gUnknown_02024A60].type1 = gBaseStats[gBattleMons[gUnknown_02024A60].species].type1; - gBattleMons[gUnknown_02024A60].type2 = gBaseStats[gBattleMons[gUnknown_02024A60].species].type2; - gBattleMons[gUnknown_02024A60].ability = GetAbilityBySpecies(gBattleMons[gUnknown_02024A60].species, gBattleMons[gUnknown_02024A60].altAbility); - r0 = battle_side_get_owner(gUnknown_02024A60); - ewram160BC[r0] = gBattleMons[gUnknown_02024A60].hp; + gBattleMons[gActiveBank].type1 = gBaseStats[gBattleMons[gActiveBank].species].type1; + gBattleMons[gActiveBank].type2 = gBaseStats[gBattleMons[gActiveBank].species].type2; + gBattleMons[gActiveBank].ability = GetAbilityBySpecies(gBattleMons[gActiveBank].species, gBattleMons[gActiveBank].altAbility); + r0 = GetBankSide(gActiveBank); + ewram160BC[r0] = gBattleMons[gActiveBank].hp; for (i = 0; i < 8; i++) - gBattleMons[gUnknown_02024A60].statStages[i] = 6; - gBattleMons[gUnknown_02024A60].status2 = 0; + gBattleMons[gActiveBank].statStages[i] = 6; + gBattleMons[gActiveBank].status2 = 0; } - if (battle_get_per_side_status(gUnknown_02024A60) == 0) + if (GetBankIdentity(gActiveBank) == 0) { dp01_build_cmdbuf_x07_7_7_7(0); - dp01_battle_side_mark_buffer_for_execution(gUnknown_02024A60); + MarkBufferBankForExecution(gActiveBank); } if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) { - if (battle_get_per_side_status(gUnknown_02024A60) == 1) + if (GetBankIdentity(gActiveBank) == 1) { dp01_build_cmdbuf_x07_7_7_7(0); - dp01_battle_side_mark_buffer_for_execution(gUnknown_02024A60); + MarkBufferBankForExecution(gActiveBank); } - if (battle_side_get_owner(gUnknown_02024A60) == 1 + if (GetBankSide(gActiveBank) == 1 && !(gBattleTypeFlags & (BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_LINK))) - GetNationalPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gUnknown_02024A60].species), 2); + GetNationalPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gActiveBank].species), 2); } else { - if (battle_side_get_owner(gUnknown_02024A60) == 1 + if (GetBankSide(gActiveBank) == 1 && !(gBattleTypeFlags & (BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_LINK))) { - GetNationalPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gUnknown_02024A60].species), 2); + GetNationalPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gActiveBank].species), 2); dp01_build_cmdbuf_x04_4_4_4(0); - dp01_battle_side_mark_buffer_for_execution(gUnknown_02024A60); + MarkBufferBankForExecution(gActiveBank); } } if (gBattleTypeFlags & BATTLE_TYPE_MULTI) { - if (battle_get_per_side_status(gUnknown_02024A60) == 2 - || battle_get_per_side_status(gUnknown_02024A60) == 3) + if (GetBankIdentity(gActiveBank) == 2 + || GetBankIdentity(gActiveBank) == 3) { dp01_build_cmdbuf_x07_7_7_7(0); - dp01_battle_side_mark_buffer_for_execution(gUnknown_02024A60); + MarkBufferBankForExecution(gActiveBank); } } } - gUnknown_030042D4 = bc_801333C; + gBattleMainFunc = bc_801333C; } } @@ -1979,7 +1979,7 @@ void bc_801333C(void) { s32 i; - if (gUnknown_02024A64 == 0) + if (gBattleExecBuffer == 0) { struct { @@ -2003,9 +2003,9 @@ void bc_801333C(void) sp0[i].status = GetMonData(&gEnemyParty[i], MON_DATA_STATUS); } } - gUnknown_02024A60 = battle_get_side_with_given_state(1); + gActiveBank = GetBankByPlayerAI(1); dp01_build_cmdbuf_x30_TODO(0, (u8 *)sp0, 0x80); - dp01_battle_side_mark_buffer_for_execution(gUnknown_02024A60); + MarkBufferBankForExecution(gActiveBank); for (i = 0; i < 6; i++) { @@ -2021,11 +2021,11 @@ void bc_801333C(void) sp0[i].status = GetMonData(&gPlayerParty[i], MON_DATA_STATUS); } } - gUnknown_02024A60 = battle_get_side_with_given_state(0); + gActiveBank = GetBankByPlayerAI(0); dp01_build_cmdbuf_x30_TODO(0, (u8 *)sp0, 0x80); - dp01_battle_side_mark_buffer_for_execution(gUnknown_02024A60); + MarkBufferBankForExecution(gActiveBank); - gUnknown_030042D4 = bc_battle_begin_message; + gBattleMainFunc = bc_battle_begin_message; } else { @@ -2047,198 +2047,198 @@ void bc_801333C(void) } } - gUnknown_030042D4 = bc_8013568; + gBattleMainFunc = bc_8013568; } } } void bc_battle_begin_message(void) { - if (gUnknown_02024A64 == 0) + if (gBattleExecBuffer == 0) { - gUnknown_02024A60 = battle_get_side_with_given_state(1); - b_std_message(0, gUnknown_02024A60); - gUnknown_030042D4 = sub_8011800; + gActiveBank = GetBankByPlayerAI(1); + PrepareStringBattle(0, gActiveBank); + gBattleMainFunc = sub_8011800; } } void bc_8013568(void) { - if (gUnknown_02024A64 == 0) + if (gBattleExecBuffer == 0) { - gUnknown_030042D4 = sub_8011970; - b_std_message(0, 0); + gBattleMainFunc = sub_8011970; + PrepareStringBattle(0, 0); } } void sub_8011800(void) { - if (gUnknown_02024A64 == 0) + if (gBattleExecBuffer == 0) { - b_std_message(1, battle_get_side_with_given_state(1)); - gUnknown_030042D4 = sub_8011834; + PrepareStringBattle(1, GetBankByPlayerAI(1)); + gBattleMainFunc = sub_8011834; } } void sub_8011834(void) { - if (gUnknown_02024A64 == 0) + if (gBattleExecBuffer == 0) { - for (gUnknown_02024A60 = 0; gUnknown_02024A60 < gUnknown_02024A68; gUnknown_02024A60++) + for (gActiveBank = 0; gActiveBank < gNoOfAllBanks; gActiveBank++) { - if (battle_get_per_side_status(gUnknown_02024A60) == 1) + if (GetBankIdentity(gActiveBank) == 1) { dp01_build_cmdbuf_x2F_2F_2F_2F(0); - dp01_battle_side_mark_buffer_for_execution(gUnknown_02024A60); + MarkBufferBankForExecution(gActiveBank); } if ((gBattleTypeFlags & BATTLE_TYPE_MULTI) - && battle_get_per_side_status(gUnknown_02024A60) == 3) + && GetBankIdentity(gActiveBank) == 3) { dp01_build_cmdbuf_x2F_2F_2F_2F(0); - dp01_battle_side_mark_buffer_for_execution(gUnknown_02024A60); + MarkBufferBankForExecution(gActiveBank); } } - gUnknown_030042D4 = bc_801362C; + gBattleMainFunc = bc_801362C; } } void bc_801362C(void) { - if (gUnknown_02024A64 == 0) + if (gBattleExecBuffer == 0) { - for (gUnknown_02024A60 = 0; gUnknown_02024A60 < gUnknown_02024A68; gUnknown_02024A60++) + for (gActiveBank = 0; gActiveBank < gNoOfAllBanks; gActiveBank++) { - if (battle_side_get_owner(gUnknown_02024A60) == 1 + if (GetBankSide(gActiveBank) == 1 && !(gBattleTypeFlags & (BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_LINK))) - GetNationalPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gUnknown_02024A60].species), 2); + GetNationalPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gActiveBank].species), 2); } - gUnknown_030042D4 = sub_8011970; + gBattleMainFunc = sub_8011970; } } void unref_sub_8011950(void) { - if (gUnknown_02024A64 == 0) - gUnknown_030042D4 = sub_8011970; + if (gBattleExecBuffer == 0) + gBattleMainFunc = sub_8011970; } void sub_8011970(void) { - if (gUnknown_02024A64 == 0) + if (gBattleExecBuffer == 0) { if (!(gBattleTypeFlags & BATTLE_TYPE_SAFARI)) - b_std_message(1, battle_get_side_with_given_state(0)); - gUnknown_030042D4 = sub_80119B4; + PrepareStringBattle(1, GetBankByPlayerAI(0)); + gBattleMainFunc = sub_80119B4; } } void sub_80119B4(void) { - if (gUnknown_02024A64 == 0) + if (gBattleExecBuffer == 0) { - for (gUnknown_02024A60 = 0; gUnknown_02024A60 < gUnknown_02024A68; gUnknown_02024A60++) + for (gActiveBank = 0; gActiveBank < gNoOfAllBanks; gActiveBank++) { - if (battle_get_per_side_status(gUnknown_02024A60) == 0) + if (GetBankIdentity(gActiveBank) == 0) { dp01_build_cmdbuf_x2F_2F_2F_2F(0); - dp01_battle_side_mark_buffer_for_execution(gUnknown_02024A60); + MarkBufferBankForExecution(gActiveBank); } if ((gBattleTypeFlags & BATTLE_TYPE_MULTI) - && battle_get_per_side_status(gUnknown_02024A60) == 2) + && GetBankIdentity(gActiveBank) == 2) { dp01_build_cmdbuf_x2F_2F_2F_2F(0); - dp01_battle_side_mark_buffer_for_execution(gUnknown_02024A60); + MarkBufferBankForExecution(gActiveBank); } } ewram16058 = 0; ewram160F9 = 0; ewram160E6 = 0; - gUnknown_030042D4 = sub_8011B00; + gBattleMainFunc = BattleBeginFirstTurn; } } void unref_sub_8011A68(void) { - if (gUnknown_02024A64 == 0) + if (gBattleExecBuffer == 0) { - for (gUnknown_02024A60 = 0; gUnknown_02024A60 < gUnknown_02024A68; gUnknown_02024A60++) + for (gActiveBank = 0; gActiveBank < gNoOfAllBanks; gActiveBank++) { - if (battle_side_get_owner(gUnknown_02024A60) == 0) + if (GetBankSide(gActiveBank) == 0) { - sub_800C704(0, gUnknown_02024A6A[gUnknown_02024A60], 0); - dp01_battle_side_mark_buffer_for_execution(gUnknown_02024A60); + sub_800C704(0, gBattlePartyID[gActiveBank], 0); + MarkBufferBankForExecution(gActiveBank); } } ewram16058 = 0; ewram160F9 = 0; ewram160E6 = 0; - gUnknown_030042D4 = sub_8011B00; + gBattleMainFunc = BattleBeginFirstTurn; } } -void sub_8011B00(void) +void BattleBeginFirstTurn(void) { s32 i; s32 j; u8 r9 = 0; - if (gUnknown_02024A64 == 0) + if (gBattleExecBuffer == 0) { if (ewram16058 == 0) { - for (i = 0; i < gUnknown_02024A68; i++) - gUnknown_02024A7A[i] = i; - for (i = 0; i < gUnknown_02024A68 - 1; i++) + for (i = 0; i < gNoOfAllBanks; i++) + gTurnOrder[i] = i; + for (i = 0; i < gNoOfAllBanks - 1; i++) { - for (j = i + 1; j < gUnknown_02024A68; j++) + for (j = i + 1; j < gNoOfAllBanks; j++) { - if (b_first_side(gUnknown_02024A7A[i], gUnknown_02024A7A[j], 1) != 0) + if (b_first_side(gTurnOrder[i], gTurnOrder[j], 1) != 0) sub_8012FBC(i, j); } } } - if (ewram160E6 == 0 && sub_8018324(0, 0, 0, 0xFF, 0) != 0) + if (ewram160E6 == 0 && AbilityBattleEffects(0, 0, 0, 0xFF, 0) != 0) { ewram160E6 = 1; return; } - while (ewram16058 < gUnknown_02024A68) + while (ewram16058 < gNoOfAllBanks) { - if (sub_8018324(0, gUnknown_02024A7A[ewram16058], 0, 0, 0) != 0) + if (AbilityBattleEffects(0, gTurnOrder[ewram16058], 0, 0, 0) != 0) r9++; ewram16058++; if (r9 != 0) return; } - if (sub_8018324(9, 0, 0, 0, 0) != 0) + if (AbilityBattleEffects(9, 0, 0, 0, 0) != 0) return; - if (sub_8018324(11, 0, 0, 0, 0) != 0) + if (AbilityBattleEffects(11, 0, 0, 0, 0) != 0) return; - while (ewram160F9 < gUnknown_02024A68) + while (ewram160F9 < gNoOfAllBanks) { - if (sub_801A02C(0, gUnknown_02024A7A[ewram160F9], 0) != 0) + if (sub_801A02C(0, gTurnOrder[ewram160F9], 0) != 0) r9++; ewram160F9++; if (r9 != 0) return; } // Absolutely pointless for-loop that somehow doesn't get optimized out - for (i = 0; i < gUnknown_02024A68; i++) + for (i = 0; i < gNoOfAllBanks; i++) ; for (i = 0; i < 4; i++) { ewram[0x16068 + i] = 6; - gUnknown_02024C18[i] = 0xFF; - gUnknown_02024C60[i] = 0; + gActionForBanks[i] = 0xFF; + gChosenMovesByBanks[i] = 0; } - sub_801365C(0); - sub_801377C(); - ewram160A6 = gUnknown_02024C0C; - gUnknown_030042D4 = sub_8012324; + TurnValuesCleanUp(0); + SpecialStatusesClear(); + ewram160A6 = gAbsentBankFlags; + gBattleMainFunc = sub_8012324; sub_80156DC(); for (i = 0; i < 8; i++) - gUnknown_02024D1E[i] = 0; - for (i = 0; i < gUnknown_02024A68; i++) + gBattleCommunication[i] = 0; + for (i = 0; i < gNoOfAllBanks; i++) gBattleMons[i].status2 &= ~8; ewram16000 = 0; ewram16001 = 0; @@ -2248,7 +2248,7 @@ void sub_8011B00(void) ewram16059 = 0; ewram1600E = 0; gBattleMoveFlags = 0; - gUnknown_02024D1C = Random(); + gRandomTurnNumber = Random(); } } @@ -2256,16 +2256,16 @@ void bc_8013B1C(void) { s32 i; - if (gUnknown_02024A64 == 0) + if (gBattleExecBuffer == 0) { - gUnknown_030042D4 = sub_8011E8C; + gBattleMainFunc = BattleTurnPassed; for (i = 0; i < 8; i++) - gUnknown_02024D1E[i] = 0; - for (i = 0; i < gUnknown_02024A68; i++) + gBattleCommunication[i] = 0; + for (i = 0; i < gNoOfAllBanks; i++) { gBattleMons[i].status2 &= ~8; if ((gBattleMons[i].status1 & 7) && (gBattleMons[i].status2 & 0x1000)) - b_cancel_multi_turn_move_maybe(i); + CancelMultiTurnMoves(i); } ewram16000 = 0; ewram16001 = 0; @@ -2276,16 +2276,16 @@ void bc_8013B1C(void) } } -void sub_8011E8C(void) +void BattleTurnPassed(void) { s32 i; - sub_801365C(1); - if (gUnknown_02024D26 == 0) + TurnValuesCleanUp(1); + if (gBattleOutcome == 0) { - if (sub_8015DFC() != 0) + if (UpdateTurnCounters() != 0) return; - if (sub_8016558() != 0) + if (TurnBasedEffects() != 0) return; } if (sub_80173A4() != 0) @@ -2293,94 +2293,94 @@ void sub_8011E8C(void) ewram16059 = 0; if (sub_80170DC() != 0) return; - sub_801365C(0); - gUnknown_02024C6C &= ~0x200; - gUnknown_02024C6C &= ~0x80000; - gUnknown_02024C6C &= ~0x400000; - gUnknown_02024C6C &= ~0x100000; + TurnValuesCleanUp(0); + gHitMarker &= ~0x200; + gHitMarker &= ~0x80000; + gHitMarker &= ~0x400000; + gHitMarker &= ~0x100000; ewram16002 = 0; ewram160A1 = 0; ewram1600C = 0; gBattleMoveDamage = 0; gBattleMoveFlags = 0; for (i = 0; i < 5; i++) - gUnknown_02024D1E[i] = 0; - if (gUnknown_02024D26 != 0) + gBattleCommunication[i] = 0; + if (gBattleOutcome != 0) { - gUnknown_02024A7F = 12; - gUnknown_030042D4 = sub_80138F0; + gFightStateTracker = 12; + gBattleMainFunc = sub_80138F0; return; } - if (gUnknown_030042E0.unk13 < 0xFF) - gUnknown_030042E0.unk13++; - for (i = 0; i < gUnknown_02024A68; i++) + if (gBattleResults.unk13 < 0xFF) + gBattleResults.unk13++; + for (i = 0; i < gNoOfAllBanks; i++) { - gUnknown_02024C18[i] = 0xFF; - gUnknown_02024C60[i] = 0; + gActionForBanks[i] = 0xFF; + gChosenMovesByBanks[i] = 0; } for (i = 0; i < 4; i++) ewram[0x16068 + i] = 6; - ewram160A6 = gUnknown_02024C0C; - gUnknown_030042D4 = sub_8012324; - gUnknown_02024D1C = Random(); + ewram160A6 = gAbsentBankFlags; + gBattleMainFunc = sub_8012324; + gRandomTurnNumber = Random(); } -u8 sub_8012028(void) +u8 CanRunFromBattle(void) { u8 r2; u8 r6; s32 i; - if (gBattleMons[gUnknown_02024A60].item == 0xAF) - r2 = gEnigmaBerries[gUnknown_02024A60].holdEffect; + if (gBattleMons[gActiveBank].item == 0xAF) + r2 = gEnigmaBerries[gActiveBank].holdEffect; else - r2 = ItemId_GetHoldEffect(gBattleMons[gUnknown_02024A60].item); - gUnknown_02024C0B = gUnknown_02024A60; + r2 = ItemId_GetHoldEffect(gBattleMons[gActiveBank].item); + gStringBank = gActiveBank; if (r2 == 0x25) return 0; if (gBattleTypeFlags & BATTLE_TYPE_LINK) return 0; - if (gBattleMons[gUnknown_02024A60].ability == ABILITY_RUN_AWAY) + if (gBattleMons[gActiveBank].ability == ABILITY_RUN_AWAY) return 0; - r6 = battle_side_get_owner(gUnknown_02024A60); - for (i = 0; i < gUnknown_02024A68; i++) + r6 = GetBankSide(gActiveBank); + for (i = 0; i < gNoOfAllBanks; i++) { - if (r6 != battle_side_get_owner(i) + if (r6 != GetBankSide(i) && gBattleMons[i].ability == 0x17) { ewram16003 = i; - byte_2024C06 = gBattleMons[i].ability; - gUnknown_02024D1E[5] = 2; + gLastUsedAbility = gBattleMons[i].ability; + gBattleCommunication[5] = 2; return 2; } - if (r6 != battle_side_get_owner(i) - && gBattleMons[gUnknown_02024A60].ability != ABILITY_LEVITATE - && gBattleMons[gUnknown_02024A60].type1 != 2 - && gBattleMons[gUnknown_02024A60].type2 != 2 + if (r6 != GetBankSide(i) + && gBattleMons[gActiveBank].ability != ABILITY_LEVITATE + && gBattleMons[gActiveBank].type1 != 2 + && gBattleMons[gActiveBank].type2 != 2 && gBattleMons[i].ability == 0x47) { ewram16003 = i; - byte_2024C06 = gBattleMons[i].ability; - gUnknown_02024D1E[5] = 2; + gLastUsedAbility = gBattleMons[i].ability; + gBattleCommunication[5] = 2; return 2; } } - i = sub_8018324(15, gUnknown_02024A60, 0x2A, 0, 0); - if (i != 0 && (gBattleMons[gUnknown_02024A60].type1 == 8 || gBattleMons[gUnknown_02024A60].type2 == 8)) + i = AbilityBattleEffects(15, gActiveBank, 0x2A, 0, 0); + if (i != 0 && (gBattleMons[gActiveBank].type1 == 8 || gBattleMons[gActiveBank].type2 == 8)) { ewram16003 = i - 1; - byte_2024C06 = gBattleMons[i - 1].ability; - gUnknown_02024D1E[5] = 2; + gLastUsedAbility = gBattleMons[i - 1].ability; + gBattleCommunication[5] = 2; return 2; } - if ((gBattleMons[gUnknown_02024A60].status2 & 0x0400E000) || (gUnknown_02024C98[gUnknown_02024A60] & 0x400)) + if ((gBattleMons[gActiveBank].status2 & 0x0400E000) || (gStatuses3[gActiveBank] & 0x400)) { - gUnknown_02024D1E[5] = 0; + gBattleCommunication[5] = 0; return 1; } if (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE) { - gUnknown_02024D1E[5] = 1; + gBattleCommunication[5] = 1; return 1; } return 0; @@ -2394,7 +2394,7 @@ void sub_8012258(u8 a) for (i = 0; i < 3; i++) gUnknown_02038470[i] = ewram[0x1606C + i + a * 3]; - r4 = pokemon_order_func(gUnknown_02024A6A[a]); + r4 = pokemon_order_func(gBattlePartyID[a]); r1 = pokemon_order_func(ewram[0x16068 + a]); sub_8094C98(r4, r1); if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) @@ -2419,44 +2419,44 @@ void sub_8012324(void) { u8 r5; - gUnknown_02024D1E[4] = 0; + gBattleCommunication[4] = 0; // inverted loop //_0801234C - for (gUnknown_02024A60 = 0; gUnknown_02024A60 < gUnknown_02024A68; gUnknown_02024A60++) + for (gActiveBank = 0; gActiveBank < gNoOfAllBanks; gActiveBank++) { - r5 = battle_get_per_side_status(gUnknown_02024A60); - switch (gUnknown_02024D1E[gUnknown_02024A60]) + r5 = GetBankIdentity(gActiveBank); + switch (gBattleCommunication[gActiveBank]) { case 0: - ewram[0x016068 + gUnknown_02024A60] = 6; + ewram[0x016068 + gActiveBank] = 6; if (!(gBattleTypeFlags & 0x40) && (r5 & 2) - && !(ewram160A6 & gBitTable[battle_get_side_with_given_state(r5 ^ 2)]) - && gUnknown_02024D1E[battle_get_side_with_given_state(r5)] != 4) + && !(ewram160A6 & gBitTable[GetBankByPlayerAI(r5 ^ 2)]) + && gBattleCommunication[GetBankByPlayerAI(r5)] != 4) break; //_080123F8 - if (ewram160A6 & gBitTable[gUnknown_02024A60]) + if (ewram160A6 & gBitTable[gActiveBank]) { - gUnknown_02024C18[gUnknown_02024A60] = 13; + gActionForBanks[gActiveBank] = 13; if (!(gBattleTypeFlags & 0x40)) - gUnknown_02024D1E[gUnknown_02024A60] = 4; + gBattleCommunication[gActiveBank] = 4; //_08012454 else - gUnknown_02024D1E[gUnknown_02024A60] = 3; + gBattleCommunication[gActiveBank] = 3; break; } //_08012468 - if ((gBattleMons[gUnknown_02024A60].status2 & 0x1000) - || (gBattleMons[gUnknown_02024A60].status2 & 0x10000000)) + if ((gBattleMons[gActiveBank].status2 & 0x1000) + || (gBattleMons[gActiveBank].status2 & 0x10000000)) { - gUnknown_02024C18[gUnknown_02024A60] = 0; - gUnknown_02024D1E[gUnknown_02024A60] = 3; + gActionForBanks[gActiveBank] = 0; + gBattleCommunication[gActiveBank] = 3; } else { - dp01_build_cmdbuf_x12_a_bb(0, gUnknown_02024C18[0], gUnknown_02024260[0][1] | (gUnknown_02024260[0][2] << 8)); - dp01_battle_side_mark_buffer_for_execution(gUnknown_02024A60); - gUnknown_02024D1E[gUnknown_02024A60]++; + dp01_build_cmdbuf_x12_a_bb(0, gActionForBanks[0], gBattleBufferB[0][1] | (gBattleBufferB[0][2] << 8)); + MarkBufferBankForExecution(gActiveBank); + gBattleCommunication[gActiveBank]++; } break; case 1: diff --git a/src/battle_6.c b/src/battle_6.c index 866a66ae3..df2419f70 100644 --- a/src/battle_6.c +++ b/src/battle_6.c @@ -9,11 +9,11 @@ extern u16 gUnknown_030042A0; extern struct Window gUnknown_03004210; -extern void (*gUnknown_03004330[])(void); +extern void (*gBattleBankFunc[])(void); -extern u8 gUnknown_02024A60; -extern u8 gUnknown_02024E60[]; -extern u8 gUnknown_020238CC[]; +extern u8 gActiveBank; +extern u8 gActionSelectionCursor[]; +extern u8 gDisplayedStringBattle[]; extern u16 gUnknown_030042C0; extern u16 gUnknown_030041B4; @@ -39,7 +39,7 @@ void sub_803037C(void) { FillWindowRect(&gUnknown_03004210, 10, 2, 15, 27, 18); FillWindowRect(&gUnknown_03004210, 10, 2, 35, 16, 38); - gUnknown_03004330[gUnknown_02024A60] = sub_802C098; + gBattleBankFunc[gActiveBank] = sub_802C098; InitWindow(&gUnknown_03004210, gUnknown_08400CF3, 400, 18, 35); sub_8002F44(&gUnknown_03004210); @@ -50,9 +50,9 @@ void sub_803037C(void) { nullsub_8(r4); } - sub_802E3E4(gUnknown_02024E60[gUnknown_02024A60], 0); + sub_802E3E4(gActionSelectionCursor[gActiveBank], 0); - get_battle_strings_((u8 *) gUnknown_08400CA8); - InitWindow(&gUnknown_03004210, gUnknown_020238CC, SUB_803037C_TILE_DATA_OFFSET, 2, 35); + StrCpyDecodeToDisplayedStringBattle((u8 *) gUnknown_08400CA8); + InitWindow(&gUnknown_03004210, gDisplayedStringBattle, SUB_803037C_TILE_DATA_OFFSET, 2, 35); sub_8002F44(&gUnknown_03004210); } diff --git a/src/battle_7.c b/src/battle_7.c index 9c8b86fb4..a2990018e 100644 --- a/src/battle_7.c +++ b/src/battle_7.c @@ -29,19 +29,19 @@ struct Struct2019348 u32 unk10; }; -extern u8 gUnknown_02023A60[][0x200]; -extern u8 gUnknown_02024A60; -extern u32 gUnknown_02024A64; -extern u8 gUnknown_02024A68; -extern u16 gUnknown_02024A6A[]; -extern u8 gUnknown_02024A72[]; -extern u8 gUnknown_02024BE0[]; +extern u8 gBattleBufferA[][0x200]; +extern u8 gActiveBank; +extern u32 gBattleExecBuffer; +extern u8 gNoOfAllBanks; +extern u16 gBattlePartyID[]; +extern u8 gBanksBySide[]; +extern u8 gObjectBankIDs[]; extern u16 gUnknown_02024DE8; -extern u8 gUnknown_02024E6D; -extern u32 gUnknown_02024E70[]; +extern u8 gDoingBattleAnim; +extern u32 gPID_perBank[]; extern struct Window gUnknown_03004210; -extern void (*gUnknown_03004330[])(void); -extern u8 gUnknown_03004340[]; +extern void (*gBattleBankFunc[])(void); +extern u8 gHealthboxIDs[]; extern u8 gUnknown_0300434C[]; extern struct MusicPlayerInfo gMPlay_SE1; extern struct MusicPlayerInfo gMPlay_SE2; @@ -63,7 +63,7 @@ extern const u8 gSubstituteDollGfx[]; extern const u8 gSubstituteDollPal[]; extern const struct SpriteSheet gUnknown_081FAF24; extern const struct SpriteTemplate gSpriteTemplate_81FAF34; -extern void (*const gUnknown_081FAF5C[])(void); +extern void (*const gOpponentBufferCommands[])(void); extern const struct SpriteSheet gUnknown_0820A47C; extern const struct SpriteSheet gUnknown_0820A484; extern const struct SpriteSheet gUnknown_0820A48C[]; @@ -98,9 +98,9 @@ void sub_80324E0(u8 a); void sub_80327CC(void); void sub_8032978(struct Sprite *); void sub_80328A4(struct Sprite *); -void sub_8032AFC(void); +void OpponentBufferRunCommand(void); void sub_80332D0(void); -void sub_80334EC(void); +void OpponentBufferExecCompleted(void); void sub_80312F0(struct Sprite *sprite) { @@ -142,36 +142,36 @@ void sub_80313A0(struct Sprite *sprite) void move_anim_start_t2_for_situation(u8 a, u32 b) { - ewram17810[gUnknown_02024A60].unk0_4 = 1; + ewram17810[gActiveBank].unk0_4 = 1; if (a == 0) { if (b == 0x20) - move_anim_start_t2(gUnknown_02024A60, 6); + move_anim_start_t2(gActiveBank, 6); else if (b == 8 || (b & 0x80)) - move_anim_start_t2(gUnknown_02024A60, 0); + move_anim_start_t2(gActiveBank, 0); else if (b == 0x10) - move_anim_start_t2(gUnknown_02024A60, 2); + move_anim_start_t2(gActiveBank, 2); else if (b & 7) - move_anim_start_t2(gUnknown_02024A60, 4); + move_anim_start_t2(gActiveBank, 4); else if (b == 0x40) - move_anim_start_t2(gUnknown_02024A60, 5); + move_anim_start_t2(gActiveBank, 5); else - ewram17810[gUnknown_02024A60].unk0_4 = 0; + ewram17810[gActiveBank].unk0_4 = 0; } else { if (b & 0x000F0000) - move_anim_start_t2(gUnknown_02024A60, 3); + move_anim_start_t2(gActiveBank, 3); else if (b & 7) - move_anim_start_t2(gUnknown_02024A60, 1); + move_anim_start_t2(gActiveBank, 1); else if (b & 0x10000000) - move_anim_start_t2(gUnknown_02024A60, 7); + move_anim_start_t2(gActiveBank, 7); else if (b & 0x08000000) - move_anim_start_t2(gUnknown_02024A60, 8); + move_anim_start_t2(gActiveBank, 8); else if (b & 0x0000E000) - move_anim_start_t2(gUnknown_02024A60, 9); + move_anim_start_t2(gActiveBank, 9); else - ewram17810[gUnknown_02024A60].unk0_4 = 0; + ewram17810[gActiveBank].unk0_4 = 0; } } @@ -186,9 +186,9 @@ bool8 move_anim_start_t3(u8 a, u8 b, u8 c, u8 d, u16 e) } if (ewram17800[a].unk0_2 && sub_803163C(d) == 0) return TRUE; - if (ewram17800[a].unk0_2 && d == 2 && gSprites[gUnknown_02024BE0[a]].invisible) + if (ewram17800[a].unk0_2 && d == 2 && gSprites[gObjectBankIDs[a]].invisible) { - refresh_graphics_maybe(a, 1, gUnknown_02024BE0[a]); + refresh_graphics_maybe(a, 1, gObjectBankIDs[a]); sub_80324E0(a); return TRUE; } @@ -262,7 +262,7 @@ bool8 mplay_80342A4(u8 a) if (IsSEPlaying()) { ewram17810[a].unk8++; - if (ewram17810[gUnknown_02024A60].unk8 < 30) + if (ewram17810[gActiveBank].unk8 < 30) return TRUE; m4aMPlayStop(&gMPlay_SE1); m4aMPlayStop(&gMPlay_SE2); @@ -294,10 +294,10 @@ void sub_8031794(struct Pokemon *pkmn, u8 b) else { species = ewram17800[b].unk2; - r7 = gUnknown_02024E70[b]; + r7 = gPID_perBank[b]; } otId = GetMonData(pkmn, MON_DATA_OT_ID); - var = battle_get_per_side_status(b); + var = GetBankIdentity(b); HandleLoadSpecialPokePic( &gMonFrontPicTable[species], gMonFrontPicCoords[species].coords, @@ -346,10 +346,10 @@ void sub_80318FC(struct Pokemon *pkmn, u8 b) else { species = ewram17800[b].unk2; - r7 = gUnknown_02024E70[b]; + r7 = gPID_perBank[b]; } otId = GetMonData(pkmn, MON_DATA_OT_ID); - var = battle_get_per_side_status(b); + var = GetBankIdentity(b); HandleLoadSpecialPokePic( &gMonBackPicTable[species], gMonBackPicCoords[species].coords, @@ -392,7 +392,7 @@ void sub_8031A6C(u16 a, u8 b) u8 status; struct SpriteSheet spriteSheet; - status = battle_get_per_side_status(b); + status = GetBankIdentity(b); DecompressPicFromTable_2( &gTrainerFrontPicTable[a], gTrainerFrontPicCoords[a].coords, @@ -411,7 +411,7 @@ void sub_8031AF4(u16 a, u8 b) { u8 status; - status = battle_get_per_side_status(b); + status = GetBankIdentity(b); DecompressPicFromTable_2( &gTrainerBackPicTable[a], gTrainerBackPicCoords[a].coords, @@ -454,7 +454,7 @@ void unref_sub_8031BA0(void) count = 4; } for (i = 0; i < count; i++) - LoadCompressedObjectPic(&gUnknown_0820A4B4[gUnknown_02024A72[i]]); + LoadCompressedObjectPic(&gUnknown_0820A4B4[gBanksBySide[i]]); } bool8 sub_8031C30(u8 a) @@ -480,9 +480,9 @@ bool8 sub_8031C30(u8 a) else if (a == 3) LoadCompressedObjectPic(&gUnknown_0820A484); else if (a == 4) - LoadCompressedObjectPic(&gUnknown_0820A4B4[gUnknown_02024A72[0]]); + LoadCompressedObjectPic(&gUnknown_0820A4B4[gBanksBySide[0]]); else if (a == 5) - LoadCompressedObjectPic(&gUnknown_0820A4B4[gUnknown_02024A72[1]]); + LoadCompressedObjectPic(&gUnknown_0820A4B4[gBanksBySide[1]]); else retVal = TRUE; } @@ -497,13 +497,13 @@ bool8 sub_8031C30(u8 a) else if (a == 5) LoadCompressedObjectPic(&gUnknown_0820A49C[1]); else if (a == 6) - LoadCompressedObjectPic(&gUnknown_0820A4B4[gUnknown_02024A72[0]]); + LoadCompressedObjectPic(&gUnknown_0820A4B4[gBanksBySide[0]]); else if (a == 7) - LoadCompressedObjectPic(&gUnknown_0820A4B4[gUnknown_02024A72[1]]); + LoadCompressedObjectPic(&gUnknown_0820A4B4[gBanksBySide[1]]); else if (a == 8) - LoadCompressedObjectPic(&gUnknown_0820A4B4[gUnknown_02024A72[2]]); + LoadCompressedObjectPic(&gUnknown_0820A4B4[gBanksBySide[2]]); else if (a == 9) - LoadCompressedObjectPic(&gUnknown_0820A4B4[gUnknown_02024A72[3]]); + LoadCompressedObjectPic(&gUnknown_0820A4B4[gBanksBySide[3]]); else retVal = TRUE; } @@ -542,11 +542,11 @@ u8 battle_load_something(u8 *pState, u8 *b) break; case 3: if ((gBattleTypeFlags & 0x80) && *b == 0) - gUnknown_03004340[*b] = battle_make_oam_safari_battle(); + gHealthboxIDs[*b] = battle_make_oam_safari_battle(); else - gUnknown_03004340[*b] = battle_make_oam_normal_battle(*b); + gHealthboxIDs[*b] = battle_make_oam_normal_battle(*b); (*b)++; - if (*b == gUnknown_02024A68) + if (*b == gNoOfAllBanks) { *b = 0; (*pState)++; @@ -554,30 +554,30 @@ u8 battle_load_something(u8 *pState, u8 *b) break; case 4: sub_8043F44(*b); - if (gUnknown_02024A72[*b] <= 1) - nullsub_11(gUnknown_03004340[*b], 0); + if (gBanksBySide[*b] <= 1) + nullsub_11(gHealthboxIDs[*b], 0); else - nullsub_11(gUnknown_03004340[*b], 1); + nullsub_11(gHealthboxIDs[*b], 1); (*b)++; - if (*b == gUnknown_02024A68) + if (*b == gNoOfAllBanks) { *b = 0; (*pState)++; } break; case 5: - if (battle_side_get_owner(*b) == 0) + if (GetBankSide(*b) == 0) { if (!(gBattleTypeFlags & 0x80)) - sub_8045A5C(gUnknown_03004340[*b], &gPlayerParty[gUnknown_02024A6A[*b]], 0); + sub_8045A5C(gHealthboxIDs[*b], &gPlayerParty[gBattlePartyID[*b]], 0); } else { - sub_8045A5C(gUnknown_03004340[*b], &gEnemyParty[gUnknown_02024A6A[*b]], 0); + sub_8045A5C(gHealthboxIDs[*b], &gEnemyParty[gBattlePartyID[*b]], 0); } - sub_8043DB0(gUnknown_03004340[*b]); + sub_8043DB0(gHealthboxIDs[*b]); (*b)++; - if (*b == gUnknown_02024A68) + if (*b == gNoOfAllBanks) { *b = 0; (*pState)++; @@ -608,13 +608,13 @@ void sub_8031F24(void) { s32 i; - for (i = 0; i < gUnknown_02024A68; i++) - ewram17800[i].unk0_0 = gSprites[gUnknown_02024BE0[i]].invisible; + for (i = 0; i < gNoOfAllBanks; i++) + ewram17800[i].unk0_0 = gSprites[gObjectBankIDs[i]].invisible; } void sub_8031F88(u8 a) { - ewram17800[a].unk0_0 = gSprites[gUnknown_02024BE0[a]].invisible; + ewram17800[a].unk0_0 = gSprites[gObjectBankIDs[a]].invisible; } void sub_8031FC4(u8 a, u8 b, bool8 c) @@ -628,7 +628,7 @@ void sub_8031FC4(u8 a, u8 b, bool8 c) if (c) { - StartSpriteAnim(&gSprites[gUnknown_02024BE0[a]], ewram17840.unk0); + StartSpriteAnim(&gSprites[gObjectBankIDs[a]], ewram17840.unk0); paletteOffset = 0x100 + a * 16; LoadPalette(ewram + 0x16400 + ewram17840.unk0 * 32, paletteOffset, 32); gBattleMonForms[a] = ewram17840.unk0; @@ -637,7 +637,7 @@ void sub_8031FC4(u8 a, u8 b, bool8 c) BlendPalette(paletteOffset, 16, 6, 0x7FFF); CpuCopy32(gPlttBufferFaded + paletteOffset, gPlttBufferUnfaded + paletteOffset, 32); } - gSprites[gUnknown_02024BE0[a]].pos1.y = sub_8077F68(a); + gSprites[gObjectBankIDs[a]].pos1.y = sub_8077F68(a); } else { @@ -661,15 +661,15 @@ void sub_8031FC4(u8 a, u8 b, bool8 c) } else { - r10 = battle_get_per_side_status(a); - if (battle_side_get_owner(b) == 1) - species = GetMonData(&gEnemyParty[gUnknown_02024A6A[b]], MON_DATA_SPECIES); + r10 = GetBankIdentity(a); + if (GetBankSide(b) == 1) + species = GetMonData(&gEnemyParty[gBattlePartyID[b]], MON_DATA_SPECIES); else - species = GetMonData(&gPlayerParty[gUnknown_02024A6A[b]], MON_DATA_SPECIES); - if (battle_side_get_owner(a) == 0) + species = GetMonData(&gPlayerParty[gBattlePartyID[b]], MON_DATA_SPECIES); + if (GetBankSide(a) == 0) { - personalityValue = GetMonData(&gPlayerParty[gUnknown_02024A6A[a]], MON_DATA_PERSONALITY); - otId = GetMonData(&gPlayerParty[gUnknown_02024A6A[a]], MON_DATA_OT_ID); + personalityValue = GetMonData(&gPlayerParty[gBattlePartyID[a]], MON_DATA_PERSONALITY); + otId = GetMonData(&gPlayerParty[gBattlePartyID[a]], MON_DATA_OT_ID); HandleLoadSpecialPokePic( &gMonBackPicTable[species], gMonBackPicCoords[species].coords, @@ -677,12 +677,12 @@ void sub_8031FC4(u8 a, u8 b, bool8 c) 0x02000000, gUnknown_081FAF4C[r10], species, - gUnknown_02024E70[a]); + gPID_perBank[a]); } else { - personalityValue = GetMonData(&gEnemyParty[gUnknown_02024A6A[a]], MON_DATA_PERSONALITY); - otId = GetMonData(&gEnemyParty[gUnknown_02024A6A[a]], MON_DATA_OT_ID); + personalityValue = GetMonData(&gEnemyParty[gBattlePartyID[a]], MON_DATA_PERSONALITY); + otId = GetMonData(&gEnemyParty[gBattlePartyID[a]], MON_DATA_OT_ID); HandleLoadSpecialPokePic( &gMonFrontPicTable[species], gMonFrontPicCoords[species].coords, @@ -690,11 +690,11 @@ void sub_8031FC4(u8 a, u8 b, bool8 c) 0x02000000, gUnknown_081FAF4C[r10], species, - gUnknown_02024E70[a]); + gPID_perBank[a]); } } src = gUnknown_081FAF4C[r10]; - dst = (void *)(VRAM + 0x10000 + gSprites[gUnknown_02024BE0[a]].oam.tileNum * 32); + dst = (void *)(VRAM + 0x10000 + gSprites[gObjectBankIDs[a]].oam.tileNum * 32); DmaCopy32(3, src, dst, 0x800); paletteOffset = 0x100 + a * 16; palette = species_and_otid_get_pal(species, otId, personalityValue); @@ -714,8 +714,8 @@ void sub_8031FC4(u8 a, u8 b, bool8 c) ewram17800[a].unk2 = species; gBattleMonForms[a] = gBattleMonForms[b]; } - gSprites[gUnknown_02024BE0[a]].pos1.y = sub_8077F68(a); - StartSpriteAnim(&gSprites[gUnknown_02024BE0[a]], gBattleMonForms[a]); + gSprites[gObjectBankIDs[a]].pos1.y = sub_8077F68(a); + StartSpriteAnim(&gSprites[gObjectBankIDs[a]], gBattleMonForms[a]); } } @@ -732,10 +732,10 @@ void sub_8032350(u8 a, u8 b) if (IsContest()) r4 = 0; else - r4 = battle_get_per_side_status(a); + r4 = GetBankIdentity(a); if (IsContest()) LZDecompressVram(gSubstituteDollTilemap, gUnknown_081FAF4C[r4]); - else if (battle_side_get_owner(a) != 0) + else if (GetBankSide(a) != 0) LZDecompressVram(gSubstituteDollGfx, gUnknown_081FAF4C[r4]); else LZDecompressVram(gSubstituteDollTilemap, gUnknown_081FAF4C[r4]); @@ -751,10 +751,10 @@ void sub_8032350(u8 a, u8 b) { if (!IsContest()) { - if (battle_side_get_owner(a) != 0) - sub_8031794(&gEnemyParty[gUnknown_02024A6A[a]], a); + if (GetBankSide(a) != 0) + sub_8031794(&gEnemyParty[gBattlePartyID[a]], a); else - sub_80318FC(&gPlayerParty[gUnknown_02024A6A[a]], a); + sub_80318FC(&gPlayerParty[gBattlePartyID[a]], a); } } } @@ -812,7 +812,7 @@ void sub_80324F8(struct Pokemon *pkmn, u8 b) void sub_80325B8(void) { - u8 r4 = battle_get_side_with_given_state(0); + u8 r4 = GetBankByPlayerAI(0); ewram17800[r4].unk0_1 = 0; if (IsDoubleBattle()) @@ -832,10 +832,10 @@ void sub_8032638(void) { if (gMain.inBattle) { - u8 r8 = battle_get_side_with_given_state(0); - u8 r9 = battle_get_side_with_given_state(2); - u8 r4 = pokemon_order_func(gUnknown_02024A6A[r8]); - u8 r5 = pokemon_order_func(gUnknown_02024A6A[r9]); + u8 r8 = GetBankByPlayerAI(0); + u8 r9 = GetBankByPlayerAI(2); + u8 r4 = pokemon_order_func(gBattlePartyID[r8]); + u8 r5 = pokemon_order_func(gBattlePartyID[r9]); if (GetMonData(&gPlayerParty[r4], MON_DATA_HP) != 0) sub_80324F8(&gPlayerParty[r4], r8); @@ -851,19 +851,19 @@ void sub_80326EC(u8 a) { s32 i; - for (i = 0; i < gUnknown_02024A68; i++) + for (i = 0; i < gNoOfAllBanks; i++) { if (sub_8078874(i) != 0) { - gSprites[gUnknown_02024BE0[i]].oam.affineMode = a; + gSprites[gObjectBankIDs[i]].oam.affineMode = a; if (a == 0) { - ewram17810[i].unk6 = gSprites[gUnknown_02024BE0[i]].oam.matrixNum; - gSprites[gUnknown_02024BE0[i]].oam.matrixNum = 0; + ewram17810[i].unk6 = gSprites[gObjectBankIDs[i]].oam.matrixNum; + gSprites[gObjectBankIDs[i]].oam.matrixNum = 0; } else { - gSprites[gUnknown_02024BE0[i]].oam.matrixNum = ewram17810[i].unk6; + gSprites[gObjectBankIDs[i]].oam.matrixNum = ewram17810[i].unk6; } } } @@ -874,12 +874,12 @@ void sub_80327CC(void) u8 r5; LoadCompressedObjectPic(&gUnknown_081FAF24); - r5 = battle_get_side_with_given_state(1); + r5 = GetBankByPlayerAI(1); ewram17810[r5].unk7 = CreateSprite(&gSpriteTemplate_81FAF34, sub_8077ABC(r5, 0), sub_8077ABC(r5, 1) + 32, 0xC8); gSprites[ewram17810[r5].unk7].data0 = r5; if (IsDoubleBattle()) { - r5 = battle_get_side_with_given_state(3); + r5 = GetBankByPlayerAI(3); ewram17810[r5].unk7 = CreateSprite(&gSpriteTemplate_81FAF34, sub_8077ABC(r5, 0), sub_8077ABC(r5, 1) + 32, 0xC8); gSprites[ewram17810[r5].unk7].data0 = r5; } @@ -889,7 +889,7 @@ void sub_80328A4(struct Sprite *sprite) { bool8 invisible = FALSE; u8 r4 = sprite->data0; - struct Sprite *r7 = &gSprites[gUnknown_02024BE0[r4]]; + struct Sprite *r7 = &gSprites[gObjectBankIDs[r4]]; if (!r7->inUse || sub_8078874(r4) == 0) { @@ -914,7 +914,7 @@ void sub_8032978(struct Sprite *sprite) void sub_8032984(u8 a, u16 b) { - if (battle_side_get_owner(a) != 0) + if (GetBankSide(a) != 0) { if (ewram17800[a].unk2 != 0) b = ewram17800[a].unk2; @@ -965,53 +965,53 @@ void nullsub_45(void) { } -void sub_8032AE0(void) +void SetBankFuncToOpponentBufferRunCommand(void) { - gUnknown_03004330[gUnknown_02024A60] = sub_8032AFC; + gBattleBankFunc[gActiveBank] = OpponentBufferRunCommand; } -void sub_8032AFC(void) +void OpponentBufferRunCommand(void) { - if (gUnknown_02024A64 & gBitTable[gUnknown_02024A60]) + if (gBattleExecBuffer & gBitTable[gActiveBank]) { - if (gUnknown_02023A60[gUnknown_02024A60][0] <= 0x38) - gUnknown_081FAF5C[gUnknown_02023A60[gUnknown_02024A60][0]](); + if (gBattleBufferA[gActiveBank][0] <= 0x38) + gOpponentBufferCommands[gBattleBufferA[gActiveBank][0]](); else - sub_80334EC(); + OpponentBufferExecCompleted(); } } void sub_8032B4C(void) { - if (gSprites[gUnknown_02024BE0[gUnknown_02024A60]].callback == SpriteCallbackDummy) - sub_80334EC(); + if (gSprites[gObjectBankIDs[gActiveBank]].callback == SpriteCallbackDummy) + OpponentBufferExecCompleted(); } // Duplicate of sub_8032B4C void sub_8032B84(void) { - if (gSprites[gUnknown_02024BE0[gUnknown_02024A60]].callback == SpriteCallbackDummy) - sub_80334EC(); + if (gSprites[gObjectBankIDs[gActiveBank]].callback == SpriteCallbackDummy) + OpponentBufferExecCompleted(); } void sub_8032BBC(void) { - if (gSprites[gUnknown_02024BE0[gUnknown_02024A60]].callback == SpriteCallbackDummy) + if (gSprites[gObjectBankIDs[gActiveBank]].callback == SpriteCallbackDummy) { - sub_8031B74(gSprites[gUnknown_02024BE0[gUnknown_02024A60]].oam.affineParam); - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].oam.tileNum = gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data5; - FreeSpriteOamMatrix(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); - DestroySprite(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); - sub_80334EC(); + sub_8031B74(gSprites[gObjectBankIDs[gActiveBank]].oam.affineParam); + gSprites[gObjectBankIDs[gActiveBank]].oam.tileNum = gSprites[gObjectBankIDs[gActiveBank]].data5; + FreeSpriteOamMatrix(&gSprites[gObjectBankIDs[gActiveBank]]); + DestroySprite(&gSprites[gObjectBankIDs[gActiveBank]]); + OpponentBufferExecCompleted(); } } void sub_8032C4C(void) { - if ((--ewram17810[gUnknown_02024A60].unk9) == 0xFF) + if ((--ewram17810[gActiveBank].unk9) == 0xFF) { - ewram17810[gUnknown_02024A60].unk9 = 0; - sub_80334EC(); + ewram17810[gActiveBank].unk9 = 0; + OpponentBufferExecCompleted(); } } @@ -1021,89 +1021,89 @@ void sub_8032C88(void) if (!IsDoubleBattle() || (IsDoubleBattle() && (gBattleTypeFlags & BATTLE_TYPE_MULTI))) { - if (gSprites[gUnknown_03004340[gUnknown_02024A60]].callback == SpriteCallbackDummy) + if (gSprites[gHealthboxIDs[gActiveBank]].callback == SpriteCallbackDummy) r6 = TRUE; } else { - if (gSprites[gUnknown_03004340[gUnknown_02024A60]].callback == SpriteCallbackDummy - && gSprites[gUnknown_03004340[gUnknown_02024A60 ^ 2]].callback == SpriteCallbackDummy) + if (gSprites[gHealthboxIDs[gActiveBank]].callback == SpriteCallbackDummy + && gSprites[gHealthboxIDs[gActiveBank ^ 2]].callback == SpriteCallbackDummy) r6 = TRUE; } if (IsCryPlayingOrClearCrySongs()) r6 = FALSE; - if (r6 && ewram17810[gUnknown_02024A60].unk1_0 && ewram17810[gUnknown_02024A60 ^ 2].unk1_0) + if (r6 && ewram17810[gActiveBank].unk1_0 && ewram17810[gActiveBank ^ 2].unk1_0) { - ewram17810[gUnknown_02024A60].unk0_7 = 0; - ewram17810[gUnknown_02024A60].unk1_0 = 0; - ewram17810[gUnknown_02024A60 ^ 2].unk0_7 = 0; - ewram17810[gUnknown_02024A60 ^ 2].unk1_0 = 0; + ewram17810[gActiveBank].unk0_7 = 0; + ewram17810[gActiveBank].unk1_0 = 0; + ewram17810[gActiveBank ^ 2].unk0_7 = 0; + ewram17810[gActiveBank ^ 2].unk1_0 = 0; FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); if (gBattleTypeFlags & BATTLE_TYPE_MULTI) m4aMPlayContinue(&gMPlay_BGM); else m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 256); - ewram17810[gUnknown_02024A60].unk9 = 3; - gUnknown_03004330[gUnknown_02024A60] = sub_8032C4C; + ewram17810[gActiveBank].unk9 = 3; + gBattleBankFunc[gActiveBank] = sub_8032C4C; } } void sub_8032E2C(void) { - if (!ewram17810[gUnknown_02024A60].unk0_3 && !ewram17810[gUnknown_02024A60].unk0_7) - sub_8141828(gUnknown_02024A60, &gEnemyParty[gUnknown_02024A6A[gUnknown_02024A60]]); - if (!ewram17810[gUnknown_02024A60 ^ 2].unk0_3 && !ewram17810[gUnknown_02024A60 ^ 2].unk0_7) - sub_8141828(gUnknown_02024A60 ^ 2, &gEnemyParty[gUnknown_02024A6A[gUnknown_02024A60 ^ 2]]); - if (!ewram17810[gUnknown_02024A60].unk0_3 && !ewram17810[gUnknown_02024A60 ^ 2].unk0_3) + if (!ewram17810[gActiveBank].unk0_3 && !ewram17810[gActiveBank].unk0_7) + sub_8141828(gActiveBank, &gEnemyParty[gBattlePartyID[gActiveBank]]); + if (!ewram17810[gActiveBank ^ 2].unk0_3 && !ewram17810[gActiveBank ^ 2].unk0_7) + sub_8141828(gActiveBank ^ 2, &gEnemyParty[gBattlePartyID[gActiveBank ^ 2]]); + if (!ewram17810[gActiveBank].unk0_3 && !ewram17810[gActiveBank ^ 2].unk0_3) { if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI)) { - DestroySprite(&gSprites[gUnknown_0300434C[gUnknown_02024A60 ^ 2]]); + DestroySprite(&gSprites[gUnknown_0300434C[gActiveBank ^ 2]]); sub_8045A5C( - gUnknown_03004340[gUnknown_02024A60 ^ 2], - &gEnemyParty[gUnknown_02024A6A[gUnknown_02024A60 ^ 2]], + gHealthboxIDs[gActiveBank ^ 2], + &gEnemyParty[gBattlePartyID[gActiveBank ^ 2]], 0); - sub_804777C(gUnknown_02024A60 ^ 2); - sub_8043DFC(gUnknown_03004340[gUnknown_02024A60 ^ 2]); + sub_804777C(gActiveBank ^ 2); + sub_8043DFC(gHealthboxIDs[gActiveBank ^ 2]); sub_8032984( - gUnknown_02024A60 ^ 2, - GetMonData(&gEnemyParty[gUnknown_02024A6A[gUnknown_02024A60 ^ 2]], MON_DATA_SPECIES)); + gActiveBank ^ 2, + GetMonData(&gEnemyParty[gBattlePartyID[gActiveBank ^ 2]], MON_DATA_SPECIES)); } - DestroySprite(&gSprites[gUnknown_0300434C[gUnknown_02024A60]]); + DestroySprite(&gSprites[gUnknown_0300434C[gActiveBank]]); sub_8045A5C( - gUnknown_03004340[gUnknown_02024A60], - &gEnemyParty[gUnknown_02024A6A[gUnknown_02024A60]], + gHealthboxIDs[gActiveBank], + &gEnemyParty[gBattlePartyID[gActiveBank]], 0); - sub_804777C(gUnknown_02024A60); - sub_8043DFC(gUnknown_03004340[gUnknown_02024A60]); + sub_804777C(gActiveBank); + sub_8043DFC(gHealthboxIDs[gActiveBank]); sub_8032984( - gUnknown_02024A60, - GetMonData(&gEnemyParty[gUnknown_02024A6A[gUnknown_02024A60]], MON_DATA_SPECIES)); + gActiveBank, + GetMonData(&gEnemyParty[gBattlePartyID[gActiveBank]], MON_DATA_SPECIES)); ewram17840.unk9_0 = 0; - gUnknown_03004330[gUnknown_02024A60] = sub_8032C88; + gBattleBankFunc[gActiveBank] = sub_8032C88; } } void sub_8033018(void) { - if (gSprites[gUnknown_02024BE0[gUnknown_02024A60]].animEnded == TRUE - && gSprites[gUnknown_02024BE0[gUnknown_02024A60]].pos2.x == 0) + if (gSprites[gObjectBankIDs[gActiveBank]].animEnded == TRUE + && gSprites[gObjectBankIDs[gActiveBank]].pos2.x == 0) { - if (!ewram17810[gUnknown_02024A60].unk0_7) + if (!ewram17810[gActiveBank].unk0_7) { - sub_8141828(gUnknown_02024A60, &gEnemyParty[gUnknown_02024A6A[gUnknown_02024A60]]); + sub_8141828(gActiveBank, &gEnemyParty[gBattlePartyID[gActiveBank]]); return; } - if (ewram17810[gUnknown_02024A60].unk1_0) + if (ewram17810[gActiveBank].unk1_0) { - ewram17810[gUnknown_02024A60].unk0_7 = 0; - ewram17810[gUnknown_02024A60].unk1_0 = 0; + ewram17810[gActiveBank].unk0_7 = 0; + ewram17810[gActiveBank].unk1_0 = 0; FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); - sub_80334EC(); + OpponentBufferExecCompleted(); return; } } @@ -1111,52 +1111,52 @@ void sub_8033018(void) void sub_80330C8(void) { - s16 r4 = sub_8045C78(gUnknown_02024A60, gUnknown_03004340[gUnknown_02024A60], 0, 0); + s16 r4 = sub_8045C78(gActiveBank, gHealthboxIDs[gActiveBank], 0, 0); - sub_8043DFC(gUnknown_03004340[gUnknown_02024A60]); + sub_8043DFC(gHealthboxIDs[gActiveBank]); if (r4 != -1) - sub_80440EC(gUnknown_03004340[gUnknown_02024A60], r4, 0); + sub_80440EC(gHealthboxIDs[gActiveBank], r4, 0); else - sub_80334EC(); + OpponentBufferExecCompleted(); } void sub_803311C(void) { - if (!gSprites[gUnknown_02024BE0[gUnknown_02024A60]].inUse) + if (!gSprites[gObjectBankIDs[gActiveBank]].inUse) { - sub_8043DB0(gUnknown_03004340[gUnknown_02024A60]); - sub_80334EC(); + sub_8043DB0(gHealthboxIDs[gActiveBank]); + OpponentBufferExecCompleted(); } } void sub_8033160(void) { - if (!ewram17810[gUnknown_02024A60].unk0_6) + if (!ewram17810[gActiveBank].unk0_6) { - FreeSpriteOamMatrix(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); - DestroySprite(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); - sub_8032A08(gUnknown_02024A60); - sub_8043DB0(gUnknown_03004340[gUnknown_02024A60]); - sub_80334EC(); + FreeSpriteOamMatrix(&gSprites[gObjectBankIDs[gActiveBank]]); + DestroySprite(&gSprites[gObjectBankIDs[gActiveBank]]); + sub_8032A08(gActiveBank); + sub_8043DB0(gHealthboxIDs[gActiveBank]); + OpponentBufferExecCompleted(); } } void sub_80331D0(void) { if (gUnknown_03004210.state == 0) - sub_80334EC(); + OpponentBufferExecCompleted(); } void bx_blink_t7(void) { - u8 spriteId = gUnknown_02024BE0[gUnknown_02024A60]; + u8 spriteId = gObjectBankIDs[gActiveBank]; if (gSprites[spriteId].data1 == 32) { gSprites[spriteId].data1 = 0; gSprites[spriteId].invisible = FALSE; - gUnknown_02024E6D = 0; - sub_80334EC(); + gDoingBattleAnim = 0; + OpponentBufferExecCompleted(); } else { @@ -1168,70 +1168,70 @@ void bx_blink_t7(void) void sub_8033264(void) { - if (gSprites[gUnknown_03004340[gUnknown_02024A60]].callback == SpriteCallbackDummy) + if (gSprites[gHealthboxIDs[gActiveBank]].callback == SpriteCallbackDummy) { - if (ewram17800[gUnknown_02024A60].unk0_2) - move_anim_start_t4(gUnknown_02024A60, gUnknown_02024A60, gUnknown_02024A60, 6); - gUnknown_03004330[gUnknown_02024A60] = sub_80332D0; + if (ewram17800[gActiveBank].unk0_2) + move_anim_start_t4(gActiveBank, gActiveBank, gActiveBank, 6); + gBattleBankFunc[gActiveBank] = sub_80332D0; } } void sub_80332D0(void) { - if (!ewram17810[gUnknown_02024A60].unk0_6) + if (!ewram17810[gActiveBank].unk0_6) { CreateTask(c3_0802FDF4, 10); - sub_80334EC(); + OpponentBufferExecCompleted(); } } void sub_8033308(void) { - if (ewram17810[gUnknown_02024A60].unk1_0) + if (ewram17810[gActiveBank].unk1_0) { - ewram17810[gUnknown_02024A60].unk0_7 = 0; - ewram17810[gUnknown_02024A60].unk1_0 = 0; + ewram17810[gActiveBank].unk0_7 = 0; + ewram17810[gActiveBank].unk1_0 = 0; FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); - StartSpriteAnim(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]], 0); + StartSpriteAnim(&gSprites[gObjectBankIDs[gActiveBank]], 0); sub_8045A5C( - gUnknown_03004340[gUnknown_02024A60], - &gEnemyParty[gUnknown_02024A6A[gUnknown_02024A60]], + gHealthboxIDs[gActiveBank], + &gEnemyParty[gBattlePartyID[gActiveBank]], 0); - sub_804777C(gUnknown_02024A60); - sub_8043DFC(gUnknown_03004340[gUnknown_02024A60]); - sub_8031F88(gUnknown_02024A60); - gUnknown_03004330[gUnknown_02024A60] = sub_8033264; + sub_804777C(gActiveBank); + sub_8043DFC(gHealthboxIDs[gActiveBank]); + sub_8031F88(gActiveBank); + gBattleBankFunc[gActiveBank] = sub_8033264; } } void sub_80333D4(void) { - if (!ewram17810[gUnknown_02024A60].unk0_3 && !ewram17810[gUnknown_02024A60].unk0_7) - sub_8141828(gUnknown_02024A60, &gEnemyParty[gUnknown_02024A6A[gUnknown_02024A60]]); - if (gSprites[gUnknown_0300434C[gUnknown_02024A60]].callback == SpriteCallbackDummy - && !ewram17810[gUnknown_02024A60].unk0_3) + if (!ewram17810[gActiveBank].unk0_3 && !ewram17810[gActiveBank].unk0_7) + sub_8141828(gActiveBank, &gEnemyParty[gBattlePartyID[gActiveBank]]); + if (gSprites[gUnknown_0300434C[gActiveBank]].callback == SpriteCallbackDummy + && !ewram17810[gActiveBank].unk0_3) { - DestroySprite(&gSprites[gUnknown_0300434C[gUnknown_02024A60]]); - sub_8032984(gUnknown_02024A60, GetMonData(&gEnemyParty[gUnknown_02024A6A[gUnknown_02024A60]], MON_DATA_SPECIES)); - gUnknown_03004330[gUnknown_02024A60] = sub_8033308; + DestroySprite(&gSprites[gUnknown_0300434C[gActiveBank]]); + sub_8032984(gActiveBank, GetMonData(&gEnemyParty[gBattlePartyID[gActiveBank]], MON_DATA_SPECIES)); + gBattleBankFunc[gActiveBank] = sub_8033308; } } void sub_8033494(void) { - if (!ewram17810[gUnknown_02024A60].unk0_4) - sub_80334EC(); + if (!ewram17810[gActiveBank].unk0_4) + OpponentBufferExecCompleted(); } void sub_80334C0(void) { - if (!ewram17810[gUnknown_02024A60].unk0_5) - sub_80334EC(); + if (!ewram17810[gActiveBank].unk0_5) + OpponentBufferExecCompleted(); } -void sub_80334EC(void) +void OpponentBufferExecCompleted(void) { - gUnknown_03004330[gUnknown_02024A60] = sub_8032AFC; - gUnknown_02024A64 &= ~gBitTable[gUnknown_02024A60]; + gBattleBankFunc[gActiveBank] = OpponentBufferRunCommand; + gBattleExecBuffer &= ~gBitTable[gActiveBank]; } diff --git a/src/battle_811DA74.c b/src/battle_811DA74.c index b855f1535..743dd2554 100644 --- a/src/battle_811DA74.c +++ b/src/battle_811DA74.c @@ -44,35 +44,35 @@ struct UnknownStruct5 extern u16 gBattleTypeFlags; extern struct UnknownStruct5 gUnknown_020238C8; -extern u8 gUnknown_020238CC[]; -extern u8 gUnknown_02023A60[][0x200]; -extern u8 gUnknown_02024A60; -extern u32 gUnknown_02024A64; -extern u16 gUnknown_02024A6A[]; -extern u8 gUnknown_02024BE0[]; -extern u8 gUnknown_02024D26; +extern u8 gDisplayedStringBattle[]; +extern u8 gBattleBufferA[][0x200]; +extern u8 gActiveBank; +extern u32 gBattleExecBuffer; +extern u16 gBattlePartyID[]; +extern u8 gObjectBankIDs[]; +extern u8 gBattleOutcome; extern u16 gUnknown_02024DE8; extern u8 gUnknown_02024E68[]; -extern u8 gUnknown_02024E6D; -extern u32 gUnknown_02024E70[]; +extern u8 gDoingBattleAnim; +extern u32 gPID_perBank[]; extern struct SpriteTemplate gUnknown_02024E8C; -extern u32 *gUnknown_0202F7B4; -extern u32 gUnknown_0202F7B8; -extern u16 gUnknown_0202F7BC; -extern u8 gUnknown_0202F7BE; -extern u16 gUnknown_0202F7C0; +extern u32 *gDisableStructMoveAnim; +extern u32 gMoveDmgMoveAnim; +extern u16 gMovePowerMoveAnim; +extern u8 gHappinessMoveAnim; +extern u16 gWeatherMoveAnim; extern u8 gUnknown_0202F7C4; extern struct Window gUnknown_03004210; extern u16 gUnknown_030042A0; extern u16 gUnknown_030042A4; -extern MainCallback gUnknown_030042D0; -extern void (*gUnknown_03004330[])(void); -extern u8 gUnknown_03004340[]; +extern MainCallback gPreBattleCallback1; +extern void (*gBattleBankFunc[])(void); +extern u8 gHealthboxIDs[]; extern u8 gUnknown_0300434C[]; extern u8 gBattleMonForms[]; extern u8 gAnimScriptActive; extern void (*gAnimScriptCallback)(void); -extern void (*const gUnknown_083FE4F4[])(void); +extern void (*const gLinkPartnerBufferCommands[])(void); extern u8 move_anim_start_t3(); extern u8 sub_8078874(); @@ -83,7 +83,7 @@ extern void sub_8047858(); extern void move_anim_start_t2_for_situation(); extern void load_gfxc_health_bar(); extern void sub_8043D84(); -extern void sub_8120AA8(); +extern void BufferStringBattle(); extern void sub_8031F24(void); extern void sub_80326EC(); extern void ExecuteMoveAnim(); @@ -119,9 +119,9 @@ extern void sub_8031F88(); extern void sub_8141828(); extern void c2_8011A1C(void); -void sub_811DA94(void); +void LinkPartnerBufferRunCommand(void); void sub_811E0A0(void); -void dp01_tbl3_exec_completed(void); +void LinkPartnerBufferExecCompleted(void); u32 dp01_getattr_by_ch1_for_player_pokemon(u8 a, u8 *b); void sub_811EC68(u8); void sub_811F864(u8, u8); @@ -135,45 +135,45 @@ void nullsub_74(void) { } -void sub_811DA78(void) +void SetBankFuncToLinkPartnerBufferRunCommand(void) { - gUnknown_03004330[gUnknown_02024A60] = sub_811DA94; + gBattleBankFunc[gActiveBank] = LinkPartnerBufferRunCommand; } -void sub_811DA94(void) +void LinkPartnerBufferRunCommand(void) { - if (gUnknown_02024A64 & gBitTable[gUnknown_02024A60]) + if (gBattleExecBuffer & gBitTable[gActiveBank]) { - if (gUnknown_02023A60[gUnknown_02024A60][0] <= 0x38) - gUnknown_083FE4F4[gUnknown_02023A60[gUnknown_02024A60][0]](); + if (gBattleBufferA[gActiveBank][0] <= 0x38) + gLinkPartnerBufferCommands[gBattleBufferA[gActiveBank][0]](); else - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } } void sub_811DAE4(void) { - if (gSprites[gUnknown_02024BE0[gUnknown_02024A60]].callback == SpriteCallbackDummy) - dp01_tbl3_exec_completed(); + if (gSprites[gObjectBankIDs[gActiveBank]].callback == SpriteCallbackDummy) + LinkPartnerBufferExecCompleted(); } void sub_811DB1C(void) { - if (gSprites[gUnknown_02024BE0[gUnknown_02024A60]].callback == SpriteCallbackDummy) + if (gSprites[gObjectBankIDs[gActiveBank]].callback == SpriteCallbackDummy) { nullsub_10(0); - FreeSpriteOamMatrix(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); - DestroySprite(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); - dp01_tbl3_exec_completed(); + FreeSpriteOamMatrix(&gSprites[gObjectBankIDs[gActiveBank]]); + DestroySprite(&gSprites[gObjectBankIDs[gActiveBank]]); + LinkPartnerBufferExecCompleted(); } } void sub_811DB84(void) { - if ((--ewram17810[gUnknown_02024A60].unk9) == 0xFF) + if ((--ewram17810[gActiveBank].unk9) == 0xFF) { - ewram17810[gUnknown_02024A60].unk9 = 0; - dp01_tbl3_exec_completed(); + ewram17810[gActiveBank].unk9 = 0; + LinkPartnerBufferExecCompleted(); } } @@ -183,21 +183,21 @@ void sub_811DBC0(void) if (!IsDoubleBattle() || (IsDoubleBattle() && (gBattleTypeFlags & 0x40))) { - if (gSprites[gUnknown_03004340[gUnknown_02024A60]].callback == SpriteCallbackDummy) + if (gSprites[gHealthboxIDs[gActiveBank]].callback == SpriteCallbackDummy) r6 = TRUE; } else { - if (gSprites[gUnknown_03004340[gUnknown_02024A60]].callback == SpriteCallbackDummy - && gSprites[gUnknown_03004340[gUnknown_02024A60 ^ 2]].callback == SpriteCallbackDummy) + if (gSprites[gHealthboxIDs[gActiveBank]].callback == SpriteCallbackDummy + && gSprites[gHealthboxIDs[gActiveBank ^ 2]].callback == SpriteCallbackDummy) r6 = TRUE; } if (IsCryPlayingOrClearCrySongs()) r6 = FALSE; if (r6) { - ewram17810[gUnknown_02024A60].unk9 = 3; - gUnknown_03004330[gUnknown_02024A60] = sub_811DB84; + ewram17810[gActiveBank].unk9 = 3; + gBattleBankFunc[gActiveBank] = sub_811DB84; } } @@ -205,92 +205,92 @@ void sub_811DCA0(void) { u8 r2; - if (!ewram17810[gUnknown_02024A60].unk0_3) + if (!ewram17810[gActiveBank].unk0_3) { // I couldn't get it to work as a bitfield here - r2 = *((u8 *)&ewram17810[gUnknown_02024A60 ^ 2]) & 8; - if (!r2 && (++ewram17810[gUnknown_02024A60].unk9) != 1) + r2 = *((u8 *)&ewram17810[gActiveBank ^ 2]) & 8; + if (!r2 && (++ewram17810[gActiveBank].unk9) != 1) { - ewram17810[gUnknown_02024A60].unk9 = r2; + ewram17810[gActiveBank].unk9 = r2; if (IsDoubleBattle() && !(gBattleTypeFlags & 0x40)) { - DestroySprite(&gSprites[gUnknown_0300434C[gUnknown_02024A60 ^ 2]]); - sub_8045A5C(gUnknown_03004340[gUnknown_02024A60 ^ 2], &gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60 ^ 2]], 0); - sub_804777C(gUnknown_02024A60 ^ 2); - sub_8043DFC(gUnknown_03004340[gUnknown_02024A60 ^ 2]); + DestroySprite(&gSprites[gUnknown_0300434C[gActiveBank ^ 2]]); + sub_8045A5C(gHealthboxIDs[gActiveBank ^ 2], &gPlayerParty[gBattlePartyID[gActiveBank ^ 2]], 0); + sub_804777C(gActiveBank ^ 2); + sub_8043DFC(gHealthboxIDs[gActiveBank ^ 2]); } - DestroySprite(&gSprites[gUnknown_0300434C[gUnknown_02024A60]]); - sub_8045A5C(gUnknown_03004340[gUnknown_02024A60], &gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], 0); - sub_804777C(gUnknown_02024A60); - sub_8043DFC(gUnknown_03004340[gUnknown_02024A60]); + DestroySprite(&gSprites[gUnknown_0300434C[gActiveBank]]); + sub_8045A5C(gHealthboxIDs[gActiveBank], &gPlayerParty[gBattlePartyID[gActiveBank]], 0); + sub_804777C(gActiveBank); + sub_8043DFC(gHealthboxIDs[gActiveBank]); (s8)ewram17810[4].unk9 &= ~1; - gUnknown_03004330[gUnknown_02024A60] = sub_811DBC0; + gBattleBankFunc[gActiveBank] = sub_811DBC0; } } } void sub_811DDE8(void) { - if (gSprites[gUnknown_02024BE0[gUnknown_02024A60]].animEnded - && gSprites[gUnknown_02024BE0[gUnknown_02024A60]].pos2.x == 0) - dp01_tbl3_exec_completed(); + if (gSprites[gObjectBankIDs[gActiveBank]].animEnded + && gSprites[gObjectBankIDs[gActiveBank]].pos2.x == 0) + LinkPartnerBufferExecCompleted(); } void bx_t3_healthbar_update(void) { s16 r4; - r4 = sub_8045C78(gUnknown_02024A60, gUnknown_03004340[gUnknown_02024A60], 0, 0); - sub_8043DFC(gUnknown_03004340[gUnknown_02024A60]); + r4 = sub_8045C78(gActiveBank, gHealthboxIDs[gActiveBank], 0, 0); + sub_8043DFC(gHealthboxIDs[gActiveBank]); if (r4 != -1) { - sub_80440EC(gUnknown_03004340[gUnknown_02024A60], r4, 0); + sub_80440EC(gHealthboxIDs[gActiveBank], r4, 0); } else { - sub_80324F8(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], gUnknown_02024A60); - dp01_tbl3_exec_completed(); + sub_80324F8(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + LinkPartnerBufferExecCompleted(); } } void sub_811DE98(void) { - if (gSprites[gUnknown_02024BE0[gUnknown_02024A60]].pos1.y + gSprites[gUnknown_02024BE0[gUnknown_02024A60]].pos2.y > 160) + if (gSprites[gObjectBankIDs[gActiveBank]].pos1.y + gSprites[gObjectBankIDs[gActiveBank]].pos2.y > 160) { - nullsub_9(GetMonData(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], MON_DATA_SPECIES)); - FreeOamMatrix(gSprites[gUnknown_02024BE0[gUnknown_02024A60]].oam.matrixNum); - DestroySprite(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); - sub_8043DB0(gUnknown_03004340[gUnknown_02024A60]); - dp01_tbl3_exec_completed(); + nullsub_9(GetMonData(&gPlayerParty[gBattlePartyID[gActiveBank]], MON_DATA_SPECIES)); + FreeOamMatrix(gSprites[gObjectBankIDs[gActiveBank]].oam.matrixNum); + DestroySprite(&gSprites[gObjectBankIDs[gActiveBank]]); + sub_8043DB0(gHealthboxIDs[gActiveBank]); + LinkPartnerBufferExecCompleted(); } } void sub_811DF34(void) { - if (!ewram17810[gUnknown_02024A60].unk0_6) + if (!ewram17810[gActiveBank].unk0_6) { - FreeSpriteOamMatrix(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); - DestroySprite(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); - sub_8043DB0(gUnknown_03004340[gUnknown_02024A60]); - dp01_tbl3_exec_completed(); + FreeSpriteOamMatrix(&gSprites[gObjectBankIDs[gActiveBank]]); + DestroySprite(&gSprites[gObjectBankIDs[gActiveBank]]); + sub_8043DB0(gHealthboxIDs[gActiveBank]); + LinkPartnerBufferExecCompleted(); } } void sub_811DFA0(void) { if (gUnknown_03004210.state == 0) - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void bx_blink_t3(void) { - u8 spriteId = gUnknown_02024BE0[gUnknown_02024A60]; + u8 spriteId = gObjectBankIDs[gActiveBank]; if (gSprites[spriteId].data1 == 32) { gSprites[spriteId].data1 = 0; gSprites[spriteId].invisible = FALSE; - gUnknown_02024E6D = 0; - dp01_tbl3_exec_completed(); + gDoingBattleAnim = 0; + LinkPartnerBufferExecCompleted(); } else { @@ -304,48 +304,48 @@ void bx_blink_t3(void) void sub_811E034(void) { - if (gSprites[gUnknown_03004340[gUnknown_02024A60]].callback == SpriteCallbackDummy) + if (gSprites[gHealthboxIDs[gActiveBank]].callback == SpriteCallbackDummy) { - if (ewram17800[gUnknown_02024A60].unk0_2) - move_anim_start_t4(gUnknown_02024A60, gUnknown_02024A60, gUnknown_02024A60, 6); - gUnknown_03004330[gUnknown_02024A60] = sub_811E0A0; + if (ewram17800[gActiveBank].unk0_2) + move_anim_start_t4(gActiveBank, gActiveBank, gActiveBank, 6); + gBattleBankFunc[gActiveBank] = sub_811E0A0; } } void sub_811E0A0(void) { - if (!ewram17810[gUnknown_02024A60].unk0_6) - dp01_tbl3_exec_completed(); + if (!ewram17810[gActiveBank].unk0_6) + LinkPartnerBufferExecCompleted(); } void sub_811E0CC(void) { - if (ewram17810[gUnknown_02024A60].unk1_0) + if (ewram17810[gActiveBank].unk1_0) { - ewram17810[gUnknown_02024A60].unk0_7 = 0; - ewram17810[gUnknown_02024A60].unk1_0 = 0; + ewram17810[gActiveBank].unk0_7 = 0; + ewram17810[gActiveBank].unk1_0 = 0; FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); CreateTask(c3_0802FDF4, 10); - sub_80324F8(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], gUnknown_02024A60); - StartSpriteAnim(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]], 0); - sub_8045A5C(gUnknown_03004340[gUnknown_02024A60], &gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], 0); - sub_804777C(gUnknown_02024A60); - sub_8043DFC(gUnknown_03004340[gUnknown_02024A60]); - sub_8031F88(gUnknown_02024A60); - gUnknown_03004330[gUnknown_02024A60] = sub_811E034; + sub_80324F8(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + StartSpriteAnim(&gSprites[gObjectBankIDs[gActiveBank]], 0); + sub_8045A5C(gHealthboxIDs[gActiveBank], &gPlayerParty[gBattlePartyID[gActiveBank]], 0); + sub_804777C(gActiveBank); + sub_8043DFC(gHealthboxIDs[gActiveBank]); + sub_8031F88(gActiveBank); + gBattleBankFunc[gActiveBank] = sub_811E034; } } void sub_811E1BC(void) { - if (!ewram17810[gUnknown_02024A60].unk0_3 && !ewram17810[gUnknown_02024A60].unk0_7) - sub_8141828(gUnknown_02024A60, &gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]]); - if (gSprites[gUnknown_0300434C[gUnknown_02024A60]].callback == SpriteCallbackDummy - && !ewram17810[gUnknown_02024A60].unk0_3) + if (!ewram17810[gActiveBank].unk0_3 && !ewram17810[gActiveBank].unk0_7) + sub_8141828(gActiveBank, &gPlayerParty[gBattlePartyID[gActiveBank]]); + if (gSprites[gUnknown_0300434C[gActiveBank]].callback == SpriteCallbackDummy + && !ewram17810[gActiveBank].unk0_3) { - DestroySprite(&gSprites[gUnknown_0300434C[gUnknown_02024A60]]); - gUnknown_03004330[gUnknown_02024A60] = sub_811E0CC; + DestroySprite(&gSprites[gUnknown_0300434C[gActiveBank]]); + gBattleBankFunc[gActiveBank] = sub_811E0CC; } } @@ -355,7 +355,7 @@ void sub_811E258(void) { m4aSongNumStop(0x5A); gMain.inBattle = FALSE; - gMain.callback1 = gUnknown_030042D0; + gMain.callback1 = gPreBattleCallback1; SetMainCallback2(c2_8011A1C); } } @@ -367,60 +367,60 @@ void sub_811E29C(void) if (gBattleTypeFlags & 2) { sub_800832C(); - gUnknown_03004330[gUnknown_02024A60] = sub_811E258; + gBattleBankFunc[gActiveBank] = sub_811E258; } else { m4aSongNumStop(0x5A); gMain.inBattle = FALSE; - gMain.callback1 = gUnknown_030042D0; + gMain.callback1 = gPreBattleCallback1; SetMainCallback2(gMain.savedCallback); } } } -void dp01_tbl3_exec_completed(void) +void LinkPartnerBufferExecCompleted(void) { u8 multiplayerId; - gUnknown_03004330[gUnknown_02024A60] = sub_811DA94; + gBattleBankFunc[gActiveBank] = LinkPartnerBufferRunCommand; if (gBattleTypeFlags & 2) { multiplayerId = GetMultiplayerId(); dp01_prepare_buffer_wireless_probably(2, 4, &multiplayerId); - gUnknown_02023A60[gUnknown_02024A60][0] = 0x38; + gBattleBufferA[gActiveBank][0] = 0x38; } else { - gUnknown_02024A64 &= ~gBitTable[gUnknown_02024A60]; + gBattleExecBuffer &= ~gBitTable[gActiveBank]; } } void sub_811E38C(void) { - if (!ewram17810[gUnknown_02024A60].unk0_4) - dp01_tbl3_exec_completed(); + if (!ewram17810[gActiveBank].unk0_4) + LinkPartnerBufferExecCompleted(); } void sub_811E3B8(void) { - if (!ewram17810[gUnknown_02024A60].unk0_5) - dp01_tbl3_exec_completed(); + if (!ewram17810[gActiveBank].unk0_5) + LinkPartnerBufferExecCompleted(); } -void dp01t_00_3_getattr(void) +void LinkPartnerHandleGetAttributes(void) { u8 unk[256]; int r6 = 0; s32 i; - if (gUnknown_02023A60[gUnknown_02024A60][2] == 0) + if (gBattleBufferA[gActiveBank][2] == 0) { - r6 = dp01_getattr_by_ch1_for_player_pokemon(gUnknown_02024A6A[gUnknown_02024A60], unk); + r6 = dp01_getattr_by_ch1_for_player_pokemon(gBattlePartyID[gActiveBank], unk); } else { - u8 r4 = gUnknown_02023A60[gUnknown_02024A60][2]; + u8 r4 = gBattleBufferA[gActiveBank][2]; for (i = 0; i < 6; i++) { @@ -430,7 +430,7 @@ void dp01t_00_3_getattr(void) } } dp01_build_cmdbuf_x1D_1D_numargs_varargs(1, r6, unk); - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } u32 dp01_getattr_by_ch1_for_player_pokemon(u8 a, u8 *buffer) @@ -443,7 +443,7 @@ u32 dp01_getattr_by_ch1_for_player_pokemon(u8 a, u8 *buffer) u32 data32; s32 size = 0; - switch (gUnknown_02023A60[gUnknown_02024A60][1]) + switch (gBattleBufferA[gActiveBank][1]) { case 0: battlePokemon.species = GetMonData(&gPlayerParty[a], MON_DATA_SPECIES); @@ -509,7 +509,7 @@ u32 dp01_getattr_by_ch1_for_player_pokemon(u8 a, u8 *buffer) case 5: case 6: case 7: - data16 = GetMonData(&gPlayerParty[a], MON_DATA_MOVE1 + gUnknown_02023A60[gUnknown_02024A60][1] - 4); + data16 = GetMonData(&gPlayerParty[a], MON_DATA_MOVE1 + gBattleBufferA[gActiveBank][1] - 4); buffer[0] = data16; buffer[1] = data16 >> 8; size = 2; @@ -524,7 +524,7 @@ u32 dp01_getattr_by_ch1_for_player_pokemon(u8 a, u8 *buffer) case 10: case 11: case 12: - buffer[0] = GetMonData(&gPlayerParty[a], MON_DATA_PP1 + gUnknown_02023A60[gUnknown_02024A60][1] - 9); + buffer[0] = GetMonData(&gPlayerParty[a], MON_DATA_PP1 + gBattleBufferA[gActiveBank][1] - 9); size = 1; break; case 17: @@ -740,21 +740,21 @@ u32 dp01_getattr_by_ch1_for_player_pokemon(u8 a, u8 *buffer) void sub_811EC04(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } -void sub_811EC10(void) +void LinkPartnerHandleSetAttributes(void) { u8 i; u8 r4; - if (gUnknown_02023A60[gUnknown_02024A60][2] == 0) + if (gBattleBufferA[gActiveBank][2] == 0) { - sub_811EC68(gUnknown_02024A6A[gUnknown_02024A60]); + sub_811EC68(gBattlePartyID[gActiveBank]); } else { - r4 = gUnknown_02023A60[gUnknown_02024A60][2]; + r4 = gBattleBufferA[gActiveBank][2]; for (i = 0; i < 6; i++) { if (r4 & 1) @@ -762,16 +762,16 @@ void sub_811EC10(void) r4 >>= 1; } } - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_811EC68(u8 a) { - struct BattlePokemon *battlePokemon = (struct BattlePokemon *)&gUnknown_02023A60[gUnknown_02024A60][3]; - struct UnknownStruct3 *moveData = (struct UnknownStruct3 *)&gUnknown_02023A60[gUnknown_02024A60][3]; + struct BattlePokemon *battlePokemon = (struct BattlePokemon *)&gBattleBufferA[gActiveBank][3]; + struct UnknownStruct3 *moveData = (struct UnknownStruct3 *)&gBattleBufferA[gActiveBank][3]; s32 i; - switch (gUnknown_02023A60[gUnknown_02024A60][1]) + switch (gBattleBufferA[gActiveBank][1]) { case 0: { @@ -812,10 +812,10 @@ void sub_811EC68(u8 a) } break; case 1: - SetMonData(&gPlayerParty[a], MON_DATA_SPECIES, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_SPECIES, &gBattleBufferA[gActiveBank][3]); break; case 2: - SetMonData(&gPlayerParty[a], MON_DATA_HELD_ITEM, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_HELD_ITEM, &gBattleBufferA[gActiveBank][3]); break; case 3: for (i = 0; i < 4; i++) @@ -829,157 +829,157 @@ void sub_811EC68(u8 a) case 5: case 6: case 7: - SetMonData(&gPlayerParty[a], MON_DATA_MOVE1 + gUnknown_02023A60[gUnknown_02024A60][1] - 4, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_MOVE1 + gBattleBufferA[gActiveBank][1] - 4, &gBattleBufferA[gActiveBank][3]); break; case 8: - SetMonData(&gPlayerParty[a], MON_DATA_PP1, &gUnknown_02023A60[gUnknown_02024A60][3]); - SetMonData(&gPlayerParty[a], MON_DATA_PP2, &gUnknown_02023A60[gUnknown_02024A60][4]); - SetMonData(&gPlayerParty[a], MON_DATA_PP3, &gUnknown_02023A60[gUnknown_02024A60][5]); - SetMonData(&gPlayerParty[a], MON_DATA_PP4, &gUnknown_02023A60[gUnknown_02024A60][6]); - SetMonData(&gPlayerParty[a], MON_DATA_PP_BONUSES, &gUnknown_02023A60[gUnknown_02024A60][7]); + SetMonData(&gPlayerParty[a], MON_DATA_PP1, &gBattleBufferA[gActiveBank][3]); + SetMonData(&gPlayerParty[a], MON_DATA_PP2, &gBattleBufferA[gActiveBank][4]); + SetMonData(&gPlayerParty[a], MON_DATA_PP3, &gBattleBufferA[gActiveBank][5]); + SetMonData(&gPlayerParty[a], MON_DATA_PP4, &gBattleBufferA[gActiveBank][6]); + SetMonData(&gPlayerParty[a], MON_DATA_PP_BONUSES, &gBattleBufferA[gActiveBank][7]); break; case 9: case 10: case 11: case 12: - SetMonData(&gPlayerParty[a], MON_DATA_PP1 + gUnknown_02023A60[gUnknown_02024A60][1] - 9, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_PP1 + gBattleBufferA[gActiveBank][1] - 9, &gBattleBufferA[gActiveBank][3]); break; case 17: - SetMonData(&gPlayerParty[a], MON_DATA_OT_ID, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_OT_ID, &gBattleBufferA[gActiveBank][3]); break; case 18: - SetMonData(&gPlayerParty[a], MON_DATA_EXP, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_EXP, &gBattleBufferA[gActiveBank][3]); break; case 19: - SetMonData(&gPlayerParty[a], MON_DATA_HP_EV, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_HP_EV, &gBattleBufferA[gActiveBank][3]); break; case 20: - SetMonData(&gPlayerParty[a], MON_DATA_ATK_EV, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_ATK_EV, &gBattleBufferA[gActiveBank][3]); break; case 21: - SetMonData(&gPlayerParty[a], MON_DATA_DEF_EV, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_DEF_EV, &gBattleBufferA[gActiveBank][3]); break; case 22: - SetMonData(&gPlayerParty[a], MON_DATA_SPD_EV, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_SPD_EV, &gBattleBufferA[gActiveBank][3]); break; case 23: - SetMonData(&gPlayerParty[a], MON_DATA_SPATK_EV, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_SPATK_EV, &gBattleBufferA[gActiveBank][3]); break; case 24: - SetMonData(&gPlayerParty[a], MON_DATA_SPDEF_EV, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_SPDEF_EV, &gBattleBufferA[gActiveBank][3]); break; case 25: - SetMonData(&gPlayerParty[a], MON_DATA_FRIENDSHIP, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_FRIENDSHIP, &gBattleBufferA[gActiveBank][3]); break; case 26: - SetMonData(&gPlayerParty[a], MON_DATA_POKERUS, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_POKERUS, &gBattleBufferA[gActiveBank][3]); break; case 27: - SetMonData(&gPlayerParty[a], MON_DATA_MET_LOCATION, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_MET_LOCATION, &gBattleBufferA[gActiveBank][3]); break; case 28: - SetMonData(&gPlayerParty[a], MON_DATA_MET_LEVEL, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_MET_LEVEL, &gBattleBufferA[gActiveBank][3]); break; case 29: - SetMonData(&gPlayerParty[a], MON_DATA_MET_GAME, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_MET_GAME, &gBattleBufferA[gActiveBank][3]); break; case 30: - SetMonData(&gPlayerParty[a], MON_DATA_POKEBALL, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_POKEBALL, &gBattleBufferA[gActiveBank][3]); break; case 31: - SetMonData(&gPlayerParty[a], MON_DATA_HP_IV, &gUnknown_02023A60[gUnknown_02024A60][3]); - SetMonData(&gPlayerParty[a], MON_DATA_ATK_IV, &gUnknown_02023A60[gUnknown_02024A60][4]); - SetMonData(&gPlayerParty[a], MON_DATA_DEF_IV, &gUnknown_02023A60[gUnknown_02024A60][5]); - SetMonData(&gPlayerParty[a], MON_DATA_SPD_IV, &gUnknown_02023A60[gUnknown_02024A60][6]); - SetMonData(&gPlayerParty[a], MON_DATA_SPATK_IV, &gUnknown_02023A60[gUnknown_02024A60][7]); - SetMonData(&gPlayerParty[a], MON_DATA_SPDEF_IV, &gUnknown_02023A60[gUnknown_02024A60][8]); + SetMonData(&gPlayerParty[a], MON_DATA_HP_IV, &gBattleBufferA[gActiveBank][3]); + SetMonData(&gPlayerParty[a], MON_DATA_ATK_IV, &gBattleBufferA[gActiveBank][4]); + SetMonData(&gPlayerParty[a], MON_DATA_DEF_IV, &gBattleBufferA[gActiveBank][5]); + SetMonData(&gPlayerParty[a], MON_DATA_SPD_IV, &gBattleBufferA[gActiveBank][6]); + SetMonData(&gPlayerParty[a], MON_DATA_SPATK_IV, &gBattleBufferA[gActiveBank][7]); + SetMonData(&gPlayerParty[a], MON_DATA_SPDEF_IV, &gBattleBufferA[gActiveBank][8]); break; case 32: - SetMonData(&gPlayerParty[a], MON_DATA_HP_IV, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_HP_IV, &gBattleBufferA[gActiveBank][3]); break; case 33: - SetMonData(&gPlayerParty[a], MON_DATA_ATK_IV, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_ATK_IV, &gBattleBufferA[gActiveBank][3]); break; case 34: - SetMonData(&gPlayerParty[a], MON_DATA_DEF_IV, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_DEF_IV, &gBattleBufferA[gActiveBank][3]); break; case 35: - SetMonData(&gPlayerParty[a], MON_DATA_SPD_IV, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_SPD_IV, &gBattleBufferA[gActiveBank][3]); break; case 36: - SetMonData(&gPlayerParty[a], MON_DATA_SPATK_IV, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_SPATK_IV, &gBattleBufferA[gActiveBank][3]); break; case 37: - SetMonData(&gPlayerParty[a], MON_DATA_SPDEF_IV, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_SPDEF_IV, &gBattleBufferA[gActiveBank][3]); break; case 38: - SetMonData(&gPlayerParty[a], MON_DATA_PERSONALITY, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_PERSONALITY, &gBattleBufferA[gActiveBank][3]); break; case 39: - SetMonData(&gPlayerParty[a], MON_DATA_CHECKSUM, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_CHECKSUM, &gBattleBufferA[gActiveBank][3]); break; case 40: - SetMonData(&gPlayerParty[a], MON_DATA_STATUS, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_STATUS, &gBattleBufferA[gActiveBank][3]); break; case 41: - SetMonData(&gPlayerParty[a], MON_DATA_LEVEL, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_LEVEL, &gBattleBufferA[gActiveBank][3]); break; case 42: - SetMonData(&gPlayerParty[a], MON_DATA_HP, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_HP, &gBattleBufferA[gActiveBank][3]); break; case 43: - SetMonData(&gPlayerParty[a], MON_DATA_MAX_HP, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_MAX_HP, &gBattleBufferA[gActiveBank][3]); break; case 44: - SetMonData(&gPlayerParty[a], MON_DATA_ATK, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_ATK, &gBattleBufferA[gActiveBank][3]); break; case 45: - SetMonData(&gPlayerParty[a], MON_DATA_DEF, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_DEF, &gBattleBufferA[gActiveBank][3]); break; case 46: - SetMonData(&gPlayerParty[a], MON_DATA_SPD, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_SPD, &gBattleBufferA[gActiveBank][3]); break; case 47: - SetMonData(&gPlayerParty[a], MON_DATA_SPATK, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_SPATK, &gBattleBufferA[gActiveBank][3]); break; case 48: - SetMonData(&gPlayerParty[a], MON_DATA_SPDEF, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_SPDEF, &gBattleBufferA[gActiveBank][3]); break; case 49: - SetMonData(&gPlayerParty[a], MON_DATA_COOL, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_COOL, &gBattleBufferA[gActiveBank][3]); break; case 50: - SetMonData(&gPlayerParty[a], MON_DATA_BEAUTY, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_BEAUTY, &gBattleBufferA[gActiveBank][3]); break; case 51: - SetMonData(&gPlayerParty[a], MON_DATA_CUTE, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_CUTE, &gBattleBufferA[gActiveBank][3]); break; case 52: - SetMonData(&gPlayerParty[a], MON_DATA_SMART, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_SMART, &gBattleBufferA[gActiveBank][3]); break; case 53: - SetMonData(&gPlayerParty[a], MON_DATA_TOUGH, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_TOUGH, &gBattleBufferA[gActiveBank][3]); break; case 54: - SetMonData(&gPlayerParty[a], MON_DATA_SHEEN, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_SHEEN, &gBattleBufferA[gActiveBank][3]); break; case 55: - SetMonData(&gPlayerParty[a], MON_DATA_COOL_RIBBON, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_COOL_RIBBON, &gBattleBufferA[gActiveBank][3]); break; case 56: - SetMonData(&gPlayerParty[a], MON_DATA_BEAUTY_RIBBON, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_BEAUTY_RIBBON, &gBattleBufferA[gActiveBank][3]); break; case 57: - SetMonData(&gPlayerParty[a], MON_DATA_CUTE_RIBBON, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_CUTE_RIBBON, &gBattleBufferA[gActiveBank][3]); break; case 58: - SetMonData(&gPlayerParty[a], MON_DATA_SMART_RIBBON, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_SMART_RIBBON, &gBattleBufferA[gActiveBank][3]); break; case 59: - SetMonData(&gPlayerParty[a], MON_DATA_TOUGH_RIBBON, &gUnknown_02023A60[gUnknown_02024A60][3]); + SetMonData(&gPlayerParty[a], MON_DATA_TOUGH_RIBBON, &gBattleBufferA[gActiveBank][3]); break; } - sub_80324F8(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], gUnknown_02024A60); + sub_80324F8(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); } void sub_811F664(void) @@ -987,37 +987,37 @@ void sub_811F664(void) u8 *dst; u8 i; - dst = (u8 *)&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]] + gUnknown_02023A60[gUnknown_02024A60][1]; - for (i = 0; i < gUnknown_02023A60[gUnknown_02024A60][2]; i++) - dst[i] = gUnknown_02023A60[gUnknown_02024A60][3 + i]; - dp01_tbl3_exec_completed(); + dst = (u8 *)&gPlayerParty[gBattlePartyID[gActiveBank]] + gBattleBufferA[gActiveBank][1]; + for (i = 0; i < gBattleBufferA[gActiveBank][2]; i++) + dst[i] = gBattleBufferA[gActiveBank][3 + i]; + LinkPartnerBufferExecCompleted(); } void sub_811F6D8(void) { - sub_80318FC(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], gUnknown_02024A60); + sub_80318FC(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); GetMonSpriteTemplate_803C56C( - GetMonData(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], MON_DATA_SPECIES), - battle_get_per_side_status(gUnknown_02024A60)); - gUnknown_02024BE0[gUnknown_02024A60] = CreateSprite( + GetMonData(&gPlayerParty[gBattlePartyID[gActiveBank]], MON_DATA_SPECIES), + GetBankIdentity(gActiveBank)); + gObjectBankIDs[gActiveBank] = CreateSprite( &gUnknown_02024E8C, - sub_8077ABC(gUnknown_02024A60, 2), - sub_8077F68(gUnknown_02024A60), - sub_8079E90(gUnknown_02024A60)); - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].pos2.x = -240; - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data0 = gUnknown_02024A60; - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].oam.paletteNum = gUnknown_02024A60; - StartSpriteAnim(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]], gBattleMonForms[gUnknown_02024A60]); - gUnknown_03004330[gUnknown_02024A60] = sub_811DDE8; + sub_8077ABC(gActiveBank, 2), + sub_8077F68(gActiveBank), + sub_8079E90(gActiveBank)); + gSprites[gObjectBankIDs[gActiveBank]].pos2.x = -240; + gSprites[gObjectBankIDs[gActiveBank]].data0 = gActiveBank; + gSprites[gObjectBankIDs[gActiveBank]].oam.paletteNum = gActiveBank; + StartSpriteAnim(&gSprites[gObjectBankIDs[gActiveBank]], gBattleMonForms[gActiveBank]); + gBattleBankFunc[gActiveBank] = sub_811DDE8; } void sub_811F7F4(void) { - sub_8032AA8(gUnknown_02024A60, gUnknown_02023A60[gUnknown_02024A60][2]); - gUnknown_02024A6A[gUnknown_02024A60] = gUnknown_02023A60[gUnknown_02024A60][1]; - sub_80318FC(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], gUnknown_02024A60); - sub_811F864(gUnknown_02024A60, gUnknown_02023A60[gUnknown_02024A60][2]); - gUnknown_03004330[gUnknown_02024A60] = sub_811E1BC; + sub_8032AA8(gActiveBank, gBattleBufferA[gActiveBank][2]); + gBattlePartyID[gActiveBank] = gBattleBufferA[gActiveBank][1]; + sub_80318FC(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + sub_811F864(gActiveBank, gBattleBufferA[gActiveBank][2]); + gBattleBankFunc[gActiveBank] = sub_811E1BC; } void sub_811F864(u8 a, u8 b) @@ -1025,56 +1025,56 @@ void sub_811F864(u8 a, u8 b) u16 species; sub_8032AA8(a, b); - gUnknown_02024A6A[a] = gUnknown_02023A60[a][1]; - species = GetMonData(&gPlayerParty[gUnknown_02024A6A[a]], MON_DATA_SPECIES); + gBattlePartyID[a] = gBattleBufferA[a][1]; + species = GetMonData(&gPlayerParty[gBattlePartyID[a]], MON_DATA_SPECIES); gUnknown_0300434C[a] = CreateInvisibleSpriteWithCallback(sub_80312F0); - GetMonSpriteTemplate_803C56C(species, battle_get_per_side_status(a)); - gUnknown_02024BE0[a] = CreateSprite( + GetMonSpriteTemplate_803C56C(species, GetBankIdentity(a)); + gObjectBankIDs[a] = CreateSprite( &gUnknown_02024E8C, sub_8077ABC(a, 2), sub_8077F68(a), sub_8079E90(a)); - gSprites[gUnknown_0300434C[a]].data1 = gUnknown_02024BE0[a]; - gSprites[gUnknown_02024BE0[a]].data0 = a; - gSprites[gUnknown_02024BE0[a]].data2 = species; - gSprites[gUnknown_02024BE0[a]].oam.paletteNum = a; - StartSpriteAnim(&gSprites[gUnknown_02024BE0[a]], gBattleMonForms[a]); - gSprites[gUnknown_02024BE0[a]].invisible = TRUE; - gSprites[gUnknown_02024BE0[a]].callback = SpriteCallbackDummy; + gSprites[gUnknown_0300434C[a]].data1 = gObjectBankIDs[a]; + gSprites[gObjectBankIDs[a]].data0 = a; + gSprites[gObjectBankIDs[a]].data2 = species; + gSprites[gObjectBankIDs[a]].oam.paletteNum = a; + StartSpriteAnim(&gSprites[gObjectBankIDs[a]], gBattleMonForms[a]); + gSprites[gObjectBankIDs[a]].invisible = TRUE; + gSprites[gObjectBankIDs[a]].callback = SpriteCallbackDummy; gSprites[gUnknown_0300434C[a]].data0 = sub_8046400(0, 0xFF); } void sub_811F9D0(void) { - if (gUnknown_02023A60[gUnknown_02024A60][1] == 0) + if (gBattleBufferA[gActiveBank][1] == 0) { - ewram17810[gUnknown_02024A60].unk4 = 0; - gUnknown_03004330[gUnknown_02024A60] = sub_811FA5C; + ewram17810[gActiveBank].unk4 = 0; + gBattleBankFunc[gActiveBank] = sub_811FA5C; } else { - FreeSpriteOamMatrix(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); - DestroySprite(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); - sub_8043DB0(gUnknown_03004340[gUnknown_02024A60]); - dp01_tbl3_exec_completed(); + FreeSpriteOamMatrix(&gSprites[gObjectBankIDs[gActiveBank]]); + DestroySprite(&gSprites[gObjectBankIDs[gActiveBank]]); + sub_8043DB0(gHealthboxIDs[gActiveBank]); + LinkPartnerBufferExecCompleted(); } } void sub_811FA5C(void) { - switch (ewram17810[gUnknown_02024A60].unk4) + switch (ewram17810[gActiveBank].unk4) { case 0: - if (ewram17800[gUnknown_02024A60].unk0_2) - move_anim_start_t4(gUnknown_02024A60, gUnknown_02024A60, gUnknown_02024A60, 5); - ewram17810[gUnknown_02024A60].unk4 = 1; + if (ewram17800[gActiveBank].unk0_2) + move_anim_start_t4(gActiveBank, gActiveBank, gActiveBank, 5); + ewram17810[gActiveBank].unk4 = 1; break; case 1: - if (!ewram17810[gUnknown_02024A60].unk0_6) + if (!ewram17810[gActiveBank].unk0_6) { - ewram17810[gUnknown_02024A60].unk4 = 0; - move_anim_start_t4(gUnknown_02024A60, gUnknown_02024A60, gUnknown_02024A60, 1); - gUnknown_03004330[gUnknown_02024A60] = sub_811DF34; + ewram17810[gActiveBank].unk4 = 0; + move_anim_start_t4(gActiveBank, gActiveBank, gActiveBank, 1); + gBattleBankFunc[gActiveBank] = sub_811DF34; } break; } @@ -1087,138 +1087,138 @@ void sub_811FAE4(void) if (gBattleTypeFlags & BATTLE_TYPE_MULTI) { - if (battle_get_per_side_status(gUnknown_02024A60) & 2) + if (GetBankIdentity(gActiveBank) & 2) xOffset = 16; else xOffset = -16; - gender = gLinkPlayers[sub_803FC34(gUnknown_02024A60)].gender; + gender = gLinkPlayers[sub_803FC34(gActiveBank)].gender; } else { xOffset = 0; gender = gLinkPlayers[GetMultiplayerId() ^ 1].gender; } - sub_8031AF4(gender, gUnknown_02024A60); - GetMonSpriteTemplate_803C5A0(gender, battle_get_per_side_status(gUnknown_02024A60)); - gUnknown_02024BE0[gUnknown_02024A60] = CreateSprite( + sub_8031AF4(gender, gActiveBank); + GetMonSpriteTemplate_803C5A0(gender, GetBankIdentity(gActiveBank)); + gObjectBankIDs[gActiveBank] = CreateSprite( &gUnknown_02024E8C, 80 + xOffset, 80 + 4 * (8 - gTrainerBackPicCoords[gender].coords), - sub_8079E90(gUnknown_02024A60)); - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].oam.paletteNum = gUnknown_02024A60; - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].pos2.x = 240; - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data0 = -2; - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].callback = sub_80313A0; - gUnknown_03004330[gUnknown_02024A60] = sub_811DAE4; + sub_8079E90(gActiveBank)); + gSprites[gObjectBankIDs[gActiveBank]].oam.paletteNum = gActiveBank; + gSprites[gObjectBankIDs[gActiveBank]].pos2.x = 240; + gSprites[gObjectBankIDs[gActiveBank]].data0 = -2; + gSprites[gObjectBankIDs[gActiveBank]].callback = sub_80313A0; + gBattleBankFunc[gActiveBank] = sub_811DAE4; } void sub_811FC30(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_811FC3C(void) { - oamt_add_pos2_onto_pos1(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data0 = 35; - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data2 = -40; - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data4 = gSprites[gUnknown_02024BE0[gUnknown_02024A60]].pos1.y; - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].callback = sub_8078B34; - oamt_set_x3A_32(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]], SpriteCallbackDummy); - gUnknown_03004330[gUnknown_02024A60] = sub_811DB1C; + oamt_add_pos2_onto_pos1(&gSprites[gObjectBankIDs[gActiveBank]]); + gSprites[gObjectBankIDs[gActiveBank]].data0 = 35; + gSprites[gObjectBankIDs[gActiveBank]].data2 = -40; + gSprites[gObjectBankIDs[gActiveBank]].data4 = gSprites[gObjectBankIDs[gActiveBank]].pos1.y; + gSprites[gObjectBankIDs[gActiveBank]].callback = sub_8078B34; + oamt_set_x3A_32(&gSprites[gObjectBankIDs[gActiveBank]], SpriteCallbackDummy); + gBattleBankFunc[gActiveBank] = sub_811DB1C; } void sub_811FCE8(void) { - if (ewram17810[gUnknown_02024A60].unk4 == 0) + if (ewram17810[gActiveBank].unk4 == 0) { - if (ewram17800[gUnknown_02024A60].unk0_2) - move_anim_start_t4(gUnknown_02024A60, gUnknown_02024A60, gUnknown_02024A60, 5); - ewram17810[gUnknown_02024A60].unk4++; + if (ewram17800[gActiveBank].unk0_2) + move_anim_start_t4(gActiveBank, gActiveBank, gActiveBank, 5); + ewram17810[gActiveBank].unk4++; } - else if (!ewram17810[gUnknown_02024A60].unk0_6) + else if (!ewram17810[gActiveBank].unk0_6) { - ewram17810[gUnknown_02024A60].unk4 = 0; - sub_80324F8(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], gUnknown_02024A60); + ewram17810[gActiveBank].unk4 = 0; + sub_80324F8(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); PlaySE12WithPanning(SE_POKE_DEAD, -64); - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data1 = 0; - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data2 = 5; - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].callback = sub_80105EC; - gUnknown_03004330[gUnknown_02024A60] = sub_811DE98; + gSprites[gObjectBankIDs[gActiveBank]].data1 = 0; + gSprites[gObjectBankIDs[gActiveBank]].data2 = 5; + gSprites[gObjectBankIDs[gActiveBank]].callback = sub_80105EC; + gBattleBankFunc[gActiveBank] = sub_811DE98; } } void sub_811FDCC(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_811FDD8(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_811FDE4(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_811FDF0(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_811FDFC(void) { - if (mplay_80342A4(gUnknown_02024A60) == 0) + if (mplay_80342A4(gActiveBank) == 0) { - u32 r0 = gUnknown_02023A60[gUnknown_02024A60][1] - | (gUnknown_02023A60[gUnknown_02024A60][2] << 8); - - gUnknown_0202F7C4 = gUnknown_02023A60[gUnknown_02024A60][3]; - gUnknown_0202F7BC = gUnknown_02023A60[gUnknown_02024A60][4] - | (gUnknown_02023A60[gUnknown_02024A60][5] << 8); - gUnknown_0202F7B8 = gUnknown_02023A60[gUnknown_02024A60][6] - | (gUnknown_02023A60[gUnknown_02024A60][7] << 8) - | (gUnknown_02023A60[gUnknown_02024A60][8] << 16) - | (gUnknown_02023A60[gUnknown_02024A60][9] << 24); - gUnknown_0202F7BE = gUnknown_02023A60[gUnknown_02024A60][10]; - gUnknown_0202F7C0 = gUnknown_02023A60[gUnknown_02024A60][12] - | (gUnknown_02023A60[gUnknown_02024A60][13] << 8); - gUnknown_0202F7B4 = (u32 *)&gUnknown_02023A60[gUnknown_02024A60][16]; - gUnknown_02024E70[gUnknown_02024A60] = *gUnknown_0202F7B4; + u32 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]; + gWeatherMoveAnim = gBattleBufferA[gActiveBank][12] + | (gBattleBufferA[gActiveBank][13] << 8); + gDisableStructMoveAnim = (u32 *)&gBattleBufferA[gActiveBank][16]; + gPID_perBank[gActiveBank] = *gDisableStructMoveAnim; if (sub_8031720(r0, gUnknown_0202F7C4) != 0) - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); else { - ewram17810[gUnknown_02024A60].unk4 = 0; - gUnknown_03004330[gUnknown_02024A60] = sub_811FF30; + ewram17810[gActiveBank].unk4 = 0; + gBattleBankFunc[gActiveBank] = sub_811FF30; } } } void sub_811FF30(void) { - u16 r4 = gUnknown_02023A60[gUnknown_02024A60][1] - | (gUnknown_02023A60[gUnknown_02024A60][2] << 8); - u8 r7 = gUnknown_02023A60[gUnknown_02024A60][11]; + u16 r4 = gBattleBufferA[gActiveBank][1] + | (gBattleBufferA[gActiveBank][2] << 8); + u8 r7 = gBattleBufferA[gActiveBank][11]; - switch (ewram17810[gUnknown_02024A60].unk4) + switch (ewram17810[gActiveBank].unk4) { case 0: - if (ewram17800[gUnknown_02024A60].unk0_2 && !ewram17800[gUnknown_02024A60].unk0_3) + if (ewram17800[gActiveBank].unk0_2 && !ewram17800[gActiveBank].unk0_3) { - ewram17800[gUnknown_02024A60].unk0_3 = 1; - move_anim_start_t4(gUnknown_02024A60, gUnknown_02024A60, gUnknown_02024A60, 5); + ewram17800[gActiveBank].unk0_3 = 1; + move_anim_start_t4(gActiveBank, gActiveBank, gActiveBank, 5); } - ewram17810[gUnknown_02024A60].unk4 = 1; + ewram17810[gActiveBank].unk4 = 1; break; case 1: - if (!ewram17810[gUnknown_02024A60].unk0_6) + if (!ewram17810[gActiveBank].unk0_6) { sub_80326EC(0); ExecuteMoveAnim(r4); - ewram17810[gUnknown_02024A60].unk4 = 2; + ewram17810[gActiveBank].unk4 = 2; } break; case 2: @@ -1226,23 +1226,23 @@ void sub_811FF30(void) if (!gAnimScriptActive) { sub_80326EC(1); - if ((ewram17800[gUnknown_02024A60].unk0_2) && r7 <= 1) + if ((ewram17800[gActiveBank].unk0_2) && r7 <= 1) { - move_anim_start_t4(gUnknown_02024A60, gUnknown_02024A60, gUnknown_02024A60, 6); - ewram17800[gUnknown_02024A60].unk0_3 = 0; + move_anim_start_t4(gActiveBank, gActiveBank, gActiveBank, 6); + ewram17800[gActiveBank].unk0_3 = 0; } - ewram17810[gUnknown_02024A60].unk4 = 3; + ewram17810[gActiveBank].unk4 = 3; } break; case 3: - if (!ewram17810[gUnknown_02024A60].unk0_6) + if (!ewram17810[gActiveBank].unk0_6) { sub_8031F24(); sub_80324BC( - gUnknown_02024A60, - gUnknown_02023A60[gUnknown_02024A60][1] | (gUnknown_02023A60[gUnknown_02024A60][2] << 8)); - ewram17810[gUnknown_02024A60].unk4 = 0; - dp01_tbl3_exec_completed(); + gActiveBank, + gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8)); + ewram17810[gActiveBank].unk4 = 0; + LinkPartnerBufferExecCompleted(); } break; } @@ -1252,215 +1252,215 @@ void sub_8120094(void) { gUnknown_030042A4 = 0; gUnknown_030042A0 = 0; - sub_8120AA8(*(u16 *)&gUnknown_02023A60[gUnknown_02024A60][2]); - sub_8002EB0(&gUnknown_03004210, gUnknown_020238CC, 144, 2, 15); - gUnknown_03004330[gUnknown_02024A60] = sub_811DFA0; + BufferStringBattle(*(u16 *)&gBattleBufferA[gActiveBank][2]); + sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); + gBattleBankFunc[gActiveBank] = sub_811DFA0; } void sub_81200F8(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_8120104(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_8120110(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_812011C(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_8120128(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_8120134(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_8120140(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } -void sub_812014C(void) +void LinkPartnerHandleHealthBarUpdate(void) { s16 r7; load_gfxc_health_bar(0); - r7 = gUnknown_02023A60[gUnknown_02024A60][2] | (gUnknown_02023A60[gUnknown_02024A60][3] << 8); + r7 = gBattleBufferA[gActiveBank][2] | (gBattleBufferA[gActiveBank][3] << 8); if (r7 != 0x7FFF) { - u32 maxHP = GetMonData(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], MON_DATA_MAX_HP); - u32 hp = GetMonData(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], MON_DATA_HP); + u32 maxHP = GetMonData(&gPlayerParty[gBattlePartyID[gActiveBank]], MON_DATA_MAX_HP); + u32 hp = GetMonData(&gPlayerParty[gBattlePartyID[gActiveBank]], MON_DATA_HP); - sub_8043D84(gUnknown_02024A60, gUnknown_03004340[gUnknown_02024A60], maxHP, hp, r7); + sub_8043D84(gActiveBank, gHealthboxIDs[gActiveBank], maxHP, hp, r7); } else { - u32 maxHP = GetMonData(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], MON_DATA_MAX_HP); + u32 maxHP = GetMonData(&gPlayerParty[gBattlePartyID[gActiveBank]], MON_DATA_MAX_HP); - sub_8043D84(gUnknown_02024A60, gUnknown_03004340[gUnknown_02024A60], maxHP, 0, r7); + sub_8043D84(gActiveBank, gHealthboxIDs[gActiveBank], maxHP, 0, r7); } - gUnknown_03004330[gUnknown_02024A60] = bx_t3_healthbar_update; + gBattleBankFunc[gActiveBank] = bx_t3_healthbar_update; } -void sub_812023C(void) +void LinkPartnerHandleExpBarUpdate(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } -void sub_8120248(void) +void LinkPartnerHandleStatusIconUpdate(void) { - if (mplay_80342A4(gUnknown_02024A60) == 0) + if (mplay_80342A4(gActiveBank) == 0) { - sub_8045A5C(gUnknown_03004340[gUnknown_02024A60], &gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], 9); - ewram17810[gUnknown_02024A60].unk0_4 = 0; - gUnknown_03004330[gUnknown_02024A60] = sub_811E38C; + sub_8045A5C(gHealthboxIDs[gActiveBank], &gPlayerParty[gBattlePartyID[gActiveBank]], 9); + ewram17810[gActiveBank].unk0_4 = 0; + gBattleBankFunc[gActiveBank] = sub_811E38C; } } -void sub_81202BC(void) +void LinkPartnerHandleStatusAnimation(void) { - if (mplay_80342A4(gUnknown_02024A60) == 0) + if (mplay_80342A4(gActiveBank) == 0) { move_anim_start_t2_for_situation( - gUnknown_02023A60[gUnknown_02024A60][1], - gUnknown_02023A60[gUnknown_02024A60][2] - | (gUnknown_02023A60[gUnknown_02024A60][3] << 8) - | (gUnknown_02023A60[gUnknown_02024A60][4] << 16) - | (gUnknown_02023A60[gUnknown_02024A60][5] << 24)); - gUnknown_03004330[gUnknown_02024A60] = sub_811E38C; + gBattleBufferA[gActiveBank][1], + gBattleBufferA[gActiveBank][2] + | (gBattleBufferA[gActiveBank][3] << 8) + | (gBattleBufferA[gActiveBank][4] << 16) + | (gBattleBufferA[gActiveBank][5] << 24)); + gBattleBankFunc[gActiveBank] = sub_811E38C; } } void sub_8120324(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_8120330(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_812033C(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_8120348(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_8120354(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_8120360(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_812036C(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_8120378(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_8120384(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_8120390(void) { gUnknown_020238C8.unk0_0 = 0; - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_81203AC(void) { - gUnknown_020238C8.unk0_0 = gUnknown_02023A60[gUnknown_02024A60][1]; - dp01_tbl3_exec_completed(); + gUnknown_020238C8.unk0_0 = gBattleBufferA[gActiveBank][1]; + LinkPartnerBufferExecCompleted(); } void sub_81203E4(void) { gUnknown_020238C8.unk0_7 = 0; - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_81203FC(void) { gUnknown_020238C8.unk0_7 ^= 1; - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } -void dp01t_29_3_blink(void) +void LinkPartnerHandleHitAnimation(void) { - if (gSprites[gUnknown_02024BE0[gUnknown_02024A60]].invisible == TRUE) - dp01_tbl3_exec_completed(); + if (gSprites[gObjectBankIDs[gActiveBank]].invisible == TRUE) + LinkPartnerBufferExecCompleted(); else { - gUnknown_02024E6D = 1; - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data1 = 0; - sub_8047858(gUnknown_02024A60); - gUnknown_03004330[gUnknown_02024A60] = bx_blink_t3; + gDoingBattleAnim = 1; + gSprites[gObjectBankIDs[gActiveBank]].data1 = 0; + sub_8047858(gActiveBank); + gBattleBankFunc[gActiveBank] = bx_blink_t3; } } void sub_8120494(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } -void sub_81204A0(void) +void LinkPartnerHandleEffectivenessSound(void) { s8 pan; - if (battle_side_get_owner(gUnknown_02024A60) == 0) + if (GetBankSide(gActiveBank) == 0) pan = -64; else pan = 63; - PlaySE12WithPanning(gUnknown_02023A60[gUnknown_02024A60][1] | (gUnknown_02023A60[gUnknown_02024A60][2] << 8), pan); - dp01_tbl3_exec_completed(); + PlaySE12WithPanning(gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8), pan); + LinkPartnerBufferExecCompleted(); } void sub_81204E4(void) { - PlayFanfare(gUnknown_02023A60[gUnknown_02024A60][1] | (gUnknown_02023A60[gUnknown_02024A60][2] << 8)); - dp01_tbl3_exec_completed(); + PlayFanfare(gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8)); + LinkPartnerBufferExecCompleted(); } -void sub_8120514(void) +void LinkPartnerHandleFaintingCry(void) { PlayCry3( - GetMonData(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], MON_DATA_SPECIES), + GetMonData(&gPlayerParty[gBattlePartyID[gActiveBank]], MON_DATA_SPECIES), -25, 5); - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void dp01t_2E_3_battle_intro(void) { - sub_80E43C0(gUnknown_02023A60[gUnknown_02024A60][1]); + sub_80E43C0(gBattleBufferA[gActiveBank][1]); gUnknown_02024DE8 |= 1; - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_8120588(void) @@ -1468,25 +1468,25 @@ void sub_8120588(void) u8 r4; u8 taskId; - oamt_add_pos2_onto_pos1(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]]); - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data0 = 50; - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data2 = -40; - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data4 = gSprites[gUnknown_02024BE0[gUnknown_02024A60]].pos1.y; - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].callback = sub_8078B34; - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].data5 = gUnknown_02024A60; - oamt_set_x3A_32(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]], sub_8030E38); - StartSpriteAnim(&gSprites[gUnknown_02024BE0[gUnknown_02024A60]], 1); + oamt_add_pos2_onto_pos1(&gSprites[gObjectBankIDs[gActiveBank]]); + gSprites[gObjectBankIDs[gActiveBank]].data0 = 50; + gSprites[gObjectBankIDs[gActiveBank]].data2 = -40; + gSprites[gObjectBankIDs[gActiveBank]].data4 = gSprites[gObjectBankIDs[gActiveBank]].pos1.y; + gSprites[gObjectBankIDs[gActiveBank]].callback = sub_8078B34; + gSprites[gObjectBankIDs[gActiveBank]].data5 = gActiveBank; + oamt_set_x3A_32(&gSprites[gObjectBankIDs[gActiveBank]], sub_8030E38); + StartSpriteAnim(&gSprites[gObjectBankIDs[gActiveBank]], 1); r4 = AllocSpritePalette(0xD6F9); LoadCompressedPalette( - gTrainerBackPicPaletteTable[gLinkPlayers[sub_803FC34(gUnknown_02024A60)].gender].data, + gTrainerBackPicPaletteTable[gLinkPlayers[sub_803FC34(gActiveBank)].gender].data, 0x100 + r4 * 16, 0x20); - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].oam.paletteNum = r4; + gSprites[gObjectBankIDs[gActiveBank]].oam.paletteNum = r4; taskId = CreateTask(sub_812071C, 5); - gTasks[taskId].data[0] = gUnknown_02024A60; - if (ewram17810[gUnknown_02024A60].unk0_0) - gTasks[gUnknown_02024E68[gUnknown_02024A60]].func = sub_8044CA0; + gTasks[taskId].data[0] = gActiveBank; + if (ewram17810[gActiveBank].unk0_0) + gTasks[gUnknown_02024E68[gActiveBank]].func = sub_8044CA0; ewram17840.unk9_0 = 1; - gUnknown_03004330[gUnknown_02024A60] = nullsub_74; + gBattleBankFunc[gActiveBank] = nullsub_74; } void sub_812071C(u8 taskId) @@ -1499,111 +1499,111 @@ void sub_812071C(u8 taskId) return; } - r9 = gUnknown_02024A60; - gUnknown_02024A60 = gTasks[taskId].data[0]; + r9 = gActiveBank; + gActiveBank = gTasks[taskId].data[0]; if (!IsDoubleBattle() || (gBattleTypeFlags & BATTLE_TYPE_MULTI)) { - gUnknown_02023A60[gUnknown_02024A60][1] = gUnknown_02024A6A[gUnknown_02024A60]; - sub_811F864(gUnknown_02024A60, 0); + gBattleBufferA[gActiveBank][1] = gBattlePartyID[gActiveBank]; + sub_811F864(gActiveBank, 0); } else { - gUnknown_02023A60[gUnknown_02024A60][1] = gUnknown_02024A6A[gUnknown_02024A60]; - sub_811F864(gUnknown_02024A60, 0); - gUnknown_02024A60 ^= 2; - gUnknown_02023A60[gUnknown_02024A60][1] = gUnknown_02024A6A[gUnknown_02024A60]; - sub_80318FC(&gPlayerParty[gUnknown_02024A6A[gUnknown_02024A60]], gUnknown_02024A60); - sub_811F864(gUnknown_02024A60, 0); - gUnknown_02024A60 ^= 2; + gBattleBufferA[gActiveBank][1] = gBattlePartyID[gActiveBank]; + sub_811F864(gActiveBank, 0); + gActiveBank ^= 2; + gBattleBufferA[gActiveBank][1] = gBattlePartyID[gActiveBank]; + sub_80318FC(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + sub_811F864(gActiveBank, 0); + gActiveBank ^= 2; } - gUnknown_03004330[gUnknown_02024A60] = sub_811DCA0; - gUnknown_02024A60 = r9; + gBattleBankFunc[gActiveBank] = sub_811DCA0; + gActiveBank = r9; DestroyTask(taskId); } void dp01t_30_3_80EB11C(void) { - if (gUnknown_02023A60[gUnknown_02024A60][1] != 0 && battle_side_get_owner(gUnknown_02024A60) == 0) + if (gBattleBufferA[gActiveBank][1] != 0 && GetBankSide(gActiveBank) == 0) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); return; } - ewram17810[gUnknown_02024A60].unk0_0 = 1; - gUnknown_02024E68[gUnknown_02024A60] = sub_8044804( - gUnknown_02024A60, - (struct BattleInterfaceStruct2 *)&gUnknown_02023A60[gUnknown_02024A60][4], - gUnknown_02023A60[gUnknown_02024A60][1], - gUnknown_02023A60[gUnknown_02024A60][2]); - ewram17810[gUnknown_02024A60].unk5 = 0; - if (gUnknown_02023A60[gUnknown_02024A60][2] != 0) - ewram17810[gUnknown_02024A60].unk5 = 0x5D; - gUnknown_03004330[gUnknown_02024A60] = sub_81208E0; + ewram17810[gActiveBank].unk0_0 = 1; + gUnknown_02024E68[gActiveBank] = sub_8044804( + gActiveBank, + (struct BattleInterfaceStruct2 *)&gBattleBufferA[gActiveBank][4], + gBattleBufferA[gActiveBank][1], + gBattleBufferA[gActiveBank][2]); + ewram17810[gActiveBank].unk5 = 0; + if (gBattleBufferA[gActiveBank][2] != 0) + ewram17810[gActiveBank].unk5 = 0x5D; + gBattleBankFunc[gActiveBank] = sub_81208E0; } void sub_81208E0(void) { - if (ewram17810[gUnknown_02024A60].unk5++ >= 93) + if (ewram17810[gActiveBank].unk5++ >= 93) { - ewram17810[gUnknown_02024A60].unk5 = 0; - dp01_tbl3_exec_completed(); + ewram17810[gActiveBank].unk5 = 0; + LinkPartnerBufferExecCompleted(); } } void sub_8120920(void) { - if (ewram17810[gUnknown_02024A60].unk0_0) - gTasks[gUnknown_02024E68[gUnknown_02024A60]].func = sub_8044CA0; - dp01_tbl3_exec_completed(); + if (ewram17810[gActiveBank].unk0_0) + gTasks[gUnknown_02024E68[gActiveBank]].func = sub_8044CA0; + LinkPartnerBufferExecCompleted(); } void sub_812096C(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_8120978(void) { - if (sub_8078874(gUnknown_02024A60) != 0) + if (sub_8078874(gActiveBank) != 0) { - gSprites[gUnknown_02024BE0[gUnknown_02024A60]].invisible = gUnknown_02023A60[gUnknown_02024A60][1]; - sub_8031F88(gUnknown_02024A60); + gSprites[gObjectBankIDs[gActiveBank]].invisible = gBattleBufferA[gActiveBank][1]; + sub_8031F88(gActiveBank); } - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_81209D8(void) { - if (mplay_80342A4(gUnknown_02024A60) == 0) + if (mplay_80342A4(gActiveBank) == 0) { - u8 r3 = gUnknown_02023A60[gUnknown_02024A60][1]; - u16 r4 = gUnknown_02023A60[gUnknown_02024A60][2] | (gUnknown_02023A60[gUnknown_02024A60][3] << 8); - u8 var = gUnknown_02024A60; + u8 r3 = gBattleBufferA[gActiveBank][1]; + u16 r4 = gBattleBufferA[gActiveBank][2] | (gBattleBufferA[gActiveBank][3] << 8); + u8 var = gActiveBank; if (move_anim_start_t3(var, var, var, r3, r4) != 0) - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); else - gUnknown_03004330[gUnknown_02024A60] = sub_811E3B8; + gBattleBankFunc[gActiveBank] = sub_811E3B8; } } void sub_8120A40(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_8120A4C(void) { - dp01_tbl3_exec_completed(); + LinkPartnerBufferExecCompleted(); } void sub_8120A58(void) { - gUnknown_02024D26 = gUnknown_02023A60[gUnknown_02024A60][1]; + gBattleOutcome = gBattleBufferA[gActiveBank][1]; FadeOutMapMusic(5); BeginFastPaletteFade(3); - dp01_tbl3_exec_completed(); - gUnknown_03004330[gUnknown_02024A60] = sub_811E29C; + LinkPartnerBufferExecCompleted(); + gBattleBankFunc[gActiveBank] = sub_811E29C; } void nullsub_75(void) diff --git a/src/battle_ai.c b/src/battle_ai.c index cb8023251..fabe0b61d 100644 --- a/src/battle_ai.c +++ b/src/battle_ai.c @@ -14,22 +14,22 @@ extern u16 gBattleTypeFlags; extern u16 gBattleWeather; -extern u8 gUnknown_02024A60; -extern u8 gUnknown_02024A6A[][2]; -extern u16 gUnknown_02024BE6; +extern u8 gActiveBank; +extern u8 gBattlePartyID[][2]; +extern u16 gCurrentMove; extern int gBattleMoveDamage; -extern u8 gPlayerMonIndex; -extern u8 gEnemyMonIndex; -extern u8 gUnknown_02024C0C; +extern u8 gBankAttacker; +extern u8 gBankTarget; +extern u8 gAbsentBankFlags; extern u8 gBattleMoveFlags; -extern u16 gUnknown_02024DEC; -extern u16 gUnknown_02024C34[]; +extern u16 gDynamicBasePower; +extern u16 gLastUsedMove[]; extern u32 gUnknown_02024ACC[]; -extern u32 gUnknown_02024C98[]; -extern u16 gUnknown_02024C7A[]; +extern u32 gStatuses3[]; +extern u16 gSideAffecting[]; extern struct BattlePokemon gBattleMons[]; extern struct BattlePokemon gUnknown_02024A8C[]; -extern u8 gUnknown_030042E0[]; +extern u8 gBattleResults[]; extern u8 gCritMultiplier; extern u16 gTrainerBattleOpponent; extern u8 *BattleAIs[]; @@ -296,7 +296,7 @@ void BattleAI_SetupAIData(void) for (i = 0; i < MAX_MON_MOVES; i++) AI_THINKING_STRUCT->score[i] = 100; - r7 = sub_8015A98(gUnknown_02024A60, 0, 0xFF); + r7 = sub_8015A98(gActiveBank, 0, 0xFF); // probably sets up the moves to consider and ignores non-valid moves such as NO_MOVE or glitch moves. for (i = 0; i < MAX_MON_MOVES; i++) @@ -309,17 +309,17 @@ void BattleAI_SetupAIData(void) // clear AI stack. AI_STACK->size = 0; - gPlayerMonIndex = gUnknown_02024A60; + gBankAttacker = gActiveBank; if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { - gEnemyMonIndex = Random() & 2; // just pick somebody to target. + gBankTarget = Random() & 2; // just pick somebody to target. - if (gUnknown_02024C0C & gBitTable[gEnemyMonIndex]) - gEnemyMonIndex ^= 2; + if (gAbsentBankFlags & gBitTable[gBankTarget]) + gBankTarget ^= 2; } else - gEnemyMonIndex = gUnknown_02024A60 ^ 1; + gBankTarget = gActiveBank ^ 1; // special AI flag cases. if (gBattleTypeFlags & BATTLE_TYPE_SAFARI) @@ -394,13 +394,13 @@ void BattleAI_DoAIProcessing(void) break; case AIState_SettingUp: gAIScriptPtr = BattleAIs[AI_THINKING_STRUCT->aiLogicId]; // set the AI ptr. - if (gBattleMons[gPlayerMonIndex].pp[AI_THINKING_STRUCT->movesetIndex] == 0) + if (gBattleMons[gBankAttacker].pp[AI_THINKING_STRUCT->movesetIndex] == 0) { AI_THINKING_STRUCT->moveConsidered = MOVE_NONE; // don't consider a move you have 0 PP for, idiot. } else { - AI_THINKING_STRUCT->moveConsidered = gBattleMons[gPlayerMonIndex].moves[AI_THINKING_STRUCT->movesetIndex]; + AI_THINKING_STRUCT->moveConsidered = gBattleMons[gBankAttacker].moves[AI_THINKING_STRUCT->movesetIndex]; } AI_THINKING_STRUCT->aiState++; break; @@ -433,9 +433,9 @@ void sub_810745C(void) for (i = 0; i < 8; i++) { - if (UNK_2016A00_STRUCT->movesUsed[gEnemyMonIndex >> 1][i] == 0) + if (UNK_2016A00_STRUCT->movesUsed[gBankTarget >> 1][i] == 0) { - UNK_2016A00_STRUCT->movesUsed[gEnemyMonIndex >> 1][i] = gUnknown_02024C34[gEnemyMonIndex]; + UNK_2016A00_STRUCT->movesUsed[gBankTarget >> 1][i] = gLastUsedMove[gBankTarget]; return; } } @@ -451,14 +451,14 @@ void unref_sub_81074A0(u8 a) void sub_81074C4(u8 a, u8 b) { - if (battle_side_get_owner(a) == 0) - UNK_2016A00_STRUCT->unk20[battle_get_per_side_status(a) & 1] = b; + if (GetBankSide(a) == 0) + UNK_2016A00_STRUCT->unk20[GetBankIdentity(a) & 1] = b; } void sub_81074F8(u8 a, u8 b) { - if (battle_side_get_owner(a) == 0) - UNK_2016A00_STRUCT->unk22[battle_get_per_side_status(a) & 1] = b; + if (GetBankSide(a) == 0) + UNK_2016A00_STRUCT->unk22[GetBankIdentity(a) & 1] = b; } static void BattleAICmd_if_random_less_than(void) @@ -508,9 +508,9 @@ static void BattleAICmd_if_hp_less_than(void) u16 index; if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + index = gBankAttacker; else - index = gEnemyMonIndex; + index = gBankTarget; if ((u32)(100 * gBattleMons[index].hp / gBattleMons[index].maxHP) < gAIScriptPtr[2]) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3); @@ -523,9 +523,9 @@ static void BattleAICmd_if_hp_more_than(void) u16 index; if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + index = gBankAttacker; else - index = gEnemyMonIndex; + index = gBankTarget; if ((u32)(100 * gBattleMons[index].hp / gBattleMons[index].maxHP) > gAIScriptPtr[2]) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3); @@ -538,9 +538,9 @@ static void BattleAICmd_if_hp_equal(void) u16 index; if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + index = gBankAttacker; else - index = gEnemyMonIndex; + index = gBankTarget; if ((u32)(100 * gBattleMons[index].hp / gBattleMons[index].maxHP) == gAIScriptPtr[2]) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3); @@ -553,9 +553,9 @@ static void BattleAICmd_if_hp_not_equal(void) u16 index; if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + index = gBankAttacker; else - index = gEnemyMonIndex; + index = gBankTarget; if ((u32)(100 * gBattleMons[index].hp / gBattleMons[index].maxHP) != gAIScriptPtr[2]) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3); @@ -569,9 +569,9 @@ static void BattleAICmd_if_status(void) u32 arg; if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + index = gBankAttacker; else - index = gEnemyMonIndex; + index = gBankTarget; arg = AIScriptRead32(gAIScriptPtr + 2); @@ -587,9 +587,9 @@ static void BattleAICmd_if_not_status(void) u32 arg; if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + index = gBankAttacker; else - index = gEnemyMonIndex; + index = gBankTarget; arg = AIScriptRead32(gAIScriptPtr + 2); @@ -605,9 +605,9 @@ static void BattleAICmd_if_status2(void) u32 arg; if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + index = gBankAttacker; else - index = gEnemyMonIndex; + index = gBankTarget; arg = AIScriptRead32(gAIScriptPtr + 2); @@ -623,9 +623,9 @@ static void BattleAICmd_if_not_status2(void) u32 arg; if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + index = gBankAttacker; else - index = gEnemyMonIndex; + index = gBankTarget; arg = AIScriptRead32(gAIScriptPtr + 2); @@ -641,13 +641,13 @@ static void BattleAICmd_if_status3(void) u32 arg; if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + index = gBankAttacker; else - index = gEnemyMonIndex; + index = gBankTarget; arg = AIScriptRead32(gAIScriptPtr + 2); - if ((gUnknown_02024C98[index] & arg) != 0) + if ((gStatuses3[index] & arg) != 0) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 6); else gAIScriptPtr += 10; @@ -659,13 +659,13 @@ static void BattleAICmd_if_not_status3(void) u32 arg; if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + index = gBankAttacker; else - index = gEnemyMonIndex; + index = gBankTarget; arg = AIScriptRead32(gAIScriptPtr + 2); - if ((gUnknown_02024C98[index] & arg) == 0) + if ((gStatuses3[index] & arg) == 0) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 6); else gAIScriptPtr += 10; @@ -677,14 +677,14 @@ static void BattleAICmd_if_status4(void) u32 arg1, arg2; if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + index = gBankAttacker; else - index = gEnemyMonIndex; + index = gBankTarget; - arg1 = battle_get_per_side_status(index) & 1; + arg1 = GetBankIdentity(index) & 1; arg2 = AIScriptRead32(gAIScriptPtr + 2); - if ((gUnknown_02024C7A[arg1] & arg2) != 0) + if ((gSideAffecting[arg1] & arg2) != 0) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 6); else gAIScriptPtr += 10; @@ -696,14 +696,14 @@ static void BattleAICmd_if_not_status4(void) u32 arg1, arg2; if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + index = gBankAttacker; else - index = gEnemyMonIndex; + index = gBankTarget; - arg1 = battle_get_per_side_status(index) & 1; + arg1 = GetBankIdentity(index) & 1; arg2 = AIScriptRead32(gAIScriptPtr + 2); - if ((gUnknown_02024C7A[arg1] & arg2) == 0) + if ((gSideAffecting[arg1] & arg2) == 0) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 6); else gAIScriptPtr += 10; @@ -871,8 +871,8 @@ static void BattleAICmd_if_user_can_damage(void) for (i = 0; i < MAX_MON_MOVES; i++) { - if (gBattleMons[gPlayerMonIndex].moves[i] != 0 - && gBattleMoves[gBattleMons[gPlayerMonIndex].moves[i]].power != 0) + if (gBattleMons[gBankAttacker].moves[i] != 0 + && gBattleMoves[gBattleMons[gBankAttacker].moves[i]].power != 0) break; } if (i == MAX_MON_MOVES) @@ -887,8 +887,8 @@ static void BattleAICmd_if_user_cant_damage(void) for (i = 0; i < MAX_MON_MOVES; i++) { - if (gBattleMons[gPlayerMonIndex].moves[i] != 0 - && gBattleMoves[gBattleMons[gPlayerMonIndex].moves[i]].power != 0) + if (gBattleMons[gBankAttacker].moves[i] != 0 + && gBattleMoves[gBattleMons[gBankAttacker].moves[i]].power != 0) break; } if (i != MAX_MON_MOVES) @@ -899,7 +899,7 @@ static void BattleAICmd_if_user_cant_damage(void) static void BattleAICmd_get_turn_count(void) { - AI_THINKING_STRUCT->funcResult = gUnknown_030042E0[19]; + AI_THINKING_STRUCT->funcResult = gBattleResults[19]; gAIScriptPtr += 1; } @@ -908,16 +908,16 @@ static void BattleAICmd_get_type(void) switch (gAIScriptPtr[1]) { case 1: // player primary type - AI_THINKING_STRUCT->funcResult = gBattleMons[gPlayerMonIndex].type1; + AI_THINKING_STRUCT->funcResult = gBattleMons[gBankAttacker].type1; break; case 0: // enemy primary type - AI_THINKING_STRUCT->funcResult = gBattleMons[gEnemyMonIndex].type1; + AI_THINKING_STRUCT->funcResult = gBattleMons[gBankTarget].type1; break; case 3: // player secondary type - AI_THINKING_STRUCT->funcResult = gBattleMons[gPlayerMonIndex].type2; + AI_THINKING_STRUCT->funcResult = gBattleMons[gBankAttacker].type2; break; case 2: // enemy secondary type - AI_THINKING_STRUCT->funcResult = gBattleMons[gEnemyMonIndex].type2; + AI_THINKING_STRUCT->funcResult = gBattleMons[gBankTarget].type2; break; case 4: // type of move being pointed to AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->moveConsidered].type; @@ -945,7 +945,7 @@ static void BattleAICmd_is_most_powerful_move(void) if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].power > 1 && sDiscouragedPowerfulMoveEffects[i] == 0xFFFF) { - gUnknown_02024DEC = 0; + gDynamicBasePower = 0; unk_2000000[0x1601C] = 0; // why is this a manual array? unk_2000000[0x1601F] = 1; gBattleMoveFlags = 0; @@ -955,18 +955,18 @@ static void BattleAICmd_is_most_powerful_move(void) { for (j = 0; sDiscouragedPowerfulMoveEffects[j] != 0xFFFF; j++) { // _08108276 - if (gBattleMoves[gBattleMons[gPlayerMonIndex].moves[i]].effect == sDiscouragedPowerfulMoveEffects[j]) + if (gBattleMoves[gBattleMons[gBankAttacker].moves[i]].effect == sDiscouragedPowerfulMoveEffects[j]) break; } // _081082BA - if (gBattleMons[gPlayerMonIndex].moves[i] + if (gBattleMons[gBankAttacker].moves[i] && sDiscouragedPowerfulMoveEffects[j] == 0xFFFF - && gBattleMoves[gBattleMons[gPlayerMonIndex].moves[i]].power > 1) + && gBattleMoves[gBattleMons[gBankAttacker].moves[i]].power > 1) { - gUnknown_02024BE6 = gBattleMons[gPlayerMonIndex].moves[i]; - sub_801CAF8(gPlayerMonIndex, gEnemyMonIndex); - move_effectiveness_something(gUnknown_02024BE6, gPlayerMonIndex, gEnemyMonIndex); + gCurrentMove = gBattleMons[gBankAttacker].moves[i]; + sub_801CAF8(gBankAttacker, gBankTarget); + move_effectiveness_something(gCurrentMove, gBankAttacker, gBankTarget); damages[i] = (gBattleMoveDamage * AI_THINKING_STRUCT->simulatedRNG[i]) / 100; if (damages[i] == 0) // moves always do at least 1 damage. @@ -1049,7 +1049,7 @@ _08108240:\n\ beq _08108250\n\ b _081083B2\n\ _08108250:\n\ - ldr r0, _08108338 @ =gUnknown_02024DEC\n\ + ldr r0, _08108338 @ =gDynamicBasePower\n\ movs r1, 0\n\ strh r1, [r0]\n\ ldr r2, _0810833C @ =0xfffff81c\n\ @@ -1072,7 +1072,7 @@ _08108276:\n\ movs r3, 0\n\ ldr r5, _08108348 @ =gBattleMons\n\ lsls r4, r6, 1\n\ - ldr r7, _0810834C @ =gPlayerMonIndex\n\ + ldr r7, _0810834C @ =gBankAttacker\n\ lsls r1, r6, 2\n\ mov r8, r1\n\ adds r2, r6, 0x1\n\ @@ -1130,10 +1130,10 @@ _081082BA:\n\ ldrb r0, [r1, 0x1]\n\ cmp r0, 0x1\n\ bls _0810835C\n\ - ldr r5, _08108350 @ =gUnknown_02024BE6\n\ + ldr r5, _08108350 @ =gCurrentMove\n\ strh r2, [r5]\n\ ldrb r0, [r7]\n\ - ldr r4, _08108354 @ =gEnemyMonIndex\n\ + ldr r4, _08108354 @ =gBankTarget\n\ ldrb r1, [r4]\n\ bl sub_801CAF8\n\ ldrh r0, [r5]\n\ @@ -1162,14 +1162,14 @@ _08108328: .4byte sDiscouragedPowerfulMoveEffects\n\ _0810832C: .4byte 0x0000ffff\n\ _08108330: .4byte gBattleMoves\n\ _08108334: .4byte 0x02016800\n\ -_08108338: .4byte gUnknown_02024DEC\n\ +_08108338: .4byte gDynamicBasePower\n\ _0810833C: .4byte 0xfffff81c\n\ _08108340: .4byte gBattleMoveFlags\n\ _08108344: .4byte gCritMultiplier\n\ _08108348: .4byte gBattleMons\n\ -_0810834C: .4byte gPlayerMonIndex\n\ -_08108350: .4byte gUnknown_02024BE6\n\ -_08108354: .4byte gEnemyMonIndex\n\ +_0810834C: .4byte gBankAttacker\n\ +_08108350: .4byte gCurrentMove\n\ +_08108354: .4byte gBankTarget\n\ _08108358: .4byte gBattleMoveDamage\n\ _0810835C:\n\ mov r1, sp\n\ @@ -1243,9 +1243,9 @@ _081083D0: .4byte gAIScriptPtr\n\ static void BattleAICmd_get_move(void) { if (gAIScriptPtr[1] == USER) - AI_THINKING_STRUCT->funcResult = gUnknown_02024C34[gPlayerMonIndex]; + AI_THINKING_STRUCT->funcResult = gLastUsedMove[gBankAttacker]; else - AI_THINKING_STRUCT->funcResult = gUnknown_02024C34[gEnemyMonIndex]; + AI_THINKING_STRUCT->funcResult = gLastUsedMove[gBankTarget]; gAIScriptPtr += 2; } @@ -1268,7 +1268,7 @@ static void BattleAICmd_if_arg_not_equal(void) static void BattleAICmd_if_would_go_first(void) { - if (b_first_side(gPlayerMonIndex, gEnemyMonIndex, 1) == gAIScriptPtr[1]) + if (b_first_side(gBankAttacker, gBankTarget, 1) == gAIScriptPtr[1]) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); else gAIScriptPtr += 6; @@ -1276,7 +1276,7 @@ static void BattleAICmd_if_would_go_first(void) static void BattleAICmd_if_would_not_go_first(void) { - if (b_first_side(gPlayerMonIndex, gEnemyMonIndex, 1) != gAIScriptPtr[1]) + if (b_first_side(gBankAttacker, gBankTarget, 1) != gAIScriptPtr[1]) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); else gAIScriptPtr += 6; @@ -1300,11 +1300,11 @@ static void BattleAICmd_count_alive_pokemon(void) AI_THINKING_STRUCT->funcResult = 0; if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + index = gBankAttacker; else - index = gEnemyMonIndex; + index = gBankTarget; - if (battle_side_get_owner(index) == 0) + if (GetBankSide(index) == 0) party = gPlayerParty; else party = gEnemyParty; @@ -1312,14 +1312,14 @@ static void BattleAICmd_count_alive_pokemon(void) if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { u32 status; - var = gUnknown_02024A6A[index][0]; - status = battle_get_per_side_status(index) ^ 2; - var2 = gUnknown_02024A6A[battle_get_side_with_given_state(status)][0]; + var = gBattlePartyID[index][0]; + status = GetBankIdentity(index) ^ 2; + var2 = gBattlePartyID[GetBankByPlayerAI(status)][0]; } else { - var = gUnknown_02024A6A[index][0]; - var2 = gUnknown_02024A6A[index][0]; + var = gBattlePartyID[index][0]; + var2 = gBattlePartyID[index][0]; } for (i = 0; i < 6; i++) @@ -1353,13 +1353,13 @@ static void BattleAICmd_get_ability(void) u8 index; if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + index = gBankAttacker; else - index = gEnemyMonIndex; + index = gBankTarget; - if (battle_side_get_owner(index) == TARGET) + if (GetBankSide(index) == TARGET) { - u16 unk = battle_get_per_side_status(index) & 1; + u16 unk = GetBankIdentity(index) & 1; if (UNK_2016A00_STRUCT->unk20[unk] != 0) { @@ -1414,7 +1414,7 @@ static void BattleAICmd_get_highest_possible_damage(void) { s32 i; - gUnknown_02024DEC = 0; + gDynamicBasePower = 0; BATTLE_STRUCT->unk.unk1 = 0; BATTLE_STRUCT->unk.unk4 = 1; gBattleMoveFlags = 0; @@ -1424,11 +1424,11 @@ static void BattleAICmd_get_highest_possible_damage(void) for (i = 0; i < MAX_MON_MOVES; i++) { gBattleMoveDamage = 40; - gUnknown_02024BE6 = gBattleMons[gPlayerMonIndex].moves[i]; + gCurrentMove = gBattleMons[gBankAttacker].moves[i]; - if (gUnknown_02024BE6) + if (gCurrentMove) { - move_effectiveness_something(gUnknown_02024BE6, gPlayerMonIndex, gEnemyMonIndex); + move_effectiveness_something(gCurrentMove, gBankAttacker, gBankTarget); // reduce by 1/3. if (gBattleMoveDamage == 120) @@ -1454,16 +1454,16 @@ static void BattleAICmd_if_damage_bonus(void) { u8 damageVar; - gUnknown_02024DEC = 0; + gDynamicBasePower = 0; BATTLE_STRUCT->unk.unk1 = 0; BATTLE_STRUCT->unk.unk4 = 1; gBattleMoveFlags = 0; gCritMultiplier = 1; gBattleMoveDamage = 40; - gUnknown_02024BE6 = AI_THINKING_STRUCT->moveConsidered; + gCurrentMove = AI_THINKING_STRUCT->moveConsidered; - move_effectiveness_something(gUnknown_02024BE6, gPlayerMonIndex, gEnemyMonIndex); + move_effectiveness_something(gCurrentMove, gBankAttacker, gBankTarget); if (gBattleMoveDamage == 120) gBattleMoveDamage = 80; @@ -1598,9 +1598,9 @@ static void BattleAICmd_if_stat_level_less_than(void) u32 party; if (gAIScriptPtr[1] == USER) - party = gPlayerMonIndex; + party = gBankAttacker; else - party = gEnemyMonIndex; + party = gBankTarget; if (gBattleMons[party].statStages[gAIScriptPtr[2]] < gAIScriptPtr[3]) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4); @@ -1613,9 +1613,9 @@ static void BattleAICmd_if_stat_level_more_than(void) u32 party; if (gAIScriptPtr[1] == USER) - party = gPlayerMonIndex; + party = gBankAttacker; else - party = gEnemyMonIndex; + party = gBankTarget; if (gBattleMons[party].statStages[gAIScriptPtr[2]] > gAIScriptPtr[3]) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4); @@ -1628,9 +1628,9 @@ static void BattleAICmd_if_stat_level_equal(void) u32 party; if (gAIScriptPtr[1] == USER) - party = gPlayerMonIndex; + party = gBankAttacker; else - party = gEnemyMonIndex; + party = gBankTarget; if (gBattleMons[party].statStages[gAIScriptPtr[2]] == gAIScriptPtr[3]) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4); @@ -1643,9 +1643,9 @@ static void BattleAICmd_if_stat_level_not_equal(void) u32 party; if (gAIScriptPtr[1] == USER) - party = gPlayerMonIndex; + party = gBankAttacker; else - party = gEnemyMonIndex; + party = gBankTarget; if (gBattleMons[party].statStages[gAIScriptPtr[2]] != gAIScriptPtr[3]) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4); @@ -1661,14 +1661,14 @@ static void BattleAICmd_if_can_faint(void) return; } - gUnknown_02024DEC = 0; + gDynamicBasePower = 0; BATTLE_STRUCT->unk.unk1 = 0; BATTLE_STRUCT->unk.unk4 = 1; gBattleMoveFlags = 0; gCritMultiplier = 1; - gUnknown_02024BE6 = AI_THINKING_STRUCT->moveConsidered; - sub_801CAF8(gPlayerMonIndex, gEnemyMonIndex); - move_effectiveness_something(gUnknown_02024BE6, gPlayerMonIndex, gEnemyMonIndex); + gCurrentMove = AI_THINKING_STRUCT->moveConsidered; + sub_801CAF8(gBankAttacker, gBankTarget); + move_effectiveness_something(gCurrentMove, gBankAttacker, gBankTarget); gBattleMoveDamage = gBattleMoveDamage * AI_THINKING_STRUCT->simulatedRNG[AI_THINKING_STRUCT->movesetIndex] / 100; @@ -1676,7 +1676,7 @@ static void BattleAICmd_if_can_faint(void) if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; - if (gBattleMons[gEnemyMonIndex].hp <= gBattleMoveDamage) + if (gBattleMons[gBankTarget].hp <= gBattleMoveDamage) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 1); else gAIScriptPtr += 5; @@ -1690,20 +1690,20 @@ static void BattleAICmd_if_cant_faint(void) return; } - gUnknown_02024DEC = 0; + gDynamicBasePower = 0; BATTLE_STRUCT->unk.unk1 = 0; BATTLE_STRUCT->unk.unk4 = 1; gBattleMoveFlags = 0; gCritMultiplier = 1; - gUnknown_02024BE6 = AI_THINKING_STRUCT->moveConsidered; - sub_801CAF8(gPlayerMonIndex, gEnemyMonIndex); - move_effectiveness_something(gUnknown_02024BE6, gPlayerMonIndex, gEnemyMonIndex); + gCurrentMove = AI_THINKING_STRUCT->moveConsidered; + sub_801CAF8(gBankAttacker, gBankTarget); + move_effectiveness_something(gCurrentMove, gBankAttacker, gBankTarget); gBattleMoveDamage = gBattleMoveDamage * AI_THINKING_STRUCT->simulatedRNG[AI_THINKING_STRUCT->movesetIndex] / 100; // this macro is missing the damage 0 = 1 assumption. - if (gBattleMons[gEnemyMonIndex].hp > gBattleMoveDamage) + if (gBattleMons[gBankTarget].hp > gBattleMoveDamage) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 1); else gAIScriptPtr += 5; @@ -1720,7 +1720,7 @@ static void BattleAICmd_if_has_move(void) case 3: for (i = 0; i < MAX_MON_MOVES; i++) { - if (gBattleMons[gPlayerMonIndex].moves[i] == *temp_ptr) + if (gBattleMons[gBankAttacker].moves[i] == *temp_ptr) break; } if (i == MAX_MON_MOVES) @@ -1732,7 +1732,7 @@ static void BattleAICmd_if_has_move(void) case 2: for (i = 0; i < 8; i++) { - if (UNK_2016A00_STRUCT->movesUsed[gEnemyMonIndex >> 1][i] == *temp_ptr) + if (UNK_2016A00_STRUCT->movesUsed[gBankTarget >> 1][i] == *temp_ptr) break; } if (i == 8) @@ -1754,7 +1754,7 @@ static void BattleAICmd_if_dont_have_move(void) case 3: for (i = 0; i < MAX_MON_MOVES; i++) { - if (gBattleMons[gPlayerMonIndex].moves[i] == *temp_ptr) + if (gBattleMons[gBankAttacker].moves[i] == *temp_ptr) break; } if (i != MAX_MON_MOVES) @@ -1766,7 +1766,7 @@ static void BattleAICmd_if_dont_have_move(void) case 2: for (i = 0; i < 8; i++) { - if (UNK_2016A00_STRUCT->movesUsed[gEnemyMonIndex >> 1][i] == *temp_ptr) + if (UNK_2016A00_STRUCT->movesUsed[gBankTarget >> 1][i] == *temp_ptr) break; } if (i != 8) @@ -1787,7 +1787,7 @@ static void BattleAICmd_if_move_effect(void) case 3: for (i = 0; i < MAX_MON_MOVES; i++) { - if (gBattleMons[gPlayerMonIndex].moves[i] != 0 && gBattleMoves[gBattleMons[gPlayerMonIndex].moves[i]].effect == gAIScriptPtr[2]) + if (gBattleMons[gBankAttacker].moves[i] != 0 && gBattleMoves[gBattleMons[gBankAttacker].moves[i]].effect == gAIScriptPtr[2]) break; } if (i != MAX_MON_MOVES) @@ -1799,7 +1799,7 @@ static void BattleAICmd_if_move_effect(void) case 2: for (i = 0; i < 8; i++) { - if (gBattleMons[gPlayerMonIndex].moves[i] != 0 && gBattleMoves[UNK_2016A00_STRUCT->movesUsed[gEnemyMonIndex >> 1][i]].effect == gAIScriptPtr[2]) + if (gBattleMons[gBankAttacker].moves[i] != 0 && gBattleMoves[UNK_2016A00_STRUCT->movesUsed[gBankTarget >> 1][i]].effect == gAIScriptPtr[2]) break; } gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3); @@ -1816,7 +1816,7 @@ static void BattleAICmd_if_not_move_effect(void) case 3: for (i = 0; i < MAX_MON_MOVES; i++) { - if (gBattleMons[gPlayerMonIndex].moves[i] != 0 && gBattleMoves[gBattleMons[gPlayerMonIndex].moves[i]].effect == gAIScriptPtr[2]) + if (gBattleMons[gBankAttacker].moves[i] != 0 && gBattleMoves[gBattleMons[gBankAttacker].moves[i]].effect == gAIScriptPtr[2]) break; } if (i != MAX_MON_MOVES) @@ -1828,7 +1828,7 @@ static void BattleAICmd_if_not_move_effect(void) case 2: for (i = 0; i < 8; i++) { - if (UNK_2016A00_STRUCT->movesUsed[gEnemyMonIndex >> 1][i] != 0 && gBattleMoves[UNK_2016A00_STRUCT->movesUsed[gEnemyMonIndex >> 1][i]].effect == gAIScriptPtr[2]) + if (UNK_2016A00_STRUCT->movesUsed[gBankTarget >> 1][i] != 0 && gBattleMoves[UNK_2016A00_STRUCT->movesUsed[gBankTarget >> 1][i]].effect == gAIScriptPtr[2]) break; } gAIScriptPtr += 7; @@ -1840,13 +1840,13 @@ static void BattleAICmd_if_last_move_did_damage(void) u8 index; if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + index = gBankAttacker; else - index = gEnemyMonIndex; + index = gBankTarget; if (gAIScriptPtr[2] == 0) { - if (gUnknown_02024CA8[index].unk4 == 0) + if (gDisableStructs[index].unk4 == 0) { gAIScriptPtr += 7; return; @@ -1859,7 +1859,7 @@ static void BattleAICmd_if_last_move_did_damage(void) gAIScriptPtr += 7; return; } - else if (gUnknown_02024CA8[index].unk6 != 0) + else if (gDisableStructs[index].unk6 != 0) { gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3); return; @@ -1872,7 +1872,7 @@ static void BattleAICmd_if_encored(void) switch (gAIScriptPtr[1]) { case 0: // _08109348 - if (gUnknown_02024CA8[gUnknown_02024A60].unk4 == AI_THINKING_STRUCT->moveConsidered) + if (gDisableStructs[gActiveBank].unk4 == AI_THINKING_STRUCT->moveConsidered) { gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); return; @@ -1880,7 +1880,7 @@ static void BattleAICmd_if_encored(void) gAIScriptPtr += 6; return; case 1: // _08109370 - if (gUnknown_02024CA8[gUnknown_02024A60].unk6 == AI_THINKING_STRUCT->moveConsidered) + if (gDisableStructs[gActiveBank].unk6 == AI_THINKING_STRUCT->moveConsidered) { gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); return; @@ -1919,13 +1919,13 @@ static void BattleAICmd_get_hold_effect(void) u16 status; if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + index = gBankAttacker; else - index = gEnemyMonIndex; + index = gBankTarget; - if (battle_side_get_owner(index) == 0) + if (GetBankSide(index) == 0) { - status = (battle_get_per_side_status(index) & 1); + status = (GetBankIdentity(index) & 1); AI_THINKING_STRUCT->funcResult = UNK_2016A00_STRUCT->unk22[status]; } else @@ -1939,9 +1939,9 @@ static void BattleAICmd_get_gender(void) u8 index; if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + index = gBankAttacker; else - index = gEnemyMonIndex; + index = gBankTarget; AI_THINKING_STRUCT->funcResult = GetGenderFromSpeciesAndPersonality(gBattleMons[index].species, gBattleMons[index].personality); @@ -1953,11 +1953,11 @@ static void BattleAICmd_is_first_turn(void) u8 index; if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + index = gBankAttacker; else - index = gEnemyMonIndex; + index = gBankTarget; - AI_THINKING_STRUCT->funcResult = gUnknown_02024CA8[index].unk16; + AI_THINKING_STRUCT->funcResult = gDisableStructs[index].unk16; gAIScriptPtr += 2; } @@ -1967,11 +1967,11 @@ static void BattleAICmd_get_stockpile_count(void) u8 index; if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + index = gBankAttacker; else - index = gEnemyMonIndex; + index = gBankTarget; - AI_THINKING_STRUCT->funcResult = gUnknown_02024CA8[index].unk9; + AI_THINKING_STRUCT->funcResult = gDisableStructs[index].unk9; gAIScriptPtr += 2; } @@ -1988,9 +1988,9 @@ static void BattleAICmd_get_item(void) u8 index; if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + index = gBankAttacker; else - index = gEnemyMonIndex; + index = gBankTarget; // this hack and a half matches. whatever. i dont care. someone else fix this mess later. PS: still cant fix this. AI_THINKING_STRUCT->funcResult = ewram[0x160CC + (index * 2)]; @@ -2024,11 +2024,11 @@ static void BattleAICmd_get_protect_count(void) u8 index; if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + index = gBankAttacker; else - index = gEnemyMonIndex; + index = gBankTarget; - AI_THINKING_STRUCT->funcResult = gUnknown_02024CA8[index].unk8; + AI_THINKING_STRUCT->funcResult = gDisableStructs[index].unk8; gAIScriptPtr += 2; } @@ -2079,7 +2079,7 @@ static void BattleAICmd_if_level_compare(void) switch (gAIScriptPtr[1]) { case 0: // greater than - if (gBattleMons[gPlayerMonIndex].level > gBattleMons[gEnemyMonIndex].level) + if (gBattleMons[gBankAttacker].level > gBattleMons[gBankTarget].level) { gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); return; @@ -2087,7 +2087,7 @@ static void BattleAICmd_if_level_compare(void) gAIScriptPtr += 6; return; case 1: // less than - if (gBattleMons[gPlayerMonIndex].level < gBattleMons[gEnemyMonIndex].level) + if (gBattleMons[gBankAttacker].level < gBattleMons[gBankTarget].level) { gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); return; @@ -2095,7 +2095,7 @@ static void BattleAICmd_if_level_compare(void) gAIScriptPtr += 6; return; case 2: // equal - if (gBattleMons[gPlayerMonIndex].level == gBattleMons[gEnemyMonIndex].level) + if (gBattleMons[gBankAttacker].level == gBattleMons[gBankTarget].level) { gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); return; @@ -2107,7 +2107,7 @@ static void BattleAICmd_if_level_compare(void) static void BattleAICmd_if_taunted(void) { - if (gUnknown_02024CA8[gEnemyMonIndex].taunt != 0) + if (gDisableStructs[gBankTarget].taunt != 0) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 1); else gAIScriptPtr += 5; @@ -2115,7 +2115,7 @@ static void BattleAICmd_if_taunted(void) static void BattleAICmd_if_not_taunted(void) { - if (gUnknown_02024CA8[gEnemyMonIndex].taunt == 0) + if (gDisableStructs[gBankTarget].taunt == 0) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 1); else gAIScriptPtr += 5; diff --git a/src/battle_anim.c b/src/battle_anim.c index 90e5c97c3..cc856d5cd 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -17,10 +17,10 @@ #define GET_TRUE_SPRITE_INDEX(i) (i - 10000) extern u8 unk_2000000[]; -extern u16 gUnknown_02024A6A[4]; -extern u8 gUnknown_02024BE0[]; -extern u8 gPlayerMonIndex; -extern u8 gEnemyMonIndex; +extern u16 gBattlePartyID[4]; +extern u8 gObjectBankIDs[]; +extern u8 gBankAttacker; +extern u8 gBankTarget; EWRAM_DATA const u8 *gBattleAnimScriptPtr = NULL; EWRAM_DATA const u8 *gBattleAnimScriptRetAddr = NULL; EWRAM_DATA void (*gAnimScriptCallback)(void) = NULL; @@ -28,11 +28,11 @@ EWRAM_DATA s8 gAnimFramesToWait = 0; EWRAM_DATA u8 gAnimScriptActive = FALSE; EWRAM_DATA u8 gAnimVisualTaskCount = 0; EWRAM_DATA u8 gAnimSoundTaskCount = 0; -EWRAM_DATA u32 gUnknown_0202F7B4 = 0; -EWRAM_DATA u32 gUnknown_0202F7B8 = 0; -EWRAM_DATA u16 gUnknown_0202F7BC = 0; -EWRAM_DATA u8 gUnknown_0202F7BE = 0; -EWRAM_DATA u16 gUnknown_0202F7C0 = 0; +EWRAM_DATA u32 gDisableStructMoveAnim = 0; +EWRAM_DATA u32 gMoveDmgMoveAnim = 0; +EWRAM_DATA u16 gMovePowerMoveAnim = 0; +EWRAM_DATA u8 gHappinessMoveAnim = 0; +EWRAM_DATA u16 gWeatherMoveAnim = 0; EWRAM_DATA u8 gMonAnimTaskIdArray[2] = {0}; EWRAM_DATA u8 gUnknown_0202F7C4 = 0; EWRAM_DATA u8 gUnknown_0202F7C5 = 0; @@ -181,10 +181,10 @@ void battle_anim_clear_some_data(void) gAnimScriptActive = FALSE; gAnimVisualTaskCount = 0; gAnimSoundTaskCount = 0; - gUnknown_0202F7B4 = 0; - gUnknown_0202F7B8 = 0; - gUnknown_0202F7BC = 0; - gUnknown_0202F7BE = 0; + gDisableStructMoveAnim = 0; + gMoveDmgMoveAnim = 0; + gMovePowerMoveAnim = 0; + gHappinessMoveAnim = 0; // clear index array. for (i = 0; i < 8; i++) @@ -206,8 +206,8 @@ void battle_anim_clear_some_data(void) void ExecuteMoveAnim(u16 move) { - gBattleAnimPlayerMonIndex = gPlayerMonIndex; - gBattleAnimEnemyMonIndex = gEnemyMonIndex; + gBattleAnimPlayerMonIndex = gBankAttacker; + gBattleAnimEnemyMonIndex = gBankTarget; DoMoveAnim(gBattleAnims_Moves, move, 1); } @@ -221,10 +221,10 @@ void DoMoveAnim(const u8 *const moveAnims[], u16 move, u8 c) sub_8043EB4(0); for (i = 0; i < 4; i++) { - if (battle_side_get_owner(i) != 0) - gUnknown_0202F7CA[i] = GetMonData(&gEnemyParty[gUnknown_02024A6A[i]], MON_DATA_SPECIES); + if (GetBankSide(i) != 0) + gUnknown_0202F7CA[i] = GetMonData(&gEnemyParty[gBattlePartyID[i]], MON_DATA_SPECIES); else - gUnknown_0202F7CA[i] = GetMonData(&gPlayerParty[gUnknown_02024A6A[i]], MON_DATA_SPECIES); + gUnknown_0202F7CA[i] = GetMonData(&gPlayerParty[gBattlePartyID[i]], MON_DATA_SPECIES); } } else @@ -689,14 +689,14 @@ static void ScriptCmd_monbg(void) r5 = gBattleAnimEnemyMonIndex; if (b_side_obj__get_some_boolean(r5)) { - r0 = battle_get_per_side_status(r5); + r0 = GetBankIdentity(r5); r0 += 0xFF; if (r0 <= 1 || IsContest() != 0) r7 = 0; else r7 = 1; sub_8076034(r5, r7); - r4 = gUnknown_02024BE0[r5]; + r4 = gObjectBankIDs[r5]; 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; @@ -719,14 +719,14 @@ static void ScriptCmd_monbg(void) r5 ^= 2; if (r6 > 1 && b_side_obj__get_some_boolean(r5)) { - r0 = battle_get_per_side_status(r5); + r0 = GetBankIdentity(r5); r0 += 0xFF; if (r0 <= 1 || IsContest() != 0) r7 = 0; else r7 = 1; sub_8076034(r5, r7); - r4 = gUnknown_02024BE0[r5]; + r4 = gObjectBankIDs[r5]; 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; @@ -764,7 +764,7 @@ bool8 b_side_obj__get_some_boolean(u8 a) return TRUE; // this line wont ever be reached. if ((EWRAM_17800[a].unk0 & 1) == 0) return TRUE; - if (gSprites[gUnknown_02024BE0[a]].invisible) + if (gSprites[gObjectBankIDs[a]].invisible) return FALSE; return TRUE; } @@ -807,7 +807,7 @@ _08075FDC:\n\ cmp r0, 0\n\ beq _0807601C\n\ ldr r2, _08076024 @ =gSprites\n\ - ldr r0, _08076028 @ =gUnknown_02024BE0\n\ + ldr r0, _08076028 @ =gObjectBankIDs\n\ adds r0, r5, r0\n\ ldrb r1, [r0]\n\ lsls r0, r1, 4\n\ @@ -825,7 +825,7 @@ _0807601C:\n\ .align 2, 0\n\ _08076020: .4byte 0x02017800\n\ _08076024: .4byte gSprites\n\ -_08076028: .4byte gUnknown_02024BE0\n\ +_08076028: .4byte gObjectBankIDs\n\ _0807602C:\n\ movs r0, 0\n\ _0807602E:\n\ @@ -873,12 +873,12 @@ void sub_8076034(u8 a, u8 b) REG_BG1CNT_BITFIELD.screenSize = 1; REG_BG1CNT_BITFIELD.areaOverflowMode = 0; - spriteId = gUnknown_02024BE0[a]; + spriteId = gObjectBankIDs[a]; gUnknown_030042C0 = -(gSprites[spriteId].pos1.x + gSprites[spriteId].pos2.x) + 32; if (IsContest() != 0 && sub_80AEB1C(EWRAM_19348) != 0) gUnknown_030042C0--; gUnknown_030041B4 = -(gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y) + 32; - gSprites[gUnknown_02024BE0[a]].invisible = TRUE; + gSprites[gObjectBankIDs[a]].invisible = TRUE; REG_BG1HOFS = gUnknown_030042C0; REG_BG1VOFS = gUnknown_030041B4; @@ -890,7 +890,7 @@ void sub_8076034(u8 a, u8 b) if (IsContest() != 0) r2 = 0; else - r2 = battle_get_per_side_status(a); + r2 = GetBankIdentity(a); sub_80E4EF8(0, 0, r2, s.unk8, (u32)s.unk0, (((s32)s.unk4 - VRAM) / 2048), REG_BG1CNT_BITFIELD.charBaseBlock); if (IsContest() != 0) sub_8076380(); @@ -923,10 +923,10 @@ void sub_8076034(u8 a, u8 b) REG_BG2CNT_BITFIELD.screenSize = 1; REG_BG2CNT_BITFIELD.areaOverflowMode = 0; - spriteId = gUnknown_02024BE0[a]; + 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; - gSprites[gUnknown_02024BE0[a]].invisible = TRUE; + gSprites[gObjectBankIDs[a]].invisible = TRUE; REG_BG2HOFS = gUnknown_03004288; REG_BG2VOFS = gUnknown_03004280; @@ -935,7 +935,7 @@ void sub_8076034(u8 a, u8 b) addr3 = (void *)(PLTT + 0x120); DmaCopy32(3, gPlttBufferUnfaded + 0x100 + a * 16, addr3, 32); - sub_80E4EF8(0, 0, battle_get_per_side_status(a), 9, 0x6000, 0x1E, REG_BG2CNT_BITFIELD.charBaseBlock); + sub_80E4EF8(0, 0, GetBankIdentity(a), 9, 0x6000, 0x1E, REG_BG2CNT_BITFIELD.charBaseBlock); } } @@ -1098,9 +1098,9 @@ static void ScriptCmd_clearmonbg(void) else r5 = gBattleAnimEnemyMonIndex; if (gMonAnimTaskIdArray[0] != 0xFF) - gSprites[gUnknown_02024BE0[r5]].invisible = FALSE; + gSprites[gObjectBankIDs[r5]].invisible = FALSE; if (r4 > 1 && gMonAnimTaskIdArray[1] != 0xFF) - gSprites[gUnknown_02024BE0[r5 ^ 2]].invisible = FALSE; + gSprites[gObjectBankIDs[r5 ^ 2]].invisible = FALSE; else r4 = 0; taskId = CreateTask(sub_807672C, 5); @@ -1117,7 +1117,7 @@ static void sub_807672C(u8 taskId) gTasks[taskId].data[1]++; if (gTasks[taskId].data[1] != 1) { - var = battle_get_per_side_status(gTasks[taskId].data[2]); + var = GetBankIdentity(gTasks[taskId].data[2]); var += 0xFF; if (var <= 1 || IsContest() != 0) r4 = 0; @@ -1158,26 +1158,26 @@ static void ScriptCmd_monbg_22(void) r4 = gBattleAnimEnemyMonIndex; if (b_side_obj__get_some_boolean(r4)) { - r0 = battle_get_per_side_status(r4); + r0 = GetBankIdentity(r4); r0 += 0xFF; if (r0 <= 1 || IsContest() != 0) r1 = 0; else r1 = 1; sub_8076034(r4, r1); - gSprites[gUnknown_02024BE0[r4]].invisible = FALSE; + gSprites[gObjectBankIDs[r4]].invisible = FALSE; } r4 ^= 2; if (r5 > 1 && b_side_obj__get_some_boolean(r4)) { - r0 = battle_get_per_side_status(r4); + r0 = GetBankIdentity(r4); r0 += 0xFF; if (r0 <= 1 || IsContest() != 0) r1 = 0; else r1 = 1; sub_8076034(r4, r1); - gSprites[gUnknown_02024BE0[r4]].invisible = FALSE; + gSprites[gObjectBankIDs[r4]].invisible = FALSE; } gBattleAnimScriptPtr++; } @@ -1199,9 +1199,9 @@ static void ScriptCmd_clearmonbg_23(void) else r6 = gBattleAnimEnemyMonIndex; if (b_side_obj__get_some_boolean(r6)) - gSprites[gUnknown_02024BE0[r6]].invisible = FALSE; + gSprites[gObjectBankIDs[r6]].invisible = FALSE; if (r5 > 1 && b_side_obj__get_some_boolean(r6 ^ 2)) - gSprites[gUnknown_02024BE0[r6 ^ 2]].invisible = FALSE; + gSprites[gObjectBankIDs[r6 ^ 2]].invisible = FALSE; else r5 = 0; taskId = CreateTask(sub_80769A4, 5); @@ -1220,7 +1220,7 @@ static void sub_80769A4(u8 taskId) if (gTasks[taskId].data[1] != 1) { r4 = gTasks[taskId].data[2]; - r0 = battle_get_per_side_status(r4); + r0 = GetBankIdentity(r4); r0 += 0xFF; if (r0 <= 1 || IsContest() != 0) r5 = 0; @@ -1369,7 +1369,7 @@ static void ScriptCmd_fadetobg_25(void) taskId = CreateTask(task_p5_load_battle_screen_elements, 5); if (IsContest() != 0) gTasks[taskId].data[0] = r6; - else if (battle_side_get_owner(gBattleAnimEnemyMonIndex) == 0) + else if (GetBankSide(gBattleAnimEnemyMonIndex) == 0) gTasks[taskId].data[0] = r7; else gTasks[taskId].data[0] = r8; @@ -1493,7 +1493,7 @@ s8 sub_8076F98(s8 a) { if (!IsContest() && (EWRAM_17810[gBattleAnimPlayerMonIndex].unk0 & 0x10)) { - a = battle_side_get_owner(gBattleAnimPlayerMonIndex) ? 0xC0 : 0x3F; + a = GetBankSide(gBattleAnimPlayerMonIndex) ? 0xC0 : 0x3F; } //_08076FDC else @@ -1512,9 +1512,9 @@ s8 sub_8076F98(s8 a) //_08077004 else { - if (battle_side_get_owner(gBattleAnimPlayerMonIndex) == 0) + if (GetBankSide(gBattleAnimPlayerMonIndex) == 0) { - if (battle_side_get_owner(gBattleAnimEnemyMonIndex) == 0) + if (GetBankSide(gBattleAnimEnemyMonIndex) == 0) } //_08077042 else @@ -1551,7 +1551,7 @@ s8 sub_8076F98(s8 a) cmp r0, 0\n\ beq _08076FDC\n\ adds r0, r2, 0\n\ - bl battle_side_get_owner\n\ + bl GetBankSide\n\ lsls r0, 24\n\ movs r4, 0xC0\n\ cmp r0, 0\n\ @@ -1583,13 +1583,13 @@ _08077000: .4byte gBattleAnimEnemyMonIndex\n\ _08077004:\n\ ldr r0, _0807702C @ =gBattleAnimPlayerMonIndex\n\ ldrb r0, [r0]\n\ - bl battle_side_get_owner\n\ + bl GetBankSide\n\ lsls r0, 24\n\ cmp r0, 0\n\ bne _08077042\n\ ldr r0, _08077030 @ =gBattleAnimEnemyMonIndex\n\ ldrb r0, [r0]\n\ - bl battle_side_get_owner\n\ + bl GetBankSide\n\ lsls r0, 24\n\ cmp r0, 0\n\ bne _0807706E\n\ @@ -1613,7 +1613,7 @@ _08077034:\n\ _08077042:\n\ ldr r0, _08077064 @ =gBattleAnimEnemyMonIndex\n\ ldrb r0, [r0]\n\ - bl battle_side_get_owner\n\ + bl GetBankSide\n\ lsls r0, 24\n\ lsrs r0, 24\n\ cmp r0, 0x1\n\ @@ -1661,14 +1661,14 @@ s8 sub_8077094(s8 a) { if (!IsContest() && (EWRAM_17810[gBattleAnimPlayerMonIndex].unk0 & 0x10)) { - if (battle_side_get_owner(gBattleAnimPlayerMonIndex) != 0) + if (GetBankSide(gBattleAnimPlayerMonIndex) != 0) a = 0x3F; else a = 0xC0; } else { - if (battle_side_get_owner(gBattleAnimPlayerMonIndex) != 0 || IsContest() != 0) + if (GetBankSide(gBattleAnimPlayerMonIndex) != 0 || IsContest() != 0) a = -a; } return a; @@ -2129,7 +2129,7 @@ static void ScriptCmd_monbgprio_28(void) r0 = gBattleAnimEnemyMonIndex; else r0 = gBattleAnimPlayerMonIndex; - r4 = battle_get_per_side_status(r0); + r4 = GetBankIdentity(r0); if (!IsContest() && (r4 == 0 || r4 == 3)) { REG_BG1CNT_BITFIELD.priority = 1; @@ -2155,13 +2155,13 @@ static void ScriptCmd_monbgprio_2A(void) r6 = SCRIPT_READ_8(gBattleAnimScriptPtr + 1); gBattleAnimScriptPtr += 2; - if (battle_side_get_owner(gBattleAnimPlayerMonIndex) != battle_side_get_owner(gBattleAnimEnemyMonIndex)) + if (GetBankSide(gBattleAnimPlayerMonIndex) != GetBankSide(gBattleAnimEnemyMonIndex)) { if (r6 != 0) r0 = gBattleAnimEnemyMonIndex; else r0 = gBattleAnimPlayerMonIndex; - r4 = battle_get_per_side_status(r0); + r4 = GetBankIdentity(r0); if (!IsContest() && (r4 == 0 || r4 == 3)) { REG_BG1CNT_BITFIELD.priority = 1; @@ -2207,16 +2207,16 @@ static void ScriptCmd_doublebattle_2D(void) r7 = SCRIPT_READ_8(gBattleAnimScriptPtr + 1); gBattleAnimScriptPtr += 2; if (!IsContest() && IsDoubleBattle() - && battle_side_get_owner(gBattleAnimPlayerMonIndex) == battle_side_get_owner(gBattleAnimEnemyMonIndex)) + && GetBankSide(gBattleAnimPlayerMonIndex) == GetBankSide(gBattleAnimEnemyMonIndex)) { if (r7 == 0) { - r4 = battle_get_per_side_status_permutated(gBattleAnimPlayerMonIndex); + r4 = GetBankIdentity_permutated(gBattleAnimPlayerMonIndex); spriteId = obj_id_for_side_relative_to_move(0); } else { - r4 = battle_get_per_side_status_permutated(gBattleAnimEnemyMonIndex); + r4 = GetBankIdentity_permutated(gBattleAnimEnemyMonIndex); spriteId = obj_id_for_side_relative_to_move(1); } if (spriteId != 0xFF) @@ -2241,16 +2241,16 @@ static void ScriptCmd_doublebattle_2E(void) r7 = SCRIPT_READ_8(gBattleAnimScriptPtr + 1); gBattleAnimScriptPtr += 2; if (!IsContest() && IsDoubleBattle() - && battle_side_get_owner(gBattleAnimPlayerMonIndex) == battle_side_get_owner(gBattleAnimEnemyMonIndex)) + && GetBankSide(gBattleAnimPlayerMonIndex) == GetBankSide(gBattleAnimEnemyMonIndex)) { if (r7 == 0) { - r4 = battle_get_per_side_status_permutated(gBattleAnimPlayerMonIndex); + r4 = GetBankIdentity_permutated(gBattleAnimPlayerMonIndex); spriteId = obj_id_for_side_relative_to_move(0); } else { - r4 = battle_get_per_side_status_permutated(gBattleAnimEnemyMonIndex); + r4 = GetBankIdentity_permutated(gBattleAnimEnemyMonIndex); spriteId = obj_id_for_side_relative_to_move(1); } if (spriteId != 0xFF && r4 == 2) diff --git a/src/battle_anim_80A7E7C.c b/src/battle_anim_80A7E7C.c index 12b53d7d9..34c11a352 100644 --- a/src/battle_anim_80A7E7C.c +++ b/src/battle_anim_80A7E7C.c @@ -10,9 +10,9 @@ extern s16 gBattleAnimArgs[8]; -extern u8 gUnknown_02024BE0[]; -extern s32 gUnknown_0202F7B8; -extern u16 gUnknown_0202F7BC; +extern u8 gObjectBankIDs[]; +extern s32 gMoveDmgMoveAnim; +extern u16 gMovePowerMoveAnim; extern u8 gBattleAnimPlayerMonIndex; extern u8 gBattleAnimEnemyMonIndex; @@ -109,28 +109,28 @@ void sub_80A7FA0(u8 task) switch (gBattleAnimArgs[0]) { case 4: - side = battle_get_side_with_given_state(0); + side = GetBankByPlayerAI(0); break; case 5: - side = battle_get_side_with_given_state(2); + side = GetBankByPlayerAI(2); break; case 6: - side = battle_get_side_with_given_state(1); + side = GetBankByPlayerAI(1); break; case 7: default: - side = battle_get_side_with_given_state(3); + side = GetBankByPlayerAI(3); break; } if (b_side_obj__get_some_boolean(side) == FALSE) { r6 = 1; } - sprite = gUnknown_02024BE0[side]; + sprite = gObjectBankIDs[side]; } else { - sprite = gUnknown_02024BE0[gBattleAnimPlayerMonIndex]; + sprite = gObjectBankIDs[gBattleAnimPlayerMonIndex]; } if (r6) { @@ -329,7 +329,7 @@ static void sub_80A8488(u8 task) void sub_80A8500(u8 task) { - if (battle_side_get_owner(gBattleAnimPlayerMonIndex)) + if (GetBankSide(gBattleAnimPlayerMonIndex)) { gBattleAnimArgs[1] = -gBattleAnimArgs[1]; } @@ -339,7 +339,7 @@ void sub_80A8500(u8 task) void sub_80A8530(struct Sprite *sprite) { sprite->invisible = TRUE; - if (battle_side_get_owner(gBattleAnimPlayerMonIndex)) + if (GetBankSide(gBattleAnimPlayerMonIndex)) { sprite->data1 = -gBattleAnimArgs[1]; } @@ -349,7 +349,7 @@ void sub_80A8530(struct Sprite *sprite) } sprite->data0 = gBattleAnimArgs[0]; sprite->data2 = 0; - sprite->data3 = gUnknown_02024BE0[gBattleAnimPlayerMonIndex]; + sprite->data3 = gObjectBankIDs[gBattleAnimPlayerMonIndex]; sprite->data4 = gBattleAnimArgs[0]; oamt_set_x3A_32(sprite, sub_80A85A4); sprite->callback = sub_8078458; @@ -391,11 +391,11 @@ void sub_80A8638(struct Sprite *sprite) int spriteId; if (!gBattleAnimArgs[0]) { - spriteId = gUnknown_02024BE0[gBattleAnimPlayerMonIndex]; + spriteId = gObjectBankIDs[gBattleAnimPlayerMonIndex]; } else { - spriteId = gUnknown_02024BE0[gBattleAnimEnemyMonIndex]; + spriteId = gObjectBankIDs[gBattleAnimEnemyMonIndex]; } sprite->data0 = gBattleAnimArgs[2]; sprite->data1 = gSprites[spriteId].pos1.x + gSprites[spriteId].pos2.x; @@ -464,8 +464,8 @@ void sub_80A8764(struct Sprite *sprite) { v1 = gBattleAnimEnemyMonIndex; } - spriteId = gUnknown_02024BE0[v1]; - if (battle_side_get_owner(v1)) + spriteId = gObjectBankIDs[v1]; + if (GetBankSide(v1)) { gBattleAnimArgs[1] = -gBattleAnimArgs[1]; if (gBattleAnimArgs[3] == 1) @@ -500,8 +500,8 @@ void sub_80A8818(struct Sprite *sprite) { v1 = gBattleAnimEnemyMonIndex; } - spriteId = gUnknown_02024BE0[v1]; - if (battle_side_get_owner(v1)) + spriteId = gObjectBankIDs[v1]; + if (GetBankSide(v1)) { gBattleAnimArgs[1] = -gBattleAnimArgs[1]; if (gBattleAnimArgs[3] == 1) @@ -542,7 +542,7 @@ void sub_80A8920(u8 task) { s16 r7; r7 = 0x8000 / gBattleAnimArgs[3]; - if (battle_side_get_owner(gBattleAnimPlayerMonIndex)) + if (GetBankSide(gBattleAnimPlayerMonIndex)) { gBattleAnimArgs[1] = -gBattleAnimArgs[1]; gBattleAnimArgs[5] = -gBattleAnimArgs[5]; @@ -609,7 +609,7 @@ void sub_80A8A80(u8 task) DestroyAnimVisualTask(task); return; } - spriteId = gUnknown_02024BE0[gBattleAnimPlayerMonIndex ^ 2]; + spriteId = gObjectBankIDs[gBattleAnimPlayerMonIndex ^ 2]; break; case 3: if (!b_side_obj__get_some_boolean(gBattleAnimEnemyMonIndex ^ 2)) @@ -617,14 +617,14 @@ void sub_80A8A80(u8 task) DestroyAnimVisualTask(task); return; } - spriteId = gUnknown_02024BE0[gBattleAnimEnemyMonIndex ^ 2]; + spriteId = gObjectBankIDs[gBattleAnimEnemyMonIndex ^ 2]; break; default: DestroyAnimVisualTask(task); return; } TASK.data[0] = spriteId; - if (battle_side_get_owner(gBattleAnimEnemyMonIndex)) + if (GetBankSide(gBattleAnimEnemyMonIndex)) { TASK.data[1] = gBattleAnimArgs[1]; } @@ -649,7 +649,7 @@ static void sub_80A8B3C(u8 task) void sub_80A8B88(u8 task) { u8 spriteId; - if (battle_side_get_owner(gBattleAnimPlayerMonIndex)) + if (GetBankSide(gBattleAnimPlayerMonIndex)) { gBattleAnimArgs[1] = -gBattleAnimArgs[1]; } @@ -688,7 +688,7 @@ static void sub_80A8C0C(u8 task) } else { - if (battle_side_get_owner(TASK.data[5]) == 0) + if (GetBankSide(TASK.data[5]) == 0) { gSprites[spriteId].pos2.y = (y >= 0) ? y : -y; } @@ -778,11 +778,11 @@ void sub_80A8E04(u8 task) { if (gBattleAnimArgs[2] == 0) { - TASK.data[7] = !battle_side_get_owner(gBattleAnimPlayerMonIndex); + TASK.data[7] = !GetBankSide(gBattleAnimPlayerMonIndex); } else { - TASK.data[7] = !battle_side_get_owner(gBattleAnimEnemyMonIndex); + TASK.data[7] = !GetBankSide(gBattleAnimEnemyMonIndex); } } if (TASK.data[7]) @@ -805,14 +805,14 @@ void sub_80A8EFC(u8 task) TASK.data[2] = gBattleAnimArgs[0]; if (gBattleAnimArgs[2] == 0) { - if (battle_side_get_owner(gBattleAnimPlayerMonIndex)) + if (GetBankSide(gBattleAnimPlayerMonIndex)) { gBattleAnimArgs[1] = -gBattleAnimArgs[1]; } } else { - if (battle_side_get_owner(gBattleAnimEnemyMonIndex)) + if (GetBankSide(gBattleAnimEnemyMonIndex)) { gBattleAnimArgs[1] = -gBattleAnimArgs[1]; } @@ -865,7 +865,7 @@ void sub_80A9058(u8 task) { if (!gBattleAnimArgs[0]) { - TASK.data[15] = gUnknown_0202F7BC / 12; + TASK.data[15] = gMovePowerMoveAnim / 12; if (TASK.data[15] < 1) { TASK.data[15] = 1; @@ -877,7 +877,7 @@ void sub_80A9058(u8 task) } else { - TASK.data[15] = gUnknown_0202F7B8 / 12; + TASK.data[15] = gMoveDmgMoveAnim / 12; if (TASK.data[15] < 1) { TASK.data[15] = 1; diff --git a/src/battle_anim_81258BC.c b/src/battle_anim_81258BC.c index fe4e9bd38..5bdbb4946 100644 --- a/src/battle_anim_81258BC.c +++ b/src/battle_anim_81258BC.c @@ -6,14 +6,14 @@ #include "text.h" extern struct Window gUnknown_03004210; -extern u8 gUnknown_020238CC[]; -extern u8 gUnknown_02024E60[]; +extern u8 gDisplayedStringBattle[]; +extern u8 gActionSelectionCursor[]; extern const u8 gUnknown_08400CBB[]; -extern u8 gUnknown_02024A60; +extern u8 gActiveBank; extern const u8 gUnknown_08400D15[]; -extern void *gUnknown_03004330[]; +extern void *gBattleBankFunc[]; extern u16 gUnknown_030042A0; extern u16 gUnknown_030042A4; @@ -31,7 +31,7 @@ void sub_812BB10(void) { gUnknown_03004210.paletteNum = 0; FillWindowRect_DefaultPalette(&gUnknown_03004210, 10, 2, 15, 27, 18); FillWindowRect_DefaultPalette(&gUnknown_03004210, 10, 2, 35, 16, 36); - gUnknown_03004330[gUnknown_02024A60] = bx_battle_menu_t6_2; + gBattleBankFunc[gActiveBank] = bx_battle_menu_t6_2; InitWindow(&gUnknown_03004210, gUnknown_08400D15, 400, 18, 35); sub_8002F44(&gUnknown_03004210); @@ -42,9 +42,9 @@ void sub_812BB10(void) { nullsub_8(i); } - sub_802E3E4(gUnknown_02024E60[gUnknown_02024A60], 0); - get_battle_strings_((u8 *) gUnknown_08400CBB); + sub_802E3E4(gActionSelectionCursor[gActiveBank], 0); + StrCpyDecodeToDisplayedStringBattle((u8 *) gUnknown_08400CBB); - InitWindow(&gUnknown_03004210, gUnknown_020238CC, SUB_812BB10_TILE_DATA_OFFSET, 2, 35); + InitWindow(&gUnknown_03004210, gDisplayedStringBattle, SUB_812BB10_TILE_DATA_OFFSET, 2, 35); sub_8002F44(&gUnknown_03004210); } \ No newline at end of file diff --git a/src/battle_interface.c b/src/battle_interface.c index 042861c22..246bda62b 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -34,11 +34,11 @@ extern u8 ewram[]; #define ewram16089 (*(u8 *) (ewram + 0x16089)) #define ewram17850 ((struct UnknownStruct5 *)(ewram + 0x17850)) -extern u8 gUnknown_020238CC[]; -extern u8 gUnknown_02024A68; -extern u16 gUnknown_02024A6A[]; -extern u8 gUnknown_02024A72[]; -extern u8 gUnknown_03004340[]; +extern u8 gDisplayedStringBattle[]; +extern u8 gNoOfAllBanks; +extern u16 gBattlePartyID[]; +extern u8 gBanksBySide[]; +extern u8 gHealthboxIDs[]; extern u16 gBattleTypeFlags; @@ -424,7 +424,7 @@ u8 battle_make_oam_normal_battle(u8 a) if (!IsDoubleBattle()) { - if (battle_side_get_owner(a) == 0) + if (GetBankSide(a) == 0) { spriteId1 = CreateSprite(&gSpriteTemplate_820A4EC[0], 240, 160, 1); spriteId2 = CreateSpriteAtEnd(&gSpriteTemplate_820A4EC[0], 240, 160, 1); @@ -450,10 +450,10 @@ u8 battle_make_oam_normal_battle(u8 a) //_08043A28 else { - if (battle_side_get_owner(a) == 0) + if (GetBankSide(a) == 0) { - spriteId1 = CreateSprite(&gSpriteTemplate_820A4EC[battle_get_per_side_status(a) / 2], 240, 160, 1); - spriteId2 = CreateSpriteAtEnd(&gSpriteTemplate_820A4EC[battle_get_per_side_status(a) / 2], 240, 160, 1); + spriteId1 = CreateSprite(&gSpriteTemplate_820A4EC[GetBankIdentity(a) / 2], 240, 160, 1); + spriteId2 = CreateSpriteAtEnd(&gSpriteTemplate_820A4EC[GetBankIdentity(a) / 2], 240, 160, 1); gSprites[spriteId1].oam.affineParam = spriteId2; gSprites[spriteId2].data5 = spriteId1; @@ -464,8 +464,8 @@ u8 battle_make_oam_normal_battle(u8 a) //_08043ACC else { - spriteId1 = CreateSprite(&gSpriteTemplate_820A51C[battle_get_per_side_status(a) / 2], 240, 160, 1); - spriteId2 = CreateSpriteAtEnd(&gSpriteTemplate_820A51C[battle_get_per_side_status(a) / 2], 240, 160, 1); + spriteId1 = CreateSprite(&gSpriteTemplate_820A51C[GetBankIdentity(a) / 2], 240, 160, 1); + spriteId2 = CreateSpriteAtEnd(&gSpriteTemplate_820A51C[GetBankIdentity(a) / 2], 240, 160, 1); gSprites[spriteId1].oam.affineParam = spriteId2; gSprites[spriteId2].data5 = spriteId1; @@ -477,9 +477,9 @@ u8 battle_make_oam_normal_battle(u8 a) } //_08043B50 - spriteId3 = CreateSpriteAtEnd(&gSpriteTemplate_820A56C[gUnknown_02024A72[a]], 140, 60, 0); + spriteId3 = CreateSpriteAtEnd(&gSpriteTemplate_820A56C[gBanksBySide[a]], 140, 60, 0); sprite = &gSprites[spriteId3]; - SetSubspriteTables(sprite, &gSubspriteTables_820A684[battle_side_get_owner(a)]); + SetSubspriteTables(sprite, &gSubspriteTables_820A684[GetBankSide(a)]); sprite->subspriteMode = 2; sprite->oam.priority = 1; CpuCopy32(sub_8043CDC(1), (void *)(OBJ_VRAM0 + sprite->oam.tileNum * 32), 64); @@ -592,13 +592,13 @@ void sub_8043EB4(u8 priority) { s32 i; - for (i = 0; i < gUnknown_02024A68; i++) + for (i = 0; i < gNoOfAllBanks; i++) { u8 spriteId1; u8 spriteId2; u8 spriteId3; - spriteId1 = gUnknown_03004340[i]; + spriteId1 = gHealthboxIDs[i]; spriteId2 = gSprites[spriteId1].oam.affineParam; spriteId3 = gSprites[spriteId1].data5; gSprites[spriteId1].oam.priority = priority; @@ -614,7 +614,7 @@ void sub_8043F44(u8 a) if (!IsDoubleBattle()) { - if (battle_side_get_owner(a) != 0) + if (GetBankSide(a) != 0) { x = 44; y = 30; @@ -627,7 +627,7 @@ void sub_8043F44(u8 a) } else { - switch (battle_get_per_side_status(a)) + switch (GetBankIdentity(a)) { case 0: x = 159; @@ -647,7 +647,7 @@ void sub_8043F44(u8 a) break; } } - sub_8043E50(gUnknown_03004340[a], x, y); + sub_8043E50(gHealthboxIDs[a], x, y); } #if ENGLISH @@ -668,14 +668,14 @@ static void sub_8043FC0(u8 a, u8 b) memcpy(str, gUnknown_0820A81C, sizeof(str)); if (!IsDoubleBattle()) { - if (battle_side_get_owner(gSprites[a].data6) == 0) + if (GetBankSide(gSprites[a].data6) == 0) r7 = gUnknown_0820A804; else r7 = gUnknown_0820A80C; } else { - if (battle_side_get_owner(gSprites[a].data6) == 0) + if (GetBankSide(gSprites[a].data6) == 0) r7 = gUnknown_0820A814; else r7 = gUnknown_0820A80C; @@ -725,7 +725,7 @@ void sub_80440EC(u8 a, s16 b, u8 c) memcpy(str, gUnknown_0820A864, sizeof(str)); foo = gSprites[a].data6; - if (IsDoubleBattle() == TRUE || battle_side_get_owner(foo) == 1) + if (IsDoubleBattle() == TRUE || GetBankSide(foo) == 1) { //_08044136 sub_8044210(a, b, c); @@ -735,7 +735,7 @@ void sub_80440EC(u8 a, s16 b, u8 c) ptr = str + 6; if (c == 0) { - if (battle_side_get_owner(gSprites[a].data6) == 0) + if (GetBankSide(gSprites[a].data6) == 0) r4 = gUnknown_0820A83C; else r4 = gUnknown_0820A848; @@ -747,7 +747,7 @@ void sub_80440EC(u8 a, s16 b, u8 c) } else { - if (battle_side_get_owner(gSprites[a].data6) == 0) + if (GetBankSide(gSprites[a].data6) == 0) r4 = gUnknown_0820A854; else r4 = gUnknown_0820A85C; @@ -797,7 +797,7 @@ void sub_80440EC(u8 a, s16 b, u8 c) beq _08044136\n\ lsls r0, r5, 24\n\ lsrs r0, 24\n\ - bl battle_side_get_owner\n\ + bl GetBankSide\n\ lsls r0, 24\n\ lsrs r0, 24\n\ cmp r0, 0x1\n\ @@ -821,7 +821,7 @@ _0804414C:\n\ ldrh r0, [r4, 0x3A]\n\ lsls r0, 24\n\ lsrs r0, 24\n\ - bl battle_side_get_owner\n\ + bl GetBankSide\n\ lsls r0, 24\n\ ldr r4, _08044188 @ =gUnknown_0820A848\n\ cmp r0, 0\n\ @@ -849,7 +849,7 @@ _08044190:\n\ ldrh r0, [r4, 0x3A]\n\ lsls r0, 24\n\ lsrs r0, 24\n\ - bl battle_side_get_owner\n\ + bl GetBankSide\n\ lsls r0, 24\n\ ldr r4, _080441FC @ =gUnknown_0820A85C\n\ cmp r0, 0\n\ @@ -938,7 +938,7 @@ static void sub_8044210(u8 a, s16 b, u8 c) r7 = gUnknown_0820A894; r10 = 2; sub_8003504(ptr, b, 0xF, 1); - if (battle_side_get_owner(r4) == 0) + if (GetBankSide(r4) == 0) { CpuCopy32(sub_8043CDC(0x74), (void *)(OBJ_VRAM0 + (gSprites[a].oam.tileNum + 0x34) * 32), 32); } @@ -964,7 +964,7 @@ void sub_8044338(u8 a, struct Pokemon *pkmn) // TODO: make this a local variable memcpy(str, gUnknown_0820A864, sizeof(str)); - r6 = ewram520[battle_get_per_side_status(gSprites[a].data6)].filler0; + r6 = ewram520[GetBankIdentity(gSprites[a].data6)].filler0; r8 = 5; nature = GetNature(pkmn); StringCopy(str + 6, gNatureNames[nature]); @@ -1048,7 +1048,7 @@ void sub_8044338(u8 a, struct Pokemon *pkmn) ldrh r0, [r0, 0x3A]\n\ lsls r0, 24\n\ lsrs r0, 24\n\ - bl battle_get_per_side_status\n\ + bl GetBankIdentity\n\ lsls r0, 24\n\ lsrs r0, 24\n\ lsls r1, r0, 1\n\ @@ -1287,17 +1287,17 @@ void sub_804454C(void) s32 i; u8 spriteId; - for (i = 0; i < gUnknown_02024A68; i++) + for (i = 0; i < gNoOfAllBanks; i++) { - if (gSprites[gUnknown_03004340[i]].callback == SpriteCallbackDummy - && battle_side_get_owner(i) != 1 - && (IsDoubleBattle() || battle_side_get_owner(i) != 0)) + if (gSprites[gHealthboxIDs[i]].callback == SpriteCallbackDummy + && GetBankSide(i) != 1 + && (IsDoubleBattle() || GetBankSide(i) != 0)) { u8 r6; ewram17800[i].unk0_4 ^= 1; r6 = ewram17800[i].unk0_4; - if (battle_side_get_owner(i) == 0) + if (GetBankSide(i) == 0) { if (!IsDoubleBattle()) @@ -1307,17 +1307,17 @@ void sub_804454C(void) if (r6 == 1) { - spriteId = gSprites[gUnknown_03004340[i]].data5; + spriteId = gSprites[gHealthboxIDs[i]].data5; CpuFill32(0, (void *)(OBJ_VRAM0 + gSprites[spriteId].oam.tileNum * 32), 0x100); - sub_8044210(gUnknown_03004340[i], GetMonData(&gPlayerParty[gUnknown_02024A6A[i]], MON_DATA_HP), 0); - sub_8044210(gUnknown_03004340[i], GetMonData(&gPlayerParty[gUnknown_02024A6A[i]], MON_DATA_MAX_HP), 1); + sub_8044210(gHealthboxIDs[i], GetMonData(&gPlayerParty[gBattlePartyID[i]], MON_DATA_HP), 0); + sub_8044210(gHealthboxIDs[i], GetMonData(&gPlayerParty[gBattlePartyID[i]], MON_DATA_MAX_HP), 1); } else { - draw_status_ailment_maybe(gUnknown_03004340[i]); - sub_8045A5C(gUnknown_03004340[i], &gPlayerParty[gUnknown_02024A6A[i]], 5); - CpuCopy32(sub_8043CDC(0x75), (void *)(OBJ_VRAM0 + 0x680 + gSprites[gUnknown_03004340[i]].oam.tileNum * 32), 32); + draw_status_ailment_maybe(gHealthboxIDs[i]); + sub_8045A5C(gHealthboxIDs[i], &gPlayerParty[gBattlePartyID[i]], 5); + CpuCopy32(sub_8043CDC(0x75), (void *)(OBJ_VRAM0 + 0x680 + gSprites[gHealthboxIDs[i]].oam.tileNum * 32), 32); } } else @@ -1326,26 +1326,26 @@ void sub_804454C(void) { if (gBattleTypeFlags & BATTLE_TYPE_SAFARI) { - sub_8044338(gUnknown_03004340[i], &gEnemyParty[gUnknown_02024A6A[i]]); + sub_8044338(gHealthboxIDs[i], &gEnemyParty[gBattlePartyID[i]]); } else { - spriteId = gSprites[gUnknown_03004340[i]].data5; + spriteId = gSprites[gHealthboxIDs[i]].data5; CpuFill32(0, (void *)(OBJ_VRAM0 + gSprites[spriteId].oam.tileNum * 32), 0x100); - sub_8044210(gUnknown_03004340[i], GetMonData(&gEnemyParty[gUnknown_02024A6A[i]], MON_DATA_HP), 0); - sub_8044210(gUnknown_03004340[i], GetMonData(&gEnemyParty[gUnknown_02024A6A[i]], MON_DATA_MAX_HP), 1); + sub_8044210(gHealthboxIDs[i], GetMonData(&gEnemyParty[gBattlePartyID[i]], MON_DATA_HP), 0); + sub_8044210(gHealthboxIDs[i], GetMonData(&gEnemyParty[gBattlePartyID[i]], MON_DATA_MAX_HP), 1); } } else { - draw_status_ailment_maybe(gUnknown_03004340[i]); - sub_8045A5C(gUnknown_03004340[i], &gEnemyParty[gUnknown_02024A6A[i]], 5); + draw_status_ailment_maybe(gHealthboxIDs[i]); + sub_8045A5C(gHealthboxIDs[i], &gEnemyParty[gBattlePartyID[i]], 5); if (gBattleTypeFlags & BATTLE_TYPE_SAFARI) - sub_8045A5C(gUnknown_03004340[i], &gEnemyParty[gUnknown_02024A6A[i]], 4); + sub_8045A5C(gHealthboxIDs[i], &gEnemyParty[gBattlePartyID[i]], 4); } } - gSprites[gUnknown_03004340[i]].data7 ^= 1; + gSprites[gHealthboxIDs[i]].data7 ^= 1; } } } @@ -1366,9 +1366,9 @@ u8 sub_8044804(u8 a, const struct BattleInterfaceStruct2 *b, u8 c, u8 d) u8 sp18; u8 taskId; - if (c == 0 || battle_get_per_side_status(a) != 3) + if (c == 0 || GetBankIdentity(a) != 3) { - if (battle_side_get_owner(a) == 0) + if (GetBankSide(a) == 0) { r7 = 0; x = 136; @@ -1461,7 +1461,7 @@ u8 sub_8044804(u8 a, const struct BattleInterfaceStruct2 *b, u8 c, u8 d) gSprites[sp[i]].data2 = r7; } //_08044A76 - if (battle_side_get_owner(a) == 0) + if (GetBankSide(a) == 0) { for (i = 0; i < 6; i++) //_08044A9A { @@ -1582,14 +1582,14 @@ u8 sub_8044804(u8 a, const struct BattleInterfaceStruct2 *b, u8 c, u8 d) str r3, [sp, 0x10]\n\ cmp r4, 0\n\ beq _08044834\n\ - bl battle_get_per_side_status\n\ + bl GetBankIdentity\n\ lsls r0, 24\n\ lsrs r0, 24\n\ cmp r0, 0x3\n\ beq _08044878\n\ _08044834:\n\ ldr r0, [sp, 0x8]\n\ - bl battle_side_get_owner\n\ + bl GetBankSide\n\ lsls r0, 24\n\ cmp r0, 0\n\ bne _08044854\n\ @@ -1871,7 +1871,7 @@ _08044A56:\n\ b _08044970\n\ _08044A76:\n\ ldr r0, [sp, 0x8]\n\ - bl battle_side_get_owner\n\ + bl GetBankSide\n\ lsls r0, 24\n\ cmp r0, 0\n\ bne _08044B5E\n\ @@ -2177,7 +2177,7 @@ void sub_8044CA0(u8 taskId) { for (i = 0; i < 6; i++) { - if (battle_side_get_owner(sp8) != 0) + if (GetBankSide(sp8) != 0) { gSprites[sp[5 - i]].data1 = 7 * i; gSprites[sp[5 - i]].data3 = 0; @@ -2375,10 +2375,10 @@ static void sub_80451A0(u8 a, struct Pokemon *pkmn) s32 _7; u8 *const *r1; - StringCopy(gUnknown_020238CC, gUnknown_0820A8B0); + StringCopy(gDisplayedStringBattle, gUnknown_0820A8B0); GetMonData(pkmn, MON_DATA_NICKNAME, nickname); StringGetEnd10(nickname); - ptr = StringCopy(gUnknown_020238CC + 3, nickname); + ptr = StringCopy(gDisplayedStringBattle + 3, nickname); ptr[0] = EXT_CTRL_CODE_BEGIN; ptr[1] = 3; ptr[2] = 2; @@ -2414,15 +2414,15 @@ static void sub_80451A0(u8 a, struct Pokemon *pkmn) ptr[1] = 0x13; ptr[2] = 0x37; ptr[3] = EOS; - ptr = (u8 *)0x02000520 + battle_get_per_side_status(gSprites[a].data6) * 0x180; - sub_80034D4(ptr, gUnknown_020238CC); + ptr = (u8 *)0x02000520 + GetBankIdentity(gSprites[a].data6) * 0x180; + sub_80034D4(ptr, gDisplayedStringBattle); i = 0; _7 = 7; if (GetMonData(pkmn, MON_DATA_LANGUAGE) == 1 && GetMonData(pkmn, MON_DATA_IS_EGG) == 0) { - u8 *p = gUnknown_020238CC; + u8 *p = gDisplayedStringBattle; while (*p != EOS) { @@ -2451,7 +2451,7 @@ static void sub_80451A0(u8 a, struct Pokemon *pkmn) for (; i < _7; i++) CpuCopy32(sub_8043CDC(0x2B), ptr + 64 * i, 32); - if (battle_side_get_owner(gSprites[a].data6) == 0 && !IsDoubleBattle()) + if (GetBankSide(gSprites[a].data6) == 0 && !IsDoubleBattle()) { r1 = (u8 *const *)gUnknown_0820A8B4; for (i = 0; i < _7; i++) @@ -2469,7 +2469,7 @@ static void sub_80451A0(u8 a, struct Pokemon *pkmn) } else { - if (battle_side_get_owner(gSprites[a].data6) == 0) + if (GetBankSide(gSprites[a].data6) == 0) r1 = (u8 *const *)gUnknown_0820A904; else r1 = (u8 *const *)gUnknown_0820A8DC; @@ -2498,9 +2498,9 @@ static void sub_8045458(u8 a, u8 b) return; r4 = gSprites[a].data6; - if (battle_side_get_owner(r4) != 0) + if (GetBankSide(r4) != 0) { - u16 species = GetMonData(&gEnemyParty[gUnknown_02024A6A[r4]], MON_DATA_SPECIES); + u16 species = GetMonData(&gEnemyParty[gBattlePartyID[r4]], MON_DATA_SPECIES); if (GetNationalPokedexFlag(SpeciesToNationalPokedexNum(species), 1) != 0) { r4 = gSprites[a].data5; @@ -2525,9 +2525,9 @@ static void draw_status_ailment_maybe(u8 a) r7 = gSprites[a].data6; r10 = gSprites[a].data5; - if (battle_side_get_owner(r7) == 0) + if (GetBankSide(r7) == 0) { - r4 = GetMonData(&gPlayerParty[gUnknown_02024A6A[r7]], MON_DATA_STATUS); + r4 = GetMonData(&gPlayerParty[gBattlePartyID[r7]], MON_DATA_STATUS); if (!IsDoubleBattle()) r8 = 0x1A; else @@ -2535,7 +2535,7 @@ static void draw_status_ailment_maybe(u8 a) } else { - r4 = GetMonData(&gEnemyParty[gUnknown_02024A6A[r7]], MON_DATA_STATUS); + r4 = GetMonData(&gEnemyParty[gBattlePartyID[r7]], MON_DATA_STATUS); r8 = 0x11; } if (r4 & 7) @@ -2583,7 +2583,7 @@ static void draw_status_ailment_maybe(u8 a) FillPalette(r0[gBattleInterfaceStatusIcons_DynPal], r4_2 + 0x100, 2); CpuCopy16(gPlttBufferUnfaded + 0x100 + r4_2, (void *)(OBJ_PLTT + r4_2 * 2), 2); CpuCopy32(r6, (void *)(OBJ_VRAM0 + (gSprites[a].oam.tileNum + r8) * 32), 96); - if (IsDoubleBattle() == TRUE || battle_side_get_owner(r7) == TRUE) + if (IsDoubleBattle() == TRUE || GetBankSide(r7) == TRUE) { if (!ewram17800[r7].unk0_4) { @@ -2662,7 +2662,7 @@ static void sub_80458B0(u8 a) s32 r7; u8 *addr; - r6 = (u8 *)0x02000520 + battle_get_per_side_status(gSprites[a].data6) * 0x180; + r6 = (u8 *)0x02000520 + GetBankIdentity(gSprites[a].data6) * 0x180; r8 = 7; sub_80034D4(r6, BattleText_SafariBalls); for (i = 0; i < r8; i++) @@ -2687,13 +2687,13 @@ static void sub_8045998(u8 a) s32 r6; s32 i; - r7 = StringCopy(gUnknown_020238CC, BattleText_SafariBallsLeft); + r7 = StringCopy(gDisplayedStringBattle, BattleText_SafariBallsLeft); r7 = sub_8003504(r7, gNumSafariBalls, 10, 1); StringAppend(r7, BattleText_HighlightRed); - status = battle_get_per_side_status(gSprites[a].data6); + status = GetBankIdentity(gSprites[a].data6); r7 = (u8 *)0x02000520 + status * 0x180; r6 = 5; - sub_80034D4(r7, gUnknown_020238CC); + sub_80034D4(r7, gDisplayedStringBattle); r7 = (u8 *)0x02000520 + status * 0x180 + 32; for (i = 6; i < 6 + r6; i++) { @@ -2709,7 +2709,7 @@ void sub_8045A5C(u8 a, struct Pokemon *pkmn, u8 c) u32 currhp; r10 = gSprites[a].data6; - if (battle_side_get_owner(r10) == 0) + if (GetBankSide(r10) == 0) { if (c == 3 || c == 0) sub_8043FC0(a, GetMonData(pkmn, MON_DATA_LEVEL)); @@ -2828,7 +2828,7 @@ static void sub_8045D58(u8 a, u8 b) break; case 1: sub_804602C(ewram17850[a].unk4, ewram17850[a].unk8, ewram17850[a].unkC, &ewram17850[a].unk10, sp8, 8); - r0 = GetMonData(&gPlayerParty[gUnknown_02024A6A[a]], MON_DATA_LEVEL); + r0 = GetMonData(&gPlayerParty[gBattlePartyID[a]], MON_DATA_LEVEL); if (r0 == 100) { for (i = 0; i < 8; i++) diff --git a/src/battle_party_menu.c b/src/battle_party_menu.c index c02290e80..96b68adba 100644 --- a/src/battle_party_menu.c +++ b/src/battle_party_menu.c @@ -44,9 +44,9 @@ struct Unk201B000 extern u16 gScriptItemId; extern u8 gPlayerPartyCount; -extern u8 gUnknown_02024A68; -extern u16 gUnknown_02024A6A[]; -extern u8 gUnknown_02024E6C; +extern u8 gNoOfAllBanks; +extern u16 gBattlePartyID[]; +extern u8 gBankInMenu; extern u8 gUnknown_0202E8F4; extern u8 gUnknown_0202E8F5; extern u8 gUnknown_0202E8F6; @@ -135,7 +135,7 @@ static void sub_8094998(u8 arg[3], u8 player_number) if (!IsDoubleBattle()) { pos = 1; - *temp = gUnknown_02024A6A[battle_get_side_with_given_state(0)]; + *temp = gBattlePartyID[GetBankByPlayerAI(0)]; for (i = 0; i <= 5; i++) if (i != *temp) temp[pos++] = i; @@ -143,8 +143,8 @@ static void sub_8094998(u8 arg[3], u8 player_number) else { pos = 2; - *temp = gUnknown_02024A6A[battle_get_side_with_given_state(0)]; - temp[1] = gUnknown_02024A6A[battle_get_side_with_given_state(2)]; + *temp = gBattlePartyID[GetBankByPlayerAI(0)]; + temp[1] = gBattlePartyID[GetBankByPlayerAI(2)]; for (i = 0; i <= 5; i++) if ((i != *temp) && (i != temp[1])) temp[pos++] = i; @@ -158,15 +158,15 @@ static void sub_8094A74(u8 arg[3], u8 player_number, u32 arg3) { int i, j; u8 temp[6]; - if (!battle_side_get_owner(arg3)) + if (!GetBankSide(arg3)) { - i = battle_get_side_with_given_state(0); - j = battle_get_side_with_given_state(2); + i = GetBankByPlayerAI(0); + j = GetBankByPlayerAI(2); } else { - i = battle_get_side_with_given_state(1); - j = battle_get_side_with_given_state(3); + i = GetBankByPlayerAI(1); + j = GetBankByPlayerAI(3); } if (IsLinkDoubleBattle() == TRUE) { @@ -188,7 +188,7 @@ static void sub_8094A74(u8 arg[3], u8 player_number, u32 arg3) if (!IsDoubleBattle()) { int pos = 1; - *temp = gUnknown_02024A6A[i]; + *temp = gBattlePartyID[i]; for (i = 0; i <= 5; i++) if (i != *temp) temp[pos++] = i; @@ -196,8 +196,8 @@ static void sub_8094A74(u8 arg[3], u8 player_number, u32 arg3) else { int pos = 2; - *temp = gUnknown_02024A6A[i]; - temp[1] = gUnknown_02024A6A[j]; + *temp = gBattlePartyID[i]; + temp[1] = gBattlePartyID[j]; for (i = 0; i <= 5; i++) if ((i != *temp) && (i != temp[1])) temp[pos++] = i; @@ -674,10 +674,10 @@ static void Task_BattlePartyMenuShift(u8 taskId) gTasks[taskId].func = Task_80954C0; return; } - for (i = 0; i < gUnknown_02024A68; i++) + for (i = 0; i < gNoOfAllBanks; i++) { - if (battle_side_get_owner(i) == 0 - && sub_8094C20(partySelection) == gUnknown_02024A6A[i]) + if (GetBankSide(i) == 0 + && sub_8094C20(partySelection) == gBattlePartyID[i]) { sub_806D5A4(); GetMonNickname(&gPlayerParty[partySelection], gStringVar1); @@ -715,10 +715,10 @@ static void Task_BattlePartyMenuShift(u8 taskId) if (gUnknown_02038473 == 2) { u8 r0; - u8 r4 = gUnknown_02024E6C; + u8 r4 = gBankInMenu; sub_806D5A4(); - r0 = pokemon_order_func(gUnknown_02024A6A[r4]); + r0 = pokemon_order_func(gBattlePartyID[r4]); GetMonNickname(&gPlayerParty[r0], gStringVar1); StringExpandPlaceholders(gStringVar4, gOtherText_CantBeSwitched); sub_806E834(gStringVar4, 0); @@ -727,7 +727,7 @@ static void Task_BattlePartyMenuShift(u8 taskId) } gUnknown_0202E8F5 = sub_8094C20(partySelection); gUnknown_0202E8F4 = 1; - r4 = pokemon_order_func(gUnknown_02024A6A[gUnknown_02024E6C]); + r4 = pokemon_order_func(gBattlePartyID[gBankInMenu]); sub_8094C98(r4, partySelection); sub_806E6F0(&gPlayerParty[r4], &gPlayerParty[partySelection]); gTasks[taskId].func = Task_809527C; diff --git a/src/battle_setup.c b/src/battle_setup.c index e4e83dfa1..adcbe8eaa 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -49,7 +49,7 @@ EWRAM_DATA u8 *gTrainerBattleEndScript = NULL; extern u16 gBattleTypeFlags; extern u16 gScriptLastTalked; -extern u8 gUnknown_02024D26; +extern u8 gBattleOutcome; extern struct MapObject gMapObjects[]; @@ -574,7 +574,7 @@ void HandleWildBattleEnd(void) CpuFill16(0, (void *)BG_PLTT, BG_PLTT_SIZE); ResetOamRange(0, 128); - if (battle_exit_is_player_defeat(gUnknown_02024D26) == TRUE) + if (battle_exit_is_player_defeat(gBattleOutcome) == TRUE) { SetMainCallback2(CB2_WhiteOut); } @@ -590,7 +590,7 @@ void HandleScriptedWildBattleEnd(void) CpuFill16(0, (void *)BG_PLTT, BG_PLTT_SIZE); ResetOamRange(0, 128); - if (battle_exit_is_player_defeat(gUnknown_02024D26) == TRUE) + if (battle_exit_is_player_defeat(gBattleOutcome) == TRUE) SetMainCallback2(CB2_WhiteOut); else SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music); @@ -1051,7 +1051,7 @@ void sub_808260C(void) { SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music); // link battle? } - else if (battle_exit_is_player_defeat(gUnknown_02024D26) == TRUE) + else if (battle_exit_is_player_defeat(gBattleOutcome) == TRUE) { SetMainCallback2(CB2_WhiteOut); } @@ -1068,7 +1068,7 @@ void do_choose_name_or_words_screen(void) { SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music); // link battle? } - else if (battle_exit_is_player_defeat(gUnknown_02024D26) == TRUE) + else if (battle_exit_is_player_defeat(gBattleOutcome) == TRUE) { SetMainCallback2(CB2_WhiteOut); } diff --git a/src/calculate_base_damage.c b/src/calculate_base_damage.c index f3799ab66..ae60e30fe 100644 --- a/src/calculate_base_damage.c +++ b/src/calculate_base_damage.c @@ -23,8 +23,8 @@ extern struct SecretBaseRecord gSecretBaseRecord; extern u32 dword_2017100[]; extern u16 gBattleTypeFlags; extern struct BattlePokemon gBattleMons[4]; -extern u16 gUnknown_02024BE6; -extern u8 byte_2024C06; +extern u16 gCurrentMove; +extern u8 gLastUsedAbility; extern u8 gCritMultiplier; extern u16 gBattleWeather; extern struct BattleEnigmaBerry gEnigmaBerries[]; @@ -103,7 +103,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de if ((gBattleTypeFlags & BATTLE_TYPE_TRAINER) && gTrainerBattleOpponent != 1024 && FlagGet(BADGE01_GET) - && !battle_side_get_owner(a7)) + && !GetBankSide(a7)) attack = (110 * attack) / 100; if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_EREADER_TRAINER))) @@ -111,7 +111,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de if ((gBattleTypeFlags & BATTLE_TYPE_TRAINER) && gTrainerBattleOpponent != 1024 && FlagGet(BADGE05_GET) - && !battle_side_get_owner(a8)) + && !GetBankSide(a8)) defense = (110 * defense) / 100; if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_EREADER_TRAINER))) @@ -119,7 +119,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de if ((gBattleTypeFlags & BATTLE_TYPE_TRAINER) && gTrainerBattleOpponent != 1024 && FlagGet(BADGE07_GET) - && !battle_side_get_owner(a7)) + && !GetBankSide(a7)) spAttack = (110 * spAttack) / 100; if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_EREADER_TRAINER))) @@ -127,7 +127,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de if ((gBattleTypeFlags & BATTLE_TYPE_TRAINER) && gTrainerBattleOpponent != 1024 && FlagGet(BADGE07_GET) - && !battle_side_get_owner(a8)) + && !GetBankSide(a8)) spDefense = (110 * spDefense) / 100; } } @@ -167,17 +167,17 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de spAttack /= 2; if (attacker->ability == ABILITY_HUSTLE) attack = (150 * attack) / 100; - if (attacker->ability == ABILITY_PLUS && sub_8018324(0xE, 0, ABILITY_MINUS, 0, 0)) + if (attacker->ability == ABILITY_PLUS && AbilityBattleEffects(0xE, 0, ABILITY_MINUS, 0, 0)) spAttack = (150 * spAttack) / 100; - if (attacker->ability == ABILITY_MINUS && sub_8018324(0xE, 0, ABILITY_PLUS, 0, 0)) + if (attacker->ability == ABILITY_MINUS && AbilityBattleEffects(0xE, 0, ABILITY_PLUS, 0, 0)) spAttack = (150 * spAttack) / 100; if (attacker->ability == ABILITY_GUTS && attacker->status1) attack = (150 * attack) / 100; if (defender->ability == ABILITY_MARVEL_SCALE && defender->status1) defense = (150 * defense) / 100; - if (type == TYPE_ELECTRIC && sub_8018324(0xE, 0, 0, 0xFD, 0)) + if (type == TYPE_ELECTRIC && AbilityBattleEffects(0xE, 0, 0, 0xFD, 0)) gBattleMovePower /= 2; - if (type == TYPE_FIRE && sub_8018324(0xE, 0, 0, 0xFE, 0)) + if (type == TYPE_FIRE && AbilityBattleEffects(0xE, 0, 0, 0xFE, 0)) gBattleMovePower /= 2; if (type == TYPE_GRASS && attacker->ability == ABILITY_OVERGROW && attacker->hp <= (attacker->maxHP / 3)) gBattleMovePower = (150 * gBattleMovePower) / 100; @@ -187,7 +187,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de gBattleMovePower = (150 * gBattleMovePower) / 100; if (type == TYPE_BUG && attacker->ability == ABILITY_SWARM && attacker->hp <= (attacker->maxHP / 3)) gBattleMovePower = (150 * gBattleMovePower) / 100; - if (gBattleMoves[gUnknown_02024BE6].effect == 7) + if (gBattleMoves[gCurrentMove].effect == 7) defense /= 2; if (type < TYPE_MYSTERY) // is physical? @@ -221,13 +221,13 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de if ((a4 & 1) && gCritMultiplier == 1) { - if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && sub_803C348(2) == 2) + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && CountAliveMons(2) == 2) damage = 2 * (damage / 3); else damage /= 2; } - if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && gBattleMoves[move].target == 8 && sub_803C348(2) == 2) + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && gBattleMoves[move].target == 8 && CountAliveMons(2) == 2) damage /= 2; // moves always do at least 1 damage. @@ -266,17 +266,17 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de if ((a4 & 2) && gCritMultiplier == 1) { - if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && sub_803C348(2) == 2) + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && CountAliveMons(2) == 2) damage = 2 * (damage / 3); else damage /= 2; } - if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && gBattleMoves[move].target == 8 && sub_803C348(2) == 2) + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && gBattleMoves[move].target == 8 && CountAliveMons(2) == 2) damage /= 2; // are effects of weather negated with cloud nine or air lock? - if (!sub_8018324(0xE, 0, ABILITY_CLOUD_NINE, 0, 0) && !sub_8018324(0xE, 0, ABILITY_AIR_LOCK, 0, 0)) + if (!AbilityBattleEffects(0xE, 0, ABILITY_CLOUD_NINE, 0, 0) && !AbilityBattleEffects(0xE, 0, ABILITY_AIR_LOCK, 0, 0)) { // rain? if (gBattleWeather & 1) @@ -288,7 +288,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de } // does lack of sun half solar beam damage? - if ((gBattleWeather & 0x9F) && gUnknown_02024BE6 == 76) + if ((gBattleWeather & 0x9F) && gCurrentMove == 76) damage /= 2; // sunny? @@ -485,7 +485,7 @@ _0803BB5E:\n\ cmp r0, 0\n\ beq _0803BB98\n\ ldr r0, [sp, 0x10]\n\ - bl battle_side_get_owner\n\ + bl GetBankSide\n\ lsls r0, 24\n\ cmp r0, 0\n\ bne _0803BB98\n\ @@ -518,7 +518,7 @@ _0803BB98:\n\ cmp r0, 0\n\ beq _0803BBE2\n\ adds r0, r4, 0\n\ - bl battle_side_get_owner\n\ + bl GetBankSide\n\ lsls r0, 24\n\ cmp r0, 0\n\ bne _0803BBE2\n\ @@ -553,7 +553,7 @@ _0803BBE2:\n\ cmp r0, 0\n\ beq _0803BC2E\n\ ldr r0, [sp, 0x10]\n\ - bl battle_side_get_owner\n\ + bl GetBankSide\n\ lsls r0, 24\n\ cmp r0, 0\n\ bne _0803BC2E\n\ @@ -589,7 +589,7 @@ _0803BC2E:\n\ cmp r0, 0\n\ beq _0803BC78\n\ adds r0, r4, 0\n\ - bl battle_side_get_owner\n\ + bl GetBankSide\n\ lsls r0, 24\n\ cmp r0, 0\n\ bne _0803BC78\n\ @@ -807,7 +807,7 @@ _0803BDFC:\n\ movs r1, 0\n\ movs r2, 0x3A\n\ movs r3, 0\n\ - bl sub_8018324\n\ + bl AbilityBattleEffects\n\ lsls r0, 24\n\ cmp r0, 0\n\ beq _0803BE2A\n\ @@ -831,7 +831,7 @@ _0803BE2A:\n\ movs r1, 0\n\ movs r2, 0x39\n\ movs r3, 0\n\ - bl sub_8018324\n\ + bl AbilityBattleEffects\n\ lsls r0, 24\n\ cmp r0, 0\n\ beq _0803BE5C\n\ @@ -885,7 +885,7 @@ _0803BE9A:\n\ movs r1, 0\n\ movs r2, 0\n\ movs r3, 0xFD\n\ - bl sub_8018324\n\ + bl AbilityBattleEffects\n\ lsls r0, 24\n\ cmp r0, 0\n\ beq _0803BEBE\n\ @@ -903,7 +903,7 @@ _0803BEBE:\n\ movs r1, 0\n\ movs r2, 0\n\ movs r3, 0xFE\n\ - bl sub_8018324\n\ + bl AbilityBattleEffects\n\ lsls r0, 24\n\ cmp r0, 0\n\ beq _0803BEE2\n\ @@ -1005,7 +1005,7 @@ _0803BF72:\n\ strh r0, [r4]\n\ _0803BFA2:\n\ ldr r2, _0803BFEC @ =gBattleMoves\n\ - ldr r0, _0803BFF0 @ =gUnknown_02024BE6\n\ + ldr r0, _0803BFF0 @ =gCurrentMove\n\ ldrh r1, [r0]\n\ lsls r0, r1, 1\n\ adds r0, r1\n\ @@ -1040,7 +1040,7 @@ _0803BFE0: .4byte 0xfffffe69\n\ _0803BFE4: .4byte 0x00000175\n\ _0803BFE8: .4byte gBattleMovePower\n\ _0803BFEC: .4byte gBattleMoves\n\ -_0803BFF0: .4byte gUnknown_02024BE6\n\ +_0803BFF0: .4byte gCurrentMove\n\ _0803BFF4: .4byte gCritMultiplier\n\ _0803BFF8: .4byte gStatStageRatios\n\ _0803BFFC:\n\ @@ -1146,7 +1146,7 @@ _0803C0A8:\n\ cmp r1, 0\n\ beq _0803C0E4\n\ movs r0, 0x2\n\ - bl sub_803C348\n\ + bl CountAliveMons\n\ lsls r0, 24\n\ lsrs r0, 24\n\ cmp r0, 0x2\n\ @@ -1180,7 +1180,7 @@ _0803C0EA:\n\ cmp r0, 0x8\n\ bne _0803C11C\n\ movs r0, 0x2\n\ - bl sub_803C348\n\ + bl CountAliveMons\n\ lsls r0, 24\n\ lsrs r0, 24\n\ cmp r0, 0x2\n\ @@ -1306,7 +1306,7 @@ _0803C1D6:\n\ cmp r1, 0\n\ beq _0803C224\n\ movs r0, 0x2\n\ - bl sub_803C348\n\ + bl CountAliveMons\n\ lsls r0, 24\n\ lsrs r0, 24\n\ cmp r0, 0x2\n\ @@ -1340,7 +1340,7 @@ _0803C22A:\n\ cmp r0, 0x8\n\ bne _0803C25C\n\ movs r0, 0x2\n\ - bl sub_803C348\n\ + bl CountAliveMons\n\ lsls r0, 24\n\ lsrs r0, 24\n\ cmp r0, 0x2\n\ @@ -1355,7 +1355,7 @@ _0803C25C:\n\ movs r1, 0\n\ movs r2, 0xD\n\ movs r3, 0\n\ - bl sub_8018324\n\ + bl AbilityBattleEffects\n\ lsls r0, 24\n\ lsrs r0, 24\n\ cmp r0, 0\n\ @@ -1365,7 +1365,7 @@ _0803C25C:\n\ movs r1, 0\n\ movs r2, 0x4D\n\ movs r3, 0\n\ - bl sub_8018324\n\ + bl AbilityBattleEffects\n\ lsls r0, 24\n\ cmp r0, 0\n\ bne _0803C30C\n\ @@ -1403,7 +1403,7 @@ _0803C2C4:\n\ ands r0, r1\n\ cmp r0, 0\n\ beq _0803C2DC\n\ - ldr r0, _0803C2F4 @ =gUnknown_02024BE6\n\ + ldr r0, _0803C2F4 @ =gCurrentMove\n\ ldrh r0, [r0]\n\ cmp r0, 0x4C\n\ bne _0803C2DC\n\ @@ -1423,7 +1423,7 @@ _0803C2DC:\n\ beq _0803C306\n\ b _0803C30C\n\ .align 2, 0\n\ -_0803C2F4: .4byte gUnknown_02024BE6\n\ +_0803C2F4: .4byte gCurrentMove\n\ _0803C2F8:\n\ lsls r0, r5, 4\n\ subs r0, r5\n\ diff --git a/src/item_use.c b/src/item_use.c index 269c847a5..a92161e9a 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -43,12 +43,12 @@ extern void (* gUnknown_03004AE4)(u8, u16, TaskFunc); extern u8 gUnknown_02038561; extern u8 gLastFieldPokeMenuOpened; -extern u8 gUnknown_02024E6C; +extern u8 gBankInMenu; extern u8 gUnknown_081A1654[]; extern u8 gUnknown_081A168F[]; -extern u16 gUnknown_02024A6A[]; +extern u16 gBattlePartyID[]; extern u16 gScriptItemId; extern u16 gBattleTypeFlags; @@ -1043,7 +1043,7 @@ void sub_80CA2BC(u8 taskId) void ItemUseInBattle_StatIncrease(u8 taskId) { - u16 partyId = gUnknown_02024A6A[gUnknown_02024E6C]; + u16 partyId = gBattlePartyID[gBankInMenu]; MenuZeroFillWindowRect(0, 0xD, 0xD, 0x14); diff --git a/src/pokemon_2.c b/src/pokemon_2.c index 91cd77f86..5acdae4d3 100644 --- a/src/pokemon_2.c +++ b/src/pokemon_2.c @@ -20,13 +20,13 @@ extern u16 unk_20160BC[]; extern struct SecretBaseRecord gSecretBaseRecord; extern u32 dword_2017100[]; extern u16 gBattleTypeFlags; -extern u8 gUnknown_02024A60; +extern u8 gActiveBank; extern struct BattlePokemon gBattleMons[4]; -extern u16 gUnknown_02024BE6; -extern u8 byte_2024C06; -extern u8 gPlayerMonIndex; -extern u8 gEnemyMonIndex; -extern u8 gUnknown_02024C0C; +extern u16 gCurrentMove; +extern u8 gLastUsedAbility; +extern u8 gBankAttacker; +extern u8 gBankTarget; +extern u8 gAbsentBankFlags; extern u8 gXXX_CritRelated; extern u16 gBattleWeather; extern struct BattleEnigmaBerry gEnigmaBerries[]; @@ -41,7 +41,7 @@ extern const struct SpriteTemplate gSpriteTemplate_8208288[]; extern u8 gSecretBaseTrainerClasses[]; extern u8 gHoldEffectToType[][2]; -u8 sub_803C348(u8 a1) +u8 CountAliveMons(u8 a1) { s32 i; u8 retVal = 0; @@ -51,21 +51,21 @@ u8 sub_803C348(u8 a1) case 0: for (i = 0; i < 4; i++) { - if (i != gUnknown_02024A60 && !(gUnknown_02024C0C & gBitTable[i])) + if (i != gActiveBank && !(gAbsentBankFlags & gBitTable[i])) retVal++; } break; case 1: for (i = 0; i < 4; i++) { - if (battle_side_get_owner(i) == battle_side_get_owner(gPlayerMonIndex) && !(gUnknown_02024C0C & gBitTable[i])) + if (GetBankSide(i) == GetBankSide(gBankAttacker) && !(gAbsentBankFlags & gBitTable[i])) retVal++; } break; case 2: for (i = 0; i < 4; i++) { - if (battle_side_get_owner(i) == battle_side_get_owner(gEnemyMonIndex) && !(gUnknown_02024C0C & gBitTable[i])) + if (GetBankSide(i) == GetBankSide(gBankTarget) && !(gAbsentBankFlags & gBitTable[i])) retVal++; } break; @@ -77,7 +77,7 @@ u8 sub_803C348(u8 a1) #ifdef NONMATCHING u8 sub_803C434(u8 a1) { - u32 status0 = battle_get_per_side_status(a1); + u32 status0 = GetBankIdentity(a1); register u8 status_ asm("r4"); u8 status; register u32 mask1 asm("r1") = 1; @@ -93,11 +93,11 @@ u8 sub_803C434(u8 a1) val &= val_; if (!val) { - return battle_get_side_with_given_state(status); + return GetBankByPlayerAI(status); } } - if (sub_803C348(0) > 1) + if (CountAliveMons(0) > 1) { u16 r = Random(); register u32 val asm("r1") = mask2; @@ -106,19 +106,19 @@ u8 sub_803C434(u8 a1) { u32 status2 = 2; status2 ^= status; - return battle_get_side_with_given_state(status2); + return GetBankByPlayerAI(status2); } else { - return battle_get_side_with_given_state(status); + return GetBankByPlayerAI(status); } } else { - if (gUnknown_02024C0C & gBitTable[status]) - return battle_get_side_with_given_state(status ^ 2); + if (gAbsentBankFlags & gBitTable[status]) + return GetBankByPlayerAI(status ^ 2); else - return battle_get_side_with_given_state(status); + return GetBankByPlayerAI(status); } } #else @@ -129,7 +129,7 @@ u8 sub_803C434(u8 a1) push {r4-r6,lr}\n\ lsls r0, 24\n\ lsrs r0, 24\n\ - bl battle_get_per_side_status\n\ + bl GetBankIdentity\n\ movs r1, 0x1\n\ movs r6, 0x1\n\ adds r4, r6, 0\n\ @@ -148,7 +148,7 @@ u8 sub_803C434(u8 a1) _0803C45C: .4byte gBattleTypeFlags\n\ _0803C460:\n\ movs r0, 0\n\ - bl sub_803C348\n\ + bl CountAliveMons\n\ lsls r0, 24\n\ lsrs r0, 24\n\ cmp r0, 0x1\n\ @@ -177,14 +177,14 @@ _0803C484:\n\ adds r0, r4, 0\n\ b _0803C4AA\n\ .align 2, 0\n\ -_0803C49C: .4byte gUnknown_02024C0C\n\ +_0803C49C: .4byte gAbsentBankFlags\n\ _0803C4A0: .4byte gBitTable\n\ _0803C4A4:\n\ movs r0, 0x2\n\ eors r5, r0\n\ adds r0, r5, 0\n\ _0803C4AA:\n\ - bl battle_get_side_with_given_state\n\ + bl GetBankByPlayerAI\n\ lsls r0, 24\n\ lsrs r0, 24\n\ pop {r4-r6}\n\ @@ -1131,11 +1131,11 @@ u8 sub_803DAA0(void) u8 GetAbilityBySpecies(u16 species, bool8 altAbility) { if (altAbility) - byte_2024C06 = gBaseStats[species].ability2; + gLastUsedAbility = gBaseStats[species].ability2; else - byte_2024C06 = gBaseStats[species].ability1; + gLastUsedAbility = gBaseStats[species].ability1; - return byte_2024C06; + return gLastUsedAbility; } u8 GetMonAbility(struct Pokemon *mon) @@ -1295,7 +1295,7 @@ void CopyPlayerPartyMonToBattleData(u8 battleIndex, u8 partyIndex) GetMonData(&gPlayerParty[partyIndex], MON_DATA_NICKNAME, nickname); StringCopy10(gBattleMons[battleIndex].nickname, nickname); GetMonData(&gPlayerParty[partyIndex], MON_DATA_OT_NAME, gBattleMons[battleIndex].otName); - *(unk_20160BC + battle_side_get_owner(battleIndex)) = gBattleMons[battleIndex].hp; + *(unk_20160BC + GetBankSide(battleIndex)) = gBattleMons[battleIndex].hp; for (i = 0; i < 8; i++) gBattleMons[battleIndex].statStages[i] = 6; diff --git a/src/pokemon_3.c b/src/pokemon_3.c index 9e69a3850..ef9a1698d 100644 --- a/src/pokemon_3.c +++ b/src/pokemon_3.c @@ -48,19 +48,19 @@ struct SpindaSpot extern u8 gPlayerPartyCount; extern u8 gEnemyPartyCount; extern struct BattlePokemon gBattleMons[4]; -extern u8 gUnknown_02024A60; +extern u8 gActiveBank; extern struct BattleEnigmaBerry gEnigmaBerries[]; extern u16 gSpeciesToHoennPokedexNum[]; extern u16 gSpeciesToNationalPokedexNum[]; extern u16 gHoennToNationalOrder[]; extern u16 gSpeciesIdToCryId[]; -extern u8 gUnknown_030041C0[]; -extern u8 gUnknown_03004290[]; -extern u8 gUnknown_020238CC[]; -extern u8 gPlayerMonIndex; -extern u8 gEnemyMonIndex; -extern u8 gUnknown_02024C0B; -extern u8 gUnknown_02024E6C; +extern u8 gBattleTextBuff1[]; +extern u8 gBattleTextBuff2[]; +extern u8 gDisplayedStringBattle[]; +extern u8 gBankAttacker; +extern u8 gBankTarget; +extern u8 gStringBank; +extern u8 gBankInMenu; extern struct SpindaSpot gSpindaSpotGraphics[]; extern s8 gNatureStatTable[][5]; extern s8 gUnknown_082082FE[][3]; @@ -71,9 +71,9 @@ extern u8 gBattleMonForms[]; extern const u8 BattleText_Wally[]; extern const u16 gHMMoves[]; extern s8 gUnknown_083F7E28[]; -extern u8 byte_2024C06; +extern u8 gLastUsedAbility; extern const u8 BattleText_PreventedSwitch[]; -extern u16 gUnknown_02024A6A[]; +extern u16 gBattlePartyID[]; extern u8 gJapaneseNidoranNames[][11]; extern u8 gUnknown_082082F8[]; @@ -119,7 +119,7 @@ u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit) if (itemId == ITEM_ENIGMA_BERRY) { - temp = gEnigmaBerries[gUnknown_02024A60].itemEffect; + temp = gEnigmaBerries[gActiveBank].itemEffect; } itemEffect = temp; @@ -216,10 +216,10 @@ u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit) void sub_803F324(int stat) { - gEnemyMonIndex = gUnknown_02024E6C; - StringCopy(gUnknown_030041C0, gUnknown_08400F58[gUnknown_082082F8[stat]]); - StringCopy(gUnknown_03004290, gUnknown_083FFDB3); - get_battle_strings_(gUnknown_083FFDD3); + gBankTarget = gBankInMenu; + StringCopy(gBattleTextBuff1, gUnknown_08400F58[gUnknown_082082F8[stat]]); + StringCopy(gBattleTextBuff2, gUnknown_083FFDB3); + StrCpyDecodeToDisplayedStringBattle(gUnknown_083FFDD3); } u8 *sub_803F378(u16 itemId) @@ -231,7 +231,7 @@ u8 *sub_803F378(u16 itemId) { if (gMain.inBattle) { - itemEffect = gEnigmaBerries[gUnknown_02024E6C].itemEffect; + itemEffect = gEnigmaBerries[gBankInMenu].itemEffect; } else { @@ -243,7 +243,7 @@ u8 *sub_803F378(u16 itemId) itemEffect = (u8 *) gItemEffectTable[itemId - 13]; } - gUnknown_02024C0B = gUnknown_02024E6C; + gStringBank = gBankInMenu; for (i = 0; i < 3; i++) { @@ -257,19 +257,19 @@ u8 *sub_803F378(u16 itemId) } else { - gPlayerMonIndex = gUnknown_02024E6C; - get_battle_strings_(gUnknown_083FEE92); + gBankAttacker = gBankInMenu; + StrCpyDecodeToDisplayedStringBattle(gUnknown_083FEE92); } } } if (itemEffect[3] & 0x80) { - gPlayerMonIndex = gUnknown_02024E6C; - get_battle_strings_(gUnknown_083FEE5D); + gBankAttacker = gBankInMenu; + StrCpyDecodeToDisplayedStringBattle(gUnknown_083FEE5D); } - return gUnknown_020238CC; + return gDisplayedStringBattle; } u8 GetNature(struct Pokemon *mon) @@ -1296,21 +1296,21 @@ void BoxMonRestorePP(struct BoxPokemon *boxMon) void sub_8040B8C(void) { - byte_2024C06 = BATTLE_STRUCT->filler1_2[0x37]; - gUnknown_030041C0[0] = 0xFD; - gUnknown_030041C0[1] = 4; - gUnknown_030041C0[2] = BATTLE_STRUCT->filler1[0x34]; - gUnknown_030041C0[4] = EOS; - if (!battle_side_get_owner(BATTLE_STRUCT->filler1[0x34])) - gUnknown_030041C0[3] = pokemon_order_func(gUnknown_02024A6A[BATTLE_STRUCT->filler1[0x34]]); + gLastUsedAbility = BATTLE_STRUCT->filler1_2[0x37]; + gBattleTextBuff1[0] = 0xFD; + gBattleTextBuff1[1] = 4; + gBattleTextBuff1[2] = BATTLE_STRUCT->filler1[0x34]; + gBattleTextBuff1[4] = EOS; + if (!GetBankSide(BATTLE_STRUCT->filler1[0x34])) + gBattleTextBuff1[3] = pokemon_order_func(gBattlePartyID[BATTLE_STRUCT->filler1[0x34]]); else - gUnknown_030041C0[3] = gUnknown_02024A6A[BATTLE_STRUCT->filler1[0x34]]; - gUnknown_03004290[0] = 0xFD; - gUnknown_03004290[1] = 4; - gUnknown_03004290[2] = gUnknown_02024E6C; - gUnknown_03004290[3] = pokemon_order_func(gUnknown_02024A6A[gUnknown_02024E6C]); - gUnknown_03004290[4] = EOS; - sub_8120FFC(BattleText_PreventedSwitch, gStringVar4); + gBattleTextBuff1[3] = gBattlePartyID[BATTLE_STRUCT->filler1[0x34]]; + gBattleTextBuff2[0] = 0xFD; + gBattleTextBuff2[1] = 4; + gBattleTextBuff2[2] = gBankInMenu; + gBattleTextBuff2[3] = pokemon_order_func(gBattlePartyID[gBankInMenu]); + gBattleTextBuff2[4] = EOS; + StrCpyDecodeBattle(BattleText_PreventedSwitch, gStringVar4); } void SetWildMonHeldItem(void) diff --git a/src/rom3.c b/src/rom3.c index 93f0f0356..9d8d39f91 100644 --- a/src/rom3.c +++ b/src/rom3.c @@ -28,33 +28,33 @@ extern u8 gUnknown_020238C4; extern u8 gUnknown_020238C5; extern u8 gUnknown_020238C6; extern u32 gUnknown_020239FC; -extern u8 gUnknown_02023A60[][0x200]; -extern u8 gUnknown_02024260[][0x200]; -extern u8 gUnknown_02024A60; -extern u32 gUnknown_02024A64; -extern u8 gUnknown_02024A68; -extern u16 gUnknown_02024A6A[]; -extern u8 gUnknown_02024A72[]; -extern u16 gUnknown_02024BE6; +extern u8 gBattleBufferA[][0x200]; +extern u8 gBattleBufferB[][0x200]; +extern u8 gActiveBank; +extern u32 gBattleExecBuffer; +extern u8 gNoOfAllBanks; +extern u16 gBattlePartyID[]; +extern u8 gBanksBySide[]; +extern u16 gCurrentMove; extern u16 gUnknown_02024BE8; -extern u16 gUnknown_02024C04; -extern u8 byte_2024C06; -extern u8 gPlayerMonIndex; -extern u8 gEnemyMonIndex; -extern u8 gUnknown_02024C0A; -extern u8 gUnknown_02024C0B; -extern u8 gUnknown_02024C0C; -extern u8 gUnknown_02024C0E; +extern u16 gLastUsedItem; +extern u8 gLastUsedAbility; +extern u8 gBankAttacker; +extern u8 gBankTarget; +extern u8 gEffectBank; +extern u8 gStringBank; +extern u8 gAbsentBankFlags; +extern u8 gMultiHitCounter; extern u8 gUnknown_02024C78; -extern u8 gUnknown_02024D26; -extern u8 gUnknown_02024E60[]; -extern u8 gUnknown_02024E64[]; -extern u8 gUnknown_03004040[]; -extern u8 gUnknown_030041C0[]; -extern u8 gUnknown_03004290[]; -extern u8 gUnknown_030042B0[]; -extern void (*gUnknown_030042D4)(void); -extern void (*gUnknown_03004330[])(void); +extern u8 gBattleOutcome; +extern u8 gActionSelectionCursor[]; +extern u8 gMoveSelectionCursor[]; +extern u8 gBattleBuffersTransferData[]; +extern u8 gBattleTextBuff1[]; +extern u8 gBattleTextBuff2[]; +extern u8 gBattleTextBuff3[]; +extern void (*gBattleMainFunc)(void); +extern void (*gBattleBankFunc[])(void); void sub_800B858(void) { @@ -70,16 +70,16 @@ void setup_poochyena_battle(void) { s32 i; - gUnknown_030042D4 = nullsub_41; + gBattleMainFunc = nullsub_41; for (i = 0; i < 4; i++) { - gUnknown_03004330[i] = nullsub_91; - gUnknown_02024A72[i] = 0xFF; - gUnknown_02024E60[i] = 0; - gUnknown_02024E64[i] = 0; + gBattleBankFunc[i] = nullsub_91; + gBanksBySide[i] = 0xFF; + gActionSelectionCursor[i] = 0; + gMoveSelectionCursor[i] = 0; } sub_800B858(); - gUnknown_02024A64 = 0; + gBattleExecBuffer = 0; battle_anim_clear_some_data(); ClearBattleMonForms(); BattleAI_HandleItemUseBeforeAISetup(); @@ -105,7 +105,7 @@ void sub_800B950(void) sub_800BD54(); if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI)) { - for (i = 0; i < gUnknown_02024A68; i++) + for (i = 0; i < gNoOfAllBanks; i++) sub_8094978(i, 0); } } @@ -114,30 +114,30 @@ void sub_800B9A8(void) { if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) { - gUnknown_030042D4 = sub_8010800; + gBattleMainFunc = sub_8010800; if (gBattleTypeFlags & BATTLE_TYPE_SAFARI) - gUnknown_03004330[0] = sub_812B468; + gBattleBankFunc[0] = SetBankFuncToSafariBufferRunCommand; else if (gBattleTypeFlags & BATTLE_TYPE_WALLY_TUTORIAL) - gUnknown_03004330[0] = sub_8137224; + gBattleBankFunc[0] = SetBankFuncToWallyBufferRunCommand; else - gUnknown_03004330[0] = sub_802BF74; - gUnknown_02024A72[0] = 0; - gUnknown_03004330[1] = sub_8032AE0; - gUnknown_02024A72[1] = 1; - gUnknown_02024A68 = 2; + gBattleBankFunc[0] = SetBankFuncToPlayerBufferRunCommand; + gBanksBySide[0] = 0; + gBattleBankFunc[1] = SetBankFuncToOpponentBufferRunCommand; + gBanksBySide[1] = 1; + gNoOfAllBanks = 2; } else { - gUnknown_030042D4 = sub_8010800; - gUnknown_03004330[0] = sub_802BF74; - gUnknown_02024A72[0] = 0; - gUnknown_03004330[1] = sub_8032AE0; - gUnknown_02024A72[1] = 1; - gUnknown_03004330[2] = sub_802BF74; - gUnknown_02024A72[2] = 2; - gUnknown_03004330[3] = sub_8032AE0; - gUnknown_02024A72[3] = 3; - gUnknown_02024A68 = 4; + gBattleMainFunc = sub_8010800; + gBattleBankFunc[0] = SetBankFuncToPlayerBufferRunCommand; + gBanksBySide[0] = 0; + gBattleBankFunc[1] = SetBankFuncToOpponentBufferRunCommand; + gBanksBySide[1] = 1; + gBattleBankFunc[2] = SetBankFuncToPlayerBufferRunCommand; + gBanksBySide[2] = 2; + gBattleBankFunc[3] = SetBankFuncToOpponentBufferRunCommand; + gBanksBySide[3] = 3; + gNoOfAllBanks = 4; } } @@ -150,20 +150,20 @@ void sub_800BA78(void) { if (gBattleTypeFlags & BATTLE_TYPE_WILD) { - gUnknown_030042D4 = sub_8010800; - gUnknown_03004330[0] = sub_802BF74; - gUnknown_02024A72[0] = 0; - gUnknown_03004330[1] = sub_8037510; - gUnknown_02024A72[1] = 1; - gUnknown_02024A68 = 2; + gBattleMainFunc = sub_8010800; + gBattleBankFunc[0] = SetBankFuncToPlayerBufferRunCommand; + gBanksBySide[0] = 0; + gBattleBankFunc[1] = SetBankFuncToLinkOpponentBufferRunCommand; + gBanksBySide[1] = 1; + gNoOfAllBanks = 2; } else { - gUnknown_03004330[1] = sub_802BF74; - gUnknown_02024A72[1] = 0; - gUnknown_03004330[0] = sub_8037510; - gUnknown_02024A72[0] = 1; - gUnknown_02024A68 = 2; + gBattleBankFunc[1] = SetBankFuncToPlayerBufferRunCommand; + gBanksBySide[1] = 0; + gBattleBankFunc[0] = SetBankFuncToLinkOpponentBufferRunCommand; + gBanksBySide[0] = 1; + gNoOfAllBanks = 2; } return; } @@ -171,35 +171,35 @@ void sub_800BA78(void) { if (gBattleTypeFlags & BATTLE_TYPE_WILD) { - gUnknown_030042D4 = sub_8010800; - gUnknown_03004330[0] = sub_802BF74; - gUnknown_02024A72[0] = 0; - gUnknown_03004330[1] = sub_8037510; - gUnknown_02024A72[1] = 1; - gUnknown_03004330[2] = sub_802BF74; - gUnknown_02024A72[2] = 2; - gUnknown_03004330[3] = sub_8037510; - gUnknown_02024A72[3] = 3; - gUnknown_02024A68 = 4; + gBattleMainFunc = sub_8010800; + gBattleBankFunc[0] = SetBankFuncToPlayerBufferRunCommand; + gBanksBySide[0] = 0; + gBattleBankFunc[1] = SetBankFuncToLinkOpponentBufferRunCommand; + gBanksBySide[1] = 1; + gBattleBankFunc[2] = SetBankFuncToPlayerBufferRunCommand; + gBanksBySide[2] = 2; + gBattleBankFunc[3] = SetBankFuncToLinkOpponentBufferRunCommand; + gBanksBySide[3] = 3; + gNoOfAllBanks = 4; } else { - gUnknown_03004330[1] = sub_802BF74; - gUnknown_02024A72[1] = 0; - gUnknown_03004330[0] = sub_8037510; - gUnknown_02024A72[0] = 1; - gUnknown_03004330[3] = sub_802BF74; - gUnknown_02024A72[3] = 2; - gUnknown_03004330[2] = sub_8037510; - gUnknown_02024A72[2] = 3; - gUnknown_02024A68 = 4; + gBattleBankFunc[1] = SetBankFuncToPlayerBufferRunCommand; + gBanksBySide[1] = 0; + gBattleBankFunc[0] = SetBankFuncToLinkOpponentBufferRunCommand; + gBanksBySide[0] = 1; + gBattleBankFunc[3] = SetBankFuncToPlayerBufferRunCommand; + gBanksBySide[3] = 2; + gBattleBankFunc[2] = SetBankFuncToLinkOpponentBufferRunCommand; + gBanksBySide[2] = 3; + gNoOfAllBanks = 4; } return; } multiplayerId = GetMultiplayerId(); if (gBattleTypeFlags & BATTLE_TYPE_WILD) - gUnknown_030042D4 = sub_8010800; + gBattleMainFunc = sub_8010800; for (i = 0; i < 4; i++) { switch (gLinkPlayers[i].lp_field_18) @@ -216,18 +216,18 @@ void sub_800BA78(void) if (i == multiplayerId) { - gUnknown_03004330[gLinkPlayers[i].lp_field_18] = sub_802BF74; + gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetBankFuncToPlayerBufferRunCommand; switch (gLinkPlayers[i].lp_field_18) { case 0: case 3: - gUnknown_02024A72[gLinkPlayers[i].lp_field_18] = 0; - gUnknown_02024A6A[gLinkPlayers[i].lp_field_18] = 0; + gBanksBySide[gLinkPlayers[i].lp_field_18] = 0; + gBattlePartyID[gLinkPlayers[i].lp_field_18] = 0; break; case 1: case 2: - gUnknown_02024A72[gLinkPlayers[i].lp_field_18] = 2; - gUnknown_02024A6A[gLinkPlayers[i].lp_field_18] = 3; + gBanksBySide[gLinkPlayers[i].lp_field_18] = 2; + gBattlePartyID[gLinkPlayers[i].lp_field_18] = 3; break; } } @@ -236,41 +236,41 @@ void sub_800BA78(void) if ((!(gLinkPlayers[i].lp_field_18 & 1) && !(gLinkPlayers[multiplayerId].lp_field_18 & 1)) || ((gLinkPlayers[i].lp_field_18 & 1) && (gLinkPlayers[multiplayerId].lp_field_18 & 1))) { - gUnknown_03004330[gLinkPlayers[i].lp_field_18] = sub_811DA78; + gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetBankFuncToLinkPartnerBufferRunCommand; switch (gLinkPlayers[i].lp_field_18) { case 0: case 3: - gUnknown_02024A72[gLinkPlayers[i].lp_field_18] = 0; - gUnknown_02024A6A[gLinkPlayers[i].lp_field_18] = 0; + gBanksBySide[gLinkPlayers[i].lp_field_18] = 0; + gBattlePartyID[gLinkPlayers[i].lp_field_18] = 0; break; case 1: case 2: - gUnknown_02024A72[gLinkPlayers[i].lp_field_18] = 2; - gUnknown_02024A6A[gLinkPlayers[i].lp_field_18] = 3; + gBanksBySide[gLinkPlayers[i].lp_field_18] = 2; + gBattlePartyID[gLinkPlayers[i].lp_field_18] = 3; break; } } else { - gUnknown_03004330[gLinkPlayers[i].lp_field_18] = sub_8037510; + gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetBankFuncToLinkOpponentBufferRunCommand; switch (gLinkPlayers[i].lp_field_18) { case 0: case 3: - gUnknown_02024A72[gLinkPlayers[i].lp_field_18] = 1; - gUnknown_02024A6A[gLinkPlayers[i].lp_field_18] = 0; + gBanksBySide[gLinkPlayers[i].lp_field_18] = 1; + gBattlePartyID[gLinkPlayers[i].lp_field_18] = 0; break; case 1: case 2: - gUnknown_02024A72[gLinkPlayers[i].lp_field_18] = 3; - gUnknown_02024A6A[gLinkPlayers[i].lp_field_18] = 3; + gBanksBySide[gLinkPlayers[i].lp_field_18] = 3; + gBattlePartyID[gLinkPlayers[i].lp_field_18] = 3; break; } } } } - gUnknown_02024A68 = 4; + gNoOfAllBanks = 4; } void sub_800BD54(void) @@ -280,20 +280,20 @@ void sub_800BD54(void) if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI)) { - for (i = 0; i < gUnknown_02024A68; i++) + for (i = 0; i < gNoOfAllBanks; i++) { for (j = 0; j < 6; j++) { if (i < 2) { - if (!(gUnknown_02024A72[i] & 1)) + if (!(gBanksBySide[i] & 1)) { if (GetMonData(&gPlayerParty[j], MON_DATA_HP) != 0 && GetMonData(&gPlayerParty[j], MON_DATA_SPECIES2) != 0 && GetMonData(&gPlayerParty[j], MON_DATA_SPECIES2) != SPECIES_EGG && GetMonData(&gPlayerParty[j], MON_DATA_IS_EGG) == 0) { - gUnknown_02024A6A[i] = j; + gBattlePartyID[i] = j; break; } } @@ -304,22 +304,22 @@ void sub_800BD54(void) && GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != SPECIES_EGG && GetMonData(&gEnemyParty[j], MON_DATA_IS_EGG) == 0) { - gUnknown_02024A6A[i] = j; + gBattlePartyID[i] = j; break; } } } else { - if (!(gUnknown_02024A72[i] & 1)) + if (!(gBanksBySide[i] & 1)) { if (GetMonData(&gPlayerParty[j], MON_DATA_HP) != 0 && GetMonData(&gPlayerParty[j], MON_DATA_SPECIES) != 0 //Probably a typo by Game Freak. The rest use SPECIES2 && GetMonData(&gPlayerParty[j], MON_DATA_SPECIES2) != SPECIES_EGG && GetMonData(&gPlayerParty[j], MON_DATA_IS_EGG) == 0 - && gUnknown_02024A6A[i - 2] != j) + && gBattlePartyID[i - 2] != j) { - gUnknown_02024A6A[i] = j; + gBattlePartyID[i] = j; break; } } @@ -329,9 +329,9 @@ void sub_800BD54(void) && GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != 0 && GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != SPECIES_EGG && GetMonData(&gEnemyParty[j], MON_DATA_IS_EGG) == 0 - && gUnknown_02024A6A[i - 2] != j) + && gBattlePartyID[i - 2] != j) { - gUnknown_02024A6A[i] = j; + gBattlePartyID[i] = j; break; } } @@ -356,14 +356,14 @@ void dp01_prepare_buffer(u8 a, u8 *b, u16 c) case 0: for (i = 0; i < c; i++) { - gUnknown_02023A60[gUnknown_02024A60][i] = *b; + gBattleBufferA[gActiveBank][i] = *b; b++; } break; case 1: for (i = 0; i < c; i++) { - gUnknown_02024260[gUnknown_02024A60][i] = *b; + gBattleBufferB[gActiveBank][i] = *b; b++; } break; @@ -400,13 +400,13 @@ void dp01_prepare_buffer_wireless_probably(u8 a, u16 b, u8 *c) gTasks[gUnknown_020238C4].data[14] = 0; } unk_2000000[gTasks[gUnknown_020238C4].data[14] + 0x14000] = a; - unk_2000000[gTasks[gUnknown_020238C4].data[14] + 0x14001] = gUnknown_02024A60; - unk_2000000[gTasks[gUnknown_020238C4].data[14] + 0x14002] = gPlayerMonIndex; - unk_2000000[gTasks[gUnknown_020238C4].data[14] + 0x14003] = gEnemyMonIndex; + unk_2000000[gTasks[gUnknown_020238C4].data[14] + 0x14001] = gActiveBank; + unk_2000000[gTasks[gUnknown_020238C4].data[14] + 0x14002] = gBankAttacker; + unk_2000000[gTasks[gUnknown_020238C4].data[14] + 0x14003] = gBankTarget; unk_2000000[gTasks[gUnknown_020238C4].data[14] + 0x14004] = r9; unk_2000000[gTasks[gUnknown_020238C4].data[14] + 0x14005] = (r9 & 0x0000FF00) >> 8; - unk_2000000[gTasks[gUnknown_020238C4].data[14] + 0x14006] = gUnknown_02024C0C; - unk_2000000[gTasks[gUnknown_020238C4].data[14] + 0x14007] = gUnknown_02024C0A; + unk_2000000[gTasks[gUnknown_020238C4].data[14] + 0x14006] = gAbsentBankFlags; + unk_2000000[gTasks[gUnknown_020238C4].data[14] + 0x14007] = gEffectBank; for (i = 0; i < b; i++) unk_2000000[gTasks[gUnknown_020238C4].data[14] + 0x14008 + i] = c[i]; gTasks[gUnknown_020238C4].data[14] = gTasks[gUnknown_020238C4].data[14] + r9 + 8; @@ -538,235 +538,235 @@ void sub_800C47C(u8 taskId) switch (unk_2000000[0x15000 + gTasks[taskId].data[15] + 0]) { case 0: - if (gUnknown_02024A64 & gBitTable[r4]) + if (gBattleExecBuffer & gBitTable[r4]) return; - memcpy(gUnknown_02023A60[r4], &unk_2000000[0x15000 + gTasks[taskId].data[15] + 8], r7); + memcpy(gBattleBufferA[r4], &unk_2000000[0x15000 + gTasks[taskId].data[15] + 8], r7); sub_80155A4(r4); if (!(gBattleTypeFlags & BATTLE_TYPE_WILD)) { - gPlayerMonIndex = unk_2000000[0x15000 + gTasks[taskId].data[15] + 2]; - gEnemyMonIndex = unk_2000000[0x15000 + gTasks[taskId].data[15] + 3]; - gUnknown_02024C0C = unk_2000000[0x15000 + gTasks[taskId].data[15] + 6]; - gUnknown_02024C0A = unk_2000000[0x15000 + gTasks[taskId].data[15] + 7]; + gBankAttacker = unk_2000000[0x15000 + gTasks[taskId].data[15] + 2]; + gBankTarget = unk_2000000[0x15000 + gTasks[taskId].data[15] + 3]; + gAbsentBankFlags = unk_2000000[0x15000 + gTasks[taskId].data[15] + 6]; + gEffectBank = unk_2000000[0x15000 + gTasks[taskId].data[15] + 7]; } break; case 1: - memcpy(gUnknown_02024260[r4], &unk_2000000[0x15000 + gTasks[taskId].data[15] + 8], r7); + memcpy(gBattleBufferB[r4], &unk_2000000[0x15000 + gTasks[taskId].data[15] + 8], r7); break; case 2: r2 = unk_2000000[0x15000 + gTasks[taskId].data[15] + 8]; - gUnknown_02024A64 &= ~(gBitTable[r4] << (r2 * 4)); + gBattleExecBuffer &= ~(gBitTable[r4] << (r2 * 4)); break; } gTasks[taskId].data[15] = gTasks[taskId].data[15] + r7 + 8; } } -void dp01_build_cmdbuf_x00_a_b_0(u8 a, u8 b, u8 c) +void EmitGetAttributes(u8 a, u8 b, u8 c) { - gUnknown_03004040[0] = 0; - gUnknown_03004040[1] = b; - gUnknown_03004040[2] = c; - gUnknown_03004040[3] = 0; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 0; + gBattleBuffersTransferData[1] = b; + gBattleBuffersTransferData[2] = c; + gBattleBuffersTransferData[3] = 0; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } void dp01_build_cmdbuf_x01_a_b_0(u8 a, u8 b, u8 c) { - gUnknown_03004040[0] = 1; - gUnknown_03004040[1] = b; - gUnknown_03004040[2] = c; - gUnknown_03004040[3] = 0; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 1; + gBattleBuffersTransferData[1] = b; + gBattleBuffersTransferData[2] = c; + gBattleBuffersTransferData[3] = 0; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } -void dp01_build_cmdbuf_x02_a_b_varargs(u8 a, u8 b, u8 c, u8 d, u8 *e) +void EmitSetAttributes(u8 a, u8 b, u8 c, u8 d, u8 *e) { int i; - gUnknown_03004040[0] = 2; - gUnknown_03004040[1] = b; - gUnknown_03004040[2] = c; + gBattleBuffersTransferData[0] = 2; + gBattleBuffersTransferData[1] = b; + gBattleBuffersTransferData[2] = c; for (i = 0; i < d; i++) - gUnknown_03004040[3 + i] = *(e++); - dp01_prepare_buffer(a, gUnknown_03004040, d + 3); + gBattleBuffersTransferData[3 + i] = *(e++); + dp01_prepare_buffer(a, gBattleBuffersTransferData, d + 3); } void unref_sub_800C6A4(u8 a, u8 b, u8 c, u8 *d) { int i; - gUnknown_03004040[0] = 3; - gUnknown_03004040[1] = b; - gUnknown_03004040[2] = c; + gBattleBuffersTransferData[0] = 3; + gBattleBuffersTransferData[1] = b; + gBattleBuffersTransferData[2] = c; for (i = 0; i < c; i++) - gUnknown_03004040[3 + i] = *(d++); - dp01_prepare_buffer(a, gUnknown_03004040, c + 3); + gBattleBuffersTransferData[3 + i] = *(d++); + dp01_prepare_buffer(a, gBattleBuffersTransferData, c + 3); } void dp01_build_cmdbuf_x04_4_4_4(u8 a) { - gUnknown_03004040[0] = 4; - gUnknown_03004040[1] = 4; - gUnknown_03004040[2] = 4; - gUnknown_03004040[3] = 4; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 4; + gBattleBuffersTransferData[1] = 4; + gBattleBuffersTransferData[2] = 4; + gBattleBuffersTransferData[3] = 4; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } void sub_800C704(u8 a, u8 b, u8 c) { - gUnknown_03004040[0] = 5; - gUnknown_03004040[1] = b; - gUnknown_03004040[2] = c; - gUnknown_03004040[3] = 5; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 5; + gBattleBuffersTransferData[1] = b; + gBattleBuffersTransferData[2] = c; + gBattleBuffersTransferData[3] = 5; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } void dp01_build_cmdbuf_x06_a(u8 a, u8 b) { - gUnknown_03004040[0] = 6; - gUnknown_03004040[1] = b; - dp01_prepare_buffer(a, gUnknown_03004040, 2); + gBattleBuffersTransferData[0] = 6; + gBattleBuffersTransferData[1] = b; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 2); } void dp01_build_cmdbuf_x07_7_7_7(u8 a) { - gUnknown_03004040[0] = 7; - gUnknown_03004040[1] = 7; - gUnknown_03004040[2] = 7; - gUnknown_03004040[3] = 7; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 7; + gBattleBuffersTransferData[1] = 7; + gBattleBuffersTransferData[2] = 7; + gBattleBuffersTransferData[3] = 7; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } void dp01_build_cmdbuf_x08_8_8_8(u8 a) { - gUnknown_03004040[0] = 8; - gUnknown_03004040[1] = 8; - gUnknown_03004040[2] = 8; - gUnknown_03004040[3] = 8; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 8; + gBattleBuffersTransferData[1] = 8; + gBattleBuffersTransferData[2] = 8; + gBattleBuffersTransferData[3] = 8; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } void dp01_build_cmdbuf_x09_9_9_9(u8 a) { - gUnknown_03004040[0] = 9; - gUnknown_03004040[1] = 9; - gUnknown_03004040[2] = 9; - gUnknown_03004040[3] = 9; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 9; + gBattleBuffersTransferData[1] = 9; + gBattleBuffersTransferData[2] = 9; + gBattleBuffersTransferData[3] = 9; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } -void dp01_build_cmdbuf_x0A_A_A_A(u8 a) +void EmitFaintAnimation(u8 a) { - gUnknown_03004040[0] = 10; - gUnknown_03004040[1] = 10; - gUnknown_03004040[2] = 10; - gUnknown_03004040[3] = 10; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 10; + gBattleBuffersTransferData[1] = 10; + gBattleBuffersTransferData[2] = 10; + gBattleBuffersTransferData[3] = 10; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } void dp01_build_cmdbuf_x0B_B_B_B(u8 a) { - gUnknown_03004040[0] = 11; - gUnknown_03004040[1] = 11; - gUnknown_03004040[2] = 11; - gUnknown_03004040[3] = 11; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 11; + gBattleBuffersTransferData[1] = 11; + gBattleBuffersTransferData[2] = 11; + gBattleBuffersTransferData[3] = 11; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } void dp01_build_cmdbuf_x0C_C_C_C(u8 a) { - gUnknown_03004040[0] = 12; - gUnknown_03004040[1] = 12; - gUnknown_03004040[2] = 12; - gUnknown_03004040[3] = 12; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 12; + gBattleBuffersTransferData[1] = 12; + gBattleBuffersTransferData[2] = 12; + gBattleBuffersTransferData[3] = 12; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } void dp01_build_cmdbuf_x0D_a(u8 a, u8 b) { - gUnknown_03004040[0] = 13; - gUnknown_03004040[1] = b; - dp01_prepare_buffer(a, gUnknown_03004040, 2); + gBattleBuffersTransferData[0] = 13; + gBattleBuffersTransferData[1] = b; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 2); } void unref_sub_800C828(u8 a, u8 b, u8 *c) { int i; - gUnknown_03004040[0] = 14; - gUnknown_03004040[1] = b; + gBattleBuffersTransferData[0] = 14; + gBattleBuffersTransferData[1] = b; for (i = 0; i < b * 3; i++) - gUnknown_03004040[2 + i] = *(c++); - dp01_prepare_buffer(a, gUnknown_03004040, b * 3 + 2); -} - -void dp01_build_cmdbuf_x0F_aa_b_cc_dddd_e_mlc_weather_00_x1Cbytes(u8 a, u16 b, u8 c, u16 d, s32 e, u8 f, u8 *g) -{ - gUnknown_03004040[0] = 15; - gUnknown_03004040[1] = b; - gUnknown_03004040[2] = (b & 0xFF00) >> 8; - gUnknown_03004040[3] = c; - gUnknown_03004040[4] = d; - gUnknown_03004040[5] = (d & 0xFF00) >> 8; - gUnknown_03004040[6] = e; - gUnknown_03004040[7] = (e & 0x0000FF00) >> 8; - gUnknown_03004040[8] = (e & 0x00FF0000) >> 16; - gUnknown_03004040[9] = (e & 0xFF000000) >> 24; - gUnknown_03004040[10] = f; - gUnknown_03004040[11] = gUnknown_02024C0E; - if (sub_8018324(14, 0, 13, 0, 0) == 0 && sub_8018324(14, 0, 0x4D, 0, 0) == 0) + gBattleBuffersTransferData[2 + i] = *(c++); + dp01_prepare_buffer(a, gBattleBuffersTransferData, b * 3 + 2); +} + +void EmitMoveAnimation(u8 a, u16 b, u8 c, u16 d, s32 e, u8 f, u8 *g) +{ + gBattleBuffersTransferData[0] = 15; + gBattleBuffersTransferData[1] = b; + gBattleBuffersTransferData[2] = (b & 0xFF00) >> 8; + gBattleBuffersTransferData[3] = c; + gBattleBuffersTransferData[4] = d; + gBattleBuffersTransferData[5] = (d & 0xFF00) >> 8; + gBattleBuffersTransferData[6] = e; + gBattleBuffersTransferData[7] = (e & 0x0000FF00) >> 8; + gBattleBuffersTransferData[8] = (e & 0x00FF0000) >> 16; + gBattleBuffersTransferData[9] = (e & 0xFF000000) >> 24; + gBattleBuffersTransferData[10] = f; + gBattleBuffersTransferData[11] = gMultiHitCounter; + if (AbilityBattleEffects(14, 0, 13, 0, 0) == 0 && AbilityBattleEffects(14, 0, 0x4D, 0, 0) == 0) { - gUnknown_03004040[12] = gBattleWeather; - gUnknown_03004040[13] = (gBattleWeather & 0xFF00) >> 8; + gBattleBuffersTransferData[12] = gBattleWeather; + gBattleBuffersTransferData[13] = (gBattleWeather & 0xFF00) >> 8; } else { - gUnknown_03004040[12] = 0; - gUnknown_03004040[13] = 0; + gBattleBuffersTransferData[12] = 0; + gBattleBuffersTransferData[13] = 0; } - gUnknown_03004040[14] = 0; - gUnknown_03004040[15] = 0; - memcpy(&gUnknown_03004040[16], g, 0x1C); - dp01_prepare_buffer(a, gUnknown_03004040, 0x2C); + gBattleBuffersTransferData[14] = 0; + gBattleBuffersTransferData[15] = 0; + memcpy(&gBattleBuffersTransferData[16], g, 0x1C); + dp01_prepare_buffer(a, gBattleBuffersTransferData, 0x2C); } #ifdef NONMATCHING -void dp01_build_cmdbuf_x10_TODO(u8 a, u16 b) +void EmitPrintString(u8 a, u16 b) { int i; //u16 *r12; - gUnknown_03004040[0] = 16; - gUnknown_03004040[1] = gUnknown_02024D26; - gUnknown_03004040[2] = b; - gUnknown_03004040[3] = (b & 0xFF00) >> 8; - - *((u16 *)&gUnknown_03004040[4]) = gUnknown_02024BE6; - *((u16 *)&gUnknown_03004040[6]) = gUnknown_02024BE8; - *((u16 *)&gUnknown_03004040[8]) = gUnknown_02024C04; - - gUnknown_03004040[10] = byte_2024C06; - gUnknown_03004040[11] = unk_2000000[0x16000 + 3]; - gUnknown_03004040[12] = unk_2000000[0x16000 + 0x5E]; - gUnknown_03004040[13] = unk_2000000[0x16000 + 0xC1]; - gUnknown_03004040[14] = gUnknown_02024C0B; - gUnknown_03004040[15] = gBattleMoves[gUnknown_02024BE6].type; + gBattleBuffersTransferData[0] = 16; + gBattleBuffersTransferData[1] = gBattleOutcome; + gBattleBuffersTransferData[2] = b; + gBattleBuffersTransferData[3] = (b & 0xFF00) >> 8; + + *((u16 *)&gBattleBuffersTransferData[4]) = gCurrentMove; + *((u16 *)&gBattleBuffersTransferData[6]) = gUnknown_02024BE8; + *((u16 *)&gBattleBuffersTransferData[8]) = gLastUsedItem; + + gBattleBuffersTransferData[10] = gLastUsedAbility; + gBattleBuffersTransferData[11] = unk_2000000[0x16000 + 3]; + gBattleBuffersTransferData[12] = unk_2000000[0x16000 + 0x5E]; + gBattleBuffersTransferData[13] = unk_2000000[0x16000 + 0xC1]; + gBattleBuffersTransferData[14] = gStringBank; + gBattleBuffersTransferData[15] = gBattleMoves[gCurrentMove].type; for (i = 0; i < 4; i++) { - gUnknown_03004040[16 + i] = gBattleMons[i].ability; + gBattleBuffersTransferData[16 + i] = gBattleMons[i].ability; } for (i = 0; i < 16; i++) { - gUnknown_03004040[20 + i] = gUnknown_030041C0[i]; - gUnknown_03004040[36 + i] = gUnknown_03004290[i]; - gUnknown_03004040[52 + i] = gUnknown_030042B0[i]; + gBattleBuffersTransferData[20 + i] = gBattleTextBuff1[i]; + gBattleBuffersTransferData[36 + i] = gBattleTextBuff2[i]; + gBattleBuffersTransferData[52 + i] = gBattleTextBuff3[i]; } - dp01_prepare_buffer(a, gUnknown_03004040, 0x44); + dp01_prepare_buffer(a, gBattleBuffersTransferData, 0x44); } #else __attribute__((naked)) -void dp01_build_cmdbuf_x10_TODO(u8 a, u16 b) +void EmitPrintString(u8 a, u16 b) { asm(".syntax unified\n\ push {r4-r7,lr}\n\ @@ -779,10 +779,10 @@ void dp01_build_cmdbuf_x10_TODO(u8 a, u16 b) mov r10, r0\n\ lsls r1, 16\n\ lsrs r1, 16\n\ - ldr r2, _0800CA2C @ =gUnknown_03004040\n\ + ldr r2, _0800CA2C @ =gBattleBuffersTransferData\n\ movs r0, 0x10\n\ strb r0, [r2]\n\ - ldr r0, _0800CA30 @ =gUnknown_02024D26\n\ + ldr r0, _0800CA30 @ =gBattleOutcome\n\ ldrb r0, [r0]\n\ strb r0, [r2, 0x1]\n\ strb r1, [r2, 0x2]\n\ @@ -790,17 +790,17 @@ void dp01_build_cmdbuf_x10_TODO(u8 a, u16 b) strb r1, [r2, 0x3]\n\ adds r0, r2, 0x4\n\ mov r12, r0\n\ - ldr r4, _0800CA34 @ =gUnknown_02024BE6\n\ + ldr r4, _0800CA34 @ =gCurrentMove\n\ ldrh r0, [r4]\n\ strh r0, [r2, 0x4]\n\ ldr r0, _0800CA38 @ =gUnknown_02024BE8\n\ ldrh r0, [r0]\n\ mov r1, r12\n\ strh r0, [r1, 0x2]\n\ - ldr r0, _0800CA3C @ =gUnknown_02024C04\n\ + ldr r0, _0800CA3C @ =gLastUsedItem\n\ ldrh r0, [r0]\n\ strh r0, [r1, 0x4]\n\ - ldr r0, _0800CA40 @ =byte_2024C06\n\ + ldr r0, _0800CA40 @ =gLastUsedAbility\n\ ldrb r0, [r0]\n\ strb r0, [r1, 0x6]\n\ ldr r1, _0800CA44 @ =0x02000000\n\ @@ -818,7 +818,7 @@ void dp01_build_cmdbuf_x10_TODO(u8 a, u16 b) ldrb r0, [r1]\n\ mov r1, r12\n\ strb r0, [r1, 0x9]\n\ - ldr r0, _0800CA50 @ =gUnknown_02024C0B\n\ + ldr r0, _0800CA50 @ =gStringBank\n\ ldrb r0, [r0]\n\ strb r0, [r1, 0xA]\n\ ldr r3, _0800CA54 @ =gBattleMoves\n\ @@ -832,7 +832,7 @@ void dp01_build_cmdbuf_x10_TODO(u8 a, u16 b) strb r0, [r3, 0xB]\n\ movs r3, 0\n\ mov r9, r2\n\ - ldr r7, _0800CA58 @ =gUnknown_030042B0\n\ + ldr r7, _0800CA58 @ =gBattleTextBuff3\n\ mov r8, r7\n\ adds r2, 0x10\n\ ldr r0, _0800CA5C @ =gBattleMons\n\ @@ -851,12 +851,12 @@ _0800C9D2:\n\ adds r5, 0x10\n\ mov r4, r12\n\ adds r4, 0x20\n\ - ldr r6, _0800CA60 @ =gUnknown_03004290\n\ + ldr r6, _0800CA60 @ =gBattleTextBuff2\n\ mov r2, r12\n\ adds r2, 0x30\n\ _0800C9F0:\n\ adds r1, r5, r3\n\ - ldr r7, _0800CA64 @ =gUnknown_030041C0\n\ + ldr r7, _0800CA64 @ =gBattleTextBuff1\n\ adds r0, r3, r7\n\ ldrb r0, [r0]\n\ strb r0, [r1]\n\ @@ -884,27 +884,27 @@ _0800C9F0:\n\ pop {r0}\n\ bx r0\n\ .align 2, 0\n\ -_0800CA2C: .4byte gUnknown_03004040\n\ -_0800CA30: .4byte gUnknown_02024D26\n\ -_0800CA34: .4byte gUnknown_02024BE6\n\ +_0800CA2C: .4byte gBattleBuffersTransferData\n\ +_0800CA30: .4byte gBattleOutcome\n\ +_0800CA34: .4byte gCurrentMove\n\ _0800CA38: .4byte gUnknown_02024BE8\n\ -_0800CA3C: .4byte gUnknown_02024C04\n\ -_0800CA40: .4byte byte_2024C06\n\ +_0800CA3C: .4byte gLastUsedItem\n\ +_0800CA40: .4byte gLastUsedAbility\n\ _0800CA44: .4byte 0x02000000\n\ _0800CA48: .4byte 0x00016003\n\ _0800CA4C: .4byte 0x000160c1\n\ -_0800CA50: .4byte gUnknown_02024C0B\n\ +_0800CA50: .4byte gStringBank\n\ _0800CA54: .4byte gBattleMoves\n\ -_0800CA58: .4byte gUnknown_030042B0\n\ +_0800CA58: .4byte gBattleTextBuff3\n\ _0800CA5C: .4byte gBattleMons\n\ -_0800CA60: .4byte gUnknown_03004290\n\ -_0800CA64: .4byte gUnknown_030041C0\n\ +_0800CA60: .4byte gBattleTextBuff2\n\ +_0800CA64: .4byte gBattleTextBuff1\n\ .syntax divided\n"); } #endif __attribute__((naked)) -void dp01_build_cmdbuf_x11_TODO() +void EmitPrintStringPlayerOnly() { asm(".syntax unified\n\ push {r4-r7,lr}\n\ @@ -917,7 +917,7 @@ void dp01_build_cmdbuf_x11_TODO() mov r10, r0\n\ lsls r1, 16\n\ lsrs r1, 16\n\ - ldr r2, _0800CB28 @ =gUnknown_03004040\n\ + ldr r2, _0800CB28 @ =gBattleBuffersTransferData\n\ movs r0, 0x11\n\ strb r0, [r2]\n\ strb r0, [r2, 0x1]\n\ @@ -926,17 +926,17 @@ void dp01_build_cmdbuf_x11_TODO() strb r1, [r2, 0x3]\n\ adds r0, r2, 0x4\n\ mov r12, r0\n\ - ldr r0, _0800CB2C @ =gUnknown_02024BE6\n\ + ldr r0, _0800CB2C @ =gCurrentMove\n\ ldrh r0, [r0]\n\ strh r0, [r2, 0x4]\n\ ldr r0, _0800CB30 @ =gUnknown_02024BE8\n\ ldrh r0, [r0]\n\ mov r1, r12\n\ strh r0, [r1, 0x2]\n\ - ldr r0, _0800CB34 @ =gUnknown_02024C04\n\ + ldr r0, _0800CB34 @ =gLastUsedItem\n\ ldrh r0, [r0]\n\ strh r0, [r1, 0x4]\n\ - ldr r0, _0800CB38 @ =byte_2024C06\n\ + ldr r0, _0800CB38 @ =gLastUsedAbility\n\ ldrb r0, [r0]\n\ strb r0, [r1, 0x6]\n\ ldr r0, _0800CB3C @ =0x02000000\n\ @@ -951,7 +951,7 @@ void dp01_build_cmdbuf_x11_TODO() strb r0, [r7, 0x8]\n\ movs r3, 0\n\ mov r9, r2\n\ - ldr r7, _0800CB48 @ =gUnknown_030042B0\n\ + ldr r7, _0800CB48 @ =gBattleTextBuff3\n\ mov r8, r7\n\ mov r4, r9\n\ adds r4, 0x10\n\ @@ -971,12 +971,12 @@ _0800CACE:\n\ adds r5, 0x10\n\ mov r4, r12\n\ adds r4, 0x20\n\ - ldr r6, _0800CB50 @ =gUnknown_03004290\n\ + ldr r6, _0800CB50 @ =gBattleTextBuff2\n\ mov r2, r12\n\ adds r2, 0x30\n\ _0800CAEC:\n\ adds r1, r5, r3\n\ - ldr r7, _0800CB54 @ =gUnknown_030041C0\n\ + ldr r7, _0800CB54 @ =gBattleTextBuff1\n\ adds r0, r3, r7\n\ ldrb r0, [r0]\n\ strb r0, [r1]\n\ @@ -1004,384 +1004,384 @@ _0800CAEC:\n\ pop {r0}\n\ bx r0\n\ .align 2, 0\n\ -_0800CB28: .4byte gUnknown_03004040\n\ -_0800CB2C: .4byte gUnknown_02024BE6\n\ +_0800CB28: .4byte gBattleBuffersTransferData\n\ +_0800CB2C: .4byte gCurrentMove\n\ _0800CB30: .4byte gUnknown_02024BE8\n\ -_0800CB34: .4byte gUnknown_02024C04\n\ -_0800CB38: .4byte byte_2024C06\n\ +_0800CB34: .4byte gLastUsedItem\n\ +_0800CB38: .4byte gLastUsedAbility\n\ _0800CB3C: .4byte 0x02000000\n\ _0800CB40: .4byte 0x00016003\n\ _0800CB44: .4byte 0x0001605e\n\ -_0800CB48: .4byte gUnknown_030042B0\n\ +_0800CB48: .4byte gBattleTextBuff3\n\ _0800CB4C: .4byte gBattleMons\n\ -_0800CB50: .4byte gUnknown_03004290\n\ -_0800CB54: .4byte gUnknown_030041C0\n\ +_0800CB50: .4byte gBattleTextBuff2\n\ +_0800CB54: .4byte gBattleTextBuff1\n\ .syntax divided\n"); } void dp01_build_cmdbuf_x12_a_bb(u8 a, u8 b, u16 c) { - gUnknown_03004040[0] = 18; - gUnknown_03004040[1] = b; - gUnknown_03004040[2] = c; - gUnknown_03004040[3] = (c & 0xFF00) >> 8; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 18; + gBattleBuffersTransferData[1] = b; + gBattleBuffersTransferData[2] = c; + gBattleBuffersTransferData[3] = (c & 0xFF00) >> 8; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } void unref_sub_800CB84(u8 a, u8 b) { - gUnknown_03004040[0] = 19; - gUnknown_03004040[1] = b; - dp01_prepare_buffer(a, gUnknown_03004040, 2); + gBattleBuffersTransferData[0] = 19; + gBattleBuffersTransferData[1] = b; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 2); } void sub_800CBA4(u8 a, u8 b, u8 c, u8 *d) { u32 i; - gUnknown_03004040[0] = 20; - gUnknown_03004040[1] = b; - gUnknown_03004040[2] = c; - gUnknown_03004040[3] = 0; + gBattleBuffersTransferData[0] = 20; + gBattleBuffersTransferData[1] = b; + gBattleBuffersTransferData[2] = c; + gBattleBuffersTransferData[3] = 0; for (i = 0; i < 20; i++) - gUnknown_03004040[4 + i] = d[i]; - dp01_prepare_buffer(a, gUnknown_03004040, 24); + gBattleBuffersTransferData[4 + i] = d[i]; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 24); } void sub_800CBE0(u8 a, u8 *b) { int i; - gUnknown_03004040[0] = 21; + gBattleBuffersTransferData[0] = 21; for (i = 0; i < 3; i++) - gUnknown_03004040[1 + i] = b[i]; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[1 + i] = b[i]; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } void dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f(u8 a, u8 b, u8 c, u8 d, u8 *e) { int i; - gUnknown_03004040[0] = 22; - gUnknown_03004040[1] = b; - gUnknown_03004040[2] = c; - gUnknown_03004040[3] = d; + gBattleBuffersTransferData[0] = 22; + gBattleBuffersTransferData[1] = b; + gBattleBuffersTransferData[2] = c; + gBattleBuffersTransferData[3] = d; for (i = 0; i < 3; i++) - gUnknown_03004040[4 + i] = e[i]; - dp01_prepare_buffer(a, gUnknown_03004040, 8); //but only 7 bytes were written + gBattleBuffersTransferData[4 + i] = e[i]; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 8); //but only 7 bytes were written } void dp01_build_cmdbuf_x17_17_17_17(u8 a) { - gUnknown_03004040[0] = 23; - gUnknown_03004040[1] = 23; - gUnknown_03004040[2] = 23; - gUnknown_03004040[3] = 23; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 23; + gBattleBuffersTransferData[1] = 23; + gBattleBuffersTransferData[2] = 23; + gBattleBuffersTransferData[3] = 23; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } -void dp01_build_cmdbuf_x18_0_aa_health_bar_update(u8 a, s16 b) +void EmitHealthBarUpdate(u8 a, s16 b) { - gUnknown_03004040[0] = 24; - gUnknown_03004040[1] = 0; - gUnknown_03004040[2] = b; - gUnknown_03004040[3] = (b & 0xFF00) >> 8; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 24; + gBattleBuffersTransferData[1] = 0; + gBattleBuffersTransferData[2] = b; + gBattleBuffersTransferData[3] = (b & 0xFF00) >> 8; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } -void dp01_build_cmdbuf_x19_a_bb(u8 a, u8 b, s16 c) +void EmitExpBarUpdate(u8 a, u8 b, s16 c) { - gUnknown_03004040[0] = 25; - gUnknown_03004040[1] = b; - gUnknown_03004040[2] = c; - gUnknown_03004040[3] = (c & 0xFF00) >> 8; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 25; + gBattleBuffersTransferData[1] = b; + gBattleBuffersTransferData[2] = c; + gBattleBuffersTransferData[3] = (c & 0xFF00) >> 8; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } -void dp01_build_cmdbuf_x1A_aaaa_bbbb(u8 a, u32 b, u32 c) +void EmitStatusIconUpdate(u8 a, u32 b, u32 c) { - gUnknown_03004040[0] = 26; - gUnknown_03004040[1] = b; - gUnknown_03004040[2] = (b & 0x0000FF00) >> 8; - gUnknown_03004040[3] = (b & 0x00FF0000) >> 16; - gUnknown_03004040[4] = (b & 0xFF000000) >> 24; - gUnknown_03004040[5] = c; - gUnknown_03004040[6] = (c & 0x0000FF00) >> 8; - gUnknown_03004040[7] = (c & 0x00FF0000) >> 16; - gUnknown_03004040[8] = (c & 0xFF000000) >> 24; - dp01_prepare_buffer(a, gUnknown_03004040, 9); + gBattleBuffersTransferData[0] = 26; + gBattleBuffersTransferData[1] = b; + gBattleBuffersTransferData[2] = (b & 0x0000FF00) >> 8; + gBattleBuffersTransferData[3] = (b & 0x00FF0000) >> 16; + gBattleBuffersTransferData[4] = (b & 0xFF000000) >> 24; + gBattleBuffersTransferData[5] = c; + gBattleBuffersTransferData[6] = (c & 0x0000FF00) >> 8; + gBattleBuffersTransferData[7] = (c & 0x00FF0000) >> 16; + gBattleBuffersTransferData[8] = (c & 0xFF000000) >> 24; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 9); } -void dp01_build_cmdbuf_x1B_aaaa_b(u8 a, u8 b, u32 c) +void EmitStatusAnimation(u8 a, u8 b, u32 c) { - gUnknown_03004040[0] = 27; - gUnknown_03004040[1] = b; - gUnknown_03004040[2] = c; - gUnknown_03004040[3] = (c & 0x0000FF00) >> 8; - gUnknown_03004040[4] = (c & 0x00FF0000) >> 16; - gUnknown_03004040[5] = (c & 0xFF000000) >> 24; - dp01_prepare_buffer(a, gUnknown_03004040, 6); + gBattleBuffersTransferData[0] = 27; + gBattleBuffersTransferData[1] = b; + gBattleBuffersTransferData[2] = c; + gBattleBuffersTransferData[3] = (c & 0x0000FF00) >> 8; + gBattleBuffersTransferData[4] = (c & 0x00FF0000) >> 16; + gBattleBuffersTransferData[5] = (c & 0xFF000000) >> 24; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 6); } -void dp01_build_cmdbuf_x1C_a(u8 a, u8 b) +void EmitStatusXor(u8 a, u8 b) { - gUnknown_03004040[0] = 28; - gUnknown_03004040[1] = b; - dp01_prepare_buffer(a, gUnknown_03004040, 2); + gBattleBuffersTransferData[0] = 28; + gBattleBuffersTransferData[1] = b; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 2); } void dp01_build_cmdbuf_x1D_1D_numargs_varargs(u8 a, u16 b, u8 *c) { int i; - gUnknown_03004040[0] = 29; - gUnknown_03004040[1] = 29; - gUnknown_03004040[2] = b; - gUnknown_03004040[3] = (b & 0xFF00) >> 8; + gBattleBuffersTransferData[0] = 29; + gBattleBuffersTransferData[1] = 29; + gBattleBuffersTransferData[2] = b; + gBattleBuffersTransferData[3] = (b & 0xFF00) >> 8; for (i = 0; i < b; i++) - gUnknown_03004040[4 + i] = *(c++); - dp01_prepare_buffer(a, gUnknown_03004040, b + 4); + gBattleBuffersTransferData[4 + i] = *(c++); + dp01_prepare_buffer(a, gBattleBuffersTransferData, b + 4); } void unref_sub_800CDD4(u8 a, u32 b, u16 c, u8 *d) { int i; - gUnknown_03004040[0] = 30; - gUnknown_03004040[1] = b; - gUnknown_03004040[2] = (b & 0x0000FF00) >> 8; - gUnknown_03004040[3] = (b & 0x00FF0000) >> 16; - gUnknown_03004040[4] = (b & 0xFF000000) >> 24; - gUnknown_03004040[5] = c; - gUnknown_03004040[6] = (c & 0xFF00) >> 8; + gBattleBuffersTransferData[0] = 30; + gBattleBuffersTransferData[1] = b; + gBattleBuffersTransferData[2] = (b & 0x0000FF00) >> 8; + gBattleBuffersTransferData[3] = (b & 0x00FF0000) >> 16; + gBattleBuffersTransferData[4] = (b & 0xFF000000) >> 24; + gBattleBuffersTransferData[5] = c; + gBattleBuffersTransferData[6] = (c & 0xFF00) >> 8; for (i = 0; i < c; i++) - gUnknown_03004040[7 + i] = *(d++); - dp01_prepare_buffer(a, gUnknown_03004040, c + 7); + gBattleBuffersTransferData[7 + i] = *(d++); + dp01_prepare_buffer(a, gBattleBuffersTransferData, c + 7); } void unref_sub_800CE3C(u8 a, u16 b, u8 *c) { int i; - gUnknown_03004040[0] = 31; - gUnknown_03004040[1] = b; - gUnknown_03004040[2] = (b & 0xFF00) >> 8; + gBattleBuffersTransferData[0] = 31; + gBattleBuffersTransferData[1] = b; + gBattleBuffersTransferData[2] = (b & 0xFF00) >> 8; for (i = 0; i < b; i++) - gUnknown_03004040[3 + i] = *(c++); - dp01_prepare_buffer(a, gUnknown_03004040, b + 3); + gBattleBuffersTransferData[3 + i] = *(c++); + dp01_prepare_buffer(a, gBattleBuffersTransferData, b + 3); } void unref_sub_800CE84(u8 a, u16 b, u8 *c) { int i; - gUnknown_03004040[0] = 32; - gUnknown_03004040[1] = b; - gUnknown_03004040[2] = (b & 0xFF00) >> 8; + gBattleBuffersTransferData[0] = 32; + gBattleBuffersTransferData[1] = b; + gBattleBuffersTransferData[2] = (b & 0xFF00) >> 8; for (i = 0; i < b; i++) - gUnknown_03004040[3 + i] = *(c++); - dp01_prepare_buffer(a, gUnknown_03004040, b + 3); + gBattleBuffersTransferData[3 + i] = *(c++); + dp01_prepare_buffer(a, gBattleBuffersTransferData, b + 3); } void dp01_build_cmdbuf_x21_a_bb(u8 a, u8 b, u16 c) { - gUnknown_03004040[0] = 33; - gUnknown_03004040[1] = b; - gUnknown_03004040[2] = c; - gUnknown_03004040[3] = (c & 0xFF00) >> 8; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 33; + gBattleBuffersTransferData[1] = b; + gBattleBuffersTransferData[2] = c; + gBattleBuffersTransferData[3] = (c & 0xFF00) >> 8; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } void dp01_build_cmdbuf_x22_a_three_bytes(u8 a, u8 b, u8 *c) { int i; - gUnknown_03004040[0] = 34; - gUnknown_03004040[1] = b; + gBattleBuffersTransferData[0] = 34; + gBattleBuffersTransferData[1] = b; for (i = 0; i < 3; i++) - gUnknown_03004040[2 + i] = c[i]; - dp01_prepare_buffer(a, gUnknown_03004040, 5); + gBattleBuffersTransferData[2 + i] = c[i]; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 5); } void dp01_build_cmdbuf_x23_aa_0(u8 a, u16 b) { - gUnknown_03004040[0] = 35; - gUnknown_03004040[1] = b; - gUnknown_03004040[2] = (b & 0xFF00) >> 8; - gUnknown_03004040[3] = 0; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 35; + gBattleBuffersTransferData[1] = b; + gBattleBuffersTransferData[2] = (b & 0xFF00) >> 8; + gBattleBuffersTransferData[3] = 0; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } void dp01_build_cmdbuf_x24_aa_0(u8 a, u16 b) { - gUnknown_03004040[0] = 36; - gUnknown_03004040[1] = b; - gUnknown_03004040[2] = (b & 0xFF00) >> 8; - gUnknown_03004040[3] = 0; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 36; + gBattleBuffersTransferData[1] = b; + gBattleBuffersTransferData[2] = (b & 0xFF00) >> 8; + gBattleBuffersTransferData[3] = 0; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } void dp01_build_cmdbuf_x25_25_25_25(u8 a) { - gUnknown_03004040[0] = 37; - gUnknown_03004040[1] = 37; - gUnknown_03004040[2] = 37; - gUnknown_03004040[3] = 37; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 37; + gBattleBuffersTransferData[1] = 37; + gBattleBuffersTransferData[2] = 37; + gBattleBuffersTransferData[3] = 37; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } void dp01_build_cmdbuf_x26_a(u8 a, u8 b) { - gUnknown_03004040[0] = 38; - gUnknown_03004040[1] = b; - dp01_prepare_buffer(a, gUnknown_03004040, 2); + gBattleBuffersTransferData[0] = 38; + gBattleBuffersTransferData[1] = b; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 2); } void dp01_build_cmdbuf_x27_27_27_27(u8 a) { - gUnknown_03004040[0] = 39; - gUnknown_03004040[1] = 39; - gUnknown_03004040[2] = 39; - gUnknown_03004040[3] = 39; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 39; + gBattleBuffersTransferData[1] = 39; + gBattleBuffersTransferData[2] = 39; + gBattleBuffersTransferData[3] = 39; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } void dp01_build_cmdbuf_x28_28_28_28(u8 a) { - gUnknown_03004040[0] = 40; - gUnknown_03004040[1] = 40; - gUnknown_03004040[2] = 40; - gUnknown_03004040[3] = 40; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 40; + gBattleBuffersTransferData[1] = 40; + gBattleBuffersTransferData[2] = 40; + gBattleBuffersTransferData[3] = 40; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } -void dp01_build_cmdbuf_x29_29_29_29(u8 a) +void EmitHitAnimation(u8 a) { - gUnknown_03004040[0] = 41; - gUnknown_03004040[1] = 41; - gUnknown_03004040[2] = 41; - gUnknown_03004040[3] = 41; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 41; + gBattleBuffersTransferData[1] = 41; + gBattleBuffersTransferData[2] = 41; + gBattleBuffersTransferData[3] = 41; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } void dp01_build_cmdbuf_x2A_2A_2A_2A(u8 a) { - gUnknown_03004040[0] = 42; - gUnknown_03004040[1] = 42; - gUnknown_03004040[2] = 42; - gUnknown_03004040[3] = 42; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 42; + gBattleBuffersTransferData[1] = 42; + gBattleBuffersTransferData[2] = 42; + gBattleBuffersTransferData[3] = 42; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } -void dp01_build_cmdbuf_x2B_aa_0(u8 a, u16 b) +void EmitEffectivenessSound(u8 a, u16 b) { - gUnknown_03004040[0] = 43; - gUnknown_03004040[1] = b; - gUnknown_03004040[2] = (b & 0xFF00) >> 8; - gUnknown_03004040[3] = 0; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 43; + gBattleBuffersTransferData[1] = b; + gBattleBuffersTransferData[2] = (b & 0xFF00) >> 8; + gBattleBuffersTransferData[3] = 0; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } void sub_800D074(u8 a, u16 b) { - gUnknown_03004040[0] = 44; - gUnknown_03004040[1] = b; - gUnknown_03004040[2] = (b & 0xFF00) >> 8; - gUnknown_03004040[3] = 0; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 44; + gBattleBuffersTransferData[1] = b; + gBattleBuffersTransferData[2] = (b & 0xFF00) >> 8; + gBattleBuffersTransferData[3] = 0; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } -void dp01_build_cmdbuf_x2D_2D_2D_2D(u8 a) +void EmitFaintingCry(u8 a) { - gUnknown_03004040[0] = 45; - gUnknown_03004040[1] = 45; - gUnknown_03004040[2] = 45; - gUnknown_03004040[3] = 45; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 45; + gBattleBuffersTransferData[1] = 45; + gBattleBuffersTransferData[2] = 45; + gBattleBuffersTransferData[3] = 45; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } -void dp01_build_cmdbuf_x2E_a(u8 a, u8 b) +void EmitBattleIntroSlide(u8 a, u8 b) { - gUnknown_03004040[0] = 46; - gUnknown_03004040[1] = b; - dp01_prepare_buffer(a, gUnknown_03004040, 2); + gBattleBuffersTransferData[0] = 46; + gBattleBuffersTransferData[1] = b; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 2); } void dp01_build_cmdbuf_x2F_2F_2F_2F(u8 a) { - gUnknown_03004040[0] = 47; - gUnknown_03004040[1] = 47; - gUnknown_03004040[2] = 47; - gUnknown_03004040[3] = 47; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 47; + gBattleBuffersTransferData[1] = 47; + gBattleBuffersTransferData[2] = 47; + gBattleBuffersTransferData[3] = 47; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } void dp01_build_cmdbuf_x30_TODO(u8 a, u8 *b, u8 c) { int i; - gUnknown_03004040[0] = 48; - gUnknown_03004040[1] = c & 0x7F; - gUnknown_03004040[2] = (c & 0x80) >> 7; - gUnknown_03004040[3] = 48; + gBattleBuffersTransferData[0] = 48; + gBattleBuffersTransferData[1] = c & 0x7F; + gBattleBuffersTransferData[2] = (c & 0x80) >> 7; + gBattleBuffersTransferData[3] = 48; for (i = 0; i < 48; i++) - gUnknown_03004040[4 + i] = b[i]; - dp01_prepare_buffer(a, gUnknown_03004040, 52); + gBattleBuffersTransferData[4 + i] = b[i]; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 52); } void dp01_build_cmdbuf_x31_31_31_31(u8 a) { - gUnknown_03004040[0] = 49; - gUnknown_03004040[1] = 49; - gUnknown_03004040[2] = 49; - gUnknown_03004040[3] = 49; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 49; + gBattleBuffersTransferData[1] = 49; + gBattleBuffersTransferData[2] = 49; + gBattleBuffersTransferData[3] = 49; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } void dp01_build_cmdbuf_x32_32_32_32(u8 a) { - gUnknown_03004040[0] = 50; - gUnknown_03004040[1] = 50; - gUnknown_03004040[2] = 50; - gUnknown_03004040[3] = 50; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 50; + gBattleBuffersTransferData[1] = 50; + gBattleBuffersTransferData[2] = 50; + gBattleBuffersTransferData[3] = 50; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } -void dp01_build_cmdbuf_x33_a_33_33(u8 a, u8 b) +void EmitSpriteInvisibility(u8 a, u8 b) { - gUnknown_03004040[0] = 51; - gUnknown_03004040[1] = b; - gUnknown_03004040[2] = 51; - gUnknown_03004040[3] = 51; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 51; + gBattleBuffersTransferData[1] = b; + gBattleBuffersTransferData[2] = 51; + gBattleBuffersTransferData[3] = 51; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } -void dp01_build_cmdbuf_x34_a_bb_aka_battle_anim(u8 a, u8 b, u16 c) +void EmitBattleAnimation(u8 a, u8 b, u16 c) { - gUnknown_03004040[0] = 52; - gUnknown_03004040[1] = b; - gUnknown_03004040[2] = c; - gUnknown_03004040[3] = (c & 0xFF00) >> 8; - dp01_prepare_buffer(a, gUnknown_03004040, 4); + gBattleBuffersTransferData[0] = 52; + gBattleBuffersTransferData[1] = b; + gBattleBuffersTransferData[2] = c; + gBattleBuffersTransferData[3] = (c & 0xFF00) >> 8; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 4); } -void sub_800D1D8(u8 a, u8 b) +void EmitLinkStandbyMsg(u8 a, u8 b) { - gUnknown_03004040[0] = 53; - gUnknown_03004040[1] = b; - dp01_prepare_buffer(a, gUnknown_03004040, 2); + gBattleBuffersTransferData[0] = 53; + gBattleBuffersTransferData[1] = b; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 2); } -void dp01_build_cmdbuf_x38_a(u8 a, u8 b) +void EmitResetActionMoveSelection(u8 a, u8 b) { - gUnknown_03004040[0] = 54; - gUnknown_03004040[1] = b; - dp01_prepare_buffer(a, gUnknown_03004040, 2); + gBattleBuffersTransferData[0] = 54; + gBattleBuffersTransferData[1] = b; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 2); } void dp01_build_cmdbuf_x37_a(u8 a, u8 b) { - gUnknown_03004040[0] = 55; - gUnknown_03004040[1] = b; - dp01_prepare_buffer(a, gUnknown_03004040, 2); + gBattleBuffersTransferData[0] = 55; + gBattleBuffersTransferData[1] = b; + dp01_prepare_buffer(a, gBattleBuffersTransferData, 2); } diff --git a/src/rom_800D42C.c b/src/rom_800D42C.c index 6f153c340..f51779e65 100644 --- a/src/rom_800D42C.c +++ b/src/rom_800D42C.c @@ -4,7 +4,7 @@ #include "text.h" extern u16 gBattleTypeFlags; -extern u8 gUnknown_02024D26; +extern u8 gBattleOutcome; extern struct Window gUnknown_03004210; @@ -37,7 +37,7 @@ extern u8 BattleText_Tie[]; void PrintLinkBattleWinLossTie(void) { - if (gUnknown_02024D26 == 3) + if (gBattleOutcome == 3) { PRINT_MESSAGE(BattleText_Tie, TILE_OFFSET_WIN, CENTER_MESSAGE_X); return; @@ -47,7 +47,7 @@ void PrintLinkBattleWinLossTie(void) { // Double battle? - if (gUnknown_02024D26 == 1) + if (gBattleOutcome == 1) { // lp_field_18 = player position? @@ -89,7 +89,7 @@ void PrintLinkBattleWinLossTie(void) } - if (gUnknown_02024D26 == 1) + if (gBattleOutcome == 1) { if (gLinkPlayers[BATTLE_STRUCT->linkPlayerIndex].lp_field_18 != 0) { diff --git a/src/rom_8077ABC.c b/src/rom_8077ABC.c index a31a764fb..249146b37 100644 --- a/src/rom_8077ABC.c +++ b/src/rom_8077ABC.c @@ -24,11 +24,11 @@ #define NUM_BATTLE_SLOTS 4 -#define gBattleMonPartyPositions gUnknown_02024A6A +#define gBattleMonPartyPositions gBattlePartyID #define gCastformElevations gUnknownCastformData_0837F5A8 #define gCastformBackSpriteYCoords gUnknown_0837F5AC -#define gTransformPersonalities gUnknown_02024E70 -#define gBattleMonSprites gUnknown_02024BE0 +#define gTransformPersonalities gPID_perBank +#define gBattleMonSprites gObjectBankIDs struct Struct_unk_2019348 { @@ -105,11 +105,11 @@ extern u8 gBattleMonSprites[NUM_BATTLE_SLOTS]; extern u8 gBattleAnimPlayerMonIndex; extern u8 gBattleAnimEnemyMonIndex; extern s16 gBattleAnimArgs[8]; -extern u8 gUnknown_02024A72[NUM_BATTLE_SLOTS]; -extern u8 gUnknown_02024A68; // gNumBattleMons? +extern u8 gBanksBySide[NUM_BATTLE_SLOTS]; +extern u8 gNoOfAllBanks; // gNumBattleMons? extern struct OamMatrix gOamMatrices[]; extern struct Struct_2017810 unk_2017810[]; -extern u8 gUnknown_0202F7BE; +extern u8 gHappinessMoveAnim; EWRAM_DATA union AffineAnimCmd *gUnknown_0202F7D4 = NULL; EWRAM_DATA u32 filler_0202F7D8[3] = {0}; @@ -193,10 +193,10 @@ u8 sub_8077ABC(u8 slot, u8 a2) { switch (a2) { case 0: case 2: - var = gUnknown_0837F578[IS_DOUBLE_BATTLE()][battle_get_per_side_status(slot)].field_0; + var = gUnknown_0837F578[IS_DOUBLE_BATTLE()][GetBankIdentity(slot)].field_0; break; case 1: - var = gUnknown_0837F578[IS_DOUBLE_BATTLE()][battle_get_per_side_status(slot)].field_1; + var = gUnknown_0837F578[IS_DOUBLE_BATTLE()][GetBankIdentity(slot)].field_1; break; case 3: case 4: @@ -208,7 +208,7 @@ u8 sub_8077ABC(u8 slot, u8 a2) { species = unk_2019348.field_0; } } else { - if (battle_side_get_owner(slot)) { + if (GetBankSide(slot)) { transform = &gTransformStatuses[slot]; if (!transform->species) { species = GetMonData(&gEnemyParty[gBattleMonPartyPositions[slot]], MON_DATA_SPECIES); @@ -241,7 +241,7 @@ u8 sub_8077BFC(u8 slot, u16 species) { u8 ret; u16 var; - if (!battle_side_get_owner(slot) || IsContest()) { + if (!GetBankSide(slot) || IsContest()) { if (species == SPECIES_UNOWN) { if (IsContest()) { if (unk_2019348.field_4 & 1) { @@ -299,7 +299,7 @@ u8 sub_8077BFC(u8 slot, u16 species) { u8 sub_8077DD8(u8 slot, u16 species) { u8 ret = 0; - if (battle_side_get_owner(slot) == 1) { + if (GetBankSide(slot) == 1) { if (!IsContest()) { if (species == SPECIES_CASTFORM) { ret = gCastformElevations[gBattleMonForms[slot]]; @@ -316,15 +316,15 @@ u8 sub_8077DD8(u8 slot, u16 species) { u8 sub_8077E44(u8 slot, u16 species, u8 a3) { u16 offset; u8 y; - if (battle_side_get_owner(slot) == 0 || IsContest()) { + if (GetBankSide(slot) == 0 || IsContest()) { offset = sub_8077BFC(slot, species); } else { offset = sub_8077BFC(slot, species); offset -= sub_8077DD8(slot, species); } - y = offset + gUnknown_0837F578[IS_DOUBLE_BATTLE()][battle_get_per_side_status(slot)].field_1; + y = offset + gUnknown_0837F578[IS_DOUBLE_BATTLE()][GetBankIdentity(slot)].field_1; if (a3) { - if (battle_side_get_owner(slot) == 0) { + if (GetBankSide(slot) == 0) { y += 8; } if (y > 104) y = 104; @@ -366,7 +366,7 @@ u8 sub_8077F68(u8 slot) { u8 sub_8077F7C(u8 slot) { u16 var; - if (battle_side_get_owner(slot)) { + if (GetBankSide(slot)) { var = sub_8077ABC(slot, 1) + 16; } else { var = sub_8077ABC(slot, 1) + 17; @@ -380,7 +380,7 @@ u8 sub_8077FC0(u8 slot) { struct TransformStatus *transform; r6 = sub_8077ABC(slot, 1); if (!IsContest()) { - if (battle_side_get_owner(slot)) { + if (GetBankSide(slot)) { transform = &gTransformStatuses[slot]; if (!transform->species) { var = GetMonData(&gEnemyParty[gBattleMonPartyPositions[slot]], MON_DATA_SPECIES); @@ -395,7 +395,7 @@ u8 sub_8077FC0(u8 slot) { var = transform->species; } } - if (battle_side_get_owner(slot)) { + if (GetBankSide(slot)) { r6 -= sub_8077DD8(slot, var); } } @@ -678,7 +678,7 @@ void sub_807867C(struct Sprite *sprite, s16 a2) { } else if (v1 < v2) { sprite->pos1.x += a2; } else { - if (battle_side_get_owner(gBattleAnimPlayerMonIndex)) { + if (GetBankSide(gBattleAnimPlayerMonIndex)) { sprite->pos1.x -= a2; } else { sprite->pos1.x += a2; @@ -731,18 +731,18 @@ void sub_80787B0(struct Sprite *sprite, u8 a2) { sprite->pos1.y += gBattleAnimArgs[1]; } -u8 battle_side_get_owner(u8 slot) { - return gUnknown_02024A72[slot] & 1; +u8 GetBankSide(u8 slot) { + return gBanksBySide[slot] & 1; } -u8 battle_get_per_side_status(u8 slot) { - return gUnknown_02024A72[slot]; +u8 GetBankIdentity(u8 slot) { + return gBanksBySide[slot]; } -u8 battle_get_side_with_given_state(u8 slot) { +u8 GetBankByPlayerAI(u8 slot) { u8 i; - for (i = 0; i < gUnknown_02024A68; i++) { - if (gUnknown_02024A72[i] == slot) { + for (i = 0; i < gNoOfAllBanks; i++) { + if (gBanksBySide[i] == slot) { break; } } @@ -759,10 +759,10 @@ bool8 sub_8078874(u8 slot) { } return FALSE; } else { - if (gUnknown_02024A72[slot] == 0xff) { + if (gBanksBySide[slot] == 0xff) { return FALSE; } - if (battle_side_get_owner(slot)) { + if (GetBankSide(slot)) { if (GetMonData(&gEnemyParty[gBattleMonPartyPositions[slot]], MON_DATA_HP) != 0) { return TRUE; } @@ -796,7 +796,7 @@ void sub_8078954(struct Struct_sub_8078914 *unk) { unk->field_0 = (u8 *)0x6008000; unk->field_4 = (u8 *)0x600f000; unk->field_8 = 0xe; - } else if (battle_get_per_side_status_permutated(gBattleAnimPlayerMonIndex) == 1) { + } else if (GetBankIdentity_permutated(gBattleAnimPlayerMonIndex) == 1) { unk->field_0 = (u8 *)0x6004000; unk->field_4 = (u8 *)0x600e000; unk->field_8 = 0x8; @@ -1184,25 +1184,25 @@ u32 sub_80792C0(u8 a1, u8 a2, u8 a3, u8 a4) { } } else { if (a1) { - if (b_side_obj__get_some_boolean(battle_get_side_with_given_state(0))) { - var |= 1 << (battle_get_side_with_given_state(0) + 16); + if (b_side_obj__get_some_boolean(GetBankByPlayerAI(0))) { + var |= 1 << (GetBankByPlayerAI(0) + 16); } } if (a2) { - if (b_side_obj__get_some_boolean(battle_get_side_with_given_state(2))) { - shift = battle_get_side_with_given_state(2) + 16; + if (b_side_obj__get_some_boolean(GetBankByPlayerAI(2))) { + shift = GetBankByPlayerAI(2) + 16; var |= 1 << shift; } } if (a3) { - if (b_side_obj__get_some_boolean(battle_get_side_with_given_state(1))) { - shift = battle_get_side_with_given_state(1) + 16; + if (b_side_obj__get_some_boolean(GetBankByPlayerAI(1))) { + shift = GetBankByPlayerAI(1) + 16; var |= 1 << shift; } } if (a4) { - if (b_side_obj__get_some_boolean(battle_get_side_with_given_state(3))) { - shift = battle_get_side_with_given_state(3) + 16; + if (b_side_obj__get_some_boolean(GetBankByPlayerAI(3))) { + shift = GetBankByPlayerAI(3) + 16; var |= 1 << shift; } } @@ -1215,7 +1215,7 @@ u8 sub_80793A8(u8 a1) { } u8 unref_sub_80793B0(u8 a1) { - return battle_get_side_with_given_state(a1); + return GetBankByPlayerAI(a1); } void sub_80793C4(struct Sprite *sprite) { @@ -1252,7 +1252,7 @@ void sub_807941C(struct Sprite *sprite) { v2 = 1; } sub_80787B0(sprite, v1); - if (battle_side_get_owner(gBattleAnimPlayerMonIndex)) { + if (GetBankSide(gBattleAnimPlayerMonIndex)) { gBattleAnimArgs[2] = -gBattleAnimArgs[2]; } sprite->data0 = gBattleAnimArgs[4]; @@ -1264,7 +1264,7 @@ void sub_807941C(struct Sprite *sprite) { void sub_80794A8(struct Sprite *sprite) { sub_80787B0(sprite, 1); - if (battle_side_get_owner(gBattleAnimPlayerMonIndex)) { + if (GetBankSide(gBattleAnimPlayerMonIndex)) { gBattleAnimArgs[2] = -gBattleAnimArgs[2]; } sprite->data0 = gBattleAnimArgs[4]; @@ -1297,7 +1297,7 @@ void sub_8079534(struct Sprite *sprite) { sub_8078764(sprite, r4); slot = gBattleAnimEnemyMonIndex; } - if (battle_side_get_owner(gBattleAnimPlayerMonIndex)) { + if (GetBankSide(gBattleAnimPlayerMonIndex)) { gBattleAnimArgs[2] = -gBattleAnimArgs[2]; } sub_8078764(sprite, r4); @@ -1542,7 +1542,7 @@ u16 sub_8079B10(u8 sprite) { species = unk_2019348.field_0; return gMonBackPicCoords[species].y_offset; } else { - if (!battle_side_get_owner(i)) { + if (!GetBankSide(i)) { transform = &gTransformStatuses[slot]; if (!transform->species) { species = GetMonData(&gPlayerParty[gBattleMonPartyPositions[i]], MON_DATA_SPECIES); @@ -1610,11 +1610,11 @@ u8 sub_8079C74(struct Task *task) { void sub_8079CEC(u8 task) { u16 v1; - if (gUnknown_0202F7BE <= 30) { + if (gHappinessMoveAnim <= 30) { v1 = 0; - } else if (gUnknown_0202F7BE <= 100) { + } else if (gHappinessMoveAnim <= 100) { v1 = 1; - } else if (gUnknown_0202F7BE <= 200) { + } else if (gHappinessMoveAnim <= 200) { v1 = 2; } else { v1 = 3; @@ -1640,7 +1640,7 @@ void unref_sub_8079D20(u8 priority) { void sub_8079E24() { int i; - for (i = 0; i < gUnknown_02024A68; i++) { + for (i = 0; i < gNoOfAllBanks; i++) { if (b_side_obj__get_some_boolean(i)) { gSprites[gBattleMonSprites[i]].subpriority = sub_8079E90(i); gSprites[gBattleMonSprites[i]].oam.priority = 2; @@ -1658,7 +1658,7 @@ u8 sub_8079E90(u8 slot) { return 40; } } else { - status = battle_get_per_side_status(slot); + status = GetBankIdentity(slot); if (status == 0) { ret = 30; } else if (status == 2) { @@ -1673,7 +1673,7 @@ u8 sub_8079E90(u8 slot) { } u8 sub_8079ED4(u8 slot) { - u8 status = battle_get_per_side_status(slot); + u8 status = GetBankIdentity(slot); if (IsContest()) { return 2; } @@ -1684,10 +1684,10 @@ u8 sub_8079ED4(u8 slot) { } } -u8 battle_get_per_side_status_permutated(u8 slot) { +u8 GetBankIdentity_permutated(u8 slot) { u8 status; if (!IsContest()) { - status = battle_get_per_side_status(slot); + status = GetBankIdentity(slot); if (status == 0 || status == 3) { return 2; } else { @@ -1785,7 +1785,7 @@ int sub_807A100(u8 slot, u8 a2) { coords = &gMonBackPicCoords[0]; } } else { - if (!battle_side_get_owner(slot)) { + if (!GetBankSide(slot)) { transform = &gTransformStatuses[slot]; if (!transform->species) { species = GetMonData(&gPlayerParty[gBattleMonPartyPositions[slot]], MON_DATA_SPECIES); @@ -1892,7 +1892,7 @@ u8 sub_807A4A0(int a1, u8 sprite, int a3) { void sub_807A544(struct Sprite *sprite) { sub_8078650(sprite); - if (battle_side_get_owner(gBattleAnimPlayerMonIndex)) { + if (GetBankSide(gBattleAnimPlayerMonIndex)) { sprite->pos1.x -= gBattleAnimArgs[0]; gBattleAnimArgs[3] = -gBattleAnimArgs[3]; sprite->hFlip = TRUE; @@ -1909,7 +1909,7 @@ void sub_807A544(struct Sprite *sprite) { } void sub_807A5C4(struct Sprite *sprite) { - if (battle_side_get_owner(gBattleAnimPlayerMonIndex)) { + if (GetBankSide(gBattleAnimPlayerMonIndex)) { sprite->pos1.x -= gBattleAnimArgs[0]; gBattleAnimArgs[3] *= -1; } else { @@ -1927,7 +1927,7 @@ void sub_807A5C4(struct Sprite *sprite) { void sub_807A63C(struct Sprite *sprite) { sub_8078650(sprite); - if (battle_side_get_owner(gBattleAnimPlayerMonIndex)) { + if (GetBankSide(gBattleAnimPlayerMonIndex)) { sprite->pos1.x -= gBattleAnimArgs[0]; } else { sprite->pos1.x += gBattleAnimArgs[0]; @@ -1942,7 +1942,7 @@ void sub_807A69C(u8 taskId) { u16 dest; struct Task *task = &gTasks[taskId]; task->data[0] = obj_id_for_side_relative_to_move(0); - task->data[1] = (battle_side_get_owner(gBattleAnimPlayerMonIndex)) ? -8 : 8; + task->data[1] = (GetBankSide(gBattleAnimPlayerMonIndex)) ? -8 : 8; task->data[2] = 0; task->data[3] = 0; gSprites[task->data[0]].pos2.x -= task->data[0]; @@ -2014,7 +2014,7 @@ void sub_807A8D4(struct Sprite *sprite) { void sub_807A908(struct Sprite *sprite) { sprite->pos1.x = sub_8077ABC(gBattleAnimPlayerMonIndex, 2); sprite->pos1.y = sub_8077ABC(gBattleAnimPlayerMonIndex, 3); - if (!battle_side_get_owner(gBattleAnimPlayerMonIndex)) { + if (!GetBankSide(gBattleAnimPlayerMonIndex)) { sprite->data0 = 5; } else { sprite->data0 = -10; @@ -2041,7 +2041,7 @@ void sub_807A9BC(struct Sprite *sprite) { sprite->data0 = gBattleAnimArgs[2]; sprite->data2 = sprite->pos1.x + gBattleAnimArgs[4]; sprite->data4 = sprite->pos1.y + gBattleAnimArgs[5]; - if (!battle_side_get_owner(gBattleAnimEnemyMonIndex)) { + if (!GetBankSide(gBattleAnimEnemyMonIndex)) { x = (u16)gBattleAnimArgs[4] + 30; sprite->pos1.x += x; sprite->pos1.y = gBattleAnimArgs[5] - 20; diff --git a/src/safari_zone.c b/src/safari_zone.c index fa6c11f52..a47c8e951 100644 --- a/src/safari_zone.c +++ b/src/safari_zone.c @@ -23,7 +23,7 @@ struct PokeblockFeeder static void ClearAllPokeblockFeeders(void); static void DecrementFeederStepCounters(void); -extern u8 gUnknown_02024D26; +extern u8 gBattleOutcome; EWRAM_DATA u8 gNumSafariBalls = 0; EWRAM_DATA static u16 gSafariZoneStepCounter = 0; @@ -99,14 +99,14 @@ void sub_80C824C(void) { SetMainCallback2(c2_exit_to_overworld_2_switch); } - else if (gUnknown_02024D26 == 8) + else if (gBattleOutcome == 8) { ScriptContext2_RunNewScript(&gUnknown_081C340A); warp_in(); gFieldCallback = sub_8080E44; SetMainCallback2(CB2_LoadMap); } - else if (gUnknown_02024D26 == 7) + else if (gBattleOutcome == 7) { ScriptContext1_SetupScript(&gUnknown_081C3459); ScriptContext1_Stop(); diff --git a/src/script_pokemon_util_80C4BF0.c b/src/script_pokemon_util_80C4BF0.c index c8171db52..fb72be527 100644 --- a/src/script_pokemon_util_80C4BF0.c +++ b/src/script_pokemon_util_80C4BF0.c @@ -31,7 +31,7 @@ extern struct SpriteTemplate gUnknown_02024E8C; extern u8 gContestPlayerMonIndex; extern u8 gIsLinkContest; extern u8 gPlayerPartyCount; -extern u8 gSelectedOrderFromParty[]; +extern u8 gBufferedMoves[]; extern u16 gSpecialVar_0x8004; extern u16 gSpecialVar_0x8005; @@ -648,7 +648,7 @@ void sub_80C5568(void) void sub_80C5580(void) { - u8 var = gSelectedOrderFromParty[0]; + u8 var = gBufferedMoves[0]; switch(var) { @@ -671,7 +671,7 @@ void ChooseBattleTowerPlayerParty(void) void SetBattleTowerPlayerParty(void) { - u8 var = gSelectedOrderFromParty[0]; + u8 var = gBufferedMoves[0]; switch(var) { @@ -697,8 +697,8 @@ void ReducePlayerPartyToThree(void) // copy the selected pokemon according to the order. for(i = 0; i < 3; i++) - if(gSelectedOrderFromParty[i]) // as long as the order keeps going (did the player select 1 mon? 2? 3?), do not stop - party[i] = gPlayerParty[gSelectedOrderFromParty[i] - 1]; // index is 0 based, not literal + if(gBufferedMoves[i]) // as long as the order keeps going (did the player select 1 mon? 2? 3?), do not stop + party[i] = gPlayerParty[gBufferedMoves[i] - 1]; // index is 0 based, not literal // delete the last 3 pokemon CpuFill32(0, gPlayerParty, sizeof gPlayerParty); diff --git a/src/tv.c b/src/tv.c index ca9785da6..14e7cf143 100644 --- a/src/tv.c +++ b/src/tv.c @@ -44,7 +44,7 @@ struct UnkTvStruct s8 var0; }; -extern struct Struct30042E0 gUnknown_030042E0; +extern struct Struct30042E0 gBattleResults; extern u8 gUnknown_0300430A[11]; struct OutbreakPokemon @@ -101,9 +101,9 @@ extern u16 gScriptLastTalked; extern u8 gScriptContestCategory; extern u8 gScriptContestRank; extern u8 gUnknown_03004316[11]; -extern u8 gUnknown_02024D26; +extern u8 gBattleOutcome; -extern u16 gUnknown_02024C04; +extern u16 gLastUsedItem; extern u8 ewram[]; #define gUnknown_02007000 (*(ewramStruct_02007000 *)(ewram + 0x7000)) @@ -132,7 +132,7 @@ extern u16 sub_8135D3C(u8); extern u8 gScriptContestCategory; extern u8 gScriptContestRank; extern u8 gUnknown_03004316[11]; -extern u8 gUnknown_02024D26; +extern u8 gBattleOutcome; void sub_80BF334(void); void sub_80BF3A4(void); @@ -156,7 +156,7 @@ void sub_80BEA88(void); void sub_80BE138(TVShow *show); void sub_80BE160(TVShow *show); -extern u16 gUnknown_02024C04; +extern u16 gLastUsedItem; void sub_80BE5FC(void); void sub_80BE65C(void); @@ -430,33 +430,33 @@ void TakeTVShowInSearchOfTrainersOffTheAir(void); void GabbyAndTyBeforeInterview(void) { u8 i; - gSaveBlock1.gabbyAndTyData.mon1 = gUnknown_030042E0.unk6; - gSaveBlock1.gabbyAndTyData.mon2 = gUnknown_030042E0.unk26; - gSaveBlock1.gabbyAndTyData.lastMove = gUnknown_030042E0.unk22; + gSaveBlock1.gabbyAndTyData.mon1 = gBattleResults.unk6; + gSaveBlock1.gabbyAndTyData.mon2 = gBattleResults.unk26; + gSaveBlock1.gabbyAndTyData.lastMove = gBattleResults.unk22; if (gSaveBlock1.gabbyAndTyData.battleNum != 0xff) { gSaveBlock1.gabbyAndTyData.battleNum ++; } - gSaveBlock1.gabbyAndTyData.valA_0 = gUnknown_030042E0.unk5_0; - if (gUnknown_030042E0.unk0) + gSaveBlock1.gabbyAndTyData.valA_0 = gBattleResults.unk5_0; + if (gBattleResults.unk0) { gSaveBlock1.gabbyAndTyData.valA_1 = 1; } else { gSaveBlock1.gabbyAndTyData.valA_1 = 0; } - if (gUnknown_030042E0.unk3) + if (gBattleResults.unk3) { gSaveBlock1.gabbyAndTyData.valA_2 = 1; } else { gSaveBlock1.gabbyAndTyData.valA_2 = 0; } - if (!gUnknown_030042E0.unk5_1) + if (!gBattleResults.unk5_1) { for (i=0; i<11; i++) { - if (gUnknown_030042E0.unk36[i] != 0) + if (gBattleResults.unk36[i] != 0) { gSaveBlock1.gabbyAndTyData.valA_3 = 1; break; @@ -612,38 +612,38 @@ void sub_80BDEC8(void) { total = 0; sub_80BEB20(); sub_80BE778(); - if (gUnknown_030042E0.unk28 == 0) { + if (gBattleResults.unk28 == 0) { sub_80BE074(); } else { sub_80BE028(); - if (sub_80BF77C(0xffff) == 0 && StringCompareWithoutExtCtrlCodes(gSpeciesNames[gUnknown_030042E0.unk28], gUnknown_030042E0.unk2A) != 0) { + if (sub_80BF77C(0xffff) == 0 && StringCompareWithoutExtCtrlCodes(gSpeciesNames[gBattleResults.unk28], gBattleResults.unk2A) != 0) { gUnknown_03005D38.var0 = sub_80BF74C(gSaveBlock1.tvShows); if (gUnknown_03005D38.var0 != -1 && sub_80BF1B4(TVSHOW_POKEMON_TODAY_CAUGHT) != 1) { for (i=0; i<11; i++) { - total += gUnknown_030042E0.unk36[i]; + total += gBattleResults.unk36[i]; } - if (total != 0 || gUnknown_030042E0.unk5_1 != 0) { + if (total != 0 || gBattleResults.unk5_1 != 0) { total = FALSE; show = &gSaveBlock1.tvShows[gUnknown_03005D38.var0]; show->pokemonToday.var00 = TVSHOW_POKEMON_TODAY_CAUGHT; show->pokemonToday.var01 = total; - if (gUnknown_030042E0.unk5_1 != 0) { + if (gBattleResults.unk5_1 != 0) { total = 1; item = ITEM_MASTER_BALL; } else { for (i=0; i<11; i++) { - total += gUnknown_030042E0.unk36[i]; + total += gBattleResults.unk36[i]; } if (total > 0xff) { total = 0xff; } - item = gUnknown_02024C04; + item = gLastUsedItem; } show->pokemonToday.var12 = total; show->pokemonToday.ball = item; StringCopy(show->pokemonToday.playerName, gSaveBlock2.playerName); - StringCopy(show->pokemonToday.nickname, gUnknown_030042E0.unk2A); - show->pokemonToday.species = gUnknown_030042E0.unk28; + StringCopy(show->pokemonToday.nickname, gBattleResults.unk2A); + show->pokemonToday.species = gBattleResults.unk28; sub_80BE138(show); show->pokemonToday.language = GAME_LANGUAGE; show->pokemonToday.language2 = sub_80BDEAC(show->pokemonToday.nickname); @@ -663,8 +663,8 @@ void sub_80BE028(void) { buffer->worldOfMasters.var00 = TVSHOW_WORLD_OF_MASTERS; } buffer->worldOfMasters.var02++; - buffer->worldOfMasters.var04 = gUnknown_030042E0.unk28; - buffer->worldOfMasters.var08 = gUnknown_030042E0.unk6; + buffer->worldOfMasters.var04 = gBattleResults.unk28; + buffer->worldOfMasters.var08 = gBattleResults.unk6; buffer->worldOfMasters.var0a = gMapHeader.name; } @@ -681,7 +681,7 @@ void sub_80BE074(void) { if (total > 0xff) { total = 0xff; } - if (total > 2 && gUnknown_02024D26 == 1) { + if (total > 2 && gBattleOutcome == 1) { gUnknown_03005D38.var0 = sub_80BF74C(gSaveBlock1.tvShows); if (gUnknown_03005D38.var0 != -1 && sub_80BF1B4(TVSHOW_POKEMON_TODAY_FAILED) != 1) { flag = FALSE; @@ -689,10 +689,10 @@ void sub_80BE074(void) { asm_comment("Here the wrong registers are used to hold the show ID and flag."); show->pokemonTodayFailed.var00 = TVSHOW_POKEMON_TODAY_FAILED; show->pokemonTodayFailed.var01 = flag; - show->pokemonTodayFailed.species = gUnknown_030042E0.unk6; - show->pokemonTodayFailed.species2 = gUnknown_030042E0.unk20; + show->pokemonTodayFailed.species = gBattleResults.unk6; + show->pokemonTodayFailed.species2 = gBattleResults.unk20; show->pokemonTodayFailed.var10 = total; - show->pokemonTodayFailed.var11 = gUnknown_02024D26; + show->pokemonTodayFailed.var11 = gBattleOutcome; show->pokemonTodayFailed.var12 = gMapHeader.name; StringCopy(show->pokemonTodayFailed.playerName, gSaveBlock2.playerName); sub_80BE138(show); @@ -731,7 +731,7 @@ _080BE088:\n\ _080BE0A2:\n\ cmp r5, 0x2\n\ bls _080BE112\n\ - ldr r7, _080BE120 @ =gUnknown_02024D26\n\ + ldr r7, _080BE120 @ =gBattleOutcome\n\ ldrb r0, [r7]\n\ cmp r0, 0x1\n\ bne _080BE112\n\ @@ -763,7 +763,7 @@ _080BE0A2:\n\ movs r0, 0x17\n\ strb r0, [r4]\n\ strb r1, [r4, 0x1]\n\ - ldr r1, _080BE12C @ =gUnknown_030042E0\n\ + ldr r1, _080BE12C @ =gBattleResults\n\ ldrh r0, [r1, 0x6]\n\ strh r0, [r4, 0xC]\n\ ldrh r0, [r1, 0x20]\n\ @@ -789,10 +789,10 @@ _080BE112:\n\ .align 2, 0\n\ _080BE118: .4byte 0x0000ffff\n\ _080BE11C: .4byte gUnknown_03004316\n\ -_080BE120: .4byte gUnknown_02024D26\n\ +_080BE120: .4byte gBattleOutcome\n\ _080BE124: .4byte gSaveBlock1 + 0x2738\n\ _080BE128: .4byte gUnknown_03005D38\n\ -_080BE12C: .4byte gUnknown_030042E0\n\ +_080BE12C: .4byte gBattleResults\n\ _080BE130: .4byte gMapHeader\n\ _080BE134: .4byte gSaveBlock2\n\ .syntax divided\n"); diff --git a/src/unknown_debug_menu.c b/src/unknown_debug_menu.c index 2cdcbaabd..6a8bad0d4 100644 --- a/src/unknown_debug_menu.c +++ b/src/unknown_debug_menu.c @@ -1,7 +1,7 @@ #include "global.h" #include "menu.h" -extern u8 gUnknown_02024D1E[]; +extern u8 gBattleCommunication[]; extern u8 (*gCallback_03004AE8)(void); @@ -33,7 +33,7 @@ static u8 sub_814A464(void) } else { - gUnknown_02024D1E[0] = result; + gBattleCommunication[0] = result; gCallback_03004AE8 = gUnknown_0842C29C[result].func; return 0; } @@ -43,8 +43,8 @@ u8 sub_814A4B8(void) { gSaveBlock2.filler_A8.var_4AE = 3; gSaveBlock2.filler_A8.var_4AF = 3; - gSaveBlock2.filler_A8.var_4B4 = gUnknown_02024D1E[0] + 1; - gSaveBlock2.filler_A8.var_4B6 = gUnknown_02024D1E[0] + 1; + gSaveBlock2.filler_A8.var_4B4 = gBattleCommunication[0] + 1; + gSaveBlock2.filler_A8.var_4B6 = gBattleCommunication[0] + 1; gSaveBlock2.filler_A8.var_4B0 = 1; gSaveBlock2.filler_A8.var_4B2 = 1; CloseMenu(); -- cgit v1.2.3 From 829371c3e0fcc6593ed6853b23f473a127ebfa05 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sun, 18 Jun 2017 16:03:58 -0500 Subject: decompile sub_8046400 - sub_8046E9C --- src/pokeball.c | 519 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 519 insertions(+) create mode 100644 src/pokeball.c (limited to 'src') diff --git a/src/pokeball.c b/src/pokeball.c new file mode 100644 index 000000000..cd5eb46d1 --- /dev/null +++ b/src/pokeball.c @@ -0,0 +1,519 @@ +#include "global.h" +#include "gba/m4a_internal.h" +#include "battle.h" +#include "main.h" +#include "pokemon.h" +#include "rom_8077ABC.h" +#include "songs.h" +#include "sound.h" +#include "sprite.h" +#include "task.h" +#include "trig.h" + +extern struct MusicPlayerInfo gMPlay_BGM; +extern u16 gBattleTypeFlags; +extern u8 gBankTarget; +extern u8 gActiveBank; +extern u16 gBattlePartyID[]; +extern u8 gObjectBankIDs[]; +extern u8 gDoingBattleAnim; + +extern const struct SpriteTemplate gSpriteTemplate_820AAB4[]; + +extern u32 ball_number_to_ball_processing_index(u16); // not sure of return type +extern void sub_80786EC(); +extern bool8 sub_8078718(struct Sprite *); +extern void sub_814086C(u8, u8, int, int, u8); +extern u8 sub_8141314(u8, u8, u8, u8); + +void sub_8046464(u8); +void sub_80466E8(struct Sprite *); +void sub_80466F4(struct Sprite *); +void sub_8046760(struct Sprite *); +void sub_80467F8(struct Sprite *); +void sub_804684C(struct Sprite *); +void sub_8046944(struct Sprite *); +void sub_8046984(struct Sprite *); +void sub_8046C78(struct Sprite *); +void sub_8046E7C(struct Sprite *); +void sub_8046E9C(struct Sprite *); +void sub_8046FBC(struct Sprite *); +void sub_8047074(struct Sprite *); +void sub_8047254(struct Sprite *); +void sub_80478DC(); +void sub_804794C(u8); +u16 sub_8047978(); + +u8 sub_8046400(u16 a, u8 b) +{ + u8 taskId; + + gDoingBattleAnim = 1; + ewram17810[gActiveBank].unk0_3 = 1; + taskId = CreateTask(sub_8046464, 5); + gTasks[taskId].data[1] = a; + gTasks[taskId].data[2] = b; + gTasks[taskId].data[3] = gActiveBank; + return 0; +} + +void sub_8046464(u8 taskId) +{ + bool8 sp0 = FALSE; + u16 r8; + u8 r5; + u16 ball; + u8 r4; + u8 spriteId; + + if (gTasks[taskId].data[0] == 0) + { + gTasks[taskId].data[0]++; + return; + } + r8 = gTasks[taskId].data[2]; + r5 = gTasks[taskId].data[3]; + if (GetBankSide(r5) != 0) + ball = GetMonData(&gEnemyParty[gBattlePartyID[r5]], MON_DATA_POKEBALL); + else + ball = GetMonData(&gPlayerParty[gBattlePartyID[r5]], MON_DATA_POKEBALL); + r4 = ball_number_to_ball_processing_index(ball); + sub_80478DC(r4); + spriteId = CreateSprite(&gSpriteTemplate_820AAB4[r4], 32, 80, 0x1D); + gSprites[spriteId].data0 = 0x80; + gSprites[spriteId].data1 = 0; + gSprites[spriteId].data7 = r8; + switch (r8) + { + case 0xFF: + gBankTarget = r5; + gSprites[spriteId].pos1.x = 0x18; + gSprites[spriteId].pos1.y = 0x44; + gSprites[spriteId].callback = sub_8047074; + break; + case 0xFE: + gSprites[spriteId].pos1.x = sub_8077ABC(r5, 0); + gSprites[spriteId].pos1.y = sub_8077ABC(r5, 1) + 0x18; + gBankTarget = r5; + gSprites[spriteId].data0 = 0; + gSprites[spriteId].callback = sub_8047254; + break; + default: + gBankTarget = GetBankByPlayerAI(1); + sp0 = TRUE; + break; + } + gSprites[spriteId].data6 = gBankTarget; + if (!sp0) + { + DestroyTask(taskId); + return; + } + gSprites[spriteId].data0 = 0x22; + gSprites[spriteId].data2 = sub_8077ABC(gBankTarget, 0); + gSprites[spriteId].data4 = sub_8077ABC(gBankTarget, 1) - 16; + gSprites[spriteId].data5 = -40; + sub_80786EC(&gSprites[spriteId]); + gSprites[spriteId].oam.affineParam = taskId; + gTasks[taskId].data[4] = gBankTarget; + gTasks[taskId].func = TaskDummy; + PlaySE(SE_NAGERU); +} + +void objc_0804ABD4(struct Sprite *sprite) +{ + if (sub_8078718(sprite)) + { + u8 taskId = sprite->oam.affineParam; + u8 r5 = gTasks[taskId].data[4]; + u8 r8 = gTasks[taskId].data[2]; + u32 r4; // not sure of this type + + StartSpriteAnim(sprite, 1); + sprite->affineAnimPaused = TRUE; + sprite->pos1.x += sprite->pos2.x; + sprite->pos1.y += sprite->pos2.y; + sprite->pos2.x = 0; + sprite->pos2.y = 0; + sprite->data5 = 0; + r4 = ball_number_to_ball_processing_index(sub_8047978(r5)); + sub_814086C(sprite->pos1.x, sprite->pos1.y - 5, 1, 0x1C, r4); + sprite->data0 = sub_8141314(0, r5, 14, r4); + sprite->data6 = r5; + sprite->data7 = r8; + DestroyTask(taskId); + sprite->callback = sub_80466E8; + } +} + +void sub_80466E8(struct Sprite *sprite) +{ + sprite->callback = sub_80466F4; +} + +void sub_80466F4(struct Sprite *sprite) +{ + sprite->data5++; + if (sprite->data5 == 10) + { + sprite->data5 = 0; + sprite->callback = sub_8046760; + StartSpriteAffineAnim(&gSprites[gObjectBankIDs[sprite->data6]], 2); + AnimateSprite(&gSprites[gObjectBankIDs[sprite->data6]]); + gSprites[gObjectBankIDs[sprite->data6]].data1 = 0; + } +} + +void sub_8046760(struct Sprite *sprite) +{ + sprite->data5++; + if (sprite->data5 == 11) + PlaySE(SE_SUIKOMU); + if (gSprites[gObjectBankIDs[sprite->data6]].affineAnimEnded) + { + StartSpriteAnim(sprite, 2); + gSprites[gObjectBankIDs[sprite->data6]].invisible = TRUE; + sprite->data5 = 0; + sprite->callback = sub_80467F8; + } + else + { + gSprites[gObjectBankIDs[sprite->data6]].data1 += 0x60; + gSprites[gObjectBankIDs[sprite->data6]].pos2.y = -gSprites[gObjectBankIDs[sprite->data6]].data1 >> 8; + } +} + +void sub_80467F8(struct Sprite *sprite) +{ + if (sprite->animEnded) + { + sprite->data5++; + if (sprite->data5 == 1) + { + sprite->data3 = 0; + sprite->data4 = 32; + sprite->data5 = 0; + sprite->pos1.y += Cos(0, 32); + sprite->pos2.y = -Cos(0, sprite->data4); + sprite->callback = sub_804684C; + } + } +} + +void sub_804684C(struct Sprite *sprite) +{ + bool8 r5 = FALSE; + + switch (sprite->data3 & 0xFF) + { + case 0: + sprite->pos2.y = -Cos(sprite->data5, sprite->data4); + sprite->data5 += 4 + (sprite->data3 >> 8); + if (sprite->data5 >= 64) + { + sprite->data4 -= 10; + sprite->data3 += 0x101; + if (sprite->data3 >> 8 == 4) + r5 = TRUE; + switch (sprite->data3 >> 8) + { + case 1: + PlaySE(SE_KON); + break; + case 2: + PlaySE(SE_KON2); + break; + case 3: + PlaySE(SE_KON3); + break; + default: + PlaySE(SE_KON4); + break; + } + } + break; + case 1: + sprite->pos2.y = -Cos(sprite->data5, sprite->data4); + sprite->data5 -= 4 + (sprite->data3 >> 8); + if (sprite->data5 <= 0) + { + sprite->data5 = 0; + sprite->data3 &= 0xFF00; + } + break; + } + if (r5) + { + sprite->data3 = 0; + sprite->pos1.y += Cos(64, 32); + sprite->pos2.y = 0; + if (sprite->data7 == 0) + { + sprite->callback = sub_8046C78; + } + else + { + sprite->callback = sub_8046944; + sprite->data4 = 1; + sprite->data5 = 0; + } + } +} + +void sub_8046944(struct Sprite *sprite) +{ + sprite->data3++; + if (sprite->data3 == 31) + { + sprite->data3 = 0; + sprite->affineAnimPaused = TRUE; + StartSpriteAffineAnim(sprite, 1); + sprite->callback = sub_8046984; + PlaySE(SE_BOWA); + } +} + +void sub_8046984(struct Sprite *sprite) +{ + switch (sprite->data3 & 0xFF) + { + case 0: + case 2: + sprite->pos2.x += sprite->data4; + sprite->data5 += sprite->data4; + sprite->affineAnimPaused = FALSE; + if (sprite->data5 > 3 || sprite->data5 < -3) + { + sprite->data3++; + sprite->data5 = 0; + } + break; + case 1: + sprite->data5++; + if (sprite->data5 == 1) + { + sprite->data5 = 0; + sprite->data4 = -sprite->data4; + sprite->data3++; + sprite->affineAnimPaused = FALSE; + if (sprite->data4 < 0) + ChangeSpriteAffineAnim(sprite, 2); + else + ChangeSpriteAffineAnim(sprite, 1); + } + else + { + sprite->affineAnimPaused = TRUE; + } + break; + case 3: + sprite->data3 += 0x100; + if (sprite->data3 >> 8 == sprite->data7) + { + sprite->callback = sub_8046C78; + } + else + { + if (sprite->data7 == 4 && sprite->data3 >> 8 == 3) + { + sprite->callback = sub_8046E7C; + sprite->affineAnimPaused = TRUE; + } + else + { + sprite->data3++; + sprite->affineAnimPaused = TRUE; + } + } + break; + case 4: + default: + sprite->data5++; + if (sprite->data5 == 31) + { + sprite->data5 = 0; + sprite->data3 &= 0xFF00; + StartSpriteAffineAnim(sprite, 3); + if (sprite->data4 < 0) + StartSpriteAffineAnim(sprite, 2); + else + StartSpriteAffineAnim(sprite, 1); + PlaySE(SE_BOWA); + } + break; + } +} + +void sub_8046AD0(u8 taskId) +{ + u8 r6 = gTasks[taskId].data[2]; + u8 r3 = gTasks[taskId].data[1]; + u16 species = gTasks[taskId].data[0]; + + switch (gTasks[taskId].data[15]) + { + case 0: + default: + if (gTasks[taskId].data[8] < 3) + gTasks[taskId].data[8]++; + else + gTasks[taskId].data[15] = r6 + 1; + break; + case 1: + PlayCry1(species, r3); + DestroyTask(taskId); + break; + case 2: + StopCryAndClearCrySongs(); + gTasks[taskId].data[10] = 3; + gTasks[taskId].data[15] = 20; + break; + case 20: + if (gTasks[taskId].data[10] != 0) + { + gTasks[taskId].data[10]--; + break; + } + PlayCry4(species, r3, 1); + DestroyTask(taskId); + break; + case 3: + gTasks[taskId].data[10] = 6; + gTasks[taskId].data[15] = 30; + break; + case 30: + if (gTasks[taskId].data[10] != 0) + { + gTasks[taskId].data[10]--; + break; + } + gTasks[taskId].data[15]++; + // fall through + case 31: + if (!IsCryPlayingOrClearCrySongs()) + { + StopCryAndClearCrySongs(); + gTasks[taskId].data[10] = 3; + gTasks[taskId].data[15]++; + } + break; + case 32: + if (gTasks[taskId].data[10] != 0) + { + gTasks[taskId].data[10]--; + break; + } + PlayCry4(species, r3, 0); + DestroyTask(taskId); + break; + } +} + +void sub_8046C78(struct Sprite *sprite) +{ + u8 r5 = sprite->data6; + u32 r4; // not sure of this type + + StartSpriteAnim(sprite, 1); + r4 = ball_number_to_ball_processing_index(sub_8047978(r5)); + sub_814086C(sprite->pos1.x, sprite->pos1.y - 5, 1, 0x1C, r4); + sprite->data0 = sub_8141314(1, sprite->data6, 14, r4); + sprite->callback = sub_8046E9C; + if (gMain.inBattle) + { + struct Pokemon *pkmn; + u16 species; + s8 r8; + u16 r4_2; + u8 taskId; + + if (GetBankSide(r5) != 0) + { + pkmn = &gEnemyParty[gBattlePartyID[r5]]; + r8 = 25; + } + else + { + pkmn = &gPlayerParty[gBattlePartyID[r5]]; + r8 = -25; + } + species = GetMonData(pkmn, MON_DATA_SPECIES); + if ((r5 == GetBankByPlayerAI(0) || r5 == GetBankByPlayerAI(1)) + && IsDoubleBattle() && ewram17840.unk9_0) + { + if (gBattleTypeFlags & BATTLE_TYPE_MULTI) + { + if (IsBGMPlaying()) + m4aMPlayStop(&gMPlay_BGM); + } + else + { + m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 128); + } + } + if (!IsDoubleBattle() || !ewram17840.unk9_0) + r4_2 = 0; + else if (r5 == GetBankByPlayerAI(0) || r5 == GetBankByPlayerAI(1)) + r4_2 = 1; + else + r4_2 = 2; + taskId = CreateTask(sub_8046AD0, 3); + gTasks[taskId].data[0] = species; + gTasks[taskId].data[1] = r8; + gTasks[taskId].data[2] = r4_2; + gTasks[taskId].data[15] = 0; + } + StartSpriteAffineAnim(&gSprites[gObjectBankIDs[sprite->data6]], 1); + AnimateSprite(&gSprites[gObjectBankIDs[sprite->data6]]); + gSprites[gObjectBankIDs[sprite->data6]].data1 = 0x1000; +} + +void sub_8046E7C(struct Sprite *sprite) +{ + sprite->animPaused = TRUE; + sprite->callback = sub_8046FBC; + sprite->data3 = 0; + sprite->data4 = 0; + sprite->data5 = 0; +} + +void sub_8046E9C(struct Sprite *sprite) +{ + bool8 r7 = FALSE; + u8 r4 = sprite->data6; + + gSprites[gObjectBankIDs[r4]].invisible = FALSE; + if (sprite->animEnded) + sprite->invisible = TRUE; + if (gSprites[gObjectBankIDs[r4]].affineAnimEnded) + { + StartSpriteAffineAnim(&gSprites[gObjectBankIDs[r4]], 0); + r7 = TRUE; + } + else + { + gSprites[gObjectBankIDs[r4]].data1 -= 288; + gSprites[gObjectBankIDs[r4]].pos2.y = gSprites[gObjectBankIDs[r4]].data1 >> 8; + } + if (sprite->animEnded && r7) + { + s32 i; + u32 r3; + + gSprites[gObjectBankIDs[r4]].pos2.y = 0; + gDoingBattleAnim = 0; + ewram17810[r4].unk0_3 = 0; + FreeSpriteOamMatrix(sprite); + DestroySprite(sprite); + for (r3 = 0, i = 0; i < 4; i++) + { + if (ewram17810[i].unk0_3 == 0) + r3++; + } + if (r3 == 4) + { + for (i = 0; i < 12; i++) + sub_804794C(i); + } + } +} -- cgit v1.2.3 From 5041f91c4bc412cf3c7a8b23b65444b775ae7d3c Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sun, 18 Jun 2017 18:25:37 -0500 Subject: decompile sub_8046FBC - sub_80470C4 --- src/pokeball.c | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) (limited to 'src') diff --git a/src/pokeball.c b/src/pokeball.c index cd5eb46d1..113be945b 100644 --- a/src/pokeball.c +++ b/src/pokeball.c @@ -1,6 +1,7 @@ #include "global.h" #include "gba/m4a_internal.h" #include "battle.h" +#include "m4a.h" #include "main.h" #include "pokemon.h" #include "rom_8077ABC.h" @@ -39,6 +40,8 @@ void sub_8046E7C(struct Sprite *); void sub_8046E9C(struct Sprite *); void sub_8046FBC(struct Sprite *); void sub_8047074(struct Sprite *); +void sub_80470C4(struct Sprite *); +void sub_8047230(struct Sprite *); void sub_8047254(struct Sprite *); void sub_80478DC(); void sub_804794C(u8); @@ -517,3 +520,95 @@ void sub_8046E9C(struct Sprite *sprite) } } } + +void sub_8046FBC(struct Sprite *sprite) +{ + u8 r7 = sprite->data6; + + sprite->data4++; + if (sprite->data4 == 40) + { + return; + } + else if (sprite->data4 == 95) + { + gDoingBattleAnim = 0; + m4aMPlayAllStop(); + PlaySE(BGM_FANFA5); + } + else if (sprite->data4 == 315) + { + FreeOamMatrix(gSprites[gObjectBankIDs[sprite->data6]].oam.matrixNum); + DestroySprite(&gSprites[gObjectBankIDs[sprite->data6]]); + DestroySpriteAndFreeResources(sprite); + if (gMain.inBattle) + ewram17810[r7].unk0_3 = 0; + } +} + +void sub_8047074(struct Sprite *sprite) +{ + sprite->data0 = 25; + sprite->data2 = sub_8077ABC(sprite->data6, 2); + sprite->data4 = sub_8077ABC(sprite->data6, 3) + 0x18; + sprite->data5 = -30; + sprite->oam.affineParam = sprite->data6; + sub_80786EC(sprite); + sprite->callback = sub_80470C4; +} + +#define HIBYTE(x) (((x) >> 8) & 0xFF) + +void sub_80470C4(struct Sprite *sprite) +{ + u32 r6; + u32 r7; + + if (HIBYTE(sprite->data7) >= 35 && HIBYTE(sprite->data7) < 80) + { + s16 r4; + + if ((sprite->oam.affineParam & 0xFF00) == 0) + { + r6 = sprite->data1 & 1; + r7 = sprite->data2 & 1; + sprite->data1 = ((sprite->data1 / 3) & ~1) | r6; + sprite->data2 = ((sprite->data2 / 3) & ~1) | r7; + StartSpriteAffineAnim(sprite, 4); + } + r4 = sprite->data0; + sub_8078B5C(sprite); + sprite->data7 += sprite->data6 / 3; + sprite->pos2.y += Sin(HIBYTE(sprite->data7), sprite->data5); + sprite->oam.affineParam += 0x100; + if ((sprite->oam.affineParam >> 8) % 3 != 0) + sprite->data0 = r4; + else + sprite->data0 = r4 - 1; + if (HIBYTE(sprite->data7) >= 80) + { + r6 = sprite->data1 & 1; + r7 = sprite->data2 & 1; + sprite->data1 = ((sprite->data1 * 3) & ~1) | r6; + sprite->data2 = ((sprite->data2 * 3) & ~1) | r7; + } + } + else + { + if (sub_8078718(sprite)) + { + sprite->pos1.x += sprite->pos2.x; + sprite->pos1.y += sprite->pos2.y; + sprite->pos2.y = 0; + sprite->pos2.x = 0; + sprite->data6 = sprite->oam.affineParam & 0xFF; + sprite->data0 = 0; + if (IsDoubleBattle() && ewram17840.unk9_0 + && sprite->data6 == GetBankByPlayerAI(2)) + sprite->callback = sub_8047230; + else + sprite->callback = sub_8046C78; + StartSpriteAffineAnim(sprite, 0); + } + } +} -- cgit v1.2.3 From 1fafe80241d56c7e89aa37d0bf6d20a0f4d208f2 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sun, 18 Jun 2017 22:03:56 -0500 Subject: finish decompiling pokedex.s --- src/pokeball.c | 386 +++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 349 insertions(+), 37 deletions(-) (limited to 'src') diff --git a/src/pokeball.c b/src/pokeball.c index 113be945b..4b2ba8212 100644 --- a/src/pokeball.c +++ b/src/pokeball.c @@ -1,8 +1,10 @@ #include "global.h" #include "gba/m4a_internal.h" #include "battle.h" +#include "decompress.h" #include "m4a.h" #include "main.h" +#include "pokeball.h" #include "pokemon.h" #include "rom_8077ABC.h" #include "songs.h" @@ -10,6 +12,7 @@ #include "sprite.h" #include "task.h" #include "trig.h" +#include "util.h" extern struct MusicPlayerInfo gMPlay_BGM; extern u16 gBattleTypeFlags; @@ -18,34 +21,44 @@ extern u8 gActiveBank; extern u16 gBattlePartyID[]; extern u8 gObjectBankIDs[]; extern u8 gDoingBattleAnim; +extern u8 gHealthboxIDs[]; +extern const struct SpriteSheet gUnknown_0820A92C[]; +extern const struct SpritePalette gUnknown_0820A98C[]; extern const struct SpriteTemplate gSpriteTemplate_820AAB4[]; +extern const u8 gUnknown_08D030D0[]; extern u32 ball_number_to_ball_processing_index(u16); // not sure of return type extern void sub_80786EC(); extern bool8 sub_8078718(struct Sprite *); -extern void sub_814086C(u8, u8, int, int, u8); -extern u8 sub_8141314(u8, u8, u8, u8); - -void sub_8046464(u8); -void sub_80466E8(struct Sprite *); -void sub_80466F4(struct Sprite *); -void sub_8046760(struct Sprite *); -void sub_80467F8(struct Sprite *); -void sub_804684C(struct Sprite *); -void sub_8046944(struct Sprite *); -void sub_8046984(struct Sprite *); -void sub_8046C78(struct Sprite *); -void sub_8046E7C(struct Sprite *); -void sub_8046E9C(struct Sprite *); -void sub_8046FBC(struct Sprite *); -void sub_8047074(struct Sprite *); -void sub_80470C4(struct Sprite *); -void sub_8047230(struct Sprite *); -void sub_8047254(struct Sprite *); -void sub_80478DC(); -void sub_804794C(u8); -u16 sub_8047978(); +extern u8 sub_814086C(u8, u8, int, int, u8); +extern u8 sub_8141314(u8, u8, int, u8); + +static void sub_8046464(u8); +static void sub_80466E8(struct Sprite *); +static void sub_80466F4(struct Sprite *); +static void sub_8046760(struct Sprite *); +static void sub_80467F8(struct Sprite *); +static void sub_804684C(struct Sprite *); +static void sub_8046944(struct Sprite *); +static void sub_8046984(struct Sprite *); +static void sub_8046C78(struct Sprite *); +static void sub_8046E7C(struct Sprite *); +static void sub_8046E9C(struct Sprite *); +static void sub_8046FBC(struct Sprite *); +static void sub_8047074(struct Sprite *); +static void sub_80470C4(struct Sprite *); +static void sub_8047230(struct Sprite *); +static void sub_8047254(struct Sprite *); +static void sub_80473D0(struct Sprite *); +static void sub_804748C(struct Sprite *); +static void sub_8047638(struct Sprite *); +static void sub_80476E0(struct Sprite *); +static void sub_8047754(struct Sprite *); +static void sub_804780C(struct Sprite *); +static void sub_8047830(struct Sprite *); +static void oamc_804BEB4(struct Sprite *); +static u16 sub_8047978(u8); u8 sub_8046400(u16 a, u8 b) { @@ -60,7 +73,7 @@ u8 sub_8046400(u16 a, u8 b) return 0; } -void sub_8046464(u8 taskId) +static void sub_8046464(u8 taskId) { bool8 sp0 = FALSE; u16 r8; @@ -149,12 +162,12 @@ void objc_0804ABD4(struct Sprite *sprite) } } -void sub_80466E8(struct Sprite *sprite) +static void sub_80466E8(struct Sprite *sprite) { sprite->callback = sub_80466F4; } -void sub_80466F4(struct Sprite *sprite) +static void sub_80466F4(struct Sprite *sprite) { sprite->data5++; if (sprite->data5 == 10) @@ -167,7 +180,7 @@ void sub_80466F4(struct Sprite *sprite) } } -void sub_8046760(struct Sprite *sprite) +static void sub_8046760(struct Sprite *sprite) { sprite->data5++; if (sprite->data5 == 11) @@ -186,7 +199,7 @@ void sub_8046760(struct Sprite *sprite) } } -void sub_80467F8(struct Sprite *sprite) +static void sub_80467F8(struct Sprite *sprite) { if (sprite->animEnded) { @@ -203,7 +216,7 @@ void sub_80467F8(struct Sprite *sprite) } } -void sub_804684C(struct Sprite *sprite) +static void sub_804684C(struct Sprite *sprite) { bool8 r5 = FALSE; @@ -263,7 +276,7 @@ void sub_804684C(struct Sprite *sprite) } } -void sub_8046944(struct Sprite *sprite) +static void sub_8046944(struct Sprite *sprite) { sprite->data3++; if (sprite->data3 == 31) @@ -276,7 +289,7 @@ void sub_8046944(struct Sprite *sprite) } } -void sub_8046984(struct Sprite *sprite) +static void sub_8046984(struct Sprite *sprite) { switch (sprite->data3 & 0xFF) { @@ -347,7 +360,7 @@ void sub_8046984(struct Sprite *sprite) } } -void sub_8046AD0(u8 taskId) +static void sub_8046AD0(u8 taskId) { u8 r6 = gTasks[taskId].data[2]; u8 r3 = gTasks[taskId].data[1]; @@ -412,7 +425,7 @@ void sub_8046AD0(u8 taskId) } } -void sub_8046C78(struct Sprite *sprite) +static void sub_8046C78(struct Sprite *sprite) { u8 r5 = sprite->data6; u32 r4; // not sure of this type @@ -471,7 +484,7 @@ void sub_8046C78(struct Sprite *sprite) gSprites[gObjectBankIDs[sprite->data6]].data1 = 0x1000; } -void sub_8046E7C(struct Sprite *sprite) +static void sub_8046E7C(struct Sprite *sprite) { sprite->animPaused = TRUE; sprite->callback = sub_8046FBC; @@ -480,7 +493,7 @@ void sub_8046E7C(struct Sprite *sprite) sprite->data5 = 0; } -void sub_8046E9C(struct Sprite *sprite) +static void sub_8046E9C(struct Sprite *sprite) { bool8 r7 = FALSE; u8 r4 = sprite->data6; @@ -521,7 +534,7 @@ void sub_8046E9C(struct Sprite *sprite) } } -void sub_8046FBC(struct Sprite *sprite) +static void sub_8046FBC(struct Sprite *sprite) { u8 r7 = sprite->data6; @@ -546,7 +559,7 @@ void sub_8046FBC(struct Sprite *sprite) } } -void sub_8047074(struct Sprite *sprite) +static void sub_8047074(struct Sprite *sprite) { sprite->data0 = 25; sprite->data2 = sub_8077ABC(sprite->data6, 2); @@ -559,7 +572,7 @@ void sub_8047074(struct Sprite *sprite) #define HIBYTE(x) (((x) >> 8) & 0xFF) -void sub_80470C4(struct Sprite *sprite) +static void sub_80470C4(struct Sprite *sprite) { u32 r6; u32 r7; @@ -612,3 +625,302 @@ void sub_80470C4(struct Sprite *sprite) } } } + +static void sub_8047230(struct Sprite *sprite) +{ + if (sprite->data0++ > 0x18) + { + sprite->data0 = 0; + sprite->callback = sub_8046C78; + } +} + +static void sub_8047254(struct Sprite *sprite) +{ + sprite->data0++; + if (sprite->data0 > 15) + { + sprite->data0 = 0; + if (IsDoubleBattle() && ewram17840.unk9_0 + && sprite->data6 == GetBankByPlayerAI(3)) + sprite->callback = sub_8047230; + else + sprite->callback = sub_8046C78; + } +} + +static u8 sub_80472B0(u8 a, u8 b, u8 c, u8 d) +{ + return sub_814086C(a, b, c, d, 0); +} + +static u8 sub_80472D8(u8 a, u8 b, u32 c) +{ + return sub_8141314(a, b, c, 0); +} + +void CreatePokeballSprite(u8 a, u8 b, u8 x, u8 y, u8 e, u8 f, u8 g, u32 h) +{ + u8 spriteId; + + LoadCompressedObjectPic(&gUnknown_0820A92C[0]); + LoadCompressedObjectPalette(&gUnknown_0820A98C[0]); + spriteId = CreateSprite(&gSpriteTemplate_820AAB4[0], x, y, f); + gSprites[spriteId].data0 = a; + gSprites[spriteId].data5 = gSprites[a].pos1.x; + gSprites[spriteId].data6 = gSprites[a].pos1.y; + gSprites[a].pos1.x = x; + gSprites[a].pos1.y = y; + gSprites[spriteId].data1 = g; + gSprites[spriteId].data2 = b; + gSprites[spriteId].data3 = h; + gSprites[spriteId].data4 = h >> 16; + gSprites[spriteId].oam.priority = e; + gSprites[spriteId].callback = sub_80473D0; + gSprites[a].invisible = TRUE; +} + +static void sub_80473D0(struct Sprite *sprite) +{ + if (sprite->data1 == 0) + { + u8 r5; + u8 r7 = sprite->data0; + u8 r8 = sprite->data2; + u32 r4 = (u16)sprite->data3 | ((u16)sprite->data4 << 16); + + if (sprite->subpriority != 0) + r5 = sprite->subpriority - 1; + else + r5 = 0; + StartSpriteAnim(sprite, 1); + sub_80472B0(sprite->pos1.x, sprite->pos1.y - 5, sprite->oam.priority, r5); + sprite->data1 = sub_80472D8(1, r8, r4); + sprite->callback = sub_804748C; + gSprites[r7].invisible = FALSE; + StartSpriteAffineAnim(&gSprites[r7], 1); + AnimateSprite(&gSprites[r7]); + gSprites[r7].data1 = 0x1000; + sprite->data7 = 0; + } + else + { + sprite->data1--; + } +} + +static void sub_804748C(struct Sprite *sprite) +{ + bool8 r12 = FALSE; + bool8 r6 = FALSE; + u8 r3 = sprite->data0; + u16 var1; + u16 var2; + + if (sprite->animEnded) + sprite->invisible = TRUE; + if (gSprites[r3].affineAnimEnded) + { + StartSpriteAffineAnim(&gSprites[r3], 0); + r12 = TRUE; + } + var1 = (sprite->data5 - sprite->pos1.x) * sprite->data7 / 128 + sprite->pos1.x; + var2 = (sprite->data6 - sprite->pos1.y) * sprite->data7 / 128 + sprite->pos1.y; + gSprites[r3].pos1.x = var1; + gSprites[r3].pos1.y = var2; + if (sprite->data7 < 128) + { + s16 sine = -(gSineTable[(u8)sprite->data7] / 8); + + sprite->data7 += 4; + gSprites[r3].pos2.x = sine; + gSprites[r3].pos2.y = sine; + } + else + { + gSprites[r3].pos1.x = sprite->data5; + gSprites[r3].pos1.y = sprite->data6; + gSprites[r3].pos2.x = 0; + gSprites[r3].pos2.y = 0; + r6 = TRUE; + } + if (sprite->animEnded && r12 && r6) + DestroySpriteAndFreeResources(sprite); +} + +u8 sub_8047580(u8 a, u8 b, u8 x, u8 y, u8 e, u8 f, u8 g, u32 h) +{ + u8 spriteId; + + LoadCompressedObjectPic(&gUnknown_0820A92C[0]); + LoadCompressedObjectPalette(&gUnknown_0820A98C[0]); + spriteId = CreateSprite(&gSpriteTemplate_820AAB4[0], x, y, f); + gSprites[spriteId].data0 = a; + gSprites[spriteId].data1 = g; + gSprites[spriteId].data2 = b; + gSprites[spriteId].data3 = h; + gSprites[spriteId].data4 = h >> 16; + gSprites[spriteId].oam.priority = e; + gSprites[spriteId].callback = sub_8047638; + return spriteId; +} + +static void sub_8047638(struct Sprite *sprite) +{ + if (sprite->data1 == 0) + { + u8 r6; + u8 r7 = sprite->data0; + u8 r8 = sprite->data2; + u32 r5 = (u16)sprite->data3 | ((u16)sprite->data4 << 16); + + if (sprite->subpriority != 0) + r6 = sprite->subpriority - 1; + else + r6 = 0; + StartSpriteAnim(sprite, 1); + sub_80472B0(sprite->pos1.x, sprite->pos1.y - 5, sprite->oam.priority, r6); + sprite->data1 = sub_80472D8(1, r8, r5); + sprite->callback = sub_80476E0; + StartSpriteAffineAnim(&gSprites[r7], 2); + AnimateSprite(&gSprites[r7]); + gSprites[r7].data1 = 0; + } + else + { + sprite->data1--; + } +} + +static void sub_80476E0(struct Sprite *sprite) +{ + u8 r1; + + sprite->data5++; + if (sprite->data5 == 11) + PlaySE(SE_SUIKOMU); + r1 = sprite->data0; + if (gSprites[r1].affineAnimEnded) + { + StartSpriteAnim(sprite, 2); + gSprites[r1].invisible = TRUE; + sprite->data5 = 0; + sprite->callback = sub_8047754; + } + else + { + gSprites[r1].data1 += 96; + gSprites[r1].pos2.y = -gSprites[r1].data1 >> 8; + } +} + +static void sub_8047754(struct Sprite *sprite) +{ + if (sprite->animEnded) + sprite->callback = SpriteCallbackDummy; +} + +void obj_delete_and_free_associated_resources_(struct Sprite *sprite) +{ + DestroySpriteAndFreeResources(sprite); +} + +void sub_804777C(u8 a) +{ + struct Sprite *sprite = &gSprites[gHealthboxIDs[a]]; + + sprite->data0 = 5; + sprite->data1 = 0; + sprite->pos2.x = 0x73; + sprite->pos2.y = 0; + sprite->callback = sub_8047830; + if (GetBankSide(a) != 0) + { + sprite->data0 = -sprite->data0; + sprite->data1 = -sprite->data1; + sprite->pos2.x = -sprite->pos2.x; + sprite->pos2.y = -sprite->pos2.y; + } + gSprites[sprite->data5].callback(&gSprites[sprite->data5]); + if (GetBankIdentity(a) == 2) + sprite->callback = sub_804780C; +} + +static void sub_804780C(struct Sprite *sprite) +{ + sprite->data1++; + if (sprite->data1 == 20) + { + sprite->data1 = 0; + sprite->callback = sub_8047830; + } +} + +static void sub_8047830(struct Sprite *sprite) +{ + sprite->pos2.x -= sprite->data0; + sprite->pos2.y -= sprite->data1; + if (sprite->pos2.x == 0 && sprite->pos2.y == 0) + sprite->callback = SpriteCallbackDummy; +} + +void sub_8047858(u8 a) +{ + u8 spriteId; + + spriteId = CreateInvisibleSpriteWithCallback(oamc_804BEB4); + gSprites[spriteId].data0 = 1; + gSprites[spriteId].data1 = gHealthboxIDs[a]; + gSprites[spriteId].callback = oamc_804BEB4; +} + +static void oamc_804BEB4(struct Sprite *sprite) +{ + u8 r1 = sprite->data1; + + gSprites[r1].pos2.y = sprite->data0; + sprite->data0 = -sprite->data0; + sprite->data2++; + if (sprite->data2 == 21) + { + gSprites[r1].pos2.x = 0; + gSprites[r1].pos2.y = 0; + DestroySprite(sprite); + } +} + +void sub_80478DC(u8 a) +{ + u16 var; + + if (GetSpriteTileStartByTag(gUnknown_0820A92C[a].tag) == 0xFFFF) + { + LoadCompressedObjectPic(&gUnknown_0820A92C[a]); + LoadCompressedObjectPalette(&gUnknown_0820A98C[a]); + } + switch (a) + { + case 6: + case 10: + case 11: + break; + default: + var = GetSpriteTileStartByTag(gUnknown_0820A92C[a].tag); + LZDecompressVram(gUnknown_08D030D0, (void *)(VRAM + 0x10100 + var * 32)); + break; + } +} + +void sub_804794C(u8 a) +{ + FreeSpriteTilesByTag(gUnknown_0820A92C[a].tag); + FreeSpritePaletteByTag(gUnknown_0820A98C[a].tag); +} + +static u16 sub_8047978(u8 a) +{ + if (GetBankSide(a) == 0) + return GetMonData(&gPlayerParty[gBattlePartyID[a]], MON_DATA_POKEBALL); + else + return GetMonData(&gEnemyParty[gBattlePartyID[a]], MON_DATA_POKEBALL); +} -- cgit v1.2.3 From e072ddd6fbae8b303de546d0e9bd5ace2ecb20a1 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Mon, 19 Jun 2017 13:34:32 -0500 Subject: move data to C and introduce CompressedSpriteSheet and CompressedSpritePalette --- src/battle_7.c | 50 +++--- src/battle_anim.c | 4 +- src/berry_tag_screen.c | 4 +- src/credits.c | 6 +- src/decompress.c | 64 ++++---- src/field_effect.c | 3 +- src/intro.c | 18 +-- src/money.c | 4 +- src/pokeball.c | 313 +++++++++++++++++++++++++++++++++++--- src/pokedex.c | 10 +- src/pokemon_3.c | 8 +- src/script_pokemon_util_80C4BF0.c | 19 ++- src/starter_choose.c | 4 +- src/title_screen.c | 6 +- src/wallclock.c | 2 +- 15 files changed, 393 insertions(+), 122 deletions(-) (limited to 'src') diff --git a/src/battle_7.c b/src/battle_7.c index a2990018e..a93237608 100644 --- a/src/battle_7.c +++ b/src/battle_7.c @@ -55,21 +55,21 @@ extern void (*gAnimScriptCallback)(void); extern u8 gAnimScriptActive; extern const u8 *const gBattleAnims_Unknown1[]; extern const u8 *const gBattleAnims_Unknown2[]; -extern const struct SpriteSheet gTrainerFrontPicTable[]; +extern const struct CompressedSpriteSheet gTrainerFrontPicTable[]; extern const struct MonCoords gTrainerFrontPicCoords[]; -extern const struct SpritePalette gTrainerFrontPicPaletteTable[]; +extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; extern const u8 gSubstituteDollTilemap[]; extern const u8 gSubstituteDollGfx[]; extern const u8 gSubstituteDollPal[]; -extern const struct SpriteSheet gUnknown_081FAF24; +extern const struct CompressedSpriteSheet gUnknown_081FAF24; extern const struct SpriteTemplate gSpriteTemplate_81FAF34; extern void (*const gOpponentBufferCommands[])(void); -extern const struct SpriteSheet gUnknown_0820A47C; -extern const struct SpriteSheet gUnknown_0820A484; -extern const struct SpriteSheet gUnknown_0820A48C[]; -extern const struct SpriteSheet gUnknown_0820A49C[]; -extern const struct SpriteSheet gUnknown_0820A4AC; -extern const struct SpriteSheet gUnknown_0820A4B4[]; +extern const struct CompressedSpriteSheet gUnknown_0820A47C; +extern const struct CompressedSpriteSheet gUnknown_0820A484; +extern const struct CompressedSpriteSheet gUnknown_0820A48C[]; +extern const struct CompressedSpriteSheet gUnknown_0820A49C[]; +extern const struct CompressedSpriteSheet gUnknown_0820A4AC; +extern const struct CompressedSpriteSheet gUnknown_0820A4B4[]; extern const struct SpritePalette gUnknown_0820A4D4[]; extern const u8 gUnknown_08D09C48[]; @@ -84,10 +84,8 @@ extern u8 sub_8078874(u8); extern u8 sub_8077F68(u8); extern u8 sub_8077F7C(u8); extern void sub_8094958(void); -extern const u16 *pokemon_get_pal(struct Pokemon *); extern void sub_80105DC(struct Sprite *); extern void move_anim_start_t2(); -extern const u16 *species_and_otid_get_pal(); void sub_80315E8(u8); u8 sub_803163C(u8); @@ -283,7 +281,7 @@ void sub_8031794(struct Pokemon *pkmn, u8 b) u32 otId; u8 var; u16 paletteOffset; - const u16 *palette; + const u8 *lzPaletteData; personalityValue = GetMonData(pkmn, MON_DATA_PERSONALITY); if (ewram17800[b].unk2 == 0) @@ -308,16 +306,16 @@ void sub_8031794(struct Pokemon *pkmn, u8 b) r7); paletteOffset = 0x100 + b * 16; if (ewram17800[b].unk2 == 0) - palette = pokemon_get_pal(pkmn); + lzPaletteData = pokemon_get_pal(pkmn); else - palette = species_and_otid_get_pal(species, otId, personalityValue); - sub_800D238(palette, ewram); + lzPaletteData = species_and_otid_get_pal(species, otId, personalityValue); + sub_800D238(lzPaletteData, ewram); LoadPalette(ewram, paletteOffset, 0x20); LoadPalette(ewram, 0x80 + b * 16, 0x20); if (species == SPECIES_CASTFORM) { paletteOffset = 0x100 + b * 16; - sub_800D238(palette, ewram + 0x16400); + sub_800D238(lzPaletteData, ewram + 0x16400); LoadPalette(ewram + 0x16400 + gBattleMonForms[b] * 32, paletteOffset, 0x20); } if (ewram17800[b].unk2 != 0) @@ -335,7 +333,7 @@ void sub_80318FC(struct Pokemon *pkmn, u8 b) u32 otId; u8 var; u16 paletteOffset; - const u16 *palette; + const u8 *lzPaletteData; personalityValue = GetMonData(pkmn, MON_DATA_PERSONALITY); if (ewram17800[b].unk2 == 0) @@ -360,16 +358,16 @@ void sub_80318FC(struct Pokemon *pkmn, u8 b) r7); paletteOffset = 0x100 + b * 16; if (ewram17800[b].unk2 == 0) - palette = pokemon_get_pal(pkmn); + lzPaletteData = pokemon_get_pal(pkmn); else - palette = species_and_otid_get_pal(species, otId, personalityValue); - sub_800D238(palette, ewram); + lzPaletteData = species_and_otid_get_pal(species, otId, personalityValue); + sub_800D238(lzPaletteData, ewram); LoadPalette(ewram, paletteOffset, 0x20); LoadPalette(ewram, 0x80 + b * 16, 0x20); if (species == SPECIES_CASTFORM) { paletteOffset = 0x100 + b * 16; - sub_800D238(palette, ewram + 0x16400); + sub_800D238(lzPaletteData, ewram + 0x16400); LoadPalette(ewram + 0x16400 + gBattleMonForms[b] * 32, paletteOffset, 0x20); } if (ewram17800[b].unk2 != 0) @@ -390,7 +388,7 @@ void nullsub_9(u16 unused) void sub_8031A6C(u16 a, u8 b) { u8 status; - struct SpriteSheet spriteSheet; + struct CompressedSpriteSheet spriteSheet; status = GetBankIdentity(b); DecompressPicFromTable_2( @@ -624,7 +622,7 @@ void sub_8031FC4(u8 a, u8 b, bool8 c) u32 personalityValue; u32 otId; u8 r10; - const u16 *palette; + const u8 *lzPaletteData; if (c) { @@ -697,14 +695,14 @@ void sub_8031FC4(u8 a, u8 b, bool8 c) dst = (void *)(VRAM + 0x10000 + gSprites[gObjectBankIDs[a]].oam.tileNum * 32); DmaCopy32(3, src, dst, 0x800); paletteOffset = 0x100 + a * 16; - palette = species_and_otid_get_pal(species, otId, personalityValue); - sub_800D238(palette, ewram); + lzPaletteData = species_and_otid_get_pal(species, otId, personalityValue); + sub_800D238(lzPaletteData, ewram); LoadPalette(ewram, paletteOffset, 32); if (species == SPECIES_CASTFORM) { u16 *paletteSrc = (u16 *)(ewram + 0x16400); - sub_800D238(palette, paletteSrc); + sub_800D238(lzPaletteData, paletteSrc); LoadPalette(paletteSrc + gBattleMonForms[b] * 16, paletteOffset, 32); } BlendPalette(paletteOffset, 16, 6, 0x7FFF); diff --git a/src/battle_anim.c b/src/battle_anim.c index cc856d5cd..55ede1788 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -58,8 +58,8 @@ extern struct MusicPlayerInfo gMPlay_SE2; extern const u16 gUnknown_081C7160[]; extern const u8 *const gBattleAnims_Moves[]; -extern const struct SpriteSheet gBattleAnimPicTable[]; -extern const struct SpritePalette gBattleAnimPaletteTable[]; +extern const struct CompressedSpriteSheet gBattleAnimPicTable[]; +extern const struct CompressedSpritePalette gBattleAnimPaletteTable[]; extern const struct BattleAnimBackground gBattleAnimBackgroundTable[]; static void RunAnimScriptCommand(void); diff --git a/src/berry_tag_screen.c b/src/berry_tag_screen.c index 5647d4593..116ca2cca 100644 --- a/src/berry_tag_screen.c +++ b/src/berry_tag_screen.c @@ -38,8 +38,8 @@ extern struct BerryTagStatus gUnknown_0203932E; extern u16 gScriptItemId; extern u16 gUnknown_030041B4; -extern const struct SpriteSheet gUnknown_083C1F74; -extern const struct SpritePalette gUnknown_083C1F7C; +extern const struct CompressedSpriteSheet gUnknown_083C1F74; +extern const struct CompressedSpritePalette gUnknown_083C1F7C; extern u8 *gUnknown_0841192C[]; diff --git a/src/credits.c b/src/credits.c index a7d6191e6..8ec126a41 100644 --- a/src/credits.c +++ b/src/credits.c @@ -1495,7 +1495,7 @@ void spritecb_81454E0(struct Sprite *sprite) { static u8 sub_81456B4(u16 species, u16 x, u16 y, u16 position) { u32 personality; - const u16 *palette; + const u8 *lzPaletteData; u8 spriteId; u8 spriteId2; @@ -1527,8 +1527,8 @@ static u8 sub_81456B4(u16 species, u16 x, u16 y, u16 position) 1 ); - palette = species_and_otid_get_pal(species, 0, 0xFFFF); - LoadCompressedPalette(palette, 0x100 + (position * 16), 0x20); + lzPaletteData = species_and_otid_get_pal(species, 0, 0xFFFF); + LoadCompressedPalette(lzPaletteData, 0x100 + (position * 16), 0x20); sub_8143648(position, position); spriteId = CreateSprite(&gUnknown_02024E8C, x, y, 0); diff --git a/src/decompress.c b/src/decompress.c index 1d38447b5..d7f7087a7 100644 --- a/src/decompress.c +++ b/src/decompress.c @@ -16,57 +16,57 @@ void LZDecompressVram(const void *src, void *dest) LZ77UnCompVram(src, dest); } -void LoadCompressedObjectPic(const struct SpriteSheet *a) +void LoadCompressedObjectPic(const struct CompressedSpriteSheet *src) { - struct SpriteSheet spriteSheet; + struct SpriteSheet dest; - LZ77UnCompWram(a->data, (void *)WRAM); - spriteSheet.data = (void *)WRAM; - spriteSheet.size = a->size; - spriteSheet.tag = a->tag; - LoadSpriteSheet(&spriteSheet); + LZ77UnCompWram(src->data, (void *)WRAM); + dest.data = (void *)WRAM; + dest.size = src->size; + dest.tag = src->tag; + LoadSpriteSheet(&dest); } -void LoadCompressedObjectPicOverrideBuffer(const struct SpriteSheet *a, void *buffer) +void LoadCompressedObjectPicOverrideBuffer(const struct CompressedSpriteSheet *src, void *buffer) { - struct SpriteSheet spriteSheet; + struct SpriteSheet dest; - LZ77UnCompWram(a->data, buffer); - spriteSheet.data = buffer; - spriteSheet.size = a->size; - spriteSheet.tag = a->tag; - LoadSpriteSheet(&spriteSheet); + LZ77UnCompWram(src->data, buffer); + dest.data = buffer; + dest.size = src->size; + dest.tag = src->tag; + LoadSpriteSheet(&dest); } -void LoadCompressedObjectPalette(const struct SpritePalette *a) +void LoadCompressedObjectPalette(const struct CompressedSpritePalette *src) { - struct SpritePalette spritePalette; + struct SpritePalette dest; - LZ77UnCompWram(a->data, (void *)WRAM); - spritePalette.data = (void *)WRAM; - spritePalette.tag = a->tag; - LoadSpritePalette(&spritePalette); + LZ77UnCompWram(src->data, (void *)WRAM); + dest.data = (void *)WRAM; + dest.tag = src->tag; + LoadSpritePalette(&dest); } -void LoadCompressedObjectPaletteOverrideBuffer(const struct SpritePalette *a, void *buffer) +void LoadCompressedObjectPaletteOverrideBuffer(const struct CompressedSpritePalette *a, void *buffer) { - struct SpritePalette spritePalette; + struct SpritePalette dest; LZ77UnCompWram(a->data, buffer); - spritePalette.data = buffer; - spritePalette.tag = a->tag; - LoadSpritePalette(&spritePalette); + dest.data = buffer; + dest.tag = a->tag; + LoadSpritePalette(&dest); } -void DecompressPicFromTable_2(const struct SpriteSheet *a, u8 b, u8 c, void *d, void *e, s32 species) +void DecompressPicFromTable_2(const struct CompressedSpriteSheet *src, u8 b, u8 c, void *d, void *buffer, s32 species) { if (species > SPECIES_EGG) - LZ77UnCompWram(gMonFrontPicTable[0].data, e); + LZ77UnCompWram(gMonFrontPicTable[0].data, buffer); else - LZ77UnCompWram(a->data, e); + LZ77UnCompWram(src->data, buffer); } -void HandleLoadSpecialPokePic(const struct SpriteSheet *spriteSheet, u32 b, u32 c, u32 d, void *dest, s32 species, u32 g) +void HandleLoadSpecialPokePic(const struct CompressedSpriteSheet *src, u32 b, u32 c, u32 d, void *dest, s32 species, u32 g) { u32 frontOrBack; @@ -76,10 +76,10 @@ void HandleLoadSpecialPokePic(const struct SpriteSheet *spriteSheet, u32 b, u32 else frontOrBack = 1; // frontPic - LoadSpecialPokePic(spriteSheet, b, c, d, dest, species, g, frontOrBack); + LoadSpecialPokePic(src, b, c, d, dest, species, g, frontOrBack); } -void LoadSpecialPokePic(const struct SpriteSheet *spriteSheet, u32 b, u32 c, u32 d, void *dest, s32 species, u32 g, u32 frontOrBack) +void LoadSpecialPokePic(const struct CompressedSpriteSheet *src, u32 b, u32 c, u32 d, void *dest, s32 species, u32 g, u32 frontOrBack) { u8 frontOrBack8 = frontOrBack; @@ -101,7 +101,7 @@ void LoadSpecialPokePic(const struct SpriteSheet *spriteSheet, u32 b, u32 c, u32 else if (species > SPECIES_EGG) // is species unknown? draw the ? icon LZ77UnCompWram(gMonFrontPicTable[0].data, dest); else - LZ77UnCompWram(spriteSheet->data, dest); + LZ77UnCompWram(src->data, dest); DrawSpindaSpots(species, g, dest, frontOrBack8); } diff --git a/src/field_effect.c b/src/field_effect.c index 9591bb6a0..a7f0e4129 100755 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -657,7 +657,8 @@ u8 CreateMonSprite_PicBox(u16 species, s16 x, s16 y, u8 subpriority) u8 CreateMonSprite_FieldMove(u16 species, u32 d, u32 g, s16 x, s16 y, u8 subpriority) { - const struct SpritePalette *spritePalette; + const struct CompressedSpritePalette *spritePalette; + HandleLoadSpecialPokePic(&gMonFrontPicTable[species], gMonFrontPicCoords[species].coords, gMonFrontPicCoords[species].y_offset, (u32)gUnknown_081FAF4C[3] /* this is actually u8* or something, pointing to ewram */, gUnknown_081FAF4C[3], species, g); spritePalette = sub_80409C8(species, d, g); LoadCompressedObjectPalette(spritePalette); diff --git a/src/intro.c b/src/intro.c index f13bd04e6..396f5e5df 100644 --- a/src/intro.c +++ b/src/intro.c @@ -31,7 +31,7 @@ extern struct GcmbStruct gMultibootProgramStruct; extern u16 gSaveFileStatus; extern u8 gReservedSpritePaletteCount; extern const u8 gInterfaceGfx_PokeBall[]; -extern const u16 gInterfacePal_PokeBall[]; +extern const u8 gInterfacePal_PokeBall[]; extern const u8 gIntroCopyright_Gfx[]; extern const u16 gIntroCopyright_Pal[]; extern const u16 gIntroCopyright_Tilemap[]; @@ -411,12 +411,12 @@ static const struct SpriteTemplate gSpriteTemplate_840AFF0 = .affineAnims = gDummySpriteAffineAnimTable, .callback = sub_813DA64, }; -const struct SpriteSheet gUnknown_0840B008[] = +const struct CompressedSpriteSheet gUnknown_0840B008[] = { {gIntroTiles, 0x1400, 2000}, {NULL}, }; -const struct SpriteSheet gUnknown_0840B018[] = +const struct CompressedSpriteSheet gUnknown_0840B018[] = { {gIntro1EonTiles, 0x400, 2002}, {NULL}, @@ -738,17 +738,17 @@ static const struct SpriteTemplate gSpriteTemplate_840B1F4 = .affineAnims = gDummySpriteAffineAnimTable, .callback = sub_813EDFC, }; -const struct SpriteSheet gIntro3PokeballGfx_Table[] = +const struct CompressedSpriteSheet gIntro3PokeballGfx_Table[] = { {gInterfaceGfx_PokeBall, 0x100, 2002}, {NULL}, }; -const struct SpriteSheet gIntro3MiscGfx_Table[] = +const struct CompressedSpriteSheet gIntro3MiscGfx_Table[] = { {gIntro3MiscTiles, 0xa00, 2003}, {NULL}, }; -const struct SpritePalette gInterfacePokeballPal_Table[] = +const struct CompressedSpritePalette gInterfacePokeballPal_Table[] = { {gInterfacePal_PokeBall, 2002}, {NULL}, @@ -1772,15 +1772,15 @@ void sub_813CE30(u16 scrX, u16 scrY, u16 zoom, u16 alpha) static u16 sub_813CE88(u16 species, s16 x, s16 y, u16 d, u8 front) { - const u16 *pal; + const u8 *lzPaletteData; u8 spriteId; if (front) LoadSpecialPokePic(&gMonFrontPicTable[species], gMonFrontPicCoords[species].coords, gMonFrontPicCoords[species].y_offset, 0x2000000, gUnknown_0840B5A0[d], species, 0, 1); else LoadSpecialPokePic(&gMonBackPicTable[species], gMonBackPicCoords[species].coords, gMonBackPicCoords[species].y_offset, 0x2000000, gUnknown_0840B5A0[d], species, 0, 0); - pal = species_and_otid_get_pal(species, 0, 0xFFFF); - LoadCompressedPalette(pal, 0x100 + d * 0x10, 0x20); + lzPaletteData = species_and_otid_get_pal(species, 0, 0xFFFF); + LoadCompressedPalette(lzPaletteData, 0x100 + d * 0x10, 0x20); sub_8143648(d, d); spriteId = CreateSprite(&gUnknown_02024E8C, x, y, (d + 1) * 4); gSprites[spriteId].oam.paletteNum = d; diff --git a/src/money.c b/src/money.c index de0730951..ab4508a39 100644 --- a/src/money.c +++ b/src/money.c @@ -10,8 +10,8 @@ extern u16 gSpecialVar_0x8005; extern u8 gUnknown_02038734; -extern const struct SpriteSheet gUnknown_083CF584; -extern const struct SpritePalette gUnknown_083CF58C; +extern const struct CompressedSpriteSheet gUnknown_083CF584; +extern const struct CompressedSpritePalette gUnknown_083CF58C; extern const struct SpriteTemplate gSpriteTemplate_83CF56C; bool8 IsEnoughMoney(u32 budget, u32 cost) diff --git a/src/pokeball.c b/src/pokeball.c index 4b2ba8212..c123130c6 100644 --- a/src/pokeball.c +++ b/src/pokeball.c @@ -2,6 +2,7 @@ #include "gba/m4a_internal.h" #include "battle.h" #include "decompress.h" +#include "graphics.h" #include "m4a.h" #include "main.h" #include "pokeball.h" @@ -23,10 +24,276 @@ extern u8 gObjectBankIDs[]; extern u8 gDoingBattleAnim; extern u8 gHealthboxIDs[]; -extern const struct SpriteSheet gUnknown_0820A92C[]; -extern const struct SpritePalette gUnknown_0820A98C[]; -extern const struct SpriteTemplate gSpriteTemplate_820AAB4[]; -extern const u8 gUnknown_08D030D0[]; +#define GFX_TAG_POKEBALL 55000 +#define GFX_TAG_GREATBALL 55001 +#define GFX_TAG_SAFARIBALL 55002 +#define GFX_TAG_ULTRABALL 55003 +#define GFX_TAG_MASTERBALL 55004 +#define GFX_TAG_NETBALL 55005 +#define GFX_TAG_DIVEBALL 55006 +#define GFX_TAG_NESTBALL 55007 +#define GFX_TAG_REPEATBALL 55008 +#define GFX_TAG_TIMERBALL 55009 +#define GFX_TAG_LUXURYBALL 55010 +#define GFX_TAG_PREMIERBALL 55011 + +static const struct CompressedSpriteSheet sBallSpriteSheets[] = +{ + {gInterfaceGfx_PokeBall, 384, GFX_TAG_POKEBALL}, + {gInterfaceGfx_GreatBall, 384, GFX_TAG_GREATBALL}, + {gInterfaceGfx_SafariBall, 384, GFX_TAG_SAFARIBALL}, + {gInterfaceGfx_UltraBall, 384, GFX_TAG_ULTRABALL}, + {gInterfaceGfx_MasterBall, 384, GFX_TAG_MASTERBALL}, + {gInterfaceGfx_NetBall, 384, GFX_TAG_NETBALL}, + {gInterfaceGfx_DiveBall, 384, GFX_TAG_DIVEBALL}, + {gInterfaceGfx_NestBall, 384, GFX_TAG_NESTBALL}, + {gInterfaceGfx_RepeatBall, 384, GFX_TAG_REPEATBALL}, + {gInterfaceGfx_TimerBall, 384, GFX_TAG_TIMERBALL}, + {gInterfaceGfx_LuxuryBall, 384, GFX_TAG_LUXURYBALL}, + {gInterfaceGfx_PremierBall, 384, GFX_TAG_PREMIERBALL}, +}; + +static const struct CompressedSpritePalette sBallSpritePalettes[] = +{ + {gInterfacePal_PokeBall, GFX_TAG_POKEBALL}, + {gInterfacePal_GreatBall, GFX_TAG_GREATBALL}, + {gInterfacePal_SafariBall, GFX_TAG_SAFARIBALL}, + {gInterfacePal_UltraBall, GFX_TAG_ULTRABALL}, + {gInterfacePal_MasterBall, GFX_TAG_MASTERBALL}, + {gInterfacePal_NetBall, GFX_TAG_NETBALL}, + {gInterfacePal_DiveBall, GFX_TAG_DIVEBALL}, + {gInterfacePal_NestBall, GFX_TAG_NESTBALL}, + {gInterfacePal_RepeatBall, GFX_TAG_REPEATBALL}, + {gInterfacePal_TimerBall, GFX_TAG_TIMERBALL}, + {gInterfacePal_LuxuryBall, GFX_TAG_LUXURYBALL}, + {gInterfacePal_PremierBall, GFX_TAG_PREMIERBALL}, +}; + +static const struct OamData sBallOamData = +{ + .y = 0, + .affineMode = 3, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 1, + .tileNum = 0, + .priority = 2, + .paletteNum = 0, + .affineParam = 0, +}; + +static const union AnimCmd sBallAnimSeq3[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_JUMP(0), +}; + +static const union AnimCmd sBallAnimSeq5[] = +{ + ANIMCMD_FRAME(4, 1), + ANIMCMD_JUMP(0), +}; + +static const union AnimCmd sBallAnimSeq4[] = +{ + ANIMCMD_FRAME(8, 5), + ANIMCMD_JUMP(0), +}; + +static const union AnimCmd sBallAnimSeq6[] = +{ + ANIMCMD_FRAME(12, 1), + ANIMCMD_JUMP(0), +}; + +static const union AnimCmd sBallAnimSeq0[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +static const union AnimCmd sBallAnimSeq1[] = +{ + ANIMCMD_FRAME(4, 5), + ANIMCMD_FRAME(8, 5), + ANIMCMD_END, +}; + +static const union AnimCmd sBallAnimSeq2[] = +{ + ANIMCMD_FRAME(4, 5), + ANIMCMD_FRAME(0, 5), + ANIMCMD_END, +}; + +static const union AnimCmd *const sBallAnimSequences[] = +{ + sBallAnimSeq0, + sBallAnimSeq1, + sBallAnimSeq2, + + // unused? + sBallAnimSeq3, + sBallAnimSeq4, + sBallAnimSeq5, + sBallAnimSeq6, +}; + +static const union AffineAnimCmd sBallAffineAnimSeq0[] = +{ + AFFINEANIMCMD_FRAME(0, 0, 0, 1), + AFFINEANIMCMD_JUMP(0), +}; + +static const union AffineAnimCmd sBallAffineAnimSeq1[] = +{ + AFFINEANIMCMD_FRAME(0, 0, -3, 1), + AFFINEANIMCMD_JUMP(0), +}; + +static const union AffineAnimCmd sBallAffineAnimSeq2[] = +{ + AFFINEANIMCMD_FRAME(0, 0, 3, 1), + AFFINEANIMCMD_JUMP(0), +}; + +static const union AffineAnimCmd sBallAffineAnimSeq3[] = +{ + AFFINEANIMCMD_FRAME(256, 256, 0, 0), + AFFINEANIMCMD_END, +}; + +static const union AffineAnimCmd sBallAffineAnimSeq4[] = +{ + AFFINEANIMCMD_FRAME(0, 0, 25, 1), + AFFINEANIMCMD_JUMP(0), +}; + +static const union AffineAnimCmd *const sBallAffineAnimSequences[] = +{ + sBallAffineAnimSeq0, + sBallAffineAnimSeq1, + sBallAffineAnimSeq2, + sBallAffineAnimSeq3, + sBallAffineAnimSeq4, +}; + +static void objc_0804ABD4(struct Sprite *sprite); +const struct SpriteTemplate gBallSpriteTemplates[] = +{ + { + .tileTag = GFX_TAG_POKEBALL, + .paletteTag = GFX_TAG_POKEBALL, + .oam = &sBallOamData, + .anims = sBallAnimSequences, + .images = NULL, + .affineAnims = sBallAffineAnimSequences, + .callback = objc_0804ABD4, + }, + { + .tileTag = GFX_TAG_GREATBALL, + .paletteTag = GFX_TAG_GREATBALL, + .oam = &sBallOamData, + .anims = sBallAnimSequences, + .images = NULL, + .affineAnims = sBallAffineAnimSequences, + .callback = objc_0804ABD4, + }, + { + .tileTag = GFX_TAG_SAFARIBALL, + .paletteTag = GFX_TAG_SAFARIBALL, + .oam = &sBallOamData, + .anims = sBallAnimSequences, + .images = NULL, + .affineAnims = sBallAffineAnimSequences, + .callback = objc_0804ABD4, + }, + { + .tileTag = GFX_TAG_ULTRABALL, + .paletteTag = GFX_TAG_ULTRABALL, + .oam = &sBallOamData, + .anims = sBallAnimSequences, + .images = NULL, + .affineAnims = sBallAffineAnimSequences, + .callback = objc_0804ABD4, + }, + { + .tileTag = GFX_TAG_MASTERBALL, + .paletteTag = GFX_TAG_MASTERBALL, + .oam = &sBallOamData, + .anims = sBallAnimSequences, + .images = NULL, + .affineAnims = sBallAffineAnimSequences, + .callback = objc_0804ABD4, + }, + { + .tileTag = GFX_TAG_NETBALL, + .paletteTag = GFX_TAG_NETBALL, + .oam = &sBallOamData, + .anims = sBallAnimSequences, + .images = NULL, + .affineAnims = sBallAffineAnimSequences, + .callback = objc_0804ABD4, + }, + { + .tileTag = GFX_TAG_DIVEBALL, + .paletteTag = GFX_TAG_DIVEBALL, + .oam = &sBallOamData, + .anims = sBallAnimSequences, + .images = NULL, + .affineAnims = sBallAffineAnimSequences, + .callback = objc_0804ABD4, + }, + { + .tileTag = GFX_TAG_NESTBALL, + .paletteTag = GFX_TAG_NESTBALL, + .oam = &sBallOamData, + .anims = sBallAnimSequences, + .images = NULL, + .affineAnims = sBallAffineAnimSequences, + .callback = objc_0804ABD4, + }, + { + .tileTag = GFX_TAG_REPEATBALL, + .paletteTag = GFX_TAG_REPEATBALL, + .oam = &sBallOamData, + .anims = sBallAnimSequences, + .images = NULL, + .affineAnims = sBallAffineAnimSequences, + .callback = objc_0804ABD4, + }, + { + .tileTag = GFX_TAG_TIMERBALL, + .paletteTag = GFX_TAG_TIMERBALL, + .oam = &sBallOamData, + .anims = sBallAnimSequences, + .images = NULL, + .affineAnims = sBallAffineAnimSequences, + .callback = objc_0804ABD4, + }, + { + .tileTag = GFX_TAG_LUXURYBALL, + .paletteTag = GFX_TAG_LUXURYBALL, + .oam = &sBallOamData, + .anims = sBallAnimSequences, + .images = NULL, + .affineAnims = sBallAffineAnimSequences, + .callback = objc_0804ABD4, + }, + { + .tileTag = GFX_TAG_PREMIERBALL, + .paletteTag = GFX_TAG_PREMIERBALL, + .oam = &sBallOamData, + .anims = sBallAnimSequences, + .images = NULL, + .affineAnims = sBallAffineAnimSequences, + .callback = objc_0804ABD4, + }, +}; extern u32 ball_number_to_ball_processing_index(u16); // not sure of return type extern void sub_80786EC(); @@ -95,7 +362,7 @@ static void sub_8046464(u8 taskId) ball = GetMonData(&gPlayerParty[gBattlePartyID[r5]], MON_DATA_POKEBALL); r4 = ball_number_to_ball_processing_index(ball); sub_80478DC(r4); - spriteId = CreateSprite(&gSpriteTemplate_820AAB4[r4], 32, 80, 0x1D); + spriteId = CreateSprite(&gBallSpriteTemplates[r4], 32, 80, 0x1D); gSprites[spriteId].data0 = 0x80; gSprites[spriteId].data1 = 0; gSprites[spriteId].data7 = r8; @@ -103,13 +370,13 @@ static void sub_8046464(u8 taskId) { case 0xFF: gBankTarget = r5; - gSprites[spriteId].pos1.x = 0x18; - gSprites[spriteId].pos1.y = 0x44; + gSprites[spriteId].pos1.x = 24; + gSprites[spriteId].pos1.y = 68; gSprites[spriteId].callback = sub_8047074; break; case 0xFE: gSprites[spriteId].pos1.x = sub_8077ABC(r5, 0); - gSprites[spriteId].pos1.y = sub_8077ABC(r5, 1) + 0x18; + gSprites[spriteId].pos1.y = sub_8077ABC(r5, 1) + 24; gBankTarget = r5; gSprites[spriteId].data0 = 0; gSprites[spriteId].callback = sub_8047254; @@ -136,7 +403,7 @@ static void sub_8046464(u8 taskId) PlaySE(SE_NAGERU); } -void objc_0804ABD4(struct Sprite *sprite) +static void objc_0804ABD4(struct Sprite *sprite) { if (sub_8078718(sprite)) { @@ -563,7 +830,7 @@ static void sub_8047074(struct Sprite *sprite) { sprite->data0 = 25; sprite->data2 = sub_8077ABC(sprite->data6, 2); - sprite->data4 = sub_8077ABC(sprite->data6, 3) + 0x18; + sprite->data4 = sub_8077ABC(sprite->data6, 3) + 24; sprite->data5 = -30; sprite->oam.affineParam = sprite->data6; sub_80786EC(sprite); @@ -628,7 +895,7 @@ static void sub_80470C4(struct Sprite *sprite) static void sub_8047230(struct Sprite *sprite) { - if (sprite->data0++ > 0x18) + if (sprite->data0++ > 24) { sprite->data0 = 0; sprite->callback = sub_8046C78; @@ -663,9 +930,9 @@ void CreatePokeballSprite(u8 a, u8 b, u8 x, u8 y, u8 e, u8 f, u8 g, u32 h) { u8 spriteId; - LoadCompressedObjectPic(&gUnknown_0820A92C[0]); - LoadCompressedObjectPalette(&gUnknown_0820A98C[0]); - spriteId = CreateSprite(&gSpriteTemplate_820AAB4[0], x, y, f); + LoadCompressedObjectPic(&sBallSpriteSheets[0]); + LoadCompressedObjectPalette(&sBallSpritePalettes[0]); + spriteId = CreateSprite(&gBallSpriteTemplates[0], x, y, f); gSprites[spriteId].data0 = a; gSprites[spriteId].data5 = gSprites[a].pos1.x; gSprites[spriteId].data6 = gSprites[a].pos1.y; @@ -752,9 +1019,9 @@ u8 sub_8047580(u8 a, u8 b, u8 x, u8 y, u8 e, u8 f, u8 g, u32 h) { u8 spriteId; - LoadCompressedObjectPic(&gUnknown_0820A92C[0]); - LoadCompressedObjectPalette(&gUnknown_0820A98C[0]); - spriteId = CreateSprite(&gSpriteTemplate_820AAB4[0], x, y, f); + LoadCompressedObjectPic(&sBallSpriteSheets[0]); + LoadCompressedObjectPalette(&sBallSpritePalettes[0]); + spriteId = CreateSprite(&gBallSpriteTemplates[0], x, y, f); gSprites[spriteId].data0 = a; gSprites[spriteId].data1 = g; gSprites[spriteId].data2 = b; @@ -893,10 +1160,10 @@ void sub_80478DC(u8 a) { u16 var; - if (GetSpriteTileStartByTag(gUnknown_0820A92C[a].tag) == 0xFFFF) + if (GetSpriteTileStartByTag(sBallSpriteSheets[a].tag) == 0xFFFF) { - LoadCompressedObjectPic(&gUnknown_0820A92C[a]); - LoadCompressedObjectPalette(&gUnknown_0820A98C[a]); + LoadCompressedObjectPic(&sBallSpriteSheets[a]); + LoadCompressedObjectPalette(&sBallSpritePalettes[a]); } switch (a) { @@ -905,7 +1172,7 @@ void sub_80478DC(u8 a) case 11: break; default: - var = GetSpriteTileStartByTag(gUnknown_0820A92C[a].tag); + var = GetSpriteTileStartByTag(sBallSpriteSheets[a].tag); LZDecompressVram(gUnknown_08D030D0, (void *)(VRAM + 0x10100 + var * 32)); break; } @@ -913,8 +1180,8 @@ void sub_80478DC(u8 a) void sub_804794C(u8 a) { - FreeSpriteTilesByTag(gUnknown_0820A92C[a].tag); - FreeSpritePaletteByTag(gUnknown_0820A98C[a].tag); + FreeSpriteTilesByTag(sBallSpriteSheets[a].tag); + FreeSpritePaletteByTag(sBallSpritePalettes[a].tag); } static u16 sub_8047978(u8 a) diff --git a/src/pokedex.c b/src/pokedex.c index 8674c3d2b..17ae9a597 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -162,7 +162,7 @@ extern const u8 gUnknown_08E96ACC[]; extern const u8 gUnknown_08E96B58[]; extern const u16 gPokedexMenu_Pal[]; extern const u16 gPokedexMenu2_Pal[]; -extern const struct SpriteSheet gTrainerFrontPicTable[]; +extern const struct CompressedSpriteSheet gTrainerFrontPicTable[]; extern const struct MonCoords gTrainerFrontPicCoords[]; extern const struct PokedexEntry gPokedexEntries[]; extern const u8 gPokedexMenuSearch_Gfx[]; @@ -493,7 +493,7 @@ static const struct SpriteTemplate gSpriteTemplate_83A05B4 = .affineAnims = gDummySpriteAffineAnimTable, .callback = sub_808F168, }; -static const struct SpriteSheet gUnknown_083A05CC[] = +static const struct CompressedSpriteSheet gUnknown_083A05CC[] = { {gPokedexMenu2_Gfx, 0x1F00, 0x1000}, {NULL, 0, 0}, @@ -3921,7 +3921,7 @@ static void sub_8090B8C(u8 taskId) u32 otId; u32 personality; u8 paletteNum; - const u16 *palette; + const u8 *lzPaletteData; REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | DISPCNT_BG3_ON | DISPCNT_OBJ_ON; CpuCopy16(gUnknown_08D00524, (void *)(VRAM + 0xC000), 0x1000); @@ -3930,8 +3930,8 @@ static void sub_8090B8C(u8 taskId) otId = ((u16)gTasks[taskId].data[13] << 16) | (u16)gTasks[taskId].data[12]; personality = ((u16)gTasks[taskId].data[15] << 16) | (u16)gTasks[taskId].data[14]; paletteNum = gSprites[gTasks[taskId].data[3]].oam.paletteNum; - palette = species_and_otid_get_pal(species, otId, personality); - LoadCompressedPalette(palette, 0x100 | paletteNum * 16, 32); + lzPaletteData = species_and_otid_get_pal(species, otId, personality); + LoadCompressedPalette(lzPaletteData, 0x100 | paletteNum * 16, 32); DestroyTask(taskId); } } diff --git a/src/pokemon_3.c b/src/pokemon_3.c index ef9a1698d..cb8eb2a46 100644 --- a/src/pokemon_3.c +++ b/src/pokemon_3.c @@ -1172,7 +1172,7 @@ void current_map_music_set__default_for_battle(u16 song) PlayNewMapMusic(sub_8040728()); } -const u16 *pokemon_get_pal(struct Pokemon *mon) +const u8 *pokemon_get_pal(struct Pokemon *mon) { u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0); u32 otId = GetMonData(mon, MON_DATA_OT_ID, 0); @@ -1186,7 +1186,7 @@ const u16 *pokemon_get_pal(struct Pokemon *mon) //Extracts the lower 16 bits of a 32-bit number #define LOHALF(n) ((n) & 0xFFFF) -const u16 *species_and_otid_get_pal(u16 species, u32 otId, u32 personality) +const u8 *species_and_otid_get_pal(u16 species, u32 otId, u32 personality) { u32 shinyValue; @@ -1200,7 +1200,7 @@ const u16 *species_and_otid_get_pal(u16 species, u32 otId, u32 personality) return gMonPaletteTable[species].data; } -const struct SpritePalette *sub_8040990(struct Pokemon *mon) +const struct CompressedSpritePalette *sub_8040990(struct Pokemon *mon) { u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0); u32 otId = GetMonData(mon, MON_DATA_OT_ID, 0); @@ -1208,7 +1208,7 @@ const struct SpritePalette *sub_8040990(struct Pokemon *mon) return sub_80409C8(species, otId, personality); } -const struct SpritePalette *sub_80409C8(u16 species, u32 otId , u32 personality) +const struct CompressedSpritePalette *sub_80409C8(u16 species, u32 otId , u32 personality) { u32 shinyValue; diff --git a/src/script_pokemon_util_80C4BF0.c b/src/script_pokemon_util_80C4BF0.c index fb72be527..ecfd8111b 100644 --- a/src/script_pokemon_util_80C4BF0.c +++ b/src/script_pokemon_util_80C4BF0.c @@ -407,7 +407,7 @@ u8 sub_80C5044(void) void ShowContestEntryMonPic(void) { - struct SpritePalette *paletteData; + const struct CompressedSpritePalette *palette; u32 var1, var2; u16 species; u8 spriteId; @@ -425,13 +425,18 @@ void ShowContestEntryMonPic(void) taskId = CreateTask(sub_80C5190, 0x50); gTasks[taskId].data[0] = 0; gTasks[taskId].data[1] = species; - HandleLoadSpecialPokePic((struct SpriteSheet *)&gMonFrontPicTable[species].data, - gMonFrontPicCoords[species].coords, gMonFrontPicCoords[species].y_offset, - (u32)gUnknown_081FAF4C[0], gUnknown_081FAF4C[1], species, var1); - paletteData = (struct SpritePalette *) sub_80409C8(species, var2, var1); - LoadCompressedObjectPalette(paletteData); + HandleLoadSpecialPokePic( + &gMonFrontPicTable[species], + gMonFrontPicCoords[species].coords, + gMonFrontPicCoords[species].y_offset, + (u32)gUnknown_081FAF4C[0], + gUnknown_081FAF4C[1], + species, + var1); + palette = sub_80409C8(species, var2, var1); + LoadCompressedObjectPalette(palette); GetMonSpriteTemplate_803C56C(species, 1); - gUnknown_02024E8C.paletteTag = paletteData->tag; + gUnknown_02024E8C.paletteTag = palette->tag; spriteId = CreateSprite(&gUnknown_02024E8C, 0x78, 0x40, 0); gTasks[taskId].data[2] = spriteId; gTasks[taskId].data[3] = left; diff --git a/src/starter_choose.c b/src/starter_choose.c index f30be8e08..c838f2dc0 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -172,12 +172,12 @@ static const union AffineAnimCmd *const gSpriteAffineAnimTable_83F7790[] = { gSpriteAffineAnim_83F7774, }; -static const struct SpriteSheet gUnknown_083F7794[] = +static const struct CompressedSpriteSheet gUnknown_083F7794[] = { {gBirchBallarrow_Gfx, 0x0800, 0x1000}, {NULL}, }; -static const struct SpriteSheet gUnknown_083F77A4[] = +static const struct CompressedSpriteSheet gUnknown_083F77A4[] = { {gBirchCircle_Gfx, 0x0800, 0x1001}, {NULL}, diff --git a/src/title_screen.c b/src/title_screen.c index 12c31d10a..dd06956c3 100644 --- a/src/title_screen.c +++ b/src/title_screen.c @@ -152,7 +152,7 @@ static const struct SpriteTemplate sVersionBannerRightSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallback_VersionBannerRight, }; -static const struct SpriteSheet gUnknown_08393EFC[] = +static const struct CompressedSpriteSheet gUnknown_08393EFC[] = { {gVersionTiles, 0x1000, 1000}, {NULL}, @@ -234,7 +234,7 @@ static const struct SpriteTemplate sStartCopyrightBannerSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallback_PressStartCopyrightBanner, }; -static const struct SpriteSheet gUnknown_08393F8C[] = +static const struct CompressedSpriteSheet gUnknown_08393F8C[] = { {gTitleScreenPressStart_Gfx, 0x520, 1001}, {NULL}, @@ -279,7 +279,7 @@ static const struct SpriteTemplate sPokemonLogoShineSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallback_PokemonLogoShine, }; -static const struct SpriteSheet sPokemonLogoShineSpriteSheet[] = +static const struct CompressedSpriteSheet sPokemonLogoShineSpriteSheet[] = { {sLogoShineTiles, 0x800, 1002}, {NULL}, diff --git a/src/wallclock.c b/src/wallclock.c index efc7dd42a..8db13dc2d 100644 --- a/src/wallclock.c +++ b/src/wallclock.c @@ -24,7 +24,7 @@ extern u16 gMiscClockFemale_Pal[]; //-------------------------------------------------- static const u8 ClockGfx_Misc[] = INCBIN_U8("graphics/misc/clock_misc.4bpp.lz"); -static const struct SpriteSheet gUnknown_083F7A90[] = +static const struct CompressedSpriteSheet gUnknown_083F7A90[] = { {ClockGfx_Misc, 0x2000, 0x1000}, {NULL}, -- cgit v1.2.3 From a80eef47ca3fea61b9345ae791056c9ca2650f97 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Mon, 19 Jun 2017 13:41:19 -0500 Subject: whitespace --- src/pokeball.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/pokeball.c b/src/pokeball.c index c123130c6..ee3b95678 100644 --- a/src/pokeball.c +++ b/src/pokeball.c @@ -135,7 +135,7 @@ static const union AnimCmd *const sBallAnimSequences[] = sBallAnimSeq0, sBallAnimSeq1, sBallAnimSeq2, - + // unused? sBallAnimSeq3, sBallAnimSeq4, -- cgit v1.2.3