summaryrefslogtreecommitdiff
path: root/apps/plugins/xrick/data
diff options
context:
space:
mode:
authorSebastian Leonhardt <sebastian.leonhardt@web.de>2016-01-08 01:05:36 +0100
committerSolomon Peachy <pizza@shaftnet.org>2024-06-30 17:24:16 -0400
commit102c3742487dba76ec72d5f56a2c3041344b2d68 (patch)
tree4931ad34d2cc0bac56d9984b9ead355d012ad63a /apps/plugins/xrick/data
parent6f1e67e5e318ba2fd0f5ec1892c7b6633ec6521c (diff)
downloadrockbox-102c3742487dba76ec72d5f56a2c3041344b2d68.tar.gz
rockbox-102c3742487dba76ec72d5f56a2c3041344b2d68.zip
added xrick game
original xrick code by 'BigOrno' at: http://www.bigorno.net/xrick/ Rockbox port, plus bugfixes at: https://github.com/pierluigi-vicinanza/xrick Further changes: * Additonal fixes from g#3026 * Port to modern plugin API * Add Pluginlib keymap fallback * Support all >1bpp screens * Fix build warnings in miniz * Better error message when resources are missing Change-Id: Id83928bc2539901b0221692f65cbca41389c58e7
Diffstat (limited to 'apps/plugins/xrick/data')
-rw-r--r--apps/plugins/xrick/data/img.c23
-rw-r--r--apps/plugins/xrick/data/img.h39
-rw-r--r--apps/plugins/xrick/data/pics.c29
-rw-r--r--apps/plugins/xrick/data/pics.h41
-rw-r--r--apps/plugins/xrick/data/sounds.c44
-rw-r--r--apps/plugins/xrick/data/sounds.h87
-rw-r--r--apps/plugins/xrick/data/sprites.c22
-rw-r--r--apps/plugins/xrick/data/sprites.h70
-rw-r--r--apps/plugins/xrick/data/tiles.c22
-rw-r--r--apps/plugins/xrick/data/tiles.h70
10 files changed, 447 insertions, 0 deletions
diff --git a/apps/plugins/xrick/data/img.c b/apps/plugins/xrick/data/img.c
new file mode 100644
index 0000000000..2226df3c48
--- /dev/null
+++ b/apps/plugins/xrick/data/img.c
@@ -0,0 +1,23 @@
1/*
2 * xrick/data/img.c
3 *
4 * Copyright (C) 2008-2014 Pierluigi Vicinanza. All rights reserved.
5 *
6 * The use and distribution terms for this software are contained in the file
7 * named README, which can be found in the root of this distribution. By
8 * using this software in any fashion, you are agreeing to be bound by the
9 * terms of this license.
10 *
11 * You must not remove this notice, or any other, from this software.
12 */
13
14#include "xrick/data/img.h"
15
16#include <stddef.h> /* NULL */
17
18/*
19 * globals
20 */
21img_t *img_splash = NULL;
22
23/* eof */
diff --git a/apps/plugins/xrick/data/img.h b/apps/plugins/xrick/data/img.h
new file mode 100644
index 0000000000..96952627f9
--- /dev/null
+++ b/apps/plugins/xrick/data/img.h
@@ -0,0 +1,39 @@
1/*
2 * xrick/data/img.h
3 *
4 * Copyright (C) 1998-2002 BigOrno (bigorno@bigorno.net).
5 * Copyright (C) 2008-2014 Pierluigi Vicinanza.
6 * All rights reserved.
7 *
8 * The use and distribution terms for this software are contained in the file
9 * named README, which can be found in the root of this distribution. By
10 * using this software in any fashion, you are agreeing to be bound by the
11 * terms of this license.
12 *
13 * You must not remove this notice, or any other, from this software.
14 */
15
16#ifndef _IMG_H
17#define _IMG_H
18
19#include "xrick/system/basic_types.h"
20
21typedef struct {
22 U8 r, g, b, nothing;
23} img_color_t;
24
25typedef struct {
26 U16 width;
27 U16 height;
28 U16 xPos;
29 U16 yPos;
30 U16 ncolors;
31 img_color_t *colors;
32 U8 *pixels;
33} img_t;
34
35extern img_t *img_splash;
36
37#endif /* ndef _IMG_H */
38
39/* eof */
diff --git a/apps/plugins/xrick/data/pics.c b/apps/plugins/xrick/data/pics.c
new file mode 100644
index 0000000000..103bfd8344
--- /dev/null
+++ b/apps/plugins/xrick/data/pics.c
@@ -0,0 +1,29 @@
1/*
2 * xrick/data/pics.c
3 *
4 * Copyright (C) 2008-2014 Pierluigi Vicinanza. All rights reserved.
5 *
6 * The use and distribution terms for this software are contained in the file
7 * named README, which can be found in the root of this distribution. By
8 * using this software in any fashion, you are agreeing to be bound by the
9 * terms of this license.
10 *
11 * You must not remove this notice, or any other, from this software.
12 */
13
14#include "xrick/data/pics.h"
15
16#ifdef GFXST
17
18#include <stddef.h> /* NULL */
19
20/*
21 * globals
22 */
23pic_t *pic_haf = NULL;
24pic_t *pic_congrats = NULL;
25pic_t *pic_splash = NULL;
26
27#endif /* GFXST */
28
29/* eof */
diff --git a/apps/plugins/xrick/data/pics.h b/apps/plugins/xrick/data/pics.h
new file mode 100644
index 0000000000..0c540b125e
--- /dev/null
+++ b/apps/plugins/xrick/data/pics.h
@@ -0,0 +1,41 @@
1/*
2 * xrick/data/pics.h
3 *
4 * Copyright (C) 1998-2002 BigOrno (bigorno@bigorno.net).
5 * Copyright (C) 2008-2014 Pierluigi Vicinanza.
6 * All rights reserved.
7 *
8 * The use and distribution terms for this software are contained in the file
9 * named README, which can be found in the root of this distribution. By
10 * using this software in any fashion, you are agreeing to be bound by the
11 * terms of this license.
12 *
13 * You must not remove this notice, or any other, from this software.
14 */
15
16#ifndef _PICS_H
17#define _PICS_H
18
19#include "xrick/config.h"
20
21#ifdef GFXST
22
23#include "xrick/system/basic_types.h"
24
25typedef struct {
26 U16 width;
27 U16 height;
28 U16 xPos;
29 U16 yPos;
30 U32 *pixels;
31} pic_t;
32
33extern pic_t *pic_haf;
34extern pic_t *pic_congrats;
35extern pic_t *pic_splash;
36
37#endif /* GFXST */
38
39#endif /* ndef _PICS_H */
40
41/* eof */
diff --git a/apps/plugins/xrick/data/sounds.c b/apps/plugins/xrick/data/sounds.c
new file mode 100644
index 0000000000..853e7cd198
--- /dev/null
+++ b/apps/plugins/xrick/data/sounds.c
@@ -0,0 +1,44 @@
1/*
2 * xrick/data/sounds.c
3 *
4 * Copyright (C) 2008-2014 Pierluigi Vicinanza. All rights reserved.
5 *
6 * The use and distribution terms for this software are contained in the file
7 * named README, which can be found in the root of this distribution. By
8 * using this software in any fashion, you are agreeing to be bound by the
9 * terms of this license.
10 *
11 * You must not remove this notice, or any other, from this software.
12 */
13
14#include "xrick/data/sounds.h"
15
16#ifdef ENABLE_SOUND
17
18#include <stddef.h> /* NULL */
19
20sound_t *soundBombshht = NULL;
21sound_t *soundBonus = NULL;
22sound_t *soundBox = NULL;
23sound_t *soundBullet = NULL;
24sound_t *soundCrawl = NULL;
25sound_t *soundDie = NULL;
26sound_t *soundEntity[SOUNDS_NBR_ENTITIES];
27sound_t *soundExplode = NULL;
28sound_t *soundGameover = NULL;
29sound_t *soundJump = NULL;
30sound_t *soundPad = NULL;
31sound_t *soundSbonus1 = NULL;
32sound_t *soundSbonus2 = NULL;
33sound_t *soundStick = NULL;
34sound_t *soundTune0 = NULL;
35sound_t *soundTune1 = NULL;
36sound_t *soundTune2 = NULL;
37sound_t *soundTune3 = NULL;
38sound_t *soundTune4 = NULL;
39sound_t *soundTune5 = NULL;
40sound_t *soundWalk = NULL;
41
42#endif /* ENABLE_SOUND */
43
44/* eof */ \ No newline at end of file
diff --git a/apps/plugins/xrick/data/sounds.h b/apps/plugins/xrick/data/sounds.h
new file mode 100644
index 0000000000..5d89b3e9ee
--- /dev/null
+++ b/apps/plugins/xrick/data/sounds.h
@@ -0,0 +1,87 @@
1/*
2 * xrick/data/sounds.h
3 *
4 * Copyright (C) 2008-2014 Pierluigi Vicinanza. All rights reserved.
5 *
6 * The use and distribution terms for this software are contained in the file
7 * named README, which can be found in the root of this distribution. By
8 * using this software in any fashion, you are agreeing to be bound by the
9 * terms of this license.
10 *
11 * You must not remove this notice, or any other, from this software.
12 */
13
14#ifndef _SOUNDS_H
15#define _SOUNDS_H
16
17#include "xrick/config.h"
18
19#ifdef ENABLE_SOUND
20
21#include "xrick/system/basic_types.h"
22
23typedef struct {
24 char *name;
25 U8 *buf;
26 U32 len;
27 bool dispose;
28} sound_t;
29
30enum
31{
32 /* expected format is 8-bit mono at 22050Hz */
33 Wave_SAMPLE_RATE = 22050,
34 Wave_AUDIO_FORMAT = 1, /* PCM = 1 (i.e. Linear quantization) */
35 Wave_CHANNEL_COUNT = 1,
36 Wave_BITS_PER_SAMPLE = 8,
37};
38
39typedef struct {
40 /* "RIFF" chunk descriptor */
41 U8 riffChunkId[4];
42 U8 riffChunkSize[4];
43 U8 riffType[4];
44 /* "fmt" sub-chunk */
45 U8 formatChunkId[4];
46 U8 formatChunkSize[4];
47 U8 audioFormat[2];
48 U8 channelCount[2];
49 U8 sampleRate[4];
50 U8 byteRate[4];
51 U8 blockAlign[2];
52 U8 bitsPerSample[2];
53 /* "data" sub-chunk */
54 U8 dataChunkId[4];
55 U8 dataChunkSize[4];
56} wave_header_t;
57
58/* apparently there are 10 entity sounds in original game (ref. "e_them.c" notes)? However we only have 9 so far... */
59enum { SOUNDS_NBR_ENTITIES = 10 };
60
61extern sound_t *soundBombshht;
62extern sound_t *soundBonus;
63extern sound_t *soundBox;
64extern sound_t *soundBullet;
65extern sound_t *soundCrawl;
66extern sound_t *soundDie;
67extern sound_t *soundEntity[SOUNDS_NBR_ENTITIES];
68extern sound_t *soundExplode;
69extern sound_t *soundGameover;
70extern sound_t *soundJump;
71extern sound_t *soundPad;
72extern sound_t *soundSbonus1;
73extern sound_t *soundSbonus2;
74extern sound_t *soundStick;
75extern sound_t *soundTune0;
76extern sound_t *soundTune1;
77extern sound_t *soundTune2;
78extern sound_t *soundTune3;
79extern sound_t *soundTune4;
80extern sound_t *soundTune5;
81extern sound_t *soundWalk;
82
83#endif /* ENABLE_SOUND */
84
85#endif /* ndef _SOUNDS_H */
86
87/* eof */ \ No newline at end of file
diff --git a/apps/plugins/xrick/data/sprites.c b/apps/plugins/xrick/data/sprites.c
new file mode 100644
index 0000000000..461861e85e
--- /dev/null
+++ b/apps/plugins/xrick/data/sprites.c
@@ -0,0 +1,22 @@
1/*
2 * xrick/data/sprites.c
3 *
4 * Copyright (C) 2008-2014 Pierluigi Vicinanza. All rights reserved.
5 *
6 * The use and distribution terms for this software are contained in the file
7 * named README, which can be found in the root of this distribution. By
8 * using this software in any fashion, you are agreeing to be bound by the
9 * terms of this license.
10 *
11 * You must not remove this notice, or any other, from this software.
12 */
13
14#include "xrick/data/sprites.h"
15
16/*
17 * globals
18 */
19size_t sprites_nbr_sprites = 0;
20sprite_t *sprites_data = NULL;
21
22/* eof */
diff --git a/apps/plugins/xrick/data/sprites.h b/apps/plugins/xrick/data/sprites.h
new file mode 100644
index 0000000000..124ad4bc85
--- /dev/null
+++ b/apps/plugins/xrick/data/sprites.h
@@ -0,0 +1,70 @@
1/*
2 * xrick/data/sprites.h
3 *
4 * Copyright (C) 1998-2002 BigOrno (bigorno@bigorno.net).
5 * Copyright (C) 2008-2014 Pierluigi Vicinanza.
6 * All rights reserved.
7 *
8 * The use and distribution terms for this software are contained in the file
9 * named README, which can be found in the root of this distribution. By
10 * using this software in any fashion, you are agreeing to be bound by the
11 * terms of this license.
12 *
13 * You must not remove this notice, or any other, from this software.
14 */
15
16/*
17 * NOTES -- PC version
18 *
19 * A sprite consists in 4 columns and 21 rows of (U16 mask, U16 pict),
20 * each pair representing 8 pixels (cga encoding, two bits per pixels).
21 * Sprites are stored in 'sprites.bin' and are loaded by spr_init. Memory
22 * is freed by spr_shutdown.
23 *
24 * There are four sprites planes. Plane 0 is the raw content of 'sprites.bin',
25 * and planes 1, 2 and 3 contain copies of plane 0 with all sprites shifted
26 * 2, 4 and 6 pixels to the right.
27 */
28
29#ifndef _SPRITES_H_
30#define _SPRITES_H_
31
32#include "xrick/config.h"
33
34#include "xrick/system/basic_types.h"
35
36#include <stddef.h> /* size_t */
37
38#ifdef GFXPC
39
40typedef struct {
41 U16 mask;
42 U16 pict;
43} spriteX_t;
44
45enum {
46 SPRITES_NBR_ROWS = 21,
47 SPRITES_NBR_COLS = 4
48};
49typedef spriteX_t sprite_t[SPRITES_NBR_COLS][SPRITES_NBR_ROWS]; /* one sprite */
50
51#endif /* GFXPC */
52
53
54#ifdef GFXST
55
56enum {
57 SPRITES_NBR_ROWS = 21,
58 SPRITES_NBR_COLS = 4,
59 SPRITES_NBR_DATA = SPRITES_NBR_ROWS * SPRITES_NBR_COLS
60};
61typedef U32 sprite_t[SPRITES_NBR_DATA];
62
63#endif /* GFXST */
64
65extern size_t sprites_nbr_sprites;
66extern sprite_t *sprites_data;
67
68#endif /* ndef _SPRITES_H_ */
69
70/* eof */
diff --git a/apps/plugins/xrick/data/tiles.c b/apps/plugins/xrick/data/tiles.c
new file mode 100644
index 0000000000..17d702ee6b
--- /dev/null
+++ b/apps/plugins/xrick/data/tiles.c
@@ -0,0 +1,22 @@
1/*
2 * xrick/data/tiles.c
3 *
4 * Copyright (C) 2008-2014 Pierluigi Vicinanza. All rights reserved.
5 *
6 * The use and distribution terms for this software are contained in the file
7 * named README, which can be found in the root of this distribution. By
8 * using this software in any fashion, you are agreeing to be bound by the
9 * terms of this license.
10 *
11 * You must not remove this notice, or any other, from this software.
12 */
13
14#include "xrick/data/tiles.h"
15
16/*
17 * globals
18 */
19size_t tiles_nbr_banks = 0;
20tile_t *tiles_data = NULL;
21
22/* eof */
diff --git a/apps/plugins/xrick/data/tiles.h b/apps/plugins/xrick/data/tiles.h
new file mode 100644
index 0000000000..35bc07184e
--- /dev/null
+++ b/apps/plugins/xrick/data/tiles.h
@@ -0,0 +1,70 @@
1/*
2 * xrick/data/tiles.h
3 *
4 * Copyright (C) 1998-2002 BigOrno (bigorno@bigorno.net).
5 * Copyright (C) 2008-2014 Pierluigi Vicinanza.
6 * All rights reserved.
7 *
8 * The use and distribution terms for this software are contained in the file
9 * named README, which can be found in the root of this distribution. By
10 * using this software in any fashion, you are agreeing to be bound by the
11 * terms of this license.
12 *
13 * You must not remove this notice, or any other, from this software.
14 */
15
16/*
17 * NOTES
18 *
19 * A tile consists in one column and 8 rows of 8 U16 (cga encoding, two
20 * bits per pixel). The tl_tiles array contains all tiles, with the
21 * following structure:
22 *
23 * 0x0000 - 0x00FF tiles for main intro
24 * 0x0100 - 0x01FF tiles for map intro
25 * 0x0200 - 0x0327 unused
26 * 0x0328 - 0x0427 game tiles, page 0
27 * 0x0428 - 0x0527 game tiles, page 1
28 * 0x0527 - 0x05FF unused
29 */
30
31#ifndef _TILES_H
32#define _TILES_H
33
34#include "xrick/system/basic_types.h"
35
36#include "xrick/config.h"
37
38#include <stddef.h> /* size_t */
39
40/*
41 * three special tile numbers
42 */
43enum {
44 TILES_BULLET = 0x01,
45 TILES_BOMB = 0x02,
46 TILES_RICK = 0x03
47};
48
49/*
50 * one single tile
51 */
52enum { TILES_NBR_LINES = 0x08 };
53
54#ifdef GFXPC
55typedef U16 tile_t[TILES_NBR_LINES];
56#endif
57#ifdef GFXST
58typedef U32 tile_t[TILES_NBR_LINES];
59#endif
60
61/*
62 * tiles banks (each bank is 0x100 tiles)
63 */
64enum { TILES_NBR_TILES = 0x100 };
65extern size_t tiles_nbr_banks;
66extern tile_t *tiles_data;
67
68#endif /* ndef _TILES_H */
69
70/* eof */