private void enableStereoSettings(SidTune tune) { EmulationSection emulationSection = util.getConfig().getEmulationSection(); boolean second = SidTune.isSIDUsed(emulationSection, tune, 1); boolean third = SidTune.isSIDUsed(emulationSection, tune, 2); int sidBase = SidTune.getSIDAddress(emulationSection, tune, 0); int dualSidBase = SidTune.getSIDAddress(emulationSection, tune, 1); boolean isForcedStereo = second && emulationSection.isForceStereoTune(); boolean isFakeStereo = isForcedStereo && dualSidBase == sidBase; boolean isForced3Sid = third && emulationSection.isForce3SIDTune(); if (isFakeStereo) { stereoMode.getSelectionModel().select(StereoMode.FAKE_STEREO); } else if (isForced3Sid) { stereoMode.getSelectionModel().select(StereoMode.THREE_SID); } else if (isForcedStereo) { stereoMode.getSelectionModel().select(StereoMode.STEREO); } else { stereoMode.getSelectionModel().select(StereoMode.AUTO); } // stereo, only: mainBalance.setDisable(!second); secondVolume.setDisable(!second); secondBalance.setDisable(!second); sid2Emulation.setDisable(!second); sid2Model.setDisable(!second); secondFilter.setDisable(!second); secondFilterCurve.setDisable(!second); // 3-SID, only: thirdVolume.setDisable(!third); thirdBalance.setDisable(!third); sid3Emulation.setDisable(!third); sid3Model.setDisable(!third); thirdFilter.setDisable(!third); thirdFilterCurve.setDisable(!third); // fake stereo, only: sidToRead.setDisable(!(isFakeStereo)); // forced stereo or forced 3-SID, only: baseAddress.setDisable(!(isForcedStereo || isForced3Sid)); // forced 3-SID, only: thirdAddress.setDisable(!isForced3Sid); }
/** * Draw filter curve of the specified SID number and filter name * * @param filterBox filter combo box * @param num SID chip number */ private void drawFilterCurve( final ComboBox<String> filterBox, LineChart<Number, Number> filterCurve) { EmulationSection emulationSection = util.getConfig().getEmulationSection(); XYChart.Series<Number, Number> series = new XYChart.Series<Number, Number>(); series.setName(util.getBundle().getString("FILTERCURVE_TITLE")); filterCurve.getData().clear(); SidTune tune = util.getPlayer().getTune(); boolean second = SidTune.isSIDUsed(emulationSection, tune, 1); boolean third = SidTune.isSIDUsed(emulationSection, tune, 2); Optional<FilterSection> optFilter = util.getConfig() .getFilterSection() .stream() .filter(f -> f.getName().equals(filterBox.getSelectionModel().getSelectedItem())) .findFirst(); if (optFilter.isPresent()) { FilterSection filter = optFilter.get(); // stereo curve or 3-SID curve currently not used? if (!((filterCurve == secondFilterCurve && !second) || (filterCurve == thirdFilterCurve && !third))) { for (int fc = 0; fc < SIDChip.FC_MAX; fc += STEP) { if (filter.isReSIDFilter6581() || filter.isReSIDFilter8580()) { double data = resid_builder.resid.FilterModelConfig.estimateFrequency(filter, fc); series.getData().add(new XYChart.Data<Number, Number>(fc, (int) data)); } else if (filter.isReSIDfpFilter6581() || filter.isReSIDfpFilter8580()) { double data = resid_builder.residfp.FilterModelConfig.estimateFrequency(filter, fc); series.getData().add(new XYChart.Data<Number, Number>(fc, (int) data)); } } } } filterCurve.getData().add(series); }
/** * Detect CPU clock of specific tune. * * <OL> * <LI>forced CPU clock * <LI>CPU clock provided by tune information * <LI>default CPU clock * </OL> * * @return CPU clock to be used for the tune */ public static CPUClock getCPUClock(IEmulationSection emulation, SidTune tune) { CPUClock forcedCPUClock = emulation.getUserClockSpeed(); Clock tuneCPUClock = tune != null ? tune.getInfo().getClockSpeed() : null; CPUClock defaultCPUClock = emulation.getDefaultClockSpeed(); if (forcedCPUClock != null) { return forcedCPUClock; } if (tuneCPUClock == null) { return defaultCPUClock; } switch (tuneCPUClock) { case PAL: case NTSC: return valueOf(tuneCPUClock.toString()); default: return defaultCPUClock; } }