diff options
| author | 2019-04-13 12:40:52 -0400 | |
|---|---|---|
| committer | 2019-04-13 12:40:52 -0400 | |
| commit | 55bfff7cf6541caac172b43186cf14405185b14d (patch) | |
| tree | c1ae99d2b39f8df8933d81ec2e61e81050bdb410 /frontends/calculator/CEdev/examples/keypad_arrows | |
| parent | 761462861fc1228e65546c4e0f877d5212320082 (diff) | |
| download | cetris-55bfff7cf6541caac172b43186cf14405185b14d.tar.gz cetris-55bfff7cf6541caac172b43186cf14405185b14d.tar.bz2 cetris-55bfff7cf6541caac172b43186cf14405185b14d.zip | |
fix curses on linux
Diffstat (limited to 'frontends/calculator/CEdev/examples/keypad_arrows')
4 files changed, 135 insertions, 135 deletions
diff --git a/frontends/calculator/CEdev/examples/keypad_arrows/autotester.json b/frontends/calculator/CEdev/examples/keypad_arrows/autotester.json index c81becf..61768c3 100644 --- a/frontends/calculator/CEdev/examples/keypad_arrows/autotester.json +++ b/frontends/calculator/CEdev/examples/keypad_arrows/autotester.json @@ -1,61 +1,61 @@ -{ - "rom": "84pce_515.rom", - "transfer_files": [ - "bin/DEMO.8xp" - ], - "target": { - "name": "DEMO", - "isASM": true - }, - "sequence": [ - "action|launch", - "delay|500", - "key|down", - "hash|1", - "delay|200", - "key|right", - "hash|2", - "delay|200", - "key|up", - "hash|3", - "delay|200", - "key|left", - "hash|4", - "delay|200", - "key|2nd", - "hashWait|5" - ], - "hashes": { - "1": { - "description": "The screen is black", - "start": "vram_start", - "size": "vram_8_size", - "expected_CRCs": [ "AF74BFCB" ] - }, - "2": { - "description": "The screen is red", - "start": "vram_start", - "size": "vram_8_size", - "expected_CRCs": [ "D2E7DAC8" ] - }, - "3": { - "description": "The screen is white", - "start": "vram_start", - "size": "vram_8_size", - "expected_CRCs": [ "3132DE74" ] - }, - "4": { - "description": "The screen is red (other)", - "start": "vram_start", - "size": "vram_8_size", - "expected_CRCs": [ "74B02578" ] - }, - "5": { - "description": "Back to the home screen (exit check)", - "start": "vram_start", - "size": "vram_16_size", - "expected_CRCs": [ "FFAF89BA", "101734A5", "9DA19F44" ] - } - } -} - +{
+ "rom": "84pce_515.rom",
+ "transfer_files": [
+ "bin/DEMO.8xp"
+ ],
+ "target": {
+ "name": "DEMO",
+ "isASM": true
+ },
+ "sequence": [
+ "action|launch",
+ "delay|500",
+ "key|down",
+ "hash|1",
+ "delay|200",
+ "key|right",
+ "hash|2",
+ "delay|200",
+ "key|up",
+ "hash|3",
+ "delay|200",
+ "key|left",
+ "hash|4",
+ "delay|200",
+ "key|2nd",
+ "hashWait|5"
+ ],
+ "hashes": {
+ "1": {
+ "description": "The screen is black",
+ "start": "vram_start",
+ "size": "vram_8_size",
+ "expected_CRCs": [ "AF74BFCB" ]
+ },
+ "2": {
+ "description": "The screen is red",
+ "start": "vram_start",
+ "size": "vram_8_size",
+ "expected_CRCs": [ "D2E7DAC8" ]
+ },
+ "3": {
+ "description": "The screen is white",
+ "start": "vram_start",
+ "size": "vram_8_size",
+ "expected_CRCs": [ "3132DE74" ]
+ },
+ "4": {
+ "description": "The screen is red (other)",
+ "start": "vram_start",
+ "size": "vram_8_size",
+ "expected_CRCs": [ "74B02578" ]
+ },
+ "5": {
+ "description": "Back to the home screen (exit check)",
+ "start": "vram_start",
+ "size": "vram_16_size",
+ "expected_CRCs": [ "FFAF89BA", "101734A5", "9DA19F44" ]
+ }
+ }
+}
+
diff --git a/frontends/calculator/CEdev/examples/keypad_arrows/makefile b/frontends/calculator/CEdev/examples/keypad_arrows/makefile index 1f1b36b..d3deba8 100644 --- a/frontends/calculator/CEdev/examples/keypad_arrows/makefile +++ b/frontends/calculator/CEdev/examples/keypad_arrows/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/keypad_arrows/readme.md b/frontends/calculator/CEdev/examples/keypad_arrows/readme.md index 698dd4e..486b144 100644 --- a/frontends/calculator/CEdev/examples/keypad_arrows/readme.md +++ b/frontends/calculator/CEdev/examples/keypad_arrows/readme.md @@ -1,10 +1,10 @@ -### Keypad Arrow Key Demo - -This demo changes the color of the screen depending on which arrow keys are pressed. - - - ---- - -This demo is a part of the C SDK Toolchain for use on the CE. - +### Keypad Arrow Key Demo
+
+This demo changes the color of the screen depending on which arrow keys are pressed.
+
+
+
+---
+
+This demo is a part of the C SDK Toolchain for use on the CE.
+
diff --git a/frontends/calculator/CEdev/examples/keypad_arrows/src/main.c b/frontends/calculator/CEdev/examples/keypad_arrows/src/main.c index c4f7adf..e358faf 100644 --- a/frontends/calculator/CEdev/examples/keypad_arrows/src/main.c +++ b/frontends/calculator/CEdev/examples/keypad_arrows/src/main.c @@ -1,49 +1,49 @@ -#include <stdbool.h> -#include <stddef.h> -#include <stdint.h> -#include <tice.h> - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include <keypadc.h> - -/* Function Prototypes */ -void fill_screen(uint8_t color); - -void main(void) { - /* Key variable */ - kb_key_t key; - - /* Loop until 2nd is pressed */ - do { - /* Update kb_Data */ - kb_Scan(); - - /* Load group 7 registers */ - key = kb_Data[7]; - - switch (key) { - case kb_Down: /* Change screen color to black */ - fill_screen(0x00); - break; - case kb_Right: /* Change screen color to red */ - fill_screen(0xE0); - break; - case kb_Up: /* Change screen color to white */ - fill_screen(0xFF); - break; - case kb_Left: /* Change screen color to a different red */ - fill_screen(0xC0); - break; - default: - break; - } - } while (kb_Data[1] != kb_2nd); -} - -/* Simple way to fill the screen with a given color */ -void fill_screen(uint8_t color) { - memset(lcd_Ram, color, LCD_SIZE); -} +#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <tice.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <keypadc.h>
+
+/* Function Prototypes */
+void fill_screen(uint8_t color);
+
+void main(void) {
+ /* Key variable */
+ kb_key_t key;
+
+ /* Loop until 2nd is pressed */
+ do {
+ /* Update kb_Data */
+ kb_Scan();
+
+ /* Load group 7 registers */
+ key = kb_Data[7];
+
+ switch (key) {
+ case kb_Down: /* Change screen color to black */
+ fill_screen(0x00);
+ break;
+ case kb_Right: /* Change screen color to red */
+ fill_screen(0xE0);
+ break;
+ case kb_Up: /* Change screen color to white */
+ fill_screen(0xFF);
+ break;
+ case kb_Left: /* Change screen color to a different red */
+ fill_screen(0xC0);
+ break;
+ default:
+ break;
+ }
+ } while (kb_Data[1] != kb_2nd);
+}
+
+/* Simple way to fill the screen with a given color */
+void fill_screen(uint8_t color) {
+ memset(lcd_Ram, color, LCD_SIZE);
+}
|