diff options
author | yenatch <yenatch@gmail.com> | 2017-06-20 20:26:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-20 20:26:44 -0400 |
commit | b22e5219ba01c70da9a03397430bff10d0b99060 (patch) | |
tree | 7db3364ee8ccda2ca66606ef1b65ebc4113a3660 /include | |
parent | 102f5b1e15e7295e30a3cebfbbad3c8af4cc1d37 (diff) | |
parent | a80eef47ca3fea61b9345ae791056c9ca2650f97 (diff) |
Merge pull request #335 from marijnvdwerf/camthesaxman/decompile_pokeball
Decompile pokeball
Diffstat (limited to 'include')
-rw-r--r-- | include/data2.h | 19 | ||||
-rw-r--r-- | include/decompress.h | 14 | ||||
-rw-r--r-- | include/field_effect.h | 6 | ||||
-rw-r--r-- | include/graphics.h | 26 | ||||
-rw-r--r-- | include/intro_credits_graphics.h | 14 | ||||
-rw-r--r-- | include/pokeball.h | 6 | ||||
-rw-r--r-- | include/pokemon.h | 5 | ||||
-rw-r--r-- | include/songs.h | 20 | ||||
-rw-r--r-- | include/sprite.h | 21 |
9 files changed, 89 insertions, 42 deletions
diff --git a/include/data2.h b/include/data2.h index 759efe3d3..f292472ef 100644 --- a/include/data2.h +++ b/include/data2.h @@ -3,7 +3,8 @@ #include "sprite.h" -struct UnknownStructD2 { +struct UnknownStructD2 +{ u32 unk0; u32 unk4; u32 unk8; @@ -21,15 +22,15 @@ extern const union AffineAnimCmd *const gSpriteAffineAnimTable_81E7C18; extern const union AnimCmd *const gSpriteAnimTable_81E7C64[]; extern struct MonCoords gMonFrontPicCoords[]; extern struct MonCoords gMonBackPicCoords[]; -extern struct SpriteSheet gMonFrontPicTable[]; -extern struct SpriteSheet gMonBackPicTable[]; -extern const struct SpritePalette gMonPaletteTable[]; -extern const struct SpritePalette gMonShinyPaletteTable[]; +extern struct CompressedSpriteSheet gMonFrontPicTable[]; +extern struct CompressedSpriteSheet gMonBackPicTable[]; +extern const struct CompressedSpritePalette gMonPaletteTable[]; +extern const struct CompressedSpritePalette gMonShinyPaletteTable[]; extern const union AnimCmd *const *const gUnknown_081EC2A4[]; extern const union AnimCmd *const *const gUnknown_081ECACC[]; extern struct MonCoords gTrainerBackPicCoords[]; -extern struct SpriteSheet gTrainerBackPicTable[]; -extern const struct SpritePalette gTrainerBackPicPaletteTable[]; +extern struct CompressedSpriteSheet gTrainerBackPicTable[]; +extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[]; extern u8 gEnemyMonElevation[]; extern const u8 gTrainerClassNames[][13]; extern const struct Trainer gTrainers[]; @@ -37,8 +38,8 @@ extern u8 gSpeciesNames[][11]; extern u8 gMoveNames[][13]; extern const struct UnknownStructD2 gUnknown_081F9674; extern const u8 gUnknown_081F96C8[]; -extern struct SpriteSheet gUnknown_081FAEA4; -extern struct SpritePalette gUnknown_081FAEAC; +extern struct CompressedSpriteSheet gUnknown_081FAEA4; +extern struct CompressedSpritePalette gUnknown_081FAEAC; extern const struct SpriteTemplate gSpriteTemplate_81FAF0C; extern void *const gUnknown_081FAF4C[]; extern struct BattleMove gBattleMoves[]; diff --git a/include/decompress.h b/include/decompress.h index 28570afdd..07d69301f 100644 --- a/include/decompress.h +++ b/include/decompress.h @@ -5,13 +5,13 @@ void sub_800D238(const void *src, void *dest); void LZDecompressVram(const void *src, void *dest); -void LoadCompressedObjectPic(const struct SpriteSheet *a); -void LoadCompressedObjectPicOverrideBuffer(const struct SpriteSheet *a, void *buffer); -void LoadCompressedObjectPalette(const struct SpritePalette *a); -void LoadCompressedObjectPaletteOverrideBuffer(const struct SpritePalette *a, void *buffer); -void DecompressPicFromTable_2(const struct SpriteSheet *a, u8 b, u8 c, void *d, void *e, s32 f); -void HandleLoadSpecialPokePic(const struct SpriteSheet *spriteSheet, u32 b, u32 c, u32 d, void *dest, s32 species, u32 g); -void LoadSpecialPokePic(const struct SpriteSheet *spriteSheet, u32 b, u32 c, u32 d, void *dest, s32 species, u32 g, u32 h); +void LoadCompressedObjectPic(const struct CompressedSpriteSheet *a); +void LoadCompressedObjectPicOverrideBuffer(const struct CompressedSpriteSheet *a, void *buffer); +void LoadCompressedObjectPalette(const struct CompressedSpritePalette *a); +void LoadCompressedObjectPaletteOverrideBuffer(const struct CompressedSpritePalette *a, void *buffer); +void DecompressPicFromTable_2(const struct CompressedSpriteSheet *a, u8 b, u8 c, void *d, void *e, s32 f); +void HandleLoadSpecialPokePic(const struct CompressedSpriteSheet *spriteSheet, u32 b, u32 c, u32 d, void *dest, s32 species, u32 g); +void LoadSpecialPokePic(const struct CompressedSpriteSheet *spriteSheet, u32 b, u32 c, u32 d, void *dest, s32 species, u32 g, u32 h); void Unused_LZDecompressWramIndirect(const void **src, void *dest); #endif // GUARD_DECOMPRESS_H diff --git a/include/field_effect.h b/include/field_effect.h index 74b5fa34d..cd84652b1 100644 --- a/include/field_effect.h +++ b/include/field_effect.h @@ -72,15 +72,13 @@ enum FieldEffectScriptIdx FLDEFF_USE_TELEPORT }; -extern const struct SpritePalette gTrainerFrontPicPaletteTable[2]; +extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[2]; extern const struct SpritePalette gUnknown_0839F114; -extern const struct SpriteSheet gTrainerFrontPicTable[2]; +extern const struct CompressedSpriteSheet gTrainerFrontPicTable[2]; extern const struct SpriteTemplate gSpriteTemplate_839F128; extern const struct OamData gOamData_839F0F4; extern struct SpriteTemplate gUnknown_02024E8C; -extern const struct SpritePalette *sub_80409C8(u16, u32, u32); - extern u8 gLastFieldPokeMenuOpened; u32 FieldEffectStart(u8 id); diff --git a/include/graphics.h b/include/graphics.h index 096a1982c..c3fe20996 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -2,6 +2,32 @@ #define GUARD_GRAPHICS_H // data/graphics.s +extern const u8 gInterfaceGfx_PokeBall[]; +extern const u8 gInterfacePal_PokeBall[]; +extern const u8 gInterfaceGfx_GreatBall[]; +extern const u8 gInterfacePal_GreatBall[]; +extern const u8 gInterfaceGfx_SafariBall[]; +extern const u8 gInterfacePal_SafariBall[]; +extern const u8 gInterfaceGfx_UltraBall[]; +extern const u8 gInterfacePal_UltraBall[]; +extern const u8 gInterfaceGfx_MasterBall[]; +extern const u8 gInterfacePal_MasterBall[]; +extern const u8 gInterfaceGfx_NetBall[]; +extern const u8 gInterfacePal_NetBall[]; +extern const u8 gInterfaceGfx_DiveBall[]; +extern const u8 gInterfacePal_DiveBall[]; +extern const u8 gInterfaceGfx_NestBall[]; +extern const u8 gInterfacePal_NestBall[]; +extern const u8 gInterfaceGfx_RepeatBall[]; +extern const u8 gInterfacePal_RepeatBall[]; +extern const u8 gInterfaceGfx_TimerBall[]; +extern const u8 gInterfacePal_TimerBall[]; +extern const u8 gInterfaceGfx_LuxuryBall[]; +extern const u8 gInterfacePal_LuxuryBall[]; +extern const u8 gInterfaceGfx_PremierBall[]; +extern const u8 gInterfacePal_PremierBall[]; +extern const u8 gUnknown_08D030D0[]; + extern const u8 gMonFootprint_QuestionMark[]; // data/graphics/pokemon/graphics.inc diff --git a/include/intro_credits_graphics.h b/include/intro_credits_graphics.h index 85485a2c4..5abb2381b 100644 --- a/include/intro_credits_graphics.h +++ b/include/intro_credits_graphics.h @@ -1,14 +1,14 @@ #ifndef GUARD_INTRO_CREDITS_GRAPHICS_H #define GUARD_INTRO_CREDITS_GRAPHICS_H -extern const struct SpriteSheet gIntro2BrendanSpriteSheet; -extern const struct SpriteSheet gIntro2MaySpriteSheet; -extern const struct SpriteSheet gIntro2BicycleSpriteSheet; -extern const struct SpriteSheet gIntro2LatiosSpriteSheet; -extern const struct SpriteSheet gIntro2LatiasSpriteSheet; +extern const struct CompressedSpriteSheet gIntro2BrendanSpriteSheet; +extern const struct CompressedSpriteSheet gIntro2MaySpriteSheet; +extern const struct CompressedSpriteSheet gIntro2BicycleSpriteSheet; +extern const struct CompressedSpriteSheet gIntro2LatiosSpriteSheet; +extern const struct CompressedSpriteSheet gIntro2LatiasSpriteSheet; extern const struct SpritePalette gIntro2SpritePalettes[]; -extern const struct SpriteSheet gUnknown_08416E24; -extern const struct SpriteSheet gUnknown_08416E34; +extern const struct CompressedSpriteSheet gUnknown_08416E24; +extern const struct CompressedSpriteSheet gUnknown_08416E34; void load_intro_part2_graphics(/*TODO: arg types*/); void sub_8148C78(/*TODO: arg types*/); diff --git a/include/pokeball.h b/include/pokeball.h index b6fbbcf77..19f813415 100644 --- a/include/pokeball.h +++ b/include/pokeball.h @@ -1,7 +1,11 @@ #ifndef GUARD_POKEBALL_H #define GUARD_POKEBALL_H -void CreatePokeballSprite(u8 r0, u8 r1, u8 r2, u8 r3, u8 s1, u8 s2, u8 s3, u16 s4); +extern const struct SpriteTemplate gBallSpriteTemplates[]; + +void CreatePokeballSprite(u8 r0, u8 r1, u8 r2, u8 r3, u8 s1, u8 s2, u8 s3, u32 s4); void sub_804777C(u8); +void sub_80478DC(u8); +void sub_804794C(u8); #endif // GUARD_POKEBALL_H diff --git a/include/pokemon.h b/include/pokemon.h index d67cd647a..47990073b 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -503,8 +503,9 @@ u8 sub_8040574(struct Pokemon *party); void ClearBattleMonForms(void); void sub_80408BC(); void current_map_music_set__default_for_battle(u16); -const u16 *species_and_otid_get_pal(u16, u32, u32); -const struct SpritePalette *sub_80409C8(u16, u32, u32); +const u8 *pokemon_get_pal(struct Pokemon *mon); +const u8 *species_and_otid_get_pal(u16, u32, u32); +const struct CompressedSpritePalette *sub_80409C8(u16, u32, u32); bool8 IsOtherTrainer(u32, u8 *); void sub_8040B8C(void); void SetWildMonHeldItem(void); diff --git a/include/songs.h b/include/songs.h index 72d28a355..8180ee67e 100644 --- a/include/songs.h +++ b/include/songs.h @@ -59,12 +59,12 @@ enum SE_MOTER, SE_CARD, SE_SAVE, - SE_KON, - SE_KON2, - SE_KON3, - SE_KON4, - SE_SUIKOMU, - SE_NAGERU, + /*0x38*/ SE_KON, + /*0x39*/ SE_KON2, + /*0x3A*/ SE_KON3, + /*0x3B*/ SE_KON4, + /*0x3C*/ SE_SUIKOMU, + /*0x3D*/ SE_NAGERU, SE_TOY_C, SE_TOY_D, SE_TOY_E, @@ -270,10 +270,10 @@ enum BGM_NAMINORI, BGM_DAN01, /*0x16F*/ BGM_FANFA1, - BGM_ME_ASA, - BGM_ME_BACHI, - BGM_FANFA4, - BGM_FANFA5, + /*0x170*/ BGM_ME_ASA, + /*0x171*/ BGM_ME_BACHI, + /*0x172*/ BGM_FANFA4, + /*0x173*/ BGM_FANFA5, BGM_ME_WAZA, BGM_BIJYUTU, BGM_DOORO_X4, diff --git a/include/sprite.h b/include/sprite.h index dd9d5efb7..3f893132e 100644 --- a/include/sprite.h +++ b/include/sprite.h @@ -5,11 +5,18 @@ struct SpriteSheet { - const u8 *data; + const u8 *data; // Raw uncompressed pixel data u16 size; u16 tag; }; +struct CompressedSpriteSheet +{ + const u8 *data; // LZ77 compressed pixel data + u16 size; // Uncompressed size of pixel data + u16 tag; +}; + struct SpriteFrameImage { u8 *data; @@ -20,7 +27,13 @@ struct SpriteFrameImage struct SpritePalette { - const u16 *data; + const u16 *data; // Raw uncompressed palette data + u16 tag; +}; + +struct CompressedSpritePalette +{ + const u8 *data; // LZ77 compressed palette data u16 tag; }; @@ -99,6 +112,10 @@ union AffineAnimCmd #define AFFINEANIMCMD_FRAME(_xScale, _yScale, _rotation, _duration) \ {.frame = {.xScale = _xScale, .yScale = _yScale, .rotation = _rotation, .duration = _duration}} +#define AFFINEANIMCMD_LOOP(_count) \ + {.loop = {.type = AFFINEANIMCMDTYPE_LOOP, .count = _count}} +#define AFFINEANIMCMD_JUMP(_target) \ + {.jump = {.type = AFFINEANIMCMDTYPE_JUMP, .target = _target}} #define AFFINEANIMCMD_END \ {.type = AFFINEANIMCMDTYPE_END} |