Split text.c and decompress.c

This commit is contained in:
Kermalis 2025-03-21 23:48:05 -04:00
parent 489f94a7b3
commit 10cbb42719
213 changed files with 5700 additions and 5327 deletions

View File

@ -170,7 +170,7 @@ _0802398E:
adds r1, r0, r1
str r1, [r2]
adds r0, r6
bl RestoreUnkTextStruct_8006518
bl RestoreSavedWindows
ldr r1, [r5]
adds r4, r1, r4
ldr r2, [r4]

View File

@ -20,7 +20,7 @@ sub_803B050:
adds r1, 0x84
str r1, [r0, 0x38]
adds r0, 0x3C
bl RestoreUnkTextStruct_8006518
bl RestoreSavedWindows
ldr r1, [r4]
ldr r2, [r1, 0x34]
lsls r0, r2, 1

View File

@ -1011,7 +1011,7 @@ gUnknown_80B7DF8:
.fill 8, 1, 0
.global gVectorDirections
gVectorDirections: @ 80B7E3C
gVectorDirections: @ GBA=080B7E3C | NDS=0208772C
.4byte 0, 1 @N
.4byte 1, 1 @NE
.4byte 1, 0 @E

View File

@ -3,13 +3,12 @@
#include "structs/str_position.h"
void sub_800290C(PixelPos *param_1, s32 param_2);
void sub_8002934(PixelPos *param_1, PixelPos *param_2, PixelPos *param_3, s32 param_4, s32 param_5);
s32 sub_8002A70(s32 a0, s32 a1, s32 a2);
s32 sub_8002B04(s32, s32);
s32 VecDirection8Sign(PixelPos *param_1);
s32 VecDirection4SignYX(PixelPos *param_1);
s8 VecDirection8Radial(PixelPos *param_1);
s8 VecDirection4Radial(PixelPos *param_1);
s8 SizedDeltaDirection4(const PixelPos *r0, const PixelPos *r1, const PixelPos *r2, const PixelPos *r3);
s8 SizedDeltaDirection8(const PixelPos *r0, const PixelPos *r1, const PixelPos *r2, const PixelPos *r3);
#endif
#endif // GUARD_CODE_8002774_H

View File

@ -1,43 +1,12 @@
#ifndef GUARD_CODE_800558C_H
#define GUARD_CODE_800558C_H
#include "structs/axdata.h"
#include "structs/rgb.h"
typedef struct Palette256
{
RGB pal[256];
} Palette256;
// size: 0x20
struct EfoFileData
{
/* 0x0 */ ax_pose **poses; // TODO: Verify if these fields' names are actually valid
/* 0x4 */ ax_anim ***animations;
/* 0x8 */ s32 animCount;
/* 0xC */ void *spriteData; // ?
/* 0x10 */ Palette256 *unk10; // ?
/* 0x14 */ const u32 *tiles;
/* 0x18 */ const RGB *pal;
/* 0x1C */ s32 tileCount;
};
extern bool8 gUnknown_2026E38;
extern u32 *gUnknown_2026E3C;
extern s16 gUnknown_2026E4E;
extern s16 *gUnknown_203B078;
void nullsub_7(s16 *);
void nullsub_8(u32);
void nullsub_9(void);
void nullsub_10(bool8);
void nullsub_12(void);
void nullsub_13(void);
void nullsub_14(void);
void sub_8005610(OpenedFile *, s32, s32, const RGB *);
const RGB *sub_8005674(const struct EfoFileData *a0, s32 vramIdx);
void sub_8005770(s32, const RGB *color, s32, const RGB *ramp);
void sub_80057E8(void);
void sub_8005838(s32 *, u8 kind);
void sub_80060EC(void);

View File

@ -1,7 +1,7 @@
#ifndef GUARD_CODE_8009804_H
#define GUARD_CODE_8009804_H
#include "structs/rgb.h"
#include "structs/axdata.h"
extern RGB gFontPalette[128];
@ -16,11 +16,11 @@ struct unkStruct_202D240
struct unkStruct_8009A1C_ptr
{
u8 fill0;
struct EfoFileData *ptr;
EfoFileData *ptr;
};
void vram_related_8009804(void);
void sub_8009A1C(const struct EfoFileData *r0, u32 palId, u32 vramDstOffset, u32 r3);
void sub_8009A1C(const EfoFileData *r0, u32 palId, u32 vramDstOffset, u32 r3);
void InitFontPalette(void);
void sub_80098A0(void);
void sub_80098BC(u32 *, const u32 *, u32);

View File

@ -27,7 +27,7 @@ struct unkStruct_203B0CC_sub
s32 unk50;
u8 unk54;
u8 fill55[0x58 - 0x55];
struct axObject unk58;
axObject unk58;
u8 fillA4[0xB8 - 0xA4];
u32 unkB8;
u8 fillBC[0xCC - 0xBC];

View File

@ -1,10 +1,9 @@
#ifndef GUARD_CODE_802DB28_H
#define GUARD_CODE_802DB28_H
#include "file_system.h"
#include "structs/str_mon_portrait.h"
#include "structs/str_text.h"
#include "structs/str_wonder_mail.h"
#include "string_format.h"
// size: 0xA8
struct unkStruct_203B2FC
@ -14,7 +13,7 @@ struct unkStruct_203B2FC
unkStruct_802F204 unk8;
/* 0x30 */ u8 jobSlotIndex;
/* 0x34 */ WonderMail *jobInfo;
/* 0x38 */ struct MonPortraitMsg monPortrait;
/* 0x38 */ MonPortraitMsg monPortrait;
WindowTemplates unk48;
};

View File

@ -9,30 +9,10 @@ typedef struct DebugLocation
/* 0x8 */ const u8 *func;
} DebugLocation;
void FatalError(const DebugLocation *debug, const char *text, ...) NORETURN;
void Log(u8 num, const u8 *text, ...);
void NDS_DebugInit(void);
void nullsub_25(void);
void nullsub_26(void);
void nullsub_27(void);
void nullsub_28(void);
void nullsub_29(void);
void nullsub_30(void);
void nullsub_31(void);
void nullsub_32(void);
void nullsub_137(void);
void nullsub_199(void);
void PrintFuncFileLine(u8 *buf, const DebugLocation *loc, const u8 *prefix);
void PrintMessageWithFuncFileLine(u8 *buffer, const DebugLocation *debug, const u8 *text, ...);
void sub_8011B08(void);
void sub_8011B88(const u8 *text, ...);
s8 ScriptLoggingEnabled(bool8);
u32 sub_8011BA8(void);
const u8 *sub_8011BAC(void);
void sub_8011B14(void);
u8 sub_8011B20(void);
u8 sub_8011B3C(void);
void sub_8011BC8(u32, u32, u32, ...);
void UnusedHang(void);
void FatalError(const DebugLocation *debug, const char *text, ...) __attribute__((noreturn));
bool8 ScriptLoggingEnabled(bool8);
#endif // GUARD_DEBUG_H

View File

@ -1,26 +0,0 @@
#ifndef GUARD_DECOMPRESS_H
#define GUARD_DECOMPRESS_H
#include "file_system.h"
// size: 0x8
typedef struct SiroArchive
{
/* 0x0 */ u32 magic;
/* 0x4 */ const void *data;
} SiroArchive;
u32 DecompressAT(u8 *dst, s32 dstLen, const u8 *src);
u32 DecompressATFile(void *dst, s32 dstLen, OpenedFile *file);
u32 DecompressATGlobalFile(u32 *result, s32 resultLength, OpenedFile *file);
const void *GetSiroPtr(OpenedFile *openedFile);
void nullsub_16(void);
// Returns FALSE if the ascii chars in both strings match, ignoring uppercase/lowercase differences.
// "YeS\0" and "yEs\0" => FALSE
// "Yes\0" and "Tes\0" => TRUE
// "Yes\0" and "y\0" => TRUE
// "T\0" and "Tes\0" => TRUE
bool8 StrsDifferent_IgnoreCase(const char *strA, const char *strB, s32 maxLen);
#endif // GUARD_DECOMPRESS_H

11
include/decompress_3.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef GUARD_DECOMPRESS_3_H
#define GUARD_DECOMPRESS_3_H
// Returns FALSE if the ascii chars in both strings match, ignoring uppercase/lowercase differences.
// "YeS\0" and "yEs\0" => FALSE
// "Yes\0" and "Tes\0" => TRUE
// "Yes\0" and "y\0" => TRUE
// "T\0" and "Tes\0" => TRUE
bool8 StrsDifferent_IgnoreCase(const char *strA, const char *strB, s32 maxLen);
#endif // GUARD_DECOMPRESS_3_H

10
include/decompress_at.h Normal file
View File

@ -0,0 +1,10 @@
#ifndef GUARD_DECOMPRESS_AT_H
#define GUARD_DECOMPRESS_AT_H
#include "file_system.h"
u32 DecompressAT(u8 *dst, s32 dstLen, const u8 *src);
u32 DecompressATFile(void *dst, s32 dstLen, OpenedFile *file);
u32 DecompressATGlobalFile(u32 *result, s32 resultLength, OpenedFile *file);
#endif // GUARD_DECOMPRESS_AT_H

16
include/decompress_sir.h Normal file
View File

@ -0,0 +1,16 @@
#ifndef GUARD_DECOMPRESS_SIR_H
#define GUARD_DECOMPRESS_SIR_H
#include "file_system.h"
// size: 0x8
typedef struct SiroArchive
{
/* 0x0 */ u32 magic;
/* 0x4 */ const void *data;
} SiroArchive;
const void *GetSiroPtr(OpenedFile *openedFile);
void nullsub_16(void);
#endif // GUARD_DECOMPRESS_SIR_H

View File

@ -171,7 +171,7 @@ bool8 SaveGlobalScriptVars(void *r0);
bool8 RestoreGlobalScriptVars(u8 *r0);
// .rodata
extern struct ScriptVarInfo gScriptVarInfo[];
extern struct ScriptVarInfo gScriptVarInfo[]; // NDS=0210FAC4
// EWRAM
extern u8 gScriptVarBuffer[0x400];

View File

@ -1,10 +1,9 @@
#ifndef GUARD_FELICITY_BANK_H
#define GUARD_FELICITY_BANK_H
#include "file_system.h"
#include "structs/menu.h"
#include "structs/str_mon_portrait.h"
#include "structs/str_text.h"
#include "string_format.h"
#define FELICITY_BANK_ACTION_WITHDRAW 0
#define FELICITY_BANK_ACTION_DEPOSIT 1
@ -20,8 +19,8 @@ typedef struct FelicityBankWork
MenuItem unk14[8];
u16 unk54[8];
unkStructFor8013AA0 unk64;
/* 0x94 */ struct MonPortraitMsg monPortrait;
struct MonPortraitMsg *monPortraitPtr;
/* 0x94 */ MonPortraitMsg monPortrait;
MonPortraitMsg *monPortraitPtr;
WindowTemplates unkA8;
} FelicityBankWork;

View File

@ -13,7 +13,8 @@
#define IWRAM_INIT __attribute__((section("iwram_init")))
#define UNUSED __attribute__((unused))
#define NAKED __attribute__((naked))
#define NORETURN __attribute__((noreturn))
#define PACKED __attribute__((packed))
#define ALIGNED(n) __attribute__((aligned(n)))
#define SOUND_INFO_PTR (*(struct SoundInfo **)0x3007FF0)

View File

@ -34,7 +34,7 @@ struct PlttData
u16 g:5; // green
u16 b:5; // blue
u16 unused_15:1;
} /*__attribute__((packed))*/;
} /*PACKED*/;
struct OamData
{

View File

@ -1,11 +1,10 @@
#ifndef GUARD_GULPIN_SHOP_H
#define GUARD_GULPIN_SHOP_H
#include "file_system.h"
#include "structs/menu.h"
#include "structs/str_text.h"
#include "structs/str_mon_portrait.h"
#include "structs/str_moves.h"
#include "string_format.h"
#include "structs/str_text.h"
// size: 0x18C
typedef struct GulpinShopWork
@ -25,8 +24,8 @@ typedef struct GulpinShopWork
u16 unk68[8];
MenuStruct unk78;
u8 fillC8[0x118 - 0xC8];
/* 0x118 */ struct MonPortraitMsg monPortrait;
struct MonPortraitMsg *monPortraitPtr;
/* 0x118 */ MonPortraitMsg monPortrait;
MonPortraitMsg *monPortraitPtr;
WindowTemplates unk12C;
} GulpinShopWork;

View File

@ -2,9 +2,9 @@
#define GUARD_GULPIN_SHOP_801FB50_H
#include "constants/move.h"
#include "file_system.h"
#include "structs/menu.h"
#include "pokemon.h"
#include "structs/str_mon_portrait.h"
#include "structs/str_text.h"
// size: 0x1E0
@ -33,8 +33,8 @@ typedef struct unkStruct_203B27C
u16 unkBC[8];
MenuStruct unkCC;
u8 fill11C[0x16C - 0x11C];
/* 0x16C */ struct MonPortraitMsg monPortrait;
struct MonPortraitMsg *monPortraitPtr;
/* 0x16C */ MonPortraitMsg monPortrait;
MonPortraitMsg *monPortraitPtr;
WindowTemplates unk180;
} unkStruct_203B27C;

View File

@ -17,34 +17,34 @@ typedef struct InputTimers
{
/* 0x0 */ s16 holdTimerB;
/* 0x2 */ s16 holdTimerR;
u16 unk4;
u16 unk6;
/* 0x4 */ u16 unk4;
/* 0x6 */ u16 unk6;
} InputTimers;
// size: 0x2C
typedef struct UnusedInputStruct
{
u16 unk0;
u16 unk2;
u16 unk4;
u16 unk6;
u16 unk8;
u16 unkA;
u16 unkC;
u16 unkE;
u16 unk10;
u16 unk12;
u16 unk14;
u16 unk16;
u16 unk18;
u16 unk1A;
u16 unk1C;
u16 unk1E;
u32 unk20;
u16 unk24;
u16 unk26;
u8 unk28;
u8 unk29;
/* 0x0 */ u16 unk0;
/* 0x2 */ u16 unk2;
/* 0x4 */ u16 unk4;
/* 0x6 */ u16 unk6;
/* 0x8 */ u16 unk8;
/* 0xA */ u16 unkA;
/* 0xC */ u16 unkC;
/* 0xE */ u16 unkE;
/* 0x10 */ u16 unk10;
/* 0x12 */ u16 unk12;
/* 0x14 */ u16 unk14;
/* 0x16 */ u16 unk16;
/* 0x18 */ u16 unk18;
/* 0x1A */ u16 unk1A;
/* 0x1C */ u16 unk1C;
/* 0x1E */ u16 unk1E;
/* 0x20 */ u32 unk20;
/* 0x24 */ u16 unk24;
/* 0x26 */ u16 unk26;
/* 0x28 */ u8 unk28;
/* 0x29 */ u8 unk29;
} UnusedInputStruct;
extern Inputs gRealInputs;

View File

@ -1,9 +1,9 @@
#ifndef GUARD_KANGASKHAN_STORAGE1_H
#define GUARD_KANGASKHAN_STORAGE1_H
#include "file_system.h"
#include "structs/menu.h"
#include "structs/str_items.h"
#include "structs/str_mon_portrait.h"
#include "structs/str_text.h"
enum KangaskhanStorageStates
@ -45,8 +45,8 @@ struct KangaskhanStorageWork
u16 unk4C[5];
MenuStruct unk58;
unkStructFor8013AA0 unkA8;
/* 0xD8 */ struct MonPortraitMsg monPortrait;
struct MonPortraitMsg *monPortraitPtr;
/* 0xD8 */ MonPortraitMsg monPortrait;
MonPortraitMsg *monPortraitPtr;
WindowTemplates unkEC;
};

View File

@ -1,9 +1,9 @@
#ifndef GUARD_KECLEON_BROS1_H
#define GUARD_KECLEON_BROS1_H
#include "file_system.h"
#include "items.h"
#include "structs/menu.h"
#include "structs/str_mon_portrait.h"
#include "structs/str_text.h"
enum KecleonStoreStates
@ -63,8 +63,8 @@ typedef struct KecleonBrosWork1
/* 0x34 */ MenuItem menuItems[8];
u16 unk74[8];
/* 0x84 */ MenuStruct menu;
/* 0xD4 */ struct MonPortraitMsg monPortrait;
struct MonPortraitMsg *monPortraitPtr;
/* 0xD4 */ MonPortraitMsg monPortrait;
MonPortraitMsg *monPortraitPtr;
WindowTemplates unkE8;
} KecleonBrosWork1;

View File

@ -1,8 +1,8 @@
#ifndef GUARD_MAKUHITA_DOJO1_H
#define GUARD_MAKUHITA_DOJO1_H
#include "file_system.h"
#include "structs/menu.h"
#include "structs/str_mon_portrait.h"
#include "structs/str_text.h"
enum MakuhitaDojoInitMode
@ -28,8 +28,8 @@ typedef struct MakuhitaDojoWork1
/* 0x14 */ s32 menuAction;
MenuItem unk18[4];
u8 fill38[0x58 - 0x38];
/* 0x58 */ struct MonPortraitMsg monPortrait;
struct MonPortraitMsg *monPortraitPtr;
/* 0x58 */ MonPortraitMsg monPortrait;
MonPortraitMsg *monPortraitPtr;
WindowTemplates unk6C;
} MakuhitaDojoWork1;

View File

@ -1,14 +1,14 @@
#ifndef GUARD_POST_OFFICE_GUIDE1_H
#define GUARD_POST_OFFICE_GUIDE1_H
#include "file_system.h"
#include "structs/str_mon_portrait.h"
// size: 0x18
typedef struct PostOfficeWork
{
/* 0x0 */ u8 state;
/* 0x4 */ s32 currMenuChoice;
/* 0x8 */ struct MonPortraitMsg monPortrait;
/* 0x8 */ MonPortraitMsg monPortrait;
} PostOfficeWork;
void CleanHelperPelipper(void);

View File

@ -2,7 +2,6 @@
#define GUARD_RESCUE_PASSWORD_MENU_H
#include "structs/menu.h"
#include "sprite.h"
#include "structs/str_text.h"
// Similar to unkStruct_203B360

View File

@ -1,18 +1,6 @@
#ifndef GUARD_SAVE_WRITE_H
#define GUARD_SAVE_WRITE_H
#include "file_system.h"
// size: 0x20
typedef struct SavePakWrite
{
/* 0x0 */ u32 state;
s32 unk4;
/* 0x8 */ u32 saveStatus;
/* 0xC */ struct MonPortraitMsg monPortrait;
/* 0x1C */ u16 pokeID;
} SavePakWrite;
void FinishWriteSavePak(void);
u32 GetSavePakStatus(void);
void PrepareSavePakWrite(s16 pokemonID);

View File

@ -28,20 +28,33 @@ typedef struct unkStruct_20266B0
/* 0x8 */ void *dest;
} unkStruct_20266B0;
void AddSprite(SpriteOAM *, s32, UnkSpriteMem *, unkStruct_2039DB0 *);
void AddAxSprite(ax_pose *, axdata1 *, UnkSpriteMem *, unkStruct_2039DB0 *spriteMasks);
void AddSprite(SpriteOAM *, s32, UnkSpriteMem *, unkStruct_2039DB0 *spriteMasks);
void AxResInit(axdata *, axmain *, u32, u32 direction, u32, u32 spriteAnimIndex, bool8);
void AxResInitFile(axdata *, OpenedFile *, u32, u32, u32, u32 spriteAnimIndex, bool8);
void AxResInitUnorientedFile(axdata *, OpenedFile *, u32, u32, u32 spriteAnimIndex, bool8);
void BlinkSavingIcon(void);
void CopySpritesToOam(void);
void DoAxFrame_800558C(axdata *, s32 spriteX, s32 spriteY, u32, u32 paletteNum, unkStruct_2039DB0 *spriteMasks);
void InitSprites(void);
void nullsub_7(s16 *);
void nullsub_8(u32);
void nullsub_9(void);
void nullsub_10(bool8);
void nullsub_11(SpriteOAM *, s32, UnkSpriteMem *, unkStruct_2039DB0 *);
void nullsub_12(void);
void nullsub_13(void);
void nullsub_14(void);
void ResetSprites(bool8);
void SetSavingIconCoords(DungeonPos *);
void RunAxAnimationFrame(axdata *);
void SetSavingIconCoords(DungeonPos *pos);
void sub_8004E8C(unkStruct_2039DB0 *);
void sub_8005180(void);
void sub_8005304(void);
void sub_800533C(ax_pose **, UnkSpriteMem **, axdata1 *, unkStruct_2039DB0 *, bool8);
void AxResInitFile(axdata *, OpenedFile *, u32, u32, u32, u32, bool8);
void AxResInit(axdata *, axmain *, u32, u32, u32, u32, bool8);
void AxResInitUnorientedFile(axdata *, OpenedFile *, u32, u32, u32, bool8);
void RunAxAnimationFrame(struct axdata *);
void DoAxFrame_800558C(struct axdata *a0, s32 spriteX, s32 spriteY, u32 a3, u32 paletteNum, unkStruct_2039DB0 *spriteMasks);
void sub_8005610(OpenedFile *, s32 vramIdx, s32 brightness, const RGB *ramp);
const RGB *sub_8005674(const EfoFileData *, s32 vramIdx);
void sub_800569C(DungeonPos *, axObject *, u8);
void sub_8005700(DungeonPos *, axObject *);
void sub_8005770(s32, const RGB *color, s32 brightness, const RGB *ramp);
#endif // GUARD_SPRITE_H

View File

@ -1,10 +1,11 @@
#ifndef GUARD_STRING_FORMAT_H
#define GUARD_STRING_FORMAT_H
#include "file_system.h"
#include "structs/menu.h"
#include "structs/str_text.h"
#include "structs/rgb.h"
#include "structs/str_file_system.h"
#include "structs/str_mon_portrait.h"
#include "structs/str_text.h"
// TODO: once the files close to string_format.c are decompiled, check if these should be included here. Most likely, they should be declared elsewhere.
// code_80130A8.s
@ -15,28 +16,6 @@ u32 sub_80151C0(u32, u8 *);
u32 sub_80154F0(void);
void sub_80155F0(void);
struct PortraitGfxSub
{
const RGB *pal;
const u8 *gfx;
};
struct PortraitGfx
{
// NOTE: The actual number of sprites is different depending on pokemon. For example, starters have 12 sprites, while most legendaries only 1. [0] means that any number of sprites is valid.
struct PortraitGfxSub sprites[0];
};
struct MonPortraitMsg
{
OpenedFile *faceFile;
struct PortraitGfx *faceData;
DungeonPos pos;
u8 spriteId; // Which mon's sprite to use. For example Kecleon has multiple sprites depending on whether it's green or purple.
bool8 flip; // Whether the mon's sprite is flipped.
u8 unkE;
};
#define FORMAT_BUFFER_LEN 80
#define FRIEND_AREA_BUFFER_LEN 184
@ -49,10 +28,10 @@ extern u8 gFormatBuffer_FriendArea[FRIEND_AREA_BUFFER_LEN];
void sub_8014144(void);
void sub_801416C(s32 param_1,s32 param_2);
void CreateDialogueBoxAndPortrait(const u8 *text, void *param_2, struct MonPortraitMsg *monPortraitPtr, u16 flags);
void CreateYesNoDialogueBoxAndPortrait_DefaultYes(const u8 *text, struct MonPortraitMsg *monPortraitPtr, u16 flags);
void CreateYesNoDialogueBoxAndPortrait_DefaultNo(const u8 *text, struct MonPortraitMsg *monPortraitPtr, u16 flags);
void CreateMenuDialogueBoxAndPortrait(const u8 *text, void *a1, u32 r9, const MenuItem *menuItems, void *arg_0, u32 a5, u32 unknownUnused, struct MonPortraitMsg *monPortraitPtr, u16 flags);
void CreateDialogueBoxAndPortrait(const u8 *text, void *param_2, MonPortraitMsg *monPortraitPtr, u16 flags);
void CreateYesNoDialogueBoxAndPortrait_DefaultYes(const u8 *text, MonPortraitMsg *monPortraitPtr, u16 flags);
void CreateYesNoDialogueBoxAndPortrait_DefaultNo(const u8 *text, MonPortraitMsg *monPortraitPtr, u16 flags);
void CreateMenuDialogueBoxAndPortrait(const u8 *text, void *a1, u32 r9, const MenuItem *menuItems, void *arg_0, u32 a5, u32 unknownUnused, MonPortraitMsg *monPortraitPtr, u16 flags);
void sub_8014490(void);
s32 sub_80144A4(s32 *a0);
void DrawDialogueBoxString(void);

View File

@ -1,6 +1,7 @@
#ifndef GUARD_AXDATA_H
#define GUARD_AXDATA_H
#include "structs/rgb.h"
#include "structs/str_file_system.h"
#include "structs/str_position.h"
@ -28,21 +29,21 @@ typedef struct axdata1
} axdata1;
// Size: 0x2
typedef struct __attribute__((packed, aligned(2))) ax_pose_unk2
typedef struct ax_pose_unk2
{
u8 unk0;
s8 unk1;
} ax_pose_unk2;
} ax_pose_unk2 __attribute__((packed, aligned(2)));
// size: 0xA
typedef struct __attribute__((packed, aligned(2))) ax_pose
typedef struct ax_pose
{
/* 0x0 */ s16 sprite;
/* 0x2 */ ax_pose_unk2 unk2; // Always {0, 0} in red (except for end markers which are {0xFF, 0xFF})
/* 0x4 */ u16 flags1;
/* 0x6 */ u16 flags2;
/* 0x8 */ u16 flags3;
} ax_pose;
} ax_pose __attribute__((packed, aligned(2)));
// size: 0xC
typedef struct ax_anim
@ -80,7 +81,7 @@ typedef struct axmain
} axmain;
// size: 0x4C
struct axObject
typedef 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 friend_areas_map_util.AnimateSprites()
@ -97,12 +98,12 @@ struct axObject
struct EntityInfo* monster;
struct Trap* trap;
} info;
};
} axObject;
// size: 0x80? (assuming it's the last sub-struct of GroundLives)
struct axPokemon
typedef struct axPokemon
{
struct axObject obj;
axObject obj;
/* 0x4C */ axmain *axmain;
u16 flags_0x50;
s16 unk52;
@ -123,6 +124,24 @@ struct axPokemon
s32 unk74;
s32 unk78;
s32 unk7C;
};
} axPokemon;
typedef struct Palette256
{
RGB pal[256];
} Palette256;
// size: 0x20
typedef struct EfoFileData
{
/* 0x0 */ ax_pose **poses; // TODO: Verify if these fields' names are actually valid
/* 0x4 */ ax_anim ***animations;
/* 0x8 */ s32 animCount;
/* 0xC */ void *spriteData; // ?
/* 0x10 */ Palette256 *unk10; // ?
/* 0x14 */ const u32 *tiles;
/* 0x18 */ const RGB *pal;
/* 0x1C */ s32 tileCount;
} EfoFileData;
#endif // GUARD_AXDATA_H

View File

@ -12,7 +12,6 @@
#include "structs/str_iq_skill_flags.h"
#include "math.h"
#include "number_util.h"
#include "sprite.h"
#define MAX_STAT_STAGE 20
#define STAT_MULTIPLIER_THRESHOLD 0.249 // one tick less than 0.25
@ -361,7 +360,7 @@ typedef struct Entity
// The global spawn index counter starts at 10. Each Pokémon that spawns increments the counter and
// gets assigned the current counter value as its spawn index.
/* 0x26 */ u16 spawnGenID;
/* 0x28 */ struct axObject axObj;
/* 0x28 */ axObject axObj;
} Entity;
enum EntityType

View File

@ -1,9 +1,9 @@
#ifndef GUARD_STR_3001B64_H
#define GUARD_STR_3001B64_H
#include "file_system.h"
#include "structs/menu.h"
#include "string_format.h"
#include "structs/str_file_system.h"
#include "structs/str_mon_portrait.h"
// Maybe Position32?
struct unkStruct_3001B64_sub_sub
@ -22,7 +22,7 @@ struct unkStruct_3001B64_sub
s8 unk6;
u8 unk7;
struct unkStruct_3001B64_sub_sub unk8;
struct MonPortraitMsg monPortrait;
MonPortraitMsg monPortrait;
/* 0x20 */ OpenedFile *faceFile;
};

View File

@ -9,7 +9,6 @@
#include "structs/str_position.h"
#include "structs/str_traps.h"
#include "structs/str_dungeon_location.h"
#include "sprite.h"
#define DUNGEON_MAX_SIZE_X 56
#define DUNGEON_MAX_SIZE_Y 32

View File

@ -0,0 +1,33 @@
#ifndef GUARD_STR_MON_PORTRAIT_H
#define GUARD_STR_MON_PORTRAIT_H
#include "structs/rgb.h"
#include "structs/str_file_system.h"
#include "structs/str_position.h"
// size: 0x8
typedef struct PortraitGfxSub
{
const RGB *pal;
const u8 *gfx;
} PortraitGfxSub;
// size: variable
typedef struct PortraitGfx
{
// NOTE: The actual number of sprites is different depending on pokemon. For example, starters have 12 sprites, while most legendaries only 1. [0] means that any number of sprites is valid.
PortraitGfxSub sprites[0];
} PortraitGfx;
// size: 0xC
typedef struct MonPortraitMsg
{
OpenedFile *faceFile;
PortraitGfx *faceData;
DungeonPos pos;
u8 spriteId; // Which mon's sprite to use. For example Kecleon has multiple sprites depending on whether it's green or purple.
bool8 flip; // Whether the mon's sprite is flipped.
u8 unkE;
} MonPortraitMsg;
#endif // GUARD_STR_MON_PORTRAIT_H

View File

@ -1,6 +1,20 @@
#ifndef GUARD_STR_TEXT_H
#define GUARD_STR_TEXT_H
#include "structs/str_position.h"
// size: 0xC
typedef struct unkChar
{
const u16 *unk0;
u16 unk4;
s16 unk6;
u8 unk8;
u8 fill9;
u8 unkA;
u8 fillB;
} unkChar;
// size: 0x48
typedef struct Window
{
@ -37,8 +51,6 @@ typedef struct WindowHeader
/* 0x3 */ u8 f3;
} WindowHeader;
#include "structs/str_position.h"
// size: 0x18
typedef struct WindowTemplate
{
@ -52,14 +64,14 @@ typedef struct WindowTemplate
const WindowHeader *header;
} WindowTemplate;
#define WINDOW_TYPE_0 0
#define WINDOW_TYPE_WITHOUT_BORDER 1
#define WINDOW_TYPE_2 2
#define WINDOW_TYPE_NORMAL 3
#define WINDOW_TYPE_4 4
#define WINDOW_TYPE_FILL_TRANSPARENT 5
#define WINDOW_TYPE_WITH_HEADER 6
#define WINDOW_TYPE_7 7
#define WINDOW_TYPE_0 0
#define WINDOW_TYPE_WITHOUT_BORDER 1
#define WINDOW_TYPE_2 2
#define WINDOW_TYPE_NORMAL 3
#define WINDOW_TYPE_4 4
#define WINDOW_TYPE_FILL_TRANSPARENT 5
#define WINDOW_TYPE_WITH_HEADER 6
#define WINDOW_TYPE_7 7
#define MAX_WINDOWS 4
@ -72,4 +84,4 @@ typedef struct WindowTemplates
/* 0x0 */ WindowTemplate id[MAX_WINDOWS];
} WindowTemplates;
#endif // GUARD_STR_TEXT_H
#endif // GUARD_STR_TEXT_H

View File

@ -4,8 +4,8 @@
#include "structs/menu.h"
#include "structs/str_text.h"
s32 sub_80095E4(s32 a0, s32 a1);
s32 sub_8009614(s32 a0, s32 a1);
#include "text_1.h"
#include "text_3.h"
// Struct related with sub_80095E4
typedef struct struct_Sub80095E4

View File

@ -1,104 +0,0 @@
#ifndef GUARD_TEXT_H
#define GUARD_TEXT_H
#include "structs/str_text.h"
// size: 0x10
struct unkShiftData
{
u32 bytesA;
u32 bytesB;
u32 shift_left;
u32 shift_right;
};
// size: 0xC
struct unkChar
{
const u16 *unk0;
u16 unk4;
s16 unk6;
u8 unk8;
u8 fill9;
u8 unkA;
u8 fillB;
};
struct UnkDrawStringStruct;
struct UnkDrawStringStruct
{
s16 unk0;
s16 unk2;
s16 unk4;
s16 unk6;
s16 unk8;
s16 unkA;
s32 unkC;
u32 unk10;
u32 unk14;
u32 unk18;
u32 unk1C;
u8 unk20;
u8 unk21;
u8 fill22;
u8 fill23;
const u8* (*unk24)(const u8 *, const u8 *, struct UnkDrawStringStruct*);
s32 unk28;
s32 unk2C;
s32 unk30;
};
extern Window gWindows[MAX_WINDOWS];
extern u8 gUnknown_202749A[11];
extern bool8 gUnknown_20274A5;
// These should probably go to code_8009804.h
#define TILEMAP_TILE_NUM(num)(num & 0x3FF) // bits 0-9
#define TILEMAP_FLIP_HORIZONTAL(f)((f & 1) << 10) // bit 10
#define TILEMAP_FLIP_VERTICAL(f)((f & 1) << 11) // bit 11
#define TILEMAP_PAL(pal)((pal & 0xF) << 12) // bits 12-15
extern u16 gBgTilemaps[4][32][32]; // 4 bgs, 32x32 tiles, y dimension goes before x [bgId][y][x]
extern void (*ScrollDownWindowFunc)(s32 windowId);
extern void (*ScrollUpWindowFunc)(s32 windowId);
extern void (*gIwramTextFunc3)(s32 a0);
extern void (*gIwramTextFunc4)(s32 a0);
void LoadCharmaps(void);
u32 UpdateFadeInTile(u32 a0);
u32 sub_80063B0(void);
void SelectCharmap(u32 a0);
void SetCharacterMask(int a0);
void ShowWindows(const WindowTemplates *windows, bool8 a1, bool8 a2);
void RestoreUnkTextStruct_8006518(WindowTemplates *unkData);
u32 sub_8006544(u32 index);
void sub_8007334(s32 windowId);
void sub_80073B8(s32 a0);
void sub_80073E0(s32 a0);
u32 xxx_call_draw_char(s32 x, s32 y, u32 a2, u32 color, u32 a4);
void AddDoubleUnderScoreHighlight(u32 windowId, s32 x, s32 y, s32 width, u32 color);
void AddUnderScoreHighlight(u32 windowId, s32 x, s32 y, s32 width, u32 color);
void sub_8007A78(u32 a0, s32 x, s32 y, s32 a3, u32 color);
void sub_8007B7C(u32 a0, s32 x, s32 y, s32 a3, u32 color);
void sub_8007E20(u32 a0, u32 a1, u32 a2, u32 a3, u32 a4, u32 *a5, u32 a6);
void DisplayMonPortraitSprite(s32 a0, const u8 *compressedData, s32 a2);
void DisplayMonPortraitSpriteFlipped(s32 a0, const u8 *compressedData, s32 a1);
const struct unkChar *GetCharacter(s32 chr);
const u8 *xxx_get_next_char_from_string(const u8 *a1, u32 *a0);
void sub_80087EC(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4);
bool8 xxx_call_update_bg_vram(void);
void CallPrepareTextbox_8008C54(u32 strId);
bool8 sub_8008D8C(u32 strId);
void sub_8008DC8(s32 a0, s32 a1, u16 a2, s32 a3);
s32 sub_8008ED0(const u8 *str);
void PrintStringOnWindow2(s32 x, s32 y, const u8 *str, u32 windowId, u32 terminatingChr, s32 lineSpacing);
void PrintStringOnWindow(s32 x, s32 y, const u8 *str, u32 windowId, u32 terminatingChr);
const u8 *xxx_handle_format_global(const u8 *str, struct UnkDrawStringStruct *unkStrPtr);
void sub_8009408(s32 from, s32 to);
void sub_8009524(s32 strArrId);
void sub_80095CC(s32 a0, s32 a1);
s32 sub_80095E4(s32 a0, s32 a1);
s32 sub_8009614(s32 a0, s32 a1);
#endif // GUARD_TEXT_H

65
include/text_1.h Normal file
View File

@ -0,0 +1,65 @@
#ifndef GUARD_TEXT_1_H
#define GUARD_TEXT_1_H
#include "structs/str_text.h"
// These should probably go to code_8009804.h
#define TILEMAP_TILE_NUM(num)(num & 0x3FF) // bits 0-9
#define TILEMAP_FLIP_HORIZONTAL(f)((f & 1) << 10) // bit 10
#define TILEMAP_FLIP_VERTICAL(f)((f & 1) << 11) // bit 11
#define TILEMAP_PAL(pal)((pal & 0xF) << 12) // bits 12-15
// size: 0x10
typedef struct unkShiftData
{
u32 bytesA;
u32 bytesB;
u32 shift_left;
u32 shift_right;
} unkShiftData;
typedef struct CharMapStruct
{
s32 unk0;
unkChar *unk4;
} CharMapStruct;
extern Window gWindows[MAX_WINDOWS];
extern CharMapStruct *gCharmaps[2];
extern s16 gCharacterSpacing;
extern u8 gUnknown_202749A[11];
extern bool8 gUnknown_20274A5;
extern u8 gUnknown_20274A6[6];
extern s32 gCurrentCharmap;
extern s32 gUnknown_202B020;
extern s32 gUnknown_202B024;
extern s32 gCharHeight[2];
extern u32 gTextShadowMask;
extern u8 gDrawTextShadow;
extern u16 gBgTilemaps[4][32][32];
extern void (*ScrollDownWindowFunc)(s32 windowId);
extern void (*ScrollUpWindowFunc)(s32 windowId);
extern void (*gIwramTextFunc3)(s32 a0);
extern void (*gIwramTextFunc4)(s32 a0);
extern s16 gUnknown_3000E94[161];
extern const u32 gUnknown_80B853C[16];
extern const unkShiftData gCharMasksOffsets[8];
extern const unkChar gUnknown_80B86A4;
extern const u32 gUnknown_80B86B4[][32];
void LoadCharmaps(void);
void RestoreSavedWindows(WindowTemplates *dst);
void SelectCharmap(u32);
void SetCharacterMask(s32);
void ShowWindows(const WindowTemplates *winTemplates, bool8, bool8);
u32 sub_80063B0(void);
u32 sub_8006544(u32 index);
void sub_8007334(s32 windowId);
void sub_80073B8(s32 windowId);
void sub_80073E0(s32 windowId);
u32 UpdateFadeInTile(u32);
#endif // GUARD_TEXT_1_H

24
include/text_2.h Normal file
View File

@ -0,0 +1,24 @@
#ifndef GUARD_TEXT_2_H
#define GUARD_TEXT_2_H
#include "structs/str_text.h"
void AddDoubleUnderScoreHighlight(u32 windowId, s32 x, s32 y, s32 width, u32 color);
void AddUnderScoreHighlight(u32 windowId, s32 x, s32 y, s32 width, u32 color);
void CallPrepareTextbox_8008C54(u32 strId);
void DisplayMonPortraitSprite(s32 a0, const u8 *compressedData, s32 a2);
void DisplayMonPortraitSpriteFlipped(s32 a0, const u8 *compressedData, s32 a1);
const unkChar *GetCharacter(s32 chr);
void PrepareTextbox_8008C6C(Window *windows, u32 windowId);
void ResetWindowBgData(void);
void sub_8007A78(u32 a0, s32 x, s32 y, s32 a3, u32 color);
void sub_8007B7C(u32 a0, s32 x, s32 y, s32 a3, u32 color);
void sub_8007E20(u32 a0, u32 a1, u32 a2, u32 a3, u32 a4, u32 *a5, u32 a6);
void sub_80087EC(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4);
void sub_80089AC(const WindowTemplate *r4, DungeonPos *r5_Str);
u32 xxx_call_draw_char(s32 x, s32 y, u32 a2, u32 color, u32 a4);
bool8 xxx_call_update_bg_vram(void);
u32 xxx_draw_char(Window *windows, s32 x, s32 y, u32 a3, u32 color, u32 windowId);
const u8 *xxx_get_next_char_from_string(const u8 *a1, u32 *a0);
#endif // GUARD_TEXT_2_H

41
include/text_3.h Normal file
View File

@ -0,0 +1,41 @@
#ifndef GUARD_TEXT_3_H
#define GUARD_TEXT_3_H
// size: 0x34
typedef struct UnkDrawStringStruct
{
s16 unk0;
s16 unk2;
s16 unk4;
s16 unk6;
s16 unk8;
s16 unkA;
s32 unkC;
u32 unk10;
u32 unk14;
u32 unk18;
u32 unk1C;
u8 unk20;
u8 unk21;
u8 fill22;
u8 fill23;
const u8 * (*unk24)(const u8 *, const u8 *, struct UnkDrawStringStruct *);
s32 unk28;
s32 unk2C;
s32 unk30;
} UnkDrawStringStruct;
void PrintStringOnWindow(s32 x, s32 y, const u8 *str, u32 windowId, u32 terminatingChr);
void PrintStringOnWindow2(s32 x, s32 y, const u8 *str, u32 windowId, u32 terminatingChr, s32 lineSpacing);
bool8 sub_8008D8C(s32 windowId);
void sub_8008DC8(s32 x, s32 y, u16 bg0Val, u16 bg1Val);
s32 sub_8008ED0(const u8 *str);
void sub_8009388(void);
void sub_8009408(s32 from, s32 to);
void sub_8009524(s32 windowId);
void sub_80095CC(s32 a0, s32 a1);
s32 sub_80095E4(s32 a0, s32 a1);
s32 sub_8009614(s32 a0, s32 a1);
const u8 *xxx_handle_format_global(const u8 *str, UnkDrawStringStruct *unkStrPtr);
#endif // GUARD_TEXT_3_H

9
include/text_4.h Normal file
View File

@ -0,0 +1,9 @@
#ifndef GUARD_TEXT_4_H
#define GUARD_TEXT_4_H
void ScrollDownWindow(s32 windowId);
void ScrollUpWindow(s32 windowId);
void sub_82729A4(s32 id);
void sub_8272A78(s32 id);
#endif // GUARD_TEXT_4_H

View File

@ -2,9 +2,9 @@
#define GUARD_THANK_YOU_WONDER_MAIL_H
#include "constants/wonder_mail.h"
#include "file_system.h"
#include "structs/menu.h"
#include "structs/str_items.h"
#include "structs/str_mon_portrait.h"
#include "structs/str_text.h"
#include "structs/str_wonder_mail.h"
@ -25,7 +25,7 @@ typedef struct WonderMailStruct_203B2C4
WindowTemplates unk35C;
WindowTemplates unk3BC;
Item unk41C;
/* 0x420 */ struct MonPortraitMsg monPortrait;
/* 0x420 */ MonPortraitMsg monPortrait;
u32 unk430;
/* 0x434 */ u8 formattedString[0x100];
/* 0x534 */ s32 wonderMailMethod;

View File

@ -1,8 +1,8 @@
#ifndef GUARD_WIGGLYTUFF_SHOP3_H
#define GUARD_WIGGLYTUFF_SHOP3_H
#include "file_system.h"
#include "structs/menu.h"
#include "structs/str_mon_portrait.h"
#include "structs/str_text.h"
enum WigglytuffStates
@ -52,8 +52,8 @@ typedef struct WigglytuffShop3Work
MenuItem unk1C[8];
u16 unk5C[8];
MenuStruct unk6C;
/* 0xBC */ struct MonPortraitMsg monPortrait;
struct MonPortraitMsg *monPortraitPtr;
/* 0xBC */ MonPortraitMsg monPortrait;
MonPortraitMsg *monPortraitPtr;
WindowTemplates unkD0;
u32 unk130;
u32 unk134;

View File

@ -2,8 +2,8 @@
#define GUARD_WONDER_MAIL_H
#include "constants/wonder_mail.h"
#include "file_system.h"
#include "structs/menu.h"
#include "structs/str_mon_portrait.h"
#include "structs/str_wonder_mail.h"
// size: 0x548
@ -25,7 +25,7 @@ typedef struct WonderMailStruct_203B2C0
WindowTemplates unk35C;
WindowTemplates unk3BC;
/* 0x41C */ u32 unkfill; // ItemSlot?
/* 0x420 */ struct MonPortraitMsg monPortrait;
/* 0x420 */ MonPortraitMsg monPortrait;
/* 0x430 */ u8 padding3[0x534 - 0x430];
u32 unk534;
s32 unk538; // A7 << 3

View File

@ -62,12 +62,17 @@ SECTIONS {
src/sprite.o(.text);
src/code_800558C.o(.text);
src/random.o(.text);
src/text.o(.text);
src/text_1.o(.text);
src/text_2.o(.text);
src/text_3.o(.text);
src/text_4.o(.text);
src/code_8009804.o(.text);
asm/code_8009804.o(.text);
src/math.o(.text);
src/file_system.o(.text);
src/decompress.o(.text);
src/decompress_sir.o(.text);
src/decompress_at.o(.text);
src/decompress_3.o(.text);
src/main.o(.text);
src/reg_control.o(.text);
src/music.o(.text);
@ -402,12 +407,13 @@ SECTIONS {
src/memory.o(.rodata);
data/data1.o(.rodata);
src/random.o(.rodata);
src/text.o(.rodata);
src/text_1.o(.rodata);
src/text_2.o(.rodata);
src/code_8009804.o(.rodata);
data/data2.o(.rodata);
src/math.o(.rodata);
src/file_system.o(.rodata);
src/decompress.o(.rodata);
src/decompress_at.o(.rodata);
data/data_80B9BB8.o(.rodata);
src/main.o(.rodata);
src/reg_control.o(.rodata);

View File

@ -1,22 +1,22 @@
#include "global.h"
#include "globaldata.h"
#include "constants/input.h"
#include "structs/struct_sub80095e4.h"
#include "adventure_log.h"
#include "code_80118A4.h"
#include "string_format.h"
#include "code_8097670.h"
#include "constants/input.h"
#include "input.h"
#include "memory.h"
#include "menu_input.h"
#include "text.h"
#include "structs/struct_sub80095e4.h"
#include "string_format.h"
#include "text_1.h"
#include "text_2.h"
static EWRAM_INIT struct_Sub80095E4_2 *sAdventureLog = {NULL};
static EWRAM_INIT struct_Sub80095E4_2 *sAdventureLog = { NULL };
#include "data/adventure_log.h"
static void DisplayAdventureLog();
static void sub_8032084();
bool8 CreateAdventureLogScreen(u32 kind)
@ -24,7 +24,7 @@ bool8 CreateAdventureLogScreen(u32 kind)
sAdventureLog = MemoryAlloc(sizeof(*sAdventureLog), 8);
sAdventureLog->s0.unk34 = kind;
sAdventureLog->s0.unk38 = &sAdventureLog->s0.windows.id[kind];
RestoreUnkTextStruct_8006518(&sAdventureLog->s0.windows);
RestoreSavedWindows(&sAdventureLog->s0.windows);
sAdventureLog->s0.windows.id[sAdventureLog->s0.unk34] = sUnknown_80E2008;
sAdventureLog->s0.unk38->header = &sAdventureLog->unk9C;

View File

@ -1,9 +1,9 @@
#include "global.h"
#include "constants/main_menu.h"
#include "adventure_log.h"
#include "adventure_log_menu.h"
#include "constants/main_menu.h"
#include "input.h"
#include "text.h"
#include "text_1.h"
void CreateAdventureLogMenu(void)
{

View File

@ -11,6 +11,10 @@ struct S
u8 x0[UNK_STRUCT_ARR_COUNT];
};
extern const PixelPos gVectorDirections[8];
static s8 VecDirection4Radial(PixelPos *pixelPos);
u16 sub_8002774(struct S s)
{
return ((s.x0[2] & 0xF8) << 7) | ((s.x0[1] & 0xF8) << 2) | ((s.x0[0] & 0xF8) >> 3);
@ -63,22 +67,28 @@ UNUSED static void sub_800282C(struct S *dst, s32 a1, struct S *a2, struct S *a3
*dst = *a3;
}
// File split here?
extern PixelPos gVectorDirections[8];
// TODO: File split here
// arm9.bin::02010314
void sub_800290C(PixelPos *param_1, s32 param_2)
{
if (param_1->x > param_2)
param_1->x = param_2;
else if (param_1->x < -param_2)
param_1->x = -param_2;
if (param_1->y > param_2)
param_1->y = param_2;
else if(param_1->y < -param_2)
param_1->y = -param_2;
}
// arm9.bin::020102B8
void sub_8002934(PixelPos *param_1, PixelPos *param_2, PixelPos *param_3, s32 param_4, s32 param_5)
{
s32 r9 = (param_4 + param_5);
@ -86,11 +96,22 @@ void sub_8002934(PixelPos *param_1, PixelPos *param_2, PixelPos *param_3, s32 pa
param_1->y = (param_4 * param_2->y + param_5 * param_3->y) / r9;
}
// TODO: File split here
static inline s8 sub_8002984_sub(s32 direction1, s32 rand, s32 add, s32 multi)
{
return (s8)(((direction1 + add) + OtherRandInt(rand) * multi) % NUM_DIRECTIONS);
}
// arm9.bin::020109F4
s32 sub_8002984(s32 _direction1, u32 caseID)
{
s32 direction1;
@ -151,7 +172,7 @@ s32 sub_8002984(s32 _direction1, u32 caseID)
return direction1;
}
// arm9.bin::020108EC
s32 sub_8002A70(s32 _direction1, s32 _direction2, s32 _caseId)
{
s32 direction1 = (s8)(_direction1);
@ -196,6 +217,7 @@ s32 sub_8002A70(s32 _direction1, s32 _direction2, s32 _caseId)
return direction1;
}
// arm9.bin::02010824
s32 sub_8002B04(s32 _direction1, s32 _direction2)
{
s32 direction1 = (s8)(_direction1);
@ -217,11 +239,12 @@ s32 sub_8002B04(s32 _direction1, s32 _direction2)
return direction1;
}
UNUSED s32 sub_8002B5C(s32 _direction1, s32 _direction2)
#if (GAME_VERSION == VERSION_RED)
UNUSED static s32 sub_8002B5C(s32 _direction1, s32 _direction2)
{
int newDirection;
int direction1;
int direction2;
s32 newDirection;
s32 direction1;
s32 direction2;
direction1 = (s8)_direction1;
direction2 = (s8)_direction2;
@ -241,50 +264,43 @@ UNUSED s32 sub_8002B5C(s32 _direction1, s32 _direction2)
}
return direction1 & DIRECTION_MASK_CARDINAL;
}
#endif
// arm9.bin::02010790
PixelPos SetVecFromDirectionSpeed(s8 r1, u32 r2)
{
PixelPos *vec = &gVectorDirections[r1];
const PixelPos *vec = &gVectorDirections[r1];
return (PixelPos){ .x = vec->x * r2, .y = vec->y * r2 };
}
s32 VecDirection8Sign(PixelPos *param_1)
UNUSED static s32 VecDirection8Sign(PixelPos *param_1)
{
if (param_1->x < 0) {
if (param_1->y < 0) {
if (param_1->y < 0)
return DIRECTION_NORTHWEST;
}
else if (param_1->y > 0) {
else if (param_1->y > 0)
return DIRECTION_SOUTHWEST;
}
else {
else
return DIRECTION_WEST;
}
}
else if (param_1->x > 0) {
if (param_1->y < 0) {
if (param_1->y < 0)
return DIRECTION_NORTHEAST;
}
else if (param_1->y > 0) {
else if (param_1->y > 0)
return DIRECTION_SOUTHEAST;
}
else {
else
return DIRECTION_EAST;
}
}
else if (param_1->y < 0) {
else if (param_1->y < 0)
return DIRECTION_NORTH;
}
else if (param_1->y > 0) {
else if (param_1->y > 0)
return DIRECTION_SOUTH;
}
else {
else
return -1;
}
}
s32 VecDirection4SignYX(PixelPos *param_1)
UNUSED static s32 VecDirection4SignYX(PixelPos *param_1)
{
if (param_1->y < 0) {
return DIRECTION_NORTH;
@ -303,6 +319,7 @@ s32 VecDirection4SignYX(PixelPos *param_1)
}
}
// arm9.bin::02010680
s8 VecDirection8Radial(PixelPos *pixelPos)
{
PixelPos absPos = {abs(pixelPos->x), abs(pixelPos->y)};
@ -355,7 +372,8 @@ s8 VecDirection8Radial(PixelPos *pixelPos)
return DIRECTION_SOUTH;
}
s8 VecDirection4Radial(PixelPos *pixelPos)
// arm9.bin::020105A0
static s8 VecDirection4Radial(PixelPos *pixelPos)
{
PixelPos absPos = {abs(pixelPos->x), abs(pixelPos->y)};
@ -395,6 +413,7 @@ s8 VecDirection4Radial(PixelPos *pixelPos)
return DIRECTION_SOUTH;
}
// arm9.bin::02010478
s8 SizedDeltaDirection4(const PixelPos *r0, const PixelPos *r1, const PixelPos *r2, const PixelPos *r3)
{
PixelPos stack;
@ -435,10 +454,10 @@ s8 SizedDeltaDirection4(const PixelPos *r0, const PixelPos *r1, const PixelPos *
if(stack.y > 0) stack.y = 0;
}
return VecDirection4Radial(&stack);
}
// arm9.bin::02010350
s8 SizedDeltaDirection8(const PixelPos *r0, const PixelPos *r1, const PixelPos *r2, const PixelPos *r3)
{
PixelPos stack;
@ -446,39 +465,38 @@ s8 SizedDeltaDirection8(const PixelPos *r0, const PixelPos *r1, const PixelPos *
s32 iVar2;
s32 iVar3;
stack.x = r2->x - r0->x;
stack.y = r2->y - r0->y;
stack.x = r2->x - r0->x;
stack.y = r2->y - r0->y;
if(stack.x >= 0)
{
iVar3 = (stack.x + 1);
iVar3 -= ((r1->x + r3->x) / 2);
if (stack.x >= 0) {
iVar3 = stack.x + 1;
iVar3 -= (r1->x + r3->x) / 2;
stack.x = iVar3;
if(stack.x < 0) stack.x = 0;
if (stack.x < 0)
stack.x = 0;
}
else
{
iVar1 = (stack.x - 1);
iVar1 += ((r1->x + r3->x) / 2);
else {
iVar1 = stack.x - 1;
iVar1 += (r1->x + r3->x) / 2;
stack.x = iVar1;
if(stack.x > 0) stack.x = 0;
if (stack.x > 0)
stack.x = 0;
}
if(stack.y >= 0)
{
iVar2 = (stack.y + 1);
iVar2 -= ((r1->y + r3->y) / 2);
if (stack.y >= 0) {
iVar2 = stack.y + 1;
iVar2 -= (r1->y + r3->y) / 2;
stack.y = iVar2;
if(stack.y < 0) stack.y = 0;
if (stack.y < 0)
stack.y = 0;
}
else
{
iVar1 = (stack.y - 1);
iVar1 += ((r1->y + r3->y) / 2);
else {
iVar1 = stack.y - 1;
iVar1 += (r1->y + r3->y) / 2;
stack.y = iVar1;
if(stack.y > 0) stack.y = 0;
if (stack.y > 0)
stack.y = 0;
}
return VecDirection8Radial(&stack);
}

View File

@ -3,7 +3,8 @@
#include "code_8004AA0.h"
void nullsub_6(void)
{}
{
}
void sub_8004AA4(unkStruct_202EE8C *a0, OpenedFile *a1, s32 a2)
{

View File

@ -1,24 +1,21 @@
#include "global.h"
#include "bg_control.h"
#include "bg_palette_buffer.h"
#include "code_800558C.h"
#include "cpu.h"
#include "math.h"
#include "sprite.h"
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 static s32 sUnknown_2026E40 = 0; // Read from but never written to
EWRAM_DATA static s32 sUnknown_2026E44 = 0; // Read from but never written to
EWRAM_DATA static s32 sUnknown_2026E48 = 0; // Read from but never written to
EWRAM_DATA static 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_DATA static bool32 sUnknown_2026E50 = FALSE;
EWRAM_DATA static bool32 sUnknown_2026E54 = FALSE;
EWRAM_DATA static u32 *sUnknown_2026E58 = NULL;
UNUSED EWRAM_DATA static u32 sUnused0 = 0;
EWRAM_DATA static s16 sUnknown_2026E60[324] = {0}; // These might be [2][162]
EWRAM_DATA static s16 sUnknown_20270E8[324] = {0};
EWRAM_INIT s16 *gUnknown_203B078 = NULL;
@ -29,173 +26,7 @@ extern const s16 gUnknown_80B816A[16 * 10];
extern const s16 gUnknown_80B82AA[16 * 10];
extern const s16 gUnknown_80B83EA[16 * 10];
static void sub_800561C(struct EfoFileData *, s32, s32, const RGB *);
void sub_8005610(OpenedFile *a0, s32 vramIdx, s32 brightness, const RGB *ramp)
{
sub_800561C((struct EfoFileData *)a0->data, vramIdx, brightness, ramp);
}
static void sub_800561C(struct EfoFileData *a0, s32 vramIdx, s32 brightness, const RGB *ramp)
{
s32 i;
if (a0->tiles != NULL)
CpuCopy(OBJ_VRAM0 + vramIdx * 0x20, a0->tiles, a0->tileCount * 0x20);
if (a0->pal != NULL) {
for (i = 0; i < 16; i++)
SetBGPaletteBufferColorRGB(i + 480, &a0->pal[i], brightness, ramp);
}
}
UNUSED static const RGB *sub_8005668(OpenedFile *a0, s32 vramIdx)
{
return sub_8005674((struct EfoFileData *)a0->data, vramIdx);
}
const RGB *sub_8005674(const struct EfoFileData *a0, s32 vramIdx)
{
if (a0->tiles != NULL)
CpuCopy(OBJ_VRAM0 + vramIdx * 0x20, a0->tiles, a0->tileCount * 0x20);
return a0->pal;
}
void sub_800569C(DungeonPos *a0, struct axObject *a1, u8 a2)
{
DungeonPos *ptr;
DungeonPos *ptr2;
DungeonPos *ptr3;
a0->x = 0;
a0->y = 0;
if (!(a1->axdata.flags >> 15) || a2 >= 4)
return;
if (a1->axdata.paletteData != NULL) {
ptr = &((DungeonPos*)a1->axdata.paletteData)[a1->axdata.sub1.poseId * 4];
ptr2 = &ptr[a2];
if (*&ptr2->x == 99 && *&ptr2->y == 99) {
a0->x = 99;
a0->y = 99;
}
else {
ptr3 = &ptr[a2];
a0->x = a1->axdata.sub1.offset.x + ptr3->x;
a0->y = a1->axdata.sub1.offset.y + ptr3->y;
}
}
else {
a0->x = 99;
a0->y = 99;
}
}
void sub_8005700(DungeonPos *a0, struct axObject *a1)
{
s32 i;
DungeonPos *ptr;
if (!(a1->axdata.flags >> 15))
return;
if (a1->axdata.paletteData != NULL) {
ptr = &((DungeonPos*)a1->axdata.paletteData)[a1->axdata.sub1.poseId * 4];
for (i = 0; i < 4; i++) {
if (*&ptr[i].x == 99 && *&ptr[i].y == 99) {
a0->x = 99;
a0->y = 99;
}
else {
a0->x = a1->axdata.sub1.offset.x + ptr[i].x;
a0->y = a1->axdata.sub1.offset.y + ptr[i].y;
}
a0++;
}
}
else {
for (i = 0; i < 4; i++) {
a0->x = 99;
a0->y = 99;
a0++;
}
}
}
UNUSED static void sub_8005764(s32 a0, OpenedFile *file, s32 a2, const RGB *a3)
{
sub_8005770(a0, (const RGB*)file->data, a2, a3);
}
void sub_8005770(s32 param_1, const RGB *color, s32 brightness, const RGB *ramp)
{
s32 i;
for (i = 0; i < 16; i++)
SetBGPaletteBufferColorRGB((param_1 + 0x10) * 0x10 + i, &color[i], brightness, ramp);
}
// Maybe DungeonPos
void nullsub_7(s16 *a0)
{}
void nullsub_8(u32 a0)
{}
void nullsub_9(void)
{}
void nullsub_10(bool8 a0)
{}
UNUSED static void nullsub_144(void)
{}
void nullsub_11(void)
{}
void nullsub_12(void)
{}
void nullsub_13(void)
{}
UNUSED static void nullsub_145(void)
{}
void nullsub_14(void)
{}
UNUSED static void nullsub_146(void)
{}
UNUSED static void nullsub_147(void)
{}
UNUSED static void nullsub_148(void)
{}
UNUSED static void nullsub_149(void)
{}
UNUSED static bool8 sub_80057D8(void)
{
return FALSE;
}
UNUSED static bool8 sub_80057DC(void)
{
return FALSE;
}
UNUSED static void nullsub_150(void)
{}
UNUSED static void nullsub_151(void)
{}
// arm9.bin::02006154
void sub_80057E8(void)
{
sUnknown_2026E4C = TRUE;
@ -208,6 +39,7 @@ void sub_80057E8(void)
gUnknown_203B078 = NULL;
}
// arm9.bin::02005758
void sub_8005838(s32 *a0, u8 kind)
{
const s16 *r1, *r2;
@ -569,6 +401,7 @@ void sub_8005838(s32 *a0, u8 kind)
}
}
#if (GAME_VERSION == VERSION_RED)
UNUSED static void sub_80060A8(void)
{
gUnknown_2026E3C = sUnknown_2026E58;
@ -576,7 +409,9 @@ UNUSED static void sub_80060A8(void)
sUnknown_2026E50 = !sUnknown_2026E50;
gUnknown_2026E38 = FALSE;
}
#endif
// arm9.bin::020056C0
void sub_80060EC(void)
{
gUnknown_2026E3C = sUnknown_2026E58;

View File

@ -1,12 +1,12 @@
#include "global.h"
#include "globaldata.h"
#include "bg_palette_buffer.h"
#include "code_800558C.h"
#include "structs/axdata.h"
#include "code_8009804.h"
#include "cpu.h"
#include "def_filearchives.h"
#include "file_system.h"
#include "text.h"
#include "text_1.h"
struct FontData
{
@ -168,6 +168,7 @@ void sub_80098F8(u32 r0)
sUnknown_202D238[r0] = 1;
}
// arm9.bin::02009BE0
void sub_8009908(void)
{
s32 i;
@ -213,7 +214,7 @@ UNUSED static void sub_8009A10(struct unkStruct_8009A1C_ptr *a0, u32 palId, u32
sub_8009A1C(a0->ptr, palId, vramDstOffset, r3);
}
void sub_8009A1C(const struct EfoFileData *r0, u32 palId, u32 vramDstOffset, u32 r3)
void sub_8009A1C(const EfoFileData *r0, u32 palId, u32 vramDstOffset, u32 r3)
{
s32 i;
u32 *dst, *src;

View File

@ -7,6 +7,7 @@
// Todo: Figure out if this file could be merged with bg_control and cpu?
EWRAM_INIT u32 gUnknown_203B0B8 = {0};
// Should be arm9.bin02008A00, but it's way different
void WaitForNextFrameAndAdvanceRNG(void)
{
sub_800BA5C();
@ -27,6 +28,7 @@ UNUSED static void nullsub_180(void)
{
}
// Should be arm9.bin::020084D4, but it's way different
void xxx_call_update_bg_sound_input(void)
{
xxx_update_bg_sound_input();

View File

@ -63,6 +63,7 @@ void sub_800D098(void)
while(REG_KEYINPUT != KEYS_MASK){} // All buttons
}
// arm9.bin::02007FF8
void sprintfStatic(char *buffer, const char *text, ...)
{
va_list vArgv;

View File

@ -1,15 +1,16 @@
#include "global.h"
#include "structs/axdata.h"
#include "bg_control.h"
#include "code_800558C.h"
#include "code_800DAC0.h"
#include "code_800E9A8.h"
#include "code_80118A4.h"
#include "code_803E724.h"
#include "def_filearchives.h"
#include "dungeon_map.h"
#include "file_system.h"
#include "main_loops.h"
#include "memory.h"
#include "dungeon_map.h"
#include "sprite.h"
EWRAM_INIT struct unkStruct_203B0CC *gUnknown_203B0CC = NULL;

View File

@ -1,6 +1,6 @@
#include "global.h"
#include "bg_control.h"
#include "code_800558C.h"
#include "structs/axdata.h"
#include "code_8009804.h"
#include "code_800C9CC.h"
#include "code_800E9E4.h"
@ -12,14 +12,14 @@
#include "main_loops.h"
#include "memory.h"
#include "sprite.h"
#include "text.h"
#include "text_2.h"
struct unkStruct_203B0D0_sub
{
// size: 0x24
u32 unk0;
OpenedFile *file;
const struct EfoFileData *fileData;
const EfoFileData *fileData;
u32 unkC;
s32 unk10;
s32 unk14;

View File

@ -1,13 +1,12 @@
#include "global.h"
#include "globaldata.h"
#include "structs/sprite_oam.h"
#include "code_800F958.h"
#include "code_8009804.h"
#include "cpu.h"
#include "dungeon_pokemon_sprites.h"
#include "memory.h"
#include "sprite.h"
#include "structs/sprite_oam.h"
#include <stdio.h>
struct StatusGraphicsInfo
{
@ -75,7 +74,7 @@ extern SpriteOAM gUnknown_203B0DC;
extern DungeonPos gUnknown_80D3564;
void DrawStatusSprite(s16 param_1,s32 status,DungeonPos *pos,DungeonPos *posOffset,
static void DrawStatusSprite(s16 param_1,s32 status,DungeonPos *pos,DungeonPos *posOffset,
DungeonPos *posScreen,u32 priority, u32 unused);
DungeonPokemonSprite *GetDungeonPokemonSprite(s32 id)
@ -200,7 +199,7 @@ void sub_800F2EC(DungeonPokemonSprite *sprite, s32 index, DungeonPos *screenPos)
}
}
void DrawStatusSprite(s16 param_1, s32 status, DungeonPos *pos, DungeonPos *posOffset,
static void DrawStatusSprite(s16 param_1, s32 status, DungeonPos *pos, DungeonPos *posOffset,
DungeonPos *posScreen, u32 priority, u32 unused)
{
struct StatusSprite sprite;

View File

@ -1,20 +1,19 @@
#include "global.h"
#include "code_800558C.h"
#include "structs/axdata.h"
#include "code_8009804.h"
#include "code_80118A4.h"
#include "music.h"
#include "constants/bg_music.h"
#include "config.h"
#include "sprite.h"
#include "event_flag.h"
#include "file_system.h"
extern const u16 gUnknown_80D4144[8];
EWRAM_DATA u32 gUnknown_202DE1C = {0};
EWRAM_DATA s16 gUnknown_202DE20 = {0};
EWRAM_DATA s16 gUnknown_202DE22 = {0};
EWRAM_DATA s16 gUnknown_202DE24 = {0};
EWRAM_DATA u32 gUnknown_202DE1C = {0}; // GBA=202DE1C | NDS=02134218
EWRAM_DATA s16 gUnknown_202DE20 = {0}; // GBA=202DE20 | NDS=0213420C
EWRAM_DATA s16 gUnknown_202DE22 = {0}; // GBA=202DE22 | NDS=02134210
EWRAM_DATA s16 gUnknown_202DE24 = {0}; // GBA=202DE24 | NDS=02134214
void sub_8011760(void)
{
@ -82,6 +81,7 @@ void xxx_call_start_bg_music(void)
StartBGMusicVSync();
}
// arm9.bin::020187C0
void sub_8011860(void)
{
if (gUnknown_202DE20 > 0)

View File

@ -7,7 +7,7 @@
#include "string_format.h"
#include "game_options.h"
#include "sprite.h"
#include "text.h"
#include "text_2.h"
void sub_8012A18()
{

View File

@ -1,8 +1,8 @@
#include "global.h"
#include "code_8012A18_1.h"
#include "structs/sprite_oam.h"
#include "code_8012A18_1.h"
#include "text_2.h"
#include "text_util.h"
#include "text.h"
struct unkStruct_203B1FC
{
@ -50,7 +50,7 @@ s32 sub_8015F44(void)
void sub_8015F84(void)
{
u32 uVar2;
const struct unkChar *puVar3;
const unkChar *puVar3;
s32 index;
s32 total;
@ -73,7 +73,7 @@ void sub_8015F84(void)
s32 sub_8015FEC(u8 *buffer, s32 size)
{
const struct unkChar *iVar2;
const unkChar *iVar2;
s32 currLength;
s32 length;
u8 *bufferPtr;

View File

@ -1,15 +1,16 @@
#include "global.h"
#include "globaldata.h"
#include "string_format.h"
#include "input.h"
#include "memory.h"
#include "menu_input.h"
#include "text.h"
#include "sprite.h"
#include "code_800D090.h"
#include "code_80118A4.h"
#include "code_803D0D8.h"
#include "text.h"
#include "input.h"
#include "memory.h"
#include "menu_input.h"
#include "sprite.h"
#include "string_format.h"
#include "text_1.h"
#include "text_2.h"
#include "text_3.h"
struct unkStruct_203B1F8
{

View File

@ -1,15 +1,15 @@
#include "global.h"
#include "globaldata.h"
#include "code_8012A18_1.h"
#include "string_format.h"
#include "code_801602C.h"
#include "common_strings.h"
#include "input.h"
#include "memory.h"
#include "string_format.h"
#include "text_util.h"
#include "text.h"
#include "text_1.h"
static EWRAM_INIT struct unkStruct_203B200 *sUnknown_203B200 = {NULL};
EWRAM_INIT static struct unkStruct_203B200 *sUnknown_203B200 = {NULL};
#include "data/code_801602C.h"

View File

@ -1,18 +1,19 @@
#include "global.h"
#include "globaldata.h"
#include "code_80118A4.h"
#include "string_format.h"
#include "code_801B3C0.h"
#include "input.h"
#include "items.h"
#include "memory.h"
#include "menu_input.h"
#include "sprite.h"
#include "text.h"
#include "string_format.h"
#include "text_1.h"
#include "text_2.h"
static EWRAM_INIT unkStruct_203B230 *sUnknown_203B230 = {NULL};
static EWRAM_INIT unkStruct_203B230 *sUnknown_203B230 = { NULL };
#include "data/code_801B3C0.h" // 80DBA4C
#include "data/code_801B3C0.h"
static void sub_801B46C(u32);
static void sub_801B480(void);

View File

@ -1,12 +1,11 @@
#include "global.h"
#include "globaldata.h"
#include "constants/colors.h"
#include "code_80118A4.h"
#include "string_format.h"
#include "code_801B3C0.h"
#include "code_801B60C.h"
#include "code_8099360.h"
#include "common_strings.h"
#include "constants/colors.h"
#include "event_flag.h"
#include "input.h"
#include "items.h"
@ -14,9 +13,10 @@
#include "memory.h"
#include "menu_input.h"
#include "pokemon.h"
#include "text.h"
#include "string_format.h"
#include "text_1.h"
static EWRAM_INIT unkStruct_203B234 *sUnknown_203B234 = {NULL};
static EWRAM_INIT unkStruct_203B234 *sUnknown_203B234 = { NULL };
#include "data/code_801B60C.h" // 80DBA58
@ -124,7 +124,7 @@ static void sub_801B760(void)
case 13:
case 14:
case 15:
RestoreUnkTextStruct_8006518(&sUnknown_203B234->windows);
RestoreSavedWindows(&sUnknown_203B234->windows);
for (i = 0; i < 4; i++)
sUnknown_203B234->windows.id[i] = sUnknown_80DBA58;
@ -132,7 +132,7 @@ static void sub_801B760(void)
ShowWindows(&sUnknown_203B234->windows, TRUE, TRUE);
break;
case 10:
RestoreUnkTextStruct_8006518(&sUnknown_203B234->windows);
RestoreSavedWindows(&sUnknown_203B234->windows);
sub_801BB5C();
sUnknown_203B234->windows.id[2] = sUnknown_80DBA70;
sub_8012CAC(&sUnknown_203B234->windows.id[2], sUnknown_203B234->unkCC);
@ -140,7 +140,7 @@ static void sub_801B760(void)
ShowWindows(&sUnknown_203B234->windows, TRUE, TRUE);
break;
case 12:
RestoreUnkTextStruct_8006518(&sUnknown_203B234->windows);
RestoreSavedWindows(&sUnknown_203B234->windows);
sUnknown_203B234->windows.id[1] = sUnknown_80DBA88;
ResetUnusedInputStruct();
ShowWindows(&sUnknown_203B234->windows, TRUE, TRUE);

View File

@ -6,12 +6,13 @@
#include "items.h"
#include "memory.h"
#include "menu_input.h"
#include "text.h"
#include "text_1.h"
#include "text_2.h"
static EWRAM_INIT struct unkStruct_203B244 *sUnknown_203B244 = {NULL};
static EWRAM_INIT u32 sUnknown_203B248 = {0};
static EWRAM_INIT u16 sUnknown_203B24C = {0};
static EWRAM_INIT u16 sUnknown_203B24E = {0};
EWRAM_INIT static struct unkStruct_203B244 *sUnknown_203B244 = { NULL };
EWRAM_INIT static u32 sUnknown_203B248 = {0};
EWRAM_INIT static u16 sUnknown_203B24C = {0};
EWRAM_INIT static u16 sUnknown_203B24E = {0};
#include "data/code_801C8C4.h"
@ -30,7 +31,7 @@ bool8 sub_801C8C4(s32 a0, s32 a1, DungeonPos *a2, u32 a3)
sub_801CF94();
sUnknown_203B244->unk4B4.s0.unk34 = a1;
sUnknown_203B244->unk4B4.s0.unk38 = &sUnknown_203B244->unk4B4.s0.windows.id[a1];
RestoreUnkTextStruct_8006518(&sUnknown_203B244->unk4B4.s0.windows);
RestoreSavedWindows(&sUnknown_203B244->unk4B4.s0.windows);
sUnknown_203B244->unk4B4.s0.windows.id[sUnknown_203B244->unk4B4.s0.unk34] = sUnknown_80DBE54;
sUnknown_203B244->unk4B4.s0.unk38->header = &sUnknown_203B244->unk4B4.unk9C;

View File

@ -25,7 +25,9 @@
#include "party_list_menu.h"
#include "rescue_team_info.h"
#include "string_format.h"
#include "text.h"
#include "text_1.h"
#include "text_2.h"
#include "text_3.h"
#include "wigglytuff_shop2.h"
#include "wonder_mail_802C4C8.h"
#include "wonder_mail_802C860.h"
@ -187,7 +189,7 @@ static void sub_801D220(void)
{
s32 i;
RestoreUnkTextStruct_8006518(&sUnknown_203B250->windows);
RestoreSavedWindows(&sUnknown_203B250->windows);
switch (sUnknown_203B250->state) {
case 0:

View File

@ -1,18 +1,19 @@
#include "global.h"
#include "globaldata.h"
#include "constants/input.h"
#include "structs/struct_sub80095e4.h"
#include "code_80118A4.h"
#include "code_801D9E4.h"
#include "constants/input.h"
#include "ground_main.h"
#include "input.h"
#include "memory.h"
#include "menu_input.h"
#include "text.h"
#include "structs/struct_sub80095e4.h"
#include "text_1.h"
#include "text_2.h"
static EWRAM_INIT struct struct_Sub80095E4_2 *sUnknown_203B258 = {NULL};
EWRAM_INIT static struct struct_Sub80095E4_2 *sUnknown_203B258 = {NULL};
extern struct unkStruct_81188F0 gUnknown_81188F0[10];
extern const struct unkStruct_81188F0 gUnknown_81188F0[10];
#include "data/code_801D9E4.h"
@ -24,7 +25,7 @@ bool8 sub_801D9E4(void)
sUnknown_203B258 = MemoryAlloc(sizeof(*sUnknown_203B258), 8);
sUnknown_203B258->s0.unk34 = 3;
sUnknown_203B258->s0.unk38 = &sUnknown_203B258->s0.windows.id[3];
RestoreUnkTextStruct_8006518(&sUnknown_203B258->s0.windows);
RestoreSavedWindows(&sUnknown_203B258->s0.windows);
sUnknown_203B258->s0.windows.id[sUnknown_203B258->s0.unk34] = sUnknown_80DBF88;
sUnknown_203B258->s0.unk38->header = &sUnknown_203B258->unk9C;
ResetUnusedInputStruct();
@ -104,7 +105,7 @@ static void sub_801DB54(void)
static void sub_801DBD4(void)
{
GroundConversionStruct *temp;
struct unkStruct_81188F0 *temp2;
const struct unkStruct_81188F0 *temp2;
s32 x, y, n;
s16 index;
int counter;

View File

@ -1,17 +1,18 @@
#include "global.h"
#include "globaldata.h"
#include "constants/input.h"
#include "code_80118A4.h"
#include "code_801EE10.h"
#include "input.h"
#include "items.h"
#include "text.h"
#include "memory.h"
#include "moves.h"
#include "code_801EE10.h"
#include "code_80118A4.h"
#include "menu_input.h"
#include "moves.h"
#include "string_format.h"
#include "text_1.h"
#include "text_2.h"
EWRAM_INIT unkStruct_203B270 *gUnknown_203B270 = {NULL};
EWRAM_INIT unkStruct_203B270 *gUnknown_203B270 = { NULL };
const WindowTemplate gUnknown_80DC240 = {
0x00,
@ -84,7 +85,7 @@ u8 sub_801EE10(u32 param_1, s16 species, Move *moves, u32 param_4, const u8 *tex
if (iVar8 < four) {
iVar8 = 4;
}
RestoreUnkTextStruct_8006518(&gUnknown_203B270->windows);
RestoreSavedWindows(&gUnknown_203B270->windows);
gUnknown_203B270->unk50 = param_6;
gUnknown_203B270->windows.id[param_6] = gUnknown_80DC25C;
if (gUnknown_203B270->text != NULL) {

View File

@ -1,14 +1,15 @@
#include "global.h"
#include "globaldata.h"
#include "code_80118A4.h"
#include "structs/struct_sub80095e4.h"
#include "code_800D090.h"
#include "code_80118A4.h"
#include "input.h"
#include "memory.h"
#include "menu_input.h"
#include "moves.h"
#include "pokemon.h"
#include "text.h"
#include "structs/struct_sub80095e4.h"
#include "text_1.h"
#include "text_2.h"
struct unkStruct_203B274
{
@ -18,6 +19,7 @@ struct unkStruct_203B274
unkStruct_808E218_arg unk8;
struct_Sub80095E4_2 s348;
};
EWRAM_INIT struct unkStruct_203B274 *gUnknown_203B274 = {NULL};
static const WindowTemplate sUnknown_80DC2AC = {
@ -53,7 +55,7 @@ bool8 sub_801F428(s16 index, s32 param_2)
gUnknown_203B274->unk4 = &gUnknown_203B274->unk8;
gUnknown_203B274->s348.s0.unk34 = param_2;
gUnknown_203B274->s348.s0.unk38 = &gUnknown_203B274->s348.s0.windows.id[gUnknown_203B274->s348.s0.unk34];
RestoreUnkTextStruct_8006518(&gUnknown_203B274->s348.s0.windows);
RestoreSavedWindows(&gUnknown_203B274->s348.s0.windows);
gUnknown_203B274->s348.s0.windows.id[gUnknown_203B274->s348.s0.unk34] = sUnknown_80DC2C4;
gUnknown_203B274->s348.s0.unk38->header = &gUnknown_203B274->s348.unk9C;
gUnknown_203B274->s348.unk9C.count = 1;

View File

@ -1,15 +1,16 @@
#include "global.h"
#include "globaldata.h"
#include "string_format.h"
#include "structs/menu.h"
#include "structs/str_text.h"
#include "code_80118A4.h"
#include "input.h"
#include "memory.h"
#include "menu_input.h"
#include "moves.h"
#include "sprite.h"
#include "structs/menu.h"
#include "structs/str_text.h"
#include "text.h"
#include "string_format.h"
#include "text_1.h"
#include "text_2.h"
// TODO: UNIFY WITH struct_Sub80095E4
struct unkStruct_203B278

View File

@ -1,22 +1,22 @@
#include "global.h"
#include "globaldata.h"
#include "string_format.h"
#include "constants/colors.h"
#include "code_80118A4.h"
#include "code_801AFA4.h"
#include "code_801B3C0.h"
#include "code_80227B8.h"
#include "code_8098BDC.h"
#include "code_8099360.h"
#include "code_80118A4.h"
#include "common_strings.h"
#include "constants/colors.h"
#include "input.h"
#include "kecleon_bros4.h"
#include "memory.h"
#include "menu_input.h"
#include "pokemon_3.h"
#include "text.h"
#include "string_format.h"
#include "text_1.h"
static EWRAM_INIT unkStruct_203B294 *sUnknown_203B294 = {NULL};
EWRAM_INIT static unkStruct_203B294 *sUnknown_203B294 = {NULL};
#include "data/code_80227B8.h"
@ -109,7 +109,7 @@ static void sub_802293C(void)
{
s32 i;
RestoreUnkTextStruct_8006518(&sUnknown_203B294->windows);
RestoreSavedWindows(&sUnknown_203B294->windows);
switch (sUnknown_203B294->state) {
case 2:

View File

@ -1,21 +1,22 @@
#include "global.h"
#include "globaldata.h"
#include "constants/colors.h"
#include "constants/input.h"
#include "code_800D090.h"
#include "code_80118A4.h"
#include "code_8023144.h"
#include "constants/colors.h"
#include "constants/input.h"
#include "exclusive_pokemon.h"
#include "friend_area.h"
#include "input.h"
#include "memory.h"
#include "menu_input.h"
#include "pokemon_3.h"
#include "text.h"
#include "text_1.h"
#include "text_2.h"
static EWRAM_INIT u32 gUnknown_203B298 = {1};
static EWRAM_INIT u16 gUnknown_203B29C = {0};
static EWRAM_INIT u16 gUnknown_203B29E = {0};
EWRAM_INIT static u32 gUnknown_203B298 = {1};
EWRAM_INIT static u16 gUnknown_203B29C = {0};
EWRAM_INIT static u16 gUnknown_203B29E = {0};
EWRAM_INIT s32 gUnknown_203B2A0 = 2;
EWRAM_INIT s32 gUnknown_203B2A4 = 1;
EWRAM_INIT u16 gUnknown_203B2A8 = 0;
@ -48,7 +49,7 @@ bool8 sub_8023144(s32 a0, s32 index, DungeonPos *sub, u32 a3)
gUnknown_3001B5C->s35C.s0.unk34 = index;
gUnknown_3001B5C->s35C.s0.unk38 = &gUnknown_3001B5C->s35C.s0.windows.id[index];
RestoreUnkTextStruct_8006518(&gUnknown_3001B5C->s35C.s0.windows);
RestoreSavedWindows(&gUnknown_3001B5C->s35C.s0.windows);
gUnknown_3001B5C->s35C.s0.windows.id[gUnknown_3001B5C->s35C.s0.unk34] = sUnknown_80DC91C;
gUnknown_3001B5C->s35C.s0.unk38->header = &gUnknown_3001B5C->s35C.unk9C;

View File

@ -1,15 +1,15 @@
#include "global.h"
#include "globaldata.h"
#include "constants/input.h"
#include "code_80118A4.h"
#include "code_8024458.h"
#include "constants/input.h"
#include "event_flag.h"
#include "input.h"
#include "memory.h"
#include "menu_input.h"
#include "pokemon.h"
#include "pokemon_3.h"
#include "text.h"
#include "text_1.h"
static EWRAM_INIT struct unkStruct_203B2AC *sUnknown_203B2AC = {NULL};
@ -27,7 +27,7 @@ bool8 sub_8024458(s16 speciesNum, s32 a1)
sUnknown_203B2AC->speciesNum = speciesNum_s32;
sUnknown_203B2AC->unkE0 = a1;
sUnknown_203B2AC->unkE4 = &sUnknown_203B2AC->unkE8.id[a1];
RestoreUnkTextStruct_8006518(&sUnknown_203B2AC->unkE8);
RestoreSavedWindows(&sUnknown_203B2AC->unkE8);
sUnknown_203B2AC->unkE8.id[sUnknown_203B2AC->unkE0] = sUnknown_80DC9C8;
sUnknown_203B2AC->unkE4->header = &sUnknown_203B2AC->unk148;
sUnknown_203B2AC->unk148.width = 10;

View File

@ -1,6 +1,5 @@
#include "global.h"
#include "globaldata.h"
#include "string_format.h"
#include "code_802DB28.h"
#include "code_802F204.h"
#include "code_803C1D0.h"
@ -10,9 +9,10 @@
#include "items.h"
#include "memory.h"
#include "pokemon.h"
#include "text.h"
#include "string_format.h"
#include "text_1.h"
static EWRAM_INIT struct unkStruct_203B2FC *sUnknown_203B2FC = {NULL};
EWRAM_INIT static struct unkStruct_203B2FC *sUnknown_203B2FC = {NULL};
#include "data/code_802DB28.h"
@ -49,7 +49,7 @@ bool8 sub_802DB28(u8 jobSlotIndex, u8 dungeon)
sUnknown_203B2FC->monPortrait.pos.y = 8;
if (sUnknown_203B2FC->monPortrait.faceFile != NULL)
sUnknown_203B2FC->monPortrait.faceData = (struct PortraitGfx *) sUnknown_203B2FC->monPortrait.faceFile->data;
sUnknown_203B2FC->monPortrait.faceData = (PortraitGfx *) sUnknown_203B2FC->monPortrait.faceFile->data;
sub_802DC28(0);
return TRUE;
@ -92,7 +92,7 @@ static void sub_802DC40(void)
{
s32 i;
RestoreUnkTextStruct_8006518(&sUnknown_203B2FC->unk48);
RestoreSavedWindows(&sUnknown_203B2FC->unk48);
switch (sUnknown_203B2FC->state) {
case 0:

View File

@ -6,7 +6,7 @@
#include "memory.h"
#include "menu_input.h"
#include "pokemon_mail.h"
#include "text.h"
#include "text_1.h"
static EWRAM_INIT struct unkStruct_203B300 *sUnknown_203B300 = {NULL};
@ -23,7 +23,7 @@ bool8 sub_802DE84(unkStruct_802C39C *mail)
sub_801317C(&sUnknown_203B300->unk0);
sUnknown_203B300->unk10 = sUnknown_203B300->mail->unk0[0];
sUnknown_203B300->unk14 = &sUnknown_203B300->unk18.id[sUnknown_203B300->unk10];
RestoreUnkTextStruct_8006518(&sUnknown_203B300->unk18);
RestoreSavedWindows(&sUnknown_203B300->unk18);
sUnknown_203B300->unk18.id[sUnknown_203B300->unk10] = sUnknown_80E0264;
sub_802DF14();
return TRUE;

View File

@ -2,15 +2,17 @@
#include "globaldata.h"
#include "constants/wonder_mail.h"
#include "constants/colors.h"
#include "structs/str_dungeon.h"
#include "code_80118A4.h"
#include "code_803D0D8.h"
#include "code_8094F88.h"
#include "input.h"
#include "memory.h"
#include "text.h"
#include "structs/str_dungeon.h"
#include "pokemon.h"
#include "code_8094F88.h"
#include "menu_input.h"
#include "code_80118A4.h"
#include "pokemon.h"
#include "text_1.h"
#include "text_2.h"
#include "text_3.h"
struct unkStruct_203B334
{
@ -59,7 +61,7 @@ bool8 sub_8031D70(u32 mailIndex, s32 param_2)
sub_801317C(&gUnknown_203B334->unk4);
gUnknown_203B334->unk10 = param_2;
gUnknown_203B334->unk14 = &gUnknown_203B334->unk18.id[param_2];
RestoreUnkTextStruct_8006518(&gUnknown_203B334->unk18);
RestoreSavedWindows(&gUnknown_203B334->unk18);
gUnknown_203B334->unk18.id[gUnknown_203B334->unk10] = gUnknown_80E1FC4;
sub_8031E00();
return TRUE;

View File

@ -15,7 +15,8 @@
#include "game_options.h"
#include "pokemon.h"
#include "pokemon_3.h"
#include "text.h"
#include "text_1.h"
#include "text_3.h"
extern s32 sub_80902C8(u8 dungeon);
extern void sub_808E9C4(UnkDungeonGlobal_unk1CD98 *r0, s16 r1);

View File

@ -1,5 +1,7 @@
#include "global.h"
#include "structs/str_dungeon.h"
#include "bg_control.h"
#include "bg_palette_buffer.h"
#include "code_8004AA0.h"
#include "code_800558C.h"
#include "code_8009804.h"
@ -9,14 +11,12 @@
#include "code_803E668.h"
#include "code_803E724.h"
#include "dungeon_map.h"
#include "bg_palette_buffer.h"
#include "bg_control.h"
#include "dungeon_music.h"
#include "game_options.h"
#include "input.h"
#include "play_time.h"
#include "sprite.h"
#include "text.h"
#include "text_2.h"
EWRAM_INIT u8 gUnknown_203B40C = 0;
EWRAM_INIT u8 gUnknown_203B40D = 0;
@ -26,7 +26,7 @@ extern s32 gDungeonFramesCounter;
extern u32 gUnknown_202EDD0;
extern s32 gUnknown_202EDD4;
extern void sub_803E490(u32);
static void sub_803E490(u32);
void xxx_draw_string_80524F0(void);
void sub_8085F78(void);
void sub_803F580(s32);
@ -48,7 +48,7 @@ void DungeonRunFrameActions(u32 a0)
sub_803E668(a0);
}
void sub_803E490(u32 unused)
static void sub_803E490(u32 unused)
{
gUnknown_202EDD4++;
xxx_draw_string_80524F0();

View File

@ -1,31 +1,31 @@
#include "global.h"
#include "dungeon.h"
#include "bg_palette_buffer.h"
#include "code_8004AA0.h"
#include "input.h"
#include "text.h"
#include "code_801602C.h"
#include "menu_input.h"
#include "code_8009804.h"
#include "code_803E46C.h"
#include "dungeon_util.h"
#include "code_800E9E4.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_map_access.h"
#include "sprite.h"
#include "bg_control.h"
#include "dungeon_map.h"
#include "game_options.h"
#include "code_800558C.h"
#include "dungeon_range.h"
#include "dungeon_message.h"
#include "code_806CD90.h"
#include "dungeon_items.h"
#include "constants/item.h"
#include "constants/status.h"
#include "code_803E724.h"
#include "structs/str_202EDE8.h"
#include "bg_control.h"
#include "bg_palette_buffer.h"
#include "code_8004AA0.h"
#include "code_800558C.h"
#include "code_8009804.h"
#include "code_800E9E4.h"
#include "code_801602C.h"
#include "code_803E46C.h"
#include "code_803E724.h"
#include "code_806CD90.h"
#include "dungeon.h"
#include "dungeon_items.h"
#include "dungeon_map.h"
#include "dungeon_map_access.h"
#include "dungeon_message.h"
#include "dungeon_music.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_range.h"
#include "dungeon_util.h"
#include "game_options.h"
#include "input.h"
#include "menu_input.h"
#include "sprite.h"
#include "text_1.h"
extern s32 gDungeonBrightness;
extern u32 gUnknown_202EDD0;
@ -170,7 +170,7 @@ void sub_803EA10(void)
SetBGPaletteBufferColorRGB(248, &gFontPalette[8], gDungeonBrightness, NULL);
}
static const struct WindowTemplates gUnknown_80F62B0 =
static const WindowTemplates gUnknown_80F62B0 =
{
.id = {
[0] = {
@ -188,7 +188,7 @@ static const struct WindowTemplates gUnknown_80F62B0 =
}
};
static const struct WindowTemplates gUnknown_80F6310 =
static const WindowTemplates gUnknown_80F6310 =
{
.id = {
[0] = {
@ -206,7 +206,7 @@ static const struct WindowTemplates gUnknown_80F6310 =
}
};
static const struct WindowTemplates gUnknown_80F6370 =
static const WindowTemplates gUnknown_80F6370 =
{
.id = {
[0] = {
@ -240,7 +240,7 @@ static const struct WindowTemplates gUnknown_80F6370 =
}
};
static const struct WindowTemplates gUnknown_80F63D0 =
static const WindowTemplates gUnknown_80F63D0 =
{
.id = {
[0] = {

View File

@ -1,11 +1,11 @@
#include "global.h"
#include "structs/dungeon_entity.h"
#include "structs/str_dungeon.h"
#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"
#include "dungeon_map_access.h"
#include "dungeon_music.h"
#include "file_system.h"

View File

@ -17,6 +17,7 @@
#include "dungeon_music.h"
#include "dungeon_random.h"
#include "dungeon_util.h"
#include "sprite.h"
#include "tile_types.h"
#include "weather.h"
@ -32,7 +33,6 @@ struct UnkStruct_8040094
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_8042DD4(s32 a0, Entity *a1, s32 a2);
extern u8 sub_800EA44(s32 species, u16 a2);
@ -100,7 +100,7 @@ static void sub_8040C4C(Entity *entity, Move *move, bool32 a2)
s32 r2 = sub_800E710(apparentId, sub_80412E0(move->id, GetApparentWeather(entity), TRUE));
if (r2 != -1) {
sub_800569C(&sp.unk8, &entity->axObj.axdata, r2);
sub_800569C(&sp.unk8, &entity->axObj, r2);
}
else {
sp.unk8 = (DungeonPos) {0};
@ -252,7 +252,7 @@ static void sub_8041038(struct UnkStruct_8040094 *a0, Entity *entity, Move *move
s32 r2 = sub_800E710(entInfo->apparentID, sub_80412E0(move->id, GetApparentWeather(entity), a2));
if (r2 != -1) {
sub_800569C(&a0->unk8, &entity->axObj.axdata, r2);
sub_800569C(&a0->unk8, &entity->axObj, r2);
}
else {
a0->unk8 = (DungeonPos) {0};
@ -312,7 +312,7 @@ void sub_8041168(Entity *entity, Entity *entity2, Move *move, DungeonPos *pos)
var2 = sub_800ECA4(var)->unk1c;
if (var2 != -1) {
if (EntityIsValid(entity2)) {
sub_800569C(&sp.unk8, &entity2->axObj.axdata, var2);
sub_800569C(&sp.unk8, &entity2->axObj, var2);
}
else {
sp.unk8 = (DungeonPos) {0};

View File

@ -1,5 +1,10 @@
#include "global.h"
#include "math.h"
#include "constants/direction.h"
#include "constants/status.h"
#include "constants/type.h"
#include "structs/dungeon_entity.h"
#include "structs/sprite_oam.h"
#include "structs/str_dungeon.h"
#include "code_800558C.h"
#include "code_800DAC0.h"
#include "code_800E9A8.h"
@ -10,15 +15,11 @@
#include "code_804267C.h"
#include "code_806CD90.h"
#include "dungeon_config.h"
#include "constants/direction.h"
#include "constants/status.h"
#include "constants/type.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_util.h"
#include "items.h"
#include "structs/dungeon_entity.h"
#include "structs/sprite_oam.h"
#include "structs/str_dungeon.h"
#include "math.h"
#include "sprite.h"
extern u32 gStatusSpriteMasks_SleepClassStatus[];
extern u32 gStatusSpriteMasks_BurnClassStatus[];
@ -37,7 +38,6 @@ extern u32 gStatusSpriteMasks_MuzzledStatus[];
extern void sub_803ED30(u8, Entity *pokemon, u8, u8);
extern u32 sub_806F62C(u32);
extern u32 sub_800DC9C(s32 a0);
extern void sub_800569C(DungeonPos *, axdata *, u8);
extern void PlaySoundEffect(u32);
void EntityUpdateStatusSprites(Entity *entity);
@ -82,7 +82,7 @@ s32 sub_8041550(Entity *entity, s32 a1, u8 a2, u8 a3, s32 a4, u8 a5)
sub_804178C(a4 == 2);
}
sub_800569C(&pos, &entity->axObj.axdata, a3);
sub_800569C(&pos, &entity->axObj, a3);
if (pos.x != 99 && pos.y != 99) {
pixelPos.x = entity->pixelPos.x + (pos.x << 8);
pixelPos.y = (entity->pixelPos.y + (pos.y << 8)) - entInfo->unk174.raw;

View File

@ -1,21 +1,22 @@
#include "global.h"
#include "structs/str_dungeon.h"
#include "code_800DAC0.h"
#include "code_800ED38.h"
#include "code_8041AD0.h"
#include "code_804267C.h"
#include "code_803E46C.h"
#include "code_803E668.h"
#include "code_8041AD0.h"
#include "code_804267C.h"
#include "code_8045A00.h"
#include "code_806CD90.h"
#include "dungeon.h"
#include "dungeon_engine.h"
#include "dungeon_map.h"
#include "dungeon_leader.h"
#include "dungeon_map.h"
#include "dungeon_message.h"
#include "dungeon_music.h"
#include "dungeon_util.h"
#include "items.h"
#include "structs/str_dungeon.h"
#include "sprite.h"
extern const u16 gUnknown_80F67DC[4];
extern const u16 gUnknown_80F67E4[4];
@ -35,7 +36,6 @@ extern u8 GetFloorType(void);
extern bool8 sub_8045888(Entity *);
extern s32 sub_80416E0(PixelPos*, u32, bool8);
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);

View File

@ -1,53 +1,54 @@
#include "global.h"
#include "dungeon_util_1.h"
#include "memory.h"
#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"
#include "dungeon_util.h"
#include "dungeon_message.h"
#include "dungeon_generation.h"
#include "bg_control.h"
#include "random.h"
#include "file_system.h"
#include "dungeon_leader.h"
#include "dungeon.h"
#include "dungeon_ai.h"
#include "pokemon.h"
#include "cpu.h"
#include "dungeon_music.h"
#include "dungeon_random.h"
#include "code_8009804.h"
#include "tile_types.h"
#include "text.h"
#include "code_805D8C8.h"
#include "code_803E668.h"
#include "dungeon_engine.h"
#include "dungeon_map_access.h"
#include "pokemon.h"
#include "weather.h"
#include "moves.h"
#include "code_8094F88.h"
#include "code_8099360.h"
#include "bg_palette_buffer.h"
#include "exclusive_pokemon.h"
#include "constants/dungeon.h"
#include "constants/monster.h"
#include "constants/trap.h"
#include "dungeon_serializer.h"
#include "dungeon_config.h"
#include "dungeon_map.h"
#include "dungeon_items.h"
#include "dungeon_misc.h"
#include "code_8042B34.h"
#include "structs/rgb.h"
#include "structs/sprite_oam.h"
#include "structs/str_dungeon_8042F6C.h"
#include "bg_control.h"
#include "bg_palette_buffer.h"
#include "code_800558C.h"
#include "code_8009804.h"
#include "code_800DAC0.h"
#include "code_800E9A8.h"
#include "code_800E9E4.h"
#include "code_800ED38.h"
#include "code_803D110.h"
#include "code_803E46C.h"
#include "code_803E668.h"
#include "code_803E724.h"
#include "code_8042B34.h"
#include "code_805D8C8.h"
#include "code_8094F88.h"
#include "code_8099360.h"
#include "cpu.h"
#include "dungeon.h"
#include "dungeon_ai.h"
#include "dungeon_config.h"
#include "dungeon_engine.h"
#include "dungeon_generation.h"
#include "dungeon_items.h"
#include "dungeon_leader.h"
#include "dungeon_map.h"
#include "dungeon_map_access.h"
#include "dungeon_message.h"
#include "dungeon_misc.h"
#include "dungeon_music.h"
#include "dungeon_random.h"
#include "dungeon_serializer.h"
#include "dungeon_util.h"
#include "dungeon_util_1.h"
#include "exclusive_pokemon.h"
#include "file_system.h"
#include "memory.h"
#include "moves.h"
#include "pokemon.h"
#include "random.h"
#include "sprite.h"
#include "text_1.h"
#include "text_3.h"
#include "tile_types.h"
#include "weather.h"
extern void sub_800F15C(s32);
@ -226,7 +227,6 @@ void sub_8042E98(void)
}
}
extern void sub_800569C(DungeonPos *, axdata *, u8);
extern void sub_800EB24(s32 param_1, DungeonPos *param_2, DungeonPos *param_3,
s32 param_4, s32 param_5);
@ -243,7 +243,7 @@ void sub_8042EC8(Entity *a0, s32 a1)
if (strPtr->unk8 != -1) {
sub_800569C(&sp4,
&a0->axObj.axdata,
&a0->axObj,
strPtr->unk8);
}

View File

@ -34,9 +34,10 @@
#include "pokemon.h"
#include "pokemon_3.h"
#include "position_util.h"
#include "sprite.h"
#include "status_checks_1.h"
#include "string_format.h"
#include "text.h"
#include "text_1.h"
#include "trap.h"
extern u8 *gUnknown_80F8BE0[];

View File

@ -1,45 +1,46 @@
#include "global.h"
#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"
#include "random.h"
#include "constants/ability.h"
#include "constants/iq_skill.h"
#include "constants/move_id.h"
#include "constants/status.h"
#include "constants/type.h"
#include "constants/weather.h"
#include "structs/dungeon_entity.h"
#include "structs/str_202ED28.h"
#include "structs/str_806B7F8.h"
#include "structs/str_dungeon.h"
#include "code_800F958.h"
#include "code_803E46C.h"
#include "code_803E668.h"
#include "code_8041AD0.h"
#include "code_804267C.h"
#include "code_8045A00.h"
#include "code_805D8C8.h"
#include "code_806CD90.h"
#include "code_8077274_1.h"
#include "dungeon_config.h"
#include "dungeon_engine.h"
#include "dungeon_leader.h"
#include "dungeon_map_access.h"
#include "dungeon_misc.h"
#include "dungeon_movement.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_random.h"
#include "dungeon_message.h"
#include "dungeon_util.h"
#include "exclusive_pokemon.h"
#include "file_system.h"
#include "move_effects_target.h"
#include "moves.h"
#include "pokemon.h"
#include "structs/dungeon_entity.h"
#include "structs/str_dungeon.h"
#include "weather.h"
#include "file_system.h"
#include "tile_types.h"
#include "position_util.h"
#include "exclusive_pokemon.h"
#include "number_util.h"
#include "pokemon.h"
#include "pokemon_3.h"
#include "code_8077274_1.h"
#include "code_806CD90.h"
#include "position_util.h"
#include "random.h"
#include "sprite.h"
#include "status_checks_1.h"
#include "constants/iq_skill.h"
#include "structs/str_806B7F8.h"
#include "structs/str_202ED28.h"
#include "dungeon_config.h"
#include "dungeon_misc.h"
#include "tile_types.h"
#include "weather.h"
extern void sub_8042900(Entity *r0);
extern void sub_8042968(Entity *r0);
@ -66,7 +67,6 @@ extern void sub_80429E8(Entity *r0);
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 void sub_8042EC8(Entity *a0, s32 a1);
extern Entity *sub_804550C(s16 a);
extern Entity *sub_80453AC(s16 id);

View File

@ -1,40 +1,39 @@
#include "global.h"
#include "code_806CD90.h"
#include "code_803E46C.h"
#include "code_805D8C8.h"
#include "constants/direction.h"
#include "constants/status.h"
#include "constants/ability.h"
#include "constants/type.h"
#include "constants/dungeon.h"
#include "constants/iq_skill.h"
#include "dungeon_util.h"
#include "code_803E668.h"
#include "exclusive_pokemon.h"
#include "code_8077274_1.h"
#include "dungeon_misc.h"
#include "code_8045A00.h"
#include "position_util.h"
#include "game_options.h"
#include "dungeon_items.h"
#include "status.h"
#include "pokemon.h"
#include "random.h"
#include "dungeon_misc.h"
#include "sprite.h"
#include "structs/str_dungeon.h"
#include "tile_types.h"
#include "dungeon_capabilities.h"
#include "dungeon_random.h"
#include "text_util.h"
#include "dungeon_visibility.h"
#include "code_804267C.h"
#include "move_effects_target.h"
#include "dungeon_pokemon_attributes.h"
#include "code_803E46C.h"
#include "code_803E668.h"
#include "code_8041AD0.h"
#include "dungeon_message.h"
#include "dungeon_map_access.h"
#include "code_804267C.h"
#include "code_8045A00.h"
#include "code_805D8C8.h"
#include "code_806CD90.h"
#include "code_8077274_1.h"
#include "dungeon_capabilities.h"
#include "dungeon_config.h"
#include "dungeon_items.h"
#include "dungeon_map_access.h"
#include "dungeon_message.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_random.h"
#include "dungeon_misc.h"
#include "dungeon_util.h"
#include "dungeon_visibility.h"
#include "exclusive_pokemon.h"
#include "game_options.h"
#include "move_effects_target.h"
#include "pokemon.h"
#include "position_util.h"
#include "random.h"
#include "sprite.h"
#include "status.h"
#include "text_util.h"
#include "tile_types.h"
extern u8 gUnknown_202F221;

View File

@ -1,15 +1,15 @@
#include "global.h"
#include "globaldata.h"
#include "constants/input.h"
#include "structs/struct_sub80095e4.h"
#include "code_80118A4.h"
#include "code_80958E8.h"
#include "code_80A26CC.h"
#include "input.h"
#include "memory.h"
#include "menu_input.h"
#include "text.h"
#include "structs/struct_sub80095e4.h"
#include "text_1.h"
#include "text_2.h"
struct unkStruct_203B314
{
@ -77,7 +77,7 @@ u32 sub_802F73C(u32 r0, DungeonPos *r1, u32 r2, u8 r3)
gUnknown_203B314->unkB8 = r3;
gUnknown_203B314->sBC.s0.unk34 = r0;
gUnknown_203B314->sBC.s0.unk38 = &gUnknown_203B314->sBC.s0.windows.id[gUnknown_203B314->sBC.s0.unk34];
RestoreUnkTextStruct_8006518(&gUnknown_203B314->sBC.s0.windows);
RestoreSavedWindows(&gUnknown_203B314->sBC.s0.windows);
if (r3 != 0)
gUnknown_203B314->sBC.s0.windows.id[gUnknown_203B314->sBC.s0.unk34] = gUnknown_80E072C;

View File

@ -36,6 +36,7 @@
#include "constants/type.h"
#include "dungeon_misc.h"
#include "code_807E5AC.h"
#include "sprite.h"
extern OpenedFile *gUnknown_202ECA0;
extern SpriteOAM gUnknown_202EDC0;

View File

@ -1,6 +1,7 @@
#include "global.h"
#include "structs/str_dungeon.h"
#include "structs/str_202ED28.h"
#include "sprite.h"
bool8 sub_8083568(s32 inX, s32 inY, u8 index)
{

View File

@ -9,6 +9,7 @@
#include "code_80861A8.h"
#include "dungeon_music.h"
#include "dungeon_util.h"
#include "sprite.h"
extern const unkStruct_2039DB0 gUnknown_8107380;
@ -21,7 +22,6 @@ extern const u8 *gUnknown_810671C[];
static void sub_80861EC(Entity *);
s32 sub_800E700(s32);
void sub_800569C(DungeonPos *, axdata *, u8);
void sub_8085F44(s32);
void sub_8052FB8(const u8 *);
@ -95,7 +95,7 @@ s32 sub_80861F8(s32 param_1,Entity *param_2,bool32 param_3)
pos.y = 0;
uStack_38 = sub_800E700(param_1Copy);
if (uStack_38 != -1) {
sub_800569C(&pos,&param_2->axObj.axdata,uStack_38);
sub_800569C(&pos, &param_2->axObj, uStack_38);
}
stack.unk0 = param_1Copy;
stack.unk4 = 0;

View File

@ -1,13 +1,14 @@
#include "global.h"
#include "string_format.h"
#include "structs/str_dungeon.h"
#include "code_8092334.h"
#include "code_809447C.h"
#include "dungeon.h"
#include "structs/str_dungeon.h"
#include "items.h"
#include "moves.h"
#include "string_format.h"
#include "text_1.h"
#include "text_3.h"
#include "text_util.h"
#include "text.h"
struct unkStruct_8113080
{

View File

@ -12,6 +12,7 @@
ALIGNED(4) const u8 gDummyScenarioText[] = _("{COLOR YELLOW_C}Scenario try dummy{RESET}");
ALIGNED(4) const u8 gBlankMission[] = _("{COLOR RED_W}???{RESET}");
// arm9.bin::020688A8
void sub_80972F4(void)
{
ClearScriptVarArray(NULL, RESCUE_SCENARIO_ORDER_LIST);

View File

@ -1,6 +1,6 @@
#include "global.h"
#include "structs/str_status_text.h"
#include "decompress.h"
#include "decompress_3.h"
static bool8 AreStatusesTheSame(const StatusText *status1, const StatusText *status2)
{

View File

@ -4,20 +4,19 @@
#include "def_filearchives.h"
#include "event_flag.h"
#include "file_system.h"
#include "text.h"
#include "text_1.h"
#include "text_2.h"
extern const u8 gUnknown_811601C[];
extern u8 gUnknown_20398B8;
extern const u8 gUnknown_811601C[];
extern void sub_8003600(void);
extern s32 sub_800388C(u16, const u8 *, u8);
extern void sub_8099690(u32);
extern void sub_80A4B38(void);
extern void sub_80A4B54(void);
extern void sub_8099690(u32);
bool8 sub_8099360(u8 *dungeonId) {
s16 script_disc;
DungeonInfo* dungeonInfo;

View File

@ -1,37 +1,37 @@
#include "global.h"
#include "globaldata.h"
#include "text.h"
#include "memory.h"
#include "pokemon.h"
#include "ground_script.h"
#include "code_8099360.h"
#include "code_800D090.h"
#include "code_800558C.h"
#include "pokemon_mid.h"
#include "string_format.h"
#include "structs/str_3001B64.h"
#include "constants/dungeon.h"
#include "wigglytuff_shop1.h"
#include "event_flag.h"
#include "input.h"
#include "ground_main.h"
#include "structs/str_3001B64.h"
#include "code_800558C.h"
#include "code_800D090.h"
#include "code_80118A4.h"
#include "code_801D014.h"
#include "code_8099360.h"
#include "credits2.h"
#include "event_flag.h"
#include "felicity_bank.h"
#include "flash.h"
#include "friend_list_menu.h"
#include "ground_main.h"
#include "ground_script.h"
#include "gulpin_shop_801FB50.h"
#include "input.h"
#include "kangaskhan_storage1.h"
#include "kangaskhan_storage2.h"
#include "felicity_bank.h"
#include "kecleon_bros1.h"
#include "gulpin_shop_801FB50.h"
#include "main_loops.h"
#include "memory.h"
#include "personality_test1.h"
#include "pokemon.h"
#include "pokemon_mid.h"
#include "string_format.h"
#include "text_1.h"
#include "text_2.h"
#include "wigglytuff_shop1.h"
#include "wigglytuff_shop3.h"
#include "wonder_mail.h"
#include "flash.h"
#include "code_80118A4.h"
#include "friend_list_menu.h"
#include "personality_test1.h"
#include "credits2.h"
#include "main_loops.h"
#include "string_format.h"
IWRAM_INIT struct unkStruct_3001B64 *gUnknown_3001B64 = {NULL};
IWRAM_INIT struct unkStruct_3001B64 *gUnknown_3001B64 = { NULL };
extern u16 gUnknown_20399DC;
extern u16 gUnknown_20399DE;
@ -606,7 +606,7 @@ bool8 sub_809ADD8(s32 a0_, struct unkStruct_3001B64_sub_sub *a1)
return TRUE;
}
struct MonPortraitMsg *sub_809AE3C(s32 a0_)
MonPortraitMsg *sub_809AE3C(s32 a0_)
{
s32 a0 = (s16) a0_;

View File

@ -1,8 +1,9 @@
#include "global.h"
#include "structs/str_position.h"
#include "other_random.h"
#include "code_8002774.h"
#include "math.h"
#include "memory.h"
#include "other_random.h"
struct unkStruct_20399E8
{
@ -255,8 +256,6 @@ u8 sub_809D248(PixelPos *r0)
extern s32 sub_80A8FD8(s16 a0, PixelPos *a1);
extern s32 sub_80AC448(s16 a0, PixelPos *a1);
extern s32 sub_80AD360(s16 a0, PixelPos *a1);
extern void sub_800290C(PixelPos *a0, s32 a1);
extern void sub_8002934(PixelPos *a0, PixelPos *a1, PixelPos *a2, u32 a3, u32 a4);
extern bool8 sub_80A579C(PixelPos *a0, PixelPos *a1);
void sub_809D25C(void)

View File

@ -2,8 +2,8 @@
#include "structs/axdata.h"
extern void sub_80A68A0(u32);
extern void sub_80A7094(struct axPokemon *, u32, u32, u32);
extern void sub_80A7310(struct axPokemon *, u32, u32, u32);
extern void sub_80A7094(axPokemon *, u32, u32, u32);
extern void sub_80A7310(axPokemon *, u32, u32, u32);
extern void ResetCurrentScriptFile();
static EWRAM_DATA s16 sUnknown_2039DE0 = {0};
@ -16,7 +16,7 @@ void sub_80A7714(u32 a0)
sub_80A68A0(a0);
}
void sub_80A7720(struct axPokemon *a0, u32 a1, u32 a2)
void sub_80A7720(axPokemon *a0, u32 a1, u32 a2)
{
sub_80A7094(a0, 0, a1, a2);
sub_80A7310(a0, a1, 0, a2);

View File

@ -28,6 +28,7 @@ u32 sub_800CDC8(void)
return gUnknown_202D800;
}
// arm9.bin::02007FF4
void SetWindowTitle(const u8 *title)
{
}
@ -45,11 +46,13 @@ UNUSED static bool8 sub_800CDE0(void)
return TRUE;
}
// In NDS, this func is copied to 01FF9FC4
void CpuCopy(void *dest, const void *src, s32 size)
{
CpuCopy32(src, dest, size);
}
// In NDS, this func is copied to 01FF9FB0
void CpuClear(void *dest, s32 size)
{
CpuFill32(NULL, dest, size);

View File

@ -4,9 +4,10 @@
#include "event_flag.h"
#include "input.h"
#include "memory.h"
#include "text.h"
#include "text_1.h"
#include "text_3.h"
static EWRAM_INIT Credits1Work *sCredits1Work = {NULL};
EWRAM_INIT static Credits1Work *sCredits1Work = {NULL};
extern const WindowTemplate gUnknown_80E4A10;
extern const WindowTemplate gUnknown_80E4A28;

View File

@ -1 +0,0 @@
static const u32 gByteShiftLookup[4] = {0, 8, 16, 24};

1
src/data/decompress_at.h Normal file
View File

@ -0,0 +1 @@
static const u32 gByteShiftLookup[4] = {0, 8, 16, 24}; // NDS=020831CC

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