# HG changeset patch # User Michael Pavone # Date 1524031508 25200 # Node ID d14490dee01fe8d582331fa030cb32ea545e72ae # Parent 66387b1645e45e3088668f579c0a16d911eb6290 Add sync_source to default.cfg and the Nuklear UI diff -r 66387b1645e4 -r d14490dee01f default.cfg --- a/default.cfg Tue Apr 17 22:26:39 2018 -0700 +++ b/default.cfg Tue Apr 17 23:05:08 2018 -0700 @@ -228,6 +228,11 @@ } system { + #controls how the emulated system is synced to the host + #video provides the smoothest experience when the host and emulated system have similar refresh rates + #audio provides lower audio latency, especially when there is a refresh rate mismatch + sync_source video + #set this to random to debug initialization bugs ram_init zero default_region U #controls whether MegaWiFi support is enabled or not diff -r 66387b1645e4 -r d14490dee01f nuklear_ui/blastem_nuklear.c --- a/nuklear_ui/blastem_nuklear.c Tue Apr 17 22:26:39 2018 -0700 +++ b/nuklear_ui/blastem_nuklear.c Tue Apr 17 23:05:08 2018 -0700 @@ -776,6 +776,15 @@ } void view_system_settings(struct nk_context *context) { + const char *sync_opts[] = { + "video", + "audio" + }; + const uint32_t num_sync_opts = sizeof(sync_opts)/sizeof(*sync_opts); + static int32_t selected_sync = -1; + if (selected_sync < 0) { + selected_sync = find_match(sync_opts, num_sync_opts, "system\0sync_source\0", "video"); + } const char *regions[] = { "J - Japan", "U - Americas", @@ -833,6 +842,7 @@ uint32_t height = render_height(); if (nk_begin(context, "System Settings", nk_rect(0, 0, width, height), 0)) { nk_layout_row_static(context, 30, width > 300 ? 300 : width, 2); + selected_sync = settings_dropdown(context, "Sync Source", sync_opts, num_sync_opts, selected_sync, "system\0sync_source\0"); settings_int_property(context, "68000 Clock Divider", "", "clocks\0m68k_divider\0", 7, 1, 53); settings_toggle(context, "Remember ROM Path", "ui\0remember_path\0", 1); selected_region = settings_dropdown_ex(context, "Default Region", region_codes, regions, num_regions, selected_region, "system\0default_region\0");