aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-05-06 22:00:16 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-05-06 22:00:16 +0100
commitc9f28c1ce3ffda9c407003a26adf903d810b681b (patch)
tree0387d4fa236b37519f33295352aceb1babb98700
parent3a8be8c9949ac8c37822bed7cf407b46df6dbd0b (diff)
downloadubox-msx-lib-c9f28c1ce3ffda9c407003a26adf903d810b681b.tar.gz
ubox-msx-lib-c9f28c1ce3ffda9c407003a26adf903d810b681b.zip
Set tighter qualifiers for pointer parameters
This should prevent warnings when using source data from ROM.
-rw-r--r--include/mplayer.h4
-rw-r--r--include/spman.h6
-rw-r--r--include/ubox.h14
3 files changed, 12 insertions, 12 deletions
diff --git a/include/mplayer.h b/include/mplayer.h
index 8d36516..12bdc5e 100644
--- a/include/mplayer.h
+++ b/include/mplayer.h
@@ -56,7 +56,7 @@
* See [exporting songs and effects](#exporting-songs-and-effects) for details
* on how to add songs to your project.
*/
-void mplayer_init(uint8_t *song, uint8_t sub_song);
+void mplayer_init(const uint8_t *song, uint8_t sub_song);
/**
* Inits the effects table.
@@ -77,7 +77,7 @@ void mplayer_init(uint8_t *song, uint8_t sub_song);
* See [exporting songs and effects](#exporting-songs-and-effects) for details
* on how to add effects to your project.
*/
-void mplayer_init_effects(uint8_t *effects) __z88dk_fastcall;
+void mplayer_init_effects(const uint8_t *effects) __z88dk_fastcall;
// @Playback
diff --git a/include/spman.h b/include/spman.h
index d31dc3e..2a5db45 100644
--- a/include/spman.h
+++ b/include/spman.h
@@ -77,7 +77,7 @@ void spman_init();
* A `type` can't be reused with a different pattern, [spman_init](#spman_init)
* has to be called again to free all the patterns.
*/
-uint8_t spman_alloc_pat(uint8_t type, uint8_t *data, uint8_t len, uint8_t flip);
+uint8_t spman_alloc_pat(uint8_t type, const uint8_t *data, uint8_t len, uint8_t flip);
// @Sprite allocation
@@ -97,7 +97,7 @@ uint8_t spman_alloc_pat(uint8_t type, uint8_t *data, uint8_t len, uint8_t flip);
* Allocated sprites are shown on screen by calling to
* [spman_update](#spman_update).
*/
-void spman_alloc_fixed_sprite(struct sprite_attr *sp);
+void spman_alloc_fixed_sprite(const struct sprite_attr *sp);
/**
* Allocates a sprite described by `sp` to be shown on the screen on the next
@@ -114,7 +114,7 @@ void spman_alloc_fixed_sprite(struct sprite_attr *sp);
* Allocated sprites are shown on screen by calling to
* [spman_update](#spman_update).
*/
-void spman_alloc_sprite(struct sprite_attr *sp);
+void spman_alloc_sprite(const struct sprite_attr *sp);
/**
* Any allocated sprite will be freed.
diff --git a/include/ubox.h b/include/ubox.h
index b66c76e..842f2f4 100644
--- a/include/ubox.h
+++ b/include/ubox.h
@@ -193,7 +193,7 @@ uint8_t ubox_get_vsync_freq();
* All the tiles functions use an index in this tile set (usually via a `tile`
* parameter).
*/
-void ubox_set_tiles(uint8_t *tiles) __z88dk_fastcall;
+void ubox_set_tiles(const uint8_t *tiles) __z88dk_fastcall;
/**
* Sets the current color table for current tile set to the color table pointed
@@ -203,7 +203,7 @@ void ubox_set_tiles(uint8_t *tiles) __z88dk_fastcall;
* of the tiles table (8 rows, 8 bytes per tile). The colors will be loaded into
* the VDP in all three screen sections.
*/
-void ubox_set_tiles_colors(uint8_t *colors) __z88dk_fastcall;
+void ubox_set_tiles_colors(const uint8_t *colors) __z88dk_fastcall;
/**
* Puts a tile from current tile set on the screen. The tile is identified by
@@ -409,7 +409,7 @@ struct sprite_attr {
*
* See [ubox_set_sprite_pat16](#ubox_set_sprite_pat16) to set a 16x16 pixels pattern.
*/
-void ubox_set_sprite_pat8(uint8_t *data, uint8_t pattern);
+void ubox_set_sprite_pat8(const uint8_t *data, uint8_t pattern);
/**
* Sets the sprite pattern data pointed by `data` into pattern number
@@ -422,7 +422,7 @@ void ubox_set_sprite_pat8(uint8_t *data, uint8_t pattern);
* See [ubox_set_sprite_pat16_flip](#ubox_set_sprite_pat16_flip) to set a 16x16
* pixels pattern.
*/
-void ubox_set_sprite_pat8_flip(uint8_t *data, uint8_t pattern);
+void ubox_set_sprite_pat8_flip(const uint8_t *data, uint8_t pattern);
/**
* Sets the sprite attributes of sprite number `sprite` using the attributes
@@ -442,7 +442,7 @@ void ubox_set_sprite_pat8_flip(uint8_t *data, uint8_t pattern);
* table, it is recommended to use [ubox_write_vm](#ubox_write_vm). The sprite
* attribute table is in the memory address `0x1b00`.
*/
-void ubox_set_sprite_attr(struct sprite_attr *attr, uint8_t sprite);
+void ubox_set_sprite_attr(const struct sprite_attr *attr, uint8_t sprite);
/**
* Sets the sprite pattern data pointed by `data` into pattern number
@@ -455,7 +455,7 @@ void ubox_set_sprite_attr(struct sprite_attr *attr, uint8_t sprite);
*
* See [ubox_set_sprite_pat8](#ubox_set_sprite_pat8) to set a 8x8 pixels pattern.
*/
-void ubox_set_sprite_pat16(uint8_t *data, uint8_t pattern);
+void ubox_set_sprite_pat16(const uint8_t *data, uint8_t pattern);
/**
* Sets the sprite pattern data pointed by `data` into pattern number
@@ -469,7 +469,7 @@ void ubox_set_sprite_pat16(uint8_t *data, uint8_t pattern);
* See [ubox_set_sprite_pat8_flip](#ubox_set_sprite_pat8_flip) to set a 8x8
* pixels pattern.
*/
-void ubox_set_sprite_pat16_flip(uint8_t *data, uint8_t pattern);
+void ubox_set_sprite_pat16_flip(const uint8_t *data, uint8_t pattern);
// @Control functions
//