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_multiple_keys | |
| 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_multiple_keys')
4 files changed, 147 insertions, 147 deletions
diff --git a/frontends/calculator/CEdev/examples/keypad_multiple_keys/autotester.json b/frontends/calculator/CEdev/examples/keypad_multiple_keys/autotester.json index ea6581f..33e2115 100644 --- a/frontends/calculator/CEdev/examples/keypad_multiple_keys/autotester.json +++ b/frontends/calculator/CEdev/examples/keypad_multiple_keys/autotester.json @@ -1,62 +1,62 @@ -{ - "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", - "delay|300", - "hashWait|5" - ], - "hashes": { - "1": { - "description": "The screen shows Down", - "start": "vram_start", - "size": "vram_16_size", - "expected_CRCs": [ "349F4775" ] - }, - "2": { - "description": "The screen shows Right", - "start": "vram_start", - "size": "vram_16_size", - "expected_CRCs": [ "349F4775" ] - }, - "3": { - "description": "The screen shows Up", - "start": "vram_start", - "size": "vram_16_size", - "expected_CRCs": [ "349F4775" ] - }, - "4": { - "description": "The screen shows Left", - "start": "vram_start", - "size": "vram_16_size", - "expected_CRCs": [ "349F4775" ] - }, - "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",
+ "delay|300",
+ "hashWait|5"
+ ],
+ "hashes": {
+ "1": {
+ "description": "The screen shows Down",
+ "start": "vram_start",
+ "size": "vram_16_size",
+ "expected_CRCs": [ "349F4775" ]
+ },
+ "2": {
+ "description": "The screen shows Right",
+ "start": "vram_start",
+ "size": "vram_16_size",
+ "expected_CRCs": [ "349F4775" ]
+ },
+ "3": {
+ "description": "The screen shows Up",
+ "start": "vram_start",
+ "size": "vram_16_size",
+ "expected_CRCs": [ "349F4775" ]
+ },
+ "4": {
+ "description": "The screen shows Left",
+ "start": "vram_start",
+ "size": "vram_16_size",
+ "expected_CRCs": [ "349F4775" ]
+ },
+ "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_multiple_keys/makefile b/frontends/calculator/CEdev/examples/keypad_multiple_keys/makefile index 1f1b36b..d3deba8 100644 --- a/frontends/calculator/CEdev/examples/keypad_multiple_keys/makefile +++ b/frontends/calculator/CEdev/examples/keypad_multiple_keys/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_multiple_keys/readme.md b/frontends/calculator/CEdev/examples/keypad_multiple_keys/readme.md index 170f907..4a34d2e 100644 --- a/frontends/calculator/CEdev/examples/keypad_multiple_keys/readme.md +++ b/frontends/calculator/CEdev/examples/keypad_multiple_keys/readme.md @@ -1,10 +1,10 @@ -### Keypad Multiple Keys Demo - -This demo shows how to interpret multiple keypresses at the same time - - - ---- - -This demo is a part of the C SDK Toolchain for use on the CE. - +### Keypad Multiple Keys Demo
+
+This demo shows how to interpret multiple keypresses at the same time
+
+
+
+---
+
+This demo is a part of the C SDK Toolchain for use on the CE.
+
diff --git a/frontends/calculator/CEdev/examples/keypad_multiple_keys/src/main.c b/frontends/calculator/CEdev/examples/keypad_multiple_keys/src/main.c index fbe3ffa..715d437 100644 --- a/frontends/calculator/CEdev/examples/keypad_multiple_keys/src/main.c +++ b/frontends/calculator/CEdev/examples/keypad_multiple_keys/src/main.c @@ -1,60 +1,60 @@ -#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 printText(int8_t xpos, int8_t ypos, const char *text); - -void main(void) { - /* Key variable */ - kb_key_t key; - const char *erase_string = " "; - - /* Clear the homescreen */ - os_ClrHome(); - - /* Loop until 2nd is pressed */ - do { - - /* Update kb_Data */ - kb_Scan(); - - key = kb_Data[7]; - - /* Print the current arrow key input */ - if (key & kb_Down) { - printText(0, 0, "Down"); - } else { - printText(0, 0, erase_string); - } - if (key & kb_Up) { - printText(0, 1, "Up"); - } else { - printText(0, 1, erase_string); - } - if (key & kb_Left) { - printText(0, 2, "Left"); - } else { - printText(0, 2, erase_string); - } - if (key & kb_Right) { - printText(0, 3, "Right"); - } else { - printText(0, 3, erase_string); - } - - } while (kb_Data[1] != kb_2nd); -} - -/* Draw text on the homescreen at the given X/Y location */ -void printText(int8_t xpos, int8_t ypos, const char *text) { - os_SetCursorPos(ypos, xpos); - os_PutStrFull(text); -} +#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 printText(int8_t xpos, int8_t ypos, const char *text);
+
+void main(void) {
+ /* Key variable */
+ kb_key_t key;
+ const char *erase_string = " ";
+
+ /* Clear the homescreen */
+ os_ClrHome();
+
+ /* Loop until 2nd is pressed */
+ do {
+
+ /* Update kb_Data */
+ kb_Scan();
+
+ key = kb_Data[7];
+
+ /* Print the current arrow key input */
+ if (key & kb_Down) {
+ printText(0, 0, "Down");
+ } else {
+ printText(0, 0, erase_string);
+ }
+ if (key & kb_Up) {
+ printText(0, 1, "Up");
+ } else {
+ printText(0, 1, erase_string);
+ }
+ if (key & kb_Left) {
+ printText(0, 2, "Left");
+ } else {
+ printText(0, 2, erase_string);
+ }
+ if (key & kb_Right) {
+ printText(0, 3, "Right");
+ } else {
+ printText(0, 3, erase_string);
+ }
+
+ } while (kb_Data[1] != kb_2nd);
+}
+
+/* Draw text on the homescreen at the given X/Y location */
+void printText(int8_t xpos, int8_t ypos, const char *text) {
+ os_SetCursorPos(ypos, xpos);
+ os_PutStrFull(text);
+}
|