diff options
author | Juan J. Martinez <jjm@usebox.net> | 2024-05-27 19:13:02 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2024-05-27 19:13:02 +0100 |
commit | 420ac2c8f2307ddcbe551972544bbe11f05ee7ff (patch) | |
tree | 70748bd36a378f3a44ccb720e2776030eac956f2 /game | |
parent | 0b3ba3e708899145296e3b6c1496ff87efe6a6c7 (diff) | |
download | ubox-msx-lib-420ac2c8f2307ddcbe551972544bbe11f05ee7ff.tar.gz ubox-msx-lib-420ac2c8f2307ddcbe551972544bbe11f05ee7ff.zip |
Avoid function declarator with no prototype errors
This is for SDCC 4.4.0 at least.
Diffstat (limited to 'game')
-rw-r--r-- | game/src/game.c | 12 | ||||
-rw-r--r-- | game/src/game.h | 12 | ||||
-rw-r--r-- | game/src/main.c | 8 | ||||
-rw-r--r-- | game/src/main.h | 4 |
4 files changed, 18 insertions, 18 deletions
diff --git a/game/src/game.c b/game/src/game.c index 2fea5a3..3f91e23 100644 --- a/game/src/game.c +++ b/game/src/game.c @@ -19,7 +19,7 @@ #define BG_TILE_MAP 0x1800 -void init_map_entities() +void init_map_entities(void) { const uint8_t *m = cur_map; uint8_t typ, last = 0; @@ -83,7 +83,7 @@ void init_map_entities() } -void draw_map() +void draw_map(void) { // draw the map! // @@ -96,7 +96,7 @@ void draw_map() ubox_write_vm((uint8_t *)BG_TILE_MAP, MAP_W * MAP_H, cur_map_data); } -void draw_hud() +void draw_hud(void) { uint8_t i; @@ -189,7 +189,7 @@ uint8_t is_map_elevator_up(uint8_t x, uint8_t y) return (t == 14 || t == 15); } -void update_enemy() +void update_enemy(void) { // check for the player; if alive and not invulnerable! // we use small hit boxes @@ -253,7 +253,7 @@ void update_enemy() spman_alloc_sprite(&sp); } -void update_player() +void update_player(void) { // to know if we need to update the walk animation uint8_t moved = 0; @@ -371,7 +371,7 @@ void update_player() spman_alloc_fixed_sprite(&sp); } -void run_game() +void run_game(void) { uint8_t i; diff --git a/game/src/game.h b/game/src/game.h index 5f5d603..1354522 100644 --- a/game/src/game.h +++ b/game/src/game.h @@ -80,16 +80,16 @@ struct entity uint8_t flags; uint8_t delay; uint8_t frame; - void (*update)(); + void (*update)(void); }; -void run_game(); +void run_game(void); -void update_player(); -void update_enemy(); +void update_player(void); +void update_enemy(void); -void draw_map(); -void draw_hud(); +void draw_map(void); +void draw_hud(void); void erase_battery(uint8_t x, uint8_t y); diff --git a/game/src/main.c b/game/src/main.c index c95fcc8..577fd5c 100644 --- a/game/src/main.c +++ b/game/src/main.c @@ -12,7 +12,7 @@ // generated #include "tiles.h" -void draw_menu() +void draw_menu(void) { uint8_t i; @@ -39,7 +39,7 @@ void draw_menu() ubox_enable_screen(); } -void draw_end_game() +void draw_end_game(void) { ubox_disable_screen(); @@ -63,7 +63,7 @@ void draw_end_game() } } -void draw_game_over() +void draw_game_over(void) { ubox_disable_screen(); @@ -78,7 +78,7 @@ void draw_game_over() ubox_wait_for(128); } -void main() +void main(void) { // PAL: 50/2 = 25 FPS // NTSC: 60/2 = 30 FPS diff --git a/game/src/main.h b/game/src/main.h index 9f7b628..606a07c 100644 --- a/game/src/main.h +++ b/game/src/main.h @@ -33,8 +33,8 @@ enum effects EFX_DEAD, }; -void draw_end_game(); -void draw_menu(); +void draw_end_game(void); +void draw_menu(void); // store the selected control LOCAL uint8_t ctl; |