aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorneonloop2022-03-27 17:46:39 +0000
committerneonloop2022-03-27 17:46:39 +0000
commit700befc8ac877c5c9ee74c69841d31d5f570ee9e (patch)
tree424035110cfe5745b0180d93eacee552dfa0e9ef /main.c
parent5a5baa280f725d25f38f1025d92fb521fdba8940 (diff)
downloadpicoarch-700befc8ac877c5c9ee74c69841d31d5f570ee9e.tar.gz
picoarch-700befc8ac877c5c9ee74c69841d31d5f570ee9e.tar.bz2
picoarch-700befc8ac877c5c9ee74c69841d31d5f570ee9e.zip
Changes capacity to occupancy and return whole number as percent
Avoids float operations and redundant "1 -"
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/main.c b/main.c
index e91b832..e004101 100644
--- a/main.c
+++ b/main.c
@@ -31,7 +31,7 @@ static int last_screenshot = 0;
static uint32_t vsyncs;
static uint32_t renders;
-#define UNDERRUN_THRESHOLD 0.5
+#define UNDERRUN_THRESHOLD 50
static void toggle_fast_forward(int force_off)
{
@@ -498,11 +498,11 @@ static void adjust_audio(void) {
}
if (current_core.retro_audio_buffer_status) {
- float occupancy = 1.0 - plat_sound_capacity();
+ int occupancy = plat_sound_occupancy();
if (enable_drc)
- occupancy = MIN(1.0, occupancy * 2.0);
+ occupancy = MIN(100, occupancy * 2);
- current_core.retro_audio_buffer_status(true, (int)(occupancy * 100), occupancy < UNDERRUN_THRESHOLD);
+ current_core.retro_audio_buffer_status(true, occupancy, occupancy < UNDERRUN_THRESHOLD);
}
}