diff --git a/include/code_8040094_1.h b/include/code_8040094_1.h index 0b8959592..323a53ce8 100644 --- a/include/code_8040094_1.h +++ b/include/code_8040094_1.h @@ -1,6 +1,12 @@ #ifndef GUARD_CODE_8040094_1_H #define GUARD_CODE_8040094_1_H +#include "structs/dungeon_entity.h" + +u16 GetEffectiveMoveId(u16 moveId, u8 weather, bool32 hasSpecialEffect); + +bool8 sub_8040BB0(Entity *entity, Move *move, bool8 a2); +void sub_8040DA0(Entity *entity, Move *move); void sub_8041168(Entity *entity, Entity *entity2, Move *move, DungeonPos *pos); #endif // GUARD_CODE_8040094_1_H diff --git a/include/code_8099360.h b/include/code_8099360.h index bbe27c936..46696947b 100644 --- a/include/code_8099360.h +++ b/include/code_8099360.h @@ -1,9 +1,12 @@ #ifndef GUARD_CODE_8099360_H #define GUARD_CODE_8099360_H +#include "structs/rgb.h" + void sub_8099648(void); void nullsub_103(void); void sub_809965C(void); void sub_8099690(u32 param_1); +void sub_809971C(u16 idx, RGB_Array *strPtrs, s32 n); #endif //GUARD_CODE_8099360_H diff --git a/include/graphics_memory.h b/include/graphics_memory.h index 9e2ad8a80..85e811d14 100644 --- a/include/graphics_memory.h +++ b/include/graphics_memory.h @@ -20,6 +20,8 @@ void ScheduleBgTilemapCopy(u32); void DoScheduledMemCopies(void); void CopyBgTilemaps0And1(void); void SetFontsBaseColor(RGB_Struct); + bool8 sub_8009A7C(struct EfbFileData *a0, s32 a1, s32 a2, s32 a3, bool8 a4, s32 *a5, s16 *a6); +void sub_8009BE4(void); #endif // GUARD_GRAPHICS_MEMORY_H diff --git a/src/code_8040094_1.c b/src/code_8040094_1.c index fbf61a21e..f12679b34 100644 --- a/src/code_8040094_1.c +++ b/src/code_8040094_1.c @@ -3,7 +3,6 @@ #include "constants/move_id.h" #include "constants/type.h" #include "constants/weather.h" -#include "structs/dungeon_entity.h" #include "structs/str_dungeon.h" #include "code_800558C.h" #include "code_8040094_1.h" @@ -29,7 +28,6 @@ #include "sprite.h" #include "weather.h" -u16 GetEffectiveMoveId(u16 moveId, u8 weather, bool32 hasSpecialEffect); static bool32 MoveHasSpecialEffect(Entity *entity, Move *move); static bool8 sub_80414C0(Entity *entity, Move *move); static bool8 MoveHasSineWobble(u16 moveId, u8 weather, bool32 hasSpecialEffect); diff --git a/src/dungeon_move_util.c b/src/dungeon_move_util.c index 5c827658b..2e0ac4f39 100644 --- a/src/dungeon_move_util.c +++ b/src/dungeon_move_util.c @@ -45,14 +45,10 @@ #include "dungeon_damage.h" #include "dungeon_leveling.h" -extern bool8 sub_8040BB0(Entity *entity, Move *move, bool8); -extern void sub_8040DA0(Entity *entity, Move *move); -extern u16 GetEffectiveMoveId(u16 moveId, u8 weather, u8 hasSpecialEffect); +static EWRAM_INIT Entity *gUnknown_203B438 = NULL; static u8 ToItemID(u32 itemID); -static EWRAM_INIT Entity *gUnknown_203B438 = NULL; - bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s32 arg_0) { s32 i, j; diff --git a/src/effect_main.c b/src/effect_main.c index 44a3583dc..4f25a54b0 100644 --- a/src/effect_main.c +++ b/src/effect_main.c @@ -1,5 +1,6 @@ #include "global.h" #include "globaldata.h" +#include "code_8099360.h" #include "effect_main.h" #include "effect_sub_1.h" #include "effect_sub_2.h" @@ -79,10 +80,6 @@ struct unkStruct_800F18C extern s16 gUnknown_2026E4E; - -extern void sub_8009BE4(void); -extern void sub_809971C(u16 a0, const RGB_Struct *a1, s32 a2); - static s32 sub_800E900(s32 a0); static s32 sub_800E2C0(s32); static s32 sub_800E2B8(OpenedFile *a0); @@ -514,7 +511,7 @@ static bool8 sub_800DE8C(struct unkStruct_203B0CC_sub *a0, DungeonPos *unused) if (r8->unk20 != 0) { switch (gUnknown_203B0CC->fileSelection) { case 1: - sub_809971C(224, &GetFileEfo(a0)->unk10->pal[224],16); + sub_809971C(224, (RGB_Array*)&GetFileEfo(a0)->unk10->pal[224],16); break; case 0: { s32 i; diff --git a/src/effect_sub_1.c b/src/effect_sub_1.c index 5eabb9b72..c5cc86cc5 100644 --- a/src/effect_sub_1.c +++ b/src/effect_sub_1.c @@ -1,5 +1,6 @@ #include "global.h" #include "globaldata.h" +#include "code_8099360.h" #include "effect_sub_1.h" #include "effect_sub_2.h" #include "bg_control.h" @@ -38,8 +39,6 @@ struct unkStruct_203B0D0 { static EWRAM_INIT struct unkStruct_203B0D0 *gUnknown_203B0D0 = NULL; -extern void sub_809971C(u16 a0, const RGB_Struct *a1, s32 a2); - void sub_800ED38(s32 r0) { if (gUnknown_203B0D0 == NULL) { @@ -198,7 +197,7 @@ void sub_800EF64(void) switch (gUnknown_203B0D0->unk0) { case 1: { const RGB_Struct *pal = sub->fileData->pal; - sub_809971C((sub->unkC + 16) * 16, pal, 0x10); + sub_809971C((sub->unkC + 16) * 16, (RGB_Array*)pal, 0x10); break; } case 0: { diff --git a/src/friend_rescue.c b/src/friend_rescue.c index 2451206f8..fc9501c58 100644 --- a/src/friend_rescue.c +++ b/src/friend_rescue.c @@ -31,8 +31,6 @@ #include "code_803C1B4.h" #include "code_8031D70.h" -extern void SetFriendRescueMenuState(u32); - // NOTE: MenuItems and WindowTemplate defined in here.. #include "data/friend_rescue_menus.h" @@ -582,6 +580,8 @@ void sub_8035430(void); extern u8 sub_800D588(void); +static void SetFriendRescueMenuState(u32 newState); + u32 CreateFriendRescueMenu(void) { u8 *monName; @@ -1603,8 +1603,7 @@ void sub_8032828(void) } } - -void SetFriendRescueMenuState(u32 newState) +static void SetFriendRescueMenuState(u32 newState) { gUnknown_203B33C->state = newState; nullsub_40(); diff --git a/src/ground_bg.c b/src/ground_bg.c index 556bb148b..946936901 100644 --- a/src/ground_bg.c +++ b/src/ground_bg.c @@ -1,5 +1,6 @@ #include "global.h" #include "globaldata.h" +#include "code_8099360.h" #include "ground_bg.h" #include "ground_map.h" #include "text_1.h" @@ -33,8 +34,6 @@ static void ClearDoubleBgTilemaps(MapRender *mapRender); static void RenderChunksToBgTilemaps_2x2(MapRender *mapRender); static void RenderChunksToBgTilemaps_3x3(MapRender *mapRender); -extern void sub_809971C(u16 idx, const RGB_Array *strPtrs, s32 n); - static const PixelPos sPositionZero = {0, 0}; void GroundBg_Init(GroundBg *groundBg, const SubStruct_52C *a1) @@ -285,7 +284,7 @@ void sub_80A2FBC(GroundBg *groundBg, s32 mapFileId_) str1.c[RGB_UNK] = 0; for (i = 0; i < bplHeader->numPalettes && i < groundBg->unk52C.unk2; i++) { sub_8003810(r5++, str2); - sub_809971C(r5, rgbPal, 15); + sub_809971C(r5, (RGB_Array*)rgbPal, 15); r5 += 15; rgbPal += 15; } @@ -1362,7 +1361,7 @@ void sub_80A4764(GroundBg *groundBg) if (sub0Ptr->unk8 != NULL) { RGB_Array empty = {0}; sub_8003810(r6, empty); - sub_809971C(r6 + 1, sub0Ptr->unk8, 15); + sub_809971C(r6 + 1, (RGB_Array*)sub0Ptr->unk8, 15); sub0Ptr->unk8 += 60; } } diff --git a/src/ground_sprite.c b/src/ground_sprite.c index c08691ceb..d6583c40e 100644 --- a/src/ground_sprite.c +++ b/src/ground_sprite.c @@ -1,5 +1,6 @@ #include "global.h" #include "globaldata.h" +#include "code_8099360.h" #include "ground_sprite.h" #include "structs/axdata.h" #include "effect_main.h" @@ -12,6 +13,7 @@ #include "memory.h" #include "sprite.h" #include "effect_sub_1.h" +#include "palette_util.h" #include "pokemon.h" #include "ground_effect.h" #include "ground_object.h" @@ -42,8 +44,6 @@ typedef struct unkStruct_3001B7C unkStruct_3001B7C_sub108 unk108[UNK_3001B7C_SUB108_COUNT]; } unkStruct_3001B7C; -static IWRAM_INIT unkStruct_3001B7C *gUnknown_3001B7C = {NULL}; - static EWRAM_DATA unkStruct_2039DB0 gUnknown_2039DB0 = {0}; UNUSED static EWRAM_DATA u32 sUnknown_2039DBC = {0}; // Unused, for alignment static EWRAM_DATA unkStruct_2039DB0 gUnknown_2039DC0 = {0}; @@ -55,10 +55,7 @@ static EWRAM_DATA PixelPos gUnknown_2039DD8 = {0}; static EWRAM_INIT OpenedFile *gUnknown_203B4B4 = {NULL}; -// code_8098BDC.s -extern void sub_809971C(u16, const u8 *, s16); -extern void sub_80997F4(u16, u16); -extern void sub_800E970(void); +static IWRAM_INIT unkStruct_3001B7C *gUnknown_3001B7C = {NULL}; static bool8 sub_80A68F8(struct UnkGroundSpriteStruct *ptr, struct UnkGroundSpriteSubStructx48 *a1, s32 a2); static bool8 sub_80A6CF4(struct UnkGroundSpriteSubStructx48 *a0); @@ -143,7 +140,7 @@ static void sub_80A6460(void) data = file->data; for (i = 0; i < 13; i++) { - sub_809971C(something, data, 0x10); + sub_809971C(something, (RGB_Array*)data, 0x10); something += 0x10; data += 0x40; } @@ -192,7 +189,7 @@ UNUSED static void sub_80A64A4(void) if (flag) r4 |= 2; - sub_809971C(r9, r2, 16); + sub_809971C(r9, (RGB_Array*)r2, 16); sub_80997F4(sl, r4); if (file != NULL) @@ -545,7 +542,7 @@ void GroundSprite_ExtendPaletteAdd(struct UnkGroundSpriteStruct *ptr, u16 a1) } sub_80997F4(var_28, r6); - sub_809971C(var_24, r7, 16); + sub_809971C(var_24, (RGB_Array*)r7, 16); sub108Ptr->unk0 = a1; sub108Ptr->unk2 = 1; r2 = var_28 - 16; diff --git a/src/move_orb_actions_2.c b/src/move_orb_actions_2.c index c449ae6b0..97cd7a883 100644 --- a/src/move_orb_actions_2.c +++ b/src/move_orb_actions_2.c @@ -1,12 +1,5 @@ #include "global.h" #include "globaldata.h" -#include "move_orb_actions_2.h" -#include "move_orb_effects_2.h" -#include "dungeon_move_util.h" -#include "dungeon_vram.h" -#include "dungeon_tilemap.h" -#include "dungeon_mon_sprite_render.h" -#include "dungeon_random.h" #include "constants/ability.h" #include "constants/dungeon_exit.h" #include "constants/residual_damage.h" @@ -14,33 +7,37 @@ #include "constants/targeting.h" #include "constants/type.h" #include "constants/weather.h" -#include "dungeon_logic.h" -#include "dungeon_items.h" -#include "dungeon_map_access.h" -#include "dungeon_message.h" -#include "dungeon_random.h" -#include "dungeon_util.h" -#include "dungeon_move.h" -#include "dungeon_misc.h" -#include "move_orb_effects_1.h" -#include "moves.h" -#include "number_util.h" -#include "pokemon.h" -#include "move_orb_actions_1.h" #include "structs/dungeon_entity.h" #include "structs/map.h" #include "structs/str_dungeon.h" -#include "weather.h" +#include "dungeon_8041AD0.h" #include "dungeon_config.h" -#include "dungeon_misc.h" -#include "dungeon_strings.h" #include "dungeon_damage.h" -#include "warp_target.h" +#include "dungeon_items.h" +#include "dungeon_logic.h" +#include "dungeon_map_access.h" +#include "dungeon_message.h" +#include "dungeon_misc.h" +#include "dungeon_mon_sprite_render.h" +#include "dungeon_move.h" +#include "dungeon_move_util.h" +#include "dungeon_random.h" +#include "dungeon_strings.h" +#include "dungeon_tilemap.h" +#include "dungeon_util.h" +#include "dungeon_vram.h" #include "explosion.h" +#include "move_orb_actions_1.h" +#include "move_orb_actions_2.h" +#include "move_orb_effects_1.h" +#include "move_orb_effects_2.h" #include "move_orb_effects_3.h" #include "move_orb_effects_4.h" - -extern void nullsub_92(Entity *); +#include "moves.h" +#include "number_util.h" +#include "pokemon.h" +#include "warp_target.h" +#include "weather.h" bool8 SkyAttackMoveAction(Entity *pokemon, Entity *target, Move *move, s32 itemId) {