Declare several libgme functions static.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30394 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Andree Buschmann 2011-08-31 09:15:04 +00:00
parent 7e14b935df
commit 5cfec21350
9 changed files with 17 additions and 35 deletions

View file

@ -30,7 +30,7 @@ void Osc_reset( struct Gb_Osc* this )
this->enabled = false;
}
inline void Osc_update_amp( struct Gb_Osc* this, blip_time_t time, int new_amp )
static inline void Osc_update_amp( struct Gb_Osc* this, blip_time_t time, int new_amp )
{
Blip_set_modified( this->output );
int delta = new_amp - this->last_amp;
@ -76,14 +76,14 @@ void Square_clock_envelope( struct Gb_Square* this )
}
}
inline void reload_sweep_timer( struct Gb_Square* this )
static inline void reload_sweep_timer( struct Gb_Square* this )
{
this->sweep_delay = (this->osc.regs [0] & period_mask) >> 4;
if ( !this->sweep_delay )
this->sweep_delay = 8;
}
void calc_sweep( struct Gb_Square* this, bool update )
static void calc_sweep( struct Gb_Square* this, bool update )
{
struct Gb_Osc* osc = &this->osc;
int const shift = osc->regs [0] & shift_mask;
@ -234,7 +234,7 @@ static inline void Square_zombie_volume( struct Gb_Square* this, int old, int da
this->volume = v & 0x0F;
}
bool Square_write_register( struct Gb_Square* this, int frame_phase, int reg, int old_data, int data )
static bool Square_write_register( struct Gb_Square* this, int frame_phase, int reg, int old_data, int data )
{
int const max_len = 64;
@ -275,7 +275,7 @@ bool Square_write_register( struct Gb_Square* this, int frame_phase, int reg, in
return false;
}
inline void Noise_write_register( struct Gb_Noise* this, int frame_phase, int reg, int old_data, int data )
static inline void Noise_write_register( struct Gb_Noise* this, int frame_phase, int reg, int old_data, int data )
{
int const max_len = 64;
@ -315,7 +315,7 @@ inline void Noise_write_register( struct Gb_Noise* this, int frame_phase, int re
}
}
inline void Sweep_write_register( struct Gb_Square* this, int frame_phase, int reg, int old_data, int data )
static inline void Sweep_write_register( struct Gb_Square* this, int frame_phase, int reg, int old_data, int data )
{
if ( reg == 0 && this->sweep_enabled && this->sweep_neg && !(data & 0x08) )
this->osc.enabled = false; // sweep negate disabled after used
@ -331,7 +331,7 @@ inline void Sweep_write_register( struct Gb_Square* this, int frame_phase, int r
}
}
void corrupt_wave( struct Gb_Wave* this )
static void corrupt_wave( struct Gb_Wave* this )
{
int pos = ((this->osc.phase + 1) & (wave_bank_size - 1)) >> 1;
if ( pos < 4 )
@ -343,7 +343,7 @@ void corrupt_wave( struct Gb_Wave* this )
}
}
inline void Wave_write_register( struct Gb_Wave* this, int frame_phase, int reg, int old_data, int data )
static inline void Wave_write_register( struct Gb_Wave* this, int frame_phase, int reg, int old_data, int data )
{
int const max_len = 256;

View file

@ -36,9 +36,7 @@ struct Gb_Osc {
// 11-bit frequency in NRx3 and NRx4
static inline int Osc_frequency( struct Gb_Osc* this ) { return (this->regs [4] & 7) * 0x100 + this->regs [3]; }
void Osc_update_amp( struct Gb_Osc* this, blip_time_t, int new_amp );
int Osc_write_trig( struct Gb_Osc* this, int frame_phase, int max_len, int old_data );
void Osc_clock_length( struct Gb_Osc* this );
void Osc_reset( struct Gb_Osc* this );
@ -61,7 +59,6 @@ struct Gb_Square {
bool sweep_neg;
};
bool Square_write_register( struct Gb_Square* this, int frame_phase, int reg, int old_data, int data );
void Square_run( struct Gb_Square* this, blip_time_t, blip_time_t );
void Square_clock_envelope( struct Gb_Square* this );
@ -85,7 +82,6 @@ static inline int Square_reload_env_timer( struct Gb_Square* this )
// Sweep square
void clock_sweep( struct Gb_Square* this );
void Sweep_write_register( struct Gb_Square* this, int frame_phase, int reg, int old_data, int data );
static inline void Sweep_reset( struct Gb_Square* this )
{
@ -99,9 +95,6 @@ static inline void Sweep_reset( struct Gb_Square* this )
Osc_reset( &this->osc );
this->osc.delay = 0x40000000; // TODO: something less hacky (never clocked until first trigger)
}
void calc_sweep( struct Gb_Square* this, bool update );
void reload_sweep_timer( struct Gb_Square* this );
// Noise
@ -118,7 +111,6 @@ struct Gb_Noise {
};
void Noise_run( struct Gb_Noise* this, blip_time_t, blip_time_t );
void Noise_write_register( struct Gb_Noise* this, int frame_phase, int reg, int old_data, int data );
static inline void Noise_reset( struct Gb_Noise* this )
{
@ -159,7 +151,6 @@ struct Gb_Wave {
uint8_t* wave_ram; // 32 bytes (64 nybbles), stored in APU
};
void Wave_write_register( struct Gb_Wave* this, int frame_phase, int reg, int old_data, int data );
void Wave_run( struct Gb_Wave* this, blip_time_t, blip_time_t );
static inline void Wave_reset( struct Gb_Wave* this )
@ -174,8 +165,6 @@ static inline int Wave_period( struct Gb_Wave* this ) { return (2048 - Osc_frequ
// Non-zero if DAC is enabled
static inline int Wave_dac_enabled( struct Gb_Wave* this ) { return this->osc.regs [0] & 0x80; }
void corrupt_wave( struct Gb_Wave* this );
static inline uint8_t* wave_bank( struct Gb_Wave* this ) { return &this->wave_ram [(~this->osc.regs [0] & bank40_mask) >> 2 & this->agb_mask]; }
// Wave index that would be accessed, or -1 if no access would occur

View file

@ -29,7 +29,7 @@ int Read_mem( struct Gbs_Emu* this, addr_t addr )
return LOG_MEM( addr, ">", result );
}
inline void Write_io_inline( struct Gbs_Emu* this, int offset, int data, int base )
static inline void Write_io_inline( struct Gbs_Emu* this, int offset, int data, int base )
{
if ( (unsigned) (offset - (io_addr - base)) < io_size )
Apu_write_register( &this->apu, Time( this ), offset + base, data & 0xFF );
@ -66,12 +66,12 @@ void Write_mem( struct Gbs_Emu* this, addr_t addr, int data )
#endif
}
void Write_io_( struct Gbs_Emu* this, int offset, int data )
static void Write_io_( struct Gbs_Emu* this, int offset, int data )
{
Write_io_inline( this, offset, data, io_base );
}
inline void Write_io( struct Gbs_Emu* this, int offset, int data )
static inline void Write_io( struct Gbs_Emu* this, int offset, int data )
{
(void) LOG_MEM( offset + io_base, "<", data );
@ -80,7 +80,7 @@ inline void Write_io( struct Gbs_Emu* this, int offset, int data )
Write_io_( this, offset, data );
}
int Read_io( struct Gbs_Emu* this, int offset )
static int Read_io( struct Gbs_Emu* this, int offset )
{
int const io_base = 0xFF00;
int result = this->ram [io_base - ram_addr + offset];

View file

@ -196,9 +196,5 @@ static inline blip_time_t Time( struct Gbs_Emu* this )
}
void Jsr_then_stop( struct Gbs_Emu* this, byte const [] );
void Write_io_inline( struct Gbs_Emu* this, int offset, int data, int base );
void Write_io_( struct Gbs_Emu* this, int offset, int data );
int Read_io( struct Gbs_Emu* this, int offset );
void Write_io( struct Gbs_Emu* this, int offset, int data );
#endif

View file

@ -334,7 +334,7 @@ static short const dmc_period_table [2] [16] = {
176, 148, 132, 118, 98, 78, 66, 50}
};
inline void Dmc_reload_sample( struct Nes_Dmc* this )
static inline void Dmc_reload_sample( struct Nes_Dmc* this )
{
this->address = 0x4000 + this->osc.regs [2] * 0x40;
this->osc.length_counter = this->osc.regs [3] * 0x10 + 1;

View file

@ -157,7 +157,6 @@ void Dmc_write_register( struct Nes_Dmc* this, int, int );
void Dmc_run( struct Nes_Dmc* this, nes_time_t, nes_time_t );
void Dmc_recalc_irq( struct Nes_Dmc* this );
void Dmc_fill_buffer( struct Nes_Dmc* this );
void Dmc_reload_sample( struct Nes_Dmc* this );
void Dmc_reset( struct Nes_Dmc* this );
int Dmc_count_reads( struct Nes_Dmc* this, nes_time_t, nes_time_t* );

View file

@ -330,7 +330,7 @@ void write_bank( struct Nsf_Emu* this, int bank, int data )
Cpu_map_code( &this->cpu, (bank + 6) * this->rom.bank_size, this->rom.bank_size, rom_data, false );
}
void map_memory( struct Nsf_Emu* this )
static void map_memory( struct Nsf_Emu* this )
{
// Map standard things
Cpu_reset( &this->cpu, unmapped_code( this ) );
@ -493,7 +493,7 @@ void Sound_set_tempo( struct Nsf_Emu* this, int t )
#endif
}
inline void push_byte( struct Nsf_Emu* this, int b )
static inline void push_byte( struct Nsf_Emu* this, int b )
{
this->low_ram [0x100 + this->cpu.r.sp--] = b;
}

View file

@ -209,11 +209,9 @@ static inline void Sound_set_gain( struct Nsf_Emu* this, int g )
blargg_err_t run_clocks( struct Nsf_Emu* this, blip_time_t* duration, int );
void map_memory( struct Nsf_Emu* this );
void write_bank( struct Nsf_Emu* this, int index, int data );
int cpu_read( struct Nsf_Emu* this, addr_t );
void cpu_write( struct Nsf_Emu* this, addr_t, int );
void push_byte( struct Nsf_Emu* this, int );
addr_t get_addr( byte const [] );
bool run_cpu_until( struct Nsf_Emu* this, nes_time_t end );

View file

@ -135,7 +135,7 @@ sample_t const* resample_( struct Resampler* this, sample_t** out_,
return in;
}
inline int resample_wrapper( struct Resampler* this, sample_t out [], int* out_size,
static inline int resample_wrapper( struct Resampler* this, sample_t out [], int* out_size,
sample_t const in [], int in_size )
{
assert( Resampler_rate( this ) );