summaryrefslogtreecommitdiff
path: root/apps/codecs/libgme/emu2413.h
diff options
context:
space:
mode:
authorTorne Wuff <torne@wolfpuppy.org.uk>2011-11-06 22:44:25 +0000
committerTorne Wuff <torne@wolfpuppy.org.uk>2011-11-06 22:44:25 +0000
commit569285794b9112f0134ddad4bb886308ea4a7be6 (patch)
treece702cb07829820261a682c471133c76d11c610e /apps/codecs/libgme/emu2413.h
parentd9b7d58fa6c9ceb136bea429adf6746cc7138208 (diff)
downloadrockbox-569285794b9112f0134ddad4bb886308ea4a7be6.tar.gz
rockbox-569285794b9112f0134ddad4bb886308ea4a7be6.zip
Bulk convert all DOS line endings to UNIX.
For the git migration we want a nice clean repository with UNIX line endings. git does not use svn:eol-style, we just need the file contents to be sane. Sorry everybody. I know this messes up blame. Scumbag *NIX developer says migrating to git will make line ending issues go away; commits giant change to svn which changes line endings anyway. :) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30924 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libgme/emu2413.h')
-rw-r--r--apps/codecs/libgme/emu2413.h328
1 files changed, 164 insertions, 164 deletions
diff --git a/apps/codecs/libgme/emu2413.h b/apps/codecs/libgme/emu2413.h
index 6a19b102a1..254f042957 100644
--- a/apps/codecs/libgme/emu2413.h
+++ b/apps/codecs/libgme/emu2413.h
@@ -1,164 +1,164 @@
1#ifndef _EMU2413_H_ 1#ifndef _EMU2413_H_
2#define _EMU2413_H_ 2#define _EMU2413_H_
3 3
4#include "blargg_common.h" 4#include "blargg_common.h"
5#include "emutypes.h" 5#include "emutypes.h"
6 6
7#ifdef EMU2413_DLL_EXPORTS 7#ifdef EMU2413_DLL_EXPORTS
8 #define EMU2413_API __declspec(dllexport) 8 #define EMU2413_API __declspec(dllexport)
9#elif defined(EMU2413_DLL_IMPORTS) 9#elif defined(EMU2413_DLL_IMPORTS)
10 #define EMU2413_API __declspec(dllimport) 10 #define EMU2413_API __declspec(dllimport)
11#else 11#else
12 #define EMU2413_API 12 #define EMU2413_API
13#endif 13#endif
14 14
15#ifdef __cplusplus 15#ifdef __cplusplus
16extern "C" { 16extern "C" {
17#endif 17#endif
18 18
19#define AUDIO_MONO_BUFFER_SIZE 1024 19#define AUDIO_MONO_BUFFER_SIZE 1024
20 20
21#define PI 3.14159265358979323846 21#define PI 3.14159265358979323846
22 22
23enum OPLL_TONE_ENUM {OPLL_2413_TONE=0, OPLL_VRC7_TONE=1, OPLL_281B_TONE=2} ; 23enum OPLL_TONE_ENUM {OPLL_2413_TONE=0, OPLL_VRC7_TONE=1, OPLL_281B_TONE=2} ;
24 24
25/* voice data */ 25/* voice data */
26typedef struct __OPLL_PATCH { 26typedef struct __OPLL_PATCH {
27 e_uint32 TL,FB,EG,ML,AR,DR,SL,RR,KR,KL,AM,PM,WF ; 27 e_uint32 TL,FB,EG,ML,AR,DR,SL,RR,KR,KL,AM,PM,WF ;
28} OPLL_PATCH ; 28} OPLL_PATCH ;
29 29
30/* slot */ 30/* slot */
31typedef struct __OPLL_SLOT { 31typedef struct __OPLL_SLOT {
32 32
33 OPLL_PATCH *patch; 33 OPLL_PATCH *patch;
34 34
35 e_int32 type ; /* 0 : modulator 1 : carrier */ 35 e_int32 type ; /* 0 : modulator 1 : carrier */
36 36
37 /* OUTPUT */ 37 /* OUTPUT */
38 e_int32 feedback ; 38 e_int32 feedback ;
39 e_int32 output[2] ; /* Output value of slot */ 39 e_int32 output[2] ; /* Output value of slot */
40 40
41 /* for Phase Generator (PG) */ 41 /* for Phase Generator (PG) */
42 e_uint16 *sintbl ; /* Wavetable */ 42 e_uint16 *sintbl ; /* Wavetable */
43 e_uint32 phase ; /* Phase */ 43 e_uint32 phase ; /* Phase */
44 e_uint32 dphase ; /* Phase increment amount */ 44 e_uint32 dphase ; /* Phase increment amount */
45 e_uint32 pgout ; /* output */ 45 e_uint32 pgout ; /* output */
46 46
47 /* for Envelope Generator (EG) */ 47 /* for Envelope Generator (EG) */
48 e_int32 fnum ; /* F-Number */ 48 e_int32 fnum ; /* F-Number */
49 e_int32 block ; /* Block */ 49 e_int32 block ; /* Block */
50 e_int32 volume ; /* Current volume */ 50 e_int32 volume ; /* Current volume */
51 e_int32 sustine ; /* Sustine 1 = ON, 0 = OFF */ 51 e_int32 sustine ; /* Sustine 1 = ON, 0 = OFF */
52 e_uint32 tll ; /* Total Level + Key scale level*/ 52 e_uint32 tll ; /* Total Level + Key scale level*/
53 e_uint32 rks ; /* Key scale offset (Rks) */ 53 e_uint32 rks ; /* Key scale offset (Rks) */
54 e_int32 eg_mode ; /* Current state */ 54 e_int32 eg_mode ; /* Current state */
55 e_uint32 eg_phase ; /* Phase */ 55 e_uint32 eg_phase ; /* Phase */
56 e_uint32 eg_dphase ; /* Phase increment amount */ 56 e_uint32 eg_dphase ; /* Phase increment amount */
57 e_uint32 egout ; /* output */ 57 e_uint32 egout ; /* output */
58 58
59} OPLL_SLOT ; 59} OPLL_SLOT ;
60 60
61/* Mask */ 61/* Mask */
62#define OPLL_MASK_CH(x) (1<<(x)) 62#define OPLL_MASK_CH(x) (1<<(x))
63#define OPLL_MASK_HH (1<<(9)) 63#define OPLL_MASK_HH (1<<(9))
64#define OPLL_MASK_CYM (1<<(10)) 64#define OPLL_MASK_CYM (1<<(10))
65#define OPLL_MASK_TOM (1<<(11)) 65#define OPLL_MASK_TOM (1<<(11))
66#define OPLL_MASK_SD (1<<(12)) 66#define OPLL_MASK_SD (1<<(12))
67#define OPLL_MASK_BD (1<<(13)) 67#define OPLL_MASK_BD (1<<(13))
68#define OPLL_MASK_RHYTHM ( OPLL_MASK_HH | OPLL_MASK_CYM | OPLL_MASK_TOM | OPLL_MASK_SD | OPLL_MASK_BD ) 68#define OPLL_MASK_RHYTHM ( OPLL_MASK_HH | OPLL_MASK_CYM | OPLL_MASK_TOM | OPLL_MASK_SD | OPLL_MASK_BD )
69 69
70/* opll */ 70/* opll */
71typedef struct __OPLL { 71typedef struct __OPLL {
72 72
73 e_uint32 adr ; 73 e_uint32 adr ;
74 e_int32 out ; 74 e_int32 out ;
75 75
76#ifndef EMU2413_COMPACTION 76#ifndef EMU2413_COMPACTION
77 e_uint32 realstep ; 77 e_uint32 realstep ;
78 e_uint32 oplltime ; 78 e_uint32 oplltime ;
79 e_uint32 opllstep ; 79 e_uint32 opllstep ;
80 e_int32 prev, next ; 80 e_int32 prev, next ;
81 e_int32 sprev[2],snext[2]; 81 e_int32 sprev[2],snext[2];
82 e_uint32 pan[16]; 82 e_uint32 pan[16];
83#endif 83#endif
84 84
85 /* Register */ 85 /* Register */
86 e_uint8 reg[0x40] ; 86 e_uint8 reg[0x40] ;
87 e_int32 slot_on_flag[18] ; 87 e_int32 slot_on_flag[18] ;
88 88
89 /* Pitch Modulator */ 89 /* Pitch Modulator */
90 e_uint32 pm_phase ; 90 e_uint32 pm_phase ;
91 e_int32 lfo_pm ; 91 e_int32 lfo_pm ;
92 92
93 /* Amp Modulator */ 93 /* Amp Modulator */
94 e_int32 am_phase ; 94 e_int32 am_phase ;
95 e_int32 lfo_am ; 95 e_int32 lfo_am ;
96 96
97 e_uint32 quality; 97 e_uint32 quality;
98 98
99 /* Noise Generator */ 99 /* Noise Generator */
100 e_uint32 noise_seed ; 100 e_uint32 noise_seed ;
101 101
102 /* Channel Data */ 102 /* Channel Data */
103 e_int32 patch_number[9]; 103 e_int32 patch_number[9];
104 e_int32 key_status[9] ; 104 e_int32 key_status[9] ;
105 105
106 /* Slot */ 106 /* Slot */
107 OPLL_SLOT slot[18] ; 107 OPLL_SLOT slot[18] ;
108 108
109 /* Voice Data */ 109 /* Voice Data */
110 OPLL_PATCH patch[19*2] ; 110 OPLL_PATCH patch[19*2] ;
111 e_int32 patch_update[2] ; /* flag for check patch update */ 111 e_int32 patch_update[2] ; /* flag for check patch update */
112 112
113 e_uint32 mask ; 113 e_uint32 mask ;
114 e_uint32 current_mask; 114 e_uint32 current_mask;
115 e_uint32 status; 115 e_uint32 status;
116 116
117 e_uint32 internal_mute; 117 e_uint32 internal_mute;
118 e_int16 buffer[AUDIO_MONO_BUFFER_SIZE]; 118 e_int16 buffer[AUDIO_MONO_BUFFER_SIZE];
119} OPLL ; 119} OPLL ;
120 120
121/* Create Object */ 121/* Create Object */
122EMU2413_API void OPLL_new(OPLL *, e_uint32 clk, e_uint32 rate) ; 122EMU2413_API void OPLL_new(OPLL *, e_uint32 clk, e_uint32 rate) ;
123EMU2413_API void OPLL_delete(OPLL *) ; 123EMU2413_API void OPLL_delete(OPLL *) ;
124 124
125/* Setup */ 125/* Setup */
126EMU2413_API void OPLL_reset(OPLL *) ; 126EMU2413_API void OPLL_reset(OPLL *) ;
127EMU2413_API void OPLL_reset_patch(OPLL *, e_int32) ; 127EMU2413_API void OPLL_reset_patch(OPLL *, e_int32) ;
128EMU2413_API void OPLL_set_rate(OPLL *opll, e_uint32 r) ; 128EMU2413_API void OPLL_set_rate(OPLL *opll, e_uint32 r) ;
129EMU2413_API void OPLL_set_quality(OPLL *opll, e_uint32 q) ; 129EMU2413_API void OPLL_set_quality(OPLL *opll, e_uint32 q) ;
130EMU2413_API void OPLL_set_pan(OPLL *, e_uint32 ch, e_uint32 pan); 130EMU2413_API void OPLL_set_pan(OPLL *, e_uint32 ch, e_uint32 pan);
131EMU2413_API void OPLL_set_internal_mute(OPLL *, e_uint32 mute); 131EMU2413_API void OPLL_set_internal_mute(OPLL *, e_uint32 mute);
132EMU2413_API e_uint32 OPLL_is_internal_muted(OPLL *); 132EMU2413_API e_uint32 OPLL_is_internal_muted(OPLL *);
133 133
134/* Port/Register access */ 134/* Port/Register access */
135EMU2413_API void OPLL_writeIO(OPLL *, e_uint32 reg, e_uint32 val); 135EMU2413_API void OPLL_writeIO(OPLL *, e_uint32 reg, e_uint32 val);
136EMU2413_API void OPLL_writeReg(OPLL *, e_uint32 reg, e_uint32 val); 136EMU2413_API void OPLL_writeReg(OPLL *, e_uint32 reg, e_uint32 val);
137EMU2413_API e_uint32 OPLL_read(OPLL *, e_uint32 port); 137EMU2413_API e_uint32 OPLL_read(OPLL *, e_uint32 port);
138 138
139/* Synthsize */ 139/* Synthsize */
140EMU2413_API e_int16 OPLL_calc(OPLL *) EMU2413_CALC_ICODE; 140EMU2413_API e_int16 OPLL_calc(OPLL *) EMU2413_CALC_ICODE;
141EMU2413_API void OPLL_calc_stereo(OPLL *, e_int32 out[2]) ; 141EMU2413_API void OPLL_calc_stereo(OPLL *, e_int32 out[2]) ;
142EMU2413_API e_int16 *OPLL_update_buffer(OPLL *, e_uint32 length) ; 142EMU2413_API e_int16 *OPLL_update_buffer(OPLL *, e_uint32 length) ;
143 143
144/* Misc */ 144/* Misc */
145EMU2413_API void OPLL_setPatch(OPLL *, const e_uint8 *dump) ; 145EMU2413_API void OPLL_setPatch(OPLL *, const e_uint8 *dump) ;
146EMU2413_API void OPLL_copyPatch(OPLL *, e_int32, OPLL_PATCH *) ; 146EMU2413_API void OPLL_copyPatch(OPLL *, e_int32, OPLL_PATCH *) ;
147EMU2413_API void OPLL_forceRefresh(OPLL *) ; 147EMU2413_API void OPLL_forceRefresh(OPLL *) ;
148/* Utility */ 148/* Utility */
149EMU2413_API void OPLL_dump2patch(const e_uint8 *dump, OPLL_PATCH *patch) ; 149EMU2413_API void OPLL_dump2patch(const e_uint8 *dump, OPLL_PATCH *patch) ;
150EMU2413_API void OPLL_patch2dump(const OPLL_PATCH *patch, e_uint8 *dump) ; 150EMU2413_API void OPLL_patch2dump(const OPLL_PATCH *patch, e_uint8 *dump) ;
151EMU2413_API void OPLL_getDefaultPatch(e_int32 type, e_int32 num, OPLL_PATCH *) ; 151EMU2413_API void OPLL_getDefaultPatch(e_int32 type, e_int32 num, OPLL_PATCH *) ;
152 152
153/* Channel Mask */ 153/* Channel Mask */
154EMU2413_API e_uint32 OPLL_setMask(OPLL *, e_uint32 mask) ; 154EMU2413_API e_uint32 OPLL_setMask(OPLL *, e_uint32 mask) ;
155EMU2413_API e_uint32 OPLL_toggleMask(OPLL *, e_uint32 mask) ; 155EMU2413_API e_uint32 OPLL_toggleMask(OPLL *, e_uint32 mask) ;
156 156
157#define dump2patch OPLL_dump2patch 157#define dump2patch OPLL_dump2patch
158 158
159#ifdef __cplusplus 159#ifdef __cplusplus
160} 160}
161#endif 161#endif
162 162
163#endif 163#endif
164 164