comparison nuklear_ui/blastem_nuklear.c @ 2556:6f1eebc0a90b

Add auto option for fm_dac config variable that bases zero offset on the select MD model
author Michael Pavone <pavone@retrodev.com>
date Sat, 11 Jan 2025 23:21:36 -0800
parents 6aa3025bbf5f
children 251cc75574af
comparison
equal deleted inserted replaced
2555:78e1769efcdb 2556:6f1eebc0a90b
2111 "256", 2111 "256",
2112 "128", 2112 "128",
2113 "64" 2113 "64"
2114 }; 2114 };
2115 const char *dac[] = { 2115 const char *dac[] = {
2116 "auto",
2116 "zero_offset", 2117 "zero_offset",
2117 "linear" 2118 "linear"
2118 }; 2119 };
2119 const char *dac_desc[] = { 2120 const char *dac_desc[] = {
2121 "Default for Model",
2120 "Zero Offset", 2122 "Zero Offset",
2121 "Linear" 2123 "Linear"
2122 }; 2124 };
2123 const uint32_t num_rates = sizeof(rates)/sizeof(*rates); 2125 const uint32_t num_rates = sizeof(rates)/sizeof(*rates);
2124 const uint32_t num_sizes = sizeof(sizes)/sizeof(*sizes); 2126 const uint32_t num_sizes = sizeof(sizes)/sizeof(*sizes);
2127 static int32_t selected_size = -1; 2129 static int32_t selected_size = -1;
2128 static int32_t selected_dac = -1; 2130 static int32_t selected_dac = -1;
2129 if (selected_rate < 0 || selected_size < 0 || selected_dac < 0) { 2131 if (selected_rate < 0 || selected_size < 0 || selected_dac < 0) {
2130 selected_rate = find_match(rates, num_rates, "audio\0rate\0", "48000"); 2132 selected_rate = find_match(rates, num_rates, "audio\0rate\0", "48000");
2131 selected_size = find_match(sizes, num_sizes, "audio\0buffer\0", "512"); 2133 selected_size = find_match(sizes, num_sizes, "audio\0buffer\0", "512");
2132 selected_dac = find_match(dac, num_dacs, "audio\0fm_dac\0", "zero_offset"); 2134 selected_dac = find_match(dac, num_dacs, "audio\0fm_dac\0", "auto");
2133 } 2135 }
2134 uint32_t width = render_width(); 2136 uint32_t width = render_width();
2135 uint32_t height = render_height(); 2137 uint32_t height = render_height();
2136 uint32_t desired_width = context->style.font->height * 10; 2138 uint32_t desired_width = context->style.font->height * 10;
2137 if (desired_width > width) { 2139 if (desired_width > width) {