1#ifndef ALCHEMY_BATTLE_INTERNAL_H
2#define ALCHEMY_BATTLE_INTERNAL_H
33#include "text/msg_ids.h"
101#define BATTLE_WININ \
102 (WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_OBJ | \
103 WININ_WIN0_CLR | WININ_WIN1_BG0 | WININ_WIN1_BG2 | WININ_WIN1_OBJ | \
105#define BATTLE_WINOUT (WINOUT_WIN01_BG0 | WINOUT_WIN01_CLR | WINOUT_WINOBJ_ALL)
109#define BATTLE_BG_PALETTE ((u16 *)&BG_PLTT_COLOR(6, 0))
113#define CURTAIN_TILE(n) (BG_CHAR_BLOCK(1) + (128 + (n)) * TILE_SIZE_4BPP)
116#define BATTLE_BG1CNT \
117 (BGCNT_PRIORITY(3) | BGCNT_256_COLORS | BGCNT_SCREEN_BASE(31))
122#define VALUE_UNIT_NAME 1
123#define VALUE_ITEM_NAME 2
124#define VALUE_CLASS_NAME 3
125#define VALUE_ABILITY_NAME 4
126#define VALUE_NUMBER 5
130#define FIRST_ENEMY_UNIT 128
131#define LINK_PARTY_SIZE 3
135#define PARTY_BATTLE_SIZE 4
136#define ENEMY_BATTLE_SIZE 6
138#define ABILITY_ATTACK 1
143#define ENEMY_CLASS_FIRST 8
148#define ENEMY_DEFEATED_FLAG(classId) ((classId) + 0x600)
151#define UNIT_NAME_LENGTH 14
155#define SIO_MULTI_PLAYER_ID() ((REG_SIOCNT << 26) >> 30)
158#define LINK_BOTH_CONNECTED 3
162#define LINK_MAX_MISSED_FRAMES 24
166#define DJINN_RECOVERY_PARTY 0
167#define DJINN_RECOVERY_OPPONENT 1
170#define DJINN_RECOVERY_AFTER_BATTLE -1
172#define DJINN_PER_ELEMENT 20
177#define FORMATION_SHUFFLED 0
178#define FORMATION_INTERLEAVED 1
182#define SPRITE_WITH_SECOND_PART_A 476
183#define SPRITE_WITH_SECOND_PART_B 483
186#define EQUIP_WEAPON 1
190#define RECORDS_NONE 0
191#define RECORDS_SINGLE 1
192#define RECORDS_TABLE 2
193#define RECORDS_KIND_MASK 15
194#define RECORDS_TABLE_SIZE 4
198#define POISON_NORMAL 1
199#define POISON_DEADLY 2
203#define GUARD_DEFEND 1
204#define GUARD_TOTAL_DEFENSE 2
224#define STAGING_KIND_MASK 0xfff
225#define STAGING_VARIANT_MASK 0x3000
226#define STAGING_VARIANT_SHIFT 12
227#define STAGING_BY_ID_RANGE 0x4000
228#define STAGING_SCENE 0x8000
229#define STAGING_ON_DOWNED 0x10000
230#define STAGING_OTHER_SIDE 0x20000
234#define STAGING_VIEW_ACROSS 0x40000
235#define STAGING_VIEW_REVERSED 0x80000
238#define ITEM_USE_CONSUMED 1
239#define ITEM_USE_MAY_BREAK 2
240#define ITEM_USE_EMPTIES 4
243#define TARGET_MODE_NONE 0
244#define TARGET_MODE_FOES 1
245#define TARGET_MODE_ALLIES 2
246#define TARGET_MODE_SELF 4
251#define TARGET_NONE_ENEMY 0x100
252#define TARGET_NONE_PARTY 0x180
255#define YAW_PARTY_TURN 0x2000
256#define YAW_ENEMY_TURN -0x2000
260#define BLEND_SPRITES_OVER_ALL (BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL)
263#define KEY_ADVANCE (KEY_A | KEY_B | KEYS_SHOULDERS)
Ability numbers, named from the English release.
Animated sprites: their layers, frames and colour modes, and the resource slots they draw from.
The sound driver's command masks, cue controls and the routines and globals it shares with the engine...
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 command names: auto battle and the battle options (aliases of debug and key globals),...
The battle camera and the presentation's transition, background and affine work.
The battle effect argument and the rectangle-drawing routines effects call.
BattleEffectWork, the running battle effect's work, and its animation objects.
Declares nothing of its own: it only includes edition.h, battle_session.h and types....
The battle event queue: the events BattleEvPush queues and the playback phases that play them.
BattlePlanStaging
BattlePlan.outcome: how BattlePresentation_DispatchAction shows the action, set by BattleCommand_Buil...
@ PLAN_SHOW_ATTACK
the actor runs up and strikes
@ PLAN_SHOW_CAST
Psynergy, and Venus, Mercury, Mars, Jupiter.
@ PLAN_SHOW_ENEMY_CAST
an enemy's Psynergy
@ PLAN_SHOW_FLEE
a unit runs
@ PLAN_SHOW_DJINNI
a Djinni with no attack (Granite, Quartz...)
@ PLAN_SHOW_FULL_SCREEN
Gaia, Rockfall, Procne and their kin.
@ PLAN_SHOW_MESSAGES
no animation: each target's events only
@ PLAN_SHOW_SUMMON
the larger summons, the actor hidden
Who strikes first as a battle opens.
Declares nothing of its own: it only includes types.h and text/msg_ids.h.
Declares nothing of its own: it only includes edition.h and types.h.
Actor_Place, which places a battle object for a unit.
Which units are in a battle, and the Djinn recovery list.
gBattleRandomSeed, the battle's random seed.
Declares nothing of its own: it only includes edition.h and battle_session.h.
Summons and the battle sprite definitions of the enemy classes.
BattleUnit_Recalculate, which recalculates a unit's stats.
Declares nothing of its own: it only includes edition.h, battle_session.h and types....
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...
BattleWork, the battle's own work, and the battle display work.
The task scheduler: tasks, their order and the scheduler's state.
The definitions of characters, classes, Djinn and enemies, and a level up's result.
The engine calls the debug menus import, and their palette swatch tiles.
DMA channel registers, and the DMA and CPU fills.
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
EffectStep and EffectPosition, the positions effects move through.
The scene script layer: the engine services a scene's events call, declared once (Engine_EventBegin,...
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.
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.
Saving, disabling and restoring the interrupt master enable.
Items: their definitions, types, flags and effects.
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.
The heaps: allocating and freeing blocks.
The reel game's title lettering.
MotionObject, an effect object that moves and draws one sprite.
The object dispatcher's forward declaration.
Declares nothing of its own: it only includes battle_system.h.
Declares nothing of its own: it only includes types.h, edition.h and farcall.h.
Declares nothing of its own: it only includes static_assert.h and game_state.h.
The work pointers in the gWorkSlot table, by name.
Copying ARM routines to RAM to run them there.
Resource numbers, named where their contents are known.
FIELD_AT_OFFSET and the entity and camera views older scene code reads.
The link cable's runtime: serial packets, registers and transfer state.
Song and sound effect ids, indices into gSound_SongTable.
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.
UiWork, the window system's work, and the status screen's cursors.
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.