Merge pull request #371 from Kermalis/clean-stuff
Some checks failed
GithubCI / build (push) Has been cancelled

Match RockSmashMoveAction + cleans
This commit is contained in:
AnonymousRandomPerson 2025-03-18 19:31:52 -04:00 committed by GitHub
commit 293a2a5307
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
123 changed files with 1413 additions and 1422 deletions

View File

@ -511,7 +511,7 @@ _080988F8:
ldr r0, _08098978
ldr r0, [r0]
bl IncrementPlayTime
bl sub_800CB20
bl WaitForNextFrameAndAdvanceRNG
bl LoadBufferedInputs
bl nullsub_120
bl sub_80A5E70

View File

@ -1,9 +1,8 @@
#ifndef GUARD_CODE_800558C_H
#define GUARD_CODE_800558C_H
#include "structs/rgb.h"
#include "structs/axdata.h"
#include "file_system.h"
#include "structs/rgb.h"
typedef struct Palette256
{
@ -23,6 +22,10 @@ struct EfoFileData
/* 0x1C */ s32 tileCount;
};
extern bool8 gUnknown_2026E38;
extern u32 *gUnknown_2026E3C;
extern s16 gUnknown_2026E4E;
extern s16 *gUnknown_203B078;
void nullsub_7(s16 *);

View File

@ -1,11 +1,11 @@
#ifndef GUARD_CODE_800D090_H
#define GUARD_CODE_800D090_H
#ifndef GUARD_CODE_800C9CC_H
#define GUARD_CODE_800C9CC_H
#include "input.h"
void ReadKeyInput(Inputs *);
void xxx_call_update_bg_sound_input(void);
void sub_800CB20(void);
void WaitForNextFrameAndAdvanceRNG(void);
#endif // GUARD_CODE_800D090_H
#endif // GUARD_CODE_800C9CC_H

View File

@ -3,4 +3,4 @@
void sprintfStatic(char *buffer, const char *text, ...);
#endif
#endif // GUARD_CODE_800D090_H

7
include/code_800ED38.h Normal file
View File

@ -0,0 +1,7 @@
#ifndef GUARD_CODE_800ED38_H
#define GUARD_CODE_800ED38_H
void sub_800EE5C(s32 r0);
void sub_800EF64(void);
#endif // GUARD_CODE_800ED38_H

View File

@ -4,5 +4,6 @@
#include "structs/str_position.h"
void AddPokemonDungeonSprite(s32 id, s16 species, DungeonPos *pos, u32 priority);
void UpdateDungeonPokemonSprite(s32 id, s32 species, s32 status, u32 visible);
#endif // GUARD_CODE_800F958_H

View File

@ -2,20 +2,25 @@
#define GUARD_CODE_80118A4_H
void FadeOutAllMusic(u16);
void PlayAcceptSoundEffect(void);
void PlayCancelSoundEffect(void);
void PlayCursorUpDownSoundEffect(void);
void PlayMenuSoundEffect(u32);
void PlaySound(u16);
void StopAllMusic_1(void);
void sub_8011760(void);
void sub_80117AC(void);
void sub_801180C(void);
void sub_8011830(void);
void sub_8011860(void);
void xxx_call_fade_in_new_bgm(u16 songIndex, u16 speed);
void xxx_call_fade_out_bgm(u16 speed);
void xxx_call_start_bg_music(void);
void xxx_call_stop_bgm(void);
void xxx_call_stop_fanfare_se(u16 songIndex);
void StopAllMusic_1(void);
void xxx_call_start_new_bgm(u16 songIndex);
void xxx_call_fade_out_fanfare_se(u16 songIndex, u16 speed);
void xxx_call_queue_bgm(u16 songIndex);
void xxx_call_play_fanfare_se(u16 songIndex, u16 volume);
void xxx_call_fade_out_fanfare_se(u16 songIndex, u16 speed);
void xxx_call_start_bg_music(void);
void xxx_call_start_new_bgm(u16 songIndex);
void xxx_call_stop_bgm(void);
void xxx_call_stop_fanfare_se(u16 songIndex);
#endif // GUARD_CODE_80118A4_H

13
include/code_803D110.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef GUARD_CODE_803D110_H
#define GUARD_CODE_803D110_H
void nullsub_56(void);
void ShowDungeonNameBanner_Async(void);
void sub_803DF60(void);
void sub_803E02C(void);
void sub_803E13C(void);
void sub_803E178(void);
void sub_803E214(void);
void sub_803E250(void);
#endif // GUARD_CODE_803D110_H

View File

@ -1,6 +1,8 @@
#ifndef GUARD_CODE_803E46C_H
#define GUARD_CODE_803E46C_H
extern u8 gUnknown_203B40D;
void DungeonRunFrameActions(u32);
#endif
#endif // GUARD_CODE_803E46C_H

View File

@ -3,6 +3,7 @@
#include "structs/str_position.h"
void sub_803EAF0(u32 kind, u8 *name);
bool8 sub_803F428(DungeonPos *pos);
#endif // GUARD_CODE_803E724_H

View File

@ -4,6 +4,7 @@
#include "structs/dungeon_entity.h"
#include "structs/str_damage.h"
u32 EntityGetStatusSprites(Entity *entity);
void sub_80420E8(Entity *pokemon, DamageStruct *dmgStruct);
void sub_80421C0(Entity *pokemon, u16);

View File

@ -1,6 +1,7 @@
#ifndef GUARD_CODE_8042B34_H
#define GUARD_CODE_8042B34_H
bool8 sub_8043CE4(s32 dungeonId);
void sub_8043D50(s32 *a0, s32 *a1);
#endif // GUARD_CODE_8042B34_H
#endif // GUARD_CODE_8042B34_H

View File

@ -11,4 +11,7 @@ typedef struct unkStruct_202EE44
extern unkStruct_202EE44 gDungeonSubMenu[10];
void AddActionToDungeonSubMenu(u16 actionId, u8 param_2);
void SetActionUnusableInDungeonSubMenu(u16 actionId);
#endif // GUARD_CODE_8044CC8_H

View File

@ -5,7 +5,6 @@
void CloseAllSpriteFiles(void);
void OpenDungeonPaletteFile(void);
void CloseDungeonPaletteFile(void);
void LoadDungeonPokemonSprites(void);
void LoadDungeonActivePokemonSprites(void);

6
include/code_8066D04.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef GUARD_CODE_8066D04_H
#define GUARD_CODE_8066D04_H
void HandleSetItemAction(Entity *, bool8);
#endif // GUARD_CODE_8066D04_H

6
include/code_8069E0C.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef GUARD_CODE_8069E0C_H
#define GUARD_CODE_8069E0C_H
void sub_806C51C(Entity *entity);
#endif // GUARD_CODE_8069E0C_H

6
include/code_807E5AC.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef GUARD_CODE_807E5AC_H
#define GUARD_CODE_807E5AC_H
void sub_807FA9C(void);
#endif // GUARD_CODE_807E5AC_H

View File

@ -1,6 +1,8 @@
#ifndef GUARD_CPU_H
#define GUARD_CPU_H
extern u16 gRawKeyInput;
void CpuClear(void *, s32);
void CpuCopy(void *dest, const void *src, s32 size);
void nullsub_23(bool8);

View File

@ -1,8 +1,6 @@
#ifndef GUARD_DEBUG_H
#define GUARD_DEBUG_H
#include "gba/gba.h"
// size: 0xC
typedef struct DebugLocation
{

View File

@ -0,0 +1,24 @@
#ifndef GUARD_DEF_FILEARCHIVES_H
#define GUARD_DEF_FILEARCHIVES_H
#include "structs/str_file_system.h"
// dungeon_sbin.s
extern const FileArchive gDungeonFileArchive;
// effect_sbin.s
extern const FileArchive gEffectFileArchive;
// monster_sbin.c
extern const FileArchive gMonsterFileArchive;
// ornament_sbin.s
extern const FileArchive gOrnamentFileArchive;
// system_sbin.s
extern const FileArchive gSystemFileArchive;
// titlemenu_sbin.s
extern const FileArchive gTitleMenuFileArchive;
#endif // GUARD_DEF_FILEARCHIVES_H

View File

@ -46,6 +46,8 @@ s16 GetRandomMovementChance(u8 dungeon);
void PrintYellowDungeonNametoBuffer(u8 *buffer, DungeonLocation *dungeonLocation);
void PrintDungeonLocationtoBuffer(u8 *buffer, DungeonLocation *dungeonLocation);
void sub_80901D8(DungeonLocation *param_1, DungeonLocation *param_2);
u32 sub_809034C(u8 dungeonIndex, s32 speciesId_, u8 *buffer, bool32 param_4_, bool32 param_5_);
u32 sub_80908D8(DungeonLocation *dungeon);
u8 sub_8090910(DungeonLocation *dungeon, u32 param_2);
bool8 IsNotValidDungeon(u8 dungeon);

View File

@ -31,4 +31,4 @@ bool8 PlayerHasItemWithFlag(s32 itemFlag);
void CleanUpInventoryItems(void);
void ClearUnpaidFlagFromAllItems(void);
#endif
#endif // GUARD_DUNGEON_ITEMS_H

View File

@ -17,6 +17,6 @@ void sub_805EFB4(Entity *a0, bool8 a1);
void sub_805F02C(void);
ActionContainer *GetLeaderActionContainer(void);
u16 GetLeaderActionId(void);
bool8 DungeonGiveNameToRecruitedMon(u8 *a0);
bool8 DungeonGiveNameToRecruitedMon(u8 *name);
#endif
#endif // GUARD_DUNGEON_MAIN_H

View File

@ -36,14 +36,14 @@ void sub_8068BDC(bool8 a0);
void sub_8068F28(void);
void sub_8068F80(void);
void sub_8068FE0(Entity *entity, s32 param_2, Entity *param_3);
void sub_80694C0(Entity *target,s32 x,int y,char param_4);
void sub_80694C0(Entity *target,s32 x,s32 y,u8 param_4);
void sub_80695EC(Entity *param_1,int x,int y);
Entity * sub_8069660(Entity *target);
Entity * sub_80696A8(Entity *target);
Entity * sub_80696FC(Entity *target);
Entity * sub_806977C(Entity *target);
void sub_8069844(struct unkStruct_808FF20 *param_1, Entity *target);
u32 sub_8069D18(DungeonPos *pos,Entity *entity);
bool8 sub_8069D18(DungeonPos *pos,Entity *entity);
void sub_8069D4C(struct unkStruct_8069D4C *r0, Entity *target);
void TargetTileInFront(Entity *pokemon);
void sub_8069E0C(Entity *pokemon);
@ -70,10 +70,11 @@ void sub_806A898(Entity *entity, bool8 r7, bool8 showRunAwayEffect);
void sub_806A914(bool8 a0, bool8 a1, bool8 showRunAwayEffect);
void sub_806A974(void);
void sub_806A9B4(Entity *entity, s32 moveIndex);
bool8 sub_806AA0C(s16 _species, bool32 _a1);
// s16 memes
//bool8 sub_806AA0C(s16 _species, bool32 _a1);
void sub_806AA70(void);
void sub_806AB2C(void);
void EndAbilityImmuneStatus(Entity *attacker, Entity *target);
void MarkLastUsedMonMove(Entity *entity, Move *move);
#endif
#endif // GUARD_DUNGEON_MISC_H

View File

@ -4,6 +4,9 @@
#include "structs/str_pokemon.h"
#include "structs/str_moves.h"
extern s32 gUnknown_202F208;
extern s32 gUnknown_202F224;
bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, bool32 isLinkedMove, struct Move *move);
#endif
#endif // GUARD_DUNGEON_MOVE_H

View File

@ -1,16 +1,21 @@
#ifndef GUARD_DUNGEON_MUSIC_H
#define GUARD_DUNGEON_MUSIC_H
void PlaySoundEffect(u32 songIndex);
void StopSoundEffect(u32 songIndex);
bool8 IsFanfareSEPlaying_2(u16 songIndex);
void DungeonStartNewBGM(u16 songIndex);
u16 DungeonGetCurrentBGSong(void);
void DungeonFadeInNewBGM(u16 songIndex, u32 fadeInSpeed);
void DungeonFadeOutBGM(u16 speed);
void DungeonStartNewBGM(u16 songIndex);
void DungeonStopBGM(void);
u16 DungeonGetCurrentBGSong(void);
bool8 IsFanfareSEPlaying_2(u16 songIndex);
void PlayDungeonCursorSE(bool8 checkMenuEntriesCount);
void PlayDungeonStartButtonSE(void);
void PlaySoundEffect(u32 songIndex);
void StopDungeonBGM(void);
void StopSoundEffect(u32 songIndex);
void sub_8083AB0(s16 param_0, Entity *target, Entity *entity);
bool8 sub_8083C24(void);
bool8 sub_8083C50(void);
bool8 sub_8083C88(u8);
void UpdateDungeonMusic(void);
#endif
#endif // GUARD_DUNGEON_MUSIC_H

View File

@ -1,34 +1,7 @@
#ifndef GUARD_FILE_SYSTEM_H
#define GUARD_FILE_SYSTEM_H
// size: 0x8
typedef struct File
{
/* 0x0 */ char *name;
/* 0x4 */ const void *data;
} File;
// size: 0x8
typedef struct OpenedFile
{
/* 0x0 */ const File *file;
/* 0x4 */ const void *data;
} OpenedFile;
// size: 0x10
typedef struct FileArchive
{
/* 0x0 */ char magic[8];
/* 0x8 */ s32 count;
/* 0xC */ const File *entries;
} FileArchive;
// size: 0x8
typedef struct UnkFileStruct
{
/* 0x0 */ u32 unk0;
/* 0x4 */ u32 unk4;
} UnkFileStruct;
#include "structs/str_file_system.h"
OpenedFile *Call_OpenFileAndGetFileDataPtr(const u8 *filename, const FileArchive *arc);
void CloseFile(OpenedFile *openedFile);
@ -39,6 +12,4 @@ OpenedFile *OpenFileAndGetFileDataPtr(const u8 *filename, const FileArchive *arc
u32 sub_800A8F8(u32 value);
extern const FileArchive gMonsterFileArchive; // monster_sbin.c
#endif //GUARD_FILE_SYSTEM_H

View File

@ -1,12 +1,10 @@
#ifndef GUARD_FRIEND_AREAS_MAP_H
#define GUARD_FRIEND_AREAS_MAP_H
#include "file_system.h"
#include "code_8004AA0.h"
#include "menu_input.h"
#include "structs/axdata.h"
#include "structs/str_position.h"
#include "constants/direction.h"
#include "structs/menu.h"
#include "structs/axdata.h"
#include "code_8004AA0.h"
#define MAX_AREAS_PER_LOCATION 8
@ -104,18 +102,8 @@ struct struct_unk800F990
u8 unkC;
};
void ShowFriendAreasMap(struct struct_unk800F990 *param_1);
void ShowFriendAreasMap_Async(struct struct_unk800F990 *param_1);
void PrintFriendAreaNameInMap(u8 *strBuffer, u8 index);
bool8 IsFriendAreaShownOnMap(u8 friendAreaId);
void FriendAreasMap_UpdateMonSpritePosition(void);
void FriendAreasMap_UpdateBg(void);
void FriendAreasMap_HideTextWindowAndArrows(void);
void FriendAreasMap_RunFrameActions(void);
void FriendAreasMap_ShowDirectionArrows(void);
void FriendAreasMap_PrintCurrAreaName(void);
void FriendAreasMap_PrintAvailableSubAreas(void);
void FriendAreasMap_CloseFiles(void);
void FriendAreasMap_InitGfx(void);
#endif
#endif // GUARD_FRIEND_AREAS_MAP_H

View File

@ -0,0 +1,14 @@
#ifndef GUARD_FRIEND_AREAS_MAP_UTIL_H
#define GUARD_FRIEND_AREAS_MAP_UTIL_H
void FriendAreasMap_CloseFiles(void);
void FriendAreasMap_HideTextWindowAndArrows(void);
void FriendAreasMap_InitGfx(void);
void FriendAreasMap_PrintAvailableSubAreas(void);
void FriendAreasMap_PrintCurrAreaName(void);
void FriendAreasMap_RunFrameActions(void);
void FriendAreasMap_ShowDirectionArrows(void);
void FriendAreasMap_UpdateBg(void);
void FriendAreasMap_UpdateMonSpritePosition(void);
#endif // GUARD_FRIEND_AREAS_MAP_UTIL_H

View File

@ -1,6 +1,9 @@
#ifndef GUARD_GLOBAL_H
#define GUARD_GLOBAL_H
#include <stdarg.h>
#include <stdio.h>
#include <stddef.h>
#include <string.h>
#include "config.h" // We need to define config before gba headers as print stuff needs the functions nulled before defines.
#include "gba/gba.h"

View File

@ -81,8 +81,10 @@ s32 SaveTeamInventory(u8 *, u32 size);
s32 GetItemPossessionCount(u8 id);
s32 WriteHighDecimal(s32, u8 *strbuf, u8);
u32 sub_80913E0(Item* slot, u32 a2, STATUSTEXTS(statuses));
u8 sub_8091E94(s32 a0, s32 a1, s32 a2);
static inline void ZeroOutItem(Item *item)
{

View File

@ -2,8 +2,11 @@
#define GUARD_MATH_H
#include "gba/types.h"
#include "structs/str_position.h"
#include "number_util.h"
s32 Atan2_4096(PixelPos *a);
/**
* This function computes the cosine of of `x` using a lookup table. The period of
* the function is `4096`, and the range is `[-256, 256]`.

View File

@ -5,7 +5,6 @@ typedef void (*IntrCallback)(void);
extern IntrCallback gIntrCallbacks[6];
void AckInterrupt(u16);
bool8 EnableInterrupts(void);
bool8 DisableInterrupts(void);

View File

@ -8,5 +8,6 @@ bool8 HasNegativeStatus(Entity *pokemon);
bool8 IsSleeping(Entity *pokemon);
bool8 HasLowHealth(Entity *pokemon);
s32 sub_8070828(Entity *pokemon, bool8 displayMessage);
void sub_80709C8(u8 *buffer, EntityInfo *entityInfo);
#endif
#endif // GUARD_STATUS_CHECKS_1_H

View File

@ -1,7 +1,7 @@
#ifndef GUARD_AXDATA_H
#define GUARD_AXDATA_H
#include "file_system.h"
#include "structs/str_file_system.h"
#include "structs/str_position.h"
// size: 0x8
@ -83,7 +83,7 @@ typedef struct axmain
struct axObject
{
/* 0x0 */ axdata axdata;
/* 0x3C */ OpenedFile *spriteFile; // This might be a unkStruct_202EE8C instead and unkStruct_202EE8C.unk0 might be a OpenedFile* etc. See sub_8010F28
/* 0x3C */ OpenedFile *spriteFile; // This might be a unkStruct_202EE8C instead and unkStruct_202EE8C.unk0 might be a OpenedFile* etc. See friend_areas_map_util.AnimateSprites()
s16 unk40_maybeAnimTimer;
u8 unk42_animId1;
u8 unk43_animId2;

View File

@ -1,6 +1,7 @@
#ifndef GUARD_STR_202ED28_H
#define GUARD_STR_202ED28_H
#include "structs/sprite_oam.h"
#include "structs/str_position.h"
struct unkStruct_202ED28

View File

@ -24,13 +24,13 @@ typedef struct UnkStruct_RunDungeon
PokemonStruct1 unk1C;
u8 *unk74;
Dungeon *unk78;
s16 unk7C;
s16 unk7C; // Set to 5 if the dungeon was skipped (quicksave read failed)
u8 unk7E;
DungeonLocation unk80;
WonderMailSub unk84;
} UnkStruct_RunDungeon;
// TODO: This func should not be in a structs include file
void RunDungeon(UnkStruct_RunDungeon *r8);
void RunDungeon_Async(UnkStruct_RunDungeon *r8);
#endif // GUARD_STR_DUNGEON_8042F6C_H
#endif // GUARD_STR_DUNGEON_8042F6C_H

View File

@ -0,0 +1,26 @@
#ifndef GUARD_STR_FILE_SYSTEM_H
#define GUARD_STR_FILE_SYSTEM_H
// size: 0x8
typedef struct File
{
/* 0x0 */ char *name;
/* 0x4 */ const void *data;
} File;
// size: 0x10
typedef struct FileArchive
{
/* 0x0 */ char magic[8];
/* 0x8 */ s32 count;
/* 0xC */ const File *entries;
} FileArchive;
// size: 0x8
typedef struct OpenedFile
{
/* 0x0 */ const File *file;
/* 0x4 */ const void *data;
} OpenedFile;
#endif // GUARD_STR_FILE_SYSTEM_H

View File

@ -4,28 +4,28 @@
// size: 0x48
typedef struct Window
{
s16 x;
s16 y;
s16 width;
s16 height;
s16 unk8;
s32 type;
u32 unk10;
u32 unk14;
u32 *unk18;
u32 *unk1C;
s32 unk20;
s32 unk24;
u32 *unk28; // Somewhere in VRAM
s32 unk2C;
u32 *unk30; // Somewhere in VRAM?
u32 *unk34;
s32 unk38;
u32 *unk3C;
u32 *unk40;
u8 unk44;
bool8 unk45;
u8 unk46;
/* 0x0 */ s16 x;
/* 0x2 */ s16 y;
/* 0x4 */ s16 width;
/* 0x6 */ s16 height;
/* 0x8 */ s16 unk8;
/* 0xC */ s32 type;
/* 0x10 */ u32 unk10;
/* 0x14 */ u32 unk14;
/* 0x18 */ u32 *unk18;
/* 0x1C */ u32 *unk1C;
/* 0x20 */ s32 unk20;
/* 0x24 */ s32 unk24;
/* 0x28 */ u32 *unk28; // Somewhere in VRAM
/* 0x2C */ s32 unk2C;
/* 0x30 */ u32 *unk30; // Somewhere in VRAM?
/* 0x34 */ u32 *unk34;
/* 0x38 */ s32 unk38;
/* 0x3C */ u32 *unk3C;
/* 0x40 */ u32 *unk40;
/* 0x44 */ u8 unk44;
/* 0x45 */ bool8 unk45;
/* 0x46 */ u8 unk46;
} Window;
// size: 0x4

View File

@ -9,8 +9,9 @@
extern const u8 gDungeonWaterType[76];
bool8 sub_804AD34(DungeonPos *pos);
void sub_804AE84(DungeonPos *pos);
bool8 IsTileGround(Tile *tile);
bool8 IsWaterTileset();
#endif // GUARD_TILE_TYPES_H
#endif // GUARD_TILE_TYPES_H

View File

@ -52,6 +52,6 @@ struct UnkStruct_sub_8010268
u8 unkB4;
};
void ShowWorldMap(struct UnkStruct_sub_8010268 *r5);
void ShowWorldMap_Async(struct UnkStruct_sub_8010268 *r5);
#endif

View File

@ -21,6 +21,7 @@ void InitBGPaletteBuffer(void)
}
}
// arm9.bin::020011A0
void SetBGPaletteBufferColorRGB(s32 index, const RGB *color, s32 brightnessRaw, const RGB *ramp)
{
s32 brightness = brightnessRaw;
@ -44,30 +45,37 @@ void SetBGPaletteBufferColorRGB(s32 index, const RGB *color, s32 brightnessRaw,
ramp[color->b].b * brightness / 256 & 0x1F);
}
// arm9.bin::02001130
void SetBGPaletteBufferColorArray(s32 index, const RGB *color32)
{
sBGPaletteRowDirty[index / BG_PALETTE_ROW_SIZE] = TRUE;
sBGPaletteBuffer[index] = RGB2(color32->r >> 3, color32->g >> 3, color32->b >> 3);
}
// arm9.bin::020010EC
void SetBGPaletteBufferColor(s32 index, u16 *color)
{
sBGPaletteRowDirty[index / BG_PALETTE_ROW_SIZE] = TRUE;
sBGPaletteBuffer[index] = *color;
}
// arm9.bin::02000FC8
void nullsub_4(s32 index, const RGB *colorArray, s32 brightness, const RGB *ramp)
{
}
// arm9.bin::02000F58
void nullsub_5(s32 index, const RGB *colorArray)
{
}
#if (GAME_VERSION == VERSION_RED)
UNUSED static void nullsub_143(void)
{
}
#endif
// arm9.bin::02000E9C
void TransferBGPaletteBuffer(void)
{
u32 i;
@ -89,4 +97,6 @@ void TransferBGPaletteBuffer(void)
paletteBufferIndex += BG_PALETTE_ROW_SIZE;
}
while (paletteBufferIndex < BG_PALETTE_BUFFER_SIZE);
// NDS version has a second loop for the 2nd screen (0x5000400 dest instead)
}

View File

@ -6,19 +6,19 @@
#include "math.h"
#include "sprite.h"
EWRAM_DATA u8 gUnknown_2026E38 = 0;
EWRAM_DATA u32 *gUnknown_2026E3C = 0;
EWRAM_DATA s32 gUnknown_2026E40 = 0;
EWRAM_DATA s32 gUnknown_2026E44 = 0;
EWRAM_DATA s32 gUnknown_2026E48 = 0;
EWRAM_DATA bool8 gUnknown_2026E4C = 0;
EWRAM_DATA u16 gUnknown_2026E4E = 0;
EWRAM_DATA bool32 gUnknown_2026E50 = 0;
EWRAM_DATA bool32 gUnknown_2026E54 = 0;
EWRAM_DATA u32 *gUnknown_2026E58 = NULL;
UNUSED EWRAM_DATA static u32 sUnused0 = 0;
EWRAM_DATA static s16 gUnknown_2026E60[324] = {0};
EWRAM_DATA static s16 gUnknown_20270E8[324] = {0};
EWRAM_DATA bool8 gUnknown_2026E38 = FALSE;
EWRAM_DATA u32 *gUnknown_2026E3C = NULL;
static EWRAM_DATA s32 sUnknown_2026E40 = 0; // Read from but never written to
static EWRAM_DATA s32 sUnknown_2026E44 = 0; // Read from but never written to
static EWRAM_DATA s32 sUnknown_2026E48 = 0; // Read from but never written to
static EWRAM_DATA bool8 sUnknown_2026E4C = FALSE;
EWRAM_DATA s16 gUnknown_2026E4E = 0;
static EWRAM_DATA bool32 sUnknown_2026E50 = FALSE;
static EWRAM_DATA bool32 sUnknown_2026E54 = FALSE;
static EWRAM_DATA u32 *sUnknown_2026E58 = NULL;
UNUSED static EWRAM_DATA u32 sUnused0 = 0;
static EWRAM_DATA s16 sUnknown_2026E60[324] = {0}; // These might be [2][162]
static EWRAM_DATA s16 sUnknown_20270E8[324] = {0};
EWRAM_INIT s16 *gUnknown_203B078 = NULL;
@ -198,12 +198,12 @@ UNUSED static void nullsub_151(void)
void sub_80057E8(void)
{
gUnknown_2026E4C = TRUE;
gUnknown_2026E54 = FALSE;
gUnknown_2026E50 = 1;
gUnknown_2026E58 = NULL;
sUnknown_2026E4C = TRUE;
sUnknown_2026E54 = FALSE;
sUnknown_2026E50 = TRUE;
sUnknown_2026E58 = NULL;
gUnknown_2026E3C = NULL;
gUnknown_2026E38 = 0;
gUnknown_2026E38 = FALSE;
gUnknown_2026E4E = 0x60C;
gUnknown_203B078 = NULL;
}
@ -214,16 +214,16 @@ void sub_8005838(s32 *a0, u8 kind)
s16 *r3;
s32 i;
if (!gUnknown_2026E4C)
if (!sUnknown_2026E4C)
kind = 0;
r3 = !gUnknown_2026E54 ? gUnknown_2026E60 : gUnknown_20270E8;
r3 = !sUnknown_2026E54 ? sUnknown_2026E60 : sUnknown_20270E8;
r2 = gUnknown_203B078;
if (r2 == NULL)
r2 = (void *) &gUnknown_80B83EA;
gUnknown_2026E58 = (void *) r3;
sUnknown_2026E58 = (void *) r3;
switch (kind) {
case 0:
@ -504,9 +504,9 @@ void sub_8005838(s32 *a0, u8 kind)
s32 j, k;
val1 = gUnknown_2026E40;
val2 = gUnknown_2026E44;
val3 = gUnknown_2026E48;
val1 = sUnknown_2026E40;
val2 = sUnknown_2026E44;
val3 = sUnknown_2026E48;
spC = 0x400 / (val3 / 256 + 1);
iVar11 = val2 / 256;
@ -545,10 +545,10 @@ void sub_8005838(s32 *a0, u8 kind)
if (j >= 160)
continue;
if (gUnknown_2026E54 == 0)
gUnknown_2026E60[j * 2 + 1] = uVar7;
if (!sUnknown_2026E54)
sUnknown_2026E60[j * 2 + 1] = uVar7;
else
gUnknown_20270E8[j * 2 + 1] = uVar7;
sUnknown_20270E8[j * 2 + 1] = uVar7;
}
for (; k > r8; k--) {
@ -557,10 +557,10 @@ void sub_8005838(s32 *a0, u8 kind)
if (k >= 160)
continue;
if (gUnknown_2026E54 == 0)
gUnknown_2026E60[k * 2 + 1] = uVar7;
if (!sUnknown_2026E54)
sUnknown_2026E60[k * 2 + 1] = uVar7;
else
gUnknown_20270E8[k * 2 + 1] = uVar7;
sUnknown_20270E8[k * 2 + 1] = uVar7;
}
}
}
@ -571,17 +571,17 @@ void sub_8005838(s32 *a0, u8 kind)
UNUSED static void sub_80060A8(void)
{
gUnknown_2026E3C = gUnknown_2026E58;
gUnknown_2026E54 = !gUnknown_2026E54;
gUnknown_2026E50 = !gUnknown_2026E50;
gUnknown_2026E3C = sUnknown_2026E58;
sUnknown_2026E54 = !sUnknown_2026E54;
sUnknown_2026E50 = !sUnknown_2026E50;
gUnknown_2026E38 = FALSE;
}
void sub_80060EC(void)
{
gUnknown_2026E3C = gUnknown_2026E58;
gUnknown_2026E54 = !gUnknown_2026E54;
gUnknown_2026E50 = !gUnknown_2026E50;
gUnknown_2026E3C = sUnknown_2026E58;
sUnknown_2026E54 = !sUnknown_2026E54;
sUnknown_2026E50 = !sUnknown_2026E50;
SetBldAlphaReg((gUnknown_2026E4E & 0x1F00) >> 8, gUnknown_2026E4E & 0x1F);
gUnknown_2026E38 = TRUE;
}

View File

@ -1,19 +1,12 @@
#include "global.h"
#include "globaldata.h"
#include "bg_palette_buffer.h"
#include "code_800558C.h"
#include "code_8009804.h"
#include "cpu.h"
#include "def_filearchives.h"
#include "file_system.h"
#include "text.h"
#include "code_800558C.h"
extern const struct FileArchive gSystemFileArchive; // 8300500
EWRAM_DATA RGB gFontPalette[128] = {0};
EWRAM_DATA static u8 gUnknown_202D238[4] = {0};
EWRAM_DATA static s32 gUnknown_202D23C = 0;
EWRAM_DATA static struct unkStruct_202D240 gUnknown_202D240[8] = {0};
EWRAM_DATA u32 gUnknown_202D2A0 = 0;
struct FontData
{
@ -21,11 +14,17 @@ struct FontData
u8 dataArray[0];
};
// Only written to.
EWRAM_INIT static bool8 gUnknown_203B090 = FALSE;
EWRAM_DATA RGB gFontPalette[128] = {0};
static EWRAM_DATA u8 sUnknown_202D238[4] = {0};
static EWRAM_DATA s32 sUnknown_202D23C = 0;
static EWRAM_DATA struct unkStruct_202D240 sUnknown_202D240[8] = {0};
/*static [.s file not finished yet]*/ EWRAM_DATA u32 gUnknown_202D2A0 = 0;
#define OAM_DUMMY 0xA000A0 // y set to 160 - DISPLAY_HEIGHT
static EWRAM_INIT bool8 sUnknown_203B090 = FALSE; // Only written to.
#define OAM_DUMMY 0xA000A0 // y set to 160 (DISPLAY_HEIGHT)
// arm9.bin::0200A178
void InitGraphics(void)
{
s32 i;
@ -39,7 +38,7 @@ void InitGraphics(void)
register const FileArchive *sysFileArchieve asm("r4");
#endif // NONMATCHING
gUnknown_203B090 = TRUE;
sUnknown_203B090 = TRUE;
dest = (u32 *)VRAM;
for (i = 0; i < VRAM_SIZE / sizeof(*dest); i++) {
*dest++ = 0;
@ -68,6 +67,8 @@ void InitGraphics(void)
CpuCopy((u32 *)(VRAM + 0x17e00), font->dataArray, i * 32);
CloseFile(file);
// TODO: Lots missing here from NDS.
InitFontPalette();
file = OpenFileAndGetFileDataPtr("fontsppa", sysFileArchieve);
rgbColors = (RGB *)file->data;
@ -79,6 +80,7 @@ void InitGraphics(void)
TransferBGPaletteBuffer();
}
// arm9.bin::0200A100
void InitFontPalette(void)
{
OpenedFile *fontpalFile;
@ -99,6 +101,7 @@ void InitFontPalette(void)
CloseFile(fontpalFile);
}
// arm9.bin::0200A00C
void vram_related_8009804(void)
{
u32 i;
@ -133,52 +136,60 @@ void vram_related_8009804(void)
*dest++ = OAM_DUMMY;
}
// Extra func in NDS here:
// arm9.bin::02009FC4
// arm9.bin::02009F70
void sub_80098A0(void)
{
gUnknown_202D23C = 0;
gUnknown_202D238[0] = 0;
gUnknown_202D238[1] = 0;
gUnknown_202D238[2] = 0;
gUnknown_202D238[3] = 0;
sUnknown_202D23C = 0;
sUnknown_202D238[0] = 0;
sUnknown_202D238[1] = 0;
sUnknown_202D238[2] = 0;
sUnknown_202D238[3] = 0;
}
// arm9.bin::02009F18
void sub_80098BC(u32 *r0, const u32 *r1, u32 r2)
{
if (gUnknown_202D23C < 8) {
gUnknown_202D240[gUnknown_202D23C].unk0 = r0;
gUnknown_202D240[gUnknown_202D23C].unk4 = r1;
gUnknown_202D240[gUnknown_202D23C].size = r2;
gUnknown_202D23C++;
if (sUnknown_202D23C < 8) {
sUnknown_202D240[sUnknown_202D23C].unk0 = r0;
sUnknown_202D240[sUnknown_202D23C].unk4 = r1;
sUnknown_202D240[sUnknown_202D23C].size = r2;
sUnknown_202D23C++;
}
}
// The below func has a sibling in the NDS version.
// arm9.bin::02009F04 and arm9.bin::02009EF0
void sub_80098F8(u32 r0)
{
gUnknown_202D238[r0] = 1;
sUnknown_202D238[r0] = 1;
}
void sub_8009908(void)
{
s32 i;
for (i = 0; i < gUnknown_202D23C; i++)
CpuCopy(gUnknown_202D240[i].unk0, gUnknown_202D240[i].unk4, gUnknown_202D240[i].size);
for (i = 0; i < sUnknown_202D23C; i++)
CpuCopy(sUnknown_202D240[i].unk0, sUnknown_202D240[i].unk4, sUnknown_202D240[i].size);
gUnknown_202D23C = 0;
if (gUnknown_202D238[0] != 0) {
gUnknown_202D238[0] = 0;
sUnknown_202D23C = 0;
if (sUnknown_202D238[0] != 0) {
sUnknown_202D238[0] = 0;
CpuCopy(BG_SCREEN_ADDR(12), gBgTilemaps[0], BG_SCREEN_SIZE);
}
if (gUnknown_202D238[1] != 0) {
gUnknown_202D238[1] = 0;
if (sUnknown_202D238[1] != 0) {
sUnknown_202D238[1] = 0;
CpuCopy(BG_SCREEN_ADDR(13), gBgTilemaps[1], BG_SCREEN_SIZE);
}
if (gUnknown_202D238[2] != 0) {
gUnknown_202D238[2] = 0;
if (sUnknown_202D238[2] != 0) {
sUnknown_202D238[2] = 0;
CpuCopy(BG_SCREEN_ADDR(14), gBgTilemaps[2], BG_SCREEN_SIZE);
}
if (gUnknown_202D238[3] != 0) {
gUnknown_202D238[3] = 0;
if (sUnknown_202D238[3] != 0) {
sUnknown_202D238[3] = 0;
CpuCopy(BG_SCREEN_ADDR(15), gBgTilemaps[3], BG_SCREEN_SIZE);
}
}

View File

@ -1,13 +1,13 @@
#include "global.h"
#include "code_800C9CC.h"
#include "cpu.h"
#include "random.h"
#include "reg_control.h"
// Todo: Figure out if this file could be merged with bg_control and cpu?
EWRAM_INIT u32 gUnknown_203B0B8 = {0};
extern u16 gRawKeyInput;
void sub_800CB20(void)
void WaitForNextFrameAndAdvanceRNG(void)
{
sub_800BA5C();
gUnknown_203B0B8++;

View File

@ -1,7 +1,3 @@
#include <stdarg.h>
#include <stdio.h>
#include "gba/gba.h"
#include "config.h"
#include "global.h"
#include "music.h"

View File

@ -2,8 +2,10 @@
#include "bg_control.h"
#include "code_800558C.h"
#include "code_800DAC0.h"
#include "code_80118A4.h"
#include "code_800E9A8.h"
#include "code_80118A4.h"
#include "code_803E724.h"
#include "def_filearchives.h"
#include "file_system.h"
#include "main_loops.h"
#include "memory.h"
@ -21,13 +23,11 @@ extern s32 sub_800E2C0(u32);
extern u32 sub_800E900(void);
extern void sub_8009BE4(void);
extern void sub_800F204(void);
extern void sub_803EAF0(u32, u32);
extern struct unkStruct_800F18C *sub_800F18C(s32);
extern void sub_800DCA8(struct unkStruct_203B0CC_sub *);
extern u8 gefob000_string[];
extern u8 gefob001_string[];
extern struct FileArchive gEffectFileArchive;
extern void sub_800F034(void);
extern void sub_800ED38(u32);
@ -137,7 +137,7 @@ void sub_800DC14(s32 param_1)
sub_8009BE4();
if (sub_8000728() == 1) {
LoadDungeonMapPalette();
sub_803EAF0(0,0);
sub_803EAF0(0, NULL);
sub_800CD64(0x8000,0);
}
}

View File

@ -1,15 +1,18 @@
#include "global.h"
#include "bg_control.h"
#include "code_800558C.h"
#include "code_8009804.h"
#include "code_800C9CC.h"
#include "code_800E9E4.h"
#include "dungeon_pokemon_sprites.h"
#include "code_800ED38.h"
#include "code_803E724.h"
#include "dungeon_message.h"
#include "dungeon_pokemon_sprites.h"
#include "file_system.h"
#include "main_loops.h"
#include "memory.h"
#include "sprite.h"
#include "code_800C9CC.h"
#include "code_800558C.h"
#include "bg_control.h"
#include "code_8009804.h"
#include "text.h"
struct unkStruct_203B0D0_sub
{
@ -42,6 +45,8 @@ void sub_800F204(OpenedFile *file);
void sub_800F13C(s32, OpenedFile *, unkStruct_80B9CC4 *);
void sub_800F15C(s32);
extern void sub_809971C(u16 a0, const RGB *a1, int a2);
void sub_800ED38(s32 r0)
{
if(gUnknown_203B0D0 == 0)
@ -205,10 +210,6 @@ void sub_800EF40(u8 r0, u8 r1)
sub_800EE5C(ret);
}
extern void xxx_call_update_bg_vram(void);
extern void sub_803EAF0(u32 a0, u8 *a1);
extern void sub_809971C(u16 a0, const RGB *a1, int a2);
void sub_800EF64(void)
{
s32 i;
@ -246,7 +247,7 @@ void sub_800EF64(void)
sub_800CD64(0, TRUE);
sub_8052210(0);
sub_803EAF0(5, NULL);
sub_800CB20();
WaitForNextFrameAndAdvanceRNG();
xxx_call_update_bg_vram();
}
sub_8009A1C(sub->fileData, sub->unkC, sub->unk10, sub->unk14);

View File

@ -1,7 +1,7 @@
#include "global.h"
#include "globaldata.h"
#include <stdio.h>
#include "code_800E9E4.h"
#include "def_filearchives.h"
#include "file_system.h"
#include "memory.h"
@ -21,8 +21,6 @@ extern struct unkStruct_203B0D4 *gUnknown_203B0D4;
ALIGNED(4) static const u8 gUnknown_80CE77C[] = "efob%03d";
ALIGNED(4) static const u8 gUnknown_80CE788[] = "efbg%03d";
extern struct FileArchive gEffectFileArchive;
void sub_800F034(void) {
s32 index;
if(gUnknown_203B0D4 == NULL)

View File

@ -16,9 +16,6 @@ EWRAM_DATA s16 gUnknown_202DE20 = {0};
EWRAM_DATA s16 gUnknown_202DE22 = {0};
EWRAM_DATA s16 gUnknown_202DE24 = {0};
extern bool8 sub_80111C4();
extern void sub_8010F28();
void sub_8011760(void)
{
if (sub_80023E4(13))

View File

@ -7,8 +7,7 @@
#include "string_format.h"
#include "game_options.h"
#include "sprite.h"
extern void xxx_call_update_bg_vram();
#include "text.h"
void sub_8012A18()
{
@ -17,7 +16,7 @@ void sub_8012A18()
nullsub_8(gGameOptionsRef->unkA);
sub_8005180();
sub_80060EC();
sub_800CB20();
WaitForNextFrameAndAdvanceRNG();
LoadBufferedInputs(); // Input related
CopySpritesToOam();
sub_8005304();

View File

@ -1,16 +1,15 @@
#include "global.h"
#include "globaldata.h"
#include "constants/friend_area.h"
#include "bg_palette_buffer.h"
#include "code_800D090.h"
#include "string_format.h"
#include "iq_skill_menu.h"
#include "code_801D014.h"
#include "code_80227B8.h"
#include "code_8023868.h"
#include "code_8024458.h"
#include "code_80958E8.h"
#include "common_strings.h"
#include "constants/friend_area.h"
#include "def_filearchives.h"
#include "event_flag.h"
#include "friend_area.h"
#include "friend_area_action_menu.h"
@ -19,11 +18,13 @@
#include "ground_main.h"
#include "ground_map_1.h"
#include "input.h"
#include "iq_skill_menu.h"
#include "memory.h"
#include "menu_input.h"
#include "options_menu1.h"
#include "party_list_menu.h"
#include "rescue_team_info.h"
#include "string_format.h"
#include "text.h"
#include "wigglytuff_shop2.h"
#include "wonder_mail_802C4C8.h"
@ -32,8 +33,6 @@
static EWRAM_INIT struct unk_203B250 *sUnknown_203B250 = {NULL};
static EWRAM_INIT u32 sUnknown_203B254 = {0};
extern const struct FileArchive gTitleMenuFileArchive;
#include "data/code_801D014.h"
static void LoadTeamRankBadge(u32, u32, u32);

View File

@ -1,22 +1,22 @@
#include "global.h"
#include "dungeon.h"
#include "pokemon.h"
#include "file_system.h"
#include "code_803E46C.h"
#include "code_8009804.h"
#include "cpu.h"
#include "dungeon_random.h"
#include "bg_palette_buffer.h"
#include "code_800D090.h"
#include "pokemon_3.h"
#include "game_options.h"
#include "text.h"
#include "constants/dungeon.h"
#include "structs/str_202ED28.h"
#include "structs/str_202EDE8.h"
#include "bg_palette_buffer.h"
#include "code_8009804.h"
#include "code_800D090.h"
#include "code_803D110.h"
#include "code_803E46C.h"
#include "cpu.h"
#include "def_filearchives.h"
#include "dungeon.h"
#include "dungeon_random.h"
#include "file_system.h"
#include "game_options.h"
#include "pokemon.h"
#include "pokemon_3.h"
#include "text.h"
extern void sub_803E13C(void);
extern void sub_80901D8(DungeonLocation *param_1,DungeonLocation *param_2);
extern s32 sub_80902C8(u8 dungeon);
extern void sub_808E9C4(UnkDungeonGlobal_unk1CD98 *r0, s16 r1);
extern bool8 sub_80848EC(void);
@ -34,7 +34,6 @@ extern const u32 gUnknown_80F6120[];
extern const u16 gUnknown_80F5F70[];
extern RGB gUnknown_202ECA4[];
extern struct FileArchive gDungeonFileArchive;
extern OpenedFile *gDungeonNameBannerPalette;
extern OpenedFile *gDungeonNameBannerFontFile;
extern OpenedFile *gUnknown_202ECA0;
@ -42,7 +41,6 @@ extern OpenedFile *gUnknown_202EC9C;
extern OpenedFile *gUnknown_202EC98;
extern OpenedFile *gUnknown_202EC94;
extern s32 gDungeonNameBannerFont;
extern u8 gUnknown_20274A5;
struct UnkDungeonFileData
{
@ -62,17 +60,47 @@ struct UnkDataFileStruct
};
// Very similar to unkChar struct
struct UnkStruct_sub_803DC6C
typedef struct UnkStruct_sub_803DC6C
{
u8 *unk0;
u16 unk4;
u8 unk6;
} UnkStruct_sub_803DC6C;
extern u32 gUnknown_202EDD0;
extern s32 gUnknown_202EDD4;
extern s32 gDungeonBrightness;
extern SpriteOAM gUnknown_202EDC0;
extern SpriteOAM gUnknown_202EDB8;
extern const DungeonPos gUnknown_80F61EC[2][6];
struct Unk80F6224Struct
{
s32 shape;
s32 size;
s32 tileNum;
};
struct FileStruct2
{
s32 count;
u8 array[0];
};
struct FileStruct
{
struct FileStruct2 *ptr;
struct u8 *ptr2;
};
extern const struct Unk80F6224Struct gUnknown_80F621C[2][6];
s32 sub_803DC14(const u8 *dungName, s32 strWidth, s32 a2);
s32 CalcStringWidth(const u8 *dungName);
s32 sub_803DC6C(u32 chr, s32 strWidth, s32 a2);
struct UnkStruct_sub_803DC6C *sub_803DEC8(s32 chr);
static UnkStruct_sub_803DC6C *sub_803DEC8(s32 chr);
void sub_803DD30(u8 *a0, u32 *a1);
void sub_803D4D0(void)
@ -272,7 +300,7 @@ struct DungeonNamePaletteFileData
RGB pal[16];
};
void ShowDungeonNameBanner(void)
void ShowDungeonNameBanner_Async(void)
{
u8 text[100];
s32 var;
@ -355,7 +383,7 @@ s32 sub_803DC6C(u32 chr, s32 strWidth, s32 a2)
const u32 *constData;
u32 sp[72];
s32 r9;
struct UnkStruct_sub_803DC6C *strPtr = sub_803DEC8(chr);
UnkStruct_sub_803DC6C *strPtr = sub_803DEC8(chr);
sub_803DD30(strPtr->unk0, sp);
r9 = strPtr->unk6;
@ -480,11 +508,11 @@ s32 CalcStringWidth(const u8 *dungName)
return w;
}
struct UnkStruct_sub_803DC6C *sub_803DEC8(s32 chr)
static UnkStruct_sub_803DC6C *sub_803DEC8(s32 chr)
{
s32 r2, r4;
struct UnkStruct_sub_803DC6C *ret;
struct UnkStruct_sub_803DC6C *strPtr = *((struct UnkStruct_sub_803DC6C **) gDungeonNameBannerFontFile->data);
UnkStruct_sub_803DC6C *ret;
UnkStruct_sub_803DC6C *strPtr = *((UnkStruct_sub_803DC6C **) gDungeonNameBannerFontFile->data);
// Fakematch? Or just magic numbers which will make more sense once this file is documented?
if (chr > 63487 && chr < 65535)
{
@ -521,18 +549,6 @@ struct UnkStruct_sub_803DC6C *sub_803DEC8(s32 chr)
return ret;
};
struct FileStruct2
{
s32 count;
u8 array[0];
};
struct FileStruct
{
struct FileStruct2 *ptr;
struct u8 *ptr2;
};
void sub_803DF60(void)
{
u8 *vram;
@ -662,26 +678,9 @@ void sub_803E214(void)
CloseFile(gUnknown_202ECA0);
}
void nullsub_56(void) {}
extern u8 gUnknown_203B40D;
extern u32 gUnknown_202EDD0;
extern s32 gUnknown_202EDD4;
extern s32 gDungeonBrightness;
extern SpriteOAM gUnknown_202EDC0;
extern SpriteOAM gUnknown_202EDB8;
extern const DungeonPos gUnknown_80F61EC[2][6];
struct Unk80F6224Struct
void nullsub_56(void)
{
s32 shape;
s32 size;
s32 tileNum;
};
extern const struct Unk80F6224Struct gUnknown_80F621C[2][6];
}
void sub_803E250(void)
{

View File

@ -1,12 +1,13 @@
#include "global.h"
#include "structs/str_dungeon.h"
#include "code_803E46C.h"
#include "code_8004AA0.h"
#include "code_800558C.h"
#include "code_8009804.h"
#include "code_800C9CC.h"
#include "code_80118A4.h"
#include "code_803E46C.h"
#include "code_803E668.h"
#include "code_803E724.h"
#include "dungeon_map.h"
#include "bg_palette_buffer.h"
#include "bg_control.h"
@ -15,6 +16,7 @@
#include "input.h"
#include "play_time.h"
#include "sprite.h"
#include "text.h"
EWRAM_INIT u8 gUnknown_203B40C = 0;
EWRAM_INIT u8 gUnknown_203B40D = 0;
@ -31,14 +33,12 @@ void sub_803F580(s32);
void sub_806CC10();
void sub_804522C();
void sub_803F9CC();
extern void xxx_call_update_bg_vram(void);
void sub_803ECE0();
void sub_803EDF0();
void sub_800E90C();
void sub_8042E5C();
void sub_800F7D0(DungeonPos *);
void sub_803E874(s32, s32);
void sub_803EAF0(s32, s32);
void DungeonRunFrameActions(u32 a0)
{
@ -95,7 +95,7 @@ void sub_803E490(u32 unused)
gDungeonFramesCounter++;
IncrementPlayTime(gPlayTimeRef);
sub_800CB20();
WaitForNextFrameAndAdvanceRNG();
LoadBufferedInputs();
CopySpritesToOam();
nullsub_13();
@ -127,7 +127,7 @@ void sub_803E668(u32 unused)
sub_80060EC();
gDungeonFramesCounter++;
IncrementPlayTime(gPlayTimeRef);
sub_800CB20();
WaitForNextFrameAndAdvanceRNG();
LoadBufferedInputs();
CopySpritesToOam();
nullsub_13();
@ -144,11 +144,11 @@ void sub_803E668(u32 unused)
gUnknown_202EDD4--;
}
void sub_803E708(s32 a0, u32 a1)
void sub_803E708(s32 numFrames, u32 a1)
{
while (a0 != 0) {
while (numFrames != 0) {
DungeonRunFrameActions(a1);
a0--;
numFrames--;
}
}
@ -179,7 +179,7 @@ void sub_803E748(void) {
if(index2 <= 0)
{
index2 = 0;
sub_803EAF0(1, 0);
sub_803EAF0(1, NULL);
gDungeon->unk181e8.unk18217 = index2;
}
}
@ -214,7 +214,7 @@ void sub_803E7C8(void)
if(index2 <= 0)
{
index2 = 0;
sub_803EAF0(1, 0);
sub_803EAF0(1, NULL);
gDungeon->unk181e8.unk18217 = index2;
}
}

View File

@ -25,6 +25,7 @@
#include "constants/status.h"
#include "code_803E724.h"
#include "structs/str_202EDE8.h"
#include "dungeon_music.h"
extern s32 gDungeonBrightness;
extern u32 gUnknown_202EDD0;
@ -52,15 +53,11 @@ extern const s32 gUnknown_80F6520[];
extern const u16 gUnknown_80F64D8[][9];
extern const u16 gUnknown_80F6544[][9];
extern u8 gUnknown_20274A5;
extern s32 gDungeonFramesCounter;
extern void PlayDungeonStartButtonSE(void);
extern void ShowWholeRevealedDungeonMap(void);
extern void sub_80400D4(void);
extern void sub_8041888(u8 param_1);
extern void ShowDungeonMapAtPos(s32, s32);
void sub_803EC94(void);
s32 sub_803EF90(s32 a0, u8 a1);
@ -261,21 +258,23 @@ static const struct WindowTemplates gUnknown_80F63D0 =
}
};
void sub_803EAF0(u32 a0, u8 *a1)
// kind==8 uses the `name` param.
void sub_803EAF0(u32 kind, u8 *name)
{
if (a0 == gUnknown_202EDD0)
if (kind == gUnknown_202EDD0)
return;
switch (a0) {
case 1:
if (gUnknown_203B40C != 0) {
switch (kind) {
case 1: {
if (gUnknown_203B40C != 0)
sub_8052210(0);
}
ResetUnusedInputStruct();
sub_803EC94();
ShowWindows(NULL, TRUE, TRUE);
break;
case 0:
}
case 0: {
sub_803EC94();
ShowWindows(NULL, TRUE, TRUE);
if (gUnknown_203B40C != 0) {
@ -283,64 +282,75 @@ void sub_803EAF0(u32 a0, u8 *a1)
UpdateBgTilemapForDungeonMap(FALSE);
}
break;
case 3:
}
case 3: {
ShowWindows(&gUnknown_80F62B0, TRUE, TRUE);
if (gUnknown_203B40C != 0) {
if (gUnknown_203B40C != 0)
UpdateBgTilemapForDungeonMap(TRUE);
}
break;
case 6:
if (gUnknown_203B40C != 0) {
}
case 6: {
if (gUnknown_203B40C != 0)
sub_8052210(0);
}
ResetUnusedInputStruct();
ShowWindows(&gUnknown_80F6310, TRUE, TRUE);
break;
case 7:
if (gUnknown_203B40C != 0) {
}
case 7: {
if (gUnknown_203B40C != 0)
sub_8052210(0);
}
ResetUnusedInputStruct();
ShowWindows(&gUnknown_80F6370, TRUE, TRUE);
break;
}
case 2:
case 4:
if (gUnknown_203B40C != 0) {
case 4: {
if (gUnknown_203B40C != 0)
sub_8052210(0);
}
ResetUnusedInputStruct();
sub_803EC94();
ShowWindows(NULL, TRUE, TRUE);
break;
case 5:
if (gUnknown_203B40C != 0) {
}
case 5: {
if (gUnknown_203B40C != 0)
sub_8052210(0);
}
ShowWindows(NULL, TRUE, TRUE);
break;
case 8:
}
case 8: {
if (gUnknown_203B40C != 0) {
PlayDungeonStartButtonSE();
sub_8052210(0);
}
CreateConfirmNameMenu(2, a1);
CreateConfirmNameMenu(2, name);
break;
case 9:
}
case 9: {
if (gUnknown_203B40C != 0) {
sub_8052210(0);
PlayDungeonStartButtonSE();
}
ResetUnusedInputStruct();
ShowWindows(&gUnknown_80F63D0, FALSE, TRUE);
break;
case 10:
}
case 10: {
PlayDungeonStartButtonSE();
break;
case 150: // Dummy case put here to match, any value >= 150 works
}
case 150: { // Dummy case put here to match, any value >= 150 works
break;
}
}
gUnknown_202EDD0 = a0;
gUnknown_202EDD0 = kind;
}
void sub_803EC94(void)

View File

@ -2,6 +2,7 @@
#include "code_800558C.h"
#include "code_800C9CC.h"
#include "code_80118A4.h"
#include "def_filearchives.h"
#include "dungeon_message.h"
#include "structs/dungeon_entity.h"
#include "structs/str_dungeon.h"
@ -12,7 +13,6 @@
extern s32 gUnknown_80F6568[];
extern const char gUnknown_80F6604; // "zmappat"
extern struct FileArchive gDungeonFileArchive;
extern void sub_803F7BC(void);
@ -49,7 +49,7 @@ void sub_8040094(u8 r0)
sub_803F7BC();
sub_80060EC();
IncrementPlayTime(gPlayTimeRef);
sub_800CB20();
WaitForNextFrameAndAdvanceRNG();
LoadBufferedInputs();
xxx_call_update_bg_sound_input();
UpdateDungeonMusic();

View File

@ -1,20 +1,24 @@
#include "global.h"
#include "globaldata.h"
#include "dungeon_message.h"
#include "dungeon_random.h"
#include "constants/move_id.h"
#include "constants/type.h"
#include "constants/weather.h"
#include "structs/dungeon_entity.h"
#include "structs/str_dungeon.h"
#include "dungeon_music.h"
#include "dungeon.h"
#include "code_800558C.h"
#include "code_8009804.h"
#include "code_800E9E4.h"
#include "dungeon_util.h"
#include "code_800ED38.h"
#include "code_803E46C.h"
#include "code_804267C.h"
#include "weather.h"
#include "dungeon.h"
#include "dungeon_message.h"
#include "dungeon_move.h"
#include "dungeon_music.h"
#include "dungeon_random.h"
#include "dungeon_util.h"
#include "tile_types.h"
#include "constants/move_id.h"
#include "constants/weather.h"
#include "constants/type.h"
#include "weather.h"
struct UnkStruct_8040094
{
@ -30,9 +34,7 @@ extern u8 sub_800EC94(s32 param_1);
extern s32 sub_800E710(s32 a0, u16 a1);
extern void sub_800569C(DungeonPos *, axdata *, u8);
extern void sub_800EEC8(u16 r0);
extern void sub_800EF64(void);
extern void sub_8042DD4(s32 a0, Entity *a1, s32 a2);
extern void DungeonRunFrameActions(u32);
extern u8 sub_800EA44(s32 species, u16 a2);
extern s32 sub_800E790(s32 species, u16 a2);
extern void sub_806CDD4(Entity *entity, u8, u32 direction);
@ -53,10 +55,7 @@ extern bool8 MoveMatchesBideClassStatus(Entity *pokemon, Move *move);
extern bool8 IsSleeping(Entity *pokemon);
extern void sub_80421C0(Entity *pokemon, u16);
extern u8 gUnknown_203B40D;
extern s16 gUnknown_2026E4E;
extern s32 gDungeonBrightness;
extern s32 gUnknown_202F224;
extern const u8 *const gPtrMagnitudeMessage;
extern const s32 gUnknown_8106A8C[];

View File

@ -1,12 +1,14 @@
#include "global.h"
#include "math.h"
#include "code_800558C.h"
#include "code_800DAC0.h"
#include "code_800E9A8.h"
#include "code_800ED38.h"
#include "code_803E46C.h"
#include "code_803E724.h"
#include "code_8041AD0.h"
#include "code_804267C.h"
#include "code_806CD90.h"
#include "code_8041AD0.h"
#include "code_800DAC0.h"
#include "dungeon_config.h"
#include "constants/direction.h"
#include "constants/status.h"
@ -41,14 +43,10 @@ extern void PlaySoundEffect(u32);
void EntityUpdateStatusSprites(Entity *entity);
extern s32 gDungeonBrightness;
extern u8 gUnknown_203B40D;
extern s16 gUnknown_2026E4E;
extern void sub_800DBBC(void);
extern void sub_803EA10(void);
extern void sub_8042E98(void);
extern void sub_800EE5C(u32);
extern void sub_800EF64(void);
void sub_804178C(u8 param_1);
u32 sub_8041764(unkStruct_80416E0 *param_1, bool8 param_2);

View File

@ -1,5 +1,6 @@
#include "global.h"
#include "code_800DAC0.h"
#include "code_800ED38.h"
#include "code_8041AD0.h"
#include "code_804267C.h"
#include "code_803E46C.h"
@ -37,7 +38,6 @@ extern u32 sub_8041764(unkStruct_80416E0 *, bool8);
extern void sub_8005700(DungeonPos *a0, struct axObject *a1);
extern u32 sub_800E49C();
extern void sub_800EF40(u8 r0, u8 r1);
extern void sub_800EF64(void);
void sub_8042390(Entity *entity, Item *item)
{

View File

@ -4,7 +4,10 @@
#include "structs/rgb.h"
#include "structs/sprite_oam.h"
#include "structs/str_dungeon_8042F6C.h"
#include "code_800558C.h"
#include "code_803D110.h"
#include "code_803E46C.h"
#include "code_803E724.h"
#include "code_800E9E4.h"
#include "code_800DAC0.h"
#include "code_800E9A8.h"
@ -42,9 +45,10 @@
#include "dungeon_config.h"
#include "dungeon_map.h"
#include "dungeon_items.h"
#include "dungeon_misc.h"
#include "code_8042B34.h"
#include "code_800ED38.h"
extern void sub_800EE5C(s32);
extern void sub_800EF64(void);
extern void sub_800F15C(s32);
struct UnkStruct_203B414
@ -258,25 +262,18 @@ extern void sub_8041888(u8 param_1);
extern void sub_803D4AC(void);
extern void sub_804513C(void);
extern void sub_8043CD8(void);
extern void sub_803E250(void);
extern void sub_803E830(void);
extern void sub_803E214(void);
extern void nullsub_56(void);
extern void sub_8068F28(void);
extern void sub_806C1D8(void);
extern void IncrementThievingSuccesses(void);
extern void sub_803E13C(void);
extern void sub_80841EC(void);
extern void sub_8084424(void);
extern void sub_8086130(void);
extern void FreeDungeonPokemonSprites(void);
extern void sub_803DF60(void);
extern void sub_803E02C(void);
extern void sub_80847D4(void);
extern void sub_8043D60(void);
extern void sub_806890C(void);
extern void sub_80840A4(void);
extern void sub_803E178(void);
extern void sub_80848F0(void);
extern void IncrementAdventureFloorsExplored(void);
extern void sub_806AB2C(void);
@ -315,22 +312,14 @@ extern void sub_806A974(void);
extern void sub_806CF60(void);
extern void sub_8068F80(void);
extern bool8 sub_8044B28(void);
extern bool8 sub_8083C24(void);
extern bool8 sub_8083C88(u8 param_1);
extern bool8 sub_8043ED0(bool8);
extern void ShowDungeonNameBanner(void);
extern void sub_803EAF0(u32, u32);
extern void sub_806A914(bool8 a0, bool8 a1, bool8 showRunAwayEffect);
extern void sub_803F4A0(Entity *a0);
extern void sub_8083AB0(s16 param_0, Entity * target, Entity * entity);
extern bool8 sub_8083C50(void);
extern void sub_8068FE0(Entity *, u32, Entity *r2);
extern void ResetMonEntityData(EntityInfo *, u32);
extern s32 GetMovesLearnedAtLevel(u16* dst, s16 species, s32 level, s32 IQPoints);
extern bool8 IsKeepMoney(u8 dungeon);
extern void sub_8042B0C(Entity *);
extern s16 gUnknown_2026E4E;
extern u8 gUnknown_202F32C;
extern u8 gUnknown_202F1A8;
extern s32 gDungeonBrightness;
@ -356,7 +345,7 @@ extern OpenedFile *gDungeonNameBannerPalette;
// This functions is the main 'loop' when the player is in a Dungeon. It runs from the moment the player enters a dungeon, until they leave(by completing or by fainting).
// arm9.bin::0206A848
void RunDungeon(UnkStruct_RunDungeon *r8)
void RunDungeon_Async(UnkStruct_RunDungeon *r8)
{
bool8 check;
Entity *leader;
@ -492,7 +481,7 @@ void RunDungeon(UnkStruct_RunDungeon *r8)
}
}
while (1) {
while (TRUE) {
sub_8098080();
nullsub_16();
sub_80521D0();
@ -583,10 +572,10 @@ void RunDungeon(UnkStruct_RunDungeon *r8)
sub_803E178();
gDungeonBrightness = 0;
SetDungeonMapToNotShown();
sub_803EAF0(4, 0);
sub_803EAF0(4, NULL);
sub_8052210(0);
sub_803F27C(r6);
ShowDungeonNameBanner();
ShowDungeonNameBanner_Async();
if (!r6) {
GenerateFloor();
@ -653,7 +642,7 @@ void RunDungeon(UnkStruct_RunDungeon *r8)
sub_803E7C8();
}
sub_8040094(0);
sub_803EAF0(0, 0);
sub_803EAF0(0, NULL);
InitDungeonMap(r6);
ShowWholeRevealedDungeonMap();
gDungeon->unkB8 = NULL;
@ -739,7 +728,7 @@ void RunDungeon(UnkStruct_RunDungeon *r8)
}
SetDungeonMapToNotShown();
sub_803EAF0(1, 0);
sub_803EAF0(1, NULL);
gDungeon->unk181e8.unk18219 = 0;
gDungeon->unk181e8.unk18218 = 1;
if (gDungeon->unk3 == 0

View File

@ -1,11 +1,12 @@
#include "global.h"
#include "constants/dungeon_action.h"
#include "structs/str_item_text.h"
#include "code_8044CC8.h"
#include "dungeon_generation.h"
#include "dungeon_items.h"
#include "dungeon_map_access.h"
#include "dungeon_util.h"
#include "dungeon_generation.h"
#include "code_8044CC8.h"
#include "items.h"
#include "structs/str_item_text.h"
// size: 0x8
typedef struct unkStr_80F7C54
@ -25,8 +26,6 @@ extern const unkStr_80F7C54 gUnknown_80F7C54[65];
extern u8 *gUnknown_80F91EC[];
extern bool8 sub_8045888(Entity *);
extern u8 GetFloorType(void);
void AddItemToDungeonAt(DungeonPos *, Item *, u32);
bool8 RemoveItemFromDungeonAt(DungeonPos *, u32);
Item * sub_8044CC8(Entity *param_1, ActionParameter *param_2, UNUSED s32 a3)
{

View File

@ -29,6 +29,8 @@
#include "dungeon_config.h"
#include "dungeon_menu_team.h"
#include "dungeon_menu_moves.h"
#include "dungeon_misc.h"
#include "code_803E724.h"
extern s16 gTypeGummiIQBoost[NUM_TYPES][NUMBER_OF_GUMMIS];
@ -67,13 +69,11 @@ extern u8 *gUnknown_80F9BD8[];
#include "data/code_8048480.h"
extern void sub_8078B5C(Entity *, Entity *, u32, u32, u32);
extern u8 sub_806A538(s32);
extern void sub_8051E7C(Entity *pokemon);
extern void sub_8045BF8(u8 *, Item *);
extern void ActionShowMoveInfo(ActionContainer *);
extern void ActionLinkMoves(ActionContainer *);
extern void sub_8044DF0(Entity *, u32, u32);
extern void sub_803EAF0(u32, u32);
extern void SetLeaderActionToNothing(bool8);
extern void sub_8044E24(Entity *, u32, u32);
extern void sub_804245C(Entity *, Item *);
@ -933,22 +933,22 @@ bool8 sub_8048B9C(Entity *entity, Item *item)
ActionShowMoveInfo(entityActionPtr);
}
else if (entityActionPtr->action == ACTION_LINK_MOVES) {
sub_803EAF0(0,0);
sub_803EAF0(0, NULL);
ActionLinkMoves(entityActionPtr);
SetLeaderActionToNothing(TRUE);
ret = TRUE;
}
else if (entityActionPtr->action == ACTION_DELINK_MOVES) {
sub_803EAF0(0,0);
sub_803EAF0(0, NULL);
ActionDelinkMoves(entityActionPtr,0);
SetLeaderActionToNothing(TRUE);
}
else if ((entityActionPtr->action == ACTION_SET_MOVE) || (entityActionPtr->action == ACTION_UNSET_MOVE)) {
sub_803EAF0(0,0);
sub_803EAF0(0, NULL);
ActionSetOrUnsetMove(entityActionPtr, FALSE);
}
else if (entityActionPtr->action == ACTION_SWITCH_AI_MOVE) {
sub_803EAF0(0,0);
sub_803EAF0(0, NULL);
ActionToggleMoveUsableForAi(entityActionPtr);
}

View File

@ -1,39 +1,43 @@
#include "global.h"
#include "globaldata.h"
#include "code_8045A00.h"
#include "dungeon_message.h"
#include "code_807CD9C.h"
#include "constants/dungeon.h"
#include "constants/item.h"
#include "constants/move_id.h"
#include "code_803E46C.h"
#include "code_803E724.h"
#include "code_8041AD0.h"
#include "code_8044CC8.h"
#include "code_8045A00.h"
#include "code_8066D04.h"
#include "code_806CD90.h"
#include "code_8077274_1.h"
#include "code_807CD9C.h"
#include "code_8084778.h"
#include "dungeon_ai_targeting.h"
#include "dungeon_capabilities.h"
#include "dungeon_engine.h"
#include "dungeon_items.h"
#include "dungeon_leader.h"
#include "dungeon_map_access.h"
#include "dungeon_message.h"
#include "dungeon_misc.h"
#include "dungeon_move.h"
#include "dungeon_movement.h"
#include "dungeon_music.h"
#include "position_util.h"
#include "dungeon_util.h"
#include "items.h"
#include "input.h"
#include "text.h"
#include "code_803E46C.h"
#include "string_format.h"
#include "friend_area.h"
#include "dungeon_leader.h"
#include "status_checks_1.h"
#include "dungeon_ai_targeting.h"
#include "dungeon_engine.h"
#include "dungeon_move.h"
#include "dungeon_items.h"
#include "dungeon_random.h"
#include "code_8077274_1.h"
#include "code_8084778.h"
#include "pokemon.h"
#include "trap.h"
#include "moves.h"
#include "pokemon_3.h"
#include "dungeon_util.h"
#include "friend_area.h"
#include "input.h"
#include "items.h"
#include "menu_input.h"
#include "dungeon_capabilities.h"
#include "constants/item.h"
#include "constants/dungeon.h"
#include "constants/move_id.h"
#include "moves.h"
#include "pokemon.h"
#include "pokemon_3.h"
#include "position_util.h"
#include "status_checks_1.h"
#include "string_format.h"
#include "text.h"
#include "trap.h"
extern u8 *gUnknown_80F8BE0[];
extern u8 *gUnknown_80FF76C[];
@ -77,13 +81,10 @@ extern const u8 *const gMonParalyzed;
extern const u8 *const gUnknown_80FC690;
extern s32 gDungeonSubMenuItemsCount;
extern u32 gUnknown_202F208;
extern void sub_8071DA4(Entity *);
extern void sub_806A1B0(Entity *);
extern void sub_806A9B4(Entity *, u32);
extern void sub_8057588(Entity * pokemon, u8 param_2);
extern void sub_8068FE0(Entity *, u32, Entity *r2);
extern bool8 sub_806A58C(s16 a0);
extern bool8 sub_806A564(s16 r0);
extern void sub_8045C08(u8 *buffer, Item *item);
@ -91,8 +92,6 @@ extern bool8 sub_8045888(Entity *);
extern Item *sub_8044D90(Entity *, s32, u32);
void sub_8045BF8(u8 *, Item *);
u8 sub_8048D50();
void SetActionUnusableInDungeonSubMenu(u16 param_1);
void AddActionToDungeonSubMenu(u16 param_1, u8 param_2);
void sub_8044DF0();
void sub_8042208(Entity *pokemon, u8 r1);
void sub_803E708();
@ -895,7 +894,6 @@ void sub_8067904(Entity *entity, u16 moveId)
extern void sub_80684C4(void);
void sub_8045064(void);
extern void PlayDungeonCursorSE(u8 param_1);
extern void sub_8068344(void);
bool8 CanSubMenuItemBeChosen(s32 param_1);
void sub_8068310(s32 n, PokemonStruct1 **monPtrs);
@ -907,7 +905,6 @@ void PlayDungeonConfirmationSE(void);
void PlayDungeonCancelSE(void);
void sub_806806C(PokemonStruct1 *a0);
void CreateDungeonMenuSubWindow(WindowTemplates *a0, s32 a1);
extern void sub_803EAF0(u32, u8 *);
extern const s32 gUnknown_8106E80[];
extern MenuInputStruct gDungeonMenu;

View File

@ -2,6 +2,7 @@
#include "code_800F958.h"
#include "code_803E46C.h"
#include "code_803E668.h"
#include "code_8041AD0.h"
#include "code_8045A00.h"
#include "code_805D8C8.h"
#include "code_804267C.h"
@ -38,6 +39,7 @@
#include "structs/str_806B7F8.h"
#include "structs/str_202ED28.h"
#include "dungeon_config.h"
#include "dungeon_misc.h"
extern void sub_8042900(Entity *r0);
extern void sub_8042968(Entity *r0);
@ -62,12 +64,9 @@ extern u8 GetRandomFloorItem(s32 a0);
extern void DeletePokemonDungeonSprite(s32 id);
extern void sub_80429E8(Entity *r0);
extern s32 sub_803DA20(s32 param_1);
extern void sub_80694C0(Entity *, s32, s32, u32);
extern s32 gDungeonFramesCounter;
extern void sub_800F958(s32 dungeonSpriteID, DungeonPos *pos, DungeonPos *statusOffsets, u32 a3);
extern void sub_8005700(DungeonPos *a0, struct axObject *a1);
u32 EntityGetStatusSprites(Entity *entity);
void UpdateDungeonPokemonSprite(int id, short species, int status, char visible);
extern void sub_8042EC8(Entity *a0, s32 a1);
extern Entity *sub_804550C(s16 a);
extern Entity *sub_80453AC(s16 id);

View File

@ -1,6 +1,7 @@
#include "global.h"
#include "constants/type.h"
#include "structs/str_pokemon.h"
#include "dungeon_main.h"
#include "dungeon_misc.h"
#include "code_80118A4.h"
#include "code_803E668.h"
@ -39,7 +40,6 @@ extern u8 *gUnknown_80FA120[];
extern u8 *gUnknown_80FA090[];
u8 sub_806B8CC();
bool8 DungeonGiveNameToRecruitedMon(u8 *a0);
void sub_8083D88();
u8 sub_808529C(s32);
void nullsub_96(Entity *pokemon,Entity *target);

View File

@ -13,6 +13,7 @@
#include "dungeon_generation.h"
#include "dungeon_movement.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_map.h"
#include "dungeon_map_access.h"
#include "dungeon_util.h"
#include "math.h"
@ -24,6 +25,8 @@
#include "code_803E668.h"
#include "weather.h"
#include "dungeon_config.h"
#include "dungeon_misc.h"
#include "dungeon_items.h"
extern u32 gDungeonFramesCounter;
@ -53,7 +56,6 @@ extern struct DungeonPos *gUnknown_8107178[3];
extern void sub_807E1A0(Entity *pokemon,Entity *target,u8 moveType,s32 param_4,s32 param_5); // TODO: param_4 should be s16
extern void sub_804216C(Entity *pokemon, Entity *target, u32 r2);
extern void RemoveItemFromDungeonAt(DungeonPos *, u32);
extern void sub_804218C(Entity *pokemon, Entity *target);
EWRAM_INIT u32 gUnknown_203B444[3] = {0x28, 0x28, 0x50};
@ -65,7 +67,6 @@ void sub_8049ED4();
void sub_806A5B8(Entity *);
u8 sub_8045888(Entity *);
void sub_807EC28(u32);
void sub_80694C0(Entity *, s32, s32, s32);
void sub_807D068(Entity *, DungeonPos *);
u8 sub_8044B28(void);
extern void sub_806F370(Entity *pokemon, Entity *target, u32, u32, u8 *, u8 moveType, s32, u32, u32, u32);
@ -74,9 +75,6 @@ void sub_807BB78(Entity *pokemon);
extern void sub_803F580(u32);
bool8 sub_808384C(DungeonPos *, DungeonPos *);
u8 sub_8083660(DungeonPos *);
void AddItemToDungeonAt(DungeonPos *, Item *, u32);
void sub_80462AC(Entity * ,u32, u32, u8, u32);
extern void ShowDungeonMapAtPos(s32, s32);
void BlowAwayTarget(Entity *pokemon, Entity *target, u32 direction)
{

View File

@ -1,5 +1,5 @@
#include "global.h"
#include "dungeon_misc.h"
#include "code_804267C.h"
#include "code_8045A00.h"
#include "dungeon_message.h"
@ -18,10 +18,8 @@ extern u8 UseAttack(Entity *);
extern void sub_805E804(void);
void sub_806A2BC(Entity *pokemon, u8 param_2);
extern u8 sub_8044B28(void);
extern void sub_8068FE0(Entity *, u32, Entity *r2);
extern void nullsub_93(DungeonPos *);
extern void sub_806F370(Entity *pokemon, Entity *target, u32, u32, u8 *, u8 moveType, s32, u32, u32, u32);
extern void sub_80694C0(Entity *, s32, s32, u32);
extern void sub_807EC28(bool8);
extern void sub_806A5B8(Entity *);

View File

@ -26,6 +26,7 @@
#include "code_805D8C8.h"
#include "code_803E668.h"
#include "code_8045A00.h"
#include "dungeon_items.h"
#include "move_util.h"
#include "moves.h"
#include "code_80450F8.h"
@ -33,12 +34,13 @@
#include "constants/ability.h"
#include "constants/monster.h"
#include "constants/type.h"
#include "dungeon_misc.h"
#include "code_807E5AC.h"
extern u8 gUnknown_203B40D;
extern OpenedFile *gUnknown_202ECA0;
extern SpriteOAM gUnknown_202EDC0;
extern void sub_804178C(u32);
extern bool8 RemoveItemFromDungeonAt(DungeonPos *, u32);
extern void sub_80429D8(Entity *r0);
extern s32 GetMonsterApparentID(Entity *pokemon, s32 id);
extern void sub_803E874(bool8 r10, s32 r9);
@ -46,7 +48,6 @@ extern void GetWeatherName(u8 *dst, u8 weatherId);
extern s32 CalculateStatusTurns(Entity *target, const s16 *turnRange, bool8 factorCurerSkills);
extern void sub_80838EC(u8 *a);
extern bool8 sub_8044B28(void);
extern void AddItemToDungeonAt(DungeonPos *, Item *, u32);
void sub_807E7FC(bool8 arg0);
void sub_807EFFC(bool8 arg0);
@ -623,7 +624,6 @@ extern void sub_806A5B8(Entity *);
extern bool8 sub_8045888(Entity *ent);
extern void sub_806F370(Entity *pokemon, Entity *target, u32, u32, u8 *, u8 moveType, s32, u32, u32, u32);
extern void sub_807D068(Entity *, DungeonPos *);
extern void sub_80694C0(Entity *target,s32 x,int y,char param_4);
void sub_807F9BC(Entity *entity);
@ -872,8 +872,6 @@ void sub_807FA18(void)
}
}
extern SpriteOAM gUnknown_202EDC0;
void sub_807FA9C(void)
{
s32 x, y;

View File

@ -5,15 +5,13 @@
#include "dungeon_util.h"
#include "items.h"
#include "code_800DAC0.h"
#include "code_800ED38.h"
#include "structs/sprite_oam.h"
#include "structs/str_dungeon.h"
extern const unkStruct_2039DB0 gUnknown_8107374;
void sub_800EF64(void);
void sub_800EE5C(s32);
void sub_8085F44(s32);
bool8 sub_800E90C(DungeonPos *);
void sub_8088EE8(void);

View File

@ -1,12 +1,14 @@
#include "global.h"
#include "constants/direction.h"
#include "code_80861A8.h"
#include "structs/sprite_oam.h"
#include "code_800DAC0.h"
#include "code_800ED38.h"
#include "code_803E46C.h"
#include "code_803E668.h"
#include "code_806CD90.h"
#include "code_80861A8.h"
#include "dungeon_music.h"
#include "dungeon_util.h"
#include "structs/sprite_oam.h"
extern const unkStruct_2039DB0 gUnknown_8107380;
@ -18,9 +20,6 @@ extern const u8 *gUnknown_810671C[];
static void sub_80861EC(Entity *);
void sub_800EE5C(s32);
void sub_800EF64();
void DungeonRunFrameActions(s32);
s32 sub_800E700(s32);
void sub_800569C(DungeonPos *, axdata *, u8);
void sub_8085F44(s32);

View File

@ -1,9 +1,11 @@
#include "global.h"
#include "file_system.h"
#include "event_flag.h"
#include "code_800558C.h"
#include "code_80A26CC.h"
#include "def_filearchives.h"
#include "event_flag.h"
#include "file_system.h"
#include "text.h"
extern struct FileArchive gSystemFileArchive;
extern const u8 gUnknown_811601C[];
extern u8 gUnknown_20398B8;
@ -60,7 +62,6 @@ void sub_80993E4(void) {
file or spend time decomping so here it is in
asm();
*/
void sub_8099648(void);
NAKED
UNUSED static void sub_80993F0(void)
@ -286,7 +287,7 @@ UNUSED static void sub_80993F0(void)
" bl sub_8099BE4\n"
" bl sub_8099744\n"
" bl sub_8011860\n"
" bl sub_800CB20\n"
" bl WaitForNextFrameAndAdvanceRNG\n"
" bl LoadBufferedInputs\n"
" bl nullsub_120\n"
" bl sub_80A5E70\n"
@ -327,17 +328,18 @@ UNUSED static void sub_80993F0(void)
void sub_809965C(void);
void sub_8099648(void) {
void sub_8099648(void)
{
sub_8003600();
sub_809965C();
}
void nullsub_103(void) {
return;
void nullsub_103(void)
{
}
void sub_809965C(void) {
void sub_809965C(void)
{
OpenedFile *temp;
sub_8099690(0);
@ -347,4 +349,3 @@ void sub_809965C(void) {
sub_800388C(0x1f0, temp->data, 0x10);
CloseFile(temp);
}

View File

@ -1,5 +1,6 @@
#include "global.h"
#include "bg_control.h"
#include "code_800558C.h"
#include "cpu.h"
EWRAM_DATA u32 gUnknown_202D800 = {0};
@ -16,9 +17,6 @@ static EWRAM_INIT u16 sBldCntTable[] = {
(0),
};
extern u16 *gUnknown_2026E3C;
extern u8 gUnknown_2026E38;
void sub_800CDA8(u32 r0)
{
gUnknown_202D800 = r0;
@ -79,10 +77,10 @@ void VBlank_CB(void)
REG_WINOUT = WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR | WINOUT_WIN01_BG3 | WINOUT_WIN01_BG2 | WINOUT_WIN01_BG0;
REG_BLDCNT = gBldCnt;
REG_BLDALPHA = gBldAlpha;
if (gUnknown_2026E38 != 0) {
DmaSet(0, &gUnknown_2026E3C[2], REG_ADDR_WIN0H, 0xA2600002);
REG_WIN0H = gUnknown_2026E3C[0];
REG_WIN1H = gUnknown_2026E3C[1];
if (gUnknown_2026E38) {
DmaSet(0, &gUnknown_2026E3C[1], REG_ADDR_WIN0H, 0xA2600002);
REG_WIN0H = ((u16 *)gUnknown_2026E3C)[0];
REG_WIN1H = ((u16 *)gUnknown_2026E3C)[1];
REG_WIN0V = DISPLAY_HEIGHT;
REG_WIN1V = DISPLAY_HEIGHT;
}

503
src/data/friend_areas_map.h Normal file
View File

@ -0,0 +1,503 @@
#define NO_AREA NUM_FRIEND_AREAS + 5
// ななし means 'without name'
#define DUMMY_LOCATION \
{ \
.name = _("ななし"), \
.pos = { 0, 0 }, \
.areasIds = { NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA }, \
.adjacentLocations = { -1, -1, -1, -1, -1, -1, -1, -1 }, \
}
// The second set is all dummies, maybe it was used for testing purposes?
static const struct FriendAreaLocationInfo sFriendAreaLocations[2][NUM_FRIEND_AREA_LOCATIONS] =
{
{
[LOCATION_MOUNTAIN_RANGE] =
{
.name = "Mountain Range",
.pos = {0x1C5, 0x71},
.areasIds = {MT_DEEPGREEN, MT_CLEFT, MT_MOONVIEW, MT_DISCIPLINE, DARKNESS_RIDGE, RAINBOW_PEAK, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_EASTERN_FOREST,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = LOCATION_MARSH,
[DIRECTION_WEST] = LOCATION_PLAINS,
[DIRECTION_SOUTHWEST] = LOCATION_RIVER,
},
},
[LOCATION_GLACIER] =
{
.name = "Glacier",
.pos = {0x1CD, 0x1C},
.areasIds = {FRIGID_CAVERN, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = LOCATION_NORTHERN_LAKES,
[DIRECTION_SOUTHWEST] = LOCATION_MARSH,
},
},
[LOCATION_PLAINS] =
{
.name = "Plains",
.pos = {0x161, 0x78},
.areasIds = {BEAU_PLAINS, SKY_BLUE_PLAINS, SACRED_FIELD, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_TEAM_BASE,
[DIRECTION_SOUTHEAST] = LOCATION_RIVER,
[DIRECTION_EAST] = 0,
[DIRECTION_NORTHEAST] = LOCATION_MARSH,
[DIRECTION_NORTH] = LOCATION_CAVE,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = LOCATION_POND,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_SOUTH_PLAINS] =
{
.name = "South Plains",
.pos = {0x162, 0x12D},
.areasIds = {SAFARI, WILD_PLAINS, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = LOCATION_BADLANDS,
[DIRECTION_NORTH] = LOCATION_JUNGLE,
[DIRECTION_NORTHWEST] = LOCATION_RELICS,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_BADLANDS] =
{
.name = "Badlands",
.pos = {0x194, 0x102},
.areasIds = {RAVAGED_FIELD, MAGNETIC_QUARRY, THUNDER_MEADOW, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = LOCATION_DESERT,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = LOCATION_EASTERN_LAKES,
[DIRECTION_NORTH] = LOCATION_EASTERN_PONDS,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = LOCATION_JUNGLE,
[DIRECTION_SOUTHWEST] = LOCATION_SOUTH_PLAINS,
},
},
[LOCATION_EASTERN_FOREST] =
{
.name = "Eastern Forest",
.pos = {0x1C7, 0x9D},
.areasIds = {MIST_RISE_FOREST, FLYAWAY_FOREST, OVERGROWN_FOREST, ENERGETIC_FOREST, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_EASTERN_LAKES,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = 0,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = LOCATION_RIVER,
[DIRECTION_SOUTHWEST] = LOCATION_EASTERN_PONDS,
},
},
[LOCATION_WESTERN_FOREST] =
{
.name = "Western Forest",
.pos = {0x108, 0x9D},
.areasIds = {MUSHROOM_FOREST, HEALING_FOREST, TRANSFORM_FOREST, SECRETIVE_FOREST, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_VOLCANO,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = LOCATION_TEAM_BASE,
[DIRECTION_NORTHEAST] = LOCATION_POND,
[DIRECTION_NORTH] = LOCATION_NORTHERN_ISLES,
[DIRECTION_NORTHWEST] = LOCATION_BEACH,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_RIVER] =
{
.name = "River",
.pos = {0x197, 0xA0},
.areasIds = {RUB_A_DUB_RIVER, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_EASTERN_PONDS,
[DIRECTION_SOUTHEAST] = LOCATION_EASTERN_LAKES,
[DIRECTION_EAST] = LOCATION_EASTERN_FOREST,
[DIRECTION_NORTHEAST] = LOCATION_MOUNTAIN_RANGE,
[DIRECTION_NORTH] = LOCATION_MARSH,
[DIRECTION_NORTHWEST] = LOCATION_PLAINS,
[DIRECTION_WEST] = LOCATION_TEAM_BASE,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_EASTERN_PONDS] =
{
.name = "Eastern Ponds",
.pos = {0x198, 0xCF},
.areasIds = {TADPOLE_POND, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_BADLANDS,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = LOCATION_EASTERN_LAKES,
[DIRECTION_NORTHEAST] = LOCATION_EASTERN_FOREST,
[DIRECTION_NORTH] = LOCATION_RIVER,
[DIRECTION_NORTHWEST] = LOCATION_TEAM_BASE,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = LOCATION_JUNGLE,
},
},
[LOCATION_POND] =
{
.name = "Pond",
.pos = {0x133, 0x79},
.areasIds = {TURTLESHELL_POND, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = LOCATION_TEAM_BASE,
[DIRECTION_EAST] = LOCATION_PLAINS,
[DIRECTION_NORTHEAST] = LOCATION_CAVE,
[DIRECTION_NORTH] = LOCATION_RUINS,
[DIRECTION_NORTHWEST] = LOCATION_NORTHERN_ISLES,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = LOCATION_WESTERN_FOREST,
},
},
[LOCATION_NORTHERN_LAKES] =
{
.name = "Northern Lakes",
.pos = {0x182, 0x1D},
.areasIds = {MYSTIC_LAKE, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = LOCATION_MARSH,
[DIRECTION_EAST] = 1,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = LOCATION_RUINS,
[DIRECTION_SOUTHWEST] = LOCATION_CAVE,
},
},
[LOCATION_EASTERN_LAKES] =
{
.name = "Eastern Lakes",
.pos = {0x1C6, 0xD0},
.areasIds = {WATERFALL_LAKE, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = LOCATION_EASTERN_FOREST,
[DIRECTION_NORTHWEST] = LOCATION_RIVER,
[DIRECTION_WEST] = LOCATION_EASTERN_PONDS,
[DIRECTION_SOUTHWEST] = LOCATION_BADLANDS,
},
},
[LOCATION_MARSH] =
{
.name = "Marsh",
.pos = {0x1A2, 0x46},
.areasIds = {PEANUT_SWAMP, POISON_SWAMP, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_RIVER,
[DIRECTION_SOUTHEAST] = LOCATION_MOUNTAIN_RANGE,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = 1,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = LOCATION_NORTHERN_LAKES,
[DIRECTION_WEST] = LOCATION_CAVE,
[DIRECTION_SOUTHWEST] = LOCATION_PLAINS,
},
},
[LOCATION_CAVE] =
{
.name = "Cave",
.pos = {0x160, 0x47},
.areasIds = {ECHO_CAVE, DRAGON_CAVE, BOULDER_CAVE, CRYPTIC_CAVE, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_PLAINS,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = LOCATION_MARSH,
[DIRECTION_NORTHEAST] = LOCATION_NORTHERN_LAKES,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = LOCATION_RUINS,
[DIRECTION_WEST] = LOCATION_NORTHERN_ISLES,
[DIRECTION_SOUTHWEST] = LOCATION_POND,
},
},
[LOCATION_JUNGLE] =
{
.name = "Jungle",
.pos = {0x163, 0x104},
.areasIds = {JUNGLE, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_SOUTH_PLAINS,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = LOCATION_BADLANDS,
[DIRECTION_NORTHEAST] = LOCATION_EASTERN_PONDS,
[DIRECTION_NORTH] = LOCATION_TEAM_BASE,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = LOCATION_RELICS,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_RUINS] =
{
.name = "Ruins",
.pos = {0x136, 0x1C},
.areasIds = {DECREPIT_LAB, POWER_PLANT, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_POND,
[DIRECTION_SOUTHEAST] = LOCATION_CAVE,
[DIRECTION_EAST] = LOCATION_NORTHERN_LAKES,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = LOCATION_NORTHERN_SEA,
[DIRECTION_SOUTHWEST] = LOCATION_NORTHERN_ISLES,
},
},
[LOCATION_VOLCANO] =
{
.name = "Volcano",
.pos = {0x107, 0xCB},
.areasIds = {SCORCHED_PLAINS, CRATER, VOLCANIC_PIT, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = LOCATION_RELICS,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = LOCATION_TEAM_BASE,
[DIRECTION_NORTH] = LOCATION_WESTERN_FOREST,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = LOCATION_SOUTHERN_SEA,
},
},
[LOCATION_DESERT] =
{
.name = "Desert",
.pos = {0x1C4, 0x12D},
.areasIds = {FURNACE_DESERT, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = LOCATION_BADLANDS,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_RELICS] =
{
.name = "Relics",
.pos = {0x131, 0x105},
.areasIds = {ANCIENT_RELIC, AGED_CHAMBER_AN, AGED_CHAMBER_O_EXCLAIM, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = LOCATION_SOUTH_PLAINS,
[DIRECTION_EAST] = LOCATION_JUNGLE,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = LOCATION_VOLCANO,
[DIRECTION_WEST] = LOCATION_SOUTHERN_SEA,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_SKY] =
{
.name = "Sky",
.pos = {0x2F, 0x15},
.areasIds = {STRATOS_LOOKOUT, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_WESTERN_ISLES,
[DIRECTION_SOUTHEAST] = LOCATION_BEACH,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_NORTHERN_ISLES] =
{
.name = "Northern Isles",
.pos = {0x107, 0x47},
.areasIds = {LEGENDARY_ISLAND, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = 6,
[DIRECTION_SOUTHEAST] = 9,
[DIRECTION_EAST] = 0xD,
[DIRECTION_NORTHEAST] = 0xF,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = 0x18,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_SOUTHERN_ISLES] =
{
.name = "Southern Isles",
.pos = {0x5D, 0x10C},
.areasIds = {SOUTHERN_ISLAND, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = LOCATION_SOUTHERN_SEA,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = LOCATION_SOUTHWEST_ISLES,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_SOUTHWEST_ISLES] =
{
.name = "Southwest Isles",
.pos = {0x2D, 0xCB},
.areasIds = {ENCLOSED_ISLAND, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = LOCATION_SOUTHERN_ISLES,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = LOCATION_WESTERN_ISLES,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_WESTERN_ISLES] =
{
.name = "Western Isles",
.pos = {0x2D, 0x70},
.areasIds = {FINAL_ISLAND, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_SOUTHWEST_ISLES,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = LOCATION_BEACH,
[DIRECTION_NORTH] = LOCATION_SKY,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_NORTHERN_SEA] =
{
.name = "Northern Sea",
.pos = {0xD0, 0x16},
.areasIds = {BOUNTIFUL_SEA, SERENE_SEA, DEEP_SEA_CURRENT, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = LOCATION_NORTHERN_ISLES,
[DIRECTION_EAST] = LOCATION_RUINS,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = LOCATION_BEACH,
},
},
[LOCATION_SOUTHERN_SEA] =
{
.name = "Southern Sea",
.pos = {0xB2, 0x10D},
.areasIds = {TREASURE_SEA, DEEP_SEA_FLOOR, SEAFLOOR_CAVE, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = LOCATION_RELICS,
[DIRECTION_NORTHEAST] = LOCATION_VOLCANO,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = LOCATION_SOUTHERN_ISLES,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_BEACH] =
{
.name = "Beach",
.pos = {0x81, 0x42},
.areasIds = {SHALLOW_BEACH, ICE_FLOE_BEACH, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = LOCATION_WESTERN_FOREST,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = LOCATION_NORTHERN_SEA,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = LOCATION_SKY,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = LOCATION_WESTERN_ISLES,
},
},
[LOCATION_TEAM_BASE] =
{
.name = _("$t"),
.pos = {0x163, 0xA1},
.areasIds = {FRIEND_AREA_NONE, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_JUNGLE,
[DIRECTION_SOUTHEAST] = LOCATION_EASTERN_PONDS,
[DIRECTION_EAST] = LOCATION_RIVER,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = LOCATION_PLAINS,
[DIRECTION_NORTHWEST] = LOCATION_POND,
[DIRECTION_WEST] = LOCATION_WESTERN_FOREST,
[DIRECTION_SOUTHWEST] = LOCATION_VOLCANO,
},
},
[LOCATION_UNUSED_28] = DUMMY_LOCATION,
[LOCATION_UNUSED_29] = DUMMY_LOCATION,
[LOCATION_UNUSED_30] = DUMMY_LOCATION,
[LOCATION_UNUSED_31] = DUMMY_LOCATION,
},
{
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
}
};

View File

@ -1,7 +1,4 @@
#include <stdarg.h>
#include <stdio.h>
#include "gba/gba.h"
#include "config.h"
#include "global.h"
#include "debug.h"
extern void Hang();

View File

@ -1,15 +1,16 @@
#include "global.h"
#include "dungeon.h"
#include "code_800D090.h"
#include "pokemon.h"
#include "moves.h"
#include "random.h"
#include "code_8092334.h"
#include "pokemon_mid.h"
#include "string_format.h"
#include "constants/dungeon.h"
#include "constants/type.h"
#include "constants/monster.h"
#include "constants/type.h"
#include "code_800D090.h"
#include "code_8092334.h"
#include "dungeon.h"
#include "items.h"
#include "moves.h"
#include "pokemon.h"
#include "pokemon_mid.h"
#include "random.h"
#include "string_format.h"
extern const char gUnknown_8108F10[];
extern const char gUnknown_8108F18[];
@ -42,11 +43,8 @@ extern u8 *gUnknown_8115E28[];
extern u8 *gUnknown_8115E80[];
extern u8 gUnknown_8108F50[];
void sub_80901D8(DungeonLocation *param_1,DungeonLocation *param_2);
s32 sub_8091E94(s32 a1, s32 a2, s32 a3); // items.c
void sub_8090888(u8 *param_1, u8 *param_2);
bool8 sub_8090820(u16 moveID);
s32 GetItemPossessionCount(u8 id);
static void sub_8090888(u8 *param_1, u8 *param_2);
static bool8 sub_8090820(u16 moveID);
const u8 *GetDungeonName1(u8 dungeon)
{
@ -204,6 +202,7 @@ static inline void AddNewLine(const u8 *str, u8 *buffer, u8 *newLine)
FormatString(str, buffer, newLine, 0);
}
// I think this checks if the dungeon HM requirement is met
u32 sub_809034C(u8 dungeonIndex, s32 speciesId_, u8 *buffer, bool32 param_4_, bool32 param_5_)
{
s32 maxPartyMembers, i;
@ -384,7 +383,7 @@ u32 sub_809034C(u8 dungeonIndex, s32 speciesId_, u8 *buffer, bool32 param_4_, bo
}
}
bool8 sub_8090820(u16 moveID)
static bool8 sub_8090820(u16 moveID)
{
s32 speciesId, moveIndex;
@ -402,7 +401,7 @@ bool8 sub_8090820(u16 moveID)
return FALSE;
}
void sub_8090888(u8 *param_1, u8 *param_2)
static void sub_8090888(u8 *param_1, u8 *param_2)
{
s32 iVar3 = 0;

View File

@ -5,6 +5,7 @@
#include "code_8041AD0.h"
#include "code_804267C.h"
#include "code_8045A00.h"
#include "code_8066D04.h"
#include "dungeon_message.h"
#include "code_8077274_1.h"
#include "code_807CD9C.h"
@ -32,6 +33,7 @@
#include "status_checks_1.h"
#include "trap.h"
#include "dungeon_config.h"
#include "dungeon_misc.h"
extern u8 gUnknown_202F221;
extern u8 gUnknown_202F222;
@ -73,12 +75,10 @@ void HandleGiveItemAction(Entity *);
void HandleTakeItemAction(Entity *);
void HandleUseItemAction(Entity *);
void sub_8066FA4(Entity *);
void HandleSetItemAction(Entity *,bool8);
void HandleUnsetItemAction(Entity *,bool8);
extern u8 sub_8044B28(void);
extern u8 UseAttack(Entity *);
void sub_806A1E8(Entity *pokemon);
extern void sub_80694C0(Entity *, s32, s32, u32);
bool8 sub_804AE08(DungeonPos *pos);
void HandlePickUpAIAction(Entity *pokemon);
void HandleThrowItemAIAction(Entity *pokemon);

View File

@ -18,6 +18,7 @@
#include "dungeon_map_access.h"
#include "dungeon_message.h"
#include "dungeon_music.h"
#include "dungeon_misc.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_random.h"
#include "dungeon_util_1.h"
@ -363,7 +364,6 @@ struct Zapdos2
extern const struct Zapdos1 gUnknown_810744C;
extern struct Zapdos2 gUnknown_8107464;
extern void sub_8068FE0(Entity *, u32, u32);
extern void sub_8042B0C(Entity *);
extern u8 sub_806FD18(Entity *);
extern void sub_806FDF4(Entity *, Entity *, Entity **);

View File

@ -1,4 +1,5 @@
#include "global.h"
#include "def_filearchives.h"
#include "dungeon_generation.h"
#include "file_system.h"
#include "tile_types.h"
@ -17,11 +18,10 @@
#include "structs/map.h"
#include "structs/str_806B7F8.h"
#include "dungeon_config.h"
#include "dungeon_items.h"
extern const u8 gUnknown_80F6DCC[];
extern struct FileArchive gDungeonFileArchive;
extern void AddItemToDungeonAt(DungeonPos *, Item *, u32);
extern s32 sub_803DA20(s16 species);
extern void sub_8049840(void);
extern void sub_80429FC(DungeonPos *r0);

View File

@ -26,6 +26,7 @@
#include "math.h"
#include "code_80450F8.h"
#include "structs/str_item_text.h"
#include "code_803E46C.h"
extern SpriteOAM gUnknown_202EDC0;
@ -56,7 +57,6 @@ extern void sub_80855E4(void *);
extern void PlaySoundEffect(u32);
extern void sub_804178C(u32);
extern void sub_804219C(PixelPos *pos);
extern void DungeonRunFrameActions(u32);
extern bool8 sub_8045888(Entity *);
extern u32 GetRandomFloorItem(u32);

View File

@ -20,11 +20,13 @@
#include "code_8045A00.h"
#include "string_format.h"
#include "code_803E46C.h"
#include "code_803E724.h"
#include "code_801602C.h"
#include "code_800D090.h"
#include "trap.h"
#include "charge_move.h"
#include "dungeon_map_access.h"
#include "dungeon_misc.h"
#include "status_checks_1.h"
#include "game_options.h"
#include "weather.h"
@ -41,6 +43,7 @@
#include "pokemon_3.h"
#include "text.h"
#include "code_806CD90.h"
#include "code_8066D04.h"
#include "code_8044CC8.h"
#include "code_801B3C0.h"
#include "dungeon_capabilities.h"
@ -58,13 +61,11 @@
#include "structs/struct_sub80095e4.h"
#include "structs/str_text.h"
extern void HandleSetItemAction(Entity *,bool8);
extern void HandleUnsetItemAction(Entity *,bool8);
extern bool8 sub_8048A68(Entity *param_1,Item *item);
extern bool8 sub_8048950(Entity *param_1,Item *item);
extern bool8 sub_8048B9C(Entity *param_1,Item *item);
extern Item *sub_8044D90(Entity *, s32, u32);
extern void PlayDungeonStartButtonSE(void);
extern void PlayDungeonCancelSE(void);
extern void PlayDungeonConfirmationSE(void);
extern void sub_806A6E8(Entity *);
@ -95,13 +96,10 @@ extern bool8 sub_8071A8C(Entity *pokemon);
extern void GetWeatherName(u8 *dst, u8 weatherId);
extern bool8 sub_8070F14(Entity * pokemon, s32 direction);
extern Entity *sub_80696A8(Entity *a0);
extern u8 sub_806A538(s32);
extern void sub_803EAF0(u32, u8 *);
extern void sub_803F508(Entity *);
extern void sub_8041AD0(Entity *pokemon);
extern void sub_8041AE0(Entity *pokemon);
extern void sub_807EC28(bool8);
extern void PlayDungeonCursorSE(u8 param_1);
extern const u8 *GetCurrentDungeonName(void);
extern Entity *gLeaderPointer;
@ -1637,10 +1635,10 @@ static void PrintOnMainMenu(bool8 printAll)
}
}
bool8 DungeonGiveNameToRecruitedMon(u8 *a0)
bool8 DungeonGiveNameToRecruitedMon(u8 *name)
{
s32 r4;
sub_803EAF0(8, a0);
sub_803EAF0(8, name);
do
{
DungeonRunFrameActions(0xE);
@ -1650,7 +1648,7 @@ bool8 DungeonGiveNameToRecruitedMon(u8 *a0)
CleanConfirmNameMenu();
DungeonRunFrameActions(0xE);
sub_803EAF0(0, NULL);
if (r4 == 3 && *a0 != 0)
if (r4 == 3 && *name != '\0')
return TRUE;
return FALSE;

View File

@ -1,5 +1,6 @@
#include "global.h"
#include "globaldata.h"
#include "def_filearchives.h"
#include "dungeon_map.h"
#include "structs/dungeon_entity.h"
#include "structs/str_dungeon.h"
@ -19,7 +20,6 @@
#include "constants/dungeon.h"
#include "constants/trap.h"
extern struct FileArchive gDungeonFileArchive;
extern DungeonPos gPlayerDotMapPosition;
extern s32 gUnknown_202EDD0;

View File

@ -1,20 +1,22 @@
#include "global.h"
#include "dungeon_map_access.h"
#include "code_8004AA0.h"
#include "constants/walkable_tile.h"
#include "decompress.h"
#include "dungeon_map_access.h"
#include "structs/str_dungeon.h"
#include "tile_types.h"
#include "code_8042B34.h"
#include "code_8004AA0.h"
#include "code_8009804.h"
#include "decompress.h"
#include "def_filearchives.h"
#include "dungeon_engine.h"
#include "dungeon_leader.h"
#include "dungeon_map.h"
#include "dungeon_map_access.h"
#include "dungeon_movement.h"
#include "dungeon_util.h"
#include "dungeon_visibility.h"
#include "game_options.h"
#include "random.h"
#include "text.h"
#include "dungeon_engine.h"
#include "dungeon_movement.h"
#include "dungeon_leader.h"
#include "dungeon_util.h"
#include "code_8009804.h"
#include "game_options.h"
#include "dungeon_visibility.h"
#include "tile_types.h"
extern const Tile gOtherOobTile;
extern const Tile gWaterOobTile;
@ -25,7 +27,6 @@ extern u8 gUnknown_80F6A1C[];
extern u8 gUnknown_80F6A34[];
extern u8 gUnknown_80F6A40[];
extern u8 gUnknown_8108EC0[];
extern const struct FileArchive gDungeonFileArchive;
extern const s16 gUnknown_80F6A4A[];
extern const s16 gUnknown_80F6C06[];
@ -36,10 +37,6 @@ EWRAM_DATA Tile gOutOfBoundsTileData = {0};
EWRAM_INIT const Tile *gCurTilesetOobTile = {NULL};
extern u8 sub_8043CE4(u32);
extern void ShowDungeonMapAtPos(s32, s32);
extern int sprintf(char *, const char *, ...);
const Tile *GetTile(s32 x, s32 y)
{
if (x >= 0 && y >= 0 && x < DUNGEON_MAX_SIZE_X && y < DUNGEON_MAX_SIZE_Y)

View File

@ -18,6 +18,7 @@
#include "code_8045A00.h"
#include "string_format.h"
#include "code_803E46C.h"
#include "code_803E724.h"
#include "trap.h"
#include "dungeon_map_access.h"
#include "status_checks_1.h"
@ -30,7 +31,6 @@
#include "code_801B3C0.h"
#include "dungeon_capabilities.h"
extern void PlayDungeonStartButtonSE(void);
extern void PlayDungeonCancelSE(void);
extern void PlayDungeonConfirmationSE(void);
extern void sub_806A2BC(Entity *a0, u8 a1);
@ -40,21 +40,16 @@ extern Item *sub_8044D90(Entity *, s32, u32);
extern bool8 sub_8070F14(Entity * pokemon, s32 direction);
bool8 sub_805EC2C(Entity *a0, s32 x, s32 y);
extern Entity *sub_80696A8(Entity *a0);
extern u8 sub_806A538(s32);
extern void sub_803EAF0(u32, u8 *);
extern void sub_803F508(Entity *);
extern void sub_8041AD0(Entity *pokemon);
extern void sub_8041AE0(Entity *pokemon);
extern void sub_807EC28(bool8);
extern void PlayDungeonCursorSE(u8 param_1);
extern u8 *GetDungeonSubMenuItemString(s32 param_1);
extern bool8 CanSubMenuItemBeChosen(s32 param_1);
extern s32 gDungeonSubMenuItemsCount;
extern const u8 gUnknown_8106B50[];
extern void DungeonShowWindows(WindowTemplates *a0, u8 a1);
extern Item * sub_8044CC8(Entity *param_1, ActionParameter *param_2, UNUSED s32 a3);
extern void AddActionToDungeonSubMenu(u16 param_1, u8 param_2);
extern void SetActionUnusableInDungeonSubMenu(u16 param_1);
extern u16 sub_8044DC8(Item *param_1);
extern bool8 sub_8046F00(Item *item);
extern void sub_8045064(void);
@ -349,7 +344,7 @@ bool8 ShowDungeonItemsMenu(Entity * a0, struct UnkMenuBitsStruct *a1)
// Hm...
int newAction = sUnknownActionUnk4.actionUseIndex - 0x90;
a0Info->action.actionParameters[0].actionUseIndex = newAction;
sub_803EAF0(0, 0);
sub_803EAF0(0, NULL);
inputAction = 0;
break;
}
@ -357,7 +352,7 @@ bool8 ShowDungeonItemsMenu(Entity * a0, struct UnkMenuBitsStruct *a1)
s32 teamId;
if (ShowDungeonToWhichMonMenu(&teamId, WHICH_MENU_ITEMS) != NULL) {
a0Info->action.actionParameters[1].actionUseIndex = teamId;
sub_803EAF0(0, 0);
sub_803EAF0(0, NULL);
inputAction = 0;
break;
}
@ -365,7 +360,7 @@ bool8 ShowDungeonItemsMenu(Entity * a0, struct UnkMenuBitsStruct *a1)
SetLeaderActionToNothing(1);
}
else {
sub_803EAF0(0, 0);
sub_803EAF0(0, NULL);
inputAction = 0;
break;
}

View File

@ -17,6 +17,7 @@
#include "code_8045A00.h"
#include "string_format.h"
#include "code_803E46C.h"
#include "code_803E724.h"
#include "status_checks_1.h"
#include "dungeon_leader.h"
#include "tile_types.h"
@ -28,17 +29,12 @@
#include "code_8044CC8.h"
#include "move_util.h"
extern void PlayDungeonStartButtonSE(void);
extern void PlayDungeonCancelSE(void);
extern void PlayDungeonConfirmationSE(void);
extern void PlayDungeonCursorSE(u8 param_1);
extern u8 *GetDungeonSubMenuItemString(s32 param_1);
extern bool8 CanSubMenuItemBeChosen(s32 param_1);
extern void sub_8045064(void);
extern void sub_803EAF0(u32, u8 *);
extern void sub_803E708(s32 a0, s32 a1);
extern void AddActionToDungeonSubMenu(u16 param_1, u8 param_2);
extern void SetActionUnusableInDungeonSubMenu(u16 param_1);
extern void DungeonShowWindows(WindowTemplates *a0, u8 a1);
extern s32 GetTeamMemberEntityIndex(Entity *pokemon);
extern void ChangeDungeonCameraPos(DungeonPos *pos, s32 a1, u8 a2, u8 a3);
@ -712,7 +708,7 @@ static void ShowMovesInfoWindow(Move *moves, s32 firstMoveId, s32 movesCount)
}
}
sub_803EAF0(0, 0);
sub_803EAF0(0, NULL);
}
static const WindowHeader sStatusDescriptionHeader = {
@ -1005,7 +1001,7 @@ bool8 sub_8063E70(Entity *entity, Move *moves, bool8 showYesNoBox, bool8 allowBP
sChosenMoveSlotId = gDungeonMenu.menuIndex;
if (inputAction == 2) {
sub_803EAF0(0, 0);
sub_803EAF0(0, NULL);
sub_803E708(8, 0x1B);
ASM_MATCH_TRICK(sChosenMoveSlotId);
ShowMovesInfoWindow(moves, sChosenMoveSlotId, MAX_MON_MOVES);
@ -1050,7 +1046,7 @@ bool8 sub_8063E70(Entity *entity, Move *moves, bool8 showYesNoBox, bool8 allowBP
AddMenuCursorSprite(&gDungeonMenu);
DungeonRunFrameActions(0x1b);
sub_803EAF0(0, 0);
sub_803EAF0(0, NULL);
if (inputAction == 1)
continue;
if (gDungeonMenu.menuIndex == 1) {

View File

@ -7,6 +7,8 @@
#include "text.h"
#include "menu_input.h"
#include "input.h"
#include "code_803D110.h"
#include "code_803E724.h"
#include "code_8044CC8.h"
#include "dungeon_action.h"
#include "dungeon_util.h"
@ -19,21 +21,16 @@
#include "post_office_guide2.h"
#include "dungeon_main.h"
#include "dungeon_map.h"
#include "dungeon_music.h"
#include "code_803E46C.h"
extern void PlayDungeonStartButtonSE(void);
extern void PlayDungeonCancelSE(void);
extern void PlayDungeonConfirmationSE(void);
extern void PlayDungeonCursorSE(u8 param_1);
extern void sub_803EAF0(u32, u8 *);
extern bool8 CanSubMenuItemBeChosen(s32 param_1);
extern void DungeonRunFrameActions(u32 a0);
extern void DungeonShowWindows(WindowTemplates *a0, bool8 a1);
extern void AddActionToDungeonSubMenu(u16 actionId, u8 param_2);
extern void sub_8045064(void);
extern bool8 IsBossFight(void);
extern u16 GetLeaderActionId(void);
extern void sub_803E13C(void);
extern void sub_8083AB0(s16 param_0, Entity * target, Entity * entity);
extern MenuInputStruct gDungeonMenu;

View File

@ -1,5 +1,8 @@
#include "global.h"
#include "globaldata.h"
#include "code_800D090.h"
#include "code_803E46C.h"
#include "code_803E724.h"
#include "dungeon_menu_recruitment.h"
#include "dungeon.h"
#include "text.h"
@ -10,19 +13,14 @@
#include "pokemon_3.h"
#include "sprite.h"
#include "exclusive_pokemon.h"
#include "dungeon_music.h"
extern void PlayDungeonStartButtonSE(void);
extern void PlayDungeonCancelSE(void);
extern void PlayDungeonConfirmationSE(void);
extern void PlayDungeonCursorSE(u8 param_1);
extern void sub_803EAF0(u32, u8 *);
extern bool8 CanSubMenuItemBeChosen(s32 param_1);
extern void DungeonRunFrameActions(u32 a0);
extern void DungeonShowWindows(const WindowTemplates *a0, bool8 a1);
extern void AddActionToDungeonSubMenu(u16 actionId, u8 param_2);
extern u16 GetLeaderActionId(void);
extern u32 sub_8014140(s32 a0, const void *a1);
extern void sprintfStatic(char *buffer, const char *text, ...);
extern u8 sub_806F9BC(s32);
extern bool8 sub_80860A8(u8 id);
extern bool8 sub_806A564(s32 r0);

View File

@ -1,5 +1,8 @@
#include "global.h"
#include "globaldata.h"
#include "code_803E46C.h"
#include "code_803E724.h"
#include "code_8044CC8.h"
#include "dungeon_menu_stairs.h"
#include "dungeon_menu_team.h"
#include "dungeon_menu_moves.h"
@ -8,23 +11,18 @@
#include "text.h"
#include "menu_input.h"
#include "input.h"
#include "code_8044CC8.h"
#include "dungeon_action.h"
#include "dungeon_util.h"
#include "dungeon_map_access.h"
#include "code_8045A00.h"
#include "code_8097DD0.h"
#include "dungeon_generation.h"
#include "dungeon_music.h"
extern void PlayDungeonStartButtonSE(void);
extern void PlayDungeonCancelSE(void);
extern void PlayDungeonConfirmationSE(void);
extern void PlayDungeonCursorSE(u8 param_1);
extern void sub_803EAF0(u32, u8 *);
extern bool8 CanSubMenuItemBeChosen(s32 param_1);
extern void DungeonRunFrameActions(u32 a0);
extern void DungeonShowWindows(WindowTemplates *a0, bool8 a1);
extern void AddActionToDungeonSubMenu(u16 actionId, u8 param_2);
extern void sub_8045064(void);
extern u8 GetFloorType(void);
@ -120,7 +118,7 @@ void ShowDungeonStairsMenu(Entity *mon)
break;
}
sub_803EAF0(0, 0);
sub_803EAF0(0, NULL);
}
static void ShowAndPrintOnStairsMenu(DungeonPos *pos, WindowTemplates *windows, WindowHeader *header)
@ -238,6 +236,5 @@ static void ShowStairsDescription(DungeonPos *pos)
}
}
sub_803EAF0(0, 0);
sub_803EAF0(0, NULL);
}

View File

@ -17,10 +17,12 @@
#include "moves.h"
#include "items.h"
#include "dungeon_music.h"
#include "dungeon_misc.h"
#include "dungeon_ai_movement.h"
#include "code_8045A00.h"
#include "string_format.h"
#include "code_803E46C.h"
#include "code_803E724.h"
#include "code_801602C.h"
#include "code_800D090.h"
#include "dungeon_map_access.h"
@ -50,10 +52,8 @@ extern bool8 sub_8048A68(Entity *param_1,Item *item);
extern bool8 sub_8048950(Entity *param_1,Item *item);
extern bool8 sub_8048B9C(Entity *param_1,Item *item);
extern Item *sub_8044D90(Entity *, s32, u32);
extern void PlayDungeonStartButtonSE(void);
extern void PlayDungeonCancelSE(void);
extern void PlayDungeonConfirmationSE(void);
extern void PlayDungeonCursorSE(u8 param_1);
extern void sub_806A6E8(Entity *);
extern void HandleTrap(Entity *pokemon, DungeonPos *pos, int param_3, char param_4);
bool8 sub_807EF48(void);
@ -98,8 +98,6 @@ extern bool8 ShowDungeonMovesMenu(Entity * entity, u8 a1, u8 a2, s32 a3, s32 a4)
extern bool8 sub_8070F14(Entity * pokemon, s32 direction);
bool8 sub_805EC2C(Entity *a0, s32 x, s32 y);
extern Entity *sub_80696A8(Entity *a0);
extern u8 sub_806A538(s32);
extern void sub_803EAF0(u32, u8 *);
extern void sub_803F508(Entity *);
extern void sub_8041AD0(Entity *pokemon);
extern void sub_8041AE0(Entity *pokemon);
@ -110,8 +108,6 @@ extern s32 gDungeonSubMenuItemsCount;
extern const u8 gUnknown_8106B50[];
extern void DungeonShowWindows(WindowTemplates *a0, u8 a1);
extern Item * sub_8044CC8(Entity *param_1, ActionParameter *param_2, UNUSED s32 a3);
extern void AddActionToDungeonSubMenu(u16 actionId, u8 param_2);
extern void SetActionUnusableInDungeonSubMenu(u16 param_1);
extern u16 sub_8044DC8(Item *param_1);
extern bool8 sub_8046F00(Item *item);
extern void sub_8045064(void);
@ -123,7 +119,6 @@ extern u32 sub_8014140(s32 a0, const void *a1);
extern char* sub_808E4FC(s32 a1);
extern char* sub_808E51C(s32 a1);
extern void sub_8045C18(u8 *buffer, Item *item);
extern bool32 sub_8069D18(DungeonPos *a0, Entity *a1);
extern u8 gUnknown_202EE00;
extern Entity *gLeaderPointer;
@ -1557,7 +1552,7 @@ Entity *ShowDungeonToWhichMonMenu(s32 *teamId, s32 caseId)
DungeonRunFrameActions(0x1B);
sub_804AA60();
sub_806A2BC(GetLeader(), 0);
sub_803EAF0(0, 0);
sub_803EAF0(0, NULL);
sub_803E708(4, 0x3E);
if (bPress) {
return NULL;

View File

@ -1,5 +1,7 @@
#include "global.h"
#include "globaldata.h"
#include "code_803E46C.h"
#include "code_803E724.h"
#include "dungeon_menu_tile.h"
#include "dungeon_menu_team.h"
#include "dungeon_menu_moves.h"
@ -15,16 +17,12 @@
#include "code_8045A00.h"
#include "trap.h"
#include "code_8097DD0.h"
#include "dungeon_music.h"
extern void PlayDungeonStartButtonSE(void);
extern void PlayDungeonCancelSE(void);
extern void PlayDungeonConfirmationSE(void);
extern void PlayDungeonCursorSE(u8 param_1);
extern void sub_803EAF0(u32, u8 *);
extern bool8 CanSubMenuItemBeChosen(s32 param_1);
extern void DungeonRunFrameActions(u32 a0);
extern void DungeonShowWindows(WindowTemplates *a0, bool8 a1);
extern void AddActionToDungeonSubMenu(u16 actionId, u8 param_2);
extern void sub_8045064(void);
extern MenuInputStruct gDungeonMenu;
@ -115,7 +113,7 @@ void ShowDungeonTileMenu(Entity *mon)
break;
}
sub_803EAF0(0, 0);
sub_803EAF0(0, NULL);
}
static void ShowAndPrintOnTileMenu(DungeonPos *pos, WindowTemplates *windows, WindowHeader *header)
@ -237,5 +235,5 @@ static void ShowTileDescription(DungeonPos *pos)
}
}
sub_803EAF0(0, 0);
sub_803EAF0(0, NULL);
}

View File

@ -21,6 +21,7 @@
#include "exclusive_pokemon.h"
#include "dungeon_leader.h"
#include "text.h"
#include "dungeon_music.h"
void sub_80526D0(s32 r0);
static void PutStringsOnMessageLog(void);
@ -33,14 +34,12 @@ static bool8 sub_8052DC0(Entity *);
extern bool8 sub_8045888(Entity *pokemon);
extern void sub_805E804(void);
extern void sub_803EAF0(s32, s32);
extern void sub_8083E28(void);
extern u32 sub_8014140(s32 a0, const void *a1);
extern void PlayDungeonCancelSE(void);
extern void PlayDungeonConfirmationSE(void);
extern void sub_8007334(s32 a0);
extern void sub_80087EC(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4);
extern void PlayDungeonCursorSE(u8 param_1);
extern u32 gUnknown_202EDD0;
extern u8 gUnknown_203B40C;
@ -88,7 +87,7 @@ void sub_8052210(bool8 a0)
gDungeon->unk1BDD4.unk1C06C = 0;
if (a0 && gUnknown_202EDD0 == 3) {
sub_803EAF0(0, 0);
sub_803EAF0(0, NULL);
DungeonRunFrameActions(11);
}
}
@ -233,7 +232,7 @@ void xxx_draw_string_80524F0(void)
case 1:
if (sub_800EC74())
break;
sub_803EAF0(3, 0);
sub_803EAF0(3, NULL);
// fall through
case 2: {
struct UnkDrawStringStruct sp;
@ -292,7 +291,7 @@ void xxx_draw_string_80524F0(void)
if (strPtr->unk1C05E == 0 && strPtr->unk1C064 != 0 && --strPtr->unk1C064 == 0) {
strPtr->unk1C06C = 0;
sub_803EAF0(0, 0);
sub_803EAF0(0, NULL);
sub_8052210(FALSE);
}
}
@ -343,7 +342,7 @@ void DisplayDungeonMessage(struct MonDialogueSpriteInfo *monSpriteInfo, const u8
sub_8052740(10);
}
sub_803EAF0(2, 0);
sub_803EAF0(2, NULL);
sub_8052210(FALSE);
monPortraitPtr = NULL;
@ -377,10 +376,10 @@ void DisplayDungeonMessage(struct MonDialogueSpriteInfo *monSpriteInfo, const u8
sub_805E804();
LoadDungeonMapPalette();
if (gShowDungeonMap) {
sub_803EAF0(0, 0);
sub_803EAF0(0, NULL);
}
else {
sub_803EAF0(1, 0);
sub_803EAF0(1, NULL);
}
}
@ -496,7 +495,7 @@ void DisplayDungeonDialogue(const struct DungeonDialogueStruct *dialogueInfo)
}
sub_8052740(10);
sub_803EAF0(2, 0);
sub_803EAF0(2, NULL);
sub_8052210(FALSE);
CreateDialogueBoxAndPortrait(dialogueInfo->str, 0, monPortraitPtr, gUnknown_80F7AEA[dialogueInfo->unk0]);
PRINT_STRING_WAIT_PRESS(&chosenMenuIndex);
@ -507,7 +506,7 @@ void DisplayDungeonDialogue(const struct DungeonDialogueStruct *dialogueInfo)
if (dialogueInfo->unk0 != 1 && dialogueInfo->unk0 != 3) {
LoadDungeonMapPalette();
sub_803EAF0(0, 0);
sub_803EAF0(0, NULL);
}
sub_803E708(8, 9);
}
@ -518,7 +517,7 @@ bool32 DisplayDungeonYesNoMessage(struct MonDialogueSpriteInfo *monSpriteInfo, c
s32 chosenMenuIndex;
sub_8052740(10);
sub_803EAF0(2, 0);
sub_803EAF0(2, NULL);
sub_8052210(FALSE);
monPortraitPtr = NULL;
@ -553,7 +552,7 @@ bool32 DisplayDungeonYesNoMessage(struct MonDialogueSpriteInfo *monSpriteInfo, c
}
LoadDungeonMapPalette();
sub_803EAF0(0, 0);
sub_803EAF0(0, NULL);
if (chosenMenuIndex == 1)
return TRUE;
@ -567,7 +566,7 @@ s32 DisplayDungeonMenuMessage(struct MonDialogueSpriteInfo *monSpriteInfo, const
s32 chosenMenuIndex;
sub_8052740(10);
sub_803EAF0(2, 0);
sub_803EAF0(2, NULL);
sub_8052210(FALSE);
monPortraitPtr = NULL;
@ -596,7 +595,7 @@ s32 DisplayDungeonMenuMessage(struct MonDialogueSpriteInfo *monSpriteInfo, const
}
LoadDungeonMapPalette();
sub_803EAF0(0, 0);
sub_803EAF0(0, NULL);
return chosenMenuIndex;
}
@ -860,7 +859,7 @@ bool32 DisplayMessageLog(void)
MenuInputStructSub menuInput;
sub_801317C(&menuInput);
sub_803EAF0(9, 0);
sub_803EAF0(9, NULL);
do {
DungeonRunFrameActions(13);
unkRet = sub_8008D8C(0);
@ -906,7 +905,7 @@ bool32 DisplayMessageLog(void)
}
}
sub_803EAF0(0, 0);
sub_803EAF0(0, NULL);
return TRUE;
}

View File

@ -1,6 +1,7 @@
#include "global.h"
#include "globaldata.h"
#include "dungeon_misc.h"
#include "dungeon_music.h"
#include "structs/str_dungeon.h"
#include "dungeon_util.h"
#include "dungeon_util_1.h"
@ -45,17 +46,16 @@
#include "position_util.h"
#include "dungeon_ai_movement.h"
#include "code_803E46C.h"
#include "def_filearchives.h"
#include "code_803D110.h"
static void EnsureCastformLoaded(void);
static void EnsureDeoxysLoaded(void);
extern s32 sprintf(char *, const char *, ...);
extern bool8 IsLevelResetTo1(u8 dungeon);
extern void xxx_pokemonstruct_index_to_pokemon2_808DE30(void* r0, u32 r1);
extern void DeletePokemonDungeonSprite(s32 id);
extern void sub_803E178(void);
extern void sub_806C264(s32 teamIndex, EntityInfo *entInfo);
extern void sub_8083AB0(s16 param_0, Entity * target, Entity * entity);
extern bool8 sub_806A58C(s16 r0);
extern void sub_8084E00(Entity *entity, u8 param_2, u8 param_3);
extern void sub_8078084(Entity * pokemon);
@ -88,8 +88,6 @@ extern s32 sub_803DA20(s32 param_1);
extern s32 gDungeonFramesCounter;
extern void sub_800F958(s32 dungeonSpriteID, DungeonPos *pos, DungeonPos *statusOffsets, u32 a3);
extern void sub_8005700(DungeonPos *a0, struct axObject *a1);
extern u32 EntityGetStatusSprites(Entity *entity);
extern void UpdateDungeonPokemonSprite(int id, short species, int status, char visible);
extern void sub_8042EC8(Entity *a0, s32 a1);
extern Entity *sub_804550C(s16 a);
extern Entity *sub_80453AC(s16 id);
@ -98,8 +96,6 @@ extern void ShowWholeRevealedDungeonMap(void);
extern void sub_806B678(void);
extern void EntityUpdateStatusSprites(Entity *);
extern Entity *sub_80696A8(Entity *a0);
extern int sprintf(char *, const char *, ...);
extern const struct FileArchive gDungeonFileArchive;
extern u8 *gUnknown_80FE168[];
extern u8 *gUnknown_80FE134[];
@ -134,7 +130,6 @@ extern DungeonPos gPlayerDotMapPosition;
extern DungeonPos gUnknown_202EE0C;
extern u8 gUnknown_202F32C;
bool8 sub_806A538(s16 r0);
bool8 sub_806A564(s16 r0);
static bool8 sub_806A5A4(s16 r0);
@ -704,7 +699,7 @@ void sub_8068FE0(Entity *entity, s32 param_2, Entity *param_3)
sub_8045ACC();
}
void sub_80694C0(Entity *target,s32 x,int y,char param_4)
void sub_80694C0(Entity *target,s32 x,s32 y,u8 param_4)
{
Tile *tile;
Tile *tile2;
@ -1070,14 +1065,14 @@ void sub_8069844(struct unkStruct_808FF20 *param_1, Entity *target)
return;
}
u32 sub_8069D18(DungeonPos *pos,Entity *entity)
bool8 sub_8069D18(DungeonPos *pos,Entity *entity)
{
EntityInfo *info;
info = GetEntInfo(entity);
pos->x = (entity->pos).x + gAdjacentTileOffsets[(info->action).direction].x;
pos->y = (entity->pos).y + gAdjacentTileOffsets[(info->action).direction].y;
pos->x = entity->pos.x + gAdjacentTileOffsets[info->action.direction].x;
pos->y = entity->pos.y + gAdjacentTileOffsets[info->action.direction].y;
return info->action.direction & 1;
}

View File

@ -40,6 +40,7 @@
#include "code_8041AD0.h"
#include "code_800E9E4.h"
#include "dungeon_config.h"
#include "code_800ED38.h"
extern void sub_80429C8(Entity *r0);
extern bool8 sub_8045888(Entity *r0);
@ -2264,7 +2265,6 @@ struct UnkStruct_sub_800E308_1
};
extern s32 sub_800E308(struct UnkStruct_sub_800E308_1 *, DungeonPos *);
extern void sub_800EF64(void);
s32 sub_8056564(Entity *entity, DungeonPos *pos, Move *move, s32 r4)
{

View File

@ -1,15 +1,15 @@
#include "global.h"
#include "code_80118A4.h"
#include "constants/bg_music.h"
#include "dungeon.h"
#include "music.h"
#include "structs/menu.h"
#include "structs/str_dungeon.h"
#include "code_80118A4.h"
#include "dungeon.h"
#include "dungeon_music.h"
#include "dungeon_util.h"
#include "music.h"
#include "status_checks_1.h"
#include "text_util.h"
extern MenuInputStruct gDungeonMenu;
extern u8 *gUnknown_80FE6F4[];
@ -19,13 +19,11 @@ extern u8 gUnknown_810AC68; // 0x8
extern u8 gUnknown_810AC64; // 0x8
extern u8 gUnknown_810AC66; // 0x8
extern void sub_80709C8(u8 *buffer, EntityInfo *entityInfo);
// Dungeon Music Player adds in this flag to tell
// the system to fade in rather than immediately playing
#define DUNGEON_MUSIC_FADE_IN 0x8000
void sub_8083AB0(s16 param_0, Entity * target, Entity * entity)
void sub_8083AB0(s16 param_0, Entity *target, Entity *entity)
{
u8 *defPtr;
u8 *attackPtr;
@ -96,53 +94,40 @@ void sub_8083AB0(s16 param_0, Entity * target, Entity * entity)
bool8 sub_8083C24(void)
{
UnkDungeonGlobal_unk1CE98_sub *temp;
UnkDungeonGlobal_unk1CE98_sub *temp = &gDungeon->unk1CE98;
temp = &gDungeon->unk1CE98;
if (temp->moveID < 0x226)
return TRUE;
if (temp->moveID < 0x226) {
return TRUE;
}
else {
return FALSE;
}
}
bool8 sub_8083C50(void)
{
UnkDungeonGlobal_unk1CE98_sub *temp;
UnkDungeonGlobal_unk1CE98_sub *temp = &gDungeon->unk1CE98;
temp = &gDungeon->unk1CE98;
if (temp->moveID == 0x227 || temp->moveID == 0x22A || temp->moveID == 0x228)
return TRUE;
if ((temp->moveID == 0x227) || (temp->moveID == 0x22A) || (temp->moveID == 0x228)) {
return TRUE;
}
else {
return FALSE;
}
}
bool8 sub_8083C88(u8 param_1)
{
UnkDungeonGlobal_unk1CE98_sub *temp;
UnkDungeonGlobal_unk1CE98_sub *temp = &gDungeon->unk1CE98;
temp = &gDungeon->unk1CE98;
if ((!HasCheckpoint(gDungeon->unk644.dungeonLocation.id) && (gDungeon->unk644.unk18 != 0 || param_1 != 0))
|| temp->moveID != 0x227) {
return TRUE;
}
if ((!HasCheckpoint(gDungeon->unk644.dungeonLocation.id) &&
((gDungeon->unk644.unk18 != 0) || (param_1 != 0))) ||
(temp->moveID != 0x227)) {
return TRUE;
}
else {
return FALSE;
}
}
void PlayDungeonCursorSE(bool8 checkMenuEntriesCount)
{
if ((!checkMenuEntriesCount) || (gDungeonMenu.unk1A > 1)) {
PlayFanfareSE(0x12d,MAX_VOLUME);
}
if (!checkMenuEntriesCount || gDungeonMenu.unk1A > 1)
PlayFanfareSE(0x12d,MAX_VOLUME);
}
void PlayDungeonConfirmationSE(void)

View File

@ -1,16 +1,17 @@
#include "global.h"
#include "globaldata.h"
#include "structs/str_dungeon.h"
#include "code_800F958.h"
#include "code_80450F8.h"
#include "code_8045A00.h"
#include "code_805D8C8.h"
#include "code_806CD90.h"
#include "dungeon_items.h"
#include "dungeon_map_access.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_serializer.h"
#include "dungeon_util.h"
#include "pokemon.h"
#include "structs/str_dungeon.h"
extern u8 gUnknown_202EE70[MAX_TEAM_BODY_SIZE];
extern u8 gUnknown_202EE76[DUNGEON_MAX_WILD_POKEMON_BODY_SIZE];
@ -133,9 +134,6 @@ static void WriteWeather(DataSerializer *seri, Weather *src);
static Entity* sub_80828E0(s16 id, s16 apparentID, s32 index);
static Entity* sub_8082A08(s32 id, s32 apparentID, s32 index);
// These externs are from other files
extern void AddItemToDungeonAt(DungeonPos *, Item *, u32);
void SaveDungeonState(u8 *buffer, u32 bufLen)
{
DataSerializer seri;

View File

@ -1,20 +1,17 @@
#include "global.h"
#include "dungeon_util.h"
#include "dungeon_map_access.h"
#include "structs/str_dungeon.h"
#include "structs/str_traps.h"
#include "code_800F958.h"
#include "code_8041AD0.h"
#include "code_8069E0C.h"
#include "code_807E5AC.h"
#include "dungeon_items.h"
#include "dungeon_map_access.h"
#include "dungeon_util.h"
extern u8 gUnknown_202EE70[MAX_TEAM_BODY_SIZE];
extern u8 gUnknown_202EE76[DUNGEON_MAX_WILD_POKEMON_BODY_SIZE];
u32 EntityGetStatusSprites(Entity *entity);
void UpdateDungeonPokemonSprite(int id, short species, int status, char visible);
void sub_806C51C(Entity *entity);
extern void sub_80462AC(Entity * ,u32, u32, u32, u32);
extern void sub_807FA9C();
const DungeonPos gAdjacentTileOffsets[] = {
{0, 1},
{1, 1},

View File

@ -1,6 +1,6 @@
#include "global.h"
#include "dungeon_util_1.h"
#include "dungeon_misc.h"
#include "code_803E46C.h"
#include "code_803E668.h"
#include "code_80450F8.h"
@ -22,10 +22,6 @@ extern s32 GetCameraYPos(void);
extern void sub_803F4A0(u32);
extern void sub_803F878(s32, s32);
extern void sub_8068FE0(Entity *, u32, Entity*);
extern void sub_80694C0(Entity *, s32, s32, u32);
Entity *xxx_call_GetLeader(void)
{
return GetLeader();

View File

@ -2,6 +2,13 @@
#include "decompress.h"
#include "file_system.h"
// size: 0x8
typedef struct UnkFileStruct
{
/* 0x0 */ u32 unk0;
/* 0x4 */ u32 unk4;
} UnkFileStruct;
EWRAM_DATA u32 gUnknown_202D2A4 = {0};
EWRAM_DATA OpenedFile gFileCache[64] = {0};
@ -9,9 +16,6 @@ static EWRAM_INIT u32 sFileCacheCursorPosition = {0};
#include "data/file_system.h"
// ???
extern s32 sprintf(char *, const char *, ...);
UNUSED static void FP48_16_Log(UnkFileStruct *r0, s32 r1)
{
s32 temp;

View File

@ -1,561 +1,44 @@
#include "global.h"
#include "globaldata.h"
#include "friend_areas_map.h"
#include "sprite.h"
#include "code_8004AA0.h"
#include "input.h"
#include "text.h"
#include "code_8009804.h"
#include "bg_palette_buffer.h"
#include "string_format.h"
#include "code_800D090.h"
#include "friend_area.h"
#include "bg_control.h"
#include "code_800558C.h"
#include "code_80118A4.h"
#include "code_800C9CC.h"
#include "pokemon.h"
#include "decompress.h"
#include "constants/friend_area.h"
extern u32 sub_809034C(u8 dungeonIndex, s32 speciesId_, u8 *buffer, bool32 param_4_, bool32 param_5_);
extern void sub_801178C(void);
extern void sub_80117C4(void);
extern void PlayCancelSoundEffect(void);
extern void PlayAcceptSoundEffect(void);
extern void PlayCursorUpDownSoundEffect(void);
extern s32 sprintf(char *, const char *, ...);
extern void sub_800CB20(void);
extern void xxx_call_update_bg_sound_input(void);
extern void CopyDungeonName1toBuffer(u8 *buffer, DungeonLocation *dungeonLocation);
extern s32 Atan2_4096(PixelPos *a);
extern void sub_80117AC(void);
extern void sub_8011760(void);
#include "bg_control.h"
#include "bg_palette_buffer.h"
#include "code_8004AA0.h"
#include "code_800558C.h"
#include "code_8009804.h"
#include "code_800C9CC.h"
#include "code_800D090.h"
#include "code_80118A4.h"
#include "decompress.h"
#include "friend_area.h"
#include "friend_areas_map.h"
#include "friend_areas_map_util.h"
#include "input.h"
#include "math.h"
#include "menu_input.h"
#include "pokemon.h"
#include "sprite.h"
#include "string_format.h"
#include "text.h"
EWRAM_INIT struct FriendAreasMap *gFriendAreasMapPtr = NULL;
EWRAM_DATA static u8 sCurrDirection = 0;
EWRAM_DATA static u8 sHeldDpadCounter = 0;
extern const FileArchive gTitleMenuFileArchive;
#include "data/friend_areas_map.h"
static void MoveToNewLocation(s32 destLocationId, s32 direction, s32 nFrames);
static s32 ChooseLocation_Async(s32 *newLocationId, s32 *newDirection);
static bool8 ChooseAreaInLocation_Async(void);
static void FriendAreasMap_FadeOut_Async(void);
static u8 GetChosenDirection(void);
static s32 ChooseLocation(s32 *newLocationId, s32 *newDirection);
static bool8 ChooseAreaInLocation(void);
static void FadeFromFriendAreasMap(void);
static void InitMapLocations(u8 startingFriendAreaId);
static void MoveToNewLocation_Async(s32 destLocationId, s32 direction, s32 nFrames);
extern u16 gUnknown_2026E4E;
#define NO_AREA NUM_FRIEND_AREAS + 5
// ななし means 'without name'
#define DUMMY_LOCATION \
{ \
.name = _("ななし"), \
.pos = {0, 0}, \
.areasIds = {NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA}, \
.adjacentLocations = {-1, -1, -1, -1, -1, -1, -1, -1}, \
}
// The second set is all dummies, maybe it was used for testing purposes?
static const struct FriendAreaLocationInfo sFriendAreaLocations[2][NUM_FRIEND_AREA_LOCATIONS] =
{
{
[LOCATION_MOUNTAIN_RANGE] =
{
.name = "Mountain Range",
.pos = {0x1C5, 0x71},
.areasIds = {MT_DEEPGREEN, MT_CLEFT, MT_MOONVIEW, MT_DISCIPLINE, DARKNESS_RIDGE, RAINBOW_PEAK, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_EASTERN_FOREST,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = LOCATION_MARSH,
[DIRECTION_WEST] = LOCATION_PLAINS,
[DIRECTION_SOUTHWEST] = LOCATION_RIVER,
},
},
[LOCATION_GLACIER] =
{
.name = "Glacier",
.pos = {0x1CD, 0x1C},
.areasIds = {FRIGID_CAVERN, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = LOCATION_NORTHERN_LAKES,
[DIRECTION_SOUTHWEST] = LOCATION_MARSH,
},
},
[LOCATION_PLAINS] =
{
.name = "Plains",
.pos = {0x161, 0x78},
.areasIds = {BEAU_PLAINS, SKY_BLUE_PLAINS, SACRED_FIELD, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_TEAM_BASE,
[DIRECTION_SOUTHEAST] = LOCATION_RIVER,
[DIRECTION_EAST] = 0,
[DIRECTION_NORTHEAST] = LOCATION_MARSH,
[DIRECTION_NORTH] = LOCATION_CAVE,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = LOCATION_POND,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_SOUTH_PLAINS] =
{
.name = "South Plains",
.pos = {0x162, 0x12D},
.areasIds = {SAFARI, WILD_PLAINS, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = LOCATION_BADLANDS,
[DIRECTION_NORTH] = LOCATION_JUNGLE,
[DIRECTION_NORTHWEST] = LOCATION_RELICS,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_BADLANDS] =
{
.name = "Badlands",
.pos = {0x194, 0x102},
.areasIds = {RAVAGED_FIELD, MAGNETIC_QUARRY, THUNDER_MEADOW, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = LOCATION_DESERT,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = LOCATION_EASTERN_LAKES,
[DIRECTION_NORTH] = LOCATION_EASTERN_PONDS,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = LOCATION_JUNGLE,
[DIRECTION_SOUTHWEST] = LOCATION_SOUTH_PLAINS,
},
},
[LOCATION_EASTERN_FOREST] =
{
.name = "Eastern Forest",
.pos = {0x1C7, 0x9D},
.areasIds = {MIST_RISE_FOREST, FLYAWAY_FOREST, OVERGROWN_FOREST, ENERGETIC_FOREST, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_EASTERN_LAKES,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = 0,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = LOCATION_RIVER,
[DIRECTION_SOUTHWEST] = LOCATION_EASTERN_PONDS,
},
},
[LOCATION_WESTERN_FOREST] =
{
.name = "Western Forest",
.pos = {0x108, 0x9D},
.areasIds = {MUSHROOM_FOREST, HEALING_FOREST, TRANSFORM_FOREST, SECRETIVE_FOREST, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_VOLCANO,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = LOCATION_TEAM_BASE,
[DIRECTION_NORTHEAST] = LOCATION_POND,
[DIRECTION_NORTH] = LOCATION_NORTHERN_ISLES,
[DIRECTION_NORTHWEST] = LOCATION_BEACH,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_RIVER] =
{
.name = "River",
.pos = {0x197, 0xA0},
.areasIds = {RUB_A_DUB_RIVER, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_EASTERN_PONDS,
[DIRECTION_SOUTHEAST] = LOCATION_EASTERN_LAKES,
[DIRECTION_EAST] = LOCATION_EASTERN_FOREST,
[DIRECTION_NORTHEAST] = LOCATION_MOUNTAIN_RANGE,
[DIRECTION_NORTH] = LOCATION_MARSH,
[DIRECTION_NORTHWEST] = LOCATION_PLAINS,
[DIRECTION_WEST] = LOCATION_TEAM_BASE,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_EASTERN_PONDS] =
{
.name = "Eastern Ponds",
.pos = {0x198, 0xCF},
.areasIds = {TADPOLE_POND, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_BADLANDS,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = LOCATION_EASTERN_LAKES,
[DIRECTION_NORTHEAST] = LOCATION_EASTERN_FOREST,
[DIRECTION_NORTH] = LOCATION_RIVER,
[DIRECTION_NORTHWEST] = LOCATION_TEAM_BASE,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = LOCATION_JUNGLE,
},
},
[LOCATION_POND] =
{
.name = "Pond",
.pos = {0x133, 0x79},
.areasIds = {TURTLESHELL_POND, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = LOCATION_TEAM_BASE,
[DIRECTION_EAST] = LOCATION_PLAINS,
[DIRECTION_NORTHEAST] = LOCATION_CAVE,
[DIRECTION_NORTH] = LOCATION_RUINS,
[DIRECTION_NORTHWEST] = LOCATION_NORTHERN_ISLES,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = LOCATION_WESTERN_FOREST,
},
},
[LOCATION_NORTHERN_LAKES] =
{
.name = "Northern Lakes",
.pos = {0x182, 0x1D},
.areasIds = {MYSTIC_LAKE, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = LOCATION_MARSH,
[DIRECTION_EAST] = 1,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = LOCATION_RUINS,
[DIRECTION_SOUTHWEST] = LOCATION_CAVE,
},
},
[LOCATION_EASTERN_LAKES] =
{
.name = "Eastern Lakes",
.pos = {0x1C6, 0xD0},
.areasIds = {WATERFALL_LAKE, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = LOCATION_EASTERN_FOREST,
[DIRECTION_NORTHWEST] = LOCATION_RIVER,
[DIRECTION_WEST] = LOCATION_EASTERN_PONDS,
[DIRECTION_SOUTHWEST] = LOCATION_BADLANDS,
},
},
[LOCATION_MARSH] =
{
.name = "Marsh",
.pos = {0x1A2, 0x46},
.areasIds = {PEANUT_SWAMP, POISON_SWAMP, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_RIVER,
[DIRECTION_SOUTHEAST] = LOCATION_MOUNTAIN_RANGE,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = 1,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = LOCATION_NORTHERN_LAKES,
[DIRECTION_WEST] = LOCATION_CAVE,
[DIRECTION_SOUTHWEST] = LOCATION_PLAINS,
},
},
[LOCATION_CAVE] =
{
.name = "Cave",
.pos = {0x160, 0x47},
.areasIds = {ECHO_CAVE, DRAGON_CAVE, BOULDER_CAVE, CRYPTIC_CAVE, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_PLAINS,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = LOCATION_MARSH,
[DIRECTION_NORTHEAST] = LOCATION_NORTHERN_LAKES,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = LOCATION_RUINS,
[DIRECTION_WEST] = LOCATION_NORTHERN_ISLES,
[DIRECTION_SOUTHWEST] = LOCATION_POND,
},
},
[LOCATION_JUNGLE] =
{
.name = "Jungle",
.pos = {0x163, 0x104},
.areasIds = {JUNGLE, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_SOUTH_PLAINS,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = LOCATION_BADLANDS,
[DIRECTION_NORTHEAST] = LOCATION_EASTERN_PONDS,
[DIRECTION_NORTH] = LOCATION_TEAM_BASE,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = LOCATION_RELICS,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_RUINS] =
{
.name = "Ruins",
.pos = {0x136, 0x1C},
.areasIds = {DECREPIT_LAB, POWER_PLANT, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_POND,
[DIRECTION_SOUTHEAST] = LOCATION_CAVE,
[DIRECTION_EAST] = LOCATION_NORTHERN_LAKES,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = LOCATION_NORTHERN_SEA,
[DIRECTION_SOUTHWEST] = LOCATION_NORTHERN_ISLES,
},
},
[LOCATION_VOLCANO] =
{
.name = "Volcano",
.pos = {0x107, 0xCB},
.areasIds = {SCORCHED_PLAINS, CRATER, VOLCANIC_PIT, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = LOCATION_RELICS,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = LOCATION_TEAM_BASE,
[DIRECTION_NORTH] = LOCATION_WESTERN_FOREST,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = LOCATION_SOUTHERN_SEA,
},
},
[LOCATION_DESERT] =
{
.name = "Desert",
.pos = {0x1C4, 0x12D},
.areasIds = {FURNACE_DESERT, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = LOCATION_BADLANDS,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_RELICS] =
{
.name = "Relics",
.pos = {0x131, 0x105},
.areasIds = {ANCIENT_RELIC, AGED_CHAMBER_AN, AGED_CHAMBER_O_EXCLAIM, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = LOCATION_SOUTH_PLAINS,
[DIRECTION_EAST] = LOCATION_JUNGLE,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = LOCATION_VOLCANO,
[DIRECTION_WEST] = LOCATION_SOUTHERN_SEA,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_SKY] =
{
.name = "Sky",
.pos = {0x2F, 0x15},
.areasIds = {STRATOS_LOOKOUT, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_WESTERN_ISLES,
[DIRECTION_SOUTHEAST] = LOCATION_BEACH,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_NORTHERN_ISLES] =
{
.name = "Northern Isles",
.pos = {0x107, 0x47},
.areasIds = {LEGENDARY_ISLAND, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = 6,
[DIRECTION_SOUTHEAST] = 9,
[DIRECTION_EAST] = 0xD,
[DIRECTION_NORTHEAST] = 0xF,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = 0x18,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_SOUTHERN_ISLES] =
{
.name = "Southern Isles",
.pos = {0x5D, 0x10C},
.areasIds = {SOUTHERN_ISLAND, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = LOCATION_SOUTHERN_SEA,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = LOCATION_SOUTHWEST_ISLES,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_SOUTHWEST_ISLES] =
{
.name = "Southwest Isles",
.pos = {0x2D, 0xCB},
.areasIds = {ENCLOSED_ISLAND, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = LOCATION_SOUTHERN_ISLES,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = LOCATION_WESTERN_ISLES,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_WESTERN_ISLES] =
{
.name = "Western Isles",
.pos = {0x2D, 0x70},
.areasIds = {FINAL_ISLAND, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_SOUTHWEST_ISLES,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = LOCATION_BEACH,
[DIRECTION_NORTH] = LOCATION_SKY,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_NORTHERN_SEA] =
{
.name = "Northern Sea",
.pos = {0xD0, 0x16},
.areasIds = {BOUNTIFUL_SEA, SERENE_SEA, DEEP_SEA_CURRENT, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = LOCATION_NORTHERN_ISLES,
[DIRECTION_EAST] = LOCATION_RUINS,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = LOCATION_BEACH,
},
},
[LOCATION_SOUTHERN_SEA] =
{
.name = "Southern Sea",
.pos = {0xB2, 0x10D},
.areasIds = {TREASURE_SEA, DEEP_SEA_FLOOR, SEAFLOOR_CAVE, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = -1,
[DIRECTION_EAST] = LOCATION_RELICS,
[DIRECTION_NORTHEAST] = LOCATION_VOLCANO,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = -1,
[DIRECTION_WEST] = LOCATION_SOUTHERN_ISLES,
[DIRECTION_SOUTHWEST] = -1,
},
},
[LOCATION_BEACH] =
{
.name = "Beach",
.pos = {0x81, 0x42},
.areasIds = {SHALLOW_BEACH, ICE_FLOE_BEACH, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = -1,
[DIRECTION_SOUTHEAST] = LOCATION_WESTERN_FOREST,
[DIRECTION_EAST] = -1,
[DIRECTION_NORTHEAST] = LOCATION_NORTHERN_SEA,
[DIRECTION_NORTH] = -1,
[DIRECTION_NORTHWEST] = LOCATION_SKY,
[DIRECTION_WEST] = -1,
[DIRECTION_SOUTHWEST] = LOCATION_WESTERN_ISLES,
},
},
[LOCATION_TEAM_BASE] =
{
.name = _("$t"),
.pos = {0x163, 0xA1},
.areasIds = {FRIEND_AREA_NONE, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA, NO_AREA},
.adjacentLocations = {
[DIRECTION_SOUTH] = LOCATION_JUNGLE,
[DIRECTION_SOUTHEAST] = LOCATION_EASTERN_PONDS,
[DIRECTION_EAST] = LOCATION_RIVER,
[DIRECTION_NORTHEAST] = -1,
[DIRECTION_NORTH] = LOCATION_PLAINS,
[DIRECTION_NORTHWEST] = LOCATION_POND,
[DIRECTION_WEST] = LOCATION_WESTERN_FOREST,
[DIRECTION_SOUTHWEST] = LOCATION_VOLCANO,
},
},
[LOCATION_UNUSED_28] = DUMMY_LOCATION,
[LOCATION_UNUSED_29] = DUMMY_LOCATION,
[LOCATION_UNUSED_30] = DUMMY_LOCATION,
[LOCATION_UNUSED_31] = DUMMY_LOCATION,
},
{
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
DUMMY_LOCATION,
}
};
void ShowFriendAreasMap(struct struct_unk800F990 *param_1)
void ShowFriendAreasMap_Async(struct struct_unk800F990 *param_1)
{
gFriendAreasMapPtr = param_1->friendAreasMapPtr;
gUnknown_2026E4E = 0x1010;
sub_80095CC(0,0x14);
sub_80095CC(0, 20);
UpdateFadeInTile(2);
gFriendAreasMapPtr->locationsInfo = sFriendAreaLocations[0];
gFriendAreasMapPtr->unk4A2C = param_1->unk5;
@ -567,16 +50,17 @@ void ShowFriendAreasMap(struct struct_unk800F990 *param_1)
sCurrDirection = 0xff;
sHeldDpadCounter = 0;
sub_8011760();
while (1) {
while (TRUE) {
s32 newLocationId = 0;
s32 newDirection = 0;
s32 inputRet = ChooseLocation(&newLocationId, &newDirection);
s32 inputRet = ChooseLocation_Async(&newLocationId, &newDirection);
if (inputRet == 1) {
MoveToNewLocation(newLocationId, newDirection, 50);
MoveToNewLocation_Async(newLocationId, newDirection, 50);
}
else if (inputRet == 2) {
if (!ChooseAreaInLocation())
if (!ChooseAreaInLocation_Async())
continue;
param_1->unkC = gFriendAreasMapPtr->chosenFriendAreaId;
break;
@ -586,16 +70,16 @@ void ShowFriendAreasMap(struct struct_unk800F990 *param_1)
param_1->unkC = 0;
break;
}
MoveToNewLocation(gFriendAreasMapPtr->locationIdOnBPress, DIRECTION_SOUTH, 10);
MoveToNewLocation_Async(gFriendAreasMapPtr->locationIdOnBPress, DIRECTION_SOUTH, 10);
}
}
FadeFromFriendAreasMap();
FriendAreasMap_FadeOut_Async();
FriendAreasMap_CloseFiles();
nullsub_16();
}
static s32 ChooseLocation(s32 *newLocationId, s32 *newDirection)
static s32 ChooseLocation_Async(s32 *newLocationId, s32 *newDirection)
{
s32 ret = 0;
@ -636,16 +120,18 @@ static s32 ChooseLocation(s32 *newLocationId, s32 *newDirection)
return ret;
}
static bool8 ChooseAreaInLocation(void)
static bool8 ChooseAreaInLocation_Async(void)
{
bool8 ret = FALSE;
FriendAreasMap_PrintAvailableSubAreas();
while (1) {
while (TRUE) {
MenuInputStruct *menuPtr = &gFriendAreasMapPtr->menu;
AddMenuCursorSprite(menuPtr);
FriendAreasMap_RunFrameActions();
if (gRealInputs.repeated & DPAD_DOWN) {
MoveMenuCursorDown(menuPtr);
PlayCursorUpDownSoundEffect();
@ -670,12 +156,13 @@ static bool8 ChooseAreaInLocation(void)
return ret;
}
static void FadeFromFriendAreasMap(void)
static void FriendAreasMap_FadeOut_Async(void)
{
s32 i;
FriendAreasMap_HideTextWindowAndArrows();
sub_80117AC();
for (i = 0; i < 60; i++) {
gFriendAreasMapPtr->brightness -= 2;
FriendAreasMap_RunFrameActions();
@ -884,7 +371,7 @@ static u8 GetChosenDirection(void)
return 0xFF;
}
static void MoveToNewLocation(s32 destLocationId, s32 direction, s32 nFrames)
static void MoveToNewLocation_Async(s32 destLocationId, s32 direction, s32 nFrames)
{
s32 i, currLocationId;
DungeonPos startingPos, dstPos;

View File

@ -1,30 +1,27 @@
#include "global.h"
#include "globaldata.h"
#include "friend_areas_map.h"
#include "sprite.h"
#include "code_8004AA0.h"
#include "input.h"
#include "text.h"
#include "code_8009804.h"
#include "bg_palette_buffer.h"
#include "string_format.h"
#include "code_800D090.h"
#include "friend_area.h"
#include "bg_control.h"
#include "code_800558C.h"
#include "game_options.h"
#include "play_time.h"
#include "code_80118A4.h"
#include "code_800C9CC.h"
#include "pokemon.h"
#include "decompress.h"
#include "constants/direction.h"
extern void sub_800CB20(void);
extern void xxx_call_update_bg_sound_input(void);
extern s32 sprintf(char *, const char *, ...);
extern const FileArchive gTitleMenuFileArchive;
#include "bg_control.h"
#include "bg_palette_buffer.h"
#include "code_8004AA0.h"
#include "code_800558C.h"
#include "code_8009804.h"
#include "code_800C9CC.h"
#include "code_800D090.h"
#include "code_80118A4.h"
#include "decompress.h"
#include "def_filearchives.h"
#include "friend_area.h"
#include "friend_areas_map.h"
#include "friend_areas_map_util.h"
#include "game_options.h"
#include "input.h"
#include "menu_input.h"
#include "play_time.h"
#include "pokemon.h"
#include "sprite.h"
#include "string_format.h"
#include "text.h"
static inline bool8 CheckAxFlag8000(axdata *ptr)
{
@ -58,7 +55,7 @@ static const DungeonPos gUnknown_80D40C4[] =
void FriendAreasMap_InitGfx(void)
{
u8 filename[0xC];
u8 filename[12];
s32 i, size;
PokemonStruct1 *pokeStruct = GetPlayerPokemonStruct();
@ -383,7 +380,7 @@ void FriendAreasMap_RunFrameActions(void)
sub_8005180();
sub_80060EC();
IncrementPlayTime(gPlayTimeRef);
sub_800CB20();
WaitForNextFrameAndAdvanceRNG();
LoadBufferedInputs();
CopySpritesToOam();
sub_8005304();
@ -394,4 +391,3 @@ void FriendAreasMap_RunFrameActions(void)
sub_8011860();
ResetSprites(FALSE);
}

View File

@ -1,5 +1,6 @@
#include "global.h"
#include "globaldata.h"
#include "code_800D090.h"
#include "code_80118A4.h"
#include "string_format.h"
#include "code_801B3C0.h"
@ -307,7 +308,6 @@ extern u32 sub_8023CE8(void);
extern bool8 sub_8031D70(u32 mailIndex, s32);
extern u32 GetDungeonTeamRankPts(DungeonLocation *, u32);
extern void sprintfStatic(char *buffer, const char *text, ...);
u32 CreateFriendRescueMenu(void)
{

Some files were not shown because too many files have changed in this diff Show More