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 --- .../examples/gfx_sprites_appvar/autotester.json | 62 ++++++++-------- .../CEdev/examples/gfx_sprites_appvar/makefile | 30 ++++---- .../CEdev/examples/gfx_sprites_appvar/readme.md | 20 +++--- .../examples/gfx_sprites_appvar/src/gfx/all_gfx.c | 8 +-- .../examples/gfx_sprites_appvar/src/gfx/all_gfx.h | 16 ++--- .../gfx_sprites_appvar/src/gfx/convpng.ini | 32 ++++----- .../examples/gfx_sprites_appvar/src/gfx/mint.c | 8 +-- .../examples/gfx_sprites_appvar/src/gfx/ubuntu.c | 8 +-- .../examples/gfx_sprites_appvar/src/gfx/var_gfx.c | 54 +++++++------- .../examples/gfx_sprites_appvar/src/gfx/var_gfx.h | 36 +++++----- .../CEdev/examples/gfx_sprites_appvar/src/main.c | 84 +++++++++++----------- 11 files changed, 179 insertions(+), 179 deletions(-) (limited to 'frontends/calculator/CEdev/examples/gfx_sprites_appvar') diff --git a/frontends/calculator/CEdev/examples/gfx_sprites_appvar/autotester.json b/frontends/calculator/CEdev/examples/gfx_sprites_appvar/autotester.json index d246692..3b39b3b 100644 --- a/frontends/calculator/CEdev/examples/gfx_sprites_appvar/autotester.json +++ b/frontends/calculator/CEdev/examples/gfx_sprites_appvar/autotester.json @@ -1,31 +1,31 @@ -{ - "rom": "84pce_515.rom", - "transfer_files": [ - "bin/DEMO.8xp", - "src/gfx/var_gfx.8xv" - ], - "target": { - "name": "DEMO", - "isASM": true - }, - "sequence": [ - "action|launch", - "hashWait|1", - "key|enter", - "hashWait|2" - ], - "hashes": { - "1": { - "description": "Make sure the sprites are displayed properly", - "start": "vram_start", - "size": "vram_8_size", - "expected_CRCs": [ "A3ED6457" ] - }, - "2": { - "description": "Back to the home screen (exit check)", - "start": "vram_start", - "size": "vram_16_size", - "expected_CRCs": [ "FFAF89BA", "101734A5", "9DA19F44", "43BF8092", "5ACF1C01" ] - } - } -} +{ + "rom": "84pce_515.rom", + "transfer_files": [ + "bin/DEMO.8xp", + "src/gfx/var_gfx.8xv" + ], + "target": { + "name": "DEMO", + "isASM": true + }, + "sequence": [ + "action|launch", + "hashWait|1", + "key|enter", + "hashWait|2" + ], + "hashes": { + "1": { + "description": "Make sure the sprites are displayed properly", + "start": "vram_start", + "size": "vram_8_size", + "expected_CRCs": [ "A3ED6457" ] + }, + "2": { + "description": "Back to the home screen (exit check)", + "start": "vram_start", + "size": "vram_16_size", + "expected_CRCs": [ "FFAF89BA", "101734A5", "9DA19F44", "43BF8092", "5ACF1C01" ] + } + } +} diff --git a/frontends/calculator/CEdev/examples/gfx_sprites_appvar/makefile b/frontends/calculator/CEdev/examples/gfx_sprites_appvar/makefile index 1f1b36b..d3deba8 100644 --- a/frontends/calculator/CEdev/examples/gfx_sprites_appvar/makefile +++ b/frontends/calculator/CEdev/examples/gfx_sprites_appvar/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/gfx_sprites_appvar/readme.md b/frontends/calculator/CEdev/examples/gfx_sprites_appvar/readme.md index 428bc83..9ef8479 100644 --- a/frontends/calculator/CEdev/examples/gfx_sprites_appvar/readme.md +++ b/frontends/calculator/CEdev/examples/gfx_sprites_appvar/readme.md @@ -1,10 +1,10 @@ -### GraphX Appvars Demo - -Demonstrates easily extracting and using images placed into an appvar - -![Screenshot](screenshot.png) - ---- - -This demo is a part of the C SDK Toolchain for use on the CE. - +### GraphX Appvars Demo + +Demonstrates easily extracting and using images placed into an appvar + +![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/gfx_sprites_appvar/src/gfx/all_gfx.c b/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/all_gfx.c index 9f77108..d1b789d 100644 --- a/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/all_gfx.c +++ b/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/all_gfx.c @@ -1,4 +1,4 @@ -// convpng -#include -#include "all_gfx.h" - +// convpng +#include +#include "all_gfx.h" + diff --git a/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/all_gfx.h b/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/all_gfx.h index 37f0480..9a60010 100644 --- a/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/all_gfx.h +++ b/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/all_gfx.h @@ -1,8 +1,8 @@ -// convpng -// this file contains all the graphics sources for easy inclusion in a project -#ifndef __all_gfx__ -#define __all_gfx__ -#include - - -#endif +// convpng +// this file contains all the graphics sources for easy inclusion in a project +#ifndef __all_gfx__ +#define __all_gfx__ +#include + + +#endif diff --git a/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/convpng.ini b/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/convpng.ini index 8dc89f4..34a3c4a 100644 --- a/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/convpng.ini +++ b/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/convpng.ini @@ -1,16 +1,16 @@ -// #AppvarC -- The name of the appvar we are making -// #IncludePalettes -- List of comma separated groups with palettes - -#AppvarC : var_gfx -#IncludePalettes : all_gfx -#PNGImages : - ubuntu - mint - -// The main conversion group - -#GroupC : all_gfx -#PNGImages : - ubuntu - mint - +// #AppvarC -- The name of the appvar we are making +// #IncludePalettes -- List of comma separated groups with palettes + +#AppvarC : var_gfx +#IncludePalettes : all_gfx +#PNGImages : + ubuntu + mint + +// The main conversion group + +#GroupC : all_gfx +#PNGImages : + ubuntu + mint + diff --git a/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/mint.c b/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/mint.c index 9f77108..d1b789d 100644 --- a/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/mint.c +++ b/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/mint.c @@ -1,4 +1,4 @@ -// convpng -#include -#include "all_gfx.h" - +// convpng +#include +#include "all_gfx.h" + diff --git a/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/ubuntu.c b/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/ubuntu.c index 9f77108..d1b789d 100644 --- a/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/ubuntu.c +++ b/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/ubuntu.c @@ -1,4 +1,4 @@ -// convpng -#include -#include "all_gfx.h" - +// convpng +#include +#include "all_gfx.h" + diff --git a/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/var_gfx.c b/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/var_gfx.c index b0d3117..c3641ca 100644 --- a/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/var_gfx.c +++ b/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/var_gfx.c @@ -1,27 +1,27 @@ -// convpng -#include -#include "var_gfx.h" - -#include -uint8_t *var_gfx[3] = { - (uint8_t*)0, - (uint8_t*)1026, - (uint8_t*)2052, -}; - -bool var_gfx_init(void) { - unsigned int data, i; - ti_var_t appvar; - - ti_CloseAll(); - - appvar = ti_Open("var_gfx", "r"); - data = (unsigned int)ti_GetDataPtr(appvar) - (unsigned int)var_gfx[0]; - for (i = 0; i < var_gfx_num; i++) { - var_gfx[i] += data; - } - - ti_CloseAll(); - - return (bool)appvar; -} +// convpng +#include +#include "var_gfx.h" + +#include +uint8_t *var_gfx[3] = { + (uint8_t*)0, + (uint8_t*)1026, + (uint8_t*)2052, +}; + +bool var_gfx_init(void) { + unsigned int data, i; + ti_var_t appvar; + + ti_CloseAll(); + + appvar = ti_Open("var_gfx", "r"); + data = (unsigned int)ti_GetDataPtr(appvar) - (unsigned int)var_gfx[0]; + for (i = 0; i < var_gfx_num; i++) { + var_gfx[i] += data; + } + + ti_CloseAll(); + + return (bool)appvar; +} diff --git a/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/var_gfx.h b/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/var_gfx.h index 49afcb0..919da4b 100644 --- a/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/var_gfx.h +++ b/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/gfx/var_gfx.h @@ -1,18 +1,18 @@ -// convpng -// this file contains all the graphics sources for easy inclusion in a project -#ifndef __var_gfx__ -#define __var_gfx__ -#include - -#include - -#define var_gfx_num 3 - -extern uint8_t *var_gfx[3]; -#define ubuntu ((gfx_sprite_t*)var_gfx[0]) -#define mint ((gfx_sprite_t*)var_gfx[1]) -#define sizeof_all_gfx_pal 512 -#define all_gfx_pal ((uint16_t*)var_gfx[2]) -bool var_gfx_init(void); - -#endif +// convpng +// this file contains all the graphics sources for easy inclusion in a project +#ifndef __var_gfx__ +#define __var_gfx__ +#include + +#include + +#define var_gfx_num 3 + +extern uint8_t *var_gfx[3]; +#define ubuntu ((gfx_sprite_t*)var_gfx[0]) +#define mint ((gfx_sprite_t*)var_gfx[1]) +#define sizeof_all_gfx_pal 512 +#define all_gfx_pal ((uint16_t*)var_gfx[2]) +bool var_gfx_init(void); + +#endif diff --git a/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/main.c b/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/main.c index 7c18c3a..98edbf9 100644 --- a/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/main.c +++ b/frontends/calculator/CEdev/examples/gfx_sprites_appvar/src/main.c @@ -1,42 +1,42 @@ -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -/* Include the sprite data */ -#include "gfx/all_gfx.h" -#include "gfx/var_gfx.h" - -void main(void) { - /* This function is automatically created by convpng */ - /* Simply call it to load in graphics from the appvar */ - /* The common function name is _init */ - var_gfx_init(); - - /* Initialize the graphics */ - gfx_Begin(); - - /* Set up the palette for the sprite */ - gfx_SetPalette(all_gfx_pal, sizeof_all_gfx_pal, 0); - - /* Fill the screen with color index 0 */ - gfx_FillScreen(0); - - /* Draw the sprites directly from the appvar */ - gfx_Sprite(ubuntu, LCD_WIDTH / 2 - 16, LCD_HEIGHT / 2 - 16); - gfx_Sprite(mint, LCD_WIDTH / 2 + 16, LCD_HEIGHT / 2 - 16); - - /* Wait for a key to be pressed */ - while (!os_GetCSC()); - - /* Close the graphics */ - gfx_End(); -} +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +/* Include the sprite data */ +#include "gfx/all_gfx.h" +#include "gfx/var_gfx.h" + +void main(void) { + /* This function is automatically created by convpng */ + /* Simply call it to load in graphics from the appvar */ + /* The common function name is _init */ + var_gfx_init(); + + /* Initialize the graphics */ + gfx_Begin(); + + /* Set up the palette for the sprite */ + gfx_SetPalette(all_gfx_pal, sizeof_all_gfx_pal, 0); + + /* Fill the screen with color index 0 */ + gfx_FillScreen(0); + + /* Draw the sprites directly from the appvar */ + gfx_Sprite(ubuntu, LCD_WIDTH / 2 - 16, LCD_HEIGHT / 2 - 16); + gfx_Sprite(mint, LCD_WIDTH / 2 + 16, LCD_HEIGHT / 2 - 16); + + /* Wait for a key to be pressed */ + while (!os_GetCSC()); + + /* Close the graphics */ + gfx_End(); +} -- cgit v1.2.3-101-g0448