diff options
author | Bertrik Sikken <bertrik@sikken.nl> | 2011-08-11 19:04:28 +0000 |
---|---|---|
committer | Bertrik Sikken <bertrik@sikken.nl> | 2011-08-11 19:04:28 +0000 |
commit | b1279498609808cf65a7054ae7085b4885a33e66 (patch) | |
tree | 65b811724afd1237bbaddf16d503134d1048196f /apps/codecs/libgme/vgm_emu.c | |
parent | 39e4987ea5c2326249583b53afcd9038d8209ba9 (diff) | |
download | rockbox-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
Diffstat (limited to 'apps/codecs/libgme/vgm_emu.c')
-rw-r--r-- | apps/codecs/libgme/vgm_emu.c | 28 |
1 files changed, 14 insertions, 14 deletions
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 | ||
56 | void clear_track_vars( struct Vgm_Emu* this ) | 56 | static 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 | ||
168 | byte const* gd3_data( struct Vgm_Emu* this, int* size ) | 168 | static 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 | ||
208 | blargg_err_t track_info( struct Vgm_Emu* this, struct track_info_t* out ) | 208 | static 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 | ||
228 | void set_voice( struct Vgm_Emu* this, int i, struct Blip_Buffer* c, struct Blip_Buffer* l, struct Blip_Buffer* r ) | 228 | static 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 | ||
312 | void update_fm_rates( struct Vgm_Emu* this, int* ym2413_rate, int* ym2612_rate ); | 312 | void update_fm_rates( struct Vgm_Emu* this, int* ym2413_rate, int* ym2612_rate ); |
313 | blargg_err_t init_fm( struct Vgm_Emu* this, double* rate ) | 313 | static 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 | ||
367 | blip_time_t run( struct Vgm_Emu* this, vgm_time_t end_time ); | 367 | blip_time_t run( struct Vgm_Emu* this, vgm_time_t end_time ); |
368 | blargg_err_t run_clocks( struct Vgm_Emu* this, blip_time_t* time_io, int msec ) | 368 | static 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 | ||
377 | blargg_err_t play_( struct Vgm_Emu* this, long count, sample_t* out ) | 377 | static 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 | ||
410 | inline int command_len( int command ) | 410 | static 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 | ||
421 | inline fm_time_t to_fm_time( struct Vgm_Emu* this, vgm_time_t t ) | 421 | static 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 | ||
426 | inline blip_time_t to_psg_time( struct Vgm_Emu* this, vgm_time_t t ) | 426 | static 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 | ||
431 | void write_pcm( struct Vgm_Emu* this, vgm_time_t vgm_time, int amp ) | 431 | static 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 | ||
823 | blargg_long msec_to_samples( blargg_long msec, long sample_rate ) | 823 | static 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 | ||
919 | void handle_fade( struct Vgm_Emu* this, long out_count, sample_t* out ) | 919 | static 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 | ||
943 | void emu_play( struct Vgm_Emu* this, long count, sample_t* out ) | 943 | static 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_ ) { |