diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f50a7ca20..29079891d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ defaults: shell: bash env: - BUILD_TYPE: Debug + BUILD_TYPE: RelWithDebInfo jobs: build: @@ -20,8 +20,8 @@ jobs: config: - { name: 'Windows MSVC x86', os: windows-latest, compiler: msvc, arch: x86 } - { name: 'Windows MSVC x86_64', os: windows-latest, compiler: msvc, arch: x86_64 } - - { name: 'Windows MinGW x86', os: ubuntu-20.04, compiler: mingw, arch: x86 } - - { name: 'Windows MinGW x86_64', os: ubuntu-20.04, compiler: mingw, arch: x86_64 } + #- { name: 'Windows MinGW x86', os: ubuntu-20.04, compiler: mingw, arch: x86 } + #- { name: 'Windows MinGW x86_64', os: ubuntu-20.04, compiler: mingw, arch: x86_64 } - { name: 'macOS x86_64', os: macos-latest, arch: x86_64 } - { name: 'macOS ARM', os: macos-latest, arch: arm64 } - { name: 'Linux x86_64', os: ubuntu-18.04, arch: x86_64 } diff --git a/README.md b/README.md index 4da5e5933..baabcd03c 100644 --- a/README.md +++ b/README.md @@ -282,17 +282,13 @@ two possibilities: - the recommended way is by creating the "Sample" type instrument and assigning a sample to it. - otherwise you may employ the DefleMask-compatible method, using `17xx` effect. -> my .dmf song sounds very odd at a certain point +> my .dmf song sounds odd at a certain point -file a bug report. use the Issues page. it's probably another playback inaccuracy. - -> my .dmf song sounds correct, but it doesn't in DefleMask - -file a bug report **here**. it still is a playback inaccuracy. +Furnace's .dmf compatibility isn't perfect and it's mostly because DefleMask does things different. > my song sounds terrible after saving as .dmf! -the DefleMask format has several limitations. save in Furnace song format instead (.fur). +you should only save as .dmf if you're really sure, because the DefleMask format has several limitations. save in Furnace song format instead (.fur). > how do I solo channels? @@ -301,7 +297,7 @@ right click on the channel name. --- # footnotes -copyright (C) 2021-2022 tildearrow and contributors. +copyright (C) 2021-2023 tildearrow and contributors. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. @@ -310,4 +306,4 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -despite the fact this program works with the .dmf file format, it is NOT affiliated with Delek or DefleMask in any way, nor it is a replacement for the original program. +despite the fact this program works with the .dmf, .dmp and .dmw file formats (besides its native .fur format), it is NOT affiliated with Delek or DefleMask in any way, nor it is a replacement for the original program. diff --git a/demos/nes/Super_Space_Invaders_Title.fur b/demos/nes/Super_Space_Invaders_Title.fur new file mode 100644 index 000000000..fe964b0e9 Binary files /dev/null and b/demos/nes/Super_Space_Invaders_Title.fur differ diff --git a/papers/doc/3-pattern/effects.md b/papers/doc/3-pattern/effects.md index 0aa1fc03b..9d784d380 100644 --- a/papers/doc/3-pattern/effects.md +++ b/papers/doc/3-pattern/effects.md @@ -57,9 +57,6 @@ however, effects are continuous, which means you only need to type it once and t - `EDxx`: delay note by `xx` ticks. - `EExx`: send external command. - this effect is currently incomplete. -- `EFxx`: add or subtract global pitch. - - this effect is rather weird. use with caution. - - `80` is center. - `F0xx`: change song Hz by BPM value. - `F1xx`: single tick slide up. - `F2xx`: single tick slide down. diff --git a/src/audio/abstract.cpp b/src/audio/abstract.cpp index 942e31438..e360d1cb1 100644 --- a/src/audio/abstract.cpp +++ b/src/audio/abstract.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/audio/jack.cpp b/src/audio/jack.cpp index f9502cf4f..2ffe19b63 100644 --- a/src/audio/jack.cpp +++ b/src/audio/jack.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/audio/jack.h b/src/audio/jack.h index adba7850c..8018d6c20 100644 --- a/src/audio/jack.h +++ b/src/audio/jack.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/audio/midi.cpp b/src/audio/midi.cpp index afe0dbadc..fa3faf1f4 100644 --- a/src/audio/midi.cpp +++ b/src/audio/midi.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/audio/rtmidi.cpp b/src/audio/rtmidi.cpp index 568ea0614..cbf4dca42 100644 --- a/src/audio/rtmidi.cpp +++ b/src/audio/rtmidi.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/audio/rtmidi.h b/src/audio/rtmidi.h index 34ddf73e6..5a8e06e0b 100644 --- a/src/audio/rtmidi.h +++ b/src/audio/rtmidi.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/audio/sdlAudio.cpp b/src/audio/sdlAudio.cpp index 2915f0343..6d0ceff06 100644 --- a/src/audio/sdlAudio.cpp +++ b/src/audio/sdlAudio.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/audio/sdlAudio.h b/src/audio/sdlAudio.h index 556adabc2..a827b059d 100644 --- a/src/audio/sdlAudio.h +++ b/src/audio/sdlAudio.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/audio/taAudio.h b/src/audio/taAudio.h index 81814f3e3..dd0d76748 100644 --- a/src/audio/taAudio.h +++ b/src/audio/taAudio.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/baseutils.cpp b/src/baseutils.cpp index aad61eb48..787496c7b 100644 --- a/src/baseutils.cpp +++ b/src/baseutils.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/baseutils.h b/src/baseutils.h index 438696aaa..0e1b31911 100644 --- a/src/baseutils.h +++ b/src/baseutils.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp index 87bf76dda..546c5000f 100644 --- a/src/cli/cli.cpp +++ b/src/cli/cli.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/cli/cli.h b/src/cli/cli.h index 55ad36b38..b77df2e8a 100644 --- a/src/cli/cli.h +++ b/src/cli/cli.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/chipUtils.h b/src/engine/chipUtils.h index 01223e30c..90c52953c 100644 --- a/src/engine/chipUtils.h +++ b/src/engine/chipUtils.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/config.cpp b/src/engine/config.cpp index 86c7ddc01..e7e61daa0 100644 --- a/src/engine/config.cpp +++ b/src/engine/config.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/config.h b/src/engine/config.h index a867dc829..e59674ce1 100644 --- a/src/engine/config.h +++ b/src/engine/config.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/configEngine.cpp b/src/engine/configEngine.cpp index a265f0bee..67f466a97 100644 --- a/src/engine/configEngine.cpp +++ b/src/engine/configEngine.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/dataErrors.h b/src/engine/dataErrors.h index a163f221a..e6d8fdc42 100644 --- a/src/engine/dataErrors.h +++ b/src/engine/dataErrors.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/defines.h b/src/engine/defines.h index 3461a52db..0f53bd777 100644 --- a/src/engine/defines.h +++ b/src/engine/defines.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/dispatch.h b/src/engine/dispatch.h index 0c958916c..c9453c49c 100644 --- a/src/engine/dispatch.h +++ b/src/engine/dispatch.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/dispatchContainer.cpp b/src/engine/dispatchContainer.cpp index 7e4eba5da..030bab559 100644 --- a/src/engine/dispatchContainer.cpp +++ b/src/engine/dispatchContainer.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index 7c4896ba3..ce58ec752 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -110,8 +110,6 @@ const char* DivEngine::getEffectDesc(unsigned char effect, int chan, bool notNul return "EDxx: Note delay"; case 0xee: return "EExx: Send external command"; - case 0xef: - return "EFxx: Set global tuning (quirky!)"; case 0xf0: return "F0xx: Set tick rate (bpm)"; case 0xf1: diff --git a/src/engine/engine.h b/src/engine/engine.h index 75b0ad94c..d0f6f98b9 100644 --- a/src/engine/engine.h +++ b/src/engine/engine.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/fileOps.cpp b/src/engine/fileOps.cpp index 9ba9dd9be..e2629dfa0 100644 --- a/src/engine/fileOps.cpp +++ b/src/engine/fileOps.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/fileOpsIns.cpp b/src/engine/fileOpsIns.cpp index 359a7ae39..c23e437d3 100644 --- a/src/engine/fileOpsIns.cpp +++ b/src/engine/fileOpsIns.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/filter.cpp b/src/engine/filter.cpp index 88b381487..5c8ab218e 100644 --- a/src/engine/filter.cpp +++ b/src/engine/filter.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/filter.h b/src/engine/filter.h index 035c05e6a..1e6597e4f 100644 --- a/src/engine/filter.h +++ b/src/engine/filter.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/instrument.cpp b/src/engine/instrument.cpp index 433e288fa..cc1755028 100644 --- a/src/engine/instrument.cpp +++ b/src/engine/instrument.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/instrument.h b/src/engine/instrument.h index 23c353971..8829f6ce8 100644 --- a/src/engine/instrument.h +++ b/src/engine/instrument.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/macroInt.cpp b/src/engine/macroInt.cpp index ff24ae57a..97ae9cdea 100644 --- a/src/engine/macroInt.cpp +++ b/src/engine/macroInt.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/macroInt.h b/src/engine/macroInt.h index 49a4edfcb..ab3cc1216 100644 --- a/src/engine/macroInt.h +++ b/src/engine/macroInt.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/orders.h b/src/engine/orders.h index 78a05f0c1..170eb4ad4 100644 --- a/src/engine/orders.h +++ b/src/engine/orders.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/pattern.cpp b/src/engine/pattern.cpp index 6acdc2842..f7b833e18 100644 --- a/src/engine/pattern.cpp +++ b/src/engine/pattern.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/pattern.h b/src/engine/pattern.h index 218ae2d68..644399863 100644 --- a/src/engine/pattern.h +++ b/src/engine/pattern.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/abstract.cpp b/src/engine/platform/abstract.cpp index bd3efa72a..74ec8cddf 100644 --- a/src/engine/platform/abstract.cpp +++ b/src/engine/platform/abstract.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/amiga.cpp b/src/engine/platform/amiga.cpp index 6f70a310e..1772b313d 100644 --- a/src/engine/platform/amiga.cpp +++ b/src/engine/platform/amiga.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/amiga.h b/src/engine/platform/amiga.h index 494b5da7c..e6048a859 100644 --- a/src/engine/platform/amiga.h +++ b/src/engine/platform/amiga.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/arcade.cpp b/src/engine/platform/arcade.cpp index dece6b67c..e417c3131 100644 --- a/src/engine/platform/arcade.cpp +++ b/src/engine/platform/arcade.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -319,27 +319,6 @@ void DivPlatformArcade::tick(bool sysTick) { rWrite(baseAddr+ADDR_DT2_D2R,(op.d2r&31)|(op.dt2<<6)); } } - if (chan[i].keyOn || chan[i].keyOff) { - if (chan[i].hardReset && chan[i].keyOn) { - for (int j=0; j<4; j++) { - unsigned short baseAddr=chanOffs[i]|opOffs[j]; - immWrite(baseAddr+ADDR_SL_RR,0x0f); - immWrite(baseAddr+ADDR_TL,0x7f); - oldWrites[baseAddr+ADDR_SL_RR]=-1; - oldWrites[baseAddr+ADDR_TL]=-1; - } - } - immWrite(0x08,i); - if (chan[i].hardReset && chan[i].keyOn) { - for (int j=0; j<4; j++) { - unsigned short baseAddr=chanOffs[i]|opOffs[j]; - for (int k=0; k<9; k++) { - immWrite(baseAddr+ADDR_SL_RR,0x0f); - } - } - } - chan[i].keyOff=false; - } } for (int i=0; i<256; i++) { @@ -349,6 +328,24 @@ void DivPlatformArcade::tick(bool sysTick) { } } + int hardResetElapsed=0; + bool mustHardReset=false; + + for (int i=0; i<8; i++) { + if (chan[i].keyOn || chan[i].keyOff) { + immWrite(0x08,i); + if (chan[i].hardReset && chan[i].keyOn) { + mustHardReset=true; + for (int j=0; j<4; j++) { + unsigned short baseAddr=chanOffs[i]|opOffs[j]; + immWrite(baseAddr+ADDR_SL_RR,0x0f); + hardResetElapsed++; + } + } + chan[i].keyOff=false; + } + } + for (int i=0; i<8; i++) { if (chan[i].freqChanged) { chan[i].freq=chan[i].baseFreq+(chan[i].pitch>>1)-64+chan[i].pitch2; @@ -363,14 +360,37 @@ void DivPlatformArcade::tick(bool sysTick) { if (chan[i].freq>=(95<<6)) chan[i].freq=(95<<6)-1; immWrite(i+0x28,hScale(chan[i].freq>>6)); immWrite(i+0x30,chan[i].freq<<2); + hardResetElapsed+=2; chan[i].freqChanged=false; } - if (chan[i].keyOn || chan[i].opMaskChanged) { + if ((chan[i].keyOn || chan[i].opMaskChanged) && !chan[i].hardReset) { immWrite(0x08,(chan[i].opMask<<3)|i); + hardResetElapsed++; chan[i].opMaskChanged=false; chan[i].keyOn=false; } } + + // hard reset handling + if (mustHardReset) { + for (unsigned int i=hardResetElapsed; i { DivInstrumentFM state; unsigned char freqH, freqL; diff --git a/src/engine/platform/ga20.cpp b/src/engine/platform/ga20.cpp index c5cbbb61e..0d2a78461 100644 --- a/src/engine/platform/ga20.cpp +++ b/src/engine/platform/ga20.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/ga20.h b/src/engine/platform/ga20.h index 9c67a9fd3..9cd6869a2 100644 --- a/src/engine/platform/ga20.h +++ b/src/engine/platform/ga20.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/gb.cpp b/src/engine/platform/gb.cpp index 6e6c317c9..e94970145 100644 --- a/src/engine/platform/gb.cpp +++ b/src/engine/platform/gb.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/gb.h b/src/engine/platform/gb.h index 8f70fecb8..f75cc62c2 100644 --- a/src/engine/platform/gb.h +++ b/src/engine/platform/gb.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/genesis.cpp b/src/engine/platform/genesis.cpp index d50f382d0..b75823602 100644 --- a/src/engine/platform/genesis.cpp +++ b/src/engine/platform/genesis.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -472,26 +472,19 @@ void DivPlatformGenesis::tick(bool sysTick) { } } + int hardResetElapsed=0; + bool mustHardReset=false; + for (int i=0; i<6; i++) { if (i==2 && extMode) continue; if (chan[i].keyOn || chan[i].keyOff) { + immWrite(0x28,0x00|konOffs[i]); if (chan[i].hardReset && chan[i].keyOn) { + mustHardReset=true; for (int j=0; j<4; j++) { unsigned short baseAddr=chanOffs[i]|opOffs[j]; immWrite(baseAddr+ADDR_SL_RR,0x0f); - immWrite(baseAddr+ADDR_TL,0x7f); - oldWrites[baseAddr+ADDR_SL_RR]=-1; - oldWrites[baseAddr+ADDR_TL]=-1; - //rWrite(baseAddr+ADDR_SL_RR,(op.rr&15)|(op.sl<<4)); - } - } - immWrite(0x28,0x00|konOffs[i]); - if (chan[i].hardReset && chan[i].keyOn) { - for (int j=0; j<4; j++) { - unsigned short baseAddr=chanOffs[i]|opOffs[j]; - for (int k=0; k<5; k++) { - immWrite(baseAddr+ADDR_SL_RR,0x0f); - } + hardResetElapsed++; } } chan[i].keyOff=false; @@ -520,6 +513,7 @@ void DivPlatformGenesis::tick(bool sysTick) { if (i<6) { immWrite(chanOffs[i]+ADDR_FREQH,chan[i].freq>>8); immWrite(chanOffs[i]+ADDR_FREQ,chan[i].freq&0xff); + hardResetElapsed+=2; } if (chan[i].furnaceDac && chan[i].dacMode) { double off=1.0; @@ -538,12 +532,38 @@ void DivPlatformGenesis::tick(bool sysTick) { } chan[i].freqChanged=false; } - if (chan[i].keyOn || chan[i].opMaskChanged) { - if (i<6) immWrite(0x28,(chan[i].opMask<<4)|konOffs[i]); + if ((chan[i].keyOn || chan[i].opMaskChanged) && !chan[i].hardReset) { + if (i<6) { + immWrite(0x28,(chan[i].opMask<<4)|konOffs[i]); + hardResetElapsed++; + } chan[i].opMaskChanged=false; chan[i].keyOn=false; } } + + // hard reset handling + if (mustHardReset) { + for (unsigned int i=hardResetElapsed; ifm.alg; + if (ch==0 || fbAllOps) { + chan[2].state.fb=ins->fm.fb; + } + chan[2].state.fms=ins->fm.fms; + chan[2].state.ams=ins->fm.ams; + chan[2].state.op[ordch]=ins->fm.op[ordch]; + } + + unsigned short baseAddr=chanOffs[2]|opOffs[ordch]; + DivInstrumentFM::Operator& op=chan[2].state.op[ordch]; + // TODO: how does this work?! + if (isOpMuted[ch]) { + rWrite(baseAddr+0x40,127); + } else { + if (opChan[ch].insChanged) { + rWrite(baseAddr+0x40,127-VOL_SCALE_LOG_BROKEN(127-op.tl,opChan[ch].outVol&0x7f,127)); + } + } + if (opChan[ch].insChanged) { + rWrite(baseAddr+0x30,(op.mult&15)|(dtTable[op.dt&7]<<4)); + rWrite(baseAddr+0x50,(op.ar&31)|(op.rs<<6)); + rWrite(baseAddr+0x60,(op.dr&31)|(op.am<<7)); + rWrite(baseAddr+0x70,op.d2r&31); + rWrite(baseAddr+0x80,(op.rr&15)|(op.sl<<4)); + rWrite(baseAddr+0x90,op.ssgEnv&15); + opChan[ch].mask=op.enable; + } + if (opChan[ch].insChanged) { // TODO how does this work? + rWrite(chanOffs[2]+0xb0,(chan[2].state.alg&7)|(chan[2].state.fb<<3)); + rWrite(chanOffs[2]+0xb4,(IS_EXTCH_MUTED?0:(opChan[ch].pan<<6))|(chan[2].state.fms&7)|((chan[2].state.ams&3)<<4)); + } +} + int DivPlatformGenesisExt::dispatch(DivCommand c) { if (c.chan<2) { return DivPlatformGenesis::dispatch(c); @@ -44,16 +82,6 @@ int DivPlatformGenesisExt::dispatch(DivCommand c) { case DIV_CMD_NOTE_ON: { DivInstrument* ins=parent->getIns(opChan[ch].ins,DIV_INS_FM); - if (opChan[ch].insChanged) { - chan[2].state.alg=ins->fm.alg; - if (ch==0 || fbAllOps) { - chan[2].state.fb=ins->fm.fb; - } - chan[2].state.fms=ins->fm.fms; - chan[2].state.ams=ins->fm.ams; - chan[2].state.op[ordch]=ins->fm.op[ordch]; - } - if (noExtMacros) { opChan[ch].macroInit(NULL); } else { @@ -62,30 +90,8 @@ int DivPlatformGenesisExt::dispatch(DivCommand c) { if (!opChan[ch].std.vol.will) { opChan[ch].outVol=opChan[ch].vol; } - - unsigned short baseAddr=chanOffs[2]|opOffs[ordch]; - DivInstrumentFM::Operator& op=chan[2].state.op[ordch]; - // TODO: how does this work?! - if (isOpMuted[ch]) { - rWrite(baseAddr+0x40,127); - } else { - if (opChan[ch].insChanged) { - rWrite(baseAddr+0x40,127-VOL_SCALE_LOG_BROKEN(127-op.tl,opChan[ch].outVol&0x7f,127)); - } - } - if (opChan[ch].insChanged) { - rWrite(baseAddr+0x30,(op.mult&15)|(dtTable[op.dt&7]<<4)); - rWrite(baseAddr+0x50,(op.ar&31)|(op.rs<<6)); - rWrite(baseAddr+0x60,(op.dr&31)|(op.am<<7)); - rWrite(baseAddr+0x70,op.d2r&31); - rWrite(baseAddr+0x80,(op.rr&15)|(op.sl<<4)); - rWrite(baseAddr+0x90,op.ssgEnv&15); - opChan[ch].mask=op.enable; - } - if (opChan[ch].insChanged) { // TODO how does this work? - rWrite(chanOffs[2]+0xb0,(chan[2].state.alg&7)|(chan[2].state.fb<<3)); - rWrite(chanOffs[2]+0xb4,(IS_EXTCH_MUTED?0:(opChan[ch].pan<<6))|(chan[2].state.fms&7)|((chan[2].state.ams&3)<<4)); - } + + commitStateExt(ch,ins); opChan[ch].insChanged=false; if (c.value!=DIV_NOTE_NULL) { @@ -202,6 +208,11 @@ int DivPlatformGenesisExt::dispatch(DivCommand c) { } break; case DIV_CMD_LEGATO: { + if (opChan[ch].insChanged) { + DivInstrument* ins=parent->getIns(opChan[ch].ins,DIV_INS_FM); + commitStateExt(ch,ins); + opChan[ch].insChanged=false; + } opChan[ch].baseFreq=NOTE_FNUM_BLOCK(c.value,11); opChan[ch].freqChanged=true; break; diff --git a/src/engine/platform/genesisext.h b/src/engine/platform/genesisext.h index 67955adcf..c668d5104 100644 --- a/src/engine/platform/genesisext.h +++ b/src/engine/platform/genesisext.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,6 +29,7 @@ class DivPlatformGenesisExt: public DivPlatformGenesis { bool isOpMuted[4]; friend void putDispatchChip(void*,int); friend void putDispatchChan(void*,int,int); + inline void commitStateExt(int ch, DivInstrument* ins); public: int dispatch(DivCommand c); void* getChanState(int chan); diff --git a/src/engine/platform/k007232.cpp b/src/engine/platform/k007232.cpp index 6a333c6c6..daa661f6f 100644 --- a/src/engine/platform/k007232.cpp +++ b/src/engine/platform/k007232.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/k007232.h b/src/engine/platform/k007232.h index 8d9aeb28b..842310da5 100644 --- a/src/engine/platform/k007232.h +++ b/src/engine/platform/k007232.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/lynx.cpp b/src/engine/platform/lynx.cpp index 07be2d6f6..7dec2102d 100644 --- a/src/engine/platform/lynx.cpp +++ b/src/engine/platform/lynx.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/lynx.h b/src/engine/platform/lynx.h index ec2208d38..7cde207e4 100644 --- a/src/engine/platform/lynx.h +++ b/src/engine/platform/lynx.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/mmc5.cpp b/src/engine/platform/mmc5.cpp index 6e44ea1cb..b130f2cbf 100644 --- a/src/engine/platform/mmc5.cpp +++ b/src/engine/platform/mmc5.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/mmc5.h b/src/engine/platform/mmc5.h index 3e83ff06d..291a1baf4 100644 --- a/src/engine/platform/mmc5.h +++ b/src/engine/platform/mmc5.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/msm5232.cpp b/src/engine/platform/msm5232.cpp index 7405f8d36..eb8d5cbf5 100644 --- a/src/engine/platform/msm5232.cpp +++ b/src/engine/platform/msm5232.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/msm5232.h b/src/engine/platform/msm5232.h index 26d2a34b0..b1d83cf01 100644 --- a/src/engine/platform/msm5232.h +++ b/src/engine/platform/msm5232.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/msm6258.cpp b/src/engine/platform/msm6258.cpp index 7814d23e8..6591eda5e 100644 --- a/src/engine/platform/msm6258.cpp +++ b/src/engine/platform/msm6258.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/msm6258.h b/src/engine/platform/msm6258.h index 47d079cab..0c19d9763 100644 --- a/src/engine/platform/msm6258.h +++ b/src/engine/platform/msm6258.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/msm6295.cpp b/src/engine/platform/msm6295.cpp index 608429002..de7fedd5b 100644 --- a/src/engine/platform/msm6295.cpp +++ b/src/engine/platform/msm6295.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/msm6295.h b/src/engine/platform/msm6295.h index 77a82f580..df1406933 100644 --- a/src/engine/platform/msm6295.h +++ b/src/engine/platform/msm6295.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/n163.cpp b/src/engine/platform/n163.cpp index a65532793..afd4898a0 100644 --- a/src/engine/platform/n163.cpp +++ b/src/engine/platform/n163.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/n163.h b/src/engine/platform/n163.h index 30eb222ce..49c0ff05e 100644 --- a/src/engine/platform/n163.h +++ b/src/engine/platform/n163.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/namcowsg.cpp b/src/engine/platform/namcowsg.cpp index 4d49d2787..ca1de7a54 100644 --- a/src/engine/platform/namcowsg.cpp +++ b/src/engine/platform/namcowsg.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/namcowsg.h b/src/engine/platform/namcowsg.h index 87a2517ef..b29434137 100644 --- a/src/engine/platform/namcowsg.h +++ b/src/engine/platform/namcowsg.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/nes.cpp b/src/engine/platform/nes.cpp index 435384c46..88c7253ee 100644 --- a/src/engine/platform/nes.cpp +++ b/src/engine/platform/nes.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/nes.h b/src/engine/platform/nes.h index 22ccfd913..cb30dbf78 100644 --- a/src/engine/platform/nes.h +++ b/src/engine/platform/nes.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/opl.cpp b/src/engine/platform/opl.cpp index 014f2a402..afaba9f94 100644 --- a/src/engine/platform/opl.cpp +++ b/src/engine/platform/opl.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -446,35 +446,34 @@ void DivPlatformOPL::tick(bool sysTick) { } } } + } - if (i0x100) { + weWillWriteRRLater[(baseAddr&0xff)|32]=true; + } else { + weWillWriteRRLater[(baseAddr&0xff)]=true; } + immWrite(baseAddr+ADDR_SL_RR,0x0f); + hardResetElapsed++; } } } @@ -562,6 +561,11 @@ void DivPlatformOPL::tick(bool sysTick) { for (int i=0; i<512; i++) { if (pendingWrites[i]!=oldWrites[i]) { + if ((i>=0x80 && i<0xa0)) { + if (weWillWriteRRLater[i-0x80]) continue; + } else if ((i>=0x180 && i<0x1a0)) { + if (weWillWriteRRLater[32|(i-0x180)]) continue; + } immWrite(i,pendingWrites[i]&0xff); oldWrites[i]=pendingWrites[i]; } @@ -580,11 +584,15 @@ void DivPlatformOPL::tick(bool sysTick) { immWrite(chanMap[i]+ADDR_FREQ,chan[i].freqL); } if (i=4) { chan[i].noise=chan[i].std.duty.val; chan[i].freqChanged=true; - int noiseSeek=chan[i].note; - if (noiseSeek<0) noiseSeek=0; - chWrite(i,0x07,chan[i].noise?(0x80|(parent->song.properNoiseLayout?(noiseSeek&31):noiseFreq[noiseSeek%12])):0); } if (NEW_ARP_STRAT) { chan[i].handleArp(); - int noiseSeek=chan[i].fixedArp?chan[i].baseNoteOverride:(chan[i].note+chan[i].arpOff); - if (noiseSeek<0) noiseSeek=0; - chWrite(i,0x07,chan[i].noise?(0x80|(parent->song.properNoiseLayout?(noiseSeek&31):noiseFreq[noiseSeek%12])):0); } else if (chan[i].std.arp.had) { if (!chan[i].inPorta) { int noiseSeek=parent->calcArp(chan[i].note,chan[i].std.arp.val); chan[i].baseFreq=NOTE_PERIODIC(noiseSeek); if (noiseSeek<0) noiseSeek=0; - chWrite(i,0x07,chan[i].noise?(0x80|(parent->song.properNoiseLayout?(noiseSeek&31):noiseFreq[noiseSeek%12])):0); + chan[i].noiseSeek=noiseSeek; } chan[i].freqChanged=true; } @@ -246,6 +240,15 @@ void DivPlatformPCE::tick(bool sysTick) { if (chan[i].freq>4095) chan[i].freq=4095; chWrite(i,0x02,chan[i].freq&0xff); chWrite(i,0x03,chan[i].freq>>8); + + if (i>=4) { + int noiseSeek=(chan[i].fixedArp?chan[i].baseNoteOverride:(chan[i].note+chan[i].arpOff))+chan[i].pitch2; + if (!parent->song.properNoiseLayout && noiseSeek<0) noiseSeek=0; + if (!NEW_ARP_STRAT) { + noiseSeek=chan[i].noiseSeek; + } + chWrite(i,0x07,chan[i].noise?(0x80|(parent->song.properNoiseLayout?(noiseSeek&31):noiseFreq[noiseSeek%12])):0); + } if (chan[i].keyOn) { //rWrite(16+i*5,0x80); //chWrite(i,0x04,0x80|chan[i].vol); @@ -331,9 +334,8 @@ int DivPlatformPCE::dispatch(DivCommand c) { chan[c.chan].baseFreq=NOTE_PERIODIC(c.value); chan[c.chan].freqChanged=true; chan[c.chan].note=c.value; - int noiseSeek=chan[c.chan].note; - if (noiseSeek<0) noiseSeek=0; - chWrite(c.chan,0x07,chan[c.chan].noise?(0x80|(parent->song.properNoiseLayout?(noiseSeek&31):noiseFreq[noiseSeek%12])):0); + chan[c.chan].noiseSeek=c.value; + if (chan[c.chan].noiseSeek<0) chan[c.chan].noiseSeek=0; } chan[c.chan].active=true; chan[c.chan].keyOn=true; @@ -431,7 +433,7 @@ int DivPlatformPCE::dispatch(DivCommand c) { } case DIV_CMD_STD_NOISE_MODE: chan[c.chan].noise=c.value; - chWrite(c.chan,0x07,chan[c.chan].noise?(0x80|chan[c.chan].note):0); + chan[c.chan].freqChanged=true; break; case DIV_CMD_SAMPLE_MODE: chan[c.chan].pcm=c.value; diff --git a/src/engine/platform/pce.h b/src/engine/platform/pce.h index 6493840c1..fd4f81320 100644 --- a/src/engine/platform/pce.h +++ b/src/engine/platform/pce.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,7 +34,7 @@ class DivPlatformPCE: public DivDispatch { unsigned char pan; bool noise, pcm, furnaceDac, deferredWaveUpdate; signed short wave; - int macroVolMul; + int macroVolMul, noiseSeek; DivWaveSynth ws; Channel(): SharedChannel(31), @@ -51,7 +51,8 @@ class DivPlatformPCE: public DivDispatch { furnaceDac(false), deferredWaveUpdate(false), wave(-1), - macroVolMul(31) {} + macroVolMul(31), + noiseSeek(0) {} }; Channel chan[6]; DivDispatchOscBuffer* oscBuf[6]; diff --git a/src/engine/platform/pcmdac.cpp b/src/engine/platform/pcmdac.cpp index 2843f0797..935a795d0 100644 --- a/src/engine/platform/pcmdac.cpp +++ b/src/engine/platform/pcmdac.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/pcmdac.h b/src/engine/platform/pcmdac.h index 9224ccc7d..9de928ffe 100644 --- a/src/engine/platform/pcmdac.h +++ b/src/engine/platform/pcmdac.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/pcspkr.cpp b/src/engine/platform/pcspkr.cpp index 70c846f7c..9694b66c0 100644 --- a/src/engine/platform/pcspkr.cpp +++ b/src/engine/platform/pcspkr.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/pcspkr.h b/src/engine/platform/pcspkr.h index 554c0d074..23b3c0b49 100644 --- a/src/engine/platform/pcspkr.h +++ b/src/engine/platform/pcspkr.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/pet.cpp b/src/engine/platform/pet.cpp index b4399bcbc..4d085581e 100644 --- a/src/engine/platform/pet.cpp +++ b/src/engine/platform/pet.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/pet.h b/src/engine/platform/pet.h index 5942817c2..771d5cbb5 100644 --- a/src/engine/platform/pet.h +++ b/src/engine/platform/pet.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/pokemini.cpp b/src/engine/platform/pokemini.cpp index 9b543153c..aa8adc0d7 100644 --- a/src/engine/platform/pokemini.cpp +++ b/src/engine/platform/pokemini.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/pokemini.h b/src/engine/platform/pokemini.h index 80233eb42..4e14bf572 100644 --- a/src/engine/platform/pokemini.h +++ b/src/engine/platform/pokemini.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/pokey.cpp b/src/engine/platform/pokey.cpp index 8294d9dcc..ae4b311e1 100644 --- a/src/engine/platform/pokey.cpp +++ b/src/engine/platform/pokey.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/pokey.h b/src/engine/platform/pokey.h index 79206a745..f24ea56c8 100644 --- a/src/engine/platform/pokey.h +++ b/src/engine/platform/pokey.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/pong.cpp b/src/engine/platform/pong.cpp index 27fd76b38..7d478b83b 100644 --- a/src/engine/platform/pong.cpp +++ b/src/engine/platform/pong.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/pong.h b/src/engine/platform/pong.h index 8259b14cf..4fb13477c 100644 --- a/src/engine/platform/pong.h +++ b/src/engine/platform/pong.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/qsound.cpp b/src/engine/platform/qsound.cpp index cea8c41af..f73f85dab 100644 --- a/src/engine/platform/qsound.cpp +++ b/src/engine/platform/qsound.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/qsound.h b/src/engine/platform/qsound.h index c04514ed8..9c090f19c 100644 --- a/src/engine/platform/qsound.h +++ b/src/engine/platform/qsound.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/rf5c68.cpp b/src/engine/platform/rf5c68.cpp index e5484dc77..7301bb40c 100644 --- a/src/engine/platform/rf5c68.cpp +++ b/src/engine/platform/rf5c68.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/rf5c68.h b/src/engine/platform/rf5c68.h index 98fc1a759..94ced515e 100644 --- a/src/engine/platform/rf5c68.h +++ b/src/engine/platform/rf5c68.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/saa.cpp b/src/engine/platform/saa.cpp index 924bc73ac..d66692ddf 100644 --- a/src/engine/platform/saa.cpp +++ b/src/engine/platform/saa.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/saa.h b/src/engine/platform/saa.h index 97bdbc60b..43e3cc875 100644 --- a/src/engine/platform/saa.h +++ b/src/engine/platform/saa.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/scc.cpp b/src/engine/platform/scc.cpp index fcb55f257..e1fa7424f 100644 --- a/src/engine/platform/scc.cpp +++ b/src/engine/platform/scc.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/scc.h b/src/engine/platform/scc.h index 1c7364723..b8b892af3 100644 --- a/src/engine/platform/scc.h +++ b/src/engine/platform/scc.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/segapcm.cpp b/src/engine/platform/segapcm.cpp index 607e16421..91ba1000b 100644 --- a/src/engine/platform/segapcm.cpp +++ b/src/engine/platform/segapcm.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/segapcm.h b/src/engine/platform/segapcm.h index 2f91f03e3..a57c8084e 100644 --- a/src/engine/platform/segapcm.h +++ b/src/engine/platform/segapcm.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/sms.cpp b/src/engine/platform/sms.cpp index 8fcb3a396..6679eba25 100644 --- a/src/engine/platform/sms.cpp +++ b/src/engine/platform/sms.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/sms.h b/src/engine/platform/sms.h index 39d4a0947..a8bb42d6b 100644 --- a/src/engine/platform/sms.h +++ b/src/engine/platform/sms.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/snes.cpp b/src/engine/platform/snes.cpp index 6fb942d48..ead26a81b 100644 --- a/src/engine/platform/snes.cpp +++ b/src/engine/platform/snes.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/snes.h b/src/engine/platform/snes.h index 884c7d804..8783e61c3 100644 --- a/src/engine/platform/snes.h +++ b/src/engine/platform/snes.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/sound/ymfm/ymfm.h b/src/engine/platform/sound/ymfm/ymfm.h index 47ff90072..b1ba7c83a 100644 --- a/src/engine/platform/sound/ymfm/ymfm.h +++ b/src/engine/platform/sound/ymfm/ymfm.h @@ -350,7 +350,7 @@ public: { // create file char name[20]; - sprintf(name, "wavlog-%02d.wav", m_index); + snprintf(name, 20, "wavlog-%02d.wav", m_index); FILE *out = fopen(name, "wb"); // make the wav file header diff --git a/src/engine/platform/sound/ymfm/ymfm_opm.cpp b/src/engine/platform/sound/ymfm/ymfm_opm.cpp index 31d0a7467..958dae579 100644 --- a/src/engine/platform/sound/ymfm/ymfm_opm.cpp +++ b/src/engine/platform/sound/ymfm/ymfm_opm.cpp @@ -363,7 +363,7 @@ std::string opm_registers::log_keyon(uint32_t choffs, uint32_t opoffs) char buffer[256]; char *end = &buffer[0]; - end += sprintf(end, "%u.%02u freq=%04X dt2=%u dt=%u fb=%u alg=%X mul=%X tl=%02X ksr=%u adsr=%02X/%02X/%02X/%X sl=%X out=%c%c", + end += snprintf(end, 256-(end-buffer), "%u.%02u freq=%04X dt2=%u dt=%u fb=%u alg=%X mul=%X tl=%02X ksr=%u adsr=%02X/%02X/%02X/%X sl=%X out=%c%c", chnum, opnum, ch_block_freq(choffs), op_detune2(opoffs), @@ -383,14 +383,14 @@ std::string opm_registers::log_keyon(uint32_t choffs, uint32_t opoffs) bool am = (lfo_am_depth() != 0 && ch_lfo_am_sens(choffs) != 0 && op_lfo_am_enable(opoffs) != 0); if (am) - end += sprintf(end, " am=%u/%02X", ch_lfo_am_sens(choffs), lfo_am_depth()); + end += snprintf(end, 256-(end-buffer), " am=%u/%02X", ch_lfo_am_sens(choffs), lfo_am_depth()); bool pm = (lfo_pm_depth() != 0 && ch_lfo_pm_sens(choffs) != 0); if (pm) - end += sprintf(end, " pm=%u/%02X", ch_lfo_pm_sens(choffs), lfo_pm_depth()); + end += snprintf(end, 256-(end-buffer), " pm=%u/%02X", ch_lfo_pm_sens(choffs), lfo_pm_depth()); if (am || pm) - end += sprintf(end, " lfo=%02X/%c", lfo_rate(), "WQTN"[lfo_waveform()]); + end += snprintf(end, 256-(end-buffer), " lfo=%02X/%c", lfo_rate(), "WQTN"[lfo_waveform()]); if (noise_enable() && opoffs == 31) - end += sprintf(end, " noise=1"); + end += snprintf(end, 256-(end-buffer), " noise=1"); return buffer; } diff --git a/src/engine/platform/sound/ymfm/ymfm_opn.cpp b/src/engine/platform/sound/ymfm/ymfm_opn.cpp index 053ad9770..25d921a95 100644 --- a/src/engine/platform/sound/ymfm/ymfm_opn.cpp +++ b/src/engine/platform/sound/ymfm/ymfm_opn.cpp @@ -411,7 +411,7 @@ std::string opn_registers_base::log_keyon(uint32_t choffs, uint32_t opof char buffer[256]; char *end = &buffer[0]; - end += sprintf(end, "%u.%02u freq=%04X dt=%u fb=%u alg=%X mul=%X tl=%02X ksr=%u adsr=%02X/%02X/%02X/%X sl=%X", + end += snprintf(end, 256-(end-buffer), "%u.%02u freq=%04X dt=%u fb=%u alg=%X mul=%X tl=%02X ksr=%u adsr=%02X/%02X/%02X/%X sl=%X", chnum, opnum, block_freq, op_detune(opoffs), @@ -427,21 +427,21 @@ std::string opn_registers_base::log_keyon(uint32_t choffs, uint32_t opof op_sustain_level(opoffs)); if (OUTPUTS > 1) - end += sprintf(end, " out=%c%c", + end += snprintf(end, 256-(end-buffer), " out=%c%c", ch_output_0(choffs) ? 'L' : '-', ch_output_1(choffs) ? 'R' : '-'); if (op_ssg_eg_enable(opoffs)) - end += sprintf(end, " ssg=%X", op_ssg_eg_mode(opoffs)); + end += snprintf(end, 256-(end-buffer), " ssg=%X", op_ssg_eg_mode(opoffs)); bool am = (op_lfo_am_enable(opoffs) && ch_lfo_am_sens(choffs) != 0); if (am) - end += sprintf(end, " am=%u", ch_lfo_am_sens(choffs)); + end += snprintf(end, 256-(end-buffer), " am=%u", ch_lfo_am_sens(choffs)); bool pm = (ch_lfo_pm_sens(choffs) != 0); if (pm) - end += sprintf(end, " pm=%u", ch_lfo_pm_sens(choffs)); + end += snprintf(end, 256-(end-buffer), " pm=%u", ch_lfo_pm_sens(choffs)); if (am || pm) - end += sprintf(end, " lfo=%02X", lfo_rate()); + end += snprintf(end, 256-(end-buffer), " lfo=%02X", lfo_rate()); if (multi_freq() && choffs == 2) - end += sprintf(end, " multi=1"); + end += snprintf(end, 256-(end-buffer), " multi=1"); return buffer; } diff --git a/src/engine/platform/sound/ymfm/ymfm_opz.cpp b/src/engine/platform/sound/ymfm/ymfm_opz.cpp index 37c6a5fce..b20bea3c1 100644 --- a/src/engine/platform/sound/ymfm/ymfm_opz.cpp +++ b/src/engine/platform/sound/ymfm/ymfm_opz.cpp @@ -575,14 +575,14 @@ std::string opz_registers::log_keyon(uint32_t choffs, uint32_t opoffs) char buffer[256]; char *end = &buffer[0]; - end += sprintf(end, "%u.%02u", chnum, opnum); + end += snprintf(end, 256-(end-buffer), "%u.%02u", chnum, opnum); if (op_fix_mode(opoffs)) - end += sprintf(end, " fixfreq=%X fine=%X shift=%X", op_fix_frequency(opoffs), op_fine(opoffs), op_fix_range(opoffs)); + end += snprintf(end, 256-(end-buffer), " fixfreq=%X fine=%X shift=%X", op_fix_frequency(opoffs), op_fine(opoffs), op_fix_range(opoffs)); else - end += sprintf(end, " freq=%04X dt2=%u fine=%X", ch_block_freq(choffs), op_detune2(opoffs), op_fine(opoffs)); + end += snprintf(end, 256-(end-buffer), " freq=%04X dt2=%u fine=%X", ch_block_freq(choffs), op_detune2(opoffs), op_fine(opoffs)); - end += sprintf(end, " dt=%u fb=%u alg=%X mul=%X tl=%02X ksr=%u adsr=%02X/%02X/%02X/%X sl=%X out=%c%c", + end += snprintf(end, 256-(end-buffer), " dt=%u fb=%u alg=%X mul=%X tl=%02X ksr=%u adsr=%02X/%02X/%02X/%X sl=%X out=%c%c", op_detune(opoffs), ch_feedback(choffs), ch_algorithm(choffs), @@ -598,32 +598,32 @@ std::string opz_registers::log_keyon(uint32_t choffs, uint32_t opoffs) ch_output_1(choffs) ? 'R' : '-'); if (op_eg_shift(opoffs) != 0) - end += sprintf(end, " egshift=%u", op_eg_shift(opoffs)); + end += snprintf(end, 256-(end-buffer), " egshift=%u", op_eg_shift(opoffs)); bool am = (lfo_am_depth() != 0 && ch_lfo_am_sens(choffs) != 0 && op_lfo_am_enable(opoffs) != 0); if (am) - end += sprintf(end, " am=%u/%02X", ch_lfo_am_sens(choffs), lfo_am_depth()); + end += snprintf(end, 256-(end-buffer), " am=%u/%02X", ch_lfo_am_sens(choffs), lfo_am_depth()); bool pm = (lfo_pm_depth() != 0 && ch_lfo_pm_sens(choffs) != 0); if (pm) - end += sprintf(end, " pm=%u/%02X", ch_lfo_pm_sens(choffs), lfo_pm_depth()); + end += snprintf(end, 256-(end-buffer), " pm=%u/%02X", ch_lfo_pm_sens(choffs), lfo_pm_depth()); if (am || pm) - end += sprintf(end, " lfo=%02X/%c", lfo_rate(), "WQTN"[lfo_waveform()]); + end += snprintf(end, 256-(end-buffer), " lfo=%02X/%c", lfo_rate(), "WQTN"[lfo_waveform()]); bool am2 = (lfo2_am_depth() != 0 && ch_lfo2_am_sens(choffs) != 0 && op_lfo_am_enable(opoffs) != 0); if (am2) - end += sprintf(end, " am2=%u/%02X", ch_lfo2_am_sens(choffs), lfo2_am_depth()); + end += snprintf(end, 256-(end-buffer), " am2=%u/%02X", ch_lfo2_am_sens(choffs), lfo2_am_depth()); bool pm2 = (lfo2_pm_depth() != 0 && ch_lfo2_pm_sens(choffs) != 0); if (pm2) - end += sprintf(end, " pm2=%u/%02X", ch_lfo2_pm_sens(choffs), lfo2_pm_depth()); + end += snprintf(end, 256-(end-buffer), " pm2=%u/%02X", ch_lfo2_pm_sens(choffs), lfo2_pm_depth()); if (am2 || pm2) - end += sprintf(end, " lfo2=%02X/%c", lfo2_rate(), "WQTN"[lfo2_waveform()]); + end += snprintf(end, 256-(end-buffer), " lfo2=%02X/%c", lfo2_rate(), "WQTN"[lfo2_waveform()]); if (op_reverb_rate(opoffs) != 0) - end += sprintf(end, " rev=%u", op_reverb_rate(opoffs)); + end += snprintf(end, 256-(end-buffer), " rev=%u", op_reverb_rate(opoffs)); if (op_waveform(opoffs) != 0) - end += sprintf(end, " wf=%u", op_waveform(opoffs)); + end += snprintf(end, 256-(end-buffer), " wf=%u", op_waveform(opoffs)); if (noise_enable() && opoffs == 31) - end += sprintf(end, " noise=1"); + end += snprintf(end, 256-(end-buffer), " noise=1"); return buffer; } diff --git a/src/engine/platform/su.cpp b/src/engine/platform/su.cpp index 51b04e0e6..7a7addea8 100644 --- a/src/engine/platform/su.cpp +++ b/src/engine/platform/su.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/su.h b/src/engine/platform/su.h index 518edafa4..0102db03e 100644 --- a/src/engine/platform/su.h +++ b/src/engine/platform/su.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/swan.cpp b/src/engine/platform/swan.cpp index 001d2957a..4e0b83724 100644 --- a/src/engine/platform/swan.cpp +++ b/src/engine/platform/swan.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -217,6 +217,26 @@ void DivPlatformSwan::tick(bool sysTick) { } } } + if (chan[3].std.phaseReset.had) { + if (noise>0) { + rWrite(0x0e,((noise-1)&0x07)|0x18); + sndCtrl|=0x80; + } else { + sndCtrl&=~0x80; + } + } + unsigned char origSndCtrl=sndCtrl; + bool phaseResetHappens=false; + for (int i=0; i<4; i++) { + if (chan[i].std.phaseReset.had) { + phaseResetHappens=true; + sndCtrl&=~(1<>1)-64+chan[i].pitch2; @@ -323,14 +319,34 @@ void DivPlatformTX81Z::tick(bool sysTick) { if (chan[i].freq>=(95<<6)) chan[i].freq=(95<<6)-1; immWrite(i+0x28,hScale(chan[i].freq>>6)); immWrite(i+0x30,(chan[i].freq<<2)|(chan[i].chVolL==chan[i].chVolR)); + hardResetElapsed+=2; chan[i].freqChanged=false; } - if (chan[i].keyOn) { - //immWrite(0x08,i); + if (chan[i].keyOn && !chan[i].hardReset) { immWrite(chanOffs[i]+ADDR_LR_FB_ALG,(chan[i].state.alg&7)|(chan[i].state.fb<<3)|0x40|(chan[i].chVolR<<7)); chan[i].keyOn=false; } } + + // hard reset handling + if (mustHardReset) { + for (unsigned int i=hardResetElapsed; i0x3fff) chan[i].freq=0x3fff; immWrite(chanOffs[i]+ADDR_FREQH,chan[i].freq>>8); immWrite(chanOffs[i]+ADDR_FREQ,chan[i].freq&0xff); + hardResetElapsed+=2; chan[i].freqChanged=false; } - if (chan[i].keyOn || chan[i].opMaskChanged) { + if ((chan[i].keyOn || chan[i].opMaskChanged) && !chan[i].hardReset) { immWrite(0x28,(chan[i].opMask<<4)|konOffs[i]); + hardResetElapsed++; chan[i].opMaskChanged=false; chan[i].keyOn=false; } } + + // hard reset handling + if (mustHardReset) { + for (unsigned int i=hardResetElapsed; ifm.alg; + if (ch==0 || fbAllOps) { + chan[2].state.fb=ins->fm.fb; + } + chan[2].state.op[ordch]=ins->fm.op[ordch]; + } + + unsigned short baseAddr=chanOffs[2]|opOffs[ordch]; + DivInstrumentFM::Operator& op=chan[2].state.op[ordch]; + // TODO: how does this work?! + if (isOpMuted[ch]) { + rWrite(baseAddr+0x40,127); + } else { + if (opChan[ch].insChanged) { + rWrite(baseAddr+0x40,127-VOL_SCALE_LOG_BROKEN(127-op.tl,opChan[ch].outVol&0x7f,127)); + } + } + if (opChan[ch].insChanged) { + rWrite(baseAddr+0x30,(op.mult&15)|(dtTable[op.dt&7]<<4)); + rWrite(baseAddr+0x50,(op.ar&31)|(op.rs<<6)); + rWrite(baseAddr+0x60,(op.dr&31)|(op.am<<7)); + rWrite(baseAddr+0x70,op.d2r&31); + rWrite(baseAddr+0x80,(op.rr&15)|(op.sl<<4)); + rWrite(baseAddr+0x90,op.ssgEnv&15); + opChan[ch].mask=op.enable; + } + if (opChan[ch].insChanged) { // TODO how does this work? + rWrite(chanOffs[2]+0xb0,(chan[2].state.alg&7)|(chan[2].state.fb<<3)); + } +} + int DivPlatformYM2203Ext::dispatch(DivCommand c) { if (c.chan<2) { return DivPlatformYM2203::dispatch(c); @@ -42,14 +77,6 @@ int DivPlatformYM2203Ext::dispatch(DivCommand c) { case DIV_CMD_NOTE_ON: { DivInstrument* ins=parent->getIns(opChan[ch].ins,DIV_INS_FM); - if (opChan[ch].insChanged) { - chan[2].state.alg=ins->fm.alg; - if (ch==0 || fbAllOps) { - chan[2].state.fb=ins->fm.fb; - } - chan[2].state.op[ordch]=ins->fm.op[ordch]; - } - if (noExtMacros) { opChan[ch].macroInit(NULL); } else { @@ -58,29 +85,8 @@ int DivPlatformYM2203Ext::dispatch(DivCommand c) { if (!opChan[ch].std.vol.will) { opChan[ch].outVol=opChan[ch].vol; } - - unsigned short baseAddr=chanOffs[2]|opOffs[ordch]; - DivInstrumentFM::Operator& op=chan[2].state.op[ordch]; - // TODO: how does this work?! - if (isOpMuted[ch]) { - rWrite(baseAddr+0x40,127); - } else { - if (opChan[ch].insChanged) { - rWrite(baseAddr+0x40,127-VOL_SCALE_LOG_BROKEN(127-op.tl,opChan[ch].outVol&0x7f,127)); - } - } - if (opChan[ch].insChanged) { - rWrite(baseAddr+0x30,(op.mult&15)|(dtTable[op.dt&7]<<4)); - rWrite(baseAddr+0x50,(op.ar&31)|(op.rs<<6)); - rWrite(baseAddr+0x60,(op.dr&31)|(op.am<<7)); - rWrite(baseAddr+0x70,op.d2r&31); - rWrite(baseAddr+0x80,(op.rr&15)|(op.sl<<4)); - rWrite(baseAddr+0x90,op.ssgEnv&15); - opChan[ch].mask=op.enable; - } - if (opChan[ch].insChanged) { // TODO how does this work? - rWrite(chanOffs[2]+0xb0,(chan[2].state.alg&7)|(chan[2].state.fb<<3)); - } + + commitStateExt(ch,ins); opChan[ch].insChanged=false; if (c.value!=DIV_NOTE_NULL) { @@ -166,6 +172,11 @@ int DivPlatformYM2203Ext::dispatch(DivCommand c) { break; } case DIV_CMD_LEGATO: { + if (opChan[ch].insChanged) { + DivInstrument* ins=parent->getIns(opChan[ch].ins,DIV_INS_FM); + commitStateExt(ch,ins); + opChan[ch].insChanged=false; + } opChan[ch].baseFreq=NOTE_FNUM_BLOCK(c.value,11); opChan[ch].freqChanged=true; break; diff --git a/src/engine/platform/ym2203ext.h b/src/engine/platform/ym2203ext.h index 6d8bb0baa..731e2a202 100644 --- a/src/engine/platform/ym2203ext.h +++ b/src/engine/platform/ym2203ext.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,6 +28,7 @@ class DivPlatformYM2203Ext: public DivPlatformYM2203 { OPNOpChannel opChan[4]; bool isOpMuted[4]; friend void putDispatchChip(void*,int); + inline void commitStateExt(int ch, DivInstrument* ins); public: int dispatch(DivCommand c); void* getChanState(int chan); diff --git a/src/engine/platform/ym2608.cpp b/src/engine/platform/ym2608.cpp index 063b3870b..52301d3ec 100644 --- a/src/engine/platform/ym2608.cpp +++ b/src/engine/platform/ym2608.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -606,29 +606,6 @@ void DivPlatformYM2608::tick(bool sysTick) { rWrite(baseAddr+ADDR_SSG,op.ssgEnv&15); } } - - if (chan[i].keyOn || chan[i].keyOff) { - if (chan[i].hardReset && chan[i].keyOn) { - for (int j=0; j<4; j++) { - unsigned short baseAddr=chanOffs[i]|opOffs[j]; - immWrite(baseAddr+ADDR_SL_RR,0x0f); - immWrite(baseAddr+ADDR_TL,0x7f); - oldWrites[baseAddr+ADDR_SL_RR]=-1; - oldWrites[baseAddr+ADDR_TL]=-1; - //rWrite(baseAddr+ADDR_SL_RR,(op.rr&15)|(op.sl<<4)); - } - } - immWrite(0x28,0x00|konOffs[i]); - if (chan[i].hardReset && chan[i].keyOn) { - for (int j=0; j<4; j++) { - unsigned short baseAddr=chanOffs[i]|opOffs[j]; - for (int k=0; k<100; k++) { - immWrite(baseAddr+ADDR_SL_RR,0x0f); - } - } - } - chan[i].keyOff=false; - } } for (int i=16; i<512; i++) { @@ -638,6 +615,25 @@ void DivPlatformYM2608::tick(bool sysTick) { } } + int hardResetElapsed=0; + bool mustHardReset=false; + + for (int i=0; i<6; i++) { + if (i==2 && extMode) continue; + if (chan[i].keyOn || chan[i].keyOff) { + immWrite(0x28,0x00|konOffs[i]); + if (chan[i].hardReset && chan[i].keyOn) { + mustHardReset=true; + for (int j=0; j<4; j++) { + unsigned short baseAddr=chanOffs[i]|opOffs[j]; + immWrite(baseAddr+ADDR_SL_RR,0x0f); + hardResetElapsed++; + } + } + chan[i].keyOff=false; + } + } + for (int i=0; i<6; i++) { if (i==2 && extMode) continue; if (chan[i].freqChanged) { @@ -659,10 +655,12 @@ void DivPlatformYM2608::tick(bool sysTick) { if (chan[i].freq>0x3fff) chan[i].freq=0x3fff; immWrite(chanOffs[i]+ADDR_FREQH,chan[i].freq>>8); immWrite(chanOffs[i]+ADDR_FREQ,chan[i].freq&0xff); + hardResetElapsed+=2; chan[i].freqChanged=false; } - if (chan[i].keyOn || chan[i].opMaskChanged) { + if ((chan[i].keyOn || chan[i].opMaskChanged) && !chan[i].hardReset) { immWrite(0x28,(chan[i].opMask<<4)|konOffs[i]); + hardResetElapsed++; chan[i].opMaskChanged=false; chan[i].keyOn=false; } @@ -679,6 +677,7 @@ void DivPlatformYM2608::tick(bool sysTick) { if (globalRSSVolume!=(chan[i].std.duty.val&0x3f)) { globalRSSVolume=chan[i].std.duty.val&0x3f; immWrite(0x11,globalRSSVolume); + hardResetElapsed++; } } if (chan[i].std.panL.had) { @@ -691,6 +690,7 @@ void DivPlatformYM2608::tick(bool sysTick) { } if (!isMuted[i] && (chan[i].std.vol.had || chan[i].std.panL.had)) { immWrite(0x18+(i-9),isMuted[i]?0:((chan[i].pan<<6)|chan[i].outVol)); + hardResetElapsed++; } } if (chan[i].keyOff) { @@ -709,6 +709,7 @@ void DivPlatformYM2608::tick(bool sysTick) { if (chan[15].std.vol.had) { chan[15].outVol=(chan[15].vol*MIN(chan[15].macroVolMul,chan[15].std.vol.val))/chan[15].macroVolMul; immWrite(0x10b,chan[15].outVol); + hardResetElapsed++; } if (NEW_ARP_STRAT) { @@ -735,6 +736,7 @@ void DivPlatformYM2608::tick(bool sysTick) { chan[15].pan=chan[15].std.panL.val&3; if (!isMuted[15]) { immWrite(0x101,(isMuted[15]?0:(chan[15].pan<<6))|2); + hardResetElapsed++; } } } @@ -755,12 +757,17 @@ void DivPlatformYM2608::tick(bool sysTick) { } immWrite(0x109,chan[15].freq&0xff); immWrite(0x10a,(chan[15].freq>>8)&0xff); + hardResetElapsed+=2; if (chan[15].keyOn || chan[15].keyOff) { - if (chan[15].keyOff) immWrite(0x100,0x01); // reset + if (chan[15].keyOff) { + immWrite(0x100,0x01); // reset + hardResetElapsed++; + } if (chan[15].active && chan[15].keyOn && !chan[15].keyOff) { if (chan[15].sample>=0 && chan[15].samplesong.sampleLen) { DivSample* s=parent->getSample(chan[15].sample); immWrite(0x100,(s->isLoopable())?0xb0:0xa0); // start/repeat + hardResetElapsed++; } } chan[15].keyOn=false; @@ -771,11 +778,13 @@ void DivPlatformYM2608::tick(bool sysTick) { if (writeRSSOff) { immWrite(0x10,0x80|writeRSSOff); + hardResetElapsed++; writeRSSOff=0; } if (writeRSSOn) { immWrite(0x10,writeRSSOn); + hardResetElapsed++; writeRSSOn=0; } @@ -785,8 +794,31 @@ void DivPlatformYM2608::tick(bool sysTick) { for (DivRegWrite& i: ay->getRegisterWrites()) { if (i.addr>15) continue; immWrite(i.addr&15,i.val); + hardResetElapsed++; } ay->getRegisterWrites().clear(); + + // hard reset handling + if (mustHardReset) { + for (unsigned int i=hardResetElapsed; ifm.alg; + if (ch==0 || fbAllOps) { + chan[2].state.fb=ins->fm.fb; + } + chan[2].state.fms=ins->fm.fms; + chan[2].state.ams=ins->fm.ams; + chan[2].state.op[ordch]=ins->fm.op[ordch]; + } + + unsigned short baseAddr=chanOffs[2]|opOffs[ordch]; + DivInstrumentFM::Operator& op=chan[2].state.op[ordch]; + // TODO: how does this work?! + if (isOpMuted[ch]) { + rWrite(baseAddr+0x40,127); + } else { + if (opChan[ch].insChanged) { + rWrite(baseAddr+0x40,127-VOL_SCALE_LOG_BROKEN(127-op.tl,opChan[ch].outVol&0x7f,127)); + } + } + if (opChan[ch].insChanged) { + rWrite(baseAddr+0x30,(op.mult&15)|(dtTable[op.dt&7]<<4)); + rWrite(baseAddr+0x50,(op.ar&31)|(op.rs<<6)); + rWrite(baseAddr+0x60,(op.dr&31)|(op.am<<7)); + rWrite(baseAddr+0x70,op.d2r&31); + rWrite(baseAddr+0x80,(op.rr&15)|(op.sl<<4)); + rWrite(baseAddr+0x90,op.ssgEnv&15); + opChan[ch].mask=op.enable; + } + if (opChan[ch].insChanged) { // TODO how does this work? + rWrite(chanOffs[2]+0xb0,(chan[2].state.alg&7)|(chan[2].state.fb<<3)); + rWrite(chanOffs[2]+0xb4,(IS_EXTCH_MUTED?0:(opChan[ch].pan<<6))|(chan[2].state.fms&7)|((chan[2].state.ams&3)<<4)); + } +} + int DivPlatformYM2608Ext::dispatch(DivCommand c) { if (c.chan<2) { return DivPlatformYM2608::dispatch(c); @@ -42,16 +80,6 @@ int DivPlatformYM2608Ext::dispatch(DivCommand c) { case DIV_CMD_NOTE_ON: { DivInstrument* ins=parent->getIns(opChan[ch].ins,DIV_INS_FM); - if (opChan[ch].insChanged) { - chan[2].state.alg=ins->fm.alg; - if (ch==0 || fbAllOps) { - chan[2].state.fb=ins->fm.fb; - } - chan[2].state.fms=ins->fm.fms; - chan[2].state.ams=ins->fm.ams; - chan[2].state.op[ordch]=ins->fm.op[ordch]; - } - if (noExtMacros) { opChan[ch].macroInit(NULL); } else { @@ -60,30 +88,8 @@ int DivPlatformYM2608Ext::dispatch(DivCommand c) { if (!opChan[ch].std.vol.will) { opChan[ch].outVol=opChan[ch].vol; } - - unsigned short baseAddr=chanOffs[2]|opOffs[ordch]; - DivInstrumentFM::Operator& op=chan[2].state.op[ordch]; - // TODO: how does this work?! - if (isOpMuted[ch]) { - rWrite(baseAddr+0x40,127); - } else { - if (opChan[ch].insChanged) { - rWrite(baseAddr+0x40,127-VOL_SCALE_LOG_BROKEN(127-op.tl,opChan[ch].outVol&0x7f,127)); - } - } - if (opChan[ch].insChanged) { - rWrite(baseAddr+0x30,(op.mult&15)|(dtTable[op.dt&7]<<4)); - rWrite(baseAddr+0x50,(op.ar&31)|(op.rs<<6)); - rWrite(baseAddr+0x60,(op.dr&31)|(op.am<<7)); - rWrite(baseAddr+0x70,op.d2r&31); - rWrite(baseAddr+0x80,(op.rr&15)|(op.sl<<4)); - rWrite(baseAddr+0x90,op.ssgEnv&15); - opChan[ch].mask=op.enable; - } - if (opChan[ch].insChanged) { // TODO how does this work? - rWrite(chanOffs[2]+0xb0,(chan[2].state.alg&7)|(chan[2].state.fb<<3)); - rWrite(chanOffs[2]+0xb4,(IS_EXTCH_MUTED?0:(opChan[ch].pan<<6))|(chan[2].state.fms&7)|((chan[2].state.ams&3)<<4)); - } + + commitStateExt(ch,ins); opChan[ch].insChanged=false; if (c.value!=DIV_NOTE_NULL) { @@ -184,6 +190,11 @@ int DivPlatformYM2608Ext::dispatch(DivCommand c) { break; } case DIV_CMD_LEGATO: { + if (opChan[ch].insChanged) { + DivInstrument* ins=parent->getIns(opChan[ch].ins,DIV_INS_FM); + commitStateExt(ch,ins); + opChan[ch].insChanged=false; + } opChan[ch].baseFreq=NOTE_FNUM_BLOCK(c.value,11); opChan[ch].freqChanged=true; break; diff --git a/src/engine/platform/ym2608ext.h b/src/engine/platform/ym2608ext.h index e99518fbe..c9348b48f 100644 --- a/src/engine/platform/ym2608ext.h +++ b/src/engine/platform/ym2608ext.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,6 +28,7 @@ class DivPlatformYM2608Ext: public DivPlatformYM2608 { OPNOpChannelStereo opChan[4]; bool isOpMuted[4]; friend void putDispatchChip(void*,int); + inline void commitStateExt(int ch, DivInstrument* ins); public: int dispatch(DivCommand c); void* getChanState(int chan); diff --git a/src/engine/platform/ym2610.cpp b/src/engine/platform/ym2610.cpp index e41d1af69..b4a3291c4 100644 --- a/src/engine/platform/ym2610.cpp +++ b/src/engine/platform/ym2610.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -539,29 +539,6 @@ void DivPlatformYM2610::tick(bool sysTick) { rWrite(baseAddr+ADDR_SSG,op.ssgEnv&15); } } - - if (chan[i].keyOn || chan[i].keyOff) { - if (chan[i].hardReset && chan[i].keyOn) { - for (int j=0; j<4; j++) { - unsigned short baseAddr=chanOffs[i]|opOffs[j]; - immWrite(baseAddr+ADDR_SL_RR,0x0f); - immWrite(baseAddr+ADDR_TL,0x7f); - oldWrites[baseAddr+ADDR_SL_RR]=-1; - oldWrites[baseAddr+ADDR_TL]=-1; - //rWrite(baseAddr+ADDR_SL_RR,(op.rr&15)|(op.sl<<4)); - } - } - immWrite(0x28,0x00|konOffs[i]); - if (chan[i].hardReset && chan[i].keyOn) { - for (int j=0; j<4; j++) { - unsigned short baseAddr=chanOffs[i]|opOffs[j]; - for (int k=0; k<100; k++) { - immWrite(baseAddr+ADDR_SL_RR,0x0f); - } - } - } - chan[i].keyOff=false; - } } for (int i=16; i<512; i++) { @@ -571,6 +548,25 @@ void DivPlatformYM2610::tick(bool sysTick) { } } + int hardResetElapsed=0; + bool mustHardReset=false; + + for (int i=0; i0x3fff) chan[i].freq=0x3fff; immWrite(chanOffs[i]+ADDR_FREQH,chan[i].freq>>8); immWrite(chanOffs[i]+ADDR_FREQ,chan[i].freq&0xff); + hardResetElapsed+=2; chan[i].freqChanged=false; } - if (chan[i].keyOn || chan[i].opMaskChanged) { + if ((chan[i].keyOn || chan[i].opMaskChanged) && !chan[i].hardReset) { immWrite(0x28,(chan[i].opMask<<4)|konOffs[i]); + hardResetElapsed++; chan[i].opMaskChanged=false; chan[i].keyOn=false; } @@ -612,6 +610,7 @@ void DivPlatformYM2610::tick(bool sysTick) { if (globalADPCMAVolume!=(chan[i].std.duty.val&0x3f)) { globalADPCMAVolume=chan[i].std.duty.val&0x3f; immWrite(0x101,globalADPCMAVolume); + hardResetElapsed++; } } if (chan[i].std.panL.had) { @@ -624,6 +623,7 @@ void DivPlatformYM2610::tick(bool sysTick) { } if (!isMuted[i] && (chan[i].std.vol.had || chan[i].std.panL.had)) { immWrite(0x108+(i-adpcmAChanOffs),isMuted[i]?0:((chan[i].pan<<6)|chan[i].outVol)); + hardResetElapsed++; } } if (chan[i].keyOff) { @@ -644,6 +644,7 @@ void DivPlatformYM2610::tick(bool sysTick) { if (chan[adpcmBChanOffs].std.vol.had) { chan[adpcmBChanOffs].outVol=(chan[adpcmBChanOffs].vol*MIN(chan[adpcmBChanOffs].macroVolMul,chan[adpcmBChanOffs].std.vol.val))/chan[adpcmBChanOffs].macroVolMul; immWrite(0x1b,chan[adpcmBChanOffs].outVol); + hardResetElapsed++; } if (NEW_ARP_STRAT) { @@ -670,6 +671,7 @@ void DivPlatformYM2610::tick(bool sysTick) { chan[adpcmBChanOffs].pan=chan[adpcmBChanOffs].std.panL.val&3; if (!isMuted[adpcmBChanOffs]) { immWrite(0x11,(isMuted[adpcmBChanOffs]?0:(chan[adpcmBChanOffs].pan<<6))); + hardResetElapsed++; } } } @@ -689,13 +691,16 @@ void DivPlatformYM2610::tick(bool sysTick) { } immWrite(0x19,chan[adpcmBChanOffs].freq&0xff); immWrite(0x1a,(chan[adpcmBChanOffs].freq>>8)&0xff); + hardResetElapsed+=2; } if (chan[adpcmBChanOffs].keyOn || chan[adpcmBChanOffs].keyOff) { immWrite(0x10,0x01); // reset + hardResetElapsed++; if (chan[adpcmBChanOffs].active && chan[adpcmBChanOffs].keyOn && !chan[adpcmBChanOffs].keyOff) { if (chan[adpcmBChanOffs].sample>=0 && chan[adpcmBChanOffs].samplesong.sampleLen) { DivSample* s=parent->getSample(chan[adpcmBChanOffs].sample); immWrite(0x10,(s->isLoopable())?0x90:0x80); // start/repeat + hardResetElapsed++; } } chan[adpcmBChanOffs].keyOn=false; @@ -706,11 +711,13 @@ void DivPlatformYM2610::tick(bool sysTick) { if (writeADPCMAOff) { immWrite(0x100,0x80|writeADPCMAOff); + hardResetElapsed++; writeADPCMAOff=0; } if (writeADPCMAOn) { immWrite(0x100,writeADPCMAOn); + hardResetElapsed++; writeADPCMAOn=0; } @@ -720,8 +727,31 @@ void DivPlatformYM2610::tick(bool sysTick) { for (DivRegWrite& i: ay->getRegisterWrites()) { if (i.addr>15) continue; immWrite(i.addr&15,i.val); + hardResetElapsed++; } ay->getRegisterWrites().clear(); + + // hard reset handling + if (mustHardReset) { + for (unsigned int i=hardResetElapsed; i0x3fff) chan[i].freq=0x3fff; immWrite(chanOffs[i]+ADDR_FREQH,chan[i].freq>>8); immWrite(chanOffs[i]+ADDR_FREQ,chan[i].freq&0xff); + hardResetElapsed+=2; chan[i].freqChanged=false; } - if (chan[i].keyOn || chan[i].opMaskChanged) { + if ((chan[i].keyOn || chan[i].opMaskChanged) && !chan[i].hardReset) { immWrite(0x28,(chan[i].opMask<<4)|konOffs[i]); + hardResetElapsed++; chan[i].opMaskChanged=false; chan[i].keyOn=false; } @@ -679,6 +677,7 @@ void DivPlatformYM2610B::tick(bool sysTick) { if (globalADPCMAVolume!=(chan[i].std.duty.val&0x3f)) { globalADPCMAVolume=chan[i].std.duty.val&0x3f; immWrite(0x101,globalADPCMAVolume); + hardResetElapsed++; } } if (chan[i].std.panL.had) { @@ -691,6 +690,7 @@ void DivPlatformYM2610B::tick(bool sysTick) { } if (!isMuted[i] && (chan[i].std.vol.had || chan[i].std.panL.had)) { immWrite(0x108+(i-adpcmAChanOffs),isMuted[i]?0:((chan[i].pan<<6)|chan[i].outVol)); + hardResetElapsed++; } } if (chan[i].keyOff) { @@ -711,6 +711,7 @@ void DivPlatformYM2610B::tick(bool sysTick) { if (chan[adpcmBChanOffs].std.vol.had) { chan[adpcmBChanOffs].outVol=(chan[adpcmBChanOffs].vol*MIN(chan[adpcmBChanOffs].macroVolMul,chan[adpcmBChanOffs].std.vol.val))/chan[adpcmBChanOffs].macroVolMul; immWrite(0x1b,chan[adpcmBChanOffs].outVol); + hardResetElapsed++; } if (NEW_ARP_STRAT) { @@ -737,6 +738,7 @@ void DivPlatformYM2610B::tick(bool sysTick) { chan[adpcmBChanOffs].pan=chan[adpcmBChanOffs].std.panL.val&3; if (!isMuted[adpcmBChanOffs]) { immWrite(0x11,(isMuted[adpcmBChanOffs]?0:(chan[adpcmBChanOffs].pan<<6))); + hardResetElapsed++; } } } @@ -756,13 +758,16 @@ void DivPlatformYM2610B::tick(bool sysTick) { } immWrite(0x19,chan[adpcmBChanOffs].freq&0xff); immWrite(0x1a,(chan[adpcmBChanOffs].freq>>8)&0xff); + hardResetElapsed+=2; } if (chan[adpcmBChanOffs].keyOn || chan[adpcmBChanOffs].keyOff) { immWrite(0x10,0x01); // reset + hardResetElapsed++; if (chan[adpcmBChanOffs].active && chan[adpcmBChanOffs].keyOn && !chan[adpcmBChanOffs].keyOff) { if (chan[adpcmBChanOffs].sample>=0 && chan[adpcmBChanOffs].samplesong.sampleLen) { DivSample* s=parent->getSample(chan[adpcmBChanOffs].sample); immWrite(0x10,(s->isLoopable())?0x90:0x80); // start/repeat + hardResetElapsed++; } } chan[adpcmBChanOffs].keyOn=false; @@ -773,11 +778,13 @@ void DivPlatformYM2610B::tick(bool sysTick) { if (writeADPCMAOff) { immWrite(0x100,0x80|writeADPCMAOff); + hardResetElapsed++; writeADPCMAOff=0; } if (writeADPCMAOn) { immWrite(0x100,writeADPCMAOn); + hardResetElapsed++; writeADPCMAOn=0; } @@ -787,8 +794,31 @@ void DivPlatformYM2610B::tick(bool sysTick) { for (DivRegWrite& i: ay->getRegisterWrites()) { if (i.addr>15) continue; immWrite(i.addr&15,i.val); + hardResetElapsed++; } ay->getRegisterWrites().clear(); + + // hard reset handling + if (mustHardReset) { + for (unsigned int i=hardResetElapsed; i +void DivPlatformYM2610BExt::commitStateExt(int ch, DivInstrument* ins) { + int ordch=orderedOps[ch]; + + if (opChan[ch].insChanged) { + chan[extChanOffs].state.alg=ins->fm.alg; + if (ch==0 || fbAllOps) { + chan[extChanOffs].state.fb=ins->fm.fb; + } + chan[extChanOffs].state.fms=ins->fm.fms; + chan[extChanOffs].state.ams=ins->fm.ams; + chan[extChanOffs].state.op[ordch]=ins->fm.op[ordch]; + } + + unsigned short baseAddr=chanOffs[extChanOffs]|opOffs[ordch]; + DivInstrumentFM::Operator& op=chan[extChanOffs].state.op[ordch]; + // TODO: how does this work?! + if (isOpMuted[ch]) { + rWrite(baseAddr+0x40,127); + } else { + if (opChan[ch].insChanged) { + rWrite(baseAddr+0x40,127-VOL_SCALE_LOG_BROKEN(127-op.tl,opChan[ch].outVol&0x7f,127)); + } + } + if (opChan[ch].insChanged) { + rWrite(baseAddr+0x30,(op.mult&15)|(dtTable[op.dt&7]<<4)); + rWrite(baseAddr+0x50,(op.ar&31)|(op.rs<<6)); + rWrite(baseAddr+0x60,(op.dr&31)|(op.am<<7)); + rWrite(baseAddr+0x70,op.d2r&31); + rWrite(baseAddr+0x80,(op.rr&15)|(op.sl<<4)); + rWrite(baseAddr+0x90,op.ssgEnv&15); + opChan[ch].mask=op.enable; + } + if (opChan[ch].insChanged) { // TODO how does this work? + rWrite(chanOffs[extChanOffs]+0xb0,(chan[extChanOffs].state.alg&7)|(chan[extChanOffs].state.fb<<3)); + rWrite(chanOffs[extChanOffs]+0xb4,(IS_EXTCH_MUTED?0:(opChan[ch].pan<<6))|(chan[extChanOffs].state.fms&7)|((chan[extChanOffs].state.ams&3)<<4)); + } +} + int DivPlatformYM2610BExt::dispatch(DivCommand c) { if (c.changetIns(opChan[ch].ins,DIV_INS_FM); - if (opChan[ch].insChanged) { - chan[extChanOffs].state.alg=ins->fm.alg; - if (ch==0 || fbAllOps) { - chan[extChanOffs].state.fb=ins->fm.fb; - } - chan[extChanOffs].state.fms=ins->fm.fms; - chan[extChanOffs].state.ams=ins->fm.ams; - chan[extChanOffs].state.op[ordch]=ins->fm.op[ordch]; - } - if (noExtMacros) { opChan[ch].macroInit(NULL); } else { @@ -56,30 +84,8 @@ int DivPlatformYM2610BExt::dispatch(DivCommand c) { if (!opChan[ch].std.vol.will) { opChan[ch].outVol=opChan[ch].vol; } - - unsigned short baseAddr=chanOffs[extChanOffs]|opOffs[ordch]; - DivInstrumentFM::Operator& op=chan[extChanOffs].state.op[ordch]; - // TODO: how does this work?! - if (isOpMuted[ch]) { - rWrite(baseAddr+0x40,127); - } else { - if (opChan[ch].insChanged) { - rWrite(baseAddr+0x40,127-VOL_SCALE_LOG_BROKEN(127-op.tl,opChan[ch].outVol&0x7f,127)); - } - } - if (opChan[ch].insChanged) { - rWrite(baseAddr+0x30,(op.mult&15)|(dtTable[op.dt&7]<<4)); - rWrite(baseAddr+0x50,(op.ar&31)|(op.rs<<6)); - rWrite(baseAddr+0x60,(op.dr&31)|(op.am<<7)); - rWrite(baseAddr+0x70,op.d2r&31); - rWrite(baseAddr+0x80,(op.rr&15)|(op.sl<<4)); - rWrite(baseAddr+0x90,op.ssgEnv&15); - opChan[ch].mask=op.enable; - } - if (opChan[ch].insChanged) { // TODO how does this work? - rWrite(chanOffs[extChanOffs]+0xb0,(chan[extChanOffs].state.alg&7)|(chan[extChanOffs].state.fb<<3)); - rWrite(chanOffs[extChanOffs]+0xb4,(IS_EXTCH_MUTED?0:(opChan[ch].pan<<6))|(chan[extChanOffs].state.fms&7)|((chan[extChanOffs].state.ams&3)<<4)); - } + + commitStateExt(ch,ins); opChan[ch].insChanged=false; if (c.value!=DIV_NOTE_NULL) { @@ -180,6 +186,11 @@ int DivPlatformYM2610BExt::dispatch(DivCommand c) { break; } case DIV_CMD_LEGATO: { + if (opChan[ch].insChanged) { + DivInstrument* ins=parent->getIns(opChan[ch].ins,DIV_INS_FM); + commitStateExt(ch,ins); + opChan[ch].insChanged=false; + } opChan[ch].baseFreq=NOTE_FNUM_BLOCK(c.value,11); opChan[ch].freqChanged=true; break; diff --git a/src/engine/platform/ym2610bext.h b/src/engine/platform/ym2610bext.h index 50bd5badf..b14ba99c4 100644 --- a/src/engine/platform/ym2610bext.h +++ b/src/engine/platform/ym2610bext.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,6 +28,7 @@ class DivPlatformYM2610BExt: public DivPlatformYM2610B { OPNOpChannelStereo opChan[4]; bool isOpMuted[4]; friend void putDispatchChip(void*,int); + inline void commitStateExt(int ch, DivInstrument* ins); public: int dispatch(DivCommand c); void* getChanState(int chan); diff --git a/src/engine/platform/ym2610ext.cpp b/src/engine/platform/ym2610ext.cpp index 03442dc5b..e8a531dae 100644 --- a/src/engine/platform/ym2610ext.cpp +++ b/src/engine/platform/ym2610ext.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,6 +20,44 @@ #include "ym2610ext.h" #include +void DivPlatformYM2610Ext::commitStateExt(int ch, DivInstrument* ins) { + int ordch=orderedOps[ch]; + + if (opChan[ch].insChanged) { + chan[extChanOffs].state.alg=ins->fm.alg; + if (ch==0 || fbAllOps) { + chan[extChanOffs].state.fb=ins->fm.fb; + } + chan[extChanOffs].state.fms=ins->fm.fms; + chan[extChanOffs].state.ams=ins->fm.ams; + chan[extChanOffs].state.op[ordch]=ins->fm.op[ordch]; + } + + unsigned short baseAddr=chanOffs[extChanOffs]|opOffs[ordch]; + DivInstrumentFM::Operator& op=chan[extChanOffs].state.op[ordch]; + // TODO: how does this work?! + if (isOpMuted[ch]) { + rWrite(baseAddr+0x40,127); + } else { + if (opChan[ch].insChanged) { + rWrite(baseAddr+0x40,127-VOL_SCALE_LOG_BROKEN(127-op.tl,opChan[ch].outVol&0x7f,127)); + } + } + if (opChan[ch].insChanged) { + rWrite(baseAddr+0x30,(op.mult&15)|(dtTable[op.dt&7]<<4)); + rWrite(baseAddr+0x50,(op.ar&31)|(op.rs<<6)); + rWrite(baseAddr+0x60,(op.dr&31)|(op.am<<7)); + rWrite(baseAddr+0x70,op.d2r&31); + rWrite(baseAddr+0x80,(op.rr&15)|(op.sl<<4)); + rWrite(baseAddr+0x90,op.ssgEnv&15); + opChan[ch].mask=op.enable; + } + if (opChan[ch].insChanged) { // TODO how does this work? + rWrite(chanOffs[extChanOffs]+0xb0,(chan[extChanOffs].state.alg&7)|(chan[extChanOffs].state.fb<<3)); + rWrite(chanOffs[extChanOffs]+0xb4,(IS_EXTCH_MUTED?0:(opChan[ch].pan<<6))|(chan[extChanOffs].state.fms&7)|((chan[extChanOffs].state.ams&3)<<4)); + } +} + int DivPlatformYM2610Ext::dispatch(DivCommand c) { if (c.changetIns(opChan[ch].ins,DIV_INS_FM); - if (opChan[ch].insChanged) { - chan[extChanOffs].state.alg=ins->fm.alg; - if (ch==0 || fbAllOps) { - chan[extChanOffs].state.fb=ins->fm.fb; - } - chan[extChanOffs].state.fms=ins->fm.fms; - chan[extChanOffs].state.ams=ins->fm.ams; - chan[extChanOffs].state.op[ordch]=ins->fm.op[ordch]; - } - if (noExtMacros) { opChan[ch].macroInit(NULL); } else { @@ -56,30 +84,8 @@ int DivPlatformYM2610Ext::dispatch(DivCommand c) { if (!opChan[ch].std.vol.will) { opChan[ch].outVol=opChan[ch].vol; } - - unsigned short baseAddr=chanOffs[extChanOffs]|opOffs[ordch]; - DivInstrumentFM::Operator& op=chan[extChanOffs].state.op[ordch]; - // TODO: how does this work?! - if (isOpMuted[ch]) { - rWrite(baseAddr+0x40,127); - } else { - if (opChan[ch].insChanged) { - rWrite(baseAddr+0x40,127-VOL_SCALE_LOG_BROKEN(127-op.tl,opChan[ch].outVol&0x7f,127)); - } - } - if (opChan[ch].insChanged) { - rWrite(baseAddr+0x30,(op.mult&15)|(dtTable[op.dt&7]<<4)); - rWrite(baseAddr+0x50,(op.ar&31)|(op.rs<<6)); - rWrite(baseAddr+0x60,(op.dr&31)|(op.am<<7)); - rWrite(baseAddr+0x70,op.d2r&31); - rWrite(baseAddr+0x80,(op.rr&15)|(op.sl<<4)); - rWrite(baseAddr+0x90,op.ssgEnv&15); - opChan[ch].mask=op.enable; - } - if (opChan[ch].insChanged) { // TODO how does this work? - rWrite(chanOffs[extChanOffs]+0xb0,(chan[extChanOffs].state.alg&7)|(chan[extChanOffs].state.fb<<3)); - rWrite(chanOffs[extChanOffs]+0xb4,(IS_EXTCH_MUTED?0:(opChan[ch].pan<<6))|(chan[extChanOffs].state.fms&7)|((chan[extChanOffs].state.ams&3)<<4)); - } + + commitStateExt(ch,ins); opChan[ch].insChanged=false; if (c.value!=DIV_NOTE_NULL) { @@ -180,6 +186,11 @@ int DivPlatformYM2610Ext::dispatch(DivCommand c) { break; } case DIV_CMD_LEGATO: { + if (opChan[ch].insChanged) { + DivInstrument* ins=parent->getIns(opChan[ch].ins,DIV_INS_FM); + commitStateExt(ch,ins); + opChan[ch].insChanged=false; + } opChan[ch].baseFreq=NOTE_FNUM_BLOCK(c.value,11); opChan[ch].freqChanged=true; break; diff --git a/src/engine/platform/ym2610ext.h b/src/engine/platform/ym2610ext.h index e41033384..2ce887c36 100644 --- a/src/engine/platform/ym2610ext.h +++ b/src/engine/platform/ym2610ext.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,6 +28,7 @@ class DivPlatformYM2610Ext: public DivPlatformYM2610 { OPNOpChannelStereo opChan[4]; bool isOpMuted[4]; friend void putDispatchChip(void*,int); + inline void commitStateExt(int ch, DivInstrument* ins); public: int dispatch(DivCommand c); void* getChanState(int chan); diff --git a/src/engine/platform/ym2610shared.h b/src/engine/platform/ym2610shared.h index 517186999..d35c5fce8 100644 --- a/src/engine/platform/ym2610shared.h +++ b/src/engine/platform/ym2610shared.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/ymz280b.cpp b/src/engine/platform/ymz280b.cpp index a5fdf10bd..e10dda43f 100644 --- a/src/engine/platform/ymz280b.cpp +++ b/src/engine/platform/ymz280b.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/ymz280b.h b/src/engine/platform/ymz280b.h index 78ea544ba..3fb4a7dc6 100644 --- a/src/engine/platform/ymz280b.h +++ b/src/engine/platform/ymz280b.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/zxbeeper.cpp b/src/engine/platform/zxbeeper.cpp index f8762c7f2..047dc2cb5 100644 --- a/src/engine/platform/zxbeeper.cpp +++ b/src/engine/platform/zxbeeper.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/platform/zxbeeper.h b/src/engine/platform/zxbeeper.h index a9b3594c3..3e120354b 100644 --- a/src/engine/platform/zxbeeper.h +++ b/src/engine/platform/zxbeeper.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/playback.cpp b/src/engine/playback.cpp index 8759cd6a5..f016dd532 100644 --- a/src/engine/playback.cpp +++ b/src/engine/playback.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/safeReader.cpp b/src/engine/safeReader.cpp index 428c91502..cf2effbec 100644 --- a/src/engine/safeReader.cpp +++ b/src/engine/safeReader.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/safeReader.h b/src/engine/safeReader.h index 1f7149834..9e85eeee8 100644 --- a/src/engine/safeReader.h +++ b/src/engine/safeReader.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/safeWriter.cpp b/src/engine/safeWriter.cpp index 5af7fa09d..a0c295d30 100644 --- a/src/engine/safeWriter.cpp +++ b/src/engine/safeWriter.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/safeWriter.h b/src/engine/safeWriter.h index 414417fd2..28a3d9b91 100644 --- a/src/engine/safeWriter.h +++ b/src/engine/safeWriter.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/sample.cpp b/src/engine/sample.cpp index 5df46fab1..f882a3d0c 100644 --- a/src/engine/sample.cpp +++ b/src/engine/sample.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/sample.h b/src/engine/sample.h index 55292d1fe..fa955d01e 100644 --- a/src/engine/sample.h +++ b/src/engine/sample.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/sfWrapper.cpp b/src/engine/sfWrapper.cpp index f12dc95be..62ddf949f 100644 --- a/src/engine/sfWrapper.cpp +++ b/src/engine/sfWrapper.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/sfWrapper.h b/src/engine/sfWrapper.h index 6e984a454..e4746b530 100644 --- a/src/engine/sfWrapper.h +++ b/src/engine/sfWrapper.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/song.cpp b/src/engine/song.cpp index 7dc136836..828f0a1bc 100644 --- a/src/engine/song.cpp +++ b/src/engine/song.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/song.h b/src/engine/song.h index 61083c185..6aaec7c12 100644 --- a/src/engine/song.h +++ b/src/engine/song.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/sysDef.cpp b/src/engine/sysDef.cpp index c6478ca75..fe75ea24e 100644 --- a/src/engine/sysDef.cpp +++ b/src/engine/sysDef.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1408,7 +1408,7 @@ void DivEngine::registerSystems() { } sysDefs[DIV_SYSTEM_LYNX]=new DivSysDef( - "Atari Lynx", NULL, 0xa8, 0, 4, false, true, 0, false, 1U<writeC(0x4e); + w->writeC(0x40); w->writeC(0x44); w->writeC(0xff); //stereo attenuation select - w->writeC(0x4e); + w->writeC(0x40); w->writeC(0x50); w->writeC(0x00); //stereo channel disable for (int i=0; i<4; i++) { //stereo attenuation value - w->writeC(0x4e); + w->writeC(0x40); w->writeC(0x40+i); w->writeC(0xff); } @@ -765,7 +765,7 @@ void DivEngine::performVGMWrite(SafeWriter* w, DivSystem sys, DivRegWrite& write w->writeC(write.val&0xff); break; case DIV_SYSTEM_LYNX: - w->writeC(0x4e); + w->writeC(0x40); w->writeC(write.addr&0xff); w->writeC(write.val&0xff); break; @@ -1739,7 +1739,7 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version, bool p w->writeI(hasX1); w->writeI(hasC352); w->writeI(hasGA20); - w->writeI(hasLynx); + w->writeI(version>=0x172?hasLynx:0); //Mikey introduced in 1.72 } else { w->writeI(0); w->writeI(0); diff --git a/src/engine/waveSynth.cpp b/src/engine/waveSynth.cpp index e68e36751..757c2c7eb 100644 --- a/src/engine/waveSynth.cpp +++ b/src/engine/waveSynth.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/waveSynth.h b/src/engine/waveSynth.h index 26f5b259b..81a3cbe19 100644 --- a/src/engine/waveSynth.h +++ b/src/engine/waveSynth.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/wavetable.cpp b/src/engine/wavetable.cpp index 608b0e89d..a14c28bbe 100644 --- a/src/engine/wavetable.cpp +++ b/src/engine/wavetable.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/wavetable.h b/src/engine/wavetable.h index 0f518ab53..52405082e 100644 --- a/src/engine/wavetable.h +++ b/src/engine/wavetable.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/winStuff.cpp b/src/engine/winStuff.cpp index 79065e88b..4452a5143 100644 --- a/src/engine/winStuff.cpp +++ b/src/engine/winStuff.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/winStuff.h b/src/engine/winStuff.h index 0e49bccd3..a569f6a09 100644 --- a/src/engine/winStuff.h +++ b/src/engine/winStuff.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/zsm.cpp b/src/engine/zsm.cpp index 89eb01496..5fdcd6236 100644 --- a/src/engine/zsm.cpp +++ b/src/engine/zsm.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/zsm.h b/src/engine/zsm.h index af0979e7c..b452171f8 100644 --- a/src/engine/zsm.h +++ b/src/engine/zsm.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/engine/zsmOps.cpp b/src/engine/zsmOps.cpp index f5fa83090..0207a93d9 100644 --- a/src/engine/zsmOps.cpp +++ b/src/engine/zsmOps.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/fileutils.cpp b/src/fileutils.cpp index d2574ee1b..a58f92a0a 100644 --- a/src/fileutils.cpp +++ b/src/fileutils.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/fileutils.h b/src/fileutils.h index ea4afabc2..ded2bfb41 100644 --- a/src/fileutils.h +++ b/src/fileutils.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/about.cpp b/src/gui/about.cpp index 368353cb1..94b3c0f00 100644 --- a/src/gui/about.cpp +++ b/src/gui/about.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -174,7 +174,7 @@ const char* aboutLine[]={ "NEOART Costa Rica", "all members of Deflers of Noice!", "", - "copyright © 2021-2022 tildearrow", + "copyright © 2021-2023 tildearrow", "(and contributors).", "licensed under GPLv2+! see", "LICENSE for more information.", diff --git a/src/gui/actionUtil.h b/src/gui/actionUtil.h index 81685af48..51fffa002 100644 --- a/src/gui/actionUtil.h +++ b/src/gui/actionUtil.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/chanOsc.cpp b/src/gui/chanOsc.cpp index 7b0f8a027..7bcece959 100644 --- a/src/gui/chanOsc.cpp +++ b/src/gui/chanOsc.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/channels.cpp b/src/gui/channels.cpp index e61138851..48d5ed8cb 100644 --- a/src/gui/channels.cpp +++ b/src/gui/channels.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/clock.cpp b/src/gui/clock.cpp index e8450d10a..5db890558 100644 --- a/src/gui/clock.cpp +++ b/src/gui/clock.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/compatFlags.cpp b/src/gui/compatFlags.cpp index 7a9fd962a..10fbb57c0 100644 --- a/src/gui/compatFlags.cpp +++ b/src/gui/compatFlags.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/cursor.cpp b/src/gui/cursor.cpp index 88d50d2b8..c3745d616 100644 --- a/src/gui/cursor.cpp +++ b/src/gui/cursor.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/dataList.cpp b/src/gui/dataList.cpp index 46b10800d..8edde40d1 100644 --- a/src/gui/dataList.cpp +++ b/src/gui/dataList.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/debug.cpp b/src/gui/debug.cpp index dc40e5ba4..ddb1bb01c 100644 --- a/src/gui/debug.cpp +++ b/src/gui/debug.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/debug.h b/src/gui/debug.h index e3c911a84..4ec4cd87c 100644 --- a/src/gui/debug.h +++ b/src/gui/debug.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/debugWindow.cpp b/src/gui/debugWindow.cpp index 0adef883d..af2757359 100644 --- a/src/gui/debugWindow.cpp +++ b/src/gui/debugWindow.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/doAction.cpp b/src/gui/doAction.cpp index 2b3a27497..b857b17cf 100644 --- a/src/gui/doAction.cpp +++ b/src/gui/doAction.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/editControls.cpp b/src/gui/editControls.cpp index 6730fbb94..e8968e698 100644 --- a/src/gui/editControls.cpp +++ b/src/gui/editControls.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/editing.cpp b/src/gui/editing.cpp index f18efece3..556557a92 100644 --- a/src/gui/editing.cpp +++ b/src/gui/editing.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/findReplace.cpp b/src/gui/findReplace.cpp index e66108cfc..60b6c899b 100644 --- a/src/gui/findReplace.cpp +++ b/src/gui/findReplace.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/fonts.cpp b/src/gui/fonts.cpp index ee2e4f1b8..4ab0f6a4c 100644 --- a/src/gui/fonts.cpp +++ b/src/gui/fonts.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/fonts.h b/src/gui/fonts.h index a0a42d251..baaf1e594 100644 --- a/src/gui/fonts.h +++ b/src/gui/fonts.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/gradient.cpp b/src/gui/gradient.cpp index e4af10b57..a36768ead 100644 --- a/src/gui/gradient.cpp +++ b/src/gui/gradient.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index e07167320..e0c458b35 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -2,7 +2,7 @@ // OK, sorry for inserting the define here but I'm so tired of this extension /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -3413,6 +3413,12 @@ bool FurnaceGUI::loop() { eventTimeEnd=SDL_GetPerformanceCounter(); + if (SDL_GetWindowFlags(sdlWin)&SDL_WINDOW_MINIMIZED) { + SDL_Delay(30); + drawHalt=0; + continue; + } + layoutTimeBegin=SDL_GetPerformanceCounter(); ImGui_ImplSDLRenderer_NewFrame(); @@ -3507,7 +3513,7 @@ bool FurnaceGUI::loop() { if (ImGui::BeginMenu("export VGM...")) { ImGui::Text("settings:"); if (ImGui::BeginCombo("format version",fmt::sprintf("%d.%.2x",vgmExportVersion>>8,vgmExportVersion&0xff).c_str())) { - for (int i=0; i<6; i++) { + for (int i=0; i<7; i++) { if (ImGui::Selectable(fmt::sprintf("%d.%.2x",vgmVersions[i]>>8,vgmVersions[i]&0xff).c_str(),vgmExportVersion==vgmVersions[i])) { vgmExportVersion=vgmVersions[i]; } diff --git a/src/gui/gui.h b/src/gui/gui.h index 57f4b303f..5cb28b8f1 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/guiConst.cpp b/src/gui/guiConst.cpp index d51dd8d0a..dc634d03e 100644 --- a/src/gui/guiConst.cpp +++ b/src/gui/guiConst.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -70,13 +70,14 @@ const int altValues[24]={ 0, 10, 1, 11, 2, 3, 12, 4, 13, 5, 14, 6, 7, 15, 8, -1, 9, -1, -1, -1, -1, -1, -1, -1 }; -const int vgmVersions[6]={ +const int vgmVersions[7]={ 0x150, 0x151, 0x160, 0x161, 0x170, - 0x171 + 0x171, + 0x172 }; const char* insTypes[DIV_INS_MAX+1]={ diff --git a/src/gui/guiConst.h b/src/gui/guiConst.h index cb5eb5408..00b350495 100644 --- a/src/gui/guiConst.h +++ b/src/gui/guiConst.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -54,5 +54,5 @@ extern const int* chipCategories[]; extern const FurnaceGUIActionDef guiActions[]; extern const FurnaceGUIColorDef guiColors[]; extern const int altValues[24]; -extern const int vgmVersions[6]; +extern const int vgmVersions[7]; extern const FurnaceGUIColors fxColors[256]; \ No newline at end of file diff --git a/src/gui/icon.c b/src/gui/icon.c index bae81ab7c..80429eb6b 100644 --- a/src/gui/icon.c +++ b/src/gui/icon.c @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/icon.h b/src/gui/icon.h index 43135be86..6e866f25f 100644 --- a/src/gui/icon.h +++ b/src/gui/icon.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/insEdit.cpp b/src/gui/insEdit.cpp index 506472b8f..11c368265 100644 --- a/src/gui/insEdit.cpp +++ b/src/gui/insEdit.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/intConst.cpp b/src/gui/intConst.cpp index 9a41486e1..167fdd7e8 100644 --- a/src/gui/intConst.cpp +++ b/src/gui/intConst.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/intConst.h b/src/gui/intConst.h index ff11a4968..082f421a7 100644 --- a/src/gui/intConst.h +++ b/src/gui/intConst.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/log.cpp b/src/gui/log.cpp index 0419b6a7d..0dc56e5de 100644 --- a/src/gui/log.cpp +++ b/src/gui/log.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/macstuff.h b/src/gui/macstuff.h index 73ca0c47f..76afff169 100644 --- a/src/gui/macstuff.h +++ b/src/gui/macstuff.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/mixer.cpp b/src/gui/mixer.cpp index c9aa96b80..35c083f28 100644 --- a/src/gui/mixer.cpp +++ b/src/gui/mixer.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/newSong.cpp b/src/gui/newSong.cpp index 0df3a2538..8fdafeb9b 100644 --- a/src/gui/newSong.cpp +++ b/src/gui/newSong.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/orders.cpp b/src/gui/orders.cpp index f3349d71d..914217787 100644 --- a/src/gui/orders.cpp +++ b/src/gui/orders.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/osc.cpp b/src/gui/osc.cpp index 7f4142211..f04587c8b 100644 --- a/src/gui/osc.cpp +++ b/src/gui/osc.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/patManager.cpp b/src/gui/patManager.cpp index 161a42cb2..6f5e3205b 100644 --- a/src/gui/patManager.cpp +++ b/src/gui/patManager.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/pattern.cpp b/src/gui/pattern.cpp index 8ce95852b..b02b11501 100644 --- a/src/gui/pattern.cpp +++ b/src/gui/pattern.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -969,7 +969,7 @@ void FurnaceGUI::drawPattern() { // overflow changes order // TODO: this is very unreliable and sometimes it can warp you out of the song - if (settings.scrollChangesOrder && !e->isPlaying()) { + if (settings.scrollChangesOrder && !e->isPlaying() && ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows)) { if (wheelY!=0) { if (wheelY>0) { if (ImGui::GetScrollY()<=0) { diff --git a/src/gui/piano.cpp b/src/gui/piano.cpp index d999d7fd2..fe451c3f7 100644 --- a/src/gui/piano.cpp +++ b/src/gui/piano.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/plot_nolerp.cpp b/src/gui/plot_nolerp.cpp index 12bfb9fca..2fd7994bc 100644 --- a/src/gui/plot_nolerp.cpp +++ b/src/gui/plot_nolerp.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/plot_nolerp.h b/src/gui/plot_nolerp.h index 48332b339..50334dda6 100644 --- a/src/gui/plot_nolerp.h +++ b/src/gui/plot_nolerp.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/presets.cpp b/src/gui/presets.cpp index e114cfc14..24a535d9d 100644 --- a/src/gui/presets.cpp +++ b/src/gui/presets.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/regView.cpp b/src/gui/regView.cpp index 8b2176eb2..729f17c6e 100644 --- a/src/gui/regView.cpp +++ b/src/gui/regView.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/sampleEdit.cpp b/src/gui/sampleEdit.cpp index 6b17e967e..950420e20 100644 --- a/src/gui/sampleEdit.cpp +++ b/src/gui/sampleEdit.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/sampleUtil.h b/src/gui/sampleUtil.h index 187f5ebf6..bdef166f4 100644 --- a/src/gui/sampleUtil.h +++ b/src/gui/sampleUtil.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/scaling.cpp b/src/gui/scaling.cpp index 1b8cfae35..e3d8d6f80 100644 --- a/src/gui/scaling.cpp +++ b/src/gui/scaling.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/scaling.h b/src/gui/scaling.h index ce1a364a6..60710a34f 100644 --- a/src/gui/scaling.h +++ b/src/gui/scaling.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index 7e4d809b3..43adfc85a 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/songInfo.cpp b/src/gui/songInfo.cpp index e20468575..fc25d63e3 100644 --- a/src/gui/songInfo.cpp +++ b/src/gui/songInfo.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/songNotes.cpp b/src/gui/songNotes.cpp index eb63cbf3a..d0218f7bf 100644 --- a/src/gui/songNotes.cpp +++ b/src/gui/songNotes.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/spoiler.cpp b/src/gui/spoiler.cpp index dc64b14ce..05e6d0ead 100644 --- a/src/gui/spoiler.cpp +++ b/src/gui/spoiler.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/stats.cpp b/src/gui/stats.cpp index 636ecd529..33e7029c1 100644 --- a/src/gui/stats.cpp +++ b/src/gui/stats.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/sysConf.cpp b/src/gui/sysConf.cpp index 3136d6282..d363d9833 100644 --- a/src/gui/sysConf.cpp +++ b/src/gui/sysConf.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/sysManager.cpp b/src/gui/sysManager.cpp index dda5ed963..7a214beca 100644 --- a/src/gui/sysManager.cpp +++ b/src/gui/sysManager.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/sysPicker.cpp b/src/gui/sysPicker.cpp index f59e547ad..8607de05d 100644 --- a/src/gui/sysPicker.cpp +++ b/src/gui/sysPicker.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/util.cpp b/src/gui/util.cpp index 3998f2bb4..80ed73781 100644 --- a/src/gui/util.cpp +++ b/src/gui/util.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/util.h b/src/gui/util.h index 8071884b8..6dd2c3a6f 100644 --- a/src/gui/util.h +++ b/src/gui/util.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/volMeter.cpp b/src/gui/volMeter.cpp index f050341dd..a4cf11d7e 100644 --- a/src/gui/volMeter.cpp +++ b/src/gui/volMeter.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/waveEdit.cpp b/src/gui/waveEdit.cpp index fcc10bd03..cecc3635e 100644 --- a/src/gui/waveEdit.cpp +++ b/src/gui/waveEdit.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/log.cpp b/src/log.cpp index 8fec13189..5f24269d8 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main.cpp b/src/main.cpp index ef335a223..094e5b93e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -152,7 +152,7 @@ TAParamResult pLogLevel(String val) { TAParamResult pVersion(String) { printf("Furnace version " DIV_VERSION ".\n\n"); - printf("copyright (C) 2021-2022 tildearrow and contributors.\n"); + printf("copyright (C) 2021-2023 tildearrow and contributors.\n"); printf("licensed under the GNU General Public License version 2 or later\n"); printf(".\n\n"); printf("this is free software with ABSOLUTELY NO WARRANTY.\n"); diff --git a/src/ta-log.h b/src/ta-log.h index 160201e03..d36f5da7d 100644 --- a/src/ta-log.h +++ b/src/ta-log.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ta-utils.h b/src/ta-utils.h index feddbc1e9..f0c896d00 100644 --- a/src/ta-utils.h +++ b/src/ta-utils.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/utfutils.cpp b/src/utfutils.cpp index 4c727777b..889b9a9bd 100644 --- a/src/utfutils.cpp +++ b/src/utfutils.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/utfutils.h b/src/utfutils.h index 76c894708..e55aa07ab 100644 --- a/src/utfutils.h +++ b/src/utfutils.h @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/winMain.cpp b/src/winMain.cpp index 853b11530..85dd27770 100644 --- a/src/winMain.cpp +++ b/src/winMain.cpp @@ -1,6 +1,6 @@ /** * Furnace Tracker - multi-system chiptune tracker - * Copyright (C) 2021-2022 tildearrow and contributors + * Copyright (C) 2021-2023 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by