summaryrefslogtreecommitdiff
path: root/frontends/calculator/src
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/calculator/src')
l---------frontends/calculator/src/cetris.c1
l---------frontends/calculator/src/cetris.h1
-rw-r--r--frontends/calculator/src/gfx/block_1.c17
-rw-r--r--frontends/calculator/src/gfx/block_1.pngbin0 -> 127 bytes
-rw-r--r--frontends/calculator/src/gfx/block_2.c17
-rw-r--r--frontends/calculator/src/gfx/block_2.pngbin0 -> 129 bytes
-rw-r--r--frontends/calculator/src/gfx/block_3.c17
-rw-r--r--frontends/calculator/src/gfx/block_3.pngbin0 -> 129 bytes
-rw-r--r--frontends/calculator/src/gfx/block_4.c17
-rw-r--r--frontends/calculator/src/gfx/block_4.pngbin0 -> 129 bytes
-rw-r--r--frontends/calculator/src/gfx/block_5.c17
-rw-r--r--frontends/calculator/src/gfx/block_5.pngbin0 -> 126 bytes
-rw-r--r--frontends/calculator/src/gfx/block_6.c17
-rw-r--r--frontends/calculator/src/gfx/block_6.pngbin0 -> 129 bytes
-rw-r--r--frontends/calculator/src/gfx/block_7.c17
-rw-r--r--frontends/calculator/src/gfx/block_7.pngbin0 -> 129 bytes
-rw-r--r--frontends/calculator/src/gfx/convpng.ini10
-rw-r--r--frontends/calculator/src/gfx/convpng.log20
-rw-r--r--frontends/calculator/src/gfx/logo_gfx.c14
-rw-r--r--frontends/calculator/src/gfx/logo_gfx.h47
l---------frontends/calculator/src/input.c1
l---------frontends/calculator/src/input.h1
-rw-r--r--frontends/calculator/src/main.c41
l---------frontends/calculator/src/matrix.c1
l---------frontends/calculator/src/matrix.h1
l---------frontends/calculator/src/types.h1
26 files changed, 258 insertions, 0 deletions
diff --git a/frontends/calculator/src/cetris.c b/frontends/calculator/src/cetris.c
new file mode 120000
index 0000000..ecbdb48
--- /dev/null
+++ b/frontends/calculator/src/cetris.c
@@ -0,0 +1 @@
+../../../core/src/cetris.c \ No newline at end of file
diff --git a/frontends/calculator/src/cetris.h b/frontends/calculator/src/cetris.h
new file mode 120000
index 0000000..37329b2
--- /dev/null
+++ b/frontends/calculator/src/cetris.h
@@ -0,0 +1 @@
+../../../core/include/cetris.h \ No newline at end of file
diff --git a/frontends/calculator/src/gfx/block_1.c b/frontends/calculator/src/gfx/block_1.c
new file mode 100644
index 0000000..58d58d3
--- /dev/null
+++ b/frontends/calculator/src/gfx/block_1.c
@@ -0,0 +1,17 @@
+// convpng v7.0
+#include <stdint.h>
+#include "logo_gfx.h"
+
+// 8 bpp image
+uint8_t block_1_data[83] = {
+ 9,9, // width,height
+ 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+ 0x02,0x00,0x05,0x05,0x05,0x05,0x05,0x05,0x02,
+ 0x02,0x05,0x00,0x00,0x05,0x05,0x05,0x05,0x02,
+ 0x02,0x05,0x00,0x05,0x05,0x05,0x05,0x05,0x02,
+ 0x02,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x02,
+ 0x02,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x02,
+ 0x02,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x02,
+ 0x02,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x02,
+ 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+};
diff --git a/frontends/calculator/src/gfx/block_1.png b/frontends/calculator/src/gfx/block_1.png
new file mode 100644
index 0000000..295821e
--- /dev/null
+++ b/frontends/calculator/src/gfx/block_1.png
Binary files differ
diff --git a/frontends/calculator/src/gfx/block_2.c b/frontends/calculator/src/gfx/block_2.c
new file mode 100644
index 0000000..47c16cb
--- /dev/null
+++ b/frontends/calculator/src/gfx/block_2.c
@@ -0,0 +1,17 @@
+// convpng v7.0
+#include <stdint.h>
+#include "logo_gfx.h"
+
+// 8 bpp image
+uint8_t block_2_data[83] = {
+ 9,9, // width,height
+ 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+ 0x02,0x00,0x07,0x07,0x07,0x07,0x07,0x07,0x02,
+ 0x02,0x07,0x00,0x00,0x07,0x07,0x07,0x07,0x02,
+ 0x02,0x07,0x00,0x07,0x07,0x07,0x07,0x07,0x02,
+ 0x02,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x02,
+ 0x02,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x02,
+ 0x02,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x02,
+ 0x02,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x02,
+ 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+};
diff --git a/frontends/calculator/src/gfx/block_2.png b/frontends/calculator/src/gfx/block_2.png
new file mode 100644
index 0000000..29443db
--- /dev/null
+++ b/frontends/calculator/src/gfx/block_2.png
Binary files differ
diff --git a/frontends/calculator/src/gfx/block_3.c b/frontends/calculator/src/gfx/block_3.c
new file mode 100644
index 0000000..798215c
--- /dev/null
+++ b/frontends/calculator/src/gfx/block_3.c
@@ -0,0 +1,17 @@
+// convpng v7.0
+#include <stdint.h>
+#include "logo_gfx.h"
+
+// 8 bpp image
+uint8_t block_3_data[83] = {
+ 9,9, // width,height
+ 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+ 0x02,0x00,0x06,0x06,0x06,0x06,0x06,0x06,0x02,
+ 0x02,0x06,0x00,0x00,0x06,0x06,0x06,0x06,0x02,
+ 0x02,0x06,0x00,0x06,0x06,0x06,0x06,0x06,0x02,
+ 0x02,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x02,
+ 0x02,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x02,
+ 0x02,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x02,
+ 0x02,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x02,
+ 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+};
diff --git a/frontends/calculator/src/gfx/block_3.png b/frontends/calculator/src/gfx/block_3.png
new file mode 100644
index 0000000..a4b6dfd
--- /dev/null
+++ b/frontends/calculator/src/gfx/block_3.png
Binary files differ
diff --git a/frontends/calculator/src/gfx/block_4.c b/frontends/calculator/src/gfx/block_4.c
new file mode 100644
index 0000000..517aff2
--- /dev/null
+++ b/frontends/calculator/src/gfx/block_4.c
@@ -0,0 +1,17 @@
+// convpng v7.0
+#include <stdint.h>
+#include "logo_gfx.h"
+
+// 8 bpp image
+uint8_t block_4_data[83] = {
+ 9,9, // width,height
+ 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+ 0x02,0x00,0x03,0x03,0x03,0x03,0x03,0x03,0x02,
+ 0x02,0x03,0x00,0x00,0x03,0x03,0x03,0x03,0x02,
+ 0x02,0x03,0x00,0x03,0x03,0x03,0x03,0x03,0x02,
+ 0x02,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,
+ 0x02,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,
+ 0x02,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,
+ 0x02,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,
+ 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+};
diff --git a/frontends/calculator/src/gfx/block_4.png b/frontends/calculator/src/gfx/block_4.png
new file mode 100644
index 0000000..e5b977e
--- /dev/null
+++ b/frontends/calculator/src/gfx/block_4.png
Binary files differ
diff --git a/frontends/calculator/src/gfx/block_5.c b/frontends/calculator/src/gfx/block_5.c
new file mode 100644
index 0000000..073b138
--- /dev/null
+++ b/frontends/calculator/src/gfx/block_5.c
@@ -0,0 +1,17 @@
+// convpng v7.0
+#include <stdint.h>
+#include "logo_gfx.h"
+
+// 8 bpp image
+uint8_t block_5_data[83] = {
+ 9,9, // width,height
+ 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+ 0x02,0x00,0x04,0x04,0x04,0x04,0x04,0x04,0x02,
+ 0x02,0x04,0x00,0x00,0x04,0x04,0x04,0x04,0x02,
+ 0x02,0x04,0x00,0x04,0x04,0x04,0x04,0x04,0x02,
+ 0x02,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x02,
+ 0x02,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x02,
+ 0x02,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x02,
+ 0x02,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x02,
+ 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+};
diff --git a/frontends/calculator/src/gfx/block_5.png b/frontends/calculator/src/gfx/block_5.png
new file mode 100644
index 0000000..a63802c
--- /dev/null
+++ b/frontends/calculator/src/gfx/block_5.png
Binary files differ
diff --git a/frontends/calculator/src/gfx/block_6.c b/frontends/calculator/src/gfx/block_6.c
new file mode 100644
index 0000000..4decd9b
--- /dev/null
+++ b/frontends/calculator/src/gfx/block_6.c
@@ -0,0 +1,17 @@
+// convpng v7.0
+#include <stdint.h>
+#include "logo_gfx.h"
+
+// 8 bpp image
+uint8_t block_6_data[83] = {
+ 9,9, // width,height
+ 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+ 0x02,0x00,0x06,0x06,0x06,0x06,0x06,0x06,0x02,
+ 0x02,0x06,0x00,0x00,0x06,0x06,0x06,0x06,0x02,
+ 0x02,0x06,0x00,0x06,0x06,0x06,0x06,0x06,0x02,
+ 0x02,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x02,
+ 0x02,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x02,
+ 0x02,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x02,
+ 0x02,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x02,
+ 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+};
diff --git a/frontends/calculator/src/gfx/block_6.png b/frontends/calculator/src/gfx/block_6.png
new file mode 100644
index 0000000..a4b6dfd
--- /dev/null
+++ b/frontends/calculator/src/gfx/block_6.png
Binary files differ
diff --git a/frontends/calculator/src/gfx/block_7.c b/frontends/calculator/src/gfx/block_7.c
new file mode 100644
index 0000000..67122d1
--- /dev/null
+++ b/frontends/calculator/src/gfx/block_7.c
@@ -0,0 +1,17 @@
+// convpng v7.0
+#include <stdint.h>
+#include "logo_gfx.h"
+
+// 8 bpp image
+uint8_t block_7_data[83] = {
+ 9,9, // width,height
+ 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+ 0x02,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+ 0x02,0x01,0x00,0x00,0x01,0x01,0x01,0x01,0x02,
+ 0x02,0x01,0x00,0x01,0x01,0x01,0x01,0x01,0x02,
+ 0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+ 0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+ 0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+ 0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+ 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+};
diff --git a/frontends/calculator/src/gfx/block_7.png b/frontends/calculator/src/gfx/block_7.png
new file mode 100644
index 0000000..8cb6da8
--- /dev/null
+++ b/frontends/calculator/src/gfx/block_7.png
Binary files differ
diff --git a/frontends/calculator/src/gfx/convpng.ini b/frontends/calculator/src/gfx/convpng.ini
new file mode 100644
index 0000000..fcf7193
--- /dev/null
+++ b/frontends/calculator/src/gfx/convpng.ini
@@ -0,0 +1,10 @@
+#GroupC : logo_gfx
+#TransparentColor : 255,255,255
+#PNGImages :
+ block_1
+ block_2
+ block_3
+ block_4
+ block_5
+ block_6
+ block_7
diff --git a/frontends/calculator/src/gfx/convpng.log b/frontends/calculator/src/gfx/convpng.log
new file mode 100644
index 0000000..538c0d0
--- /dev/null
+++ b/frontends/calculator/src/gfx/convpng.log
@@ -0,0 +1,20 @@
+opened convpng.ini
+
+--- logo_gfx (C) ---
+building palette with [256] available indices ...
+built palette with [8] indices.
+palette quality : 100.00%
+transparent color index : 0
+transparent color : 0xFFFF
+7:
+ block_1 : 100.00%
+ block_2 : 100.00%
+ block_3 : 100.00%
+ block_4 : 100.00%
+ block_5 : 100.00%
+ block_6 : 100.00%
+ block_7 : 100.00%
+
+converted in 0 s
+
+finished!
diff --git a/frontends/calculator/src/gfx/logo_gfx.c b/frontends/calculator/src/gfx/logo_gfx.c
new file mode 100644
index 0000000..3509c0e
--- /dev/null
+++ b/frontends/calculator/src/gfx/logo_gfx.c
@@ -0,0 +1,14 @@
+// convpng v7.0
+#include <stdint.h>
+#include "logo_gfx.h"
+
+uint16_t logo_gfx_pal[8] = {
+ 0xFFFF, // 00 :: rgb(255,255,255)
+ 0xF264, // 01 :: rgb(231,156,33)
+ 0x0000, // 02 :: rgb(0,0,0)
+ 0xCC84, // 03 :: rgb(160,35,30)
+ 0x38BF, // 04 :: rgb(115,41,255)
+ 0x211F, // 05 :: rgb(66,66,255)
+ 0xA370, // 06 :: rgb(66,222,132)
+ 0x588F, // 07 :: rgb(181,33,123)
+}; \ No newline at end of file
diff --git a/frontends/calculator/src/gfx/logo_gfx.h b/frontends/calculator/src/gfx/logo_gfx.h
new file mode 100644
index 0000000..02714e5
--- /dev/null
+++ b/frontends/calculator/src/gfx/logo_gfx.h
@@ -0,0 +1,47 @@
+// convpng v7.0
+// this file contains all the graphics sources for easy inclusion in a project
+#ifndef __logo_gfx__
+#define __logo_gfx__
+#include <stdint.h>
+
+#define logo_gfx_transparent_color_index 0
+
+#define block_1_width 9
+#define block_1_height 9
+#define block_1_size 83
+extern uint8_t block_1_data[83];
+#define block_1 ((gfx_sprite_t*)block_1_data)
+#define block_2_width 9
+#define block_2_height 9
+#define block_2_size 83
+extern uint8_t block_2_data[83];
+#define block_2 ((gfx_sprite_t*)block_2_data)
+#define block_3_width 9
+#define block_3_height 9
+#define block_3_size 83
+extern uint8_t block_3_data[83];
+#define block_3 ((gfx_sprite_t*)block_3_data)
+#define block_4_width 9
+#define block_4_height 9
+#define block_4_size 83
+extern uint8_t block_4_data[83];
+#define block_4 ((gfx_sprite_t*)block_4_data)
+#define block_5_width 9
+#define block_5_height 9
+#define block_5_size 83
+extern uint8_t block_5_data[83];
+#define block_5 ((gfx_sprite_t*)block_5_data)
+#define block_6_width 9
+#define block_6_height 9
+#define block_6_size 83
+extern uint8_t block_6_data[83];
+#define block_6 ((gfx_sprite_t*)block_6_data)
+#define block_7_width 9
+#define block_7_height 9
+#define block_7_size 83
+extern uint8_t block_7_data[83];
+#define block_7 ((gfx_sprite_t*)block_7_data)
+#define sizeof_logo_gfx_pal 16
+extern uint16_t logo_gfx_pal[8];
+
+#endif
diff --git a/frontends/calculator/src/input.c b/frontends/calculator/src/input.c
new file mode 120000
index 0000000..5b377ca
--- /dev/null
+++ b/frontends/calculator/src/input.c
@@ -0,0 +1 @@
+../../../core/src/input.c \ No newline at end of file
diff --git a/frontends/calculator/src/input.h b/frontends/calculator/src/input.h
new file mode 120000
index 0000000..d569ad2
--- /dev/null
+++ b/frontends/calculator/src/input.h
@@ -0,0 +1 @@
+../../../core/include/input.h \ No newline at end of file
diff --git a/frontends/calculator/src/main.c b/frontends/calculator/src/main.c
new file mode 100644
index 0000000..535f431
--- /dev/null
+++ b/frontends/calculator/src/main.c
@@ -0,0 +1,41 @@
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <tice.h>
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <graphx.h>
+
+#include "cetris.h"
+
+/* Include the sprite data */
+#include "gfx/logo_gfx.h"
+
+void main(void) {
+ /* Initialize the 8bpp graphics */
+ gfx_Begin();
+
+ /* Set up the palette for our sprites */
+ gfx_SetPalette(logo_gfx_pal, sizeof_logo_gfx_pal, 0);
+
+ /* Fill the screen with color index 0 */
+ gfx_FillScreen(0);
+
+ /* Draw a bunch of different styled sprites on the screen */
+ gfx_Sprite(block_1, 0, 0);
+ gfx_Sprite_NoClip(block_1, 32, 32);
+ gfx_TransparentSprite(block_1, 64, 64);
+ gfx_TransparentSprite_NoClip(block_1, 96, 96);
+ gfx_ScaledSprite_NoClip(block_1, 128, 128, 2, 2);
+ gfx_ScaledTransparentSprite_NoClip(block_1, 128, 0, 3, 3);
+
+ /* Wait for a key to be pressed */
+ while (!os_GetCSC());
+
+ /* Close the graphics */
+ gfx_End();
+}
diff --git a/frontends/calculator/src/matrix.c b/frontends/calculator/src/matrix.c
new file mode 120000
index 0000000..9a72a36
--- /dev/null
+++ b/frontends/calculator/src/matrix.c
@@ -0,0 +1 @@
+../../../core/src/matrix.c \ No newline at end of file
diff --git a/frontends/calculator/src/matrix.h b/frontends/calculator/src/matrix.h
new file mode 120000
index 0000000..0b441d9
--- /dev/null
+++ b/frontends/calculator/src/matrix.h
@@ -0,0 +1 @@
+../../../core/include/matrix.h \ No newline at end of file
diff --git a/frontends/calculator/src/types.h b/frontends/calculator/src/types.h
new file mode 120000
index 0000000..65216e0
--- /dev/null
+++ b/frontends/calculator/src/types.h
@@ -0,0 +1 @@
+../../../core/include/types.h \ No newline at end of file