From 102c3742487dba76ec72d5f56a2c3041344b2d68 Mon Sep 17 00:00:00 2001 From: Sebastian Leonhardt Date: Fri, 8 Jan 2016 01:05:36 +0100 Subject: 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 --- apps/plugins/xrick/data/sounds.h | 87 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 apps/plugins/xrick/data/sounds.h (limited to 'apps/plugins/xrick/data/sounds.h') 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 @@ +/* + * 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 -- cgit v1.2.3