summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs/libspc/spc_emu.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2013-05-18 01:45:03 -0400
committerMichael Sevakis <jethead71@rockbox.org>2013-05-21 00:02:14 -0400
commit87021f7c0ac4620eafd185ff11905ee643f72b6c (patch)
tree03ae48f3d999cd8743af40cc5df933f64f6df2d2 /lib/rbcodec/codecs/libspc/spc_emu.c
parenta17d6de5bc727b0bb55764ecef2605ae689e8dab (diff)
downloadrockbox-87021f7c0ac4620eafd185ff11905ee643f72b6c.tar.gz
rockbox-87021f7c0ac4620eafd185ff11905ee643f72b6c.zip
SPC Codec: Refactor for CPU and clean up some things.
CPU optimization gets its own files in which to fill-in optimizable routines. Some pointless #if 0's for profiling need removal. Those macros are empty if not profiling. Force some functions that are undesirable to be force-inlined by the compiler to be not inlined. Change-Id: Ia7b7e45380d7efb20c9b1a4d52e05db3ef6bbaab
Diffstat (limited to 'lib/rbcodec/codecs/libspc/spc_emu.c')
-rw-r--r--lib/rbcodec/codecs/libspc/spc_emu.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/rbcodec/codecs/libspc/spc_emu.c b/lib/rbcodec/codecs/libspc/spc_emu.c
index 5ea5b0cdeb..dab4199ef0 100644
--- a/lib/rbcodec/codecs/libspc/spc_emu.c
+++ b/lib/rbcodec/codecs/libspc/spc_emu.c
@@ -32,8 +32,8 @@ struct cpu_ram_t ram IBSS_ATTR_SPC_LARGE_IRAM CACHEALIGN_ATTR;
32 32
33/**************** Timers ****************/ 33/**************** Timers ****************/
34 34
35static void Timer_run_( struct Timer* t, long time ) ICODE_ATTR_SPC; 35static void NO_INLINE ICODE_ATTR_SPC
36static void Timer_run_( struct Timer* t, long time ) 36Timer_run_( struct Timer* t, long time )
37{ 37{
38 /* when disabled, next_tick should always be in the future */ 38 /* when disabled, next_tick should always be in the future */
39 assert( t->enabled ); 39 assert( t->enabled );
@@ -60,7 +60,7 @@ static inline void Timer_run( struct Timer* t, long time )
60/**************** SPC emulator ****************/ 60/**************** SPC emulator ****************/
61/* 1.024 MHz clock / 32000 samples per second */ 61/* 1.024 MHz clock / 32000 samples per second */
62 62
63static void SPC_enable_rom( THIS, int enable ) 63static void NO_INLINE SPC_enable_rom( THIS, int enable )
64{ 64{
65 if ( this->rom_enabled != enable ) 65 if ( this->rom_enabled != enable )
66 { 66 {
@@ -186,8 +186,8 @@ int SPC_load_spc( THIS, const void* data, long size )
186} 186}
187 187
188/**************** DSP interaction ****************/ 188/**************** DSP interaction ****************/
189static void SPC_run_dsp_( THIS, long time ) ICODE_ATTR_SPC; 189static void NO_INLINE ICODE_ATTR_SPC
190static void SPC_run_dsp_( THIS, long time ) 190SPC_run_dsp_( THIS, long time )
191{ 191{
192 /* divide by CLOCKS_PER_SAMPLE */ 192 /* divide by CLOCKS_PER_SAMPLE */
193 int count = ((time - this->next_dsp) >> 5) + 1; 193 int count = ((time - this->next_dsp) >> 5) + 1;
@@ -383,13 +383,10 @@ int SPC_play( THIS, long count, int32_t* out )
383 } 383 }
384 384
385 /* Catch DSP up to present */ 385 /* Catch DSP up to present */
386#if 0
387 ENTER_TIMER(cpu); 386 ENTER_TIMER(cpu);
388#endif
389 SPC_run_dsp( this, -EXTRA_CLOCKS ); 387 SPC_run_dsp( this, -EXTRA_CLOCKS );
390#if 0
391 EXIT_TIMER(cpu); 388 EXIT_TIMER(cpu);
392#endif 389
393 assert( this->next_dsp == CLOCKS_PER_SAMPLE - EXTRA_CLOCKS ); 390 assert( this->next_dsp == CLOCKS_PER_SAMPLE - EXTRA_CLOCKS );
394 assert( this->sample_buf - out == count ); 391 assert( this->sample_buf - out == count );
395 392