1
0
Fork 0
forked from len0rd/rockbox

5th part of FS#12176. Further fixed point migration. Only two emulators (ym2413, ym2612) still use floating point.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30281 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Andree Buschmann 2011-08-11 21:06:16 +00:00
parent b127949860
commit 1b9f9fb465
17 changed files with 38 additions and 43 deletions

View file

@ -179,9 +179,9 @@ static bool pal_only( struct header_t* this )
return (this->speed_flags & 3) == 1;
}
static double clock_rate( struct header_t* this )
static long clock_rate( struct header_t* this )
{
return pal_only( this ) ? 1662607.125 : 1789772.727272727;
return pal_only( this ) ? (long)1662607.125 : (long)1789772.727272727;
}
static int play_period( struct header_t* this )
@ -206,7 +206,7 @@ static int play_period( struct header_t* this )
// Custom rate
if ( rate != value )
clocks = (int) (rate * clock_rate( this ) * (1.0/1000000.0));
clocks = (int) ((1LL * rate * clock_rate( this )) / 1000000);
return clocks;
}
@ -285,7 +285,7 @@ blargg_err_t Nsf_post_load( struct Nsf_Emu* this )
this->track_count = this->header.track_count;
// Change clock rate & setup buffer
this->clock_rate__ = (long) (clock_rate( &this->header ) + 0.5);
this->clock_rate__ = (long) clock_rate( &this->header );
Buffer_clock_rate( &this->stereo_buf, this->clock_rate__ );
this->buf_changed_count = Buffer_channels_changed_count( &this->stereo_buf );
return 0;