From 55bfff7cf6541caac172b43186cf14405185b14d Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Sat, 13 Apr 2019 12:40:52 -0400 Subject: fix curses on linux --- .../CEdev/examples/fileio_tokens/autotester.json | 66 ++++++------ .../CEdev/examples/fileio_tokens/makefile | 30 +++--- .../CEdev/examples/fileio_tokens/readme.md | 20 ++-- .../CEdev/examples/fileio_tokens/src/main.c | 118 ++++++++++----------- 4 files changed, 117 insertions(+), 117 deletions(-) (limited to 'frontends/calculator/CEdev/examples/fileio_tokens') diff --git a/frontends/calculator/CEdev/examples/fileio_tokens/autotester.json b/frontends/calculator/CEdev/examples/fileio_tokens/autotester.json index 529758c..d780c28 100644 --- a/frontends/calculator/CEdev/examples/fileio_tokens/autotester.json +++ b/frontends/calculator/CEdev/examples/fileio_tokens/autotester.json @@ -1,33 +1,33 @@ -{ - "rom": "84pce_515.rom", - "transfer_files": [ - "bin/DEMO.8xp" - ], - "target": { - "name": "DEMO", - "isASM": true - }, - "sequence": [ - "action|launch", - "delay|1000", - "hash|1", - "key|enter", - "delay|200", - "hashWait|2" - ], - "hashes": { - "1": { - "description": "Blank screen", - "start": "vram_start", - "size": "vram_16_size", - "expected_CRCs": [ "349F4775" ] - }, - "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|1000", + "hash|1", + "key|enter", + "delay|200", + "hashWait|2" + ], + "hashes": { + "1": { + "description": "Blank screen", + "start": "vram_start", + "size": "vram_16_size", + "expected_CRCs": [ "349F4775" ] + }, + "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/fileio_tokens/makefile b/frontends/calculator/CEdev/examples/fileio_tokens/makefile index 1f1b36b..d3deba8 100644 --- a/frontends/calculator/CEdev/examples/fileio_tokens/makefile +++ b/frontends/calculator/CEdev/examples/fileio_tokens/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/fileio_tokens/readme.md b/frontends/calculator/CEdev/examples/fileio_tokens/readme.md index a1d5546..9421319 100644 --- a/frontends/calculator/CEdev/examples/fileio_tokens/readme.md +++ b/frontends/calculator/CEdev/examples/fileio_tokens/readme.md @@ -1,10 +1,10 @@ -### FileIO Get Token Demo - -This demo shows how to use the ti_GetDataPtr and ti_GetTokenString functions. It prints out the first two tokens in the basic prgmABC. - -![Screenshot](screenshot.png) - ---- - -This demo is a part of the C SDK Toolchain for use on the CE. - +### FileIO Get Token Demo + +This demo shows how to use the ti_GetDataPtr and ti_GetTokenString functions. It prints out the first two tokens in the basic prgmABC. + +![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/fileio_tokens/src/main.c b/frontends/calculator/CEdev/examples/fileio_tokens/src/main.c index d3f6b57..f787180 100644 --- a/frontends/calculator/CEdev/examples/fileio_tokens/src/main.c +++ b/frontends/calculator/CEdev/examples/fileio_tokens/src/main.c @@ -1,59 +1,59 @@ -#include -#include -#include -#include - -#include -#include -#include - -#include - -/* Declare the program name */ -const char *prgmName = "ABC"; - -/* Function prototypes */ -void printText(int8_t xpos, int8_t ypos, const char *text); - -/* Main Function */ -void main(void) { - ti_var_t prgm; - char *text; - uint8_t *data_ptr; - uint8_t token_length; - uint16_t size; - int8_t y = 0; - - /* Clear the homescreen */ - os_ClrHome(); - - /* Close any files that may be open already */ - ti_CloseAll(); - - /* Open the program for reading */ - prgm = ti_OpenVar(prgmName, "r", TI_PRGM_TYPE); - - /* Make sure we opened okay */ - if (!prgm) goto err; - - data_ptr = ti_GetDataPtr(prgm); - size = ti_GetSize(prgm); - - while (size && y < 8) { - printText(0, y++, ti_GetTokenString(&data_ptr, &token_length, NULL)); - size -= token_length; - } - -err: - /* Pause */ - while (!os_GetCSC()); - - /* Close files */ - ti_CloseAll(); -} - -/* 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 +#include +#include +#include + +#include +#include +#include + +#include + +/* Declare the program name */ +const char *prgmName = "ABC"; + +/* Function prototypes */ +void printText(int8_t xpos, int8_t ypos, const char *text); + +/* Main Function */ +void main(void) { + ti_var_t prgm; + char *text; + uint8_t *data_ptr; + uint8_t token_length; + uint16_t size; + int8_t y = 0; + + /* Clear the homescreen */ + os_ClrHome(); + + /* Close any files that may be open already */ + ti_CloseAll(); + + /* Open the program for reading */ + prgm = ti_OpenVar(prgmName, "r", TI_PRGM_TYPE); + + /* Make sure we opened okay */ + if (!prgm) goto err; + + data_ptr = ti_GetDataPtr(prgm); + size = ti_GetSize(prgm); + + while (size && y < 8) { + printText(0, y++, ti_GetTokenString(&data_ptr, &token_length, NULL)); + size -= token_length; + } + +err: + /* Pause */ + while (!os_GetCSC()); + + /* Close files */ + ti_CloseAll(); +} + +/* 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); +} -- cgit v1.2.3-101-g0448