Mercurial > repos > blastem
comparison nuklear_ui/blastem_nuklear.c @ 1798:5278b6e44fc1
Optionally emulate the offset around zero in the imperfect DAC of a discrete YM2612
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 24 Mar 2019 19:59:41 -0700 |
parents | 51417bb557b6 |
children | 34370330eaf3 |
comparison
equal
deleted
inserted
replaced
1797:5ff8f0d28188 | 1798:5278b6e44fc1 |
---|---|
1666 "512", | 1666 "512", |
1667 "256", | 1667 "256", |
1668 "128", | 1668 "128", |
1669 "64" | 1669 "64" |
1670 }; | 1670 }; |
1671 const char *dac[] = { | |
1672 "zero_offset", | |
1673 "linear" | |
1674 }; | |
1675 const char *dac_desc[] = { | |
1676 "Zero Offset", | |
1677 "Linear" | |
1678 }; | |
1671 const uint32_t num_rates = sizeof(rates)/sizeof(*rates); | 1679 const uint32_t num_rates = sizeof(rates)/sizeof(*rates); |
1672 const uint32_t num_sizes = sizeof(sizes)/sizeof(*sizes); | 1680 const uint32_t num_sizes = sizeof(sizes)/sizeof(*sizes); |
1681 const uint32_t num_dacs = sizeof(dac)/sizeof(*dac); | |
1673 static int32_t selected_rate = -1; | 1682 static int32_t selected_rate = -1; |
1674 static int32_t selected_size = -1; | 1683 static int32_t selected_size = -1; |
1675 if (selected_rate < 0 || selected_size < 0) { | 1684 static int32_t selected_dac = -1; |
1685 if (selected_rate < 0 || selected_size < 0 || selected_dac < 0) { | |
1676 selected_rate = find_match(rates, num_rates, "autio\0rate\0", "48000"); | 1686 selected_rate = find_match(rates, num_rates, "autio\0rate\0", "48000"); |
1677 selected_size = find_match(sizes, num_sizes, "audio\0buffer\0", "512"); | 1687 selected_size = find_match(sizes, num_sizes, "audio\0buffer\0", "512"); |
1688 selected_dac = find_match(dac, num_dacs, "audio\0fm_dac\0", "zero_offset"); | |
1678 } | 1689 } |
1679 uint32_t width = render_width(); | 1690 uint32_t width = render_width(); |
1680 uint32_t height = render_height(); | 1691 uint32_t height = render_height(); |
1681 uint32_t desired_width = context->style.font->height * 10; | 1692 uint32_t desired_width = context->style.font->height * 10; |
1682 if (desired_width > width) { | 1693 if (desired_width > width) { |
1688 selected_size = settings_dropdown(context, "Buffer Samples", sizes, num_sizes, selected_size, "audio\0buffer\0"); | 1699 selected_size = settings_dropdown(context, "Buffer Samples", sizes, num_sizes, selected_size, "audio\0buffer\0"); |
1689 settings_int_input(context, "Lowpass Cutoff Hz", "audio\0lowpass_cutoff\0", "3390"); | 1700 settings_int_input(context, "Lowpass Cutoff Hz", "audio\0lowpass_cutoff\0", "3390"); |
1690 settings_float_property(context, "Gain", "Overall", "audio\0gain\0", 0, -30.0f, 30.0f, 0.5f); | 1701 settings_float_property(context, "Gain", "Overall", "audio\0gain\0", 0, -30.0f, 30.0f, 0.5f); |
1691 settings_float_property(context, "", "FM", "audio\0fm_gain\0", 0, -30.0f, 30.0f, 0.5f); | 1702 settings_float_property(context, "", "FM", "audio\0fm_gain\0", 0, -30.0f, 30.0f, 0.5f); |
1692 settings_float_property(context, "", "PSG", "audio\0psg_gain\0", 0, -30.0f, 30.0f, 0.5f); | 1703 settings_float_property(context, "", "PSG", "audio\0psg_gain\0", 0, -30.0f, 30.0f, 0.5f); |
1704 selected_dac = settings_dropdown_ex(context, "FM DAC", dac, dac_desc, num_dacs, selected_dac, "audio\0fm_dac\0"); | |
1693 if (nk_button_label(context, "Back")) { | 1705 if (nk_button_label(context, "Back")) { |
1694 pop_view(); | 1706 pop_view(); |
1695 } | 1707 } |
1696 nk_end(context); | 1708 nk_end(context); |
1697 } | 1709 } |