Alchemy
Loading...
Searching...
No Matches

game_internal.h

Go to the documentation of this file.
1#ifndef ALCHEMY_GAME_INTERNAL_H
2#define ALCHEMY_GAME_INTERNAL_H
3
4/// @file
5/// What every part of the game object shares: its includes and the inventory
6/// helper two parts use. game.c includes it before the parts, and each part
7/// includes it too, so that a part read on its own still resolves.
8
9#include "unit/game/game.h"
11#include "battle.h"
12#include "debug.h"
13#include "field.h"
14#include "game.h"
15#include "graphics.h"
16#include "menu.h"
17#include "minigame.h"
18#include "sound.h"
19#include "system.h"
20#include "types.h"
21#include "mem.h"
22#include "scene.h"
23#include "owner_state.h"
24#include "character.h"
25#include "party_state.h"
26#include "runtime_interfaces.h"
27#include "item.h"
28#include "game_flags.h"
29#include "inventory.h"
30#include "resource.h"
31#include "resource_ids.h"
32#include "dma.h"
33#include "game_state.h"
34#include "frame.h"
35#include "save_state.h"
36#include "io_reg.h"
37#include "fixed_math.h"
38#include "battle_unit.h"
39#include "lib.h"
40#include "edition.h"
41#include "battle_system.h"
42#include "text/msg_ids.h"
43#include "battle_summon.h"
44#include "preset_table.h"
45#include "iwram_call.h"
46#include "battle_calc.h"
47#include "battle_random.h"
48#include "battle_type.h"
50#include "battle_party.h"
51#include "field_event.h"
53#include "flags.h"
54#include "character_ids.h"
55#include "ability_ids.h"
56#include "macros.h"
57#include "item_ids.h"
58
59/// Keeps occupied slots in order and clears the unused inventory tail, for
60/// Inventory_Remove (inventory.c) and InventorySnapshot_Save (snapshot.c).
61static inline void Inventory_CompactSlots(s16 *inventory) {
62 s32 usedSlots = 0;
63 s32 slot;
64
65 for (slot = 0; slot < INVENTORY_SLOTS; slot++) {
66 if (inventory[slot] != 0)
67 inventory[usedSlots++] = inventory[slot];
68 }
69 for (; usedSlots < INVENTORY_SLOTS; usedSlots++)
70 inventory[usedSlots] = 0;
71}
72
73#endif
Ability numbers, named from the English release.
The battle calculation tables: hit chances, HP and PP damage and recovery.
Declares nothing of its own: it only includes edition.h, battle_unit.h and types.h.
Which units are in a battle, and the Djinn recovery list.
gBattleRandomSeed, the battle's random seed.
Summons and the battle sprite definitions of the enemy classes.
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 definitions of characters, classes, Djinn and enemies, and a level up's result.
Character numbers, with each character's Japanese name.
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).
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.
Game flags, named where their meaning is shown.
The frame loop's globals: lag counts, the CPU load display and the VBlank flags.
Setting and clearing game flags, and the byte that holds a flag.
static void Inventory_CompactSlots(s16 *inventory)
Keeps occupied slots in order and clears the unused inventory tail, for Inventory_Remove (inventory....
GameState, the game's state: play time, coins, the scene and the leader's position,...
The screen blend's globals and the graphics routines.
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.
Items: their definitions, types, flags and effects.
@ INVENTORY_SLOTS
Definition item.h:23
Item numbers, named from the English release.
The IWRAM call layer: the routines the game keeps resident in IWRAM, each at its fixed address,...
Declares nothing of its own: it only includes types.h and edition.h.
Small statement macros both games use for positions, velocities and bounds.
The heaps: allocating and freeing blocks.
The reel game's title lettering.
Declares nothing of its own: it only includes battle_system.h.
Declares nothing of its own: it only includes static_assert.h and game_state.h.
PresetValues, a row of preset values.
Resource numbers, named where their contents are known.
Declares nothing of its own: it only includes edition.h and types.h.
The save workspace: slot headers and summaries.
FIELD_AT_OFFSET and the entity and camera views older scene code reads.
The system's routines and globals: interrupts, BIOS sound bias, random numbers and sleep.
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
signed short s16
Definition types.h:12