Table of Contents

Class Tiles

Namespace
GB
Assembly
GBSharp.Framework.dll

Loading tile data into VRAM.

public static class Tiles
Inheritance
Tiles
Inherited Members

Remarks

There are two tile regions, not three. The background and window share one; sprites have their own. LoadBackground(byte, byte, byte[]) and LoadTiles(byte, byte, byte[]) are deliberately the same operation under two names: one for code that thinks in layers, one for code that thinks in tiles, and neither costs anything the other does not.

Fields

BytesPerTile

Bytes per 8x8 tile, at 2 bits per pixel.

public const byte BytesPerTile = 16

Field Value

byte

MaxTiles

The number of tiles a layer's VRAM region holds.

public const byte MaxTiles = 255

Field Value

byte

Methods

LoadBackground(byte, byte, byte[])

Loads background and window tiles. Same as LoadTiles(byte, byte, byte[]).

[Native("gbs_bkg_load_tiles")]
public static void LoadBackground(byte firstTile, byte count, byte[] data)

Parameters

firstTile byte
count byte
data byte[]

LoadSprite(byte, byte, byte[])

Loads sprite tiles, which live in their own VRAM region.

[Native("gbs_sprite_load_tiles")]
public static void LoadSprite(byte firstTile, byte count, byte[] data)

Parameters

firstTile byte
count byte
data byte[]

LoadWindow(byte, byte, byte[])

Loads window tiles.

[Native("gbs_win_load_tiles")]
public static void LoadWindow(byte firstTile, byte count, byte[] data)

Parameters

firstTile byte
count byte
data byte[]

Remarks

The window draws from the background's tile region, so this writes the same VRAM as LoadBackground(byte, byte, byte[]). It exists so window-only code can say what it means.