64 flags = actor & 0xf000;
89 }
else if (actor <= 7) {
117 left = x - width / 2;
119 top = y - height - 1;
121 top = y - height - 1;
131 column = x - margin - 2;
136 if (column + margin > 29)
137 column = 29 - margin;
138 }
else if (column <= 15) {
139 column = column - margin - 2;
144 if (column + margin > 29)
145 column = x - margin - 2;
157 portraitTop = top - 5;
159 portraitTop = top + height;
161 portraitTop = top + height;
162 else if (portraitTop + 5 > 19)
163 portraitTop = top - 5;
164 if (top < portraitTop) {
170 extra = lines - height + 1;
172 }
else if (top < y) {
177 extra = lines - height + 1;
188 portraitTop = top - 5;
190 portraitTop = top + height;
192 portraitTop = top + height;
193 else if (portraitTop + 5 > 19)
194 portraitTop = top - 5;
202 extra = lines - height + 1;
207 else if (column + margin > 29)
208 column = 29 - margin;
212 if (win->
mode != 0) {
259 member = actor & 0x0fff;
345 s32 positionFound = 0;
350 if (
object !=
NULL) {
373 px = px < 8 ? 8 : px;
376 py = py < 20 ? 20 : py;
416 CLAMP(py, minY, 220);
437 s32 firstPortraitX,
s32 firstPortraitY,
440 s32 secondPortraitY) {
448 field->
message++, firstX, firstY,
454 field->
message++, secondX, secondY,
490 if (actor == 0x80000000) {
s32 ObjectTable_ReadActiveValue(s32 actor)
Returns the sprite (the first animation's id) of the actor in the low 12 bits of actor,...
void * ObjectTable_Get(u32 actorIndex)
Returns the actor in slot index (0 to 65), or NULL.
u8 gUi_RenderResultValues[]
s32 Object_GetScreenPosition(s32 objectId, s32 *position)
Finds where an actor is on screen: position[0] and position[1] receive its x and y in pixels,...
s32 UiText_GetResourceDimensionsFar(s32 no, s32 *x, s32 *y, u32 *width, u32 *height)
s32 UiText_GetResourceDimensionsAltFar(s32 no, s32 *x, s32 *y, u32 *width, u32 *height)
s32 Localization_LookupEntryIdFar(u32 value)
struct UiWindow * UiWindow_CreateWithSideObjectFar(s32 arg0, s32 arg1, s32 x, s32 y)
s32 UiWork_IsIdleFar(struct UiWindow *window)
void UiWork_FinalizeEntityMatchingLocalizedIdFar(u32 entry)
s32 UiWork_IsCompleteFar(void)
struct UiWindow * UiText_OpenMessageWindowFar(s32 message, s32 x, s32 y, u32 packed)
void UiWork_FinalizePendingCoreFar(void)
#define SPEAKER_PORTRAIT_LEFT
#define SPEAKER_WINDOW_ABOVE
#define SPEAKER_PORTRAIT_RIGHT
#define SPEAKER_WINDOW_BELOW
void WaitFrames(s32 frames)
The game's frame loop: runs frames frames and returns.
struct GameState gGameState
volatile u32 gKeysHeld
Keys down now.
volatile u32 gKeysPressed
Keys that went down this frame.
#define CLAMP(v, low, high)
Keeps v within low to high, the low bound tested first.
struct ScenePlacement * Scene_FindActorPlacement(s32 id)
Returns the placement of actor id in the scene's placement tables, or NULL: for a party character (0 ...
s32 Event_AskYesNoWithActorAnimation(s32 actor, s32 forceBottom)
The event command "choose yes or no": once the message on screen has been read, asks yes or no below ...
void FieldEvent_WaitFrames(s32 frames)
The event command "wait": waits the requested frames, unless debug fast forward (Event_UpdateDebugSki...
struct UiWindow * UiText_OpenMessageAtObject(s32 actor, s32 unused)
The event command "open message": opens the event's current message in a speech window next to the sp...
void Ui_SetMessageVoiceFromActor(s32 actor)
Sets the voice of the messages that follow to that of actor's sprite, at the rate the message speed o...
void ObjectTable_RunIfActive(s32 actor)
Closes the portrait of an actor's sprite, if it has one.
void Event_ShowSpeakerMessage(s32 speaker)
A speaker-message entry point retained by its overlay veneer, with no current scene caller.
void ObjectTable_CallRefreshHook(s32 unused0, s32 unused1, s32 x, s32 y)
Retained by its overlay veneer; no current caller establishes the coordinates forwarded to Event_Show...
void BattleEventRuntime_EmptyCallback(void)
void Event_ShowMessageAtPosition(s32 unused0, s32 unused1, s32 x, s32 y)
A retained coordinate-message entry point: waits for the message and advances the event's message ind...
void FieldEvent_ShowMessageAndWait(s32 actor, s32 flags)
The event command "show message": opens the current message at actor (UiText_OpenMessageAtObject) and...
void BattlePres_RunActionThenWaitIfModeZero(s32 actor, s32 flags, s32 wait)
The event command "show message and wait": shows the message, then waits wait frames.
void Battle_ShowPairedUnitWorkAndWait(s32 first, s32 firstX, s32 firstY, s32 firstPortraitX, s32 firstPortraitY, s32 second, s32 secondX, s32 secondY, s32 secondPortraitX, s32 secondPortraitY)
The event command "show two messages and wait": two actors speak at once, each message at its own (x,...
s32 FieldEvent_AskYesNoAndShowResponse(s32 actor, s32 flags)
The event command "ask yes or no": opens the question at actor, lets the leader answer,...
What every part of psynergy_effects.c shares: its includes and the macros and types more than one par...
s32 BattleFx_GetResourceId(u32 id)
Returns the portrait shown beside the messages of sprite id (0x100 plus its definition's value),...
struct EventWork * gEventWork
#define offsetof(type, member)
Full event work allocated by Field_RunScene (heap slot 27).
s16 event
A raised event for Scene_RunRaisedEvent, or -1 when characters fell to poison or hazard damage,...
s32 fastForward
debug: skip timed event waits and actor messages
s32 speaker
the actor speaking; the leader at each event
s16 message
the next message, advanced as each window opens
s32 sideWindow
the speaker's portrait window
s16 mode
MODE_WORLD_MAP (3) on the world map.
s32 messageWindow
the open message window, 0 for none
struct FieldActor * actors[66]
The actors by id: 0 to 7 the party's characters, 8 on the placed actors.
The game's state: play time, coins, the scene and the leader's position, the active party and the opt...
u8 messageSpeed
0 to 2; 1 on a new game
s32 selectedActor
the leader: its unit and its actor
One of the 64 field objects in the object pool (heap slot 5): its script, position,...
s32 x
16.16 fixed-point pixels
s32 y
16.16 fixed-point pixels
The window system's work: the windows' tilemap, the windows, the three text channels,...
u8 mode
Set while Mind Read shows thoughts: round frame corners, colour 8 text with no shadow,...
u16 speakerVoiceCountdown
characters until the next voice blip
u16 speakerVoiceSound
first of four voice blip sounds; 0 for none
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation...
u16 flags
UI_WINDOW_ flags; 0 once closing or free.
The work slots from the window work's onward, seen as the window work and, twelve slots on,...
#define MODE_WORLD_MAP
the world map