Alchemy
Loading...
Searching...
No Matches

object_internal.h

Go to the documentation of this file.
1#ifndef ALCHEMY_OBJECT_INTERNAL_H
2#define ALCHEMY_OBJECT_INTERNAL_H
3
4/// @file
5/// What every part of object.c shares: its includes and the macros and
6/// types more than one part uses. object.c includes it before the parts, and
7/// each part includes it too, so that a part read on its own resolves. It
8/// places no bytes.
9
12#include "vram_tab.h"
13#include "unit/object/object.h"
16#include "types.h"
17#include "scene.h"
18#include "battle_type.h"
19#include "game_state.h"
20#include "field_runtime.h"
21#include "battle_system.h"
22#include "battle.h"
23#include "battle_unit.h"
24#include "debug.h"
25#include "field.h"
26#include "game.h"
27#include "graphics.h"
28#include "menu.h"
29#include "minigame.h"
30#include "sound.h"
31#include "system.h"
32#include "mem.h"
33#include "dma.h"
34#include "scene_ids.h"
35#include "io_reg.h"
36#include "iowrite.h"
37#include "irq.h"
38#include "callback_scheduler.h"
39#include "flags.h"
40#include "iwram_call.h"
41#include "event_work.h"
42#include "resource_ids.h"
44#include "resource.h"
45#include "field_scene.h"
46#include "map.h"
47#include "map_scroll.h"
48#include "ram_buffer.h"
49#include "global_cells.h"
50#include "object_runtime.h"
52#include "animspr.h"
53#include "field_obj.h"
54#include "object_dispatch.h"
55#include "field_event.h"
56#include "heap_state.h"
57#include "keystate.h"
58#include "owner_value.h"
59#include "party_state.h"
60#include "songs.h"
61#include "fixed_math.h"
62#include "item_gift.h"
63#include "battle_calc.h"
64#include "display_transition.h"
65#include "text/msg_ids.h"
66#include "object_lookup.h"
67#include "objdisp.h"
68#include "object_effect.h"
69#include "item.h"
70#include "motobj.h"
71#include "static_assert.h"
72#include "frame.h"
73#include "io_write_queue.h"
74#include "palbuf.h"
75#include "vram_block.h"
76#include "item_ids.h"
77#include "inventory.h"
78#include "ui.h"
79#include "window.h"
80#include "battle_party.h"
81#include "b5_context.h"
82#include "edition.h"
83#include "facing_object.h"
84#include "script_motion.h"
85#include "tbs_edition.h"
86#include "metadata_lookup.h"
87#include "field_coordinate.h"
88#include "scroll.h"
89#include "fxblend.h"
90#include "fx_scene.h"
91#include "effect_slot.h"
93#include "menu_list.h"
94#include "field_effect.h"
96#include "macros.h"
97#include "ability_ids.h"
98
99/// Field_RunScene's result when the scene was not left (scene.c, run_scene.c).
100#define EXIT_NONE 999
101
102/// Scene ids above the field maps, which Game_ResetForNewGame runs without a
103/// map.
104enum {
105 SCENE_BLANK = 0x1fb,
109};
110
111/// The polar-offset routine walks three array elements. Named coordinates
112/// remain useful to callers; the union gives that array real storage.
116};
117
119
120/// A scene region's bounds, in pixels, as 16.16 fixed point.
121#define REGION_FIXED(value) ((s32)((u32)(s32)(value) << 16))
122
123// A field Psynergy or item use, packed into one value (items.c, psynergy.c).
124#define ABILITY_ID(c) ((c) & 0x3ff) ///< the Psynergy
125#define ACT_UNIT(c) (((c) >> 10) & 15) ///< who uses it
126#define ACT_PACKED 0x2000 ///< use it without paying PP
127#define UNIT_NONE 15
128#define ALLY_MAX 7 ///< the last party member
129
130#define EXIT_RETREAT 999 ///< the exit Retreat takes
131
132#define FLAG_PSYNERGY_EFFECT 0x140 ///< play the usual effect
133#define FLAG_PSYNERGY_TARGET 0x141 ///< aim the effect at the target
134
135/// The flags of a Psynergy event (kind 5) in the given phase.
136#define PSYNERGY_EV(phase) ((phase) << 28 | EVENT_PSYNERGY)
137#define PSYNERGY_EV_ANY PSYNERGY_EV(7) ///< any phase
138
139/// Shows message m with the user's and the Psynergy's names, and waits.
140#define PSYNERGY_MESSAGE(who, act, m) \
141 (UiWork_PushValueSlotFar((who), 1), UiWork_PushValueSlotFar((act), 4), \
142 UiText_ShowPositionedMessageAndWaitFar((m), 1))
143
144#endif
Ability numbers, named from the English release.
Animated sprites: their layers, frames and colour modes, and the resource slots they draw from.
B5Context, the object context a battle routine reads; most of its fields are still unnamed.
The battle calculation tables: hit chances, HP and PP damage and recovery.
The battle animation state, render objects and effect entries, and the palette buffer work.
Which units are in a battle, and the Djinn recovery list.
BattleUnit_Recalculate, which recalculates a unit's stats.
BattlePlan, an action planned for its targets: the hits, criticals and multipliers rolled.
BattleUnit, a party member's or enemy's battle state, with the elements, abilities and actions it use...
The task scheduler: tasks, their order and the scheduler's state.
The engine calls the debug menus import, and their palette swatch tiles.
The display transition's frames, windows and state.
DMA channel registers, and the DMA and CPU fills.
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
Effect slots: the particles Psynergy effects move and draw.
EventWork, the running scene's event work.
FacingObject, the view of an object that turns to face a target.
FieldCoordinate, a position on the field.
Field effects, their scripts and the flags that spawn them.
The scene script layer: the engine services a scene's events call, declared once (Engine_EventBegin,...
Field objects and actors, and the scene transition styles.
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.
16.16 fixed-point constants, sine and cosine, and the library division.
FixedPointPosition, a position in 16.16 fixed point.
Game flags, named where their meaning is shown.
The frame loop's globals: lag counts, the CPU load display and the VBlank flags.
BattleFxScene, the work of a battle or field Psynergy effect scene, and its arc objects.
FieldBlendWork, the field's colour blend work.
GameState, the game's state: play time, coins, the scene and the leader's position,...
The work slots of gWorkSlot, read through their own names.
The screen blend's globals and the graphics routines.
The heap's work slots and HeapState.
gOverflowItem, an item slot the spoils code uses when items are handed out.
The hardware's I/O registers and their bits, as pret names them.
The register write queue that VBlank carries out after each finished frame.
Io_Write16, a 16-bit write to a register or memory.
The hardware's interrupt sources and the interrupt handler table.
Items: their definitions, types, flags and effects.
Declares nothing of its own: it only includes types.h, edition.h and farcall.h.
Item numbers, named from the English release.
The IWRAM call layer: the routines the game keeps resident in IWRAM, each at its fixed address,...
The keypad state the VBlank interrupt keeps.
Small statement macros both games use for positions, velocities and bounds.
Maps: their cells, layers, animations and blend scripts, and the map state.
The map layers' scroll work and the background scroll values.
The heaps: allocating and freeing blocks.
Menu lists: sprites, cursors, the party status window and paged selections.
Animation metadata and its lookup by resource.
The reel game's title lettering.
MotionObject, an effect object that moves and draws one sprite.
The object dispatcher's forward declaration.
The object dispatcher's scripts: key checks, the player, the world map and the camera.
The fade overlay, the weather particles and the actor effect work.
The object scripts effects give their particles and fragments.
@ SCENE_REEL_GAME
@ SCENE_BATTLE
@ SCENE_BLANK
@ SCENE_LUCKY_DICE
Declares nothing: an empty header kept for the files that include it.
ObjectRuntime, a field object's runtime state, and the object snapshots.
Declares nothing of its own: it only includes types.h, edition.h and farcall.h.
Palette fades, the battle effect palette buffers and the colour channel curves.
Declares nothing of its own: it only includes static_assert.h and game_state.h.
The work pointers in the gWorkSlot table, by name.
Resource numbers, named where their contents are known.
FIELD_AT_OFFSET and the entity and camera views older scene code reads.
Scene numbers, named after their places.
ScriptMotionObject, an object moved by a field script.
ScriptObjectRuntime, the work of an object a script moves.
The display scroll work, the HBlank scroll work and its wave.
Song and sound effect ids, indices into gSound_SongTable.
STATIC_ASSERT, a compile-time check that emits nothing.
#define STATIC_ASSERT(condition)
C89 permits repeated extern declarations of the same array.
A world position, as Camera_WorldToScreen converts it to the screen.
Definition battle.h:73
The system's routines and globals: interrupts, BIOS sound bias, random numbers and sleep.
Values that differ by patch level or language, chosen once for their code.
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
UiWork, the window system's work, and the status screen's cursors.
The polar-offset routine walks three array elements.
struct EffectVector vector
Declares nothing of its own: it only includes the window, battle command, resource and VRAM table hea...
The sprite VRAM block cache and its owners.
The window renderer's work.