diff options
author | Nils Wallménius <nils@rockbox.org> | 2011-06-01 10:28:26 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2011-06-01 10:28:26 +0000 |
commit | 7c6056b352e35c5b12521b35ba193e13f75500be (patch) | |
tree | a53215338a7c78bd47ebb3afedf41c0489a97f4e /apps/codecs/libspc/spc_emu.c | |
parent | 05a1984eb32dd07bcf5d54c147ace4d6f56a00b4 (diff) | |
download | rockbox-7c6056b352e35c5b12521b35ba193e13f75500be.tar.gz rockbox-7c6056b352e35c5b12521b35ba193e13f75500be.zip |
FS#12140 by Sean Bartell, Make various codec stuff static.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29942 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libspc/spc_emu.c')
-rw-r--r-- | apps/codecs/libspc/spc_emu.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/apps/codecs/libspc/spc_emu.c b/apps/codecs/libspc/spc_emu.c index 0ad1329a6b..5ea5b0cdeb 100644 --- a/apps/codecs/libspc/spc_emu.c +++ b/apps/codecs/libspc/spc_emu.c | |||
@@ -32,7 +32,8 @@ struct cpu_ram_t ram IBSS_ATTR_SPC_LARGE_IRAM CACHEALIGN_ATTR; | |||
32 | 32 | ||
33 | /**************** Timers ****************/ | 33 | /**************** Timers ****************/ |
34 | 34 | ||
35 | void Timer_run_( struct Timer* t, long time ) | 35 | static void Timer_run_( struct Timer* t, long time ) ICODE_ATTR_SPC; |
36 | static void Timer_run_( struct Timer* t, long time ) | ||
36 | { | 37 | { |
37 | /* when disabled, next_tick should always be in the future */ | 38 | /* when disabled, next_tick should always be in the future */ |
38 | assert( t->enabled ); | 39 | assert( t->enabled ); |
@@ -50,6 +51,12 @@ void Timer_run_( struct Timer* t, long time ) | |||
50 | t->count = elapsed; | 51 | t->count = elapsed; |
51 | } | 52 | } |
52 | 53 | ||
54 | static inline void Timer_run( struct Timer* t, long time ) | ||
55 | { | ||
56 | if ( time >= t->next_tick ) | ||
57 | Timer_run_( t, time ); | ||
58 | } | ||
59 | |||
53 | /**************** SPC emulator ****************/ | 60 | /**************** SPC emulator ****************/ |
54 | /* 1.024 MHz clock / 32000 samples per second */ | 61 | /* 1.024 MHz clock / 32000 samples per second */ |
55 | 62 | ||
@@ -179,7 +186,8 @@ int SPC_load_spc( THIS, const void* data, long size ) | |||
179 | } | 186 | } |
180 | 187 | ||
181 | /**************** DSP interaction ****************/ | 188 | /**************** DSP interaction ****************/ |
182 | void SPC_run_dsp_( THIS, long time ) | 189 | static void SPC_run_dsp_( THIS, long time ) ICODE_ATTR_SPC; |
190 | static void SPC_run_dsp_( THIS, long time ) | ||
183 | { | 191 | { |
184 | /* divide by CLOCKS_PER_SAMPLE */ | 192 | /* divide by CLOCKS_PER_SAMPLE */ |
185 | int count = ((time - this->next_dsp) >> 5) + 1; | 193 | int count = ((time - this->next_dsp) >> 5) + 1; |
@@ -189,6 +197,12 @@ void SPC_run_dsp_( THIS, long time ) | |||
189 | DSP_run( &this->dsp, count, buf ); | 197 | DSP_run( &this->dsp, count, buf ); |
190 | } | 198 | } |
191 | 199 | ||
200 | static inline void SPC_run_dsp( THIS, long time ) | ||
201 | { | ||
202 | if ( time >= this->next_dsp ) | ||
203 | SPC_run_dsp_( this, time ); | ||
204 | } | ||
205 | |||
192 | int SPC_read( THIS, unsigned addr, long const time ) | 206 | int SPC_read( THIS, unsigned addr, long const time ) |
193 | { | 207 | { |
194 | int result = RAM [addr]; | 208 | int result = RAM [addr]; |