Merge remote-tracking branch 'pret/master' into RHH/pr/pretmerge_20220909

# Conflicts:
#	asm/macros/battle_ai_script.inc
#	asm/macros/battle_script.inc
#	data/battle_ai_scripts.s
#	include/link_rfu.h
#	src/pokemon.c
#	src/pokemon_summary_screen.c
#	src/sound.c
This commit is contained in:
Eduardo Quezada 2022-09-13 16:22:42 -03:00
commit 1d7e8bd730
60 changed files with 481 additions and 482 deletions

View File

@ -56,7 +56,7 @@
"x": 14,
"y": 9,
"elevation": 3,
"var": "VAR_SKY_PILLAR_RAQUAZA_CRY_DONE",
"var": "VAR_SKY_PILLAR_RAYQUAZA_CRY_DONE",
"var_value": "0",
"script": "SkyPillar_Top_EventScript_AwakenRayquaza"
}

View File

@ -128,7 +128,7 @@ SkyPillar_Top_EventScript_AwakenRayquaza::
special RemoveCameraObject
setvar VAR_SOOTOPOLIS_CITY_STATE, 5
setvar VAR_SKY_PILLAR_STATE, 1
setvar VAR_SKY_PILLAR_RAQUAZA_CRY_DONE, 1
setvar VAR_SKY_PILLAR_RAYQUAZA_CRY_DONE, 1
releaseall
end

View File

@ -148,7 +148,6 @@ void RestoreTextColors(u8 *fgColor, u8 *bgColor, u8 *shadowColor);
void DecompressGlyphTile(const void *src_, void *dest_);
void CopyGlyphToWindow(struct TextPrinter *x);
void ClearTextSpan(struct TextPrinter *textPrinter, u32 width);
u8 GetMenuCursorDimensionByFont(u8, u8);
void TextPrinterInitDownArrowCounters(struct TextPrinter *textPrinter);
void TextPrinterDrawDownArrow(struct TextPrinter *textPrinter);

View File

@ -46,235 +46,235 @@
#define VAR_OBJ_GFX_ID_F 0x401F
// general purpose vars
#define VAR_RECYCLE_GOODS 0x4020
#define VAR_REPEL_STEP_COUNT 0x4021
#define VAR_ICE_STEP_COUNT 0x4022
#define VAR_STARTER_MON 0x4023 // 0=Treecko, 1=Torchic, 2=Mudkip
#define VAR_MIRAGE_RND_H 0x4024
#define VAR_MIRAGE_RND_L 0x4025
#define VAR_SECRET_BASE_MAP 0x4026
#define VAR_CYCLING_ROAD_RECORD_COLLISIONS 0x4027
#define VAR_CYCLING_ROAD_RECORD_TIME_L 0x4028
#define VAR_CYCLING_ROAD_RECORD_TIME_H 0x4029
#define VAR_FRIENDSHIP_STEP_COUNTER 0x402A
#define VAR_POISON_STEP_COUNTER 0x402B
#define VAR_RESET_RTC_ENABLE 0x402C
#define VAR_ENIGMA_BERRY_AVAILABLE 0x402D
#define VAR_WONDER_NEWS_COUNTER 0x402E
#define VAR_RECYCLE_GOODS 0x4020
#define VAR_REPEL_STEP_COUNT 0x4021
#define VAR_ICE_STEP_COUNT 0x4022
#define VAR_STARTER_MON 0x4023 // 0=Treecko, 1=Torchic, 2=Mudkip
#define VAR_MIRAGE_RND_H 0x4024
#define VAR_MIRAGE_RND_L 0x4025
#define VAR_SECRET_BASE_MAP 0x4026
#define VAR_CYCLING_ROAD_RECORD_COLLISIONS 0x4027
#define VAR_CYCLING_ROAD_RECORD_TIME_L 0x4028
#define VAR_CYCLING_ROAD_RECORD_TIME_H 0x4029
#define VAR_FRIENDSHIP_STEP_COUNTER 0x402A
#define VAR_POISON_STEP_COUNTER 0x402B
#define VAR_RESET_RTC_ENABLE 0x402C
#define VAR_ENIGMA_BERRY_AVAILABLE 0x402D
#define VAR_WONDER_NEWS_COUNTER 0x402E
#define VAR_FRONTIER_MANIAC_FACILITY 0x402F
#define VAR_FRONTIER_GAMBLER_CHALLENGE 0x4030
#define VAR_FRONTIER_GAMBLER_SET_CHALLENGE 0x4031
#define VAR_FRONTIER_GAMBLER_AMOUNT_BET 0x4032
#define VAR_FRONTIER_GAMBLER_STATE 0x4033
#define VAR_FRONTIER_MANIAC_FACILITY 0x402F
#define VAR_FRONTIER_GAMBLER_CHALLENGE 0x4030
#define VAR_FRONTIER_GAMBLER_SET_CHALLENGE 0x4031
#define VAR_FRONTIER_GAMBLER_AMOUNT_BET 0x4032
#define VAR_FRONTIER_GAMBLER_STATE 0x4033
#define VAR_DEOXYS_ROCK_STEP_COUNT 0x4034
#define VAR_DEOXYS_ROCK_LEVEL 0x4035
#define VAR_PC_BOX_TO_SEND_MON 0x4036
#define VAR_ABNORMAL_WEATHER_LOCATION 0x4037
#define VAR_ABNORMAL_WEATHER_STEP_COUNTER 0x4038
#define VAR_SHOULD_END_ABNORMAL_WEATHER 0x4039
#define VAR_FARAWAY_ISLAND_STEP_COUNTER 0x403A
#define VAR_REGICE_STEPS_1 0x403B
#define VAR_REGICE_STEPS_2 0x403C
#define VAR_REGICE_STEPS_3 0x403D
#define VAR_ALTERING_CAVE_WILD_SET 0x403E
#define VAR_DISTRIBUTE_EON_TICKET 0x403F // This var is read and written, but is always zero. The only way to obtain the Eon Ticket in Emerald is via Record Mixing
#define VAR_DAYS 0x4040
#define VAR_FANCLUB_FAN_COUNTER 0x4041
#define VAR_FANCLUB_LOSE_FAN_TIMER 0x4042
#define VAR_DEPT_STORE_FLOOR 0x4043
#define VAR_TRICK_HOUSE_LEVEL 0x4044
#define VAR_POKELOT_PRIZE_ITEM 0x4045
#define VAR_NATIONAL_DEX 0x4046
#define VAR_SEEDOT_SIZE_RECORD 0x4047
#define VAR_ASH_GATHER_COUNT 0x4048
#define VAR_BIRCH_STATE 0x4049
#define VAR_CRUISE_STEP_COUNT 0x404A
#define VAR_POKELOT_RND1 0x404B
#define VAR_POKELOT_RND2 0x404C
#define VAR_POKELOT_PRIZE_PLACE 0x404D
#define VAR_UNUSED_0x404E 0x404E // Unused Var
#define VAR_LOTAD_SIZE_RECORD 0x404F
#define VAR_LITTLEROOT_TOWN_STATE 0x4050
#define VAR_OLDALE_TOWN_STATE 0x4051
#define VAR_DEWFORD_TOWN_STATE 0x4052 // Unused Var
#define VAR_LAVARIDGE_TOWN_STATE 0x4053
#define VAR_CURRENT_SECRET_BASE 0x4054 // was probably allocated for VAR_FALLARBOR_TOWN_STATE at one point
#define VAR_VERDANTURF_TOWN_STATE 0x4055 // Unused Var
#define VAR_PACIFIDLOG_TOWN_STATE 0x4056 // Unused Var
#define VAR_PETALBURG_CITY_STATE 0x4057
#define VAR_SLATEPORT_CITY_STATE 0x4058
#define VAR_MAUVILLE_CITY_STATE 0x4059 // Unused Var
#define VAR_RUSTBORO_CITY_STATE 0x405A
#define VAR_FORTREE_CITY_STATE 0x405B // Unused Var
#define VAR_LILYCOVE_CITY_STATE 0x405C // Unused Var
#define VAR_MOSSDEEP_CITY_STATE 0x405D
#define VAR_SOOTOPOLIS_CITY_STATE 0x405E
#define VAR_EVER_GRANDE_CITY_STATE 0x405F // Unused Var
#define VAR_ROUTE101_STATE 0x4060
#define VAR_ROUTE102_STATE 0x4061 // Unused Var
#define VAR_ROUTE103_STATE 0x4062 // Unused Var
#define VAR_ROUTE104_STATE 0x4063
#define VAR_ROUTE105_STATE 0x4064 // Unused Var
#define VAR_ROUTE106_STATE 0x4065 // Unused Var
#define VAR_ROUTE107_STATE 0x4066 // Unused Var
#define VAR_ROUTE108_STATE 0x4067 // Unused Var
#define VAR_ROUTE109_STATE 0x4068 // Unused Var
#define VAR_ROUTE110_STATE 0x4069
#define VAR_ROUTE111_STATE 0x406A // Unused Var
#define VAR_ROUTE112_STATE 0x406B // Unused Var
#define VAR_ROUTE113_STATE 0x406C // Unused Var
#define VAR_ROUTE114_STATE 0x406D // Unused Var
#define VAR_ROUTE115_STATE 0x406E // Unused Var
#define VAR_ROUTE116_STATE 0x406F
#define VAR_ROUTE117_STATE 0x4070 // Unused Var
#define VAR_ROUTE118_STATE 0x4071
#define VAR_ROUTE119_STATE 0x4072
#define VAR_ROUTE120_STATE 0x4073 // Unused Var
#define VAR_ROUTE121_STATE 0x4074
#define VAR_ROUTE122_STATE 0x4075 // Unused Var
#define VAR_ROUTE123_STATE 0x4076 // Unused Var
#define VAR_ROUTE124_STATE 0x4077 // Unused Var
#define VAR_ROUTE125_STATE 0x4078 // Unused Var
#define VAR_ROUTE126_STATE 0x4079 // Unused Var
#define VAR_ROUTE127_STATE 0x407A // Unused Var
#define VAR_ROUTE128_STATE 0x407B
#define VAR_ROUTE129_STATE 0x407C // Unused Var
#define VAR_ROUTE130_STATE 0x407D // Unused Var
#define VAR_ROUTE131_STATE 0x407E // Unused Var
#define VAR_ROUTE132_STATE 0x407F // Unused Var
#define VAR_ROUTE133_STATE 0x4080 // Unused Var
#define VAR_ROUTE134_STATE 0x4081 // Unused Var
#define VAR_LITTLEROOT_HOUSES_STATE_MAY 0x4082
#define VAR_UNUSED_0x4083 0x4083 // Unused Var
#define VAR_BIRCH_LAB_STATE 0x4084
#define VAR_PETALBURG_GYM_STATE 0x4085 // 0-1: Wally tutorial, 2-6: 0-4 badges, 7: Defeated Norman, 8: Rematch Norman
#define VAR_CONTEST_HALL_STATE 0x4086
#define VAR_CABLE_CLUB_STATE 0x4087
#define VAR_CONTEST_TYPE 0x4088
#define VAR_SECRET_BASE_INITIALIZED 0x4089
#define VAR_CONTEST_PRIZE_PICKUP 0x408A
#define VAR_UNUSED_0x408B 0x408B // Unused Var
#define VAR_LITTLEROOT_HOUSES_STATE_BRENDAN 0x408C
#define VAR_LITTLEROOT_RIVAL_STATE 0x408D
#define VAR_BOARD_BRINEY_BOAT_STATE 0x408E
#define VAR_DEVON_CORP_3F_STATE 0x408F
#define VAR_BRINEY_HOUSE_STATE 0x4090
#define VAR_UNUSED_0x4091 0x4091 // Unused Var
#define VAR_LITTLEROOT_INTRO_STATE 0x4092
#define VAR_MAUVILLE_GYM_STATE 0x4093
#define VAR_LILYCOVE_MUSEUM_2F_STATE 0x4094
#define VAR_LILYCOVE_FAN_CLUB_STATE 0x4095
#define VAR_BRINEY_LOCATION 0x4096
#define VAR_INIT_SECRET_BASE 0x4097
#define VAR_PETALBURG_WOODS_STATE 0x4098
#define VAR_LILYCOVE_CONTEST_LOBBY_STATE 0x4099
#define VAR_RUSTURF_TUNNEL_STATE 0x409A
#define VAR_UNUSED_0x409B 0x409B // Unused Var
#define VAR_ELITE_4_STATE 0x409C
#define VAR_UNUSED_0x409D 0x409D // Unused Var
#define VAR_MOSSDEEP_SPACE_CENTER_STAIR_GUARD_STATE 0x409E
#define VAR_MOSSDEEP_SPACE_CENTER_STATE 0x409F
#define VAR_SLATEPORT_HARBOR_STATE 0x40A0
#define VAR_UNUSED_0x40A1 0x40A1 // Unused var
#define VAR_SEAFLOOR_CAVERN_STATE 0x40A2
#define VAR_CABLE_CAR_STATION_STATE 0x40A3
#define VAR_SAFARI_ZONE_STATE 0x40A4 // 0: In or out of SZ, 1: Player exiting SZ, 2: Player entering SZ
#define VAR_TRICK_HOUSE_BEING_WATCHED_STATE 0x40A5
#define VAR_TRICK_HOUSE_FOUND_TRICK_MASTER 0x40A6
#define VAR_TRICK_HOUSE_ENTRANCE_STATE 0x40A7
#define VAR_UNUSED_0x40A8 0x40A8 // Unused Var
#define VAR_CYCLING_CHALLENGE_STATE 0x40A9
#define VAR_SLATEPORT_MUSEUM_1F_STATE 0x40AA
#define VAR_TRICK_HOUSE_PUZZLE_1_STATE 0x40AB
#define VAR_TRICK_HOUSE_PUZZLE_2_STATE 0x40AC
#define VAR_TRICK_HOUSE_PUZZLE_3_STATE 0x40AD
#define VAR_TRICK_HOUSE_PUZZLE_4_STATE 0x40AE
#define VAR_TRICK_HOUSE_PUZZLE_5_STATE 0x40AF
#define VAR_TRICK_HOUSE_PUZZLE_6_STATE 0x40B0
#define VAR_TRICK_HOUSE_PUZZLE_7_STATE 0x40B1
#define VAR_TRICK_HOUSE_PUZZLE_8_STATE 0x40B2
#define VAR_WEATHER_INSTITUTE_STATE 0x40B3
#define VAR_SS_TIDAL_STATE 0x40B4
#define VAR_TRICK_HOUSE_ENTER_FROM_CORRIDOR 0x40B5
#define VAR_TRICK_HOUSE_PUZZLE_7_STATE_2 0x40B6 // Leftover from RS, never set
#define VAR_SLATEPORT_FAN_CLUB_STATE 0x40B7
#define VAR_UNUSED_0x40B8 0x40B8 // Unused Var
#define VAR_MT_PYRE_STATE 0x40B9
#define VAR_NEW_MAUVILLE_STATE 0x40BA
#define VAR_UNUSED_0x40BB 0x40BB // Unused Var
#define VAR_BRAVO_TRAINER_BATTLE_TOWER_ON 0x40BC
#define VAR_JAGGED_PASS_ASH_WEATHER 0x40BD
#define VAR_GLASS_WORKSHOP_STATE 0x40BE
#define VAR_METEOR_FALLS_STATE 0x40BF
#define VAR_SOOTOPOLIS_MYSTERY_EVENTS_STATE 0x40C0
#define VAR_TRICK_HOUSE_PRIZE_PICKUP 0x40C1
#define VAR_PACIFIDLOG_TM_RECEIVED_DAY 0x40C2
#define VAR_VICTORY_ROAD_1F_STATE 0x40C3
#define VAR_FOSSIL_RESURRECTION_STATE 0x40C4
#define VAR_WHICH_FOSSIL_REVIVED 0x40C5
#define VAR_STEVENS_HOUSE_STATE 0x40C6
#define VAR_OLDALE_RIVAL_STATE 0x40C7
#define VAR_JAGGED_PASS_STATE 0x40C8
#define VAR_SCOTT_PETALBURG_ENCOUNTER 0x40C9
#define VAR_SKY_PILLAR_STATE 0x40CA
#define VAR_MIRAGE_TOWER_STATE 0x40CB
#define VAR_FOSSIL_MANIAC_STATE 0x40CC
#define VAR_CABLE_CLUB_TUTORIAL_STATE 0x40CD
#define VAR_FRONTIER_BATTLE_MODE 0x40CE
#define VAR_FRONTIER_FACILITY 0x40CF
#define VAR_HAS_ENTERED_BATTLE_FRONTIER 0x40D0 // Var is used like a flag.
#define VAR_SCOTT_STATE 0x40D1
#define VAR_SLATEPORT_OUTSIDE_MUSEUM_STATE 0x40D2
#define VAR_DEX_UPGRADE_JOHTO_STARTER_STATE 0x40D3
#define VAR_SS_TIDAL_SCOTT_STATE 0x40D4 // Always equal to FLAG_MET_SCOTT_ON_SS_TIDAL
#define VAR_ROAMER_POKEMON 0x40D5 // 0 = Latias, 1 = Latios
#define VAR_TRAINER_HILL_IS_ACTIVE 0x40D6
#define VAR_SKY_PILLAR_RAQUAZA_CRY_DONE 0x40D7
#define VAR_SOOTOPOLIS_WALLACE_STATE 0x40D8
#define VAR_DEOXYS_ROCK_STEP_COUNT 0x4034
#define VAR_DEOXYS_ROCK_LEVEL 0x4035
#define VAR_PC_BOX_TO_SEND_MON 0x4036
#define VAR_ABNORMAL_WEATHER_LOCATION 0x4037
#define VAR_ABNORMAL_WEATHER_STEP_COUNTER 0x4038
#define VAR_SHOULD_END_ABNORMAL_WEATHER 0x4039
#define VAR_FARAWAY_ISLAND_STEP_COUNTER 0x403A
#define VAR_REGICE_STEPS_1 0x403B
#define VAR_REGICE_STEPS_2 0x403C
#define VAR_REGICE_STEPS_3 0x403D
#define VAR_ALTERING_CAVE_WILD_SET 0x403E
#define VAR_DISTRIBUTE_EON_TICKET 0x403F // This var is read and written, but is always zero. The only way to obtain the Eon Ticket in Emerald is via Record Mixing
#define VAR_DAYS 0x4040
#define VAR_FANCLUB_FAN_COUNTER 0x4041
#define VAR_FANCLUB_LOSE_FAN_TIMER 0x4042
#define VAR_DEPT_STORE_FLOOR 0x4043
#define VAR_TRICK_HOUSE_LEVEL 0x4044
#define VAR_POKELOT_PRIZE_ITEM 0x4045
#define VAR_NATIONAL_DEX 0x4046
#define VAR_SEEDOT_SIZE_RECORD 0x4047
#define VAR_ASH_GATHER_COUNT 0x4048
#define VAR_BIRCH_STATE 0x4049
#define VAR_CRUISE_STEP_COUNT 0x404A
#define VAR_POKELOT_RND1 0x404B
#define VAR_POKELOT_RND2 0x404C
#define VAR_POKELOT_PRIZE_PLACE 0x404D
#define VAR_UNUSED_0x404E 0x404E // Unused Var
#define VAR_LOTAD_SIZE_RECORD 0x404F
#define VAR_LITTLEROOT_TOWN_STATE 0x4050
#define VAR_OLDALE_TOWN_STATE 0x4051
#define VAR_DEWFORD_TOWN_STATE 0x4052 // Unused Var
#define VAR_LAVARIDGE_TOWN_STATE 0x4053
#define VAR_CURRENT_SECRET_BASE 0x4054 // was probably allocated for VAR_FALLARBOR_TOWN_STATE at one point
#define VAR_VERDANTURF_TOWN_STATE 0x4055 // Unused Var
#define VAR_PACIFIDLOG_TOWN_STATE 0x4056 // Unused Var
#define VAR_PETALBURG_CITY_STATE 0x4057
#define VAR_SLATEPORT_CITY_STATE 0x4058
#define VAR_MAUVILLE_CITY_STATE 0x4059 // Unused Var
#define VAR_RUSTBORO_CITY_STATE 0x405A
#define VAR_FORTREE_CITY_STATE 0x405B // Unused Var
#define VAR_LILYCOVE_CITY_STATE 0x405C // Unused Var
#define VAR_MOSSDEEP_CITY_STATE 0x405D
#define VAR_SOOTOPOLIS_CITY_STATE 0x405E
#define VAR_EVER_GRANDE_CITY_STATE 0x405F // Unused Var
#define VAR_ROUTE101_STATE 0x4060
#define VAR_ROUTE102_STATE 0x4061 // Unused Var
#define VAR_ROUTE103_STATE 0x4062 // Unused Var
#define VAR_ROUTE104_STATE 0x4063
#define VAR_ROUTE105_STATE 0x4064 // Unused Var
#define VAR_ROUTE106_STATE 0x4065 // Unused Var
#define VAR_ROUTE107_STATE 0x4066 // Unused Var
#define VAR_ROUTE108_STATE 0x4067 // Unused Var
#define VAR_ROUTE109_STATE 0x4068 // Unused Var
#define VAR_ROUTE110_STATE 0x4069
#define VAR_ROUTE111_STATE 0x406A // Unused Var
#define VAR_ROUTE112_STATE 0x406B // Unused Var
#define VAR_ROUTE113_STATE 0x406C // Unused Var
#define VAR_ROUTE114_STATE 0x406D // Unused Var
#define VAR_ROUTE115_STATE 0x406E // Unused Var
#define VAR_ROUTE116_STATE 0x406F
#define VAR_ROUTE117_STATE 0x4070 // Unused Var
#define VAR_ROUTE118_STATE 0x4071
#define VAR_ROUTE119_STATE 0x4072
#define VAR_ROUTE120_STATE 0x4073 // Unused Var
#define VAR_ROUTE121_STATE 0x4074
#define VAR_ROUTE122_STATE 0x4075 // Unused Var
#define VAR_ROUTE123_STATE 0x4076 // Unused Var
#define VAR_ROUTE124_STATE 0x4077 // Unused Var
#define VAR_ROUTE125_STATE 0x4078 // Unused Var
#define VAR_ROUTE126_STATE 0x4079 // Unused Var
#define VAR_ROUTE127_STATE 0x407A // Unused Var
#define VAR_ROUTE128_STATE 0x407B
#define VAR_ROUTE129_STATE 0x407C // Unused Var
#define VAR_ROUTE130_STATE 0x407D // Unused Var
#define VAR_ROUTE131_STATE 0x407E // Unused Var
#define VAR_ROUTE132_STATE 0x407F // Unused Var
#define VAR_ROUTE133_STATE 0x4080 // Unused Var
#define VAR_ROUTE134_STATE 0x4081 // Unused Var
#define VAR_LITTLEROOT_HOUSES_STATE_MAY 0x4082
#define VAR_UNUSED_0x4083 0x4083 // Unused Var
#define VAR_BIRCH_LAB_STATE 0x4084
#define VAR_PETALBURG_GYM_STATE 0x4085 // 0-1: Wally tutorial, 2-6: 0-4 badges, 7: Defeated Norman, 8: Rematch Norman
#define VAR_CONTEST_HALL_STATE 0x4086
#define VAR_CABLE_CLUB_STATE 0x4087
#define VAR_CONTEST_TYPE 0x4088
#define VAR_SECRET_BASE_INITIALIZED 0x4089
#define VAR_CONTEST_PRIZE_PICKUP 0x408A
#define VAR_UNUSED_0x408B 0x408B // Unused Var
#define VAR_LITTLEROOT_HOUSES_STATE_BRENDAN 0x408C
#define VAR_LITTLEROOT_RIVAL_STATE 0x408D
#define VAR_BOARD_BRINEY_BOAT_STATE 0x408E
#define VAR_DEVON_CORP_3F_STATE 0x408F
#define VAR_BRINEY_HOUSE_STATE 0x4090
#define VAR_UNUSED_0x4091 0x4091 // Unused Var
#define VAR_LITTLEROOT_INTRO_STATE 0x4092
#define VAR_MAUVILLE_GYM_STATE 0x4093
#define VAR_LILYCOVE_MUSEUM_2F_STATE 0x4094
#define VAR_LILYCOVE_FAN_CLUB_STATE 0x4095
#define VAR_BRINEY_LOCATION 0x4096
#define VAR_INIT_SECRET_BASE 0x4097
#define VAR_PETALBURG_WOODS_STATE 0x4098
#define VAR_LILYCOVE_CONTEST_LOBBY_STATE 0x4099
#define VAR_RUSTURF_TUNNEL_STATE 0x409A
#define VAR_UNUSED_0x409B 0x409B // Unused Var
#define VAR_ELITE_4_STATE 0x409C
#define VAR_UNUSED_0x409D 0x409D // Unused Var
#define VAR_MOSSDEEP_SPACE_CENTER_STAIR_GUARD_STATE 0x409E
#define VAR_MOSSDEEP_SPACE_CENTER_STATE 0x409F
#define VAR_SLATEPORT_HARBOR_STATE 0x40A0
#define VAR_UNUSED_0x40A1 0x40A1 // Unused var
#define VAR_SEAFLOOR_CAVERN_STATE 0x40A2
#define VAR_CABLE_CAR_STATION_STATE 0x40A3
#define VAR_SAFARI_ZONE_STATE 0x40A4 // 0: In or out of SZ, 1: Player exiting SZ, 2: Player entering SZ
#define VAR_TRICK_HOUSE_BEING_WATCHED_STATE 0x40A5
#define VAR_TRICK_HOUSE_FOUND_TRICK_MASTER 0x40A6
#define VAR_TRICK_HOUSE_ENTRANCE_STATE 0x40A7
#define VAR_UNUSED_0x40A8 0x40A8 // Unused Var
#define VAR_CYCLING_CHALLENGE_STATE 0x40A9
#define VAR_SLATEPORT_MUSEUM_1F_STATE 0x40AA
#define VAR_TRICK_HOUSE_PUZZLE_1_STATE 0x40AB
#define VAR_TRICK_HOUSE_PUZZLE_2_STATE 0x40AC
#define VAR_TRICK_HOUSE_PUZZLE_3_STATE 0x40AD
#define VAR_TRICK_HOUSE_PUZZLE_4_STATE 0x40AE
#define VAR_TRICK_HOUSE_PUZZLE_5_STATE 0x40AF
#define VAR_TRICK_HOUSE_PUZZLE_6_STATE 0x40B0
#define VAR_TRICK_HOUSE_PUZZLE_7_STATE 0x40B1
#define VAR_TRICK_HOUSE_PUZZLE_8_STATE 0x40B2
#define VAR_WEATHER_INSTITUTE_STATE 0x40B3
#define VAR_SS_TIDAL_STATE 0x40B4
#define VAR_TRICK_HOUSE_ENTER_FROM_CORRIDOR 0x40B5
#define VAR_TRICK_HOUSE_PUZZLE_7_STATE_2 0x40B6 // Leftover from RS, never set
#define VAR_SLATEPORT_FAN_CLUB_STATE 0x40B7
#define VAR_UNUSED_0x40B8 0x40B8 // Unused Var
#define VAR_MT_PYRE_STATE 0x40B9
#define VAR_NEW_MAUVILLE_STATE 0x40BA
#define VAR_UNUSED_0x40BB 0x40BB // Unused Var
#define VAR_BRAVO_TRAINER_BATTLE_TOWER_ON 0x40BC
#define VAR_JAGGED_PASS_ASH_WEATHER 0x40BD
#define VAR_GLASS_WORKSHOP_STATE 0x40BE
#define VAR_METEOR_FALLS_STATE 0x40BF
#define VAR_SOOTOPOLIS_MYSTERY_EVENTS_STATE 0x40C0
#define VAR_TRICK_HOUSE_PRIZE_PICKUP 0x40C1
#define VAR_PACIFIDLOG_TM_RECEIVED_DAY 0x40C2
#define VAR_VICTORY_ROAD_1F_STATE 0x40C3
#define VAR_FOSSIL_RESURRECTION_STATE 0x40C4
#define VAR_WHICH_FOSSIL_REVIVED 0x40C5
#define VAR_STEVENS_HOUSE_STATE 0x40C6
#define VAR_OLDALE_RIVAL_STATE 0x40C7
#define VAR_JAGGED_PASS_STATE 0x40C8
#define VAR_SCOTT_PETALBURG_ENCOUNTER 0x40C9
#define VAR_SKY_PILLAR_STATE 0x40CA
#define VAR_MIRAGE_TOWER_STATE 0x40CB
#define VAR_FOSSIL_MANIAC_STATE 0x40CC
#define VAR_CABLE_CLUB_TUTORIAL_STATE 0x40CD
#define VAR_FRONTIER_BATTLE_MODE 0x40CE
#define VAR_FRONTIER_FACILITY 0x40CF
#define VAR_HAS_ENTERED_BATTLE_FRONTIER 0x40D0 // Var is used like a flag.
#define VAR_SCOTT_STATE 0x40D1
#define VAR_SLATEPORT_OUTSIDE_MUSEUM_STATE 0x40D2
#define VAR_DEX_UPGRADE_JOHTO_STARTER_STATE 0x40D3
#define VAR_SS_TIDAL_SCOTT_STATE 0x40D4 // Always equal to FLAG_MET_SCOTT_ON_SS_TIDAL
#define VAR_ROAMER_POKEMON 0x40D5 // 0 = Latias, 1 = Latios
#define VAR_TRAINER_HILL_IS_ACTIVE 0x40D6
#define VAR_SKY_PILLAR_RAYQUAZA_CRY_DONE 0x40D7
#define VAR_SOOTOPOLIS_WALLACE_STATE 0x40D8
#define VAR_HAS_TALKED_TO_SEAFLOOR_CAVERN_ENTRANCE_GRUNT 0x40D9
#define VAR_REGISTER_BIRCH_STATE 0x40DA
#define VAR_UNUSED_0x40DB 0x40DB // Unused Var
#define VAR_UNUSED_0x40DC 0x40DC // Unused Var
#define VAR_GIFT_PICHU_SLOT 0x40DD
#define VAR_GIFT_UNUSED_1 0x40DE // Var is written to, but never read
#define VAR_GIFT_UNUSED_2 0x40DF // Var is written to, but never read
#define VAR_GIFT_UNUSED_3 0x40E0 // Var is written to, but never read
#define VAR_GIFT_UNUSED_4 0x40E1 // Var is written to, but never read
#define VAR_GIFT_UNUSED_5 0x40E2 // Var is written to, but never read
#define VAR_GIFT_UNUSED_6 0x40E3 // Var is written to, but never read
#define VAR_GIFT_UNUSED_7 0x40E4 // var is written to, but never read
#define VAR_UNUSED_0x40E5 0x40E5 // Unused Var
#define VAR_DAILY_SLOTS 0x40E6
#define VAR_DAILY_WILDS 0x40E7
#define VAR_DAILY_BLENDER 0x40E8
#define VAR_DAILY_PLANTED_BERRIES 0x40E9
#define VAR_DAILY_PICKED_BERRIES 0x40EA
#define VAR_DAILY_ROULETTE 0x40EB
#define VAR_SECRET_BASE_STEP_COUNTER 0x40EC // Used by Secret Base TV programs
#define VAR_SECRET_BASE_LAST_ITEM_USED 0x40ED // Used by Secret Base TV programs
#define VAR_SECRET_BASE_LOW_TV_FLAGS 0x40EE // Used by Secret Base TV programs
#define VAR_SECRET_BASE_HIGH_TV_FLAGS 0x40EF // Used by Secret Base TV programs
#define VAR_SECRET_BASE_IS_NOT_LOCAL 0x40F0 // Set to TRUE while in another player's secret base.
#define VAR_DAILY_BP 0x40F1
#define VAR_WALLY_CALL_STEP_COUNTER 0x40F2
#define VAR_SCOTT_FORTREE_CALL_STEP_COUNTER 0x40F3
#define VAR_ROXANNE_CALL_STEP_COUNTER 0x40F4
#define VAR_SCOTT_BF_CALL_STEP_COUNTER 0x40F5
#define VAR_RIVAL_RAYQUAZA_CALL_STEP_COUNTER 0x40F6
#define VAR_UNUSED_0x40F7 0x40F7 // Unused Var
#define VAR_UNUSED_0x40F8 0x40F8 // Unused Var
#define VAR_UNUSED_0x40F9 0x40F9 // Unused Var
#define VAR_UNUSED_0x40FA 0x40FA // Unused Var
#define VAR_UNUSED_0x40FB 0x40FB // Unused Var
#define VAR_UNUSED_0x40FC 0x40FC // Unused Var
#define VAR_UNUSED_0x40FD 0x40FD // Unused Var
#define VAR_UNUSED_0x40FE 0x40FE // Unused Var
#define VAR_UNUSED_0x40FF 0x40FF // Unused Var
#define VAR_REGISTER_BIRCH_STATE 0x40DA
#define VAR_UNUSED_0x40DB 0x40DB // Unused Var
#define VAR_UNUSED_0x40DC 0x40DC // Unused Var
#define VAR_GIFT_PICHU_SLOT 0x40DD
#define VAR_GIFT_UNUSED_1 0x40DE // Var is written to, but never read
#define VAR_GIFT_UNUSED_2 0x40DF // Var is written to, but never read
#define VAR_GIFT_UNUSED_3 0x40E0 // Var is written to, but never read
#define VAR_GIFT_UNUSED_4 0x40E1 // Var is written to, but never read
#define VAR_GIFT_UNUSED_5 0x40E2 // Var is written to, but never read
#define VAR_GIFT_UNUSED_6 0x40E3 // Var is written to, but never read
#define VAR_GIFT_UNUSED_7 0x40E4 // var is written to, but never read
#define VAR_UNUSED_0x40E5 0x40E5 // Unused Var
#define VAR_DAILY_SLOTS 0x40E6
#define VAR_DAILY_WILDS 0x40E7
#define VAR_DAILY_BLENDER 0x40E8
#define VAR_DAILY_PLANTED_BERRIES 0x40E9
#define VAR_DAILY_PICKED_BERRIES 0x40EA
#define VAR_DAILY_ROULETTE 0x40EB
#define VAR_SECRET_BASE_STEP_COUNTER 0x40EC // Used by Secret Base TV programs
#define VAR_SECRET_BASE_LAST_ITEM_USED 0x40ED // Used by Secret Base TV programs
#define VAR_SECRET_BASE_LOW_TV_FLAGS 0x40EE // Used by Secret Base TV programs
#define VAR_SECRET_BASE_HIGH_TV_FLAGS 0x40EF // Used by Secret Base TV programs
#define VAR_SECRET_BASE_IS_NOT_LOCAL 0x40F0 // Set to TRUE while in another player's secret base.
#define VAR_DAILY_BP 0x40F1
#define VAR_WALLY_CALL_STEP_COUNTER 0x40F2
#define VAR_SCOTT_FORTREE_CALL_STEP_COUNTER 0x40F3
#define VAR_ROXANNE_CALL_STEP_COUNTER 0x40F4
#define VAR_SCOTT_BF_CALL_STEP_COUNTER 0x40F5
#define VAR_RIVAL_RAYQUAZA_CALL_STEP_COUNTER 0x40F6
#define VAR_UNUSED_0x40F7 0x40F7 // Unused Var
#define VAR_UNUSED_0x40F8 0x40F8 // Unused Var
#define VAR_UNUSED_0x40F9 0x40F9 // Unused Var
#define VAR_UNUSED_0x40FA 0x40FA // Unused Var
#define VAR_UNUSED_0x40FB 0x40FB // Unused Var
#define VAR_UNUSED_0x40FC 0x40FC // Unused Var
#define VAR_UNUSED_0x40FD 0x40FD // Unused Var
#define VAR_UNUSED_0x40FE 0x40FE // Unused Var
#define VAR_UNUSED_0x40FF 0x40FF // Unused Var
#define VARS_END 0x40FF
#define VARS_COUNT (VARS_END - VARS_START + 1)
#define VARS_END 0x40FF
#define VARS_COUNT (VARS_END - VARS_START + 1)
#define SPECIAL_VARS_START 0x8000
// special vars

View File

@ -77,55 +77,55 @@ extern const struct SpriteFrameImage *const gBerryTreePicTablePointers[];
extern const u8 *const gBerryTreePaletteSlotTablePointers[];
void ResetObjectEvents(void);
u8 GetMoveDirectionAnimNum(u8);
u8 GetObjectEventIdByLocalIdAndMap(u8, u8, u8);
bool8 TryGetObjectEventIdByLocalIdAndMap(u8, u8, u8, u8 *);
u8 GetObjectEventIdByXY(s16, s16);
void SetObjectEventDirection(struct ObjectEvent *, u8);
u8 GetMoveDirectionAnimNum(u8 direction);
u8 GetObjectEventIdByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroupId);
bool8 TryGetObjectEventIdByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroupId, u8 *objectEventId);
u8 GetObjectEventIdByXY(s16 x, s16 y);
void SetObjectEventDirection(struct ObjectEvent *objectEvent, u8 direction);
u8 GetFirstInactiveObjectEventId(void);
void RemoveObjectEventByLocalIdAndMap(u8, u8, u8);
void LoadPlayerObjectReflectionPalette(u16, u8);
void LoadSpecialObjectReflectionPalette(u16, u8);
void TryMoveObjectEventToMapCoords(u8, u8, u8, s16, s16);
void PatchObjectPalette(u16, u8);
void SpawnObjectEventsOnReturnToField(s16, s16);
void RemoveObjectEventByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup);
void LoadPlayerObjectReflectionPalette(u16 tag, u8 slot);
void LoadSpecialObjectReflectionPalette(u16 tag, u8 slot);
void TryMoveObjectEventToMapCoords(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y);
void PatchObjectPalette(u16 paletteTag, u8 paletteSlot);
void SpawnObjectEventsOnReturnToField(s16 x, s16 y);
void OverrideSecretBaseDecorationSpriteScript(u8 localId, u8 mapNum, u8 mapGroup, u8 decorCat);
void GetMapCoordsFromSpritePos(s16, s16, s16 *, s16 *);
u8 GetFaceDirectionAnimNum(u8);
void SetSpritePosToOffsetMapCoords(s16 *, s16 *, s16, s16);
void GetMapCoordsFromSpritePos(s16 x, s16 y, s16 *destX, s16 *destY);
u8 GetFaceDirectionAnimNum(u8 direction);
void SetSpritePosToOffsetMapCoords(s16 *x, s16 *y, s16 dx, s16 dy);
void ObjectEventClearHeldMovement(struct ObjectEvent *);
void ObjectEventClearHeldMovementIfActive(struct ObjectEvent *);
void TrySpawnObjectEvents(s16, s16);
void TrySpawnObjectEvents(s16 cameraX, s16 cameraY);
u8 CreateObjectGraphicsSprite(u16, void (*)(struct Sprite *), s16 x, s16 y, u8 subpriority);
u8 TrySpawnObjectEvent(u8, u8, u8);
u8 TrySpawnObjectEvent(u8 localId, u8 mapNum, u8 mapGroup);
u8 SpawnSpecialObjectEventParameterized(u8 graphicsId, u8 movementBehavior, u8 localId, s16 x, s16 y, u8 elevation);
u8 SpawnSpecialObjectEvent(struct ObjectEventTemplate *);
void SetSpritePosToMapCoords(s16, s16, s16 *, s16 *);
void SetSpritePosToMapCoords(s16 mapX, s16 mapY, s16 *destX, s16 *destY);
void CameraObjectReset1(void);
void ObjectEventSetGraphicsId(struct ObjectEvent *, u8 graphicsId);
void ObjectEventTurn(struct ObjectEvent *, u8);
void ObjectEventTurnByLocalIdAndMap(u8, u8, u8, u8);
void ObjectEventTurn(struct ObjectEvent *, u8 direction);
void ObjectEventTurnByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup, u8 direction);
const struct ObjectEventGraphicsInfo *GetObjectEventGraphicsInfo(u8 graphicsId);
void SetObjectInvisibility(u8, u8, u8, bool8);
void SetObjectInvisibility(u8 localId, u8 mapNum, u8 mapGroup, bool8 invisible);
void FreeAndReserveObjectSpritePalettes(void);
void SetObjectEventSpritePosByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y);
void ResetObjectSubpriority(u8, u8, u8);
void SetObjectSubpriority(u8, u8, u8, u8);
void AllowObjectAtPosTriggerGroundEffects(s16, s16);
void ResetObjectSubpriority(u8 localId, u8 mapNum, u8 mapGroup);
void SetObjectSubpriority(u8 localId, u8 mapNum, u8 mapGroup, u8 subpriority);
void AllowObjectAtPosTriggerGroundEffects(s16 x, s16 y);
void ObjectEventGetLocalIdAndMap(struct ObjectEvent *objectEvent, void *localId, void *mapNum, void *mapGroup);
void ShiftObjectEventCoords(struct ObjectEvent *, s16, s16);
void MoveObjectEventToMapCoords(struct ObjectEvent *, s16, s16);
void TryOverrideObjectEventTemplateCoords(u8, u8, u8);
void ShiftObjectEventCoords(struct ObjectEvent *, s16 x, s16 y);
void MoveObjectEventToMapCoords(struct ObjectEvent *, s16 x, s16 y);
void TryOverrideObjectEventTemplateCoords(u8 localId, u8 mapNum, u8 mapGroup);
void InitObjectEventPalettes(u8 palSlot);
void UpdateObjectEventCurrentMovement(struct ObjectEvent *, struct Sprite *, bool8(struct ObjectEvent *, struct Sprite *));
u8 ObjectEventFaceOppositeDirection(struct ObjectEvent *, u8);
u8 GetOppositeDirection(u8);
u8 ObjectEventFaceOppositeDirection(struct ObjectEvent *, u8 direction);
u8 GetOppositeDirection(u8 direction);
u8 GetWalkInPlaceFasterMovementAction(u32);
u8 GetWalkInPlaceFastMovementAction(u32);
u8 GetWalkInPlaceNormalMovementAction(u32);
u8 GetWalkInPlaceSlowMovementAction(u32);
u8 GetCollisionAtCoords(struct ObjectEvent *, s16, s16, u32);
void MoveCoords(u8, s16 *, s16 *);
u8 GetCollisionAtCoords(struct ObjectEvent *, s16 x, s16 y, u32 dir);
void MoveCoords(u8 direction, s16 *x, s16 *y);
bool8 ObjectEventIsHeldMovementActive(struct ObjectEvent *);
u8 ObjectEventClearHeldMovementIfFinished(struct ObjectEvent *);
u8 GetObjectEventIdByPosition(u16 x, u16 y, u8 elevation);
@ -168,22 +168,22 @@ u8 AddCameraObject(u8 linkedSpriteId);
void UpdateObjectEventsForCameraUpdate(s16 x, s16 y);
u8 GetWalkSlowMovementAction(u32);
u8 GetJumpMovementAction(u32);
u8 ElevationToPriority(u8);
u8 ElevationToPriority(u8 elevation);
void ObjectEventUpdateElevation(struct ObjectEvent *objEvent);
void SetObjectSubpriorityByElevation(u8, struct Sprite *, u8);
void SetObjectSubpriorityByElevation(u8 elevation, struct Sprite *, u8 subpriority);
void UnfreezeObjectEvent(struct ObjectEvent *);
u8 FindLockedObjectEventIndex(struct ObjectEvent *);
void SetAndStartSpriteAnim(struct Sprite *, u8, u8);
void SetAndStartSpriteAnim(struct Sprite *, u8 animNum, u8 animCmdIndex);
bool8 SpriteAnimEnded(struct Sprite *);
void UnfreezeObjectEvents(void);
void FreezeObjectEventsExceptOne(u8 objectEventId);
void FreezeObjectEventsExceptTwo(u8 objectEventId1, u8 objectEventId2);
void FreezeObjectEvents(void);
bool8 FreezeObjectEvent(struct ObjectEvent *objectEvent);
u8 GetMoveDirectionFastAnimNum(u8);
u8 GetMoveDirectionFasterAnimNum(u8);
u8 GetMoveDirectionFastestAnimNum(u8);
u8 GetLedgeJumpDirection(s16, s16, u8);
u8 GetMoveDirectionFastAnimNum(u8 direction);
u8 GetMoveDirectionFasterAnimNum(u8 direction);
u8 GetMoveDirectionFastestAnimNum(u8 direction);
u8 GetLedgeJumpDirection(s16 x, s16 y, u8 direction);
void CameraObjectSetFollowedSpriteId(u8 objectId);
u16 GetObjectPaletteTag(u8 palSlot);
void UpdateObjectEventSpriteInvisibility(struct Sprite *sprite, bool8 invisible);
@ -192,7 +192,7 @@ s16 GetFigure8YOffset(s16 idx);
void CameraObjectReset2(void);
u8 GetObjectEventBerryTreeId(u8 objectEventId);
void SetBerryTreeJustPicked(u8 mapId, u8 mapNumber, u8 mapGroup);
bool8 IsBerryTreeSparkling(u8, u8, u8);
bool8 IsBerryTreeSparkling(u8 localId, u8 mapNum, u8 mapGroup);
void MovementType_None(struct Sprite *);
void MovementType_LookAround(struct Sprite *);
@ -250,7 +250,6 @@ void MovementType_RunInPlace(struct Sprite *);
void MovementType_Invisible(struct Sprite *);
void MovementType_WalkSlowlyInPlace(struct Sprite *);
u8 GetSlideMovementAction(u32);
u8 GetJumpInPlaceMovementAction(u32);
u8 GetJumpMovementAction(u32);
u8 GetJump2MovementAction(u32);
u8 CreateCopySpriteAt(struct Sprite *sprite, s16 x, s16 y, u8 subpriority);
@ -262,17 +261,17 @@ u8 MovementType_WanderAround_Step3(struct ObjectEvent *, struct Sprite *);
u8 MovementType_WanderAround_Step4(struct ObjectEvent *, struct Sprite *);
u8 MovementType_WanderAround_Step5(struct ObjectEvent *, struct Sprite *);
u8 MovementType_WanderAround_Step6(struct ObjectEvent *, struct Sprite *);
u8 GetVectorDirection(s16, s16, s16, s16);
u8 GetLimitedVectorDirection_SouthNorth(s16, s16, s16, s16);
u8 GetLimitedVectorDirection_WestEast(s16, s16, s16, s16);
u8 GetLimitedVectorDirection_WestNorth(s16, s16, s16, s16);
u8 GetLimitedVectorDirection_EastNorth(s16, s16, s16, s16);
u8 GetLimitedVectorDirection_WestSouth(s16, s16, s16, s16);
u8 GetLimitedVectorDirection_EastSouth(s16, s16, s16, s16);
u8 GetLimitedVectorDirection_SouthNorthWest(s16, s16, s16, s16);
u8 GetLimitedVectorDirection_SouthNorthEast(s16, s16, s16, s16);
u8 GetLimitedVectorDirection_NorthWestEast(s16, s16, s16, s16);
u8 GetLimitedVectorDirection_SouthWestEast(s16, s16, s16, s16);
u8 GetVectorDirection(s16 dx, s16 dy, s16 absdx, s16 absdy);
u8 GetLimitedVectorDirection_SouthNorth(s16 dx, s16 dy, s16 absdx, s16 absdy);
u8 GetLimitedVectorDirection_WestEast(s16 dx, s16 dy, s16 absdx, s16 absdy);
u8 GetLimitedVectorDirection_WestNorth(s16 dx, s16 dy, s16 absdx, s16 absdy);
u8 GetLimitedVectorDirection_EastNorth(s16 dx, s16 dy, s16 absdx, s16 absdy);
u8 GetLimitedVectorDirection_WestSouth(s16 dx, s16 dy, s16 absdx, s16 absdy);
u8 GetLimitedVectorDirection_EastSouth(s16 dx, s16 dy, s16 absdx, s16 absdy);
u8 GetLimitedVectorDirection_SouthNorthWest(s16 dx, s16 dy, s16 absdx, s16 absdy);
u8 GetLimitedVectorDirection_SouthNorthEast(s16 dx, s16 dy, s16 absdx, s16 absdy);
u8 GetLimitedVectorDirection_NorthWestEast(s16 dx, s16 dy, s16 absdx, s16 absdy);
u8 GetLimitedVectorDirection_SouthWestEast(s16 dx, s16 dy, s16 absdx, s16 absdy);
u8 MovementType_LookAround_Step0(struct ObjectEvent *, struct Sprite *);
u8 MovementType_LookAround_Step1(struct ObjectEvent *, struct Sprite *);
u8 MovementType_LookAround_Step2(struct ObjectEvent *, struct Sprite *);

View File

@ -18,7 +18,7 @@ void FieldEffectStop(struct Sprite *sprite, u8 id);
u8 CreateTrainerSprite(u8 trainerSpriteID, s16 x, s16 y, u8 subpriority, u8 *buffer);
void FldEff_TeleportWarpOut(void);
void FieldEffectActiveListRemove(u8 id);
void MultiplyInvertedPaletteRGBComponents(u16, u8, u8, u8);
void MultiplyInvertedPaletteRGBComponents(u16 i, u8 r, u8 g, u8 b);
void FieldEffectActiveListAdd(u8 id);
void FieldEffectScript_LoadTiles(u8 **script);
void FieldEffectScript_LoadFadedPalette(u8 **script);

View File

@ -38,7 +38,7 @@ void PlayerFreeze(void);
void StopPlayerAvatar(void);
void SetSpinStartFacingDir(u8);
void GetXYCoordsOneStepInFrontOfPlayer(s16 *xPtr, s16 *yPtr);
u8 GetRivalAvatarGraphicsIdByStateIdAndGender(u8, u8);
u8 GetRivalAvatarGraphicsIdByStateIdAndGender(u8 state, u8 gender);
void SetPlayerAvatarFieldMove(void);
u8 GetPlayerAvatarGraphicsIdByCurrentState(void);
void SetPlayerAvatarStateMask(u8 flags);

View File

@ -47,7 +47,7 @@ void CopySecondaryTilesetToVramUsingHeap(struct MapLayout const *mapLayout);
void CopyPrimaryTilesetToVram(const struct MapLayout *);
void CopySecondaryTilesetToVram(const struct MapLayout *);
struct MapHeader const *const GetMapHeaderFromConnection(struct MapConnection *connection);
struct MapConnection *GetConnectionAtCoords(s16 x, s16 y);
struct MapConnection *GetMapConnectionAtPos(s16 x, s16 y);
void MapGridSetMetatileImpassabilityAt(int x, int y, bool32 impassable);
// field_region_map.c

View File

@ -4,9 +4,9 @@
// Masks/shifts for blocks in the map grid
// Map grid blocks consist of a 10 bit metatile id, a 2 bit collision value, and a 4 bit elevation value
// This is the data stored in each data/layouts/*/map.bin file
#define MAPGRID_METATILE_ID_MASK 0x03FF // Bits 1-10
#define MAPGRID_COLLISION_MASK 0x0C00 // Bits 11-12
#define MAPGRID_ELEVATION_MASK 0xF000 // Bits 13-16
#define MAPGRID_METATILE_ID_MASK 0x03FF // Bits 0-9
#define MAPGRID_COLLISION_MASK 0x0C00 // Bits 10-11
#define MAPGRID_ELEVATION_MASK 0xF000 // Bits 12-15
#define MAPGRID_COLLISION_SHIFT 10
#define MAPGRID_ELEVATION_SHIFT 12
@ -16,8 +16,8 @@
// Masks/shifts for metatile attributes
// Metatile attributes consist of an 8 bit behavior value, 4 unused bits, and a 4 bit layer type value
// This is the data stored in each data/tilesets/*/*/metatile_attributes.bin file
#define METATILE_ATTR_BEHAVIOR_MASK 0x00FF // Bits 1-8
#define METATILE_ATTR_LAYER_MASK 0xF000 // Bits 13-16
#define METATILE_ATTR_BEHAVIOR_MASK 0x00FF // Bits 0-7
#define METATILE_ATTR_LAYER_MASK 0xF000 // Bits 12-15
#define METATILE_ATTR_LAYER_SHIFT 12
enum {

View File

@ -284,7 +284,7 @@ void SerialCB(void);
bool32 InUnionRoom(void);
void LoadWirelessStatusIndicatorSpriteGfx(void);
bool8 IsLinkTaskFinished(void);
void CreateWirelessStatusIndicatorSprite(u8, u8);
void CreateWirelessStatusIndicatorSprite(u8 x, u8 y);
void SetLinkStandbyCallback(void);
void SetWirelessCommType1(void);
void CheckShouldAdvanceLinkState(void);

View File

@ -92,7 +92,7 @@ void PrintMenuActionGrid(u8 windowId, u8 fontId, u8 left, u8 top, u8 optionWidth
u8 InitMenuActionGrid(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initialCursorPos);
u8 ChangeMenuGridCursorPosition(s8 deltaX, s8 deltaY);
u8 GetStartMenuWindowId(void);
void ListMenuLoadStdPalAt(u8, u8);
void ListMenuLoadStdPalAt(u8 palOffset, u8 palId);
u8 Menu_MoveCursor(s8 cursorDelta);
u8 Menu_MoveCursorNoWrapAround(s8 cursorDelta);
void DrawStdWindowFrame(u8 windowId, bool8 CopyToVram);

View File

@ -52,22 +52,22 @@ extern u8 gPaletteDecompressionBuffer[];
extern u16 gPlttBufferUnfaded[PLTT_BUFFER_SIZE];
extern u16 gPlttBufferFaded[PLTT_BUFFER_SIZE];
void LoadCompressedPalette(const u32 *, u16, u16);
void LoadPalette(const void *, u16, u16);
void FillPalette(u16, u16, u16);
void LoadCompressedPalette(const u32 *src, u16 offset, u16 size);
void LoadPalette(const void *src, u16 offset, u16 size);
void FillPalette(u16 value, u16 offset, u16 size);
void TransferPlttBuffer(void);
u8 UpdatePaletteFade(void);
void ResetPaletteFade(void);
bool8 BeginNormalPaletteFade(u32, s8, u8, u8, u16);
void PaletteStruct_ResetById(u16);
bool8 BeginNormalPaletteFade(u32 selectedPalettes, s8 delay, u8 startY, u8 targetY, u16 blendColor);
void PaletteStruct_ResetById(u16 id);
void ResetPaletteFadeControl(void);
void InvertPlttBuffer(u32);
void TintPlttBuffer(u32, s8, s8, s8);
void UnfadePlttBuffer(u32);
void BeginFastPaletteFade(u8);
void BeginHardwarePaletteFade(u8, u8, u8, u8, u8);
void InvertPlttBuffer(u32 selectedPalettes);
void TintPlttBuffer(u32 selectedPalettes, s8 r, s8 g, s8 b);
void UnfadePlttBuffer(u32 selectedPalettes);
void BeginFastPaletteFade(u8 submode);
void BeginHardwarePaletteFade(u8 blendCnt, u8 delay, u8 y, u8 targetY, u8 shouldResetBlendRegisters);
void BlendPalettes(u32 selectedPalettes, u8 coeff, u16 color);
void BlendPalettesUnfaded(u32, u8, u16);
void BlendPalettesUnfaded(u32 selectedPalettes, u8 coeff, u16 color);
void BlendPalettesGradually(u32 selectedPalettes, s8 delay, u8 coeff, u8 coeffTarget, u16 color, u8 priority, u8 id);
void TintPalette_GrayScale(u16 *palette, u16 count);
void TintPalette_GrayScale2(u16 *palette, u16 count);

View File

@ -385,7 +385,7 @@ struct FormChange
| (((personality) & 0x00000003) >> 0) \
) % NUM_UNOWN_FORMS)
#define GET_SHINY_VALUE(otId, personality)HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality)
#define GET_SHINY_VALUE(otId, personality) (HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality))
extern u8 gPlayerPartyCount;
extern struct Pokemon gPlayerParty[PARTY_SIZE];

View File

@ -87,13 +87,13 @@ void InitMapFromSavedGame(void)
void InitBattlePyramidMap(bool8 setPlayerPosition)
{
CpuFastFill(MAPGRID_UNDEFINED << 16 | MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData));
CpuFastFill16(MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData));
GenerateBattlePyramidFloorLayout(sBackupMapData, setPlayerPosition);
}
void InitTrainerHillMap(void)
{
CpuFastFill(MAPGRID_UNDEFINED << 16 | MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData));
CpuFastFill16(MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData));
GenerateTrainerHillFloorLayout(sBackupMapData);
}
@ -753,7 +753,7 @@ static int IsPosInConnectingMap(struct MapConnection *connection, int x, int y)
return FALSE;
}
struct MapConnection *GetConnectionAtCoords(s16 x, s16 y)
struct MapConnection *GetMapConnectionAtPos(s16 x, s16 y)
{
int count;
struct MapConnection *connection;
@ -860,12 +860,13 @@ static void CopyTilesetToVramUsingHeap(struct Tileset const *tileset, u16 numTil
}
}
static void FieldmapPaletteDummy(u16 offset, u16 size)
// Below two are dummied functions from FRLG, used to tint the overworld palettes for the Quest Log
static void ApplyGlobalTintToPaletteEntries(u16 offset, u16 size)
{
}
static void FieldmapUnkDummy(void)
static void ApplyGlobalTintToPaletteSlot(u8 slot, u8 count)
{
}
@ -880,17 +881,17 @@ void LoadTilesetPalette(struct Tileset const *tileset, u16 destOffset, u16 size)
{
LoadPalette(&black, destOffset, 2);
LoadPalette(((u16 *)tileset->palettes) + 1, destOffset + 1, size - 2);
FieldmapPaletteDummy(destOffset + 1, (size - 2) >> 1);
ApplyGlobalTintToPaletteEntries(destOffset + 1, (size - 2) >> 1);
}
else if (tileset->isSecondary == TRUE)
{
LoadPalette(((u16 *)tileset->palettes) + (NUM_PALS_IN_PRIMARY * 16), destOffset, size);
FieldmapPaletteDummy(destOffset, size >> 1);
ApplyGlobalTintToPaletteEntries(destOffset, size >> 1);
}
else
{
LoadCompressedPalette((u32 *)tileset->palettes, destOffset, size);
FieldmapPaletteDummy(destOffset, size >> 1);
ApplyGlobalTintToPaletteEntries(destOffset, size >> 1);
}
}
}

View File

@ -457,7 +457,7 @@ static void CheckForHiddenItemsInMapConnection(u8 taskId)
|| var2 > y
|| y >= height)
{
struct MapConnection *conn = GetConnectionAtCoords(x, y);
struct MapConnection *conn = GetMapConnectionAtPos(x, y);
if (conn && IsHiddenItemPresentInConnection(conn, x, y) == TRUE)
SetDistanceOfClosestHiddenItem(taskId, x - playerX, y - playerY);
}

View File

@ -2057,15 +2057,15 @@ bool8 ScrCmd_setmetatile(struct ScriptContext *ctx)
{
u16 x = VarGet(ScriptReadHalfword(ctx));
u16 y = VarGet(ScriptReadHalfword(ctx));
u16 tileId = VarGet(ScriptReadHalfword(ctx));
u16 isImpassable = VarGet(ScriptReadHalfword(ctx));
u16 metatileId = VarGet(ScriptReadHalfword(ctx));
bool16 isImpassable = VarGet(ScriptReadHalfword(ctx));
x += MAP_OFFSET;
y += MAP_OFFSET;
if (!isImpassable)
MapGridSetMetatileIdAt(x, y, tileId);
MapGridSetMetatileIdAt(x, y, metatileId);
else
MapGridSetMetatileIdAt(x, y, tileId | MAPGRID_COLLISION_MASK);
MapGridSetMetatileIdAt(x, y, metatileId | MAPGRID_COLLISION_MASK);
return FALSE;
}