diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/berry.h | 6 | ||||
-rwxr-xr-x | include/data3.h | 41 | ||||
-rwxr-xr-x | include/event_scripts.h | 11 | ||||
-rw-r--r-- | include/field_effect.h | 80 | ||||
-rw-r--r-- | include/field_effect_helpers.h | 15 | ||||
-rw-r--r-- | include/field_ground_effect.h | 16 | ||||
-rwxr-xr-x | include/field_map_obj.h | 73 | ||||
-rw-r--r-- | include/field_player_avatar.h | 17 | ||||
-rw-r--r-- | include/fieldmap.h | 12 | ||||
-rw-r--r-- | include/global.fieldmap.h | 12 | ||||
-rw-r--r-- | include/global.h | 8 | ||||
-rw-r--r-- | include/malloc.h | 4 | ||||
-rw-r--r-- | include/map_obj_8097404.h | 15 | ||||
-rw-r--r-- | include/mauville_old_man.h | 2 | ||||
-rw-r--r-- | include/rom4.h | 31 | ||||
-rw-r--r-- | include/rom_818CFC8.h | 11 | ||||
-rw-r--r-- | include/rom_81BE66C.h | 12 |
17 files changed, 361 insertions, 5 deletions
diff --git a/include/berry.h b/include/berry.h index 7c2636411..dc0481d3d 100644 --- a/include/berry.h +++ b/include/berry.h @@ -11,6 +11,12 @@ enum BERRY_FIRMNESS_SUPER_HARD, }; +#define NUM_BERRIES 44 + +extern const u8 *const gBerryTreeFieldObjectGraphicsIdTablePointers[NUM_BERRIES]; +extern const struct SpriteFrameImage *const gBerryTreePicTablePointers[NUM_BERRIES]; +extern const u8 *const gBerryTreePaletteSlotTablePointers[NUM_BERRIES]; + void ClearEnigmaBerries(void); void SetEnigmaBerry(u8 *src); u32 GetEnigmaBerryChecksum(struct EnigmaBerry *enigmaBerry); diff --git a/include/data3.h b/include/data3.h new file mode 100755 index 000000000..b2b19b050 --- /dev/null +++ b/include/data3.h @@ -0,0 +1,41 @@ +// +// Created by Scott Norton on 9/8/17. +// + +#ifndef GUARD_DATA3_H +#define GUARD_DATA3_H + +struct PairedPalettes { + u16 tag; + const u16 *data; +}; + +extern u8 gUnknown_084975C4[0x10]; +extern const struct SpriteTemplate gUnknown_084975D4; +extern void (*const gUnknown_084975EC[3])(struct Sprite *); +extern const struct SpritePalette gUnknown_0850BBC8[]; +extern const struct PairedPalettes gUnknown_0850BD00[15]; +extern const struct PairedPalettes gUnknown_0850BD78[15]; +extern const u16 *const gUnknown_0850BE38[2]; +extern const s16 gUnknown_0850D6DC[4]; // {0x20, 0x40, 0x60, 0x80} +extern const s16 gUnknown_0850D6EC[4]; +extern const u8 gUnknown_0850D710[4]; // {DIR_SOUTH, DIR_NORTH, DIR_WEST, DIR_EAST} +extern const u8 gUnknown_0850D770[2]; // {DIR_SOUTH, DIR_NORTH} +extern const u8 gUnknown_0850D790[2]; // {DIR_WEST, DIR_EAST} +extern const u8 gUnknown_0850D7F0[2]; // {DIR_NORTH, DIR_WEST} +extern const u8 gUnknown_0850D808[2]; // {DIR_NORTH, DIR_EAST} +extern const u8 gUnknown_0850D820[2]; // {DIR_SOUTH, DIR_WEST} +extern const u8 gUnknown_0850D838[2]; // {DIR_SOUTH, DIR_EAST} +extern const u8 gUnknown_0850D850[4]; +extern const u8 gUnknown_0850D868[4]; +extern const u8 gUnknown_0850D880[4]; +extern const u8 gUnknown_0850D898[4]; +extern const u8 gUnknown_0850D8AC[5]; +extern const u8 gUnknown_0850D8C4[5]; +extern const u8 gUnknown_0850D8E8[4]; +extern bool8 (*const gUnknown_0850DA64[])(struct MapObject *, struct Sprite *, u8, bool8(u8)); + + +extern const u8 gUnknown_0850DBA0[5]; + +#endif //GUARD_DATA3_H diff --git a/include/event_scripts.h b/include/event_scripts.h new file mode 100755 index 000000000..f1abdd6f6 --- /dev/null +++ b/include/event_scripts.h @@ -0,0 +1,11 @@ +// +// Created by scott on 9/12/2017. +// + +#ifndef GUARD_EVENT_SCRIPTS_H +#define GUARD_EVENT_SCRIPTS_H + +extern const u8 gUnknown_082766A2[]; +extern const u8 gUnknown_082766A6[]; + +#endif //GUARD_EVENT_SCRIPTS_H diff --git a/include/field_effect.h b/include/field_effect.h new file mode 100644 index 000000000..7ec26b3d7 --- /dev/null +++ b/include/field_effect.h @@ -0,0 +1,80 @@ +// +// Created by Scott Norton on 9/15/17. +// + +#ifndef GUARD_FIELD_EFFECTS_H +#define GUARD_FIELD_EFFECTS_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 u32 gFieldEffectSpawnParams[8]; + +u8 FieldEffectStart(u8); + +#endif //GUARD_FIELD_EFFECTS_H diff --git a/include/field_effect_helpers.h b/include/field_effect_helpers.h new file mode 100644 index 000000000..6504a84f1 --- /dev/null +++ b/include/field_effect_helpers.h @@ -0,0 +1,15 @@ +// +// Created by scott on 9/7/2017. +// + +#ifndef GUARD_FIELD_EFFECT_HELPERS_H +#define GUARD_FIELD_EFFECT_HELPERS_H + +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations +u8 sub_8154228(void); + +#endif //GUARD_FIELD_EFFECT_HELPERS_H diff --git a/include/field_ground_effect.h b/include/field_ground_effect.h new file mode 100644 index 000000000..e2dc3a00f --- /dev/null +++ b/include/field_ground_effect.h @@ -0,0 +1,16 @@ +// +// Created by scott on 9/6/2017. +// + +#ifndef GUARD_FIELD_GROUND_EFFECT_H +#define GUARD_FIELD_GROUND_EFFECT_H + +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations +void SetObjectSubpriorityByZCoord(u8, struct Sprite *, u8); +void InitObjectPriorityByZCoord(struct Sprite *, u8); + +#endif //GUARD_FIELD_GROUND_EFFECT_H diff --git a/include/field_map_obj.h b/include/field_map_obj.h new file mode 100755 index 000000000..f603e9a8e --- /dev/null +++ b/include/field_map_obj.h @@ -0,0 +1,73 @@ +#ifndef GUARD_FIELD_MAP_OBJ_H +#define GUARD_FIELD_MAP_OBJ_H + +#define NUM_OBJECT_GRAPHICS_INFO 239 +#define SPRITE_VAR 240 + +// Exported struct declarations + +enum SpinnerRunnerFollowPatterns { + RUNFOLLOW_ANY, + RUNFOLLOW_NORTH_SOUTH, + RUNFOLLOW_EAST_WEST, + RUNFOLLOW_NORTH_WEST, + RUNFOLLOW_NORTH_EAST, + RUNFOLLOW_SOUTH_WEST, + RUNFOLLOW_SOUTH_EAST, + RUNFOLLOW_NORTH_SOUTH_WEST, + RUNFOLLOW_NORTH_SOUTH_EAST, + RUNFOLLOW_NORTH_EAST_WEST, + RUNFOLLOW_SOUTH_EAST_WEST +}; + +// Exported RAM declarations + +// Exported ROM declarations + +void sub_808D438(void); +u8 GetFieldObjectIdByLocalIdAndMap(u8, u8, u8); +bool8 TryGetFieldObjectIdByLocalIdAndMap(u8, u8, u8, u8 *); +u8 GetFieldObjectIdByXY(s16, s16); +void FieldObjectSetDirection(struct MapObject *, u8); +u8 sub_808D4F4(void); +void RemoveFieldObjectByLocalIdAndMap(u8, u8, u8); +void npc_load_two_palettes__no_record(u16, u8); +void npc_load_two_palettes__and_record(u16, u8); +void pal_patch_for_npc(u16, u8); +void sub_808E16C(s16, s16); +void sub_8092FF0(s16, s16, s16 *, s16 *); +u8 FieldObjectDirectionToImageAnimId(u8); +void sub_80930E0(s16 *, s16 *, u8, u8); +void FieldObjectClearAnim(struct MapObject *); +void SpawnFieldObjectsInView(s16, s16); +u8 sprite_new(u8, u8, s16, s16, u8, u8); +u8 AddPseudoFieldObject(u16, void (*)(struct Sprite *), s16, s16, u8); +u8 show_sprite(u8, u8, u8); +u8 SpawnSpecialFieldObjectParametrized(u8, u8, u8, s16, s16, u8); +u8 SpawnSpecialFieldObject(struct MapObjectTemplate *); +void sub_8093038(s16, s16, s16 *, s16 *); +void CameraObjectReset1(void); +void FieldObjectSetGraphicsId(struct MapObject *, u8); +void FieldObjectTurn(struct MapObject *, u8); +void FieldObjectTurnByLocalIdAndMap(u8, u8, u8, u8); +const struct MapObjectGraphicsInfo *GetFieldObjectGraphicsInfo(u8); +void npc_by_local_id_and_map_set_field_1_bit_x20(u8, u8, u8, u8); +void gpu_pal_allocator_reset__manage_upper_four(void); +void sub_808E82C(u8, u8, u8, s16, s16); +void sub_808E7E4(u8, u8, u8); +void sub_808E78C(u8, u8, u8, u8); +void sub_808E75C(s16, s16); +void FieldObjectGetLocalIdAndMap(struct MapObject *, u8 *, u8 *, u8 *); +void npc_coords_shift(struct MapObject *, s16, s16); +void sub_808EB08(struct MapObject *, s16, s16); +void sub_808F254(u8, u8, u8); +void FieldObjectStep(struct MapObject *, struct Sprite *, bool8(struct MapObject *, struct Sprite *)); +u8 GetOppositeDirection(u8); +u8 GetStepInPlaceDelay16AnimId(u8); +u8 npc_block_way(struct MapObject *, s16, s16, u32); + +// Exported data declarations + +extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[]; + +#endif //GUARD_FIELD_MAP_OBJ_H diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h new file mode 100644 index 000000000..a787cf805 --- /dev/null +++ b/include/field_player_avatar.h @@ -0,0 +1,17 @@ +// +// Created by Scott Norton on 9/6/17. +// + +#ifndef GUARD_FIELD_PLAYER_AVATAR_H +#define GUARD_FIELD_PLAYER_AVATAR_H + +void ClearPlayerAvatarInfo(void); +void SetPlayerAvatarExtraStateTransition(u8, u8); +u8 GetPlayerAvatarGenderByGraphicsId(u8); +bool8 TestPlayerAvatarFlags(u8); +void PlayerGetDestCoords(s16 *, s16 *); +u8 player_get_direction_lower_nybble(void); +u8 player_get_direction_upper_nybble(void); +u8 player_get_x22(void); + +#endif //GUARD_FIELD_PLAYER_AVATAR_H diff --git a/include/fieldmap.h b/include/fieldmap.h index f3b5a7668..511c1061f 100644 --- a/include/fieldmap.h +++ b/include/fieldmap.h @@ -1,6 +1,16 @@ +// +// Created by scott on 9/16/2017. +// + #ifndef GUARD_FIELDMAP_H #define GUARD_FIELDMAP_H +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations +u8 MapGridGetMetatileBehaviorAt(s16, s16); void GetCameraCoords(u16*, u16*); -#endif // GUARD_FIELDMAP_H +#endif //GUARD_FIELDMAP_H diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 4029132e8..f8955b9fd 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -1,6 +1,8 @@ #ifndef GUARD_GLOBAL_FIELDMAP_H #define GUARD_GLOBAL_FIELDMAP_H +#define NUM_FIELD_OBJECTS 16 + enum { CONNECTION_SOUTH = 1, @@ -84,7 +86,7 @@ struct MapObjectTemplate ///*0x0B*/ u8 fillerB[1]; /*0x0C*/ u16 unkC; /*0x0E*/ u16 unkE; - /*0x10*/ u8 *script; + /*0x10*/ const u8 *script; /*0x14*/ u16 flagId; /*0x16*/ u8 filler_16[2]; }; /*size = 0x18*/ @@ -224,7 +226,8 @@ struct MapObject /*0x14*/ struct Coords16 coords3; /*0x18*/ u8 mapobj_unk_18:4; //current direction? /*0x18*/ u8 placeholder18:4; - /*0x19*/ u8 mapobj_unk_19; + /*0x19*/ u8 mapobj_unk_19:4; + /*0x19*/ u8 mapobj_unk_19b:4; /*0x1A*/ u8 mapobj_unk_1A; /*0x1B*/ u8 mapobj_unk_1B; /*0x1C*/ u8 mapobj_unk_1C; @@ -376,14 +379,15 @@ struct PlayerAvatar /* 0x202E858 */ struct Camera { - bool8 field_0:1; + bool8 active:1; s32 x; s32 y; }; -extern struct MapObject gMapObjects[]; +extern struct MapObject gMapObjects[NUM_FIELD_OBJECTS]; extern u8 gSelectedMapObject; extern struct MapHeader gMapHeader; extern struct PlayerAvatar gPlayerAvatar; +extern struct Camera gCamera; #endif // GUARD_GLOBAL_FIELDMAP_H diff --git a/include/global.h b/include/global.h index e694a5974..33c6771c3 100644 --- a/include/global.h +++ b/include/global.h @@ -9,6 +9,12 @@ // to help in decompiling #define asm_comment(x) asm volatile("@ -- " x " -- ") +#define asm_unified(x) asm(".syntax unified\n" x "\n.syntax divided") + +#if defined (__APPLE__) || defined (__CYGWIN__) +void memset(void *, int, size_t); +void memcpy(void *, const void *, size_t); +#endif // __APPLE__ #define ARRAY_COUNT(array) (sizeof(array) / sizeof((array)[0])) @@ -752,4 +758,6 @@ struct Bitmap // TODO: Find a better spot for this u32 height:16; }; +extern u8 gReservedSpritePaletteCount; + #endif // GUARD_GLOBAL_H diff --git a/include/malloc.h b/include/malloc.h index bd870ede3..b3216b05c 100644 --- a/include/malloc.h +++ b/include/malloc.h @@ -1,6 +1,10 @@ #ifndef GUARD_MALLOC_H #define GUARD_MALLOC_H +#define malloc Alloc +#define calloc AllocZeroed +#define free Free + void *Alloc(u32 size); void *AllocZeroed(u32 size); void Free(void *pointer); diff --git a/include/map_obj_8097404.h b/include/map_obj_8097404.h new file mode 100644 index 000000000..e3b2b1efc --- /dev/null +++ b/include/map_obj_8097404.h @@ -0,0 +1,15 @@ +// +// Created by scott on 9/7/2017. +// + +#ifndef GUARD_MAP_OBJ_8097404_H +#define GUARD_MAP_OBJ_8097404_H + +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations +void sub_8097AC8(struct Sprite *); + +#endif //GUARD_MAP_OBJ_8097404_H diff --git a/include/mauville_old_man.h b/include/mauville_old_man.h index d0526db88..aefc76083 100644 --- a/include/mauville_old_man.h +++ b/include/mauville_old_man.h @@ -1,6 +1,8 @@ + #ifndef GUARD_MAUVILLE_OLD_MAN_H #define GUARD_MAUVILLE_OLD_MAN_H void SetMauvilleOldMan(void); +u8 sub_81201C8(void); #endif // GUARD_MAUVILLE_OLD_MAN_H diff --git a/include/rom4.h b/include/rom4.h new file mode 100644 index 000000000..d4ece109e --- /dev/null +++ b/include/rom4.h @@ -0,0 +1,31 @@ + +#ifndef GUARD_ROM4_H +#define GUARD_ROM4_H + +struct UnkPlayerStruct +{ + u8 player_field_0; + u8 player_field_1; +}; + +struct LinkPlayerMapObject +{ + u8 active; + u8 linkPlayerId; + u8 mapObjId; + u8 mode; +}; + +struct UCoords32 +{ + u32 x, y; +}; + + +extern struct LinkPlayerMapObject gLinkPlayerMapObjects[4]; + +void strange_npc_table_clear(void); +const struct MapHeader *get_mapheader_by_bank_and_number(u8, u8); +void FieldObjectMoveDestCoords(struct MapObject *, u32, s16 *, s16 *); + +#endif //GUARD_ROM4_H diff --git a/include/rom_818CFC8.h b/include/rom_818CFC8.h new file mode 100644 index 000000000..1d0626b2b --- /dev/null +++ b/include/rom_818CFC8.h @@ -0,0 +1,11 @@ +// +// Created by Scott Norton on 9/6/17. +// + +#ifndef GUARD_ROM_818CFC8_H +#define GUARD_ROM_818CFC8_H + +bool8 InBattlePyramid(void); +u8 sub_81AAA40(void); + +#endif //GUARD_ROM_818CFC8_H diff --git a/include/rom_81BE66C.h b/include/rom_81BE66C.h new file mode 100644 index 000000000..5b4f80249 --- /dev/null +++ b/include/rom_81BE66C.h @@ -0,0 +1,12 @@ +// +// Created by Scott Norton on 9/6/17. +// + +#ifndef GUARD_ROM_81BE66C_H +#define GUARD_ROM_81BE66C_H + +bool32 InTrainerHill(void); +bool8 FieldObjectIsFarawayIslandMew(struct MapObject *); +u32 sub_81D427C(void); + +#endif //GUARD_ROM_81BE66C_H |