aboutsummaryrefslogtreecommitdiff
path: root/libretro.c
diff options
context:
space:
mode:
authorTwinaphex2017-02-12 16:02:47 +0100
committerGitHub2017-02-12 16:02:47 +0100
commit474a67ccdccb89d369c706347085ca4619f0cbef (patch)
treecb331b665bc5d53ad180d5500bf37e2dfbf683d8 /libretro.c
parentb6006bc542f89ad1b7086268f851f0ba880ad6cd (diff)
parentfb2517282da2fdfc26e58207bbb8e0a8bca35be2 (diff)
downloadsnes9x2005-474a67ccdccb89d369c706347085ca4619f0cbef.tar.gz
snes9x2005-474a67ccdccb89d369c706347085ca4619f0cbef.tar.bz2
snes9x2005-474a67ccdccb89d369c706347085ca4619f0cbef.zip
Merge pull request #31 from jamsilva/master
Improvements to both accuracy and performance.
Diffstat (limited to 'libretro.c')
-rw-r--r--libretro.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libretro.c b/libretro.c
index 73d0d9f..f2056b9 100644
--- a/libretro.c
+++ b/libretro.c
@@ -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
}