diff options
author | Sebastian Leonhardt <sebastian.leonhardt@web.de> | 2016-01-08 01:05:36 +0100 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2024-06-30 17:24:16 -0400 |
commit | 102c3742487dba76ec72d5f56a2c3041344b2d68 (patch) | |
tree | 4931ad34d2cc0bac56d9984b9ead355d012ad63a /apps/plugins/xrick/data | |
parent | 6f1e67e5e318ba2fd0f5ec1892c7b6633ec6521c (diff) | |
download | rockbox-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.c | 23 | ||||
-rw-r--r-- | apps/plugins/xrick/data/img.h | 39 | ||||
-rw-r--r-- | apps/plugins/xrick/data/pics.c | 29 | ||||
-rw-r--r-- | apps/plugins/xrick/data/pics.h | 41 | ||||
-rw-r--r-- | apps/plugins/xrick/data/sounds.c | 44 | ||||
-rw-r--r-- | apps/plugins/xrick/data/sounds.h | 87 | ||||
-rw-r--r-- | apps/plugins/xrick/data/sprites.c | 22 | ||||
-rw-r--r-- | apps/plugins/xrick/data/sprites.h | 70 | ||||
-rw-r--r-- | apps/plugins/xrick/data/tiles.c | 22 | ||||
-rw-r--r-- | apps/plugins/xrick/data/tiles.h | 70 |
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 | */ | ||
21 | img_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 | |||
21 | typedef struct { | ||
22 | U8 r, g, b, nothing; | ||
23 | } img_color_t; | ||
24 | |||
25 | typedef 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 | |||
35 | extern 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 | */ | ||
23 | pic_t *pic_haf = NULL; | ||
24 | pic_t *pic_congrats = NULL; | ||
25 | pic_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 | |||
25 | typedef struct { | ||
26 | U16 width; | ||
27 | U16 height; | ||
28 | U16 xPos; | ||
29 | U16 yPos; | ||
30 | U32 *pixels; | ||
31 | } pic_t; | ||
32 | |||
33 | extern pic_t *pic_haf; | ||
34 | extern pic_t *pic_congrats; | ||
35 | extern 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 | |||
20 | sound_t *soundBombshht = NULL; | ||
21 | sound_t *soundBonus = NULL; | ||
22 | sound_t *soundBox = NULL; | ||
23 | sound_t *soundBullet = NULL; | ||
24 | sound_t *soundCrawl = NULL; | ||
25 | sound_t *soundDie = NULL; | ||
26 | sound_t *soundEntity[SOUNDS_NBR_ENTITIES]; | ||
27 | sound_t *soundExplode = NULL; | ||
28 | sound_t *soundGameover = NULL; | ||
29 | sound_t *soundJump = NULL; | ||
30 | sound_t *soundPad = NULL; | ||
31 | sound_t *soundSbonus1 = NULL; | ||
32 | sound_t *soundSbonus2 = NULL; | ||
33 | sound_t *soundStick = NULL; | ||
34 | sound_t *soundTune0 = NULL; | ||
35 | sound_t *soundTune1 = NULL; | ||
36 | sound_t *soundTune2 = NULL; | ||
37 | sound_t *soundTune3 = NULL; | ||
38 | sound_t *soundTune4 = NULL; | ||
39 | sound_t *soundTune5 = NULL; | ||
40 | sound_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 | |||
23 | typedef struct { | ||
24 | char *name; | ||
25 | U8 *buf; | ||
26 | U32 len; | ||
27 | bool dispose; | ||
28 | } sound_t; | ||
29 | |||
30 | enum | ||
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 | |||
39 | typedef 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... */ | ||
59 | enum { SOUNDS_NBR_ENTITIES = 10 }; | ||
60 | |||
61 | extern sound_t *soundBombshht; | ||
62 | extern sound_t *soundBonus; | ||
63 | extern sound_t *soundBox; | ||
64 | extern sound_t *soundBullet; | ||
65 | extern sound_t *soundCrawl; | ||
66 | extern sound_t *soundDie; | ||
67 | extern sound_t *soundEntity[SOUNDS_NBR_ENTITIES]; | ||
68 | extern sound_t *soundExplode; | ||
69 | extern sound_t *soundGameover; | ||
70 | extern sound_t *soundJump; | ||
71 | extern sound_t *soundPad; | ||
72 | extern sound_t *soundSbonus1; | ||
73 | extern sound_t *soundSbonus2; | ||
74 | extern sound_t *soundStick; | ||
75 | extern sound_t *soundTune0; | ||
76 | extern sound_t *soundTune1; | ||
77 | extern sound_t *soundTune2; | ||
78 | extern sound_t *soundTune3; | ||
79 | extern sound_t *soundTune4; | ||
80 | extern sound_t *soundTune5; | ||
81 | extern 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 | */ | ||
19 | size_t sprites_nbr_sprites = 0; | ||
20 | sprite_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 | |||
40 | typedef struct { | ||
41 | U16 mask; | ||
42 | U16 pict; | ||
43 | } spriteX_t; | ||
44 | |||
45 | enum { | ||
46 | SPRITES_NBR_ROWS = 21, | ||
47 | SPRITES_NBR_COLS = 4 | ||
48 | }; | ||
49 | typedef spriteX_t sprite_t[SPRITES_NBR_COLS][SPRITES_NBR_ROWS]; /* one sprite */ | ||
50 | |||
51 | #endif /* GFXPC */ | ||
52 | |||
53 | |||
54 | #ifdef GFXST | ||
55 | |||
56 | enum { | ||
57 | SPRITES_NBR_ROWS = 21, | ||
58 | SPRITES_NBR_COLS = 4, | ||
59 | SPRITES_NBR_DATA = SPRITES_NBR_ROWS * SPRITES_NBR_COLS | ||
60 | }; | ||
61 | typedef U32 sprite_t[SPRITES_NBR_DATA]; | ||
62 | |||
63 | #endif /* GFXST */ | ||
64 | |||
65 | extern size_t sprites_nbr_sprites; | ||
66 | extern 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 | */ | ||
19 | size_t tiles_nbr_banks = 0; | ||
20 | tile_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 | */ | ||
43 | enum { | ||
44 | TILES_BULLET = 0x01, | ||
45 | TILES_BOMB = 0x02, | ||
46 | TILES_RICK = 0x03 | ||
47 | }; | ||
48 | |||
49 | /* | ||
50 | * one single tile | ||
51 | */ | ||
52 | enum { TILES_NBR_LINES = 0x08 }; | ||
53 | |||
54 | #ifdef GFXPC | ||
55 | typedef U16 tile_t[TILES_NBR_LINES]; | ||
56 | #endif | ||
57 | #ifdef GFXST | ||
58 | typedef U32 tile_t[TILES_NBR_LINES]; | ||
59 | #endif | ||
60 | |||
61 | /* | ||
62 | * tiles banks (each bank is 0x100 tiles) | ||
63 | */ | ||
64 | enum { TILES_NBR_TILES = 0x100 }; | ||
65 | extern size_t tiles_nbr_banks; | ||
66 | extern tile_t *tiles_data; | ||
67 | |||
68 | #endif /* ndef _TILES_H */ | ||
69 | |||
70 | /* eof */ | ||