From b8ae97fe586c2cbefc8a229fe54c17b27331b20b Mon Sep 17 00:00:00 2001 From: Andree Buschmann Date: Sun, 7 Aug 2011 20:28:47 +0000 Subject: Fix yellow and red. Disable NSF, VGM, SGC and KSS formats for low memory targets for now. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30265 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/SOURCES | 4 +++- apps/codecs/libgme/blip_buffer.c | 2 +- apps/codecs/libgme/gbs_emu.c | 4 ++-- apps/codecs/libgme/hes_cpu.c | 4 ++-- apps/codecs/libgme/hes_emu.c | 24 ++++++++++++------------ 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/apps/codecs/SOURCES b/apps/codecs/SOURCES index 508969bd20..bbceae45b0 100644 --- a/apps/codecs/SOURCES +++ b/apps/codecs/SOURCES @@ -18,7 +18,6 @@ mpc.c wma.c sid.c ape.c -nsf.c asap.c aac.c spc.c @@ -36,9 +35,12 @@ wmapro.c ay.c gbs.c hes.c +#if MEMORYSIZE > 2 +nsf.c sgc.c vgm.c kss.c +#endif #ifdef HAVE_RECORDING diff --git a/apps/codecs/libgme/blip_buffer.c b/apps/codecs/libgme/blip_buffer.c index 3061f68573..2a015d75c4 100644 --- a/apps/codecs/libgme/blip_buffer.c +++ b/apps/codecs/libgme/blip_buffer.c @@ -27,7 +27,7 @@ int const silent_buf_size = 1; // size used for Silent_Blip_Buffer void Blip_init( struct Blip_Buffer* this ) { - this->factor_ = LONG_MAX; + this->factor_ = (blip_ulong)LONG_MAX; this->offset_ = 0; this->buffer_size_ = 0; this->sample_rate_ = 0; diff --git a/apps/codecs/libgme/gbs_emu.c b/apps/codecs/libgme/gbs_emu.c index 693e84a39b..f5e214e5d1 100644 --- a/apps/codecs/libgme/gbs_emu.c +++ b/apps/codecs/libgme/gbs_emu.c @@ -34,8 +34,8 @@ void clear_track_vars( struct Gbs_Emu* this ) this->out_time = 0; this->emu_time = 0; this->emu_track_ended_ = true; - this->track_ended = true; - this->fade_start = LONG_MAX / 2 + 1; + this->track_ended = true; + this->fade_start = (blargg_long)(LONG_MAX / 2 + 1); this->fade_step = 1; this->silence_time = 0; this->silence_count = 0; diff --git a/apps/codecs/libgme/hes_cpu.c b/apps/codecs/libgme/hes_cpu.c index 08dfb5e993..60ea099905 100644 --- a/apps/codecs/libgme/hes_cpu.c +++ b/apps/codecs/libgme/hes_cpu.c @@ -58,8 +58,8 @@ void Cpu_reset( struct Hes_Cpu* this ) this->state_.time = 0; this->state_.base = 0; - this->irq_time = future_hes_time; - this->end_time = future_hes_time; + this->irq_time = (hes_time_t)future_hes_time; + this->end_time = (hes_time_t)future_hes_time; this->r.status = st_i; this->r.sp = 0; diff --git a/apps/codecs/libgme/hes_emu.c b/apps/codecs/libgme/hes_emu.c index a44eded8d7..324027888d 100644 --- a/apps/codecs/libgme/hes_emu.c +++ b/apps/codecs/libgme/hes_emu.c @@ -37,8 +37,8 @@ void clear_track_vars( struct Hes_Emu* this ) this->out_time = 0; this->emu_time = 0; this->emu_track_ended_ = true; - this->track_ended = true; - this->fade_start = LONG_MAX / 2 + 1; + this->track_ended = true; + this->fade_start = (blargg_long)(LONG_MAX / 2 + 1); this->fade_step = 1; this->silence_time = 0; this->silence_count = 0; @@ -202,7 +202,7 @@ int Cpu_done( struct Hes_Emu* this ) if ( this->irq.timer <= present && !(this->irq.disables & timer_mask) ) { this->timer.fired = true; - this->irq.timer = future_hes_time; + this->irq.timer = (hes_time_t)future_hes_time; irq_changed( this ); // overkill, but not worth writing custom code #if defined (GME_FRAME_HOOK_DEFINED) { @@ -322,7 +322,7 @@ int Emu_cpu_read( struct Hes_Emu* this, hes_addr_t addr ) case 0x0000: if ( this->irq.vdp > time ) return 0; - this->irq.vdp = future_hes_time; + this->irq.vdp = (hes_time_t)future_hes_time; run_until( this, time ); irq_changed( this ); return 0x20; @@ -398,19 +398,19 @@ void irq_changed( struct Hes_Emu* this ) if ( this->irq.timer > present ) { - this->irq.timer = future_hes_time; + this->irq.timer = (hes_time_t)future_hes_time; if ( this->timer.enabled && !this->timer.fired ) this->irq.timer = present + this->timer.count; } if ( this->irq.vdp > present ) { - this->irq.vdp = future_hes_time; + this->irq.vdp = (hes_time_t)future_hes_time; if ( this->vdp.control & 0x08 ) this->irq.vdp = this->vdp.next_vbl; } - hes_time_t time = future_hes_time; + hes_time_t time = (hes_time_t)future_hes_time; if ( !(this->irq.disables & timer_mask) ) time = this->irq.timer; if ( !(this->irq.disables & vdp_mask) ) time = min( time, this->irq.vdp ); @@ -422,7 +422,7 @@ void irq_changed( struct Hes_Emu* this ) static void adjust_time( blargg_long* time, hes_time_t delta ) ICODE_ATTR; static void adjust_time( blargg_long* time, hes_time_t delta ) { - if ( *time < future_hes_time ) + if ( *time < (blargg_long)future_hes_time ) { *time -= delta; if ( *time < 0 ) @@ -452,8 +452,8 @@ blargg_err_t run_clocks( struct Hes_Emu* this, blip_time_t* duration_ ) // End cpu frame this->cpu.state_.base -= duration; - if ( this->cpu.irq_time < future_hes_time ) this->cpu.irq_time -= duration; - if ( this->cpu.end_time < future_hes_time ) this->cpu.end_time -= duration; + if ( this->cpu.irq_time < (hes_time_t)future_hes_time ) this->cpu.irq_time -= duration; + if ( this->cpu.end_time < (hes_time_t)future_hes_time ) this->cpu.end_time -= duration; adjust_time( &this->irq.timer, duration ); adjust_time( &this->irq.vdp, duration ); @@ -585,8 +585,8 @@ blargg_err_t Hes_start_track( struct Hes_Emu* this, int track ) Cpu_set_mmr( this, page_count, 0xFF ); // unmapped beyond end of address space this->irq.disables = timer_mask | vdp_mask; - this->irq.timer = future_hes_time; - this->irq.vdp = future_hes_time; + this->irq.timer = (hes_time_t)future_hes_time; + this->irq.vdp = (hes_time_t)future_hes_time; this->timer.enabled = false; this->timer.raw_load= 0x80; -- cgit v1.2.3