From be33e6164428c28adb486b20fcade03c99a1956c Mon Sep 17 00:00:00 2001 From: Chris Moeller Date: Sat, 26 Oct 2013 10:30:36 -0700 Subject: [PATCH] Fixed SPC/SFM seeking --- Frameworks/GME/gme/higan/smp/smp.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Frameworks/GME/gme/higan/smp/smp.cpp b/Frameworks/GME/gme/higan/smp/smp.cpp index cc7fd1543..b59d4f883 100755 --- a/Frameworks/GME/gme/higan/smp/smp.cpp +++ b/Frameworks/GME/gme/higan/smp/smp.cpp @@ -29,13 +29,6 @@ void SMP::enter() { } void SMP::render(int16_t * buffer, unsigned count) { - while (count > 4096) { - sample_buffer = buffer; - sample_buffer_end = buffer + 4096; - buffer += 4096; - count -= 4096; - enter(); - } sample_buffer = buffer; sample_buffer_end = buffer + count; enter(); @@ -44,17 +37,17 @@ void SMP::render(int16_t * buffer, unsigned count) { void SMP::skip(unsigned count) { while (count > 4096) { sample_buffer = 0; - sample_buffer_end = (const int16_t *) 4096; + sample_buffer_end = ((const int16_t *)0) + 4096; count -= 4096; enter(); } sample_buffer = 0; - sample_buffer_end = (const int16_t *) (intptr_t) count; + sample_buffer_end = ((const int16_t *)0) + count; enter(); } void SMP::sample(int16_t left, int16_t right) { - if ( sample_buffer >= (const int16_t *) (intptr_t) 4096 ) { + if ( sample_buffer > ((const int16_t *)0) + 4096 ) { if ( sample_buffer < sample_buffer_end ) *sample_buffer++ = left; if ( sample_buffer < sample_buffer_end ) *sample_buffer++ = right; }