From 8ea8da50d1f01fbbfce9e752d73a9303334555b4 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Sun, 8 Nov 2020 02:34:04 +0100 Subject: Upload TIM files into VRAM --- src/game/CMakeLists.txt | 3 +++ src/game/inc/game.h | 15 +++++++++++++++ src/game/src/game.c | 24 ++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 src/game/CMakeLists.txt create mode 100644 src/game/inc/game.h create mode 100644 src/game/src/game.c (limited to 'src/game') diff --git a/src/game/CMakeLists.txt b/src/game/CMakeLists.txt new file mode 100644 index 0000000..89cd1f0 --- /dev/null +++ b/src/game/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(game "src/game.c") +target_include_directories(game PUBLIC "inc") +target_link_libraries(game PRIVATE gfx) diff --git a/src/game/inc/game.h b/src/game/inc/game.h new file mode 100644 index 0000000..8275d54 --- /dev/null +++ b/src/game/inc/game.h @@ -0,0 +1,15 @@ +#ifndef GAME_H +#define GAME_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +int game(void); + +#ifdef __cplusplus +} +#endif + +#endif /* GAME_H */ diff --git a/src/game/src/game.c b/src/game/src/game.c new file mode 100644 index 0000000..b17e534 --- /dev/null +++ b/src/game/src/game.c @@ -0,0 +1,24 @@ +#include +#include + +static int init(void) +{ + struct gfx_sprite s, s2; + + if (gfx_sprite_from_file("cdrom:\\block.TIM;1", &s)) + return -1; + + gfx_sprite_sort(&s); + s2 = s; + gfx_sprite_sort(&s2); + gfx_draw(); + return 0; +} + +int game(void) +{ + if (init()) + return -1; + + return 0; +} -- cgit v1.2.3