Skip to content
🌋️
Alchemy
Theme: Weyard
Theme: Modern
Mode: Auto
Mode: Light
Mode: Dark
Alchemy
Source
Reference
Loading...
Searching...
No Matches
vram_tab.h
Go to the documentation of this file.
1
#ifndef ALCHEMY_VRAM_TAB_H
2
#define ALCHEMY_VRAM_TAB_H
3
4
/// @file
5
/// The sprite VRAM block cache and its owners.
6
7
#include "
types.h
"
8
#include "
edition.h
"
9
#include "
static_assert.h
"
10
11
enum
VramBlockLimits
{
12
VRAM_CACHE_ENTRY_COUNT
= 96,
13
VRAM_BLOCK_COUNT
= 512,
14
VRAM_BLOCK_BYTES
= 64,
15
VRAM_BLOCK_OWNER_FREE
= 0xff,
16
VRAM_CACHE_OFFSET_FREE
= 0xffff
17
};
18
19
extern
u8
gResourceBlockOwners
[
VRAM_BLOCK_COUNT
];
20
21
/// A sprite slot of the VRAM cache: the size of its block and where the block
22
/// starts in OBJ VRAM.
23
struct
VramBlockCacheEntry
{
24
u16
size
;
///< bytes
25
u16
offset
;
///< bytes from the start of OBJ VRAM
26
};
27
28
STATIC_ASSERT
(
sizeof
(
struct
VramBlockCacheEntry
) == 4);
29
STATIC_ASSERT
(
offsetof
(
struct
VramBlockCacheEntry
, offset) == 2);
30
31
extern
struct
VramBlockCacheEntry
gVramBlockCache
[];
32
33
#endif
edition.h
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
static_assert.h
STATIC_ASSERT, a compile-time check that emits nothing.
STATIC_ASSERT
#define STATIC_ASSERT(condition)
C89 permits repeated extern declarations of the same array.
Definition
static_assert.h:15
offsetof
#define offsetof(type, member)
Definition
stddef.h:19
VramBlockCacheEntry
A sprite slot of the VRAM cache: the size of its block and where the block starts in OBJ VRAM.
Definition
vram_tab.h:23
VramBlockCacheEntry::offset
u16 offset
bytes from the start of OBJ VRAM
Definition
vram_tab.h:25
VramBlockCacheEntry::size
u16 size
bytes
Definition
vram_tab.h:24
types.h
The integer types, TRUE, UNUSED and the fixed-address macros.
u16
unsigned short u16
Definition
types.h:13
u8
unsigned char u8
Definition
types.h:11
gVramBlockCache
struct VramBlockCacheEntry gVramBlockCache[]
gResourceBlockOwners
u8 gResourceBlockOwners[VRAM_BLOCK_COUNT]
VramBlockLimits
VramBlockLimits
Definition
vram_tab.h:11
VRAM_BLOCK_BYTES
@ VRAM_BLOCK_BYTES
Definition
vram_tab.h:14
VRAM_CACHE_ENTRY_COUNT
@ VRAM_CACHE_ENTRY_COUNT
Definition
vram_tab.h:12
VRAM_CACHE_OFFSET_FREE
@ VRAM_CACHE_OFFSET_FREE
Definition
vram_tab.h:16
VRAM_BLOCK_COUNT
@ VRAM_BLOCK_COUNT
Definition
vram_tab.h:13
VRAM_BLOCK_OWNER_FREE
@ VRAM_BLOCK_OWNER_FREE
Definition
vram_tab.h:15
include
graphics
vram_tab.h