Alchemy
Loading...
Searching...
No Matches

display_transition.h

Go to the documentation of this file.
1#ifndef ALCHEMY_DISPLAY_TRANSITION_H
2#define ALCHEMY_DISPLAY_TRANSITION_H
3
4/// @file
5/// The display transition's frames, windows and state.
6
7#include "edition.h"
8#include "types.h"
9#include "static_assert.h"
10
11/// The display transition state as the centre-line transition and the dissolve
12/// read it: the dissolve's tile pixels and the transition's progress.
14 u8 unk000[0x508]; ///< DisplayTransitionState's pages; not named here
15 /// DisplayTransitionState's solidTile, as 4-bit pixels two a byte: the
16 /// dissolve sets two more each frame and copies the tile to BG character
17 /// block 0.
19 /// The progress, moved from start to end over duration frames: bit 5 says
20 /// whether the dissolve fills or clears, the low 5 bits how far it is.
22 /// DisplayTransitionState's centreX to unk538; not named here.
24 /// DisplayTransitionState's page: the dissolve flips it each frame and
25 /// never reads it.
27 s8 start; ///< the value's first step
28 s8 end; ///< the value's last step
29 s8 duration; ///< frames; 0 when the value is not moving
30 s8 step; ///< frames
31};
32
33/// The map work's display fields that transitions use: its display control
34/// bits and the lines where the centre-line transition shows and hides the
35/// screen, with the VCount interrupt's copies and phase.
37 u32 unk000[5]; ///< map work fields no transition names
38 /// Display control bits ORed into DISPCNT; DisplayState_ClearFlags clears
39 /// those of backgrounds 1 to 3.
41 u8 unk016[0xea]; ///< map work fields no transition names
42 /// scanlines: where the screen is hidden, 200 when it is not
44 /// scanlines: where the screen is shown again, 250 when it is not hidden
46 u16 irqFirstLine; ///< scanlines; firstLine as the VCount interrupt reads it
47 u16 irqSecondLine; ///< scanlines; secondLine as the VCount interrupt reads it
48 /// The VCount interrupt's phase: 0 waiting for a line above 159, 1 neither
49 /// line passed, 2 the first passed, 3 the second passed first, 9 done.
51};
52
53/// The display transition state (heap block 31): two pages of window edges for
54/// every line, the dissolve's solid tile, and the transition's mode and
55/// progress.
57 /// Window edges, two pages: WININ and WINOUT, then a WIN0H and WIN1H pair,
58 /// each (left << 8 | right), for each of the 160 lines.
59 u16 pages[2][322];
60 /// The dissolve's solid tile, one 8 by 8 tile of 4-bit pixels.
62 /// The window transition's shape: modes are listed at
63 /// DisplayTransition_UpdateScanlineTable.
65 /// The progress, moved from start to end over duration frames: bit 5 says
66 /// whether the transition opens or closes, the low 5 bits how far it is.
68 /// 16.16 fixed-point pixels: the centre of the ellipse around a point
69 /// (mode 8), set by the Reveal effect.
71 s32 centreY; ///< as centreX: the target's z less its y
72 /// WINOUT, or WININ by mode: 0x3f3f or 63 when a transition starts.
74 /// WININ, or WINOUT by mode: 1 when a transition starts.
76 u8 unk538; ///< not named by TBS code
77 u8 page; ///< the pages entry shown; the next is built in the other
78 s8 start; ///< the value's first step
79 s8 end; ///< the value's last step; 64 hides BG1 to BG3 and sprites
80 s8 duration; ///< frames; 0 when the value is not moving
81 s8 step; ///< frames
82 /// The mode taken when the value reaches its end; 0 ends the transition.
84};
85
88STATIC_ASSERT(sizeof(struct DisplayTransitionFrame) == 0x540);
90STATIC_ASSERT(offsetof(struct DisplayTransitionWindow, firstLine) == 0x100);
92STATIC_ASSERT(sizeof(struct DisplayTransitionWindow) == 0x10c);
94STATIC_ASSERT(offsetof(struct DisplayTransitionState, solidTile) == 0x508);
99STATIC_ASSERT(offsetof(struct DisplayTransitionState, nextMode) == 0x53e);
101STATIC_ASSERT(sizeof(struct DisplayTransitionState) == 0x540);
102
103#endif
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
STATIC_ASSERT, a compile-time check that emits nothing.
#define STATIC_ASSERT(condition)
C89 permits repeated extern declarations of the same array.
#define offsetof(type, member)
Definition stddef.h:19
The display transition state as the centre-line transition and the dissolve read it: the dissolve's t...
u8 ditherToggle
DisplayTransitionState's page: the dissolve flips it each frame and never reads it.
u8 unk000[0x508]
DisplayTransitionState's pages; not named here.
s8 start
the value's first step
u16 value
The progress, moved from start to end over duration frames: bit 5 says whether the dissolve fills or ...
u8 unk52c[13]
DisplayTransitionState's centreX to unk538; not named here.
s8 duration
frames; 0 when the value is not moving
s8 end
the value's last step
u8 paletteNibbles[0x22]
DisplayTransitionState's solidTile, as 4-bit pixels two a byte: the dissolve sets two more each frame...
The display transition state (heap block 31): two pages of window edges for every line,...
u16 value
The progress, moved from start to end over duration frames: bit 5 says whether the transition opens o...
u8 page
the pages entry shown; the next is built in the other
s16 active
WININ, or WINOUT by mode: 1 when a transition starts.
u8 unk538
not named by TBS code
s8 nextMode
The mode taken when the value reaches its end; 0 ends the transition.
s8 end
the value's last step; 64 hides BG1 to BG3 and sprites
s8 start
the value's first step
u16 mode
The window transition's shape: modes are listed at DisplayTransition_UpdateScanlineTable.
s16 mask
WINOUT, or WININ by mode: 0x3f3f or 63 when a transition starts.
u16 pages[2][322]
Window edges, two pages: WININ and WINOUT, then a WIN0H and WIN1H pair, each (left << 8 | right),...
u32 solidTile[8]
The dissolve's solid tile, one 8 by 8 tile of 4-bit pixels.
s32 centreX
16.16 fixed-point pixels: the centre of the ellipse around a point (mode 8), set by the Reveal effect...
s8 duration
frames; 0 when the value is not moving
s32 centreY
as centreX: the target's z less its y
The map work's display fields that transitions use: its display control bits and the lines where the ...
u16 irqSecondLine
scanlines; secondLine as the VCount interrupt reads it
u16 firstLine
scanlines: where the screen is hidden, 200 when it is not
u8 unk016[0xea]
map work fields no transition names
u32 unk000[5]
map work fields no transition names
u16 irqFirstLine
scanlines; firstLine as the VCount interrupt reads it
u16 secondLine
scanlines: where the screen is shown again, 250 when it is not hidden
u16 irqPhase
The VCount interrupt's phase: 0 waiting for a line above 159, 1 neither line passed,...
u16 dispcnt
Display control bits ORed into DISPCNT; DisplayState_ClearFlags clears those of backgrounds 1 to 3.
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
signed char s8
Definition types.h:10
signed short s16
Definition types.h:12
unsigned short u16
Definition types.h:13
unsigned char u8
Definition types.h:11