Merge branch 'master' into dump_trainer_ai_scripts

This commit is contained in:
DizzyEggg
2017-12-30 12:20:16 +01:00
321 changed files with 23184 additions and 5907 deletions

View File

@@ -63,7 +63,7 @@ extern const u8 gUnknown_08C1F46C[];
extern const u8 gUnknown_08C1F5E8[];
extern const u8 gUnknown_08C1F76C[];
extern const u8 gUnknown_08C1F8E8[];
extern const u8 gUnknown_08C0237C[];
extern const u8 gBlankGfxCompressed[];
extern const u16 gBattleInterface_BallStatusBarPal[];
extern const u16 gBattleInterface_BallDisplayPal[];
@@ -110,10 +110,10 @@ static const struct CompressedSpriteSheet gUnknown_0832C100 =
static const struct CompressedSpriteSheet gUnknown_0832C108[BATTLE_BANKS_COUNT] =
{
{gUnknown_08C0237C, 0x0100, 0xd704},
{gUnknown_08C0237C, 0x0120, 0xd705},
{gUnknown_08C0237C, 0x0100, 0xd706},
{gUnknown_08C0237C, 0x0120, 0xd707}
{gBlankGfxCompressed, 0x0100, 0xd704},
{gBlankGfxCompressed, 0x0120, 0xd705},
{gBlankGfxCompressed, 0x0100, 0xd706},
{gBlankGfxCompressed, 0x0120, 0xd707}
};
static const struct SpritePalette gUnknown_0832C128[2] =

View File

@@ -25,7 +25,7 @@
#include "sound.h"
#include "event_scripts.h"
#include "event_data.h"
#include "region_map.h"
#include "constants/region_map_sections.h"
#include "player_pc.h"
#include "strings.h"
#include "tv.h"

View File

@@ -60,16 +60,8 @@ extern u8 gBattleCommunication[];
extern const struct WindowTemplate gUnknown_0833900C;
extern const struct CompressedSpriteSheet gMonFrontPicTable[];
extern const u8 gUnknown_085B58C9[][4];
extern const u16 gUnknown_085B5884[];
extern const u8 gUnknown_085B58D9[];
extern const u16 gUnknown_085B51E4[];
extern const u32 gUnknown_085B4134[];
extern const u32 gUnknown_085B482C[];
extern const u32 gUnknown_085B4D10[];
// strings
extern const u8 gText_ShedinjaJapaneseName2[];
extern const u8 gText_PkmnIsEvolving[];
extern const u8 gText_CongratsPkmnEvolved[];
extern const u8 gText_BattleYesNoChoice[];
@@ -108,6 +100,80 @@ static void InitMovingBackgroundTask(bool8 isLink);
static void sub_813FEE8(u8 taskId);
static void sub_8140174(void);
// const data
static const u16 sUnknown_085B4114[] = INCBIN_U16("graphics/evolution_scene/unknown_5B4114.gbapal");
static const u32 sUnknown_085B4134[] = INCBIN_U32("graphics/evolution_scene/bg.4bpp.lz");
static const u32 sUnknown_085B482C[] = INCBIN_U32("graphics/evolution_scene/bg.bin.lz");
static const u32 sUnknown_085B4D10[] = INCBIN_U32("graphics/evolution_scene/bg2.bin.lz");
static const u16 sUnknown_085B51E4[] = INCBIN_U16("graphics/evolution_scene/gray_transition_intro.gbapal");
static const u16 sUnknown_085B53E4[] = INCBIN_U16("graphics/evolution_scene/gray_transition_lighten.gbapal");
static const u16 sUnknown_085B5544[] = INCBIN_U16("graphics/evolution_scene/gray_transition_darken.gbapal");
static const u16 sUnknown_085B56E4[] = INCBIN_U16("graphics/evolution_scene/gray_transition_outro.gbapal");
static const u16 sUnknown_085B5884[] = INCBIN_U16("graphics/evolution_scene/transition.gbapal");
static const u8 Text_ShedinjaJapaneseName[] = _("ヌケニン");
static const u8 sUnknown_085B58C9[][4] =
{
{ 0x00, 0x0C, 0x01, 0x06 },
{ 0x0D, 0x24, 0x05, 0x02 },
{ 0x0D, 0x18, 0x01, 0x02 },
{ 0x25, 0x31, 0x01, 0x06 },
};
static const u8 sUnknown_085B58D9[][16] = {
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00, 0x0B, 0x00, 0x00 },
{ 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x00, 0x00 },
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x00, 0x00 },
{ 0x00, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x00, 0x00 },
{ 0x00, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x0B, 0x00, 0x00 },
{ 0x00, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x0B, 0x0A, 0x00, 0x00 },
{ 0x00, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x00, 0x00 },
{ 0x00, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x00, 0x00 },
{ 0x00, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x00, 0x00 },
{ 0x00, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x00, 0x00 },
{ 0x00, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x00, 0x00 },
{ 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x00, 0x00 },
{ 0x00, 0x0B, 0x0C, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x00, 0x00 },
{ 0x00, 0x0C, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x00, 0x00 },
{ 0x00, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00 },
{ 0x00, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x02, 0x00, 0x00 },
{ 0x00, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x02, 0x03, 0x00, 0x00 },
{ 0x00, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x02, 0x03, 0x04, 0x00, 0x00 },
{ 0x00, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x00 },
{ 0x00, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x00, 0x00 },
{ 0x00, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x00, 0x00 },
{ 0x00, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00 },
{ 0x00, 0x05, 0x04, 0x03, 0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00, 0x00 },
{ 0x00, 0x04, 0x03, 0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x00, 0x00 },
{ 0x00, 0x03, 0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x00, 0x00 },
{ 0x00, 0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x00, 0x00 },
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x00, 0x00 },
{ 0x00, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00 },
{ 0x00, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
};
static void CB2_BeginEvolutionScene(void)
{
UpdatePaletteFade();
@@ -544,7 +610,7 @@ static void CreateShedinja(u16 preEvoSpecies, struct Pokemon* mon)
if (GetMonData(Shedinja, MON_DATA_SPECIES) == SPECIES_SHEDINJA
&& GetMonData(Shedinja, MON_DATA_LANGUAGE) == LANGUAGE_JAPANESE
&& GetMonData(mon, MON_DATA_SPECIES) == SPECIES_NINJASK)
SetMonData(Shedinja, MON_DATA_NICKNAME, gText_ShedinjaJapaneseName2);
SetMonData(Shedinja, MON_DATA_NICKNAME, Text_ShedinjaJapaneseName);
}
}
@@ -1330,17 +1396,17 @@ static void sub_813FDEC(u8 taskId)
if (data[5]++ < 20)
return;
if (data[0]++ > gUnknown_085B58C9[data[2]][3])
if (data[0]++ > sUnknown_085B58C9[data[2]][3])
{
if (gUnknown_085B58C9[data[2]][1] == data[1])
if (sUnknown_085B58C9[data[2]][1] == data[1])
{
data[3]++;
if (data[3] == gUnknown_085B58C9[data[2]][2])
if (data[3] == sUnknown_085B58C9[data[2]][2])
{
data[3] = 0;
data[2]++;
}
data[1] = gUnknown_085B58C9[data[2]][0];
data[1] = sUnknown_085B58C9[data[2]][0];
}
else
{
@@ -1411,7 +1477,7 @@ static void InitMovingBgValues(u16 *movingBgs)
{
for (j = 0; j < 16; j++)
{
movingBgs[i * 16 + j] = gUnknown_085B5884[gUnknown_085B58D9[i * 16 + j]];
movingBgs[i * 16 + j] = sUnknown_085B5884[sUnknown_085B58D9[i][j]];
}
}
}
@@ -1428,11 +1494,11 @@ static void InitMovingBackgroundTask(bool8 isLink)
else
innerBgId = 1, outerBgId = 3;
LoadPalette(gUnknown_085B51E4, 0xA0, 0x20);
LoadPalette(sUnknown_085B51E4, 0xA0, 0x20);
copy_decompressed_tile_data_to_vram_autofree(1, gUnknown_085B4134, FALSE, 0, 0);
CopyToBgTilemapBuffer(1, gUnknown_085B482C, 0, 0);
CopyToBgTilemapBuffer(outerBgId, gUnknown_085B4D10, 0, 0);
copy_decompressed_tile_data_to_vram_autofree(1, sUnknown_085B4134, FALSE, 0, 0);
CopyToBgTilemapBuffer(1, sUnknown_085B482C, 0, 0);
CopyToBgTilemapBuffer(outerBgId, sUnknown_085B4D10, 0, 0);
CopyBgTilemapBufferToVram(1);
CopyBgTilemapBufferToVram(outerBgId);

View File

@@ -97,7 +97,7 @@ extern u16 sub_818D7D8(u16 species, u32 trainerId, u32 personality, u8 arg3, s16
extern void sub_8198204(u8 *dst, const u8 *src, u8, u8, u8);
extern bool8 sub_80F9C30(void);
extern void sub_8198314(void);
extern void sub_8137C3C(void);
extern void ReturnFromHallOfFamePC(void);
extern void sub_8198180(const u8 *src, u8, u8);
extern void sub_80F9BF4(u16, u16, u8);
extern void sub_81980F0(u8, u8, u8, u8, u16);
@@ -1108,7 +1108,7 @@ static void Task_HofPC_HandleExit(u8 taskId)
if (sHofMonPtr != NULL)
FREE_AND_SET_NULL(sHofMonPtr);
sub_8137C3C();
ReturnFromHallOfFamePC();
}
}

441
src/landmark.c Normal file
View File

@@ -0,0 +1,441 @@
#include "global.h"
#include "event_data.h"
#include "constants/region_map_sections.h"
struct Landmark
{
const u8 *name;
u16 flag;
};
struct LandmarkList
{
u8 mapSection;
u8 id;
const struct Landmark *const *landmarks;
};
static const u8 LandmarkName_FlowerShop[] = _("FLOWER SHOP");
static const u8 LandmarkName_PetalburgWoods[] = _("PETALBURG WOODS");
static const u8 LandmarkName_MrBrineysCottage[] = _("MR. BRINEYS COTTAGE");
static const u8 LandmarkName_AbandonedShip[] = _("ABANDONED SHIP");
static const u8 LandmarkName_SeashoreHouse[] = _("SEASHORE HOUSE");
static const u8 LandmarkName_SlateportBeach[] = _("SLATEPORT BEACH");
static const u8 LandmarkName_CyclingRoad[] = _("CYCLING ROAD");
static const u8 LandmarkName_NewMauville[] = _("NEW MAUVILLE");
static const u8 LandmarkName_TrickHouse[] = _("TRICK HOUSE");
static const u8 LandmarkName_OldLadysRestShop[] = _("OLD LADYS REST STOP");
static const u8 LandmarkName_Desert[] = _("DESERT");
static const u8 LandmarkName_WinstrateFamily[] = _("THE WINSTRATE FAMILY");
static const u8 LandmarkName_CableCar[] = _("CABLE CAR");
static const u8 LandmarkName_GlassWorkshop[] = _("GLASS WORKSHOP");
static const u8 LandmarkName_WeatherInstitute[] = _("WEATHER INSTITUTE");
static const u8 LandmarkName_MeteorFalls[] = _("METEOR FALLS");
static const u8 LandmarkName_TunnelersRestHouse[] = _("TUNNELERS RESTHOUSE");
static const u8 LandmarkName_RusturfTunnel[] = _("RUSTURF TUNNEL");
static const u8 LandmarkName_PokemonDayCare[] = _("POKéMON DAY CARE");
static const u8 LandmarkName_SafariZoneEntrance[] = _("SAFARI ZONE ENTRANCE");
static const u8 LandmarkName_MtPyre[] = _("MT. PYRE");
static const u8 LandmarkName_ShoalCave[] = _("SHOAL CAVE");
static const u8 LandmarkName_SeafloorCavern[] = _("SEAFLOOR CAVERN");
static const u8 LandmarkName_GraniteCave[] = _("GRANITE CAVE");
static const u8 LandmarkName_OceanCurrent[] = _("OCEAN CURRENT");
static const u8 LandmarkName_LanettesHouse[] = _("LANETTES HOUSE");
static const u8 LandmarkName_FieryPath[] = _("FIERY PATH");
static const u8 LandmarkName_JaggedPass[] = _("JAGGED PASS");
static const u8 LandmarkName_SkyPillar[] = _("SKY PILLAR");
static const u8 LandmarkName_BerryMastersHouse[] = _("BERRY MASTERS HOUSE");
static const u8 LandmarkName_IslandCave[] = _("ISLAND CAVE");
static const u8 LandmarkName_DesertRuins[] = _("DESERT RUINS");
static const u8 LandmarkName_ScorchedSlab[] = _("SCORCHED SLAB");
static const u8 LandmarkName_AncientTomb[] = _("ANCIENT TOMB");
static const u8 LandmarkName_SealedChamber[] = _("SEALED CHAMBER");
static const u8 LandmarkName_FossilManiacsHouse[] = _("FOSSIL MANIACS HOUSE");
static const u8 LandmarkName_HuntersHouse[] = _("HUNTERS HOUSE");
static const u8 LandmarkName_MagmaHideout[] = _("MAGMA HIDEOUT");
static const u8 LandmarkName_MirageTower[] = _("MIRAGE TOWER");
static const u8 LandmarkName_AlteringCave[] = _("ALTERING CAVE");
static const u8 LandmarkName_DesertUnderpass[] = _("DESERT UNDERPASS");
static const u8 LandmarkName_TrainerHill[] = _("TRAINER HILL");
static const struct Landmark Landmark_FlowerShop = {LandmarkName_FlowerShop, FLAG_LANDMARK_FLOWER_SHOP};
static const struct Landmark Landmark_PetalburgWoods = {LandmarkName_PetalburgWoods, -1};
static const struct Landmark Landmark_MrBrineysCottage = {LandmarkName_MrBrineysCottage, FLAG_LANDMARK_MR_BRINEY_HOUSE};
static const struct Landmark Landmark_AbandonedShip = {LandmarkName_AbandonedShip, FLAG_LANDMARK_ABANDONED_SHIP};
static const struct Landmark Landmark_SeashoreHouse = {LandmarkName_SeashoreHouse, FLAG_LANDMARK_SEASHORE_HOUSE};
static const struct Landmark Landmark_SlateportBeach = {LandmarkName_SlateportBeach, -1};
static const struct Landmark Landmark_CyclingRoad = {LandmarkName_CyclingRoad, -1};
static const struct Landmark Landmark_NewMauville = {LandmarkName_NewMauville, FLAG_LANDMARK_NEW_MAUVILLE};
static const struct Landmark Landmark_TrickHouse = {LandmarkName_TrickHouse, FLAG_LANDMARK_TRICK_HOUSE};
static const struct Landmark Landmark_OldLadysRestShop = {LandmarkName_OldLadysRestShop, FLAG_LANDMARK_OLD_LADY_REST_SHOP};
static const struct Landmark Landmark_Desert = {LandmarkName_Desert, -1};
static const struct Landmark Landmark_WinstrateFamily = {LandmarkName_WinstrateFamily, FLAG_LANDMARK_WINSTRATE_FAMILY};
static const struct Landmark Landmark_CableCar = {LandmarkName_CableCar, -1};
static const struct Landmark Landmark_GlassWorkshop = {LandmarkName_GlassWorkshop, FLAG_LANDMARK_GLASS_WORKSHOP};
static const struct Landmark Landmark_WeatherInstitute = {LandmarkName_WeatherInstitute, -1};
static const struct Landmark Landmark_MeteorFalls = {LandmarkName_MeteorFalls, -1};
static const struct Landmark Landmark_TunnelersRestHouse = {LandmarkName_TunnelersRestHouse, FLAG_LANDMARK_TUNNELERS_REST_HOUSE};
static const struct Landmark Landmark_RusturfTunnel = {LandmarkName_RusturfTunnel, -1};
static const struct Landmark Landmark_PokemonDayCare = {LandmarkName_PokemonDayCare, FLAG_LANDMARK_POKEMON_DAYCARE};
static const struct Landmark Landmark_SafariZoneEntrance = {LandmarkName_SafariZoneEntrance, -1};
static const struct Landmark Landmark_MtPyre = {LandmarkName_MtPyre, -1};
static const struct Landmark Landmark_ShoalCave = {LandmarkName_ShoalCave, -1};
static const struct Landmark Landmark_SeafloorCavern = {LandmarkName_SeafloorCavern, FLAG_LANDMARK_SEAFLOOR_CAVERN};
static const struct Landmark Landmark_GraniteCave = {LandmarkName_GraniteCave, -1};
static const struct Landmark Landmark_OceanCurrent = {LandmarkName_OceanCurrent, -1};
static const struct Landmark Landmark_LanettesHouse = {LandmarkName_LanettesHouse, FLAG_LANDMARK_LANETTES_HOUSE};
static const struct Landmark Landmark_FieryPath = {LandmarkName_FieryPath, FLAG_LANDMARK_FIERY_PATH};
static const struct Landmark Landmark_JaggedPass = {LandmarkName_JaggedPass, -1};
static const struct Landmark Landmark_BerryMastersHouse = {LandmarkName_BerryMastersHouse, FLAG_LANDMARK_BERRY_MASTERS_HOUSE};
static const struct Landmark Landmark_IslandCave = {LandmarkName_IslandCave, FLAG_LANDMARK_ISLAND_CAVE};
static const struct Landmark Landmark_DesertRuins = {LandmarkName_DesertRuins, FLAG_LANDMARK_DESERT_RUINS};
static const struct Landmark Landmark_ScorchedSlab = {LandmarkName_ScorchedSlab, FLAG_LANDMARK_SCORCHED_SLAB};
static const struct Landmark Landmark_AncientTomb = {LandmarkName_AncientTomb, FLAG_LANDMARK_ANCIENT_TOMB};
static const struct Landmark Landmark_SealedChamber = {LandmarkName_SealedChamber, FLAG_LANDMARK_SEALED_CHAMBER};
static const struct Landmark Landmark_FossilManiacsHouse = {LandmarkName_FossilManiacsHouse, FLAG_LANDMARK_FOSSIL_MANIACS_HOUSE};
static const struct Landmark Landmark_HuntersHouse = {LandmarkName_HuntersHouse, FLAG_LANDMARK_HUNTERS_HOUSE};
static const struct Landmark Landmark_SkyPillar = {LandmarkName_SkyPillar, FLAG_LANDMARK_SKY_PILLAR};
static const struct Landmark Landmark_MirageTower = {LandmarkName_MirageTower, FLAG_LANDMARK_MIRAGE_TOWER};
static const struct Landmark Landmark_AlteringCave = {LandmarkName_AlteringCave, FLAG_LANDMARK_ALTERING_CAVE};
static const struct Landmark Landmark_DesertUnderpass = {LandmarkName_DesertUnderpass, FLAG_LANDMARK_DESERT_UNDERPASS};
static const struct Landmark Landmark_TrainerHill = {LandmarkName_TrainerHill, FLAG_LANDMARK_TRAINER_HILL};
static const struct Landmark *const Landmarks_Route103_2[] =
{
&Landmark_AlteringCave,
NULL,
};
static const struct Landmark *const Landmarks_Route104_0[] =
{
&Landmark_FlowerShop,
NULL,
};
static const struct Landmark *const Landmarks_Route104_1[] =
{
&Landmark_PetalburgWoods,
&Landmark_MrBrineysCottage,
NULL,
};
static const struct Landmark *const Landmarks_Route105_0[] =
{
&Landmark_IslandCave,
NULL,
};
static const struct Landmark *const Landmarks_Route106_1[] =
{
&Landmark_GraniteCave,
NULL,
};
static const struct Landmark *const Landmarks_Route108_0[] =
{
&Landmark_AbandonedShip,
NULL,
};
static const struct Landmark *const Landmarks_Route109_0[] =
{
&Landmark_SeashoreHouse,
&Landmark_SlateportBeach,
NULL,
};
static const struct Landmark *const Landmarks_Route110_0[] =
{
&Landmark_CyclingRoad,
&Landmark_NewMauville,
NULL,
};
static const struct Landmark *const Landmarks_Route110_1[] =
{
&Landmark_CyclingRoad,
NULL,
};
static const struct Landmark *const Landmarks_Route110_2[] =
{
&Landmark_CyclingRoad,
&Landmark_TrickHouse,
NULL,
};
static const struct Landmark *const Landmarks_Route111_0[] =
{
&Landmark_OldLadysRestShop,
NULL,
};
static const struct Landmark *const Landmarks_Route111_1[] =
{
&Landmark_Desert,
NULL,
};
static const struct Landmark *const Landmarks_Route111_2[] =
{
&Landmark_MirageTower,
&Landmark_Desert,
NULL,
};
static const struct Landmark *const Landmarks_Route111_3[] =
{
&Landmark_DesertRuins,
&Landmark_Desert,
NULL,
};
static const struct Landmark *const Landmarks_Route111_4[] =
{
&Landmark_TrainerHill,
&Landmark_WinstrateFamily,
&Landmark_Desert,
NULL,
};
static const struct Landmark *const Landmarks_Route112_0[] =
{
&Landmark_FieryPath,
&Landmark_JaggedPass,
NULL,
};
static const struct Landmark *const Landmarks_Route112_1[] =
{
&Landmark_CableCar,
&Landmark_FieryPath,
NULL,
};
static const struct Landmark *const Landmarks_Route113_1[] =
{
&Landmark_GlassWorkshop,
NULL,
};
static const struct Landmark *const Landmarks_Route114_1[] =
{
&Landmark_DesertUnderpass,
&Landmark_FossilManiacsHouse,
NULL,
};
static const struct Landmark *const Landmarks_Route114_2[] =
{
&Landmark_LanettesHouse,
NULL,
};
static const struct Landmark *const Landmarks_MeteorFalls[] =
{
&Landmark_MeteorFalls,
NULL,
};
static const struct Landmark *const Landmarks_Route116_1[] =
{
&Landmark_TunnelersRestHouse,
&Landmark_RusturfTunnel,
NULL,
};
static const struct Landmark *const Landmarks_Route116_2[] =
{
&Landmark_RusturfTunnel,
NULL,
};
static const struct Landmark *const Landmarks_Route117_2[] =
{
&Landmark_PokemonDayCare,
NULL,
};
static const struct Landmark *const Landmarks_Route119_1[] =
{
&Landmark_WeatherInstitute,
NULL,
};
static const struct Landmark *const Landmarks_Route120_0[] =
{
&Landmark_ScorchedSlab,
NULL,
};
static const struct Landmark *const Landmarks_Route120_2[] =
{
&Landmark_AncientTomb,
NULL,
};
static const struct Landmark *const Landmarks_Route121_2[] =
{
&Landmark_SafariZoneEntrance,
NULL,
};
static const struct Landmark *const Landmarks_Route122_0[] =
{
&Landmark_MtPyre,
NULL,
};
static const struct Landmark *const Landmarks_Route123_0[] =
{
&Landmark_BerryMastersHouse,
NULL,
};
static const struct Landmark *const Landmarks_Route124_7[] =
{
&Landmark_HuntersHouse,
NULL,
};
static const struct Landmark *const Landmarks_Route125_2[] =
{
&Landmark_ShoalCave,
NULL,
};
static const struct Landmark *const Landmarks_Route128_1[] =
{
&Landmark_SeafloorCavern,
NULL,
};
static const struct Landmark *const Landmarks_Route131_1[] =
{
&Landmark_SkyPillar,
NULL,
};
static const struct Landmark *const Landmarks_OceanCurrent[] =
{
&Landmark_OceanCurrent,
NULL,
};
static const struct Landmark *const Landmarks_Route134_2[] =
{
&Landmark_SealedChamber,
&Landmark_OceanCurrent,
NULL,
};
static const struct Landmark *const Landmarks_MtChimney_2[] =
{
&Landmark_CableCar,
&Landmark_JaggedPass,
NULL,
};
static const struct LandmarkList gLandmarkLists[] =
{
{MAPSEC_ROUTE_103, 2, Landmarks_Route103_2},
{MAPSEC_ROUTE_104, 0, Landmarks_Route104_0},
{MAPSEC_ROUTE_104, 1, Landmarks_Route104_1},
{MAPSEC_ROUTE_105, 0, Landmarks_Route105_0},
{MAPSEC_ROUTE_106, 1, Landmarks_Route106_1},
{MAPSEC_ROUTE_108, 0, Landmarks_Route108_0},
{MAPSEC_ROUTE_109, 0, Landmarks_Route109_0},
{MAPSEC_ROUTE_110, 0, Landmarks_Route110_0},
{MAPSEC_ROUTE_110, 1, Landmarks_Route110_1},
{MAPSEC_ROUTE_110, 2, Landmarks_Route110_2},
{MAPSEC_ROUTE_111, 0, Landmarks_Route111_0},
{MAPSEC_ROUTE_111, 1, Landmarks_Route111_1},
{MAPSEC_ROUTE_111, 2, Landmarks_Route111_2},
{MAPSEC_ROUTE_111, 3, Landmarks_Route111_3},
{MAPSEC_ROUTE_111, 4, Landmarks_Route111_4},
{MAPSEC_ROUTE_112, 0, Landmarks_Route112_0},
{MAPSEC_ROUTE_112, 1, Landmarks_Route112_1},
{MAPSEC_ROUTE_113, 1, Landmarks_Route113_1},
{MAPSEC_ROUTE_114, 1, Landmarks_Route114_1},
{MAPSEC_ROUTE_114, 2, Landmarks_Route114_2},
{MAPSEC_ROUTE_114, 3, Landmarks_MeteorFalls},
{MAPSEC_ROUTE_115, 0, Landmarks_MeteorFalls},
{MAPSEC_ROUTE_115, 1, Landmarks_MeteorFalls},
{MAPSEC_ROUTE_116, 1, Landmarks_Route116_1},
{MAPSEC_ROUTE_116, 2, Landmarks_Route116_2},
{MAPSEC_ROUTE_117, 2, Landmarks_Route117_2},
{MAPSEC_ROUTE_119, 1, Landmarks_Route119_1},
{MAPSEC_ROUTE_120, 0, Landmarks_Route120_0},
{MAPSEC_ROUTE_120, 2, Landmarks_Route120_2},
{MAPSEC_ROUTE_121, 2, Landmarks_Route121_2},
{MAPSEC_ROUTE_122, 0, Landmarks_Route122_0},
{MAPSEC_ROUTE_123, 0, Landmarks_Route123_0},
{MAPSEC_ROUTE_122, 1, Landmarks_Route122_0},
{MAPSEC_ROUTE_124, 7, Landmarks_Route124_7},
{MAPSEC_ROUTE_125, 2, Landmarks_Route125_2},
{MAPSEC_ROUTE_128, 1, Landmarks_Route128_1},
{MAPSEC_ROUTE_131, 1, Landmarks_Route131_1},
{MAPSEC_ROUTE_132, 0, Landmarks_OceanCurrent},
{MAPSEC_ROUTE_132, 1, Landmarks_OceanCurrent},
{MAPSEC_ROUTE_133, 0, Landmarks_OceanCurrent},
{MAPSEC_ROUTE_133, 1, Landmarks_OceanCurrent},
{MAPSEC_ROUTE_133, 2, Landmarks_OceanCurrent},
{MAPSEC_ROUTE_134, 0, Landmarks_OceanCurrent},
{MAPSEC_ROUTE_134, 1, Landmarks_OceanCurrent},
{MAPSEC_ROUTE_134, 2, Landmarks_Route134_2},
{MAPSEC_MT_CHIMNEY, 2, Landmarks_MtChimney_2},
{MAPSEC_NONE, 0, NULL},
};
static const struct Landmark *const *GetLandmarks(u8 mapSection, u8 id);
const u8 *GetLandmarkName(u8 mapSection, u8 id, u8 count)
{
const struct Landmark *const *landmarks = GetLandmarks(mapSection, id);
if (!landmarks)
return NULL;
while (1)
{
const struct Landmark *landmark = *landmarks;
if (landmark->flag == 0xFFFF || FlagGet(landmark->flag) == TRUE)
{
if (count == 0)
break;
else
count--;
}
landmarks++;
if (!*landmarks)
return NULL;
}
return (*landmarks)->name;
}
static const struct Landmark *const *GetLandmarks(u8 mapSection, u8 id)
{
u16 i = 0;
for (; gLandmarkLists[i].mapSection != MAPSEC_NONE; i++)
{
if (gLandmarkLists[i].mapSection > mapSection)
return NULL;
if (gLandmarkLists[i].mapSection == mapSection)
break;
}
if (gLandmarkLists[i].mapSection == MAPSEC_NONE)
return NULL;
for (; gLandmarkLists[i].mapSection == mapSection; i++)
{
if (gLandmarkLists[i].id == id)
return gLandmarkLists[i].landmarks;
}
return NULL;
}

View File

@@ -65,7 +65,8 @@ static const struct PaletteStructTemplate gDummyPaletteStructTemplate = {
.uid = 0xFFFF,
.pst_field_B_5 = 1
};
static const u8 sUnknown_0852489C[] = {
static const u8 sRoundedDownGrayscaleMap[] = {
0, 0, 0, 0, 0,
5, 5, 5, 5, 5,
11, 11, 11, 11, 11,
@@ -620,7 +621,7 @@ static u8 UpdateFastPaletteFade(void)
gPlttBufferFaded[i] = r | (g << 5) | (b << 10);
}
break;
case FAST_FADE_OUT_TO_WHTIE:
case FAST_FADE_OUT_TO_WHITE:
for (i = paletteOffsetStart; i < paletteOffsetEnd; i++)
{
struct PlttData *data = (struct PlttData *)&gPlttBufferFaded[i];
@@ -701,7 +702,7 @@ static u8 UpdateFastPaletteFade(void)
case FAST_FADE_IN_FROM_BLACK:
CpuCopy32(gPlttBufferUnfaded, gPlttBufferFaded, PLTT_SIZE);
break;
case FAST_FADE_OUT_TO_WHTIE:
case FAST_FADE_OUT_TO_WHITE:
CpuFill32(0xFFFFFFFF, gPlttBufferFaded, PLTT_SIZE);
break;
case FAST_FADE_OUT_TO_BLACK:
@@ -838,10 +839,10 @@ void BlendPalettesUnfaded(u32 selectedPalettes, u8 coeff, u16 color)
void TintPalette_GrayScale(u16 *palette, u16 count)
{
s32 r;
s32 g;
s32 b;
s32 gray;
int r;
int g;
int b;
u32 gray;
int i;
for (i = 0; i < count; i++)
@@ -850,23 +851,22 @@ void TintPalette_GrayScale(u16 *palette, u16 count)
g = (*palette >> 5) & 0x1F;
b = (*palette >> 10) & 0x1F;
r *= 0x4C;
r += g * 0x97;
r += b * 0x1D;
r = r * Q_8_8(0.2969);
r += g * Q_8_8(0.5899);
r += b * Q_8_8(0.1133);
gray = r >> 8;
*palette++ = gray << 10 | gray << 5 | gray;
}
return;
}
void TintPalette_GrayScale2(u16 *palette, u16 count)
{
s32 r;
s32 g;
s32 b;
s32 gray;
int r;
int g;
int b;
u32 gray;
int i;
for (i = 0; i < count; i++)
@@ -875,28 +875,27 @@ void TintPalette_GrayScale2(u16 *palette, u16 count)
g = (*palette >> 5) & 0x1F;
b = (*palette >> 10) & 0x1F;
r *= 0x4C;
r += g * 0x97;
r += b * 0x1D;
r = r * Q_8_8(0.2969);
r += g * Q_8_8(0.5899);
r += b * Q_8_8(0.1133);
gray = r >> 8;
if ((u32)gray > 0x1F)
if (gray > 0x1F)
gray = 0x1F;
gray = sUnknown_0852489C[gray];
gray = sRoundedDownGrayscaleMap[gray];
*palette++ = gray << 10 | gray << 5 | gray;
}
return;
}
#ifdef NONMATCHING
void TintPalette_SepiaTone(u16 *palette, u16 count)
{
s32 r;
s32 g;
s32 b;
int red;
int green;
int blue;
u32 gray;
u32 sepia;
s8 r2;
@@ -929,7 +928,6 @@ void TintPalette_SepiaTone(u16 *palette, u16 count)
*palette++ = b2 << 10 | g2 << 5 | r2;
}
return;
}
#else
__attribute__((naked))
@@ -995,7 +993,7 @@ _080A2BA2:\n\
#endif // NONMATCHING
#ifdef NONMATCHING
void sub_80A2BAC(u16 *palette, u16 count, u16 a3, u16 a4, u16 a5)
void TintPalette_CustomTone(u16 *palette, u16 count, u16 a3, u16 a4, u16 a5)
{
s32 r;
s32 g;
@@ -1039,7 +1037,7 @@ void sub_80A2BAC(u16 *palette, u16 count, u16 a3, u16 a4, u16 a5)
}
#else
__attribute__((naked))
void sub_80A2BAC(u16 *palette, u16 count, u16 a3, u16 a4, u16 a5)
void TintPalette_CustomTone(u16 *palette, u16 count, u16 a3, u16 a4, u16 a5)
{
asm("push {r4-r7,lr}\n\
mov r7, r9\n\
@@ -1153,7 +1151,7 @@ void sub_80A2C44(u32 a1, s8 a2, u8 a3, u8 a4, u16 a5, u8 a6, u8 a7)
gTasks[taskId].func(taskId);
}
u32 sub_80A2CF8(u8 var)
bool32 sub_80A2CF8(u8 var)
{
int i;
@@ -1181,7 +1179,7 @@ void sub_80A2D54(u8 taskId)
{
u32 wordVar;
s16 *data;
u16 temp;
s16 temp;
data = gTasks[taskId].data;
wordVar = GetWordTaskArg(taskId, 5);
@@ -1191,7 +1189,7 @@ void sub_80A2D54(u8 taskId)
data[4] = 0;
BlendPalettes(wordVar, data[0], data[7]);
temp = data[1];
if (data[0] == (s16)temp)
if (data[0] == temp)
{
DestroyTask(taskId);
}
@@ -1200,12 +1198,12 @@ void sub_80A2D54(u8 taskId)
data[0] += data[2];
if (data[2] >= 0)
{
if (data[0] < (s16)temp)
if (data[0] < temp)
{
return;
}
}
else if (data[0] > (s16)temp)
else if (data[0] > temp)
{
return;
}

542
src/pokedex.c Normal file
View File

@@ -0,0 +1,542 @@
#include "global.h"
#include "gba/m4a_internal.h"
#include "pokedex.h"
#include "sprite.h"
#include "graphics.h"
#include "decompress.h"
#include "bg.h"
#include "window.h"
// this file's functions
void sub_80BE604(struct Sprite *sprite);
void sub_80BE658(struct Sprite *sprite);
void sub_80BE758(struct Sprite *sprite);
void sub_80BE780(struct Sprite *sprite);
void sub_80BE44C(struct Sprite *sprite);
void sub_80BE834(struct Sprite *sprite);
// const rom data
#include "data/pokedex_orders.h"
static const struct OamData sOamData_855CFE4 =
{
.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
};
static const struct OamData sOamData_855CFEC =
{
.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
};
static const struct OamData sOamData_855CFF4 =
{
.y = 160,
.affineMode = 0,
.objMode = 0,
.mosaic = 0,
.bpp = 0,
.shape = 1,
.x = 0,
.matrixNum = 0,
.size = 2,
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
.affineParam = 0
};
static const struct OamData sOamData_855CFFC =
{
.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
};
static const struct OamData sOamData_855D004 =
{
.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
};
static const struct OamData sOamData_855D00C =
{
.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
};
static const union AnimCmd sSpriteAnim_855D014[] =
{
ANIMCMD_FRAME(3, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D01C[] =
{
ANIMCMD_FRAME(1, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D024[] =
{
ANIMCMD_FRAME(16, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D02C[] =
{
ANIMCMD_FRAME(48, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D034[] =
{
ANIMCMD_FRAME(40, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D03C[] =
{
ANIMCMD_FRAME(32, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D044[] =
{
ANIMCMD_FRAME(56, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D04C[] =
{
ANIMCMD_FRAME(64, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D054[] =
{
ANIMCMD_FRAME(96, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D05C[] =
{
ANIMCMD_FRAME(160, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D064[] =
{
ANIMCMD_FRAME(168, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D06C[] =
{
ANIMCMD_FRAME(128, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D074[] =
{
ANIMCMD_FRAME(130, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D07C[] =
{
ANIMCMD_FRAME(132, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D084[] =
{
ANIMCMD_FRAME(134, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D08C[] =
{
ANIMCMD_FRAME(136, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D094[] =
{
ANIMCMD_FRAME(138, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D09C[] =
{
ANIMCMD_FRAME(140, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D0A4[] =
{
ANIMCMD_FRAME(142, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D0AC[] =
{
ANIMCMD_FRAME(144, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D0B4[] =
{
ANIMCMD_FRAME(146, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D0BC[] =
{
ANIMCMD_FRAME(176, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D0C4[] =
{
ANIMCMD_FRAME(178, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D0CC[] =
{
ANIMCMD_FRAME(180, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D0D4[] =
{
ANIMCMD_FRAME(182, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D0DC[] =
{
ANIMCMD_FRAME(184, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D0E4[] =
{
ANIMCMD_FRAME(186, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D0EC[] =
{
ANIMCMD_FRAME(188, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D0F4[] =
{
ANIMCMD_FRAME(190, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D0FC[] =
{
ANIMCMD_FRAME(192, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D104[] =
{
ANIMCMD_FRAME(194, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_855D10C[] =
{
ANIMCMD_FRAME(4, 30),
ANIMCMD_END
};
static const union AnimCmd *const sSpriteAnimTable_855D114[] =
{
sSpriteAnim_855D014
};
static const union AnimCmd *const sSpriteAnimTable_855D118[] =
{
sSpriteAnim_855D01C
};
static const union AnimCmd *const sSpriteAnimTable_855D11C[] =
{
sSpriteAnim_855D024
};
static const union AnimCmd *const sSpriteAnimTable_855D120[] =
{
sSpriteAnim_855D02C,
sSpriteAnim_855D034,
sSpriteAnim_855D03C,
sSpriteAnim_855D044
};
static const union AnimCmd *const sSpriteAnimTable_855D130[] =
{
sSpriteAnim_855D04C,
sSpriteAnim_855D054
};
static const union AnimCmd *const sSpriteAnimTable_855D138[] =
{
sSpriteAnim_855D05C,
sSpriteAnim_855D064
};
static const union AnimCmd *const sSpriteAnimTable_855D140[] =
{
sSpriteAnim_855D06C,
sSpriteAnim_855D074,
sSpriteAnim_855D07C,
sSpriteAnim_855D084,
sSpriteAnim_855D08C,
sSpriteAnim_855D094,
sSpriteAnim_855D09C,
sSpriteAnim_855D0A4,
sSpriteAnim_855D0AC,
sSpriteAnim_855D0B4
};
static const union AnimCmd *const sSpriteAnimTable_855D168[] =
{
sSpriteAnim_855D0BC,
sSpriteAnim_855D0C4,
sSpriteAnim_855D0CC,
sSpriteAnim_855D0D4,
sSpriteAnim_855D0DC,
sSpriteAnim_855D0E4,
sSpriteAnim_855D0EC,
sSpriteAnim_855D0F4,
sSpriteAnim_855D0FC,
sSpriteAnim_855D104
};
static const union AnimCmd *const sSpriteAnimTable_855D190[] =
{
sSpriteAnim_855D10C
};
const struct SpriteTemplate gUnknown_0855D194 =
{
.tileTag = 4096,
.paletteTag = 4096,
.oam = &sOamData_855CFE4,
.anims = sSpriteAnimTable_855D114,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80BE604,
};
const struct SpriteTemplate gUnknown_0855D1AC =
{
.tileTag = 4096,
.paletteTag = 4096,
.oam = &sOamData_855CFEC,
.anims = sSpriteAnimTable_855D118,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80BE658,
};
const struct SpriteTemplate gUnknown_0855D1C4 =
{
.tileTag = 4096,
.paletteTag = 4096,
.oam = &sOamData_855CFF4,
.anims = sSpriteAnimTable_855D120,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80BE758,
};
const struct SpriteTemplate gUnknown_0855D1DC =
{
.tileTag = 4096,
.paletteTag = 4096,
.oam = &sOamData_855CFFC,
.anims = sSpriteAnimTable_855D11C,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80BE780,
};
const struct SpriteTemplate gUnknown_0855D1F4 =
{
.tileTag = 4096,
.paletteTag = 4096,
.oam = &sOamData_855D004,
.anims = sSpriteAnimTable_855D130,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80BE44C,
};
const struct SpriteTemplate gUnknown_0855D20C =
{
.tileTag = 4096,
.paletteTag = 4096,
.oam = &sOamData_855CFF4,
.anims = sSpriteAnimTable_855D138,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80BE44C,
};
const struct SpriteTemplate gUnknown_0855D224 =
{
.tileTag = 4096,
.paletteTag = 4096,
.oam = &sOamData_855D00C,
.anims = sSpriteAnimTable_855D140,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80BE44C,
};
const struct SpriteTemplate gUnknown_0855D23C =
{
.tileTag = 4096,
.paletteTag = 4096,
.oam = &sOamData_855D00C,
.anims = sSpriteAnimTable_855D168,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80BE44C,
};
const struct SpriteTemplate gUnknown_0855D254 =
{
.tileTag = 4096,
.paletteTag = 4096,
.oam = &sOamData_855D00C,
.anims = sSpriteAnimTable_855D190,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80BE834,
};
const struct CompressedSpriteSheet gSpriteSheets_0855D26C[] =
{
{gUnknown_08DC234C, 0x2000, 4096},
{0}
};
const struct CompressedSpritePalette gSpritePalettes_0855D26C[] =
{
{gUnknown_08DC16F4, 4096},
{0}
};
const u8 gUnknown_0855D28C[] = {0x4, 0x8, 0x10, 0x20, 0x20};
const u8 gUnknown_0855D291[] = {0x8, 0x4, 0x2, 0x1, 0x1};
const struct BgTemplate gBgTemplates_0855D298[] =
{
{
.bg = 0,
.charBaseIndex = 0,
.mapBaseIndex = 12,
.screenSize = 0,
.paletteMode = 0,
.priority = 0,
.baseTile = 0
},
{
.bg = 1,
.charBaseIndex = 0,
.mapBaseIndex = 13,
.screenSize = 0,
.paletteMode = 0,
.priority = 1,
.baseTile = 0
},
{
.bg = 2,
.charBaseIndex = 2,
.mapBaseIndex = 14,
.screenSize = 0,
.paletteMode = 0,
.priority = 2,
.baseTile = 0
},
{
.bg = 3,
.charBaseIndex = 0,
.mapBaseIndex = 15,
.screenSize = 0,
.paletteMode = 0,
.priority = 3,
.baseTile = 0
}
};
const struct WindowTemplate sWindowTemplates_0855D2A8[] =
{
{2, 0, 0, 0x20, 0x20, 0, 1},
DUMMY_WIN_TEMPLATE
};

1014
src/pokemon_icon.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -5,9 +5,76 @@
#include "event_data.h"
#include "string_util.h"
#include "text.h"
#include "strings.h"
#include "window.h"
IWRAM_DATA u8 gUnknown_03000F78[0x188];
struct OptionAndDescription
{
const u8 *optionTxt;
const u8 *descriptionTxt;
};
// const rom data
const struct OptionAndDescription gUnknown_085716C0[] =
{
{gText_WithdrawPokemon, gText_WithdrawMonDescription},
{gText_DepositPokemon, gText_DepositMonDescription},
{gText_MovePokemon, gText_MoveMonDescription},
{gText_MoveItems, gText_MoveItemsDescription},
{gText_SeeYa, gText_SeeYaDescription}
};
const struct WindowTemplate gUnknown_085716E8 = {0, 1, 1, 0x11, 0xA, 0xF, 1};
static const union AnimCmd sSpriteAnim_85716F0[] =
{
ANIMCMD_FRAME(0, 5),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_85716F8[] =
{
ANIMCMD_FRAME(4, 5),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_8571700[] =
{
ANIMCMD_FRAME(6, 5),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_8571708[] =
{
ANIMCMD_FRAME(10, 5),
ANIMCMD_END
};
const union AnimCmd *const sSpriteAnimTable_8571710[] =
{
sSpriteAnim_85716F0,
sSpriteAnim_85716F8,
sSpriteAnim_8571700,
sSpriteAnim_8571708
};
static const union AffineAnimCmd sSpriteAffineAnim_8571720[] =
{
AFFINEANIMCMD_FRAME(0xE0, 0xE0, 0, 0),
AFFINEANIMCMD_END
};
static const union AffineAnimCmd *const sSpriteAffineAnimTable_8571730[] =
{
sSpriteAffineAnim_8571720
};
const struct TextColor gUnknown_08571734[] = {4, 0xF, 0xE};
const u8 gUnknown_08571737[] = _("/30");
// code
u8 CountMonsInBox(u8 boxId)
{
u16 i, count;

1164
src/rayquaza_scene.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -21,6 +21,7 @@
#include "m4a.h"
#include "field_effect.h"
#include "region_map.h"
#include "constants/region_map_sections.h"
#define MAP_WIDTH 28
#define MAP_HEIGHT 15
@@ -306,7 +307,7 @@ static const struct {
} gUnknown_085A1EDC[] = {
gUnknown_085A1ED4,
MAPSEC_EVER_GRANDE_CITY,
FLAG_SYS_POKEMON_LEAGUE_FLY
FLAG_LANDMARK_POKEMON_LEAGUE
};
static const struct BgTemplate gUnknown_085A1EE4[] = {
@@ -327,7 +328,7 @@ static const struct SpritePalette gUnknown_085A1F10 = {
};
static const u16 sUnknown_085A1F18[][2] = {
{FLAG_UNLOCK_BATTLE_FRONTIER, MAPSEC_BATTLE_FRONTIER},
{FLAG_LANDMARK_BATTLE_FRONTIER, MAPSEC_BATTLE_FRONTIER},
{-1, MAPSEC_NONE}
};
@@ -1126,9 +1127,9 @@ static u8 get_flagnr_blue_points(u16 mapSecId)
case MAPSEC_EVER_GRANDE_CITY:
return FlagGet(FLAG_VISITED_EVER_GRANDE_CITY) ? MAPSECTYPE_CITY_CANFLY : MAPSECTYPE_CITY_CANTFLY;
case MAPSEC_BATTLE_FRONTIER:
return FlagGet(FLAG_UNLOCK_BATTLE_FRONTIER) ? MAPSECTYPE_BATTLE_FRONTIER : MAPSECTYPE_NONE;
return FlagGet(FLAG_LANDMARK_BATTLE_FRONTIER) ? MAPSECTYPE_BATTLE_FRONTIER : MAPSECTYPE_NONE;
case MAPSEC_SOUTHERN_ISLAND:
return FlagGet(FLAG_UNLOCK_SOUTHERN_ISLAND) ? MAPSECTYPE_PLAIN : MAPSECTYPE_NONE;
return FlagGet(FLAG_LANDMARK_SOUTHERN_ISLAND) ? MAPSECTYPE_PLAIN : MAPSECTYPE_NONE;
default:
return MAPSECTYPE_PLAIN;
}
@@ -1916,7 +1917,7 @@ static void sub_8124E0C(void)
sub_8084CCC(gSaveBlock2Ptr->playerGender == MALE ? 0x0C : 0x0D);
break;
case MAPSEC_EVER_GRANDE_CITY:
sub_8084CCC(FlagGet(FLAG_SYS_POKEMON_LEAGUE_FLY) && gUnknown_0203A148->regionMap.posWithinMapSec == 0 ? 0x14 : 0x0B);
sub_8084CCC(FlagGet(FLAG_LANDMARK_POKEMON_LEAGUE) && gUnknown_0203A148->regionMap.posWithinMapSec == 0 ? 0x14 : 0x0B);
break;
default:
if (sUnknown_085A1E3C[gUnknown_0203A148->regionMap.mapSecId][2] != 0)

View File

@@ -6,6 +6,8 @@
#include "window.h"
#include "string_util.h"
#include "text.h"
#include "strings.h"
#include "bg.h"
// Menu actions
enum
@@ -25,15 +27,6 @@ enum
MENU_ACTION_PYRAMID_BAG
};
static void BuildStartMenuActions_LinkMode(void);
static void BuildStartMenuActions_UnionRoom(void);
static void BuildStartMenuActions_SafariZone(void);
static void BuildStartMenuActions_BattlePike(void);
static void BuildStartMenuActions_BattlePyramid(void);
static void BuildStartMenuActions_MultiBattleRoom(void);
static void BuildStartMenuActions_Normal(void);
u8 StartMenu_PlayerName(void);
extern bool32 is_c1_link_related_active(void);
extern bool32 InUnionRoom(void);
extern bool8 InBattlePike(void);
@@ -42,12 +35,91 @@ extern bool8 InMultiBattleRoom(void);
extern void sub_81973FC(u8 windowId, u8 a1);
extern void sub_8198070(u8 windowId, u8 a1);
// this file's functions
static void BuildStartMenuActions_LinkMode(void);
static void BuildStartMenuActions_UnionRoom(void);
static void BuildStartMenuActions_SafariZone(void);
static void BuildStartMenuActions_BattlePike(void);
static void BuildStartMenuActions_BattlePyramid(void);
static void BuildStartMenuActions_MultiBattleRoom(void);
static void BuildStartMenuActions_Normal(void);
bool8 StartMenu_Pokedex(void);
bool8 StartMenu_Pokemon(void);
bool8 StartMenu_Bag(void);
bool8 StartMenu_PokeNav(void);
bool8 StartMenu_PlayerName(void);
bool8 StartMenu_Save(void);
bool8 StartMenu_Option(void);
bool8 StartMenu_Exit(void);
bool8 StartMenu_SafariZoneRetire(void);
bool8 StartMenu_LinkModePlayerName(void);
bool8 StartMenu_BattlePyramidRetire(void);
bool8 StartMenu_BattlePyramidBag(void);
// EWRAM vars
EWRAM_DATA u8 sSafariBallsWindowId = 0;
EWRAM_DATA u8 sBattlePyramidFloorWindowId = 0;
EWRAM_DATA u8 sStartMenuCursorPos = 0;
EWRAM_DATA u8 sNumStartMenuActions = 0;
EWRAM_DATA u8 sCurrentStartMenuActions[9] = {0};
// const rom data
static const struct WindowTemplate gSafariBallsWindowTemplate = {0, 1, 1, 9, 4, 0xF, 8};
static const u8* const sPyramindFloorNames[] =
{
gText_Floor1,
gText_Floor2,
gText_Floor3,
gText_Floor4,
gText_Floor5,
gText_Floor6,
gText_Floor7,
gText_Peak
};
static const struct WindowTemplate gPyramidFloorWindowTemplate_2 = {0, 1, 1, 0xA, 4, 0xF, 8};
static const struct WindowTemplate gPyramidFloorWindowTemplate_1 = {0, 1, 1, 0xC, 4, 0xF, 8};
const struct MenuAction sStartMenuItems[] =
{
{gText_MenuPokedex, {.u8_void = StartMenu_Pokedex}},
{gText_MenuPokemon, {.u8_void = StartMenu_Pokemon}},
{gText_MenuBag, {.u8_void = StartMenu_Bag}},
{gText_MenuPokenav, {.u8_void = StartMenu_PokeNav}},
{gText_MenuPlayer, {.u8_void = StartMenu_PlayerName}},
{gText_MenuSave, {.u8_void = StartMenu_Save}},
{gText_MenuOption, {.u8_void = StartMenu_Option}},
{gText_MenuExit, {.u8_void = StartMenu_Exit}},
{gText_MenuRetire, {.u8_void = StartMenu_SafariZoneRetire}},
{gText_MenuPlayer, {.u8_void = StartMenu_LinkModePlayerName}},
{gText_MenuRest, {.u8_void = StartMenu_Save}},
{gText_MenuRetire, {.u8_void = StartMenu_BattlePyramidRetire}},
{gText_MenuBag, {.u8_void = StartMenu_BattlePyramidBag}}
};
const struct BgTemplate gUnknown_085105A8[] =
{
{
.bg = 0,
.charBaseIndex = 2,
.mapBaseIndex = 31,
.screenSize = 0,
.paletteMode = 0,
.priority = 0,
.baseTile = 0
}
};
const struct WindowTemplate gUnknown_085105AC[] =
{
{0, 2, 0xF, 0x1A, 4, 0xF, 0x194},
DUMMY_WIN_TEMPLATE
};
const struct WindowTemplate gUnknown_085105BC = {0, 1, 1, 0xE, 0xA, 0xF, 8};
// code
void BuildStartMenuActions(void)
{
sNumStartMenuActions = 0;
@@ -148,11 +220,6 @@ static void BuildStartMenuActions_MultiBattleRoom(void)
AddStartMenuAction(MENU_ACTION_EXIT);
}
extern const struct WindowTemplate gSafariBallsWindowTemplate;
extern const struct WindowTemplate gPyramidFloorWindowTemplate_1;
extern const struct WindowTemplate gPyramidFloorWindowTemplate_2;
extern const u8 gText_SafariBallStock[];
void DisplaySafariBallsWindow(void)
{
sSafariBallsWindowId = AddWindow(&gSafariBallsWindowTemplate);
@@ -164,9 +231,6 @@ void DisplaySafariBallsWindow(void)
CopyWindowToVram(sSafariBallsWindowId, 2);
}
extern const u8* const gUnknown_08510510[];
extern const u8 gText_BattlePyramidFloor[];
void DisplayPyramidFloorWindow(void)
{
// TODO: fix location
@@ -176,7 +240,7 @@ void DisplayPyramidFloorWindow(void)
sBattlePyramidFloorWindowId = AddWindow(&gPyramidFloorWindowTemplate_2);
PutWindowTilemap(sBattlePyramidFloorWindowId);
sub_81973FC(sBattlePyramidFloorWindowId, 0);
StringCopy(gStringVar1, gUnknown_08510510[gSaveBlock2Ptr->field_CAA[4]]);
StringCopy(gStringVar1, sPyramindFloorNames[gSaveBlock2Ptr->field_CAA[4]]);
StringExpandPlaceholders(gStringVar4, gText_BattlePyramidFloor);
PrintTextOnWindow(sBattlePyramidFloorWindowId, 1, gStringVar4, 0, 1, 0xFF, NULL);
CopyWindowToVram(sBattlePyramidFloorWindowId, 2);
@@ -197,8 +261,6 @@ void RemoveExtraStartMenuWindows(void)
}
}
extern const struct MenuAction sStartMenuItems[];
/*
// Prints n menu items starting at *index
static bool32 PrintStartMenuItemsMultistep(s16 *index, u32 n)

View File

@@ -1,5 +1,3 @@
// Includes
#include "global.h"
#include "rtc.h"
#include "overworld.h"
@@ -34,6 +32,7 @@
#include "naming_screen.h"
#include "malloc.h"
#include "region_map.h"
#include "constants/region_map_sections.h"
#include "decoration.h"
#include "secret_base.h"
#include "tv.h"
@@ -6504,7 +6503,7 @@ void DoTVShowTodaysRivalTrainer(void)
break;
case 1:
TV_PrintIntToStringVar(0, show->rivalTrainer.badgeCount);
if (FlagGet(CODE_FLAGS + 0x48))
if (FlagGet(FLAG_LANDMARK_BATTLE_FRONTIER))
{
if (show->rivalTrainer.nSilverSymbols || show->rivalTrainer.nGoldSymbols)
{
@@ -6521,7 +6520,7 @@ void DoTVShowTodaysRivalTrainer(void)
}
break;
case 2:
if (FlagGet(CODE_FLAGS + 0x48))
if (FlagGet(FLAG_LANDMARK_BATTLE_FRONTIER))
{
if (show->rivalTrainer.nSilverSymbols || show->rivalTrainer.nGoldSymbols)
{