From 2ec4237076d57d56caa1fdd8dc3a75e0b40c266e Mon Sep 17 00:00:00 2001 From: cam900 Date: Sun, 4 Dec 2022 19:58:58 +0900 Subject: [PATCH 01/26] Reduce duplicates of channel struct Add/Fix custom clock limit defines (for YMF278B) --- src/chip-utils.h | 67 +++++++++++++++++++++++++ src/engine/dispatch.h | 19 +++++-- src/engine/platform/abstract.cpp | 8 +++ src/engine/platform/amiga.h | 26 ++-------- src/engine/platform/arcade.h | 44 ++--------------- src/engine/platform/ay.h | 25 ++-------- src/engine/platform/ay8930.h | 25 ++-------- src/engine/platform/bubsyswsg.h | 22 ++------- src/engine/platform/c64.h | 24 +++------ src/engine/platform/fds.h | 24 +++------ src/engine/platform/fmshared_OPN.h | 48 ++++++++++++++++++ src/engine/platform/fmsharedbase.h | 34 +++++++++++++ src/engine/platform/gb.h | 24 +++------ src/engine/platform/genesis.h | 39 ++------------- src/engine/platform/genesisext.cpp | 2 +- src/engine/platform/genesisext.h | 36 +------------- src/engine/platform/lynx.h | 30 ++++-------- src/engine/platform/mmc5.h | 24 +++------ src/engine/platform/msm5232.h | 25 ++-------- src/engine/platform/msm6258.cpp | 1 - src/engine/platform/msm6258.h | 34 ++----------- src/engine/platform/msm6295.cpp | 1 - src/engine/platform/msm6295.h | 19 ++----- src/engine/platform/n163.h | 28 +++-------- src/engine/platform/namcowsg.h | 24 ++------- src/engine/platform/nes.h | 24 +++------ src/engine/platform/opl.h | 23 ++------- src/engine/platform/opll.h | 23 ++------- src/engine/platform/pce.h | 26 +++------- src/engine/platform/pcmdac.h | 21 ++------ src/engine/platform/pcspkr.h | 27 ++-------- src/engine/platform/pet.h | 23 ++------- src/engine/platform/pong.h | 27 ++-------- src/engine/platform/qsound.h | 28 +++-------- src/engine/platform/rf5c68.h | 25 ++-------- src/engine/platform/saa.h | 14 +++--- src/engine/platform/scc.h | 23 +++------ src/engine/platform/segapcm.h | 23 ++------- src/engine/platform/sms.h | 25 +++------- src/engine/platform/snes.h | 25 ++-------- src/engine/platform/su.h | 25 +++------- src/engine/platform/swan.h | 22 ++------- src/engine/platform/t6w28.h | 24 ++------- src/engine/platform/tia.h | 11 ++--- src/engine/platform/tx81z.h | 39 ++------------- src/engine/platform/vb.h | 24 ++------- src/engine/platform/vera.h | 13 +++-- src/engine/platform/vic20.h | 24 ++------- src/engine/platform/vrc6.h | 26 +++------- src/engine/platform/x1_010.h | 46 ++++++++++------- src/engine/platform/ym2203.cpp | 2 +- src/engine/platform/ym2203.h | 45 +---------------- src/engine/platform/ym2203ext.cpp | 2 +- src/engine/platform/ym2203ext.h | 29 +---------- src/engine/platform/ym2608.cpp | 2 +- src/engine/platform/ym2608.h | 49 +----------------- src/engine/platform/ym2608ext.cpp | 2 +- src/engine/platform/ym2608ext.h | 31 +----------- src/engine/platform/ym2610.cpp | 2 +- src/engine/platform/ym2610b.cpp | 2 +- src/engine/platform/ym2610bext.cpp | 2 +- src/engine/platform/ym2610bext.h | 2 +- src/engine/platform/ym2610ext.cpp | 2 +- src/engine/platform/ym2610ext.h | 2 +- src/engine/platform/ym2610shared.h | 79 +----------------------------- src/engine/platform/ymz280b.h | 25 ++-------- src/engine/platform/zxbeeper.h | 22 ++------- src/gui/debug.cpp | 35 +++++++------ src/gui/sysConf.cpp | 9 ++-- 69 files changed, 457 insertions(+), 1151 deletions(-) create mode 100644 src/chip-utils.h diff --git a/src/chip-utils.h b/src/chip-utils.h new file mode 100644 index 00000000..04268582 --- /dev/null +++ b/src/chip-utils.h @@ -0,0 +1,67 @@ +/** + * Furnace Tracker - multi-system chiptune tracker + * Copyright (C) 2021-2022 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * 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. + */ + +#ifndef _CHIP_UTILS_H +#define _CHIP_UTILS_H + +// custom clock limits +#define MIN_CUSTOM_CLOCK 100000 +#define MAX_CUSTOM_CLOCK 40000000 + +// common shared channel struct +struct SharedChannel { + int ins; + int note; + bool active, insChanged, keyOn, keyOff; + SharedChannel(): + ins(-1), + note(0), + active(false), + insChanged(true), + keyOn(false), + keyOff(false) {} +}; + +// common shared channel struct with frequency +struct SharedChannelFreq: public SharedChannel { + int freq, baseFreq, pitch, pitch2; + bool freqChanged, inPorta, portaPause; + SharedChannelFreq(): + SharedChannel(), + freq(0), + baseFreq(0), + pitch(0), + pitch2(0), + freqChanged(false), + inPorta(false), + portaPause(false) {} +}; + +// common shared channel volume struct +template +struct SharedChannelVolume { + bool volumeChanged; + T vol, outVol, resVol; + SharedChannelVolume(T initVol): + vol(initVol), + outVol(initVol), + resVol(initVol) {} +}; + +#endif diff --git a/src/engine/dispatch.h b/src/engine/dispatch.h index 4574ebb9..2399eb35 100644 --- a/src/engine/dispatch.h +++ b/src/engine/dispatch.h @@ -24,6 +24,7 @@ #include #include #include "config.h" +#include "../chip-utils.h" #define ONE_SEMITONE 2200 @@ -453,6 +454,18 @@ class DivDispatch { */ virtual bool getWantPreNote(); + /** + * get minimum chip clock. + * @return clock in Hz, or 0 if custom clocks are not supported. + */ + virtual unsigned int getClockRangeMin(); + + /** + * get maximum chip clock. + * @return clock in Hz, or 0 if custom clocks are not supported. + */ + virtual unsigned int getClockRangeMax(); + /** * set the chip flags. * @param flags a DivConfig containing chip flags. @@ -582,9 +595,9 @@ class DivDispatch { // custom chip clock helper define. put in setFlags, but before rate is set. #define CHECK_CUSTOM_CLOCK \ if (flags.getInt("customClock",0)>0) { \ - chipClock=flags.getInt("customClock",1000000); \ - if (chipClock>20000000) chipClock=20000000; \ - if (chipClock<100000) chipClock=100000; \ + chipClock=flags.getInt("customClock",getClockRangeMin()); \ + if (chipClock>getClockRangeMax()) chipClock=getClockRangeMax(); \ + if (chipClock { unsigned int audLoc; unsigned short audLen; unsigned int audPos; int audSub; signed char audDat; int sample, wave; - int ins; int busClock; - int note; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, useWave, setPos, useV, useP; - signed char vol, outVol; + bool useWave, setPos, useV, useP; DivMacroInt std; DivWaveSynth ws; void macroInit(DivInstrument* which) { @@ -46,10 +42,8 @@ class DivPlatformAmiga: public DivDispatch { pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), + SharedChannelFreq(), + SharedChannelVolume(64), audLoc(0), audLen(0), audPos(0), @@ -57,21 +51,11 @@ class DivPlatformAmiga: public DivDispatch { audDat(0), sample(-1), wave(-1), - ins(-1), busClock(0), - note(0), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), useWave(false), setPos(false), useV(false), - useP(false), - vol(64), - outVol(64) {} + useP(false) {} }; Channel chan[4]; DivDispatchOscBuffer* oscBuf[4]; diff --git a/src/engine/platform/arcade.h b/src/engine/platform/arcade.h index eee273df..e2e84b4d 100644 --- a/src/engine/platform/arcade.h +++ b/src/engine/platform/arcade.h @@ -20,8 +20,6 @@ #ifndef _ARCADE_H #define _ARCADE_H #include "fmshared_OPM.h" -#include "../macroInt.h" -#include "../instrument.h" #include #include "../../../extern/opm/opm.h" #include "sound/ymfm/ymfm_opm.h" @@ -36,44 +34,12 @@ class DivPlatformArcade: public DivPlatformOPM { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }; - struct Channel { - DivInstrumentFM state; - DivMacroInt std; - unsigned char freqH, freqL; - int freq, baseFreq, pitch, pitch2, note; - int ins; - signed char konCycles; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, portaPause, furnacePCM, hardReset, opMaskChanged; - int vol, outVol; - unsigned char chVolL, chVolR, opMask; - void macroInit(DivInstrument* which) { - std.init(which); - pitch2=0; - } + struct Channel: public FMChannel { + unsigned char chVolL, chVolR; Channel(): - freqH(0), - freqL(0), - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), - ins(-1), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), - portaPause(false), - furnacePCM(false), - hardReset(false), - opMaskChanged(false), - vol(0), - outVol(0), - chVolL(127), - chVolR(127), - opMask(15) {} + FMChannel(), + chVolL(1), + chVolR(1) {} }; Channel chan[8]; DivDispatchOscBuffer* oscBuf[8]; diff --git a/src/engine/platform/ay.h b/src/engine/platform/ay.h index d28eac1b..ad7926b8 100644 --- a/src/engine/platform/ay.h +++ b/src/engine/platform/ay.h @@ -30,7 +30,7 @@ class DivPlatformAY8910: public DivDispatch { 0,4,1,5,2,6,9,8,11,12,13,3,7,10,14,15 }; inline unsigned char regRemap(unsigned char reg) { return intellivision?AY8914RegRemap[reg&0x0f]:reg&0x0f; } - struct Channel { + struct Channel: public SharedChannelFreq, public SharedChannelVolume { struct PSGMode { union { struct { @@ -73,38 +73,21 @@ class DivPlatformAY8910: public DivDispatch { furnaceDAC(0) {} } dac; - int freq, baseFreq, note, pitch, pitch2; - int ins; unsigned char autoEnvNum, autoEnvDen; signed char konCycles; - bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta; - int vol, outVol; DivMacroInt std; void macroInit(DivInstrument* which) { std.init(which); pitch2=0; } Channel(): + SharedChannelFreq(), + SharedChannelVolume(15), curPSGMode(PSGMode(0)), nextPSGMode(PSGMode(1)), dac(DAC()), - freq(0), - baseFreq(0), - note(0), - pitch(0), - pitch2(0), - ins(-1), autoEnvNum(0), - autoEnvDen(0), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - portaPause(false), - inPorta(false), - vol(0), - outVol(15) {} + autoEnvDen(0) {} }; Channel chan[3]; bool isMuted[3]; diff --git a/src/engine/platform/ay8930.h b/src/engine/platform/ay8930.h index 3663ee99..d653893e 100644 --- a/src/engine/platform/ay8930.h +++ b/src/engine/platform/ay8930.h @@ -26,7 +26,7 @@ class DivPlatformAY8930: public DivDispatch { protected: - struct Channel { + struct Channel: public SharedChannelFreq, public SharedChannelVolume { struct Envelope { unsigned char mode; unsigned short period; @@ -81,40 +81,23 @@ class DivPlatformAY8930: public DivDispatch { furnaceDAC(0) {} } dac; - int freq, baseFreq, note, pitch, pitch2; - int ins; unsigned char autoEnvNum, autoEnvDen, duty; signed char konCycles; - bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta; - int vol, outVol; DivMacroInt std; void macroInit(DivInstrument* which) { std.init(which); pitch2=0; } Channel(): + SharedChannelFreq(), + SharedChannelVolume(31), envelope(Envelope()), curPSGMode(PSGMode(0)), nextPSGMode(PSGMode(1)), dac(DAC()), - freq(0), - baseFreq(0), - note(0), - pitch(0), - pitch2(0), - ins(-1), autoEnvNum(0), autoEnvDen(0), - duty(4), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - portaPause(false), - inPorta(false), - vol(0), - outVol(31) {} + duty(4) {} }; Channel chan[3]; bool isMuted[3]; diff --git a/src/engine/platform/bubsyswsg.h b/src/engine/platform/bubsyswsg.h index 0d7e3fd5..f964c289 100644 --- a/src/engine/platform/bubsyswsg.h +++ b/src/engine/platform/bubsyswsg.h @@ -27,10 +27,8 @@ #include "vgsound_emu/src/k005289/k005289.hpp" class DivPlatformBubSysWSG: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2, note, ins; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta; - signed char vol, outVol, wave; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { + signed short wave; signed char waveROM[32] = {0}; // 4 bit PROM per channel on bubble system DivMacroInt std; DivWaveSynth ws; @@ -39,20 +37,8 @@ class DivPlatformBubSysWSG: public DivDispatch { pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), - ins(-1), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), - vol(15), - outVol(15), + SharedChannelFreq(), + SharedChannelVolume(15), wave(-1) {} }; Channel chan[2]; diff --git a/src/engine/platform/c64.h b/src/engine/platform/c64.h index ba9a0512..22513e06 100644 --- a/src/engine/platform/c64.h +++ b/src/engine/platform/c64.h @@ -26,27 +26,22 @@ #include "sound/c64_fp/SID.h" class DivPlatformC64: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2, prevFreq, testWhen, note, ins; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { + int prevFreq, testWhen; unsigned char sweep, wave, attack, decay, sustain, release; short duty; - bool active, insChanged, freqChanged, sweepChanged, keyOn, keyOff, inPorta, filter; + bool sweepChanged, filter; bool resetMask, resetFilter, resetDuty, ring, sync, test; - signed char vol, outVol; DivMacroInt std; void macroInit(DivInstrument* which) { std.init(which); pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), + SharedChannelFreq(), + SharedChannelVolume(15), prevFreq(65535), testWhen(0), - note(0), - ins(-1), sweep(0), wave(0), attack(0), @@ -54,21 +49,14 @@ class DivPlatformC64: public DivDispatch { sustain(0), release(0), duty(0), - active(false), - insChanged(true), - freqChanged(false), sweepChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), filter(false), resetMask(false), resetFilter(false), resetDuty(false), ring(false), sync(false), - test(false), - vol(15) {} + test(false) {} }; Channel chan[3]; DivDispatchOscBuffer* oscBuf[3]; diff --git a/src/engine/platform/fds.h b/src/engine/platform/fds.h index 7a54aa52..f41d1976 100644 --- a/src/engine/platform/fds.h +++ b/src/engine/platform/fds.h @@ -27,11 +27,11 @@ #include "sound/nes_nsfplay/nes_fds.h" class DivPlatformFDS: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2, prevFreq, note, modFreq, ins; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { + int prevFreq, modFreq; unsigned char duty, sweep, modDepth, modPos; - bool active, insChanged, freqChanged, sweepChanged, keyOn, keyOff, inPorta, modOn; - signed char vol, outVol, wave; + bool sweepChanged, modOn; + signed short wave; signed char modTable[32]; DivMacroInt std; void macroInit(DivInstrument* which) { @@ -39,28 +39,16 @@ class DivPlatformFDS: public DivDispatch { pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), + SharedChannelFreq(), + SharedChannelVolume(32), prevFreq(65535), - note(0), modFreq(0), - ins(-1), duty(0), sweep(8), modDepth(0), modPos(0), - active(false), - insChanged(true), - freqChanged(false), sweepChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), modOn(false), - vol(32), - outVol(32), wave(-1) { memset(modTable,0,32); } diff --git a/src/engine/platform/fmshared_OPN.h b/src/engine/platform/fmshared_OPN.h index a6eb7185..d2191301 100644 --- a/src/engine/platform/fmshared_OPN.h +++ b/src/engine/platform/fmshared_OPN.h @@ -101,6 +101,54 @@ class DivPlatformOPN: public DivPlatformFMBase { 0x00, 0x04, 0x08, 0x0c }; + struct OPNChannel: public FMChannel { + unsigned char psgMode, autoEnvNum, autoEnvDen; + bool furnacePCM; + int sample, macroVolMul; + + OPNChannel(): + FMChannel(), + psgMode(1), + autoEnvNum(0), + autoEnvDen(0), + furnacePCM(false), + sample(-1), + macroVolMul(255) {} + }; + + struct OPNChannelStereo: public OPNChannel { + unsigned char pan; + OPNChannelStereo(): + OPNChannel(), + pan(3) {} + }; + + struct OPNOpChannel: public SharedChannelFreq, public SharedChannelVolume { + DivMacroInt std; + unsigned char freqH, freqL; + int portaPauseFreq; + signed char konCycles; + bool mask; + void macroInit(DivInstrument* which) { + std.init(which); + pitch2=0; + } + OPNOpChannel(): + SharedChannelFreq(), + SharedChannelVolume(0), + freqH(0), + freqL(0), + portaPauseFreq(0), + mask(true) {} + }; + + struct OPNOpChannelStereo: public OPNOpChannel { + unsigned char pan; + OPNOpChannelStereo(): + OPNOpChannel(), + pan(3) {} + }; + double fmFreqBase; unsigned int fmDivBase; unsigned int ayDiv; diff --git a/src/engine/platform/fmsharedbase.h b/src/engine/platform/fmsharedbase.h index 15baacef..1e1722f9 100644 --- a/src/engine/platform/fmsharedbase.h +++ b/src/engine/platform/fmsharedbase.h @@ -21,6 +21,8 @@ #define _FMSHARED_BASE_H #include "../dispatch.h" +#include "../instrument.h" +#include "../macroInt.h" #include #define KVS(x,y) ((chan[x].state.op[y].kvs==2 && isOutput[chan[x].state.alg][y]) || chan[x].state.op[y].kvs==1) @@ -46,6 +48,38 @@ class DivPlatformFMBase: public DivDispatch { 0,2,1,3 }; + struct FMChannel: public SharedChannelFreq, public SharedChannelVolume { + DivInstrumentFM state; + DivMacroInt std; + unsigned char freqH, freqL; + int portaPauseFreq; + unsigned char opMask; + signed char konCycles; + bool hardReset, opMaskChanged; + + void macroInit(DivInstrument* which) { + std.init(which); + pitch2=0; + } + FMChannel(): + SharedChannelFreq(), + SharedChannelVolume(0), + freqH(0), + freqL(0), + portaPauseFreq(0), + opMask(15), + konCycles(0), + hardReset(false), + opMaskChanged(false) {} + }; + + struct FMChannelStereo: public FMChannel { + unsigned char pan; + FMChannelStereo(): + FMChannel(), + pan(3) {} + }; + struct QueuedWrite { unsigned short addr; unsigned char val; diff --git a/src/engine/platform/gb.h b/src/engine/platform/gb.h index 17a17da1..09057a41 100644 --- a/src/engine/platform/gb.h +++ b/src/engine/platform/gb.h @@ -27,12 +27,12 @@ #include class DivPlatformGB: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2, note, ins; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { unsigned char duty, sweep; - bool active, insChanged, freqChanged, sweepChanged, keyOn, keyOff, inPorta, released, softEnv, killIt; + bool sweepChanged, released, softEnv, killIt; bool soManyHacksToMakeItDefleCompatible; - signed char vol, outVol, wave, lastKill; + signed short wave; + signed char lastKill; unsigned char envVol, envDir, envLen, soundLen; unsigned short hwSeqPos; short hwSeqDelay; @@ -42,27 +42,15 @@ class DivPlatformGB: public DivDispatch { pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), - ins(-1), + SharedChannelFreq(), + SharedChannelVolume(15), duty(0), sweep(0), - active(false), - insChanged(true), - freqChanged(false), sweepChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), released(false), softEnv(false), killIt(false), soManyHacksToMakeItDefleCompatible(false), - vol(15), - outVol(15), wave(-1), lastKill(0), envVol(0), diff --git a/src/engine/platform/genesis.h b/src/engine/platform/genesis.h index 999e3687..53a6eada 100644 --- a/src/engine/platform/genesis.h +++ b/src/engine/platform/genesis.h @@ -39,16 +39,8 @@ class DivPlatformGenesis: public DivPlatformOPN { 0, 1, 2, 4, 5, 6 }; - struct Channel { - DivInstrumentFM state; - DivMacroInt std; - unsigned char freqH, freqL; - int freq, baseFreq, pitch, pitch2, portaPauseFreq, note; - int ins; - bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, furnaceDac, inPorta, hardReset, opMaskChanged; - int vol, outVol; - unsigned char pan, opMask; - + struct Channel: public FMChannelStereo { + bool furnaceDac; bool dacMode; int dacPeriod; int dacRate; @@ -59,34 +51,9 @@ class DivPlatformGenesis: public DivPlatformOPN { bool dacDirection; unsigned char sampleBank; signed char dacOutput; - void macroInit(DivInstrument* which) { - std.init(which); - pitch2=0; - } Channel(): - freqH(0), - freqL(0), - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - portaPauseFreq(0), - note(0), - ins(-1), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - portaPause(false), + FMChannelStereo(), furnaceDac(false), - inPorta(false), - hardReset(false), - opMaskChanged(false), - vol(0), - outVol(0), - pan(3), - opMask(15), dacMode(false), dacPeriod(0), dacRate(0), diff --git a/src/engine/platform/genesisext.cpp b/src/engine/platform/genesisext.cpp index 45a8898d..5395b32c 100644 --- a/src/engine/platform/genesisext.cpp +++ b/src/engine/platform/genesisext.cpp @@ -709,7 +709,7 @@ void DivPlatformGenesisExt::reset() { DivPlatformGenesis::reset(); for (int i=0; i<4; i++) { - opChan[i]=DivPlatformGenesisExt::OpChannel(); + opChan[i]=DivPlatformOPN::OPNOpChannelStereo(); opChan[i].std.setEngine(parent); opChan[i].vol=127; opChan[i].outVol=127; diff --git a/src/engine/platform/genesisext.h b/src/engine/platform/genesisext.h index fb68ecff..32678f51 100644 --- a/src/engine/platform/genesisext.h +++ b/src/engine/platform/genesisext.h @@ -22,41 +22,7 @@ #include "genesis.h" class DivPlatformGenesisExt: public DivPlatformGenesis { - struct OpChannel { - DivMacroInt std; - unsigned char freqH, freqL; - int freq, baseFreq, pitch, pitch2, portaPauseFreq, ins, note; - signed char konCycles; - bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta, mask; - int vol, outVol; - unsigned char pan; - void macroInit(DivInstrument* which) { - std.init(which); - pitch2=0; - } - OpChannel(): - freqH(0), - freqL(0), - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - portaPauseFreq(0), - ins(-1), - note(0), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - portaPause(false), - inPorta(false), - mask(true), - vol(0), - outVol(0), - pan(3) {} - }; - OpChannel opChan[4]; + OPNOpChannelStereo opChan[4]; bool isOpMuted[4]; friend void putDispatchChip(void*,int); friend void putDispatchChan(void*,int,int); diff --git a/src/engine/platform/lynx.h b/src/engine/platform/lynx.h index c03402e2..3e7c707d 100644 --- a/src/engine/platform/lynx.h +++ b/src/engine/platform/lynx.h @@ -27,58 +27,46 @@ class DivPlatformLynx: public DivDispatch { struct MikeyFreqDiv { - uint8_t clockDivider; - uint8_t backup; + unsigned char clockDivider; + unsigned char backup; MikeyFreqDiv(int frequency); }; struct MikeyDuty { - uint8_t int_feedback7; - uint8_t feedback; + unsigned char int_feedback7; + unsigned char feedback; MikeyDuty(int duty); }; - struct Channel { + struct Channel: public SharedChannelFreq, public SharedChannelVolume { DivMacroInt std; MikeyFreqDiv fd; MikeyDuty duty; - int baseFreq, pitch, pitch2, note, actualNote, lfsr, ins, sample, samplePos, sampleAccum, sampleBaseFreq, sampleFreq; + int actualNote, lfsr, sample, samplePos, sampleAccum, sampleBaseFreq, sampleFreq; unsigned char pan; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, pcm; - signed char vol, outVol; + bool pcm; int macroVolMul; void macroInit(DivInstrument* which) { std.init(which); pitch2=0; } Channel(): + SharedChannelFreq(), + SharedChannelVolume(127), std(), fd(0), duty(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), actualNote(0), lfsr(-1), - ins(-1), sample(-1), samplePos(0), sampleAccum(0), sampleBaseFreq(0), sampleFreq(0), pan(0xff), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), pcm(false), - vol(127), - outVol(127), macroVolMul(127) {} }; Channel chan[4]; diff --git a/src/engine/platform/mmc5.h b/src/engine/platform/mmc5.h index ddad9ec2..51991012 100644 --- a/src/engine/platform/mmc5.h +++ b/src/engine/platform/mmc5.h @@ -24,36 +24,24 @@ #include "../macroInt.h" class DivPlatformMMC5: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2, prevFreq, note, ins; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { + int prevFreq; unsigned char duty, sweep; - bool active, insChanged, freqChanged, sweepChanged, keyOn, keyOff, inPorta, furnaceDac; - signed char vol, outVol, wave; + bool sweepChanged, furnaceDac; + signed char wave; DivMacroInt std; void macroInit(DivInstrument* which) { std.init(which); pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), + SharedChannelFreq(), + SharedChannelVolume(15), prevFreq(65535), - note(0), - ins(-1), duty(0), sweep(8), - active(false), - insChanged(true), - freqChanged(false), sweepChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), furnaceDac(false), - vol(15), - outVol(15), wave(-1) {} }; Channel chan[5]; diff --git a/src/engine/platform/msm5232.h b/src/engine/platform/msm5232.h index 3e2bf71a..7d1ad4a5 100644 --- a/src/engine/platform/msm5232.h +++ b/src/engine/platform/msm5232.h @@ -26,32 +26,17 @@ #include "sound/oki/msm5232.h" class DivPlatformMSM5232: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2, note; - int ins; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, noise; - signed char vol, outVol; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { + bool noise; DivMacroInt std; void macroInit(DivInstrument* which) { std.init(which); pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), - ins(-1), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), - noise(false), - vol(127), - outVol(127) {} + SharedChannelFreq(), + SharedChannelVolume(127), + noise(false) {} }; Channel chan[8]; DivDispatchOscBuffer* oscBuf[8]; diff --git a/src/engine/platform/msm6258.cpp b/src/engine/platform/msm6258.cpp index ef11c717..1c594982 100644 --- a/src/engine/platform/msm6258.cpp +++ b/src/engine/platform/msm6258.cpp @@ -156,7 +156,6 @@ int DivPlatformMSM6258::dispatch(DivCommand c) { //DivSample* s=parent->getSample(chan[c.chan].sample); if (c.value!=DIV_NOTE_NULL) { chan[c.chan].note=c.value; - chan[c.chan].freqChanged=true; } chan[c.chan].active=true; chan[c.chan].keyOn=true; diff --git a/src/engine/platform/msm6258.h b/src/engine/platform/msm6258.h index 9a5cd7d7..2a46fb9e 100644 --- a/src/engine/platform/msm6258.h +++ b/src/engine/platform/msm6258.h @@ -26,44 +26,18 @@ class DivPlatformMSM6258: public DivDispatch { protected: - struct Channel { - unsigned char freqH, freqL; - int freq, baseFreq, pitch, pitch2, portaPauseFreq, note, ins; - unsigned char psgMode, autoEnvNum, autoEnvDen; - signed char konCycles; - bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta, furnacePCM, hardReset; - int vol, outVol; + struct Channel: public SharedChannel, public SharedChannelVolume { + bool furnacePCM; int sample; unsigned char pan; DivMacroInt std; void macroInit(DivInstrument* which) { std.init(which); - pitch2=0; } Channel(): - freqH(0), - freqL(0), - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - portaPauseFreq(0), - note(0), - ins(-1), - psgMode(1), - autoEnvNum(0), - autoEnvDen(0), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - portaPause(false), - inPorta(false), + SharedChannel(), + SharedChannelVolume(8), furnacePCM(false), - hardReset(false), - vol(0), - outVol(15), sample(-1), pan(3) {} }; diff --git a/src/engine/platform/msm6295.cpp b/src/engine/platform/msm6295.cpp index 3bf0b8eb..33321bb6 100644 --- a/src/engine/platform/msm6295.cpp +++ b/src/engine/platform/msm6295.cpp @@ -144,7 +144,6 @@ int DivPlatformMSM6295::dispatch(DivCommand c) { //DivSample* s=parent->getSample(chan[c.chan].sample); if (c.value!=DIV_NOTE_NULL) { chan[c.chan].note=c.value; - chan[c.chan].freqChanged=true; } chan[c.chan].active=true; chan[c.chan].keyOn=true; diff --git a/src/engine/platform/msm6295.h b/src/engine/platform/msm6295.h index 9d47824a..d7e1f080 100644 --- a/src/engine/platform/msm6295.h +++ b/src/engine/platform/msm6295.h @@ -26,28 +26,17 @@ class DivPlatformMSM6295: public DivDispatch, public vgsound_emu_mem_intf { protected: - struct Channel { - int note, ins; - signed char konCycles; - bool active, insChanged, freqChanged, keyOn, keyOff, furnacePCM, hardReset; - int vol, outVol; + struct Channel: public SharedChannel, public SharedChannelVolume { + bool furnacePCM; int sample; DivMacroInt std; void macroInit(DivInstrument* which) { std.init(which); } Channel(): - note(0), - ins(-1), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), + SharedChannel(), + SharedChannelVolume(8), furnacePCM(false), - hardReset(false), - vol(8), - outVol(8), sample(-1) {} }; Channel chan[4]; diff --git a/src/engine/platform/n163.h b/src/engine/platform/n163.h index 2f8e5ef9..d6fb4b2e 100644 --- a/src/engine/platform/n163.h +++ b/src/engine/platform/n163.h @@ -27,14 +27,12 @@ #include "vgsound_emu/src/n163/n163.hpp" class DivPlatformN163: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2, note; - short ins, wave, wavePos, waveLen; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { + short wave, wavePos, waveLen; unsigned char waveMode; short loadWave, loadPos, loadLen; unsigned char loadMode; - bool active, insChanged, freqChanged, volumeChanged, waveChanged, waveUpdated, keyOn, keyOff, inPorta; - signed char vol, outVol, resVol; + bool waveChanged, waveUpdated; DivMacroInt std; DivWaveSynth ws; void macroInit(DivInstrument* which) { @@ -42,12 +40,8 @@ class DivPlatformN163: public DivDispatch { pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), - ins(-1), + SharedChannelFreq(), + SharedChannelVolume(15), wave(-1), wavePos(0), waveLen(0), @@ -56,18 +50,8 @@ class DivPlatformN163: public DivDispatch { loadPos(0), loadLen(0), loadMode(0), - active(false), - insChanged(true), - freqChanged(false), - volumeChanged(false), waveChanged(false), - waveUpdated(false), - keyOn(false), - keyOff(false), - inPorta(false), - vol(15), - outVol(15), - resVol(15) {} + waveUpdated(false) {} }; Channel chan[8]; DivDispatchOscBuffer* oscBuf[8]; diff --git a/src/engine/platform/namcowsg.h b/src/engine/platform/namcowsg.h index 1656dedd..56387ee6 100644 --- a/src/engine/platform/namcowsg.h +++ b/src/engine/platform/namcowsg.h @@ -27,12 +27,10 @@ #include "sound/namco.h" class DivPlatformNamcoWSG: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2, note; - int ins; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { unsigned char pan; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, noise; - signed char vol, outVol, wave; + bool noise; + signed char wave; DivMacroInt std; DivWaveSynth ws; void macroInit(DivInstrument* which) { @@ -40,22 +38,10 @@ class DivPlatformNamcoWSG: public DivDispatch { pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), - ins(-1), + SharedChannelFreq(), + SharedChannelVolume(15), pan(255), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), noise(false), - vol(15), - outVol(15), wave(-1) {} }; Channel chan[8]; diff --git a/src/engine/platform/nes.h b/src/engine/platform/nes.h index 4dbfcec3..5d04204f 100644 --- a/src/engine/platform/nes.h +++ b/src/engine/platform/nes.h @@ -26,38 +26,26 @@ #include "sound/nes_nsfplay/nes_apu.h" class DivPlatformNES: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2, prevFreq, note, ins; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { + int prevFreq; unsigned char duty, sweep, envMode, len; - bool active, insChanged, freqChanged, sweepChanged, keyOn, keyOff, inPorta, furnaceDac; - signed char vol, outVol, wave; + bool sweepChanged, furnaceDac; + signed char wave; DivMacroInt std; void macroInit(DivInstrument* which) { std.init(which); pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), + SharedChannelFreq(), + SharedChannelVolume(15), prevFreq(65535), - note(0), - ins(-1), duty(0), sweep(8), envMode(3), len(0x1f), - active(false), - insChanged(true), - freqChanged(false), sweepChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), furnaceDac(false), - vol(15), - outVol(15), wave(-1) {} }; Channel chan[5]; diff --git a/src/engine/platform/opl.h b/src/engine/platform/opl.h index b8dee394..db3b4a8e 100644 --- a/src/engine/platform/opl.h +++ b/src/engine/platform/opl.h @@ -36,13 +36,12 @@ class DivOPLAInterface: public ymfm::ymfm_interface { class DivPlatformOPL: public DivDispatch { protected: - struct Channel { + struct Channel: public SharedChannelFreq, public SharedChannelVolume { DivInstrumentFM state; DivMacroInt std; unsigned char freqH, freqL; - int freq, baseFreq, pitch, pitch2, note, ins, sample, fixedFreq; - bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, furnacePCM, inPorta, fourOp, hardReset; - int vol, outVol; + int sample, fixedFreq; + bool furnacePCM, fourOp, hardReset; unsigned char pan; int macroVolMul; void macroInit(DivInstrument* which) { @@ -50,27 +49,15 @@ class DivPlatformOPL: public DivDispatch { pitch2=0; } Channel(): + SharedChannelFreq(), + SharedChannelVolume(0), freqH(0), freqL(0), - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), - ins(-1), sample(-1), fixedFreq(0), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - portaPause(false), furnacePCM(false), - inPorta(false), fourOp(false), hardReset(false), - vol(0), pan(3), macroVolMul(64) { state.ops=2; diff --git a/src/engine/platform/opll.h b/src/engine/platform/opll.h index 8dd8743d..c9a54224 100644 --- a/src/engine/platform/opll.h +++ b/src/engine/platform/opll.h @@ -29,37 +29,24 @@ extern "C" { class DivPlatformOPLL: public DivDispatch { protected: - struct Channel { + struct Channel: public SharedChannelFreq, public SharedChannelVolume { DivInstrumentFM state; DivMacroInt std; unsigned char freqH, freqL; - int freq, baseFreq, pitch, pitch2, note, ins, fixedFreq; - bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, furnaceDac, inPorta; - int vol, outVol; + int fixedFreq; + bool furnaceDac; unsigned char pan; void macroInit(DivInstrument* which) { std.init(which); pitch2=0; } Channel(): + SharedChannelFreq(), + SharedChannelVolume(0), freqH(0), freqL(0), - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), - ins(-1), fixedFreq(0), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - portaPause(false), furnaceDac(false), - inPorta(false), - vol(0), pan(3) {} }; Channel chan[11]; diff --git a/src/engine/platform/pce.h b/src/engine/platform/pce.h index 5645586b..28617faf 100644 --- a/src/engine/platform/pce.h +++ b/src/engine/platform/pce.h @@ -27,14 +27,14 @@ #include "sound/pce_psg.h" class DivPlatformPCE: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2, note, antiClickPeriodCount, antiClickWavePos; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { + int antiClickPeriodCount, antiClickWavePos; int dacPeriod, dacRate, dacOut; unsigned int dacPos; - int dacSample, ins; + int dacSample; unsigned char pan; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, noise, pcm, furnaceDac, deferredWaveUpdate; - signed char vol, outVol, wave; + bool noise, pcm, furnaceDac, deferredWaveUpdate; + signed short wave; int macroVolMul; DivMacroInt std; DivWaveSynth ws; @@ -43,11 +43,8 @@ class DivPlatformPCE: public DivDispatch { pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), + SharedChannelFreq(), + SharedChannelVolume(31), antiClickPeriodCount(0), antiClickWavePos(0), dacPeriod(0), @@ -55,20 +52,11 @@ class DivPlatformPCE: public DivDispatch { dacOut(0), dacPos(0), dacSample(-1), - ins(-1), pan(255), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), noise(false), pcm(false), furnaceDac(false), deferredWaveUpdate(false), - vol(31), - outVol(31), wave(-1), macroVolMul(31) {} }; diff --git a/src/engine/platform/pcmdac.h b/src/engine/platform/pcmdac.h index 46b9e224..3469c716 100644 --- a/src/engine/platform/pcmdac.h +++ b/src/engine/platform/pcmdac.h @@ -26,17 +26,15 @@ #include "../waveSynth.h" class DivPlatformPCMDAC: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2; + struct Channel: public SharedChannelFreq { bool audDir; unsigned int audLoc; unsigned short audLen; int audPos; int audSub; - int sample, wave, ins; - int note; + int sample, wave; int panL, panR; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, useWave, setPos; + bool useWave, setPos; int vol, envVol; DivMacroInt std; DivWaveSynth ws; @@ -45,10 +43,7 @@ class DivPlatformPCMDAC: public DivDispatch { pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), + SharedChannelFreq(), audDir(false), audLoc(0), audLen(0), @@ -56,16 +51,8 @@ class DivPlatformPCMDAC: public DivDispatch { audSub(0), sample(-1), wave(-1), - ins(-1), - note(0), panL(255), panR(255), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), useWave(false), setPos(false), vol(255), diff --git a/src/engine/platform/pcspkr.h b/src/engine/platform/pcspkr.h index 9d84c210..f6d3384b 100644 --- a/src/engine/platform/pcspkr.h +++ b/src/engine/platform/pcspkr.h @@ -28,36 +28,15 @@ #include class DivPlatformPCSpeaker: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2, note, ins; - unsigned char duty, sweep; - bool active, insChanged, freqChanged, sweepChanged, keyOn, keyOff, inPorta, furnaceDac; - signed char vol, outVol, wave; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { DivMacroInt std; void macroInit(DivInstrument* which) { std.init(which); pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), - ins(-1), - duty(0), - sweep(8), - active(false), - insChanged(true), - freqChanged(false), - sweepChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), - furnaceDac(false), - vol(15), - outVol(15), - wave(-1) {} + SharedChannelFreq(), + SharedChannelVolume(15) {} }; Channel chan[1]; DivDispatchOscBuffer* oscBuf; diff --git a/src/engine/platform/pet.h b/src/engine/platform/pet.h index 17c0686f..716880ad 100644 --- a/src/engine/platform/pet.h +++ b/src/engine/platform/pet.h @@ -24,10 +24,9 @@ #include "../macroInt.h" class DivPlatformPET: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2, note, ins; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, enable; - int vol, outVol, wave; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { + bool enable; + int wave; unsigned char sreg; int cnt; short out; @@ -37,21 +36,9 @@ class DivPlatformPET: public DivDispatch { pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), - ins(-1), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), + SharedChannelFreq(), + SharedChannelVolume(1), enable(false), - vol(1), - outVol(1), wave(0b00001111), sreg(0), cnt(0), diff --git a/src/engine/platform/pong.h b/src/engine/platform/pong.h index afce7450..11a70e9d 100644 --- a/src/engine/platform/pong.h +++ b/src/engine/platform/pong.h @@ -24,36 +24,15 @@ #include "../macroInt.h" class DivPlatformPong: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2, note, ins; - unsigned char duty, sweep; - bool active, insChanged, freqChanged, sweepChanged, keyOn, keyOff, inPorta, furnaceDac; - signed char vol, outVol, wave; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { DivMacroInt std; void macroInit(DivInstrument* which) { std.init(which); pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), - ins(-1), - duty(0), - sweep(8), - active(false), - insChanged(true), - freqChanged(false), - sweepChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), - furnaceDac(false), - vol(1), - outVol(1), - wave(-1) {} + SharedChannelFreq(), + SharedChannelVolume(1) {} }; Channel chan[1]; DivDispatchOscBuffer* oscBuf; diff --git a/src/engine/platform/qsound.h b/src/engine/platform/qsound.h index d141d591..a4870988 100644 --- a/src/engine/platform/qsound.h +++ b/src/engine/platform/qsound.h @@ -26,41 +26,25 @@ #include "sound/qsound.h" class DivPlatformQSound: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2; - int sample, wave, ins; - int note; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { + int sample, wave; int panning; int echo; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, useWave, surround, isNewQSound; - int vol, outVol, resVol; + bool useWave, surround, isNewQSound; DivMacroInt std; void macroInit(DivInstrument* which) { std.init(which); pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), + SharedChannelFreq(), + SharedChannelVolume(4095), sample(-1), - ins(-1), - note(0), panning(0x10), echo(0), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), useWave(false), surround(true), - isNewQSound(false), - vol(255), - outVol(255), - resVol(4096) {} + isNewQSound(false) {} }; Channel chan[19]; DivDispatchOscBuffer* oscBuf[19]; diff --git a/src/engine/platform/rf5c68.h b/src/engine/platform/rf5c68.h index 5af36c03..e2947c09 100644 --- a/src/engine/platform/rf5c68.h +++ b/src/engine/platform/rf5c68.h @@ -26,14 +26,11 @@ #include "sound/rf5c68.h" class DivPlatformRF5C68: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { unsigned int audPos; - int sample, wave, ins; - int note; + int sample, wave; int panning; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, setPos; - int vol, outVol; + bool setPos; int macroVolMul; DivMacroInt std; void macroInit(DivInstrument* which) { @@ -41,24 +38,12 @@ class DivPlatformRF5C68: public DivDispatch { pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), + SharedChannelFreq(), + SharedChannelVolume(255), audPos(0), sample(-1), - ins(-1), - note(0), panning(255), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), setPos(false), - vol(255), - outVol(255), macroVolMul(64) {} }; Channel chan[8]; diff --git a/src/engine/platform/saa.h b/src/engine/platform/saa.h index 6bae715e..9090891d 100644 --- a/src/engine/platform/saa.h +++ b/src/engine/platform/saa.h @@ -26,20 +26,22 @@ class DivPlatformSAA1099: public DivDispatch { protected: - struct Channel { + struct Channel: public SharedChannelFreq, public SharedChannelVolume { unsigned char freqH, freqL; - int freq, baseFreq, pitch, pitch2, note, ins; unsigned char psgMode; - signed char konCycles; - bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta; - int vol, outVol; unsigned char pan; DivMacroInt std; void macroInit(DivInstrument* which) { std.init(which); pitch2=0; } - Channel(): freqH(0), freqL(0), freq(0), baseFreq(0), pitch(0), pitch2(0), note(0), ins(-1), psgMode(1), active(false), insChanged(true), freqChanged(false), keyOn(false), keyOff(false), portaPause(false), inPorta(false), vol(0), outVol(15), pan(255) {} + Channel(): + SharedChannelFreq(), + SharedChannelVolume(15), + freqH(0), + freqL(0), + psgMode(1), + pan(255) {} }; Channel chan[6]; DivDispatchOscBuffer* oscBuf[6]; diff --git a/src/engine/platform/scc.h b/src/engine/platform/scc.h index ed886547..41700e35 100644 --- a/src/engine/platform/scc.h +++ b/src/engine/platform/scc.h @@ -27,11 +27,10 @@ #include "vgsound_emu/src/scc/scc.hpp" class DivPlatformSCC: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2, note, ins; - bool active, insChanged, freqChanged, freqInit, inPorta; - signed char vol, outVol, wave; - signed char waveROM[32] = {0}; // 4 bit PROM per channel on bubble system + struct Channel: public SharedChannelFreq, public SharedChannelVolume { + bool freqInit; + signed short wave; + signed char waveROM[32] = {0}; // 8 bit signed waveform DivMacroInt std; DivWaveSynth ws; void macroInit(DivInstrument* which) { @@ -39,19 +38,9 @@ class DivPlatformSCC: public DivDispatch { pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), - ins(-1), - active(false), - insChanged(true), - freqChanged(false), + SharedChannelFreq(), + SharedChannelVolume(15), freqInit(false), - inPorta(false), - vol(15), - outVol(15), wave(-1) {} }; Channel chan[5]; diff --git a/src/engine/platform/segapcm.h b/src/engine/platform/segapcm.h index 2ed15eae..1a471fe4 100644 --- a/src/engine/platform/segapcm.h +++ b/src/engine/platform/segapcm.h @@ -26,11 +26,9 @@ class DivPlatformSegaPCM: public DivDispatch { protected: - struct Channel { + struct Channel: public SharedChannelFreq, public SharedChannelVolume { DivMacroInt std; - int freq, baseFreq, pitch, pitch2, note, ins; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, portaPause, furnacePCM, isNewSegaPCM; - int vol, outVol; + bool furnacePCM, isNewSegaPCM; unsigned char chVolL, chVolR; unsigned char chPanL, chPanR; int macroVolMul; @@ -47,23 +45,10 @@ class DivPlatformSegaPCM: public DivDispatch { pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), - ins(-1), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), - portaPause(false), + SharedChannelFreq(), + SharedChannelVolume(127), furnacePCM(false), isNewSegaPCM(false), - vol(0), - outVol(0), chVolL(127), chVolR(127), chPanL(127), diff --git a/src/engine/platform/sms.h b/src/engine/platform/sms.h index ce3ee5e7..2c3e1746 100644 --- a/src/engine/platform/sms.h +++ b/src/engine/platform/sms.h @@ -29,32 +29,19 @@ extern "C" { #include class DivPlatformSMS: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2, note, actualNote, ins; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, writeVol; - signed char vol, outVol; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { + int actualNote; + bool writeVol; DivMacroInt std; void macroInit(DivInstrument* which) { std.init(which); pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), + SharedChannelFreq(), + SharedChannelVolume(15), actualNote(0), - ins(-1), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), - writeVol(false), - vol(15), - outVol(15) {} + writeVol(false) {} }; Channel chan[4]; DivDispatchOscBuffer* oscBuf[4]; diff --git a/src/engine/platform/snes.h b/src/engine/platform/snes.h index ed8bfbf3..71272ee2 100644 --- a/src/engine/platform/snes.h +++ b/src/engine/platform/snes.h @@ -27,14 +27,11 @@ #include "sound/snes/SPC_DSP.h" class DivPlatformSNES: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { unsigned int audPos; - int sample, wave, ins; - int note; + int sample, wave; int panL, panR; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, useWave, setPos, noise, echo, pitchMod, invertL, invertR, shallWriteVol, shallWriteEnv; - int vol, outVol; + bool useWave, setPos, noise, echo, pitchMod, invertL, invertR, shallWriteVol, shallWriteEnv; int wtLen; DivInstrumentSNES state; DivMacroInt std; @@ -44,23 +41,13 @@ class DivPlatformSNES: public DivDispatch { pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), + SharedChannelFreq(), + SharedChannelVolume(127), audPos(0), sample(-1), wave(-1), - ins(-1), - note(0), panL(127), panR(127), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), useWave(false), setPos(false), noise(false), @@ -70,8 +57,6 @@ class DivPlatformSNES: public DivDispatch { invertR(false), shallWriteVol(false), shallWriteEnv(false), - vol(127), - outVol(127), wtLen(16) {} }; Channel chan[8]; diff --git a/src/engine/platform/su.h b/src/engine/platform/su.h index bacdbc01..22d6ad29 100644 --- a/src/engine/platform/su.h +++ b/src/engine/platform/su.h @@ -26,30 +26,25 @@ #include "sound/su.h" class DivPlatformSoundUnit: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2, note; - int ins, cutoff, baseCutoff, res, control, hasOffset; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { + int cutoff, baseCutoff, res, control, hasOffset; signed char pan; unsigned char duty; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, noise, pcm, phaseReset, filterPhaseReset, switchRoles; + bool noise, pcm, phaseReset, filterPhaseReset, switchRoles; bool pcmLoop, timerSync, freqSweep, volSweep, cutSweep; unsigned short freqSweepP, volSweepP, cutSweepP; unsigned char freqSweepB, volSweepB, cutSweepB; unsigned char freqSweepV, volSweepV, cutSweepV; unsigned short syncTimer; - signed char vol, outVol, wave; + signed short wave; DivMacroInt std; void macroInit(DivInstrument* which) { std.init(which); pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), - ins(-1), + SharedChannelFreq(), + SharedChannelVolume(127), cutoff(16383), baseCutoff(16380), res(0), @@ -57,12 +52,6 @@ class DivPlatformSoundUnit: public DivDispatch { hasOffset(0), pan(0), duty(63), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), noise(false), pcm(false), phaseReset(false), @@ -83,8 +72,6 @@ class DivPlatformSoundUnit: public DivDispatch { volSweepV(0), cutSweepV(0), syncTimer(0), - vol(127), - outVol(127), wave(0) {} }; Channel chan[8]; diff --git a/src/engine/platform/swan.h b/src/engine/platform/swan.h index 8261e634..47c9c8f9 100644 --- a/src/engine/platform/swan.h +++ b/src/engine/platform/swan.h @@ -27,11 +27,9 @@ #include class DivPlatformSwan: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2, note, ins; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { unsigned char pan; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta; - int vol, outVol, wave; + int wave; DivMacroInt std; DivWaveSynth ws; void macroInit(DivInstrument* which) { @@ -39,21 +37,9 @@ class DivPlatformSwan: public DivDispatch { pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), - ins(-1), + SharedChannelFreq(), + SharedChannelVolume(15), pan(255), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), - vol(15), - outVol(15), wave(-1) {} }; Channel chan[4]; diff --git a/src/engine/platform/t6w28.h b/src/engine/platform/t6w28.h index 2cd66f9f..ef06c805 100644 --- a/src/engine/platform/t6w28.h +++ b/src/engine/platform/t6w28.h @@ -26,35 +26,19 @@ #include "sound/t6w28/T6W28_Apu.h" class DivPlatformT6W28: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2, note; - int ins; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { unsigned char panL, panR, duty; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta; - signed char vol, outVol; DivMacroInt std; void macroInit(DivInstrument* which) { std.init(which); pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), - ins(-1), + SharedChannelFreq(), + SharedChannelVolume(15), panL(15), panR(15), - duty(7), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), - vol(15), - outVol(15) {} + duty(7) {} }; Channel chan[4]; DivDispatchOscBuffer* oscBuf[4]; diff --git a/src/engine/platform/tia.h b/src/engine/platform/tia.h index 85bfcabe..f5eb1be1 100644 --- a/src/engine/platform/tia.h +++ b/src/engine/platform/tia.h @@ -26,18 +26,17 @@ class DivPlatformTIA: public DivDispatch { protected: - struct Channel { - int freq, baseFreq, pitch, pitch2, note, ins; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { unsigned char shape; - signed char konCycles; - bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta; - int vol, outVol; DivMacroInt std; void macroInit(DivInstrument* which) { std.init(which); pitch2=0; } - Channel(): freq(0), baseFreq(0), pitch(0), pitch2(0), note(0), ins(-1), shape(4), active(false), insChanged(true), freqChanged(false), keyOn(false), keyOff(false), portaPause(false), inPorta(false), vol(0), outVol(15) {} + Channel(): + SharedChannelFreq(), + SharedChannelVolume(15), + shape(4) {} }; Channel chan[2]; DivDispatchOscBuffer* oscBuf[2]; diff --git a/src/engine/platform/tx81z.h b/src/engine/platform/tx81z.h index 5b4b9f24..6c7b495c 100644 --- a/src/engine/platform/tx81z.h +++ b/src/engine/platform/tx81z.h @@ -20,8 +20,6 @@ #ifndef _TX81Z_H #define _TX81Z_H #include "fmshared_OPM.h" -#include "../macroInt.h" -#include "../instrument.h" #include #include "sound/ymfm/ymfm_opz.h" @@ -35,41 +33,12 @@ class DivPlatformTX81Z: public DivPlatformOPM { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }; - struct Channel { - DivInstrumentFM state; - DivMacroInt std; - unsigned char freqH, freqL; - int freq, baseFreq, pitch, pitch2, note, ins; - signed char konCycles; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, portaPause, furnacePCM, hardReset; - int vol, outVol; + struct Channel: public FMChannel { unsigned char chVolL, chVolR; - void macroInit(DivInstrument* which) { - std.init(which); - pitch2=0; - } Channel(): - freqH(0), - freqL(0), - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), - ins(-1), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), - portaPause(false), - furnacePCM(false), - hardReset(false), - vol(0), - outVol(0), - chVolL(127), - chVolR(127) {} + FMChannel(), + chVolL(1), + chVolR(1) {} }; Channel chan[8]; DivDispatchOscBuffer* oscBuf[8]; diff --git a/src/engine/platform/vb.h b/src/engine/platform/vb.h index baefc03f..adfe339f 100644 --- a/src/engine/platform/vb.h +++ b/src/engine/platform/vb.h @@ -27,12 +27,10 @@ #include "sound/vsu.h" class DivPlatformVB: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2, note; - int ins; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { unsigned char pan, envLow, envHigh; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, noise, deferredWaveUpdate; - signed char vol, outVol, wave; + bool noise, deferredWaveUpdate; + signed short wave; DivMacroInt std; DivWaveSynth ws; void macroInit(DivInstrument* which) { @@ -40,25 +38,13 @@ class DivPlatformVB: public DivDispatch { pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), - ins(-1), + SharedChannelFreq(), + SharedChannelVolume(15), pan(255), envLow(0), envHigh(0), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), noise(false), deferredWaveUpdate(false), - vol(15), - outVol(15), wave(-1) {} }; Channel chan[6]; diff --git a/src/engine/platform/vera.h b/src/engine/platform/vera.h index fec113fc..8dbe4524 100644 --- a/src/engine/platform/vera.h +++ b/src/engine/platform/vera.h @@ -28,11 +28,8 @@ struct VERA_PCM; class DivPlatformVERA: public DivDispatch { protected: - struct Channel { - int freq, baseFreq, pitch, pitch2, note, ins; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { unsigned char pan; - bool active, freqChanged, inPorta; - int vol, outVol; unsigned accum; int noiseval; DivMacroInt std; @@ -50,7 +47,13 @@ class DivPlatformVERA: public DivDispatch { std.init(which); pitch2=0; } - Channel(): freq(0), baseFreq(0), pitch(0), pitch2(0), note(0), ins(-1), pan(0), active(false), freqChanged(false), inPorta(false), vol(0), outVol(0), accum(0), noiseval(0) {} + Channel(): + SharedChannelFreq(), + SharedChannelVolume(0), + pan(0), + accum(0), + noiseval(0), + pcm(PCMChannel()) {} }; Channel chan[17]; DivDispatchOscBuffer* oscBuf[17]; diff --git a/src/engine/platform/vic20.h b/src/engine/platform/vic20.h index 21669c27..6d6df1a1 100644 --- a/src/engine/platform/vic20.h +++ b/src/engine/platform/vic20.h @@ -26,32 +26,16 @@ #include class DivPlatformVIC20: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2, note, ins; - unsigned char pan; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta; - int vol, outVol, wave, waveWriteCycle; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { + int wave, waveWriteCycle; DivMacroInt std; void macroInit(DivInstrument* which) { std.init(which); pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), - ins(-1), - pan(255), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), - vol(15), - outVol(15), + SharedChannelFreq(), + SharedChannelVolume(15), wave(0), waveWriteCycle(-1) {} }; diff --git a/src/engine/platform/vrc6.h b/src/engine/platform/vrc6.h index 839c089b..2a586472 100644 --- a/src/engine/platform/vrc6.h +++ b/src/engine/platform/vrc6.h @@ -27,42 +27,28 @@ class DivPlatformVRC6: public DivDispatch, public vrcvi_intf { - struct Channel { - int freq, baseFreq, pitch, pitch2, note; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { int dacPeriod, dacRate, dacOut; unsigned int dacPos; - int dacSample, ins; + int dacSample; unsigned char duty; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, pcm, furnaceDac; - signed char vol, outVol; + bool pcm, furnaceDac; DivMacroInt std; void macroInit(DivInstrument* which) { std.init(which); pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), + SharedChannelFreq(), + SharedChannelVolume(15), dacPeriod(0), dacRate(0), dacOut(0), dacPos(0), dacSample(-1), - ins(-1), duty(0), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), pcm(false), - furnaceDac(false), - vol(15), - outVol(15) {} + furnaceDac(false) {} }; Channel chan[3]; DivDispatchOscBuffer* oscBuf[3]; diff --git a/src/engine/platform/x1_010.h b/src/engine/platform/x1_010.h index d588d944..19f75258 100644 --- a/src/engine/platform/x1_010.h +++ b/src/engine/platform/x1_010.h @@ -27,7 +27,7 @@ #include "vgsound_emu/src/x1_010/x1_010.hpp" class DivPlatformX1_010: public DivDispatch, public vgsound_emu_mem_intf { - struct Channel { + struct Channel: public SharedChannelFreq, public SharedChannelVolume { struct Envelope { struct EnvFlag { unsigned char envEnable : 1; @@ -68,11 +68,11 @@ class DivPlatformX1_010: public DivDispatch, public vgsound_emu_mem_intf { slide(0), slidefrac(0) {} }; - int freq, baseFreq, fixedFreq, pitch, pitch2, note; - int wave, sample, ins; + int fixedFreq; + int wave, sample; unsigned char pan, autoEnvNum, autoEnvDen; - bool active, insChanged, envChanged, freqChanged, keyOn, keyOff, inPorta, furnacePCM, pcm; - int vol, outVol, lvol, rvol; + bool envChanged, furnacePCM, pcm; + int lvol, rvol; int macroVolMul; unsigned char waveBank; unsigned int bankSlot; @@ -80,26 +80,34 @@ class DivPlatformX1_010: public DivDispatch, public vgsound_emu_mem_intf { DivMacroInt std; DivWaveSynth ws; void reset() { - freq = baseFreq = pitch = pitch2 = note = 0; - wave = sample = ins = -1; - pan = 255; - autoEnvNum = autoEnvDen = 0; - active = false; - insChanged = envChanged = freqChanged = true; - keyOn = keyOff = inPorta = furnacePCM = pcm = false; - vol = outVol = lvol = rvol = 15; - waveBank = 0; + freq=baseFreq=pitch=pitch2=note=0; + wave=sample=ins=-1; + pan=255; + autoEnvNum=autoEnvDen=0; + active=false; + insChanged=envChanged=freqChanged=true; + keyOn=keyOff=inPorta=furnacePCM=pcm=false; + vol=outVol=lvol=rvol=15; + waveBank=0; } void macroInit(DivInstrument* which) { std.init(which); pitch2=0; } Channel(): - freq(0), baseFreq(0), fixedFreq(0), pitch(0), pitch2(0), note(0), - wave(-1), sample(-1), ins(-1), - pan(255), autoEnvNum(0), autoEnvDen(0), - active(false), insChanged(true), envChanged(true), freqChanged(false), keyOn(false), keyOff(false), inPorta(false), furnacePCM(false), pcm(false), - vol(15), outVol(15), lvol(15), rvol(15), + SharedChannelFreq(), + SharedChannelVolume(15), + fixedFreq(0), + wave(-1), + sample(-1), + pan(255), + autoEnvNum(0), + autoEnvDen(0), + envChanged(true), + furnacePCM(false), + pcm(false), + lvol(15), + rvol(15), macroVolMul(15), waveBank(0), bankSlot(0) {} diff --git a/src/engine/platform/ym2203.cpp b/src/engine/platform/ym2203.cpp index 3d6eaa8a..558e164b 100644 --- a/src/engine/platform/ym2203.cpp +++ b/src/engine/platform/ym2203.cpp @@ -851,7 +851,7 @@ void DivPlatformYM2203::reset() { } fm->reset(); for (int i=0; i<6; i++) { - chan[i]=DivPlatformYM2203::Channel(); + chan[i]=DivPlatformOPN::OPNChannel(); chan[i].std.setEngine(parent); } for (int i=0; i<3; i++) { diff --git a/src/engine/platform/ym2203.h b/src/engine/platform/ym2203.h index b93e45dd..ca129795 100644 --- a/src/engine/platform/ym2203.h +++ b/src/engine/platform/ym2203.h @@ -20,7 +20,6 @@ #ifndef _YM2203_H #define _YM2203_H #include "fmshared_OPN.h" -#include "../macroInt.h" #include "sound/ymfm/ymfm_opn.h" #include "ay.h" @@ -39,49 +38,7 @@ class DivPlatformYM2203: public DivPlatformOPN { 0, 1, 2 }; - struct Channel { - DivInstrumentFM state; - unsigned char freqH, freqL; - int freq, baseFreq, pitch, pitch2, portaPauseFreq, note, ins; - unsigned char psgMode, autoEnvNum, autoEnvDen, opMask; - signed char konCycles; - bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta, furnacePCM, hardReset, opMaskChanged; - int vol, outVol; - int sample; - DivMacroInt std; - void macroInit(DivInstrument* which) { - std.init(which); - pitch2=0; - } - Channel(): - freqH(0), - freqL(0), - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - portaPauseFreq(0), - note(0), - ins(-1), - psgMode(1), - autoEnvNum(0), - autoEnvDen(0), - opMask(15), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - portaPause(false), - inPorta(false), - furnacePCM(false), - hardReset(false), - opMaskChanged(false), - vol(0), - outVol(15), - sample(-1) {} - }; - Channel chan[6]; + OPNChannel chan[6]; DivDispatchOscBuffer* oscBuf[6]; bool isMuted[6]; ymfm::ym2203* fm; diff --git a/src/engine/platform/ym2203ext.cpp b/src/engine/platform/ym2203ext.cpp index 21465da7..ace50bee 100644 --- a/src/engine/platform/ym2203ext.cpp +++ b/src/engine/platform/ym2203ext.cpp @@ -483,7 +483,7 @@ void DivPlatformYM2203Ext::reset() { DivPlatformYM2203::reset(); for (int i=0; i<4; i++) { - opChan[i]=DivPlatformYM2203Ext::OpChannel(); + opChan[i]=DivPlatformOPN::OPNOpChannel(); opChan[i].vol=127; } diff --git a/src/engine/platform/ym2203ext.h b/src/engine/platform/ym2203ext.h index 5cf66429..c7a729a0 100644 --- a/src/engine/platform/ym2203ext.h +++ b/src/engine/platform/ym2203ext.h @@ -22,34 +22,7 @@ #include "ym2203.h" class DivPlatformYM2203Ext: public DivPlatformYM2203 { - struct OpChannel { - DivMacroInt std; - unsigned char freqH, freqL; - int freq, baseFreq, pitch, pitch2, portaPauseFreq, ins; - signed char konCycles; - bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta, mask; - int vol; - // UGLY - OpChannel(): - freqH(0), - freqL(0), - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - portaPauseFreq(0), - ins(-1), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - portaPause(false), - inPorta(false), - mask(true), - vol(0) {} - }; - OpChannel opChan[4]; + OPNOpChannel opChan[4]; bool isOpMuted[4]; friend void putDispatchChip(void*,int); friend void putDispatchChan(void*,int,int); diff --git a/src/engine/platform/ym2608.cpp b/src/engine/platform/ym2608.cpp index e15bf6b4..65537f4e 100644 --- a/src/engine/platform/ym2608.cpp +++ b/src/engine/platform/ym2608.cpp @@ -1245,7 +1245,7 @@ void DivPlatformYM2608::reset() { } fm->reset(); for (int i=0; i<16; i++) { - chan[i]=DivPlatformYM2608::Channel(); + chan[i]=DivPlatformOPN::OPNChannelStereo(); chan[i].std.setEngine(parent); } for (int i=0; i<6; i++) { diff --git a/src/engine/platform/ym2608.h b/src/engine/platform/ym2608.h index ef63fe63..48317f24 100644 --- a/src/engine/platform/ym2608.h +++ b/src/engine/platform/ym2608.h @@ -20,7 +20,6 @@ #ifndef _YM2608_H #define _YM2608_H #include "fmshared_OPN.h" -#include "../macroInt.h" #include "sound/ymfm/ymfm_opn.h" #include "ay.h" @@ -44,53 +43,7 @@ class DivPlatformYM2608: public DivPlatformOPN { 0, 1, 2, 4, 5, 6 }; - struct Channel { - DivInstrumentFM state; - unsigned char freqH, freqL; - int freq, baseFreq, pitch, pitch2, portaPauseFreq, note, ins; - unsigned char psgMode, autoEnvNum, autoEnvDen, opMask; - signed char konCycles; - bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta, furnacePCM, hardReset, opMaskChanged; - int vol, outVol; - int sample; - unsigned char pan; - int macroVolMul; - DivMacroInt std; - void macroInit(DivInstrument* which) { - std.init(which); - pitch2=0; - } - Channel(): - freqH(0), - freqL(0), - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - portaPauseFreq(0), - note(0), - ins(-1), - psgMode(1), - autoEnvNum(0), - autoEnvDen(0), - opMask(15), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - portaPause(false), - inPorta(false), - furnacePCM(false), - hardReset(false), - opMaskChanged(false), - vol(0), - outVol(15), - sample(-1), - pan(3), - macroVolMul(255) {} - }; - Channel chan[16]; + OPNChannelStereo chan[16]; DivDispatchOscBuffer* oscBuf[16]; bool isMuted[16]; ymfm::ym2608* fm; diff --git a/src/engine/platform/ym2608ext.cpp b/src/engine/platform/ym2608ext.cpp index 331f3887..7a244e4d 100644 --- a/src/engine/platform/ym2608ext.cpp +++ b/src/engine/platform/ym2608ext.cpp @@ -519,7 +519,7 @@ void DivPlatformYM2608Ext::reset() { DivPlatformYM2608::reset(); for (int i=0; i<4; i++) { - opChan[i]=DivPlatformYM2608Ext::OpChannel(); + opChan[i]=DivPlatformOPN::OPNOpChannelStereo(); opChan[i].vol=127; } diff --git a/src/engine/platform/ym2608ext.h b/src/engine/platform/ym2608ext.h index fc734097..45cbb292 100644 --- a/src/engine/platform/ym2608ext.h +++ b/src/engine/platform/ym2608ext.h @@ -22,36 +22,7 @@ #include "ym2608.h" class DivPlatformYM2608Ext: public DivPlatformYM2608 { - struct OpChannel { - DivMacroInt std; - unsigned char freqH, freqL; - int freq, baseFreq, pitch, pitch2, portaPauseFreq, ins; - signed char konCycles; - bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta, mask; - int vol; - unsigned char pan; - // UGLY - OpChannel(): - freqH(0), - freqL(0), - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - portaPauseFreq(0), - ins(-1), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - portaPause(false), - inPorta(false), - mask(true), - vol(0), - pan(3) {} - }; - OpChannel opChan[4]; + OPNOpChannelStereo opChan[4]; bool isOpMuted[4]; friend void putDispatchChip(void*,int); friend void putDispatchChan(void*,int,int); diff --git a/src/engine/platform/ym2610.cpp b/src/engine/platform/ym2610.cpp index 12434b06..16bb0922 100644 --- a/src/engine/platform/ym2610.cpp +++ b/src/engine/platform/ym2610.cpp @@ -1213,7 +1213,7 @@ void DivPlatformYM2610::reset() { } fm->reset(); for (int i=0; i<14; i++) { - chan[i]=DivPlatformYM2610::Channel(); + chan[i]=DivPlatformOPN::OPNChannelStereo(); chan[i].std.setEngine(parent); } for (int i=0; ireset(); for (int i=0; i<16; i++) { - chan[i]=DivPlatformYM2610B::Channel(); + chan[i]=DivPlatformOPN::OPNChannelStereo(); chan[i].std.setEngine(parent); } for (int i=0; i class DivPlatformYM2610Base: public DivPlatformOPN { protected: - struct Channel { - DivInstrumentFM state; - unsigned char freqH, freqL; - int freq, baseFreq, pitch, pitch2, portaPauseFreq, note, ins; - unsigned char psgMode, autoEnvNum, autoEnvDen; - signed char konCycles; - bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta, furnacePCM, hardReset, opMaskChanged; - int vol, outVol; - int sample; - unsigned char pan, opMask; - int macroVolMul; - DivMacroInt std; - void macroInit(DivInstrument* which) { - std.init(which); - pitch2=0; - } - Channel(): - freqH(0), - freqL(0), - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - portaPauseFreq(0), - note(0), - ins(-1), - psgMode(1), - autoEnvNum(0), - autoEnvDen(0), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - portaPause(false), - inPorta(false), - furnacePCM(false), - hardReset(false), - opMaskChanged(false), - vol(0), - outVol(15), - sample(-1), - pan(3), - opMask(15), - macroVolMul(255) {} - }; - - struct OpChannel { - DivMacroInt std; - unsigned char freqH, freqL; - int freq, baseFreq, pitch, pitch2, portaPauseFreq, ins; - signed char konCycles; - bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta, mask; - int vol; - unsigned char pan; - // UGLY - OpChannel(): - freqH(0), - freqL(0), - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - portaPauseFreq(0), - ins(-1), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - portaPause(false), - inPorta(false), - mask(true), - vol(0), - pan(3) {} - }; - Channel chan[ChanNum]; + OPNChannelStereo chan[ChanNum]; DivDispatchOscBuffer* oscBuf[ChanNum]; bool isMuted[ChanNum]; diff --git a/src/engine/platform/ymz280b.h b/src/engine/platform/ymz280b.h index 9477d003..c88cfa08 100644 --- a/src/engine/platform/ymz280b.h +++ b/src/engine/platform/ymz280b.h @@ -26,14 +26,11 @@ #include "sound/ymz280b.h" class DivPlatformYMZ280B: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { unsigned int audPos; - int sample, wave, ins; - int note; + int sample, wave; int panning; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, setPos, isNewYMZ; - int vol, outVol; + bool setPos, isNewYMZ; int macroVolMul; DivMacroInt std; void macroInit(DivInstrument* which) { @@ -41,25 +38,13 @@ class DivPlatformYMZ280B: public DivDispatch { pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), + SharedChannelFreq(), + SharedChannelVolume(255), audPos(0), sample(-1), - ins(-1), - note(0), panning(8), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), setPos(false), isNewYMZ(false), - vol(255), - outVol(255), macroVolMul(64) {} }; Channel chan[8]; diff --git a/src/engine/platform/zxbeeper.h b/src/engine/platform/zxbeeper.h index ed82caee..db2c0c41 100644 --- a/src/engine/platform/zxbeeper.h +++ b/src/engine/platform/zxbeeper.h @@ -25,11 +25,7 @@ #include "../macroInt.h" class DivPlatformZXBeeper: public DivDispatch { - struct Channel { - int freq, baseFreq, pitch, pitch2, note; - int ins; - bool active, insChanged, freqChanged, keyOn, keyOff, inPorta; - signed char vol, outVol; + struct Channel: public SharedChannelFreq, public SharedChannelVolume { unsigned short sPosition; unsigned char duty; DivMacroInt std; @@ -38,20 +34,8 @@ class DivPlatformZXBeeper: public DivDispatch { pitch2=0; } Channel(): - freq(0), - baseFreq(0), - pitch(0), - pitch2(0), - note(0), - ins(-1), - active(false), - insChanged(true), - freqChanged(false), - keyOn(false), - keyOff(false), - inPorta(false), - vol(1), - outVol(1), + SharedChannelFreq(), + SharedChannelVolume(1), sPosition(0), duty(64) {} }; diff --git a/src/gui/debug.cpp b/src/gui/debug.cpp index ddd50404..4d201d54 100644 --- a/src/gui/debug.cpp +++ b/src/gui/debug.cpp @@ -160,7 +160,7 @@ ImGui::TextColored(ch->dacDirection?colorOn:colorOff,">> DACDirection"); #define GENESIS_OPCHAN_DEBUG \ - DivPlatformGenesisExt::OpChannel* ch=(DivPlatformGenesisExt::OpChannel*)data; \ + DivPlatformOPN::OPNOpChannelStereo* ch=(DivPlatformOPN::OPNOpChannelStereo*)data; \ ImGui::Text("> YM2612 (per operator)"); \ ImGui::Text("- freqHL: %.2x%.2x",ch->freqH,ch->freqL); \ ImGui::Text("* freq: %d",ch->freq); \ @@ -170,6 +170,7 @@ ImGui::Text("- portaPauseFreq: %d",ch->portaPauseFreq); \ ImGui::Text("- ins: %d",ch->ins); \ ImGui::Text("- vol: %.2x",ch->vol); \ + ImGui::Text("- outVol: %.2x",ch->outVol); \ ImGui::Text("- pan: %x",ch->pan); \ ImGui::TextColored(ch->active?colorOn:colorOff,">> Active"); \ ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged"); \ @@ -198,7 +199,7 @@ ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff"); #define OPN_CHAN_DEBUG \ - DivPlatformYM2203::Channel* ch=(DivPlatformYM2203::Channel*)data; \ + DivPlatformOPN::OPNChannel* ch=(DivPlatformOPN::OPNChannel*)data; \ ImGui::Text("> YM2203"); \ ImGui::Text("- freqHL: %.2x%.2x",ch->freqH,ch->freqL); \ ImGui::Text("* freq: %d",ch->freq); \ @@ -228,7 +229,7 @@ ImGui::TextColored(ch->furnacePCM?colorOn:colorOff,">> FurnacePCM"); #define OPN_OPCHAN_DEBUG \ - DivPlatformYM2203Ext::OpChannel* ch=(DivPlatformYM2203Ext::OpChannel*)data; \ + DivPlatformOPN::OPNOpChannel* ch=(DivPlatformOPN::OPNOpChannel*)data; \ ImGui::Text("> YM2203 (per operator)"); \ ImGui::Text("- freqHL: %.2x%.2x",ch->freqH,ch->freqL); \ ImGui::Text("* freq: %d",ch->freq); \ @@ -238,6 +239,7 @@ ImGui::Text("- portaPauseFreq: %d",ch->portaPauseFreq); \ ImGui::Text("- ins: %d",ch->ins); \ ImGui::Text("- vol: %.2x",ch->vol); \ + ImGui::Text("- outVol: %.2x",ch->outVol); \ ImGui::TextColored(ch->active?colorOn:colorOff,">> Active"); \ ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged"); \ ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged"); \ @@ -286,6 +288,7 @@ ImGui::Text("- portaPauseFreq: %d",ch->portaPauseFreq); \ ImGui::Text("- ins: %d",ch->ins); \ ImGui::Text("- vol: %.2x",ch->vol); \ + ImGui::Text("- outVol: %.2x",ch->outVol); \ ImGui::Text("- pan: %x",ch->pan); \ ImGui::TextColored(ch->active?colorOn:colorOff,">> Active"); \ ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged"); \ @@ -574,7 +577,9 @@ void putDispatchChan(void* data, int chanNum, int type) { if (chanNum>8) { SMS_CHAN_DEBUG; } else if (chanNum>=2 && chanNum<=5) { - GENESIS_OPCHAN_DEBUG + DivPlatformOPN::OPNOpChannelStereo* ch=(DivPlatformOPN::OPNOpChannelStereo*)data; + ImGui::Text("> YM2612 (per operator)"); + OPNB_OPCHAN_DEBUG; } else { GENESIS_CHAN_DEBUG; } @@ -588,7 +593,9 @@ void putDispatchChan(void* data, int chanNum, int type) { case DIV_SYSTEM_YM2612_EXT: case DIV_SYSTEM_YM2612_FRAC_EXT: { if (chanNum>=2 && chanNum<=5) { - GENESIS_OPCHAN_DEBUG + DivPlatformOPN::OPNOpChannelStereo* ch=(DivPlatformOPN::OPNOpChannelStereo*)data; + ImGui::Text("> YM2612 (per operator)"); + OPNB_OPCHAN_DEBUG; } else { GENESIS_CHAN_DEBUG; } @@ -611,18 +618,18 @@ void putDispatchChan(void* data, int chanNum, int type) { break; } case DIV_SYSTEM_PC98: { - DivPlatformYM2608::Channel* ch=(DivPlatformYM2608::Channel*)data; + DivPlatformOPN::OPNChannelStereo* ch=(DivPlatformOPN::OPNChannelStereo*)data; ImGui::Text("> YM2608"); OPNB_CHAN_DEBUG; break; } case DIV_SYSTEM_PC98_EXT: { if (chanNum>=2 && chanNum<=5) { - DivPlatformYM2608Ext::OpChannel* ch=(DivPlatformYM2608Ext::OpChannel*)data; + DivPlatformOPN::OPNOpChannelStereo* ch=(DivPlatformOPN::OPNOpChannelStereo*)data; ImGui::Text("> YM2608 (per operator)"); OPNB_OPCHAN_DEBUG; } else { - DivPlatformYM2608Ext::Channel* ch=(DivPlatformYM2608Ext::Channel*)data; + DivPlatformOPN::OPNChannelStereo* ch=(DivPlatformOPN::OPNChannelStereo*)data; ImGui::Text("> YM2608"); OPNB_CHAN_DEBUG; } @@ -630,13 +637,13 @@ void putDispatchChan(void* data, int chanNum, int type) { } case DIV_SYSTEM_YM2610: case DIV_SYSTEM_YM2610_FULL: { - DivPlatformYM2610::Channel* ch=(DivPlatformYM2610::Channel*)data; + DivPlatformOPN::OPNChannelStereo* ch=(DivPlatformOPN::OPNChannelStereo*)data; ImGui::Text("> YM2610"); OPNB_CHAN_DEBUG; break; } case DIV_SYSTEM_YM2610B: { - DivPlatformYM2610B::Channel* ch=(DivPlatformYM2610B::Channel*)data; + DivPlatformOPN::OPNChannelStereo* ch=(DivPlatformOPN::OPNChannelStereo*)data; ImGui::Text("> YM2610B"); OPNB_CHAN_DEBUG; break; @@ -644,11 +651,11 @@ void putDispatchChan(void* data, int chanNum, int type) { case DIV_SYSTEM_YM2610_EXT: case DIV_SYSTEM_YM2610_FULL_EXT: { if (chanNum>=1 && chanNum<=4) { - DivPlatformYM2610Ext::OpChannel* ch=(DivPlatformYM2610Ext::OpChannel*)data; + DivPlatformOPN::OPNOpChannelStereo* ch=(DivPlatformOPN::OPNOpChannelStereo*)data; ImGui::Text("> YM2610 (per operator)"); OPNB_OPCHAN_DEBUG; } else { - DivPlatformYM2610Ext::Channel* ch=(DivPlatformYM2610Ext::Channel*)data; + DivPlatformOPN::OPNChannelStereo* ch=(DivPlatformOPN::OPNChannelStereo*)data; ImGui::Text("> YM2610"); OPNB_CHAN_DEBUG; } @@ -656,11 +663,11 @@ void putDispatchChan(void* data, int chanNum, int type) { } case DIV_SYSTEM_YM2610B_EXT: { if (chanNum>=2 && chanNum<=5) { - DivPlatformYM2610BExt::OpChannel* ch=(DivPlatformYM2610BExt::OpChannel*)data; + DivPlatformOPN::OPNOpChannelStereo* ch=(DivPlatformOPN::OPNOpChannelStereo*)data; ImGui::Text("> YM2610B (per operator)"); OPNB_OPCHAN_DEBUG; } else { - DivPlatformYM2610BExt::Channel* ch=(DivPlatformYM2610BExt::Channel*)data; + DivPlatformOPN::OPNChannelStereo* ch=(DivPlatformOPN::OPNChannelStereo*)data; ImGui::Text("> YM2610B"); OPNB_CHAN_DEBUG; } diff --git a/src/gui/sysConf.cpp b/src/gui/sysConf.cpp index 170e2d8b..d3e553e3 100644 --- a/src/gui/sysConf.cpp +++ b/src/gui/sysConf.cpp @@ -17,6 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "../chip-utils.h" #include "gui.h" #include "misc/cpp/imgui_stdlib.h" #include @@ -1575,19 +1576,19 @@ bool FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool mo if (supportsCustomRate) { ImGui::Separator(); int customClock=flags.getInt("customClock",0); - bool usingCustomClock=customClock>=100000; + bool usingCustomClock=customClock>=MIN_CUSTOM_CLOCK; if (ImGui::Checkbox("Custom clock rate",&usingCustomClock)) { if (usingCustomClock) { - customClock=1000000; + customClock=MIN_CUSTOM_CLOCK; } else { customClock=0; } altered=true; } if (ImGui::InputInt("Hz",&customClock)) { - if (customClock<100000) customClock=0; - if (customClock>20000000) customClock=20000000; + if (customClockMAX_CUSTOM_CLOCK) customClock=MAX_CUSTOM_CLOCK; altered=true; } From 18b87dcfafc314ced8c5cf051cb230a66ec16f6d Mon Sep 17 00:00:00 2001 From: cam900 Date: Sun, 4 Dec 2022 20:02:59 +0900 Subject: [PATCH 02/26] Fix build --- src/engine/dispatch.h | 4 ++-- src/engine/platform/abstract.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/engine/dispatch.h b/src/engine/dispatch.h index 2399eb35..02dfefd1 100644 --- a/src/engine/dispatch.h +++ b/src/engine/dispatch.h @@ -458,13 +458,13 @@ class DivDispatch { * get minimum chip clock. * @return clock in Hz, or 0 if custom clocks are not supported. */ - virtual unsigned int getClockRangeMin(); + virtual int getClockRangeMin(); /** * get maximum chip clock. * @return clock in Hz, or 0 if custom clocks are not supported. */ - virtual unsigned int getClockRangeMax(); + virtual int getClockRangeMax(); /** * set the chip flags. diff --git a/src/engine/platform/abstract.cpp b/src/engine/platform/abstract.cpp index 28974062..bd56efb8 100644 --- a/src/engine/platform/abstract.cpp +++ b/src/engine/platform/abstract.cpp @@ -97,11 +97,11 @@ bool DivDispatch::getWantPreNote() { return false; } -unsigned int DivDispatch::getClockRangeMin() { +int DivDispatch::getClockRangeMin() { return MIN_CUSTOM_CLOCK; } -unsigned int DivDispatch::getClockRangeMax() { +int DivDispatch::getClockRangeMax() { return MAX_CUSTOM_CLOCK; } From 47574fdede7be644b65477a6eafabae8c29be930 Mon Sep 17 00:00:00 2001 From: cam900 Date: Sun, 4 Dec 2022 20:06:16 +0900 Subject: [PATCH 03/26] Move file into engine --- src/{chip-utils.h => engine/chipUtils.h} | 0 src/engine/dispatch.h | 2 +- src/gui/sysConf.cpp | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename src/{chip-utils.h => engine/chipUtils.h} (100%) diff --git a/src/chip-utils.h b/src/engine/chipUtils.h similarity index 100% rename from src/chip-utils.h rename to src/engine/chipUtils.h diff --git a/src/engine/dispatch.h b/src/engine/dispatch.h index 02dfefd1..6a13689c 100644 --- a/src/engine/dispatch.h +++ b/src/engine/dispatch.h @@ -24,7 +24,7 @@ #include #include #include "config.h" -#include "../chip-utils.h" +#include "chipUtils.h" #define ONE_SEMITONE 2200 diff --git a/src/gui/sysConf.cpp b/src/gui/sysConf.cpp index d3e553e3..4025682a 100644 --- a/src/gui/sysConf.cpp +++ b/src/gui/sysConf.cpp @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "../chip-utils.h" +#include "../engine/chipUtils.h" #include "gui.h" #include "misc/cpp/imgui_stdlib.h" #include From 5da139ec82772827b77127e7cc93c92068fbd30f Mon Sep 17 00:00:00 2001 From: cam900 Date: Sun, 4 Dec 2022 21:08:13 +0900 Subject: [PATCH 04/26] Fix build --- src/engine/platform/arcade.h | 5 +---- src/engine/platform/fmsharedbase.h | 3 +++ src/engine/platform/tx81z.h | 5 +---- src/engine/platform/ym2203.h | 5 +---- src/engine/platform/ym2203ext.h | 2 -- src/engine/platform/ym2608.h | 4 +--- src/engine/platform/ym2608ext.h | 2 -- src/engine/platform/ym2610.h | 3 --- src/engine/platform/ym2610b.h | 3 --- src/engine/platform/ym2610bext.h | 2 -- src/engine/platform/ym2610ext.h | 2 -- 11 files changed, 7 insertions(+), 29 deletions(-) diff --git a/src/engine/platform/arcade.h b/src/engine/platform/arcade.h index e2e84b4d..77924ab6 100644 --- a/src/engine/platform/arcade.h +++ b/src/engine/platform/arcade.h @@ -60,10 +60,7 @@ class DivPlatformArcade: public DivPlatformOPM { void acquire_nuked(short* bufL, short* bufR, size_t start, size_t len); void acquire_ymfm(short* bufL, short* bufR, size_t start, size_t len); - - friend void putDispatchChip(void*,int); - friend void putDispatchChan(void*,int,int); - + public: void acquire(short* bufL, short* bufR, size_t start, size_t len); int dispatch(DivCommand c); diff --git a/src/engine/platform/fmsharedbase.h b/src/engine/platform/fmsharedbase.h index 1e1722f9..76413952 100644 --- a/src/engine/platform/fmsharedbase.h +++ b/src/engine/platform/fmsharedbase.h @@ -123,6 +123,9 @@ class DivPlatformFMBase: public DivDispatch { } } + friend void putDispatchChip(void*,int); + friend void putDispatchChan(void*,int,int); + DivPlatformFMBase(): DivDispatch(), lastBusy(0), diff --git a/src/engine/platform/tx81z.h b/src/engine/platform/tx81z.h index 6c7b495c..943cc023 100644 --- a/src/engine/platform/tx81z.h +++ b/src/engine/platform/tx81z.h @@ -56,10 +56,7 @@ class DivPlatformTX81Z: public DivPlatformOPM { int octave(int freq); int toFreq(int freq); - - friend void putDispatchChip(void*,int); - friend void putDispatchChan(void*,int,int); - + public: void acquire(short* bufL, short* bufR, size_t start, size_t len); int dispatch(DivCommand c); diff --git a/src/engine/platform/ym2203.h b/src/engine/platform/ym2203.h index ca129795..4125e3a4 100644 --- a/src/engine/platform/ym2203.h +++ b/src/engine/platform/ym2203.h @@ -50,10 +50,7 @@ class DivPlatformYM2203: public DivPlatformOPN { bool extMode, noExtMacros; unsigned char prescale; - - friend void putDispatchChip(void*,int); - friend void putDispatchChan(void*,int,int); - + public: void acquire(short* bufL, short* bufR, size_t start, size_t len); int dispatch(DivCommand c); diff --git a/src/engine/platform/ym2203ext.h b/src/engine/platform/ym2203ext.h index c7a729a0..63ba2c35 100644 --- a/src/engine/platform/ym2203ext.h +++ b/src/engine/platform/ym2203ext.h @@ -24,8 +24,6 @@ class DivPlatformYM2203Ext: public DivPlatformYM2203 { OPNOpChannel opChan[4]; bool isOpMuted[4]; - friend void putDispatchChip(void*,int); - friend void putDispatchChan(void*,int,int); public: int dispatch(DivCommand c); void* getChanState(int chan); diff --git a/src/engine/platform/ym2608.h b/src/engine/platform/ym2608.h index 48317f24..6e285c01 100644 --- a/src/engine/platform/ym2608.h +++ b/src/engine/platform/ym2608.h @@ -65,9 +65,7 @@ class DivPlatformYM2608: public DivPlatformOPN { double NOTE_OPNB(int ch, int note); double NOTE_ADPCMB(int note); - friend void putDispatchChip(void*,int); - friend void putDispatchChan(void*,int,int); - + public: void acquire(short* bufL, short* bufR, size_t start, size_t len); int dispatch(DivCommand c); diff --git a/src/engine/platform/ym2608ext.h b/src/engine/platform/ym2608ext.h index 45cbb292..58840528 100644 --- a/src/engine/platform/ym2608ext.h +++ b/src/engine/platform/ym2608ext.h @@ -24,8 +24,6 @@ class DivPlatformYM2608Ext: public DivPlatformYM2608 { OPNOpChannelStereo opChan[4]; bool isOpMuted[4]; - friend void putDispatchChip(void*,int); - friend void putDispatchChan(void*,int,int); public: int dispatch(DivCommand c); void* getChanState(int chan); diff --git a/src/engine/platform/ym2610.h b/src/engine/platform/ym2610.h index 1572b4a2..1b6edb9f 100644 --- a/src/engine/platform/ym2610.h +++ b/src/engine/platform/ym2610.h @@ -35,9 +35,6 @@ class DivPlatformYM2610: public DivPlatformYM2610Base<14> { 1, 2, 4, 5 }; - friend void putDispatchChip(void*,int); - friend void putDispatchChan(void*,int,int); - public: void acquire(short* bufL, short* bufR, size_t start, size_t len); int dispatch(DivCommand c); diff --git a/src/engine/platform/ym2610b.h b/src/engine/platform/ym2610b.h index 1fba7061..2db90d9a 100644 --- a/src/engine/platform/ym2610b.h +++ b/src/engine/platform/ym2610b.h @@ -31,9 +31,6 @@ class DivPlatformYM2610B: public DivPlatformYM2610Base<16> { 0, 1, 2, 4, 5, 6 }; - friend void putDispatchChip(void*,int); - friend void putDispatchChan(void*,int,int); - public: void acquire(short* bufL, short* bufR, size_t start, size_t len); int dispatch(DivCommand c); diff --git a/src/engine/platform/ym2610bext.h b/src/engine/platform/ym2610bext.h index 80910cde..6c1f31a3 100644 --- a/src/engine/platform/ym2610bext.h +++ b/src/engine/platform/ym2610bext.h @@ -24,8 +24,6 @@ class DivPlatformYM2610BExt: public DivPlatformYM2610B { OPNOpChannelStereo opChan[4]; bool isOpMuted[4]; - friend void putDispatchChip(void*,int); - friend void putDispatchChan(void*,int,int); public: int dispatch(DivCommand c); void* getChanState(int chan); diff --git a/src/engine/platform/ym2610ext.h b/src/engine/platform/ym2610ext.h index 6e88d05c..a1810746 100644 --- a/src/engine/platform/ym2610ext.h +++ b/src/engine/platform/ym2610ext.h @@ -24,8 +24,6 @@ class DivPlatformYM2610Ext: public DivPlatformYM2610 { OPNOpChannelStereo opChan[4]; bool isOpMuted[4]; - friend void putDispatchChip(void*,int); - friend void putDispatchChan(void*,int,int); public: int dispatch(DivCommand c); void* getChanState(int chan); From b8a5d27a4facfaa453cd59b332c1692c59ec2540 Mon Sep 17 00:00:00 2001 From: cam900 Date: Sun, 4 Dec 2022 21:11:57 +0900 Subject: [PATCH 05/26] Fix debug build --- src/engine/platform/arcade.h | 2 ++ src/engine/platform/fmsharedbase.h | 1 - src/engine/platform/tx81z.h | 1 + src/engine/platform/ym2203.h | 1 + src/engine/platform/ym2203ext.h | 1 + src/engine/platform/ym2608.h | 1 + src/engine/platform/ym2608ext.h | 1 + src/engine/platform/ym2610.h | 1 + src/engine/platform/ym2610b.h | 1 + src/engine/platform/ym2610bext.h | 1 + src/engine/platform/ym2610ext.h | 1 + src/gui/debug.cpp | 1 + 12 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/engine/platform/arcade.h b/src/engine/platform/arcade.h index 77924ab6..f8c66aca 100644 --- a/src/engine/platform/arcade.h +++ b/src/engine/platform/arcade.h @@ -61,6 +61,8 @@ class DivPlatformArcade: public DivPlatformOPM { void acquire_nuked(short* bufL, short* bufR, size_t start, size_t len); void acquire_ymfm(short* bufL, short* bufR, size_t start, size_t len); + friend void putDispatchChan(void*,int,int); + friend void putDispatchChip(void*,int); public: void acquire(short* bufL, short* bufR, size_t start, size_t len); int dispatch(DivCommand c); diff --git a/src/engine/platform/fmsharedbase.h b/src/engine/platform/fmsharedbase.h index 76413952..e5cf4c35 100644 --- a/src/engine/platform/fmsharedbase.h +++ b/src/engine/platform/fmsharedbase.h @@ -123,7 +123,6 @@ class DivPlatformFMBase: public DivDispatch { } } - friend void putDispatchChip(void*,int); friend void putDispatchChan(void*,int,int); DivPlatformFMBase(): diff --git a/src/engine/platform/tx81z.h b/src/engine/platform/tx81z.h index 943cc023..07338725 100644 --- a/src/engine/platform/tx81z.h +++ b/src/engine/platform/tx81z.h @@ -57,6 +57,7 @@ class DivPlatformTX81Z: public DivPlatformOPM { int octave(int freq); int toFreq(int freq); + friend void putDispatchChip(void*,int); public: void acquire(short* bufL, short* bufR, size_t start, size_t len); int dispatch(DivCommand c); diff --git a/src/engine/platform/ym2203.h b/src/engine/platform/ym2203.h index 4125e3a4..3bb3d8e6 100644 --- a/src/engine/platform/ym2203.h +++ b/src/engine/platform/ym2203.h @@ -51,6 +51,7 @@ class DivPlatformYM2203: public DivPlatformOPN { bool extMode, noExtMacros; unsigned char prescale; + friend void putDispatchChip(void*,int); public: void acquire(short* bufL, short* bufR, size_t start, size_t len); int dispatch(DivCommand c); diff --git a/src/engine/platform/ym2203ext.h b/src/engine/platform/ym2203ext.h index 63ba2c35..37aba220 100644 --- a/src/engine/platform/ym2203ext.h +++ b/src/engine/platform/ym2203ext.h @@ -24,6 +24,7 @@ class DivPlatformYM2203Ext: public DivPlatformYM2203 { OPNOpChannel opChan[4]; bool isOpMuted[4]; + friend void putDispatchChip(void*,int); public: int dispatch(DivCommand c); void* getChanState(int chan); diff --git a/src/engine/platform/ym2608.h b/src/engine/platform/ym2608.h index 6e285c01..29215820 100644 --- a/src/engine/platform/ym2608.h +++ b/src/engine/platform/ym2608.h @@ -66,6 +66,7 @@ class DivPlatformYM2608: public DivPlatformOPN { double NOTE_OPNB(int ch, int note); double NOTE_ADPCMB(int note); + friend void putDispatchChip(void*,int); public: void acquire(short* bufL, short* bufR, size_t start, size_t len); int dispatch(DivCommand c); diff --git a/src/engine/platform/ym2608ext.h b/src/engine/platform/ym2608ext.h index 58840528..30d9644d 100644 --- a/src/engine/platform/ym2608ext.h +++ b/src/engine/platform/ym2608ext.h @@ -24,6 +24,7 @@ class DivPlatformYM2608Ext: public DivPlatformYM2608 { OPNOpChannelStereo opChan[4]; bool isOpMuted[4]; + friend void putDispatchChip(void*,int); public: int dispatch(DivCommand c); void* getChanState(int chan); diff --git a/src/engine/platform/ym2610.h b/src/engine/platform/ym2610.h index 1b6edb9f..6139f6d5 100644 --- a/src/engine/platform/ym2610.h +++ b/src/engine/platform/ym2610.h @@ -35,6 +35,7 @@ class DivPlatformYM2610: public DivPlatformYM2610Base<14> { 1, 2, 4, 5 }; + friend void putDispatchChip(void*,int); public: void acquire(short* bufL, short* bufR, size_t start, size_t len); int dispatch(DivCommand c); diff --git a/src/engine/platform/ym2610b.h b/src/engine/platform/ym2610b.h index 2db90d9a..2981b1ca 100644 --- a/src/engine/platform/ym2610b.h +++ b/src/engine/platform/ym2610b.h @@ -31,6 +31,7 @@ class DivPlatformYM2610B: public DivPlatformYM2610Base<16> { 0, 1, 2, 4, 5, 6 }; + friend void putDispatchChip(void*,int); public: void acquire(short* bufL, short* bufR, size_t start, size_t len); int dispatch(DivCommand c); diff --git a/src/engine/platform/ym2610bext.h b/src/engine/platform/ym2610bext.h index 6c1f31a3..609bf5e9 100644 --- a/src/engine/platform/ym2610bext.h +++ b/src/engine/platform/ym2610bext.h @@ -24,6 +24,7 @@ class DivPlatformYM2610BExt: public DivPlatformYM2610B { OPNOpChannelStereo opChan[4]; bool isOpMuted[4]; + friend void putDispatchChip(void*,int); public: int dispatch(DivCommand c); void* getChanState(int chan); diff --git a/src/engine/platform/ym2610ext.h b/src/engine/platform/ym2610ext.h index a1810746..676f355f 100644 --- a/src/engine/platform/ym2610ext.h +++ b/src/engine/platform/ym2610ext.h @@ -24,6 +24,7 @@ class DivPlatformYM2610Ext: public DivPlatformYM2610 { OPNOpChannelStereo opChan[4]; bool isOpMuted[4]; + friend void putDispatchChip(void*,int); public: int dispatch(DivCommand c); void* getChanState(int chan); diff --git a/src/gui/debug.cpp b/src/gui/debug.cpp index 4d201d54..80d5e2cc 100644 --- a/src/gui/debug.cpp +++ b/src/gui/debug.cpp @@ -19,6 +19,7 @@ #include "debug.h" #include "imgui.h" +#include "../engine/platform/fmsharedbase.h" #include "../engine/platform/genesis.h" #include "../engine/platform/genesisext.h" #include "../engine/platform/sms.h" From d5f4e701e8aa74264e2688dee9b61595ea4cb31f Mon Sep 17 00:00:00 2001 From: cam900 Date: Sun, 4 Dec 2022 21:18:23 +0900 Subject: [PATCH 06/26] Fix build --- src/engine/platform/fmshared_OPN.h | 1 + src/engine/platform/genesis.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/engine/platform/fmshared_OPN.h b/src/engine/platform/fmshared_OPN.h index d2191301..b1bd96db 100644 --- a/src/engine/platform/fmshared_OPN.h +++ b/src/engine/platform/fmshared_OPN.h @@ -156,6 +156,7 @@ class DivPlatformOPN: public DivPlatformFMBase { DivConfig ayFlags; + friend void putDispatchChip(void*,int); DivPlatformOPN(double f=9440540.0, unsigned int d=72, unsigned int a=32, bool isExtSys=false): DivPlatformFMBase(), fmFreqBase(f), diff --git a/src/engine/platform/genesis.h b/src/engine/platform/genesis.h index 53a6eada..e126db58 100644 --- a/src/engine/platform/genesis.h +++ b/src/engine/platform/genesis.h @@ -90,6 +90,7 @@ class DivPlatformGenesis: public DivPlatformOPN { void acquire_nuked(short* bufL, short* bufR, size_t start, size_t len); void acquire_ymfm(short* bufL, short* bufR, size_t start, size_t len); + friend void putDispatchChip(void*,int); public: void acquire(short* bufL, short* bufR, size_t start, size_t len); void fillStream(std::vector& stream, int sRate, size_t len); From e1e5b0917ca0ab3d95a5c6f99aea090bb7df7c2d Mon Sep 17 00:00:00 2001 From: cam900 Date: Sun, 4 Dec 2022 21:22:09 +0900 Subject: [PATCH 07/26] Fix build --- src/engine/platform/genesis.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/engine/platform/genesis.h b/src/engine/platform/genesis.h index e126db58..3979b1b5 100644 --- a/src/engine/platform/genesis.h +++ b/src/engine/platform/genesis.h @@ -91,6 +91,7 @@ class DivPlatformGenesis: public DivPlatformOPN { void acquire_ymfm(short* bufL, short* bufR, size_t start, size_t len); friend void putDispatchChip(void*,int); + friend void putDispatchChan(void*,int,int); public: void acquire(short* bufL, short* bufR, size_t start, size_t len); void fillStream(std::vector& stream, int sRate, size_t len); From 4db187cafad73c79c1a9af44184c81bd20203796 Mon Sep 17 00:00:00 2001 From: cam900 Date: Sun, 4 Dec 2022 22:15:43 +0900 Subject: [PATCH 08/26] Fix build --- src/engine/platform/fmshared_OPN.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/engine/platform/fmshared_OPN.h b/src/engine/platform/fmshared_OPN.h index b1bd96db..0c0d0457 100644 --- a/src/engine/platform/fmshared_OPN.h +++ b/src/engine/platform/fmshared_OPN.h @@ -157,6 +157,7 @@ class DivPlatformOPN: public DivPlatformFMBase { DivConfig ayFlags; friend void putDispatchChip(void*,int); + friend void putDispatchChan(void*,int,int); DivPlatformOPN(double f=9440540.0, unsigned int d=72, unsigned int a=32, bool isExtSys=false): DivPlatformFMBase(), fmFreqBase(f), From c561ceceaf81eb836ac7036e6660f722bdaac8ca Mon Sep 17 00:00:00 2001 From: cam900 Date: Sun, 11 Dec 2022 04:32:51 +0900 Subject: [PATCH 09/26] Add tooltips in GUI, enum-ize piano mode/Special notes --- src/gui/dataList.cpp | 69 ++++++++++++++++++++++++ src/gui/editControls.cpp | 111 +++++++++++++++++++++++++++++++++++++++ src/gui/gui.cpp | 14 ++--- src/gui/gui.h | 21 ++++++++ src/gui/insEdit.cpp | 6 +++ src/gui/piano.cpp | 73 ++++++++++++++++++------- src/gui/sampleEdit.cpp | 6 +++ src/gui/subSongs.cpp | 12 +++++ src/gui/waveEdit.cpp | 6 +++ 9 files changed, 291 insertions(+), 27 deletions(-) diff --git a/src/gui/dataList.cpp b/src/gui/dataList.cpp index 81ceeb2c..455bf794 100644 --- a/src/gui/dataList.cpp +++ b/src/gui/dataList.cpp @@ -47,6 +47,9 @@ void FurnaceGUI::drawInsList(bool asChild) { if (ImGui::Button(ICON_FA_PLUS "##InsAdd")) { if (!settings.unifiedDataView) doAction(GUI_ACTION_INS_LIST_ADD); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Add"); + } if (settings.unifiedDataView) { if (ImGui::BeginPopupContextItem("UnifiedAdd",ImGuiMouseButton_Left)) { if (ImGui::MenuItem("instrument")) { @@ -70,6 +73,9 @@ void FurnaceGUI::drawInsList(bool asChild) { if (ImGui::Button(ICON_FA_FILES_O "##InsClone")) { if (!settings.unifiedDataView) doAction(GUI_ACTION_INS_LIST_DUPLICATE); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Duplicate"); + } if (settings.unifiedDataView) { if (ImGui::BeginPopupContextItem("UnifiedClone",ImGuiMouseButton_Left)) { if (ImGui::MenuItem("instrument")) { @@ -88,6 +94,9 @@ void FurnaceGUI::drawInsList(bool asChild) { if (ImGui::Button(ICON_FA_FOLDER_OPEN "##InsLoad")) { if (!settings.unifiedDataView) doAction(GUI_ACTION_INS_LIST_OPEN); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Load"); + } if (settings.unifiedDataView) { if (ImGui::BeginPopupContextItem("UnifiedLoad",ImGuiMouseButton_Left)) { if (ImGui::MenuItem("instrument")) { @@ -127,6 +136,9 @@ void FurnaceGUI::drawInsList(bool asChild) { if (ImGui::Button(ICON_FA_FLOPPY_O "##InsSave")) { if (!settings.unifiedDataView) doAction(GUI_ACTION_INS_LIST_SAVE); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Save"); + } if (settings.unifiedDataView) { if (ImGui::BeginPopupContextItem("UnifiedSave",ImGuiMouseButton_Left)) { if (ImGui::MenuItem("instrument")) { @@ -166,15 +178,24 @@ void FurnaceGUI::drawInsList(bool asChild) { if (ImGui::ArrowButton("InsUp",ImGuiDir_Up)) { doAction(GUI_ACTION_INS_LIST_MOVE_UP); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Move up"); + } ImGui::SameLine(); if (ImGui::ArrowButton("InsDown",ImGuiDir_Down)) { doAction(GUI_ACTION_INS_LIST_MOVE_DOWN); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Move down"); + } } ImGui::SameLine(); if (ImGui::Button(ICON_FA_TIMES "##InsDelete")) { if (!settings.unifiedDataView) doAction(GUI_ACTION_INS_LIST_DELETE); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Delete"); + } if (settings.unifiedDataView) { if (ImGui::BeginPopupContextItem("UnifiedDelete",ImGuiMouseButton_Left)) { if (ImGui::MenuItem("instrument")) { @@ -521,14 +542,23 @@ void FurnaceGUI::drawWaveList(bool asChild) { if (ImGui::Button(ICON_FA_PLUS "##WaveAdd")) { doAction(GUI_ACTION_WAVE_LIST_ADD); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Add"); + } ImGui::SameLine(); if (ImGui::Button(ICON_FA_FILES_O "##WaveClone")) { doAction(GUI_ACTION_WAVE_LIST_DUPLICATE); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Duplicate"); + } ImGui::SameLine(); if (ImGui::Button(ICON_FA_FOLDER_OPEN "##WaveLoad")) { doAction(GUI_ACTION_WAVE_LIST_OPEN); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Load"); + } if (ImGui::BeginPopupContextItem("WaveOpenOpt")) { if (ImGui::MenuItem("replace...")) { doAction((curWave>=0 && curWave<(int)e->song.wave.size())?GUI_ACTION_WAVE_LIST_OPEN_REPLACE:GUI_ACTION_WAVE_LIST_OPEN); @@ -539,6 +569,9 @@ void FurnaceGUI::drawWaveList(bool asChild) { if (ImGui::Button(ICON_FA_FLOPPY_O "##WaveSave")) { doAction(GUI_ACTION_WAVE_LIST_SAVE); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Save"); + } if (!settings.unifiedDataView) { if (ImGui::BeginPopupContextItem("WaveSaveFormats",ImGuiMouseButton_Right)) { if (ImGui::MenuItem("save as .dmw...")) { @@ -554,14 +587,23 @@ void FurnaceGUI::drawWaveList(bool asChild) { if (ImGui::ArrowButton("WaveUp",ImGuiDir_Up)) { doAction(GUI_ACTION_WAVE_LIST_MOVE_UP); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Move up"); + } ImGui::SameLine(); if (ImGui::ArrowButton("WaveDown",ImGuiDir_Down)) { doAction(GUI_ACTION_WAVE_LIST_MOVE_DOWN); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Move down"); + } ImGui::SameLine(); if (ImGui::Button(ICON_FA_TIMES "##WaveDelete")) { doAction(GUI_ACTION_WAVE_LIST_DELETE); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Delete"); + } ImGui::Separator(); if (ImGui::BeginTable("WaveListScroll",1,ImGuiTableFlags_ScrollY)) { actualWaveList(); @@ -598,14 +640,23 @@ void FurnaceGUI::drawSampleList(bool asChild) { if (ImGui::Button(ICON_FA_FILE "##SampleAdd")) { doAction(GUI_ACTION_SAMPLE_LIST_ADD); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Add"); + } ImGui::SameLine(); if (ImGui::Button(ICON_FA_FILES_O "##SampleClone")) { doAction(GUI_ACTION_SAMPLE_LIST_DUPLICATE); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Duplicate"); + } ImGui::SameLine(); if (ImGui::Button(ICON_FA_FOLDER_OPEN "##SampleLoad")) { doAction(GUI_ACTION_SAMPLE_LIST_OPEN); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Load"); + } if (ImGui::BeginPopupContextItem("SampleOpenOpt")) { if (ImGui::MenuItem("replace...")) { doAction((curSample>=0 && curSample<(int)e->song.sample.size())?GUI_ACTION_SAMPLE_LIST_OPEN_REPLACE:GUI_ACTION_SAMPLE_LIST_OPEN); @@ -623,26 +674,44 @@ void FurnaceGUI::drawSampleList(bool asChild) { if (ImGui::Button(ICON_FA_FLOPPY_O "##SampleSave")) { doAction(GUI_ACTION_SAMPLE_LIST_SAVE); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Save"); + } ImGui::SameLine(); if (ImGui::ArrowButton("SampleUp",ImGuiDir_Up)) { doAction(GUI_ACTION_SAMPLE_LIST_MOVE_UP); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Move up"); + } ImGui::SameLine(); if (ImGui::ArrowButton("SampleDown",ImGuiDir_Down)) { doAction(GUI_ACTION_SAMPLE_LIST_MOVE_DOWN); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Move down"); + } ImGui::SameLine(); if (ImGui::Button(ICON_FA_TIMES "##SampleDelete")) { doAction(GUI_ACTION_SAMPLE_LIST_DELETE); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Delete"); + } ImGui::SameLine(); if (ImGui::Button(ICON_FA_VOLUME_UP "##PreviewSampleL")) { doAction(GUI_ACTION_SAMPLE_LIST_PREVIEW); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Preview"); + } ImGui::SameLine(); if (ImGui::Button(ICON_FA_VOLUME_OFF "##StopSampleL")) { doAction(GUI_ACTION_SAMPLE_LIST_STOP_PREVIEW); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Stop preview"); + } ImGui::Separator(); if (ImGui::BeginTable("SampleListScroll",1,ImGuiTableFlags_ScrollY)) { actualSampleList(); diff --git a/src/gui/editControls.cpp b/src/gui/editControls.cpp index 19010e3d..7a38d2f5 100644 --- a/src/gui/editControls.cpp +++ b/src/gui/editControls.cpp @@ -188,16 +188,25 @@ void FurnaceGUI::drawMobileControls() { if (ImGui::Button(ICON_FA_PLAY "##Play",buttonSize)) { play(); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Play"); + } popToggleColors(); if (portrait) ImGui::SameLine(); if (ImGui::Button(ICON_FA_STOP "##Stop",buttonSize)) { stop(); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Stop"); + } if (portrait) ImGui::SameLine(); if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne",buttonSize)) { e->stepOne(cursor.y); pendingStepUpdate=true; } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Step 1 row"); + } bool repeatPattern=e->getRepeatPattern(); pushToggleColors(repeatPattern); @@ -205,6 +214,9 @@ void FurnaceGUI::drawMobileControls() { if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern",buttonSize)) { e->setRepeatPattern(!repeatPattern); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Repeat pattern"); + } popToggleColors(); pushToggleColors(edit); @@ -212,6 +224,9 @@ void FurnaceGUI::drawMobileControls() { if (ImGui::Button(ICON_FA_CIRCLE "##Edit",buttonSize)) { edit=!edit; } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Edit"); + } popToggleColors(); bool metro=e->getMetronome(); @@ -220,6 +235,9 @@ void FurnaceGUI::drawMobileControls() { if (ImGui::Button(ICON_FA_BELL_O "##Metronome",buttonSize)) { e->setMetronome(!metro); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Metronome"); + } popToggleColors(); } if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS; @@ -445,11 +463,17 @@ void FurnaceGUI::drawEditControls() { if (ImGui::Button(ICON_FA_PLAY "##Play")) { play(); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Play"); + } popToggleColors(); ImGui::SameLine(); if (ImGui::Button(ICON_FA_STOP "##Stop")) { stop(); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Stop"); + } ImGui::SameLine(); ImGui::Checkbox("Edit",&edit); ImGui::SameLine(); @@ -473,6 +497,9 @@ void FurnaceGUI::drawEditControls() { e->stepOne(cursor.y); pendingStepUpdate=true; } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Step 1 row"); + } ImGui::SameLine(); pushToggleColors(noteInputPoly); @@ -480,6 +507,9 @@ void FurnaceGUI::drawEditControls() { noteInputPoly=!noteInputPoly; e->setAutoNotePoly(noteInputPoly); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Polyphony"); + } popToggleColors(); } if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS; @@ -490,17 +520,26 @@ void FurnaceGUI::drawEditControls() { if (ImGui::Button(ICON_FA_STOP "##Stop")) { stop(); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Stop"); + } ImGui::SameLine(); pushToggleColors(e->isPlaying()); if (ImGui::Button(ICON_FA_PLAY "##Play")) { play(); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Play"); + } popToggleColors(); ImGui::SameLine(); if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) { e->stepOne(cursor.y); pendingStepUpdate=true; } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Step 1 row"); + } ImGui::SameLine(); bool repeatPattern=e->getRepeatPattern(); @@ -508,6 +547,9 @@ void FurnaceGUI::drawEditControls() { if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern")) { e->setRepeatPattern(!repeatPattern); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Repeat pattern"); + } popToggleColors(); ImGui::SameLine(); @@ -515,6 +557,9 @@ void FurnaceGUI::drawEditControls() { if (ImGui::Button(ICON_FA_CIRCLE "##Edit")) { edit=!edit; } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Edit"); + } popToggleColors(); ImGui::SameLine(); @@ -523,6 +568,9 @@ void FurnaceGUI::drawEditControls() { if (ImGui::Button(ICON_FA_BELL_O "##Metronome")) { e->setMetronome(!metro); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Metronome"); + } popToggleColors(); ImGui::SameLine(); @@ -565,6 +613,9 @@ void FurnaceGUI::drawEditControls() { noteInputPoly=!noteInputPoly; e->setAutoNotePoly(noteInputPoly); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Polyphony"); + } popToggleColors(); } if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS; @@ -577,26 +628,41 @@ void FurnaceGUI::drawEditControls() { if (ImGui::Button(ICON_FA_PLAY "##Play",buttonSize)) { play(); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Play"); + } popToggleColors(); if (ImGui::Button(ICON_FA_STOP "##Stop",buttonSize)) { stop(); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Stop"); + } if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne",buttonSize)) { e->stepOne(cursor.y); pendingStepUpdate=true; } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Step 1 row"); + } bool repeatPattern=e->getRepeatPattern(); pushToggleColors(repeatPattern); if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern",buttonSize)) { e->setRepeatPattern(!repeatPattern); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Repeat pattern"); + } popToggleColors(); pushToggleColors(edit); if (ImGui::Button(ICON_FA_CIRCLE "##Edit",buttonSize)) { edit=!edit; } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Edit"); + } popToggleColors(); bool metro=e->getMetronome(); @@ -604,9 +670,15 @@ void FurnaceGUI::drawEditControls() { if (ImGui::Button(ICON_FA_BELL_O "##Metronome",buttonSize)) { e->setMetronome(!metro); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Metronome"); + } popToggleColors(); ImGui::Text("Oct."); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Octave"); + } float avail=ImGui::GetContentRegionAvail().x; ImGui::SetNextItemWidth(avail); if (ImGui::InputInt("##Octave",&curOctave,0,0)) { @@ -631,15 +703,24 @@ void FurnaceGUI::drawEditControls() { } ImGui::Text("Foll."); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Follow"); + } pushToggleColors(followOrders); if (ImGui::Button("Ord##FollowOrders",buttonSize)) { handleUnimportant followOrders=!followOrders; } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Orders"); + } popToggleColors(); pushToggleColors(followPattern); if (ImGui::Button("Pat##FollowPattern",buttonSize)) { handleUnimportant followPattern=!followPattern; } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Pattern"); + } popToggleColors(); pushToggleColors(noteInputPoly); @@ -647,6 +728,9 @@ void FurnaceGUI::drawEditControls() { noteInputPoly=!noteInputPoly; e->setAutoNotePoly(noteInputPoly); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Polyphony"); + } popToggleColors(); } if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS; @@ -659,33 +743,51 @@ void FurnaceGUI::drawEditControls() { if (ImGui::Button(ICON_FA_STOP "##Stop")) { stop(); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Stop"); + } popToggleColors(); } else { if (ImGui::Button(ICON_FA_PLAY "##Play")) { play(oldRow); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Play"); + } } ImGui::SameLine(); if (ImGui::Button(ICON_FA_PLAY_CIRCLE "##PlayAgain")) { e->setRepeatPattern(false); play(); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Play from the beginning of this pattern"); + } ImGui::SameLine(); if (ImGui::Button(ICON_FA_STEP_FORWARD "##PlayRepeat")) { e->setRepeatPattern(true); play(); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Repeat from the beginning of this pattern"); + } ImGui::SameLine(); if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) { e->stepOne(cursor.y); pendingStepUpdate=true; } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Step 1 row"); + } ImGui::SameLine(); pushToggleColors(edit); if (ImGui::Button(ICON_FA_CIRCLE "##Edit")) { edit=!edit; } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Edit"); + } popToggleColors(); bool metro=e->getMetronome(); @@ -694,6 +796,9 @@ void FurnaceGUI::drawEditControls() { if (ImGui::Button(ICON_FA_BELL_O "##Metronome")) { e->setMetronome(!metro); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Metronome"); + } popToggleColors(); ImGui::SameLine(); @@ -702,6 +807,9 @@ void FurnaceGUI::drawEditControls() { if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern")) { e->setRepeatPattern(!repeatPattern); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Repeat pattern"); + } popToggleColors(); ImGui::SameLine(); @@ -710,6 +818,9 @@ void FurnaceGUI::drawEditControls() { noteInputPoly=!noteInputPoly; e->setAutoNotePoly(noteInputPoly); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Polyphony"); + } popToggleColors(); } if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS; diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 1487b50f..310f8add 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -1040,13 +1040,13 @@ void FurnaceGUI::noteInput(int num, int key, int vol) { prepareUndo(GUI_UNDO_PATTERN_EDIT); - if (key==100) { // note off + if (key==GUI_NOTE_OFF) { // note off pat->data[cursor.y][0]=100; pat->data[cursor.y][1]=0; - } else if (key==101) { // note off + env release + } else if (key==GUI_NOTE_OFF_RELEASE) { // note off + env release pat->data[cursor.y][0]=101; pat->data[cursor.y][1]=0; - } else if (key==102) { // env release only + } else if (key==GUI_NOTE_RELEASE) { // env release only pat->data[cursor.y][0]=102; pat->data[cursor.y][1]=0; } else { @@ -5979,8 +5979,8 @@ FurnaceGUI::FurnaceGUI(): pianoOptionsSet(false), pianoOffset(6), pianoOffsetEdit(9), - pianoView(2), - pianoInputPadMode(2), + pianoView(PIANO_LAYOUT_AUTOMATIC), + pianoInputPadMode(PIANO_INPUT_PAD_SPLIT_AUTO), #else pianoOctaves(7), pianoOctavesEdit(4), @@ -5988,8 +5988,8 @@ FurnaceGUI::FurnaceGUI(): pianoSharePosition(true), pianoOffset(6), pianoOffsetEdit(6), - pianoView(0), - pianoInputPadMode(0), + pianoView(PIANO_LAYOUT_STANDARD), + pianoInputPadMode(PIANO_INPUT_PAD_DISABLE), #endif hasACED(false), waveGenBaseShape(0), diff --git a/src/gui/gui.h b/src/gui/gui.h index e5e58985..dbdb26cc 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -653,6 +653,12 @@ enum PasteMode { GUI_PASTE_MODE_INS_BG }; +enum NoteCtrl { + GUI_NOTE_OFF=100, + GUI_NOTE_OFF_RELEASE=101, + GUI_NOTE_RELEASE=102 +}; + #define FURKMOD_CTRL (1U<<31) #define FURKMOD_SHIFT (1<<29) #define FURKMOD_META (1<<28) @@ -1677,6 +1683,21 @@ class FurnaceGUI { bool followLog; // piano + enum PianoLayoutMode { + PIANO_LAYOUT_STANDARD = 0, + PIANO_LAYOUT_CONTINUOUS, + PIANO_LAYOUT_AUTOMATIC, + PIANO_LAYOUT_MAX + }; + + enum PianoInputPadMode { + PIANO_INPUT_PAD_DISABLE = 0, + PIANO_INPUT_PAD_REPLACE, + PIANO_INPUT_PAD_SPLIT_AUTO, + PIANO_INPUT_PAD_SPLIT_VISIBLE, + PIANO_INPUT_PAD_MAX + }; + int pianoOctaves, pianoOctavesEdit; bool pianoOptions, pianoSharePosition, pianoOptionsSet; float pianoKeyHit[180]; diff --git a/src/gui/insEdit.cpp b/src/gui/insEdit.cpp index bf472751..5891008f 100644 --- a/src/gui/insEdit.cpp +++ b/src/gui/insEdit.cpp @@ -2166,10 +2166,16 @@ void FurnaceGUI::drawInsEdit() { if (ImGui::Button(ICON_FA_FOLDER_OPEN "##IELoad")) { doAction(GUI_ACTION_INS_LIST_OPEN_REPLACE); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Load"); + } ImGui::SameLine(); if (ImGui::Button(ICON_FA_FLOPPY_O "##IESave")) { doAction(GUI_ACTION_INS_LIST_SAVE); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Save"); + } if (ImGui::BeginPopupContextItem("InsSaveFormats",ImGuiMouseButton_Right)) { if (ImGui::MenuItem("save in legacy format...")) { doAction(GUI_ACTION_INS_LIST_SAVE_OLD); diff --git a/src/gui/piano.cpp b/src/gui/piano.cpp index 7f1360cc..6d80d5b4 100644 --- a/src/gui/piano.cpp +++ b/src/gui/piano.cpp @@ -63,7 +63,7 @@ void FurnaceGUI::drawPiano() { if (ImGui::BeginTable("PianoLayout",((pianoOptions && (!mobileUI || !portrait))?2:1),ImGuiTableFlags_BordersInnerV)) { int& off=(e->isPlaying() || pianoSharePosition)?pianoOffset:pianoOffsetEdit; int& oct=(e->isPlaying() || pianoSharePosition)?pianoOctaves:pianoOctavesEdit; - bool view=(pianoView==2)?(!e->isPlaying()):pianoView; + bool view=(pianoView==PIANO_LAYOUT_AUTOMATIC)?(!e->isPlaying()):pianoView; if (pianoOptions && (!mobileUI || !portrait)) { ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthFixed); } @@ -76,48 +76,63 @@ void FurnaceGUI::drawPiano() { ImVec2 optionSize=ImVec2((mobileUI && portrait)?((ImGui::GetContentRegionAvail().x-ImGui::GetStyle().ItemSpacing.x*5.0f)/6.0f):(1.2f*optionSizeY),optionSizeY); if (pianoOptionsSet) { if (ImGui::Button("OFF##PianoNOff",optionSize)) { - if (edit) noteInput(0,100); + if (edit) noteInput(0,GUI_NOTE_OFF); + } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Note Off"); } ImGui::SameLine(); if (ImGui::Button("===##PianoNRel",optionSize)) { - if (edit) noteInput(0,101); + if (edit) noteInput(0,GUI_NOTE_OFF_RELEASE); + } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Note Off + Release"); } } else { if (ImGui::Button(ICON_FA_ARROW_LEFT "##PianoLeft",optionSize)) { off--; if (off<0) off=0; } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Left scroll"); + } ImGui::SameLine(); if (ImGui::Button(ICON_FA_ARROW_RIGHT "##PianoRight",optionSize)) { off++; if ((off+oct)>14) off=15-oct; } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Right scroll"); + } } ImGui::SameLine(); ImGui::Button(ICON_FA_ELLIPSIS_V "##PianoOptions",optionSize); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Piano Options"); + } if (ImGui::BeginPopupContextItem("PianoOptions",ImGuiPopupFlags_MouseButtonLeft)) { ImGui::Text("Key layout:"); - if (ImGui::RadioButton("Automatic",pianoView==2)) { - pianoView=2; + if (ImGui::RadioButton("Automatic",pianoView==PIANO_LAYOUT_AUTOMATIC)) { + pianoView=PIANO_LAYOUT_AUTOMATIC; } - if (ImGui::RadioButton("Standard",pianoView==0)) { - pianoView=0; + if (ImGui::RadioButton("Standard",pianoView==PIANO_LAYOUT_STANDARD)) { + pianoView=PIANO_LAYOUT_STANDARD; } - if (ImGui::RadioButton("Continuous",pianoView==1)) { - pianoView=1; + if (ImGui::RadioButton("Continuous",pianoView==PIANO_LAYOUT_CONTINUOUS)) { + pianoView=PIANO_LAYOUT_CONTINUOUS; } ImGui::Text("Value input pad:"); - if (ImGui::RadioButton("Disabled",pianoInputPadMode==0)) { - pianoInputPadMode=0; + if (ImGui::RadioButton("Disabled",pianoInputPadMode==PIANO_INPUT_PAD_DISABLE)) { + pianoInputPadMode=PIANO_INPUT_PAD_DISABLE; } - if (ImGui::RadioButton("Replace piano",pianoInputPadMode==1)) { - pianoInputPadMode=1; + if (ImGui::RadioButton("Replace piano",pianoInputPadMode==PIANO_INPUT_PAD_REPLACE)) { + pianoInputPadMode=PIANO_INPUT_PAD_REPLACE; } - if (ImGui::RadioButton("Split (automatic)",pianoInputPadMode==2)) { - pianoInputPadMode=2; + if (ImGui::RadioButton("Split (automatic)",pianoInputPadMode==PIANO_INPUT_PAD_SPLIT_AUTO)) { + pianoInputPadMode=PIANO_INPUT_PAD_SPLIT_AUTO; } - if (ImGui::RadioButton("Split (always visible)",pianoInputPadMode==3)) { - pianoInputPadMode=3; + if (ImGui::RadioButton("Split (always visible)",pianoInputPadMode==PIANO_INPUT_PAD_SPLIT_VISIBLE)) { + pianoInputPadMode=PIANO_INPUT_PAD_SPLIT_VISIBLE; } ImGui::Checkbox("Share play/edit offset/range",&pianoSharePosition); ImGui::EndPopup(); @@ -129,28 +144,43 @@ void FurnaceGUI::drawPiano() { if (pianoOptionsSet) { if (ImGui::Button("REL##PianoNMRel",optionSize)) { - if (edit) noteInput(0,102); + if (edit) noteInput(0,GUI_NOTE_RELEASE); + } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Note Release"); } ImGui::SameLine(); if (ImGui::Button(ICON_FA_TIMES "##PianoDelP",optionSize)) { doDelete(); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Note Delete"); + } } else { if (ImGui::Button(ICON_FA_MINUS "##PianoOctaveDown",optionSize)) { oct--; if (oct<1) oct=1; } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Octave down"); + } ImGui::SameLine(); if (ImGui::Button(ICON_FA_PLUS "##PianoOctaveUp",optionSize)) { oct++; if (oct>15) oct=15; if ((off+oct)>14) off=15-oct; } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Octave up"); + } } ImGui::SameLine(); if (ImGui::Button(ICON_FA_ELLIPSIS_H "##PianoSel",optionSize)) { pianoOptionsSet=!pianoOptionsSet; } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(pianoOptionsSet?"Note Off/Release":"Scroll/Resize Piano"); + } } if (mobileUI && portrait) { @@ -158,7 +188,7 @@ void FurnaceGUI::drawPiano() { } ImGui::TableNextColumn(); - if (pianoInputPadMode==1 && cursor.xFine>0 && curWindow==GUI_WINDOW_PATTERN) { + if (pianoInputPadMode==PIANO_INPUT_PAD_REPLACE && cursor.xFine>0 && curWindow==GUI_WINDOW_PATTERN) { ImVec2 buttonSize=ImGui::GetContentRegionAvail(); if (ImGui::BeginTable("InputPadP",8,ImGuiTableFlags_SizingFixedSame)) { ImGui::TableNextRow(); @@ -431,7 +461,7 @@ void FurnaceGUI::drawPiano() { ImGui::End(); // draw input pad if necessary - if (curWindow==GUI_WINDOW_PATTERN && ((pianoInputPadMode==2 && cursor.xFine>0) || pianoInputPadMode==3)) { + if (curWindow==GUI_WINDOW_PATTERN && ((pianoInputPadMode==PIANO_INPUT_PAD_SPLIT_AUTO && cursor.xFine>0) || pianoInputPadMode==PIANO_INPUT_PAD_SPLIT_VISIBLE)) { if (ImGui::Begin("Input Pad",NULL,ImGuiWindowFlags_NoTitleBar)) { ImGui::BeginDisabled(cursor.xFine==0); if (ImGui::BeginTable("InputPad",3,ImGuiTableFlags_Borders)) { @@ -480,6 +510,9 @@ void FurnaceGUI::drawPiano() { if (ImGui::Button(ICON_FA_TIMES "##PianoDel",buttonSize)) { doDelete(); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Delete"); + } ImGui::TableNextColumn(); VALUE_DIGIT(0,"0"); ImGui::TableNextColumn(); diff --git a/src/gui/sampleEdit.cpp b/src/gui/sampleEdit.cpp index 6cc979ac..04941158 100644 --- a/src/gui/sampleEdit.cpp +++ b/src/gui/sampleEdit.cpp @@ -118,10 +118,16 @@ void FurnaceGUI::drawSampleEdit() { if (ImGui::Button(ICON_FA_FOLDER_OPEN "##SELoad")) { doAction(GUI_ACTION_SAMPLE_LIST_OPEN_REPLACE); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Load"); + } ImGui::SameLine(); if (ImGui::Button(ICON_FA_FLOPPY_O "##SESave")) { doAction(GUI_ACTION_SAMPLE_LIST_SAVE); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Save"); + } ImGui::SameLine(); diff --git a/src/gui/subSongs.cpp b/src/gui/subSongs.cpp index a6eb70f0..9801ab57 100644 --- a/src/gui/subSongs.cpp +++ b/src/gui/subSongs.cpp @@ -50,10 +50,16 @@ void FurnaceGUI::drawSubSongs() { if (ImGui::SmallButton(ICON_FA_ARROW_UP "##SubUp")) { e->moveSubSongUp(i); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Move up"); + } ImGui::SameLine(); if (ImGui::SmallButton(ICON_FA_ARROW_DOWN "##SubDown")) { e->moveSubSongDown(i); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Move down"); + } ImGui::PopID(); } ImGui::EndTable(); @@ -79,6 +85,9 @@ void FurnaceGUI::drawSubSongs() { MARK_MODIFIED; } } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Add"); + } ImGui::SameLine(); if (ImGui::Button(ICON_FA_MINUS "##SubSongDel")) { if (e->song.subsong.size()<=1) { @@ -87,6 +96,9 @@ void FurnaceGUI::drawSubSongs() { showWarning("are you sure you want to remove this subsong?",GUI_WARN_SUBSONG_DEL); } } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Remove"); + } ImGui::Text("Name"); ImGui::SameLine(); diff --git a/src/gui/waveEdit.cpp b/src/gui/waveEdit.cpp index fd863e50..92e98238 100644 --- a/src/gui/waveEdit.cpp +++ b/src/gui/waveEdit.cpp @@ -241,10 +241,16 @@ void FurnaceGUI::drawWaveEdit() { if (ImGui::Button(ICON_FA_FOLDER_OPEN "##WELoad")) { doAction(GUI_ACTION_WAVE_LIST_OPEN_REPLACE); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Load"); + } ImGui::SameLine(); if (ImGui::Button(ICON_FA_FLOPPY_O "##WESave")) { doAction(GUI_ACTION_WAVE_LIST_SAVE); } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Save"); + } if (ImGui::BeginPopupContextItem("WaveSaveFormats",ImGuiMouseButton_Right)) { if (ImGui::MenuItem("save as .dmw...")) { doAction(GUI_ACTION_WAVE_LIST_SAVE_DMW); From 662a5c5c616d0bc0d7d9b0cf9f4277cd610b28f5 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sat, 10 Dec 2022 19:24:32 -0500 Subject: [PATCH 10/26] GUI: and here is some animation --- src/gui/editControls.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/editControls.cpp b/src/gui/editControls.cpp index 19010e3d..c81af6f3 100644 --- a/src/gui/editControls.cpp +++ b/src/gui/editControls.cpp @@ -77,14 +77,14 @@ void FurnaceGUI::drawMobileControls() { if (mobileEditButtonPos.y>1) mobileEditButtonPos.y=1; if (mobileEdit) { - mobileEditAnim+=ImGui::GetIO().DeltaTime*2.0; + mobileEditAnim+=ImGui::GetIO().DeltaTime*2.4; if (mobileEditAnim>1.0f) { mobileEditAnim=1.0f; } else { WAKE_UP; } } else { - mobileEditAnim-=ImGui::GetIO().DeltaTime*2.0; + mobileEditAnim-=ImGui::GetIO().DeltaTime*2.4; if (mobileEditAnim<0.0f) { mobileEditAnim=0.0f; } else { @@ -115,9 +115,10 @@ void FurnaceGUI::drawMobileControls() { int buttonLayout=0; for (int i=0; i<8; i++) { - float anim=(mobileEditAnim*5)-(float)i*0.5; + float anim=(mobileEditAnim*1.5)-(float)i*0.05; if (anim<0.0f) anim=0.0f; if (anim>1.0f) anim=1.0f; + anim=5*anim-7*pow(anim,2.0f)+3*pow(anim,3.0f); buttonDir=mobileButtonAngles[buttonLayout][curButtonPos]; buttonDist=mobileButtonDistances[buttonLayout][curButtonPos]*mobileEditButtonSize.x*1.6f; From 592bf34bf381f04b4641f0e69f1fe2b645078430 Mon Sep 17 00:00:00 2001 From: cam900 Date: Sun, 11 Dec 2022 11:09:13 +0900 Subject: [PATCH 11/26] Addressing comments --- src/gui/dataList.cpp | 6 +++--- src/gui/editControls.cpp | 10 +++++----- src/gui/insEdit.cpp | 2 +- src/gui/piano.cpp | 32 +------------------------------- src/gui/sampleEdit.cpp | 2 +- src/gui/waveEdit.cpp | 2 +- 6 files changed, 12 insertions(+), 42 deletions(-) diff --git a/src/gui/dataList.cpp b/src/gui/dataList.cpp index 455bf794..0a5507ad 100644 --- a/src/gui/dataList.cpp +++ b/src/gui/dataList.cpp @@ -95,7 +95,7 @@ void FurnaceGUI::drawInsList(bool asChild) { if (!settings.unifiedDataView) doAction(GUI_ACTION_INS_LIST_OPEN); } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Load"); + ImGui::SetTooltip("Open"); } if (settings.unifiedDataView) { if (ImGui::BeginPopupContextItem("UnifiedLoad",ImGuiMouseButton_Left)) { @@ -557,7 +557,7 @@ void FurnaceGUI::drawWaveList(bool asChild) { doAction(GUI_ACTION_WAVE_LIST_OPEN); } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Load"); + ImGui::SetTooltip("Open"); } if (ImGui::BeginPopupContextItem("WaveOpenOpt")) { if (ImGui::MenuItem("replace...")) { @@ -655,7 +655,7 @@ void FurnaceGUI::drawSampleList(bool asChild) { doAction(GUI_ACTION_SAMPLE_LIST_OPEN); } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Load"); + ImGui::SetTooltip("Open"); } if (ImGui::BeginPopupContextItem("SampleOpenOpt")) { if (ImGui::MenuItem("replace...")) { diff --git a/src/gui/editControls.cpp b/src/gui/editControls.cpp index 7a38d2f5..288593bd 100644 --- a/src/gui/editControls.cpp +++ b/src/gui/editControls.cpp @@ -205,7 +205,7 @@ void FurnaceGUI::drawMobileControls() { pendingStepUpdate=true; } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Step 1 row"); + ImGui::SetTooltip("Step one row"); } bool repeatPattern=e->getRepeatPattern(); @@ -498,7 +498,7 @@ void FurnaceGUI::drawEditControls() { pendingStepUpdate=true; } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Step 1 row"); + ImGui::SetTooltip("Step one row"); } ImGui::SameLine(); @@ -538,7 +538,7 @@ void FurnaceGUI::drawEditControls() { pendingStepUpdate=true; } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Step 1 row"); + ImGui::SetTooltip("Step one row"); } ImGui::SameLine(); @@ -643,7 +643,7 @@ void FurnaceGUI::drawEditControls() { pendingStepUpdate=true; } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Step 1 row"); + ImGui::SetTooltip("Step one row"); } bool repeatPattern=e->getRepeatPattern(); @@ -777,7 +777,7 @@ void FurnaceGUI::drawEditControls() { pendingStepUpdate=true; } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Step 1 row"); + ImGui::SetTooltip("Step one row"); } ImGui::SameLine(); diff --git a/src/gui/insEdit.cpp b/src/gui/insEdit.cpp index 5891008f..7e48b246 100644 --- a/src/gui/insEdit.cpp +++ b/src/gui/insEdit.cpp @@ -2167,7 +2167,7 @@ void FurnaceGUI::drawInsEdit() { doAction(GUI_ACTION_INS_LIST_OPEN_REPLACE); } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Load"); + ImGui::SetTooltip("Open"); } ImGui::SameLine(); if (ImGui::Button(ICON_FA_FLOPPY_O "##IESave")) { diff --git a/src/gui/piano.cpp b/src/gui/piano.cpp index 6d80d5b4..d999d7fd 100644 --- a/src/gui/piano.cpp +++ b/src/gui/piano.cpp @@ -78,37 +78,25 @@ void FurnaceGUI::drawPiano() { if (ImGui::Button("OFF##PianoNOff",optionSize)) { if (edit) noteInput(0,GUI_NOTE_OFF); } - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Note Off"); - } ImGui::SameLine(); if (ImGui::Button("===##PianoNRel",optionSize)) { if (edit) noteInput(0,GUI_NOTE_OFF_RELEASE); } - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Note Off + Release"); - } } else { if (ImGui::Button(ICON_FA_ARROW_LEFT "##PianoLeft",optionSize)) { off--; if (off<0) off=0; } - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Left scroll"); - } ImGui::SameLine(); if (ImGui::Button(ICON_FA_ARROW_RIGHT "##PianoRight",optionSize)) { off++; if ((off+oct)>14) off=15-oct; } - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Right scroll"); - } } ImGui::SameLine(); ImGui::Button(ICON_FA_ELLIPSIS_V "##PianoOptions",optionSize); if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Piano Options"); + ImGui::SetTooltip("Options"); } if (ImGui::BeginPopupContextItem("PianoOptions",ImGuiPopupFlags_MouseButtonLeft)) { ImGui::Text("Key layout:"); @@ -146,41 +134,26 @@ void FurnaceGUI::drawPiano() { if (ImGui::Button("REL##PianoNMRel",optionSize)) { if (edit) noteInput(0,GUI_NOTE_RELEASE); } - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Note Release"); - } ImGui::SameLine(); if (ImGui::Button(ICON_FA_TIMES "##PianoDelP",optionSize)) { doDelete(); } - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Note Delete"); - } } else { if (ImGui::Button(ICON_FA_MINUS "##PianoOctaveDown",optionSize)) { oct--; if (oct<1) oct=1; } - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Octave down"); - } ImGui::SameLine(); if (ImGui::Button(ICON_FA_PLUS "##PianoOctaveUp",optionSize)) { oct++; if (oct>15) oct=15; if ((off+oct)>14) off=15-oct; } - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Octave up"); - } } ImGui::SameLine(); if (ImGui::Button(ICON_FA_ELLIPSIS_H "##PianoSel",optionSize)) { pianoOptionsSet=!pianoOptionsSet; } - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip(pianoOptionsSet?"Note Off/Release":"Scroll/Resize Piano"); - } } if (mobileUI && portrait) { @@ -510,9 +483,6 @@ void FurnaceGUI::drawPiano() { if (ImGui::Button(ICON_FA_TIMES "##PianoDel",buttonSize)) { doDelete(); } - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Delete"); - } ImGui::TableNextColumn(); VALUE_DIGIT(0,"0"); ImGui::TableNextColumn(); diff --git a/src/gui/sampleEdit.cpp b/src/gui/sampleEdit.cpp index 04941158..beca3102 100644 --- a/src/gui/sampleEdit.cpp +++ b/src/gui/sampleEdit.cpp @@ -119,7 +119,7 @@ void FurnaceGUI::drawSampleEdit() { doAction(GUI_ACTION_SAMPLE_LIST_OPEN_REPLACE); } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Load"); + ImGui::SetTooltip("Open"); } ImGui::SameLine(); if (ImGui::Button(ICON_FA_FLOPPY_O "##SESave")) { diff --git a/src/gui/waveEdit.cpp b/src/gui/waveEdit.cpp index 92e98238..fcc10bd0 100644 --- a/src/gui/waveEdit.cpp +++ b/src/gui/waveEdit.cpp @@ -242,7 +242,7 @@ void FurnaceGUI::drawWaveEdit() { doAction(GUI_ACTION_WAVE_LIST_OPEN_REPLACE); } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Load"); + ImGui::SetTooltip("Open"); } ImGui::SameLine(); if (ImGui::Button(ICON_FA_FLOPPY_O "##WESave")) { From be01c19e3e85f0869464485b2854c9c6c7870b52 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sat, 10 Dec 2022 23:45:12 -0500 Subject: [PATCH 12/26] GUI: no tooltips in mobile --- src/gui/editControls.cpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/gui/editControls.cpp b/src/gui/editControls.cpp index 288593bd..6c5e6d26 100644 --- a/src/gui/editControls.cpp +++ b/src/gui/editControls.cpp @@ -188,25 +188,16 @@ void FurnaceGUI::drawMobileControls() { if (ImGui::Button(ICON_FA_PLAY "##Play",buttonSize)) { play(); } - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Play"); - } popToggleColors(); if (portrait) ImGui::SameLine(); if (ImGui::Button(ICON_FA_STOP "##Stop",buttonSize)) { stop(); } - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Stop"); - } if (portrait) ImGui::SameLine(); if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne",buttonSize)) { e->stepOne(cursor.y); pendingStepUpdate=true; } - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Step one row"); - } bool repeatPattern=e->getRepeatPattern(); pushToggleColors(repeatPattern); @@ -214,9 +205,6 @@ void FurnaceGUI::drawMobileControls() { if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern",buttonSize)) { e->setRepeatPattern(!repeatPattern); } - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Repeat pattern"); - } popToggleColors(); pushToggleColors(edit); @@ -224,9 +212,6 @@ void FurnaceGUI::drawMobileControls() { if (ImGui::Button(ICON_FA_CIRCLE "##Edit",buttonSize)) { edit=!edit; } - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Edit"); - } popToggleColors(); bool metro=e->getMetronome(); @@ -235,9 +220,6 @@ void FurnaceGUI::drawMobileControls() { if (ImGui::Button(ICON_FA_BELL_O "##Metronome",buttonSize)) { e->setMetronome(!metro); } - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Metronome"); - } popToggleColors(); } if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS; From f331e50041c4046e46d1766ac38940cea31b6ca4 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 11 Dec 2022 04:03:22 -0500 Subject: [PATCH 13/26] GUI: automatic mobile edit button layout --- src/gui/editControls.cpp | 51 +++++++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/src/gui/editControls.cpp b/src/gui/editControls.cpp index e6041aec..143ed12c 100644 --- a/src/gui/editControls.cpp +++ b/src/gui/editControls.cpp @@ -23,17 +23,20 @@ // 0: all directions // 1: half -// 2: quarter -float mobileButtonAngles[3][8]={ +// 2: half +// 3: quarter +float mobileButtonAngles[4][8]={ {0.0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875}, - {0.8, 0.933333, 0.066667, 0.2, 0.8, 0.933333, 0.066667, 0.2}, - {0.75, 0.833333, 0.916667, 0.0, 0.75, 0.833333, 0.916667, 0.0} + {0.8333, 0.0, 0.1667, 0.8, 0.9, 0.0, 0.1, 0.2}, + {0.0833, 0.25, 0.4167, 0.45, 0.35, 0.25, 0.15, 0.05}, + {0.25, 0.125, 0.0, 0.25, 0.1875, 0.125, 0.0625, 0.0} }; -float mobileButtonDistances[3][8]={ +float mobileButtonDistances[4][8]={ {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}, - {1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0}, - {1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0} + {0.8, 0.75, 0.8, 1.5, 1.5, 1.5, 1.5, 1.5}, + {0.8, 0.75, 0.8, 1.5, 1.5, 1.5, 1.5, 1.5}, + {0.9, 1.0, 0.9, 1.78, 1.82, 1.95, 1.82, 1.78} }; void FurnaceGUI::drawMobileControls() { @@ -101,6 +104,7 @@ void FurnaceGUI::drawMobileControls() { } ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding,ImVec2(0.0f,0.0f)); + ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding,mobileEditButtonSize.x); if (ImGui::Begin("MobileEdit",NULL,ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoScrollWithMouse|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoBackground|ImGuiWindowFlags_NoDecoration)) { if (ImGui::IsMouseReleased(ImGuiMouseButton_Left) && mobileEdit) { mobileEdit=false; @@ -114,6 +118,37 @@ void FurnaceGUI::drawMobileControls() { int buttonLayout=0; + ImVec2 scaledButtonPos=ImVec2( + mobileEditButtonPos.x+((mobileEditButtonSize.x*0.5)/(float)canvasW), + mobileEditButtonPos.y+((mobileEditButtonSize.y*0.5)/(float)canvasH) + ); + + if (scaledButtonPos.x>0.25 && + scaledButtonPos.x<0.75 && + scaledButtonPos.y>0.2 && + scaledButtonPos.y<0.8) { + buttonLayout=0; + } else if (scaledButtonPos.x>0.4 && scaledButtonPos.x<0.6) { + buttonLayout=2; + } else if (scaledButtonPos.y>0.25 && scaledButtonPos.y<0.75) { + buttonLayout=1; + } else { + buttonLayout=3; + } + + switch (buttonLayout) { + case 1: + if (mobileEditButtonPos.x>0.5) buttonMirrorX=-1.0f; + break; + case 2: + if (mobileEditButtonPos.y>0.5) buttonMirrorY=-1.0f; + break; + case 3: + if (mobileEditButtonPos.x>0.5) buttonMirrorX=-1.0f; + if (mobileEditButtonPos.y>0.5) buttonMirrorY=-1.0f; + break; + } + for (int i=0; i<8; i++) { float anim=(mobileEditAnim*1.5)-(float)i*0.05; if (anim<0.0f) anim=0.0f; @@ -149,7 +184,7 @@ void FurnaceGUI::drawMobileControls() { } } ImGui::End(); - ImGui::PopStyleVar(); + ImGui::PopStyleVar(2); ImGui::SetNextWindowPos(portrait?ImVec2(0.0f,((1.0-mobileMenuPos*0.65)*canvasH)-(0.16*canvasW)):ImVec2(0.5*canvasW*mobileMenuPos,0.0f)); ImGui::SetNextWindowSize(portrait?ImVec2(canvasW,0.16*canvasW):ImVec2(0.16*canvasH,canvasH)); From 6349ebbfad8fd94908b2040eefa1b2672ec6071f Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 11 Dec 2022 12:36:41 -0500 Subject: [PATCH 14/26] GUI: half working mobile edit options --- src/gui/doAction.cpp | 7 ++ src/gui/editControls.cpp | 145 +++++++++++++++++++++++++++++++++++++-- src/gui/gui.cpp | 7 +- src/gui/gui.h | 4 ++ src/gui/guiConst.cpp | 3 + 5 files changed, 159 insertions(+), 7 deletions(-) diff --git a/src/gui/doAction.cpp b/src/gui/doAction.cpp index a12366ac..89c61564 100644 --- a/src/gui/doAction.cpp +++ b/src/gui/doAction.cpp @@ -174,6 +174,9 @@ void FurnaceGUI::doAction(int what) { case GUI_ACTION_PANIC: e->syncReset(); break; + case GUI_ACTION_CLEAR: + showWarning("Are you sure you want to clear... (cannot be undone!)",GUI_WARN_CLEAR); + break; case GUI_ACTION_WINDOW_EDIT_CONTROLS: nextWindow=GUI_WINDOW_EDIT_CONTROLS; @@ -554,6 +557,10 @@ void FurnaceGUI::doAction(int what) { break; case GUI_ACTION_PAT_LATCH: // TODO break; + case GUI_ACTION_PAT_SCROLL_MODE: // TODO + break; + case GUI_ACTION_PAT_CLEAR_LATCH: // TODO + break; case GUI_ACTION_INS_LIST_ADD: curIns=e->addInstrument(cursor.xCoarse); diff --git a/src/gui/editControls.cpp b/src/gui/editControls.cpp index 143ed12c..d8b26ca0 100644 --- a/src/gui/editControls.cpp +++ b/src/gui/editControls.cpp @@ -25,20 +25,146 @@ // 1: half // 2: half // 3: quarter -float mobileButtonAngles[4][8]={ +const float mobileButtonAngles[4][8]={ {0.0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875}, {0.8333, 0.0, 0.1667, 0.8, 0.9, 0.0, 0.1, 0.2}, {0.0833, 0.25, 0.4167, 0.45, 0.35, 0.25, 0.15, 0.05}, {0.25, 0.125, 0.0, 0.25, 0.1875, 0.125, 0.0625, 0.0} }; -float mobileButtonDistances[4][8]={ +const float mobileButtonDistances[4][8]={ {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}, {0.8, 0.75, 0.8, 1.5, 1.5, 1.5, 1.5, 1.5}, {0.8, 0.75, 0.8, 1.5, 1.5, 1.5, 1.5, 1.5}, {0.9, 1.0, 0.9, 1.78, 1.82, 1.95, 1.82, 1.78} }; +const char* mobileButtonLabels[32]={ + // page 1 + "cut", + "copy", + "paste", + "delete", + "select\nall", + "piano", + "undo", + "redo", + + // page 2 + "paste\nmix", + "paste\nmix bg", + "paste\nins", + "paste\nins bg", + "paste\nflood", + "paste\noverflow", + "transpose\nnotes", + "transpose\nvalues", + + // page 3 + "change\nins", + "find/\nreplace", + "collapse", + "expand", + "flip", + "invert", + "interpolate", + "scale", + + // page 4 + "fade", + "randomize", + "opmask", + "scroll\nmode", + "input\nlatch", + "set\nlatch", + "clear\nlatch", + "clear" +}; + +const int mobileButtonActions[32]={ + // page 1 + GUI_ACTION_PAT_CUT, + GUI_ACTION_PAT_COPY, + GUI_ACTION_PAT_PASTE, + GUI_ACTION_PAT_DELETE, + GUI_ACTION_PAT_SELECT_ALL, + 0, + GUI_ACTION_UNDO, + GUI_ACTION_REDO, + + // page 2 + GUI_ACTION_PAT_PASTE_MIX, + GUI_ACTION_PAT_PASTE_MIX_BG, + 0, + 0, + GUI_ACTION_PAT_PASTE_FLOOD, + GUI_ACTION_PAT_PASTE_OVERFLOW, + 0, + 0, + + // page 3 + 0, + GUI_ACTION_WINDOW_FIND, + GUI_ACTION_PAT_COLLAPSE_ROWS, + GUI_ACTION_PAT_EXPAND_ROWS, + GUI_ACTION_PAT_FLIP_SELECTION, + GUI_ACTION_PAT_INVERT_VALUES, + GUI_ACTION_PAT_INTERPOLATE, + 0, + + // page 4 + GUI_ACTION_PAT_FADE, + 0, + 0, + GUI_ACTION_PAT_SCROLL_MODE, + 0, + GUI_ACTION_PAT_LATCH, + GUI_ACTION_PAT_CLEAR_LATCH, + GUI_ACTION_CLEAR +}; + +const bool mobileButtonPersist[32]={ + // page 1 + false, + false, + false, + false, + true, + true, + true, + true, + + // page 2 + false, + false, + false, + false, + false, + false, + false, + false, + + // page 3 + false, + false, + false, + false, + false, + false, + false, + false, + + // page 4 + false, + false, + false, + true, + false, + false, + false, + false, +}; + void FurnaceGUI::drawMobileControls() { float timeScale=1.0f/(60.0f*ImGui::GetIO().DeltaTime); if (dragMobileMenu) { @@ -106,6 +232,7 @@ void FurnaceGUI::drawMobileControls() { ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding,ImVec2(0.0f,0.0f)); ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding,mobileEditButtonSize.x); if (ImGui::Begin("MobileEdit",NULL,ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoScrollWithMouse|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoBackground|ImGuiWindowFlags_NoDecoration)) { + bool mobileEditWas=mobileEdit; if (ImGui::IsMouseReleased(ImGuiMouseButton_Left) && mobileEdit) { mobileEdit=false; } @@ -162,7 +289,14 @@ void FurnaceGUI::drawMobileControls() { (mobileEditButtonPos.x*canvasW)+cos(buttonDir*2.0*M_PI)*buttonDist*buttonMirrorX*anim, (mobileEditButtonPos.y*canvasH)+sin(buttonDir*2.0*M_PI)*buttonDist*buttonMirrorY*anim )); - ImGui::Button(fmt::sprintf("%d",i+1).c_str(),mobileEditButtonSize); + if (ImGui::Button(mobileButtonLabels[i+mobileEditPage*8],mobileEditButtonSize)) { + if (mobileButtonActions[i+mobileEditPage*8]) { + doAction(mobileButtonActions[i+mobileEditPage*8]); + } + if (mobileButtonPersist[i+mobileEditPage*8]) { + mobileEdit=true; + } + } curButtonPos++; } @@ -173,8 +307,11 @@ void FurnaceGUI::drawMobileControls() { mobileEditButtonSize=ImVec2(avail,avail); } - if (ImGui::Button("Edit",mobileEditButtonSize)) { + if (ImGui::Button(ICON_FA_PENCIL "##Edit",mobileEditButtonSize)) { // click + if (mobileEditWas) { + if (++mobileEditPage>3) mobileEditPage=0; + } if (ImGui::GetIO().MouseDragMaxDistanceSqr[ImGuiMouseButton_Left]<=ImGui::GetIO().ConfigInertialScrollToleranceSqr) { mobileEdit=true; } diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 310f8add..a13a4902 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -3627,7 +3627,7 @@ bool FurnaceGUI::loop() { editOptions(true); ImGui::Separator(); if (ImGui::MenuItem("clear...")) { - showWarning("Are you sure you want to clear... (cannot be undone!)",GUI_WARN_CLEAR); + doAction(GUI_ACTION_CLEAR); } ImGui::EndMenu(); } @@ -3782,7 +3782,6 @@ bool FurnaceGUI::loop() { globalWinFlags=ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoBringToFrontOnFocus; //globalWinFlags=ImGuiWindowFlags_NoTitleBar; // scene handling goes here! - pianoOpen=true; drawMobileControls(); switch (mobScene) { case GUI_SCENE_ORDERS: @@ -3823,6 +3822,7 @@ bool FurnaceGUI::loop() { curWindow=GUI_WINDOW_PATTERN; drawPattern(); drawPiano(); + drawFindReplace(); drawMobileOrderSel(); break; } @@ -5150,7 +5150,7 @@ bool FurnaceGUI::init() { volMeterOpen=e->getConfBool("volMeterOpen",true); statsOpen=e->getConfBool("statsOpen",false); compatFlagsOpen=e->getConfBool("compatFlagsOpen",false); - pianoOpen=e->getConfBool("pianoOpen",false); + pianoOpen=e->getConfBool("pianoOpen",IS_MOBILE?true:false); notesOpen=e->getConfBool("notesOpen",false); channelsOpen=e->getConfBool("channelsOpen",false); patManagerOpen=e->getConfBool("patManagerOpen",false); @@ -5666,6 +5666,7 @@ FurnaceGUI::FurnaceGUI(): macroPointSize(16), waveEditStyle(0), displayInsTypeListMakeInsSample(-1), + mobileEditPage(0), mobileMenuPos(0.0f), autoButtonSize(0.0f), mobileEditAnim(0.0f), diff --git a/src/gui/gui.h b/src/gui/gui.h index dbdb26cc..ec8f8b7f 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -421,6 +421,7 @@ enum FurnaceGUIActions { GUI_ACTION_FULLSCREEN, GUI_ACTION_TX81Z_REQUEST, GUI_ACTION_PANIC, + GUI_ACTION_CLEAR, GUI_ACTION_WINDOW_EDIT_CONTROLS, GUI_ACTION_WINDOW_ORDERS, @@ -520,6 +521,8 @@ enum FurnaceGUIActions { GUI_ACTION_PAT_COLLAPSE_SONG, GUI_ACTION_PAT_EXPAND_SONG, GUI_ACTION_PAT_LATCH, + GUI_ACTION_PAT_SCROLL_MODE, + GUI_ACTION_PAT_CLEAR_LATCH, GUI_ACTION_PAT_MAX, GUI_ACTION_INS_LIST_MIN, @@ -1102,6 +1105,7 @@ class FurnaceGUI { int macroPointSize; int waveEditStyle; int displayInsTypeListMakeInsSample; + int mobileEditPage; float mobileMenuPos, autoButtonSize, mobileEditAnim; ImVec2 mobileEditButtonPos, mobileEditButtonSize; const int* curSysSection; diff --git a/src/gui/guiConst.cpp b/src/gui/guiConst.cpp index 07716653..906f207c 100644 --- a/src/gui/guiConst.cpp +++ b/src/gui/guiConst.cpp @@ -483,6 +483,7 @@ const FurnaceGUIActionDef guiActions[GUI_ACTION_MAX]={ D("FULLSCREEN", "Toggle full-screen", SDLK_F11), D("TX81Z_REQUEST", "Request voice from TX81Z", 0), D("PANIC", "Panic", SDLK_F12), + D("CLEAR", "Clear song data", 0), D("WINDOW_EDIT_CONTROLS", "Edit Controls", 0), D("WINDOW_ORDERS", "Orders", 0), @@ -582,6 +583,8 @@ const FurnaceGUIActionDef guiActions[GUI_ACTION_MAX]={ D("PAT_COLLAPSE_SONG", "Collapse song", 0), D("PAT_EXPAND_SONG", "Expand song", 0), D("PAT_LATCH", "Set note input latch", 0), + D("PAT_SCROLL_MODE", "Change mobile scroll mode", 0), + D("PAT_CLEAR_LATCH", "Clear note input latch", 0), D("PAT_MAX", "", NOT_AN_ACTION), D("INS_LIST_MIN", "---Instrument list", NOT_AN_ACTION), From a4d8604260f4cc58ef29acfc4303b533b3338787 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 11 Dec 2022 12:42:26 -0500 Subject: [PATCH 15/26] SN: fix easy noise arpeggio macro --- src/engine/platform/sms.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/platform/sms.cpp b/src/engine/platform/sms.cpp index c07e8063..d6da280c 100644 --- a/src/engine/platform/sms.cpp +++ b/src/engine/platform/sms.cpp @@ -160,7 +160,7 @@ void DivPlatformSMS::tick(bool sysTick) { if (!chan[i].inPorta) { // TODO: add compatibility flag. this is horrible. int areYouSerious=parent->calcArp(chan[i].note,chan[i].std.arp.val); - while (areYouSerious>0x60) areYouSerious-=12; + if (!easyNoise) while (areYouSerious>0x60) areYouSerious-=12; chan[i].baseFreq=NOTE_SN(i,areYouSerious); chan[i].actualNote=areYouSerious; chan[i].freqChanged=true; From 9d02afe0eb94b3dab620417edc06844f393b2f72 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 11 Dec 2022 13:34:58 -0500 Subject: [PATCH 16/26] fix build --- src/gui/gui.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index a13a4902..103582df 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -3822,8 +3822,10 @@ bool FurnaceGUI::loop() { curWindow=GUI_WINDOW_PATTERN; drawPattern(); drawPiano(); - drawFindReplace(); drawMobileOrderSel(); + + globalWinFlags=0; + drawFindReplace(); break; } @@ -5150,7 +5152,11 @@ bool FurnaceGUI::init() { volMeterOpen=e->getConfBool("volMeterOpen",true); statsOpen=e->getConfBool("statsOpen",false); compatFlagsOpen=e->getConfBool("compatFlagsOpen",false); - pianoOpen=e->getConfBool("pianoOpen",IS_MOBILE?true:false); +#ifdef IS_MOBILE + pianoOpen=e->getConfBool("pianoOpen",true); +#else + pianoOpen=e->getConfBool("pianoOpen",false); +#endif notesOpen=e->getConfBool("notesOpen",false); channelsOpen=e->getConfBool("channelsOpen",false); patManagerOpen=e->getConfBool("patManagerOpen",false); From fe4f15fff237e87d26b878086361c4b51ad878b6 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 11 Dec 2022 13:38:44 -0500 Subject: [PATCH 17/26] GUI: some inertial scrolling fixes when moving/resizing --- extern/imgui_patched/imgui.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extern/imgui_patched/imgui.cpp b/extern/imgui_patched/imgui.cpp index 3539ca81..612a88d2 100644 --- a/extern/imgui_patched/imgui.cpp +++ b/extern/imgui_patched/imgui.cpp @@ -3970,6 +3970,7 @@ void ImGui::UpdateMouseMovingWindowNewFrame() { MarkIniSettingsDirty(moving_window); SetWindowPos(moving_window, pos, ImGuiCond_Always); + g.InertialScrollInhibited=true; if (moving_window->ViewportOwned) // Synchronize viewport immediately because some overlays may relies on clipping rectangle before we Begin() into the window. { moving_window->Viewport->Pos = pos; @@ -6025,6 +6026,7 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s if (size_target.x != FLT_MAX) { window->SizeFull = size_target; + g.InertialScrollInhibited=true; MarkIniSettingsDirty(window); } if (pos_target.x != FLT_MAX) From 315d7595a5532aa56f0063180730fe50119983e7 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 11 Dec 2022 16:29:22 -0500 Subject: [PATCH 18/26] GUI: mobile edit button only visible in pattern --- src/gui/editControls.cpp | 174 ++++++++++++++++++++------------------- 1 file changed, 88 insertions(+), 86 deletions(-) diff --git a/src/gui/editControls.cpp b/src/gui/editControls.cpp index d8b26ca0..014bdfd1 100644 --- a/src/gui/editControls.cpp +++ b/src/gui/editControls.cpp @@ -221,107 +221,109 @@ void FurnaceGUI::drawMobileControls() { } } - if (mobileEditAnim>0.0f) { - ImGui::SetNextWindowPos(ImVec2(0.0f,0.0f)); - ImGui::SetNextWindowSize(ImVec2(canvasW,canvasH)); - } else { - ImGui::SetNextWindowPos(ImVec2(mobileEditButtonPos.x*canvasW, mobileEditButtonPos.y*canvasH)); - ImGui::SetNextWindowSize(portrait?ImVec2(0.16*canvasW,0.16*canvasW):ImVec2(0.16*canvasH,0.16*canvasH)); - } - - ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding,ImVec2(0.0f,0.0f)); - ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding,mobileEditButtonSize.x); - if (ImGui::Begin("MobileEdit",NULL,ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoScrollWithMouse|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoBackground|ImGuiWindowFlags_NoDecoration)) { - bool mobileEditWas=mobileEdit; - if (ImGui::IsMouseReleased(ImGuiMouseButton_Left) && mobileEdit) { - mobileEdit=false; + if (curWindowLast==GUI_WINDOW_PATTERN) { + if (mobileEditAnim>0.0f) { + ImGui::SetNextWindowPos(ImVec2(0.0f,0.0f)); + ImGui::SetNextWindowSize(ImVec2(canvasW,canvasH)); + } else { + ImGui::SetNextWindowPos(ImVec2(mobileEditButtonPos.x*canvasW, mobileEditButtonPos.y*canvasH)); + ImGui::SetNextWindowSize(portrait?ImVec2(0.16*canvasW,0.16*canvasW):ImVec2(0.16*canvasH,0.16*canvasH)); } - if (mobileEditAnim>0.0f) { - int curButtonPos=0; - float buttonDir, buttonDist; - float buttonMirrorX=1.0f; - float buttonMirrorY=1.0f; - - int buttonLayout=0; - - ImVec2 scaledButtonPos=ImVec2( - mobileEditButtonPos.x+((mobileEditButtonSize.x*0.5)/(float)canvasW), - mobileEditButtonPos.y+((mobileEditButtonSize.y*0.5)/(float)canvasH) - ); - - if (scaledButtonPos.x>0.25 && - scaledButtonPos.x<0.75 && - scaledButtonPos.y>0.2 && - scaledButtonPos.y<0.8) { - buttonLayout=0; - } else if (scaledButtonPos.x>0.4 && scaledButtonPos.x<0.6) { - buttonLayout=2; - } else if (scaledButtonPos.y>0.25 && scaledButtonPos.y<0.75) { - buttonLayout=1; - } else { - buttonLayout=3; + ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding,ImVec2(0.0f,0.0f)); + ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding,mobileEditButtonSize.x); + if (ImGui::Begin("MobileEdit",NULL,ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoScrollWithMouse|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoBackground|ImGuiWindowFlags_NoDecoration)) { + bool mobileEditWas=mobileEdit; + if (ImGui::IsMouseReleased(ImGuiMouseButton_Left) && mobileEdit) { + mobileEdit=false; } - switch (buttonLayout) { - case 1: - if (mobileEditButtonPos.x>0.5) buttonMirrorX=-1.0f; - break; - case 2: - if (mobileEditButtonPos.y>0.5) buttonMirrorY=-1.0f; - break; - case 3: - if (mobileEditButtonPos.x>0.5) buttonMirrorX=-1.0f; - if (mobileEditButtonPos.y>0.5) buttonMirrorY=-1.0f; - break; - } + if (mobileEditAnim>0.0f) { + int curButtonPos=0; + float buttonDir, buttonDist; + float buttonMirrorX=1.0f; + float buttonMirrorY=1.0f; - for (int i=0; i<8; i++) { - float anim=(mobileEditAnim*1.5)-(float)i*0.05; - if (anim<0.0f) anim=0.0f; - if (anim>1.0f) anim=1.0f; - anim=5*anim-7*pow(anim,2.0f)+3*pow(anim,3.0f); + int buttonLayout=0; - buttonDir=mobileButtonAngles[buttonLayout][curButtonPos]; - buttonDist=mobileButtonDistances[buttonLayout][curButtonPos]*mobileEditButtonSize.x*1.6f; + ImVec2 scaledButtonPos=ImVec2( + mobileEditButtonPos.x+((mobileEditButtonSize.x*0.5)/(float)canvasW), + mobileEditButtonPos.y+((mobileEditButtonSize.y*0.5)/(float)canvasH) + ); - ImGui::SetCursorPos(ImVec2( - (mobileEditButtonPos.x*canvasW)+cos(buttonDir*2.0*M_PI)*buttonDist*buttonMirrorX*anim, - (mobileEditButtonPos.y*canvasH)+sin(buttonDir*2.0*M_PI)*buttonDist*buttonMirrorY*anim - )); - if (ImGui::Button(mobileButtonLabels[i+mobileEditPage*8],mobileEditButtonSize)) { - if (mobileButtonActions[i+mobileEditPage*8]) { - doAction(mobileButtonActions[i+mobileEditPage*8]); - } - if (mobileButtonPersist[i+mobileEditPage*8]) { - mobileEdit=true; - } + if (scaledButtonPos.x>0.25 && + scaledButtonPos.x<0.75 && + scaledButtonPos.y>0.2 && + scaledButtonPos.y<0.8) { + buttonLayout=0; + } else if (scaledButtonPos.x>0.4 && scaledButtonPos.x<0.6) { + buttonLayout=2; + } else if (scaledButtonPos.y>0.25 && scaledButtonPos.y<0.75) { + buttonLayout=1; + } else { + buttonLayout=3; } - curButtonPos++; + switch (buttonLayout) { + case 1: + if (mobileEditButtonPos.x>0.5) buttonMirrorX=-1.0f; + break; + case 2: + if (mobileEditButtonPos.y>0.5) buttonMirrorY=-1.0f; + break; + case 3: + if (mobileEditButtonPos.x>0.5) buttonMirrorX=-1.0f; + if (mobileEditButtonPos.y>0.5) buttonMirrorY=-1.0f; + break; + } + + for (int i=0; i<8; i++) { + float anim=(mobileEditAnim*1.5)-(float)i*0.05; + if (anim<0.0f) anim=0.0f; + if (anim>1.0f) anim=1.0f; + anim=5*anim-7*pow(anim,2.0f)+3*pow(anim,3.0f); + + buttonDir=mobileButtonAngles[buttonLayout][curButtonPos]; + buttonDist=mobileButtonDistances[buttonLayout][curButtonPos]*mobileEditButtonSize.x*1.6f; + + ImGui::SetCursorPos(ImVec2( + (mobileEditButtonPos.x*canvasW)+cos(buttonDir*2.0*M_PI)*buttonDist*buttonMirrorX*anim, + (mobileEditButtonPos.y*canvasH)+sin(buttonDir*2.0*M_PI)*buttonDist*buttonMirrorY*anim + )); + if (ImGui::Button(mobileButtonLabels[i+mobileEditPage*8],mobileEditButtonSize)) { + if (mobileButtonActions[i+mobileEditPage*8]) { + doAction(mobileButtonActions[i+mobileEditPage*8]); + } + if (mobileButtonPersist[i+mobileEditPage*8]) { + mobileEdit=true; + } + } + + curButtonPos++; + } + + ImGui::SetCursorPos(ImVec2(mobileEditButtonPos.x*canvasW,mobileEditButtonPos.y*canvasH)); + } else { + float avail=portrait?ImGui::GetContentRegionAvail().y:ImGui::GetContentRegionAvail().x; + mobileEditButtonSize=ImVec2(avail,avail); } - ImGui::SetCursorPos(ImVec2(mobileEditButtonPos.x*canvasW,mobileEditButtonPos.y*canvasH)); - } else { - float avail=portrait?ImGui::GetContentRegionAvail().y:ImGui::GetContentRegionAvail().x; - mobileEditButtonSize=ImVec2(avail,avail); - } - - if (ImGui::Button(ICON_FA_PENCIL "##Edit",mobileEditButtonSize)) { - // click - if (mobileEditWas) { - if (++mobileEditPage>3) mobileEditPage=0; + if (ImGui::Button(ICON_FA_PENCIL "##Edit",mobileEditButtonSize)) { + // click + if (mobileEditWas) { + if (++mobileEditPage>3) mobileEditPage=0; + } + if (ImGui::GetIO().MouseDragMaxDistanceSqr[ImGuiMouseButton_Left]<=ImGui::GetIO().ConfigInertialScrollToleranceSqr) { + mobileEdit=true; + } } - if (ImGui::GetIO().MouseDragMaxDistanceSqr[ImGuiMouseButton_Left]<=ImGui::GetIO().ConfigInertialScrollToleranceSqr) { - mobileEdit=true; + if (ImGui::IsItemClicked() && !mobileEdit) { + dragMobileEditButton=true; } } - if (ImGui::IsItemClicked() && !mobileEdit) { - dragMobileEditButton=true; - } + ImGui::End(); + ImGui::PopStyleVar(2); } - ImGui::End(); - ImGui::PopStyleVar(2); ImGui::SetNextWindowPos(portrait?ImVec2(0.0f,((1.0-mobileMenuPos*0.65)*canvasH)-(0.16*canvasW)):ImVec2(0.5*canvasW*mobileMenuPos,0.0f)); ImGui::SetNextWindowSize(portrait?ImVec2(canvasW,0.16*canvasW):ImVec2(0.16*canvasH,canvasH)); From 1fe4230e82df49592742e0e83be5b66a1349bab1 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 11 Dec 2022 16:46:25 -0500 Subject: [PATCH 19/26] C64: possibly fix write delay issue in reSIDfp --- src/engine/platform/c64.cpp | 13 ++++++++++++- src/engine/platform/c64.h | 7 +++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/engine/platform/c64.cpp b/src/engine/platform/c64.cpp index 068dd1b3..4992fb24 100644 --- a/src/engine/platform/c64.cpp +++ b/src/engine/platform/c64.cpp @@ -22,7 +22,7 @@ #include "sound/c64_fp/siddefs-fp.h" #include -#define rWrite(a,v) if (!skipRegisterWrites) {if (isFP) {sid_fp.write(a,v);} else {sid.write(a,v);}; regPool[(a)&0x1f]=v; if (dumpWrites) {addWrite(a,v);} } +#define rWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} } #define CHIP_FREQBASE 524288 @@ -66,6 +66,16 @@ const char** DivPlatformC64::getRegisterSheet() { void DivPlatformC64::acquire(short* bufL, short* bufR, size_t start, size_t len) { int dcOff=isFP?0:sid.get_dc(0); for (size_t i=start; i=4) { @@ -483,6 +493,7 @@ float DivPlatformC64::getPostAmp() { } void DivPlatformC64::reset() { + while (!writes.empty()) writes.pop(); for (int i=0; i<3; i++) { chan[i]=DivPlatformC64::Channel(); chan[i].std.setEngine(parent); diff --git a/src/engine/platform/c64.h b/src/engine/platform/c64.h index ba9a0512..4fe68f4e 100644 --- a/src/engine/platform/c64.h +++ b/src/engine/platform/c64.h @@ -21,6 +21,7 @@ #define _C64_H #include "../dispatch.h" +#include #include "../macroInt.h" #include "sound/c64/sid.h" #include "sound/c64_fp/SID.h" @@ -73,6 +74,12 @@ class DivPlatformC64: public DivDispatch { Channel chan[3]; DivDispatchOscBuffer* oscBuf[3]; bool isMuted[3]; + struct QueuedWrite { + unsigned char addr; + unsigned char val; + QueuedWrite(unsigned char a, unsigned char v): addr(a), val(v) {} + }; + std::queue writes; unsigned char filtControl, filtRes, vol; unsigned char writeOscBuf; From 9ad3753179e9c84fa5e6a408562e33d7643bdda1 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 11 Dec 2022 18:22:39 -0500 Subject: [PATCH 20/26] GUI: edit button moves with menu --- src/gui/editControls.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/editControls.cpp b/src/gui/editControls.cpp index 014bdfd1..b10c85ea 100644 --- a/src/gui/editControls.cpp +++ b/src/gui/editControls.cpp @@ -226,7 +226,7 @@ void FurnaceGUI::drawMobileControls() { ImGui::SetNextWindowPos(ImVec2(0.0f,0.0f)); ImGui::SetNextWindowSize(ImVec2(canvasW,canvasH)); } else { - ImGui::SetNextWindowPos(ImVec2(mobileEditButtonPos.x*canvasW, mobileEditButtonPos.y*canvasH)); + ImGui::SetNextWindowPos(ImVec2((mobileEditButtonPos.x+(portrait?0:(mobileMenuPos*0.65)))*canvasW,(mobileEditButtonPos.y-(portrait?(mobileMenuPos*0.65):0))*canvasH)); ImGui::SetNextWindowSize(portrait?ImVec2(0.16*canvasW,0.16*canvasW):ImVec2(0.16*canvasH,0.16*canvasH)); } @@ -295,7 +295,7 @@ void FurnaceGUI::drawMobileControls() { doAction(mobileButtonActions[i+mobileEditPage*8]); } if (mobileButtonPersist[i+mobileEditPage*8]) { - mobileEdit=true; + if (mobileMenuPos<=0.0) mobileEdit=true; } } @@ -314,10 +314,10 @@ void FurnaceGUI::drawMobileControls() { if (++mobileEditPage>3) mobileEditPage=0; } if (ImGui::GetIO().MouseDragMaxDistanceSqr[ImGuiMouseButton_Left]<=ImGui::GetIO().ConfigInertialScrollToleranceSqr) { - mobileEdit=true; + if (mobileMenuPos<=0.0) mobileEdit=true; } } - if (ImGui::IsItemClicked() && !mobileEdit) { + if (ImGui::IsItemClicked() && !mobileEdit && mobileMenuPos<=0.0) { dragMobileEditButton=true; } } From 6cfbbe9fa4da50243510e3dc0fabcd745445b1cd Mon Sep 17 00:00:00 2001 From: cam900 Date: Mon, 12 Dec 2022 14:42:47 +0900 Subject: [PATCH 21/26] Reduce unused variables --- src/engine/platform/namcowsg.cpp | 3 --- src/engine/platform/namcowsg.h | 2 -- 2 files changed, 5 deletions(-) diff --git a/src/engine/platform/namcowsg.cpp b/src/engine/platform/namcowsg.cpp index c1466b90..f9e8c6ea 100644 --- a/src/engine/platform/namcowsg.cpp +++ b/src/engine/platform/namcowsg.cpp @@ -484,9 +484,6 @@ void DivPlatformNamcoWSG::reset() { namco->set_voices(chans); namco->set_stereo((devType==2 || devType==30)); namco->device_start(NULL); - lastPan=0xff; - cycles=0; - curChan=-1; } bool DivPlatformNamcoWSG::isStereo() { diff --git a/src/engine/platform/namcowsg.h b/src/engine/platform/namcowsg.h index 1656dedd..fdc86346 100644 --- a/src/engine/platform/namcowsg.h +++ b/src/engine/platform/namcowsg.h @@ -67,9 +67,7 @@ class DivPlatformNamcoWSG: public DivDispatch { QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v) {} }; std::queue writes; - unsigned char lastPan; - int cycles, curChan, delay; namco_audio_device* namco; int devType, chans; unsigned char regPool[512]; From 2ff68dad00c86c00c8be92d1930e31483a7d0166 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 12 Dec 2022 00:51:14 -0500 Subject: [PATCH 22/26] GUI: what now --- src/gui/gui.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 103582df..6753fdfd 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -3833,6 +3833,7 @@ bool FurnaceGUI::loop() { drawSettings(); drawDebug(); drawLog(); + drawStats(); } else { globalWinFlags=0; ImGui::DockSpaceOverViewport(NULL,lockLayout?(ImGuiDockNodeFlags_NoWindowMenuButton|ImGuiDockNodeFlags_NoMove|ImGuiDockNodeFlags_NoResize|ImGuiDockNodeFlags_NoCloseButton|ImGuiDockNodeFlags_NoDocking|ImGuiDockNodeFlags_NoDockingSplitMe|ImGuiDockNodeFlags_NoDockingSplitOther):0); From 82630317b09f467b4a78be625f2be32b29a1c7c2 Mon Sep 17 00:00:00 2001 From: cam900 Date: Mon, 12 Dec 2022 16:51:01 +0900 Subject: [PATCH 23/26] Fix K053260 reloading counter --- extern/vgsound_emu-modified/vgsound_emu/src/k053260/k053260.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/k053260/k053260.cpp b/extern/vgsound_emu-modified/vgsound_emu/src/k053260/k053260.cpp index cccdbbf5..bf056b81 100644 --- a/extern/vgsound_emu-modified/vgsound_emu/src/k053260/k053260.cpp +++ b/extern/vgsound_emu-modified/vgsound_emu/src/k053260/k053260.cpp @@ -59,6 +59,7 @@ void k053260_core::voice_t::tick() { m_bitpos -= 8; } + m_counter = bitfield(m_pitch, 0, 12); } m_data = m_host.m_intf.read_sample(bitfield(m_addr, 0, 21)); // fetch ROM if (update) @@ -76,6 +77,7 @@ void k053260_core::voice_t::tick() if (m_loop) { m_addr = m_start; + m_remain = m_length; m_adpcm_buf = 0; } else From b903a4276e41195398ef665de7a8cd25f07c90fd Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 12 Dec 2022 16:57:41 -0500 Subject: [PATCH 24/26] volumeChanged isn't shared --- src/engine/chipUtils.h | 1 - src/engine/platform/n163.h | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/engine/chipUtils.h b/src/engine/chipUtils.h index 04268582..13c302f7 100644 --- a/src/engine/chipUtils.h +++ b/src/engine/chipUtils.h @@ -56,7 +56,6 @@ struct SharedChannelFreq: public SharedChannel { // common shared channel volume struct template struct SharedChannelVolume { - bool volumeChanged; T vol, outVol, resVol; SharedChannelVolume(T initVol): vol(initVol), diff --git a/src/engine/platform/n163.h b/src/engine/platform/n163.h index d6fb4b2e..50142472 100644 --- a/src/engine/platform/n163.h +++ b/src/engine/platform/n163.h @@ -32,6 +32,7 @@ class DivPlatformN163: public DivDispatch { unsigned char waveMode; short loadWave, loadPos, loadLen; unsigned char loadMode; + bool volumeChanged; bool waveChanged, waveUpdated; DivMacroInt std; DivWaveSynth ws; @@ -50,6 +51,7 @@ class DivPlatformN163: public DivDispatch { loadPos(0), loadLen(0), loadMode(0), + volumeChanged(false), waveChanged(false), waveUpdated(false) {} }; From e58fb42d52d30d00923339f80c1148daeee05b6a Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 12 Dec 2022 17:18:13 -0500 Subject: [PATCH 25/26] resVol isn't shared --- src/engine/chipUtils.h | 5 ++--- src/engine/platform/n163.h | 2 ++ src/engine/platform/qsound.h | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/engine/chipUtils.h b/src/engine/chipUtils.h index 13c302f7..073783ef 100644 --- a/src/engine/chipUtils.h +++ b/src/engine/chipUtils.h @@ -56,11 +56,10 @@ struct SharedChannelFreq: public SharedChannel { // common shared channel volume struct template struct SharedChannelVolume { - T vol, outVol, resVol; + T vol, outVol; SharedChannelVolume(T initVol): vol(initVol), - outVol(initVol), - resVol(initVol) {} + outVol(initVol) {} }; #endif diff --git a/src/engine/platform/n163.h b/src/engine/platform/n163.h index 50142472..c1af6919 100644 --- a/src/engine/platform/n163.h +++ b/src/engine/platform/n163.h @@ -28,6 +28,7 @@ class DivPlatformN163: public DivDispatch { struct Channel: public SharedChannelFreq, public SharedChannelVolume { + signed char resVol; short wave, wavePos, waveLen; unsigned char waveMode; short loadWave, loadPos, loadLen; @@ -43,6 +44,7 @@ class DivPlatformN163: public DivDispatch { Channel(): SharedChannelFreq(), SharedChannelVolume(15), + resVol(15), wave(-1), wavePos(0), waveLen(0), diff --git a/src/engine/platform/qsound.h b/src/engine/platform/qsound.h index a4870988..6586e5df 100644 --- a/src/engine/platform/qsound.h +++ b/src/engine/platform/qsound.h @@ -27,6 +27,7 @@ class DivPlatformQSound: public DivDispatch { struct Channel: public SharedChannelFreq, public SharedChannelVolume { + int resVol; int sample, wave; int panning; int echo; @@ -38,7 +39,8 @@ class DivPlatformQSound: public DivDispatch { } Channel(): SharedChannelFreq(), - SharedChannelVolume(4095), + SharedChannelVolume(255), + resVol(4095), sample(-1), panning(0x10), echo(0), From 233037f6d27a135f343a8b81a775cdd37c1d9a16 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 12 Dec 2022 19:18:57 -0500 Subject: [PATCH 26/26] organize demo songs --- demos/README.md | 2 ++ demos/{ => a2600}/Coconut_Mall.fur | Bin demos/{ => a2600}/atari breakbeat.fur | Bin demos/{ => a2600}/the_erfngjt.fur | Bin demos/{ => amiga}/bruno_time.fur | Bin demos/{ => amiga}/m7 vibe.fur | Bin demos/{ => ay8910}/AY-3-8910_Jam.fur | Bin demos/{ => ay8910}/demoscenetypebeat.fur | Bin demos/{ => ay8930}/Red_Planet.fur | Bin demos/{ => ay8930}/duty fun.fur | Bin demos/{ => c64}/C64 junk.fur | Bin demos/{ => c64}/ChaosTune.fur | Bin demos/{ => c64}/DOOM_E1M1.fur | Bin demos/{ => c64}/DOOM_E1M3.fur | Bin demos/{ => c64}/The_Snippet.fur | Bin .../You're_Doing_Well!.fur} | Bin demos/{ => gameboy}/puggs_in_space.fur | Bin demos/{ => gameboy}/snowdin.fur | Bin demos/{ => genesis}/Another_winter.fur | Bin demos/{ => genesis}/Carnage.fur | Bin demos/{ => genesis}/Checknobankh.fur | Bin demos/{ => genesis}/CorridorsOfTimeRMX.fur | Bin .../Equinox Intro.fur} | Bin .../Solar_Man.fur} | Bin demos/{ => genesis}/Stereotactics_Rewritten.fur | Bin demos/{ => genesis}/Swaggin_Dragon.dmf | Bin demos/{ => genesis}/darkstar.dmf | Bin demos/{ => genesis}/the_serenity_of_lonliness.fur | Bin demos/{ => genesis}/yky.fur | Bin demos/{ => lynx}/LedStorm.fur | Bin .../Road_Rash_Grass_Valley.fur} | Bin demos/{ => lynx}/Tyrian-Camanis.fur | Bin demos/{ => lynx}/chippylotus.fur | Bin .../insert_title_here.fur} | Bin demos/{ => misc}/Eternal_Forest_Taito_Arcade.fur | Bin .../Neo_Seaside_Volley_Court_NeoGeo.fur} | Bin demos/{ => misc}/UT99_Run_Taito_Arcade.fur | Bin demos/{ => misc}/Utter Determination YM2610B.fur | Bin demos/{ => misc}/beeper_torture.fur | Bin .../fursuits_for_the_suspiciously_rich_MSM5232.fur} | Bin .../hope_for_the_dream_opm.fur} | Bin demos/{ => misc}/massive_x_opz.fur | Bin demos/{ => misc}/pseudogba_pwaa_godot.fur | Bin demos/{rule2.fur => misc/rule2_zx.fur} | Bin .../the_king_of_crisp_opm.fur} | Bin demos/{L’ambreSong.fur => msx/Il_ambreSong.fur} | Bin demos/{ => msx}/Lagrange_Point.fur | Bin demos/{ => msx}/Princess_of_the_Dead.fur | Bin demos/{ => msx}/opll-fashioned_drums.fur | Bin demos/{ => multichip}/AgentX.fur | Bin demos/{ => multichip}/BONUS. Sonic 2 Boss.fur | Bin demos/{ => multichip}/Between_the_Circuits.fur | Bin demos/{ => multichip}/ComicPartytrack20.fur | Bin demos/{ => multichip}/Fiorella YM2610B+YM2203.fur | Bin demos/{ => multichip}/Fusion.fur | Bin demos/{ => multichip}/HoldOn.fur | Bin demos/{ => multichip}/Ice_Wind_OPMSPCM.fur | Bin .../{ => multichip}/Jet_Pack_Adventure_GBAesque.fur | Bin .../{ => multichip}/MetalSlug_BaseCamp_SMS_TIA.fur | Bin demos/{ => multichip}/The_Good_Times_Arcade.fur | Bin .../Tubelectric_Fictional_Arcade.fur | Bin demos/{ => multichip}/cueball.fur | Bin demos/{ => multichip}/double-dragon-stage1.fur | Bin .../government funding breakcore-ish remix.fur | Bin demos/{ => multichip}/iji_tor.fur | Bin demos/{ => multichip}/meteor_shower.fur | Bin .../not genesis thing.fur} | Bin demos/{ => multichip}/overdrive.fur | Bin demos/{ => multichip}/ridiculous_game.fur | Bin demos/{ => multichip}/silverlining.fur | Bin demos/{ => multichip}/skate_or_die.fur | Bin demos/{ => multichip}/splashingwater.fur | Bin demos/{ => multichip}/super_fantasy_zone_mango.fur | Bin .../the_machines_are_socialising.fur | Bin demos/{ => namco}/Mars_Bar_On_Mars.fur | Bin demos/{ => namco}/Phoenix_cover.fur | Bin demos/{ => namco}/ice-cap-nc30.fur | Bin demos/{ => nes}/FDS TEST.fur | Bin .../Rise_against_the_ashes_to_the_new_dawn.fur | Bin demos/{ => nes}/Samsung SGH-x830 - Ringtone 8.fur | Bin demos/{ => nes}/The Cheetahmen.fur | Bin demos/{ => nes}/carve_your_own_path.fur | Bin demos/{ => nes}/going_up_a_step_at_time.fur | Bin demos/{ => nes}/oby1_ingame.fur | Bin demos/{ => nes}/spamton.fur | Bin demos/{ => opl}/Contraduct Design OPL3 Cover.fur | Bin demos/{ => opl}/E1M4OPL2.fur | Bin demos/{ => opl}/Egyptian_Rule.fur | Bin demos/{ => opl}/Funky_Bubbles_OPL3.fur | Bin demos/{ => opl}/Midnight_Dog_Orchestra.fur | Bin demos/{ => opl}/Moon.fur | Bin .../OPL3_SegaPCM_Xeno_Crisis_-_Facility_Area_2.fur | Bin demos/{ => opl}/Oh no, more sine waves.fur | Bin demos/{ => opl}/Waterworld_-_Map.fur | Bin demos/{ => opl}/fight and flight.fur | Bin demos/{ => opl}/green_biker_dude_opl.fur | Bin demos/{ => opl}/home_wfl_opl3.fur | Bin demos/{ => pc98}/MMXStageClear.fur | Bin demos/{ => pce}/Fake Gameboy.fur | Bin demos/{ => sms}/doorintosummer.fur | Bin demos/{ => snes}/very chill snes.fur | Bin .../{ => specs2}/Silver Surfer - Stage Music 1.fur | Bin demos/{ => specs2}/atmosphere.fur | Bin demos/{ => specs2}/su_memory.fur | Bin demos/{ => specs2}/thick bass test.fur | Bin demos/{ => specs2}/vaportrail_staffroll.fur | Bin .../Rave_Dancetune.fur} | Bin demos/{ => virtualboy}/SeeingRed.fur | Bin demos/{ => wonderswan}/Bullet_Hell.fur | Bin .../Rusty_-_Queen_in_the_Dark_Night.fur | Bin demos/{ => wonderswan}/TimeTrial.fur | Bin demos/{ => wonderswan}/sijofsjfsoeife.fur | Bin demos/{ => x16}/Cafe - 010 Editor 2.0crk.fur | Bin .../Identity_Believer.fur} | Bin demos/{her11_veraedit.fur => x16/her11.fur} | Bin demos/{ => x16}/lunacommdemo.fur | Bin demos/{ => x16}/watching_paint_dry.fur | Bin 117 files changed, 2 insertions(+) rename demos/{ => a2600}/Coconut_Mall.fur (100%) rename demos/{ => a2600}/atari breakbeat.fur (100%) rename demos/{ => a2600}/the_erfngjt.fur (100%) rename demos/{ => amiga}/bruno_time.fur (100%) rename demos/{ => amiga}/m7 vibe.fur (100%) rename demos/{ => ay8910}/AY-3-8910_Jam.fur (100%) rename demos/{ => ay8910}/demoscenetypebeat.fur (100%) rename demos/{ => ay8930}/Red_Planet.fur (100%) rename demos/{ => ay8930}/duty fun.fur (100%) rename demos/{ => c64}/C64 junk.fur (100%) rename demos/{ => c64}/ChaosTune.fur (100%) rename demos/{ => c64}/DOOM_E1M1.fur (100%) rename demos/{ => c64}/DOOM_E1M3.fur (100%) rename demos/{ => c64}/The_Snippet.fur (100%) rename demos/{You're_Doing_Well!_GB.fur => gameboy/You're_Doing_Well!.fur} (100%) rename demos/{ => gameboy}/puggs_in_space.fur (100%) rename demos/{ => gameboy}/snowdin.fur (100%) mode change 100755 => 100644 rename demos/{ => genesis}/Another_winter.fur (100%) rename demos/{ => genesis}/Carnage.fur (100%) rename demos/{ => genesis}/Checknobankh.fur (100%) rename demos/{ => genesis}/CorridorsOfTimeRMX.fur (100%) rename demos/{GEN Equinox Intro.fur => genesis/Equinox Intro.fur} (100%) rename demos/{Solar_Man_Genesis.fur => genesis/Solar_Man.fur} (100%) rename demos/{ => genesis}/Stereotactics_Rewritten.fur (100%) rename demos/{ => genesis}/Swaggin_Dragon.dmf (100%) rename demos/{ => genesis}/darkstar.dmf (100%) rename demos/{ => genesis}/the_serenity_of_lonliness.fur (100%) rename demos/{ => genesis}/yky.fur (100%) rename demos/{ => lynx}/LedStorm.fur (100%) rename demos/{Road_Rash_Grass_Valley_Lynx_01d.fur => lynx/Road_Rash_Grass_Valley.fur} (100%) rename demos/{ => lynx}/Tyrian-Camanis.fur (100%) rename demos/{ => lynx}/chippylotus.fur (100%) rename demos/{insert_title_lynx.fur => lynx/insert_title_here.fur} (100%) rename demos/{ => misc}/Eternal_Forest_Taito_Arcade.fur (100%) rename demos/{Neo_Seaside_Volley_Court.fur => misc/Neo_Seaside_Volley_Court_NeoGeo.fur} (100%) rename demos/{ => misc}/UT99_Run_Taito_Arcade.fur (100%) rename demos/{ => misc}/Utter Determination YM2610B.fur (100%) rename demos/{ => misc}/beeper_torture.fur (100%) rename demos/{fursuits_for_the_suspiciously_rich.fur => misc/fursuits_for_the_suspiciously_rich_MSM5232.fur} (100%) rename demos/{hope_for_the_dream.fur => misc/hope_for_the_dream_opm.fur} (100%) rename demos/{ => misc}/massive_x_opz.fur (100%) rename demos/{ => misc}/pseudogba_pwaa_godot.fur (100%) rename demos/{rule2.fur => misc/rule2_zx.fur} (100%) rename demos/{the_king_of_crisp.fur => misc/the_king_of_crisp_opm.fur} (100%) rename demos/{L’ambreSong.fur => msx/Il_ambreSong.fur} (100%) rename demos/{ => msx}/Lagrange_Point.fur (100%) rename demos/{ => msx}/Princess_of_the_Dead.fur (100%) rename demos/{ => msx}/opll-fashioned_drums.fur (100%) rename demos/{ => multichip}/AgentX.fur (100%) rename demos/{ => multichip}/BONUS. Sonic 2 Boss.fur (100%) rename demos/{ => multichip}/Between_the_Circuits.fur (100%) rename demos/{ => multichip}/ComicPartytrack20.fur (100%) rename demos/{ => multichip}/Fiorella YM2610B+YM2203.fur (100%) rename demos/{ => multichip}/Fusion.fur (100%) rename demos/{ => multichip}/HoldOn.fur (100%) rename demos/{ => multichip}/Ice_Wind_OPMSPCM.fur (100%) rename demos/{ => multichip}/Jet_Pack_Adventure_GBAesque.fur (100%) rename demos/{ => multichip}/MetalSlug_BaseCamp_SMS_TIA.fur (100%) rename demos/{ => multichip}/The_Good_Times_Arcade.fur (100%) rename demos/{ => multichip}/Tubelectric_Fictional_Arcade.fur (100%) rename demos/{ => multichip}/cueball.fur (100%) rename demos/{ => multichip}/double-dragon-stage1.fur (100%) rename demos/{ => multichip}/government funding breakcore-ish remix.fur (100%) rename demos/{ => multichip}/iji_tor.fur (100%) rename demos/{ => multichip}/meteor_shower.fur (100%) rename demos/{genesis thing.fur => multichip/not genesis thing.fur} (100%) rename demos/{ => multichip}/overdrive.fur (100%) rename demos/{ => multichip}/ridiculous_game.fur (100%) rename demos/{ => multichip}/silverlining.fur (100%) rename demos/{ => multichip}/skate_or_die.fur (100%) rename demos/{ => multichip}/splashingwater.fur (100%) rename demos/{ => multichip}/super_fantasy_zone_mango.fur (100%) rename demos/{ => multichip}/the_machines_are_socialising.fur (100%) rename demos/{ => namco}/Mars_Bar_On_Mars.fur (100%) rename demos/{ => namco}/Phoenix_cover.fur (100%) rename demos/{ => namco}/ice-cap-nc30.fur (100%) rename demos/{ => nes}/FDS TEST.fur (100%) rename demos/{ => nes}/Rise_against_the_ashes_to_the_new_dawn.fur (100%) rename demos/{ => nes}/Samsung SGH-x830 - Ringtone 8.fur (100%) rename demos/{ => nes}/The Cheetahmen.fur (100%) rename demos/{ => nes}/carve_your_own_path.fur (100%) rename demos/{ => nes}/going_up_a_step_at_time.fur (100%) rename demos/{ => nes}/oby1_ingame.fur (100%) rename demos/{ => nes}/spamton.fur (100%) rename demos/{ => opl}/Contraduct Design OPL3 Cover.fur (100%) rename demos/{ => opl}/E1M4OPL2.fur (100%) rename demos/{ => opl}/Egyptian_Rule.fur (100%) rename demos/{ => opl}/Funky_Bubbles_OPL3.fur (100%) rename demos/{ => opl}/Midnight_Dog_Orchestra.fur (100%) rename demos/{ => opl}/Moon.fur (100%) rename demos/{ => opl}/OPL3_SegaPCM_Xeno_Crisis_-_Facility_Area_2.fur (100%) rename demos/{ => opl}/Oh no, more sine waves.fur (100%) rename demos/{ => opl}/Waterworld_-_Map.fur (100%) rename demos/{ => opl}/fight and flight.fur (100%) rename demos/{ => opl}/green_biker_dude_opl.fur (100%) rename demos/{ => opl}/home_wfl_opl3.fur (100%) rename demos/{ => pc98}/MMXStageClear.fur (100%) rename demos/{ => pce}/Fake Gameboy.fur (100%) rename demos/{ => sms}/doorintosummer.fur (100%) rename demos/{ => snes}/very chill snes.fur (100%) rename demos/{ => specs2}/Silver Surfer - Stage Music 1.fur (100%) rename demos/{ => specs2}/atmosphere.fur (100%) rename demos/{ => specs2}/su_memory.fur (100%) rename demos/{ => specs2}/thick bass test.fur (100%) rename demos/{ => specs2}/vaportrail_staffroll.fur (100%) rename demos/{Rave_Dancetune_VSU-VUE.fur => virtualboy/Rave_Dancetune.fur} (100%) rename demos/{ => virtualboy}/SeeingRed.fur (100%) rename demos/{ => wonderswan}/Bullet_Hell.fur (100%) rename demos/{ => wonderswan}/Rusty_-_Queen_in_the_Dark_Night.fur (100%) rename demos/{ => wonderswan}/TimeTrial.fur (100%) rename demos/{ => wonderswan}/sijofsjfsoeife.fur (100%) rename demos/{ => x16}/Cafe - 010 Editor 2.0crk.fur (100%) rename demos/{Identity_Believer_VERA.fur => x16/Identity_Believer.fur} (100%) rename demos/{her11_veraedit.fur => x16/her11.fur} (100%) rename demos/{ => x16}/lunacommdemo.fur (100%) rename demos/{ => x16}/watching_paint_dry.fur (100%) diff --git a/demos/README.md b/demos/README.md index 49d5cb37..eb2fced3 100644 --- a/demos/README.md +++ b/demos/README.md @@ -12,6 +12,8 @@ contact me or send a pull request if you want your song to be added to this coll - big label music covers also are discouraged - low effort compositions/covers may not be accepted at all. +make sure to put your demo song under the respective category. + tildearrow also accepts demo songs in the .dmf format as well as the .fur format. thank you for contributing! diff --git a/demos/Coconut_Mall.fur b/demos/a2600/Coconut_Mall.fur similarity index 100% rename from demos/Coconut_Mall.fur rename to demos/a2600/Coconut_Mall.fur diff --git a/demos/atari breakbeat.fur b/demos/a2600/atari breakbeat.fur similarity index 100% rename from demos/atari breakbeat.fur rename to demos/a2600/atari breakbeat.fur diff --git a/demos/the_erfngjt.fur b/demos/a2600/the_erfngjt.fur similarity index 100% rename from demos/the_erfngjt.fur rename to demos/a2600/the_erfngjt.fur diff --git a/demos/bruno_time.fur b/demos/amiga/bruno_time.fur similarity index 100% rename from demos/bruno_time.fur rename to demos/amiga/bruno_time.fur diff --git a/demos/m7 vibe.fur b/demos/amiga/m7 vibe.fur similarity index 100% rename from demos/m7 vibe.fur rename to demos/amiga/m7 vibe.fur diff --git a/demos/AY-3-8910_Jam.fur b/demos/ay8910/AY-3-8910_Jam.fur similarity index 100% rename from demos/AY-3-8910_Jam.fur rename to demos/ay8910/AY-3-8910_Jam.fur diff --git a/demos/demoscenetypebeat.fur b/demos/ay8910/demoscenetypebeat.fur similarity index 100% rename from demos/demoscenetypebeat.fur rename to demos/ay8910/demoscenetypebeat.fur diff --git a/demos/Red_Planet.fur b/demos/ay8930/Red_Planet.fur similarity index 100% rename from demos/Red_Planet.fur rename to demos/ay8930/Red_Planet.fur diff --git a/demos/duty fun.fur b/demos/ay8930/duty fun.fur similarity index 100% rename from demos/duty fun.fur rename to demos/ay8930/duty fun.fur diff --git a/demos/C64 junk.fur b/demos/c64/C64 junk.fur similarity index 100% rename from demos/C64 junk.fur rename to demos/c64/C64 junk.fur diff --git a/demos/ChaosTune.fur b/demos/c64/ChaosTune.fur similarity index 100% rename from demos/ChaosTune.fur rename to demos/c64/ChaosTune.fur diff --git a/demos/DOOM_E1M1.fur b/demos/c64/DOOM_E1M1.fur similarity index 100% rename from demos/DOOM_E1M1.fur rename to demos/c64/DOOM_E1M1.fur diff --git a/demos/DOOM_E1M3.fur b/demos/c64/DOOM_E1M3.fur similarity index 100% rename from demos/DOOM_E1M3.fur rename to demos/c64/DOOM_E1M3.fur diff --git a/demos/The_Snippet.fur b/demos/c64/The_Snippet.fur similarity index 100% rename from demos/The_Snippet.fur rename to demos/c64/The_Snippet.fur diff --git a/demos/You're_Doing_Well!_GB.fur b/demos/gameboy/You're_Doing_Well!.fur similarity index 100% rename from demos/You're_Doing_Well!_GB.fur rename to demos/gameboy/You're_Doing_Well!.fur diff --git a/demos/puggs_in_space.fur b/demos/gameboy/puggs_in_space.fur similarity index 100% rename from demos/puggs_in_space.fur rename to demos/gameboy/puggs_in_space.fur diff --git a/demos/snowdin.fur b/demos/gameboy/snowdin.fur old mode 100755 new mode 100644 similarity index 100% rename from demos/snowdin.fur rename to demos/gameboy/snowdin.fur diff --git a/demos/Another_winter.fur b/demos/genesis/Another_winter.fur similarity index 100% rename from demos/Another_winter.fur rename to demos/genesis/Another_winter.fur diff --git a/demos/Carnage.fur b/demos/genesis/Carnage.fur similarity index 100% rename from demos/Carnage.fur rename to demos/genesis/Carnage.fur diff --git a/demos/Checknobankh.fur b/demos/genesis/Checknobankh.fur similarity index 100% rename from demos/Checknobankh.fur rename to demos/genesis/Checknobankh.fur diff --git a/demos/CorridorsOfTimeRMX.fur b/demos/genesis/CorridorsOfTimeRMX.fur similarity index 100% rename from demos/CorridorsOfTimeRMX.fur rename to demos/genesis/CorridorsOfTimeRMX.fur diff --git a/demos/GEN Equinox Intro.fur b/demos/genesis/Equinox Intro.fur similarity index 100% rename from demos/GEN Equinox Intro.fur rename to demos/genesis/Equinox Intro.fur diff --git a/demos/Solar_Man_Genesis.fur b/demos/genesis/Solar_Man.fur similarity index 100% rename from demos/Solar_Man_Genesis.fur rename to demos/genesis/Solar_Man.fur diff --git a/demos/Stereotactics_Rewritten.fur b/demos/genesis/Stereotactics_Rewritten.fur similarity index 100% rename from demos/Stereotactics_Rewritten.fur rename to demos/genesis/Stereotactics_Rewritten.fur diff --git a/demos/Swaggin_Dragon.dmf b/demos/genesis/Swaggin_Dragon.dmf similarity index 100% rename from demos/Swaggin_Dragon.dmf rename to demos/genesis/Swaggin_Dragon.dmf diff --git a/demos/darkstar.dmf b/demos/genesis/darkstar.dmf similarity index 100% rename from demos/darkstar.dmf rename to demos/genesis/darkstar.dmf diff --git a/demos/the_serenity_of_lonliness.fur b/demos/genesis/the_serenity_of_lonliness.fur similarity index 100% rename from demos/the_serenity_of_lonliness.fur rename to demos/genesis/the_serenity_of_lonliness.fur diff --git a/demos/yky.fur b/demos/genesis/yky.fur similarity index 100% rename from demos/yky.fur rename to demos/genesis/yky.fur diff --git a/demos/LedStorm.fur b/demos/lynx/LedStorm.fur similarity index 100% rename from demos/LedStorm.fur rename to demos/lynx/LedStorm.fur diff --git a/demos/Road_Rash_Grass_Valley_Lynx_01d.fur b/demos/lynx/Road_Rash_Grass_Valley.fur similarity index 100% rename from demos/Road_Rash_Grass_Valley_Lynx_01d.fur rename to demos/lynx/Road_Rash_Grass_Valley.fur diff --git a/demos/Tyrian-Camanis.fur b/demos/lynx/Tyrian-Camanis.fur similarity index 100% rename from demos/Tyrian-Camanis.fur rename to demos/lynx/Tyrian-Camanis.fur diff --git a/demos/chippylotus.fur b/demos/lynx/chippylotus.fur similarity index 100% rename from demos/chippylotus.fur rename to demos/lynx/chippylotus.fur diff --git a/demos/insert_title_lynx.fur b/demos/lynx/insert_title_here.fur similarity index 100% rename from demos/insert_title_lynx.fur rename to demos/lynx/insert_title_here.fur diff --git a/demos/Eternal_Forest_Taito_Arcade.fur b/demos/misc/Eternal_Forest_Taito_Arcade.fur similarity index 100% rename from demos/Eternal_Forest_Taito_Arcade.fur rename to demos/misc/Eternal_Forest_Taito_Arcade.fur diff --git a/demos/Neo_Seaside_Volley_Court.fur b/demos/misc/Neo_Seaside_Volley_Court_NeoGeo.fur similarity index 100% rename from demos/Neo_Seaside_Volley_Court.fur rename to demos/misc/Neo_Seaside_Volley_Court_NeoGeo.fur diff --git a/demos/UT99_Run_Taito_Arcade.fur b/demos/misc/UT99_Run_Taito_Arcade.fur similarity index 100% rename from demos/UT99_Run_Taito_Arcade.fur rename to demos/misc/UT99_Run_Taito_Arcade.fur diff --git a/demos/Utter Determination YM2610B.fur b/demos/misc/Utter Determination YM2610B.fur similarity index 100% rename from demos/Utter Determination YM2610B.fur rename to demos/misc/Utter Determination YM2610B.fur diff --git a/demos/beeper_torture.fur b/demos/misc/beeper_torture.fur similarity index 100% rename from demos/beeper_torture.fur rename to demos/misc/beeper_torture.fur diff --git a/demos/fursuits_for_the_suspiciously_rich.fur b/demos/misc/fursuits_for_the_suspiciously_rich_MSM5232.fur similarity index 100% rename from demos/fursuits_for_the_suspiciously_rich.fur rename to demos/misc/fursuits_for_the_suspiciously_rich_MSM5232.fur diff --git a/demos/hope_for_the_dream.fur b/demos/misc/hope_for_the_dream_opm.fur similarity index 100% rename from demos/hope_for_the_dream.fur rename to demos/misc/hope_for_the_dream_opm.fur diff --git a/demos/massive_x_opz.fur b/demos/misc/massive_x_opz.fur similarity index 100% rename from demos/massive_x_opz.fur rename to demos/misc/massive_x_opz.fur diff --git a/demos/pseudogba_pwaa_godot.fur b/demos/misc/pseudogba_pwaa_godot.fur similarity index 100% rename from demos/pseudogba_pwaa_godot.fur rename to demos/misc/pseudogba_pwaa_godot.fur diff --git a/demos/rule2.fur b/demos/misc/rule2_zx.fur similarity index 100% rename from demos/rule2.fur rename to demos/misc/rule2_zx.fur diff --git a/demos/the_king_of_crisp.fur b/demos/misc/the_king_of_crisp_opm.fur similarity index 100% rename from demos/the_king_of_crisp.fur rename to demos/misc/the_king_of_crisp_opm.fur diff --git a/demos/L’ambreSong.fur b/demos/msx/Il_ambreSong.fur similarity index 100% rename from demos/L’ambreSong.fur rename to demos/msx/Il_ambreSong.fur diff --git a/demos/Lagrange_Point.fur b/demos/msx/Lagrange_Point.fur similarity index 100% rename from demos/Lagrange_Point.fur rename to demos/msx/Lagrange_Point.fur diff --git a/demos/Princess_of_the_Dead.fur b/demos/msx/Princess_of_the_Dead.fur similarity index 100% rename from demos/Princess_of_the_Dead.fur rename to demos/msx/Princess_of_the_Dead.fur diff --git a/demos/opll-fashioned_drums.fur b/demos/msx/opll-fashioned_drums.fur similarity index 100% rename from demos/opll-fashioned_drums.fur rename to demos/msx/opll-fashioned_drums.fur diff --git a/demos/AgentX.fur b/demos/multichip/AgentX.fur similarity index 100% rename from demos/AgentX.fur rename to demos/multichip/AgentX.fur diff --git a/demos/BONUS. Sonic 2 Boss.fur b/demos/multichip/BONUS. Sonic 2 Boss.fur similarity index 100% rename from demos/BONUS. Sonic 2 Boss.fur rename to demos/multichip/BONUS. Sonic 2 Boss.fur diff --git a/demos/Between_the_Circuits.fur b/demos/multichip/Between_the_Circuits.fur similarity index 100% rename from demos/Between_the_Circuits.fur rename to demos/multichip/Between_the_Circuits.fur diff --git a/demos/ComicPartytrack20.fur b/demos/multichip/ComicPartytrack20.fur similarity index 100% rename from demos/ComicPartytrack20.fur rename to demos/multichip/ComicPartytrack20.fur diff --git a/demos/Fiorella YM2610B+YM2203.fur b/demos/multichip/Fiorella YM2610B+YM2203.fur similarity index 100% rename from demos/Fiorella YM2610B+YM2203.fur rename to demos/multichip/Fiorella YM2610B+YM2203.fur diff --git a/demos/Fusion.fur b/demos/multichip/Fusion.fur similarity index 100% rename from demos/Fusion.fur rename to demos/multichip/Fusion.fur diff --git a/demos/HoldOn.fur b/demos/multichip/HoldOn.fur similarity index 100% rename from demos/HoldOn.fur rename to demos/multichip/HoldOn.fur diff --git a/demos/Ice_Wind_OPMSPCM.fur b/demos/multichip/Ice_Wind_OPMSPCM.fur similarity index 100% rename from demos/Ice_Wind_OPMSPCM.fur rename to demos/multichip/Ice_Wind_OPMSPCM.fur diff --git a/demos/Jet_Pack_Adventure_GBAesque.fur b/demos/multichip/Jet_Pack_Adventure_GBAesque.fur similarity index 100% rename from demos/Jet_Pack_Adventure_GBAesque.fur rename to demos/multichip/Jet_Pack_Adventure_GBAesque.fur diff --git a/demos/MetalSlug_BaseCamp_SMS_TIA.fur b/demos/multichip/MetalSlug_BaseCamp_SMS_TIA.fur similarity index 100% rename from demos/MetalSlug_BaseCamp_SMS_TIA.fur rename to demos/multichip/MetalSlug_BaseCamp_SMS_TIA.fur diff --git a/demos/The_Good_Times_Arcade.fur b/demos/multichip/The_Good_Times_Arcade.fur similarity index 100% rename from demos/The_Good_Times_Arcade.fur rename to demos/multichip/The_Good_Times_Arcade.fur diff --git a/demos/Tubelectric_Fictional_Arcade.fur b/demos/multichip/Tubelectric_Fictional_Arcade.fur similarity index 100% rename from demos/Tubelectric_Fictional_Arcade.fur rename to demos/multichip/Tubelectric_Fictional_Arcade.fur diff --git a/demos/cueball.fur b/demos/multichip/cueball.fur similarity index 100% rename from demos/cueball.fur rename to demos/multichip/cueball.fur diff --git a/demos/double-dragon-stage1.fur b/demos/multichip/double-dragon-stage1.fur similarity index 100% rename from demos/double-dragon-stage1.fur rename to demos/multichip/double-dragon-stage1.fur diff --git a/demos/government funding breakcore-ish remix.fur b/demos/multichip/government funding breakcore-ish remix.fur similarity index 100% rename from demos/government funding breakcore-ish remix.fur rename to demos/multichip/government funding breakcore-ish remix.fur diff --git a/demos/iji_tor.fur b/demos/multichip/iji_tor.fur similarity index 100% rename from demos/iji_tor.fur rename to demos/multichip/iji_tor.fur diff --git a/demos/meteor_shower.fur b/demos/multichip/meteor_shower.fur similarity index 100% rename from demos/meteor_shower.fur rename to demos/multichip/meteor_shower.fur diff --git a/demos/genesis thing.fur b/demos/multichip/not genesis thing.fur similarity index 100% rename from demos/genesis thing.fur rename to demos/multichip/not genesis thing.fur diff --git a/demos/overdrive.fur b/demos/multichip/overdrive.fur similarity index 100% rename from demos/overdrive.fur rename to demos/multichip/overdrive.fur diff --git a/demos/ridiculous_game.fur b/demos/multichip/ridiculous_game.fur similarity index 100% rename from demos/ridiculous_game.fur rename to demos/multichip/ridiculous_game.fur diff --git a/demos/silverlining.fur b/demos/multichip/silverlining.fur similarity index 100% rename from demos/silverlining.fur rename to demos/multichip/silverlining.fur diff --git a/demos/skate_or_die.fur b/demos/multichip/skate_or_die.fur similarity index 100% rename from demos/skate_or_die.fur rename to demos/multichip/skate_or_die.fur diff --git a/demos/splashingwater.fur b/demos/multichip/splashingwater.fur similarity index 100% rename from demos/splashingwater.fur rename to demos/multichip/splashingwater.fur diff --git a/demos/super_fantasy_zone_mango.fur b/demos/multichip/super_fantasy_zone_mango.fur similarity index 100% rename from demos/super_fantasy_zone_mango.fur rename to demos/multichip/super_fantasy_zone_mango.fur diff --git a/demos/the_machines_are_socialising.fur b/demos/multichip/the_machines_are_socialising.fur similarity index 100% rename from demos/the_machines_are_socialising.fur rename to demos/multichip/the_machines_are_socialising.fur diff --git a/demos/Mars_Bar_On_Mars.fur b/demos/namco/Mars_Bar_On_Mars.fur similarity index 100% rename from demos/Mars_Bar_On_Mars.fur rename to demos/namco/Mars_Bar_On_Mars.fur diff --git a/demos/Phoenix_cover.fur b/demos/namco/Phoenix_cover.fur similarity index 100% rename from demos/Phoenix_cover.fur rename to demos/namco/Phoenix_cover.fur diff --git a/demos/ice-cap-nc30.fur b/demos/namco/ice-cap-nc30.fur similarity index 100% rename from demos/ice-cap-nc30.fur rename to demos/namco/ice-cap-nc30.fur diff --git a/demos/FDS TEST.fur b/demos/nes/FDS TEST.fur similarity index 100% rename from demos/FDS TEST.fur rename to demos/nes/FDS TEST.fur diff --git a/demos/Rise_against_the_ashes_to_the_new_dawn.fur b/demos/nes/Rise_against_the_ashes_to_the_new_dawn.fur similarity index 100% rename from demos/Rise_against_the_ashes_to_the_new_dawn.fur rename to demos/nes/Rise_against_the_ashes_to_the_new_dawn.fur diff --git a/demos/Samsung SGH-x830 - Ringtone 8.fur b/demos/nes/Samsung SGH-x830 - Ringtone 8.fur similarity index 100% rename from demos/Samsung SGH-x830 - Ringtone 8.fur rename to demos/nes/Samsung SGH-x830 - Ringtone 8.fur diff --git a/demos/The Cheetahmen.fur b/demos/nes/The Cheetahmen.fur similarity index 100% rename from demos/The Cheetahmen.fur rename to demos/nes/The Cheetahmen.fur diff --git a/demos/carve_your_own_path.fur b/demos/nes/carve_your_own_path.fur similarity index 100% rename from demos/carve_your_own_path.fur rename to demos/nes/carve_your_own_path.fur diff --git a/demos/going_up_a_step_at_time.fur b/demos/nes/going_up_a_step_at_time.fur similarity index 100% rename from demos/going_up_a_step_at_time.fur rename to demos/nes/going_up_a_step_at_time.fur diff --git a/demos/oby1_ingame.fur b/demos/nes/oby1_ingame.fur similarity index 100% rename from demos/oby1_ingame.fur rename to demos/nes/oby1_ingame.fur diff --git a/demos/spamton.fur b/demos/nes/spamton.fur similarity index 100% rename from demos/spamton.fur rename to demos/nes/spamton.fur diff --git a/demos/Contraduct Design OPL3 Cover.fur b/demos/opl/Contraduct Design OPL3 Cover.fur similarity index 100% rename from demos/Contraduct Design OPL3 Cover.fur rename to demos/opl/Contraduct Design OPL3 Cover.fur diff --git a/demos/E1M4OPL2.fur b/demos/opl/E1M4OPL2.fur similarity index 100% rename from demos/E1M4OPL2.fur rename to demos/opl/E1M4OPL2.fur diff --git a/demos/Egyptian_Rule.fur b/demos/opl/Egyptian_Rule.fur similarity index 100% rename from demos/Egyptian_Rule.fur rename to demos/opl/Egyptian_Rule.fur diff --git a/demos/Funky_Bubbles_OPL3.fur b/demos/opl/Funky_Bubbles_OPL3.fur similarity index 100% rename from demos/Funky_Bubbles_OPL3.fur rename to demos/opl/Funky_Bubbles_OPL3.fur diff --git a/demos/Midnight_Dog_Orchestra.fur b/demos/opl/Midnight_Dog_Orchestra.fur similarity index 100% rename from demos/Midnight_Dog_Orchestra.fur rename to demos/opl/Midnight_Dog_Orchestra.fur diff --git a/demos/Moon.fur b/demos/opl/Moon.fur similarity index 100% rename from demos/Moon.fur rename to demos/opl/Moon.fur diff --git a/demos/OPL3_SegaPCM_Xeno_Crisis_-_Facility_Area_2.fur b/demos/opl/OPL3_SegaPCM_Xeno_Crisis_-_Facility_Area_2.fur similarity index 100% rename from demos/OPL3_SegaPCM_Xeno_Crisis_-_Facility_Area_2.fur rename to demos/opl/OPL3_SegaPCM_Xeno_Crisis_-_Facility_Area_2.fur diff --git a/demos/Oh no, more sine waves.fur b/demos/opl/Oh no, more sine waves.fur similarity index 100% rename from demos/Oh no, more sine waves.fur rename to demos/opl/Oh no, more sine waves.fur diff --git a/demos/Waterworld_-_Map.fur b/demos/opl/Waterworld_-_Map.fur similarity index 100% rename from demos/Waterworld_-_Map.fur rename to demos/opl/Waterworld_-_Map.fur diff --git a/demos/fight and flight.fur b/demos/opl/fight and flight.fur similarity index 100% rename from demos/fight and flight.fur rename to demos/opl/fight and flight.fur diff --git a/demos/green_biker_dude_opl.fur b/demos/opl/green_biker_dude_opl.fur similarity index 100% rename from demos/green_biker_dude_opl.fur rename to demos/opl/green_biker_dude_opl.fur diff --git a/demos/home_wfl_opl3.fur b/demos/opl/home_wfl_opl3.fur similarity index 100% rename from demos/home_wfl_opl3.fur rename to demos/opl/home_wfl_opl3.fur diff --git a/demos/MMXStageClear.fur b/demos/pc98/MMXStageClear.fur similarity index 100% rename from demos/MMXStageClear.fur rename to demos/pc98/MMXStageClear.fur diff --git a/demos/Fake Gameboy.fur b/demos/pce/Fake Gameboy.fur similarity index 100% rename from demos/Fake Gameboy.fur rename to demos/pce/Fake Gameboy.fur diff --git a/demos/doorintosummer.fur b/demos/sms/doorintosummer.fur similarity index 100% rename from demos/doorintosummer.fur rename to demos/sms/doorintosummer.fur diff --git a/demos/very chill snes.fur b/demos/snes/very chill snes.fur similarity index 100% rename from demos/very chill snes.fur rename to demos/snes/very chill snes.fur diff --git a/demos/Silver Surfer - Stage Music 1.fur b/demos/specs2/Silver Surfer - Stage Music 1.fur similarity index 100% rename from demos/Silver Surfer - Stage Music 1.fur rename to demos/specs2/Silver Surfer - Stage Music 1.fur diff --git a/demos/atmosphere.fur b/demos/specs2/atmosphere.fur similarity index 100% rename from demos/atmosphere.fur rename to demos/specs2/atmosphere.fur diff --git a/demos/su_memory.fur b/demos/specs2/su_memory.fur similarity index 100% rename from demos/su_memory.fur rename to demos/specs2/su_memory.fur diff --git a/demos/thick bass test.fur b/demos/specs2/thick bass test.fur similarity index 100% rename from demos/thick bass test.fur rename to demos/specs2/thick bass test.fur diff --git a/demos/vaportrail_staffroll.fur b/demos/specs2/vaportrail_staffroll.fur similarity index 100% rename from demos/vaportrail_staffroll.fur rename to demos/specs2/vaportrail_staffroll.fur diff --git a/demos/Rave_Dancetune_VSU-VUE.fur b/demos/virtualboy/Rave_Dancetune.fur similarity index 100% rename from demos/Rave_Dancetune_VSU-VUE.fur rename to demos/virtualboy/Rave_Dancetune.fur diff --git a/demos/SeeingRed.fur b/demos/virtualboy/SeeingRed.fur similarity index 100% rename from demos/SeeingRed.fur rename to demos/virtualboy/SeeingRed.fur diff --git a/demos/Bullet_Hell.fur b/demos/wonderswan/Bullet_Hell.fur similarity index 100% rename from demos/Bullet_Hell.fur rename to demos/wonderswan/Bullet_Hell.fur diff --git a/demos/Rusty_-_Queen_in_the_Dark_Night.fur b/demos/wonderswan/Rusty_-_Queen_in_the_Dark_Night.fur similarity index 100% rename from demos/Rusty_-_Queen_in_the_Dark_Night.fur rename to demos/wonderswan/Rusty_-_Queen_in_the_Dark_Night.fur diff --git a/demos/TimeTrial.fur b/demos/wonderswan/TimeTrial.fur similarity index 100% rename from demos/TimeTrial.fur rename to demos/wonderswan/TimeTrial.fur diff --git a/demos/sijofsjfsoeife.fur b/demos/wonderswan/sijofsjfsoeife.fur similarity index 100% rename from demos/sijofsjfsoeife.fur rename to demos/wonderswan/sijofsjfsoeife.fur diff --git a/demos/Cafe - 010 Editor 2.0crk.fur b/demos/x16/Cafe - 010 Editor 2.0crk.fur similarity index 100% rename from demos/Cafe - 010 Editor 2.0crk.fur rename to demos/x16/Cafe - 010 Editor 2.0crk.fur diff --git a/demos/Identity_Believer_VERA.fur b/demos/x16/Identity_Believer.fur similarity index 100% rename from demos/Identity_Believer_VERA.fur rename to demos/x16/Identity_Believer.fur diff --git a/demos/her11_veraedit.fur b/demos/x16/her11.fur similarity index 100% rename from demos/her11_veraedit.fur rename to demos/x16/her11.fur diff --git a/demos/lunacommdemo.fur b/demos/x16/lunacommdemo.fur similarity index 100% rename from demos/lunacommdemo.fur rename to demos/x16/lunacommdemo.fur diff --git a/demos/watching_paint_dry.fur b/demos/x16/watching_paint_dry.fur similarity index 100% rename from demos/watching_paint_dry.fur rename to demos/x16/watching_paint_dry.fur