1
0
Fork 0
forked from len0rd/rockbox

libgme: make local functions static where possible

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30280 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Bertrik Sikken 2011-08-11 19:04:28 +00:00
parent 39e4987ea5
commit b127949860
27 changed files with 128 additions and 123 deletions

View file

@ -67,7 +67,7 @@ static byte const modes [8] =
MODE( 0,1, 0,0, 0,0 ),
};
void set_output( struct Ay_Apu* this, struct Blip_Buffer* b )
static void set_output( struct Ay_Apu* this, struct Blip_Buffer* b )
{
int i;
for ( i = 0; i < ay_osc_count; ++i )

View file

@ -35,7 +35,7 @@ int const spectrum_period = 70908;
int const cpc_clock = 2000000;
void clear_track_vars( struct Ay_Emu *this )
static void clear_track_vars( struct Ay_Emu *this )
{
this->current_track = -1;
this->out_time = 0;
@ -128,7 +128,7 @@ long Track_get_length( struct Ay_Emu* this, int n )
// Setup
void change_clock_rate( struct Ay_Emu *this, long rate )
static void change_clock_rate( struct Ay_Emu *this, long rate )
{
this->clock_rate_ = rate;
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 )
return 0;
}
void set_beeper_output( struct Ay_Emu *this, struct Blip_Buffer* b )
static void set_beeper_output( struct Ay_Emu *this, struct Blip_Buffer* b )
{
this->beeper_output = b;
if ( b && !this->cpc_mode )
@ -169,7 +169,7 @@ void set_beeper_output( struct Ay_Emu *this, struct Blip_Buffer* b )
disable_beeper( this );
}
void set_voice( struct Ay_Emu *this, int i, struct Blip_Buffer* center )
static void set_voice( struct Ay_Emu *this, int i, struct Blip_Buffer* center )
{
if ( i >= ay_osc_count )
set_beeper_output( this, center );
@ -177,7 +177,7 @@ void set_voice( struct Ay_Emu *this, int i, struct Blip_Buffer* center )
Ay_apu_set_output( &this->apu, i, center );
}
blargg_err_t run_clocks( struct Ay_Emu *this, blip_time_t* duration, int msec )
static blargg_err_t run_clocks( struct Ay_Emu *this, blip_time_t* duration, int msec )
{
#if defined(ROCKBOX)
(void) msec;
@ -521,7 +521,7 @@ blargg_err_t Ay_start_track( struct Ay_Emu *this, int track )
// Tell/Seek
blargg_long msec_to_samples( blargg_long msec, long sample_rate )
static blargg_long msec_to_samples( blargg_long msec, long sample_rate )
{
blargg_long sec = msec / 1000;
msec -= sec * 1000;
@ -544,7 +544,7 @@ blargg_err_t Track_seek( struct Ay_Emu *this, long msec )
}
blargg_err_t play_( struct Ay_Emu *this, long count, sample_t* out ) ICODE_ATTR;
blargg_err_t skip_( struct Ay_Emu *this, long count )
static blargg_err_t skip_( struct Ay_Emu *this, long count )
{
// for long skip, mute sound
const long threshold = 30000;
@ -620,7 +620,7 @@ static int int_log( blargg_long x, int step, int unit )
return ((unit - fraction) + (fraction >> 1)) >> shift;
}
void handle_fade( struct Ay_Emu *this, long out_count, sample_t* out )
static void handle_fade( struct Ay_Emu *this, long out_count, sample_t* out )
{
int i;
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 )
// Silence detection
void emu_play( struct Ay_Emu *this, long count, sample_t* out )
static void emu_play( struct Ay_Emu *this, long count, sample_t* out )
{
check( current_track_ >= 0 );
this->emu_time += count;

View file

@ -1495,7 +1495,7 @@ OPLL_is_internal_muted(OPLL * opll)
return opll->internal_mute;
}
e_uint32
static e_uint32
check_mute_helper(OPLL * opll)
{
for (int i = 0; i < 6; i++) {
@ -1524,7 +1524,7 @@ check_mute_helper(OPLL * opll)
return 1; /* nothing is playing, then mute */
}
void
static void
check_mute(OPLL * opll)
{
OPLL_set_internal_mute (opll, check_mute_helper (opll));

View file

@ -133,7 +133,7 @@ static void makeSinTable(void)
sintable[PG_WIDTH/2 + i] = 2*DB_MUTE + sintable[i];
}
void makeDphaseNoiseTable(int sampleRate, int clockRate)
static void makeDphaseNoiseTable(int sampleRate, int clockRate)
{
for (int i=0; i<1024; i++)
for (int j=0; j<8; j++)
@ -141,7 +141,7 @@ void makeDphaseNoiseTable(int sampleRate, int clockRate)
}
// Table for Pitch Modulator
void makePmTable(void)
static void makePmTable(void)
{
int i;
for (i=0; i < PM_PG_WIDTH; i++)
@ -159,7 +159,7 @@ void makePmTable(void)
}
// Table for Amp Modulator
void makeAmTable(void)
static void makeAmTable(void)
{
int i;
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); }
static inline void keyOff_CYM(struct Y8950* this){ slotOff(&this->ch[8].car); }
// Change Rhythm Mode
inline void setRythmMode(struct Y8950* this, int data)
static inline void setRythmMode(struct Y8950* this, int data)
{
bool newMode = (data & 32) != 0;
if (this->rythm_mode != newMode) {
@ -822,7 +822,7 @@ static inline int calcSample(struct Y8950* this, int channelMask)
return (mix*this->maxVolume) >> (DB2LIN_AMP_BITS - 1);
}
bool checkMuteHelper(struct Y8950* this)
static bool checkMuteHelper(struct Y8950* this)
{
int i;
struct OPLChannel *ch = this->ch;
@ -844,7 +844,7 @@ bool checkMuteHelper(struct Y8950* this)
return ADPCM_muted(&this->adpcm);
}
void checkMute(struct Y8950* this)
static void checkMute(struct Y8950* this)
{
bool mute = checkMuteHelper(this);
//PRT_DEBUG("Y8950: muted " << mute);

View file

@ -54,7 +54,7 @@ const int DECODE_MIN = -32768;
// //
//**************************************************//
int CLAP(int min, int x, int max)
static int CLAP(int min, int x, int max)
{
return (x < min) ? min : ((max < x) ? max : x);
}

View file

@ -24,7 +24,7 @@ int const wave_ram = 0xFF30;
int const power_mask = 0x80;
inline int calc_output( struct Gb_Apu* this, int osc )
static inline int calc_output( struct Gb_Apu* this, int osc )
{
int bits = this->regs [stereo_reg - io_addr] >> osc;
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
o->output = o->outputs [calc_output( this, i )];
}
void synth_volume( struct Gb_Apu* this, int iv )
static void synth_volume( struct Gb_Apu* this, int iv )
{
int v = (this->volume_ * 6) / 10 / osc_count / 15 /*steps*/ / 8 /*master vol range*/ * iv;
Synth_volume( &this->synth, v );
}
void apply_volume( struct Gb_Apu* this )
static void apply_volume( struct Gb_Apu* this )
{
// TODO: Doesn't handle differing left and right volumes (panning).
// Not worth the complexity.
@ -76,7 +76,7 @@ void Apu_volume( struct Gb_Apu* this, int v )
}
}
void reset_regs( struct Gb_Apu* this )
static void reset_regs( struct Gb_Apu* this )
{
int i;
for ( i = 0; i < 0x20; i++ )
@ -90,7 +90,7 @@ void reset_regs( struct Gb_Apu* this )
apply_volume( this );
}
void reset_lengths( struct Gb_Apu* this )
static void reset_lengths( struct Gb_Apu* this )
{
this->square1.osc.length_ctr = 64;
this->square2.osc.length_ctr = 64;
@ -189,7 +189,7 @@ void Apu_init( struct Gb_Apu* this )
Apu_reset( this, mode_cgb, false );
}
void run_until_( struct Gb_Apu* this, blip_time_t end_time )
static void run_until_( struct Gb_Apu* this, blip_time_t end_time )
{
if ( !this->frame_period )
this->frame_time += end_time - this->last_time;
@ -238,7 +238,7 @@ void run_until_( struct Gb_Apu* this, blip_time_t end_time )
}
}
inline void run_until( struct Gb_Apu* this, blip_time_t time )
static inline void run_until( struct Gb_Apu* this, blip_time_t time )
{
require( time >= this->last_time ); // end_time must not be before previous time
if ( time > this->last_time )
@ -261,7 +261,7 @@ void Apu_end_frame( struct Gb_Apu* this, blip_time_t end_time )
assert( this->last_time >= 0 );
}
void silence_osc( struct Gb_Apu* this, struct Gb_Osc* o )
static void silence_osc( struct Gb_Apu* this, struct Gb_Osc* o )
{
int delta = -o->last_amp;
if ( this->reduce_clicks_ )
@ -278,7 +278,7 @@ void silence_osc( struct Gb_Apu* this, struct Gb_Osc* o )
}
}
void apply_stereo( struct Gb_Apu* this )
static void apply_stereo( struct Gb_Apu* this )
{
int i;
for ( i = osc_count; --i >= 0; )

View file

@ -17,7 +17,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
#include "blargg_source.h"
inline void set_code_page( struct Gb_Cpu* this, int i, void* p )
static inline void set_code_page( struct Gb_Cpu* this, int i, void* p )
{
byte* p2 = STATIC_CAST(byte*,p) - GB_CPU_OFFSET( i * page_size );
this->cpu_state_.code_map [i] = p2;

View file

@ -135,7 +135,7 @@ int wave_access( struct Gb_Wave* this, int addr )
// write_register
int write_trig( struct Gb_Osc* this, int frame_phase, int max_len, int old_data )
static int write_trig( struct Gb_Osc* this, int frame_phase, int max_len, int old_data )
{
int data = this->regs [4];
@ -162,7 +162,7 @@ int write_trig( struct Gb_Osc* this, int frame_phase, int max_len, int old_data
return data & trigger_mask;
}
inline void Noise_zombie_volume( struct Gb_Noise* this, int old, int data )
static inline void Noise_zombie_volume( struct Gb_Noise* this, int old, int data )
{
int v = this->volume;
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 )
this->volume = v & 0x0F;
}
inline void Square_zombie_volume( struct Gb_Square* this, int old, int data )
static inline void Square_zombie_volume( struct Gb_Square* this, int old, int data )
{
int v = this->volume;
if ( this->osc.mode == mode_agb || cgb_05 )

View file

@ -28,7 +28,7 @@ int const silence_threshold = 0x10;
long const fade_block_size = 512;
int const fade_shift = 8; // fade ends with gain at 1.0 / (1 << fade_shift)
void clear_track_vars( struct Gbs_Emu* this )
static void clear_track_vars( struct Gbs_Emu* this )
{
this->current_track_ = -1;
this->out_time = 0;
@ -169,7 +169,7 @@ void Jsr_then_stop( struct Gbs_Emu* this, byte const addr [] )
Write_mem( this, --this->cpu.r.sp, idle_addr );
}
blargg_err_t Run_until( struct Gbs_Emu* this, int end )
static blargg_err_t Run_until( struct Gbs_Emu* this, int end )
{
this->end_time = end;
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 )
return 0;
}
blargg_err_t End_frame( struct Gbs_Emu* this, int end )
static blargg_err_t End_frame( struct Gbs_Emu* this, int end )
{
RETURN_ERR( Run_until( this, end ) );
@ -231,7 +231,7 @@ blargg_err_t Run_clocks( struct Gbs_Emu* this, blip_time_t duration )
return End_frame( this, duration );
}
blargg_err_t play_( struct Gbs_Emu* this, long count, sample_t* out )
static blargg_err_t play_( struct Gbs_Emu* this, long count, sample_t* out )
{
long remain = count;
while ( remain )
@ -399,7 +399,7 @@ blargg_err_t Gbs_start_track( struct Gbs_Emu* this, int track )
// Track
blargg_long msec_to_samples( blargg_long msec, long sample_rate )
static blargg_long msec_to_samples( blargg_long msec, long sample_rate )
{
blargg_long sec = msec / 1000;
msec -= sec * 1000;
@ -421,7 +421,7 @@ blargg_err_t Track_seek( struct Gbs_Emu* this, long msec )
return Track_skip( this, time - this->out_time );
}
blargg_err_t skip_( struct Gbs_Emu* this, long count )
static blargg_err_t skip_( struct Gbs_Emu* this, long count )
{
// for long skip, mute sound
const long threshold = 30000;
@ -496,7 +496,7 @@ static int int_log( blargg_long x, int step, int unit )
return ((unit - fraction) + (fraction >> 1)) >> shift;
}
void handle_fade( struct Gbs_Emu* this, long out_count, sample_t* out )
static void handle_fade( struct Gbs_Emu* this, long out_count, sample_t* out )
{
int i;
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 )
// Silence detection
void emu_play( struct Gbs_Emu* this, long count, sample_t* out )
static void emu_play( struct Gbs_Emu* this, long count, sample_t* out )
{
check( current_track_ >= 0 );
this->emu_time += count;

View file

@ -31,7 +31,7 @@ int const fade_shift = 8; // fade ends with gain at 1.0 / (1 << fade_shift)
const char gme_wrong_file_type [] ICONST_ATTR = "Wrong file type for this emulator";
void clear_track_vars( struct Hes_Emu* this )
static void clear_track_vars( struct Hes_Emu* this )
{
this->current_track_ = -1;
this->out_time = 0;
@ -632,7 +632,7 @@ blargg_err_t Hes_start_track( struct Hes_Emu* this, int track )
// Tell/Seek
blargg_long msec_to_samples( blargg_long msec, long sample_rate )
static blargg_long msec_to_samples( blargg_long msec, long sample_rate )
{
blargg_long sec = msec / 1000;
msec -= sec * 1000;

View file

@ -27,7 +27,7 @@ int const silence_threshold = 0x10;
long const fade_block_size = 512;
int const fade_shift = 8; // fade ends with gain at 1.0 / (1 << fade_shift)
void clear_track_vars( struct Kss_Emu* this )
static void clear_track_vars( struct Kss_Emu* this )
{
this->current_track = -1;
this->out_time = 0;
@ -96,7 +96,7 @@ static blargg_err_t check_kss_header( void const* header )
// Setup
void update_gain( struct Kss_Emu* this )
static void update_gain( struct Kss_Emu* this )
{
int g = this->gain;
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 )
return 0;
}
void set_voice( struct Kss_Emu* this, int i, struct Blip_Buffer* center, struct Blip_Buffer* left, struct Blip_Buffer* right )
static void set_voice( struct Kss_Emu* this, int i, struct Blip_Buffer* center, struct Blip_Buffer* left, struct Blip_Buffer* right )
{
if ( sms_psg_enabled( this ) ) // Sega Master System
{
@ -279,7 +279,7 @@ void jsr( struct Kss_Emu* this, byte const addr [] )
this->cpu.r.pc = get_le16( addr );
}
void set_bank( struct Kss_Emu* this, int logical, int physical )
static void set_bank( struct Kss_Emu* this, int logical, int physical )
{
int const bank_size = (16 * 1024L) >> (this->header.bank_mode >> 7 & 1);
@ -416,7 +416,7 @@ int cpu_in( struct Kss_Emu* this, kss_time_t time, kss_addr_t addr )
return 0xFF;
}
blargg_err_t run_clocks( struct Kss_Emu* this, blip_time_t* duration_ )
static blargg_err_t run_clocks( struct Kss_Emu* this, blip_time_t* duration_ )
{
blip_time_t duration = *duration_;
RETURN_ERR( end_frame( this, duration ) );
@ -623,7 +623,7 @@ blargg_err_t Kss_start_track( struct Kss_Emu* this, int track )
// Tell/Seek
blargg_long msec_to_samples( blargg_long msec, long sample_rate )
static blargg_long msec_to_samples( blargg_long msec, long sample_rate )
{
blargg_long sec = msec / 1000;
msec -= sec * 1000;
@ -646,7 +646,7 @@ blargg_err_t Track_seek( struct Kss_Emu* this, long msec )
}
blargg_err_t play_( struct Kss_Emu* this, long count, sample_t* out );
blargg_err_t skip_( struct Kss_Emu* this, long count )
static blargg_err_t skip_( struct Kss_Emu* this, long count )
{
// for long skip, mute sound
const long threshold = 30000;
@ -720,7 +720,7 @@ static int int_log( blargg_long x, int step, int unit )
return ((unit - fraction) + (fraction >> 1)) >> shift;
}
void handle_fade( struct Kss_Emu *this, long out_count, sample_t* out )
static void handle_fade( struct Kss_Emu *this, long out_count, sample_t* out )
{
int i;
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 )
// Silence detection
void emu_play( struct Kss_Emu* this, long count, sample_t* out )
static void emu_play( struct Kss_Emu* this, long count, sample_t* out )
{
check( current_track_ >= 0 );
this->emu_time += count;

View file

@ -145,7 +145,7 @@ void Apu_run_until( struct Nes_Apu* this, nes_time_t end_time )
}
}
void run_until_( struct Nes_Apu* this, nes_time_t end_time )
static void run_until_( struct Nes_Apu* this, nes_time_t end_time )
{
require( end_time >= this->last_time );

View file

@ -17,7 +17,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
#include "blargg_source.h"
inline void set_code_page( struct Nes_Cpu* this, int i, void const* p )
static inline void set_code_page( struct Nes_Cpu* this, int i, void const* p )
{
byte const* p2 = STATIC_CAST(byte const*,p) - NES_CPU_OFFSET( i * page_size );
this->cpu_state->code_map [i] = p2;

View file

@ -82,7 +82,7 @@ void Square_clock_sweep( struct Nes_Square* this, int negative_adjust )
}
// TODO: clean up
inline nes_time_t Square_maintain_phase( struct Nes_Square* this, nes_time_t time, nes_time_t end_time,
static inline nes_time_t Square_maintain_phase( struct Nes_Square* this, nes_time_t time, nes_time_t end_time,
nes_time_t timer_period )
{
nes_time_t remain = end_time - time;
@ -183,7 +183,7 @@ void Triangle_clock_linear_counter( struct Nes_Triangle* this )
osc->reg_written [3] = false;
}
inline int Triangle_calc_amp( struct Nes_Triangle* this )
static inline int Triangle_calc_amp( struct Nes_Triangle* this )
{
int amp = Triangle_phase_range - this->phase;
if ( amp < 0 )
@ -192,7 +192,7 @@ inline int Triangle_calc_amp( struct Nes_Triangle* this )
}
// TODO: clean up
inline nes_time_t Triangle_maintain_phase( struct Nes_Triangle* this, nes_time_t time, nes_time_t end_time,
static inline nes_time_t Triangle_maintain_phase( struct Nes_Triangle* this, nes_time_t time, nes_time_t end_time,
nes_time_t timer_period )
{
nes_time_t remain = end_time - time;

View file

@ -1,4 +1,4 @@
// Nes_Snd_Emu 0.1.8. http://www.slack.net/~ant/
// Nes_Snd_Emu 0.1.8. http://www.slack.net/~ant/
#include "nes_vrc6_apu.h"
@ -51,7 +51,7 @@ void Vrc6_output( struct Nes_Vrc6_Apu* this, struct Blip_Buffer* buf )
void run_square( struct Nes_Vrc6_Apu* this, struct Vrc6_Osc* osc, blip_time_t end_time );
void run_saw( struct Nes_Vrc6_Apu* this, blip_time_t end_time );
void Vrc6_run_until( struct Nes_Vrc6_Apu* this, blip_time_t time )
static void Vrc6_run_until( struct Nes_Vrc6_Apu* this, blip_time_t time )
{
require( time >= this->last_time );
run_square( this, &this->oscs [0], time );

View file

@ -31,7 +31,7 @@ int const fade_shift = 8; // fade ends with gain at 1.0 / (1 << fade_shift)
int const initial_play_delay = 7; // KikiKaikai needed this to work
int const rom_addr = 0x8000;
void clear_track_vars( struct Nsf_Emu* this )
static void clear_track_vars( struct Nsf_Emu* this )
{
this->current_track = -1;
this->out_time = 0;
@ -82,7 +82,7 @@ void Nsf_init( struct Nsf_Emu* this )
// Setup
blargg_err_t init_sound( struct Nsf_Emu* this )
static blargg_err_t init_sound( struct Nsf_Emu* this )
{
/* if ( header_.chip_flags & ~(fds_flag | namco_flag | vrc6_flag | fme7_flag) )
warning( "Uses unsupported audio expansion hardware" ); **/
@ -168,7 +168,7 @@ blargg_err_t init_sound( struct Nsf_Emu* this )
}
// Header stuff
bool valid_tag( struct header_t* this )
static bool valid_tag( struct header_t* this )
{
return 0 == memcmp( this->tag, "NESM\x1A", 5 );
}
@ -184,7 +184,7 @@ static double clock_rate( struct header_t* this )
return pal_only( this ) ? 1662607.125 : 1789772.727272727;
}
int play_period( struct header_t* this )
static int play_period( struct header_t* this )
{
// NTSC
int clocks = 29780;
@ -370,7 +370,7 @@ void map_memory( struct Nsf_Emu* this )
Cpu_map_code( &this->cpu, rom_addr, fdsram_size, fdsram( this ), 0 );
}
void set_voice( struct Nsf_Emu* this, int i, struct Blip_Buffer* buf, struct Blip_Buffer* left, struct Blip_Buffer* right)
static void set_voice( struct Nsf_Emu* this, int i, struct Blip_Buffer* buf, struct Blip_Buffer* left, struct Blip_Buffer* right)
{
#if defined(ROCKBOX)
(void) left;
@ -500,7 +500,7 @@ inline void push_byte( struct Nsf_Emu* this, int b )
// Jumps to routine, given pointer to address in file header. Pushes idle_addr
// as return address, NOT old PC.
void jsr_then_stop( struct Nsf_Emu* this, byte const addr [] )
static void jsr_then_stop( struct Nsf_Emu* this, byte const addr [] )
{
this->cpu.r.pc = get_addr( addr );
push_byte( this, (idle_addr - 1) >> 8 );
@ -533,7 +533,8 @@ int cpu_read( struct Nsf_Emu* this, addr_t addr )
return addr >> 8;
}
int unmapped_read( struct Nsf_Emu* this, addr_t addr )
#if 0 /* function currently unused */
static int unmapped_read( struct Nsf_Emu* this, addr_t addr )
{
(void) this;
@ -548,6 +549,7 @@ int unmapped_read( struct Nsf_Emu* this, addr_t addr )
// Unmapped read
return addr >> 8;
}
#endif
void cpu_write( struct Nsf_Emu* this, addr_t addr, int data )
{
@ -643,7 +645,8 @@ void cpu_write( struct Nsf_Emu* this, addr_t addr, int data )
// Unmapped_write
}
void unmapped_write( struct Nsf_Emu* this, addr_t addr, int data )
#if 0 /* function currently unused */
static void unmapped_write( struct Nsf_Emu* this, addr_t addr, int data )
{
(void) data;
@ -662,6 +665,7 @@ void unmapped_write( struct Nsf_Emu* this, addr_t addr, int data )
// FDS memory
if ( fds_enabled( this ) && (unsigned) (addr - 0x8000) < 0x6000 ) return;
}
#endif
void fill_buf( struct Nsf_Emu* this );
blargg_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 )
run_once( this, end );
}
void end_frame( struct Nsf_Emu* this, nes_time_t end )
static void end_frame( struct Nsf_Emu* this, nes_time_t end )
{
if ( Cpu_time( &this->cpu ) < end )
run_until( this, end );
@ -833,7 +837,7 @@ void end_frame( struct Nsf_Emu* this, nes_time_t end )
// Tell/Seek
blargg_long msec_to_samples( long sample_rate, blargg_long msec )
static blargg_long msec_to_samples( long sample_rate, blargg_long msec )
{
blargg_long sec = msec / 1000;
msec -= sec * 1000;
@ -932,7 +936,7 @@ static int int_log( blargg_long x, int step, int unit )
return ((unit - fraction) + (fraction >> 1)) >> shift;
}
void handle_fade( struct Nsf_Emu* this, long out_count, sample_t* out )
static void handle_fade( struct Nsf_Emu* this, long out_count, sample_t* out )
{
int i;
for ( i = 0; i < out_count; i += fade_block_size )

View file

@ -36,6 +36,7 @@ struct Opl_Apu {
};
blargg_err_t Opl_init( struct Opl_Apu* this, long clock, long rate, blip_time_t period, enum opl_type_t type );
void Opl_shutdown( struct Opl_Apu* this );
void Opl_reset( struct Opl_Apu* this );
static inline void Opl_volume( struct Opl_Apu* this, int v ) { Synth_volume( &this->synth, v / (4096 * 6) ); }

View file

@ -57,7 +57,7 @@ void Resampler_resize( struct Resampler* this, int pairs )
}
}
void mix_mono( struct Resampler* this, struct Stereo_Buffer* stereo_buf, dsample_t* out_ )
static void mix_mono( struct Resampler* this, struct Stereo_Buffer* stereo_buf, dsample_t* out_ )
{
int const bass = BLIP_READER_BASS( stereo_buf->bufs [0] );
BLIP_READER_BEGIN( sn, stereo_buf->bufs [0] );
@ -90,7 +90,7 @@ void mix_mono( struct Resampler* this, struct Stereo_Buffer* stereo_buf, dsample
BLIP_READER_END( sn, stereo_buf->bufs [0] );
}
void mix_stereo( struct Resampler* this, struct Stereo_Buffer* stereo_buf, dsample_t* out_ )
static void mix_stereo( struct Resampler* this, struct Stereo_Buffer* stereo_buf, dsample_t* out_ )
{
int const bass = BLIP_READER_BASS( stereo_buf->bufs [0] );
BLIP_READER_BEGIN( snc, stereo_buf->bufs [0] );
@ -133,7 +133,7 @@ void mix_stereo( struct Resampler* this, struct Stereo_Buffer* stereo_buf, dsamp
BLIP_READER_END( snr, stereo_buf->bufs [2] );
}
void mix_stereo_no_center( struct Resampler* this, struct Stereo_Buffer* stereo_buf, dsample_t* out_ )
static void mix_stereo_no_center( struct Resampler* this, struct Stereo_Buffer* stereo_buf, dsample_t* out_ )
{
int const bass = BLIP_READER_BASS( stereo_buf->bufs [0] );
BLIP_READER_BEGIN( snl, stereo_buf->bufs [1] );
@ -171,7 +171,7 @@ void mix_stereo_no_center( struct Resampler* this, struct Stereo_Buffer* stereo_
BLIP_READER_END( snr, stereo_buf->bufs [2] );
}
dsample_t const* resample_( struct Resampler* this, dsample_t** out_,
static dsample_t const* resample_( struct Resampler* this, dsample_t** out_,
dsample_t const* out_end, dsample_t const in [], int in_size )
{
in_size -= write_offset;
@ -209,7 +209,7 @@ dsample_t const* resample_( struct Resampler* this, dsample_t** out_,
return in;
}
inline int resample_wrapper( struct Resampler* this, dsample_t out [], int* out_size,
static inline int resample_wrapper( struct Resampler* this, dsample_t out [], int* out_size,
dsample_t const in [], int in_size )
{
assert( Resampler_rate( this ) );
@ -223,7 +223,7 @@ inline int resample_wrapper( struct Resampler* this, dsample_t out [], int* out_
return result;
}
int skip_input( struct Resampler* this, int count )
static int skip_input( struct Resampler* this, int count )
{
this->write_pos -= count;
if ( this->write_pos < 0 ) // occurs when downsampling
@ -235,7 +235,7 @@ int skip_input( struct Resampler* this, int count )
return count;
}
void play_frame_( struct Resampler* this, struct Stereo_Buffer* stereo_buf, dsample_t* out )
static void play_frame_( struct Resampler* this, struct Stereo_Buffer* stereo_buf, dsample_t* out )
{
long pair_count = this->sample_buf_size >> 1;
blip_time_t blip_time = Blip_count_clocks( &stereo_buf->bufs [0], pair_count );

View file

@ -25,7 +25,7 @@ int const fade_shift = 8; // fade ends with gain at 1.0 / (1 << fade_shift)
const char gme_wrong_file_type [] = "Wrong file type for this emulator";
void clear_track_vars( struct Sgc_Emu* this )
static void clear_track_vars( struct Sgc_Emu* this )
{
this->current_track = -1;
this->out_time = 0;
@ -110,7 +110,7 @@ blargg_err_t Sgc_load_mem( struct Sgc_Emu* this, const void* data, long size )
return 0;
}
void Sound_set_voice( struct Sgc_Emu* this, int i, struct Blip_Buffer* c, struct Blip_Buffer* l, struct Blip_Buffer* r )
static void Sound_set_voice( struct Sgc_Emu* this, int i, struct Blip_Buffer* c, struct Blip_Buffer* l, struct Blip_Buffer* r )
{
if ( i < sms_osc_count )
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
Fm_apu_set_output( &this->fm_apu, c );
}
blargg_err_t run_clocks( struct Sgc_Emu* this, blip_time_t* duration, int msec )
static blargg_err_t run_clocks( struct Sgc_Emu* this, blip_time_t* duration, int msec )
{
#if defined(ROCKBOX)
(void) msec;
@ -207,7 +207,7 @@ void jsr( struct Sgc_Emu* this, byte addr [2] )
this->cpu.r.pc = get_le16( addr );
}
void set_bank( struct Sgc_Emu* this, int bank, void const* data )
static void set_bank( struct Sgc_Emu* this, int bank, void const* data )
{
//dprintf( "map bank %d to %p\n", bank, (byte*) data - rom.at_addr( 0 ) );
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 )
// Tell/Seek
blargg_long msec_to_samples( blargg_long msec, long sample_rate )
static blargg_long msec_to_samples( blargg_long msec, long sample_rate )
{
blargg_long sec = msec / 1000;
msec -= sec * 1000;
@ -509,7 +509,7 @@ static int int_log( blargg_long x, int step, int unit )
return ((unit - fraction) + (fraction >> 1)) >> shift;
}
void handle_fade( struct Sgc_Emu* this, long out_count, sample_t* out )
static void handle_fade( struct Sgc_Emu* this, long out_count, sample_t* out )
{
int i;
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 )
// Silence detection
void emu_play( struct Sgc_Emu* this, long count, sample_t* out )
static void emu_play( struct Sgc_Emu* this, long count, sample_t* out )
{
check( this->current_track_ >= 0 );
this->emu_time += count;

View file

@ -23,7 +23,7 @@ void Sms_apu_volume( struct Sms_Apu* this, int vol )
Synth_volume( &this->synth, vol );
}
inline int calc_output( struct Sms_Apu* this, int i )
static inline int calc_output( struct Sms_Apu* this, int i )
{
int flags = this->ggstereo >> i;
return (flags >> 3 & 2) | (flags & 1);

View file

@ -53,7 +53,7 @@ enum {
ym2612_dac_pan_port = 0xB6
};
void clear_track_vars( struct Vgm_Emu* this )
static void clear_track_vars( struct Vgm_Emu* this )
{
this->out_time = 0;
this->emu_time = 0;
@ -165,7 +165,7 @@ static long check_gd3_header( byte const* h, long remain )
return gd3_size;
}
byte const* gd3_data( struct Vgm_Emu* this, int* size )
static byte const* gd3_data( struct Vgm_Emu* this, int* size )
{
if ( size )
*size = 0;
@ -205,7 +205,7 @@ static void get_vgm_length( struct header_t const* h, struct track_info_t* out )
}
}
blargg_err_t track_info( struct Vgm_Emu* this, struct track_info_t* out )
static blargg_err_t track_info( struct Vgm_Emu* this, struct track_info_t* out )
{
memset(out, 0, sizeof out);
get_vgm_length( header( this ), out );
@ -225,7 +225,7 @@ static blargg_err_t check_vgm_header( struct header_t* h )
return 0;
}
void set_voice( struct Vgm_Emu* this, int i, struct Blip_Buffer* c, struct Blip_Buffer* l, struct Blip_Buffer* r )
static void set_voice( struct Vgm_Emu* this, int i, struct Blip_Buffer* c, struct Blip_Buffer* l, struct Blip_Buffer* r )
{
if ( i < sms_osc_count ) {
int j;
@ -310,7 +310,7 @@ blargg_err_t Vgm_load_mem( struct Vgm_Emu* this, byte const* new_data, long new_
}
void update_fm_rates( struct Vgm_Emu* this, int* ym2413_rate, int* ym2612_rate );
blargg_err_t init_fm( struct Vgm_Emu* this, double* rate )
static blargg_err_t init_fm( struct Vgm_Emu* this, double* rate )
{
int ym2612_rate = get_le32( header( this )->ym2612_rate );
int ym2413_rate = get_le32( header( this )->ym2413_rate );
@ -365,7 +365,7 @@ blargg_err_t setup_fm( struct Vgm_Emu* this )
// Emulation
blip_time_t run( struct Vgm_Emu* this, vgm_time_t end_time );
blargg_err_t run_clocks( struct Vgm_Emu* this, blip_time_t* time_io, int msec )
static blargg_err_t run_clocks( struct Vgm_Emu* this, blip_time_t* time_io, int msec )
{
*time_io = run( this, msec * this->vgm_rate / 1000 );
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 )
blargg_err_t play_( struct Vgm_Emu* this, long count, sample_t* out )
static blargg_err_t play_( struct Vgm_Emu* this, long count, sample_t* out )
{
if ( !uses_fm( this ) ) {
long remain = count;
@ -407,7 +407,7 @@ blargg_err_t play_( struct Vgm_Emu* this, long count, sample_t* out )
// Vgm_Emu_impl
inline int command_len( int command )
static inline int command_len( int command )
{
static byte const lens [0x10] ICONST_ATTR = {
// 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 )
return len;
}
inline fm_time_t to_fm_time( struct Vgm_Emu* this, vgm_time_t t )
static inline fm_time_t to_fm_time( struct Vgm_Emu* this, vgm_time_t t )
{
return (t * this->fm_time_factor + this->fm_time_offset) >> fm_time_bits;
}
inline blip_time_t to_psg_time( struct Vgm_Emu* this, vgm_time_t t )
static inline blip_time_t to_psg_time( struct Vgm_Emu* this, vgm_time_t t )
{
return (t * this->blip_time_factor) >> blip_time_bits;
}
void write_pcm( struct Vgm_Emu* this, vgm_time_t vgm_time, int amp )
static void write_pcm( struct Vgm_Emu* this, vgm_time_t vgm_time, int amp )
{
if ( this->blip_buf )
{
@ -820,7 +820,7 @@ blargg_err_t Vgm_start_track( struct Vgm_Emu* this )
// Tell/Seek
blargg_long msec_to_samples( blargg_long msec, long sample_rate )
static blargg_long msec_to_samples( blargg_long msec, long sample_rate )
{
blargg_long sec = msec / 1000;
msec -= sec * 1000;
@ -916,7 +916,7 @@ static int int_log( blargg_long x, int step, int unit )
return ((unit - fraction) + (fraction >> 1)) >> shift;
}
void handle_fade( struct Vgm_Emu* this, long out_count, sample_t* out )
static void handle_fade( struct Vgm_Emu* this, long out_count, sample_t* out )
{
int i;
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 )
// Silence detection
void emu_play( struct Vgm_Emu* this, long count, sample_t* out )
static void emu_play( struct Vgm_Emu* this, long count, sample_t* out )
{
this->emu_time += count;
if ( !this->emu_track_ended_ ) {

View file

@ -86,7 +86,7 @@ static const unsigned char LFO_FMS_TAB [8] ICONST_ATTR =
int in0, in1, in2, in3; // current phase calculation
// int en0, en1, en2, en3; // current enveloppe calculation
inline void set_seg( struct slot_t* s, int seg )
static inline void set_seg( struct slot_t* s, int seg )
{
s->env_xor = 0;
s->env_max = INT_MAX;
@ -98,9 +98,9 @@ inline void set_seg( struct slot_t* s, int seg )
}
}
inline void YM2612_Special_Update(void) { }
static inline void YM2612_Special_Update(void) { }
void KEY_ON( struct channel_* ch, struct tables_t *g, int nsl )
static void KEY_ON( struct channel_* ch, struct tables_t *g, int nsl )
{
struct slot_t *SL = &(ch->SLOT [nsl]); // on recupere le bon pointeur de slot
@ -123,7 +123,7 @@ void KEY_ON( struct channel_* ch, struct tables_t *g, int nsl )
}
void KEY_OFF( struct channel_* ch, struct tables_t *g, int nsl )
static void KEY_OFF( struct channel_* ch, struct tables_t *g, int nsl )
{
struct slot_t *SL = &(ch->SLOT [nsl]); // on recupere le bon pointeur de slot
@ -141,7 +141,7 @@ void KEY_OFF( struct channel_* ch, struct tables_t *g, int nsl )
}
int SLOT_SET( struct Ym2612_Impl* impl, int Adr, int data )
static int SLOT_SET( struct Ym2612_Impl* impl, int Adr, int data )
{
int nch = Adr & 3;
if ( nch == 3 )
@ -245,7 +245,7 @@ int SLOT_SET( struct Ym2612_Impl* impl, int Adr, int data )
}
int CHANNEL_SET( struct state_t* YM2612, int Adr, int data )
static int CHANNEL_SET( struct state_t* YM2612, int Adr, int data )
{
int num = Adr & 3;
if ( num == 3 )
@ -348,7 +348,7 @@ int CHANNEL_SET( struct state_t* YM2612, int Adr, int data )
}
int YM_SET( struct Ym2612_Impl* impl, int Adr, int data )
static int YM_SET( struct Ym2612_Impl* impl, int Adr, int data )
{
struct state_t* YM2612 = &impl->YM2612;
struct tables_t* g = &impl->g;
@ -480,7 +480,7 @@ double ipow(double a,int b)
#endif
void impl_reset( struct Ym2612_Impl* impl );
void impl_set_rate( struct Ym2612_Impl* impl, double sample_rate, double clock_rate )
static void impl_set_rate( struct Ym2612_Impl* impl, double sample_rate, double clock_rate )
{
assert( sample_rate );
assert( !clock_rate || clock_rate > sample_rate );
@ -695,7 +695,7 @@ const char* Ym2612_set_rate( struct Ym2612_Emu* this, double sample_rate, double
return 0;
}
inline void write0( struct Ym2612_Impl* impl, int opn_addr, int data )
static inline void write0( struct Ym2612_Impl* impl, int opn_addr, int data )
{
assert( (unsigned) data <= 0xFF );
@ -715,7 +715,7 @@ inline void write0( struct Ym2612_Impl* impl, int opn_addr, int data )
}
}
inline void write1( struct Ym2612_Impl* impl, int opn_addr, int data )
static inline void write1( struct Ym2612_Impl* impl, int opn_addr, int data )
{
assert( (unsigned) data <= 0xFF );
@ -954,7 +954,7 @@ ch->SLOT [S1].Fcnt = in1; \
ch->SLOT [S2].Fcnt = in2; \
ch->SLOT [S3].Fcnt = in3;
void ym2612_update_chan0( struct tables_t* g, struct channel_* ch,
static void ym2612_update_chan0( struct tables_t* g, struct channel_* ch,
short* buf, int length )
{
int not_end = ch->SLOT [S3].Ecnt - ENV_END;
@ -987,7 +987,7 @@ void ym2612_update_chan0( struct tables_t* g, struct channel_* ch,
UPDATE_PHASE
}
void ym2612_update_chan1( struct tables_t* g, struct channel_* ch,
static void ym2612_update_chan1( struct tables_t* g, struct channel_* ch,
short* buf, int length )
{
int not_end = ch->SLOT [S3].Ecnt - ENV_END;
@ -1019,7 +1019,7 @@ void ym2612_update_chan1( struct tables_t* g, struct channel_* ch,
UPDATE_PHASE
}
void ym2612_update_chan2( struct tables_t* g, struct channel_* ch,
static void ym2612_update_chan2( struct tables_t* g, struct channel_* ch,
short* buf, int length )
{
int not_end = ch->SLOT [S3].Ecnt - ENV_END;
@ -1051,7 +1051,7 @@ void ym2612_update_chan2( struct tables_t* g, struct channel_* ch,
UPDATE_PHASE
}
void ym2612_update_chan3( struct tables_t* g, struct channel_* ch,
static void ym2612_update_chan3( struct tables_t* g, struct channel_* ch,
short* buf, int length )
{
int not_end = ch->SLOT [S3].Ecnt - ENV_END;
@ -1084,7 +1084,7 @@ void ym2612_update_chan3( struct tables_t* g, struct channel_* ch,
UPDATE_PHASE
}
void ym2612_update_chan4( struct tables_t* g, struct channel_* ch,
static void ym2612_update_chan4( struct tables_t* g, struct channel_* ch,
short* buf, int length )
{
int not_end = ch->SLOT [S3].Ecnt - ENV_END;
@ -1118,7 +1118,7 @@ void ym2612_update_chan4( struct tables_t* g, struct channel_* ch,
UPDATE_PHASE
}
void ym2612_update_chan5( struct tables_t* g, struct channel_* ch,
static void ym2612_update_chan5( struct tables_t* g, struct channel_* ch,
short* buf, int length )
{
int not_end = ch->SLOT [S3].Ecnt - ENV_END;
@ -1154,7 +1154,7 @@ void ym2612_update_chan5( struct tables_t* g, struct channel_* ch,
UPDATE_PHASE
}
void ym2612_update_chan6( struct tables_t* g, struct channel_* ch,
static void ym2612_update_chan6( struct tables_t* g, struct channel_* ch,
short* buf, int length )
{
int not_end = ch->SLOT [S3].Ecnt - ENV_END;
@ -1189,7 +1189,7 @@ void ym2612_update_chan6( struct tables_t* g, struct channel_* ch,
UPDATE_PHASE
}
void ym2612_update_chan7( struct tables_t* g, struct channel_* ch,
static void ym2612_update_chan7( struct tables_t* g, struct channel_* ch,
short* buf, int length )
{
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,
(void *)ym2612_update_chan7
};
void run_timer( struct Ym2612_Impl* impl, int length )
static void run_timer( struct Ym2612_Impl* impl, int length )
{
int const step = 6;
int remain = length;
@ -1284,7 +1284,7 @@ void run_timer( struct Ym2612_Impl* impl, int length )
while ( remain > 0 );
}
void impl_run( struct Ym2612_Impl* impl, int pair_count, short out [] )
static void impl_run( struct Ym2612_Impl* impl, int pair_count, short out [] )
{
if ( pair_count <= 0 )
return;

View file

@ -44,7 +44,7 @@ void Z80_init( struct Z80_Cpu* this )
this->szpc [0x100] |= Z40;
}
inline void set_page( struct Z80_Cpu* this, int i, void* write, void const* read )
static inline void set_page( struct Z80_Cpu* this, int i, void* write, void const* read )
{
int offset = Z80_CPU_OFFSET( i * page_size );
byte * write2 = STATIC_CAST(byte *,write) - offset;

View file

@ -108,7 +108,7 @@ static void copy_ay_fields( struct file_t const* file, struct mp3entry* id3, int
if (tmp) id3->comment = tmp;
}
bool parse_ay_header(int fd, struct mp3entry *id3)
static bool parse_ay_header(int fd, struct mp3entry *id3)
{
/* Use the trackname part of the id3 structure as a temporary buffer */
unsigned char* buf = (unsigned char *)id3->id3v2buf;

View file

@ -10,7 +10,7 @@
#include "metadata_parsers.h"
#include "rbunicode.h"
bool parse_gbs_header(int fd, struct mp3entry* id3)
static bool parse_gbs_header(int fd, struct mp3entry* id3)
{
/* Use the trackname part of the id3 structure as a temporary buffer */
unsigned char* buf = (unsigned char *)id3->path;

View file

@ -10,7 +10,7 @@
#include "metadata_parsers.h"
#include "rbunicode.h"
bool parse_kss_header(int fd, struct mp3entry* id3)
static bool parse_kss_header(int fd, struct mp3entry* id3)
{
/* Use the trackname part of the id3 structure as a temporary buffer */
unsigned char* buf = (unsigned char *)id3->path;

View file

@ -10,7 +10,7 @@
#include "metadata_parsers.h"
#include "rbunicode.h"
bool parse_sgc_header(int fd, struct mp3entry* id3)
static bool parse_sgc_header(int fd, struct mp3entry* id3)
{
/* Use the trackname part of the id3 structure as a temporary buffer */
unsigned char* buf = (unsigned char *)id3->path;