summaryrefslogtreecommitdiff
path: root/frontends/calculator/CEdev/examples/os_input
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2019-04-13 12:40:52 -0400
committerAndrew Opalach <andrew@akon.city> 2019-04-13 12:40:52 -0400
commit55bfff7cf6541caac172b43186cf14405185b14d (patch)
treec1ae99d2b39f8df8933d81ec2e61e81050bdb410 /frontends/calculator/CEdev/examples/os_input
parent761462861fc1228e65546c4e0f877d5212320082 (diff)
downloadcetris-55bfff7cf6541caac172b43186cf14405185b14d.tar.gz
cetris-55bfff7cf6541caac172b43186cf14405185b14d.tar.bz2
cetris-55bfff7cf6541caac172b43186cf14405185b14d.zip
fix curses on linux
Diffstat (limited to 'frontends/calculator/CEdev/examples/os_input')
-rw-r--r--frontends/calculator/CEdev/examples/os_input/autotester.json76
-rw-r--r--frontends/calculator/CEdev/examples/os_input/makefile30
-rw-r--r--frontends/calculator/CEdev/examples/os_input/readme.md18
-rw-r--r--frontends/calculator/CEdev/examples/os_input/src/main.c72
4 files changed, 98 insertions, 98 deletions
diff --git a/frontends/calculator/CEdev/examples/os_input/autotester.json b/frontends/calculator/CEdev/examples/os_input/autotester.json
index da88dfe..b7e1247 100644
--- a/frontends/calculator/CEdev/examples/os_input/autotester.json
+++ b/frontends/calculator/CEdev/examples/os_input/autotester.json
@@ -1,38 +1,38 @@
-{
- "rom": "84pce_515.rom",
- "transfer_files": [
- "bin/DEMO.8xp"
- ],
- "target": {
- "name": "DEMO",
- "isASM": true
- },
- "sequence": [
- "action|launch",
- "delay|700",
- "key|1",
- "delay|200",
- "key|2",
- "delay|200",
- "key|enter",
- "hashWait|1",
- "key|enter",
- "hashWait|2"
- ],
- "hashes": {
- "1": {
- "description": "Output should be 'N is 12.'",
- "start": "0xD44B00",
- "size": "128000",
- "size_comment": "offset + 320x200x2 because we don't want the busy indicator",
- "expected_CRCs": [ "44FD49F5" ]
- },
- "2": {
- "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|700",
+ "key|1",
+ "delay|200",
+ "key|2",
+ "delay|200",
+ "key|enter",
+ "hashWait|1",
+ "key|enter",
+ "hashWait|2"
+ ],
+ "hashes": {
+ "1": {
+ "description": "Output should be 'N is 12.'",
+ "start": "0xD44B00",
+ "size": "128000",
+ "size_comment": "offset + 320x200x2 because we don't want the busy indicator",
+ "expected_CRCs": [ "44FD49F5" ]
+ },
+ "2": {
+ "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/os_input/makefile b/frontends/calculator/CEdev/examples/os_input/makefile
index 1f1b36b..d3deba8 100644
--- a/frontends/calculator/CEdev/examples/os_input/makefile
+++ b/frontends/calculator/CEdev/examples/os_input/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/os_input/readme.md b/frontends/calculator/CEdev/examples/os_input/readme.md
index e0f6d7b..1e35256 100644
--- a/frontends/calculator/CEdev/examples/os_input/readme.md
+++ b/frontends/calculator/CEdev/examples/os_input/readme.md
@@ -1,9 +1,9 @@
-### OS Input Demo
-
-This demo shows how to get an input string from the OS.
-
-![Screenshot](screenshot.png)
-
----
-
-This demo is a part of the C SDK Toolchain for use on the CE.
+### OS Input Demo
+
+This demo shows how to get an input string from the OS.
+
+![Screenshot](screenshot.png)
+
+---
+
+This demo is a part of the C SDK Toolchain for use on the CE.
diff --git a/frontends/calculator/CEdev/examples/os_input/src/main.c b/frontends/calculator/CEdev/examples/os_input/src/main.c
index 7674897..a2fa7c0 100644
--- a/frontends/calculator/CEdev/examples/os_input/src/main.c
+++ b/frontends/calculator/CEdev/examples/os_input/src/main.c
@@ -1,36 +1,36 @@
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <tice.h>
-
-/* Make sure to adjust those sizes according to your usage! */
-#define INPUT_SIZE 10
-#define RESP_SIZE 20
-
-/* Draw text on the homescreen at the given X/Y location */
-void print(const char* text, uint8_t xpos, uint8_t ypos) {
- os_SetCursorPos(ypos, xpos);
- os_PutStrFull(text);
-}
-
-void main(void) {
- char inputBuffer[INPUT_SIZE];
- char response[RESP_SIZE];
-
- /* Clear the homescreen */
- os_ClrHome();
-
- /* Ask the user to type a string, which gets stored in `inputBuf` */
- os_GetStringInput("What is N? ", inputBuffer, INPUT_SIZE);
-
- /* Build the user response */
- sprintf(response, "N is %s.", inputBuffer);
-
- /* Clear the homescreen and display the built response */
- os_ClrHome();
- print(response, 0, 0);
-
- /* Wait for a key press before quitting */
- while (!os_GetCSC());
-}
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <tice.h>
+
+/* Make sure to adjust those sizes according to your usage! */
+#define INPUT_SIZE 10
+#define RESP_SIZE 20
+
+/* Draw text on the homescreen at the given X/Y location */
+void print(const char* text, uint8_t xpos, uint8_t ypos) {
+ os_SetCursorPos(ypos, xpos);
+ os_PutStrFull(text);
+}
+
+void main(void) {
+ char inputBuffer[INPUT_SIZE];
+ char response[RESP_SIZE];
+
+ /* Clear the homescreen */
+ os_ClrHome();
+
+ /* Ask the user to type a string, which gets stored in `inputBuf` */
+ os_GetStringInput("What is N? ", inputBuffer, INPUT_SIZE);
+
+ /* Build the user response */
+ sprintf(response, "N is %s.", inputBuffer);
+
+ /* Clear the homescreen and display the built response */
+ os_ClrHome();
+ print(response, 0, 0);
+
+ /* Wait for a key press before quitting */
+ while (!os_GetCSC());
+}