1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-12-28 16:31:36 +00:00

Documented and cleaned up verlib.h and veralib.c

This commit is contained in:
FlightControl 2021-01-21 19:41:14 +01:00
parent ce8e0ab26a
commit 5157db5844
2 changed files with 6 additions and 8 deletions

View File

@ -91,11 +91,11 @@ inline void vera_layer_set_height_256(byte layer);
// Get the map width of the layer.
// - layer: Value of 0 or 1.
word vera_layer_get_width(byte layer);
inline word vera_layer_get_width(byte layer);
// Get the map height of the layer.
// - layer: Value of 0 or 1.
word vera_layer_get_height(byte layer);
inline word vera_layer_get_height(byte layer);
// Set the color depth of the layer in bit per pixel (BPP) to 1.

View File

@ -205,18 +205,16 @@ inline void vera_layer_set_height_256(byte layer) {
// Get the map width of the layer.
// - layer: Value of 0 or 1.
word vera_layer_get_width(byte layer) {
inline word vera_layer_get_width(byte layer) {
byte* config = vera_layer_config[layer];
byte mask = (byte)VERA_LAYER_WIDTH_MASK;
return VERA_LAYER_WIDTH[ (*config & mask) >> 4];
return VERA_LAYER_WIDTH[ (*config & VERA_LAYER_WIDTH_MASK) >> 4];
}
// Get the map height of the layer.
// - layer: Value of 0 or 1.
word vera_layer_get_height(byte layer) {
inline word vera_layer_get_height(byte layer) {
byte* config = vera_layer_config[layer];
byte mask = VERA_LAYER_HEIGHT_MASK;
return VERA_LAYER_HEIGHT[ (*config & mask) >> 6];
return VERA_LAYER_HEIGHT[ (*config & VERA_LAYER_HEIGHT_MASK) >> 6];
}
// Set the color depth of the layer in bit per pixel (BPP) to 1.