Alchemy
Loading...
Searching...
No Matches

colosso_gauge.h

Go to the documentation of this file.
1#ifndef ALCHEMY_COLOSSO_GAUGE_H
2#define ALCHEMY_COLOSSO_GAUGE_H
3
4/// @file
5/// The Colosso race gauge's sprites and work.
6
7#include "types.h"
8#include "static_assert.h"
9
10/// One sprite of the race gauge's list: a link word, its position and shape
11/// attributes, and its tile.
13 s32 link; ///< written 0; Runtime_PushSlotEntry links the queue through it
14 s32 attr; ///< OAM attributes 0 and 1: y | x << 16 | shape and size bits
15 s32 tile; ///< OAM attribute 2: the tile, with palette 14 and priority 1
16};
17
18/// The Colosso race gauge's work at the start of work slot 59: its sprites,
19/// how far it has slid down, the racers and the finish.
21 struct ColossoGaugeSprite sprites[18]; ///< the bar, its ends and the racers
22 s16 vramBlock; ///< the VRAM cache entry holding the gauge's tiles
23 s16 level; ///< 0 hidden to 2 fully down; the bar's y is level * 6 - 8
24 s16 hold; ///< nonzero keeps the gauge down (level 2)
25 s16 playerActor; ///< the actor id drawn as the player's marker
26 s16 rivalActor; ///< the actor id drawn as the rival's marker
27 u16 finishItemActorA; ///< the first actor standing at the finish
28 u16 finishItemActorB; ///< the second actor standing at the finish
29 s16 segments; ///< 16-pixel bar pieces either side of the centre
30 s32 finishX; ///< 16.16 fixed-point pixels
31 s32 finishZ; ///< 16.16 fixed-point pixels
32};
33
34STATIC_ASSERT(sizeof(struct ColossoGaugeSprite) == 12);
35STATIC_ASSERT(sizeof(struct ColossoGaugeWork) == 240);
36STATIC_ASSERT(offsetof(struct ColossoGaugeWork, vramBlock) == 216);
39STATIC_ASSERT(offsetof(struct ColossoGaugeWork, playerActor) == 222);
40STATIC_ASSERT(offsetof(struct ColossoGaugeWork, rivalActor) == 224);
41STATIC_ASSERT(offsetof(struct ColossoGaugeWork, finishItemActorA) == 226);
42STATIC_ASSERT(offsetof(struct ColossoGaugeWork, finishItemActorB) == 228);
43STATIC_ASSERT(offsetof(struct ColossoGaugeWork, segments) == 230);
44STATIC_ASSERT(offsetof(struct ColossoGaugeWork, finishX) == 232);
45STATIC_ASSERT(offsetof(struct ColossoGaugeWork, finishZ) == 236);
46
47#endif
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
One sprite of the race gauge's list: a link word, its position and shape attributes,...
s32 tile
OAM attribute 2: the tile, with palette 14 and priority 1.
s32 link
written 0; Runtime_PushSlotEntry links the queue through it
s32 attr
OAM attributes 0 and 1: y | x << 16 | shape and size bits.
The Colosso race gauge's work at the start of work slot 59: its sprites, how far it has slid down,...
s16 rivalActor
the actor id drawn as the rival's marker
u16 finishItemActorA
the first actor standing at the finish
s16 segments
16-pixel bar pieces either side of the centre
s16 hold
nonzero keeps the gauge down (level 2)
u16 finishItemActorB
the second actor standing at the finish
struct ColossoGaugeSprite sprites[18]
the bar, its ends and the racers
s16 playerActor
the actor id drawn as the player's marker
s16 level
0 hidden to 2 fully down; the bar's y is level * 6 - 8
s32 finishX
16.16 fixed-point pixels
s16 vramBlock
the VRAM cache entry holding the gauge's tiles
s32 finishZ
16.16 fixed-point pixels
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
signed short s16
Definition types.h:12
unsigned short u16
Definition types.h:13