173 u16 tiles_vram,
u16 map_vram);
189#define DECLARE_GFX_ASSET(name, color_mode_) \
190 extern const u8 name##_tiles[], name##_tiles_end[]; \
191 extern const u8 name##_pal[], name##_pal_end[]; \
192 static const GfxAsset name = { \
193 .tiles = name##_tiles, \
194 .tiles_end = name##_tiles_end, \
195 .palette = name##_pal, \
196 .palette_end = name##_pal_end, \
197 .color_mode = (color_mode_), \
212#define DECLARE_BG_ASSET(name, color_mode_, map_size_) \
213 extern const u8 name##_tiles[], name##_tiles_end[]; \
214 extern const u8 name##_pal[], name##_pal_end[]; \
215 extern const u8 name##_map[], name##_map_end[]; \
216 static const BgAsset name = { \
218 .tiles = name##_tiles, \
219 .tiles_end = name##_tiles_end, \
220 .palette = name##_pal, \
221 .palette_end = name##_pal_end, \
222 .color_mode = (color_mode_), \
224 .tilemap = name##_map, \
225 .tilemap_end = name##_map_end, \
226 .map_size = (map_size_), \
void gfxLoad(u8 bg, const GfxAsset *asset, u8 palette_slot, u16 tiles_vram)
Load a tileset (tiles + palette) and configure a BG's tile graphics pointer. (It used to be described...
void bgLoad(u8 bg, const BgAsset *asset, u8 palette_slot, u16 tiles_vram, u16 map_vram)
Load a full background bundle: tiles, palette and tilemap in one call. (The BG_LOAD macro this used t...
SNES Background Layer Management.
SNES DMA (Direct Memory Access).
unsigned short u16
16-bit unsigned integer (0 to 65535)
Definition types.h:53
unsigned char u8
8-bit unsigned integer (0 to 255)
Definition types.h:47
A full background bundle: tileset + tilemap + map size.
Definition asset.h:129
const u8 * tilemap
Pointer to tilemap data (the .map that opensnes-tileset writes).
Definition asset.h:133
u8 map_size
Tilemap layout. Use one of SC_32x32, SC_64x32, SC_32x64, SC_64x64.
Definition asset.h:140
const u8 * tilemap_end
One past the end of the tilemap data.
Definition asset.h:135
GfxAsset gfx
Tileset (tiles + palette + color mode).
Definition asset.h:131
A tileset bundle: graphics + palette + color depth.
Definition asset.h:104
const u8 * tiles_end
One past the end of tile graphics. Size is computed at load time as tiles_end - tiles.
Definition asset.h:109
u16 color_mode
Color depth selector. Use one of: BG_4COLORS, BG_4COLORS0 (Mode 0), BG_16COLORS, BG_256COLORS....
Definition asset.h:120
const u8 * tiles
Pointer to tile graphics data.
Definition asset.h:106
const u8 * palette
Pointer to BGR555 palette data.
Definition asset.h:111
const u8 * palette_end
One past the end of the palette data.
Definition asset.h:113