summaryrefslogtreecommitdiff
path: root/frontends/calculator/CEdev/examples/gfx_light_dark
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/calculator/CEdev/examples/gfx_light_dark')
-rw-r--r--frontends/calculator/CEdev/examples/gfx_light_dark/autotester.json126
-rw-r--r--frontends/calculator/CEdev/examples/gfx_light_dark/makefile30
-rw-r--r--frontends/calculator/CEdev/examples/gfx_light_dark/readme.md20
-rw-r--r--frontends/calculator/CEdev/examples/gfx_light_dark/src/main.c118
4 files changed, 147 insertions, 147 deletions
diff --git a/frontends/calculator/CEdev/examples/gfx_light_dark/autotester.json b/frontends/calculator/CEdev/examples/gfx_light_dark/autotester.json
index 772c268..f1a5915 100644
--- a/frontends/calculator/CEdev/examples/gfx_light_dark/autotester.json
+++ b/frontends/calculator/CEdev/examples/gfx_light_dark/autotester.json
@@ -1,63 +1,63 @@
-{
- "rom": "84pce_515.rom",
- "transfer_files": [
- "bin/DEMO.8xp"
- ],
- "target": {
- "name": "DEMO",
- "isASM": true
- },
- "sequence": [
- "action|launch", "delay|300", "hash|rectangles", "hash|palette_0",
- "key|enter", "delay|1000", "hash|palette_25",
- "key|enter", "delay|1000", "hash|palette_50",
- "key|enter", "delay|1000", "hash|palette_75",
- "key|enter", "delay|1000", "hash|palette_100",
- "key|enter", "delay|300", "hash|after_exit"
- ],
- "hashes": {
- "rectangles": {
- "description": "Test rectangles",
- "start": "vram_start",
- "size": "vram_8_size",
- "expected_CRCs": [ "328D511E" ]
- },
- "palette_0": {
- "description": "Test lighten/darken fade, 0% progress",
- "start": "lcdPalette",
- "size": "8",
- "expected_CRCs": [ "41C3BFF8" ]
- },
- "palette_25": {
- "description": "Test lighten/darken fade, 25% progress",
- "start": "lcdPalette",
- "size": "8",
- "expected_CRCs": [ "5F64F889" ]
- },
- "palette_50": {
- "description": "Test lighten/darken fade, 50% progress",
- "start": "lcdPalette",
- "size": "8",
- "expected_CRCs": [ "C48CEF7C" ]
- },
- "palette_75": {
- "description": "Test lighten/darken fade, 75% progress",
- "start": "lcdPalette",
- "size": "8",
- "expected_CRCs": [ "81FEDD4E" ]
- },
- "palette_100": {
- "description": "Test lighten/darken fade, 100% progress",
- "start": "lcdPalette",
- "size": "8",
- "expected_CRCs": [ "B451E096" ]
- },
- "after_exit": {
- "description": "Back to the home screen (exit check)",
- "start": "vram_start",
- "size": "vram_16_size",
- "expected_CRCs": [ "FFAF89BA", "101734A5" ]
- }
- }
-}
-
+{
+ "rom": "84pce_515.rom",
+ "transfer_files": [
+ "bin/DEMO.8xp"
+ ],
+ "target": {
+ "name": "DEMO",
+ "isASM": true
+ },
+ "sequence": [
+ "action|launch", "delay|300", "hash|rectangles", "hash|palette_0",
+ "key|enter", "delay|1000", "hash|palette_25",
+ "key|enter", "delay|1000", "hash|palette_50",
+ "key|enter", "delay|1000", "hash|palette_75",
+ "key|enter", "delay|1000", "hash|palette_100",
+ "key|enter", "delay|300", "hash|after_exit"
+ ],
+ "hashes": {
+ "rectangles": {
+ "description": "Test rectangles",
+ "start": "vram_start",
+ "size": "vram_8_size",
+ "expected_CRCs": [ "328D511E" ]
+ },
+ "palette_0": {
+ "description": "Test lighten/darken fade, 0% progress",
+ "start": "lcdPalette",
+ "size": "8",
+ "expected_CRCs": [ "41C3BFF8" ]
+ },
+ "palette_25": {
+ "description": "Test lighten/darken fade, 25% progress",
+ "start": "lcdPalette",
+ "size": "8",
+ "expected_CRCs": [ "5F64F889" ]
+ },
+ "palette_50": {
+ "description": "Test lighten/darken fade, 50% progress",
+ "start": "lcdPalette",
+ "size": "8",
+ "expected_CRCs": [ "C48CEF7C" ]
+ },
+ "palette_75": {
+ "description": "Test lighten/darken fade, 75% progress",
+ "start": "lcdPalette",
+ "size": "8",
+ "expected_CRCs": [ "81FEDD4E" ]
+ },
+ "palette_100": {
+ "description": "Test lighten/darken fade, 100% progress",
+ "start": "lcdPalette",
+ "size": "8",
+ "expected_CRCs": [ "B451E096" ]
+ },
+ "after_exit": {
+ "description": "Back to the home screen (exit check)",
+ "start": "vram_start",
+ "size": "vram_16_size",
+ "expected_CRCs": [ "FFAF89BA", "101734A5" ]
+ }
+ }
+}
+
diff --git a/frontends/calculator/CEdev/examples/gfx_light_dark/makefile b/frontends/calculator/CEdev/examples/gfx_light_dark/makefile
index 1f1b36b..d3deba8 100644
--- a/frontends/calculator/CEdev/examples/gfx_light_dark/makefile
+++ b/frontends/calculator/CEdev/examples/gfx_light_dark/makefile
@@ -1,15 +1,15 @@
-# ----------------------------
-# Set NAME to the program name
-# Set ICON to the png icon file name
-# Set DESCRIPTION to display within a compatible shell
-# Set COMPRESSED to "YES" to create a compressed program
-# ----------------------------
-
-NAME ?= DEMO
-COMPRESSED ?= NO
-ICON ?= iconc.png
-DESCRIPTION ?= "C SDK Demo"
-
-# ----------------------------
-
-include $(CEDEV)/include/.makefile
+# ----------------------------
+# Set NAME to the program name
+# Set ICON to the png icon file name
+# Set DESCRIPTION to display within a compatible shell
+# Set COMPRESSED to "YES" to create a compressed program
+# ----------------------------
+
+NAME ?= DEMO
+COMPRESSED ?= NO
+ICON ?= iconc.png
+DESCRIPTION ?= "C SDK Demo"
+
+# ----------------------------
+
+include $(CEDEV)/include/.makefile
diff --git a/frontends/calculator/CEdev/examples/gfx_light_dark/readme.md b/frontends/calculator/CEdev/examples/gfx_light_dark/readme.md
index e429c6c..238c3e3 100644
--- a/frontends/calculator/CEdev/examples/gfx_light_dark/readme.md
+++ b/frontends/calculator/CEdev/examples/gfx_light_dark/readme.md
@@ -1,10 +1,10 @@
-### GraphX Lighten and Darken Demo
-
-Demonstrates rectangle drawing and using gfx_Darken and gfx_Lighten to modify colors in the palette to implement fade effects.
-
-![Screenshot](screenshot.gif)
-
----
-
-This demo is a part of the C SDK Toolchain for use on the CE.
-
+### GraphX Lighten and Darken Demo
+
+Demonstrates rectangle drawing and using gfx_Darken and gfx_Lighten to modify colors in the palette to implement fade effects.
+
+![Screenshot](screenshot.gif)
+
+---
+
+This demo is a part of the C SDK Toolchain for use on the CE.
+
diff --git a/frontends/calculator/CEdev/examples/gfx_light_dark/src/main.c b/frontends/calculator/CEdev/examples/gfx_light_dark/src/main.c
index d4c0a06..4f2e4d1 100644
--- a/frontends/calculator/CEdev/examples/gfx_light_dark/src/main.c
+++ b/frontends/calculator/CEdev/examples/gfx_light_dark/src/main.c
@@ -1,59 +1,59 @@
-#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>
-
-#define color gfx_RGBTo1555(34, 55, 89)
-
-void main(void) {
- uint8_t i = 0;
-
- /* Initialize the 8bpp graphics */
- gfx_Begin();
-
- /* For i in 0..255 */
- do {
-
- /* Fade out to black */
- gfx_palette[0] = gfx_Darken(color, i);
- /* Fade in from black */
- gfx_palette[1] = gfx_Darken(color, ~i);
- /* Fade in from white */
- gfx_palette[3] = gfx_Lighten(color, ~i);
- /* Fade out to white */
- gfx_palette[2] = gfx_Lighten(color, i);
-
- /* Fade out to black */
- gfx_SetColor(0);
- gfx_FillRectangle_NoClip(0, 0, 160, 120);
- /* Fade in from black */
- gfx_SetColor(1);
- gfx_FillRectangle_NoClip(160, 0, 160, 120);
- /* Fade in from white */
- gfx_SetColor(2);
- gfx_FillRectangle_NoClip(0, 120, 160, 120);
- /* Fade out to white */
- gfx_SetColor(3);
- gfx_FillRectangle_NoClip(160, 120, 160, 120);
-
- /* Wait for a keypress at the start of each quarter of the fade */
- if (!(i & 0x3f)) {
- while (!os_GetCSC());
- }
-
- /* Loop until i is 0 again because of 8 bit range */
- } while (++i);
-
- /* Wait for a keypress */
- while (!os_GetCSC());
-
- /* Usual cleanup */
- gfx_End();
-}
+#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>
+
+#define color gfx_RGBTo1555(34, 55, 89)
+
+void main(void) {
+ uint8_t i = 0;
+
+ /* Initialize the 8bpp graphics */
+ gfx_Begin();
+
+ /* For i in 0..255 */
+ do {
+
+ /* Fade out to black */
+ gfx_palette[0] = gfx_Darken(color, i);
+ /* Fade in from black */
+ gfx_palette[1] = gfx_Darken(color, ~i);
+ /* Fade in from white */
+ gfx_palette[3] = gfx_Lighten(color, ~i);
+ /* Fade out to white */
+ gfx_palette[2] = gfx_Lighten(color, i);
+
+ /* Fade out to black */
+ gfx_SetColor(0);
+ gfx_FillRectangle_NoClip(0, 0, 160, 120);
+ /* Fade in from black */
+ gfx_SetColor(1);
+ gfx_FillRectangle_NoClip(160, 0, 160, 120);
+ /* Fade in from white */
+ gfx_SetColor(2);
+ gfx_FillRectangle_NoClip(0, 120, 160, 120);
+ /* Fade out to white */
+ gfx_SetColor(3);
+ gfx_FillRectangle_NoClip(160, 120, 160, 120);
+
+ /* Wait for a keypress at the start of each quarter of the fade */
+ if (!(i & 0x3f)) {
+ while (!os_GetCSC());
+ }
+
+ /* Loop until i is 0 again because of 8 bit range */
+ } while (++i);
+
+ /* Wait for a keypress */
+ while (!os_GetCSC());
+
+ /* Usual cleanup */
+ gfx_End();
+}