diff options
author | Twinaphex | 2017-02-12 16:02:47 +0100 |
---|---|---|
committer | GitHub | 2017-02-12 16:02:47 +0100 |
commit | 474a67ccdccb89d369c706347085ca4619f0cbef (patch) | |
tree | cb331b665bc5d53ad180d5500bf37e2dfbf683d8 /libretro.c | |
parent | b6006bc542f89ad1b7086268f851f0ba880ad6cd (diff) | |
parent | fb2517282da2fdfc26e58207bbb8e0a8bca35be2 (diff) | |
download | snesemu-474a67ccdccb89d369c706347085ca4619f0cbef.tar.gz snesemu-474a67ccdccb89d369c706347085ca4619f0cbef.tar.bz2 snesemu-474a67ccdccb89d369c706347085ca4619f0cbef.zip |
Merge pull request #31 from jamsilva/master
Improvements to both accuracy and performance.
Diffstat (limited to 'libretro.c')
-rw-r--r-- | libretro.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -43,8 +43,8 @@ char slash = '\\'; char slash = '/'; #endif -static float samples_per_frame = 0.0; -static float samplerate = (((SNES_CLOCK_SPEED * 6) / (32 * ONE_APU_CYCLE))); +static int32_t samples_per_frame = 0; +static int32_t samplerate = (((SNES_CLOCK_SPEED * 6) / (32 * ONE_APU_CYCLE))); #ifdef PERF_TEST #define RETRO_PERFORMANCE_INIT(name) \ @@ -109,9 +109,9 @@ unsigned retro_api_version() return RETRO_API_VERSION; } -void S9xMessage(int32_t type, int32_t number, const char* message) +void S9xMessage(const char* message) { -#define MAX_MESSAGE_LEN (36 * 3) + #define MAX_MESSAGE_LEN (36 * 3) static char buffer [MAX_MESSAGE_LEN + 1]; @@ -400,7 +400,7 @@ static void check_variables(void) #define FRAMESKIP #endif -static float samples_to_play = 0.0; +static int32_t samples_to_play = 0; void retro_run(void) { bool updated = false; @@ -427,13 +427,13 @@ void retro_run(void) if (samples_to_play > 512) { - S9xMixSamples(audio_buf, ((int32_t)samples_to_play) * 2); - audio_batch_cb(audio_buf, (int32_t)samples_to_play); - samples_to_play -= (int32_t)samples_to_play; + S9xMixSamples(audio_buf, samples_to_play * 2); + audio_batch_cb(audio_buf, samples_to_play); + samples_to_play = 0; } #endif -#ifdef NO_VIDEO_OUTPUT +#ifdef NO_VIDEO_OUTPUT return; #endif @@ -767,7 +767,7 @@ void retro_cheat_set(unsigned index, bool enabled, const char* code) Cheat.c[index].saved = false; // it'll be saved next time cheats run anyways - Settings.ApplyCheats=true; + Settings.ApplyCheats = true; S9xApplyCheats(); #endif } |