Previous : Description of the functions Up : Description of the functions Next : High level functions

Data structures used by the functions

From begining, we mention matrix of tiles, sprite array, big virtual screen, or virtual screen. Here are their details:

Matrix of tiles
Matrix of char or short, with two dimensions. Its size must be at least 8 rows and 15 columns with 16x16 sprites, or 16 rows and 30 columns with 8x8 sprites.


Sprites
The sprites can be in grayscale or in B/W, and their size can be 16x16 or 8x8 pixels. There are specific functions for each type of sprite, so you must be careful when choosing.
Black and White sprites are classics : a simple array of 8 char for 8x8 sprites, or an array of 16 short for 16x16 sprites, containing each line of the sprite.
Grayscale sprites use a more complex format : an array of 16 char for 8x8 sprites, or 32 short for 16x16 sprites, it contains the first line of the sprite for the first plane, the first line for the second plane, the second line of the sprite for the first plane, the second line of the sprite for the second plane, etc... It's called an interlaced format.
The first plane can be the light or the dark plane, that doesn't matter, but respect the convention in your virtuals screens (see below).


Sprite array
The sprite array can be seen like an 1D array containing sprites, but it's actually a 2D array, because sprites are already an 1D array.


Matrix of animations
2D array of short : the number of rows is the number of animation steps, and the number of columns is the number of animations. Each cell contains the number of the sprite for a step for an animation.


Array of horizontal shifts
Array of char, with one dimension, of 128 elements. Each element is a horizontal shift to add to the current line when the big virtual screen is drawn on the screen. Correct values are between 0 and 16.


Array of vertical shifts
Array of short, with one dimension, of 128 elements. Each element is a value to add to the pointer on the source, at the end of each line drawed, when the big virtual screen is drawed on the screen. Any value is allowed, but be careful to not point outside of the big virtual screen.


Big virtual screen
Buffer of 5440 bytes in B/W, or 10880 bytes in grayscale (in this case, the 5440 first bytes are the first plane and the 5440 following bytes are the second plane ; you can choose which plane is the light or the dark plane, but keep this convention in your sprites).


Virtual screen
Buffer of 3840 bytes in B/W, or 2*3840 bytes in grayscales (in this case, the planes are not necessarily consecutive).


Previous : Description of the functions Up : Description of the functions Next : High level functions