include/field/field.h
The field engine's shared functions, globals and actor scripts.
#include "edition.h"#include "fixed_math.h"#include "static_assert.h"#include "types.h"#include "field/actor.h"#include "field/field_functions.h"#include "field/scene_tables.h"#include "system/globals.h"#include "window/menu_list.h"#include "graphics/render_placement.h"
Included by battle_effect_internal.h, actor_script.c, actor_script_operands.c, actor_scripts.c, field_engine_tables.c, map_grid_data.c, sprite_color_tables.c, world_map_encounter_rules.c, world_map_resources.c, menu_internal.h, menu_tables.c, sound.c, map_grid.h, script.h, script_inline.h and import.h.
Structures
| Name | Description | |
|---|---|---|
struct | PATH_RECORDER | The Colosso opponent's path player, at the start of SceneLocalState: the path in COLOSSO_RACE_STATE is played back or recorded by scColossoUpdatePathOpponent. |
struct | SWITCH_METATILE | A Venus Lighthouse switch or pillar socket's map metatile. |
struct | LINE_SCROLL_STATE | The line scroll's state: two pages of BG1 to BG3 scroll offsets for each of the 160 scanlines, and the sine wave that bends them on each axis. |
Macros
| Name | Description | |
|---|---|---|
#define | ActorsWork (*(ACTOR **)&HeapSlots[HEAP_SLOT_ACTORS]) | The ACTOR_COUNT actors (HEAP_SLOT_ACTORS), 112 bytes each. |
#define | ACTOR_SPRITE_KIND_MASK 15 | ACTOR.spriteStorageKind's low four bits, its ACTOR_SPR_KIND. |
#define | ACTOR_CREATE_KIND (kind) ((kind) << 12) | An fdActorCreate id of ACTOR_CREATE kind, above its sprite. |
#define | ACTOR_CREATE_SPRITE_MASK 0xfff | The sprite id in fdActorCreate's id, below its ACTOR_CREATE (id / 4096). |
#define | SHAKE_KEEP (-1) | A screen shake's component left as it is; any negative value does. |
#define | LineScroll (*(LINE_SCROLL_STATE **)&HeapSlots[HEAP_SLOT_LINE_SCROLL]) | The line scroll's state, HEAP_SLOT_LINE_SCROLL under its own name, which scLineScrollInitWave takes for a scene's wave. |
#define | LINE_SCROLL_WAVE_ENTRIES 256 | The entries of a wave's sine, one cycle. |
#define | LINE_SCROLL_WAVE_SCALE 256 | A wave's offset is its sine entry times its 16.16 amplitude, over this: an amplitude of toFIXED(1) swings 16 pixels each way. |
#define | LINE_SCROLL_WAVE_SINE | The entries of LineScrollWaveSine, which the Lemurian ship's ripple keeps again in its overlay. |
Enumerations
| Name | Description | |
|---|---|---|
enum | WORLD_MAP_LIGHTHOUSE { WORLD_MAP_LIGHTHOUSE_MERCURY, WORLD_MAP_LIGHTHOUSE_VENUS } | The lighthouse whose beacon the world map shows lit (scWorldMapPlayLighthouseTransition), as WorldMapPalettes orders their colours. |
enum | ACTOR_SYSTEM_MODE { ACTOR_SYSTEM_MAP, ACTOR_SYSTEM_WORLD_MAP, ACTOR_SYSTEM_BATTL … } | How the actor system runs (fdActorSystemInit): which camera follows the actors and which update moves them. |
enum | ANIMATION_FACING_KIND { ANIM_FACING_NONE, ANIM_FACING_ONE_PICTURE, ANIM_FACING_FRONT … } | SPR_ANIMATION.kind: the facing table a sprite animation's pictures follow (fdSpriteComposePicture, facing.c). |
enum | SPR_PICTURE_CODEC { SPRITE_PICTURE_RAW, SPRITE_PICTURE_TAGGED_LZ, SPRITE_PICTURE … } | SPR_ANIMATION.mode, from the metadata's pictureCodec: how a sprite animation's pictures are stored. |
enum | SPR_FLAG { SPRITE_FLAG_SHADOW, SPRITE_FLAG_OUTLINED } | SPR.flags. |
enum | ACTOR_SPR_KIND { ACTOR_SPRITE_NONE, ACTOR_SPRITE_ONE, ACTOR_SPRITE_GROUP } | ACTOR.spriteStorageKind, its low four bits: what the actor's sprite pointer holds. |
enum | ACTOR_CREATE { ACTOR_CREATE_ONE_SPRITE, ACTOR_CREATE_GROUP, ACTOR_CREATE_NO … } | fdActorCreate's id / 4096: what sprites the actor is made with. |
enum | WORLD_MAP_COLLISION { WORLD_MAP_COLLISION_WALKABLE_FIRST, WORLD_MAP_COLLISION_SHAL … } | The world map's collision values (fdWorldMapGetCollision), 1 to 15; each indexes a row of WorldMapBattleEnvironments. |
enum | BATTLE_ENVIRONMENT { BATTLE_ENVIRONMENT_NONE, BATTLE_ENVIRONMENT_GRASSLAND, BATTL … } | A world map battle environment (WorldMapBattleEnvironments, fdWorldMapGetBattleEnvironment): what its ground means for battles, named by the battle background fdBattleBackgroundSelectForEnvironment gives it. |
enum | WORLD_MAP_ENCOUNTER_REGION { WORLD_MAP_ENCOUNTER_REGION_VALE_VAULT, WORLD_MAP_ENCOUNTER_R … } | A world map metatile's encounter region (bits 30..24 of its block word), which picks its encounter zones (WorldMapEncounterRules), each named for the places whose entrances lie in it. |
enum | TERRAIN_KIND { TERRAIN_FLAT, TERRAIN_SLOPE_X, TERRAIN_SLOPE_Y, TERRAIN_STEP … } | A map metatile's terrain kind: the low four bits of its shape's first byte, which pick its height function from MapGridTerrainHeightFunctions. |
enum | COLLISION { COLLISION_TOO_LOW, COLLISION_NONE, COLLISION_TOO_HIGH, COLLI … } | What fdMapGridCheckCollision says of a step to a position. |
Variables
| Name | Description | |
|---|---|---|
extern Sint32 | CameraUnreadWordA | An IWRAM word the scrolling camera's setup clears; nothing in the tree reads it. |
extern Sint32 | CameraUnreadWordB | The second IWRAM word the scrolling camera's setup clears; also unread. |
extern const Sint32 | ActorDefaultScript [] | The script fdActorCreate gives every new actor: it does nothing and returns to the idle script. |
extern const Uint8 | WorldMapBattleEnvironments [] | World map battle environments (BATTLE_ENVIRONMENT), indexed by the collision value plus 16 when the block word's top bit is set, or plus 32 (whatever that bit) for WORLD_MAP_ENCOUNTER_REGION_SNOWFIELD. |
extern Uint8 | RenderDecodePictureCodeSize [] | The size of fdRenderDecodePicture, copied to HEAP_SLOT_TICK_SCRATCH; an address equal to the size (ld_script.ld). |
extern const Uint8 | SpriteColorGreyTable [] | Four 256-byte colour tables (remap0 to remap3), indexed by pixel: the SPR_COL_MODE tables after SpriteColorTables' five, the first also remapping the command icons (fdSpriteColorRemapPixels). |
extern const Sint32 | DustPuffLongScript [] | One of a ledge jump's dust puffs (fdEffectSpawnDustPuff): SC_WAIT(1) looped 38 times, then SC_RELEASE. |
extern const Sint32 | DustPuffShortScript [] | The other dust puff: the same, looped 18 times. |
extern Uint32 | WorldMapGraphicsResources [][6] | Each set is a palette and five tilesets: fdWorldMapLoadGraphics decodes the palette into BG palettes 0 to 13, the next four into the two halves of char blocks 2 and 3, and the last into MapGridAnimationTiles, where the tileset animations copy their pictures from. |
extern const Sint32 | ActorWaitScript [] | SC_WAIT(40), then SC_RELEASE: the one-off attached effect that ends by itself (fdEffectSetAttached, ATTACHED_EFFECT_ONCE). |
extern const Uint8 | FieldEffectSparkleTiles [] | The sparkles' 16 by 16 tiles, packed (fdEffectInitSparkles). |
extern const Uint8 | FieldExamineCueMessageOffsets [] | The message of each searchable metatile behavior from 242 to 247, as an offset from MsgTileChecked and MsgTileResult. |
extern const Uint8 | FieldEffectMoteTiles [] | The motes of light's 16 by 16 tiles, packed (fdMotesStart). |
extern Sint32 | DjinnFiguresSpriteIds [] | The sprites of the four Djinn DjinnFigures shows: a Venus, a Mercury, a Mars and a Jupiter Djinni. |
extern Sint32 | ShipRoomsShakeTimer | Ticks left of the Kraken's current jolt. |
extern const Uint8 | WorldMapPackedPictures [] | The lighthouse transition's pictures, packed (tagged LZ), decoded 4 KB after the tiles (scWorldMapPlayLighthouseTransition). |
extern const Uint8 | WorldMapPackedTiles [] | The lighthouse transition's tiles, packed (tagged LZ). |
extern const Uint8 | WorldMapPalettes [] | The lighthouse transitions' palettes, 32 bytes each, loaded as BG palette 14; indexed by WORLD_MAP_LIGHTHOUSE. |
extern Uint16 | ColossoGaugePalette [] | The race gauge's 16 colours, loaded as OBJ palette 14 (scColossoDrawGauge). |
extern Uint16 | LogRoomsACorneredTicks | Ticks in a row the chase has found a suspect cornered; at LOG_ROOMS_A_CORNERED_TICKS the chase raises its script. |
extern Uint8 | fdActorUpdateAllCodeSize [] | The size of fdActorUpdateAll's code, an address equal to the size (ld_script.ld). |
extern const Uint8 | ActorBlinkSpriteColors [] | A blinking actor's colour mode by tick ((TickCount >> 1) & 3, fdActorUpdateBlink): white for two ticks out of eight. |
extern const Sint32 | MovementTypeStandScript [] | The actor motion scripts: movement types 1 to 7, which fdActorSetMovementType starts by number, and two turning scripts with no movement type number. |
extern const Sint32 | MovementTypeWanderScript [] | Movement type 2: wanders within 16 pixels of home (SC_WANDER_HOME) at half a pixel a tick. |
extern const Sint32 | MovementTypeWanderNearScript [] | Movement type 3: the same within 8 pixels of home. |
extern const Sint32 | MovementTypeWanderCloseScript [] | Movement type 4: wanders within 6 pixels of home at 0.4 pixels a tick. |
extern const Sint32 | ActorLaunchScript [] | Waits to arrive, then turns by fdActorStepAngle until it faces the kept angle (fdActorLaunchFromLeader). |
extern const Sint32 | MovementTypeFollowWatchedScript [] | Movement type 5: fdActorMoveTowardTarget every tick, forever. |
extern const Sint32 | MovementTypeResetActionScript [] | Movement type 7: fdActorClearSpriteAndCollisionFlags once, then SC_END. |
extern const Sint32 | ActorStepAngleScript [] | Turns by fdActorStepAngle until it faces the kept angle, then SC_END. |
extern const Sint32 | MovementTypeFaceLeaderScript [] | Movement type 6: turns toward the leader every tick, forever. |
extern const Sint32 | RepeatedSquashScript [] | An actor squashes and springs back as many times as fdActorStartRepeatedMotion asks, 1 to 3: the motion is written three times, 32 words each, and a run of count motions starts (3 - count) * 32 words in and runs to the end. |
extern Uint8 | HeatGaugeTiles [] | Lamakan Desert's heat gauge (scHeatGaugeStart and scHeatGaugeDraw). |
extern const Uint16 | HeatGaugePalette [16] | The gauge's 16 colours, loaded as OBJ palette 14. |
extern Uint8 | fdRenderDecodePicture [] | The sprite picture decoder, ARM code run from a copy in HEAP_SLOT_TICK_SCRATCH. |
extern Uint8 | SolSanctumStatueSpriteRowsGraphics [] | The statue scene's three scrolling strips, packed (syDecompressByteLZ). |
extern Uint32 | PushedActorRectangleKinds [] | The six large things' sprite animations, which pick their rectangles in PushedActorRectangles; each scene with them defines its own. |
extern const Uint8 | fdTileMapDrawRows [] | The tilemap row drawer, run from a copy in HEAP_SLOT_RAM_CODE_TEMP. |
extern Uint8 | fdTileMapDrawRowsCodeSize [] | The size of fdTileMapDrawRows (picture_decode.s). |
extern Uint8 | fdWorldMapUpdateAffineLinesCodeSize | The size of fdWorldMapUpdateAffineLines, copied to HEAP_SLOT_RAM_CODE; an address equal to the size (ld_script.ld). |
extern const Sint32 | WorldMapFootprintActions [6] | Two scripts for the World Map's footprint and dust effects: wait 120 or 30 ticks, then release the actor. |
extern const Sint16 | WorldMapKeyHeadings [16] | The direction pad's headings, defined as Uint16 in facing.c. |
extern const Uint16 | InputDpadAngles [] | The field effects' scripts and tables (field_engine_tables.c, actor_scripts.c, field_effect_tables.c and graphics/field_effects/field_effects.list.tsv). |
extern const Sint8 | HaltFlickerColorModes [] | The colour modes a Halted actor flickers through at random (fdPsynergyUpdateHaltedActor, script_commands_halt.c): its own colours twice as often as each of the five channel swaps and grey. |
extern const Uint8 | FieldEffectArcSparkTiles [] | The 32 by 16 spark of Avoid's falling arcs (arc_spark.png), 4 bits a pixel; fdPsynergyAvoid loads it. |
extern const Sint32 | GrowthLeafScript [] | Growth's falling leaves: each waits 60 ticks and releases itself. |
extern const Sint32 | ForceFistScript [] | Waits to arrive, sets off fdEffectSpawnHeavyImpact and releases the actor: Force's fist as it lands. |
extern const Sint32 | EmoteBubbleScript [] | The emote bubble's script (fdActorShowEmoteById): eight 2-tick steps of squash and stretch (SC_ADD to SW_SCALE_X and SW_SCALE_Y), 30 ticks still, then SC_RELEASE. |
extern const Sint32 | FieldEffectParticleScript [] | Sinks a quarter pixel a tick for 60 ticks, then disappears. |
extern const Uint32 | FieldEffectPulseScales [] | Two scales that alternate ((FrameCount >> 2) & 1): full size and 0.97 of it (fdEffectPulseActorScale, script_commands_jupiter.c); nothing reads the third word. |
extern const Sint32 | FieldEffectSourceHoldScript [] | Faces the watched actor every tick, forever: the caster holding its target while Move, Carry or Lift has it (each gives the caster its target first). |
extern const Sint16 | FieldEffectTargetRangeByMode [] | {field Psynergy kind, range in pixels}, ended by -1; a kind not listed reaches 16 pixels. |
extern const Sint32 | FieldEffectUntargetedActorScript [] | A lone SC_RELEASE: an actor that has arrived releases itself (fdMindReadUpdateCrescent). |
extern const Uint8 | FieldEffectSparkTiles [] | The 32 by 16 spark a field Psynergy's particles draw (spark.png), 4 bits a pixel; fdPsynergyLoadResources loads it. |
extern const Uint8 | FieldEffectQuadrantModes [] | Move's hand animation by the quarter turns from its side of the target to the push (script_commands_move.c): 3 toward its side, 2 away from it, 1 either way across. |
extern const Sint32 | FieldPsynergyCastColors [] | The eight tints (PALETTE_TINT_CUSTOM and an RGB555 colour) a field Psynergy fades the palettes toward, picked by the tick counter or by the FLAG_PSYNERGY_TINT flags (fdPsynergyFadeToCastColor). |
extern const Sint16 | WeatherRainSplashFrames [] | {dx, dy, tile, shape, size} for each of the 16 frames of a raindrop's splash (script_commands_weather.c): dx and dy in screen pixels from its spot, tile from its first tile. |
extern const Uint8 | WeatherParticleTiles [] | The ground particles' 16 by 16 tiles, packed (syDecompressByteLZ). |
extern const Uint8 | SpriteColorTables [][256] | The first five 256-byte colour tables of SPR_COL_MODE, indexed by pixel. |
extern const Uint8 | ActorShadowTiles [] | The sprites' shadow, 16 by 8 at 256 colours, loaded into VRAM cache entry 93. |
extern const Sint32 | ActorKeyCheckScript [] | The built-in scripts an actor script can hand its actor to: key checks, the player, the world map and the camera (actor_script.c). |
extern const Sint32 | ActorKeysScript [] | |
extern const Sint32 | ActorPlayerScript [] | |
extern const Sint32 | ActorWorldMapScript [] | |
extern const Sint32 | ActorCameraScript [] | |
extern const Sint32 | ActorApproachWatchedScript [] | |
extern const Sint32 | ActorIdleScript [] | The idle script fdActorStartIdle gives an actor. |
extern const Sint16 | LineScrollWaveSine [] | One cycle of sine in 256 entries, 4.12 fixed point (4096 at the peak). |
extern Uint8 | PlayerActorId [] | Read as a halfword by fdActorSetOthersPaused: the actor id of the player's actor, which it leaves alone. |
Description
The field engine's shared functions, globals and actor scripts.
Macros in detail
ActorsWork
#define ActorsWork (*(ACTOR **)&HeapSlots[HEAP_SLOT_ACTORS])
The ACTOR_COUNT actors (HEAP_SLOT_ACTORS), 112 bytes each.
Referenced by fdActorFindFree(), fdActorFindNearestFacingTarget(), fdActorScriptCheckOverlap(), fdActorScriptFindOverlappingActor(), fdActorSetRevealSpriteColor(), fdActorSystemPlaceSprites(), fdActorSystemProjectSprites(), fdActorUpdateAllMotion(), fdActorUpdateAllOnField(), fdActorUpdatePlayerControl(), fdEffectReleaseRevealSparkles(), fdItemDisplayShowItemInFront() and fdPsynergyEnd().
Definition at line 78 of file field.h.
ACTOR_SPRITE_KIND_MASK
#define ACTOR_SPRITE_KIND_MASK 15
ACTOR.spriteStorageKind's low four bits, its ACTOR_SPR_KIND.
Referenced by btActorDetachSpriteScripts(), btActorGetSprite(), btHighlightSetSpriteMode(), btMotionPlayHitFlash(), btObjectUpdateSpritePriorities(), fdActorAddSpriteAnimation(), fdActorGetScreenPos(), fdActorRelease(), fdActorSetAnimationAndSpeed(), fdActorSetFirstSpriteAnimation(), fdActorSetLayersColorMode(), fdActorSetSpriteColor(), fdActorSetSpriteFlags(), fdActorSetSpritePriority(), fdActorSetSpriteRotation(), fdActorSystemPlaceSprites(), fdActorSystemProjectSprites(), fdActorUpdateBlink() and scValePrologueSetActorColorMode().
Definition at line 284 of file field.h.
ACTOR_CREATE_KIND
#define ACTOR_CREATE_KIND(kind) ((kind) << 12)
An fdActorCreate id of ACTOR_CREATE kind, above its sprite.
Referenced by btObjectMake() and fdActorResetForLeader().
Definition at line 298 of file field.h.
ACTOR_CREATE_SPRITE_MASK
#define ACTOR_CREATE_SPRITE_MASK 0xfff
The sprite id in fdActorCreate's id, below its ACTOR_CREATE (id / 4096).
Referenced by fdActorCreate().
Definition at line 301 of file field.h.
SHAKE_KEEP
#define SHAKE_KEEP (-1)
A screen shake's component left as it is; any negative value does.
Referenced by scAltinBeastHop(), scAltinBeastHopAway(), scAltinPeakFlickerWaterAway(), scAltinPeakForceLogOver(), scAltinPeakPlayLandingShake(), scAltinPeakReadFallingRockSign(), scAltinPeakRunBoulderChase(), scAltinPeakUpdateBeastHops(), scAltmillerCaveReleaseWallBurst(), scBabiLighthouseLandWithParticles(), scColosseumEntranceShowClearedTrial(), scCrossboneIsleKeysBaneSecondEscape(), scCrossboneIsleKeysOpenBlueDoor(), scCrossboneIsleKeysOpenRedDoor(), scGomaCavePillarPushStumpOver(), scGondowanCaveLeapStump(), scInit(), scKolimaLowerBridge(), scLeapStump(), scLemurianShipRaiseTheShip(), scLunpaFortressActivateLeverTrap(), scLunpaFortressMoveCrates(), scLunpaFortressUnlockCaveDoor(), scLunpaFortressUnlockGroundFloorDoor(), scLunpaFortressUnlockToadonpaDoor(), scLunpaFortressUnlockUpperFloorDoor(), scMercuryLighthouseAeriePartyArrives(), scMercuryLighthouseDrawNorthJetTiles(), scMercuryLighthouseExitWhenChannelsOpen(), scMercuryLighthousePlyOpensWaterfallPassage(), scMercuryLighthouseRestoreNorthJetTiles(), scMogallForestKillerApeAttacks(), scShipRoomsNoticeShipRocking(), scShipRoomsShakeWhileKrakenOnDeck(), scSolSanctumElementalStarRoomBagJupiterStar(), scSolSanctumElementalStarRoomBagMercuryStar(), scSolSanctumElementalStarRoomBagVenusStar(), scSolSanctumElementalStarRoomTakeMarsStar(), scSolSanctumEntranceReactToOpeningPassage(), scSolSanctumEntranceUpdateEruptionRumbles(), scSolSanctumEruptionPlayHostageScript(), scSolSanctumEruptionPlayWiseOneRescue(), scSolSanctumEruptionStepShards(), scSolSanctumLunaSolRoomsArriveAfterWiseOnesRescue(), scSolSanctumLunaSolRoomsUpdateFirstFallingLight(), scSolSanctumStatueCenterStatueMoved(), scTolbiShipDeckJumpIntoKrakenBattle(), scTreeRoomsLandFromFall(), scTunnelRuinsRaiseSteppingStone(), scValeEruptionReturnFromMtAleph() and 17 more.
Definition at line 423 of file field.h.
LineScroll
#define LineScroll (*(LINE_SCROLL_STATE **)&HeapSlots[HEAP_SLOT_LINE_SCROLL])
The line scroll's state, HEAP_SLOT_LINE_SCROLL under its own name, which
scLineScrollInitWave takes for a scene's wave.
Referenced by fdLineScrollArmDMA() and fdLineScrollBuildPage().
Definition at line 467 of file field.h.
LINE_SCROLL_WAVE_ENTRIES
#define LINE_SCROLL_WAVE_ENTRIES 256
The entries of a wave's sine, one cycle.
Referenced by fdLineScrollBuildPage(), LemurianShipRippleSine and scLemurianShipWaveOffset().
Definition at line 473 of file field.h.
LINE_SCROLL_WAVE_SCALE
#define LINE_SCROLL_WAVE_SCALE 256
A wave's offset is its sine entry times its 16.16 amplitude, over this: an
amplitude of toFIXED(1) swings 16 pixels each way.
Referenced by fdLineScrollBuildPage() and scLemurianShipWaveOffset().
Definition at line 477 of file field.h.
LINE_SCROLL_WAVE_SINE
#define LINE_SCROLL_WAVE_SINE
The entries of LineScrollWaveSine, which the Lemurian ship's ripple keeps
again in its overlay.
Referenced by LemurianShipRippleSine and LineScrollWaveSine.
Definition at line 481 of file field.h.
Enumerations in detail
WORLD_MAP_LIGHTHOUSE
enum WORLD_MAP_LIGHTHOUSE
The lighthouse whose beacon the world map shows lit
(scWorldMapPlayLighthouseTransition), as WorldMapPalettes orders their
colours.
| Enumerator | Value | Description |
|---|---|---|
WORLD_MAP_LIGHTHOUSE_MERCURY | ||
WORLD_MAP_LIGHTHOUSE_VENUS |
Referenced by scWorldMapPlayLighthouseTransition().
Definition at line 91 of file field.h.
ACTOR_SYSTEM_MODE
enum ACTOR_SYSTEM_MODE
How the actor system runs (fdActorSystemInit): which camera follows the
actors and which update moves them.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_SYSTEM_MAP | 2 | A town, a dungeon or the sprite viewer: the scrolling camera. |
ACTOR_SYSTEM_WORLD_MAP | 3 | The world map: the fixed camera, which projects 3D points onto the screen. |
ACTOR_SYSTEM_BATTLE | 4 | A battle: the fixed camera, and the battle's own motion update. |
Definition at line 208 of file field.h.
ANIMATION_FACING_KIND
enum ANIMATION_FACING_KIND
SPR_ANIMATION.kind: the facing table a sprite animation's pictures follow
(fdSpriteComposePicture, facing.c).
| Enumerator | Value | Description |
|---|---|---|
ANIM_FACING_NONE | 0 | The animation script's own picture whatever the facing; zero also marks a free sprite animation. |
ANIM_FACING_ONE_PICTURE | 1 | 8 sectors: one picture, mirrored to the left. |
ANIM_FACING_FRONT_BACK | 2 | 8 sectors: a front and a back picture. |
ANIM_FACING_THREE_PICTURES | 3 | 16 sectors: front, side and back. |
ANIM_FACING_FOUR_PICTURES | 4 | 64 sectors, with four pictures. |
ANIM_FACING_FIVE_PICTURES | 5 | 16 sectors, with five pictures. |
ANIM_FACING_SIX_PICTURES | 6 | 64 sectors, with six pictures. |
ANIM_FACING_EIGHT_PICTURES | 8 | 8 sectors centred on the compass directions, a picture for each. |
ANIM_FACING_TWO_PART | 20 | ANIM_FACING_FRONT_BACK's table for a sprite drawn in two parts, the second the next sprite id (the sprite viewer). |
ANIM_FACING_FRONT_BACK_SWAPPED | 22 | As ANIM_FACING_FRONT_BACK, with the front picture mirrored the other way. |
ANIM_FACING_EIGHT_NO_TABLE | 44 | Unused: no sprite's metadata or animation takes this kind. Ringed as eight facings by the sprite viewer, but with no facing table: fdSpriteComposePicture draws it as ANIM_FACING_NONE. |
ANIM_FACING_EIGHT_PICTURES_MIRRORED | 88 | As ANIM_FACING_EIGHT_PICTURES, with three of the pictures mirrored. |
Definition at line 220 of file field.h.
SPR_PICTURE_CODEC
enum SPR_PICTURE_CODEC
SPR_ANIMATION.mode, from the metadata's pictureCodec: how a sprite
animation's pictures are stored. Any other value is raw, for the picture
decoder.
| Enumerator | Value | Description |
|---|---|---|
SPRITE_PICTURE_RAW | 0 | |
SPRITE_PICTURE_TAGGED_LZ | 1 | syDecompressTaggedLZ's format |
SPRITE_PICTURE_LZ | 3 | LZ-compressed |
Definition at line 259 of file field.h.
SPR_FLAG
enum SPR_FLAG
SPR.flags.
| Enumerator | Value | Description |
|---|---|---|
SPRITE_FLAG_SHADOW | 1 << 0 | its shadow is drawn; set when created |
SPRITE_FLAG_OUTLINED | 1 << 1 | Drawn as an outline, in ACTOR_SYSTEM_STATE's edge and fill colours. |
Definition at line 267 of file field.h.
ACTOR_SPR_KIND
enum ACTOR_SPR_KIND
ACTOR.spriteStorageKind, its low four bits: what the actor's sprite pointer
holds.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_SPRITE_NONE | 0 | nothing drawn |
ACTOR_SPRITE_ONE | 1 | |
ACTOR_SPRITE_GROUP | 2 | a list of up to four sprites, empty ones null |
Definition at line 276 of file field.h.
ACTOR_CREATE
enum ACTOR_CREATE
fdActorCreate's id / 4096: what sprites the actor is made with.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_CREATE_ONE_SPRITE | 0 | the id's sprite (ACTOR_SPRITE_ONE) |
ACTOR_CREATE_GROUP | 2 | The sprites of the id and id + 1 (ACTOR_SPRITE_GROUP). |
ACTOR_CREATE_NO_SPRITE | 8 | No sprite: any kind but the two above, and the one the camera actor takes. |
Definition at line 287 of file field.h.
WORLD_MAP_COLLISION
enum WORLD_MAP_COLLISION
The world map's collision values (fdWorldMapGetCollision), 1 to 15; each
indexes a row of WorldMapBattleEnvironments.
| Enumerator | Value | Description |
|---|---|---|
WORLD_MAP_COLLISION_WALKABLE_FIRST | 5 | The party walks only on WORLD_MAP_COLLISION_WALKABLE_FIRST to WORLD_MAP_COLLISION_WALKABLE_LAST (fdWorldMapIsWalkable). |
WORLD_MAP_COLLISION_SHALLOW_WATER | 6 | Shallow water: a ripple follows the leader as it walks. |
WORLD_MAP_COLLISION_DEFAULT | 7 | Where neither collision layer has a value. |
WORLD_MAP_COLLISION_FOREST | 9 | Forest: the leader's sprite shows |
WORLD_MAP_COLLISION_WALKABLE_LAST | 12 | its second layer and no shadow, and encounters take a region's forest zone. |
Definition at line 305 of file field.h.
BATTLE_ENVIRONMENT
enum BATTLE_ENVIRONMENT
A world map battle environment (WorldMapBattleEnvironments,
fdWorldMapGetBattleEnvironment): what its ground means for battles, named by
the battle background fdBattleBackgroundSelectForEnvironment gives it.
| Enumerator | Value | Description |
|---|---|---|
BATTLE_ENVIRONMENT_NONE | 0 | Sol Sanctum's background. |
BATTLE_ENVIRONMENT_GRASSLAND | 1 | ResourceIdGrasslandBackdrop. |
BATTLE_ENVIRONMENT_FOREST | 2 | ResourceIdForestBackdrop; encounters take a region's forest zone. |
BATTLE_ENVIRONMENT_DESERT | 3 | ResourceIdDesertBackdrop. |
BATTLE_ENVIRONMENT_BEACH | 4 | ResourceIdBeachBackdrop. |
BATTLE_ENVIRONMENT_SNOWFIELD | 5 | ResourceIdSnowfieldBackdrop. |
BATTLE_ENVIRONMENT_SNOW_FOREST | 6 | ResourceIdSnowfieldBackdrop, for the snowfield's forest. |
BATTLE_ENVIRONMENT_SHALLOWS | 7 | ResourceIdBeachBackdrop, for shallow water (WORLD_MAP_COLLISION_SHALLOW_WATER). |
Definition at line 327 of file field.h.
WORLD_MAP_ENCOUNTER_REGION
enum WORLD_MAP_ENCOUNTER_REGION
A world map metatile's encounter region (bits 30..24 of its block word),
which picks its encounter zones (WorldMapEncounterRules), each named for the
places whose entrances lie in it.
| Enumerator | Value | Description |
|---|---|---|
WORLD_MAP_ENCOUNTER_REGION_VALE_VAULT | 1 | also Lunpa and Goma Cave |
WORLD_MAP_ENCOUNTER_REGION_BILIBIN_KOLIMA | 2 | Also Bilibin Cave and the bridge out of Goma Cave. |
WORLD_MAP_ENCOUNTER_REGION_XIAN_ALTIN | 3 | Also Lama Temple and the Alpine Crossing. |
WORLD_MAP_ENCOUNTER_REGION_KALAY | 4 | Also the Lamakan Desert's cave and Gondowan Cave's north end. |
WORLD_MAP_ENCOUNTER_REGION_TOLBI | 5 | Also Kalay's docks, Altmiller Cave and the Gondowan Passage's north end. |
WORLD_MAP_ENCOUNTER_REGION_SUHALLA | 6 | Also Lalivero, the Venus Lighthouse and the road to Babi Lighthouse. |
WORLD_MAP_ENCOUNTER_REGION_SNOWFIELD | 21 | Takes the second world map graphics set |
WORLD_MAP_ENCOUNTER_REGION_FUCHIN | 31 | (fdWorldMapLoadGraphics) and the snowfield's battle environments (fdWorldMapGetBattleEnvironment). Fuchin Temple, the sign before Mogall Forest and the north end of Kolima Bridge. |
Definition at line 346 of file field.h.
TERRAIN_KIND
enum TERRAIN_KIND
A map metatile's terrain kind: the low four bits of its shape's first byte,
which pick its height function from MapGridTerrainHeightFunctions.
| Enumerator | Value | Description |
|---|---|---|
TERRAIN_FLAT | 0 | the first sample everywhere |
TERRAIN_SLOPE_X | 1 | from the first sample at x 0 towards the second |
TERRAIN_SLOPE_Y | 2 | from the first sample at y 0 towards the second |
TERRAIN_STEP_SUM_DIAGONAL | 3 | step across diagonal x + y = 15, higher sample on it |
TERRAIN_STEP_DIFFERENCE_DIAGONAL | 4 | step across diagonal x = y, higher sample on it |
TERRAIN_BEND_SUM_DIAGONAL | 5 | three samples, bending on the diagonal x + y = 15 |
TERRAIN_BEND_DIFFERENCE_DIAGONAL | 6 | three samples, bending on the diagonal x = y |
TERRAIN_ROUNDED_SQUARE | 7 | raised or sunken (TerrainRoundedSquareMask) |
TERRAIN_STEP_X | 8 | the first sample for x below 8, then the second |
TERRAIN_STEP_Y | 9 | the first sample for y below 8, then the second |
TERRAIN_BEND_X | 10 | three samples along x, bending at the middle |
TERRAIN_BEND_Y | 11 | three samples along y, read unsigned |
TERRAIN_SAMPLE_TABLE | 12 | sample TerrainSampleIndexTable picks for each pixel |
TERRAIN_SAMPLE_TABLE_MIRRORED | 13 | as TERRAIN_SAMPLE_TABLE, mirrored left to right |
TERRAIN_FLAT_B | 14 | flat as TERRAIN_FLAT, by a copy of its function |
TERRAIN_FLAT_C | 15 | flat as TERRAIN_FLAT, by another |
TERRAIN_KIND_COUNT | 16 | copy |
Definition at line 376 of file field.h.
COLLISION
enum COLLISION
What fdMapGridCheckCollision says of a step to a position.
| Enumerator | Value | Description |
|---|---|---|
COLLISION_TOO_LOW | -1 | the ground there is more than 12 pixels lower |
COLLISION_NONE | 0 | the actor can step there |
COLLISION_TOO_HIGH | 1 | the ground there is more than 8 pixels higher |
COLLISION_IMPASSABLE | 2 | the metatile there is a wall (METATILE_BEHAVIOR_WALL) |
Definition at line 413 of file field.h.
Variables in detail
CameraUnreadWordA
extern Sint32 CameraUnreadWordA
An IWRAM word the scrolling camera's setup clears; nothing in the tree reads it.
Referenced by fdActorSystemInit().
Definition at line 20 of file field.h.
CameraUnreadWordB
extern Sint32 CameraUnreadWordB
The second IWRAM word the scrolling camera's setup clears; also unread. With no reader to give them a role, the two are numbered in IWRAM order.
Referenced by fdActorSystemInit().
Definition at line 23 of file field.h.
RenderDecodePictureCodeSize
extern Uint8 RenderDecodePictureCodeSize[]
The size of fdRenderDecodePicture, copied to HEAP_SLOT_TICK_SCRATCH; an
address equal to the size (ld_script.ld).
Referenced by fdActorSystemPlaceSprites(), fdActorSystemProjectSprites() and fdSpriteComposePicture().
Definition at line 28 of file field.h.
FieldEffectSparkleTiles
extern const Uint8 FieldEffectSparkleTiles[]
The sparkles' 16 by 16 tiles, packed (fdEffectInitSparkles).
Referenced by fdEffectInitSparkles().
Definition at line 70 of file field.h.
FieldEffectMoteTiles
extern const Uint8 FieldEffectMoteTiles[]
The motes of light's 16 by 16 tiles, packed (fdMotesStart).
Referenced by fdMotesStart().
Definition at line 73 of file field.h.
WorldMapPackedPictures
extern const Uint8 WorldMapPackedPictures[]
The lighthouse transition's pictures, packed (tagged LZ), decoded 4 KB after
the tiles (scWorldMapPlayLighthouseTransition).
Referenced by scWorldMapPlayLighthouseTransition().
Definition at line 81 of file field.h.
WorldMapPackedTiles
extern const Uint8 WorldMapPackedTiles[]
The lighthouse transition's tiles, packed (tagged LZ).
Referenced by scWorldMapPlayLighthouseTransition().
Definition at line 83 of file field.h.
WorldMapPalettes
extern const Uint8 WorldMapPalettes[]
The lighthouse transitions' palettes, 32 bytes each, loaded as BG palette 14;
indexed by WORLD_MAP_LIGHTHOUSE.
Referenced by scWorldMapPlayLighthouseTransition().
Definition at line 86 of file field.h.
ColossoGaugePalette
extern Uint16 ColossoGaugePalette[]
The race gauge's 16 colours, loaded as OBJ palette 14 (scColossoDrawGauge).
Referenced by scColossoDrawGauge().
Definition at line 98 of file field.h.
fdActorUpdateAllCodeSize
extern Uint8 fdActorUpdateAllCodeSize[]
The size of fdActorUpdateAll's code, an address equal to the size
(ld_script.ld).
Referenced by fdActorRunUpdateAllFromHeap().
Definition at line 104 of file field.h.
HeatGaugeTiles
extern Uint8 HeatGaugeTiles[]
Lamakan Desert's heat gauge (scHeatGaugeStart and scHeatGaugeDraw). The
gauge's tiles, packed (tagged LZ).
Referenced by scHeatGaugeStart().
Definition at line 131 of file field.h.
HeatGaugePalette
extern const Uint16 HeatGaugePalette[16]
The gauge's 16 colours, loaded as OBJ palette 14.
Referenced by scHeatGaugeDraw().
Definition at line 133 of file field.h.
fdRenderDecodePicture
extern Uint8 fdRenderDecodePicture[]
The sprite picture decoder, ARM code run from a copy in
HEAP_SLOT_TICK_SCRATCH.
Referenced by fdActorSystemPlaceSprites(), fdActorSystemProjectSprites() and fdSpriteComposePicture().
Definition at line 136 of file field.h.
SolSanctumStatueSpriteRowsGraphics
extern Uint8 SolSanctumStatueSpriteRowsGraphics[]
The statue scene's three scrolling strips, packed (syDecompressByteLZ).
Referenced by scSolSanctumStatueInitScrollingSprites().
Definition at line 138 of file field.h.
fdTileMapDrawRows
extern const Uint8 fdTileMapDrawRows[]
The tilemap row drawer, run from a copy in HEAP_SLOT_RAM_CODE_TEMP.
Referenced by fdTileMapDrawRowsFromRam().
Definition at line 143 of file field.h.
fdTileMapDrawRowsCodeSize
extern Uint8 fdTileMapDrawRowsCodeSize[]
The size of fdTileMapDrawRows (picture_decode.s).
Referenced by fdTileMapDrawRowsFromRam().
Definition at line 145 of file field.h.
fdWorldMapUpdateAffineLinesCodeSize
extern Uint8 fdWorldMapUpdateAffineLinesCodeSize
The size of fdWorldMapUpdateAffineLines, copied to HEAP_SLOT_RAM_CODE; an
address equal to the size (ld_script.ld).
Referenced by fdWorldMapInitPerspective().
Definition at line 148 of file field.h.
FieldEffectArcSparkTiles
extern const Uint8 FieldEffectArcSparkTiles[]
The 32 by 16 spark of Avoid's falling arcs (arc_spark.png), 4 bits a pixel;
fdPsynergyAvoid loads it.
Referenced by fdPsynergyAvoid().
Definition at line 162 of file field.h.
FieldEffectSparkTiles
extern const Uint8 FieldEffectSparkTiles[]
The 32 by 16 spark a field Psynergy's particles draw (spark.png), 4 bits a
pixel; fdPsynergyLoadResources loads it.
Referenced by fdPsynergyLoadResources().
Definition at line 180 of file field.h.
WeatherParticleTiles
extern const Uint8 WeatherParticleTiles[]
The ground particles' 16 by 16 tiles, packed (syDecompressByteLZ).
Referenced by fdWeatherStartRain().
Definition at line 188 of file field.h.
ActorShadowTiles
extern const Uint8 ActorShadowTiles[]
The sprites' shadow, 16 by 8 at 256 colours, loaded into VRAM cache entry 93.
Referenced by fdActorSystemConfigure().
Definition at line 193 of file field.h.
PlayerActorId
extern Uint8 PlayerActorId[]
Read as a halfword by fdActorSetOthersPaused: the actor id of the player's
actor, which it leaves alone.
Referenced by fdActorSetOthersPaused().
Definition at line 509 of file field.h.