From 4477c1db42b579a441bf0a62bed2f627176f1c76 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Sun, 14 Apr 2019 20:10:23 -0400 Subject: add next piece delay for when a line is cleared + cleanup --- frontends/calculator/Makefile | 8 ++ frontends/calculator/obj/gfx/block_1.src | 98 +++++++++++++++++ frontends/calculator/obj/gfx/block_2.src | 98 +++++++++++++++++ frontends/calculator/obj/gfx/block_3.src | 98 +++++++++++++++++ frontends/calculator/obj/gfx/block_4.src | 98 +++++++++++++++++ frontends/calculator/obj/gfx/block_5.src | 98 +++++++++++++++++ frontends/calculator/obj/gfx/block_6.src | 98 +++++++++++++++++ frontends/calculator/obj/gfx/block_7.src | 98 +++++++++++++++++ frontends/calculator/obj/gfx/logo_gfx.src | 22 ++++ frontends/calculator/obj/main.src | 172 ++++++++++++++++++++++++++++++ frontends/calculator/src/cetris.c | 1 + frontends/calculator/src/cetris.h | 1 + frontends/calculator/src/gfx/block_1.c | 17 +++ frontends/calculator/src/gfx/block_1.png | Bin 0 -> 127 bytes frontends/calculator/src/gfx/block_2.c | 17 +++ frontends/calculator/src/gfx/block_2.png | Bin 0 -> 129 bytes frontends/calculator/src/gfx/block_3.c | 17 +++ frontends/calculator/src/gfx/block_3.png | Bin 0 -> 129 bytes frontends/calculator/src/gfx/block_4.c | 17 +++ frontends/calculator/src/gfx/block_4.png | Bin 0 -> 129 bytes frontends/calculator/src/gfx/block_5.c | 17 +++ frontends/calculator/src/gfx/block_5.png | Bin 0 -> 126 bytes frontends/calculator/src/gfx/block_6.c | 17 +++ frontends/calculator/src/gfx/block_6.png | Bin 0 -> 129 bytes frontends/calculator/src/gfx/block_7.c | 17 +++ frontends/calculator/src/gfx/block_7.png | Bin 0 -> 129 bytes frontends/calculator/src/gfx/convpng.ini | 10 ++ frontends/calculator/src/gfx/convpng.log | 20 ++++ frontends/calculator/src/gfx/logo_gfx.c | 14 +++ frontends/calculator/src/gfx/logo_gfx.h | 47 ++++++++ frontends/calculator/src/input.c | 1 + frontends/calculator/src/input.h | 1 + frontends/calculator/src/main.c | 41 +++++++ frontends/calculator/src/matrix.c | 1 + frontends/calculator/src/matrix.h | 1 + frontends/calculator/src/types.h | 1 + 36 files changed, 1146 insertions(+) create mode 100644 frontends/calculator/Makefile create mode 100644 frontends/calculator/obj/gfx/block_1.src create mode 100644 frontends/calculator/obj/gfx/block_2.src create mode 100644 frontends/calculator/obj/gfx/block_3.src create mode 100644 frontends/calculator/obj/gfx/block_4.src create mode 100644 frontends/calculator/obj/gfx/block_5.src create mode 100644 frontends/calculator/obj/gfx/block_6.src create mode 100644 frontends/calculator/obj/gfx/block_7.src create mode 100644 frontends/calculator/obj/gfx/logo_gfx.src create mode 100644 frontends/calculator/obj/main.src create mode 120000 frontends/calculator/src/cetris.c create mode 120000 frontends/calculator/src/cetris.h create mode 100644 frontends/calculator/src/gfx/block_1.c create mode 100644 frontends/calculator/src/gfx/block_1.png create mode 100644 frontends/calculator/src/gfx/block_2.c create mode 100644 frontends/calculator/src/gfx/block_2.png create mode 100644 frontends/calculator/src/gfx/block_3.c create mode 100644 frontends/calculator/src/gfx/block_3.png create mode 100644 frontends/calculator/src/gfx/block_4.c create mode 100644 frontends/calculator/src/gfx/block_4.png create mode 100644 frontends/calculator/src/gfx/block_5.c create mode 100644 frontends/calculator/src/gfx/block_5.png create mode 100644 frontends/calculator/src/gfx/block_6.c create mode 100644 frontends/calculator/src/gfx/block_6.png create mode 100644 frontends/calculator/src/gfx/block_7.c create mode 100644 frontends/calculator/src/gfx/block_7.png create mode 100644 frontends/calculator/src/gfx/convpng.ini create mode 100644 frontends/calculator/src/gfx/convpng.log create mode 100644 frontends/calculator/src/gfx/logo_gfx.c create mode 100644 frontends/calculator/src/gfx/logo_gfx.h create mode 120000 frontends/calculator/src/input.c create mode 120000 frontends/calculator/src/input.h create mode 100644 frontends/calculator/src/main.c create mode 120000 frontends/calculator/src/matrix.c create mode 120000 frontends/calculator/src/matrix.h create mode 120000 frontends/calculator/src/types.h (limited to 'frontends/calculator') diff --git a/frontends/calculator/Makefile b/frontends/calculator/Makefile new file mode 100644 index 0000000..505d4bf --- /dev/null +++ b/frontends/calculator/Makefile @@ -0,0 +1,8 @@ +NAME ?= Cetris +COMPRESSED ?= NO +ICON ?= iconc.png +DESCRIPTION ?= "Cetris for calculator" + +# ---------------------------- + +include $(CEDEV)/include/.makefile diff --git a/frontends/calculator/obj/gfx/block_1.src b/frontends/calculator/obj/gfx/block_1.src new file mode 100644 index 0000000..19a50e7 --- /dev/null +++ b/frontends/calculator/obj/gfx/block_1.src @@ -0,0 +1,98 @@ +; Zilog eZ80 ANSI C Compiler Release 3.4 +; -optsize -noreduceopt -nomodsect -peephole -globalopt +; -localcse -const=ROM + FILE "SRC\GFX\BLOCK_1.C" + .assume ADL=1 + SEGMENT DATA +_block_1_data: + DB 9 + DB 9 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 0 + DB 5 + DB 5 + DB 5 + DB 5 + DB 5 + DB 5 + DB 2 + DB 2 + DB 5 + DB 0 + DB 0 + DB 5 + DB 5 + DB 5 + DB 5 + DB 2 + DB 2 + DB 5 + DB 0 + DB 5 + DB 5 + DB 5 + DB 5 + DB 5 + DB 2 + DB 2 + DB 5 + DB 5 + DB 5 + DB 5 + DB 5 + DB 5 + DB 5 + DB 2 + DB 2 + DB 5 + DB 5 + DB 5 + DB 5 + DB 5 + DB 5 + DB 5 + DB 2 + DB 2 + DB 5 + DB 5 + DB 5 + DB 5 + DB 5 + DB 5 + DB 5 + DB 2 + DB 2 + DB 5 + DB 5 + DB 5 + DB 5 + DB 5 + DB 5 + DB 5 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + XDEF _block_1_data +; 1 // convpng v7.0 +; 2 #include +; 3 #include "logo_gfx.h" +; 4 +; 5 // 8 bpp image +; 6 uint8_t block_1_data[83] = { + END diff --git a/frontends/calculator/obj/gfx/block_2.src b/frontends/calculator/obj/gfx/block_2.src new file mode 100644 index 0000000..200b19f --- /dev/null +++ b/frontends/calculator/obj/gfx/block_2.src @@ -0,0 +1,98 @@ +; Zilog eZ80 ANSI C Compiler Release 3.4 +; -optsize -noreduceopt -nomodsect -peephole -globalopt +; -localcse -const=ROM + FILE "SRC\GFX\BLOCK_2.C" + .assume ADL=1 + SEGMENT DATA +_block_2_data: + DB 9 + DB 9 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 0 + DB 7 + DB 7 + DB 7 + DB 7 + DB 7 + DB 7 + DB 2 + DB 2 + DB 7 + DB 0 + DB 0 + DB 7 + DB 7 + DB 7 + DB 7 + DB 2 + DB 2 + DB 7 + DB 0 + DB 7 + DB 7 + DB 7 + DB 7 + DB 7 + DB 2 + DB 2 + DB 7 + DB 7 + DB 7 + DB 7 + DB 7 + DB 7 + DB 7 + DB 2 + DB 2 + DB 7 + DB 7 + DB 7 + DB 7 + DB 7 + DB 7 + DB 7 + DB 2 + DB 2 + DB 7 + DB 7 + DB 7 + DB 7 + DB 7 + DB 7 + DB 7 + DB 2 + DB 2 + DB 7 + DB 7 + DB 7 + DB 7 + DB 7 + DB 7 + DB 7 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + XDEF _block_2_data +; 1 // convpng v7.0 +; 2 #include +; 3 #include "logo_gfx.h" +; 4 +; 5 // 8 bpp image +; 6 uint8_t block_2_data[83] = { + END diff --git a/frontends/calculator/obj/gfx/block_3.src b/frontends/calculator/obj/gfx/block_3.src new file mode 100644 index 0000000..5126067 --- /dev/null +++ b/frontends/calculator/obj/gfx/block_3.src @@ -0,0 +1,98 @@ +; Zilog eZ80 ANSI C Compiler Release 3.4 +; -optsize -noreduceopt -nomodsect -peephole -globalopt +; -localcse -const=ROM + FILE "SRC\GFX\BLOCK_3.C" + .assume ADL=1 + SEGMENT DATA +_block_3_data: + DB 9 + DB 9 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 0 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 2 + DB 2 + DB 6 + DB 0 + DB 0 + DB 6 + DB 6 + DB 6 + DB 6 + DB 2 + DB 2 + DB 6 + DB 0 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 2 + DB 2 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 2 + DB 2 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 2 + DB 2 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 2 + DB 2 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + XDEF _block_3_data +; 1 // convpng v7.0 +; 2 #include +; 3 #include "logo_gfx.h" +; 4 +; 5 // 8 bpp image +; 6 uint8_t block_3_data[83] = { + END diff --git a/frontends/calculator/obj/gfx/block_4.src b/frontends/calculator/obj/gfx/block_4.src new file mode 100644 index 0000000..bc9ad7d --- /dev/null +++ b/frontends/calculator/obj/gfx/block_4.src @@ -0,0 +1,98 @@ +; Zilog eZ80 ANSI C Compiler Release 3.4 +; -optsize -noreduceopt -nomodsect -peephole -globalopt +; -localcse -const=ROM + FILE "SRC\GFX\BLOCK_4.C" + .assume ADL=1 + SEGMENT DATA +_block_4_data: + DB 9 + DB 9 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 0 + DB 3 + DB 3 + DB 3 + DB 3 + DB 3 + DB 3 + DB 2 + DB 2 + DB 3 + DB 0 + DB 0 + DB 3 + DB 3 + DB 3 + DB 3 + DB 2 + DB 2 + DB 3 + DB 0 + DB 3 + DB 3 + DB 3 + DB 3 + DB 3 + DB 2 + DB 2 + DB 3 + DB 3 + DB 3 + DB 3 + DB 3 + DB 3 + DB 3 + DB 2 + DB 2 + DB 3 + DB 3 + DB 3 + DB 3 + DB 3 + DB 3 + DB 3 + DB 2 + DB 2 + DB 3 + DB 3 + DB 3 + DB 3 + DB 3 + DB 3 + DB 3 + DB 2 + DB 2 + DB 3 + DB 3 + DB 3 + DB 3 + DB 3 + DB 3 + DB 3 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + XDEF _block_4_data +; 1 // convpng v7.0 +; 2 #include +; 3 #include "logo_gfx.h" +; 4 +; 5 // 8 bpp image +; 6 uint8_t block_4_data[83] = { + END diff --git a/frontends/calculator/obj/gfx/block_5.src b/frontends/calculator/obj/gfx/block_5.src new file mode 100644 index 0000000..ec02546 --- /dev/null +++ b/frontends/calculator/obj/gfx/block_5.src @@ -0,0 +1,98 @@ +; Zilog eZ80 ANSI C Compiler Release 3.4 +; -optsize -noreduceopt -nomodsect -peephole -globalopt +; -localcse -const=ROM + FILE "SRC\GFX\BLOCK_5.C" + .assume ADL=1 + SEGMENT DATA +_block_5_data: + DB 9 + DB 9 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 0 + DB 4 + DB 4 + DB 4 + DB 4 + DB 4 + DB 4 + DB 2 + DB 2 + DB 4 + DB 0 + DB 0 + DB 4 + DB 4 + DB 4 + DB 4 + DB 2 + DB 2 + DB 4 + DB 0 + DB 4 + DB 4 + DB 4 + DB 4 + DB 4 + DB 2 + DB 2 + DB 4 + DB 4 + DB 4 + DB 4 + DB 4 + DB 4 + DB 4 + DB 2 + DB 2 + DB 4 + DB 4 + DB 4 + DB 4 + DB 4 + DB 4 + DB 4 + DB 2 + DB 2 + DB 4 + DB 4 + DB 4 + DB 4 + DB 4 + DB 4 + DB 4 + DB 2 + DB 2 + DB 4 + DB 4 + DB 4 + DB 4 + DB 4 + DB 4 + DB 4 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + XDEF _block_5_data +; 1 // convpng v7.0 +; 2 #include +; 3 #include "logo_gfx.h" +; 4 +; 5 // 8 bpp image +; 6 uint8_t block_5_data[83] = { + END diff --git a/frontends/calculator/obj/gfx/block_6.src b/frontends/calculator/obj/gfx/block_6.src new file mode 100644 index 0000000..7ae3009 --- /dev/null +++ b/frontends/calculator/obj/gfx/block_6.src @@ -0,0 +1,98 @@ +; Zilog eZ80 ANSI C Compiler Release 3.4 +; -optsize -noreduceopt -nomodsect -peephole -globalopt +; -localcse -const=ROM + FILE "SRC\GFX\BLOCK_6.C" + .assume ADL=1 + SEGMENT DATA +_block_6_data: + DB 9 + DB 9 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 0 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 2 + DB 2 + DB 6 + DB 0 + DB 0 + DB 6 + DB 6 + DB 6 + DB 6 + DB 2 + DB 2 + DB 6 + DB 0 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 2 + DB 2 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 2 + DB 2 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 2 + DB 2 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 2 + DB 2 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 6 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + XDEF _block_6_data +; 1 // convpng v7.0 +; 2 #include +; 3 #include "logo_gfx.h" +; 4 +; 5 // 8 bpp image +; 6 uint8_t block_6_data[83] = { + END diff --git a/frontends/calculator/obj/gfx/block_7.src b/frontends/calculator/obj/gfx/block_7.src new file mode 100644 index 0000000..fc945cd --- /dev/null +++ b/frontends/calculator/obj/gfx/block_7.src @@ -0,0 +1,98 @@ +; Zilog eZ80 ANSI C Compiler Release 3.4 +; -optsize -noreduceopt -nomodsect -peephole -globalopt +; -localcse -const=ROM + FILE "SRC\GFX\BLOCK_7.C" + .assume ADL=1 + SEGMENT DATA +_block_7_data: + DB 9 + DB 9 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 0 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 2 + DB 2 + DB 1 + DB 0 + DB 0 + DB 1 + DB 1 + DB 1 + DB 1 + DB 2 + DB 2 + DB 1 + DB 0 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 2 + DB 2 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 2 + DB 2 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 2 + DB 2 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 2 + DB 2 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + XDEF _block_7_data +; 1 // convpng v7.0 +; 2 #include +; 3 #include "logo_gfx.h" +; 4 +; 5 // 8 bpp image +; 6 uint8_t block_7_data[83] = { + END diff --git a/frontends/calculator/obj/gfx/logo_gfx.src b/frontends/calculator/obj/gfx/logo_gfx.src new file mode 100644 index 0000000..673beca --- /dev/null +++ b/frontends/calculator/obj/gfx/logo_gfx.src @@ -0,0 +1,22 @@ +; Zilog eZ80 ANSI C Compiler Release 3.4 +; -optsize -noreduceopt -nomodsect -peephole -globalopt +; -localcse -const=ROM + FILE "SRC\GFX\LOGO_GFX.C" + .assume ADL=1 + SEGMENT DATA +_logo_gfx_pal: + DW 65535 + DW 62052 + DW 0 + DW 52356 + DW 14527 + DW 8479 + DW 41840 + DW 22671 + XDEF _logo_gfx_pal +; 1 // convpng v7.0 +; 2 #include +; 3 #include "logo_gfx.h" +; 4 +; 5 uint16_t logo_gfx_pal[8] = { + END diff --git a/frontends/calculator/obj/main.src b/frontends/calculator/obj/main.src new file mode 100644 index 0000000..8897b9b --- /dev/null +++ b/frontends/calculator/obj/main.src @@ -0,0 +1,172 @@ +; Zilog eZ80 ANSI C Compiler Release 3.4 +; -optsize -noreduceopt -nomodsect -peephole -globalopt +; -localcse -const=ROM + FILE "SRC\MAIN.C" + .assume ADL=1 + SEGMENT CODE +; 1 #include +; 2 #include +; 3 #include +; 4 #include +; 5 +; 6 #include +; 7 #include +; 8 #include +; 9 #include +; 10 +; 11 #include +; 12 +; 13 #include "cetris.h" +; 14 +; 15 /* Include the sprite data */ +; 16 #include "gfx/logo_gfx.h" +; 17 +; 18 void main(void) { +_main: +; 19 /* Initialize the 8bpp graphics */ +; 20 gfx_Begin(); + CALL _gfx_Begin +; 21 +; 22 /* Set up the palette for our sprites */ +; 23 gfx_SetPalette(logo_gfx_pal, sizeof_logo_gfx_pal, 0); + LD BC,0 + PUSH BC + LD BC,16 + PUSH BC + LD BC,_logo_gfx_pal + PUSH BC + CALL _gfx_SetPalette + POP BC + POP BC + POP BC +; 24 +; 25 /* Fill the screen with color index 0 */ +; 26 gfx_FillScreen(0); + LD BC,0 + PUSH BC + CALL _gfx_FillScreen + POP BC +; 27 +; 28 /* Draw a bunch of different styled sprites on the screen */ +; 29 gfx_Sprite(block_1, 0, 0); + LD BC,0 + PUSH BC + PUSH BC + LD BC,_block_1_data + PUSH BC + CALL _gfx_Sprite + POP BC + POP BC + POP BC +; 30 gfx_Sprite_NoClip(block_1, 32, 32); + LD BC,32 + PUSH BC + PUSH BC + LD BC,_block_1_data + PUSH BC + CALL _gfx_Sprite_NoClip + POP BC + POP BC + POP BC +; 31 gfx_TransparentSprite(block_1, 64, 64); + LD BC,64 + PUSH BC + PUSH BC + LD BC,_block_1_data + PUSH BC + CALL _gfx_TransparentSprite + POP BC + POP BC + POP BC +; 32 gfx_TransparentSprite_NoClip(block_1, 96, 96); + LD BC,96 + PUSH BC + PUSH BC + LD BC,_block_1_data + PUSH BC + CALL _gfx_TransparentSprite_NoClip + POP BC + POP BC + POP BC +; 33 gfx_ScaledSprite_NoClip(block_1, 128, 128, 2, 2); + LD BC,2 + PUSH BC + PUSH BC + LD BC,128 + PUSH BC + PUSH BC + LD BC,_block_1_data + PUSH BC + CALL _gfx_ScaledSprite_NoClip + POP BC + POP BC + POP BC + POP BC + POP BC +; 34 gfx_ScaledTransparentSprite_NoClip(block_1, 128, 0, 3, 3); + LD BC,3 + PUSH BC + PUSH BC + LD BC,0 + PUSH BC + LD BC,128 + PUSH BC + LD BC,_block_1_data + PUSH BC + CALL _gfx_ScaledTransparentSprite_NoClip + POP BC + POP BC + POP BC + POP BC + POP BC +; 35 +; 36 /* Wait for a key to be pressed */ +; 37 while (!os_GetCSC()); +L_1: + CALL _os_GetCSC + OR A,A + JR Z,L_1 +; 38 +; 39 /* Close the graphics */ +; 40 gfx_End(); + CALL _gfx_End +; 41 } + RET + + +;**************************** _main *************************** +;Name Addr/Register Size Type +;_gfx_End IMPORT ----- function +;_os_GetCSC IMPORT ----- function +;_gfx_ScaledTransparentSprite_NoClip IMPORT ----- function +;_gfx_ScaledSprite_NoClip IMPORT ----- function +;_gfx_TransparentSprite_NoClip IMPORT ----- function +;_gfx_TransparentSprite IMPORT ----- function +;_gfx_Sprite_NoClip IMPORT ----- function +;_block_1_data IMPORT 83 variable +;_gfx_Sprite IMPORT ----- function +;_gfx_FillScreen IMPORT ----- function +;_logo_gfx_pal IMPORT 16 variable +;_gfx_SetPalette IMPORT ----- function +;_gfx_Begin IMPORT ----- function + + +; Stack Frame Size: 6 (bytes) +; Spill Code: 0 (instruction) + + + XREF _logo_gfx_pal:ROM + XREF _block_1_data:ROM + XREF _gfx_ScaledTransparentSprite_NoClip:ROM + XREF _gfx_ScaledSprite_NoClip:ROM + XREF _gfx_TransparentSprite_NoClip:ROM + XREF _gfx_TransparentSprite:ROM + XREF _gfx_Sprite_NoClip:ROM + XREF _gfx_Sprite:ROM + XREF _gfx_FillScreen:ROM + XREF _gfx_SetPalette:ROM + XREF _gfx_End:ROM + XREF _gfx_Begin:ROM + XREF _os_GetCSC:ROM + XDEF _main + END 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 +#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 Binary files /dev/null and b/frontends/calculator/src/gfx/block_1.png 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 +#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 Binary files /dev/null and b/frontends/calculator/src/gfx/block_2.png 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 +#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 Binary files /dev/null and b/frontends/calculator/src/gfx/block_3.png 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 +#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 Binary files /dev/null and b/frontends/calculator/src/gfx/block_4.png 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 +#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 Binary files /dev/null and b/frontends/calculator/src/gfx/block_5.png 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 +#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 Binary files /dev/null and b/frontends/calculator/src/gfx/block_6.png 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 +#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 Binary files /dev/null and b/frontends/calculator/src/gfx/block_7.png 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 +#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 + +#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 +#include +#include +#include + +#include +#include +#include +#include + +#include + +#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 -- cgit v1.2.3-101-g0448