summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2011-08-11 19:04:28 +0000
committerBertrik Sikken <bertrik@sikken.nl>2011-08-11 19:04:28 +0000
commitb1279498609808cf65a7054ae7085b4885a33e66 (patch)
tree65b811724afd1237bbaddf16d503134d1048196f
parent39e4987ea5c2326249583b53afcd9038d8209ba9 (diff)
downloadrockbox-b1279498609808cf65a7054ae7085b4885a33e66.tar.gz
rockbox-b1279498609808cf65a7054ae7085b4885a33e66.zip
libgme: make local functions static where possible
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30280 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs/libgme/ay_apu.c2
-rw-r--r--apps/codecs/libgme/ay_emu.c18
-rw-r--r--apps/codecs/libgme/emu2413.c4
-rw-r--r--apps/codecs/libgme/emu8950.c12
-rw-r--r--apps/codecs/libgme/emuadpcm.c2
-rw-r--r--apps/codecs/libgme/gb_apu.c18
-rw-r--r--apps/codecs/libgme/gb_cpu.c2
-rw-r--r--apps/codecs/libgme/gb_oscs.c6
-rw-r--r--apps/codecs/libgme/gbs_emu.c16
-rw-r--r--apps/codecs/libgme/hes_emu.c4
-rw-r--r--apps/codecs/libgme/kss_emu.c18
-rw-r--r--apps/codecs/libgme/nes_apu.c2
-rw-r--r--apps/codecs/libgme/nes_cpu.c2
-rw-r--r--apps/codecs/libgme/nes_oscs.c6
-rw-r--r--apps/codecs/libgme/nes_vrc6_apu.c4
-rw-r--r--apps/codecs/libgme/nsf_emu.c26
-rw-r--r--apps/codecs/libgme/opl_apu.h1
-rw-r--r--apps/codecs/libgme/resampler.c14
-rw-r--r--apps/codecs/libgme/sgc_emu.c14
-rw-r--r--apps/codecs/libgme/sms_apu.c2
-rw-r--r--apps/codecs/libgme/vgm_emu.c28
-rw-r--r--apps/codecs/libgme/ym2612_emu.c40
-rw-r--r--apps/codecs/libgme/z80_cpu.c2
-rw-r--r--apps/metadata/ay.c2
-rw-r--r--apps/metadata/gbs.c2
-rw-r--r--apps/metadata/kss.c2
-rw-r--r--apps/metadata/sgc.c2
27 files changed, 128 insertions, 123 deletions
diff --git a/apps/codecs/libgme/ay_apu.c b/apps/codecs/libgme/ay_apu.c
index 8906c987c1..c84e92d43d 100644
--- a/apps/codecs/libgme/ay_apu.c
+++ b/apps/codecs/libgme/ay_apu.c
@@ -67,7 +67,7 @@ static byte const modes [8] =
67 MODE( 0,1, 0,0, 0,0 ), 67 MODE( 0,1, 0,0, 0,0 ),
68}; 68};
69 69
70void set_output( struct Ay_Apu* this, struct Blip_Buffer* b ) 70static void set_output( struct Ay_Apu* this, struct Blip_Buffer* b )
71{ 71{
72 int i; 72 int i;
73 for ( i = 0; i < ay_osc_count; ++i ) 73 for ( i = 0; i < ay_osc_count; ++i )
diff --git a/apps/codecs/libgme/ay_emu.c b/apps/codecs/libgme/ay_emu.c
index 06946a9766..b537883a6d 100644
--- a/apps/codecs/libgme/ay_emu.c
+++ b/apps/codecs/libgme/ay_emu.c
@@ -35,7 +35,7 @@ int const spectrum_period = 70908;
35 35
36int const cpc_clock = 2000000; 36int const cpc_clock = 2000000;
37 37
38void clear_track_vars( struct Ay_Emu *this ) 38static void clear_track_vars( struct Ay_Emu *this )
39{ 39{
40 this->current_track = -1; 40 this->current_track = -1;
41 this->out_time = 0; 41 this->out_time = 0;
@@ -128,7 +128,7 @@ long Track_get_length( struct Ay_Emu* this, int n )
128 128
129// Setup 129// Setup
130 130
131void change_clock_rate( struct Ay_Emu *this, long rate ) 131static void change_clock_rate( struct Ay_Emu *this, long rate )
132{ 132{
133 this->clock_rate_ = rate; 133 this->clock_rate_ = rate;
134 Buffer_clock_rate( &this->stereo_buf, rate ); 134 Buffer_clock_rate( &this->stereo_buf, rate );
@@ -160,7 +160,7 @@ blargg_err_t Ay_load_mem( struct Ay_Emu *this, byte const in [], int size )
160 return 0; 160 return 0;
161} 161}
162 162
163void set_beeper_output( struct Ay_Emu *this, struct Blip_Buffer* b ) 163static void set_beeper_output( struct Ay_Emu *this, struct Blip_Buffer* b )
164{ 164{
165 this->beeper_output = b; 165 this->beeper_output = b;
166 if ( b && !this->cpc_mode ) 166 if ( b && !this->cpc_mode )
@@ -169,7 +169,7 @@ void set_beeper_output( struct Ay_Emu *this, struct Blip_Buffer* b )
169 disable_beeper( this ); 169 disable_beeper( this );
170} 170}
171 171
172void set_voice( struct Ay_Emu *this, int i, struct Blip_Buffer* center ) 172static void set_voice( struct Ay_Emu *this, int i, struct Blip_Buffer* center )
173{ 173{
174 if ( i >= ay_osc_count ) 174 if ( i >= ay_osc_count )
175 set_beeper_output( this, center ); 175 set_beeper_output( this, center );
@@ -177,7 +177,7 @@ void set_voice( struct Ay_Emu *this, int i, struct Blip_Buffer* center )
177 Ay_apu_set_output( &this->apu, i, center ); 177 Ay_apu_set_output( &this->apu, i, center );
178} 178}
179 179
180blargg_err_t run_clocks( struct Ay_Emu *this, blip_time_t* duration, int msec ) 180static blargg_err_t run_clocks( struct Ay_Emu *this, blip_time_t* duration, int msec )
181{ 181{
182#if defined(ROCKBOX) 182#if defined(ROCKBOX)
183 (void) msec; 183 (void) msec;
@@ -521,7 +521,7 @@ blargg_err_t Ay_start_track( struct Ay_Emu *this, int track )
521 521
522// Tell/Seek 522// Tell/Seek
523 523
524blargg_long msec_to_samples( blargg_long msec, long sample_rate ) 524static blargg_long msec_to_samples( blargg_long msec, long sample_rate )
525{ 525{
526 blargg_long sec = msec / 1000; 526 blargg_long sec = msec / 1000;
527 msec -= sec * 1000; 527 msec -= sec * 1000;
@@ -544,7 +544,7 @@ blargg_err_t Track_seek( struct Ay_Emu *this, long msec )
544} 544}
545 545
546blargg_err_t play_( struct Ay_Emu *this, long count, sample_t* out ) ICODE_ATTR; 546blargg_err_t play_( struct Ay_Emu *this, long count, sample_t* out ) ICODE_ATTR;
547blargg_err_t skip_( struct Ay_Emu *this, long count ) 547static blargg_err_t skip_( struct Ay_Emu *this, long count )
548{ 548{
549 // for long skip, mute sound 549 // for long skip, mute sound
550 const long threshold = 30000; 550 const long threshold = 30000;
@@ -620,7 +620,7 @@ static int int_log( blargg_long x, int step, int unit )
620 return ((unit - fraction) + (fraction >> 1)) >> shift; 620 return ((unit - fraction) + (fraction >> 1)) >> shift;
621} 621}
622 622
623void handle_fade( struct Ay_Emu *this, long out_count, sample_t* out ) 623static void handle_fade( struct Ay_Emu *this, long out_count, sample_t* out )
624{ 624{
625 int i; 625 int i;
626 for ( i = 0; i < out_count; i += fade_block_size ) 626 for ( i = 0; i < out_count; i += fade_block_size )
@@ -644,7 +644,7 @@ void handle_fade( struct Ay_Emu *this, long out_count, sample_t* out )
644 644
645// Silence detection 645// Silence detection
646 646
647void emu_play( struct Ay_Emu *this, long count, sample_t* out ) 647static void emu_play( struct Ay_Emu *this, long count, sample_t* out )
648{ 648{
649 check( current_track_ >= 0 ); 649 check( current_track_ >= 0 );
650 this->emu_time += count; 650 this->emu_time += count;
diff --git a/apps/codecs/libgme/emu2413.c b/apps/codecs/libgme/emu2413.c
index 5def504cbd..e7acebc63f 100644
--- a/apps/codecs/libgme/emu2413.c
+++ b/apps/codecs/libgme/emu2413.c
@@ -1495,7 +1495,7 @@ OPLL_is_internal_muted(OPLL * opll)
1495 return opll->internal_mute; 1495 return opll->internal_mute;
1496} 1496}
1497 1497
1498e_uint32 1498static e_uint32
1499check_mute_helper(OPLL * opll) 1499check_mute_helper(OPLL * opll)
1500{ 1500{
1501 for (int i = 0; i < 6; i++) { 1501 for (int i = 0; i < 6; i++) {
@@ -1524,7 +1524,7 @@ check_mute_helper(OPLL * opll)
1524 return 1; /* nothing is playing, then mute */ 1524 return 1; /* nothing is playing, then mute */
1525} 1525}
1526 1526
1527void 1527static void
1528check_mute(OPLL * opll) 1528check_mute(OPLL * opll)
1529{ 1529{
1530 OPLL_set_internal_mute (opll, check_mute_helper (opll)); 1530 OPLL_set_internal_mute (opll, check_mute_helper (opll));
diff --git a/apps/codecs/libgme/emu8950.c b/apps/codecs/libgme/emu8950.c
index 2198239004..0e9c4864eb 100644
--- a/apps/codecs/libgme/emu8950.c
+++ b/apps/codecs/libgme/emu8950.c
@@ -133,7 +133,7 @@ static void makeSinTable(void)
133 sintable[PG_WIDTH/2 + i] = 2*DB_MUTE + sintable[i]; 133 sintable[PG_WIDTH/2 + i] = 2*DB_MUTE + sintable[i];
134} 134}
135 135
136void makeDphaseNoiseTable(int sampleRate, int clockRate) 136static void makeDphaseNoiseTable(int sampleRate, int clockRate)
137{ 137{
138 for (int i=0; i<1024; i++) 138 for (int i=0; i<1024; i++)
139 for (int j=0; j<8; j++) 139 for (int j=0; j<8; j++)
@@ -141,7 +141,7 @@ void makeDphaseNoiseTable(int sampleRate, int clockRate)
141} 141}
142 142
143// Table for Pitch Modulator 143// Table for Pitch Modulator
144void makePmTable(void) 144static void makePmTable(void)
145{ 145{
146 int i; 146 int i;
147 for (i=0; i < PM_PG_WIDTH; i++) 147 for (i=0; i < PM_PG_WIDTH; i++)
@@ -159,7 +159,7 @@ void makePmTable(void)
159} 159}
160 160
161// Table for Amp Modulator 161// Table for Amp Modulator
162void makeAmTable(void) 162static void makeAmTable(void)
163{ 163{
164 int i; 164 int i;
165 for (i=0; i<AM_PG_WIDTH; i++) 165 for (i=0; i<AM_PG_WIDTH; i++)
@@ -549,7 +549,7 @@ static inline void keyOff_TOM(struct Y8950* this){ slotOff(&this->ch[8].mod); }
549static inline void keyOff_CYM(struct Y8950* this){ slotOff(&this->ch[8].car); } 549static inline void keyOff_CYM(struct Y8950* this){ slotOff(&this->ch[8].car); }
550 550
551// Change Rhythm Mode 551// Change Rhythm Mode
552inline void setRythmMode(struct Y8950* this, int data) 552static inline void setRythmMode(struct Y8950* this, int data)
553{ 553{
554 bool newMode = (data & 32) != 0; 554 bool newMode = (data & 32) != 0;
555 if (this->rythm_mode != newMode) { 555 if (this->rythm_mode != newMode) {
@@ -822,7 +822,7 @@ static inline int calcSample(struct Y8950* this, int channelMask)
822 return (mix*this->maxVolume) >> (DB2LIN_AMP_BITS - 1); 822 return (mix*this->maxVolume) >> (DB2LIN_AMP_BITS - 1);
823} 823}
824 824
825bool checkMuteHelper(struct Y8950* this) 825static bool checkMuteHelper(struct Y8950* this)
826{ 826{
827 int i; 827 int i;
828 struct OPLChannel *ch = this->ch; 828 struct OPLChannel *ch = this->ch;
@@ -844,7 +844,7 @@ bool checkMuteHelper(struct Y8950* this)
844 return ADPCM_muted(&this->adpcm); 844 return ADPCM_muted(&this->adpcm);
845} 845}
846 846
847void checkMute(struct Y8950* this) 847static void checkMute(struct Y8950* this)
848{ 848{
849 bool mute = checkMuteHelper(this); 849 bool mute = checkMuteHelper(this);
850 //PRT_DEBUG("Y8950: muted " << mute); 850 //PRT_DEBUG("Y8950: muted " << mute);
diff --git a/apps/codecs/libgme/emuadpcm.c b/apps/codecs/libgme/emuadpcm.c
index 1f2d5aefa5..d85aba3488 100644
--- a/apps/codecs/libgme/emuadpcm.c
+++ b/apps/codecs/libgme/emuadpcm.c
@@ -54,7 +54,7 @@ const int DECODE_MIN = -32768;
54// // 54// //
55//**************************************************// 55//**************************************************//
56 56
57int CLAP(int min, int x, int max) 57static int CLAP(int min, int x, int max)
58{ 58{
59 return (x < min) ? min : ((max < x) ? max : x); 59 return (x < min) ? min : ((max < x) ? max : x);
60} 60}
diff --git a/apps/codecs/libgme/gb_apu.c b/apps/codecs/libgme/gb_apu.c
index f6da1b034a..44dd6c8e6c 100644
--- a/apps/codecs/libgme/gb_apu.c
+++ b/apps/codecs/libgme/gb_apu.c
@@ -24,7 +24,7 @@ int const wave_ram = 0xFF30;
24 24
25int const power_mask = 0x80; 25int const power_mask = 0x80;
26 26
27inline int calc_output( struct Gb_Apu* this, int osc ) 27static inline int calc_output( struct Gb_Apu* this, int osc )
28{ 28{
29 int bits = this->regs [stereo_reg - io_addr] >> osc; 29 int bits = this->regs [stereo_reg - io_addr] >> osc;
30 return (bits >> 3 & 2) | (bits & 1); 30 return (bits >> 3 & 2) | (bits & 1);
@@ -49,13 +49,13 @@ void Apu_set_output( struct Gb_Apu* this, int i, struct Blip_Buffer* center, str
49 o->output = o->outputs [calc_output( this, i )]; 49 o->output = o->outputs [calc_output( this, i )];
50} 50}
51 51
52void synth_volume( struct Gb_Apu* this, int iv ) 52static void synth_volume( struct Gb_Apu* this, int iv )
53{ 53{
54 int v = (this->volume_ * 6) / 10 / osc_count / 15 /*steps*/ / 8 /*master vol range*/ * iv; 54 int v = (this->volume_ * 6) / 10 / osc_count / 15 /*steps*/ / 8 /*master vol range*/ * iv;
55 Synth_volume( &this->synth, v ); 55 Synth_volume( &this->synth, v );
56} 56}
57 57
58void apply_volume( struct Gb_Apu* this ) 58static void apply_volume( struct Gb_Apu* this )
59{ 59{
60 // TODO: Doesn't handle differing left and right volumes (panning). 60 // TODO: Doesn't handle differing left and right volumes (panning).
61 // Not worth the complexity. 61 // Not worth the complexity.
@@ -76,7 +76,7 @@ void Apu_volume( struct Gb_Apu* this, int v )
76 } 76 }
77} 77}
78 78
79void reset_regs( struct Gb_Apu* this ) 79static void reset_regs( struct Gb_Apu* this )
80{ 80{
81 int i; 81 int i;
82 for ( i = 0; i < 0x20; i++ ) 82 for ( i = 0; i < 0x20; i++ )
@@ -90,7 +90,7 @@ void reset_regs( struct Gb_Apu* this )
90 apply_volume( this ); 90 apply_volume( this );
91} 91}
92 92
93void reset_lengths( struct Gb_Apu* this ) 93static void reset_lengths( struct Gb_Apu* this )
94{ 94{
95 this->square1.osc.length_ctr = 64; 95 this->square1.osc.length_ctr = 64;
96 this->square2.osc.length_ctr = 64; 96 this->square2.osc.length_ctr = 64;
@@ -189,7 +189,7 @@ void Apu_init( struct Gb_Apu* this )
189 Apu_reset( this, mode_cgb, false ); 189 Apu_reset( this, mode_cgb, false );
190} 190}
191 191
192void run_until_( struct Gb_Apu* this, blip_time_t end_time ) 192static void run_until_( struct Gb_Apu* this, blip_time_t end_time )
193{ 193{
194 if ( !this->frame_period ) 194 if ( !this->frame_period )
195 this->frame_time += end_time - this->last_time; 195 this->frame_time += end_time - this->last_time;
@@ -238,7 +238,7 @@ void run_until_( struct Gb_Apu* this, blip_time_t end_time )
238 } 238 }
239} 239}
240 240
241inline void run_until( struct Gb_Apu* this, blip_time_t time ) 241static inline void run_until( struct Gb_Apu* this, blip_time_t time )
242{ 242{
243 require( time >= this->last_time ); // end_time must not be before previous time 243 require( time >= this->last_time ); // end_time must not be before previous time
244 if ( time > this->last_time ) 244 if ( time > this->last_time )
@@ -261,7 +261,7 @@ void Apu_end_frame( struct Gb_Apu* this, blip_time_t end_time )
261 assert( this->last_time >= 0 ); 261 assert( this->last_time >= 0 );
262} 262}
263 263
264void silence_osc( struct Gb_Apu* this, struct Gb_Osc* o ) 264static void silence_osc( struct Gb_Apu* this, struct Gb_Osc* o )
265{ 265{
266 int delta = -o->last_amp; 266 int delta = -o->last_amp;
267 if ( this->reduce_clicks_ ) 267 if ( this->reduce_clicks_ )
@@ -278,7 +278,7 @@ void silence_osc( struct Gb_Apu* this, struct Gb_Osc* o )
278 } 278 }
279} 279}
280 280
281void apply_stereo( struct Gb_Apu* this ) 281static void apply_stereo( struct Gb_Apu* this )
282{ 282{
283 int i; 283 int i;
284 for ( i = osc_count; --i >= 0; ) 284 for ( i = osc_count; --i >= 0; )
diff --git a/apps/codecs/libgme/gb_cpu.c b/apps/codecs/libgme/gb_cpu.c
index ae19cc06c1..4b2df63a17 100644
--- a/apps/codecs/libgme/gb_cpu.c
+++ b/apps/codecs/libgme/gb_cpu.c
@@ -17,7 +17,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
17 17
18#include "blargg_source.h" 18#include "blargg_source.h"
19 19
20inline void set_code_page( struct Gb_Cpu* this, int i, void* p ) 20static inline void set_code_page( struct Gb_Cpu* this, int i, void* p )
21{ 21{
22 byte* p2 = STATIC_CAST(byte*,p) - GB_CPU_OFFSET( i * page_size ); 22 byte* p2 = STATIC_CAST(byte*,p) - GB_CPU_OFFSET( i * page_size );
23 this->cpu_state_.code_map [i] = p2; 23 this->cpu_state_.code_map [i] = p2;
diff --git a/apps/codecs/libgme/gb_oscs.c b/apps/codecs/libgme/gb_oscs.c
index 6d607d7f5a..5c9b816d21 100644
--- a/apps/codecs/libgme/gb_oscs.c
+++ b/apps/codecs/libgme/gb_oscs.c
@@ -135,7 +135,7 @@ int wave_access( struct Gb_Wave* this, int addr )
135 135
136// write_register 136// write_register
137 137
138int write_trig( struct Gb_Osc* this, int frame_phase, int max_len, int old_data ) 138static int write_trig( struct Gb_Osc* this, int frame_phase, int max_len, int old_data )
139{ 139{
140 int data = this->regs [4]; 140 int data = this->regs [4];
141 141
@@ -162,7 +162,7 @@ int write_trig( struct Gb_Osc* this, int frame_phase, int max_len, int old_data
162 return data & trigger_mask; 162 return data & trigger_mask;
163} 163}
164 164
165inline void Noise_zombie_volume( struct Gb_Noise* this, int old, int data ) 165static inline void Noise_zombie_volume( struct Gb_Noise* this, int old, int data )
166{ 166{
167 int v = this->volume; 167 int v = this->volume;
168 if ( this->osc.mode == mode_agb || cgb_05 ) 168 if ( this->osc.mode == mode_agb || cgb_05 )
@@ -198,7 +198,7 @@ inline void Noise_zombie_volume( struct Gb_Noise* this, int old, int data )
198 this->volume = v & 0x0F; 198 this->volume = v & 0x0F;
199} 199}
200 200
201inline void Square_zombie_volume( struct Gb_Square* this, int old, int data ) 201static inline void Square_zombie_volume( struct Gb_Square* this, int old, int data )
202{ 202{
203 int v = this->volume; 203 int v = this->volume;
204 if ( this->osc.mode == mode_agb || cgb_05 ) 204 if ( this->osc.mode == mode_agb || cgb_05 )
diff --git a/apps/codecs/libgme/gbs_emu.c b/apps/codecs/libgme/gbs_emu.c
index a0e7f184c7..d0780fc0b9 100644
--- a/apps/codecs/libgme/gbs_emu.c
+++ b/apps/codecs/libgme/gbs_emu.c
@@ -28,7 +28,7 @@ int const silence_threshold = 0x10;
28long const fade_block_size = 512; 28long const fade_block_size = 512;
29int const fade_shift = 8; // fade ends with gain at 1.0 / (1 << fade_shift) 29int const fade_shift = 8; // fade ends with gain at 1.0 / (1 << fade_shift)
30 30
31void clear_track_vars( struct Gbs_Emu* this ) 31static void clear_track_vars( struct Gbs_Emu* this )
32{ 32{
33 this->current_track_ = -1; 33 this->current_track_ = -1;
34 this->out_time = 0; 34 this->out_time = 0;
@@ -169,7 +169,7 @@ void Jsr_then_stop( struct Gbs_Emu* this, byte const addr [] )
169 Write_mem( this, --this->cpu.r.sp, idle_addr ); 169 Write_mem( this, --this->cpu.r.sp, idle_addr );
170} 170}
171 171
172blargg_err_t Run_until( struct Gbs_Emu* this, int end ) 172static blargg_err_t Run_until( struct Gbs_Emu* this, int end )
173{ 173{
174 this->end_time = end; 174 this->end_time = end;
175 Cpu_set_time( &this->cpu, Cpu_time( &this->cpu ) - end ); 175 Cpu_set_time( &this->cpu, Cpu_time( &this->cpu ) - end );
@@ -208,7 +208,7 @@ blargg_err_t Run_until( struct Gbs_Emu* this, int end )
208 return 0; 208 return 0;
209} 209}
210 210
211blargg_err_t End_frame( struct Gbs_Emu* this, int end ) 211static blargg_err_t End_frame( struct Gbs_Emu* this, int end )
212{ 212{
213 RETURN_ERR( Run_until( this, end ) ); 213 RETURN_ERR( Run_until( this, end ) );
214 214
@@ -231,7 +231,7 @@ blargg_err_t Run_clocks( struct Gbs_Emu* this, blip_time_t duration )
231 return End_frame( this, duration ); 231 return End_frame( this, duration );
232} 232}
233 233
234blargg_err_t play_( struct Gbs_Emu* this, long count, sample_t* out ) 234static blargg_err_t play_( struct Gbs_Emu* this, long count, sample_t* out )
235{ 235{
236 long remain = count; 236 long remain = count;
237 while ( remain ) 237 while ( remain )
@@ -399,7 +399,7 @@ blargg_err_t Gbs_start_track( struct Gbs_Emu* this, int track )
399 399
400// Track 400// Track
401 401
402blargg_long msec_to_samples( blargg_long msec, long sample_rate ) 402static blargg_long msec_to_samples( blargg_long msec, long sample_rate )
403{ 403{
404 blargg_long sec = msec / 1000; 404 blargg_long sec = msec / 1000;
405 msec -= sec * 1000; 405 msec -= sec * 1000;
@@ -421,7 +421,7 @@ blargg_err_t Track_seek( struct Gbs_Emu* this, long msec )
421 return Track_skip( this, time - this->out_time ); 421 return Track_skip( this, time - this->out_time );
422} 422}
423 423
424blargg_err_t skip_( struct Gbs_Emu* this, long count ) 424static blargg_err_t skip_( struct Gbs_Emu* this, long count )
425{ 425{
426 // for long skip, mute sound 426 // for long skip, mute sound
427 const long threshold = 30000; 427 const long threshold = 30000;
@@ -496,7 +496,7 @@ static int int_log( blargg_long x, int step, int unit )
496 return ((unit - fraction) + (fraction >> 1)) >> shift; 496 return ((unit - fraction) + (fraction >> 1)) >> shift;
497} 497}
498 498
499void handle_fade( struct Gbs_Emu* this, long out_count, sample_t* out ) 499static void handle_fade( struct Gbs_Emu* this, long out_count, sample_t* out )
500{ 500{
501 int i; 501 int i;
502 for ( i = 0; i < out_count; i += fade_block_size ) 502 for ( i = 0; i < out_count; i += fade_block_size )
@@ -520,7 +520,7 @@ void handle_fade( struct Gbs_Emu* this, long out_count, sample_t* out )
520 520
521// Silence detection 521// Silence detection
522 522
523void emu_play( struct Gbs_Emu* this, long count, sample_t* out ) 523static void emu_play( struct Gbs_Emu* this, long count, sample_t* out )
524{ 524{
525 check( current_track_ >= 0 ); 525 check( current_track_ >= 0 );
526 this->emu_time += count; 526 this->emu_time += count;
diff --git a/apps/codecs/libgme/hes_emu.c b/apps/codecs/libgme/hes_emu.c
index 10ec9a2128..3ef87d9f71 100644
--- a/apps/codecs/libgme/hes_emu.c
+++ b/apps/codecs/libgme/hes_emu.c
@@ -31,7 +31,7 @@ int const fade_shift = 8; // fade ends with gain at 1.0 / (1 << fade_shift)
31 31
32const char gme_wrong_file_type [] ICONST_ATTR = "Wrong file type for this emulator"; 32const char gme_wrong_file_type [] ICONST_ATTR = "Wrong file type for this emulator";
33 33
34void clear_track_vars( struct Hes_Emu* this ) 34static void clear_track_vars( struct Hes_Emu* this )
35{ 35{
36 this->current_track_ = -1; 36 this->current_track_ = -1;
37 this->out_time = 0; 37 this->out_time = 0;
@@ -632,7 +632,7 @@ blargg_err_t Hes_start_track( struct Hes_Emu* this, int track )
632 632
633// Tell/Seek 633// Tell/Seek
634 634
635blargg_long msec_to_samples( blargg_long msec, long sample_rate ) 635static blargg_long msec_to_samples( blargg_long msec, long sample_rate )
636{ 636{
637 blargg_long sec = msec / 1000; 637 blargg_long sec = msec / 1000;
638 msec -= sec * 1000; 638 msec -= sec * 1000;
diff --git a/apps/codecs/libgme/kss_emu.c b/apps/codecs/libgme/kss_emu.c
index 102fbf926d..060a5b74b0 100644
--- a/apps/codecs/libgme/kss_emu.c
+++ b/apps/codecs/libgme/kss_emu.c
@@ -27,7 +27,7 @@ int const silence_threshold = 0x10;
27long const fade_block_size = 512; 27long const fade_block_size = 512;
28int const fade_shift = 8; // fade ends with gain at 1.0 / (1 << fade_shift) 28int const fade_shift = 8; // fade ends with gain at 1.0 / (1 << fade_shift)
29 29
30void clear_track_vars( struct Kss_Emu* this ) 30static void clear_track_vars( struct Kss_Emu* this )
31{ 31{
32 this->current_track = -1; 32 this->current_track = -1;
33 this->out_time = 0; 33 this->out_time = 0;
@@ -96,7 +96,7 @@ static blargg_err_t check_kss_header( void const* header )
96 96
97// Setup 97// Setup
98 98
99void update_gain( struct Kss_Emu* this ) 99static void update_gain( struct Kss_Emu* this )
100{ 100{
101 int g = this->gain; 101 int g = this->gain;
102 if ( msx_music_enabled( this ) || msx_audio_enabled( this ) 102 if ( msx_music_enabled( this ) || msx_audio_enabled( this )
@@ -241,7 +241,7 @@ blargg_err_t Kss_load_mem( struct Kss_Emu* this, const void* data, long size )
241 return 0; 241 return 0;
242} 242}
243 243
244void set_voice( struct Kss_Emu* this, int i, struct Blip_Buffer* center, struct Blip_Buffer* left, struct Blip_Buffer* right ) 244static void set_voice( struct Kss_Emu* this, int i, struct Blip_Buffer* center, struct Blip_Buffer* left, struct Blip_Buffer* right )
245{ 245{
246 if ( sms_psg_enabled( this ) ) // Sega Master System 246 if ( sms_psg_enabled( this ) ) // Sega Master System
247 { 247 {
@@ -279,7 +279,7 @@ void jsr( struct Kss_Emu* this, byte const addr [] )
279 this->cpu.r.pc = get_le16( addr ); 279 this->cpu.r.pc = get_le16( addr );
280} 280}
281 281
282void set_bank( struct Kss_Emu* this, int logical, int physical ) 282static void set_bank( struct Kss_Emu* this, int logical, int physical )
283{ 283{
284 int const bank_size = (16 * 1024L) >> (this->header.bank_mode >> 7 & 1); 284 int const bank_size = (16 * 1024L) >> (this->header.bank_mode >> 7 & 1);
285 285
@@ -416,7 +416,7 @@ int cpu_in( struct Kss_Emu* this, kss_time_t time, kss_addr_t addr )
416 return 0xFF; 416 return 0xFF;
417} 417}
418 418
419blargg_err_t run_clocks( struct Kss_Emu* this, blip_time_t* duration_ ) 419static blargg_err_t run_clocks( struct Kss_Emu* this, blip_time_t* duration_ )
420{ 420{
421 blip_time_t duration = *duration_; 421 blip_time_t duration = *duration_;
422 RETURN_ERR( end_frame( this, duration ) ); 422 RETURN_ERR( end_frame( this, duration ) );
@@ -623,7 +623,7 @@ blargg_err_t Kss_start_track( struct Kss_Emu* this, int track )
623 623
624// Tell/Seek 624// Tell/Seek
625 625
626blargg_long msec_to_samples( blargg_long msec, long sample_rate ) 626static blargg_long msec_to_samples( blargg_long msec, long sample_rate )
627{ 627{
628 blargg_long sec = msec / 1000; 628 blargg_long sec = msec / 1000;
629 msec -= sec * 1000; 629 msec -= sec * 1000;
@@ -646,7 +646,7 @@ blargg_err_t Track_seek( struct Kss_Emu* this, long msec )
646} 646}
647 647
648blargg_err_t play_( struct Kss_Emu* this, long count, sample_t* out ); 648blargg_err_t play_( struct Kss_Emu* this, long count, sample_t* out );
649blargg_err_t skip_( struct Kss_Emu* this, long count ) 649static blargg_err_t skip_( struct Kss_Emu* this, long count )
650{ 650{
651 // for long skip, mute sound 651 // for long skip, mute sound
652 const long threshold = 30000; 652 const long threshold = 30000;
@@ -720,7 +720,7 @@ static int int_log( blargg_long x, int step, int unit )
720 return ((unit - fraction) + (fraction >> 1)) >> shift; 720 return ((unit - fraction) + (fraction >> 1)) >> shift;
721} 721}
722 722
723void handle_fade( struct Kss_Emu *this, long out_count, sample_t* out ) 723static void handle_fade( struct Kss_Emu *this, long out_count, sample_t* out )
724{ 724{
725 int i; 725 int i;
726 for ( i = 0; i < out_count; i += fade_block_size ) 726 for ( i = 0; i < out_count; i += fade_block_size )
@@ -744,7 +744,7 @@ void handle_fade( struct Kss_Emu *this, long out_count, sample_t* out )
744 744
745// Silence detection 745// Silence detection
746 746
747void emu_play( struct Kss_Emu* this, long count, sample_t* out ) 747static void emu_play( struct Kss_Emu* this, long count, sample_t* out )
748{ 748{
749 check( current_track_ >= 0 ); 749 check( current_track_ >= 0 );
750 this->emu_time += count; 750 this->emu_time += count;
diff --git a/apps/codecs/libgme/nes_apu.c b/apps/codecs/libgme/nes_apu.c
index 2e304325c2..fae799d8d6 100644
--- a/apps/codecs/libgme/nes_apu.c
+++ b/apps/codecs/libgme/nes_apu.c
@@ -145,7 +145,7 @@ void Apu_run_until( struct Nes_Apu* this, nes_time_t end_time )
145 } 145 }
146} 146}
147 147
148void run_until_( struct Nes_Apu* this, nes_time_t end_time ) 148static void run_until_( struct Nes_Apu* this, nes_time_t end_time )
149{ 149{
150 require( end_time >= this->last_time ); 150 require( end_time >= this->last_time );
151 151
diff --git a/apps/codecs/libgme/nes_cpu.c b/apps/codecs/libgme/nes_cpu.c
index d255cf5485..20925918c2 100644
--- a/apps/codecs/libgme/nes_cpu.c
+++ b/apps/codecs/libgme/nes_cpu.c
@@ -17,7 +17,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
17 17
18#include "blargg_source.h" 18#include "blargg_source.h"
19 19
20inline void set_code_page( struct Nes_Cpu* this, int i, void const* p ) 20static inline void set_code_page( struct Nes_Cpu* this, int i, void const* p )
21{ 21{
22 byte const* p2 = STATIC_CAST(byte const*,p) - NES_CPU_OFFSET( i * page_size ); 22 byte const* p2 = STATIC_CAST(byte const*,p) - NES_CPU_OFFSET( i * page_size );
23 this->cpu_state->code_map [i] = p2; 23 this->cpu_state->code_map [i] = p2;
diff --git a/apps/codecs/libgme/nes_oscs.c b/apps/codecs/libgme/nes_oscs.c
index f04d5fa9ad..8682cc60e2 100644
--- a/apps/codecs/libgme/nes_oscs.c
+++ b/apps/codecs/libgme/nes_oscs.c
@@ -82,7 +82,7 @@ void Square_clock_sweep( struct Nes_Square* this, int negative_adjust )
82} 82}
83 83
84// TODO: clean up 84// TODO: clean up
85inline nes_time_t Square_maintain_phase( struct Nes_Square* this, nes_time_t time, nes_time_t end_time, 85static inline nes_time_t Square_maintain_phase( struct Nes_Square* this, nes_time_t time, nes_time_t end_time,
86 nes_time_t timer_period ) 86 nes_time_t timer_period )
87{ 87{
88 nes_time_t remain = end_time - time; 88 nes_time_t remain = end_time - time;
@@ -183,7 +183,7 @@ void Triangle_clock_linear_counter( struct Nes_Triangle* this )
183 osc->reg_written [3] = false; 183 osc->reg_written [3] = false;
184} 184}
185 185
186inline int Triangle_calc_amp( struct Nes_Triangle* this ) 186static inline int Triangle_calc_amp( struct Nes_Triangle* this )
187{ 187{
188 int amp = Triangle_phase_range - this->phase; 188 int amp = Triangle_phase_range - this->phase;
189 if ( amp < 0 ) 189 if ( amp < 0 )
@@ -192,7 +192,7 @@ inline int Triangle_calc_amp( struct Nes_Triangle* this )
192} 192}
193 193
194// TODO: clean up 194// TODO: clean up
195inline nes_time_t Triangle_maintain_phase( struct Nes_Triangle* this, nes_time_t time, nes_time_t end_time, 195static inline nes_time_t Triangle_maintain_phase( struct Nes_Triangle* this, nes_time_t time, nes_time_t end_time,
196 nes_time_t timer_period ) 196 nes_time_t timer_period )
197{ 197{
198 nes_time_t remain = end_time - time; 198 nes_time_t remain = end_time - time;
diff --git a/apps/codecs/libgme/nes_vrc6_apu.c b/apps/codecs/libgme/nes_vrc6_apu.c
index 25b0cc48b1..f712216424 100644
--- a/apps/codecs/libgme/nes_vrc6_apu.c
+++ b/apps/codecs/libgme/nes_vrc6_apu.c
@@ -1,4 +1,4 @@
1// Nes_Snd_Emu 0.1.8. http://www.slack.net/~ant/ 1 // Nes_Snd_Emu 0.1.8. http://www.slack.net/~ant/
2 2
3#include "nes_vrc6_apu.h" 3#include "nes_vrc6_apu.h"
4 4
@@ -51,7 +51,7 @@ void Vrc6_output( struct Nes_Vrc6_Apu* this, struct Blip_Buffer* buf )
51 51
52void run_square( struct Nes_Vrc6_Apu* this, struct Vrc6_Osc* osc, blip_time_t end_time ); 52void run_square( struct Nes_Vrc6_Apu* this, struct Vrc6_Osc* osc, blip_time_t end_time );
53void run_saw( struct Nes_Vrc6_Apu* this, blip_time_t end_time ); 53void run_saw( struct Nes_Vrc6_Apu* this, blip_time_t end_time );
54void Vrc6_run_until( struct Nes_Vrc6_Apu* this, blip_time_t time ) 54static void Vrc6_run_until( struct Nes_Vrc6_Apu* this, blip_time_t time )
55{ 55{
56 require( time >= this->last_time ); 56 require( time >= this->last_time );
57 run_square( this, &this->oscs [0], time ); 57 run_square( this, &this->oscs [0], time );
diff --git a/apps/codecs/libgme/nsf_emu.c b/apps/codecs/libgme/nsf_emu.c
index ec32ef3595..1b8d98e51a 100644
--- a/apps/codecs/libgme/nsf_emu.c
+++ b/apps/codecs/libgme/nsf_emu.c
@@ -31,7 +31,7 @@ int const fade_shift = 8; // fade ends with gain at 1.0 / (1 << fade_shift)
31int const initial_play_delay = 7; // KikiKaikai needed this to work 31int const initial_play_delay = 7; // KikiKaikai needed this to work
32int const rom_addr = 0x8000; 32int const rom_addr = 0x8000;
33 33
34void clear_track_vars( struct Nsf_Emu* this ) 34static void clear_track_vars( struct Nsf_Emu* this )
35{ 35{
36 this->current_track = -1; 36 this->current_track = -1;
37 this->out_time = 0; 37 this->out_time = 0;
@@ -82,7 +82,7 @@ void Nsf_init( struct Nsf_Emu* this )
82 82
83// Setup 83// Setup
84 84
85blargg_err_t init_sound( struct Nsf_Emu* this ) 85static blargg_err_t init_sound( struct Nsf_Emu* this )
86{ 86{
87 /* if ( header_.chip_flags & ~(fds_flag | namco_flag | vrc6_flag | fme7_flag) ) 87 /* if ( header_.chip_flags & ~(fds_flag | namco_flag | vrc6_flag | fme7_flag) )
88 warning( "Uses unsupported audio expansion hardware" ); **/ 88 warning( "Uses unsupported audio expansion hardware" ); **/
@@ -168,7 +168,7 @@ blargg_err_t init_sound( struct Nsf_Emu* this )
168} 168}
169 169
170// Header stuff 170// Header stuff
171bool valid_tag( struct header_t* this ) 171static bool valid_tag( struct header_t* this )
172{ 172{
173 return 0 == memcmp( this->tag, "NESM\x1A", 5 ); 173 return 0 == memcmp( this->tag, "NESM\x1A", 5 );
174} 174}
@@ -184,7 +184,7 @@ static double clock_rate( struct header_t* this )
184 return pal_only( this ) ? 1662607.125 : 1789772.727272727; 184 return pal_only( this ) ? 1662607.125 : 1789772.727272727;
185} 185}
186 186
187int play_period( struct header_t* this ) 187static int play_period( struct header_t* this )
188{ 188{
189 // NTSC 189 // NTSC
190 int clocks = 29780; 190 int clocks = 29780;
@@ -370,7 +370,7 @@ void map_memory( struct Nsf_Emu* this )
370 Cpu_map_code( &this->cpu, rom_addr, fdsram_size, fdsram( this ), 0 ); 370 Cpu_map_code( &this->cpu, rom_addr, fdsram_size, fdsram( this ), 0 );
371} 371}
372 372
373void set_voice( struct Nsf_Emu* this, int i, struct Blip_Buffer* buf, struct Blip_Buffer* left, struct Blip_Buffer* right) 373static void set_voice( struct Nsf_Emu* this, int i, struct Blip_Buffer* buf, struct Blip_Buffer* left, struct Blip_Buffer* right)
374{ 374{
375#if defined(ROCKBOX) 375#if defined(ROCKBOX)
376 (void) left; 376 (void) left;
@@ -500,7 +500,7 @@ inline void push_byte( struct Nsf_Emu* this, int b )
500 500
501// Jumps to routine, given pointer to address in file header. Pushes idle_addr 501// Jumps to routine, given pointer to address in file header. Pushes idle_addr
502// as return address, NOT old PC. 502// as return address, NOT old PC.
503void jsr_then_stop( struct Nsf_Emu* this, byte const addr [] ) 503static void jsr_then_stop( struct Nsf_Emu* this, byte const addr [] )
504{ 504{
505 this->cpu.r.pc = get_addr( addr ); 505 this->cpu.r.pc = get_addr( addr );
506 push_byte( this, (idle_addr - 1) >> 8 ); 506 push_byte( this, (idle_addr - 1) >> 8 );
@@ -533,7 +533,8 @@ int cpu_read( struct Nsf_Emu* this, addr_t addr )
533 return addr >> 8; 533 return addr >> 8;
534} 534}
535 535
536int unmapped_read( struct Nsf_Emu* this, addr_t addr ) 536#if 0 /* function currently unused */
537static int unmapped_read( struct Nsf_Emu* this, addr_t addr )
537{ 538{
538 (void) this; 539 (void) this;
539 540
@@ -548,6 +549,7 @@ int unmapped_read( struct Nsf_Emu* this, addr_t addr )
548 // Unmapped read 549 // Unmapped read
549 return addr >> 8; 550 return addr >> 8;
550} 551}
552#endif
551 553
552void cpu_write( struct Nsf_Emu* this, addr_t addr, int data ) 554void cpu_write( struct Nsf_Emu* this, addr_t addr, int data )
553{ 555{
@@ -643,7 +645,8 @@ void cpu_write( struct Nsf_Emu* this, addr_t addr, int data )
643 // Unmapped_write 645 // Unmapped_write
644} 646}
645 647
646void unmapped_write( struct Nsf_Emu* this, addr_t addr, int data ) 648#if 0 /* function currently unused */
649static void unmapped_write( struct Nsf_Emu* this, addr_t addr, int data )
647{ 650{
648 (void) data; 651 (void) data;
649 652
@@ -662,6 +665,7 @@ void unmapped_write( struct Nsf_Emu* this, addr_t addr, int data )
662 // FDS memory 665 // FDS memory
663 if ( fds_enabled( this ) && (unsigned) (addr - 0x8000) < 0x6000 ) return; 666 if ( fds_enabled( this ) && (unsigned) (addr - 0x8000) < 0x6000 ) return;
664} 667}
668#endif
665 669
666void fill_buf( struct Nsf_Emu* this ); 670void fill_buf( struct Nsf_Emu* this );
667blargg_err_t Nsf_start_track( struct Nsf_Emu* this, int track ) 671blargg_err_t Nsf_start_track( struct Nsf_Emu* this, int track )
@@ -807,7 +811,7 @@ void run_until( struct Nsf_Emu* this, nes_time_t end )
807 run_once( this, end ); 811 run_once( this, end );
808} 812}
809 813
810void end_frame( struct Nsf_Emu* this, nes_time_t end ) 814static void end_frame( struct Nsf_Emu* this, nes_time_t end )
811{ 815{
812 if ( Cpu_time( &this->cpu ) < end ) 816 if ( Cpu_time( &this->cpu ) < end )
813 run_until( this, end ); 817 run_until( this, end );
@@ -833,7 +837,7 @@ void end_frame( struct Nsf_Emu* this, nes_time_t end )
833 837
834// Tell/Seek 838// Tell/Seek
835 839
836blargg_long msec_to_samples( long sample_rate, blargg_long msec ) 840static blargg_long msec_to_samples( long sample_rate, blargg_long msec )
837{ 841{
838 blargg_long sec = msec / 1000; 842 blargg_long sec = msec / 1000;
839 msec -= sec * 1000; 843 msec -= sec * 1000;
@@ -932,7 +936,7 @@ static int int_log( blargg_long x, int step, int unit )
932 return ((unit - fraction) + (fraction >> 1)) >> shift; 936 return ((unit - fraction) + (fraction >> 1)) >> shift;
933} 937}
934 938
935void handle_fade( struct Nsf_Emu* this, long out_count, sample_t* out ) 939static void handle_fade( struct Nsf_Emu* this, long out_count, sample_t* out )
936{ 940{
937 int i; 941 int i;
938 for ( i = 0; i < out_count; i += fade_block_size ) 942 for ( i = 0; i < out_count; i += fade_block_size )
diff --git a/apps/codecs/libgme/opl_apu.h b/apps/codecs/libgme/opl_apu.h
index 6185a99208..53fc912c4c 100644
--- a/apps/codecs/libgme/opl_apu.h
+++ b/apps/codecs/libgme/opl_apu.h
@@ -36,6 +36,7 @@ struct Opl_Apu {
36}; 36};
37 37
38blargg_err_t Opl_init( struct Opl_Apu* this, long clock, long rate, blip_time_t period, enum opl_type_t type ); 38blargg_err_t Opl_init( struct Opl_Apu* this, long clock, long rate, blip_time_t period, enum opl_type_t type );
39void Opl_shutdown( struct Opl_Apu* this );
39 40
40void Opl_reset( struct Opl_Apu* this ); 41void Opl_reset( struct Opl_Apu* this );
41static inline void Opl_volume( struct Opl_Apu* this, int v ) { Synth_volume( &this->synth, v / (4096 * 6) ); } 42static inline void Opl_volume( struct Opl_Apu* this, int v ) { Synth_volume( &this->synth, v / (4096 * 6) ); }
diff --git a/apps/codecs/libgme/resampler.c b/apps/codecs/libgme/resampler.c
index bcd98f68d2..d9dcea02c6 100644
--- a/apps/codecs/libgme/resampler.c
+++ b/apps/codecs/libgme/resampler.c
@@ -57,7 +57,7 @@ void Resampler_resize( struct Resampler* this, int pairs )
57 } 57 }
58} 58}
59 59
60void mix_mono( struct Resampler* this, struct Stereo_Buffer* stereo_buf, dsample_t* out_ ) 60static void mix_mono( struct Resampler* this, struct Stereo_Buffer* stereo_buf, dsample_t* out_ )
61{ 61{
62 int const bass = BLIP_READER_BASS( stereo_buf->bufs [0] ); 62 int const bass = BLIP_READER_BASS( stereo_buf->bufs [0] );
63 BLIP_READER_BEGIN( sn, stereo_buf->bufs [0] ); 63 BLIP_READER_BEGIN( sn, stereo_buf->bufs [0] );
@@ -90,7 +90,7 @@ void mix_mono( struct Resampler* this, struct Stereo_Buffer* stereo_buf, dsample
90 BLIP_READER_END( sn, stereo_buf->bufs [0] ); 90 BLIP_READER_END( sn, stereo_buf->bufs [0] );
91} 91}
92 92
93void mix_stereo( struct Resampler* this, struct Stereo_Buffer* stereo_buf, dsample_t* out_ ) 93static void mix_stereo( struct Resampler* this, struct Stereo_Buffer* stereo_buf, dsample_t* out_ )
94{ 94{
95 int const bass = BLIP_READER_BASS( stereo_buf->bufs [0] ); 95 int const bass = BLIP_READER_BASS( stereo_buf->bufs [0] );
96 BLIP_READER_BEGIN( snc, stereo_buf->bufs [0] ); 96 BLIP_READER_BEGIN( snc, stereo_buf->bufs [0] );
@@ -133,7 +133,7 @@ void mix_stereo( struct Resampler* this, struct Stereo_Buffer* stereo_buf, dsamp
133 BLIP_READER_END( snr, stereo_buf->bufs [2] ); 133 BLIP_READER_END( snr, stereo_buf->bufs [2] );
134} 134}
135 135
136void mix_stereo_no_center( struct Resampler* this, struct Stereo_Buffer* stereo_buf, dsample_t* out_ ) 136static void mix_stereo_no_center( struct Resampler* this, struct Stereo_Buffer* stereo_buf, dsample_t* out_ )
137{ 137{
138 int const bass = BLIP_READER_BASS( stereo_buf->bufs [0] ); 138 int const bass = BLIP_READER_BASS( stereo_buf->bufs [0] );
139 BLIP_READER_BEGIN( snl, stereo_buf->bufs [1] ); 139 BLIP_READER_BEGIN( snl, stereo_buf->bufs [1] );
@@ -171,7 +171,7 @@ void mix_stereo_no_center( struct Resampler* this, struct Stereo_Buffer* stereo_
171 BLIP_READER_END( snr, stereo_buf->bufs [2] ); 171 BLIP_READER_END( snr, stereo_buf->bufs [2] );
172} 172}
173 173
174dsample_t const* resample_( struct Resampler* this, dsample_t** out_, 174static dsample_t const* resample_( struct Resampler* this, dsample_t** out_,
175 dsample_t const* out_end, dsample_t const in [], int in_size ) 175 dsample_t const* out_end, dsample_t const in [], int in_size )
176{ 176{
177 in_size -= write_offset; 177 in_size -= write_offset;
@@ -209,7 +209,7 @@ dsample_t const* resample_( struct Resampler* this, dsample_t** out_,
209 return in; 209 return in;
210} 210}
211 211
212inline int resample_wrapper( struct Resampler* this, dsample_t out [], int* out_size, 212static inline int resample_wrapper( struct Resampler* this, dsample_t out [], int* out_size,
213 dsample_t const in [], int in_size ) 213 dsample_t const in [], int in_size )
214{ 214{
215 assert( Resampler_rate( this ) ); 215 assert( Resampler_rate( this ) );
@@ -223,7 +223,7 @@ inline int resample_wrapper( struct Resampler* this, dsample_t out [], int* out_
223 return result; 223 return result;
224} 224}
225 225
226int skip_input( struct Resampler* this, int count ) 226static int skip_input( struct Resampler* this, int count )
227{ 227{
228 this->write_pos -= count; 228 this->write_pos -= count;
229 if ( this->write_pos < 0 ) // occurs when downsampling 229 if ( this->write_pos < 0 ) // occurs when downsampling
@@ -235,7 +235,7 @@ int skip_input( struct Resampler* this, int count )
235 return count; 235 return count;
236} 236}
237 237
238void play_frame_( struct Resampler* this, struct Stereo_Buffer* stereo_buf, dsample_t* out ) 238static void play_frame_( struct Resampler* this, struct Stereo_Buffer* stereo_buf, dsample_t* out )
239{ 239{
240 long pair_count = this->sample_buf_size >> 1; 240 long pair_count = this->sample_buf_size >> 1;
241 blip_time_t blip_time = Blip_count_clocks( &stereo_buf->bufs [0], pair_count ); 241 blip_time_t blip_time = Blip_count_clocks( &stereo_buf->bufs [0], pair_count );
diff --git a/apps/codecs/libgme/sgc_emu.c b/apps/codecs/libgme/sgc_emu.c
index ff8db0be9e..a25bdbc070 100644
--- a/apps/codecs/libgme/sgc_emu.c
+++ b/apps/codecs/libgme/sgc_emu.c
@@ -25,7 +25,7 @@ int const fade_shift = 8; // fade ends with gain at 1.0 / (1 << fade_shift)
25 25
26const char gme_wrong_file_type [] = "Wrong file type for this emulator"; 26const char gme_wrong_file_type [] = "Wrong file type for this emulator";
27 27
28void clear_track_vars( struct Sgc_Emu* this ) 28static void clear_track_vars( struct Sgc_Emu* this )
29{ 29{
30 this->current_track = -1; 30 this->current_track = -1;
31 this->out_time = 0; 31 this->out_time = 0;
@@ -110,7 +110,7 @@ blargg_err_t Sgc_load_mem( struct Sgc_Emu* this, const void* data, long size )
110 return 0; 110 return 0;
111} 111}
112 112
113void Sound_set_voice( struct Sgc_Emu* this, int i, struct Blip_Buffer* c, struct Blip_Buffer* l, struct Blip_Buffer* r ) 113static void Sound_set_voice( struct Sgc_Emu* this, int i, struct Blip_Buffer* c, struct Blip_Buffer* l, struct Blip_Buffer* r )
114{ 114{
115 if ( i < sms_osc_count ) 115 if ( i < sms_osc_count )
116 Sms_apu_set_output( &this->apu, i, c, l, r ); 116 Sms_apu_set_output( &this->apu, i, c, l, r );
@@ -118,7 +118,7 @@ void Sound_set_voice( struct Sgc_Emu* this, int i, struct Blip_Buffer* c, struct
118 Fm_apu_set_output( &this->fm_apu, c ); 118 Fm_apu_set_output( &this->fm_apu, c );
119} 119}
120 120
121blargg_err_t run_clocks( struct Sgc_Emu* this, blip_time_t* duration, int msec ) 121static blargg_err_t run_clocks( struct Sgc_Emu* this, blip_time_t* duration, int msec )
122{ 122{
123#if defined(ROCKBOX) 123#if defined(ROCKBOX)
124 (void) msec; 124 (void) msec;
@@ -207,7 +207,7 @@ void jsr( struct Sgc_Emu* this, byte addr [2] )
207 this->cpu.r.pc = get_le16( addr ); 207 this->cpu.r.pc = get_le16( addr );
208} 208}
209 209
210void set_bank( struct Sgc_Emu* this, int bank, void const* data ) 210static void set_bank( struct Sgc_Emu* this, int bank, void const* data )
211{ 211{
212 //dprintf( "map bank %d to %p\n", bank, (byte*) data - rom.at_addr( 0 ) ); 212 //dprintf( "map bank %d to %p\n", bank, (byte*) data - rom.at_addr( 0 ) );
213 Z80_map_mem( &this->cpu, bank * this->rom.bank_size, this->rom.bank_size, this->unmapped_write, data ); 213 Z80_map_mem( &this->cpu, bank * this->rom.bank_size, this->rom.bank_size, this->unmapped_write, data );
@@ -408,7 +408,7 @@ blargg_err_t Sgc_start_track( struct Sgc_Emu* this, int track )
408 408
409// Tell/Seek 409// Tell/Seek
410 410
411blargg_long msec_to_samples( blargg_long msec, long sample_rate ) 411static blargg_long msec_to_samples( blargg_long msec, long sample_rate )
412{ 412{
413 blargg_long sec = msec / 1000; 413 blargg_long sec = msec / 1000;
414 msec -= sec * 1000; 414 msec -= sec * 1000;
@@ -509,7 +509,7 @@ static int int_log( blargg_long x, int step, int unit )
509 return ((unit - fraction) + (fraction >> 1)) >> shift; 509 return ((unit - fraction) + (fraction >> 1)) >> shift;
510} 510}
511 511
512void handle_fade( struct Sgc_Emu* this, long out_count, sample_t* out ) 512static void handle_fade( struct Sgc_Emu* this, long out_count, sample_t* out )
513{ 513{
514 int i; 514 int i;
515 for ( i = 0; i < out_count; i += fade_block_size ) 515 for ( i = 0; i < out_count; i += fade_block_size )
@@ -533,7 +533,7 @@ void handle_fade( struct Sgc_Emu* this, long out_count, sample_t* out )
533 533
534// Silence detection 534// Silence detection
535 535
536void emu_play( struct Sgc_Emu* this, long count, sample_t* out ) 536static void emu_play( struct Sgc_Emu* this, long count, sample_t* out )
537{ 537{
538 check( this->current_track_ >= 0 ); 538 check( this->current_track_ >= 0 );
539 this->emu_time += count; 539 this->emu_time += count;
diff --git a/apps/codecs/libgme/sms_apu.c b/apps/codecs/libgme/sms_apu.c
index 09506592fd..12435f406d 100644
--- a/apps/codecs/libgme/sms_apu.c
+++ b/apps/codecs/libgme/sms_apu.c
@@ -23,7 +23,7 @@ void Sms_apu_volume( struct Sms_Apu* this, int vol )
23 Synth_volume( &this->synth, vol ); 23 Synth_volume( &this->synth, vol );
24} 24}
25 25
26inline int calc_output( struct Sms_Apu* this, int i ) 26static inline int calc_output( struct Sms_Apu* this, int i )
27{ 27{
28 int flags = this->ggstereo >> i; 28 int flags = this->ggstereo >> i;
29 return (flags >> 3 & 2) | (flags & 1); 29 return (flags >> 3 & 2) | (flags & 1);
diff --git a/apps/codecs/libgme/vgm_emu.c b/apps/codecs/libgme/vgm_emu.c
index 0cd1768991..82e30c0b0f 100644
--- a/apps/codecs/libgme/vgm_emu.c
+++ b/apps/codecs/libgme/vgm_emu.c
@@ -53,7 +53,7 @@ enum {
53 ym2612_dac_pan_port = 0xB6 53 ym2612_dac_pan_port = 0xB6
54}; 54};
55 55
56void clear_track_vars( struct Vgm_Emu* this ) 56static void clear_track_vars( struct Vgm_Emu* this )
57{ 57{
58 this->out_time = 0; 58 this->out_time = 0;
59 this->emu_time = 0; 59 this->emu_time = 0;
@@ -165,7 +165,7 @@ static long check_gd3_header( byte const* h, long remain )
165 return gd3_size; 165 return gd3_size;
166} 166}
167 167
168byte const* gd3_data( struct Vgm_Emu* this, int* size ) 168static byte const* gd3_data( struct Vgm_Emu* this, int* size )
169{ 169{
170 if ( size ) 170 if ( size )
171 *size = 0; 171 *size = 0;
@@ -205,7 +205,7 @@ static void get_vgm_length( struct header_t const* h, struct track_info_t* out )
205 } 205 }
206} 206}
207 207
208blargg_err_t track_info( struct Vgm_Emu* this, struct track_info_t* out ) 208static blargg_err_t track_info( struct Vgm_Emu* this, struct track_info_t* out )
209{ 209{
210 memset(out, 0, sizeof out); 210 memset(out, 0, sizeof out);
211 get_vgm_length( header( this ), out ); 211 get_vgm_length( header( this ), out );
@@ -225,7 +225,7 @@ static blargg_err_t check_vgm_header( struct header_t* h )
225 return 0; 225 return 0;
226} 226}
227 227
228void set_voice( struct Vgm_Emu* this, int i, struct Blip_Buffer* c, struct Blip_Buffer* l, struct Blip_Buffer* r ) 228static void set_voice( struct Vgm_Emu* this, int i, struct Blip_Buffer* c, struct Blip_Buffer* l, struct Blip_Buffer* r )
229{ 229{
230 if ( i < sms_osc_count ) { 230 if ( i < sms_osc_count ) {
231 int j; 231 int j;
@@ -310,7 +310,7 @@ blargg_err_t Vgm_load_mem( struct Vgm_Emu* this, byte const* new_data, long new_
310} 310}
311 311
312void update_fm_rates( struct Vgm_Emu* this, int* ym2413_rate, int* ym2612_rate ); 312void update_fm_rates( struct Vgm_Emu* this, int* ym2413_rate, int* ym2612_rate );
313blargg_err_t init_fm( struct Vgm_Emu* this, double* rate ) 313static blargg_err_t init_fm( struct Vgm_Emu* this, double* rate )
314{ 314{
315 int ym2612_rate = get_le32( header( this )->ym2612_rate ); 315 int ym2612_rate = get_le32( header( this )->ym2612_rate );
316 int ym2413_rate = get_le32( header( this )->ym2413_rate ); 316 int ym2413_rate = get_le32( header( this )->ym2413_rate );
@@ -365,7 +365,7 @@ blargg_err_t setup_fm( struct Vgm_Emu* this )
365// Emulation 365// Emulation
366 366
367blip_time_t run( struct Vgm_Emu* this, vgm_time_t end_time ); 367blip_time_t run( struct Vgm_Emu* this, vgm_time_t end_time );
368blargg_err_t run_clocks( struct Vgm_Emu* this, blip_time_t* time_io, int msec ) 368static blargg_err_t run_clocks( struct Vgm_Emu* this, blip_time_t* time_io, int msec )
369{ 369{
370 *time_io = run( this, msec * this->vgm_rate / 1000 ); 370 *time_io = run( this, msec * this->vgm_rate / 1000 );
371 Sms_apu_end_frame( &this->psg, *time_io ); 371 Sms_apu_end_frame( &this->psg, *time_io );
@@ -374,7 +374,7 @@ blargg_err_t run_clocks( struct Vgm_Emu* this, blip_time_t* time_io, int msec )
374 374
375 375
376 376
377blargg_err_t play_( struct Vgm_Emu* this, long count, sample_t* out ) 377static blargg_err_t play_( struct Vgm_Emu* this, long count, sample_t* out )
378{ 378{
379 if ( !uses_fm( this ) ) { 379 if ( !uses_fm( this ) ) {
380 long remain = count; 380 long remain = count;
@@ -407,7 +407,7 @@ blargg_err_t play_( struct Vgm_Emu* this, long count, sample_t* out )
407 407
408// Vgm_Emu_impl 408// Vgm_Emu_impl
409 409
410inline int command_len( int command ) 410static inline int command_len( int command )
411{ 411{
412 static byte const lens [0x10] ICONST_ATTR = { 412 static byte const lens [0x10] ICONST_ATTR = {
413 // 0 1 2 3 4 5 6 7 8 9 A B C D E F 413 // 0 1 2 3 4 5 6 7 8 9 A B C D E F
@@ -418,17 +418,17 @@ inline int command_len( int command )
418 return len; 418 return len;
419} 419}
420 420
421inline fm_time_t to_fm_time( struct Vgm_Emu* this, vgm_time_t t ) 421static inline fm_time_t to_fm_time( struct Vgm_Emu* this, vgm_time_t t )
422{ 422{
423 return (t * this->fm_time_factor + this->fm_time_offset) >> fm_time_bits; 423 return (t * this->fm_time_factor + this->fm_time_offset) >> fm_time_bits;
424} 424}
425 425
426inline blip_time_t to_psg_time( struct Vgm_Emu* this, vgm_time_t t ) 426static inline blip_time_t to_psg_time( struct Vgm_Emu* this, vgm_time_t t )
427{ 427{
428 return (t * this->blip_time_factor) >> blip_time_bits; 428 return (t * this->blip_time_factor) >> blip_time_bits;
429} 429}
430 430
431void write_pcm( struct Vgm_Emu* this, vgm_time_t vgm_time, int amp ) 431static void write_pcm( struct Vgm_Emu* this, vgm_time_t vgm_time, int amp )
432{ 432{
433 if ( this->blip_buf ) 433 if ( this->blip_buf )
434 { 434 {
@@ -820,7 +820,7 @@ blargg_err_t Vgm_start_track( struct Vgm_Emu* this )
820 820
821// Tell/Seek 821// Tell/Seek
822 822
823blargg_long msec_to_samples( blargg_long msec, long sample_rate ) 823static blargg_long msec_to_samples( blargg_long msec, long sample_rate )
824{ 824{
825 blargg_long sec = msec / 1000; 825 blargg_long sec = msec / 1000;
826 msec -= sec * 1000; 826 msec -= sec * 1000;
@@ -916,7 +916,7 @@ static int int_log( blargg_long x, int step, int unit )
916 return ((unit - fraction) + (fraction >> 1)) >> shift; 916 return ((unit - fraction) + (fraction >> 1)) >> shift;
917} 917}
918 918
919void handle_fade( struct Vgm_Emu* this, long out_count, sample_t* out ) 919static void handle_fade( struct Vgm_Emu* this, long out_count, sample_t* out )
920{ 920{
921 int i; 921 int i;
922 for ( i = 0; i < out_count; i += fade_block_size ) 922 for ( i = 0; i < out_count; i += fade_block_size )
@@ -940,7 +940,7 @@ void handle_fade( struct Vgm_Emu* this, long out_count, sample_t* out )
940 940
941// Silence detection 941// Silence detection
942 942
943void emu_play( struct Vgm_Emu* this, long count, sample_t* out ) 943static void emu_play( struct Vgm_Emu* this, long count, sample_t* out )
944{ 944{
945 this->emu_time += count; 945 this->emu_time += count;
946 if ( !this->emu_track_ended_ ) { 946 if ( !this->emu_track_ended_ ) {
diff --git a/apps/codecs/libgme/ym2612_emu.c b/apps/codecs/libgme/ym2612_emu.c
index a2f32d30ca..54930298c9 100644
--- a/apps/codecs/libgme/ym2612_emu.c
+++ b/apps/codecs/libgme/ym2612_emu.c
@@ -86,7 +86,7 @@ static const unsigned char LFO_FMS_TAB [8] ICONST_ATTR =
86int in0, in1, in2, in3; // current phase calculation 86int in0, in1, in2, in3; // current phase calculation
87// int en0, en1, en2, en3; // current enveloppe calculation 87// int en0, en1, en2, en3; // current enveloppe calculation
88 88
89inline void set_seg( struct slot_t* s, int seg ) 89static inline void set_seg( struct slot_t* s, int seg )
90{ 90{
91 s->env_xor = 0; 91 s->env_xor = 0;
92 s->env_max = INT_MAX; 92 s->env_max = INT_MAX;
@@ -98,9 +98,9 @@ inline void set_seg( struct slot_t* s, int seg )
98 } 98 }
99} 99}
100 100
101inline void YM2612_Special_Update(void) { } 101static inline void YM2612_Special_Update(void) { }
102 102
103void KEY_ON( struct channel_* ch, struct tables_t *g, int nsl ) 103static void KEY_ON( struct channel_* ch, struct tables_t *g, int nsl )
104{ 104{
105 struct slot_t *SL = &(ch->SLOT [nsl]); // on recupere le bon pointeur de slot 105 struct slot_t *SL = &(ch->SLOT [nsl]); // on recupere le bon pointeur de slot
106 106
@@ -123,7 +123,7 @@ void KEY_ON( struct channel_* ch, struct tables_t *g, int nsl )
123} 123}
124 124
125 125
126void KEY_OFF( struct channel_* ch, struct tables_t *g, int nsl ) 126static void KEY_OFF( struct channel_* ch, struct tables_t *g, int nsl )
127{ 127{
128 struct slot_t *SL = &(ch->SLOT [nsl]); // on recupere le bon pointeur de slot 128 struct slot_t *SL = &(ch->SLOT [nsl]); // on recupere le bon pointeur de slot
129 129
@@ -141,7 +141,7 @@ void KEY_OFF( struct channel_* ch, struct tables_t *g, int nsl )
141} 141}
142 142
143 143
144int SLOT_SET( struct Ym2612_Impl* impl, int Adr, int data ) 144static int SLOT_SET( struct Ym2612_Impl* impl, int Adr, int data )
145{ 145{
146 int nch = Adr & 3; 146 int nch = Adr & 3;
147 if ( nch == 3 ) 147 if ( nch == 3 )
@@ -245,7 +245,7 @@ int SLOT_SET( struct Ym2612_Impl* impl, int Adr, int data )
245} 245}
246 246
247 247
248int CHANNEL_SET( struct state_t* YM2612, int Adr, int data ) 248static int CHANNEL_SET( struct state_t* YM2612, int Adr, int data )
249{ 249{
250 int num = Adr & 3; 250 int num = Adr & 3;
251 if ( num == 3 ) 251 if ( num == 3 )
@@ -348,7 +348,7 @@ int CHANNEL_SET( struct state_t* YM2612, int Adr, int data )
348} 348}
349 349
350 350
351int YM_SET( struct Ym2612_Impl* impl, int Adr, int data ) 351static int YM_SET( struct Ym2612_Impl* impl, int Adr, int data )
352{ 352{
353 struct state_t* YM2612 = &impl->YM2612; 353 struct state_t* YM2612 = &impl->YM2612;
354 struct tables_t* g = &impl->g; 354 struct tables_t* g = &impl->g;
@@ -480,7 +480,7 @@ double ipow(double a,int b)
480#endif 480#endif
481 481
482void impl_reset( struct Ym2612_Impl* impl ); 482void impl_reset( struct Ym2612_Impl* impl );
483void impl_set_rate( struct Ym2612_Impl* impl, double sample_rate, double clock_rate ) 483static void impl_set_rate( struct Ym2612_Impl* impl, double sample_rate, double clock_rate )
484{ 484{
485 assert( sample_rate ); 485 assert( sample_rate );
486 assert( !clock_rate || clock_rate > sample_rate ); 486 assert( !clock_rate || clock_rate > sample_rate );
@@ -695,7 +695,7 @@ const char* Ym2612_set_rate( struct Ym2612_Emu* this, double sample_rate, double
695 return 0; 695 return 0;
696} 696}
697 697
698inline void write0( struct Ym2612_Impl* impl, int opn_addr, int data ) 698static inline void write0( struct Ym2612_Impl* impl, int opn_addr, int data )
699{ 699{
700 assert( (unsigned) data <= 0xFF ); 700 assert( (unsigned) data <= 0xFF );
701 701
@@ -715,7 +715,7 @@ inline void write0( struct Ym2612_Impl* impl, int opn_addr, int data )
715 } 715 }
716} 716}
717 717
718inline void write1( struct Ym2612_Impl* impl, int opn_addr, int data ) 718static inline void write1( struct Ym2612_Impl* impl, int opn_addr, int data )
719{ 719{
720 assert( (unsigned) data <= 0xFF ); 720 assert( (unsigned) data <= 0xFF );
721 721
@@ -954,7 +954,7 @@ ch->SLOT [S1].Fcnt = in1; \
954ch->SLOT [S2].Fcnt = in2; \ 954ch->SLOT [S2].Fcnt = in2; \
955ch->SLOT [S3].Fcnt = in3; 955ch->SLOT [S3].Fcnt = in3;
956 956
957void ym2612_update_chan0( struct tables_t* g, struct channel_* ch, 957static void ym2612_update_chan0( struct tables_t* g, struct channel_* ch,
958 short* buf, int length ) 958 short* buf, int length )
959{ 959{
960 int not_end = ch->SLOT [S3].Ecnt - ENV_END; 960 int not_end = ch->SLOT [S3].Ecnt - ENV_END;
@@ -987,7 +987,7 @@ void ym2612_update_chan0( struct tables_t* g, struct channel_* ch,
987 UPDATE_PHASE 987 UPDATE_PHASE
988} 988}
989 989
990void ym2612_update_chan1( struct tables_t* g, struct channel_* ch, 990static void ym2612_update_chan1( struct tables_t* g, struct channel_* ch,
991 short* buf, int length ) 991 short* buf, int length )
992{ 992{
993 int not_end = ch->SLOT [S3].Ecnt - ENV_END; 993 int not_end = ch->SLOT [S3].Ecnt - ENV_END;
@@ -1019,7 +1019,7 @@ void ym2612_update_chan1( struct tables_t* g, struct channel_* ch,
1019 UPDATE_PHASE 1019 UPDATE_PHASE
1020} 1020}
1021 1021
1022void ym2612_update_chan2( struct tables_t* g, struct channel_* ch, 1022static void ym2612_update_chan2( struct tables_t* g, struct channel_* ch,
1023 short* buf, int length ) 1023 short* buf, int length )
1024{ 1024{
1025 int not_end = ch->SLOT [S3].Ecnt - ENV_END; 1025 int not_end = ch->SLOT [S3].Ecnt - ENV_END;
@@ -1051,7 +1051,7 @@ void ym2612_update_chan2( struct tables_t* g, struct channel_* ch,
1051 UPDATE_PHASE 1051 UPDATE_PHASE
1052} 1052}
1053 1053
1054void ym2612_update_chan3( struct tables_t* g, struct channel_* ch, 1054static void ym2612_update_chan3( struct tables_t* g, struct channel_* ch,
1055 short* buf, int length ) 1055 short* buf, int length )
1056{ 1056{
1057 int not_end = ch->SLOT [S3].Ecnt - ENV_END; 1057 int not_end = ch->SLOT [S3].Ecnt - ENV_END;
@@ -1084,7 +1084,7 @@ void ym2612_update_chan3( struct tables_t* g, struct channel_* ch,
1084 UPDATE_PHASE 1084 UPDATE_PHASE
1085} 1085}
1086 1086
1087void ym2612_update_chan4( struct tables_t* g, struct channel_* ch, 1087static void ym2612_update_chan4( struct tables_t* g, struct channel_* ch,
1088 short* buf, int length ) 1088 short* buf, int length )
1089{ 1089{
1090 int not_end = ch->SLOT [S3].Ecnt - ENV_END; 1090 int not_end = ch->SLOT [S3].Ecnt - ENV_END;
@@ -1118,7 +1118,7 @@ void ym2612_update_chan4( struct tables_t* g, struct channel_* ch,
1118 UPDATE_PHASE 1118 UPDATE_PHASE
1119} 1119}
1120 1120
1121void ym2612_update_chan5( struct tables_t* g, struct channel_* ch, 1121static void ym2612_update_chan5( struct tables_t* g, struct channel_* ch,
1122 short* buf, int length ) 1122 short* buf, int length )
1123{ 1123{
1124 int not_end = ch->SLOT [S3].Ecnt - ENV_END; 1124 int not_end = ch->SLOT [S3].Ecnt - ENV_END;
@@ -1154,7 +1154,7 @@ void ym2612_update_chan5( struct tables_t* g, struct channel_* ch,
1154 UPDATE_PHASE 1154 UPDATE_PHASE
1155} 1155}
1156 1156
1157void ym2612_update_chan6( struct tables_t* g, struct channel_* ch, 1157static void ym2612_update_chan6( struct tables_t* g, struct channel_* ch,
1158 short* buf, int length ) 1158 short* buf, int length )
1159{ 1159{
1160 int not_end = ch->SLOT [S3].Ecnt - ENV_END; 1160 int not_end = ch->SLOT [S3].Ecnt - ENV_END;
@@ -1189,7 +1189,7 @@ void ym2612_update_chan6( struct tables_t* g, struct channel_* ch,
1189 UPDATE_PHASE 1189 UPDATE_PHASE
1190} 1190}
1191 1191
1192void ym2612_update_chan7( struct tables_t* g, struct channel_* ch, 1192static void ym2612_update_chan7( struct tables_t* g, struct channel_* ch,
1193 short* buf, int length ) 1193 short* buf, int length )
1194{ 1194{
1195 int not_end = ch->SLOT [S3].Ecnt - ENV_END; 1195 int not_end = ch->SLOT [S3].Ecnt - ENV_END;
@@ -1238,7 +1238,7 @@ static void (*UPDATE_CHAN[8])(struct tables_t* g, struct channel_* ch,
1238 (void *)ym2612_update_chan7 1238 (void *)ym2612_update_chan7
1239}; 1239};
1240 1240
1241void run_timer( struct Ym2612_Impl* impl, int length ) 1241static void run_timer( struct Ym2612_Impl* impl, int length )
1242{ 1242{
1243 int const step = 6; 1243 int const step = 6;
1244 int remain = length; 1244 int remain = length;
@@ -1284,7 +1284,7 @@ void run_timer( struct Ym2612_Impl* impl, int length )
1284 while ( remain > 0 ); 1284 while ( remain > 0 );
1285} 1285}
1286 1286
1287void impl_run( struct Ym2612_Impl* impl, int pair_count, short out [] ) 1287static void impl_run( struct Ym2612_Impl* impl, int pair_count, short out [] )
1288{ 1288{
1289 if ( pair_count <= 0 ) 1289 if ( pair_count <= 0 )
1290 return; 1290 return;
diff --git a/apps/codecs/libgme/z80_cpu.c b/apps/codecs/libgme/z80_cpu.c
index 9151350067..a31236020e 100644
--- a/apps/codecs/libgme/z80_cpu.c
+++ b/apps/codecs/libgme/z80_cpu.c
@@ -44,7 +44,7 @@ void Z80_init( struct Z80_Cpu* this )
44 this->szpc [0x100] |= Z40; 44 this->szpc [0x100] |= Z40;
45} 45}
46 46
47inline void set_page( struct Z80_Cpu* this, int i, void* write, void const* read ) 47static inline void set_page( struct Z80_Cpu* this, int i, void* write, void const* read )
48{ 48{
49 int offset = Z80_CPU_OFFSET( i * page_size ); 49 int offset = Z80_CPU_OFFSET( i * page_size );
50 byte * write2 = STATIC_CAST(byte *,write) - offset; 50 byte * write2 = STATIC_CAST(byte *,write) - offset;
diff --git a/apps/metadata/ay.c b/apps/metadata/ay.c
index 8b737a7eba..50b5ac29ae 100644
--- a/apps/metadata/ay.c
+++ b/apps/metadata/ay.c
@@ -108,7 +108,7 @@ static void copy_ay_fields( struct file_t const* file, struct mp3entry* id3, int
108 if (tmp) id3->comment = tmp; 108 if (tmp) id3->comment = tmp;
109} 109}
110 110
111bool parse_ay_header(int fd, struct mp3entry *id3) 111static bool parse_ay_header(int fd, struct mp3entry *id3)
112{ 112{
113 /* Use the trackname part of the id3 structure as a temporary buffer */ 113 /* Use the trackname part of the id3 structure as a temporary buffer */
114 unsigned char* buf = (unsigned char *)id3->id3v2buf; 114 unsigned char* buf = (unsigned char *)id3->id3v2buf;
diff --git a/apps/metadata/gbs.c b/apps/metadata/gbs.c
index 796db5932f..68f2b2a393 100644
--- a/apps/metadata/gbs.c
+++ b/apps/metadata/gbs.c
@@ -10,7 +10,7 @@
10#include "metadata_parsers.h" 10#include "metadata_parsers.h"
11#include "rbunicode.h" 11#include "rbunicode.h"
12 12
13bool parse_gbs_header(int fd, struct mp3entry* id3) 13static bool parse_gbs_header(int fd, struct mp3entry* id3)
14{ 14{
15 /* Use the trackname part of the id3 structure as a temporary buffer */ 15 /* Use the trackname part of the id3 structure as a temporary buffer */
16 unsigned char* buf = (unsigned char *)id3->path; 16 unsigned char* buf = (unsigned char *)id3->path;
diff --git a/apps/metadata/kss.c b/apps/metadata/kss.c
index ecb59b8353..2ae0cf50b0 100644
--- a/apps/metadata/kss.c
+++ b/apps/metadata/kss.c
@@ -10,7 +10,7 @@
10#include "metadata_parsers.h" 10#include "metadata_parsers.h"
11#include "rbunicode.h" 11#include "rbunicode.h"
12 12
13bool parse_kss_header(int fd, struct mp3entry* id3) 13static bool parse_kss_header(int fd, struct mp3entry* id3)
14{ 14{
15 /* Use the trackname part of the id3 structure as a temporary buffer */ 15 /* Use the trackname part of the id3 structure as a temporary buffer */
16 unsigned char* buf = (unsigned char *)id3->path; 16 unsigned char* buf = (unsigned char *)id3->path;
diff --git a/apps/metadata/sgc.c b/apps/metadata/sgc.c
index 9e16de2c76..78cacb9b1b 100644
--- a/apps/metadata/sgc.c
+++ b/apps/metadata/sgc.c
@@ -10,7 +10,7 @@
10#include "metadata_parsers.h" 10#include "metadata_parsers.h"
11#include "rbunicode.h" 11#include "rbunicode.h"
12 12
13bool parse_sgc_header(int fd, struct mp3entry* id3) 13static bool parse_sgc_header(int fd, struct mp3entry* id3)
14{ 14{
15 /* Use the trackname part of the id3 structure as a temporary buffer */ 15 /* Use the trackname part of the id3 structure as a temporary buffer */
16 unsigned char* buf = (unsigned char *)id3->path; 16 unsigned char* buf = (unsigned char *)id3->path;