diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h | 14 | ||||
-rw-r--r-- | include/filesystem.h | 34 | ||||
-rw-r--r-- | include/global.h | 7 | ||||
-rw-r--r-- | include/heap.h | 6 | ||||
-rw-r--r-- | include/main.h | 18 | ||||
-rw-r--r-- | include/poke_overlay.h | 2 | ||||
-rw-r--r-- | include/pokemon.h | 10 |
7 files changed, 61 insertions, 30 deletions
diff --git a/include/config.h b/include/config.h new file mode 100644 index 00000000..959e3d18 --- /dev/null +++ b/include/config.h @@ -0,0 +1,14 @@ +#ifndef POKEDIAMOND_CONFIG_H +#define POKEDIAMOND_CONFIG_H + +// #define NDEBUG + +#ifdef DIAMOND +#define GAME_VERSION VERSION_DIAMOND +#else +#define GAME_VERSION VERSION_PEARL +#endif + +#define GAME_LANGUAGE LANGUAGE_ENGLISH + +#endif //POKEDIAMOND_CONFIG_H diff --git a/include/filesystem.h b/include/filesystem.h index 1c106943..64335228 100644 --- a/include/filesystem.h +++ b/include/filesystem.h @@ -159,22 +159,22 @@ typedef enum NarcId NARC_POKETOOL_SHINZUKAN, } NarcId; -void ReadNARCFile(void * dest, const char * path, s32 file_idx, u32 offset, u32 size); -void * LoadFileIntoMemory(const char * path, s32 file_idx, u32 heap_id, u32 offset, u32 size, BOOL r4); -void LoadFromNARC(void * dest, NarcId narc_id, s32 file_id); -void * LoadFromNarc_2(NarcId narc_id, s32 file_id, u32 heap_id); -void * FUN_02006528(NarcId narc_id, s32 file_id, u32 heap_id); -void FUN_02006548(void * dest, NarcId narc_id, s32 file_id, u32 offset, u32 size); -void * FUN_02006564(NarcId narc_id, s32 file_id, u32 heap_id, u32 offset, u32 size); -void * FUN_02006584(NarcId narc_id, s32 file_id, u32 heap_id, u32 offset, u32 size); -u32 LoadFromNARC_7(NarcId narc_id, s32 file_idx); -NARC * FUN_02006670(NarcId narc_id, u32 heap_id); -void FUN_020066F4(NARC * narc); -void * FUN_02006704(NARC * narc, u32 file_id, u32 heap_id); -void FUN_02006774(NARC * narc, u32 file_id, void * dest); -u32 FUN_020067D0(NARC * narc, u32 file_id); -void FUN_02006814(NARC * narc, u32 file_id, u32 pos, u32 size, void * dest); -void FUN_02006864(NARC * narc, u32 size, void * dest); -u16 FUN_02006874(NARC * narc); +void ReadFromNarcMemberByPathAndId(void * dest, const char * path, s32 file_idx, u32 offset, u32 size); +void * AllocAndReadFromNarcMemberByPathAndId(const char * path, s32 file_idx, u32 heap_id, u32 offset, u32 size, BOOL r4); +void ReadWholeNarcMemberByIdPair(void * dest, NarcId narc_id, s32 file_id); +void * AllocAndReadWholeNarcMemberByIdPair(NarcId narc_id, s32 file_id, u32 heap_id); +void * AllocAtEndAndReadWholeNarcMemberByIdPair(NarcId narc_id, s32 file_id, u32 heap_id); +void ReadFromNarcMemberByIdPair(void * dest, NarcId narc_id, s32 file_id, u32 offset, u32 size); +void * AllocAndReadFromNarcMemberByIdPair(NarcId narc_id, s32 file_id, u32 heap_id, u32 offset, u32 size); +void * AllocAtEndAndReadFromNarcMemberByIdPair(NarcId narc_id, s32 file_id, u32 heap_id, u32 offset, u32 size); +u32 GetNarcMemberSizeByIdPair(NarcId narc_id, s32 file_idx); +NARC * NARC_ctor(NarcId narc_id, u32 heap_id); +void NARC_dtor(NARC * narc); +void * NARC_AllocAndReadWholeMember(NARC * narc, u32 file_id, u32 heap_id); +void NARC_ReadWholeMember(NARC * narc, u32 file_id, void * dest); +u32 NARC_GetMemberSize(NARC * narc, u32 file_id); +void NARC_ReadFromMember(NARC * narc, u32 file_id, u32 pos, u32 size, void * dest); +void NARC_ReadFile(NARC * narc, u32 size, void * dest); +u16 NARC_GetFileCount(NARC * narc); #endif //POKEDIAMOND_FILESYSTEM_H diff --git a/include/global.h b/include/global.h index 8d5a3e78..2f31fa3d 100644 --- a/include/global.h +++ b/include/global.h @@ -1,6 +1,7 @@ #ifndef GUARD_GLOBAL_H #define GUARD_GLOBAL_H +#include "config.h" #include "function_target.h" #include "nitro.h" @@ -11,11 +12,17 @@ enum GameVersion { VERSION_FIRE_RED = 4, VERSION_LEAF_GREEN = 5, VERSION_DIAMOND = 10, + VERSION_PEARL = 11, }; enum GameLanguage { LANGUAGE_JAPANESE = 1, LANGUAGE_ENGLISH = 2, + LANGUAGE_FRENCH = 3, + LANGUAGE_ITALIAN = 4, + LANGUAGE_GERMAN = 5, + LANGUAGE_SPANISH = 7, + LANGUAGE_KOREAN = 8 }; extern void ErrorHandling(void); diff --git a/include/heap.h b/include/heap.h index 36b79122..49c54d22 100644 --- a/include/heap.h +++ b/include/heap.h @@ -1,8 +1,8 @@ #ifndef POKEDIAMOND_HEAP_H #define POKEDIAMOND_HEAP_H -void * FUN_02016998(u32 heap_id, u32 size); -void * FUN_020169D8(u32 heap_id, u32 size); -void FUN_02016A18(void * ptr); +void * AllocFromHeap(u32 heap_id, u32 size); +void * AllocFromHeapAtEnd(u32 heap_id, u32 size); +void FreeToHeap(void * ptr); #endif //POKEDIAMOND_HEAP_H diff --git a/include/main.h b/include/main.h index ff710655..7a6f4c36 100644 --- a/include/main.h +++ b/include/main.h @@ -5,9 +5,25 @@ #include "SPI_pm.h" #include "structs.h" +struct UnkStruct_02006234; + struct Unk21DBE18 { - u8 filler_00[16]; + BOOL (*unk0)(struct UnkStruct_02006234 *, u32 *); + BOOL (*unk4)(struct UnkStruct_02006234 *, u32 *); + BOOL (*unk8)(struct UnkStruct_02006234 *, u32 *); + FSOverlayID ovly; +}; + +struct UnkStruct_02006234 +{ + struct Unk21DBE18 ovly_mgr; + u32 unk10; + u32 unk14; + int * unk18; + void * unk1C; + u32 unk20; + u32 unk24; }; struct Unk2106FA0 diff --git a/include/poke_overlay.h b/include/poke_overlay.h index 400f600e..1ac69665 100644 --- a/include/poke_overlay.h +++ b/include/poke_overlay.h @@ -3,6 +3,8 @@ #include "FS_overlay.h" +#define SDK_OVERLAY_INVALID_ID -1u + #define OVERLAY_LOAD_WRAM 0 #define OVERLAY_LOAD_ITCM 1 #define OVERLAY_LOAD_DTCM 2 diff --git a/include/pokemon.h b/include/pokemon.h index 8886c47c..494f29d8 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -24,15 +24,7 @@ typedef enum { GIFT_EEVEE = 12 } EncounterType; -typedef enum { - JAPANESE = 1, - ENGLISH = 2, - FRENCH = 3, - ITALIAN = 4, - GERMAN = 5, - SPANISH = 7, - KOREAN = 8 -} OriginLanguage; +typedef enum GameLanguage OriginLanguage; typedef enum { ARCEUS_NORMAL = 0, |