diff options
| author | Sebastian Leonhardt <sebastian.leonhardt@web.de> | 2016-01-08 01:05:36 +0100 |
|---|---|---|
| committer | Franklin Wei <frankhwei536@gmail.com> | 2016-06-13 22:49:35 -0400 |
| commit | b33d4e9ae51f7b5fcd4add3f9e7a6fb966f67d76 (patch) | |
| tree | 1226f0ab0c06d71b7f5a336dcb317f456bd68551 /apps/plugins/xrick/data | |
| parent | 9a6700d52e8dfb2e93623e7143204ae34f798bbf (diff) | |
| download | rockbox-b33d4e9ae51f7b5fcd4add3f9e7a6fb966f67d76.zip rockbox-b33d4e9ae51f7b5fcd4add3f9e7a6fb966f67d76.tar.gz rockbox-b33d4e9ae51f7b5fcd4add3f9e7a6fb966f67d76.tar.bz2 rockbox-b33d4e9ae51f7b5fcd4add3f9e7a6fb966f67d76.tar.xz | |
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
Change-Id: Id83928bc2539901b0221692f65cbca41389c58e7
Diffstat (limited to 'apps/plugins/xrick/data')
| -rw-r--r-- | apps/plugins/xrick/data/img.c | 24 | ||||
| -rw-r--r-- | apps/plugins/xrick/data/img.h | 39 | ||||
| -rw-r--r-- | apps/plugins/xrick/data/pics.c | 30 | ||||
| -rw-r--r-- | apps/plugins/xrick/data/pics.h | 43 | ||||
| -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 | 23 | ||||
| -rw-r--r-- | apps/plugins/xrick/data/sprites.h | 71 | ||||
| -rw-r--r-- | apps/plugins/xrick/data/tiles.c | 22 | ||||
| -rw-r--r-- | apps/plugins/xrick/data/tiles.h | 70 |
10 files changed, 453 insertions, 0 deletions
diff --git a/apps/plugins/xrick/data/img.c b/apps/plugins/xrick/data/img.c new file mode 100644 index 0000000..c6a40a4 --- /dev/null +++ b/apps/plugins/xrick/data/img.c @@ -0,0 +1,24 @@ +/* + * xrick/data/img.c + * + * Copyright (C) 2008-2014 Pierluigi Vicinanza. All rights reserved. + * + * The use and distribution terms for this software are contained in the file + * named README, which can be found in the root of this distribution. By + * using this software in any fashion, you are agreeing to be bound by the + * terms of this license. + * + * You must not remove this notice, or any other, from this software. + */ + +#include "xrick/data/img.h" + +#include <stddef.h> /* NULL */ + +/* + * globals + */ +img_t *img_splash = NULL; + +/* eof */ + diff --git a/apps/plugins/xrick/data/img.h b/apps/plugins/xrick/data/img.h new file mode 100644 index 0000000..9695262 --- /dev/null +++ b/apps/plugins/xrick/data/img.h @@ -0,0 +1,39 @@ +/* + * xrick/data/img.h + * + * Copyright (C) 1998-2002 BigOrno (bigorno@bigorno.net). + * Copyright (C) 2008-2014 Pierluigi Vicinanza. + * All rights reserved. + * + * The use and distribution terms for this software are contained in the file + * named README, which can be found in the root of this distribution. By + * using this software in any fashion, you are agreeing to be bound by the + * terms of this license. + * + * You must not remove this notice, or any other, from this software. + */ + +#ifndef _IMG_H +#define _IMG_H + +#include "xrick/system/basic_types.h" + +typedef struct { + U8 r, g, b, nothing; +} img_color_t; + +typedef struct { + U16 width; + U16 height; + U16 xPos; + U16 yPos; + U16 ncolors; + img_color_t *colors; + U8 *pixels; +} img_t; + +extern img_t *img_splash; + +#endif /* ndef _IMG_H */ + +/* eof */ diff --git a/apps/plugins/xrick/data/pics.c b/apps/plugins/xrick/data/pics.c new file mode 100644 index 0000000..eb9fa25 --- /dev/null +++ b/apps/plugins/xrick/data/pics.c @@ -0,0 +1,30 @@ +/* + * xrick/data/pics.c + * + * Copyright (C) 2008-2014 Pierluigi Vicinanza. All rights reserved. + * + * The use and distribution terms for this software are contained in the file + * named README, which can be found in the root of this distribution. By + * using this software in any fashion, you are agreeing to be bound by the + * terms of this license. + * + * You must not remove this notice, or any other, from this software. + */ + +#include "xrick/data/pics.h" + +#ifdef GFXST + +#include <stddef.h> /* NULL */ + +/* + * globals + */ +pic_t *pic_haf = NULL; +pic_t *pic_congrats = NULL; +pic_t *pic_splash = NULL; + +#endif /* GFXST */ + +/* eof */ + diff --git a/apps/plugins/xrick/data/pics.h b/apps/plugins/xrick/data/pics.h new file mode 100644 index 0000000..e578a19 --- /dev/null +++ b/apps/plugins/xrick/data/pics.h @@ -0,0 +1,43 @@ +/* + * xrick/data/pics.h + * + * Copyright (C) 1998-2002 BigOrno (bigorno@bigorno.net). + * Copyright (C) 2008-2014 Pierluigi Vicinanza. + * All rights reserved. + * + * The use and distribution terms for this software are contained in the file + * named README, which can be found in the root of this distribution. By + * using this software in any fashion, you are agreeing to be bound by the + * terms of this license. + * + * You must not remove this notice, or any other, from this software. + */ + +#ifndef _PICS_H +#define _PICS_H + +#include "xrick/config.h" + +#ifdef GFXST + +#include "xrick/system/basic_types.h" + +typedef struct { + U16 width; + U16 height; + U16 xPos; + U16 yPos; + U32 *pixels; +} pic_t; + +extern pic_t *pic_haf; +extern pic_t *pic_congrats; +extern pic_t *pic_splash; + +#endif /* GFXST */ + +#endif /* ndef _PICS_H */ + +/* eof */ + + diff --git a/apps/plugins/xrick/data/sounds.c b/apps/plugins/xrick/data/sounds.c new file mode 100644 index 0000000..853e7cd --- /dev/null +++ b/apps/plugins/xrick/data/sounds.c @@ -0,0 +1,44 @@ +/* + * xrick/data/sounds.c + * + * Copyright (C) 2008-2014 Pierluigi Vicinanza. All rights reserved. + * + * The use and distribution terms for this software are contained in the file + * named README, which can be found in the root of this distribution. By + * using this software in any fashion, you are agreeing to be bound by the + * terms of this license. + * + * You must not remove this notice, or any other, from this software. + */ + +#include "xrick/data/sounds.h" + +#ifdef ENABLE_SOUND + +#include <stddef.h> /* NULL */ + +sound_t *soundBombshht = NULL; +sound_t *soundBonus = NULL; +sound_t *soundBox = NULL; +sound_t *soundBullet = NULL; +sound_t *soundCrawl = NULL; +sound_t *soundDie = NULL; +sound_t *soundEntity[SOUNDS_NBR_ENTITIES]; +sound_t *soundExplode = NULL; +sound_t *soundGameover = NULL; +sound_t *soundJump = NULL; +sound_t *soundPad = NULL; +sound_t *soundSbonus1 = NULL; +sound_t *soundSbonus2 = NULL; +sound_t *soundStick = NULL; +sound_t *soundTune0 = NULL; +sound_t *soundTune1 = NULL; +sound_t *soundTune2 = NULL; +sound_t *soundTune3 = NULL; +sound_t *soundTune4 = NULL; +sound_t *soundTune5 = NULL; +sound_t *soundWalk = NULL; + +#endif /* ENABLE_SOUND */ + +/* 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 0000000..5d89b3e --- /dev/null +++ b/apps/plugins/xrick/data/sounds.h @@ -0,0 +1,87 @@ +/* + * xrick/data/sounds.h + * + * Copyright (C) 2008-2014 Pierluigi Vicinanza. All rights reserved. + * + * The use and distribution terms for this software are contained in the file + * named README, which can be found in the root of this distribution. By + * using this software in any fashion, you are agreeing to be bound by the + * terms of this license. + * + * You must not remove this notice, or any other, from this software. + */ + +#ifndef _SOUNDS_H +#define _SOUNDS_H + +#include "xrick/config.h" + +#ifdef ENABLE_SOUND + +#include "xrick/system/basic_types.h" + +typedef struct { + char *name; + U8 *buf; + U32 len; + bool dispose; +} sound_t; + +enum +{ + /* expected format is 8-bit mono at 22050Hz */ + Wave_SAMPLE_RATE = 22050, + Wave_AUDIO_FORMAT = 1, /* PCM = 1 (i.e. Linear quantization) */ + Wave_CHANNEL_COUNT = 1, + Wave_BITS_PER_SAMPLE = 8, +}; + +typedef struct { + /* "RIFF" chunk descriptor */ + U8 riffChunkId[4]; + U8 riffChunkSize[4]; + U8 riffType[4]; + /* "fmt" sub-chunk */ + U8 formatChunkId[4]; + U8 formatChunkSize[4]; + U8 audioFormat[2]; + U8 channelCount[2]; + U8 sampleRate[4]; + U8 byteRate[4]; + U8 blockAlign[2]; + U8 bitsPerSample[2]; + /* "data" sub-chunk */ + U8 dataChunkId[4]; + U8 dataChunkSize[4]; +} wave_header_t; + +/* apparently there are 10 entity sounds in original game (ref. "e_them.c" notes)? However we only have 9 so far... */ +enum { SOUNDS_NBR_ENTITIES = 10 }; + +extern sound_t *soundBombshht; +extern sound_t *soundBonus; +extern sound_t *soundBox; +extern sound_t *soundBullet; +extern sound_t *soundCrawl; +extern sound_t *soundDie; +extern sound_t *soundEntity[SOUNDS_NBR_ENTITIES]; +extern sound_t *soundExplode; +extern sound_t *soundGameover; +extern sound_t *soundJump; +extern sound_t *soundPad; +extern sound_t *soundSbonus1; +extern sound_t *soundSbonus2; +extern sound_t *soundStick; +extern sound_t *soundTune0; +extern sound_t *soundTune1; +extern sound_t *soundTune2; +extern sound_t *soundTune3; +extern sound_t *soundTune4; +extern sound_t *soundTune5; +extern sound_t *soundWalk; + +#endif /* ENABLE_SOUND */ + +#endif /* ndef _SOUNDS_H */ + +/* 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 0000000..905802f --- /dev/null +++ b/apps/plugins/xrick/data/sprites.c @@ -0,0 +1,23 @@ +/* + * xrick/data/sprites.c + * + * Copyright (C) 2008-2014 Pierluigi Vicinanza. All rights reserved. + * + * The use and distribution terms for this software are contained in the file + * named README, which can be found in the root of this distribution. By + * using this software in any fashion, you are agreeing to be bound by the + * terms of this license. + * + * You must not remove this notice, or any other, from this software. + */ + +#include "xrick/data/sprites.h" + +/* + * globals + */ +size_t sprites_nbr_sprites = 0; +sprite_t *sprites_data = NULL; + +/* eof */ + diff --git a/apps/plugins/xrick/data/sprites.h b/apps/plugins/xrick/data/sprites.h new file mode 100644 index 0000000..afd7f19 --- /dev/null +++ b/apps/plugins/xrick/data/sprites.h @@ -0,0 +1,71 @@ +/* + * xrick/data/sprites.h + * + * Copyright (C) 1998-2002 BigOrno (bigorno@bigorno.net). + * Copyright (C) 2008-2014 Pierluigi Vicinanza. + * All rights reserved. + * + * The use and distribution terms for this software are contained in the file + * named README, which can be found in the root of this distribution. By + * using this software in any fashion, you are agreeing to be bound by the + * terms of this license. + * + * You must not remove this notice, or any other, from this software. + */ + +/* + * NOTES -- PC version + * + * A sprite consists in 4 columns and 21 rows of (U16 mask, U16 pict), + * each pair representing 8 pixels (cga encoding, two bits per pixels). + * Sprites are stored in 'sprites.bin' and are loaded by spr_init. Memory + * is freed by spr_shutdown. + * + * There are four sprites planes. Plane 0 is the raw content of 'sprites.bin', + * and planes 1, 2 and 3 contain copies of plane 0 with all sprites shifted + * 2, 4 and 6 pixels to the right. + */ + +#ifndef _SPRITES_H_ +#define _SPRITES_H_ + +#include "xrick/config.h" + +#include "xrick/system/basic_types.h" + +#include <stddef.h> /* size_t */ + +#ifdef GFXPC + +typedef struct { + U16 mask; + U16 pict; +} spriteX_t; + +enum { + SPRITES_NBR_ROWS = 21, + SPRITES_NBR_COLS = 4 +}; +typedef spriteX_t sprite_t[SPRITES_NBR_COLS][SPRITES_NBR_ROWS]; /* one sprite */ + +#endif /* GFXPC */ + + +#ifdef GFXST + +enum { + SPRITES_NBR_ROWS = 21, + SPRITES_NBR_COLS = 4, + SPRITES_NBR_DATA = SPRITES_NBR_ROWS * SPRITES_NBR_COLS +}; +typedef U32 sprite_t[SPRITES_NBR_DATA]; + +#endif /* GFXST */ + +extern size_t sprites_nbr_sprites; +extern sprite_t *sprites_data; + +#endif /* ndef _SPRITES_H_ */ + +/* eof */ + diff --git a/apps/plugins/xrick/data/tiles.c b/apps/plugins/xrick/data/tiles.c new file mode 100644 index 0000000..17d702e --- /dev/null +++ b/apps/plugins/xrick/data/tiles.c @@ -0,0 +1,22 @@ +/* + * xrick/data/tiles.c + * + * Copyright (C) 2008-2014 Pierluigi Vicinanza. All rights reserved. + * + * The use and distribution terms for this software are contained in the file + * named README, which can be found in the root of this distribution. By + * using this software in any fashion, you are agreeing to be bound by the + * terms of this license. + * + * You must not remove this notice, or any other, from this software. + */ + +#include "xrick/data/tiles.h" + +/* + * globals + */ +size_t tiles_nbr_banks = 0; +tile_t *tiles_data = NULL; + +/* eof */ diff --git a/apps/plugins/xrick/data/tiles.h b/apps/plugins/xrick/data/tiles.h new file mode 100644 index 0000000..35bc071 --- /dev/null +++ b/apps/plugins/xrick/data/tiles.h @@ -0,0 +1,70 @@ +/* + * xrick/data/tiles.h + * + * Copyright (C) 1998-2002 BigOrno (bigorno@bigorno.net). + * Copyright (C) 2008-2014 Pierluigi Vicinanza. + * All rights reserved. + * + * The use and distribution terms for this software are contained in the file + * named README, which can be found in the root of this distribution. By + * using this software in any fashion, you are agreeing to be bound by the + * terms of this license. + * + * You must not remove this notice, or any other, from this software. + */ + +/* + * NOTES + * + * A tile consists in one column and 8 rows of 8 U16 (cga encoding, two + * bits per pixel). The tl_tiles array contains all tiles, with the + * following structure: + * + * 0x0000 - 0x00FF tiles for main intro + * 0x0100 - 0x01FF tiles for map intro + * 0x0200 - 0x0327 unused + * 0x0328 - 0x0427 game tiles, page 0 + * 0x0428 - 0x0527 game tiles, page 1 + * 0x0527 - 0x05FF unused + */ + +#ifndef _TILES_H +#define _TILES_H + +#include "xrick/system/basic_types.h" + +#include "xrick/config.h" + +#include <stddef.h> /* size_t */ + +/* + * three special tile numbers + */ +enum { + TILES_BULLET = 0x01, + TILES_BOMB = 0x02, + TILES_RICK = 0x03 +}; + +/* + * one single tile + */ +enum { TILES_NBR_LINES = 0x08 }; + +#ifdef GFXPC +typedef U16 tile_t[TILES_NBR_LINES]; +#endif +#ifdef GFXST +typedef U32 tile_t[TILES_NBR_LINES]; +#endif + +/* + * tiles banks (each bank is 0x100 tiles) + */ +enum { TILES_NBR_TILES = 0x100 }; +extern size_t tiles_nbr_banks; +extern tile_t *tiles_data; + +#endif /* ndef _TILES_H */ + +/* eof */ |