diff options
author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-08-07 20:01:04 +0000 |
---|---|---|
committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-08-07 20:01:04 +0000 |
commit | acb0917556fc33681c1df5a530cf754193e67705 (patch) | |
tree | 052a47097009a210e4aed9c207bd6aa4828cc000 /apps/codecs/libgme/blargg_source.h | |
parent | 93c6f1329a5691a8be158cefe15641bd1daf9ef8 (diff) | |
download | rockbox-acb0917556fc33681c1df5a530cf754193e67705.tar.gz rockbox-acb0917556fc33681c1df5a530cf754193e67705.zip |
Submit initial patch from FS#12176. Adds support for several new game music formats (AY, GBS, HES, KSS, SGC, VGM and VGZ) and replaces the current NSF and NSFE with a new implementation based on a port of the Game Music Emu library 'GME'. This first submit does not cover the full functionality provided by the author's original patch: Coleco-SGV is not supported, some GME-specific m3u-support has been removed and IRAM is not used yet. Further changes are very likely to follow this submit. Thanks to Mauricio Garrido.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30264 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libgme/blargg_source.h')
-rw-r--r-- | apps/codecs/libgme/blargg_source.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/apps/codecs/libgme/blargg_source.h b/apps/codecs/libgme/blargg_source.h new file mode 100644 index 0000000000..4bea02a48b --- /dev/null +++ b/apps/codecs/libgme/blargg_source.h | |||
@@ -0,0 +1,71 @@ | |||
1 | // Included at the beginning of library source files, after all other #include lines | ||
2 | #ifndef BLARGG_SOURCE_H | ||
3 | #define BLARGG_SOURCE_H | ||
4 | |||
5 | // If debugging is enabled, abort program if expr is false. Meant for checking | ||
6 | // internal state and consistency. A failed assertion indicates a bug in the module. | ||
7 | // void assert( bool expr ); | ||
8 | #include <assert.h> | ||
9 | |||
10 | // If debugging is enabled and expr is false, abort program. Meant for checking | ||
11 | // caller-supplied parameters and operations that are outside the control of the | ||
12 | // module. A failed requirement indicates a bug outside the module. | ||
13 | // void require( bool expr ); | ||
14 | #if defined(ROCKBOX) | ||
15 | #undef require | ||
16 | #define require( expr ) | ||
17 | #else | ||
18 | #undef require | ||
19 | #define require( expr ) assert( expr ) | ||
20 | #endif | ||
21 | |||
22 | // Like printf() except output goes to debug log file. Might be defined to do | ||
23 | // nothing (not even evaluate its arguments). | ||
24 | // void dprintf( const char* format, ... ); | ||
25 | #if defined(ROCKBOX) | ||
26 | #define dprintf DEBUGF | ||
27 | #else | ||
28 | static inline void blargg_dprintf_( const char* fmt, ... ) { } | ||
29 | #undef dprintf | ||
30 | #define dprintf (1) ? (void) 0 : blargg_dprintf_ | ||
31 | #endif | ||
32 | |||
33 | // If enabled, evaluate expr and if false, make debug log entry with source file | ||
34 | // and line. Meant for finding situations that should be examined further, but that | ||
35 | // don't indicate a problem. In all cases, execution continues normally. | ||
36 | #undef check | ||
37 | #define check( expr ) ((void) 0) | ||
38 | |||
39 | // If expr yields error string, return it from current function, otherwise continue. | ||
40 | #undef RETURN_ERR | ||
41 | #define RETURN_ERR( expr ) do { \ | ||
42 | blargg_err_t blargg_return_err_ = (expr); \ | ||
43 | if ( blargg_return_err_ ) return blargg_return_err_; \ | ||
44 | } while ( 0 ) | ||
45 | |||
46 | // If ptr is 0, return out of memory error string. | ||
47 | #undef CHECK_ALLOC | ||
48 | #define CHECK_ALLOC( ptr ) do { if ( (ptr) == 0 ) return "Out of memory"; } while ( 0 ) | ||
49 | |||
50 | #ifndef max | ||
51 | #define max(a,b) (((a) > (b)) ? (a) : (b)) | ||
52 | #endif | ||
53 | #ifndef min | ||
54 | #define min(a,b) (((a) < (b)) ? (a) : (b)) | ||
55 | #endif | ||
56 | |||
57 | // TODO: good idea? bad idea? | ||
58 | #undef byte | ||
59 | #define byte byte_ | ||
60 | typedef unsigned char byte; | ||
61 | |||
62 | // deprecated | ||
63 | #define BLARGG_CHECK_ALLOC CHECK_ALLOC | ||
64 | #define BLARGG_RETURN_ERR RETURN_ERR | ||
65 | |||
66 | // BLARGG_SOURCE_BEGIN: If defined, #included, allowing redefition of dprintf and check | ||
67 | #ifdef BLARGG_SOURCE_BEGIN | ||
68 | #include BLARGG_SOURCE_BEGIN | ||
69 | #endif | ||
70 | |||
71 | #endif | ||