Alchemy
Loading...
Searching...
No Matches

render_input.h

Go to the documentation of this file.
1#ifndef ALCHEMY_RENDER_INPUT_H
2#define ALCHEMY_RENDER_INPUT_H
3
4/// @file
5/// The sprite renderer's inputs and outputs: render inputs, OAM attributes and
6/// render output lists.
7
8#include "types.h"
9#include "static_assert.h"
10#include "edition.h"
11#include "farcall.h"
12
13/// A 16-byte record of a rectangle. In TBS it only reserves stack space in
14/// tbs-ja's glyph renderer; no TBS code reads its fields.
16 u8 unk00[8]; ///< not named by TBS code
17 u16 width; ///< not named by TBS code
18 u16 height; ///< not named by TBS code
19 u16 x; ///< not named by TBS code
20 u16 y; ///< not named by TBS code
21};
22
23STATIC_ASSERT(sizeof(struct RenderInput) == 0x10);
24STATIC_ASSERT(offsetof(struct RenderInput, width) == 8);
26
27/// A sprite's OAM attribute 2 (tile index, priority and palette) and the
28/// halfword after it, as one word or as fields.
31 struct {
32 unsigned short index : 10;
33 unsigned short priority : 2;
34 unsigned short palette : 4;
35 u16 high;
37 struct {
38 u16 low;
39 u16 high;
41};
42
43/// Attributes zero through two copied to OAM, plus one unused word.
44struct RenderOam {
45 u16 y : 8;
51 u16 x : 9;
53 u16 size : 2;
54 u16 index : 10;
58};
59
60/// A render output: a sprite in a window's output list (a character, an icon
61/// or a portrait), with its VRAM cache slot and OAM attributes.
63 struct RenderOutput *next; ///< the next output in its list
64 /// 0 for a glyph; otherwise it owns VRAM cache slot index, freed with it,
65 /// and 2 (a portrait) also its palette slot.
67 s8 active; ///< its UI_SPRITE_ motion; 0 while free
68 u16 x; ///< screen pixels
69 u16 y; ///< screen pixels
70 u16 unk0a; ///< not named by TBS code
71 u16 animStep; ///< step of its motion's animation
72 s8 index; ///< VRAM cache slot, or a glyph's tile after glyphTiles
73 u8 sentinel; ///< depth slot it is drawn at (254 for glyphs)
74 /// The depth queue's link: with oam it is the sprite entry queued each
75 /// frame, read as struct CursorSprite.
77 struct RenderOam oam;
78};
79
80/// A list of render outputs: its first output and the link to append after.
84};
85
86STATIC_ASSERT(sizeof(struct RenderOutputList) == 8);
87STATIC_ASSERT(offsetof(struct RenderOutputList, tailLink) == 4);
88
90
93STATIC_ASSERT(sizeof(struct RenderOutput) == 0x1c);
94
95#endif
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
Public interfaces to the engine's code banks.
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
A 16-byte record of a rectangle.
u16 width
not named by TBS code
u16 y
not named by TBS code
u16 height
not named by TBS code
u16 x
not named by TBS code
u8 unk00[8]
not named by TBS code
Attributes zero through two copied to OAM, plus one unused word.
A list of render outputs: its first output and the link to append after.
struct RenderOutput ** tailLink
struct RenderOutput * head
A render output: a sprite in a window's output list (a character, an icon or a portrait),...
struct RenderOam oam
u8 unk10[4]
The depth queue's link: with oam it is the sprite entry queued each frame, read as struct CursorSprit...
u16 y
screen pixels
u8 sentinel
depth slot it is drawn at (254 for glyphs)
s8 active
its UI_SPRITE_ motion; 0 while free
struct RenderOutput * next
the next output in its list
u16 animStep
step of its motion's animation
u16 x
screen pixels
u16 unk0a
not named by TBS code
s8 kind
0 for a glyph; otherwise it owns VRAM cache slot index, freed with it, and 2 (a portrait) also its pa...
s8 index
VRAM cache slot, or a glyph's tile after glyphTiles.
The integer types, TRUE, UNUSED and the fixed-address macros.
unsigned int u32
Definition types.h:15
signed char s8
Definition types.h:10
unsigned short u16
Definition types.h:13
unsigned char u8
Definition types.h:11
A sprite's OAM attribute 2 (tile index, priority and palette) and the halfword after it,...
struct RenderTableValue::@007120236370026233101065137137050014126142057215 bits
struct RenderTableValue::@376154377114264171210256327336160324034217327145 half