Debian Codegraph @

src/gui/compatFlags.cpp

raw
1 /**
2 * Furnace Tracker - multi-system chiptune tracker
3 * Copyright (C) 2021-2025 tildearrow and contributors
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #include "gui.h"
21 #include "imgui.h"
22 #include "intConst.h"
23
24 void FurnaceGUI::drawCompatFlags() {
25 if (nextWindow==GUI_WINDOW_COMPAT_FLAGS) {
26 compatFlagsOpen=true;
27 ImGui::SetNextWindowFocus();
28 nextWindow=GUI_WINDOW_NOTHING;
29 }
30 if (!compatFlagsOpen) return;
31 if (ImGui::Begin("Compatibility Flags",&compatFlagsOpen,globalWinFlags,_("Compatibility Flags"))) {
32 ImGui::TextWrapped(_("these flags are designed to provide better DefleMask/older Furnace compatibility.\nit is recommended to disable most of these unless you rely on specific quirks."));
33 if (ImGui::BeginTabBar("settingsTab")) {
34 if (ImGui::BeginTabItem(_("DefleMask"))) {
35 if (ImGui::Checkbox(_("Limit slide range"),&e->song.limitSlides)) {
36 MARK_MODIFIED;
37 }
38 if (ImGui::IsItemHovered()) {
39 ImGui::SetTooltip(_("when enabled, slides are limited to a compatible range.\nmay cause problems with slides in negative octaves."));
40 }
41 if (InvCheckbox(_("Compatible noise layout on NES and PC Engine"),&e->song.properNoiseLayout)) {
42 MARK_MODIFIED;
43 }
44 if (ImGui::IsItemHovered()) {
45 ImGui::SetTooltip(_("use a rather unusual compatible noise frequency layout.\nremoves some noise frequencies on PC Engine."));
46 }
47 if (ImGui::Checkbox(_("Game Boy instrument duty is wave volume"),&e->song.waveDutyIsVol)) {
48 MARK_MODIFIED;
49 }
50 if (ImGui::IsItemHovered()) {
51 ImGui::SetTooltip(_("if enabled, an instrument with duty macro in the wave channel will be mapped to wavetable volume."));
52 }
53
54 if (ImGui::Checkbox(_("Restart macro on portamento"),&e->song.resetMacroOnPorta)) {
55 MARK_MODIFIED;
56 }
57 if (ImGui::IsItemHovered()) {
58 ImGui::SetTooltip(_("when enabled, a portamento effect will reset the channel's macro if used in combination with a note."));
59 }
60 if (ImGui::Checkbox(_("Legacy volume slides"),&e->song.legacyVolumeSlides)) {
61 MARK_MODIFIED;
62 }
63 if (ImGui::IsItemHovered()) {
64 ImGui::SetTooltip(_("simulate glitchy volume slide behavior by silently overflowing the volume when the slide goes below 0."));
65 }
66 if (ImGui::Checkbox(_("Compatible arpeggio"),&e->song.compatibleArpeggio)) {
67 MARK_MODIFIED;
68 }
69 if (ImGui::IsItemHovered()) {
70 ImGui::SetTooltip(_("delay arpeggio by one tick on every new note."));
71 }
72 if (ImGui::Checkbox(_("Disable DAC when sample ends"),&e->song.brokenDACMode)) {
73 MARK_MODIFIED;
74 }
75 if (ImGui::IsItemHovered()) {
76 ImGui::SetTooltip(_("when enabled, the DAC in YM2612 will be disabled if there isn't any sample playing."));
77 }
78 if (ImGui::Checkbox(_("Broken speed alternation"),&e->song.brokenSpeedSel)) {
79 MARK_MODIFIED;
80 }
81 if (ImGui::IsItemHovered()) {
82 ImGui::SetTooltip(_("determines next speed based on whether the row is odd/even instead of alternating between speeds."));
83 }
84 if (ImGui::Checkbox(_("Ignore duplicate slide effects"),&e->song.ignoreDuplicateSlides)) {
85 MARK_MODIFIED;
86 }
87 if (ImGui::IsItemHovered()) {
88 ImGui::SetTooltip(_("if this is on, only the first slide of a row in a channel will be considered."));
89 }
90 if (ImGui::Checkbox(_("Ignore 0Dxx on the last order"),&e->song.ignoreJumpAtEnd)) {
91 MARK_MODIFIED;
92 }
93 if (ImGui::IsItemHovered()) {
94 ImGui::SetTooltip(_("if this is on, a jump to next row effect will not take place when it is on the last order of a song."));
95 }
96 if (ImGui::Checkbox(_("Buggy portamento after pitch slide"),&e->song.buggyPortaAfterSlide)) {
97 MARK_MODIFIED;
98 }
99 if (ImGui::IsItemHovered()) {
100 ImGui::SetTooltip(_("simulates a bug in where portamento does not work after sliding."));
101 }
102 if (ImGui::Checkbox(_("FM pitch slide octave boundary odd behavior"),&e->song.fbPortaPause)) {
103 MARK_MODIFIED;
104 }
105 if (ImGui::IsItemHovered()) {
106 ImGui::SetTooltip(_("if this is on, a pitch slide that crosses the octave boundary will stop for one tick and then continue from the nearest octave boundary.\nfor .dmf compatibility."));
107 }
108 if (InvCheckbox(_("Don't apply Game Boy envelope on note-less instrument change"),&e->song.gbInsAffectsEnvelope)) {
109 MARK_MODIFIED;
110 }
111 if (ImGui::IsItemHovered()) {
112 ImGui::SetTooltip(_("if this is on, an instrument change will not affect the envelope."));
113 }
114 if (ImGui::Checkbox(_("Ignore DAC mode change outside of intended channel in ExtCh mode"),&e->song.ignoreDACModeOutsideIntendedChannel)) {
115 MARK_MODIFIED;
116 }
117 if (ImGui::IsItemHovered()) {
118 ImGui::SetTooltip(_("if this is on, 17xx has no effect on the operator channels in YM2612."));
119 }
120 if (ImGui::Checkbox(_("E1xy/E2xy also take priority over slide stops"),&e->song.e1e2AlsoTakePriority)) {
121 MARK_MODIFIED;
122 }
123 if (ImGui::IsItemHovered()) {
124 ImGui::SetTooltip(_("does this make any sense by now?"));
125 }
126 if (ImGui::Checkbox(_("E1xy/E2xy stop when repeating the same note"),&e->song.e1e2StopOnSameNote)) {
127 MARK_MODIFIED;
128 }
129 if (ImGui::IsItemHovered()) {
130 ImGui::SetTooltip(_("ugh, if only this wasn't a thing..."));
131 }
132 if (ImGui::Checkbox(_("SN76489 duty macro always resets phase"),&e->song.snDutyReset)) {
133 MARK_MODIFIED;
134 }
135 if (ImGui::IsItemHovered()) {
136 ImGui::SetTooltip(_("when enabled, duty macro will always reset phase, even if its value hasn't changed."));
137 }
138 if (InvCheckbox(_("Broken volume scaling strategy"),&e->song.newVolumeScaling)) {
139 MARK_MODIFIED;
140 }
141 if (ImGui::IsItemHovered()) {
142 ImGui::SetTooltip(_("when enabled:\n- log scaling: multiply\n- linear scaling: subtract\nwhen disabled:\n- log scaling: subtract\n- linear scaling: multiply"));
143 }
144 if (InvCheckbox(_("Don't persist volume macro after it finishes"),&e->song.volMacroLinger)) {
145 MARK_MODIFIED;
146 }
147 if (ImGui::IsItemHovered()) {
148 ImGui::SetTooltip(_("when enabled, a value in the volume column that happens after the volume macro is done will disregard the macro."));
149 }
150 if (ImGui::Checkbox(_("Broken output volume on instrument change"),&e->song.brokenOutVol)) {
151 MARK_MODIFIED;
152 }
153 if (ImGui::IsItemHovered()) {
154 ImGui::SetTooltip(_("if enabled, no checks for the presence of a volume macro will be made.\nthis will cause the last macro value to linger unless a value in the volume column is present."));
155 }
156 if (ImGui::Checkbox(_("Broken output volume - Episode 2 (PLEASE KEEP ME DISABLED)"),&e->song.brokenOutVol2)) {
157 MARK_MODIFIED;
158 }
159 if (ImGui::IsItemHovered()) {
160 ImGui::SetTooltip(_("these compatibility flags are getting SO damn ridiculous and out of control.\nas you may have guessed, this one exists due to yet ANOTHER DefleMask-specific behavior.\nplease keep this off at all costs, because I will not support it when ROM export comes.\noh, and don't start an argument out of it. Furnace isn't a DefleMask replacement, and no,\nI am not trying to make it look like one with all these flags.\n\noh, and what about the other flags that don't have to do with DefleMask?\nthose are for .mod import, future FamiTracker import and personal taste!\n\nend of rant"));
161 }
162 if (ImGui::Checkbox(_("Treat SN76489 periods under 8 as 1"),&e->song.snNoLowPeriods)) {
163 MARK_MODIFIED;
164 }
165 if (ImGui::IsItemHovered()) {
166 ImGui::SetTooltip(_("when enabled, any SN period under 8 will be written as 1 instead.\nthis replicates DefleMask behavior, but reduces available period range."));
167 }
168 ImGui::EndTabItem();
169 }
170 if (ImGui::BeginTabItem(_("Old Furnace"))) {
171 if (ImGui::Checkbox(_("Arpeggio inhibits non-porta slides"),&e->song.arpNonPorta)) {
172 MARK_MODIFIED;
173 }
174 if (ImGui::IsItemHovered()) {
175 ImGui::SetTooltip(_("behavior changed in 0.5.5"));
176 }
177 if (ImGui::Checkbox(_("Wack FM algorithm macro"),&e->song.algMacroBehavior)) {
178 MARK_MODIFIED;
179 }
180 if (ImGui::IsItemHovered()) {
181 ImGui::SetTooltip(_("behavior changed in 0.5.5"));
182 }
183 if (ImGui::Checkbox(_("Broken shortcut slides (E1xy/E2xy)"),&e->song.brokenShortcutSlides)) {
184 MARK_MODIFIED;
185 }
186 if (ImGui::IsItemHovered()) {
187 ImGui::SetTooltip(_("behavior changed in 0.5.7"));
188 }
189 if (ImGui::Checkbox(_("Stop portamento on note off"),&e->song.stopPortaOnNoteOff)) {
190 MARK_MODIFIED;
191 }
192 if (ImGui::IsItemHovered()) {
193 ImGui::SetTooltip(_("behavior changed in 0.6pre1"));
194 }
195 if (InvCheckbox(_("Don't allow instrument change during slides"),&e->song.newInsTriggersInPorta)) {
196 MARK_MODIFIED;
197 }
198 if (ImGui::IsItemHovered()) {
199 ImGui::SetTooltip(_("behavior changed in 0.6pre1"));
200 }
201 if (InvCheckbox(_("Don't reset note to base on arpeggio stop"),&e->song.arp0Reset)) {
202 MARK_MODIFIED;
203 }
204 if (ImGui::IsItemHovered()) {
205 ImGui::SetTooltip(_("behavior changed in 0.6pre1"));
206 }
207 if (InvCheckbox(_("ExtCh channel status is not shared among operators"),&e->song.sharedExtStat)) {
208 MARK_MODIFIED;
209 }
210 if (ImGui::IsItemHovered()) {
211 ImGui::SetTooltip(_("behavior changed in 0.6pre1"));
212 }
213 if (InvCheckbox(_("Disable new SegaPCM features (macros and better panning)"),&e->song.newSegaPCM)) {
214 MARK_MODIFIED;
215 }
216 if (ImGui::IsItemHovered()) {
217 ImGui::SetTooltip(_("behavior changed in 0.6pre1"));
218 }
219 if (ImGui::Checkbox(_("Old FM octave boundary behavior"),&e->song.oldOctaveBoundary)) {
220 MARK_MODIFIED;
221 }
222 if (ImGui::IsItemHovered()) {
223 ImGui::SetTooltip(_("behavior changed in 0.6pre1"));
224 }
225 if (ImGui::Checkbox(_("Disable OPN2 DAC volume control"),&e->song.noOPN2Vol)) {
226 MARK_MODIFIED;
227 }
228 if (ImGui::IsItemHovered()) {
229 ImGui::SetTooltip(_("behavior changed in 0.6pre1"));
230 }
231 if (ImGui::Checkbox(_("Broken initial position of portamento after arpeggio"),&e->song.brokenPortaArp)) {
232 MARK_MODIFIED;
233 }
234 if (ImGui::IsItemHovered()) {
235 ImGui::SetTooltip(_("behavior changed in 0.6pre1.5"));
236 }
237 if (ImGui::Checkbox(_("Disable new sample features"),&e->song.disableSampleMacro)) {
238 MARK_MODIFIED;
239 }
240 if (ImGui::IsItemHovered()) {
241 ImGui::SetTooltip(_("behavior changed in 0.6pre2"));
242 }
243 if (ImGui::Checkbox(_("Old arpeggio macro + pitch slide strategy"),&e->song.oldArpStrategy)) {
244 MARK_MODIFIED;
245 }
246 if (ImGui::IsItemHovered()) {
247 ImGui::SetTooltip(_("behavior changed in 0.6pre2"));
248 }
249 if (ImGui::Checkbox(_("Broken portamento during legato"),&e->song.brokenPortaLegato)) {
250 MARK_MODIFIED;
251 }
252 if (ImGui::IsItemHovered()) {
253 ImGui::SetTooltip(_("behavior changed in 0.6pre4"));
254 }
255 if (ImGui::Checkbox(_("Broken macros in some FM chips after note off"),&e->song.brokenFMOff)) {
256 MARK_MODIFIED;
257 }
258 if (ImGui::IsItemHovered()) {
259 ImGui::SetTooltip(_("behavior changed in 0.6pre5"));
260 }
261 if (ImGui::Checkbox(_("Pre-note does not take effects into consideration"),&e->song.preNoteNoEffect)) {
262 MARK_MODIFIED;
263 }
264 if (ImGui::IsItemHovered()) {
265 ImGui::SetTooltip(_("behavior changed in 0.6pre9"));
266 }
267 if (ImGui::Checkbox(_("Disable new NES DPCM features"),&e->song.oldDPCM)) {
268 MARK_MODIFIED;
269 }
270 if (ImGui::IsItemHovered()) {
271 ImGui::SetTooltip(_("behavior changed in 0.6.1"));
272 }
273 if (ImGui::Checkbox(_("Legacy technical ALWAYS_SET_VOLUME behavior"),&e->song.oldAlwaysSetVolume)) {
274 MARK_MODIFIED;
275 }
276 if (ImGui::IsItemHovered()) {
277 ImGui::SetTooltip(_("behavior changed in 0.6.1\nthis flag will be removed if I find out that none of the songs break after disabling it."));
278 }
279 if (ImGui::Checkbox(_("Old sample offset effect"),&e->song.oldSampleOffset)) {
280 MARK_MODIFIED;
281 }
282 if (ImGui::IsItemHovered()) {
283 ImGui::SetTooltip(_("behavior changed in 0.6.3"));
284 }
285 ImGui::EndTabItem();
286 }
287 if (ImGui::BeginTabItem(_(".mod import"))) {
288 if (ImGui::Checkbox(_("Don't slide on the first tick of a row"),&e->song.noSlidesOnFirstTick)) {
289 MARK_MODIFIED;
290 }
291 if (ImGui::IsItemHovered()) {
292 ImGui::SetTooltip(_("simulates ProTracker's behavior of not applying volume/pitch slides on the first tick of a row."));
293 }
294 if (ImGui::Checkbox(_("Reset arpeggio position on row change"),&e->song.rowResetsArpPos)) {
295 MARK_MODIFIED;
296 }
297 if (ImGui::IsItemHovered()) {
298 ImGui::SetTooltip(_("simulates ProTracker's behavior of arpeggio being bound to the current tick of a row."));
299 }
300 ImGui::EndTabItem();
301 }
302 if (ImGui::BeginTabItem(_("Pitch/Playback"))) {
303 ImGui::Text(_("Pitch linearity:"));
304 ImGui::Indent();
305 if (ImGui::RadioButton(_("None"),e->song.linearPitch==0)) {
306 e->song.linearPitch=0;
307 MARK_MODIFIED;
308 }
309 if (ImGui::IsItemHovered()) {
310 ImGui::SetTooltip(_("like ProTracker/FamiTracker"));
311 }
312 if (e->song.linearPitch==1) {
313 pushWarningColor(true);
314 if (ImGui::RadioButton(_("Partial (only 04xy/E5xx)"),e->song.linearPitch==1)) {
315 e->song.linearPitch=1;
316 MARK_MODIFIED;
317 }
318 if (ImGui::IsItemHovered()) {
319 ImGui::SetTooltip(_("like DefleMask\n\nthis pitch linearity mode is deprecated due to:\n- excessive complexity\n- lack of possible optimization\n\nit is recommended to change it now because I will remove this option in the future!"));
320 }
321 popWarningColor();
322 }
323 if (ImGui::RadioButton(_("Full"),e->song.linearPitch==2)) {
324 e->song.linearPitch=2;
325 MARK_MODIFIED;
326 }
327 if (ImGui::IsItemHovered()) {
328 ImGui::SetTooltip(_("like Impulse Tracker"));
329 }
330 ImGui::Unindent();
331
332 if (e->song.linearPitch==2) {
333 ImGui::SameLine();
334 ImGui::SetNextItemWidth(120.0f*dpiScale);
335 if (ImGui::InputScalar(_("Pitch slide speed multiplier"),ImGuiDataType_U8,&e->song.pitchSlideSpeed,&_ONE,&_ONE)) {
336 if (e->song.pitchSlideSpeed<1) e->song.pitchSlideSpeed=1;
337 if (e->song.pitchSlideSpeed>64) e->song.pitchSlideSpeed=64;
338 MARK_MODIFIED;
339 }
340 }
341
342 ImGui::Text(_("Loop modality:"));
343 ImGui::Indent();
344 if (ImGui::RadioButton(_("Reset channels"),e->song.loopModality==0)) {
345 e->song.loopModality=0;
346 MARK_MODIFIED;
347 }
348 if (ImGui::IsItemHovered()) {
349 ImGui::SetTooltip(_("select to reset channels on loop. may trigger a voltage click on every loop!"));
350 }
351 if (ImGui::RadioButton(_("Soft reset channels"),e->song.loopModality==1)) {
352 e->song.loopModality=1;
353 MARK_MODIFIED;
354 }
355 if (ImGui::IsItemHovered()) {
356 ImGui::SetTooltip(_("select to turn channels off on loop."));
357 }
358 if (ImGui::RadioButton(_("Do nothing"),e->song.loopModality==2)) {
359 e->song.loopModality=2;
360 MARK_MODIFIED;
361 }
362 if (ImGui::IsItemHovered()) {
363 ImGui::SetTooltip(_("select to not reset channels on loop."));
364 }
365 ImGui::Unindent();
366
367 ImGui::Text(_("Cut/delay effect policy:"));
368 ImGui::Indent();
369 if (ImGui::RadioButton(_("Strict"),e->song.delayBehavior==0)) {
370 e->song.delayBehavior=0;
371 MARK_MODIFIED;
372 }
373 if (ImGui::IsItemHovered()) {
374 ImGui::SetTooltip(_("only when time is less than speed (like DefleMask/ProTracker)"));
375 }
376 if (ImGui::RadioButton(_("Strict (old)"),e->song.delayBehavior==1)) {
377 e->song.delayBehavior=1;
378 MARK_MODIFIED;
379 }
380 if (ImGui::IsItemHovered()) {
381 ImGui::SetTooltip(_("only when time is less than or equal to speed (original buggy behavior)"));
382 }
383 if (ImGui::RadioButton(_("Lax"),e->song.delayBehavior==2)) {
384 e->song.delayBehavior=2;
385 MARK_MODIFIED;
386 }
387 if (ImGui::IsItemHovered()) {
388 ImGui::SetTooltip(_("no checks"));
389 }
390 ImGui::Unindent();
391
392 ImGui::Text(_("Simultaneous jump (0B+0D) treatment:"));
393 ImGui::Indent();
394 if (ImGui::RadioButton(_("Normal"),e->song.jumpTreatment==0)) {
395 e->song.jumpTreatment=0;
396 MARK_MODIFIED;
397 }
398 if (ImGui::IsItemHovered()) {
399 ImGui::SetTooltip(_("accept 0B+0D to jump to a specific row of an order"));
400 }
401 if (ImGui::RadioButton(_("Old Furnace"),e->song.jumpTreatment==1)) {
402 e->song.jumpTreatment=1;
403 MARK_MODIFIED;
404 }
405 if (ImGui::IsItemHovered()) {
406 ImGui::SetTooltip(_("only accept the first jump effect"));
407 }
408 if (ImGui::RadioButton(_("DefleMask"),e->song.jumpTreatment==2)) {
409 e->song.jumpTreatment=2;
410 MARK_MODIFIED;
411 }
412 if (ImGui::IsItemHovered()) {
413 ImGui::SetTooltip(_("only accept 0Dxx"));
414 }
415 ImGui::Unindent();
416 ImGui::EndTabItem();
417 }
418 if (ImGui::BeginTabItem(_("Other"))) {
419 if (ImGui::Checkbox(_("Auto-insert one tick gap between notes"),&e->song.oneTickCut)) {
420 MARK_MODIFIED;
421 }
422 if (ImGui::IsItemHovered()) {
423 ImGui::SetTooltip(_("when enabled, a one-tick note cut will be inserted between non-legato/non-portamento notes.\nthis simulates the behavior of some Amiga/SNES music engines.\n\nineffective on C64."));
424 }
425
426 ImGui::Separator();
427
428 if (InvCheckbox(_("Don't reset slides after note off"),&e->song.noteOffResetsSlides)) {
429 MARK_MODIFIED;
430 }
431 if (ImGui::IsItemHovered()) {
432 ImGui::SetTooltip(_("when enabled, note off will not reset the channel's slide effect."));
433 }
434 if (InvCheckbox(_("Don't reset portamento after reaching target"),&e->song.targetResetsSlides)) {
435 MARK_MODIFIED;
436 }
437 if (ImGui::IsItemHovered()) {
438 ImGui::SetTooltip(_("when enabled, the slide effect will not be disabled after it reaches its target."));
439 }
440 if (ImGui::Checkbox(_("Continuous vibrato"),&e->song.continuousVibrato)) {
441 MARK_MODIFIED;
442 }
443 if (ImGui::IsItemHovered()) {
444 ImGui::SetTooltip(_("when enabled, vibrato phase/position will not be reset on a new note."));
445 }
446 if (InvCheckbox(_("Pitch macro is not linear"),&e->song.pitchMacroIsLinear)) {
447 MARK_MODIFIED;
448 }
449 if (ImGui::IsItemHovered()) {
450 ImGui::SetTooltip(_("when enabled, the pitch macro of an instrument is in frequency/period space."));
451 }
452 if (ImGui::Checkbox(_("Reset arpeggio effect position on new note"),&e->song.resetArpPhaseOnNewNote)) {
453 MARK_MODIFIED;
454 }
455 if (ImGui::IsItemHovered()) {
456 ImGui::SetTooltip(_("when enabled, arpeggio effect (00xy) position is reset on a new note."));
457 }
458 if (ImGui::Checkbox(_("Volume scaling rounds up"),&e->song.ceilVolumeScaling)) {
459 MARK_MODIFIED;
460 }
461 if (ImGui::IsItemHovered()) {
462 ImGui::SetTooltip(_("when enabled, volume macros round up when applied\nthis prevents volume scaling from causing vol=0, which is silent on some chips\n\nineffective on logarithmic channels"));
463 }
464 ImGui::EndTabItem();
465 }
466 ImGui::EndTabBar();
467 }
468 }
469 if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_COMPAT_FLAGS;
470 ImGui::End();
471 }