diff options
Diffstat (limited to 'include')
-rwxr-xr-x[-rw-r--r--] | include/asm.inc.h | 8 | ||||
-rw-r--r-- | include/battle.h | 10 | ||||
-rwxr-xr-x[-rw-r--r--] | include/field_effect.h | 209 | ||||
-rw-r--r-- | include/field_weather.h | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | include/gba/defines.h | 3 | ||||
-rw-r--r-- | include/gba/types.h | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | include/global.h | 22 | ||||
-rw-r--r-- | include/record_mixing.h | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | include/rom4.h | 4 | ||||
-rw-r--r-- | include/songs.h | 34 | ||||
-rwxr-xr-x | include/sprite.h | 2 |
11 files changed, 265 insertions, 35 deletions
diff --git a/include/asm.inc.h b/include/asm.inc.h index e087acd28..3837af64b 100644..100755 --- a/include/asm.inc.h +++ b/include/asm.inc.h @@ -42,7 +42,7 @@ void LoadWordFromTwoHalfwords(u16 *, u32 *); u8 Daycare_CountPokemon(struct BoxPokemon *); // asm/daycare.o -void sub_8041324(struct BoxPokemon *, void *); +void sub_8041324(struct BoxPokemon *, struct RecordMixing_UnknownStruct *); void sub_8041790(int i); u16 sub_8041870(u16); void sub_8041940(void); @@ -207,9 +207,9 @@ void sub_8083A84(TaskFunc); s32 sub_8083BF4(u8 id); // asm/field_effect.o -u8 CreateTrainerSprite_BirchSpeech(u8, u16, u16, u8, void *); -void LoadTrainerGfx_TrainerCard(u8 gender, int, void *); -u8 CreateBirchSprite(u8, u8, u8); +u8 CreateTrainerSprite_BirchSpeech(u8, s16, s16, u8, u8 *); +void LoadTrainerGfx_TrainerCard(u8 gender, u16, u8 *); +u8 CreateBirchSprite(s16, s16, u8); // asm/unknown_task.o void remove_some_task(void); diff --git a/include/battle.h b/include/battle.h index 858e493f1..9714c6add 100644 --- a/include/battle.h +++ b/include/battle.h @@ -35,7 +35,7 @@ extern u8 unk_2000000[]; // to do: maybe try to reduce the defines needed to match? #define BATTLE_STRUCT ((struct BattleStruct *)(unk_2000000)) #define AI_THINKING_STRUCT ((struct AI_ThinkingStruct *)(unk_2000000 + 0x16800)) -#define UNK_2016A00_STRUCT ((struct UnknownStruct1 *)(unk_2000000 + 0x16A00)) +#define UNK_2016A00_STRUCT ((struct UnkBattleStruct1 *)(unk_2000000 + 0x16A00)) #define AI_STACK ((struct AI_Stack *)(unk_2000000 + 0x16C00)) #define AI_ARRAY_160CC ((struct SmallItemStruct *)(unk_2000000 + 0x160CC)) @@ -61,7 +61,7 @@ struct Trainer /*0x24*/ void *party; }; -struct UnknownStruct1 // AI_Opponent_Info? +struct UnkBattleStruct1 // AI_Opponent_Info? { /*0x00*/ u16 movesUsed[2][8]; // 0xFFFF means move not used (confuse self hit, etc) /*0x20*/ u8 unk20[2]; @@ -119,10 +119,10 @@ struct BattleStruct /* 0x2000000 */ u8 filler2[0x72E]; /* 0x16800 */ struct AI_ThinkingStruct ai; /* 0x2016800 */ u8 filler1681C[0x1E4]; - /* 0x16A00 */ struct UnknownStruct1 unk_2016A00_2; + /* 0x16A00 */ struct UnkBattleStruct1 unk_2016A00_2; }; -struct UnknownStruct4 +struct UnkBattleStruct4 { /*0x00*/ u8 filler0[0x3]; /*0x04*/ u16 unk4; @@ -143,7 +143,7 @@ struct UnknownStruct4 }; extern struct UnknownStruct1 unk_2016A00; -extern struct UnknownStruct4 gUnknown_02024CA8[]; +extern struct UnkBattleStruct4 gUnknown_02024CA8[]; extern struct AI_ThinkingStruct gAIThinkingSpace; struct UnknownStruct11 diff --git a/include/field_effect.h b/include/field_effect.h index a46c048cb..2cf7f0c7a 100644..100755 --- a/include/field_effect.h +++ b/include/field_effect.h @@ -3,6 +3,85 @@ #include "sprite.h" +enum FieldEffectScriptIdx +{ + FLDEFF_EXCLAMATION_MARK_ICON_1, + FLDEFF_USE_CUT_ON_GRASS, + FLDEFF_USE_CUT_ON_TREE, + FLDEFF_SHADOW, + FLDEFF_TALL_GRASS, + FLDEFF_RIPPLE, + FLDEFF_FIELD_MOVE_SHOW_MON, + FLDEFF_ASH, + FLDEFF_SURF_BLOB, + FLDEFF_USE_SURF, + FLDEFF_DUST, + FLDEFF_USE_SECRET_POWER_CAVE, + FLDEFF_JUMP_TALL_GRASS, + FLDEFF_SAND_FOOTPRINTS, + FLDEFF_JUMP_BIG_SPLASH, + FLDEFF_SPLASH, + FLDEFF_JUMP_SMALL_SPLASH, + FLDEFF_LONG_GRASS, + FLDEFF_JUMP_LONG_GRASS, + FLDEFF_UNKNOWN_19, + FLDEFF_UNKNOWN_20, + FLDEFF_UNKNOWN_21, + FLDEFF_UNKNOWN_22, + FLDEFF_BERRY_TREE_GROWTH_SPARKLE, + FLDEFF_DEEP_SAND_FOOTPRINTS, + FLDEFF_POKECENTER_HEAL, + FLDEFF_USE_SECRET_POWER_TREE, + FLDEFF_USE_SECRET_POWER_SHRUB, + FLDEFF_TREE_DISGUISE, + FLDEFF_MOUNTAIN_DISGUISE, + FLDEFF_NPCFLY_OUT, + FLDEFF_USE_FLY, + FLDEFF_FLY_IN, + FLDEFF_EXCLAMATION_MARK_ICON_2, + FLDEFF_FEET_IN_FLOWING_WATER, + FLDEFF_BIKE_TIRE_TRACKS, + FLDEFF_SAND_DISGUISE, + FLDEFF_USE_ROCK_SMASH, + FLDEFF_USE_DIG, + FLDEFF_SAND_PILE, + FLDEFF_USE_STRENGTH, + FLDEFF_SHORT_GRASS, + FLDEFF_HOT_SPRINGS_WATER, + FLDEFF_USE_WATERFALL, + FLDEFF_USE_DIVE, + FLDEFF_POKEBALL, + FLDEFF_HEART_ICON, + FLDEFF_NOP_47, + FLDEFF_NOP_48, + FLDEFF_POP_OUT_OF_ASH, + FLDEFF_LAVARIDGE_GYM_WARP, + FLDEFF_SWEET_SCENT, + FLDEFF_SAND_PILLAR, + FLDEFF_BUBBLES, + FLDEFF_SPARKLE, + FLDEFF_SECRET_POWER_CAVE, + FLDEFF_SECRET_POWER_TREE, + FLDEFF_SECRET_POWER_SHRUB, + FLDEFF_CUT_GRASS, + FLDEFF_FIELD_MOVE_SHOW_MON_INIT, + FLDEFF_USE_FLY_ANCIENT_TOMB, + FLDEFF_PCTURN_ON, + FLDEFF_HALL_OF_FAME_RECORD, + FLDEFF_USE_TELEPORT +}; + +extern const struct SpritePalette gTrainerFrontPicPaletteTable[2]; +extern const struct SpritePalette gUnknown_0839F114; +extern const struct SpriteSheet 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); bool8 FieldEffectCmd_loadtiles(u8 **script, u32 *val); bool8 FieldEffectCmd_loadfadedpal(u8 **script, u32 *val); @@ -25,5 +104,135 @@ void FieldEffectActiveListClear(void); void FieldEffectActiveListAdd(u8 id); void FieldEffectActiveListRemove(u8 id); bool8 FieldEffectActiveListContains(u8 id); +void sub_807DE38(u8 index); + +void SpriteCB_PokeballGlow(struct Sprite *); +void SpriteCB_PokecenterMonitor(struct Sprite *); +void SpriteCB_HallOfFameMonitor(struct Sprite *); + +void PokecenterHealEffect_0(struct Task *); +void PokecenterHealEffect_1(struct Task *); +void PokecenterHealEffect_2(struct Task *); +void PokecenterHealEffect_3(struct Task *); + +void HallOfFameRecordEffect_0(struct Task *); +void HallOfFameRecordEffect_1(struct Task *); +void HallOfFameRecordEffect_2(struct Task *); +void HallOfFameRecordEffect_3(struct Task *); + +void PokeballGlowEffect_0(struct Sprite *); +void PokeballGlowEffect_1(struct Sprite *); +void PokeballGlowEffect_2(struct Sprite *); +void PokeballGlowEffect_3(struct Sprite *); +void PokeballGlowEffect_4(struct Sprite *); +void PokeballGlowEffect_5(struct Sprite *); +void PokeballGlowEffect_6(struct Sprite *); +void PokeballGlowEffect_7(struct Sprite *); + +bool8 sub_80867AC(struct Task *); +bool8 sub_8086854(struct Task *); +bool8 sub_8086870(struct Task *); +bool8 sub_80868E4(struct Task *); +bool8 sub_808699C(struct Task *); +bool8 sub_80869B8(struct Task *); +bool8 sub_80869F8(struct Task *); + +bool8 sub_8086AA0(struct Task *); +bool8 sub_8086AC0(struct Task *); +bool8 sub_8086B30(struct Task *); +bool8 sub_8086B54(struct Task *); +bool8 sub_8086B64(struct Task *); +bool8 sub_8086B88(struct Task *); + +bool8 sub_8086CF4(struct Task *); +bool8 sub_8086D70(struct Task *); +bool8 sub_8086DB0(struct Task *); +bool8 sub_8086E10(struct Task *); +bool8 sub_8086E50(struct Task *); +bool8 sub_8086EB0(struct Task *); +bool8 sub_8086ED4(struct Task *); + +bool8 sub_8086FB0(struct Task *, struct MapObject *); +bool8 waterfall_1_do_anim_probably(struct Task *, struct MapObject *); +bool8 waterfall_2_wait_anim_finish_probably(struct Task *, struct MapObject *); +bool8 sub_8087030(struct Task *, struct MapObject *); +bool8 sub_8087058(struct Task *, struct MapObject *); + +bool8 sub_8087124(struct Task *); +bool8 dive_2_unknown(struct Task *); +bool8 dive_3_unknown(struct Task *); + +bool8 sub_808722C(struct Task *, struct MapObject *, struct Sprite *); +bool8 sub_8087264(struct Task *, struct MapObject *, struct Sprite *); +bool8 sub_8087298(struct Task *, struct MapObject *, struct Sprite *); +bool8 sub_80872E4(struct Task *, struct MapObject *, struct Sprite *); +bool8 sub_80873D8(struct Task *, struct MapObject *, struct Sprite *); +bool8 sub_80873F4(struct Task *, struct MapObject *, struct Sprite *); + +bool8 sub_80874CC(struct Task *, struct MapObject *, struct Sprite *); +bool8 sub_80874FC(struct Task *, struct MapObject *, struct Sprite *); +bool8 sub_8087548(struct Task *, struct MapObject *, struct Sprite *); +bool8 sub_808759C(struct Task *, struct MapObject *, struct Sprite *); + +bool8 sub_80876C8(struct Task *, struct MapObject *, struct Sprite *); +bool8 sub_80876F8(struct Task *, struct MapObject *, struct Sprite *); +bool8 sub_8087774(struct Task *, struct MapObject *, struct Sprite *); +bool8 sub_80877AC(struct Task *, struct MapObject *, struct Sprite *); +bool8 sub_80877D4(struct Task *, struct MapObject *, struct Sprite *); + +void sub_80878F4(struct Task *); +void sub_8087914(struct Task *); + +void sub_8087AA4(struct Task *); +void sub_8087AC8(struct Task *); + +void sub_8087BEC(struct Task *); +void sub_8087C14(struct Task *); +void sub_8087CA4(struct Task *); +void sub_8087D78(struct Task *); + +void sub_8087E4C(struct Task *); +void sub_8087ED8(struct Task *); +void sub_8087FDC(struct Task *); + +void sub_8088150(struct Task *); +void sub_80881C0(struct Task *); +void sub_8088228(struct Task *); +void sub_80882B4(struct Task *); +void sub_80882E4(struct Task *); +void sub_8088338(struct Task *); +void sub_8088380(struct Task *); + +void sub_80884AC(struct Task *); +void sub_80884E8(struct Task *); +void sub_8088554(struct Task *); +void sub_80885A8(struct Task *); +void sub_80885D8(struct Task *); +void sub_808860C(struct Task *); +void sub_808862C(struct Task *); + +void sub_8088984(struct Task *); +void sub_80889E4(struct Task *); +void sub_8088A30(struct Task *); +void sub_8088A78(struct Task *); +void sub_8088AF4(struct Task *); + +void sub_8088CA0(struct Task *); +void sub_8088CF8(struct Task *); +void sub_8088D3C(struct Task *); +void sub_8088D94(struct Task *); +void sub_8088DD8(struct Task *); +void sub_8088E2C(struct Task *); +void sub_8088EB4(struct Task *); +void sub_8088F10(struct Task *); +void sub_8088F30(struct Task *); + +void sub_80892A0(struct Task *); +void sub_8089354(struct Task *); +void sub_80893C0(struct Task *); +void sub_8089414(struct Task *); +void sub_808948C(struct Task *); +void sub_80894C4(struct Task *); +void fishE(struct Task *); #endif // GUARD_FIELD_EFFECT_H diff --git a/include/field_weather.h b/include/field_weather.h index af07c970d..df216aea7 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -31,6 +31,8 @@ void sub_807D874(u8); // ... void sub_807DB64(u8, u8); // ... +void sub_807DE68(void); +// ... void PlayRainSoundEffect(void); // ... void SetSav1Weather(u32); diff --git a/include/gba/defines.h b/include/gba/defines.h index 0f7f06755..e88d2da8b 100644..100755 --- a/include/gba/defines.h +++ b/include/gba/defines.h @@ -58,4 +58,7 @@ #define WIN_RANGE(a, b) (((a) << 8) | (b)) +#define min(a, b) (a >= b ? a : b) +#define max(a, b) (a <= b ? a : b) + #endif // GUARD_GBA_DEFINES diff --git a/include/gba/types.h b/include/gba/types.h index fd8a20a4c..96e057ab7 100644 --- a/include/gba/types.h +++ b/include/gba/types.h @@ -34,7 +34,7 @@ struct PlttData u16 g:5; // green u16 b:5; // blue u16 unused_15:1; -}; +} /*__attribute__((packed))*/; struct OamData { diff --git a/include/global.h b/include/global.h index 9a95cf41f..13db2620f 100644..100755 --- a/include/global.h +++ b/include/global.h @@ -10,6 +10,16 @@ // to help in decompiling #define asm_comment(x) asm volatile("@ -- " x " -- ") +#define asm_unified(x) asm(".syntax unified\n" x "\n.syntax divided\n") + +#define nonmatching(fndec, x) {\ +__attribute__((naked))\ +fndec\ +{\ + asm_unified(x);\ +}\ +} + #define ARRAY_COUNT(array) (sizeof(array) / sizeof((array)[0])) #define POKEMON_NAME_LENGTH 10 @@ -472,10 +482,16 @@ struct GabbyAndTyData { /*2b1b*/ u8 valB_5:3; }; -struct RecordMixing_UnknownStruct { +struct RecordMixing_UnknownStructSub { u8 data[0x38]; }; +struct RecordMixing_UnknownStruct { + struct RecordMixing_UnknownStructSub data[2]; + u32 unk70; + u16 unk74[0x2]; +}; + struct SaveBlock1 /* 0x02025734 */ { /*0x00*/ struct Coords16 pos; @@ -551,8 +567,8 @@ struct SaveBlock1 /* 0x02025734 */ /*0x2DFC*/ u8 filler_2DFC[0x8]; /*0x2E04*/ SB_Struct sbStruct; /*0x2F9C*/ struct BoxPokemon daycareData[2]; - /*0x303C*/ struct RecordMixing_UnknownStruct filler_303C[2]; - /*0x30AC*/ u8 filler_30AC[0xA]; + /*0x303C*/ struct RecordMixing_UnknownStruct filler_303C; + /*0x30AC*/ u8 filler_30B4[0x2]; /*0x30B6*/ u8 filler_30B6; /*0x30B7*/ u8 filler_30B7[1]; /*0x30B8*/ u8 linkBattleRecords[5][16]; diff --git a/include/record_mixing.h b/include/record_mixing.h index 72a089ca1..103f5ad64 100644 --- a/include/record_mixing.h +++ b/include/record_mixing.h @@ -23,11 +23,11 @@ void sub_80B9A88(u8 *a); void sub_80B9B1C(u8 *a, size_t size, u8 index); void sub_80B9B70(u8 *a, size_t size, u8 index); u8 sub_80B9BBC(u16 *a); -void sub_80B9BC4(u32 a, u32 b, u32 c, u32 d); +void sub_80B9BC4(struct RecordMixing_UnknownStruct *, size_t, u8 [][2], u8, u8); u8 sub_80B9C4C(u8 *a); // ASM -void sub_80B9C6C(void *, u32, u8, void *); +void sub_80B9C6C(struct RecordMixing_UnknownStruct *, u32, u8, void *); void sub_80B9F3C(void *, u8); void sub_80BA00C(u8); diff --git a/include/rom4.h b/include/rom4.h index 476a0e103..9bfb9a51f 100644..100755 --- a/include/rom4.h +++ b/include/rom4.h @@ -18,7 +18,7 @@ struct LinkPlayerMapObject }; // sub_8052F5C -// flag_var_implications_of_teleport_ +void flag_var_implications_of_teleport_(void); void new_game(void); void sub_8053014(void); void sub_8053050(void); @@ -52,7 +52,7 @@ void sub_8053570(void); void sub_8053588(u8); void sub_80535C4(s16 a1, s16 a2); void sub_805363C(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); -// sub_8053678 +void sub_8053678(void); void sub_8053690(s8, s8, s8, s8, s8); // warp1_set_to_warp2 void sub_80536E4(s8, s8, s8, s8, s8); diff --git a/include/songs.h b/include/songs.h index c465ac562..d7829479f 100644 --- a/include/songs.h +++ b/include/songs.h @@ -3,23 +3,23 @@ enum { - SE_STOP, - SE_KAIFUKU, - SE_PC_LOGON, - SE_PC_OFF, - SE_PC_ON, - SE_SELECT, - SE_WIN_OPEN, - SE_WALL_HIT, - SE_DOOR, - SE_KAIDAN, - SE_DANSA, - SE_JITENSYA, - SE_KOUKA_L, - SE_KOUKA_M, - SE_KOUKA_H, - SE_BOWA2, - SE_POKE_DEAD, + /*0x00*/ SE_STOP, + /*0x01*/ SE_KAIFUKU, + /*0x02*/ SE_PC_LOGON, + /*0x03*/ SE_PC_OFF, + /*0x04*/ SE_PC_ON, + /*0x05*/ SE_SELECT, + /*0x06*/ SE_WIN_OPEN, + /*0x07*/ SE_WALL_HIT, + /*0x08*/ SE_DOOR, + /*0x09*/ SE_KAIDAN, + /*0x0A*/ SE_DANSA, + /*0x0B*/ SE_JITENSYA, + /*0x0C*/ SE_KOUKA_L, + /*0x0D*/ SE_KOUKA_M, + /*0x0E*/ SE_KOUKA_H, + /*0x0F*/ SE_BOWA2, + /*0x10*/ SE_POKE_DEAD, SE_NIGERU, SE_JIDO_DOA, SE_NAMINORI, diff --git a/include/sprite.h b/include/sprite.h index 13c03ab51..dd9d5efb7 100755 --- a/include/sprite.h +++ b/include/sprite.h @@ -133,7 +133,7 @@ struct Subsprite struct SubspriteTable { u8 subspriteCount; - struct Subsprite *subsprites; + const struct Subsprite *subsprites; }; struct Sprite; |