mirror of
https://github.com/pret/pmd-red.git
synced 2026-08-17 14:26:56 -05:00
Merge pull request #348 from DizzyEggg/monster_archieve
Some checks failed
GithubCI / build (push) Has been cancelled
Some checks failed
GithubCI / build (push) Has been cancelled
Move main gMonsterFileArchive array to C
This commit is contained in:
5330
data/monster_sbin.s
5330
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,11 +39,13 @@ 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);
|
||||
|
||||
u32 sub_800A8F8(u32 value);
|
||||
|
||||
extern const FileArchive gMonsterFileArchive; // monster_sbin.c
|
||||
|
||||
#endif //GUARD_FILE_SYSTEM_H
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -792,6 +792,7 @@ SECTIONS {
|
||||
monster_sbin_section 0x8510000 :
|
||||
ALIGN(4)
|
||||
{
|
||||
src/monster_sbin.o(.rodata);
|
||||
data/monster_sbin.o(.rodata);
|
||||
} > ROM =0
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "text.h"
|
||||
|
||||
// monster_sbin.s
|
||||
extern const struct FileArchive gMonsterFileArchive;
|
||||
// data_8106A4C.s
|
||||
extern const u8 gUnknown_8106EA0[]; // ax%03d
|
||||
extern const u8 gUnknown_8106E98[]; // palet
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -37,7 +37,6 @@ EWRAM_DATA static u8 sCurrDirection = 0;
|
||||
EWRAM_DATA static u8 sHeldDpadCounter = 0;
|
||||
|
||||
extern const FileArchive gTitleMenuFileArchive;
|
||||
extern const FileArchive gMonsterFileArchive;
|
||||
|
||||
static void MoveToNewLocation(s32 destLocationId, s32 direction, s32 nFrames);
|
||||
static u8 GetChosenDirection(void);
|
||||
|
||||
@@ -25,7 +25,6 @@ extern void xxx_call_update_bg_sound_input(void);
|
||||
extern s32 sprintf(char *, const char *, ...);
|
||||
|
||||
extern const FileArchive gTitleMenuFileArchive;
|
||||
extern const FileArchive gMonsterFileArchive;
|
||||
|
||||
static inline bool8 CheckAxFlag8000(axdata *ptr)
|
||||
{
|
||||
|
||||
@@ -25,7 +25,6 @@ EWRAM_INIT OpenedFile *gUnknown_203B4B4 = {NULL};
|
||||
// dungeon_sbin.s
|
||||
extern const struct FileArchive gDungeonFileArchive;
|
||||
// monster_sbin.s
|
||||
extern const struct FileArchive gMonsterFileArchive;
|
||||
// ornament_sbin.s
|
||||
extern const struct FileArchive gOrnamentFileArchive;
|
||||
// data_8115F5C.s
|
||||
@@ -35,7 +34,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 +118,7 @@ void sub_80A6460(void)
|
||||
{
|
||||
OpenedFile *file;
|
||||
s32 i;
|
||||
u8 *data;
|
||||
const u8 *data;
|
||||
u16 something;
|
||||
|
||||
file = OpenFileAndGetFileDataPtr(gUnknown_81177EC, &gMonsterFileArchive);
|
||||
@@ -138,7 +137,7 @@ void sub_80A6460(void)
|
||||
|
||||
void sub_80A64A4(void)
|
||||
{
|
||||
u8 *r2;
|
||||
const u8 *r2;
|
||||
u16 r4;
|
||||
u32 r5;
|
||||
OpenedFile *file;
|
||||
|
||||
1015
src/monster_sbin.c
Normal file
1015
src/monster_sbin.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -20,7 +20,6 @@
|
||||
#include "decompress.h"
|
||||
|
||||
extern const FileArchive gTitleMenuFileArchive;
|
||||
extern const FileArchive gMonsterFileArchive;
|
||||
|
||||
extern u16 gUnknown_2026E4E;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user