Alchemy
Loading...
Searching...
No Matches

menu_internal.h

Go to the documentation of this file.
1#ifndef ALCHEMY_MENU_INTERNAL_H
2#define ALCHEMY_MENU_INTERNAL_H
3
4/// @file
5/// What every part of the menu object shares: its includes, and the macros
6/// and types more than one part uses. menu.c includes it before the parts,
7/// and each part includes it too, so that a part read on its own resolves. It
8/// places no bytes.
9
10#include "render_placement.h"
11#include "unit/menu/menu.h"
13#include "battle.h"
14#include "debug.h"
15#include "field.h"
16#include "game.h"
17#include "graphics.h"
18#include "menu.h"
19#include "minigame.h"
20#include "sound.h"
21#include "system.h"
22#include "types.h"
23#include "callback_scheduler.h"
24#include "dma.h"
25#include "inventory_menu.h"
26#include "io_reg.h"
27#include "uiwindow.h"
28#include "mem.h"
29#include "character_menu.h"
30#include "battle_unit.h"
31#include "item.h"
32#include "edition.h"
33#include "battle_system.h"
34#include "ui.h"
35#include "text/msg_ids.h"
36#include "resource.h"
37#include "vram_block.h"
38#include "render_input.h"
39#include "fixed_math.h"
40#include "lib.h"
41#include "psynergy_menu.h"
42#include "animspr.h"
43#include "scene.h"
44#include "m7_interfaces.h"
45#include "global_cells.h"
46#include "keystate.h"
47#include "window.h"
48#include "menu_result.h"
49#include "tbs_edition.h"
50#include "game_state.h"
51#include "songs.h"
52#include "iwram_call.h"
53#include "heap_state.h"
54#include "menu_list.h"
55#include "irq.h"
56#include "object_factory.h"
57#include "far_runtime.h"
58#include "equipment_menu.h"
59#include "owner_state.h"
60#include "inventory.h"
61#include "static_assert.h"
62#include "battle_type.h"
63#include "battle_calc.h"
64#include "event_work.h"
65#include "djinn_menu.h"
66#include "a9_motion.h"
67#include "battle_effect.h"
68#include "four_object_motion.h"
69#include "item_ids.h"
70#include "macros.h"
71#include "flags.h"
72
73extern u8 IwramCopyWords[];
74
75s32 _call_via_r3(void *, void *, s32, void *);
76
77/// BattleAct.flags: where an ability or item can be used, as the Psynergy
78/// list says ("Usable in the field", "Usable in battle").
79#define ACTION_USABLE_IN_FIELD 0x40
80#define ACTION_USABLE_IN_BATTLE 0x80
81
82/// Game flags of the menus. Start was pressed: every menu screen unwinds and
83/// the whole menu closes.
84#define FLAG_MENU_START_PRESSED 0x150
85/// The info window holds a message the next selection must not draw over.
86#define FLAG_MENU_INFO_KEPT 0x151
87
88/// The target id of Psynergy or an item used on the whole party.
89#define MENU_TARGET_WHOLE_PARTY 9
90
91/// The bytes of the menu work, heap block HEAP_SLOT_MENU.
92#define MENU_WORK_SIZE 0xa70
93
94/// Inventory icons occupy five columns in the fifteen-slot list.
95#define MENU_ITEM_GRID_COLUMNS 5
96
97/// What Menu_DrawOwnerStatusPanel shows below the name and ailments: the low
98/// byte of its mode.
100 STATUS_PANEL_EXPERIENCE = 0, ///< class, HP, PP and experience
101 STATUS_PANEL_EQUIP = 2, ///< stats if the item were equipped
102 STATUS_PANEL_LEARN = 4, ///< the Psynergy a Psynergy item teaches
103 STATUS_PANEL_CLASS = 6, ///< class, HP and PP
104 STATUS_PANEL_STATS = 8, ///< Attack, Defense, Agility and Luck
105};
106#define STATUS_PANEL_KIND_MASK 0xff
107/// Keeps the open window, the name and the ailments, and redraws only the
108/// part below them.
109#define STATUS_PANEL_LOWER_ONLY 0x100
110
111// The revised information pane restores its tiles and draws directly into them.
112#if TBS_PATCH_1
113#define MENU_RESET_INFO_WINDOW RenderOutput_RedrawSavedRectFar
114#define MENU_DRAW_INFO_TEXT UiText_DrawCharacterAtOffsetFar
115#else
116#define MENU_RESET_INFO_WINDOW RenderOutput_ClearListFar
117#define MENU_DRAW_INFO_TEXT UiText_DrawResourceFar
118#endif
119
120// Status labels use the Latin font's pixel positions or the Japanese tile grid.
121#if LANGUAGE == LANGUAGE_JAPANESE
122#define MENU_DRAW_STATUS_LABEL UiText_DrawStringInWindowFar
123#else
124#define MENU_DRAW_STATUS_LABEL UiText_DrawStringAtOffsetFar
125#endif
126
127// Text colours of the status panel's numbers.
128#define TEXT_COLOR_LOW_HP 4 ///< HP under a quarter of the maximum
129#define TEXT_COLOR_NO_HP 2 ///< HP 0
130#define TEXT_COLOR_NORMAL 15
131
132/// RenderOutput.active as the menu sets it: shown, or hidden but kept.
133#define ICON_SHOWN 1
134#define ICON_HIDDEN 13
135
136/// RenderOutput_CreateFar's sprite attributes for the menu's 16x16 icons.
137#define ICON_SPRITE_16X16 0x40000000
138
139/// The preview loop's four operations, as its confirmation text describes them.
145};
146
147#endif
Declares nothing of its own: it only includes edition.h and render_input.h.
Animated sprites: their layers, frames and colour modes, and the resource slots they draw from.
The battle calculation tables: hit chances, HP and PP damage and recovery.
The battle effect argument and the rectangle-drawing routines effects call.
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 character menu's state, and the ailments it shows.
The engine calls the debug menus import, and their palette swatch tiles.
The Djinn menu: its list tables, backdrop and work, and the fields of a Djinni's list entry.
DMA channel registers, and the DMA and CPU fills.
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
Declares nothing of its own: it only includes types.h.
EventWork, the running scene's event work.
Declares nothing: an empty header kept for the files that include it.
16.16 fixed-point constants, sine and cosine, and the library division.
Game flags, named where their meaning is shown.
FourObjectMotion, the row of four figures the Status and Djinn menus show.
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 item menu's state and commands.
The hardware's I/O registers and their bits, as pret names them.
The hardware's interrupt sources and the interrupt handler table.
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.
Declares nothing of its own: it only includes types.h and edition.h.
Declares nothing of its own: it only includes edition.h and render_input.h.
Small statement macros both games use for positions, velocities and bounds.
The heaps: allocating and freeing blocks.
u8 IwramCopyWords[]
DjinnCompareOperation
The preview loop's four operations, as its confirmation text describes them.
@ DJINN_COMPARE_GIVE
@ DJINN_COMPARE_STANDBY
@ DJINN_COMPARE_TRADE
@ DJINN_COMPARE_SET
StatusPanelKind
What Menu_DrawOwnerStatusPanel shows below the name and ailments: the low byte of its mode.
@ STATUS_PANEL_STATS
Attack, Defense, Agility and Luck.
@ STATUS_PANEL_LEARN
the Psynergy a Psynergy item teaches
@ STATUS_PANEL_EQUIP
stats if the item were equipped
@ STATUS_PANEL_EXPERIENCE
class, HP, PP and experience
@ STATUS_PANEL_CLASS
class, HP and PP
Menu lists: sprites, cursors, the party status window and paged selections.
MenuResult, what a menu returns.
The reel game's title lettering.
Object_Create, which creates a field object.
Declares nothing of its own: it only includes battle_system.h.
The Psynergy menu's state.
The sprite renderer's inputs and outputs: render inputs, OAM attributes and render output lists.
A sprite's screen position and scale.
FIELD_AT_OFFSET and the entity and camera views older scene code reads.
s32 _call_via_r3(s32, s32, s32, s32)
Song and sound effect ids, indices into gSound_SongTable.
STATIC_ASSERT, a compile-time check that emits nothing.
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
unsigned char u8
Definition types.h:11
UiWork, the window system's work, and the status screen's cursors.
UiWindow, a window's work, and marking its tilemap rows for transfer.
Declares nothing of its own: it only includes the window, battle command, resource and VRAM table hea...
The window renderer's work.