Alchemy
Loading...
Searching...
No Matches

field.h

Go to the documentation of this file.
1#ifndef ALCHEMY_FIELD_FIELD_H
2#define ALCHEMY_FIELD_FIELD_H
3
4/// @file
5/// The field engine's shared routines, globals and object scripts.
6
7#include "types.h"
8#include "edition.h"
9#include "object_runtime.h"
10#include "field_runtime.h"
11#include "field_scene.h"
12#include "menu_list.h"
13#include "farcall.h"
14
15struct DispatchObject;
16struct EffectPosition;
17
18extern s32 gIwram_Data1;
19extern s32 gIwram_Data2;
24
25struct AbilityListEntry;
27struct BattleUnit;
28struct BurstParticle;
29struct DispatchObject;
30struct FieldEffectObject;
31struct EffectPosition;
32struct EffectStep;
33struct FacingObject;
34struct FieldActor;
35struct FieldPosition;
37struct MapActor;
38struct MapCell;
39struct MenuSprite;
40struct ModeRecord;
41struct MotionObject;
42struct ObjectRuntime;
43struct FieldRecord;
44struct SceneEntrance;
45struct SceneEntry;
46struct SceneEvent;
47struct FieldSceneObject;
48struct ScenePlacement;
49struct SceneRegion;
50struct SparkleFrame;
51struct Swirl;
52struct TileRun2;
53struct V;
54union FieldObject;
55
56/// An actor seen only as its priority flags at 0x23 (enum ActorPriorityFlag).
57struct Flags35 {
58 u8 pad[35];
60};
61/// An actor seen only as the coordinate at 0x08, which Goma Cave's stump
62/// reads in 16-pixel map cells.
65 s32 depthFixed; ///< 16.16 fixed-point pixels
66};
67/// An actor seen only as its priority flags at 0x23 (enum ActorPriorityFlag).
69 u8 pad00[35];
71};
72/// The Colosso rival's path player in the scene state: its mode (1 playing, 2
73/// recording, 9 finished), whether it mirrors the path, the actor, its place
74/// in the path and how long the actor has stood still.
80 s16 still; ///< frames
81};
82struct Slot {
87};
88/// A Venus Lighthouse switch or pillar socket's map cell.
89struct SwitchCell {
90 u32 x; ///< 16-pixel map cells
91 u32 z; ///< 16-pixel map cells
92};
93struct T {
94 u8 pad00[30];
96};
97/// A log in Kolima Forest lying across four map cells, from its first cell
98/// across or, when vertical, down.
99struct TileRun {
101 s16 x; ///< map cells
102 s16 y; ///< map cells
106};
112extern const u8 gObjectMotion_WaitScript[];
113extern const u8 gFieldFx_SparkleTiles[];
114extern const u8 gField_TileMessageOffsets[];
115extern const u8 gFieldFx_MoteTiles[];
119struct BendLog;
120extern struct BendLog *gKolimaForestBendRecords;
122#ifndef OWN_gObjectSlots
123extern struct ObjectRuntime *gObjectSlots;
124#endif
125extern u32 gScanlineAngle;
126#ifndef OWN_gScanlinePitch
127extern u32 gScanlinePitch;
128#endif
130extern const u8 gWorldMapPackedFrames[];
131extern const u8 gWorldMapPackedTiles[];
132extern const u8 gWorldMapPalettes[];
133extern s32 gKalay_DanceStep;
136extern u8 gKolimaPalette_First[];
142extern s32 gColosso_MarkerOam[3];
164extern const u8 gObjectMotion_StepAngleScript[];
166extern const u8 gObjectMotion_VariantScripts[];
168extern const u16 gLamakanDesert_SandPalette[16];
169#ifndef OWN_LamakanDesert_SandPhase
171#endif
173#ifndef OWN_LamakanDesert_SandVramSlot
175#endif
176extern struct MenuSprite gLamakanDesert_SandWork[];
177#ifndef OWN_Render_DecodeFrame
178extern u8 Render_DecodeFrame[];
179#endif
182extern const u8 TileMap_DrawRows[];
185extern const s32 gWorldMap_FootprintActions[6];
186extern const s16 gWorldMap_KeyHeadings[16];
188void Engine_ActorFollow(s32 actor, s32 leader);
193#ifndef OWN_FieldScene_PrepareActors
195#endif
196#ifndef OWN_GameFlag_IsSet
198#endif
199void WorldMap_BeginStillView(void);
201#ifndef OWN_Object_Destroy
203#endif
205void SceneTable_Prepare(struct ScenePlacement *placements);
206
207#endif
u32 gStagedActor_FootprintKinds[]
struct SceneEvent gBabiPalace_Events2AfterColosso[]
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
const s32 gWorldMap_FootprintActions[6]
Two scripts for the world map's footprint and dust effects: wait 120 or 30 frames,...
Definition facing.c:121
const u16 gWorldMap_KeyHeadings[16]
The heading for each state of the direction pad (bits 4-7 of the keys); 0xffff means no direction is ...
Definition facing.c:113
Public interfaces to the engine's code banks.
void WorldMap_BeginStillView(void)
Freezes the world map's perspective view as a still picture on BG1: saves BG1's tiles,...
Definition world_map.c:701
s32 FarCall_BlankRunTable(s32 entrance)
u8 gLamakanDesert_SandEffectTiles[]
s16 gColosso_ModeBlendTarget
s16 gAltinPeak_PaletteStep
s16 gColosso_ModeScaleStep
u8 gObjectMotion_LaunchScript
s16 gColosso_ModeBlendStep
s32 FarCall_BlankLoadTable(s32 entrance)
s32 Math_Atan2(s32 dy, s32 dx)
u16 gLamakanDesert_SandPhase
s16 * gKolimaForestBendLayout
u8 Render_DecodeFrameCodeSize[]
const u8 gFieldFx_SparkleTiles[]
u32 gScanlinePitch
const u8 TileMap_DrawRows[]
s32 gColosso_MarkerOam[3]
u8 gSolSanctumStatue_SpriteRowsGfx[]
const u8 gFieldFx_MoteTiles[]
s16 gColosso_ModeBlendDuration
s16 gAltinPeak_PaletteHold
s16 gColosso_ModeMoveStart
s16 gColosso_ModeBlendStart
const u8 gWorldMapPalettes[]
u8 Transform_UpdateVerticesSize
s32 gColosso_CompetitorStartZ
void ScenePlacement_ClipToView(struct ScenePlacement *placements)
u16 gColosso_GaugePalette[]
s32 gColosso_CompetitorStartX
const u8 gObjectMotion_WaitScript[]
void Engine_ActorFollow(s32 actor, s32 leader)
struct BendLog * gKolimaForestBendRecords
u32 gKolimaForestBend_ShakeScroll[]
s16 gColosso_ModeScaleStart
s32 Engine_PartyRemoveItem(s32 item)
u8 TileMap_DrawRowsCodeSize[]
const u16 gLamakanDesert_SandPalette[16]
u16 gLamakanDesert_SandVramSlot
s32 gIwram_Data2
const u8 gObjectMotion_StepAngleScript[]
u8 Render_DecodeFrame[]
void SceneTable_Prepare(struct ScenePlacement *placements)
const u8 gBattleFx_BurstParticleScriptB[]
const u8 gObjectMotion_ActionKind4Script[]
const u8 gObjectMotion_ActionKind1Script[]
const u8 gWorldMapPackedTiles[]
void Object_Destroy(struct DispatchObject *work)
s16 gColosso_ModeMoveStep
struct MenuSprite gLamakanDesert_SandWork[]
s32 gIwram_Data1
s32 gKalay_DanceStep
const u8 gWorldMapPackedFrames[]
void Engine_EventClearInvalidPackedValues(void)
u8 gLamakanDesert_SandTileBuffer[]
const u8 gBattleFx_BurstParticleScriptA[]
const u8 gObjectMotion_MoveTowardTargetScript[]
u16 * gKolimaForestBendReturned
s32 gColosso_CompetitorStartAngle
u8 Object_UpdateAllCodeSize[]
u32 gKolimaForestBend_ShakeChance
void FieldScene_PrepareActors(struct ScenePlacement *entry)
u8 gRuntime_ByteRemapTable[]
u32 gColosso_LetteringSprites[]
const u8 gObjectMotion_TurnTowardLinkedScript[]
s32 CalculateFacingAngle(s32, s32)
const u8 gObjectMotion_ResetActionScript[]
s16 gColosso_ModeScaleDuration
s16 gColosso_ModeScaleTarget
const u8 gObjectMotion_ActionKind2Script[]
const u8 gObjectMotion_ActionKind3Script[]
#define GameFlag_IsSet
The field's runtime work: map cells, scene records and regions, map markers and FieldWork.
The scene table formats: entrances, exits, placements and events, and the macros that write them.
const s32 gObjectMotion_VariantScripts[97]
Squashes as many times as the variant (1 to 3): variant v starts at word (3 - v) * 32 and runs to the...
Definition fxdata.c:300
const u8 gField_TileMessageOffsets[6]
The message of each searchable tile code from 242 to 247, as an offset from MsgTileChecked and MsgTil...
Definition fxdata.c:24
const u8 gObjectGroup_BlinkChildValues[4]
A child value by frame ((gFrameCount >> 1) & 3).
Definition fxdata.c:344
u8 gKolimaPalette_First[1792]
u8 gKolimaPalette_Second[896]
const u8 gWorldMap_TerrainBehaviorTable[48]
World map terrain behaviour, indexed by the collision value plus 0x10 when the block word's top bit i...
Definition mapdata.c:37
Menu lists: sprites, cursors, the party status window and paged selections.
s32 gFourObjectMotion_ResourceIds[4]
The resource ids of the four sprites FourObjectMotion shows.
Definition menudata.c:55
ObjectRuntime, a field object's runtime state, and the object snapshots.
const s32 gObjectDispatch_DefaultScript[]
The script FieldObject_Create gives every new object: it does nothing and returns to the idle script.
A Psynergy the debug shortcut picker lists: its owner and the Psynergy.
Definition shortcuts.c:85
The command shared by an effect's caller, dispatcher and handlers.
A unit in battle: a party member's or an enemy's stats, Psynergy, items, Djinn and ailments.
A log's saved record: its sprite, first map cell and orientation, then its actor once created.
A field object as the object dispatcher's far calls take it.
A point projected onto the screen, with its depth.
Definition effect_step.h:46
A moving point of an effect: its position, its velocity and a value each effect uses its own way (a s...
Definition effect_step.h:13
A field object seen as one that turns toward its facing target: its facing, its ground position and t...
A field actor: a person or thing on the field with a position, motion toward a target,...
Definition field_obj.h:30
A position on the field.
An actor seen only as its priority flags at 0x23 (enum ActorPriorityFlag).
Definition field.h:57
u8 flags
Definition field.h:59
u8 pad[35]
Definition field.h:58
One cell of a map layer: its metatile and flags, its collision code and an attribute indexing the col...
Definition map.h:13
A menu sprite: a list link and its OAM attributes, as two words or as fields.
Definition menu_list.h:24
Published in the scene's light-controller slot while the pillar is active.
An effect object that moves and draws one sprite: its position, scale, velocity and target,...
Definition motobj.h:20
One of the 64 field objects in the object pool (heap slot 5): its script, position,...
An actor seen only as the coordinate at 0x08, which Goma Cave's stump reads in 16-pixel map cells.
Definition field.h:63
s32 depthFixed
16.16 fixed-point pixels
Definition field.h:65
An actor seen only as its priority flags at 0x23 (enum ActorPriorityFlag).
Definition field.h:68
u8 pad00[35]
Definition field.h:69
The Colosso rival's path player in the scene state: its mode (1 playing, 2 recording,...
Definition field.h:75
s16 actor
Definition field.h:78
u16 pos
Definition field.h:79
s16 mirror
Definition field.h:77
s16 mode
Definition field.h:76
s16 still
frames
Definition field.h:80
A scene entrance: where and facing which way the party arrives, and the camera's bounds there (-1 for...
Definition field_scene.h:54
A scene event: its kind and detail, the trigger it answers, its condition and its value (a message or...
An actor a scene places: its sprite, the condition for placing it, how it behaves,...
Definition field_scene.h:81
A scene's exit region: the box that, while its condition holds, takes the party leader out through it...
Definition field.h:82
u16 f00
Definition field.h:83
u16 f04
Definition field.h:85
u16 f06
Definition field.h:86
u16 f02
Definition field.h:84
One frame of a sparkle: its height offset and tile (fxdata.c).
A Venus Lighthouse switch or pillar socket's map cell.
Definition field.h:89
u32 z
16-pixel map cells
Definition field.h:91
u32 x
16-pixel map cells
Definition field.h:90
Definition field.h:93
u8 pad00[30]
Definition field.h:94
u16 f1e
Definition field.h:95
A log in Kolima Forest lying across four map cells, from its first cell across or,...
Definition field.h:99
s16 unused08
Definition field.h:104
s16 unused0a
Definition field.h:105
s16 vertical
Definition field.h:103
s16 x
map cells
Definition field.h:101
s16 id
Definition field.h:100
s16 y
map cells
Definition field.h:102
s32 gTolbiShipInteriors_ShakeTimer
Frames left of the Kraken's current jolt; at 0 another may start.
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
signed short s16
Definition types.h:12
unsigned short u16
Definition types.h:13
unsigned char u8
Definition types.h:11
An object on the field, read as an actor or as an effect.
struct ScriptMotionObject * gObjectSlots
u16 gVaultInteriors_StopTimer
u32 gScanlineAngle
u32 gWorldMap_GraphicsResources[2][6]
Each set is a palette and five tile sets; WorldMap_LoadGraphics takes the second set when the cell it...