Skip to content

Commit

Permalink
Merge pull request #290 from lhearachel/field-task
Browse files Browse the repository at this point in the history
Document field task system and system flags
  • Loading branch information
lhearachel authored Nov 5, 2024
2 parents 8489e3e + c2e3c80 commit 0cb2809
Show file tree
Hide file tree
Showing 228 changed files with 3,423 additions and 3,373 deletions.
2 changes: 1 addition & 1 deletion .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exec 1>&2

# Run clang-format on staged files; abort the commit if any files are changed
if ! git clang-format ; then
if ! git clang-format --extensions c,h,cpp,hpp ; then
echo "linting made changes to source files; aborting commit"
exit 1
fi
80 changes: 40 additions & 40 deletions asm/macros/scrcmd.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1840,81 +1840,81 @@
.short \arg0
.endm

.macro ScrCmd_157 arg0
.macro CheckPokedexAcquired destVarID
.short 343
.short \arg0
.short \destVarID
.endm

.macro ScrCmd_158
.macro GivePokedex
.short 344
.endm

.macro ScrCmd_159 arg0
.macro CheckRunningShoesAcquired destVarID
.short 345
.short \arg0
.short \destVarID
.endm

.macro ScrCmd_15A
.macro GiveRunningShoes
.short 346
.endm

.macro CheckBadge badgeID, destVarID
.macro CheckBadgeAcquired badgeID, destVarID
.short 347
.short \badgeID
.short \destVarID
.endm

.macro ScrCmd_15C arg0
.macro GiveBadge badgeID
.short 348
.short \arg0
.short \badgeID
.endm

.macro ScrCmd_15D arg0
.macro CountBadgesAcquired destVarID
.short 349
.short \arg0
.short \destVarID
.endm

.macro ScrCmd_15E arg0
.macro CheckBagAcquired destVarID
.short 350
.short \arg0
.short \destVarID
.endm

.macro ScrCmd_15F
.macro GiveBag
.short 351
.endm

.macro ScrCmd_160 arg0
.macro CheckHasPartner destVarID
.short 352
.short \arg0
.short \destVarID
.endm

.macro ScrCmd_161
.macro SetHasPartner
.short 353
.endm

.macro ScrCmd_162
.macro ClearHasPartner
.short 354
.endm

.macro ScrCmd_163 arg0
.macro CheckStepFlag destVarID
.short 355
.short \arg0
.short \destVarID
.endm

.macro ScrCmd_164
.macro SetStepFlag
.short 356
.endm

.macro ScrCmd_165
.macro ClearStepFlag
.short 357
.endm

.macro ScrCmd_166 arg0
.macro CheckGameCompleted destVarID
.short 358
.short \arg0
.short \destVarID
.endm

.macro ScrCmd_167
.macro SetGameCompleted
.short 359
.endm

Expand Down Expand Up @@ -2457,7 +2457,7 @@
.short \arg2
.endm

.macro ScrCmd_1CC
.macro GiveJournal
.short 460
.endm

Expand All @@ -2474,27 +2474,27 @@
.short 462
.endm

.macro ScrCmd_1CF arg0, arg1=0
.macro Strength mode, checkDestVarID=0
.short 463
.byte \arg0
.if \arg0 == 2
.short \arg1
.byte \mode
.if \mode == 2
.short \checkDestVarID
.endif
.endm

.macro ScrCmd_1D0 arg0, arg1=0
.macro Flash mode, checkDestVarID=0
.short 464
.byte \arg0
.if \arg0 == 2
.short \arg1
.byte \mode
.if \mode == 2
.short \checkDestVarID
.endif
.endm

.macro ScrCmd_1D1 arg0, arg1=0
.macro Defog mode, checkDestVarID=0
.short 465
.byte \arg0
.if \arg0 == 2
.short \arg1
.byte \mode
.if \mode == 2
.short \checkDestVarID
.endif
.endm

Expand Down Expand Up @@ -3317,11 +3317,11 @@
.short \arg0
.endm

.macro ScrCmd_265
.macro HidePoketch
.short 613
.endm

.macro ScrCmd_266
.macro ShowPoketch
.short 614
.endm

Expand Down
7 changes: 5 additions & 2 deletions include/constants/heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ enum HeapId {

HEAP_ID_DISTORTION_WORLD_WARP = 30,

HEAP_ID_FIELD_TASK = 32,

HEAP_ID_OPTIONS_MENU = 38,

HEAP_ID_CHOOSE_STARTER_APP = 47,
Expand All @@ -28,10 +30,11 @@ enum HeapId {
};

enum HeapSize {
HEAP_SIZE_POKETCH_MAIN = 0xc000,
HEAP_SIZE_POKETCH_APP = 0xc000,
HEAP_SIZE_POKETCH_MAIN = 0xC000,
HEAP_SIZE_POKETCH_APP = 0xC000,

HEAP_SIZE_FIELDMAP = 0x1C000,
HEAP_SIZE_FIELD_TASK = 0x4000,

HEAP_SIZE_CHOOSE_STARTER_APP = 0x40000,
HEAP_SIZE_LIBRARY_TV = 0x40000,
Expand Down
178 changes: 178 additions & 0 deletions include/constants/savedata/vars_flags.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
#ifndef POKEPLATINUM_CONSTANTS_VARS_AND_FLAGS_H
#define POKEPLATINUM_CONSTANTS_VARS_AND_FLAGS_H

#define SYSTEM_FLAGS_START 2400
#define FLAG_BAG_ACQUIRED (SYSTEM_FLAGS_START + 0)
#define FLAG_HAS_PARTNER (SYSTEM_FLAGS_START + 1)
#define FLAG_STRENGTH_ACTIVE (SYSTEM_FLAGS_START + 2)
#define FLAG_JOURNAL_ACQUIRED (SYSTEM_FLAGS_START + 3)
#define FLAG_GAME_COMPLETED (SYSTEM_FLAGS_START + 4)
#define FLAG_STEP (SYSTEM_FLAGS_START + 5)
#define FLAG_COMMUNICATION_CLUB_ACCESSIBLE (SYSTEM_FLAGS_START + 6)
#define FLAG_SAFARI_GAME_ACTIVE (SYSTEM_FLAGS_START + 7)
#define FLAG_CONTEST_MASTER_COOL (SYSTEM_FLAGS_START + 8)
#define FLAG_CONTEST_MASTER_CUTE (SYSTEM_FLAGS_START + 9)
#define FLAG_CONTEST_MASTER_BEAUTY (SYSTEM_FLAGS_START + 10)
#define FLAG_CONTEST_MASTER_SMART (SYSTEM_FLAGS_START + 11)
#define FLAG_CONTEST_MASTER_TOUGH (SYSTEM_FLAGS_START + 12)
#define FLAG_VS_SEEKER_USED (SYSTEM_FLAGS_START + 13)
#define FLAG_ENTERED_UNDERGROUND (SYSTEM_FLAGS_START + 14)
#define FLAG_DIGGING_FOR_FOSSILS (SYSTEM_FLAGS_START + 15)
#define FLAG_SPHERE_ACQUIRED (SYSTEM_FLAGS_START + 16)
#define FLAG_CREATED_SECRET_BASE (SYSTEM_FLAGS_START + 17)
#define FLAG_DECORATED_SECRET_BASE (SYSTEM_FLAGS_START + 18)
#define FLAG_DELIVERED_STOLEN_FLAG (SYSTEM_FLAGS_START + 19)
#define FLAG_UNUSED_2420 (SYSTEM_FLAGS_START + 20)
#define FLAG_UNUSED_2421 (SYSTEM_FLAGS_START + 21)
#define FLAG_UNUSED_2422 (SYSTEM_FLAGS_START + 22)
#define FLAG_DISTORTION_WORLD_STEPPING_STONES (SYSTEM_FLAGS_START + 23)
#define FLAG_CONTEST_HALL_VISITED (SYSTEM_FLAGS_START + 24)
#define FLAG_IN_PAL_PARK (SYSTEM_FLAGS_START + 25)
#define FLAG_FLASH_ACTIVE (SYSTEM_FLAGS_START + 26)
#define FLAG_DEFOG_ACTIVE (SYSTEM_FLAGS_START + 27)
#define FLAG_POKETCH_HIDDEN (SYSTEM_FLAGS_START + 28)
#define FLAG_FREED_GALACTIC_HQ_POKEMON (SYSTEM_FLAGS_START + 29)
#define FLAG_MET_BEBE (SYSTEM_FLAGS_START + 30)
#define FLAG_UNLOCKED_VS_SEEKER_LVL_1 (SYSTEM_FLAGS_START + 31)
#define FLAG_UNLOCKED_VS_SEEKER_LVL_2 (SYSTEM_FLAGS_START + 32)
#define FLAG_UNLOCKED_VS_SEEKER_LVL_3 (SYSTEM_FLAGS_START + 33)
#define FLAG_UNLOCKED_VS_SEEKER_LVL_4 (SYSTEM_FLAGS_START + 34)
#define FLAG_UNLOCKED_VS_SEEKER_LVL_5 (SYSTEM_FLAGS_START + 35)
#define FLAG_ALT_MUSIC_LAKE_VALOR (SYSTEM_FLAGS_START + 36)
#define FLAG_ALT_MUSIC_GALACTIC_HQ (SYSTEM_FLAGS_START + 37)
#define FLAG_ALT_MUSIC_GALACTIC_HQ_1F (SYSTEM_FLAGS_START + 38)
#define FLAG_ALT_MUSIC_GALACTIC_ETERNA_BUILDING (SYSTEM_FLAGS_START + 39)
#define FLAG_ALT_MUSIC_VALLEY_WINDWORKS_BUILDING (SYSTEM_FLAGS_START + 40)
#define FLAG_ALT_MUSIC_FLOAROMA_MEADOW (SYSTEM_FLAGS_START + 41)
#define FLAG_ALT_MUSIC_ROUTE_224 (SYSTEM_FLAGS_START + 42)
#define FLAG_ALT_MUSIC_CHAMPION_ROOM (SYSTEM_FLAGS_START + 43)
#define FLAG_CONNECTED_TO_WIFI (SYSTEM_FLAGS_START + 44)
#define FLAG_DUMMY_2445 (SYSTEM_FLAGS_START + 45)
#define FLAG_ALT_MUSIC_LAKE_VERITY (SYSTEM_FLAGS_START + 46)
#define FLAG_ALT_MUSIC_LAKE_ACUITY (SYSTEM_FLAGS_START + 47)
#define FLAG_UNUSED_2448 (SYSTEM_FLAGS_START + 48)
#define FLAG_UNUSED_2449 (SYSTEM_FLAGS_START + 49)
#define FLAG_UNDERGROUND_FIRST_ENTERED (SYSTEM_FLAGS_START + 50)
#define FLAG_ALT_MUSIC_ROWANS_LAB (SYSTEM_FLAGS_START + 51)
#define FLAG_ON_CYCLING_ROAD (SYSTEM_FLAGS_START + 52)
#define FLAG_ALT_MUSIC_PAL_PARK (SYSTEM_FLAGS_START + 53)
#define FLAG_FORCE_BIKING_IN_GATE (SYSTEM_FLAGS_START + 54)

#define SYSTEM_FLAGS_VILLA_FURNITURE_START (SYSTEM_FLAGS_START + 55)

enum VillaFurniture {
VILLA_FURNITURE_UNK_00 = 0,
VILLA_FURNITURE_UNK_01,
VILLA_FURNITURE_UNK_02,
VILLA_FURNITURE_UNK_03,
VILLA_FURNITURE_UNK_04,
VILLA_FURNITURE_UNK_05,
VILLA_FURNITURE_UNK_06,
VILLA_FURNITURE_UNK_07,
VILLA_FURNITURE_UNK_08,
VILLA_FURNITURE_UNK_09,
VILLA_FURNITURE_UNK_10,
VILLA_FURNITURE_UNK_11,
VILLA_FURNITURE_UNK_12,
VILLA_FURNITURE_UNK_13,
VILLA_FURNITURE_UNK_14,
VILLA_FURNITURE_UNK_15,
VILLA_FURNITURE_UNK_16,
VILLA_FURNITURE_UNK_17,
VILLA_FURNITURE_UNK_18,
VILLA_FURNITURE_UNK_19,

VILLA_FURNITURE_MAX,
};

#define SYSTEM_FLAGS_VILLA_VISITOR_START (SYSTEM_FLAGS_VILLA_FURNITURE_START + VILLA_FURNITURE_MAX)
#define FLAG_VILLA_VISITOR_INSIDE (SYSTEM_FLAGS_VILLA_VISITOR_START + 0)
#define FLAG_VILLA_VISITOR_OUTSIDE (SYSTEM_FLAGS_VILLA_VISITOR_START + 1)
#define FLAG_DISTORTION_WORLD_PUZZLE_FINISHED (SYSTEM_FLAGS_VILLA_VISITOR_START + 2)

#define SYSTEM_FLAGS_GIRATINA_ANIM_START (FLAG_DISTORTION_WORLD_PUZZLE_FINISHED + 1)

enum GiratinaShadowAnimation {
GIRATINA_SHADOW_ANIM_LEFT_TO_RIGHT = 0,
GIRATINA_SHADOW_ANIM_BOTTOM_TO_TOP,

GIRATINA_SHADOW_ANIM_MAX,
};

#define SYSTEM_FLAGS_FIRST_ARRIVAL_TO_ZONE (SYSTEM_FLAGS_GIRATINA_ANIM_START + GIRATINA_SHADOW_ANIM_MAX)

enum FirstArrivalToZone {
FIRST_ARRIVAL_TWINLEAF_TOWN = 0,
FIRST_ARRIVAL_SANDGEM_TOWN,
FIRST_ARRIVAL_FLOAROMA_TOWN,
FIRST_ARRIVAL_SOLACEON_TOWN,
FIRST_ARRIVAL_CELESTIC_TOWN,
FIRST_ARRIVAL_SURVIVAL_AREA,
FIRST_ARRIVAL_RESORT_AREA,
FIRST_ARRIVAL_JUBILIFE_CITY,
FIRST_ARRIVAL_CANALAVE_CITY,
FIRST_ARRIVAL_OREBURGH_CITY,
FIRST_ARRIVAL_ETERNA_CITY,
FIRST_ARRIVAL_HEARTHOME_CITY,
FIRST_ARRIVAL_PASTORIA_CITY,
FIRST_ARRIVAL_VEILSTONE_CITY,
FIRST_ARRIVAL_SUNYSHORE_CITY,
FIRST_ARRIVAL_SNOWPOINT_CITY,
FIRST_ARRIVAL_OUTSIDE_VICTORY_ROAD,
FIRST_ARRIVAL_FIGHT_AREA,
FIRST_ARRIVAL_OREBURGH_MINE,
FIRST_ARRIVAL_VALLEY_WINDWORKS,
FIRST_ARRIVAL_ETERNA_FOREST,
FIRST_ARRIVAL_FUEGO_IRONWORKS,
FIRST_ARRIVAL_MYSTERY_ZONE_D05,
FIRST_ARRIVAL_SPEAR_PILLAR,
FIRST_ARRIVAL_MYSTERY_ZONE_D06,
FIRST_ARRIVAL_SOLACEON_RUINS,
FIRST_ARRIVAL_VICTORY_ROAD,
FIRST_ARRIVAL_PAL_PARK,
FIRST_ARRIVAL_AMITY_SQUARE,
FIRST_ARRIVAL_RAVAGED_PATH,
FIRST_ARRIVAL_FLOAROMA_MEADOW,
FIRST_ARRIVAL_OREBURGH_GATE,
FIRST_ARRIVAL_FULLMOON_ISLAND,
FIRST_ARRIVAL_STARK_MOUNTAIN_EXTERIOR,
FIRST_ARRIVAL_STARK_MOUNTAIN_INTERIOR,
FIRST_ARRIVAL_SENDOFF_SPRING_UNUSED,
FIRST_ARRIVAL_TURNBACK_CAVE,
FIRST_ARRIVAL_FLOWER_PARADISE,
FIRST_ARRIVAL_SNOWPOINT_TEMPLE,
FIRST_ARRIVAL_WAYWARD_CAVE,
FIRST_ARRIVAL_RUIN_MANIAC_CAVE,
FIRST_ARRIVAL_TROPHY_GARDEN,
FIRST_ARRIVAL_IRON_ISLAND_EXTERIOR,
FIRST_ARRIVAL_IRON_ISLAND_INTERIOR,
FIRST_ARRIVAL_OLD_CHATEAU,
FIRST_ARRIVAL_GALACTIC_HQ,
FIRST_ARRIVAL_LAKE_VERITY_UNUSED,
FIRST_ARRIVAL_VERITY_CAVERN,
FIRST_ARRIVAL_LAKE_VALOR_UNUSED,
FIRST_ARRIVAL_VALOR_CAVERN,
FIRST_ARRIVAL_LAKE_ACUITY_UNUSED,
FIRST_ARRIVAL_ACUITY_CAVERN,
FIRST_ARRIVAL_NEWMOON_ISLAND,
FIRST_ARRIVAL_BATTLE_PARK,
FIRST_ARRIVAL_CYCLING_ROAD_UNUSED,
FIRST_ARRIVAL_BERRY_MASTERS_HOUSE,
FIRST_ARRIVAL_LOST_TOWER,
FIRST_ARRIVAL_ROUTE_210_COFFEE_SHOP,
FIRST_ARRIVAL_DRAGON_MASTERS_HOUSE,
FIRST_ARRIVAL_POKEMON_MANSION,
FIRST_ARRIVAL_ROUTE_212_MOVE_TUTOR,
FIRST_ARRIVAL_DOCTOR_FOOTSTEPS_HOUSE,
FIRST_ARRIVAL_VALOR_LAKEFRONT_RESTAURANT,
FIRST_ARRIVAL_PIKACHU_FAN_CLUB,
FIRST_ARRIVAL_POKEMON_SIZE_JUDGE,
FIRST_ARRIVAL_THE_MEISTERS_HOUSE,
FIRST_ARRIVAL_ROUTE_221,
FIRST_ARRIVAL_POKE_PARK_FRONT_GATE,
FIRST_ARRIVAL_POKEMON_LEAGUE,

FIRST_ARRIVAL_MAX,
};

#endif // POKEPLATINUM_CONSTANTS_VARS_AND_FLAGS_H
Loading

0 comments on commit 0cb2809

Please sign in to comment.