diff options
Diffstat (limited to 'frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image')
10 files changed, 228 insertions, 228 deletions
diff --git a/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/autotester.json b/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/autotester.json index 3b57eb8..3d681be 100644 --- a/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/autotester.json +++ b/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/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": "Fullscreen tiled image", - "start": "vram_start", - "size": "vram_8_size", - "expected_CRCs": [ "2846A371" ] - }, - "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": "Fullscreen tiled image",
+ "start": "vram_start",
+ "size": "vram_8_size",
+ "expected_CRCs": [ "2846A371" ]
+ },
+ "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_fullscreen_tiled_image/makefile b/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/makefile index 1f1b36b..d3deba8 100644 --- a/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/makefile +++ b/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/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_fullscreen_tiled_image/readme.md b/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/readme.md index c656e6d..8a20747 100644 --- a/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/readme.md +++ b/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/readme.md @@ -1,9 +1,9 @@ -### GraphX Fullscreen Image Demo - -An example of a compressed tiled image to construct a fullscreen image. - - - ---- - -This demo is a part of the C SDK Toolchain for use on the CE. +### GraphX Fullscreen Image Demo
+
+An example of a compressed tiled image to construct a fullscreen image.
+
+
+
+---
+
+This demo is a part of the C SDK Toolchain for use on the CE.
diff --git a/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/convpng.ini b/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/convpng.ini index 3c282fe..254b4e1 100644 --- a/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/convpng.ini +++ b/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/convpng.ini @@ -1,15 +1,15 @@ -// Appvar to place all graphics in - -#AppvarC : var_gfx -#OutputPalettes : tiles_gfx -#PNGImages : - tileset - -// The compressed group for the tileset - -#GroupC : tiles_gfx -#Tilemap : 80,80,true -#Compression : zx7 -#PNGImages : - tileset - +// Appvar to place all graphics in
+
+#AppvarC : var_gfx
+#OutputPalettes : tiles_gfx
+#PNGImages :
+ tileset
+
+// The compressed group for the tileset
+
+#GroupC : tiles_gfx
+#Tilemap : 80,80,true
+#Compression : zx7
+#PNGImages :
+ tileset
+
diff --git a/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/tiles_gfx.c b/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/tiles_gfx.c index 7243683..c1c9573 100644 --- a/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/tiles_gfx.c +++ b/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/tiles_gfx.c @@ -1,4 +1,4 @@ -// convpng -#include <stdint.h> -#include "tiles_gfx.h" - +// convpng
+#include <stdint.h>
+#include "tiles_gfx.h"
+
diff --git a/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/tiles_gfx.h b/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/tiles_gfx.h index 1ae708a..edc49ad 100644 --- a/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/tiles_gfx.h +++ b/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/tiles_gfx.h @@ -1,8 +1,8 @@ -// convpng -// this file contains all the graphics sources for easy inclusion in a project -#ifndef __tiles_gfx__ -#define __tiles_gfx__ -#include <stdint.h> - - -#endif +// convpng
+// this file contains all the graphics sources for easy inclusion in a project
+#ifndef __tiles_gfx__
+#define __tiles_gfx__
+#include <stdint.h>
+
+
+#endif
diff --git a/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/tileset.c b/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/tileset.c index ff03cd2..e558c26 100644 --- a/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/tileset.c +++ b/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/tileset.c @@ -1,18 +1,18 @@ -// convpng -#include <stdint.h> -#include "tiles_gfx.h" - -uint8_t *tileset_tiles_compressed[12] = { - (uint8_t*)0, - (uint8_t*)3752, - (uint8_t*)7872, - (uint8_t*)12183, - (uint8_t*)15527, - (uint8_t*)20894, - (uint8_t*)25809, - (uint8_t*)30646, - (uint8_t*)35982, - (uint8_t*)41664, - (uint8_t*)46419, - (uint8_t*)50679, -}; +// convpng
+#include <stdint.h>
+#include "tiles_gfx.h"
+
+uint8_t *tileset_tiles_compressed[12] = {
+ (uint8_t*)0,
+ (uint8_t*)3752,
+ (uint8_t*)7872,
+ (uint8_t*)12183,
+ (uint8_t*)15527,
+ (uint8_t*)20894,
+ (uint8_t*)25809,
+ (uint8_t*)30646,
+ (uint8_t*)35982,
+ (uint8_t*)41664,
+ (uint8_t*)46419,
+ (uint8_t*)50679,
+};
diff --git a/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/var_gfx.c b/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/var_gfx.c index 6de6afa..3f115b0 100644 --- a/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/var_gfx.c +++ b/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/var_gfx.c @@ -1,31 +1,31 @@ -// convpng -#include <stdint.h> -#include "var_gfx.h" - -#include <fileioc.h> -uint8_t *var_gfx[2] = { - (uint8_t*)0, - (uint8_t*)55530, -}; - -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(); - - data = (unsigned int)var_gfx[0] - (unsigned int)tileset_tiles_compressed[0]; - for (i = 0; i < tileset_tiles_num; i++) { - tileset_tiles_compressed[i] += data; - } - - return (bool)appvar; -} +// convpng
+#include <stdint.h>
+#include "var_gfx.h"
+
+#include <fileioc.h>
+uint8_t *var_gfx[2] = {
+ (uint8_t*)0,
+ (uint8_t*)55530,
+};
+
+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();
+
+ data = (unsigned int)var_gfx[0] - (unsigned int)tileset_tiles_compressed[0];
+ for (i = 0; i < tileset_tiles_num; i++) {
+ tileset_tiles_compressed[i] += data;
+ }
+
+ return (bool)appvar;
+}
diff --git a/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/var_gfx.h b/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/var_gfx.h index 23b61b1..c03c0ff 100644 --- a/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/var_gfx.h +++ b/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/gfx/var_gfx.h @@ -1,31 +1,31 @@ -// convpng -// this file contains all the graphics sources for easy inclusion in a project -#ifndef __var_gfx__ -#define __var_gfx__ -#include <stdint.h> - -#include <stdbool.h> - -#define var_gfx_num 2 - -extern uint8_t *var_gfx[2]; -#define tileset_compressed ((gfx_sprite_t*)var_gfx[0]) -#define tileset_tiles_num 12 -extern uint8_t *tileset_tiles_compressed[12]; -#define tileset_tile_0_compressed ((gfx_sprite_t*)tileset_tiles_compressed[0]) -#define tileset_tile_1_compressed ((gfx_sprite_t*)tileset_tiles_compressed[1]) -#define tileset_tile_2_compressed ((gfx_sprite_t*)tileset_tiles_compressed[2]) -#define tileset_tile_3_compressed ((gfx_sprite_t*)tileset_tiles_compressed[3]) -#define tileset_tile_4_compressed ((gfx_sprite_t*)tileset_tiles_compressed[4]) -#define tileset_tile_5_compressed ((gfx_sprite_t*)tileset_tiles_compressed[5]) -#define tileset_tile_6_compressed ((gfx_sprite_t*)tileset_tiles_compressed[6]) -#define tileset_tile_7_compressed ((gfx_sprite_t*)tileset_tiles_compressed[7]) -#define tileset_tile_8_compressed ((gfx_sprite_t*)tileset_tiles_compressed[8]) -#define tileset_tile_9_compressed ((gfx_sprite_t*)tileset_tiles_compressed[9]) -#define tileset_tile_10_compressed ((gfx_sprite_t*)tileset_tiles_compressed[10]) -#define tileset_tile_11_compressed ((gfx_sprite_t*)tileset_tiles_compressed[11]) -#define sizeof_tiles_gfx_pal 512 -#define tiles_gfx_pal ((uint16_t*)var_gfx[1]) -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 <stdint.h>
+
+#include <stdbool.h>
+
+#define var_gfx_num 2
+
+extern uint8_t *var_gfx[2];
+#define tileset_compressed ((gfx_sprite_t*)var_gfx[0])
+#define tileset_tiles_num 12
+extern uint8_t *tileset_tiles_compressed[12];
+#define tileset_tile_0_compressed ((gfx_sprite_t*)tileset_tiles_compressed[0])
+#define tileset_tile_1_compressed ((gfx_sprite_t*)tileset_tiles_compressed[1])
+#define tileset_tile_2_compressed ((gfx_sprite_t*)tileset_tiles_compressed[2])
+#define tileset_tile_3_compressed ((gfx_sprite_t*)tileset_tiles_compressed[3])
+#define tileset_tile_4_compressed ((gfx_sprite_t*)tileset_tiles_compressed[4])
+#define tileset_tile_5_compressed ((gfx_sprite_t*)tileset_tiles_compressed[5])
+#define tileset_tile_6_compressed ((gfx_sprite_t*)tileset_tiles_compressed[6])
+#define tileset_tile_7_compressed ((gfx_sprite_t*)tileset_tiles_compressed[7])
+#define tileset_tile_8_compressed ((gfx_sprite_t*)tileset_tiles_compressed[8])
+#define tileset_tile_9_compressed ((gfx_sprite_t*)tileset_tiles_compressed[9])
+#define tileset_tile_10_compressed ((gfx_sprite_t*)tileset_tiles_compressed[10])
+#define tileset_tile_11_compressed ((gfx_sprite_t*)tileset_tiles_compressed[11])
+#define sizeof_tiles_gfx_pal 512
+#define tiles_gfx_pal ((uint16_t*)var_gfx[1])
+bool var_gfx_init(void);
+
+#endif
diff --git a/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/main.c b/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/main.c index 1ed734b..2aba306 100644 --- a/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/main.c +++ b/frontends/calculator/CEdev/examples/gfx_fullscreen_tiled_image/src/main.c @@ -1,66 +1,66 @@ -#include <stdbool.h> -#include <stddef.h> -#include <stdint.h> -#include <tice.h> - -#include <math.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include <compression.h> -#include <graphx.h> - -/* Include the graphics */ -#include "gfx/tiles_gfx.h" -#include "gfx/var_gfx.h" - -/* Include the external map data */ -extern uint8_t tilemap_map[]; - -#define TILE_WIDTH 80 -#define TILE_HEIGHT 80 - -void main(void) { - unsigned int i; - unsigned int x, y; - gfx_sprite_t *tile; - - tile = gfx_MallocSprite(TILE_WIDTH, TILE_HEIGHT); - - /* Initialize the graphics */ - if (!var_gfx_init()) { - return; - } - - /* Start the graphics */ - gfx_Begin(); - x = y = i = 0; - - /* Draw offscreen */ - gfx_SetDrawBuffer(); - - /* Decompress the tiles */ - for (; i < tileset_tiles_num; i++) { - zx7_Decompress(tile, tileset_tiles_compressed[i]); - gfx_Sprite_NoClip(tile, x, y); - x += TILE_WIDTH; - if (x >= LCD_WIDTH) { - y += TILE_HEIGHT; - x = 0; - } - } - - /* Copy to visible screen */ - gfx_SetPalette(tiles_gfx_pal, sizeof_tiles_gfx_pal, 0); - gfx_BlitBuffer(); - - /* Wait for a key */ - while (!os_GetCSC()); - - /* Close the graphics and return to the OS */ - gfx_End(); - - /* Free the earlier allocation */ - free(tile); -} +#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <tice.h>
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <compression.h>
+#include <graphx.h>
+
+/* Include the graphics */
+#include "gfx/tiles_gfx.h"
+#include "gfx/var_gfx.h"
+
+/* Include the external map data */
+extern uint8_t tilemap_map[];
+
+#define TILE_WIDTH 80
+#define TILE_HEIGHT 80
+
+void main(void) {
+ unsigned int i;
+ unsigned int x, y;
+ gfx_sprite_t *tile;
+
+ tile = gfx_MallocSprite(TILE_WIDTH, TILE_HEIGHT);
+
+ /* Initialize the graphics */
+ if (!var_gfx_init()) {
+ return;
+ }
+
+ /* Start the graphics */
+ gfx_Begin();
+ x = y = i = 0;
+
+ /* Draw offscreen */
+ gfx_SetDrawBuffer();
+
+ /* Decompress the tiles */
+ for (; i < tileset_tiles_num; i++) {
+ zx7_Decompress(tile, tileset_tiles_compressed[i]);
+ gfx_Sprite_NoClip(tile, x, y);
+ x += TILE_WIDTH;
+ if (x >= LCD_WIDTH) {
+ y += TILE_HEIGHT;
+ x = 0;
+ }
+ }
+
+ /* Copy to visible screen */
+ gfx_SetPalette(tiles_gfx_pal, sizeof_tiles_gfx_pal, 0);
+ gfx_BlitBuffer();
+
+ /* Wait for a key */
+ while (!os_GetCSC());
+
+ /* Close the graphics and return to the OS */
+ gfx_End();
+
+ /* Free the earlier allocation */
+ free(tile);
+}
|