Reduce duplicates of channel struct

Add/Fix custom clock limit defines (for YMF278B)
This commit is contained in:
cam900 2022-12-04 19:58:58 +09:00
parent fd3f381bc3
commit 2ec4237076
69 changed files with 457 additions and 1151 deletions

View file

@ -17,6 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "../chip-utils.h"
#include "gui.h"
#include "misc/cpp/imgui_stdlib.h"
#include <imgui.h>
@ -1575,19 +1576,19 @@ bool FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool mo
if (supportsCustomRate) {
ImGui::Separator();
int customClock=flags.getInt("customClock",0);
bool usingCustomClock=customClock>=100000;
bool usingCustomClock=customClock>=MIN_CUSTOM_CLOCK;
if (ImGui::Checkbox("Custom clock rate",&usingCustomClock)) {
if (usingCustomClock) {
customClock=1000000;
customClock=MIN_CUSTOM_CLOCK;
} else {
customClock=0;
}
altered=true;
}
if (ImGui::InputInt("Hz",&customClock)) {
if (customClock<100000) customClock=0;
if (customClock>20000000) customClock=20000000;
if (customClock<MIN_CUSTOM_CLOCK) customClock=0;
if (customClock>MAX_CUSTOM_CLOCK) customClock=MAX_CUSTOM_CLOCK;
altered=true;
}