Document some overworld and field effects
@ -5,73 +5,73 @@
|
||||
|
||||
.align 2
|
||||
gFieldEffectScriptPointers:: @ 82DB9D4
|
||||
.4byte gFieldEffectScript_ExclamationMarkIcon1
|
||||
.4byte gFieldEffectScript_UseCutOnTallGrass
|
||||
.4byte gFieldEffectScript_UseCutOnTree
|
||||
.4byte gFieldEffectScript_Shadow
|
||||
.4byte gFieldEffectScript_TallGrass
|
||||
.4byte gFieldEffectScript_Ripple
|
||||
.4byte gFieldEffectScript_FieldMoveShowMon
|
||||
.4byte gFieldEffectScript_Ash
|
||||
.4byte gFieldEffectScript_SurfBlob
|
||||
.4byte gFieldEffectScript_UseSurf
|
||||
.4byte gFieldEffectScript_GroundImpactDust
|
||||
.4byte gFieldEffectScript_UseSecretPowerCave
|
||||
.4byte gFieldEffectScript_BikeHopTallGrass
|
||||
.4byte gFieldEffectScript_SandFootprints
|
||||
.4byte gFieldEffectScript_BikeHopBigSplash
|
||||
.4byte gFieldEffectScript_Splash
|
||||
.4byte gFieldEffectScript_BikeHopSmallSplash
|
||||
.4byte gFieldEffectScript_LongGrass
|
||||
.4byte gFieldEffectScript_JumpLongGrass
|
||||
.4byte gFieldEffectScript_Unknown19
|
||||
.4byte gFieldEffectScript_Unknown20
|
||||
.4byte gFieldEffectScript_Unknown21
|
||||
.4byte gFieldEffectScript_Unknown22
|
||||
.4byte gFieldEffectScript_BerryTreeGrowthSparkle
|
||||
.4byte gFieldEffectScript_DeepSandFootprints
|
||||
.4byte gFieldEffectScript_PokeCenterHeal
|
||||
.4byte gFieldEffectScript_UseSecretPowerTree
|
||||
.4byte gFieldEffectScript_UseSecretPowerShrub
|
||||
.4byte gFieldEffectScript_TreeDisguise
|
||||
.4byte gFieldEffectScript_MountainDisguise
|
||||
.4byte gFieldEffectScript_NPCUseFly
|
||||
.4byte gFieldEffectScript_UseFly
|
||||
.4byte gFieldEffectScript_FlyIn
|
||||
.4byte gFieldEffectScript_QuestionMarkIcon
|
||||
.4byte gFieldEffectScript_FeetInFlowingWater
|
||||
.4byte gFieldEffectScript_BikeTireTracks
|
||||
.4byte gFieldEffectScript_SandDisguisePlaceholder
|
||||
.4byte gFieldEffectScript_UseRockSmash
|
||||
.4byte gFieldEffectScript_UseDig
|
||||
.4byte gFieldEffectScript_SandPile
|
||||
.4byte gFieldEffectScript_UseStrength
|
||||
.4byte gFieldEffectScript_ShortGrass
|
||||
.4byte gFieldEffectScript_HotSpringsWater
|
||||
.4byte gFieldEffectScript_UseWaterfall
|
||||
.4byte gFieldEffectScript_UseDive
|
||||
.4byte gFieldEffectScript_Pokeball
|
||||
.4byte gFieldEffectScript_HeartIcon
|
||||
.4byte gFieldEffectScript_Unknown47
|
||||
.4byte gFieldEffectScript_Unknown48
|
||||
.4byte gFieldEffectScript_JumpOutOfAsh
|
||||
.4byte gFieldEffectScript_LavaridgeGymWarp
|
||||
.4byte gFieldEffectScript_SweetScent
|
||||
.4byte gFieldEffectScript_SandPillar
|
||||
.4byte gFieldEffectScript_Bubbles
|
||||
.4byte gFieldEffectScript_Sparkle
|
||||
.4byte gFieldEffectScript_ShowSecretPowerCave
|
||||
.4byte gFieldEffectScript_ShowSecretPowerTree
|
||||
.4byte gFieldEffectScript_ShowSecretPowerShrub
|
||||
.4byte gFieldEffectScript_ShowCutGrass
|
||||
.4byte gFieldEffectScript_FieldMoveShowMonInit
|
||||
.4byte gFieldEffectScript_UsePuzzleEffect
|
||||
.4byte gFieldEffectScript_SecretBaseBootPC
|
||||
.4byte gFieldEffectScript_HallOfFameRecord
|
||||
.4byte gFieldEffectScript_UseTeleport
|
||||
.4byte gFieldEffectScript_Rayquaza
|
||||
.4byte gFieldEffectScript_Unknown65
|
||||
.4byte gFieldEffectScript_MoveDeoxysRock
|
||||
.4byte gFieldEffectScript_ExclamationMarkIcon1 @ FLDEFF_EXCLAMATION_MARK_ICON
|
||||
.4byte gFieldEffectScript_UseCutOnTallGrass @ FLDEFF_USE_CUT_ON_GRASS
|
||||
.4byte gFieldEffectScript_UseCutOnTree @ FLDEFF_USE_CUT_ON_TREE
|
||||
.4byte gFieldEffectScript_Shadow @ FLDEFF_SHADOW
|
||||
.4byte gFieldEffectScript_TallGrass @ FLDEFF_TALL_GRASS
|
||||
.4byte gFieldEffectScript_Ripple @ FLDEFF_RIPPLE
|
||||
.4byte gFieldEffectScript_FieldMoveShowMon @ FLDEFF_FIELD_MOVE_SHOW_MON
|
||||
.4byte gFieldEffectScript_Ash @ FLDEFF_ASH
|
||||
.4byte gFieldEffectScript_SurfBlob @ FLDEFF_SURF_BLOB
|
||||
.4byte gFieldEffectScript_UseSurf @ FLDEFF_USE_SURF
|
||||
.4byte gFieldEffectScript_GroundImpactDust @ FLDEFF_DUST
|
||||
.4byte gFieldEffectScript_UseSecretPowerCave @ FLDEFF_USE_SECRET_POWER_CAVE
|
||||
.4byte gFieldEffectScript_BikeHopTallGrass @ FLDEFF_JUMP_TALL_GRASS
|
||||
.4byte gFieldEffectScript_SandFootprints @ FLDEFF_SAND_FOOTPRINTS
|
||||
.4byte gFieldEffectScript_BikeHopBigSplash @ FLDEFF_JUMP_BIG_SPLASH
|
||||
.4byte gFieldEffectScript_Splash @ FLDEFF_SPLASH
|
||||
.4byte gFieldEffectScript_BikeHopSmallSplash @ FLDEFF_JUMP_SMALL_SPLASH
|
||||
.4byte gFieldEffectScript_LongGrass @ FLDEFF_LONG_GRASS
|
||||
.4byte gFieldEffectScript_JumpLongGrass @ FLDEFF_JUMP_LONG_GRASS
|
||||
.4byte gFieldEffectScript_Unknown19 @ FLDEFF_UNKNOWN_19
|
||||
.4byte gFieldEffectScript_UnusedGrass @ FLDEFF_UNUSED_GRASS
|
||||
.4byte gFieldEffectScript_Unknown21 @ FLDEFF_UNKNOWN_21
|
||||
.4byte gFieldEffectScript_Unknown22 @ FLDEFF_UNKNOWN_22
|
||||
.4byte gFieldEffectScript_BerryTreeGrowthSparkle @ FLDEFF_BERRY_TREE_GROWTH_SPARKLE
|
||||
.4byte gFieldEffectScript_DeepSandFootprints @ FLDEFF_DEEP_SAND_FOOTPRINTS
|
||||
.4byte gFieldEffectScript_PokeCenterHeal @ FLDEFF_POKECENTER_HEAL
|
||||
.4byte gFieldEffectScript_UseSecretPowerTree @ FLDEFF_USE_SECRET_POWER_TREE
|
||||
.4byte gFieldEffectScript_UseSecretPowerShrub @ FLDEFF_USE_SECRET_POWER_SHRUB
|
||||
.4byte gFieldEffectScript_TreeDisguise @ FLDEFF_TREE_DISGUISE
|
||||
.4byte gFieldEffectScript_MountainDisguise @ FLDEFF_MOUNTAIN_DISGUISE
|
||||
.4byte gFieldEffectScript_NPCUseFly @ FLDEFF_NPCFLY_OUT
|
||||
.4byte gFieldEffectScript_UseFly @ FLDEFF_USE_FLY
|
||||
.4byte gFieldEffectScript_FlyIn @ FLDEFF_FLY_IN
|
||||
.4byte gFieldEffectScript_QuestionMarkIcon @ FLDEFF_QUESTION_MARK_ICON
|
||||
.4byte gFieldEffectScript_FeetInFlowingWater @ FLDEFF_FEET_IN_FLOWING_WATER
|
||||
.4byte gFieldEffectScript_BikeTireTracks @ FLDEFF_BIKE_TIRE_TRACKS
|
||||
.4byte gFieldEffectScript_SandDisguisePlaceholder @ FLDEFF_SAND_DISGUISE
|
||||
.4byte gFieldEffectScript_UseRockSmash @ FLDEFF_USE_ROCK_SMASH
|
||||
.4byte gFieldEffectScript_UseDig @ FLDEFF_USE_DIG
|
||||
.4byte gFieldEffectScript_SandPile @ FLDEFF_SAND_PILE
|
||||
.4byte gFieldEffectScript_UseStrength @ FLDEFF_USE_STRENGTH
|
||||
.4byte gFieldEffectScript_ShortGrass @ FLDEFF_SHORT_GRASS
|
||||
.4byte gFieldEffectScript_HotSpringsWater @ FLDEFF_HOT_SPRINGS_WATER
|
||||
.4byte gFieldEffectScript_UseWaterfall @ FLDEFF_USE_WATERFALL
|
||||
.4byte gFieldEffectScript_UseDive @ FLDEFF_USE_DIVE
|
||||
.4byte gFieldEffectScript_Pokeball @ FLDEFF_POKEBALL
|
||||
.4byte gFieldEffectScript_HeartIcon @ FLDEFF_HEART_ICON
|
||||
.4byte gFieldEffectScript_Unknown47 @ FLDEFF_NOP_47
|
||||
.4byte gFieldEffectScript_Unknown48 @ FLDEFF_NOP_48
|
||||
.4byte gFieldEffectScript_JumpOutOfAsh @ FLDEFF_POP_OUT_OF_ASH
|
||||
.4byte gFieldEffectScript_LavaridgeGymWarp @ FLDEFF_LAVARIDGE_GYM_WARP
|
||||
.4byte gFieldEffectScript_SweetScent @ FLDEFF_SWEET_SCENT
|
||||
.4byte gFieldEffectScript_SandPillar @ FLDEFF_SAND_PILLAR
|
||||
.4byte gFieldEffectScript_Bubbles @ FLDEFF_BUBBLES
|
||||
.4byte gFieldEffectScript_Sparkle @ FLDEFF_SPARKLE
|
||||
.4byte gFieldEffectScript_ShowSecretPowerCave @ FLDEFF_SECRET_POWER_CAVE
|
||||
.4byte gFieldEffectScript_ShowSecretPowerTree @ FLDEFF_SECRET_POWER_TREE
|
||||
.4byte gFieldEffectScript_ShowSecretPowerShrub @ FLDEFF_SECRET_POWER_SHRUB
|
||||
.4byte gFieldEffectScript_ShowCutGrass @ FLDEFF_CUT_GRASS
|
||||
.4byte gFieldEffectScript_FieldMoveShowMonInit @ FLDEFF_FIELD_MOVE_SHOW_MON_INIT
|
||||
.4byte gFieldEffectScript_UsePuzzleEffect @ FLDEFF_USE_TOMB_PUZZLE_EFFECT
|
||||
.4byte gFieldEffectScript_SecretBaseBootPC @ FLDEFF_PCTURN_ON
|
||||
.4byte gFieldEffectScript_HallOfFameRecord @ FLDEFF_HALL_OF_FAME_RECORD
|
||||
.4byte gFieldEffectScript_UseTeleport @ FLDEFF_USE_TELEPORT
|
||||
.4byte gFieldEffectScript_Rayquaza @ FLDEFF_RAYQUAZA
|
||||
.4byte gFieldEffectScript_DestroyDeoxysRock @ FLDEFF_DESTROY_DEOXYS_ROCK
|
||||
.4byte gFieldEffectScript_MoveDeoxysRock @ FLDEFF_MOVE_DEOXYS_ROCK
|
||||
|
||||
gFieldEffectScript_ExclamationMarkIcon1:: @ 82DBAE0
|
||||
field_eff_callnative FldEff_ExclamationMarkIcon
|
||||
@ -153,8 +153,8 @@ gFieldEffectScript_Unknown19:: @ 82DBB7E
|
||||
field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, FldEff_Unknown19
|
||||
field_eff_end
|
||||
|
||||
gFieldEffectScript_Unknown20:: @ 82DBB88
|
||||
field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, FldEff_Unknown20
|
||||
gFieldEffectScript_UnusedGrass:: @ 82DBB88
|
||||
field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, FldEff_UnusedGrass
|
||||
field_eff_end
|
||||
|
||||
gFieldEffectScript_Unknown21:: @ 82DBB92
|
||||
@ -336,10 +336,10 @@ gFieldEffectScript_Rayquaza:: @ 82DBCF3
|
||||
field_eff_callnative sub_80B8F98
|
||||
field_eff_end
|
||||
|
||||
gFieldEffectScript_Unknown65:: @ 82DBCF9
|
||||
field_eff_callnative sub_80B9ADC
|
||||
gFieldEffectScript_DestroyDeoxysRock:: @ 82DBCF9
|
||||
field_eff_callnative FldEff_DestroyDeoxysRock
|
||||
field_eff_end
|
||||
|
||||
gFieldEffectScript_MoveDeoxysRock:: @ 82DBCFF
|
||||
field_eff_callnative Fldeff_MoveDeoxysRock
|
||||
field_eff_callnative FldEff_MoveDeoxysRock
|
||||
field_eff_end
|
||||
|
@ -1,37 +0,0 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.section .rodata
|
||||
|
||||
|
||||
|
||||
.align 2
|
||||
gUnref_82EC784:: @ 82EC784
|
||||
.4byte 0x00000000
|
||||
.4byte 0x00000000
|
||||
.4byte 0x04000008
|
||||
.4byte 0x0400000A
|
||||
.4byte 0x0400000C
|
||||
.4byte 0x0400000E
|
||||
.4byte 0x04000010
|
||||
.4byte 0x04000014
|
||||
.4byte 0x04000018
|
||||
.4byte 0x0400001C
|
||||
.4byte 0x04000012
|
||||
.4byte 0x04000016
|
||||
.4byte 0x0400001A
|
||||
.4byte 0x0400001E
|
||||
.4byte 0x02000100
|
||||
.4byte 0x08000400
|
||||
|
||||
gOverworldBackgroundLayerFlags:: @ 82EC7C4
|
||||
.2byte BLDCNT_TGT2_BG0
|
||||
.2byte BLDCNT_TGT2_BG1
|
||||
.2byte BLDCNT_TGT2_BG2
|
||||
.2byte BLDCNT_TGT2_BG3
|
||||
|
||||
gOrbEffectBackgroundLayerFlags:: @ 82EC7CC
|
||||
.2byte BLDCNT_TGT1_BG0
|
||||
.2byte BLDCNT_TGT1_BG1
|
||||
.2byte BLDCNT_TGT1_BG2
|
||||
.2byte BLDCNT_TGT1_BG3
|
@ -68,9 +68,9 @@ BirthIsland_Exterior_EventScript_Deoxys:: @ 8267FC1
|
||||
setfieldeffectargument 0, 1
|
||||
setfieldeffectargument 1, 58
|
||||
setfieldeffectargument 2, 26
|
||||
dofieldeffect FLDEFF_65
|
||||
dofieldeffect FLDEFF_DESTROY_DEOXYS_ROCK
|
||||
playbgm MUS_RG_DEOEYE, 0
|
||||
waitfieldeffect FLDEFF_65
|
||||
waitfieldeffect FLDEFF_DESTROY_DEOXYS_ROCK
|
||||
addobject 2
|
||||
applymovement 2, BirthIsland_Exterior_Movement_DeoxysApproach
|
||||
waitmovement 0
|
||||
|
36
gflib/io_reg.c
Normal file
@ -0,0 +1,36 @@
|
||||
#include "global.h"
|
||||
#include "io_reg.h"
|
||||
#include "gba/io_reg.h"
|
||||
|
||||
static const u32 sUnused[] = {
|
||||
0,
|
||||
0,
|
||||
(1 << 26) | (1 << 3),
|
||||
(1 << 26) | (1 << 3) | (1 << 1),
|
||||
(1 << 26) | (1 << 3) | (1 << 2),
|
||||
(1 << 26) | (1 << 3) | (1 << 2) | (1 << 1),
|
||||
(1 << 26) | (1 << 4),
|
||||
(1 << 26) | (1 << 4) | (1 << 2),
|
||||
(1 << 26) | (1 << 4) | (1 << 3),
|
||||
(1 << 26) | (1 << 4) | (1 << 3) | (1 << 2),
|
||||
(1 << 26) | (1 << 4) | (1 << 1),
|
||||
(1 << 26) | (1 << 4) | (1 << 2) | (1 << 1),
|
||||
(1 << 26) | (1 << 4) | (1 << 3) | (1 << 1),
|
||||
(1 << 26) | (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1),
|
||||
(1 << 25) | (1 << 8),
|
||||
(1 << 27) | (1 << 10),
|
||||
};
|
||||
|
||||
const u16 gOverworldBackgroundLayerFlags[] = {
|
||||
BLDCNT_TGT2_BG0,
|
||||
BLDCNT_TGT2_BG1,
|
||||
BLDCNT_TGT2_BG2,
|
||||
BLDCNT_TGT2_BG3,
|
||||
};
|
||||
|
||||
const u16 gOrbEffectBackgroundLayerFlags[] = {
|
||||
BLDCNT_TGT1_BG0,
|
||||
BLDCNT_TGT1_BG1,
|
||||
BLDCNT_TGT1_BG2,
|
||||
BLDCNT_TGT1_BG3,
|
||||
};
|
7
gflib/io_reg.h
Normal file
@ -0,0 +1,7 @@
|
||||
#ifndef GUARD_IO_REG_H
|
||||
#define GUARD_IO_REG_H
|
||||
|
||||
extern const u16 gOverworldBackgroundLayerFlags[];
|
||||
extern const u16 gOrbEffectBackgroundLayerFlags[];
|
||||
|
||||
#endif // GUARD_IO_REG_H
|
Before Width: | Height: | Size: 197 B After Width: | Height: | Size: 197 B |
Before Width: | Height: | Size: 174 B After Width: | Height: | Size: 174 B |
Before Width: | Height: | Size: 205 B After Width: | Height: | Size: 205 B |
Before Width: | Height: | Size: 344 B |
Before Width: | Height: | Size: 389 B After Width: | Height: | Size: 344 B |
BIN
graphics/field_effects/pics/unused_grass_2.png
Normal file
After Width: | Height: | Size: 389 B |
@ -21,7 +21,7 @@
|
||||
#define FLDEFF_LONG_GRASS 17
|
||||
#define FLDEFF_JUMP_LONG_GRASS 18
|
||||
#define FLDEFF_UNKNOWN_19 19
|
||||
#define FLDEFF_UNKNOWN_20 20
|
||||
#define FLDEFF_UNUSED_GRASS 20
|
||||
#define FLDEFF_UNKNOWN_21 21
|
||||
#define FLDEFF_UNKNOWN_22 22
|
||||
#define FLDEFF_BERRY_TREE_GROWTH_SPARKLE 23
|
||||
@ -66,7 +66,45 @@
|
||||
#define FLDEFF_HALL_OF_FAME_RECORD 62
|
||||
#define FLDEFF_USE_TELEPORT 63
|
||||
#define FLDEFF_RAYQUAZA 64
|
||||
#define FLDEFF_65 65
|
||||
#define FLDEFF_DESTROY_DEOXYS_ROCK 65
|
||||
#define FLDEFF_MOVE_DEOXYS_ROCK 66
|
||||
|
||||
#endif
|
||||
#define FLDEFFOBJ_SHADOW_S 0
|
||||
#define FLDEFFOBJ_SHADOW_M 1
|
||||
#define FLDEFFOBJ_SHADOW_L 2
|
||||
#define FLDEFFOBJ_SHADOW_XL 3
|
||||
#define FLDEFFOBJ_TALL_GRASS 4
|
||||
#define FLDEFFOBJ_RIPPLE 5
|
||||
#define FLDEFFOBJ_ASH 6
|
||||
#define FLDEFFOBJ_SURF_BLOB 7
|
||||
#define FLDEFFOBJ_ARROW 8
|
||||
#define FLDEFFOBJ_GROUND_IMPACT_DUST 9
|
||||
#define FLDEFFOBJ_JUMP_TALL_GRASS 10
|
||||
#define FLDEFFOBJ_SAND_FOOTPRINTS 11
|
||||
#define FLDEFFOBJ_JUMP_BIG_SPLASH 12
|
||||
#define FLDEFFOBJ_SPLASH 13
|
||||
#define FLDEFFOBJ_JUMP_SMALL_SPLASH 14
|
||||
#define FLDEFFOBJ_LONG_GRASS 15
|
||||
#define FLDEFFOBJ_JUMP_LONG_GRASS 16
|
||||
#define FLDEFFOBJ_17 17
|
||||
#define FLDEFFOBJ_UNUSED_GRASS 18
|
||||
#define FLDEFFOBJ_19 19
|
||||
#define FLDEFFOBJ_20 20
|
||||
#define FLDEFFOBJ_REFLECTION_DISTORTION 21
|
||||
#define FLDEFFOBJ_SPARKLE 22
|
||||
#define FLDEFFOBJ_DEEP_SAND_FOOTPRINTS 23
|
||||
#define FLDEFFOBJ_TREE_DISGUISE 24
|
||||
#define FLDEFFOBJ_MOUNTAIN_DISGUISE 25
|
||||
#define FLDEFFOBJ_BIRD 26
|
||||
#define FLDEFFOBJ_BIKE_TIRE_TRACKS 27
|
||||
#define FLDEFFOBJ_SAND_DISGUISE 28
|
||||
#define FLDEFFOBJ_SAND_PILE 29
|
||||
#define FLDEFFOBJ_SHORT_GRASS 30
|
||||
#define FLDEFFOBJ_HOT_SPRINGS_WATER 31
|
||||
#define FLDEFFOBJ_JUMP_OUT_OF_ASH 32
|
||||
#define FLDEFFOBJ_LAVARIDGE_GYM_WARP 33
|
||||
#define FLDEFFOBJ_BUBBLES 34
|
||||
#define FLDEFFOBJ_SMALL_SPARKLE 35
|
||||
#define FLDEFFOBJ_RAYQUAZA 36
|
||||
|
||||
#endif // GUARD_FIELD_EFFECT_CONSTANTS_H
|
||||
|
@ -587,4 +587,26 @@ extern u8 BerryTree_EventScript_ItemUsePlantBerry[];
|
||||
extern u8 BerryTree_EventScript_ItemUseWailmerPail[];
|
||||
extern u8 BattleFrontier_OutsideEast_EventScript_WaterSudowoodo[];
|
||||
|
||||
// overworld
|
||||
extern const u8 EventScript_WhiteOut[];
|
||||
extern const u8 EventScript_ResetMrBriney[];
|
||||
extern const u8 EventScript_DoLinkRoomExit[];
|
||||
extern const u8 CableClub_EventScript_TooBusyToNotice[];
|
||||
extern const u8 CableClub_EventScript_ReadTrainerCard[];
|
||||
extern const u8 CableClub_EventScript_ReadTrainerCardColored[];
|
||||
extern const u8 EventScript_BattleColosseum_4P_PlayerSpot0[];
|
||||
extern const u8 EventScript_BattleColosseum_4P_PlayerSpot1[];
|
||||
extern const u8 EventScript_BattleColosseum_4P_PlayerSpot2[];
|
||||
extern const u8 EventScript_BattleColosseum_4P_PlayerSpot3[];
|
||||
extern const u8 EventScript_RecordCenter_Spot0[];
|
||||
extern const u8 EventScript_RecordCenter_Spot1[];
|
||||
extern const u8 EventScript_RecordCenter_Spot2[];
|
||||
extern const u8 EventScript_RecordCenter_Spot3[];
|
||||
extern const u8 EventScript_BattleColosseum_2P_PlayerSpot0[];
|
||||
extern const u8 EventScript_BattleColosseum_2P_PlayerSpot1[];
|
||||
extern const u8 EventScript_TradeCenter_Chair1[];
|
||||
extern const u8 EventScript_TradeCenter_Chair0[];
|
||||
extern const u8 EventScript_ConfirmLeaveTradeRoom[];
|
||||
extern const u8 EventScript_TerminateLink[];
|
||||
|
||||
#endif // GUARD_EVENT_SCRIPTS_H
|
||||
|
@ -23,7 +23,7 @@ void DrawWholeMapView(void);
|
||||
void CurrentMapDrawMetatileAt(int x, int y);
|
||||
void sub_8089C08(s16 *a0, s16 *a1);
|
||||
void DrawDoorMetatileAt(int x, int y, u16 *arr);
|
||||
void move_tilemap_camera_to_upper_left_corner(void);
|
||||
void ResetFieldCamera(void);
|
||||
void sub_8057A58(void);
|
||||
void ResetCameraUpdateInfo(void);
|
||||
u32 InitCameraUpdateCallback(u8 a);
|
||||
|
@ -34,7 +34,7 @@ bool8 sub_8068870(u16 a);
|
||||
bool8 sub_8068894(void);
|
||||
bool8 sub_8068A64(struct MapPosition *, u16);
|
||||
u8 sub_8068F18(void);
|
||||
bool8 dive_warp(struct MapPosition *position, u16 b);
|
||||
bool8 TryDoDiveWarp(struct MapPosition *position, u16 b);
|
||||
int SetCableClubWarp(void);
|
||||
u8 TrySetDiveWarp(void);
|
||||
const u8 *GetInteractedLinkPlayerScript(struct MapPosition *position, u8 metatileBehavior, u8 direction);
|
||||
|
@ -16,7 +16,7 @@ void ReturnToFieldFromFlyMapSelect(void);
|
||||
u8 AddNewGameBirchObject(s16, s16, u8);
|
||||
void FieldEffectStop(struct Sprite *sprite, u8 id);
|
||||
u8 CreateTrainerSprite(u8 trainerSpriteID, s16 x, s16 y, u8 subpriority, u8 *buffer);
|
||||
void CreateTeleportFieldEffectTask(void);
|
||||
void FldEff_TeleportWarpOut(void);
|
||||
void FieldEffectActiveListRemove(u8 id);
|
||||
void MultiplyInvertedPaletteRGBComponents(u16, u8, u8, u8);
|
||||
void FieldEffectActiveListAdd(u8 id);
|
||||
@ -39,10 +39,6 @@ void StartEscalatorWarp(u8 metatileBehavior, u8 priority);
|
||||
void StartLavaridgeGymB1FWarp(u8 priority);
|
||||
void StartLavaridgeGym1FWarp(u8 priority);
|
||||
|
||||
void sub_80B9C28(s16*, u8);
|
||||
void sub_80B9C54(s16*, u8);
|
||||
void sub_80B9CDC(s16*, u8);
|
||||
|
||||
void SpriteCB_PopOutOfAsh(struct Sprite*);
|
||||
void SpriteCB_LavaridgeGymWarp(struct Sprite*);
|
||||
|
||||
|
@ -39,7 +39,7 @@ void sub_808BCF4(void);
|
||||
void sub_808D074(u8);
|
||||
void GetXYCoordsOneStepInFrontOfPlayer(s16 *xPtr, s16 *yPtr);
|
||||
u8 GetRivalAvatarGraphicsIdByStateIdAndGender(u8, u8);
|
||||
void sub_808C114(void);
|
||||
void SetPlayerAvatarFieldMove(void);
|
||||
u8 GetPlayerAvatarGraphicsIdByCurrentState(void);
|
||||
void SetPlayerAvatarStateMask(u8 a);
|
||||
u8 GetPlayerAvatarGraphicsIdByStateId(u8 a);
|
||||
@ -47,7 +47,7 @@ u8 GetJumpSpecialMovementAction(u32);
|
||||
bool8 PartyHasMonWithSurf(void);
|
||||
bool8 IsPlayerFacingSurfableFishableWater(void);
|
||||
bool8 IsPlayerSurfingNorth(void);
|
||||
void sub_808C228(u8 direction);
|
||||
void SetPlayerAvatarWatering(u8 direction);
|
||||
u8 GetPlayerAvatarFlags(void);
|
||||
void sub_808B578(void);
|
||||
u8 GetFRLGAvatarGraphicsIdByGender(u8);
|
||||
|
@ -1,6 +1,8 @@
|
||||
#ifndef GUARD_FIELD_SCREEN_EFFECT_H
|
||||
#define GUARD_FIELD_SCREEN_EFFECT_H
|
||||
|
||||
extern const s32 gMaxFlashLevel;
|
||||
|
||||
void WarpFadeInScreen(void);
|
||||
void WarpFadeOutScreen(void);
|
||||
void FadeInFromBlack(void);
|
||||
|
@ -35,12 +35,12 @@ void InitMap(void);
|
||||
void InitMapFromSavedGame(void);
|
||||
void InitTrainerHillMap(void);
|
||||
void InitBattlePyramidMap(bool8 setPlayerPosition);
|
||||
void copy_map_tileset1_tileset2_to_vram(struct MapLayout const *mapLayout);
|
||||
void apply_map_tileset1_tileset2_palette(struct MapLayout const *mapLayout);
|
||||
void apply_map_tileset2_palette(struct MapLayout const *mapLayout);
|
||||
void copy_map_tileset2_to_vram_2(struct MapLayout const *mapLayout);
|
||||
void copy_map_tileset1_to_vram(const struct MapLayout *);
|
||||
void copy_map_tileset2_to_vram(const struct MapLayout *);
|
||||
void CopyMapTilesetsToVram(struct MapLayout const *mapLayout);
|
||||
void LoadMapTilesetPalettes(struct MapLayout const *mapLayout);
|
||||
void LoadSecondaryTilesetPalette(struct MapLayout const *mapLayout);
|
||||
void CopySecondaryTilesetToVramUsingHeap(struct MapLayout const *mapLayout);
|
||||
void CopyPrimaryTilesetToVram(const struct MapLayout *);
|
||||
void CopySecondaryTilesetToVram(const struct MapLayout *);
|
||||
struct MapHeader const *const mapconnection_get_mapheader(struct MapConnection *connection);
|
||||
struct MapConnection *GetConnectionAtCoords(s16 x, s16 y);
|
||||
|
||||
|
@ -22,9 +22,9 @@ void sub_81BE7F4(void);
|
||||
void sub_81BE994(void);
|
||||
|
||||
// escalator
|
||||
void sub_80E1558(u8 var);
|
||||
void sub_80E1570(void);
|
||||
bool8 sub_80E1584(void);
|
||||
void StartEscalator(bool8 var);
|
||||
void StopEscalator(void);
|
||||
bool8 IsEscalatorMoving(void);
|
||||
|
||||
// soft-boiled
|
||||
bool8 SetUpFieldMove_SoftBoiled(void);
|
||||
@ -55,7 +55,7 @@ bool8 FldEff_UseDig(void);
|
||||
|
||||
// rock smash
|
||||
bool8 CheckObjectGraphicsInFrontOfPlayer(u8 graphicsId);
|
||||
u8 oei_task_add(void);
|
||||
u8 CreateFieldMoveTask(void);
|
||||
bool8 SetUpFieldMove_RockSmash(void);
|
||||
bool8 FldEff_UseRockSmash(void);
|
||||
|
||||
|
@ -247,14 +247,14 @@ enum {
|
||||
PLAYER_AVATAR_STATE_WATERING,
|
||||
};
|
||||
|
||||
#define PLAYER_AVATAR_FLAG_ON_FOOT (1 << PLAYER_AVATAR_STATE_NORMAL)
|
||||
#define PLAYER_AVATAR_FLAG_MACH_BIKE (1 << PLAYER_AVATAR_STATE_MACH_BIKE)
|
||||
#define PLAYER_AVATAR_FLAG_ACRO_BIKE (1 << PLAYER_AVATAR_STATE_ACRO_BIKE)
|
||||
#define PLAYER_AVATAR_FLAG_SURFING (1 << PLAYER_AVATAR_STATE_SURFING)
|
||||
#define PLAYER_AVATAR_FLAG_UNDERWATER (1 << PLAYER_AVATAR_STATE_UNDERWATER)
|
||||
#define PLAYER_AVATAR_FLAG_5 (1 << PLAYER_AVATAR_STATE_FIELD_MOVE)
|
||||
#define PLAYER_AVATAR_FLAG_6 (1 << PLAYER_AVATAR_STATE_FISHING)
|
||||
#define PLAYER_AVATAR_FLAG_DASH (1 << PLAYER_AVATAR_STATE_WATERING)
|
||||
#define PLAYER_AVATAR_FLAG_ON_FOOT (1 << 0)
|
||||
#define PLAYER_AVATAR_FLAG_MACH_BIKE (1 << 1)
|
||||
#define PLAYER_AVATAR_FLAG_ACRO_BIKE (1 << 2)
|
||||
#define PLAYER_AVATAR_FLAG_SURFING (1 << 3)
|
||||
#define PLAYER_AVATAR_FLAG_UNDERWATER (1 << 4)
|
||||
#define PLAYER_AVATAR_FLAG_5 (1 << 5)
|
||||
#define PLAYER_AVATAR_FLAG_FORCED_MOVE (1 << 6)
|
||||
#define PLAYER_AVATAR_FLAG_DASH (1 << 7)
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ extern const u16 gUnknown_0860F074[];
|
||||
|
||||
void FreeAllOverworldWindowBuffers(void);
|
||||
void InitStandardTextBoxWindows(void);
|
||||
void sub_8197200(void);
|
||||
void InitTextBoxGfxAndPrinters(void);
|
||||
u16 RunTextPrintersAndIsPrinter0Active(void);
|
||||
void LoadMessageBoxAndBorderGfx(void);
|
||||
void DrawDialogueFrame(u8 windowId, bool8 copyToVram);
|
||||
@ -64,8 +64,8 @@ void CreateYesNoMenu(const struct WindowTemplate *windowTemplate, u16 borderFirs
|
||||
void DecompressAndLoadBgGfxUsingHeap(u8 bgId, const void *src, u32 size, u16 offset, u8 mode);
|
||||
s8 Menu_ProcessInputNoWrapClearOnChoose(void);
|
||||
s8 ProcessMenuInput_other(void);
|
||||
void do_scheduled_bg_tilemap_copies_to_vram(void);
|
||||
void clear_scheduled_bg_copies_to_vram(void);
|
||||
void DoScheduledBgTilemapCopiesToVram(void);
|
||||
void ClearScheduledBgCopiesToVram(void);
|
||||
void AddTextPrinterParameterized4(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, const u8 *color, s8 speed, const u8 *str);
|
||||
void DrawDialogFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 a2, u8 a3);
|
||||
void sub_81995E4(u8 windowId, u8 optionsNo, const struct MenuAction *actions, const u8 *actionIds);
|
||||
|
@ -24,6 +24,8 @@
|
||||
#define MOVEMENT_MODE_FROZEN 1
|
||||
#define MOVEMENT_MODE_SCRIPTED 2
|
||||
|
||||
#define SKIP_OBJECT_EVENT_LOAD 1
|
||||
|
||||
struct InitialPlayerAvatarState
|
||||
{
|
||||
u8 transitionFlags;
|
||||
@ -99,8 +101,7 @@ void SetDefaultFlashLevel(void);
|
||||
void Overworld_SetFlashLevel(s32 flashLevel);
|
||||
u8 Overworld_GetFlashLevel(void);
|
||||
void SetCurrentMapLayout(u16 mapLayoutId);
|
||||
void sub_8085540(u8 var);
|
||||
u8 sub_808554C(void);
|
||||
void SetObjectEventLoadFlag(u8 var);
|
||||
u16 GetLocationMusic(struct WarpData *warp);
|
||||
u16 GetCurrLocationDefaultMusic(void);
|
||||
u16 GetWarpDestinationMusic(void);
|
||||
@ -135,11 +136,9 @@ void SetUnusedCallback(void *a0);
|
||||
void CB2_NewGame(void);
|
||||
void CB2_WhiteOut(void);
|
||||
void CB2_LoadMap(void);
|
||||
void sub_8086024(void);
|
||||
void CB2_ReturnToFieldContestHall(void);
|
||||
void CB2_ReturnToFieldCableClub(void);
|
||||
void CB2_ReturnToField(void);
|
||||
void CB2_ReturnToFieldLocal(void);
|
||||
void CB2_ReturnToFieldLink(void);
|
||||
void CB2_ReturnToFieldFromMultiplayer(void);
|
||||
void CB2_ReturnToFieldWithOpenMenu(void);
|
||||
void CB2_ReturnToFieldContinueScript(void);
|
||||
|
@ -439,7 +439,7 @@ SECTIONS {
|
||||
gflib/window.o(.rodata);
|
||||
gflib/text.o(.rodata);
|
||||
gflib/sprite.o(.rodata);
|
||||
data/io_reg.o(.rodata);
|
||||
gflib/io_reg.o(.rodata);
|
||||
gflib/string_util.o(.rodata);
|
||||
src/link.o(.rodata);
|
||||
src/link.o(.rodata.str1.4);
|
||||
|
@ -582,7 +582,7 @@ $(FLDEFFGFXDIR)/arrow.4bpp: %.4bpp: %.png
|
||||
$(FLDEFFGFXDIR)/ash.4bpp: %.4bpp: %.png
|
||||
$(GFX) $< $@ -mwidth 2 -mheight 2
|
||||
|
||||
$(FLDEFFGFXDIR)/berry_tree_growth_sparkle.4bpp: %.4bpp: %.png
|
||||
$(FLDEFFGFXDIR)/sparkle.4bpp: %.4bpp: %.png
|
||||
$(GFX) $< $@ -mwidth 2 -mheight 2
|
||||
|
||||
$(FLDEFFGFXDIR)/bike_hop_big_splash.4bpp: %.4bpp: %.png
|
||||
@ -642,7 +642,7 @@ $(FLDEFFGFXDIR)/unknown_16.4bpp: %.4bpp: %.png
|
||||
$(FLDEFFGFXDIR)/unknown_17.4bpp: %.4bpp: %.png
|
||||
$(GFX) $< $@ -mwidth 2 -mheight 2
|
||||
|
||||
$(FLDEFFGFXDIR)/unknown_18.4bpp: %.4bpp: %.png
|
||||
$(FLDEFFGFXDIR)/unused_grass.4bpp: %.4bpp: %.png
|
||||
$(GFX) $< $@ -mwidth 2 -mheight 2
|
||||
|
||||
$(FLDEFFGFXDIR)/unknown_19.4bpp: %.4bpp: %.png
|
||||
@ -651,14 +651,14 @@ $(FLDEFFGFXDIR)/unknown_19.4bpp: %.4bpp: %.png
|
||||
$(FLDEFFGFXDIR)/unknown_20.4bpp: %.4bpp: %.png
|
||||
$(GFX) $< $@ -mwidth 2 -mheight 2
|
||||
|
||||
$(FLDEFFGFXDIR)/unknown_29.4bpp: %.4bpp: %.png
|
||||
$(FLDEFFGFXDIR)/sand_pile.4bpp: %.4bpp: %.png
|
||||
$(GFX) $< $@ -mwidth 2 -mheight 1
|
||||
|
||||
$(FLDEFFGFXDIR)/lavaridge_gym_warp.4bpp: %.4bpp: %.png
|
||||
$(GFX) $< $@ -mwidth 2 -mheight 2
|
||||
|
||||
$(FLDEFFGFXDIR)/unknown_35.4bpp: %.4bpp: %.png
|
||||
$(FLDEFFGFXDIR)/small_sparkle.4bpp: %.4bpp: %.png
|
||||
$(GFX) $< $@ -mwidth 2 -mheight 2
|
||||
|
||||
$(FLDEFFGFXDIR)/unused_grass.4bpp: %.4bpp: %.png
|
||||
$(FLDEFFGFXDIR)/unused_grass_2.4bpp: %.4bpp: %.png
|
||||
$(GFX) $< $@ -mwidth 2 -mheight 2
|
||||
|
@ -402,7 +402,7 @@ static void sub_81C501C(void)
|
||||
RunTasks();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
do_scheduled_bg_tilemap_copies_to_vram();
|
||||
DoScheduledBgTilemapCopiesToVram();
|
||||
UpdatePaletteFade();
|
||||
}
|
||||
|
||||
@ -424,7 +424,7 @@ static bool8 sub_81C5078(void)
|
||||
{
|
||||
case 0:
|
||||
SetVBlankHBlankCallbacksToNull();
|
||||
clear_scheduled_bg_copies_to_vram();
|
||||
ClearScheduledBgCopiesToVram();
|
||||
gMain.state++;
|
||||
break;
|
||||
case 1:
|
||||
|
@ -1076,7 +1076,7 @@ int sub_802104C(void)
|
||||
return 0;
|
||||
|
||||
InitStandardTextBoxWindows();
|
||||
sub_8197200();
|
||||
InitTextBoxGfxAndPrinters();
|
||||
sub_8022588(var0);
|
||||
sub_8022600(var0);
|
||||
gPaletteFade.bufferTransferDisabled = TRUE;
|
||||
|
@ -186,7 +186,7 @@ static void CB2_BerryTagScreen(void)
|
||||
RunTasks();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
do_scheduled_bg_tilemap_copies_to_vram();
|
||||
DoScheduledBgTilemapCopiesToVram();
|
||||
UpdatePaletteFade();
|
||||
}
|
||||
|
||||
@ -217,7 +217,7 @@ static bool8 InitBerryTagScreen(void)
|
||||
case 0:
|
||||
SetVBlankHBlankCallbacksToNull();
|
||||
ResetVramOamAndBgCntRegs();
|
||||
clear_scheduled_bg_copies_to_vram();
|
||||
ClearScheduledBgCopiesToVram();
|
||||
gMain.state++;
|
||||
break;
|
||||
case 1:
|
||||
|
@ -836,7 +836,7 @@ static void Bike_UpdateDirTimerHistory(u8 dir)
|
||||
|
||||
gPlayerAvatar.directionHistory = (gPlayerAvatar.directionHistory << 4) | (dir & 0xF);
|
||||
|
||||
for (i = 7; i != 0; i--)
|
||||
for (i = ARRAY_COUNT(gPlayerAvatar.dirTimerHistory) - 1; i != 0; i--)
|
||||
gPlayerAvatar.dirTimerHistory[i] = gPlayerAvatar.dirTimerHistory[i - 1];
|
||||
gPlayerAvatar.dirTimerHistory[0] = 1;
|
||||
}
|
||||
@ -847,7 +847,7 @@ static void Bike_UpdateABStartSelectHistory(u8 input)
|
||||
|
||||
gPlayerAvatar.abStartSelectHistory = (gPlayerAvatar.abStartSelectHistory << 4) | (input & 0xF);
|
||||
|
||||
for (i = 7; i != 0; i--)
|
||||
for (i = ARRAY_COUNT(gPlayerAvatar.abStartSelectTimerHistory) - 1; i != 0; i--)
|
||||
gPlayerAvatar.abStartSelectTimerHistory[i] = gPlayerAvatar.abStartSelectTimerHistory[i - 1];
|
||||
gPlayerAvatar.abStartSelectTimerHistory[0] = 1;
|
||||
}
|
||||
@ -1001,10 +1001,10 @@ void BikeClearState(int newDirHistory, int newAbStartHistory)
|
||||
gPlayerAvatar.directionHistory = newDirHistory;
|
||||
gPlayerAvatar.abStartSelectHistory = newAbStartHistory;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
for (i = 0; i < ARRAY_COUNT(gPlayerAvatar.dirTimerHistory); i++)
|
||||
gPlayerAvatar.dirTimerHistory[i] = 0;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
for (i = 0; i < ARRAY_COUNT(gPlayerAvatar.abStartSelectTimerHistory); i++)
|
||||
gPlayerAvatar.abStartSelectTimerHistory[i] = 0;
|
||||
}
|
||||
|
||||
|
@ -165,7 +165,7 @@ void DoBrailleRegisteelEffect(void)
|
||||
|
||||
bool8 FldEff_UseFlyAncientTomb(void)
|
||||
{
|
||||
u8 taskId = oei_task_add();
|
||||
u8 taskId = CreateFieldMoveTask();
|
||||
|
||||
gTasks[taskId].data[8] = (u32)UseRegisteelHm_Callback >> 16;
|
||||
gTasks[taskId].data[9] = (u32)UseRegisteelHm_Callback;
|
||||
@ -411,7 +411,7 @@ bool32 BrailleWait_CheckButtonPress(void)
|
||||
// this used to be FldEff_UseFlyAncientTomb . why did GF merge the 2 functions?
|
||||
bool8 FldEff_UsePuzzleEffect(void)
|
||||
{
|
||||
u8 taskId = oei_task_add();
|
||||
u8 taskId = CreateFieldMoveTask();
|
||||
|
||||
if (sBraillePuzzleCallbackFlag == REGISTEEL_PUZZLE)
|
||||
{
|
||||
|
@ -8,70 +8,70 @@ const struct SpriteTemplate gFieldEffectObjectTemplate_Ash;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_SurfBlob;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Arrow;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_GroundImpactDust;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_BikeHopTallGrass;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpTallGrass;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_SandFootprints;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_BikeHopBigSplash;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpBigSplash;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Splash;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_BikeHopSmallSplash;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpSmallSplash;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_LongGrass;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown16;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpLongGrass;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown17;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown18;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_UnusedGrass;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown19;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown20;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown21;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_BerryTreeGrowthSparkle;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_ReflectionDistortion;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Sparkle;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_DeepSandFootprints;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_TreeDisguise;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_MountainDisguise;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Bird;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_BikeTireTracks;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_SandDisguisePlaceholder;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown29;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_SandPile;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_ShortGrass;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_HotSpringsWater;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpOutOfAsh;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_LavaridgeGymWarp;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Bubbles;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown35;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_SmallSparkle;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Rayquaza;
|
||||
|
||||
const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[] = {
|
||||
&gFieldEffectObjectTemplate_ShadowSmall,
|
||||
&gFieldEffectObjectTemplate_ShadowMedium,
|
||||
&gFieldEffectObjectTemplate_ShadowLarge,
|
||||
&gFieldEffectObjectTemplate_ShadowExtraLarge,
|
||||
&gFieldEffectObjectTemplate_TallGrass,
|
||||
&gFieldEffectObjectTemplate_Ripple,
|
||||
&gFieldEffectObjectTemplate_Ash,
|
||||
&gFieldEffectObjectTemplate_SurfBlob,
|
||||
&gFieldEffectObjectTemplate_Arrow,
|
||||
&gFieldEffectObjectTemplate_GroundImpactDust,
|
||||
&gFieldEffectObjectTemplate_BikeHopTallGrass,
|
||||
&gFieldEffectObjectTemplate_SandFootprints,
|
||||
&gFieldEffectObjectTemplate_BikeHopBigSplash,
|
||||
&gFieldEffectObjectTemplate_Splash,
|
||||
&gFieldEffectObjectTemplate_BikeHopSmallSplash,
|
||||
&gFieldEffectObjectTemplate_LongGrass,
|
||||
&gFieldEffectObjectTemplate_Unknown16,
|
||||
&gFieldEffectObjectTemplate_Unknown17,
|
||||
&gFieldEffectObjectTemplate_Unknown18,
|
||||
&gFieldEffectObjectTemplate_Unknown19,
|
||||
&gFieldEffectObjectTemplate_Unknown20,
|
||||
&gFieldEffectObjectTemplate_Unknown21,
|
||||
&gFieldEffectObjectTemplate_BerryTreeGrowthSparkle,
|
||||
&gFieldEffectObjectTemplate_DeepSandFootprints,
|
||||
&gFieldEffectObjectTemplate_TreeDisguise,
|
||||
&gFieldEffectObjectTemplate_MountainDisguise,
|
||||
&gFieldEffectObjectTemplate_Bird,
|
||||
&gFieldEffectObjectTemplate_BikeTireTracks,
|
||||
&gFieldEffectObjectTemplate_SandDisguisePlaceholder,
|
||||
&gFieldEffectObjectTemplate_Unknown29,
|
||||
&gFieldEffectObjectTemplate_ShortGrass,
|
||||
&gFieldEffectObjectTemplate_HotSpringsWater,
|
||||
&gFieldEffectObjectTemplate_JumpOutOfAsh,
|
||||
&gFieldEffectObjectTemplate_LavaridgeGymWarp,
|
||||
&gFieldEffectObjectTemplate_Bubbles,
|
||||
&gFieldEffectObjectTemplate_Unknown35,
|
||||
&gFieldEffectObjectTemplate_Rayquaza,
|
||||
[FLDEFFOBJ_SHADOW_S] = &gFieldEffectObjectTemplate_ShadowSmall,
|
||||
[FLDEFFOBJ_SHADOW_M] = &gFieldEffectObjectTemplate_ShadowMedium,
|
||||
[FLDEFFOBJ_SHADOW_L] = &gFieldEffectObjectTemplate_ShadowLarge,
|
||||
[FLDEFFOBJ_SHADOW_XL] = &gFieldEffectObjectTemplate_ShadowExtraLarge,
|
||||
[FLDEFFOBJ_TALL_GRASS] = &gFieldEffectObjectTemplate_TallGrass,
|
||||
[FLDEFFOBJ_RIPPLE] = &gFieldEffectObjectTemplate_Ripple,
|
||||
[FLDEFFOBJ_ASH] = &gFieldEffectObjectTemplate_Ash,
|
||||
[FLDEFFOBJ_SURF_BLOB] = &gFieldEffectObjectTemplate_SurfBlob,
|
||||
[FLDEFFOBJ_ARROW] = &gFieldEffectObjectTemplate_Arrow,
|
||||
[FLDEFFOBJ_GROUND_IMPACT_DUST] = &gFieldEffectObjectTemplate_GroundImpactDust,
|
||||
[FLDEFFOBJ_JUMP_TALL_GRASS] = &gFieldEffectObjectTemplate_JumpTallGrass,
|
||||
[FLDEFFOBJ_SAND_FOOTPRINTS] = &gFieldEffectObjectTemplate_SandFootprints,
|
||||
[FLDEFFOBJ_JUMP_BIG_SPLASH] = &gFieldEffectObjectTemplate_JumpBigSplash,
|
||||
[FLDEFFOBJ_SPLASH] = &gFieldEffectObjectTemplate_Splash,
|
||||
[FLDEFFOBJ_JUMP_SMALL_SPLASH] = &gFieldEffectObjectTemplate_JumpSmallSplash,
|
||||
[FLDEFFOBJ_LONG_GRASS] = &gFieldEffectObjectTemplate_LongGrass,
|
||||
[FLDEFFOBJ_JUMP_LONG_GRASS] = &gFieldEffectObjectTemplate_JumpLongGrass,
|
||||
[FLDEFFOBJ_17] = &gFieldEffectObjectTemplate_Unknown17,
|
||||
[FLDEFFOBJ_UNUSED_GRASS] = &gFieldEffectObjectTemplate_UnusedGrass,
|
||||
[FLDEFFOBJ_19] = &gFieldEffectObjectTemplate_Unknown19,
|
||||
[FLDEFFOBJ_20] = &gFieldEffectObjectTemplate_Unknown20,
|
||||
[FLDEFFOBJ_REFLECTION_DISTORTION] = &gFieldEffectObjectTemplate_ReflectionDistortion,
|
||||
[FLDEFFOBJ_SPARKLE] = &gFieldEffectObjectTemplate_Sparkle,
|
||||
[FLDEFFOBJ_DEEP_SAND_FOOTPRINTS] = &gFieldEffectObjectTemplate_DeepSandFootprints,
|
||||
[FLDEFFOBJ_TREE_DISGUISE] = &gFieldEffectObjectTemplate_TreeDisguise,
|
||||
[FLDEFFOBJ_MOUNTAIN_DISGUISE] = &gFieldEffectObjectTemplate_MountainDisguise,
|
||||
[FLDEFFOBJ_BIRD] = &gFieldEffectObjectTemplate_Bird,
|
||||
[FLDEFFOBJ_BIKE_TIRE_TRACKS] = &gFieldEffectObjectTemplate_BikeTireTracks,
|
||||
[FLDEFFOBJ_SAND_DISGUISE] = &gFieldEffectObjectTemplate_SandDisguisePlaceholder,
|
||||
[FLDEFFOBJ_SAND_PILE] = &gFieldEffectObjectTemplate_SandPile,
|
||||
[FLDEFFOBJ_SHORT_GRASS] = &gFieldEffectObjectTemplate_ShortGrass,
|
||||
[FLDEFFOBJ_HOT_SPRINGS_WATER] = &gFieldEffectObjectTemplate_HotSpringsWater,
|
||||
[FLDEFFOBJ_JUMP_OUT_OF_ASH] = &gFieldEffectObjectTemplate_JumpOutOfAsh,
|
||||
[FLDEFFOBJ_LAVARIDGE_GYM_WARP] = &gFieldEffectObjectTemplate_LavaridgeGymWarp,
|
||||
[FLDEFFOBJ_BUBBLES] = &gFieldEffectObjectTemplate_Bubbles,
|
||||
[FLDEFFOBJ_SMALL_SPARKLE] = &gFieldEffectObjectTemplate_SmallSparkle,
|
||||
[FLDEFFOBJ_RAYQUAZA] = &gFieldEffectObjectTemplate_Rayquaza,
|
||||
};
|
||||
|
@ -225,11 +225,11 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_GroundImpactDust[] =
|
||||
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_GroundImpactDust = {0xFFFF, 0x1004, &gObjectEventBaseOam_16x8, gFieldEffectObjectImageAnimTable_GroundImpactDust, gFieldEffectObjectPicTable_GroundImpactDust, gDummySpriteAffineAnimTable, sub_8156194};
|
||||
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_BikeHopTallGrass[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_BikeHopTallGrass, 2, 1, 0),
|
||||
overworld_frame(gFieldEffectObjectPic_BikeHopTallGrass, 2, 1, 1),
|
||||
overworld_frame(gFieldEffectObjectPic_BikeHopTallGrass, 2, 1, 2),
|
||||
overworld_frame(gFieldEffectObjectPic_BikeHopTallGrass, 2, 1, 3),
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_JumpTallGrass[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_JumpTallGrass, 2, 1, 0),
|
||||
overworld_frame(gFieldEffectObjectPic_JumpTallGrass, 2, 1, 1),
|
||||
overworld_frame(gFieldEffectObjectPic_JumpTallGrass, 2, 1, 2),
|
||||
overworld_frame(gFieldEffectObjectPic_JumpTallGrass, 2, 1, 3),
|
||||
};
|
||||
|
||||
const union AnimCmd gFieldEffectObjectImageAnim_850CCD8[] =
|
||||
@ -241,12 +241,12 @@ const union AnimCmd gFieldEffectObjectImageAnim_850CCD8[] =
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
const union AnimCmd *const gFieldEffectObjectImageAnimTable_BikeHopTallGrass[] =
|
||||
const union AnimCmd *const gFieldEffectObjectImageAnimTable_JumpTallGrass[] =
|
||||
{
|
||||
gFieldEffectObjectImageAnim_850CCD8,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_BikeHopTallGrass = {0xFFFF, 0x1005, &gObjectEventBaseOam_16x8, gFieldEffectObjectImageAnimTable_BikeHopTallGrass, gFieldEffectObjectPicTable_BikeHopTallGrass, gDummySpriteAffineAnimTable, sub_8156194};
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpTallGrass = {0xFFFF, 0x1005, &gObjectEventBaseOam_16x8, gFieldEffectObjectImageAnimTable_JumpTallGrass, gFieldEffectObjectPicTable_JumpTallGrass, gDummySpriteAffineAnimTable, sub_8156194};
|
||||
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_SandFootprints[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_SandFootprints, 2, 2, 0),
|
||||
@ -398,11 +398,11 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_BikeTireTracks[] =
|
||||
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_BikeTireTracks = {0xFFFF, 0x1004, &gObjectEventBaseOam_16x16, gFieldEffectObjectImageAnimTable_BikeTireTracks, gFieldEffectObjectPicTable_BikeTireTracks, gDummySpriteAffineAnimTable, UpdateFootprintsTireTracksFieldEffect};
|
||||
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_BikeHopBigSplash[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_BikeHopBigSplash, 2, 2, 0),
|
||||
overworld_frame(gFieldEffectObjectPic_BikeHopBigSplash, 2, 2, 1),
|
||||
overworld_frame(gFieldEffectObjectPic_BikeHopBigSplash, 2, 2, 2),
|
||||
overworld_frame(gFieldEffectObjectPic_BikeHopBigSplash, 2, 2, 3),
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_JumpBigSplash[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_JumpBigSplash, 2, 2, 0),
|
||||
overworld_frame(gFieldEffectObjectPic_JumpBigSplash, 2, 2, 1),
|
||||
overworld_frame(gFieldEffectObjectPic_JumpBigSplash, 2, 2, 2),
|
||||
overworld_frame(gFieldEffectObjectPic_JumpBigSplash, 2, 2, 3),
|
||||
};
|
||||
|
||||
const union AnimCmd gFieldEffectObjectImageAnim_850CE7C[] =
|
||||
@ -414,12 +414,12 @@ const union AnimCmd gFieldEffectObjectImageAnim_850CE7C[] =
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
const union AnimCmd *const gFieldEffectObjectImageAnimTable_BikeHopBigSplash[] =
|
||||
const union AnimCmd *const gFieldEffectObjectImageAnimTable_JumpBigSplash[] =
|
||||
{
|
||||
gFieldEffectObjectImageAnim_850CE7C,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_BikeHopBigSplash = {0xFFFF, 0x1004, &gObjectEventBaseOam_16x16, gFieldEffectObjectImageAnimTable_BikeHopBigSplash, gFieldEffectObjectPicTable_BikeHopBigSplash, gDummySpriteAffineAnimTable, sub_8156194};
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpBigSplash = {0xFFFF, 0x1004, &gObjectEventBaseOam_16x16, gFieldEffectObjectImageAnimTable_JumpBigSplash, gFieldEffectObjectPicTable_JumpBigSplash, gDummySpriteAffineAnimTable, sub_8156194};
|
||||
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_Splash[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_Splash, 2, 1, 0),
|
||||
@ -454,10 +454,10 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_Splash[] =
|
||||
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Splash = {0xFFFF, 0x1004, &gObjectEventBaseOam_16x8, gFieldEffectObjectImageAnimTable_Splash, gFieldEffectObjectPicTable_Splash, gDummySpriteAffineAnimTable, UpdateSplashFieldEffect};
|
||||
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_BikeHopSmallSplash[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_BikeHopSmallSplash, 2, 1, 0),
|
||||
overworld_frame(gFieldEffectObjectPic_BikeHopSmallSplash, 2, 1, 1),
|
||||
overworld_frame(gFieldEffectObjectPic_BikeHopSmallSplash, 2, 1, 2),
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_JumpSmallSplash[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_JumpSmallSplash, 2, 1, 0),
|
||||
overworld_frame(gFieldEffectObjectPic_JumpSmallSplash, 2, 1, 1),
|
||||
overworld_frame(gFieldEffectObjectPic_JumpSmallSplash, 2, 1, 2),
|
||||
};
|
||||
|
||||
const union AnimCmd gFieldEffectObjectImageAnim_850CF24[] =
|
||||
@ -468,12 +468,12 @@ const union AnimCmd gFieldEffectObjectImageAnim_850CF24[] =
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
const union AnimCmd *const gFieldEffectObjectImageAnimTable_BikeHopSmallSplash[] =
|
||||
const union AnimCmd *const gFieldEffectObjectImageAnimTable_JumpSmallSplash[] =
|
||||
{
|
||||
gFieldEffectObjectImageAnim_850CF24,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_BikeHopSmallSplash = {0xFFFF, 0x1004, &gObjectEventBaseOam_16x8, gFieldEffectObjectImageAnimTable_BikeHopSmallSplash, gFieldEffectObjectPicTable_BikeHopSmallSplash, gDummySpriteAffineAnimTable, sub_8156194};
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpSmallSplash = {0xFFFF, 0x1004, &gObjectEventBaseOam_16x8, gFieldEffectObjectImageAnimTable_JumpSmallSplash, gFieldEffectObjectPicTable_JumpSmallSplash, gDummySpriteAffineAnimTable, sub_8156194};
|
||||
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_LongGrass[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_LongGrass, 2, 2, 0),
|
||||
@ -501,13 +501,13 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_LongGrass[] =
|
||||
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_LongGrass = {0xFFFF, 0x1005, &gObjectEventBaseOam_16x16, gFieldEffectObjectImageAnimTable_LongGrass, gFieldEffectObjectPicTable_LongGrass, gDummySpriteAffineAnimTable, UpdateLongGrassFieldEffect};
|
||||
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_Unknown16[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_Unknown16, 2, 2, 0),
|
||||
overworld_frame(gFieldEffectObjectPic_Unknown16, 2, 2, 1),
|
||||
overworld_frame(gFieldEffectObjectPic_Unknown16, 2, 2, 2),
|
||||
overworld_frame(gFieldEffectObjectPic_Unknown16, 2, 2, 3),
|
||||
overworld_frame(gFieldEffectObjectPic_Unknown16, 2, 2, 4),
|
||||
overworld_frame(gFieldEffectObjectPic_Unknown16, 2, 2, 6),
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_JumpLongGrass[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_JumpLongGrass, 2, 2, 0),
|
||||
overworld_frame(gFieldEffectObjectPic_JumpLongGrass, 2, 2, 1),
|
||||
overworld_frame(gFieldEffectObjectPic_JumpLongGrass, 2, 2, 2),
|
||||
overworld_frame(gFieldEffectObjectPic_JumpLongGrass, 2, 2, 3),
|
||||
overworld_frame(gFieldEffectObjectPic_JumpLongGrass, 2, 2, 4),
|
||||
overworld_frame(gFieldEffectObjectPic_JumpLongGrass, 2, 2, 6),
|
||||
};
|
||||
|
||||
const union AnimCmd gFieldEffectObjectImageAnim_850CFDC[] =
|
||||
@ -521,15 +521,15 @@ const union AnimCmd gFieldEffectObjectImageAnim_850CFDC[] =
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
const union AnimCmd *const gFieldEffectObjectImageAnimTable_Unknown16[] =
|
||||
const union AnimCmd *const gFieldEffectObjectImageAnimTable_JumpLongGrass[] =
|
||||
{
|
||||
gFieldEffectObjectImageAnim_850CFDC,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown16 = {0xFFFF, 0x1005, &gObjectEventBaseOam_16x16, gFieldEffectObjectImageAnimTable_Unknown16, gFieldEffectObjectPicTable_Unknown16, gDummySpriteAffineAnimTable, sub_8156194};
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpLongGrass = {0xFFFF, 0x1005, &gObjectEventBaseOam_16x16, gFieldEffectObjectImageAnimTable_JumpLongGrass, gFieldEffectObjectPicTable_JumpLongGrass, gDummySpriteAffineAnimTable, sub_8156194};
|
||||
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_Unknown17[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_Unknown16, 2, 2, 6),
|
||||
overworld_frame(gFieldEffectObjectPic_JumpLongGrass, 2, 2, 6),
|
||||
overworld_frame(gFieldEffectObjectPic_Unknown17, 2, 2, 0),
|
||||
overworld_frame(gFieldEffectObjectPic_Unknown17, 2, 2, 1),
|
||||
overworld_frame(gFieldEffectObjectPic_Unknown17, 2, 2, 2),
|
||||
@ -561,11 +561,11 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_Unknown17[] =
|
||||
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown17 = {0xFFFF, 0x1005, &gObjectEventBaseOam_16x16, gFieldEffectObjectImageAnimTable_Unknown17, gFieldEffectObjectPicTable_Unknown17, gDummySpriteAffineAnimTable, WaitFieldEffectSpriteAnim};
|
||||
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_Unknown18[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_Unknown18, 2, 2, 0),
|
||||
overworld_frame(gFieldEffectObjectPic_Unknown18, 2, 2, 1),
|
||||
overworld_frame(gFieldEffectObjectPic_Unknown18, 2, 2, 2),
|
||||
overworld_frame(gFieldEffectObjectPic_Unknown18, 2, 2, 3),
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_UnusedGrass[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_UnusedGrass, 2, 2, 0),
|
||||
overworld_frame(gFieldEffectObjectPic_UnusedGrass, 2, 2, 1),
|
||||
overworld_frame(gFieldEffectObjectPic_UnusedGrass, 2, 2, 2),
|
||||
overworld_frame(gFieldEffectObjectPic_UnusedGrass, 2, 2, 3),
|
||||
};
|
||||
|
||||
const union AnimCmd gFieldEffectObjectImageAnim_850D0C0[] =
|
||||
@ -579,12 +579,12 @@ const union AnimCmd gFieldEffectObjectImageAnim_850D0C0[] =
|
||||
ANIMCMD_JUMP(0),
|
||||
};
|
||||
|
||||
const union AnimCmd *const gFieldEffectObjectImageAnimTable_Unknown18[] =
|
||||
const union AnimCmd *const gFieldEffectObjectImageAnimTable_UnusedGrass[] =
|
||||
{
|
||||
gFieldEffectObjectImageAnim_850D0C0,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown18 = {0xFFFF, 0x1005, &gObjectEventBaseOam_16x16, gFieldEffectObjectImageAnimTable_Unknown18, gFieldEffectObjectPicTable_Unknown18, gDummySpriteAffineAnimTable, WaitFieldEffectSpriteAnim};
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_UnusedGrass = {0xFFFF, 0x1005, &gObjectEventBaseOam_16x16, gFieldEffectObjectImageAnimTable_UnusedGrass, gFieldEffectObjectPicTable_UnusedGrass, gDummySpriteAffineAnimTable, WaitFieldEffectSpriteAnim};
|
||||
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_Unknown19[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_Unknown19, 2, 2, 0),
|
||||
@ -609,10 +609,10 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_Unknown19[] =
|
||||
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown19 = {0xFFFF, 0x1004, &gObjectEventBaseOam_16x16, gFieldEffectObjectImageAnimTable_Unknown19, gFieldEffectObjectPicTable_Unknown19, gDummySpriteAffineAnimTable, WaitFieldEffectSpriteAnim};
|
||||
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_Unknown29[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_Unknown29, 2, 1, 0),
|
||||
overworld_frame(gFieldEffectObjectPic_Unknown29, 2, 1, 1),
|
||||
overworld_frame(gFieldEffectObjectPic_Unknown29, 2, 1, 2),
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_SandPile[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_SandPile, 2, 1, 0),
|
||||
overworld_frame(gFieldEffectObjectPic_SandPile, 2, 1, 1),
|
||||
overworld_frame(gFieldEffectObjectPic_SandPile, 2, 1, 2),
|
||||
};
|
||||
|
||||
const union AnimCmd gFieldEffectObjectImageAnim_850D160[] =
|
||||
@ -623,12 +623,12 @@ const union AnimCmd gFieldEffectObjectImageAnim_850D160[] =
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
const union AnimCmd *const gFieldEffectObjectImageAnimTable_Unknown29[] =
|
||||
const union AnimCmd *const gFieldEffectObjectImageAnimTable_SandPile[] =
|
||||
{
|
||||
gFieldEffectObjectImageAnim_850D160,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown29 = {0xFFFF, 0x1004, &gObjectEventBaseOam_16x8, gFieldEffectObjectImageAnimTable_Unknown29, gFieldEffectObjectPicTable_Unknown29, gDummySpriteAffineAnimTable, UpdateSandPileFieldEffect};
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_SandPile = {0xFFFF, 0x1004, &gObjectEventBaseOam_16x8, gFieldEffectObjectImageAnimTable_SandPile, gFieldEffectObjectPicTable_SandPile, gDummySpriteAffineAnimTable, UpdateSandPileFieldEffect};
|
||||
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_Unknown20[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_Unknown20, 2, 2, 0),
|
||||
@ -683,21 +683,21 @@ const union AffineAnimCmd gFieldEffectObjectRotScalAnim_850D234[] =
|
||||
AFFINEANIMCMD_JUMP(1),
|
||||
};
|
||||
|
||||
const union AffineAnimCmd *const gFieldEffectObjectRotScalAnimTable_Unknown21[] =
|
||||
const union AffineAnimCmd *const gFieldEffectObjectRotScalAnimTable_ReflectionDistortion[] =
|
||||
{
|
||||
gFieldEffectObjectRotScalAnim_850D1E4,
|
||||
gFieldEffectObjectRotScalAnim_850D234,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown21 = {0x0, 0xFFFF, &gDummyOamData, gDummySpriteAnimTable, NULL, gFieldEffectObjectRotScalAnimTable_Unknown21, SpriteCallbackDummy};
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_ReflectionDistortion = {0x0, 0xFFFF, &gDummyOamData, gDummySpriteAnimTable, NULL, gFieldEffectObjectRotScalAnimTable_ReflectionDistortion, SpriteCallbackDummy};
|
||||
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_BerryTreeGrowthSparkle[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_BerryTreeGrowthSparkle, 2, 2, 0),
|
||||
overworld_frame(gFieldEffectObjectPic_BerryTreeGrowthSparkle, 2, 2, 1),
|
||||
overworld_frame(gFieldEffectObjectPic_BerryTreeGrowthSparkle, 2, 2, 2),
|
||||
overworld_frame(gFieldEffectObjectPic_BerryTreeGrowthSparkle, 2, 2, 3),
|
||||
overworld_frame(gFieldEffectObjectPic_BerryTreeGrowthSparkle, 2, 2, 4),
|
||||
overworld_frame(gFieldEffectObjectPic_BerryTreeGrowthSparkle, 2, 2, 5),
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_Sparkle[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_Sparkle, 2, 2, 0),
|
||||
overworld_frame(gFieldEffectObjectPic_Sparkle, 2, 2, 1),
|
||||
overworld_frame(gFieldEffectObjectPic_Sparkle, 2, 2, 2),
|
||||
overworld_frame(gFieldEffectObjectPic_Sparkle, 2, 2, 3),
|
||||
overworld_frame(gFieldEffectObjectPic_Sparkle, 2, 2, 4),
|
||||
overworld_frame(gFieldEffectObjectPic_Sparkle, 2, 2, 5),
|
||||
};
|
||||
|
||||
const union AnimCmd gFieldEffectObjectImageAnim_850D2D4[] =
|
||||
@ -725,12 +725,12 @@ const union AnimCmd gFieldEffectObjectImageAnim_850D2D4[] =
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
const union AnimCmd *const gFieldEffectObjectImageAnimTable_BerryTreeGrowthSparkle[] =
|
||||
const union AnimCmd *const gFieldEffectObjectImageAnimTable_Sparkle[] =
|
||||
{
|
||||
gFieldEffectObjectImageAnim_850D2D4,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_BerryTreeGrowthSparkle = {0xFFFF, 0xFFFF, &gObjectEventBaseOam_16x16, gFieldEffectObjectImageAnimTable_BerryTreeGrowthSparkle, gFieldEffectObjectPicTable_BerryTreeGrowthSparkle, gDummySpriteAffineAnimTable, WaitFieldEffectSpriteAnim};
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Sparkle = {0xFFFF, 0xFFFF, &gObjectEventBaseOam_16x16, gFieldEffectObjectImageAnimTable_Sparkle, gFieldEffectObjectPicTable_Sparkle, gDummySpriteAffineAnimTable, WaitFieldEffectSpriteAnim};
|
||||
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_TreeDisguise[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_TreeDisguise, 2, 4, 0),
|
||||
@ -970,9 +970,9 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_Bubbles[] =
|
||||
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Bubbles = {0xFFFF, 0x1004, &gObjectEventBaseOam_16x32, gFieldEffectObjectImageAnimTable_Bubbles, gFieldEffectObjectPicTable_Bubbles, gDummySpriteAffineAnimTable, UpdateBubblesFieldEffect};
|
||||
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_Unknown35[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_Unknown35, 2, 2, 0),
|
||||
overworld_frame(gFieldEffectObjectPic_Unknown35, 2, 2, 1),
|
||||
const struct SpriteFrameImage gFieldEffectObjectPicTable_SmallSparkle[] = {
|
||||
overworld_frame(gFieldEffectObjectPic_SmallSparkle, 2, 2, 0),
|
||||
overworld_frame(gFieldEffectObjectPic_SmallSparkle, 2, 2, 1),
|
||||
};
|
||||
|
||||
const union AnimCmd gFieldEffectObjectImageAnim_850D674[] =
|
||||
@ -983,12 +983,12 @@ const union AnimCmd gFieldEffectObjectImageAnim_850D674[] =
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
const union AnimCmd *const gFieldEffectObjectImageAnimTable_Unknown35[] =
|
||||
const union AnimCmd *const gFieldEffectObjectImageAnimTable_SmallSparkle[] =
|
||||
{
|
||||
gFieldEffectObjectImageAnim_850D674,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown35 = {0xFFFF, 0x100F, &gObjectEventBaseOam_16x16, gFieldEffectObjectImageAnimTable_Unknown35, gFieldEffectObjectPicTable_Unknown35, gDummySpriteAffineAnimTable, UpdateSparkleFieldEffect};
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_SmallSparkle = {0xFFFF, 0x100F, &gObjectEventBaseOam_16x16, gFieldEffectObjectImageAnimTable_SmallSparkle, gFieldEffectObjectPicTable_SmallSparkle, gDummySpriteAffineAnimTable, UpdateSparkleFieldEffect};
|
||||
|
||||
const struct SpritePalette gFieldEffectObjectPaletteInfo3 = {gFieldEffectObjectPalette3, 0x100F};
|
||||
|
||||
|
@ -252,7 +252,7 @@ const u32 gObjectEventPic_CableCar[] = INCBIN_U32("graphics/object_events/pics/m
|
||||
const u16 gObjectEventPalette20[] = INCBIN_U16("graphics/object_events/palettes/20.gbapal");
|
||||
const u32 gObjectEventPic_SSTidal[] = INCBIN_U32("graphics/object_events/pics/misc/ss_tidal.4bpp");
|
||||
const u16 gObjectEventPalette21[] = INCBIN_U16("graphics/object_events/palettes/21.gbapal");
|
||||
const u32 gFieldEffectObjectPic_BerryTreeGrowthSparkle[] = INCBIN_U32("graphics/field_effects/pics/berry_tree_growth_sparkle.4bpp");
|
||||
const u32 gFieldEffectObjectPic_Sparkle[] = INCBIN_U32("graphics/field_effects/pics/sparkle.4bpp");
|
||||
const u32 gObjectEventPic_BerryTreeDirtPile[] = INCBIN_U32("graphics/object_events/pics/berry_trees/dirt_pile.4bpp");
|
||||
const u32 gObjectEventPic_BerryTreeSprout[] = INCBIN_U32("graphics/object_events/pics/berry_trees/sprout.4bpp");
|
||||
const u32 gObjectEventPic_PechaBerryTree[] = INCBIN_U32("graphics/object_events/pics/berry_trees/pecha.4bpp");
|
||||
@ -303,11 +303,11 @@ const u32 gFieldEffectObjectPic_Arrow[] = INCBIN_U32("graphics/field_effects/pic
|
||||
const u16 gFieldEffectObjectPalette0[] = INCBIN_U16("graphics/field_effects/palettes/00.gbapal");
|
||||
const u16 gFieldEffectObjectPalette1[] = INCBIN_U16("graphics/field_effects/palettes/01.gbapal");
|
||||
const u32 gFieldEffectObjectPic_GroundImpactDust[] = INCBIN_U32("graphics/field_effects/pics/ground_impact_dust.4bpp");
|
||||
const u32 gFieldEffectObjectPic_BikeHopTallGrass[] = INCBIN_U32("graphics/field_effects/pics/bike_hop_tall_grass.4bpp");
|
||||
const u32 gUnusedGrass[] = INCBIN_U32("graphics/field_effects/pics/unused_grass.4bpp");
|
||||
const u32 gFieldEffectObjectPic_Unknown16[] = INCBIN_U32("graphics/field_effects/pics/unknown_16.4bpp");
|
||||
const u32 gFieldEffectObjectPic_JumpTallGrass[] = INCBIN_U32("graphics/field_effects/pics/bike_hop_tall_grass.4bpp");
|
||||
const u32 gUnusedGrass[] = INCBIN_U32("graphics/field_effects/pics/unused_grass_2.4bpp");
|
||||
const u32 gFieldEffectObjectPic_JumpLongGrass[] = INCBIN_U32("graphics/field_effects/pics/unknown_16.4bpp");
|
||||
const u32 gFieldEffectObjectPic_Unknown17[] = INCBIN_U32("graphics/field_effects/pics/unknown_17.4bpp");
|
||||
const u32 gFieldEffectObjectPic_Unknown18[] = INCBIN_U32("graphics/field_effects/pics/unknown_18.4bpp");
|
||||
const u32 gFieldEffectObjectPic_UnusedGrass[] = INCBIN_U32("graphics/field_effects/pics/unused_grass.4bpp");
|
||||
const u32 gFieldEffectObjectPic_LongGrass[] = INCBIN_U32("graphics/field_effects/pics/long_grass.4bpp");
|
||||
const u32 gFieldEffectObjectPic_TallGrass[] = INCBIN_U32("graphics/field_effects/pics/tall_grass.4bpp");
|
||||
const u32 gFieldEffectObjectPic_ShortGrass[] = INCBIN_U32("graphics/field_effects/pics/short_grass.4bpp");
|
||||
@ -315,10 +315,10 @@ const u32 gFieldEffectObjectPic_SandFootprints[] = INCBIN_U32("graphics/field_ef
|
||||
const u32 gFieldEffectObjectPic_DeepSandFootprints[] = INCBIN_U32("graphics/field_effects/pics/deep_sand_footprints.4bpp");
|
||||
const u32 gFieldEffectObjectPic_BikeTireTracks[] = INCBIN_U32("graphics/field_effects/pics/bike_tire_tracks.4bpp");
|
||||
const u32 gFieldEffectObjectPic_Unknown19[] = INCBIN_U32("graphics/field_effects/pics/unknown_19.4bpp");
|
||||
const u32 gFieldEffectObjectPic_Unknown29[] = INCBIN_U32("graphics/field_effects/pics/unknown_29.4bpp");
|
||||
const u32 gFieldEffectObjectPic_BikeHopBigSplash[] = INCBIN_U32("graphics/field_effects/pics/bike_hop_big_splash.4bpp");
|
||||
const u32 gFieldEffectObjectPic_SandPile[] = INCBIN_U32("graphics/field_effects/pics/sand_pile.4bpp");
|
||||
const u32 gFieldEffectObjectPic_JumpBigSplash[] = INCBIN_U32("graphics/field_effects/pics/bike_hop_big_splash.4bpp");
|
||||
const u32 gFieldEffectObjectPic_Splash[] = INCBIN_U32("graphics/field_effects/pics/splash.4bpp");
|
||||
const u32 gFieldEffectObjectPic_BikeHopSmallSplash[] = INCBIN_U32("graphics/field_effects/pics/bike_hop_small_splash.4bpp");
|
||||
const u32 gFieldEffectObjectPic_JumpSmallSplash[] = INCBIN_U32("graphics/field_effects/pics/bike_hop_small_splash.4bpp");
|
||||
const u32 gFieldEffectObjectPic_Unknown20[] = INCBIN_U32("graphics/field_effects/pics/unknown_20.4bpp");
|
||||
const u32 gFieldEffectObjectPic_TreeDisguise[] = INCBIN_U32("graphics/field_effects/pics/tree_disguise.4bpp");
|
||||
const u32 gFieldEffectObjectPic_MountainDisguise[] = INCBIN_U32("graphics/field_effects/pics/mountain_disguise.4bpp");
|
||||
@ -328,7 +328,7 @@ const u16 gFieldEffectObjectPalette2[] = INCBIN_U16("graphics/field_effects/pale
|
||||
const u32 gFieldEffectObjectPic_JumpOutOfAsh[] = INCBIN_U32("graphics/field_effects/pics/jump_out_of_ash.4bpp");
|
||||
const u32 gFieldEffectObjectPic_LavaridgeGymWarp[] = INCBIN_U32("graphics/field_effects/pics/lavaridge_gym_warp.4bpp");
|
||||
const u32 gFieldEffectObjectPic_Bubbles[] = INCBIN_U32("graphics/field_effects/pics/bubbles.4bpp");
|
||||
const u32 gFieldEffectObjectPic_Unknown35[] = INCBIN_U32("graphics/field_effects/pics/unknown_35.4bpp");
|
||||
const u32 gFieldEffectObjectPic_SmallSparkle[] = INCBIN_U32("graphics/field_effects/pics/small_sparkle.4bpp");
|
||||
const u16 gFieldEffectObjectPalette3[] = INCBIN_U16("graphics/field_effects/palettes/03.gbapal");
|
||||
const u32 gFieldEffectObjectPic_Bird[] = INCBIN_U32("graphics/field_effects/pics/bird.4bpp");
|
||||
const u32 gObjectEventPic_Juan[] = INCBIN_U32("graphics/object_events/pics/people/gym_leaders/juan.4bpp");
|
||||
|
@ -4629,7 +4629,7 @@ static void sub_802A7A8(void)
|
||||
ChangeBgX(3, 0, 0);
|
||||
ChangeBgY(3, 0, 0);
|
||||
InitStandardTextBoxWindows();
|
||||
sub_8197200();
|
||||
InitTextBoxGfxAndPrinters();
|
||||
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP);
|
||||
SetBgTilemapBuffer(3, gUnknown_02022CF8->tilemapBuffers[0]);
|
||||
SetBgTilemapBuffer(1, gUnknown_02022CF8->tilemapBuffers[1]);
|
||||
|
@ -1121,13 +1121,13 @@ void ResetObjectEvents(void)
|
||||
|
||||
static void CreateReflectionEffectSprites(void)
|
||||
{
|
||||
u8 spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[21], 0, 0, 31);
|
||||
u8 spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_REFLECTION_DISTORTION], 0, 0, 31);
|
||||
gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL;
|
||||
InitSpriteAffineAnim(&gSprites[spriteId]);
|
||||
StartSpriteAffineAnim(&gSprites[spriteId], 0);
|
||||
gSprites[spriteId].invisible = TRUE;
|
||||
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[21], 0, 0, 31);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_REFLECTION_DISTORTION], 0, 0, 31);
|
||||
gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL;
|
||||
InitSpriteAffineAnim(&gSprites[spriteId]);
|
||||
StartSpriteAffineAnim(&gSprites[spriteId], 1);
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "metatile_behavior.h"
|
||||
#include "sprite.h"
|
||||
#include "constants/event_objects.h"
|
||||
#include "constants/field_effects.h"
|
||||
#include "constants/flags.h"
|
||||
#include "constants/maps.h"
|
||||
#include "constants/metatile_behaviors.h"
|
||||
@ -379,7 +380,7 @@ void sub_81D4A90(void)
|
||||
x = mew->currentCoords.x;
|
||||
y = mew->currentCoords.y;
|
||||
sub_80930E0(&x, &y, 8, 8);
|
||||
sUnknown_0203CF50 = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[15], x, y, gSprites[mew->spriteId].subpriority - 1);
|
||||
sUnknown_0203CF50 = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_LONG_GRASS], x, y, gSprites[mew->spriteId].subpriority - 1);
|
||||
if (sUnknown_0203CF50 != MAX_SPRITES)
|
||||
{
|
||||
struct Sprite *sprite = &gSprites[sUnknown_0203CF50];
|
||||
|
@ -39,7 +39,7 @@ static void CameraPanningCB_PanAhead(void);
|
||||
static struct FieldCameraOffset sFieldCameraOffset;
|
||||
static s16 sHorizontalCameraPan;
|
||||
static s16 sVerticalCameraPan;
|
||||
static u8 gUnknown_03000E2C;
|
||||
static bool8 gUnknown_03000E2C;
|
||||
static void (*sFieldCameraPanningCallback)(void);
|
||||
|
||||
struct CameraObject gFieldCamera;
|
||||
@ -47,7 +47,7 @@ u16 gTotalCameraPixelOffsetY;
|
||||
u16 gTotalCameraPixelOffsetX;
|
||||
|
||||
// text
|
||||
static void move_tilemap_camera_to_upper_left_corner_(struct FieldCameraOffset *cameraOffset)
|
||||
static void ResetCameraOffset(struct FieldCameraOffset *cameraOffset)
|
||||
{
|
||||
cameraOffset->xTileOffset = 0;
|
||||
cameraOffset->yTileOffset = 0;
|
||||
@ -56,23 +56,23 @@ static void move_tilemap_camera_to_upper_left_corner_(struct FieldCameraOffset *
|
||||
cameraOffset->copyBGToVRAM = TRUE;
|
||||
}
|
||||
|
||||
static void tilemap_move_something(struct FieldCameraOffset *cameraOffset, u32 b, u32 c)
|
||||
static void AddCameraTileOffset(struct FieldCameraOffset *cameraOffset, u32 xOffset, u32 yOffset)
|
||||
{
|
||||
cameraOffset->xTileOffset += b;
|
||||
cameraOffset->xTileOffset += xOffset;
|
||||
cameraOffset->xTileOffset %= 32;
|
||||
cameraOffset->yTileOffset += c;
|
||||
cameraOffset->yTileOffset += yOffset;
|
||||
cameraOffset->yTileOffset %= 32;
|
||||
}
|
||||
|
||||
static void coords8_add(struct FieldCameraOffset *cameraOffset, u32 b, u32 c)
|
||||
static void AddCameraPixelOffset(struct FieldCameraOffset *cameraOffset, u32 xOffset, u32 yOffset)
|
||||
{
|
||||
cameraOffset->xPixelOffset += b;
|
||||
cameraOffset->yPixelOffset += c;
|
||||
cameraOffset->xPixelOffset += xOffset;
|
||||
cameraOffset->yPixelOffset += yOffset;
|
||||
}
|
||||
|
||||
void move_tilemap_camera_to_upper_left_corner(void)
|
||||
void ResetFieldCamera(void)
|
||||
{
|
||||
move_tilemap_camera_to_upper_left_corner_(&sFieldCameraOffset);
|
||||
ResetCameraOffset(&sFieldCameraOffset);
|
||||
}
|
||||
|
||||
void FieldUpdateBgTilemapScroll(void)
|
||||
@ -89,10 +89,10 @@ void FieldUpdateBgTilemapScroll(void)
|
||||
SetGpuReg(REG_OFFSET_BG3VOFS, r4);
|
||||
}
|
||||
|
||||
void sub_8089C08(s16 *a, s16 *b)
|
||||
void sub_8089C08(s16 *x, s16 *y)
|
||||
{
|
||||
*a = sFieldCameraOffset.xPixelOffset + sHorizontalCameraPan;
|
||||
*b = sFieldCameraOffset.yPixelOffset + sVerticalCameraPan + 8;
|
||||
*x = sFieldCameraOffset.xPixelOffset + sHorizontalCameraPan;
|
||||
*y = sFieldCameraOffset.yPixelOffset + sVerticalCameraPan + 8;
|
||||
}
|
||||
|
||||
void DrawWholeMapView(void)
|
||||
@ -418,11 +418,11 @@ void CameraUpdate(void)
|
||||
UpdateObjectEventsForCameraUpdate(deltaX, deltaY);
|
||||
RotatingGatePuzzleCameraUpdate(deltaX, deltaY);
|
||||
ResetBerryTreeSparkleFlags();
|
||||
tilemap_move_something(&sFieldCameraOffset, deltaX * 2, deltaY * 2);
|
||||
AddCameraTileOffset(&sFieldCameraOffset, deltaX * 2, deltaY * 2);
|
||||
RedrawMapSlicesForCameraUpdate(&sFieldCameraOffset, deltaX * 2, deltaY * 2);
|
||||
}
|
||||
|
||||
coords8_add(&sFieldCameraOffset, movementSpeedX, movementSpeedY);
|
||||
AddCameraPixelOffset(&sFieldCameraOffset, movementSpeedX, movementSpeedY);
|
||||
gTotalCameraPixelOffsetX -= movementSpeedX;
|
||||
gTotalCameraPixelOffsetY -= movementSpeedY;
|
||||
}
|
||||
@ -436,9 +436,9 @@ void MoveCameraAndRedrawMap(int deltaX, int deltaY) //unused
|
||||
gTotalCameraPixelOffsetY -= deltaY * 16;
|
||||
}
|
||||
|
||||
void SetCameraPanningCallback(void (*a)(void))
|
||||
void SetCameraPanningCallback(void (*callback)(void))
|
||||
{
|
||||
sFieldCameraPanningCallback = a;
|
||||
sFieldCameraPanningCallback = callback;
|
||||
}
|
||||
|
||||
void SetCameraPanning(s16 a, s16 b)
|
||||
@ -450,7 +450,7 @@ void SetCameraPanning(s16 a, s16 b)
|
||||
void InstallCameraPanAheadCallback(void)
|
||||
{
|
||||
sFieldCameraPanningCallback = CameraPanningCB_PanAhead;
|
||||
gUnknown_03000E2C = 0;
|
||||
gUnknown_03000E2C = FALSE;
|
||||
sHorizontalCameraPan = 0;
|
||||
sVerticalCameraPan = 32;
|
||||
}
|
||||
@ -478,12 +478,12 @@ static void CameraPanningCB_PanAhead(void)
|
||||
if (gPlayerAvatar.tileTransitionState == T_TILE_TRANSITION)
|
||||
{
|
||||
gUnknown_03000E2C ^= 1;
|
||||
if (gUnknown_03000E2C == 0)
|
||||
if (gUnknown_03000E2C == FALSE)
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
gUnknown_03000E2C = 0;
|
||||
gUnknown_03000E2C = FALSE;
|
||||
}
|
||||
|
||||
var = GetPlayerMovementDirection();
|
||||
|
@ -545,7 +545,7 @@ static bool8 TryStartStepCountScript(u16 metatileBehavior)
|
||||
UpdateHappinessStepCounter();
|
||||
UpdateFarawayIslandStepCounter();
|
||||
|
||||
if (!(gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_6) && !MetatileBehavior_IsForcedMovementTile(metatileBehavior))
|
||||
if (!(gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_FORCED_MOVE) && !MetatileBehavior_IsForcedMovementTile(metatileBehavior))
|
||||
{
|
||||
if (UpdatePoisonStepCounter() == TRUE)
|
||||
{
|
||||
@ -938,7 +938,7 @@ static struct BgEvent *GetBackgroundEventAtPosition(struct MapHeader *mapHeader,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool8 dive_warp(struct MapPosition *position, u16 metatileBehavior)
|
||||
bool8 TryDoDiveWarp(struct MapPosition *position, u16 metatileBehavior)
|
||||
{
|
||||
if (gMapHeader.mapType == MAP_TYPE_UNDERWATER && !MetatileBehavior_IsUnableToEmerge(metatileBehavior))
|
||||
{
|
||||
|
@ -166,7 +166,7 @@ u8 CreateWarpArrowSprite(void)
|
||||
u8 spriteId;
|
||||
struct Sprite *sprite;
|
||||
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[8], 0, 0, 0x52);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_ARROW], 0, 0, 0x52);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@ -202,11 +202,11 @@ void ShowWarpArrowSprite(u8 spriteId, u8 direction, s16 x, s16 y)
|
||||
}
|
||||
}
|
||||
|
||||
const u8 gShadowEffectTemplateIds[] = {
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3
|
||||
static const u8 sShadowEffectTemplateIds[] = {
|
||||
FLDEFFOBJ_SHADOW_S,
|
||||
FLDEFFOBJ_SHADOW_M,
|
||||
FLDEFFOBJ_SHADOW_L,
|
||||
FLDEFFOBJ_SHADOW_XL
|
||||
};
|
||||
|
||||
const u16 gShadowVerticalOffsets[] = {
|
||||
@ -224,7 +224,7 @@ u32 FldEff_Shadow(void)
|
||||
|
||||
objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
graphicsInfo = GetObjectEventGraphicsInfo(gObjectEvents[objectEventId].graphicsId);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[gShadowEffectTemplateIds[graphicsInfo->shadowSize]], 0, 0, 0x94);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[sShadowEffectTemplateIds[graphicsInfo->shadowSize]], 0, 0, 0x94);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
gSprites[spriteId].coordOffsetEnabled = TRUE;
|
||||
@ -275,7 +275,7 @@ u32 FldEff_TallGrass(void)
|
||||
x = gFieldEffectArguments[0];
|
||||
y = gFieldEffectArguments[1];
|
||||
sub_80930E0(&x, &y, 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[4], x, y, 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_TALL_GRASS], x, y, 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@ -341,7 +341,7 @@ u32 FldEff_JumpTallGrass(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
sub_80930E0((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 12);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[10], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_JUMP_TALL_GRASS], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@ -381,7 +381,7 @@ u32 FldEff_LongGrass(void)
|
||||
x = gFieldEffectArguments[0];
|
||||
y = gFieldEffectArguments[1];
|
||||
sub_80930E0(&x, &y, 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[15], x, y, 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_LONG_GRASS], x, y, 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@ -444,7 +444,7 @@ u32 FldEff_JumpLongGrass(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
sub_80930E0((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[16], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_JUMP_LONG_GRASS], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@ -465,7 +465,7 @@ u32 FldEff_ShortGrass(void)
|
||||
|
||||
objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
objectEvent = &gObjectEvents[objectEventId];
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[30], 0, 0, 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SHORT_GRASS], 0, 0, 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &(gSprites[spriteId]);
|
||||
@ -522,7 +522,7 @@ u32 FldEff_SandFootprints(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
sub_80930E0((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[11], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SAND_FOOTPRINTS], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@ -540,7 +540,7 @@ u32 FldEff_DeepSandFootprints(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
sub_80930E0((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[23], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_DEEP_SAND_FOOTPRINTS], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@ -558,7 +558,7 @@ u32 FldEff_BikeTireTracks(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
sub_80930E0((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[27], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_BIKE_TIRE_TRACKS], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@ -611,7 +611,7 @@ u32 FldEff_Splash(void)
|
||||
|
||||
objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
objectEvent = &gObjectEvents[objectEventId];
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[13], 0, 0, 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SPLASH], 0, 0, 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
graphicsInfo = GetObjectEventGraphicsInfo(objectEvent->graphicsId);
|
||||
@ -650,7 +650,7 @@ u32 FldEff_JumpSmallSplash(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
sub_80930E0((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 12);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[14], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_JUMP_SMALL_SPLASH], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@ -668,7 +668,7 @@ u32 FldEff_JumpBigSplash(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
sub_80930E0((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[12], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_JUMP_BIG_SPLASH], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@ -690,7 +690,7 @@ u32 FldEff_FeetInFlowingWater(void)
|
||||
|
||||
objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
objectEvent = &gObjectEvents[objectEventId];
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[13], 0, 0, 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SPLASH], 0, 0, 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
graphicsInfo = GetObjectEventGraphicsInfo(objectEvent->graphicsId);
|
||||
@ -744,7 +744,7 @@ u32 FldEff_Ripple(void)
|
||||
u8 spriteId;
|
||||
struct Sprite *sprite;
|
||||
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[5], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_RIPPLE], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@ -764,7 +764,7 @@ u32 FldEff_HotSpringsWater(void)
|
||||
|
||||
objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
objectEvent = &gObjectEvents[objectEventId];
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[31], 0, 0, 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_HOT_SPRINGS_WATER], 0, 0, 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@ -806,7 +806,7 @@ u32 FldEff_Unknown19(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
sub_80930E0((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[17], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_17], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@ -817,19 +817,19 @@ u32 FldEff_Unknown19(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 FldEff_Unknown20(void)
|
||||
u32 FldEff_UnusedGrass(void)
|
||||
{
|
||||
u8 spriteId;
|
||||
struct Sprite *sprite;
|
||||
|
||||
sub_80930E0((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[18], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_UNUSED_GRASS], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
sprite->coordOffsetEnabled = TRUE;
|
||||
sprite->oam.priority = gFieldEffectArguments[3];
|
||||
sprite->data[0] = FLDEFF_UNKNOWN_20;
|
||||
sprite->data[0] = FLDEFF_UNUSED_GRASS;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -840,7 +840,7 @@ u32 FldEff_Unknown21(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
sub_80930E0((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[19], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_19], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@ -857,7 +857,7 @@ u32 FldEff_Unknown22(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
sub_80930E0((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[20], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_20], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@ -889,7 +889,7 @@ u32 FldEff_Ash(void)
|
||||
x = gFieldEffectArguments[0];
|
||||
y = gFieldEffectArguments[1];
|
||||
sub_80930E0(&x, &y, 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[6], x, y, gFieldEffectArguments[2]);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_ASH], x, y, gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@ -945,7 +945,7 @@ u32 FldEff_SurfBlob(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
sub_80930E0((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[7], gFieldEffectArguments[0], gFieldEffectArguments[1], 0x96);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SURF_BLOB], gFieldEffectArguments[0], gFieldEffectArguments[1], 0x96);
|
||||
if (spriteId !=MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@ -1107,7 +1107,7 @@ u32 FldEff_Dust(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
sub_80930E0((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 12);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[9], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_GROUND_IMPACT_DUST], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@ -1129,7 +1129,7 @@ u32 FldEff_SandPile(void)
|
||||
|
||||
objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
objectEvent = &gObjectEvents[objectEventId];
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[29], 0, 0, 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SAND_PILE], 0, 0, 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
graphicsInfo = GetObjectEventGraphicsInfo(objectEvent->graphicsId);
|
||||
@ -1183,7 +1183,7 @@ u32 FldEff_Bubbles(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
sub_80930E0((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[34], gFieldEffectArguments[0], gFieldEffectArguments[1], 0x52);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_BUBBLES], gFieldEffectArguments[0], gFieldEffectArguments[1], 0x52);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@ -1211,7 +1211,7 @@ u32 FldEff_BerryTreeGrowthSparkle(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
sub_80930E0((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 4);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[22], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SPARKLE], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@ -1225,20 +1225,20 @@ u32 FldEff_BerryTreeGrowthSparkle(void)
|
||||
|
||||
u32 ShowTreeDisguiseFieldEffect(void)
|
||||
{
|
||||
return ShowDisguiseFieldEffect(FLDEFF_TREE_DISGUISE, 24, 4);
|
||||
return ShowDisguiseFieldEffect(FLDEFF_TREE_DISGUISE, FLDEFFOBJ_TREE_DISGUISE, 4);
|
||||
}
|
||||
|
||||
u32 ShowMountainDisguiseFieldEffect(void)
|
||||
{
|
||||
return ShowDisguiseFieldEffect(FLDEFF_MOUNTAIN_DISGUISE, 25, 3);
|
||||
return ShowDisguiseFieldEffect(FLDEFF_MOUNTAIN_DISGUISE, FLDEFFOBJ_MOUNTAIN_DISGUISE, 3);
|
||||
}
|
||||
|
||||
u32 ShowSandDisguiseFieldEffect(void)
|
||||
{
|
||||
return ShowDisguiseFieldEffect(FLDEFF_SAND_DISGUISE, 28, 2);
|
||||
return ShowDisguiseFieldEffect(FLDEFF_SAND_DISGUISE, FLDEFFOBJ_SAND_DISGUISE, 2);
|
||||
}
|
||||
|
||||
static u32 ShowDisguiseFieldEffect(u8 fldEff, u8 templateIdx, u8 paletteNum)
|
||||
static u32 ShowDisguiseFieldEffect(u8 fldEff, u8 fldEffObj, u8 paletteNum)
|
||||
{
|
||||
u8 spriteId;
|
||||
struct Sprite *sprite;
|
||||
@ -1248,7 +1248,7 @@ static u32 ShowDisguiseFieldEffect(u8 fldEff, u8 templateIdx, u8 paletteNum)
|
||||
FieldEffectActiveListRemove(fldEff);
|
||||
return MAX_SPRITES;
|
||||
}
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[templateIdx], 0, 0, 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[fldEffObj], 0, 0, 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@ -1331,7 +1331,7 @@ u32 FldEff_Sparkle(void)
|
||||
gFieldEffectArguments[0] += 7;
|
||||
gFieldEffectArguments[1] += 7;
|
||||
sub_80930E0((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[35], gFieldEffectArguments[0], gFieldEffectArguments[1], 0x52);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SMALL_SPARKLE], gFieldEffectArguments[0], gFieldEffectArguments[1], 0x52);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
gSprites[spriteId].oam.priority = gFieldEffectArguments[2];
|
||||
|
@ -379,9 +379,9 @@ static bool8 TryInterruptObjectEventSpecialAnim(struct ObjectEvent *playerObjEve
|
||||
|
||||
static void npc_clear_strange_bits(struct ObjectEvent *objEvent)
|
||||
{
|
||||
objEvent->inanimate = 0;
|
||||
objEvent->disableAnim = 0;
|
||||
objEvent->facingDirectionLocked = 0;
|
||||
objEvent->inanimate = FALSE;
|
||||
objEvent->disableAnim = FALSE;
|
||||
objEvent->facingDirectionLocked = FALSE;
|
||||
gPlayerAvatar.flags &= ~PLAYER_AVATAR_FLAG_DASH;
|
||||
}
|
||||
|
||||
@ -424,14 +424,14 @@ static u8 GetForcedMovementByMetatileBehavior(void)
|
||||
|
||||
static bool8 ForcedMovement_None(void)
|
||||
{
|
||||
if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_6)
|
||||
if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_FORCED_MOVE)
|
||||
{
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
playerObjEvent->facingDirectionLocked = 0;
|
||||
playerObjEvent->enableAnim = 1;
|
||||
playerObjEvent->facingDirectionLocked = FALSE;
|
||||
playerObjEvent->enableAnim = TRUE;
|
||||
SetObjectEventDirection(playerObjEvent, playerObjEvent->facingDirection);
|
||||
gPlayerAvatar.flags &= ~PLAYER_AVATAR_FLAG_6;
|
||||
gPlayerAvatar.flags &= ~PLAYER_AVATAR_FLAG_FORCED_MOVE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@ -441,7 +441,7 @@ static u8 DoForcedMovement(u8 direction, void (*b)(u8))
|
||||
struct PlayerAvatar *playerAvatar = &gPlayerAvatar;
|
||||
u8 collision = CheckForPlayerAvatarCollision(direction);
|
||||
|
||||
playerAvatar->flags |= PLAYER_AVATAR_FLAG_6;
|
||||
playerAvatar->flags |= PLAYER_AVATAR_FLAG_FORCED_MOVE;
|
||||
if (collision)
|
||||
{
|
||||
ForcedMovement_None();
|
||||
@ -453,7 +453,7 @@ static u8 DoForcedMovement(u8 direction, void (*b)(u8))
|
||||
{
|
||||
if (collision == COLLISION_LEDGE_JUMP)
|
||||
PlayerJumpLedge(direction);
|
||||
playerAvatar->flags |= PLAYER_AVATAR_FLAG_6;
|
||||
playerAvatar->flags |= PLAYER_AVATAR_FLAG_FORCED_MOVE;
|
||||
playerAvatar->runningState = MOVING;
|
||||
return 1;
|
||||
}
|
||||
@ -470,7 +470,7 @@ static u8 DoForcedMovementInCurrentDirection(void (*a)(u8))
|
||||
{
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
playerObjEvent->disableAnim = 1;
|
||||
playerObjEvent->disableAnim = TRUE;
|
||||
return DoForcedMovement(playerObjEvent->movementDirection, a);
|
||||
}
|
||||
|
||||
@ -519,12 +519,12 @@ static bool8 ForcedMovement_PushedEastByCurrent(void)
|
||||
return DoForcedMovement(DIR_EAST, PlayerRideWaterCurrent);
|
||||
}
|
||||
|
||||
u8 ForcedMovement_Slide(u8 direction, void (*b)(u8))
|
||||
static u8 ForcedMovement_Slide(u8 direction, void (*b)(u8))
|
||||
{
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
playerObjEvent->disableAnim = 1;
|
||||
playerObjEvent->facingDirectionLocked = 1;
|
||||
playerObjEvent->disableAnim = TRUE;
|
||||
playerObjEvent->facingDirectionLocked = TRUE;
|
||||
return DoForcedMovement(direction, b);
|
||||
}
|
||||
|
||||
@ -567,8 +567,8 @@ static bool8 ForcedMovement_MuddySlope(void)
|
||||
if (playerObjEvent->movementDirection != DIR_NORTH || GetPlayerSpeed() <= 3)
|
||||
{
|
||||
Bike_UpdateBikeCounterSpeed(0);
|
||||
playerObjEvent->facingDirectionLocked = 1;
|
||||
return DoForcedMovement(1, PlayerGoSpeed2);
|
||||
playerObjEvent->facingDirectionLocked = TRUE;
|
||||
return DoForcedMovement(DIR_SOUTH, PlayerGoSpeed2);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1328,7 +1328,7 @@ void ClearPlayerAvatarInfo(void)
|
||||
|
||||
void SetPlayerAvatarStateMask(u8 flags)
|
||||
{
|
||||
gPlayerAvatar.flags &= (PLAYER_AVATAR_FLAG_DASH | PLAYER_AVATAR_FLAG_6 | PLAYER_AVATAR_FLAG_5);
|
||||
gPlayerAvatar.flags &= (PLAYER_AVATAR_FLAG_DASH | PLAYER_AVATAR_FLAG_FORCED_MOVE | PLAYER_AVATAR_FLAG_5);
|
||||
gPlayerAvatar.flags |= flags;
|
||||
}
|
||||
|
||||
@ -1404,13 +1404,13 @@ void SetPlayerInvisibility(bool8 invisible)
|
||||
gSprites[gObjectEvents[gPlayerAvatar.objectEventId].fieldEffectSpriteId].invisible = invisible;
|
||||
}
|
||||
|
||||
void sub_808C114(void)
|
||||
void SetPlayerAvatarFieldMove(void)
|
||||
{
|
||||
ObjectEventSetGraphicsId(&gObjectEvents[gPlayerAvatar.objectEventId], GetPlayerAvatarGraphicsIdByStateId(PLAYER_AVATAR_STATE_FIELD_MOVE));
|
||||
StartSpriteAnim(&gSprites[gPlayerAvatar.spriteId], 0);
|
||||
}
|
||||
|
||||
void sub_808C15C(u8 direction)
|
||||
static void SetPlayerAvatarFishing(u8 direction)
|
||||
{
|
||||
ObjectEventSetGraphicsId(&gObjectEvents[gPlayerAvatar.objectEventId], GetPlayerAvatarGraphicsIdByStateId(PLAYER_AVATAR_STATE_FISHING));
|
||||
StartSpriteAnim(&gSprites[gPlayerAvatar.spriteId], GetFishingDirectionAnimNum(direction));
|
||||
@ -1423,7 +1423,7 @@ void PlayerUseAcroBikeOnBumpySlope(u8 direction)
|
||||
SeekSpriteAnim(&gSprites[gPlayerAvatar.spriteId], 1);
|
||||
}
|
||||
|
||||
void sub_808C228(u8 direction)
|
||||
void SetPlayerAvatarWatering(u8 direction)
|
||||
{
|
||||
ObjectEventSetGraphicsId(&gObjectEvents[gPlayerAvatar.objectEventId], GetPlayerAvatarGraphicsIdByStateId(PLAYER_AVATAR_STATE_WATERING));
|
||||
StartSpriteAnim(&gSprites[gPlayerAvatar.spriteId], GetFaceDirectionAnimNum(direction));
|
||||
@ -1739,8 +1739,8 @@ static bool8 Fishing2(struct Task *task)
|
||||
task->tPlayerGfxId = gObjectEvents[gPlayerAvatar.objectEventId].graphicsId;
|
||||
playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
ObjectEventClearHeldMovementIfActive(playerObjEvent);
|
||||
playerObjEvent->enableAnim = 1;
|
||||
sub_808C15C(playerObjEvent->facingDirection);
|
||||
playerObjEvent->enableAnim = TRUE;
|
||||
SetPlayerAvatarFishing(playerObjEvent->facingDirection);
|
||||
task->tStep++;
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ static void MCB2_InitRegionMapRegisters(void)
|
||||
InitWindows(sFieldRegionMapWindowTemplates);
|
||||
DeactivateAllTextPrinters();
|
||||
LoadUserWindowBorderGfx(0, 0x27, 0xd0);
|
||||
clear_scheduled_bg_copies_to_vram();
|
||||
ClearScheduledBgCopiesToVram();
|
||||
SetMainCallback2(MCB2_FieldUpdateRegionMap);
|
||||
SetVBlankCallback(VBCB_FieldUpdateRegionMap);
|
||||
}
|
||||
@ -134,7 +134,7 @@ static void MCB2_FieldUpdateRegionMap(void)
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
UpdatePaletteFade();
|
||||
do_scheduled_bg_tilemap_copies_to_vram();
|
||||
DoScheduledBgTilemapCopiesToVram();
|
||||
}
|
||||
|
||||
static void FieldUpdateRegionMap(void)
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "field_special_scene.h"
|
||||
#include "field_weather.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "io_reg.h"
|
||||
#include "link.h"
|
||||
#include "link_rfu.h"
|
||||
#include "load_save.h"
|
||||
@ -34,13 +35,11 @@
|
||||
#include "trainer_hill.h"
|
||||
#include "fldeff.h"
|
||||
|
||||
extern const u16 gOrbEffectBackgroundLayerFlags[];
|
||||
|
||||
// This file's functions.
|
||||
static void sub_8080B9C(u8);
|
||||
static void Task_ExitNonAnimDoor(u8);
|
||||
static void Task_ExitNonDoor(u8);
|
||||
static void task0A_fade_n_map_maybe(u8);
|
||||
static void Task_DoContestHallWarp(u8);
|
||||
static void sub_808115C(u8);
|
||||
static void FillPalBufferWhite(void);
|
||||
static void Task_ExitDoor(u8);
|
||||
@ -314,7 +313,7 @@ static void FieldCB_MossdeepGymWarpExit(void)
|
||||
PlaySE(SE_TK_WARPOUT);
|
||||
CreateTask(Task_ExitNonDoor, 10);
|
||||
ScriptContext2_Enable();
|
||||
sub_8085540(0xE);
|
||||
SetObjectEventLoadFlag((~SKIP_OBJECT_EVENT_LOAD) & 0xF);
|
||||
}
|
||||
|
||||
static void Task_ExitDoor(u8 taskId)
|
||||
@ -558,7 +557,7 @@ void DoTeleportWarp(void)
|
||||
|
||||
void DoMossdeepGymWarp(void)
|
||||
{
|
||||
sub_8085540(1);
|
||||
SetObjectEventLoadFlag(SKIP_OBJECT_EVENT_LOAD);
|
||||
ScriptContext2_Enable();
|
||||
SaveObjectEvents();
|
||||
TryFadeOutOldMapMusic();
|
||||
@ -576,19 +575,21 @@ void DoPortholeWarp(void)
|
||||
gFieldCallback = FieldCB_ShowPortholeView;
|
||||
}
|
||||
|
||||
static void sub_80AF8E0(u8 taskId)
|
||||
#define tState data[0]
|
||||
|
||||
static void Task_DoCableClubWarp(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
switch (task->data[0])
|
||||
switch (task->tState)
|
||||
{
|
||||
case 0:
|
||||
ScriptContext2_Enable();
|
||||
task->data[0]++;
|
||||
task->tState++;
|
||||
break;
|
||||
case 1:
|
||||
if (!PaletteFadeActive() && BGMusicStopped())
|
||||
task->data[0]++;
|
||||
task->tState++;
|
||||
break;
|
||||
case 2:
|
||||
WarpIntoMap();
|
||||
@ -598,13 +599,15 @@ static void sub_80AF8E0(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
#undef tState
|
||||
|
||||
void DoCableClubWarp(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
TryFadeOutOldMapMusic();
|
||||
WarpFadeOutScreen();
|
||||
PlaySE(SE_KAIDAN);
|
||||
CreateTask(sub_80AF8E0, 10);
|
||||
CreateTask(Task_DoCableClubWarp, 10);
|
||||
}
|
||||
|
||||
static void Task_ReturnToWorldFromLinkRoom(u8 taskId)
|
||||
@ -727,7 +730,7 @@ static void Task_DoDoorWarp(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
static void task0A_fade_n_map_maybe(u8 taskId)
|
||||
static void Task_DoContestHallWarp(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
@ -746,7 +749,7 @@ static void task0A_fade_n_map_maybe(u8 taskId)
|
||||
break;
|
||||
case 2:
|
||||
WarpIntoMap();
|
||||
SetMainCallback2(sub_8086024);
|
||||
SetMainCallback2(CB2_ReturnToFieldContestHall);
|
||||
DestroyTask(taskId);
|
||||
break;
|
||||
}
|
||||
@ -760,7 +763,7 @@ void DoContestHallWarp(void)
|
||||
PlayRainStoppingSoundEffect();
|
||||
PlaySE(SE_KAIDAN);
|
||||
gFieldCallback = FieldCB_WarpExitFadeFromBlack;
|
||||
CreateTask(task0A_fade_n_map_maybe, 10);
|
||||
CreateTask(Task_DoContestHallWarp, 10);
|
||||
}
|
||||
|
||||
static void SetFlashScanlineEffectWindowBoundary(u16 *dest, u32 y, s32 left, s32 right)
|
||||
|
@ -943,7 +943,7 @@ static bool8 SkipCopyingMetatileFromSavedMap(u16* mapMetatilePtr, u16 mapWidth,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void copy_tileset_patterns_to_vram(struct Tileset const *tileset, u16 numTiles, u16 offset)
|
||||
static void CopyTilesetToVram(struct Tileset const *tileset, u16 numTiles, u16 offset)
|
||||
{
|
||||
if (tileset)
|
||||
{
|
||||
@ -954,7 +954,7 @@ void copy_tileset_patterns_to_vram(struct Tileset const *tileset, u16 numTiles,
|
||||
}
|
||||
}
|
||||
|
||||
void copy_tileset_patterns_to_vram2(struct Tileset const *tileset, u16 numTiles, u16 offset)
|
||||
static void CopyTilesetToVramUsingHeap(struct Tileset const *tileset, u16 numTiles, u16 offset)
|
||||
{
|
||||
if (tileset)
|
||||
{
|
||||
@ -975,7 +975,7 @@ void nullsub_90(void)
|
||||
|
||||
}
|
||||
|
||||
void apply_map_tileset_palette(struct Tileset const *tileset, u16 destOffset, u16 size)
|
||||
void LoadTilesetPalette(struct Tileset const *tileset, u16 destOffset, u16 size)
|
||||
{
|
||||
u16 black = RGB_BLACK;
|
||||
|
||||
@ -1000,45 +1000,45 @@ void apply_map_tileset_palette(struct Tileset const *tileset, u16 destOffset, u1
|
||||
}
|
||||
}
|
||||
|
||||
void copy_map_tileset1_to_vram(struct MapLayout const *mapLayout)
|
||||
void CopyPrimaryTilesetToVram(struct MapLayout const *mapLayout)
|
||||
{
|
||||
copy_tileset_patterns_to_vram(mapLayout->primaryTileset, NUM_TILES_IN_PRIMARY, 0);
|
||||
CopyTilesetToVram(mapLayout->primaryTileset, NUM_TILES_IN_PRIMARY, 0);
|
||||
}
|
||||
|
||||
void copy_map_tileset2_to_vram(struct MapLayout const *mapLayout)
|
||||
void CopySecondaryTilesetToVram(struct MapLayout const *mapLayout)
|
||||
{
|
||||
copy_tileset_patterns_to_vram(mapLayout->secondaryTileset, NUM_TILES_TOTAL - NUM_TILES_IN_PRIMARY, NUM_TILES_IN_PRIMARY);
|
||||
CopyTilesetToVram(mapLayout->secondaryTileset, NUM_TILES_TOTAL - NUM_TILES_IN_PRIMARY, NUM_TILES_IN_PRIMARY);
|
||||
}
|
||||
|
||||
void copy_map_tileset2_to_vram_2(struct MapLayout const *mapLayout)
|
||||
void CopySecondaryTilesetToVramUsingHeap(struct MapLayout const *mapLayout)
|
||||
{
|
||||
copy_tileset_patterns_to_vram2(mapLayout->secondaryTileset, NUM_TILES_TOTAL - NUM_TILES_IN_PRIMARY, NUM_TILES_IN_PRIMARY);
|
||||
CopyTilesetToVramUsingHeap(mapLayout->secondaryTileset, NUM_TILES_TOTAL - NUM_TILES_IN_PRIMARY, NUM_TILES_IN_PRIMARY);
|
||||
}
|
||||
|
||||
void apply_map_tileset1_palette(struct MapLayout const *mapLayout)
|
||||
static void LoadPrimaryTilesetPalette(struct MapLayout const *mapLayout)
|
||||
{
|
||||
apply_map_tileset_palette(mapLayout->primaryTileset, 0, NUM_PALS_IN_PRIMARY * 16 * 2);
|
||||
LoadTilesetPalette(mapLayout->primaryTileset, 0, NUM_PALS_IN_PRIMARY * 16 * 2);
|
||||
}
|
||||
|
||||
void apply_map_tileset2_palette(struct MapLayout const *mapLayout)
|
||||
void LoadSecondaryTilesetPalette(struct MapLayout const *mapLayout)
|
||||
{
|
||||
apply_map_tileset_palette(mapLayout->secondaryTileset, NUM_PALS_IN_PRIMARY * 16, (NUM_PALS_TOTAL - NUM_PALS_IN_PRIMARY) * 16 * 2);
|
||||
LoadTilesetPalette(mapLayout->secondaryTileset, NUM_PALS_IN_PRIMARY * 16, (NUM_PALS_TOTAL - NUM_PALS_IN_PRIMARY) * 16 * 2);
|
||||
}
|
||||
|
||||
void copy_map_tileset1_tileset2_to_vram(struct MapLayout const *mapLayout)
|
||||
void CopyMapTilesetsToVram(struct MapLayout const *mapLayout)
|
||||
{
|
||||
if (mapLayout)
|
||||
{
|
||||
copy_tileset_patterns_to_vram2(mapLayout->primaryTileset, NUM_TILES_IN_PRIMARY, 0);
|
||||
copy_tileset_patterns_to_vram2(mapLayout->secondaryTileset, NUM_TILES_TOTAL - NUM_TILES_IN_PRIMARY, NUM_TILES_IN_PRIMARY);
|
||||
CopyTilesetToVramUsingHeap(mapLayout->primaryTileset, NUM_TILES_IN_PRIMARY, 0);
|
||||
CopyTilesetToVramUsingHeap(mapLayout->secondaryTileset, NUM_TILES_TOTAL - NUM_TILES_IN_PRIMARY, NUM_TILES_IN_PRIMARY);
|
||||
}
|
||||
}
|
||||
|
||||
void apply_map_tileset1_tileset2_palette(struct MapLayout const *mapLayout)
|
||||
void LoadMapTilesetPalettes(struct MapLayout const *mapLayout)
|
||||
{
|
||||
if (mapLayout)
|
||||
{
|
||||
apply_map_tileset1_palette(mapLayout);
|
||||
apply_map_tileset2_palette(mapLayout);
|
||||
LoadPrimaryTilesetPalette(mapLayout);
|
||||
LoadSecondaryTilesetPalette(mapLayout);
|
||||
}
|
||||
}
|
||||
|
@ -281,7 +281,7 @@ static void FieldCallback_CutGrass(void)
|
||||
|
||||
bool8 FldEff_UseCutOnGrass(void)
|
||||
{
|
||||
u8 taskId = oei_task_add();
|
||||
u8 taskId = CreateFieldMoveTask();
|
||||
|
||||
gTasks[taskId].data[8] = (u32)StartCutGrassFieldEffect >> 16;
|
||||
gTasks[taskId].data[9] = (u32)StartCutGrassFieldEffect;
|
||||
@ -297,7 +297,7 @@ static void FieldCallback_CutTree(void)
|
||||
|
||||
bool8 FldEff_UseCutOnTree(void)
|
||||
{
|
||||
u8 taskId = oei_task_add();
|
||||
u8 taskId = CreateFieldMoveTask();
|
||||
|
||||
gTasks[taskId].data[8] = (u32)StartCutTreeFieldEffect >> 16;
|
||||
gTasks[taskId].data[9] = (u32)StartCutTreeFieldEffect;
|
||||
|
@ -37,7 +37,7 @@ static void hm2_dig(void)
|
||||
|
||||
bool8 FldEff_UseDig(void)
|
||||
{
|
||||
u8 taskId = oei_task_add();
|
||||
u8 taskId = CreateFieldMoveTask();
|
||||
|
||||
gTasks[taskId].data[8] = (u32)sub_8135780 >> 16;
|
||||
gTasks[taskId].data[9] = (u32)sub_8135780;
|
||||
|
@ -8,161 +8,188 @@
|
||||
|
||||
static EWRAM_DATA u8 sEscalatorAnim_TaskId = 0;
|
||||
|
||||
static void sub_80E12E8(u8 taskId, const s16 *list, u16 isImpassableFlag)
|
||||
{
|
||||
s16 r5 = gTasks[taskId].data[4] - 1;
|
||||
s16 r3 = gTasks[taskId].data[5] - 1;
|
||||
s16 r4 = gTasks[taskId].data[1];
|
||||
s16 y;
|
||||
s16 x;
|
||||
static void SetEscalatorMetatile(u8 taskId, const s16 *metatileIds, u16 metatileMasks);
|
||||
static void Task_DrawEscalator(u8 taskId);
|
||||
static void Task_DrawTeleporterHousing(u8 taskId);
|
||||
static void Task_DrawTeleporterCable(u8 taskId);
|
||||
|
||||
if (gTasks[taskId].data[2] == 0)
|
||||
{
|
||||
for (y = 0; y < 3; y++)
|
||||
{
|
||||
for (x = 0; x < 3; x++)
|
||||
{
|
||||
s16 metatileId = MapGridGetMetatileIdAt(r5 + x, r3 + y);
|
||||
#define ESCALATOR_STAGES 3
|
||||
#define LAST_ESCALATOR_STAGE (ESCALATOR_STAGES - 1)
|
||||
|
||||
if (list[r4] == metatileId)
|
||||
{
|
||||
if (r4 != 2)
|
||||
MapGridSetMetatileIdAt(r5 + x, r3 + y, isImpassableFlag | list[r4 + 1]);
|
||||
else
|
||||
MapGridSetMetatileIdAt(r5 + x, r3 + y, isImpassableFlag | list[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (y = 0; y < 3; y++)
|
||||
{
|
||||
for (x = 0; x < 3; x++)
|
||||
{
|
||||
s16 metatileId = MapGridGetMetatileIdAt(r5 + x, r3 + y);
|
||||
|
||||
if (list[2 - r4] == metatileId)
|
||||
{
|
||||
if (r4 != 2)
|
||||
MapGridSetMetatileIdAt(r5 + x, r3 + y, isImpassableFlag | list[1 - r4]);
|
||||
else
|
||||
MapGridSetMetatileIdAt(r5 + x, r3 + y, isImpassableFlag | list[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const u16 sElevatorMetatiles_1F_0[] = {
|
||||
static const u16 sElevatorMetatiles_1F_0[ESCALATOR_STAGES] = {
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile0_Frame2),
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile0_Frame1),
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile0_Frame0)
|
||||
};
|
||||
|
||||
static const u16 sElevatorMetatiles_1F_1[] = {
|
||||
static const u16 sElevatorMetatiles_1F_1[ESCALATOR_STAGES] = {
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile1_Frame2),
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile1_Frame1),
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile1_Frame0)
|
||||
};
|
||||
|
||||
static const u16 sElevatorMetatiles_1F_2[] = {
|
||||
static const u16 sElevatorMetatiles_1F_2[ESCALATOR_STAGES] = {
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile2_Frame2),
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile2_Frame1),
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile2_Frame0)
|
||||
};
|
||||
|
||||
static const u16 sElevatorMetatiles_1F_3[] = {
|
||||
static const u16 sElevatorMetatiles_1F_3[ESCALATOR_STAGES] = {
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile3_Frame2),
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile3_Frame1),
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile3_Frame0)
|
||||
};
|
||||
|
||||
static const u16 sElevatorMetatiles_2F_0[] = {
|
||||
static const u16 sElevatorMetatiles_2F_0[ESCALATOR_STAGES] = {
|
||||
METATILE_ID(PokemonCenter, Elevator2F_Tile0_Frame0),
|
||||
METATILE_ID(PokemonCenter, Elevator2F_Tile0_Frame1),
|
||||
METATILE_ID(PokemonCenter, Elevator2F_Tile0_Frame2)
|
||||
};
|
||||
|
||||
static const u16 sElevatorMetatiles_2F_1[] = {
|
||||
static const u16 sElevatorMetatiles_2F_1[ESCALATOR_STAGES] = {
|
||||
METATILE_ID(PokemonCenter, Elevator2F_Tile1_Frame0),
|
||||
METATILE_ID(PokemonCenter, Elevator2F_Tile1_Frame1),
|
||||
METATILE_ID(PokemonCenter, Elevator2F_Tile1_Frame2)
|
||||
};
|
||||
|
||||
static const u16 sElevatorMetatiles_2F_2[] = {
|
||||
static const u16 sElevatorMetatiles_2F_2[ESCALATOR_STAGES] = {
|
||||
METATILE_ID(PokemonCenter, Elevator2F_Tile2_Frame0),
|
||||
METATILE_ID(PokemonCenter, Elevator2F_Tile2_Frame1),
|
||||
METATILE_ID(PokemonCenter, Elevator2F_Tile2_Frame2)
|
||||
};
|
||||
|
||||
static void sub_80E1444(u8 taskId)
|
||||
#define tState data[0]
|
||||
#define tTransitionStage data[1]
|
||||
#define tGoingUp data[2]
|
||||
#define tDrawingEscalator data[3]
|
||||
#define tPlayerX data[4]
|
||||
#define tPlayerY data[5]
|
||||
|
||||
static void SetEscalatorMetatile(u8 taskId, const s16 *metatileIds, u16 metatileMasks)
|
||||
{
|
||||
s16 *data = gTasks[taskId].data;
|
||||
s16 x = gTasks[taskId].tPlayerX - 1;
|
||||
s16 y = gTasks[taskId].tPlayerY - 1;
|
||||
s16 transitionStage = gTasks[taskId].tTransitionStage;
|
||||
s16 i;
|
||||
s16 j;
|
||||
|
||||
data[3] = 1;
|
||||
|
||||
switch (data[0])
|
||||
// Check all the escalator sections and only progress the selected one to the next stage
|
||||
if (!gTasks[taskId].tGoingUp)
|
||||
{
|
||||
case 0:
|
||||
sub_80E12E8(taskId, sElevatorMetatiles_1F_0, 0);
|
||||
break;
|
||||
case 1:
|
||||
sub_80E12E8(taskId, sElevatorMetatiles_1F_1, 0);
|
||||
break;
|
||||
case 2:
|
||||
sub_80E12E8(taskId, sElevatorMetatiles_1F_2, METATILE_COLLISION_MASK);
|
||||
break;
|
||||
case 3:
|
||||
sub_80E12E8(taskId, sElevatorMetatiles_1F_3, 0);
|
||||
break;
|
||||
case 4:
|
||||
sub_80E12E8(taskId, sElevatorMetatiles_2F_0, METATILE_COLLISION_MASK);
|
||||
break;
|
||||
case 5:
|
||||
sub_80E12E8(taskId, sElevatorMetatiles_2F_1, 0);
|
||||
break;
|
||||
case 6:
|
||||
sub_80E12E8(taskId, sElevatorMetatiles_2F_2, 0);
|
||||
break;
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
for (j = 0; j < 3; j++)
|
||||
{
|
||||
s16 metatileId = MapGridGetMetatileIdAt(x + j, y + i);
|
||||
|
||||
if (metatileIds[transitionStage] == metatileId)
|
||||
{
|
||||
if (transitionStage != LAST_ESCALATOR_STAGE)
|
||||
MapGridSetMetatileIdAt(x + j, y + i, metatileMasks | metatileIds[transitionStage + 1]);
|
||||
else
|
||||
MapGridSetMetatileIdAt(x + j, y + i, metatileMasks | metatileIds[0]);
|
||||
}
|
||||
|
||||
data[0] = (data[0] + 1) & 7;
|
||||
if (!data[0])
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawWholeMapView();
|
||||
data[1] = (data[1] + 1) % 3;
|
||||
data[3] = 0;
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
for (j = 0; j < 3; j++)
|
||||
{
|
||||
s16 metatileId = MapGridGetMetatileIdAt(x + j, y + i);
|
||||
|
||||
if (metatileIds[LAST_ESCALATOR_STAGE - transitionStage] == metatileId)
|
||||
{
|
||||
if (transitionStage != LAST_ESCALATOR_STAGE)
|
||||
MapGridSetMetatileIdAt(x + j, y + i, metatileMasks | metatileIds[1 - transitionStage]);
|
||||
else
|
||||
MapGridSetMetatileIdAt(x + j, y + i, metatileMasks | metatileIds[LAST_ESCALATOR_STAGE]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static u8 sub_80E150C(u16 var)
|
||||
static void Task_DrawEscalator(u8 taskId)
|
||||
{
|
||||
u8 taskId = CreateTask(sub_80E1444, 0);
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
PlayerGetDestCoords(&data[4], &data[5]);
|
||||
data[0] = 0;
|
||||
data[1] = 0;
|
||||
data[2] = var;
|
||||
sub_80E1444(taskId);
|
||||
tDrawingEscalator = TRUE;
|
||||
|
||||
// Set tile for each section of the escalator in sequence for current transition stage
|
||||
switch (tState)
|
||||
{
|
||||
case 0:
|
||||
SetEscalatorMetatile(taskId, sElevatorMetatiles_1F_0, 0);
|
||||
break;
|
||||
case 1:
|
||||
SetEscalatorMetatile(taskId, sElevatorMetatiles_1F_1, 0);
|
||||
break;
|
||||
case 2:
|
||||
SetEscalatorMetatile(taskId, sElevatorMetatiles_1F_2, METATILE_COLLISION_MASK);
|
||||
break;
|
||||
case 3:
|
||||
SetEscalatorMetatile(taskId, sElevatorMetatiles_1F_3, 0);
|
||||
break;
|
||||
case 4:
|
||||
SetEscalatorMetatile(taskId, sElevatorMetatiles_2F_0, METATILE_COLLISION_MASK);
|
||||
break;
|
||||
case 5:
|
||||
SetEscalatorMetatile(taskId, sElevatorMetatiles_2F_1, 0);
|
||||
break;
|
||||
case 6:
|
||||
SetEscalatorMetatile(taskId, sElevatorMetatiles_2F_2, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
tState = (tState + 1) & 7;
|
||||
|
||||
// If all metatiles of the escalator have been set, draw map and progress to next stage
|
||||
if (tState == 0)
|
||||
{
|
||||
DrawWholeMapView();
|
||||
tTransitionStage = (tTransitionStage + 1) % ESCALATOR_STAGES;
|
||||
tDrawingEscalator = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static u8 CreateEscalatorTask(bool16 goingUp)
|
||||
{
|
||||
u8 taskId = CreateTask(Task_DrawEscalator, 0);
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
PlayerGetDestCoords(&tPlayerX, &tPlayerY);
|
||||
tState = 0;
|
||||
tTransitionStage = 0;
|
||||
tGoingUp = goingUp;
|
||||
Task_DrawEscalator(taskId);
|
||||
return taskId;
|
||||
}
|
||||
|
||||
void sub_80E1558(u8 var)
|
||||
void StartEscalator(bool8 goingUp)
|
||||
{
|
||||
sEscalatorAnim_TaskId = sub_80E150C(var);
|
||||
sEscalatorAnim_TaskId = CreateEscalatorTask(goingUp);
|
||||
}
|
||||
|
||||
void sub_80E1570(void)
|
||||
void StopEscalator(void)
|
||||
{
|
||||
DestroyTask(sEscalatorAnim_TaskId);
|
||||
}
|
||||
|
||||
bool8 sub_80E1584(void)
|
||||
bool8 IsEscalatorMoving(void)
|
||||
{
|
||||
if (gTasks[sEscalatorAnim_TaskId].data[3] == 0 && gTasks[sEscalatorAnim_TaskId].data[1] == 2)
|
||||
if (gTasks[sEscalatorAnim_TaskId].tDrawingEscalator == FALSE
|
||||
&& gTasks[sEscalatorAnim_TaskId].tTransitionStage == LAST_ESCALATOR_STAGE)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#undef tState
|
||||
#undef tTransitionStage
|
||||
#undef tGoingUp
|
||||
#undef tDrawingEscalator
|
||||
#undef tPlayerX
|
||||
#undef tPlayerY
|
||||
|
@ -96,7 +96,7 @@ bool8 SetUpFieldMove_Flash(void)
|
||||
|
||||
static void FieldCallback_Flash(void)
|
||||
{
|
||||
u8 taskId = oei_task_add();
|
||||
u8 taskId = CreateFieldMoveTask();
|
||||
gFieldEffectArguments[0] = GetCursorSelectionMonId();
|
||||
gTasks[taskId].data[8] = (uintptr_t)FldEff_UseFlash >> 16;
|
||||
gTasks[taskId].data[9] = (uintptr_t)FldEff_UseFlash;
|
||||
|
@ -497,7 +497,7 @@ static void SetCurrentSecretBase(void)
|
||||
|
||||
static void AdjustSecretPowerSpritePixelOffsets(void)
|
||||
{
|
||||
if (gPlayerAvatar.flags & 0x6)
|
||||
if (gPlayerAvatar.flags & (PLAYER_AVATAR_FLAG_MACH_BIKE | PLAYER_AVATAR_FLAG_ACRO_BIKE))
|
||||
{
|
||||
switch (gFieldEffectArguments[1])
|
||||
{
|
||||
@ -590,7 +590,7 @@ static void FieldCallback_SecretBaseCave(void)
|
||||
|
||||
bool8 FldEff_UseSecretPowerCave(void)
|
||||
{
|
||||
u8 taskId = oei_task_add();
|
||||
u8 taskId = CreateFieldMoveTask();
|
||||
|
||||
gTasks[taskId].data[8] = (u32)StartSecretBaseCaveFieldEffect >> 16;
|
||||
gTasks[taskId].data[9] = (u32)StartSecretBaseCaveFieldEffect;
|
||||
@ -650,7 +650,7 @@ static void FieldCallback_SecretBaseTree(void)
|
||||
|
||||
bool8 FldEff_UseSecretPowerTree(void)
|
||||
{
|
||||
u8 taskId = oei_task_add();
|
||||
u8 taskId = CreateFieldMoveTask();
|
||||
|
||||
gTasks[taskId].data[8] = (u32)StartSecretBaseTreeFieldEffect >> 16;
|
||||
gTasks[taskId].data[9] = (u32)StartSecretBaseTreeFieldEffect;
|
||||
@ -724,7 +724,7 @@ static void FieldCallback_SecretBaseShrub(void)
|
||||
|
||||
bool8 FldEff_UseSecretPowerShrub(void)
|
||||
{
|
||||
u8 taskId = oei_task_add();
|
||||
u8 taskId = CreateFieldMoveTask();
|
||||
|
||||
gTasks[taskId].data[8] = (u32)StartSecretBaseShrubFieldEffect >> 16;
|
||||
gTasks[taskId].data[9] = (u32)StartSecretBaseShrubFieldEffect;
|
||||
@ -1010,7 +1010,7 @@ void DoSecretBaseGlitterMatSparkle(void)
|
||||
|
||||
sub_80930E0(&x, &y, 8, 4);
|
||||
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[22], x, y, 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SPARKLE], x, y, 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
gSprites[spriteId].coordOffsetEnabled = TRUE;
|
||||
@ -1236,7 +1236,7 @@ static void Task_WateringBerryTreeAnim_1(u8 taskId)
|
||||
if (!ObjectEventIsMovementOverridden(playerObjEvent)
|
||||
|| ObjectEventClearHeldMovementIfFinished(playerObjEvent))
|
||||
{
|
||||
sub_808C228(GetPlayerFacingDirection());
|
||||
SetPlayerAvatarWatering(GetPlayerFacingDirection());
|
||||
ObjectEventSetHeldMovement(playerObjEvent, GetWalkInPlaceNormalMovementAction(GetPlayerFacingDirection()));
|
||||
gTasks[taskId].func = Task_WateringBerryTreeAnim_2;
|
||||
}
|
||||
|
@ -20,11 +20,12 @@
|
||||
#include "constants/songs.h"
|
||||
|
||||
// static functions
|
||||
static void task08_080C9820(u8 taskId);
|
||||
static void sub_8135578(u8 taskId);
|
||||
static void sub_813552C(u8 taskId);
|
||||
static void sub_813561C(u8 taskId);
|
||||
static void sub_81356C4(void);
|
||||
static void Task_DoFieldMove_0(u8 taskId);
|
||||
static void Task_DoFieldMove_1(u8 taskId);
|
||||
static void Task_DoFieldMove_2(u8 taskId);
|
||||
static void Task_DoFieldMove_3(u8 taskId);
|
||||
|
||||
static void FieldCallback_RockSmash(void);
|
||||
static void sub_8135714(void);
|
||||
|
||||
// text
|
||||
@ -46,13 +47,13 @@ bool8 CheckObjectGraphicsInFrontOfPlayer(u8 graphicsId)
|
||||
}
|
||||
}
|
||||
|
||||
u8 oei_task_add(void)
|
||||
u8 CreateFieldMoveTask(void)
|
||||
{
|
||||
GetXYCoordsOneStepInFrontOfPlayer(&gPlayerFacingPosition.x, &gPlayerFacingPosition.y);
|
||||
return CreateTask(task08_080C9820, 8);
|
||||
return CreateTask(Task_DoFieldMove_0, 8);
|
||||
}
|
||||
|
||||
static void task08_080C9820(u8 taskId)
|
||||
static void Task_DoFieldMove_0(u8 taskId)
|
||||
{
|
||||
u8 objEventId;
|
||||
|
||||
@ -65,47 +66,47 @@ static void task08_080C9820(u8 taskId)
|
||||
if (gMapHeader.mapType == MAP_TYPE_UNDERWATER)
|
||||
{
|
||||
FieldEffectStart(FLDEFF_FIELD_MOVE_SHOW_MON_INIT);
|
||||
gTasks[taskId].func = sub_8135578;
|
||||
gTasks[taskId].func = Task_DoFieldMove_2;
|
||||
}
|
||||
else
|
||||
{
|
||||
sub_808C114();
|
||||
SetPlayerAvatarFieldMove();
|
||||
ObjectEventSetHeldMovement(&gObjectEvents[objEventId], MOVEMENT_ACTION_START_ANIM_IN_DIRECTION);
|
||||
gTasks[taskId].func = sub_813552C;
|
||||
gTasks[taskId].func = Task_DoFieldMove_1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_813552C(u8 taskId)
|
||||
static void Task_DoFieldMove_1(u8 taskId)
|
||||
{
|
||||
if (ObjectEventCheckHeldMovementStatus(&gObjectEvents[gPlayerAvatar.objectEventId]) == TRUE)
|
||||
{
|
||||
FieldEffectStart(FLDEFF_FIELD_MOVE_SHOW_MON_INIT);
|
||||
gTasks[taskId].func = sub_8135578;
|
||||
gTasks[taskId].func = Task_DoFieldMove_2;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8135578(u8 taskId)
|
||||
static void Task_DoFieldMove_2(u8 taskId)
|
||||
{
|
||||
if (!FieldEffectActiveListContains(FLDEFF_FIELD_MOVE_SHOW_MON))
|
||||
{
|
||||
gFieldEffectArguments[1] = GetPlayerFacingDirection();
|
||||
if (gFieldEffectArguments[1] == 1)
|
||||
if (gFieldEffectArguments[1] == DIR_SOUTH)
|
||||
gFieldEffectArguments[2] = 0;
|
||||
if (gFieldEffectArguments[1] == 2)
|
||||
if (gFieldEffectArguments[1] == DIR_NORTH)
|
||||
gFieldEffectArguments[2] = 1;
|
||||
if (gFieldEffectArguments[1] == 3)
|
||||
if (gFieldEffectArguments[1] == DIR_WEST)
|
||||
gFieldEffectArguments[2] = 2;
|
||||
if (gFieldEffectArguments[1] == 4)
|
||||
if (gFieldEffectArguments[1] == DIR_EAST)
|
||||
gFieldEffectArguments[2] = 3;
|
||||
ObjectEventSetGraphicsId(&gObjectEvents[gPlayerAvatar.objectEventId], GetPlayerAvatarGraphicsIdByCurrentState());
|
||||
StartSpriteAnim(&gSprites[gPlayerAvatar.spriteId], gFieldEffectArguments[2]);
|
||||
FieldEffectActiveListRemove(6);
|
||||
gTasks[taskId].func = sub_813561C;
|
||||
FieldEffectActiveListRemove(FLDEFF_FIELD_MOVE_SHOW_MON);
|
||||
gTasks[taskId].func = Task_DoFieldMove_3;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_813561C(u8 taskId)
|
||||
static void Task_DoFieldMove_3(u8 taskId)
|
||||
{
|
||||
void (*func)(void) = (void (*)(void))(((u16)gTasks[taskId].data[8] << 16) | (u16)gTasks[taskId].data[9]);
|
||||
|
||||
@ -128,7 +129,7 @@ bool8 SetUpFieldMove_RockSmash(void)
|
||||
else if (CheckObjectGraphicsInFrontOfPlayer(OBJ_EVENT_GFX_BREAKABLE_ROCK) == TRUE)
|
||||
{
|
||||
gFieldCallback2 = FieldCallback_PrepareFadeInFromMenu;
|
||||
gPostMenuFieldCallback = sub_81356C4;
|
||||
gPostMenuFieldCallback = FieldCallback_RockSmash;
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
@ -137,7 +138,7 @@ bool8 SetUpFieldMove_RockSmash(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_81356C4(void)
|
||||
static void FieldCallback_RockSmash(void)
|
||||
{
|
||||
gFieldEffectArguments[0] = GetCursorSelectionMonId();
|
||||
ScriptContext1_SetupScript(EventScript_FldEffRockSmash);
|
||||
@ -145,7 +146,7 @@ static void sub_81356C4(void)
|
||||
|
||||
bool8 FldEff_UseRockSmash(void)
|
||||
{
|
||||
u8 taskId = oei_task_add();
|
||||
u8 taskId = CreateFieldMoveTask();
|
||||
|
||||
gTasks[taskId].data[8] = (u32)sub_8135714 >> 16;
|
||||
gTasks[taskId].data[9] = (u32)sub_8135714;
|
||||
|
@ -35,7 +35,7 @@ static void FldEff_UseStrength(void)
|
||||
|
||||
bool8 sub_8145E2C(void)
|
||||
{
|
||||
u8 taskId = oei_task_add();
|
||||
u8 taskId = CreateFieldMoveTask();
|
||||
gTasks[taskId].data[8] = (u32)sub_8145E74 >> 16;
|
||||
gTasks[taskId].data[9] = (u32)sub_8145E74;
|
||||
GetMonNickname(&gPlayerParty[gFieldEffectArguments[0]], gStringVar1);
|
||||
|
@ -41,7 +41,7 @@ bool8 FldEff_SweetScent(void)
|
||||
u8 taskId;
|
||||
|
||||
SetWeatherScreenFadeOut();
|
||||
taskId = oei_task_add();
|
||||
taskId = CreateFieldMoveTask();
|
||||
gTasks[taskId].data[8] = (u32)StartSweetScentFieldEffect >> 16;
|
||||
gTasks[taskId].data[9] = (u32)StartSweetScentFieldEffect;
|
||||
return FALSE;
|
||||
|
@ -30,7 +30,7 @@ static void FieldCallback_Teleport(void)
|
||||
|
||||
bool8 FldEff_UseTeleport(void)
|
||||
{
|
||||
u8 taskId = oei_task_add();
|
||||
u8 taskId = CreateFieldMoveTask();
|
||||
gTasks[taskId].data[8] = (u32)StartTeleportFieldEffect >> 16;
|
||||
gTasks[taskId].data[9] = (u32)StartTeleportFieldEffect;
|
||||
SetPlayerAvatarTransitionFlags(PLAYER_AVATAR_FLAG_ON_FOOT);
|
||||
@ -40,5 +40,5 @@ bool8 FldEff_UseTeleport(void)
|
||||
static void StartTeleportFieldEffect(void)
|
||||
{
|
||||
FieldEffectActiveListRemove(FLDEFF_USE_TELEPORT);
|
||||
CreateTeleportFieldEffectTask();
|
||||
FldEff_TeleportWarpOut();
|
||||
}
|
||||
|
@ -1299,7 +1299,7 @@ static bool8 sub_8175024(void)
|
||||
break;
|
||||
case 3:
|
||||
InitStandardTextBoxWindows();
|
||||
sub_8197200();
|
||||
InitTextBoxGfxAndPrinters();
|
||||
break;
|
||||
case 4:
|
||||
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_1D_MAP | DISPCNT_OBJ_ON);
|
||||
|
@ -600,7 +600,7 @@ void CB2_BagMenuRun(void)
|
||||
RunTasks();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
do_scheduled_bg_tilemap_copies_to_vram();
|
||||
DoScheduledBgTilemapCopiesToVram();
|
||||
UpdatePaletteFade();
|
||||
}
|
||||
|
||||
@ -627,7 +627,7 @@ bool8 SetupBagMenu(void)
|
||||
{
|
||||
case 0:
|
||||
SetVBlankHBlankCallbacksToNull();
|
||||
clear_scheduled_bg_copies_to_vram();
|
||||
ClearScheduledBgCopiesToVram();
|
||||
gMain.state++;
|
||||
break;
|
||||
case 1:
|
||||
|
50
src/menu.c
@ -57,9 +57,9 @@ static EWRAM_DATA u8 sPaletteNum = 0;
|
||||
static EWRAM_DATA u8 sYesNoWindowId = 0;
|
||||
static EWRAM_DATA u8 sWindowId = 0;
|
||||
static EWRAM_DATA u16 sFiller = 0; // needed to align
|
||||
static EWRAM_DATA bool8 gUnknown_0203CDA4[4] = {FALSE};
|
||||
static EWRAM_DATA u16 gUnknown_0203CDA8 = 0;
|
||||
static EWRAM_DATA void *gUnknown_0203CDAC[0x20] = {NULL};
|
||||
static EWRAM_DATA bool8 sScheduledBgCopiesToVram[4] = {FALSE};
|
||||
static EWRAM_DATA u16 sTempTileDataBufferIdx = 0;
|
||||
static EWRAM_DATA void *sTempTileDataBuffer[0x20] = {NULL};
|
||||
|
||||
const u16 gUnknown_0860F074[] = INCBIN_U16("graphics/interface/860F074.gbapal");
|
||||
|
||||
@ -154,7 +154,7 @@ void FreeAllOverworldWindowBuffers(void)
|
||||
FreeAllWindowBuffers();
|
||||
}
|
||||
|
||||
void sub_8197200(void)
|
||||
void InitTextBoxGfxAndPrinters(void)
|
||||
{
|
||||
ChangeBgX(0, 0, 0);
|
||||
ChangeBgY(0, 0, 0);
|
||||
@ -1737,48 +1737,48 @@ u8 sub_8199944(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initialCurso
|
||||
return sMenu.cursorPos;
|
||||
}
|
||||
|
||||
void clear_scheduled_bg_copies_to_vram(void)
|
||||
void ClearScheduledBgCopiesToVram(void)
|
||||
{
|
||||
memset(gUnknown_0203CDA4, 0, sizeof(gUnknown_0203CDA4));
|
||||
memset(sScheduledBgCopiesToVram, 0, sizeof(sScheduledBgCopiesToVram));
|
||||
}
|
||||
|
||||
void ScheduleBgCopyTilemapToVram(u8 bgId)
|
||||
{
|
||||
gUnknown_0203CDA4[bgId] = TRUE;
|
||||
sScheduledBgCopiesToVram[bgId] = TRUE;
|
||||
}
|
||||
|
||||
void do_scheduled_bg_tilemap_copies_to_vram(void)
|
||||
void DoScheduledBgTilemapCopiesToVram(void)
|
||||
{
|
||||
if (gUnknown_0203CDA4[0] == TRUE)
|
||||
if (sScheduledBgCopiesToVram[0] == TRUE)
|
||||
{
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
gUnknown_0203CDA4[0] = FALSE;
|
||||
sScheduledBgCopiesToVram[0] = FALSE;
|
||||
}
|
||||
if (gUnknown_0203CDA4[1] == TRUE)
|
||||
if (sScheduledBgCopiesToVram[1] == TRUE)
|
||||
{
|
||||
CopyBgTilemapBufferToVram(1);
|
||||
gUnknown_0203CDA4[1] = FALSE;
|
||||
sScheduledBgCopiesToVram[1] = FALSE;
|
||||
}
|
||||
if (gUnknown_0203CDA4[2] == TRUE)
|
||||
if (sScheduledBgCopiesToVram[2] == TRUE)
|
||||
{
|
||||
CopyBgTilemapBufferToVram(2);
|
||||
gUnknown_0203CDA4[2] = FALSE;
|
||||
sScheduledBgCopiesToVram[2] = FALSE;
|
||||
}
|
||||
if (gUnknown_0203CDA4[3] == TRUE)
|
||||
if (sScheduledBgCopiesToVram[3] == TRUE)
|
||||
{
|
||||
CopyBgTilemapBufferToVram(3);
|
||||
gUnknown_0203CDA4[3] = FALSE;
|
||||
sScheduledBgCopiesToVram[3] = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void ResetTempTileDataBuffers(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < (s32)ARRAY_COUNT(gUnknown_0203CDAC); i++)
|
||||
for (i = 0; i < (int)ARRAY_COUNT(sTempTileDataBuffer); i++)
|
||||
{
|
||||
gUnknown_0203CDAC[i] = NULL;
|
||||
sTempTileDataBuffer[i] = NULL;
|
||||
}
|
||||
gUnknown_0203CDA8 = 0;
|
||||
sTempTileDataBufferIdx = 0;
|
||||
}
|
||||
|
||||
bool8 FreeTempTileDataBuffersIfPossible(void)
|
||||
@ -1787,13 +1787,13 @@ bool8 FreeTempTileDataBuffersIfPossible(void)
|
||||
|
||||
if (!IsDma3ManagerBusyWithBgCopy())
|
||||
{
|
||||
if (gUnknown_0203CDA8)
|
||||
if (sTempTileDataBufferIdx)
|
||||
{
|
||||
for (i = 0; i < gUnknown_0203CDA8; i++)
|
||||
for (i = 0; i < sTempTileDataBufferIdx; i++)
|
||||
{
|
||||
FREE_AND_SET_NULL(gUnknown_0203CDAC[i]);
|
||||
FREE_AND_SET_NULL(sTempTileDataBuffer[i]);
|
||||
}
|
||||
gUnknown_0203CDA8 = 0;
|
||||
sTempTileDataBufferIdx = 0;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@ -1806,7 +1806,7 @@ bool8 FreeTempTileDataBuffersIfPossible(void)
|
||||
void *DecompressAndCopyTileDataToVram(u8 bgId, const void *src, u32 size, u16 offset, u8 mode)
|
||||
{
|
||||
u32 sizeOut;
|
||||
if (gUnknown_0203CDA8 < ARRAY_COUNT(gUnknown_0203CDAC))
|
||||
if (sTempTileDataBufferIdx < ARRAY_COUNT(sTempTileDataBuffer))
|
||||
{
|
||||
void *ptr = malloc_and_decompress(src, &sizeOut);
|
||||
if (!size)
|
||||
@ -1814,7 +1814,7 @@ void *DecompressAndCopyTileDataToVram(u8 bgId, const void *src, u32 size, u16 of
|
||||
if (ptr)
|
||||
{
|
||||
copy_decompressed_tile_data_to_vram(bgId, ptr, size, offset, mode);
|
||||
gUnknown_0203CDAC[gUnknown_0203CDA8++] = ptr;
|
||||
sTempTileDataBuffer[sTempTileDataBufferIdx++] = ptr;
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
|
@ -384,7 +384,7 @@ static void CB2_InitLearnMove(void)
|
||||
ResetSpriteData();
|
||||
FreeAllSpritePalettes();
|
||||
ResetTasks();
|
||||
clear_scheduled_bg_copies_to_vram();
|
||||
ClearScheduledBgCopiesToVram();
|
||||
sMoveRelearnerStruct = AllocZeroed(sizeof(*sMoveRelearnerStruct));
|
||||
sMoveRelearnerStruct->partyMon = gSpecialVar_0x8004;
|
||||
SetVBlankCallback(VBlankCB_MoveRelearner);
|
||||
@ -412,7 +412,7 @@ static void CB2_InitLearnMoveReturnFromSelectMove(void)
|
||||
ResetSpriteData();
|
||||
FreeAllSpritePalettes();
|
||||
ResetTasks();
|
||||
clear_scheduled_bg_copies_to_vram();
|
||||
ClearScheduledBgCopiesToVram();
|
||||
sMoveRelearnerStruct = AllocZeroed(sizeof(*sMoveRelearnerStruct));
|
||||
sMoveRelearnerStruct->state = MENU_STATE_FADE_FROM_SUMMARY_SCREEN;
|
||||
sMoveRelearnerStruct->partyMon = gSpecialVar_0x8004;
|
||||
@ -452,7 +452,7 @@ static void CB2_MoveRelearnerMain(void)
|
||||
RunTasks();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
do_scheduled_bg_tilemap_copies_to_vram();
|
||||
DoScheduledBgTilemapCopiesToVram();
|
||||
UpdatePaletteFade();
|
||||
}
|
||||
|
||||
|
@ -347,7 +347,7 @@ static void NamingScreen_InitBGs(void)
|
||||
ChangeBgY(3, 0, 0);
|
||||
|
||||
InitStandardTextBoxWindows();
|
||||
sub_8197200();
|
||||
InitTextBoxGfxAndPrinters();
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
gNamingScreenData->windows[i] = AddWindow(&gUnknown_0858BE10[i]);
|
||||
|
265
src/overworld.c
@ -7,10 +7,11 @@
|
||||
#include "cable_club.h"
|
||||
#include "clock.h"
|
||||
#include "event_data.h"
|
||||
#include "event_object_movement.h"
|
||||
#include "event_scripts.h"
|
||||
#include "field_camera.h"
|
||||
#include "field_control_avatar.h"
|
||||
#include "field_effect.h"
|
||||
#include "event_object_movement.h"
|
||||
#include "field_message_box.h"
|
||||
#include "field_player_avatar.h"
|
||||
#include "field_screen_effect.h"
|
||||
@ -22,6 +23,7 @@
|
||||
#include "fldeff.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "heal_location.h"
|
||||
#include "io_reg.h"
|
||||
#include "link.h"
|
||||
#include "link_rfu.h"
|
||||
#include "load_save.h"
|
||||
@ -82,44 +84,22 @@
|
||||
#define FACING_FORCED_LEFT 9
|
||||
#define FACING_FORCED_RIGHT 10
|
||||
|
||||
// event scripts
|
||||
extern const u8 EventScript_WhiteOut[];
|
||||
extern const u8 EventScript_ResetMrBriney[];
|
||||
extern const u8 EventScript_DoLinkRoomExit[];
|
||||
extern const u8 CableClub_EventScript_TooBusyToNotice[];
|
||||
extern const u8 CableClub_EventScript_ReadTrainerCard[];
|
||||
extern const u8 CableClub_EventScript_ReadTrainerCardColored[];
|
||||
extern const u8 EventScript_BattleColosseum_4P_PlayerSpot0[];
|
||||
extern const u8 EventScript_BattleColosseum_4P_PlayerSpot1[];
|
||||
extern const u8 EventScript_BattleColosseum_4P_PlayerSpot2[];
|
||||
extern const u8 EventScript_BattleColosseum_4P_PlayerSpot3[];
|
||||
extern const u8 EventScript_RecordCenter_Spot0[];
|
||||
extern const u8 EventScript_RecordCenter_Spot1[];
|
||||
extern const u8 EventScript_RecordCenter_Spot2[];
|
||||
extern const u8 EventScript_RecordCenter_Spot3[];
|
||||
extern const u8 EventScript_BattleColosseum_2P_PlayerSpot0[];
|
||||
extern const u8 EventScript_BattleColosseum_2P_PlayerSpot1[];
|
||||
extern const u8 EventScript_TradeCenter_Chair1[];
|
||||
extern const u8 EventScript_TradeCenter_Chair0[];
|
||||
extern const u8 EventScript_ConfirmLeaveTradeRoom[];
|
||||
extern const u8 EventScript_TerminateLink[];
|
||||
|
||||
extern const struct MapLayout *const gMapLayouts[];
|
||||
extern const struct MapHeader *const *const gMapGroups[];
|
||||
extern const int gMaxFlashLevel;
|
||||
extern const u16 gOverworldBackgroundLayerFlags[];
|
||||
|
||||
static void Overworld_ResetStateAfterWhiteOut(void);
|
||||
static void c2_80567AC(void);
|
||||
static void CB2_ReturnToFieldLocal(void);
|
||||
static void CB2_ReturnToFieldLink(void);
|
||||
static void CB2_LoadMapOnReturnToFieldCableClub(void);
|
||||
static void CB2_LoadMap2(void);
|
||||
static void VBlankCB_Field(void);
|
||||
static void SpriteCB_LinkPlayer(struct Sprite *sprite);
|
||||
static void ChooseAmbientCrySpecies(void);
|
||||
static void do_load_map_stuff_loop(u8 *state);
|
||||
static bool32 map_loading_iteration_3(u8 *state);
|
||||
static bool32 sub_8086638(u8 *state);
|
||||
static bool32 load_map_stuff(u8 *state, u32);
|
||||
static bool32 map_loading_iteration_2_link(u8 *state);
|
||||
static void DoMapLoadLoop(u8 *state);
|
||||
static bool32 LoadMapInStepsLink(u8 *state);
|
||||
static bool32 ReturnToFieldLocal(u8 *state);
|
||||
static bool32 LoadMapInStepsLocal(u8 *state, bool32);
|
||||
static bool32 ReturnToFieldLink(u8 *state);
|
||||
static void mli4_mapscripts_and_other(void);
|
||||
static void InitOverworldGraphicsRegisters(void);
|
||||
static u8 GetSpriteForLinkedPlayer(u8);
|
||||
@ -131,7 +111,7 @@ static void sub_80869DC(void);
|
||||
static void sub_8086B14(void);
|
||||
static void SetCameraToTrackGuestPlayer(void);
|
||||
static void sub_8086988(bool32 arg0);
|
||||
static void sub_8086A80(void);
|
||||
static void SetCameraToTrackPlayer(void);
|
||||
static void sub_8086A68(void);
|
||||
static void sub_8086860(void);
|
||||
static void SetCameraToTrackGuestPlayer_2(void);
|
||||
@ -155,7 +135,7 @@ static void InitLinkPlayerObjectEventPos(struct ObjectEvent *objEvent, s16 x, s1
|
||||
static void sub_80877DC(u8 linkPlayerId, u8 a2);
|
||||
static void sub_808780C(u8 linkPlayerId);
|
||||
static u8 GetSpriteForLinkedPlayer(u8 linkPlayerId);
|
||||
static void sub_8087584(void);
|
||||
static void RunTerminateLinkScript(void);
|
||||
static u32 GetLinkSendQueueLength(void);
|
||||
static void ZeroLinkPlayerObjectEvent(struct LinkPlayerObjectEvent *linkPlayerObjEvent);
|
||||
static const u8 *TryInteractWithPlayer(struct TradeRoomPlayer *a1);
|
||||
@ -181,14 +161,14 @@ static void CB1_UpdateLinkState(void);
|
||||
static void SetKeyInterceptCallback(u16 (*func)(u32));
|
||||
static void SetFieldVBlankCallback(void);
|
||||
static void FieldClearVBlankHBlankCallbacks(void);
|
||||
static void sub_8085810(void);
|
||||
static void TransitionMapMusic(void);
|
||||
static u8 GetAdjustedInitialTransitionFlags(struct InitialPlayerAvatarState *playerStruct, u16 a2, u8 a3);
|
||||
static u8 GetAdjustedInitialDirection(struct InitialPlayerAvatarState *playerStruct, u8 a2, u16 a3, u8 a4);
|
||||
static u16 GetCenterScreenMetatileBehavior(void);
|
||||
|
||||
// IWRAM bss vars
|
||||
static void *sUnusedOverworldCallback;
|
||||
static u8 sPlayerTradingStates[4];
|
||||
static u8 sPlayerTradingStates[MAX_LINK_PLAYERS];
|
||||
// This callback is called with a player's key code. It then returns an
|
||||
// adjusted key code, effectively intercepting the input before anything
|
||||
// can process it.
|
||||
@ -208,13 +188,13 @@ u8 gLocalLinkPlayerId; // This is our player id in a multiplayer mode.
|
||||
u8 gFieldLinkPlayerCount;
|
||||
|
||||
// EWRAM vars
|
||||
EWRAM_DATA static u8 sUnknown_020322D8 = 0;
|
||||
EWRAM_DATA static u8 sObjectEventLoadFlag = 0;
|
||||
EWRAM_DATA struct WarpData gLastUsedWarp = {0};
|
||||
EWRAM_DATA static struct WarpData sWarpDestination = {0}; // new warp position
|
||||
EWRAM_DATA static struct WarpData gFixedDiveWarp = {0};
|
||||
EWRAM_DATA static struct WarpData gFixedHoleWarp = {0};
|
||||
EWRAM_DATA static struct WarpData sFixedDiveWarp = {0};
|
||||
EWRAM_DATA static struct WarpData sFixedHoleWarp = {0};
|
||||
EWRAM_DATA static u16 sLastMapSectionId = 0;
|
||||
EWRAM_DATA static struct InitialPlayerAvatarState gInitialPlayerAvatarState = {0};
|
||||
EWRAM_DATA static struct InitialPlayerAvatarState sInitialPlayerAvatarState = {0};
|
||||
EWRAM_DATA static u16 sAmbientCrySpecies = 0;
|
||||
EWRAM_DATA static bool8 sIsAmbientCryWaterMon = FALSE;
|
||||
EWRAM_DATA struct LinkPlayerObjectEvent gLinkPlayerObjectEvents[4] = {0};
|
||||
@ -229,16 +209,9 @@ static const struct WarpData sDummyWarpData =
|
||||
.y = -1,
|
||||
};
|
||||
|
||||
static const u8 sUnusedData[] =
|
||||
static const u32 sUnusedData[] =
|
||||
{
|
||||
0xB0, 0x04, 0x00, 0x00,
|
||||
0x10, 0x0E, 0x00, 0x00,
|
||||
0xB0, 0x04, 0x00, 0x00,
|
||||
0x60, 0x09, 0x00, 0x00,
|
||||
0x32, 0x00, 0x00, 0x00,
|
||||
0x50, 0x00, 0x00, 0x00,
|
||||
0xD4, 0xFF, 0xFF, 0xFF,
|
||||
0x2C, 0x00, 0x00, 0x00,
|
||||
1200, 3600, 1200, 2400, 50, 80, -44, 44
|
||||
};
|
||||
|
||||
const struct UCoords32 gDirectionToVectors[] =
|
||||
@ -549,9 +522,9 @@ void Overworld_SetObjEventTemplateMovementType(u8 localId, u8 movementType)
|
||||
|
||||
static void mapdata_load_assets_to_gpu_and_full_redraw(void)
|
||||
{
|
||||
move_tilemap_camera_to_upper_left_corner();
|
||||
copy_map_tileset1_tileset2_to_vram(gMapHeader.mapLayout);
|
||||
apply_map_tileset1_tileset2_palette(gMapHeader.mapLayout);
|
||||
ResetFieldCamera();
|
||||
CopyMapTilesetsToVram(gMapHeader.mapLayout);
|
||||
LoadMapTilesetPalettes(gMapHeader.mapLayout);
|
||||
DrawWholeMapView();
|
||||
InitTilesetAnimations();
|
||||
}
|
||||
@ -568,14 +541,14 @@ void ApplyCurrentWarp(void)
|
||||
{
|
||||
gLastUsedWarp = gSaveBlock1Ptr->location;
|
||||
gSaveBlock1Ptr->location = sWarpDestination;
|
||||
gFixedDiveWarp = sDummyWarpData;
|
||||
gFixedHoleWarp = sDummyWarpData;
|
||||
sFixedDiveWarp = sDummyWarpData;
|
||||
sFixedHoleWarp = sDummyWarpData;
|
||||
}
|
||||
|
||||
static void ClearDiveAndHoleWarps(void)
|
||||
{
|
||||
gFixedDiveWarp = sDummyWarpData;
|
||||
gFixedHoleWarp = sDummyWarpData;
|
||||
sFixedDiveWarp = sDummyWarpData;
|
||||
sFixedHoleWarp = sDummyWarpData;
|
||||
}
|
||||
|
||||
static void SetWarpData(struct WarpData *warp, s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y)
|
||||
@ -717,25 +690,25 @@ void SetWarpDestinationToEscapeWarp(void)
|
||||
|
||||
void SetFixedDiveWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y)
|
||||
{
|
||||
SetWarpData(&gFixedDiveWarp, mapGroup, mapNum, warpId, x, y);
|
||||
SetWarpData(&sFixedDiveWarp, mapGroup, mapNum, warpId, x, y);
|
||||
}
|
||||
|
||||
static void SetWarpDestinationToDiveWarp(void)
|
||||
{
|
||||
sWarpDestination = gFixedDiveWarp;
|
||||
sWarpDestination = sFixedDiveWarp;
|
||||
}
|
||||
|
||||
void SetFixedHoleWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y)
|
||||
{
|
||||
SetWarpData(&gFixedHoleWarp, mapGroup, mapNum, warpId, x, y);
|
||||
SetWarpData(&sFixedHoleWarp, mapGroup, mapNum, warpId, x, y);
|
||||
}
|
||||
|
||||
void SetWarpDestinationToFixedHoleWarp(s16 x, s16 y)
|
||||
{
|
||||
if (IsDummyWarp(&gFixedHoleWarp) == TRUE)
|
||||
if (IsDummyWarp(&sFixedHoleWarp) == TRUE)
|
||||
sWarpDestination = gLastUsedWarp;
|
||||
else
|
||||
SetWarpDestination(gFixedHoleWarp.mapGroup, gFixedHoleWarp.mapNum, -1, x, y);
|
||||
SetWarpDestination(sFixedHoleWarp.mapGroup, sFixedHoleWarp.mapNum, -1, x, y);
|
||||
}
|
||||
|
||||
static void SetWarpDestinationToContinueGameWarp(void)
|
||||
@ -787,7 +760,7 @@ static bool8 SetDiveWarp(u8 dir, u16 x, u16 y)
|
||||
else
|
||||
{
|
||||
RunOnDiveWarpMapScript();
|
||||
if (IsDummyWarp(&gFixedDiveWarp))
|
||||
if (IsDummyWarp(&sFixedDiveWarp))
|
||||
return FALSE;
|
||||
SetWarpDestinationToDiveWarp();
|
||||
}
|
||||
@ -809,8 +782,10 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum)
|
||||
s32 paletteIndex;
|
||||
|
||||
SetWarpDestination(mapGroup, mapNum, -1, -1, -1);
|
||||
if (gMapHeader.regionMapSectionId != 0x3A)
|
||||
sub_8085810();
|
||||
|
||||
// Dont transition map music between BF Outside West/East
|
||||
if (gMapHeader.regionMapSectionId != MAPSEC_BATTLE_FRONTIER)
|
||||
TransitionMapMusic();
|
||||
|
||||
ApplyCurrentWarp();
|
||||
LoadCurrentMapData();
|
||||
@ -827,8 +802,8 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum)
|
||||
Overworld_ClearSavedMusic();
|
||||
RunOnTransitionMapScript();
|
||||
InitMap();
|
||||
copy_map_tileset2_to_vram_2(gMapHeader.mapLayout);
|
||||
apply_map_tileset2_palette(gMapHeader.mapLayout);
|
||||
CopySecondaryTilesetToVramUsingHeap(gMapHeader.mapLayout);
|
||||
LoadSecondaryTilesetPalette(gMapHeader.mapLayout);
|
||||
|
||||
for (paletteIndex = 6; paletteIndex < 13; paletteIndex++)
|
||||
ApplyWeatherGammaShiftToPal(paletteIndex);
|
||||
@ -840,17 +815,18 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum)
|
||||
ResetFieldTasksArgs();
|
||||
RunOnResumeMapScript();
|
||||
|
||||
if (gMapHeader.regionMapSectionId != MAPSEC_BATTLE_FRONTIER || gMapHeader.regionMapSectionId != sLastMapSectionId)
|
||||
if (gMapHeader.regionMapSectionId != MAPSEC_BATTLE_FRONTIER
|
||||
|| gMapHeader.regionMapSectionId != sLastMapSectionId)
|
||||
ShowMapNamePopup();
|
||||
}
|
||||
|
||||
static void mli0_load_map(u32 a1)
|
||||
static void LoadMapFromWarp(bool32 a1)
|
||||
{
|
||||
bool8 isOutdoors;
|
||||
bool8 isIndoors;
|
||||
|
||||
LoadCurrentMapData();
|
||||
if (!(sUnknown_020322D8 & 1))
|
||||
if (!(sObjectEventLoadFlag & SKIP_OBJECT_EVENT_LOAD))
|
||||
{
|
||||
if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_FLOOR)
|
||||
LoadBattlePyramidObjectEventTemplates();
|
||||
@ -869,7 +845,7 @@ static void mli0_load_map(u32 a1)
|
||||
ResetCyclingRoadChallengeData();
|
||||
RestartWildEncounterImmunitySteps();
|
||||
TryUpdateRandomTrainerRematches(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum);
|
||||
if (a1 != 1)
|
||||
if (a1 != TRUE)
|
||||
DoTimeBasedEvents();
|
||||
SetSav1WeatherFromCurrMapHeader();
|
||||
ChooseAmbientCrySpecies();
|
||||
@ -887,7 +863,7 @@ static void mli0_load_map(u32 a1)
|
||||
else
|
||||
InitMap();
|
||||
|
||||
if (a1 != 1 && isIndoors)
|
||||
if (a1 != TRUE && isIndoors)
|
||||
{
|
||||
UpdateTVScreensOnMap(gBackupMapLayout.width, gBackupMapLayout.height);
|
||||
InitSecretBaseAppearance(TRUE);
|
||||
@ -896,24 +872,24 @@ static void mli0_load_map(u32 a1)
|
||||
|
||||
void ResetInitialPlayerAvatarState(void)
|
||||
{
|
||||
gInitialPlayerAvatarState.direction = DIR_SOUTH;
|
||||
gInitialPlayerAvatarState.transitionFlags = PLAYER_AVATAR_FLAG_ON_FOOT;
|
||||
sInitialPlayerAvatarState.direction = DIR_SOUTH;
|
||||
sInitialPlayerAvatarState.transitionFlags = PLAYER_AVATAR_FLAG_ON_FOOT;
|
||||
}
|
||||
|
||||
void StoreInitialPlayerAvatarState(void)
|
||||
{
|
||||
gInitialPlayerAvatarState.direction = GetPlayerFacingDirection();
|
||||
sInitialPlayerAvatarState.direction = GetPlayerFacingDirection();
|
||||
|
||||
if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_MACH_BIKE))
|
||||
gInitialPlayerAvatarState.transitionFlags = PLAYER_AVATAR_FLAG_MACH_BIKE;
|
||||
sInitialPlayerAvatarState.transitionFlags = PLAYER_AVATAR_FLAG_MACH_BIKE;
|
||||
else if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_ACRO_BIKE))
|
||||
gInitialPlayerAvatarState.transitionFlags = PLAYER_AVATAR_FLAG_ACRO_BIKE;
|
||||
sInitialPlayerAvatarState.transitionFlags = PLAYER_AVATAR_FLAG_ACRO_BIKE;
|
||||
else if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_SURFING))
|
||||
gInitialPlayerAvatarState.transitionFlags = PLAYER_AVATAR_FLAG_SURFING;
|
||||
sInitialPlayerAvatarState.transitionFlags = PLAYER_AVATAR_FLAG_SURFING;
|
||||
else if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_UNDERWATER))
|
||||
gInitialPlayerAvatarState.transitionFlags = PLAYER_AVATAR_FLAG_UNDERWATER;
|
||||
sInitialPlayerAvatarState.transitionFlags = PLAYER_AVATAR_FLAG_UNDERWATER;
|
||||
else
|
||||
gInitialPlayerAvatarState.transitionFlags = PLAYER_AVATAR_FLAG_ON_FOOT;
|
||||
sInitialPlayerAvatarState.transitionFlags = PLAYER_AVATAR_FLAG_ON_FOOT;
|
||||
}
|
||||
|
||||
static struct InitialPlayerAvatarState *GetInitialPlayerAvatarState(void)
|
||||
@ -921,11 +897,11 @@ static struct InitialPlayerAvatarState *GetInitialPlayerAvatarState(void)
|
||||
struct InitialPlayerAvatarState playerStruct;
|
||||
u8 mapType = GetCurrentMapType();
|
||||
u16 metatileBehavior = GetCenterScreenMetatileBehavior();
|
||||
u8 transitionFlags = GetAdjustedInitialTransitionFlags(&gInitialPlayerAvatarState, metatileBehavior, mapType);
|
||||
u8 transitionFlags = GetAdjustedInitialTransitionFlags(&sInitialPlayerAvatarState, metatileBehavior, mapType);
|
||||
playerStruct.transitionFlags = transitionFlags;
|
||||
playerStruct.direction = GetAdjustedInitialDirection(&gInitialPlayerAvatarState, transitionFlags, metatileBehavior, mapType);
|
||||
gInitialPlayerAvatarState = playerStruct;
|
||||
return &gInitialPlayerAvatarState;
|
||||
playerStruct.direction = GetAdjustedInitialDirection(&sInitialPlayerAvatarState, transitionFlags, metatileBehavior, mapType);
|
||||
sInitialPlayerAvatarState = playerStruct;
|
||||
return &sInitialPlayerAvatarState;
|
||||
}
|
||||
|
||||
static u8 GetAdjustedInitialTransitionFlags(struct InitialPlayerAvatarState *playerStruct, u16 metatileBehavior, u8 mapType)
|
||||
@ -1012,14 +988,15 @@ void SetCurrentMapLayout(u16 mapLayoutId)
|
||||
gMapHeader.mapLayout = GetMapLayout();
|
||||
}
|
||||
|
||||
void sub_8085540(u8 var)
|
||||
void SetObjectEventLoadFlag(u8 flag)
|
||||
{
|
||||
sUnknown_020322D8 = var;
|
||||
sObjectEventLoadFlag = flag;
|
||||
}
|
||||
|
||||
u8 sub_808554C(void)
|
||||
// Unused, sObjectEventLoadFlag is read directly
|
||||
static u8 GetObjectEventLoadFlag(void)
|
||||
{
|
||||
return sUnknown_020322D8;
|
||||
return sObjectEventLoadFlag;
|
||||
}
|
||||
|
||||
static bool16 ShouldLegendaryMusicPlayAtLocation(struct WarpData *warp)
|
||||
@ -1179,10 +1156,10 @@ void Overworld_SetSavedMusic(u16 songNum)
|
||||
|
||||
void Overworld_ClearSavedMusic(void)
|
||||
{
|
||||
gSaveBlock1Ptr->savedMusic = 0;
|
||||
gSaveBlock1Ptr->savedMusic = MUS_DUMMY;
|
||||
}
|
||||
|
||||
static void sub_8085810(void)
|
||||
static void TransitionMapMusic(void)
|
||||
{
|
||||
if (FlagGet(FLAG_DONT_TRANSITION_MUSIC) != TRUE)
|
||||
{
|
||||
@ -1477,7 +1454,7 @@ static void OverworldBasic(void)
|
||||
BuildOamBuffer();
|
||||
UpdatePaletteFade();
|
||||
UpdateTilesetAnimations();
|
||||
do_scheduled_bg_tilemap_copies_to_vram();
|
||||
DoScheduledBgTilemapCopiesToVram();
|
||||
}
|
||||
|
||||
// This CB2 is used when starting
|
||||
@ -1507,7 +1484,7 @@ void SetUnusedCallback(void *func)
|
||||
sUnusedOverworldCallback = func;
|
||||
}
|
||||
|
||||
static bool8 map_post_load_hook_exec(void)
|
||||
static bool8 RunFieldCallback(void)
|
||||
{
|
||||
if (gFieldCallback2)
|
||||
{
|
||||
@ -1546,7 +1523,7 @@ void CB2_NewGame(void)
|
||||
ScriptContext2_Disable();
|
||||
gFieldCallback = ExecuteTruckSequence;
|
||||
gFieldCallback2 = NULL;
|
||||
do_load_map_stuff_loop(&gMain.state);
|
||||
DoMapLoadLoop(&gMain.state);
|
||||
SetFieldVBlankCallback();
|
||||
SetMainCallback1(CB1_Overworld);
|
||||
SetMainCallback2(CB2_Overworld);
|
||||
@ -1554,7 +1531,7 @@ void CB2_NewGame(void)
|
||||
|
||||
void CB2_WhiteOut(void)
|
||||
{
|
||||
u8 val;
|
||||
u8 state;
|
||||
|
||||
if (++gMain.state >= 120)
|
||||
{
|
||||
@ -1566,8 +1543,8 @@ void CB2_WhiteOut(void)
|
||||
ScriptContext1_Init();
|
||||
ScriptContext2_Disable();
|
||||
gFieldCallback = FieldCB_WarpExitFadeFromBlack;
|
||||
val = 0;
|
||||
do_load_map_stuff_loop(&val);
|
||||
state = 0;
|
||||
DoMapLoadLoop(&state);
|
||||
SetFieldVBlankCallback();
|
||||
SetMainCallback1(CB1_Overworld);
|
||||
SetMainCallback2(CB2_Overworld);
|
||||
@ -1586,13 +1563,13 @@ void CB2_LoadMap(void)
|
||||
|
||||
static void CB2_LoadMap2(void)
|
||||
{
|
||||
do_load_map_stuff_loop(&gMain.state);
|
||||
DoMapLoadLoop(&gMain.state);
|
||||
SetFieldVBlankCallback();
|
||||
SetMainCallback1(CB1_Overworld);
|
||||
SetMainCallback2(CB2_Overworld);
|
||||
}
|
||||
|
||||
void sub_8086024(void)
|
||||
void CB2_ReturnToFieldContestHall(void)
|
||||
{
|
||||
if (!gMain.state)
|
||||
{
|
||||
@ -1601,7 +1578,7 @@ void sub_8086024(void)
|
||||
ScriptContext2_Disable();
|
||||
SetMainCallback1(NULL);
|
||||
}
|
||||
if (load_map_stuff(&gMain.state, 1))
|
||||
if (LoadMapInStepsLocal(&gMain.state, TRUE))
|
||||
{
|
||||
SetFieldVBlankCallback();
|
||||
SetMainCallback1(CB1_Overworld);
|
||||
@ -1613,12 +1590,12 @@ void CB2_ReturnToFieldCableClub(void)
|
||||
{
|
||||
FieldClearVBlankHBlankCallbacks();
|
||||
gFieldCallback = FieldCB_ReturnToFieldWirelessLink;
|
||||
SetMainCallback2(c2_80567AC);
|
||||
SetMainCallback2(CB2_LoadMapOnReturnToFieldCableClub);
|
||||
}
|
||||
|
||||
static void c2_80567AC(void)
|
||||
static void CB2_LoadMapOnReturnToFieldCableClub(void)
|
||||
{
|
||||
if (map_loading_iteration_3(&gMain.state))
|
||||
if (LoadMapInStepsLink(&gMain.state))
|
||||
{
|
||||
SetFieldVBlankCallback();
|
||||
SetMainCallback1(CB1_UpdateLinkState);
|
||||
@ -1640,18 +1617,18 @@ void CB2_ReturnToField(void)
|
||||
}
|
||||
}
|
||||
|
||||
void CB2_ReturnToFieldLocal(void)
|
||||
static void CB2_ReturnToFieldLocal(void)
|
||||
{
|
||||
if (sub_8086638(&gMain.state))
|
||||
if (ReturnToFieldLocal(&gMain.state))
|
||||
{
|
||||
SetFieldVBlankCallback();
|
||||
SetMainCallback2(CB2_Overworld);
|
||||
}
|
||||
}
|
||||
|
||||
void CB2_ReturnToFieldLink(void)
|
||||
static void CB2_ReturnToFieldLink(void)
|
||||
{
|
||||
if (!sub_8087598() && map_loading_iteration_2_link(&gMain.state))
|
||||
if (!sub_8087598() && ReturnToFieldLink(&gMain.state))
|
||||
SetMainCallback2(CB2_Overworld);
|
||||
}
|
||||
|
||||
@ -1812,7 +1789,7 @@ static void InitCurrentFlashLevelScanlineEffect(void)
|
||||
}
|
||||
}
|
||||
|
||||
static bool32 map_loading_iteration_3(u8 *state)
|
||||
static bool32 LoadMapInStepsLink(u8 *state)
|
||||
{
|
||||
switch (*state)
|
||||
{
|
||||
@ -1825,7 +1802,7 @@ static bool32 map_loading_iteration_3(u8 *state)
|
||||
(*state)++;
|
||||
break;
|
||||
case 1:
|
||||
mli0_load_map(1);
|
||||
LoadMapFromWarp(TRUE);
|
||||
(*state)++;
|
||||
break;
|
||||
case 2:
|
||||
@ -1842,25 +1819,25 @@ static bool32 map_loading_iteration_3(u8 *state)
|
||||
case 4:
|
||||
InitCurrentFlashLevelScanlineEffect();
|
||||
InitOverworldGraphicsRegisters();
|
||||
sub_8197200();
|
||||
InitTextBoxGfxAndPrinters();
|
||||
(*state)++;
|
||||
break;
|
||||
case 5:
|
||||
move_tilemap_camera_to_upper_left_corner();
|
||||
ResetFieldCamera();
|
||||
(*state)++;
|
||||
break;
|
||||
case 6:
|
||||
copy_map_tileset1_to_vram(gMapHeader.mapLayout);
|
||||
CopyPrimaryTilesetToVram(gMapHeader.mapLayout);
|
||||
(*state)++;
|
||||
break;
|
||||
case 7:
|
||||
copy_map_tileset2_to_vram(gMapHeader.mapLayout);
|
||||
CopySecondaryTilesetToVram(gMapHeader.mapLayout);
|
||||
(*state)++;
|
||||
break;
|
||||
case 8:
|
||||
if (FreeTempTileDataBuffersIfPossible() != TRUE)
|
||||
{
|
||||
apply_map_tileset1_tileset2_palette(gMapHeader.mapLayout);
|
||||
LoadMapTilesetPalettes(gMapHeader.mapLayout);
|
||||
(*state)++;
|
||||
}
|
||||
break;
|
||||
@ -1881,7 +1858,7 @@ static bool32 map_loading_iteration_3(u8 *state)
|
||||
(*state)++;
|
||||
break;
|
||||
case 12:
|
||||
if (map_post_load_hook_exec())
|
||||
if (RunFieldCallback())
|
||||
(*state)++;
|
||||
break;
|
||||
case 13:
|
||||
@ -1891,13 +1868,13 @@ static bool32 map_loading_iteration_3(u8 *state)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static bool32 load_map_stuff(u8 *state, u32 a2)
|
||||
static bool32 LoadMapInStepsLocal(u8 *state, bool32 a2)
|
||||
{
|
||||
switch (*state)
|
||||
{
|
||||
case 0:
|
||||
FieldClearVBlankHBlankCallbacks();
|
||||
mli0_load_map(a2);
|
||||
LoadMapFromWarp(a2);
|
||||
(*state)++;
|
||||
break;
|
||||
case 1:
|
||||
@ -1911,31 +1888,31 @@ static bool32 load_map_stuff(u8 *state, u32 a2)
|
||||
break;
|
||||
case 3:
|
||||
mli4_mapscripts_and_other();
|
||||
sub_8086A80();
|
||||
SetCameraToTrackPlayer();
|
||||
(*state)++;
|
||||
break;
|
||||
case 4:
|
||||
InitCurrentFlashLevelScanlineEffect();
|
||||
InitOverworldGraphicsRegisters();
|
||||
sub_8197200();
|
||||
InitTextBoxGfxAndPrinters();
|
||||
(*state)++;
|
||||
break;
|
||||
case 5:
|
||||
move_tilemap_camera_to_upper_left_corner();
|
||||
ResetFieldCamera();
|
||||
(*state)++;
|
||||
break;
|
||||
case 6:
|
||||
copy_map_tileset1_to_vram(gMapHeader.mapLayout);
|
||||
CopyPrimaryTilesetToVram(gMapHeader.mapLayout);
|
||||
(*state)++;
|
||||
break;
|
||||
case 7:
|
||||
copy_map_tileset2_to_vram(gMapHeader.mapLayout);
|
||||
CopySecondaryTilesetToVram(gMapHeader.mapLayout);
|
||||
(*state)++;
|
||||
break;
|
||||
case 8:
|
||||
if (FreeTempTileDataBuffersIfPossible() != TRUE)
|
||||
{
|
||||
apply_map_tileset1_tileset2_palette(gMapHeader.mapLayout);
|
||||
LoadMapTilesetPalettes(gMapHeader.mapLayout);
|
||||
(*state)++;
|
||||
}
|
||||
break;
|
||||
@ -1953,7 +1930,7 @@ static bool32 load_map_stuff(u8 *state, u32 a2)
|
||||
(*state)++;
|
||||
break;
|
||||
case 12:
|
||||
if (map_post_load_hook_exec())
|
||||
if (RunFieldCallback())
|
||||
(*state)++;
|
||||
break;
|
||||
case 13:
|
||||
@ -1963,16 +1940,16 @@ static bool32 load_map_stuff(u8 *state, u32 a2)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static bool32 sub_8086638(u8 *state)
|
||||
static bool32 ReturnToFieldLocal(u8 *state)
|
||||
{
|
||||
switch (*state)
|
||||
{
|
||||
case 0:
|
||||
sub_80867C8();
|
||||
sub_80867D8();
|
||||
sub_8086988(0);
|
||||
sub_8086988(FALSE);
|
||||
sub_8086A68();
|
||||
sub_8086A80();
|
||||
SetCameraToTrackPlayer();
|
||||
(*state)++;
|
||||
break;
|
||||
case 1:
|
||||
@ -1981,7 +1958,7 @@ static bool32 sub_8086638(u8 *state)
|
||||
(*state)++;
|
||||
break;
|
||||
case 2:
|
||||
if (map_post_load_hook_exec())
|
||||
if (RunFieldCallback())
|
||||
(*state)++;
|
||||
break;
|
||||
case 3:
|
||||
@ -1991,7 +1968,7 @@ static bool32 sub_8086638(u8 *state)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static bool32 map_loading_iteration_2_link(u8 *state)
|
||||
static bool32 ReturnToFieldLink(u8 *state)
|
||||
{
|
||||
switch (*state)
|
||||
{
|
||||
@ -2002,7 +1979,7 @@ static bool32 map_loading_iteration_2_link(u8 *state)
|
||||
(*state)++;
|
||||
break;
|
||||
case 1:
|
||||
sub_8086988(1);
|
||||
sub_8086988(TRUE);
|
||||
(*state)++;
|
||||
break;
|
||||
case 2:
|
||||
@ -2014,25 +1991,25 @@ static bool32 map_loading_iteration_2_link(u8 *state)
|
||||
case 3:
|
||||
InitCurrentFlashLevelScanlineEffect();
|
||||
InitOverworldGraphicsRegisters();
|
||||
sub_8197200();
|
||||
InitTextBoxGfxAndPrinters();
|
||||
(*state)++;
|
||||
break;
|
||||
case 4:
|
||||
move_tilemap_camera_to_upper_left_corner();
|
||||
ResetFieldCamera();
|
||||
(*state)++;
|
||||
break;
|
||||
case 5:
|
||||
copy_map_tileset1_to_vram(gMapHeader.mapLayout);
|
||||
CopyPrimaryTilesetToVram(gMapHeader.mapLayout);
|
||||
(*state)++;
|
||||
break;
|
||||
case 6:
|
||||
copy_map_tileset2_to_vram(gMapHeader.mapLayout);
|
||||
CopySecondaryTilesetToVram(gMapHeader.mapLayout);
|
||||
(*state)++;
|
||||
break;
|
||||
case 7:
|
||||
if (FreeTempTileDataBuffersIfPossible() != TRUE)
|
||||
{
|
||||
apply_map_tileset1_tileset2_palette(gMapHeader.mapLayout);
|
||||
LoadMapTilesetPalettes(gMapHeader.mapLayout);
|
||||
(*state)++;
|
||||
}
|
||||
break;
|
||||
@ -2053,7 +2030,7 @@ static bool32 map_loading_iteration_2_link(u8 *state)
|
||||
(*state)++;
|
||||
break;
|
||||
case 12:
|
||||
if (map_post_load_hook_exec())
|
||||
if (RunFieldCallback())
|
||||
(*state)++;
|
||||
break;
|
||||
case 10:
|
||||
@ -2068,9 +2045,9 @@ static bool32 map_loading_iteration_2_link(u8 *state)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void do_load_map_stuff_loop(u8 *state)
|
||||
static void DoMapLoadLoop(u8 *state)
|
||||
{
|
||||
while (!load_map_stuff(state, 0));
|
||||
while (!LoadMapInStepsLocal(state, FALSE));
|
||||
}
|
||||
|
||||
static void sub_80867C8(void)
|
||||
@ -2094,13 +2071,13 @@ static void sub_8086860(void)
|
||||
{
|
||||
InitCurrentFlashLevelScanlineEffect();
|
||||
InitOverworldGraphicsRegisters();
|
||||
sub_8197200();
|
||||
InitTextBoxGfxAndPrinters();
|
||||
mapdata_load_assets_to_gpu_and_full_redraw();
|
||||
}
|
||||
|
||||
static void InitOverworldGraphicsRegisters(void)
|
||||
{
|
||||
clear_scheduled_bg_copies_to_vram();
|
||||
ClearScheduledBgCopiesToVram();
|
||||
ResetTempTileDataBuffers();
|
||||
SetGpuReg(REG_OFFSET_MOSAIC, 0);
|
||||
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ);
|
||||
@ -2133,7 +2110,7 @@ static void InitOverworldGraphicsRegisters(void)
|
||||
InitFieldMessageBox();
|
||||
}
|
||||
|
||||
static void sub_8086988(u32 a1)
|
||||
static void sub_8086988(bool32 a1)
|
||||
{
|
||||
ResetTasks();
|
||||
ResetSpriteData();
|
||||
@ -2189,9 +2166,9 @@ static void sub_8086A68(void)
|
||||
RunOnReturnToFieldMapScript();
|
||||
}
|
||||
|
||||
static void sub_8086A80(void)
|
||||
static void SetCameraToTrackPlayer(void)
|
||||
{
|
||||
gObjectEvents[gPlayerAvatar.objectEventId].trackedByCamera = 1;
|
||||
gObjectEvents[gPlayerAvatar.objectEventId].trackedByCamera = TRUE;
|
||||
InitCameraUpdateCallback(gPlayerAvatar.spriteId);
|
||||
}
|
||||
|
||||
@ -2294,7 +2271,7 @@ static void CheckRfuKeepAliveTimer(void)
|
||||
static void ResetAllTradingStates(void)
|
||||
{
|
||||
s32 i;
|
||||
for (i = 0; i < 4; i++)
|
||||
for (i = 0; i < MAX_LINK_PLAYERS; i++)
|
||||
sPlayerTradingStates[i] = PLAYER_TRADING_STATE_IDLE;
|
||||
}
|
||||
|
||||
@ -2345,7 +2322,7 @@ static void HandleLinkPlayerKeyInput(u32 playerId, u16 key, struct TradeRoomPlay
|
||||
if (trainer->isLocalPlayer)
|
||||
{
|
||||
SetKeyInterceptCallback(KeyInterCB_DeferToEventScript);
|
||||
sub_8087584();
|
||||
RunTerminateLinkScript();
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -2763,7 +2740,7 @@ static const u8 *TryInteractWithPlayer(struct TradeRoomPlayer *player)
|
||||
otherPlayerPos.height = 0;
|
||||
linkPlayerId = GetLinkPlayerIdAt(otherPlayerPos.x, otherPlayerPos.y);
|
||||
|
||||
if (linkPlayerId != 4)
|
||||
if (linkPlayerId != MAX_LINK_PLAYERS)
|
||||
{
|
||||
if (!player->isLocalPlayer)
|
||||
return CableClub_EventScript_TooBusyToNotice;
|
||||
@ -2843,7 +2820,7 @@ static void InitMenuBasedScript(const u8 *script)
|
||||
ScriptContext2_Enable();
|
||||
}
|
||||
|
||||
static void sub_8087584(void)
|
||||
static void RunTerminateLinkScript(void)
|
||||
{
|
||||
ScriptContext1_SetupScript(EventScript_TerminateLink);
|
||||
ScriptContext2_Enable();
|
||||
|
@ -464,7 +464,7 @@ static void CB2_UpdatePartyMenu(void)
|
||||
RunTasks();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
do_scheduled_bg_tilemap_copies_to_vram();
|
||||
DoScheduledBgTilemapCopiesToVram();
|
||||
UpdatePaletteFade();
|
||||
}
|
||||
|
||||
@ -491,7 +491,7 @@ static bool8 ShowPartyMenu(void)
|
||||
case 0:
|
||||
SetVBlankHBlankCallbacksToNull();
|
||||
ResetVramOamAndBgCntRegs();
|
||||
clear_scheduled_bg_copies_to_vram();
|
||||
ClearScheduledBgCopiesToVram();
|
||||
gMain.state++;
|
||||
break;
|
||||
case 1:
|
||||
|
@ -475,7 +475,7 @@ static void CB2_PokeblockMenu(void)
|
||||
RunTasks();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
do_scheduled_bg_tilemap_copies_to_vram();
|
||||
DoScheduledBgTilemapCopiesToVram();
|
||||
UpdatePaletteFade();
|
||||
}
|
||||
|
||||
@ -507,7 +507,7 @@ static bool8 InitPokeblockMenu(void)
|
||||
{
|
||||
case 0:
|
||||
SetVBlankHBlankCallbacksToNull();
|
||||
clear_scheduled_bg_copies_to_vram();
|
||||
ClearScheduledBgCopiesToVram();
|
||||
gMain.state++;
|
||||
break;
|
||||
case 1:
|
||||
|
@ -518,7 +518,7 @@ static void CB2_PokeblockFeed(void)
|
||||
RunTasks();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
do_scheduled_bg_tilemap_copies_to_vram();
|
||||
DoScheduledBgTilemapCopiesToVram();
|
||||
UpdatePaletteFade();
|
||||
}
|
||||
|
||||
@ -536,7 +536,7 @@ static bool8 TransitionToPokeblockFeedScene(void)
|
||||
case 0:
|
||||
sPokeblockFeed = AllocZeroed(sizeof(*sPokeblockFeed));
|
||||
SetVBlankHBlankCallbacksToNull();
|
||||
clear_scheduled_bg_copies_to_vram();
|
||||
ClearScheduledBgCopiesToVram();
|
||||
gMain.state++;
|
||||
break;
|
||||
case 1:
|
||||
|
@ -2146,7 +2146,7 @@ static void VblankCb_PSS(void)
|
||||
static void Cb2_PSS(void)
|
||||
{
|
||||
RunTasks();
|
||||
do_scheduled_bg_tilemap_copies_to_vram();
|
||||
DoScheduledBgTilemapCopiesToVram();
|
||||
ScrollBackground();
|
||||
sub_80CAA14();
|
||||
AnimateSprites();
|
||||
@ -2214,7 +2214,7 @@ static void sub_80C7E98(void)
|
||||
gReservedSpriteTileCount = 0x280;
|
||||
sub_80D2A90(&sPSSData->unk_0020, sPSSData->unk_0028, 8);
|
||||
gKeyRepeatStartDelay = 20;
|
||||
clear_scheduled_bg_copies_to_vram();
|
||||
ClearScheduledBgCopiesToVram();
|
||||
sub_80D259C(3);
|
||||
sub_80D2644(0, 1, gUnknown_0857239C, 8, 4);
|
||||
sub_80D2770(0, 1, 0);
|
||||
|
@ -1120,7 +1120,7 @@ static void MainCB2(void)
|
||||
RunTasks();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
do_scheduled_bg_tilemap_copies_to_vram();
|
||||
DoScheduledBgTilemapCopiesToVram();
|
||||
UpdatePaletteFade();
|
||||
}
|
||||
|
||||
@ -1143,7 +1143,7 @@ static bool8 LoadGraphics(void)
|
||||
case 0:
|
||||
SetVBlankHBlankCallbacksToNull();
|
||||
ResetVramOamAndBgCntRegs();
|
||||
clear_scheduled_bg_copies_to_vram();
|
||||
ClearScheduledBgCopiesToVram();
|
||||
gMain.state++;
|
||||
break;
|
||||
case 1:
|
||||
|
@ -1244,7 +1244,7 @@ void DoRayquazaScene(u8 animId, bool8 onlyOneAnim, void (*callback)(void))
|
||||
static void CB2_InitRayquazaScene(void)
|
||||
{
|
||||
SetVBlankHBlankCallbacksToNull();
|
||||
clear_scheduled_bg_copies_to_vram();
|
||||
ClearScheduledBgCopiesToVram();
|
||||
ScanlineEffect_Stop();
|
||||
FreeAllSpritePalettes();
|
||||
ResetPaletteFade();
|
||||
@ -1260,7 +1260,7 @@ static void CB2_RayquazaScene(void)
|
||||
RunTasks();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
do_scheduled_bg_tilemap_copies_to_vram();
|
||||
DoScheduledBgTilemapCopiesToVram();
|
||||
UpdatePaletteFade();
|
||||
}
|
||||
|
||||
|
@ -1684,7 +1684,7 @@ void CB2_OpenFlyMap(void)
|
||||
break;
|
||||
case 3:
|
||||
LoadUserWindowBorderGfx(0, 0x65, 0xd0);
|
||||
clear_scheduled_bg_copies_to_vram();
|
||||
ClearScheduledBgCopiesToVram();
|
||||
gMain.state++;
|
||||
break;
|
||||
case 4:
|
||||
@ -1747,7 +1747,7 @@ static void CB2_FlyMap(void)
|
||||
sFlyMap->callback();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
do_scheduled_bg_tilemap_copies_to_vram();
|
||||
DoScheduledBgTilemapCopiesToVram();
|
||||
}
|
||||
|
||||
static void SetFlyMapCallback(void callback(void))
|
||||
|
@ -467,7 +467,7 @@ void CB2_InitResetRtcScreen(void)
|
||||
|
||||
static void sub_809F048(void)
|
||||
{
|
||||
clear_scheduled_bg_copies_to_vram();
|
||||
ClearScheduledBgCopiesToVram();
|
||||
ResetBgsAndClearDma3BusyFlags(0);
|
||||
InitBgsFromTemplates(0, sBackgroundTemplates, ARRAY_COUNT(sBackgroundTemplates));
|
||||
ScheduleBgCopyTilemapToVram(0);
|
||||
@ -483,7 +483,7 @@ static void CB2_ResetRtcScreen(void)
|
||||
RunTasks();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
do_scheduled_bg_tilemap_copies_to_vram();
|
||||
DoScheduledBgTilemapCopiesToVram();
|
||||
UpdatePaletteFade();
|
||||
}
|
||||
|
||||
|
@ -859,7 +859,7 @@ static void sub_8140388(void)
|
||||
SetBgTilemapBuffer(1, gUnknown_0203AB88->tilemapBuffers[2]);
|
||||
SetBgTilemapBuffer(2, gUnknown_0203AB88->tilemapBuffers[6]);
|
||||
InitWindows(gUnknown_085B614C);
|
||||
sub_8197200();
|
||||
InitTextBoxGfxAndPrinters();
|
||||
gUnknown_0203AB8C = 0;
|
||||
gUnknown_0203AB88->unk_397C = malloc_and_decompress(gUnknown_085B5DFC, &size);
|
||||
}
|
||||
|
@ -416,7 +416,7 @@ static void CB2_BuyMenu(void)
|
||||
RunTasks();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
do_scheduled_bg_tilemap_copies_to_vram();
|
||||
DoScheduledBgTilemapCopiesToVram();
|
||||
UpdatePaletteFade();
|
||||
}
|
||||
|
||||
@ -446,7 +446,7 @@ static void CB2_InitBuyMenu(void)
|
||||
ResetPaletteFade();
|
||||
ResetSpriteData();
|
||||
ResetTasks();
|
||||
clear_scheduled_bg_copies_to_vram();
|
||||
ClearScheduledBgCopiesToVram();
|
||||
gShopDataPtr = AllocZeroed(sizeof(struct ShopData));
|
||||
gShopDataPtr->scrollIndicatorsTaskId = 0xFF;
|
||||
gShopDataPtr->itemSpriteIds[0] = 0xFF;
|
||||
|
@ -417,7 +417,7 @@ void CB2_ChooseStarter(void)
|
||||
|
||||
DeactivateAllTextPrinters();
|
||||
LoadUserWindowBorderGfx(0, 0x2A8, 0xD0);
|
||||
clear_scheduled_bg_copies_to_vram();
|
||||
ClearScheduledBgCopiesToVram();
|
||||
ScanlineEffect_Stop();
|
||||
ResetTasks();
|
||||
ResetSpriteData();
|
||||
@ -477,7 +477,7 @@ static void MainCallback2_StarterChoose(void)
|
||||
RunTasks();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
do_scheduled_bg_tilemap_copies_to_vram();
|
||||
DoScheduledBgTilemapCopiesToVram();
|
||||
UpdatePaletteFade();
|
||||
}
|
||||
|
||||
|
@ -660,7 +660,7 @@ static void LoadWallClockGraphics(void)
|
||||
InitWindows(gUnknown_085B21DC);
|
||||
DeactivateAllTextPrinters();
|
||||
LoadUserWindowBorderGfx(0, 0x250, 0xd0);
|
||||
clear_scheduled_bg_copies_to_vram();
|
||||
ClearScheduledBgCopiesToVram();
|
||||
ScanlineEffect_Stop();
|
||||
ResetTasks();
|
||||
ResetSpriteData();
|
||||
@ -780,7 +780,7 @@ static void WallClockMainCallback(void)
|
||||
RunTasks();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
do_scheduled_bg_tilemap_copies_to_vram();
|
||||
DoScheduledBgTilemapCopiesToVram();
|
||||
UpdatePaletteFade();
|
||||
}
|
||||
|
||||
|