summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2020-11-08 02:34:04 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2020-11-08 02:34:04 +0100
commit8ea8da50d1f01fbbfce9e752d73a9303334555b4 (patch)
tree7b57544c376ca8907ccf26a878c2d12e202b50e4 /src/game
parent468468633e2b07e39d3edeb169a1924d4c4ce773 (diff)
downloadpinboid-8ea8da50d1f01fbbfce9e752d73a9303334555b4.tar.gz
Upload TIM files into VRAM
Diffstat (limited to 'src/game')
-rw-r--r--src/game/CMakeLists.txt3
-rw-r--r--src/game/inc/game.h15
-rw-r--r--src/game/src/game.c24
3 files changed, 42 insertions, 0 deletions
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 <game.h>
+#include <gfx.h>
+
+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;
+}