SecondBASIC Documentation v3

Home / Command Reference / LoadTiles

LoadTiles

Description: Loads tiles into VRAM.

Syntax:

LoadTiles <TileDataLocation>, <Count>, <VramLocation> [, <Offset>]

Part Description
<TileDataLocation> Required. The location of the tile data. This can either be a line label or a long variable. If using a long, you will need to load the line label address by using the LblPtr&() function.
<Count> Required. The number of tiles to load.
<VramLocation> Required. Location in VRAM to load the tiles.
<Offset> Optional. Offsets the <TileDataLocation> by the amount of tiles specified by the <offset>.

Example:

    Palettes pal,0,0,16
    LoadTiles MyTiles,1,1
    a& = LblPtr&(MyTiles)
    LoadTiles a&,1,2
 
    DrawTile 1,0,0
    DrawTile 2,0,1
 
    End
 
pal:
    DataInt $0000,$00EE,$0E0E,$000E,$0EE0,$00E0,$0E00,$0888
    DataInt $0CCC,$0088,$0808,$0008,$0880,$0080,$0800,$0000
 
MyTiles:
    DataLong $77777777
    DataLong $79999997
    DataLong $79999997
    DataLong $79999997
    DataLong $79999997
    DataLong $79999997
    DataLong $79999997
    DataLong $77777777