mirror of
https://github.com/pret/pmd-red.git
synced 2026-07-02 00:21:28 -05:00
Move gMonsterArchieve to C
This commit is contained in:
parent
d70df01a8a
commit
f65e3d61ff
2496
data/monster_sbin.s
2496
data/monster_sbin.s
File diff suppressed because it is too large
Load Diff
|
|
@ -6,9 +6,9 @@
|
|||
u32 DecompressAT(u8 *result, s32 resultLength, const u8 *compressedData);
|
||||
u32 DecompressATFile(u8 *result, s32 resultLength, OpenedFile *file);
|
||||
u32 DecompressATGlobalFile(u32 *result, s32 resultLength, OpenedFile *file);
|
||||
u8 *GetSiroPtr(OpenedFile *openedFile);
|
||||
const u8 *GetSiroPtr(OpenedFile *openedFile);
|
||||
void nullsub_16(void);
|
||||
|
||||
bool8 sub_800B2D4(char *, char *, s32 length);
|
||||
|
||||
#endif // GUARD_DECOMPRESS_H
|
||||
#endif // GUARD_DECOMPRESS_H
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
typedef struct File
|
||||
{
|
||||
/* 0x0 */ char *name;
|
||||
/* 0x4 */ u8 *data;
|
||||
/* 0x4 */ const u8 *data;
|
||||
} File;
|
||||
|
||||
// size: 0x8
|
||||
typedef struct OpenedFile
|
||||
{
|
||||
/* 0x0 */ File *file;
|
||||
/* 0x4 */ u8 *data;
|
||||
/* 0x0 */ const File *file;
|
||||
/* 0x4 */ const u8 *data;
|
||||
} OpenedFile;
|
||||
|
||||
// size: 0x10
|
||||
|
|
@ -20,7 +20,7 @@ typedef struct FileArchive
|
|||
{
|
||||
/* 0x0 */ char magic[8];
|
||||
/* 0x8 */ s32 count;
|
||||
/* 0xC */ File *entries;
|
||||
/* 0xC */ const File *entries;
|
||||
} FileArchive;
|
||||
|
||||
// size: 0x8
|
||||
|
|
@ -39,7 +39,7 @@ typedef struct UnkFileStruct
|
|||
|
||||
OpenedFile *Call_OpenFileAndGetFileDataPtr(const u8 *filename, const FileArchive *arc);
|
||||
void CloseFile(OpenedFile *openedFile);
|
||||
u8 *GetFileDataPtr(OpenedFile *openedFile, s32 unused);
|
||||
const u8 *GetFileDataPtr(OpenedFile *openedFile, s32 unused);
|
||||
void InitFileSystem(void);
|
||||
OpenedFile *OpenFile(const u8 *filename, const FileArchive *arc);
|
||||
OpenedFile *OpenFileAndGetFileDataPtr(const u8 *filename, const FileArchive *arc);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ typedef struct LuminousCaveWork
|
|||
MenuStruct unk84;
|
||||
u8 fillD4[0x104 - 0xD4];
|
||||
OpenedFile *unk104;
|
||||
u8 *unk108;
|
||||
const u8 *unk108;
|
||||
u16 unk10C;
|
||||
u16 unk10E;
|
||||
u8 unk110;
|
||||
|
|
@ -42,4 +42,4 @@ bool8 HasEvolutionCompleted(void);
|
|||
u32 sub_802465C(void);
|
||||
u32 sub_80246F0(void);
|
||||
|
||||
#endif // GUARD_LUMINOUS_CAVE_H
|
||||
#endif // GUARD_LUMINOUS_CAVE_H
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@ struct PortraitGfxSub
|
|||
|
||||
struct PortraitGfx
|
||||
{
|
||||
struct PortraitGfxSub sprites[10];
|
||||
// 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
|
||||
|
|
|
|||
|
|
@ -783,6 +783,7 @@ SECTIONS {
|
|||
monster_sbin_section 0x8510000 :
|
||||
ALIGN(4)
|
||||
{
|
||||
src/monster_sbin.o(.rodata);
|
||||
data/monster_sbin.o(.rodata);
|
||||
} > ROM =0
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ extern u8 gUnknown_20398B8;
|
|||
|
||||
extern void sub_8003600(void);
|
||||
|
||||
extern s32 sub_800388C(u16, u8 *, u8);
|
||||
extern s32 sub_800388C(u16, const u8 *, u8);
|
||||
|
||||
extern void sub_80A4B38(void);
|
||||
extern void sub_80A4B54(void);
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ static void DecompressAT_Finish(void);
|
|||
static char DecompressAT_GetByte(s32);
|
||||
static void DecompressAT_Init(u32 *);
|
||||
static u32 DecompressATGlobal(u32 *, s32, const char *);
|
||||
static void NDS_DecompressRLE(void *);
|
||||
static void NDS_DecompressRLE(const void *);
|
||||
|
||||
u8 *GetSiroPtr(OpenedFile *openedFile)
|
||||
const u8 *GetSiroPtr(OpenedFile *openedFile)
|
||||
{
|
||||
struct SiroArchive *siro = (struct SiroArchive *)openedFile->data;
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ UNUSED static void *UnusedGetSir0Ptr(struct SiroArchive *siro)
|
|||
return siro->data;
|
||||
}
|
||||
|
||||
static void NDS_DecompressRLE(void *unused)
|
||||
static void NDS_DecompressRLE(const void *unused)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@ OpenedFile *OpenFile(const u8 *filename, const FileArchive *arc)
|
|||
s32 i;
|
||||
u32 magic = 0;
|
||||
bool32 magicFound;
|
||||
File *entries;
|
||||
File *file;
|
||||
const File *entries;
|
||||
const File *file;
|
||||
|
||||
magic = strcmp(arc->magic, gUnknown_80B9B94) != 0;
|
||||
|
||||
|
|
@ -109,13 +109,13 @@ OpenedFile *OpenFile(const u8 *filename, const FileArchive *arc)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static u8 *_GetFileDataPtr(OpenedFile *openedFile)
|
||||
static const u8 *_GetFileDataPtr(OpenedFile *openedFile)
|
||||
{
|
||||
openedFile->data = openedFile->file->data;
|
||||
return openedFile->data;
|
||||
}
|
||||
|
||||
u8 *GetFileDataPtr(OpenedFile *openedFile, s32 unused)
|
||||
const u8 *GetFileDataPtr(OpenedFile *openedFile, s32 unused)
|
||||
{
|
||||
_GetFileDataPtr(openedFile);
|
||||
return GetSiroPtr(openedFile);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ extern const u8 gUnknown_81177EC[];
|
|||
extern const u8 *gUnknown_81178F4[];
|
||||
|
||||
// code_8098BDC.s
|
||||
extern void sub_809971C(u16, u8 *, s16);
|
||||
extern void sub_809971C(u16, const u8 *, s16);
|
||||
extern void sub_80997F4(u16, u16);
|
||||
// pokemon_2.s
|
||||
extern void InitShadowSprites(u32, u32);
|
||||
|
|
@ -119,7 +119,7 @@ void sub_80A6460(void)
|
|||
{
|
||||
OpenedFile *file;
|
||||
s32 i;
|
||||
u8 *data;
|
||||
const u8 *data;
|
||||
u16 something;
|
||||
|
||||
file = OpenFileAndGetFileDataPtr(gUnknown_81177EC, &gMonsterFileArchive);
|
||||
|
|
@ -138,7 +138,7 @@ void sub_80A6460(void)
|
|||
|
||||
void sub_80A64A4(void)
|
||||
{
|
||||
u8 *r2;
|
||||
const u8 *r2;
|
||||
u16 r4;
|
||||
u32 r5;
|
||||
OpenedFile *file;
|
||||
|
|
|
|||
1014
src/monster_sbin.c
Normal file
1014
src/monster_sbin.c
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -61,7 +61,7 @@ bool8 sub_8037A48(void)
|
|||
|
||||
gUnknown_202EC40[0] = stack.unk10;
|
||||
gUnknown_202EC40[1] = stack_1.unk10;
|
||||
|
||||
|
||||
if (IsNotChunsoft(&stack) || IsNotChunsoft(&stack_1))
|
||||
return FALSE;
|
||||
|
||||
|
|
@ -382,7 +382,7 @@ static void sub_8037EBC(WonderMailStruct_203B2C0_sub *param_1, WonderMailStruct
|
|||
{
|
||||
unkStruct_203B480 *mail;
|
||||
WonderMailStruct_203B2C0_sub *puVar2;
|
||||
|
||||
|
||||
if(sub_800D588() == 0)
|
||||
{
|
||||
puVar2 = param_1;
|
||||
|
|
@ -643,4 +643,4 @@ _start:
|
|||
_end:
|
||||
sub_800D520();
|
||||
return linkStatus;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user