From 4d9d7b5600ab615d68f671df5f8bc6c9fe4a5a09 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Wed, 24 Apr 2019 11:03:58 -0400 Subject: add pause to curses, remove unfinished calculator frontend --- .../examples/fileio_factorize/autotester.badjson | 37 ---------- .../CEdev/examples/fileio_factorize/makefile | 15 ----- .../CEdev/examples/fileio_factorize/readme.md | 12 ---- .../CEdev/examples/fileio_factorize/screenshot.png | Bin 2335 -> 0 bytes .../CEdev/examples/fileio_factorize/src/main.c | 75 --------------------- 5 files changed, 139 deletions(-) delete mode 100644 frontends/calculator/CEdev/examples/fileio_factorize/autotester.badjson delete mode 100644 frontends/calculator/CEdev/examples/fileio_factorize/makefile delete mode 100644 frontends/calculator/CEdev/examples/fileio_factorize/readme.md delete mode 100644 frontends/calculator/CEdev/examples/fileio_factorize/screenshot.png delete mode 100644 frontends/calculator/CEdev/examples/fileio_factorize/src/main.c (limited to 'frontends/calculator/CEdev/examples/fileio_factorize') diff --git a/frontends/calculator/CEdev/examples/fileio_factorize/autotester.badjson b/frontends/calculator/CEdev/examples/fileio_factorize/autotester.badjson deleted file mode 100644 index 7381145..0000000 --- a/frontends/calculator/CEdev/examples/fileio_factorize/autotester.badjson +++ /dev/null @@ -1,37 +0,0 @@ -{ - "rom": "84pce_515.rom", - "transfer_files": [ - "bin/DEMO.8xp" - ], - "target": { - "name": "DEMO", - "isASM": true - }, - "sequence": [ - "action|launch", --> type input in Ans ; expect known output back in Ans - "delay|500", - "hash|1", - "key|enter", - "delay|200", - "hash|2" - ], - -******* Broken JSON TODO : -******* implement autotester var handling feature ******* - - "hashes": { - "1": { - "description": "Variable Ans is a list [TODO]", - "start": "var_complex_B", - "size": "var_size", - "expected_CRCs": [ "" ] - }, - "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_factorize/makefile b/frontends/calculator/CEdev/examples/fileio_factorize/makefile deleted file mode 100644 index d3deba8..0000000 --- a/frontends/calculator/CEdev/examples/fileio_factorize/makefile +++ /dev/null @@ -1,15 +0,0 @@ -# ---------------------------- -# 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_factorize/readme.md b/frontends/calculator/CEdev/examples/fileio_factorize/readme.md deleted file mode 100644 index 7695265..0000000 --- a/frontends/calculator/CEdev/examples/fileio_factorize/readme.md +++ /dev/null @@ -1,12 +0,0 @@ -### FileIO Factorize Demo - -This demo demonstrates a way to compute the factors of a input number in Ans - -![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_factorize/screenshot.png b/frontends/calculator/CEdev/examples/fileio_factorize/screenshot.png deleted file mode 100644 index 924c14d..0000000 Binary files a/frontends/calculator/CEdev/examples/fileio_factorize/screenshot.png and /dev/null differ diff --git a/frontends/calculator/CEdev/examples/fileio_factorize/src/main.c b/frontends/calculator/CEdev/examples/fileio_factorize/src/main.c deleted file mode 100644 index c95bb46..0000000 --- a/frontends/calculator/CEdev/examples/fileio_factorize/src/main.c +++ /dev/null @@ -1,75 +0,0 @@ -#include -#include -#include -#include - -#include -#include -#include - -#include - -void prime_factors(unsigned int n); - -int primes[512]; -unsigned int total_primes = 0; - -/* Main Function */ -void main(void) { - /* Declare some variables */ - real_t *real_in; - list_t *list_out; - unsigned i; - int in; - - /* Clear the homescreen */ - os_ClrHome(); - - /* Get the answer variable */ - if (ti_RclVar(TI_REAL_TYPE, ti_Ans, &real_in)) return; - if ((in = os_RealToInt24(real_in)) < 1) return; - - /* Get the prime factors of the input */ - prime_factors((unsigned)in); - - /* Create a list to store the primes */ - if (!total_primes) return; - list_out = ti_MallocList(total_primes); // Same as ti_AllocList(total_primes, malloc) - - /* Write out the list of primes */ - for (i=0; iitems[i] = os_Int24ToReal(primes[i]); - } - - /* Set the new answer */ - ti_SetVar(TI_REAL_LIST_TYPE, ti_Ans, list_out); -} - -/* Store to an array all the prime numbers */ -void prime_factors(unsigned int n) { - unsigned int div, end; - - while (!(n % 2)) { - primes[total_primes++] = 2; - n /= 2; - } - - if (n == 1) return; - - div = 3; - end = sqrt(n); - - while (div <= end) { - if (!(n % div)) { - do { - primes[total_primes++] = div; - n /= div; - } while (!(n % div)); - if (n == 1) return; - end = sqrt(n); - } - div += 2; - } - - primes[total_primes++] = n; -} -- cgit v1.2.3-101-g0448