diff options
author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-08-31 09:15:04 +0000 |
---|---|---|
committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-08-31 09:15:04 +0000 |
commit | 5cfec213509f7d9e3e3e0f2b97288a010899dbd9 (patch) | |
tree | 432957ad5dc8b45baf98e99bbe62979d804cf1f9 /apps/codecs/libgme | |
parent | 7e14b935dfdcd808cfb0703d19a43efd11eeef16 (diff) | |
download | rockbox-5cfec213509f7d9e3e3e0f2b97288a010899dbd9.tar.gz rockbox-5cfec213509f7d9e3e3e0f2b97288a010899dbd9.zip |
Declare several libgme functions static.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30394 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libgme')
-rw-r--r-- | apps/codecs/libgme/gb_oscs.c | 16 | ||||
-rw-r--r-- | apps/codecs/libgme/gb_oscs.h | 13 | ||||
-rw-r--r-- | apps/codecs/libgme/gbs_cpu.c | 8 | ||||
-rw-r--r-- | apps/codecs/libgme/gbs_emu.h | 4 | ||||
-rw-r--r-- | apps/codecs/libgme/nes_oscs.c | 2 | ||||
-rw-r--r-- | apps/codecs/libgme/nes_oscs.h | 1 | ||||
-rw-r--r-- | apps/codecs/libgme/nsf_emu.c | 4 | ||||
-rw-r--r-- | apps/codecs/libgme/nsf_emu.h | 2 | ||||
-rw-r--r-- | apps/codecs/libgme/resampler.c | 2 |
9 files changed, 17 insertions, 35 deletions
diff --git a/apps/codecs/libgme/gb_oscs.c b/apps/codecs/libgme/gb_oscs.c index b136e3b218..09bb98238e 100644 --- a/apps/codecs/libgme/gb_oscs.c +++ b/apps/codecs/libgme/gb_oscs.c | |||
@@ -30,7 +30,7 @@ void Osc_reset( struct Gb_Osc* this ) | |||
30 | this->enabled = false; | 30 | this->enabled = false; |
31 | } | 31 | } |
32 | 32 | ||
33 | inline void Osc_update_amp( struct Gb_Osc* this, blip_time_t time, int new_amp ) | 33 | static inline void Osc_update_amp( struct Gb_Osc* this, blip_time_t time, int new_amp ) |
34 | { | 34 | { |
35 | Blip_set_modified( this->output ); | 35 | Blip_set_modified( this->output ); |
36 | int delta = new_amp - this->last_amp; | 36 | int delta = new_amp - this->last_amp; |
@@ -76,14 +76,14 @@ void Square_clock_envelope( struct Gb_Square* this ) | |||
76 | } | 76 | } |
77 | } | 77 | } |
78 | 78 | ||
79 | inline void reload_sweep_timer( struct Gb_Square* this ) | 79 | static inline void reload_sweep_timer( struct Gb_Square* this ) |
80 | { | 80 | { |
81 | this->sweep_delay = (this->osc.regs [0] & period_mask) >> 4; | 81 | this->sweep_delay = (this->osc.regs [0] & period_mask) >> 4; |
82 | if ( !this->sweep_delay ) | 82 | if ( !this->sweep_delay ) |
83 | this->sweep_delay = 8; | 83 | this->sweep_delay = 8; |
84 | } | 84 | } |
85 | 85 | ||
86 | void calc_sweep( struct Gb_Square* this, bool update ) | 86 | static void calc_sweep( struct Gb_Square* this, bool update ) |
87 | { | 87 | { |
88 | struct Gb_Osc* osc = &this->osc; | 88 | struct Gb_Osc* osc = &this->osc; |
89 | int const shift = osc->regs [0] & shift_mask; | 89 | 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 | |||
234 | this->volume = v & 0x0F; | 234 | this->volume = v & 0x0F; |
235 | } | 235 | } |
236 | 236 | ||
237 | bool Square_write_register( struct Gb_Square* this, int frame_phase, int reg, int old_data, int data ) | 237 | static bool Square_write_register( struct Gb_Square* this, int frame_phase, int reg, int old_data, int data ) |
238 | { | 238 | { |
239 | int const max_len = 64; | 239 | int const max_len = 64; |
240 | 240 | ||
@@ -275,7 +275,7 @@ bool Square_write_register( struct Gb_Square* this, int frame_phase, int reg, in | |||
275 | return false; | 275 | return false; |
276 | } | 276 | } |
277 | 277 | ||
278 | inline void Noise_write_register( struct Gb_Noise* this, int frame_phase, int reg, int old_data, int data ) | 278 | static inline void Noise_write_register( struct Gb_Noise* this, int frame_phase, int reg, int old_data, int data ) |
279 | { | 279 | { |
280 | int const max_len = 64; | 280 | int const max_len = 64; |
281 | 281 | ||
@@ -315,7 +315,7 @@ inline void Noise_write_register( struct Gb_Noise* this, int frame_phase, int re | |||
315 | } | 315 | } |
316 | } | 316 | } |
317 | 317 | ||
318 | inline void Sweep_write_register( struct Gb_Square* this, int frame_phase, int reg, int old_data, int data ) | 318 | static inline void Sweep_write_register( struct Gb_Square* this, int frame_phase, int reg, int old_data, int data ) |
319 | { | 319 | { |
320 | if ( reg == 0 && this->sweep_enabled && this->sweep_neg && !(data & 0x08) ) | 320 | if ( reg == 0 && this->sweep_enabled && this->sweep_neg && !(data & 0x08) ) |
321 | this->osc.enabled = false; // sweep negate disabled after used | 321 | 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 | |||
331 | } | 331 | } |
332 | } | 332 | } |
333 | 333 | ||
334 | void corrupt_wave( struct Gb_Wave* this ) | 334 | static void corrupt_wave( struct Gb_Wave* this ) |
335 | { | 335 | { |
336 | int pos = ((this->osc.phase + 1) & (wave_bank_size - 1)) >> 1; | 336 | int pos = ((this->osc.phase + 1) & (wave_bank_size - 1)) >> 1; |
337 | if ( pos < 4 ) | 337 | if ( pos < 4 ) |
@@ -343,7 +343,7 @@ void corrupt_wave( struct Gb_Wave* this ) | |||
343 | } | 343 | } |
344 | } | 344 | } |
345 | 345 | ||
346 | inline void Wave_write_register( struct Gb_Wave* this, int frame_phase, int reg, int old_data, int data ) | 346 | static inline void Wave_write_register( struct Gb_Wave* this, int frame_phase, int reg, int old_data, int data ) |
347 | { | 347 | { |
348 | int const max_len = 256; | 348 | int const max_len = 256; |
349 | 349 | ||
diff --git a/apps/codecs/libgme/gb_oscs.h b/apps/codecs/libgme/gb_oscs.h index 7245b4ca50..3c8dfef51f 100644 --- a/apps/codecs/libgme/gb_oscs.h +++ b/apps/codecs/libgme/gb_oscs.h | |||
@@ -36,9 +36,7 @@ struct Gb_Osc { | |||
36 | 36 | ||
37 | // 11-bit frequency in NRx3 and NRx4 | 37 | // 11-bit frequency in NRx3 and NRx4 |
38 | static inline int Osc_frequency( struct Gb_Osc* this ) { return (this->regs [4] & 7) * 0x100 + this->regs [3]; } | 38 | static inline int Osc_frequency( struct Gb_Osc* this ) { return (this->regs [4] & 7) * 0x100 + this->regs [3]; } |
39 | 39 | ||
40 | void Osc_update_amp( struct Gb_Osc* this, blip_time_t, int new_amp ); | ||
41 | int Osc_write_trig( struct Gb_Osc* this, int frame_phase, int max_len, int old_data ); | ||
42 | void Osc_clock_length( struct Gb_Osc* this ); | 40 | void Osc_clock_length( struct Gb_Osc* this ); |
43 | void Osc_reset( struct Gb_Osc* this ); | 41 | void Osc_reset( struct Gb_Osc* this ); |
44 | 42 | ||
@@ -61,7 +59,6 @@ struct Gb_Square { | |||
61 | bool sweep_neg; | 59 | bool sweep_neg; |
62 | }; | 60 | }; |
63 | 61 | ||
64 | bool Square_write_register( struct Gb_Square* this, int frame_phase, int reg, int old_data, int data ); | ||
65 | void Square_run( struct Gb_Square* this, blip_time_t, blip_time_t ); | 62 | void Square_run( struct Gb_Square* this, blip_time_t, blip_time_t ); |
66 | void Square_clock_envelope( struct Gb_Square* this ); | 63 | void Square_clock_envelope( struct Gb_Square* this ); |
67 | 64 | ||
@@ -85,7 +82,6 @@ static inline int Square_reload_env_timer( struct Gb_Square* this ) | |||
85 | // Sweep square | 82 | // Sweep square |
86 | 83 | ||
87 | void clock_sweep( struct Gb_Square* this ); | 84 | void clock_sweep( struct Gb_Square* this ); |
88 | void Sweep_write_register( struct Gb_Square* this, int frame_phase, int reg, int old_data, int data ); | ||
89 | 85 | ||
90 | static inline void Sweep_reset( struct Gb_Square* this ) | 86 | static inline void Sweep_reset( struct Gb_Square* this ) |
91 | { | 87 | { |
@@ -99,9 +95,6 @@ static inline void Sweep_reset( struct Gb_Square* this ) | |||
99 | Osc_reset( &this->osc ); | 95 | Osc_reset( &this->osc ); |
100 | this->osc.delay = 0x40000000; // TODO: something less hacky (never clocked until first trigger) | 96 | this->osc.delay = 0x40000000; // TODO: something less hacky (never clocked until first trigger) |
101 | } | 97 | } |
102 | |||
103 | void calc_sweep( struct Gb_Square* this, bool update ); | ||
104 | void reload_sweep_timer( struct Gb_Square* this ); | ||
105 | 98 | ||
106 | // Noise | 99 | // Noise |
107 | 100 | ||
@@ -118,7 +111,6 @@ struct Gb_Noise { | |||
118 | }; | 111 | }; |
119 | 112 | ||
120 | void Noise_run( struct Gb_Noise* this, blip_time_t, blip_time_t ); | 113 | void Noise_run( struct Gb_Noise* this, blip_time_t, blip_time_t ); |
121 | void Noise_write_register( struct Gb_Noise* this, int frame_phase, int reg, int old_data, int data ); | ||
122 | 114 | ||
123 | static inline void Noise_reset( struct Gb_Noise* this ) | 115 | static inline void Noise_reset( struct Gb_Noise* this ) |
124 | { | 116 | { |
@@ -159,7 +151,6 @@ struct Gb_Wave { | |||
159 | uint8_t* wave_ram; // 32 bytes (64 nybbles), stored in APU | 151 | uint8_t* wave_ram; // 32 bytes (64 nybbles), stored in APU |
160 | }; | 152 | }; |
161 | 153 | ||
162 | void Wave_write_register( struct Gb_Wave* this, int frame_phase, int reg, int old_data, int data ); | ||
163 | void Wave_run( struct Gb_Wave* this, blip_time_t, blip_time_t ); | 154 | void Wave_run( struct Gb_Wave* this, blip_time_t, blip_time_t ); |
164 | 155 | ||
165 | static inline void Wave_reset( struct Gb_Wave* this ) | 156 | 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 | |||
174 | // Non-zero if DAC is enabled | 165 | // Non-zero if DAC is enabled |
175 | static inline int Wave_dac_enabled( struct Gb_Wave* this ) { return this->osc.regs [0] & 0x80; } | 166 | static inline int Wave_dac_enabled( struct Gb_Wave* this ) { return this->osc.regs [0] & 0x80; } |
176 | 167 | ||
177 | void corrupt_wave( struct Gb_Wave* this ); | ||
178 | |||
179 | static inline uint8_t* wave_bank( struct Gb_Wave* this ) { return &this->wave_ram [(~this->osc.regs [0] & bank40_mask) >> 2 & this->agb_mask]; } | 168 | static inline uint8_t* wave_bank( struct Gb_Wave* this ) { return &this->wave_ram [(~this->osc.regs [0] & bank40_mask) >> 2 & this->agb_mask]; } |
180 | 169 | ||
181 | // Wave index that would be accessed, or -1 if no access would occur | 170 | // Wave index that would be accessed, or -1 if no access would occur |
diff --git a/apps/codecs/libgme/gbs_cpu.c b/apps/codecs/libgme/gbs_cpu.c index 5a27bf6abe..998888fe72 100644 --- a/apps/codecs/libgme/gbs_cpu.c +++ b/apps/codecs/libgme/gbs_cpu.c | |||
@@ -29,7 +29,7 @@ int Read_mem( struct Gbs_Emu* this, addr_t addr ) | |||
29 | return LOG_MEM( addr, ">", result ); | 29 | return LOG_MEM( addr, ">", result ); |
30 | } | 30 | } |
31 | 31 | ||
32 | inline void Write_io_inline( struct Gbs_Emu* this, int offset, int data, int base ) | 32 | static inline void Write_io_inline( struct Gbs_Emu* this, int offset, int data, int base ) |
33 | { | 33 | { |
34 | if ( (unsigned) (offset - (io_addr - base)) < io_size ) | 34 | if ( (unsigned) (offset - (io_addr - base)) < io_size ) |
35 | Apu_write_register( &this->apu, Time( this ), offset + base, data & 0xFF ); | 35 | 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 ) | |||
66 | #endif | 66 | #endif |
67 | } | 67 | } |
68 | 68 | ||
69 | void Write_io_( struct Gbs_Emu* this, int offset, int data ) | 69 | static void Write_io_( struct Gbs_Emu* this, int offset, int data ) |
70 | { | 70 | { |
71 | Write_io_inline( this, offset, data, io_base ); | 71 | Write_io_inline( this, offset, data, io_base ); |
72 | } | 72 | } |
73 | 73 | ||
74 | inline void Write_io( struct Gbs_Emu* this, int offset, int data ) | 74 | static inline void Write_io( struct Gbs_Emu* this, int offset, int data ) |
75 | { | 75 | { |
76 | (void) LOG_MEM( offset + io_base, "<", data ); | 76 | (void) LOG_MEM( offset + io_base, "<", data ); |
77 | 77 | ||
@@ -80,7 +80,7 @@ inline void Write_io( struct Gbs_Emu* this, int offset, int data ) | |||
80 | Write_io_( this, offset, data ); | 80 | Write_io_( this, offset, data ); |
81 | } | 81 | } |
82 | 82 | ||
83 | int Read_io( struct Gbs_Emu* this, int offset ) | 83 | static int Read_io( struct Gbs_Emu* this, int offset ) |
84 | { | 84 | { |
85 | int const io_base = 0xFF00; | 85 | int const io_base = 0xFF00; |
86 | int result = this->ram [io_base - ram_addr + offset]; | 86 | int result = this->ram [io_base - ram_addr + offset]; |
diff --git a/apps/codecs/libgme/gbs_emu.h b/apps/codecs/libgme/gbs_emu.h index b73f106d8f..409cf2d6c2 100644 --- a/apps/codecs/libgme/gbs_emu.h +++ b/apps/codecs/libgme/gbs_emu.h | |||
@@ -196,9 +196,5 @@ static inline blip_time_t Time( struct Gbs_Emu* this ) | |||
196 | } | 196 | } |
197 | 197 | ||
198 | void Jsr_then_stop( struct Gbs_Emu* this, byte const [] ); | 198 | void Jsr_then_stop( struct Gbs_Emu* this, byte const [] ); |
199 | void Write_io_inline( struct Gbs_Emu* this, int offset, int data, int base ); | ||
200 | void Write_io_( struct Gbs_Emu* this, int offset, int data ); | ||
201 | int Read_io( struct Gbs_Emu* this, int offset ); | ||
202 | void Write_io( struct Gbs_Emu* this, int offset, int data ); | ||
203 | 199 | ||
204 | #endif | 200 | #endif |
diff --git a/apps/codecs/libgme/nes_oscs.c b/apps/codecs/libgme/nes_oscs.c index a790c4d8a2..4402b60a61 100644 --- a/apps/codecs/libgme/nes_oscs.c +++ b/apps/codecs/libgme/nes_oscs.c | |||
@@ -334,7 +334,7 @@ static short const dmc_period_table [2] [16] = { | |||
334 | 176, 148, 132, 118, 98, 78, 66, 50} | 334 | 176, 148, 132, 118, 98, 78, 66, 50} |
335 | }; | 335 | }; |
336 | 336 | ||
337 | inline void Dmc_reload_sample( struct Nes_Dmc* this ) | 337 | static inline void Dmc_reload_sample( struct Nes_Dmc* this ) |
338 | { | 338 | { |
339 | this->address = 0x4000 + this->osc.regs [2] * 0x40; | 339 | this->address = 0x4000 + this->osc.regs [2] * 0x40; |
340 | this->osc.length_counter = this->osc.regs [3] * 0x10 + 1; | 340 | this->osc.length_counter = this->osc.regs [3] * 0x10 + 1; |
diff --git a/apps/codecs/libgme/nes_oscs.h b/apps/codecs/libgme/nes_oscs.h index 8d7f4ae817..fa6b8ab4b0 100644 --- a/apps/codecs/libgme/nes_oscs.h +++ b/apps/codecs/libgme/nes_oscs.h | |||
@@ -157,7 +157,6 @@ void Dmc_write_register( struct Nes_Dmc* this, int, int ); | |||
157 | void Dmc_run( struct Nes_Dmc* this, nes_time_t, nes_time_t ); | 157 | void Dmc_run( struct Nes_Dmc* this, nes_time_t, nes_time_t ); |
158 | void Dmc_recalc_irq( struct Nes_Dmc* this ); | 158 | void Dmc_recalc_irq( struct Nes_Dmc* this ); |
159 | void Dmc_fill_buffer( struct Nes_Dmc* this ); | 159 | void Dmc_fill_buffer( struct Nes_Dmc* this ); |
160 | void Dmc_reload_sample( struct Nes_Dmc* this ); | ||
161 | void Dmc_reset( struct Nes_Dmc* this ); | 160 | void Dmc_reset( struct Nes_Dmc* this ); |
162 | 161 | ||
163 | int Dmc_count_reads( struct Nes_Dmc* this, nes_time_t, nes_time_t* ); | 162 | int Dmc_count_reads( struct Nes_Dmc* this, nes_time_t, nes_time_t* ); |
diff --git a/apps/codecs/libgme/nsf_emu.c b/apps/codecs/libgme/nsf_emu.c index d4d5753460..a4873c81cb 100644 --- a/apps/codecs/libgme/nsf_emu.c +++ b/apps/codecs/libgme/nsf_emu.c | |||
@@ -330,7 +330,7 @@ void write_bank( struct Nsf_Emu* this, int bank, int data ) | |||
330 | Cpu_map_code( &this->cpu, (bank + 6) * this->rom.bank_size, this->rom.bank_size, rom_data, false ); | 330 | Cpu_map_code( &this->cpu, (bank + 6) * this->rom.bank_size, this->rom.bank_size, rom_data, false ); |
331 | } | 331 | } |
332 | 332 | ||
333 | void map_memory( struct Nsf_Emu* this ) | 333 | static void map_memory( struct Nsf_Emu* this ) |
334 | { | 334 | { |
335 | // Map standard things | 335 | // Map standard things |
336 | Cpu_reset( &this->cpu, unmapped_code( this ) ); | 336 | Cpu_reset( &this->cpu, unmapped_code( this ) ); |
@@ -493,7 +493,7 @@ void Sound_set_tempo( struct Nsf_Emu* this, int t ) | |||
493 | #endif | 493 | #endif |
494 | } | 494 | } |
495 | 495 | ||
496 | inline void push_byte( struct Nsf_Emu* this, int b ) | 496 | static inline void push_byte( struct Nsf_Emu* this, int b ) |
497 | { | 497 | { |
498 | this->low_ram [0x100 + this->cpu.r.sp--] = b; | 498 | this->low_ram [0x100 + this->cpu.r.sp--] = b; |
499 | } | 499 | } |
diff --git a/apps/codecs/libgme/nsf_emu.h b/apps/codecs/libgme/nsf_emu.h index adb5b8e153..dccfa8c5d5 100644 --- a/apps/codecs/libgme/nsf_emu.h +++ b/apps/codecs/libgme/nsf_emu.h | |||
@@ -209,11 +209,9 @@ static inline void Sound_set_gain( struct Nsf_Emu* this, int g ) | |||
209 | 209 | ||
210 | blargg_err_t run_clocks( struct Nsf_Emu* this, blip_time_t* duration, int ); | 210 | blargg_err_t run_clocks( struct Nsf_Emu* this, blip_time_t* duration, int ); |
211 | 211 | ||
212 | void map_memory( struct Nsf_Emu* this ); | ||
213 | void write_bank( struct Nsf_Emu* this, int index, int data ); | 212 | void write_bank( struct Nsf_Emu* this, int index, int data ); |
214 | int cpu_read( struct Nsf_Emu* this, addr_t ); | 213 | int cpu_read( struct Nsf_Emu* this, addr_t ); |
215 | void cpu_write( struct Nsf_Emu* this, addr_t, int ); | 214 | void cpu_write( struct Nsf_Emu* this, addr_t, int ); |
216 | void push_byte( struct Nsf_Emu* this, int ); | ||
217 | addr_t get_addr( byte const [] ); | 215 | addr_t get_addr( byte const [] ); |
218 | bool run_cpu_until( struct Nsf_Emu* this, nes_time_t end ); | 216 | bool run_cpu_until( struct Nsf_Emu* this, nes_time_t end ); |
219 | 217 | ||
diff --git a/apps/codecs/libgme/resampler.c b/apps/codecs/libgme/resampler.c index e2e0734fc9..837f01ed13 100644 --- a/apps/codecs/libgme/resampler.c +++ b/apps/codecs/libgme/resampler.c | |||
@@ -135,7 +135,7 @@ sample_t const* resample_( struct Resampler* this, sample_t** out_, | |||
135 | return in; | 135 | return in; |
136 | } | 136 | } |
137 | 137 | ||
138 | inline int resample_wrapper( struct Resampler* this, sample_t out [], int* out_size, | 138 | static inline int resample_wrapper( struct Resampler* this, sample_t out [], int* out_size, |
139 | sample_t const in [], int in_size ) | 139 | sample_t const in [], int in_size ) |
140 | { | 140 | { |
141 | assert( Resampler_rate( this ) ); | 141 | assert( Resampler_rate( this ) ); |