Merge branch 'master' of https://github.com/tildearrow/furnace into es5506_alt

This commit is contained in:
cam900 2023-01-02 09:26:05 +09:00
commit 8a71a81ffb
44 changed files with 76 additions and 46 deletions

View File

@ -225,6 +225,9 @@ jobs:
fi
elif [ '${{ matrix.config.compiler }}' == 'mingw' ]; then
CMAKE_EXTRA_ARGS+=('-DCMAKE_TOOLCHAIN_FILE=scripts/Cross-MinGW-${{ steps.windows-identify.outputs.mingw-target }}.cmake')
if [ '${{ matrix.config.arch }}' == 'x86' ]; then
CMAKE_EXTRA_ARGS+=('-DSUPPORT_XP=ON')
fi
elif [ '${{ runner.os }}' == 'macOS' ]; then
if [ '${{ matrix.config.arch }}' == 'arm64' ]; then
CMAKE_EXTRA_ARGS+=('-DCMAKE_OSX_DEPLOYMENT_TARGET="11.0"' '-DCMAKE_OSX_ARCHITECTURES=arm64')

View File

@ -66,6 +66,7 @@ option(SYSTEM_LIBSNDFILE "Use a system-installed version of libsndfile instead o
option(SYSTEM_RTMIDI "Use a system-installed version of RtMidi instead of the vendored one" OFF)
option(SYSTEM_ZLIB "Use a system-installed version of zlib instead of the vendored one" OFF)
option(SYSTEM_SDL2 "Use a system-installed version of SDL2 instead of the vendored one" ${SYSTEM_SDL2_DEFAULT})
option(SUPPORT_XP "Build a Windows XP-compatible binary" OFF)
option(WARNINGS_ARE_ERRORS "Whether warnings in furnace's C++ code should be treated as errors" OFF)
option(WITH_DEMOS "Install demo songs" ON)
option(WITH_INSTRUMENTS "Install instruments" ON)
@ -623,7 +624,7 @@ src/gui/volMeter.cpp
src/gui/gui.cpp
)
if (WIN32 AND (MSVC OR CMAKE_SIZEOF_VOID_P EQUAL 8))
if (WIN32 AND NOT SUPPORT_XP)
list(APPEND GUI_SOURCES extern/nfd-modified/src/nfd_common.cpp)
list(APPEND GUI_SOURCES extern/nfd-modified/src/nfd_win.cpp)
endif()
@ -708,7 +709,7 @@ if (WIN32)
list(APPEND DEPENDENCIES_LIBRARIES -static)
endif()
# support Windows XP
if (CMAKE_SIZEOF_VOID_P EQUAL 4 AND NOT MSVC)
if (SUPPORT_XP)
list(APPEND DEPENDENCIES_DEFINES "_WIN32_WINNT=0x0501")
endif()
elseif (APPLE)

View File

@ -210,6 +210,7 @@ Available options:
| `SYSTEM_RTMIDI` | `OFF` | Use a system-installed version of RtMidi instead of the vendored one |
| `SYSTEM_ZLIB` | `OFF` | Use a system-installed version of zlib instead of the vendored one |
| `SYSTEM_SDL2` | `OFF` | Use a system-installed version of SDL2 instead of the vendored one |
| `SUPPORT_XP` | `OFF` | Build a Windows XP-compatible binary |
| `WARNINGS_ARE_ERRORS` | `OFF` (but consider enabling this & reporting any errors that arise from it!) | Whether warnings in furnace's C++ code should be treated as errors |
| `WITH_DEMOS` | `ON` | Install demo songs on `make install` |
| `WITH_INSTRUMENTS` | `ON` | Install demo instruments on `make install` |

BIN
demos/genesis/laidback.fur Normal file

Binary file not shown.

Binary file not shown.

BIN
demos/genesis/louder.fur Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -54,14 +54,16 @@
#include <chrono> // std::chrono
// Versions of mingw64 g++ up to 9.3.0 do not have a complete IFileDialog
// we don't use PFD on Windows anyway
#ifndef PFD_HAS_IFILEDIALOG
# define PFD_HAS_IFILEDIALOG 1
# if (defined __MINGW64__ || defined __MINGW32__) && defined __GXX_ABI_VERSION
# if __GXX_ABI_VERSION <= 1014
# undef PFD_HAS_IFILEDIALOG
# define PFD_HAS_IFILEDIALOG 0
# endif
# endif
#define PFD_HAS_IFILEDIALOG 0
//# define PFD_HAS_IFILEDIALOG 1
//# if (defined __MINGW64__ || defined __MINGW32__) && defined __GXX_ABI_VERSION
//# if __GXX_ABI_VERSION <= 1014
//# undef PFD_HAS_IFILEDIALOG
//# define PFD_HAS_IFILEDIALOG 0
//# endif
//# endif
#endif
namespace pfd

View File

@ -15,7 +15,7 @@ fi
cd win32build
# TODO: potential Arch-ism?
i686-w64-mingw32-cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-O2" -DCMAKE_CXX_FLAGS="-O2 -Wall -Wextra -Wno-unused-parameter -Wno-cast-function-type -Werror" -DBUILD_SHARED_LIBS=OFF .. || exit 1
i686-w64-mingw32-cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-O2" -DCMAKE_CXX_FLAGS="-O2 -Wall -Wextra -Wno-unused-parameter -Wno-cast-function-type -Werror" -DBUILD_SHARED_LIBS=OFF -DSUPPORT_XP=ON .. || exit 1
make -j8 || exit 1
i686-w64-mingw32-strip -s furnace.exe || exit 1

View File

@ -206,7 +206,8 @@ bool DivInstrumentSNES::operator==(const DivInstrumentSNES& other) {
_C(a) &&
_C(d) &&
_C(s) &&
_C(r)
_C(r) &&
_C(d2)
);
}

View File

@ -224,7 +224,7 @@ int DivPlatformAmiga::dispatch(DivCommand c) {
}
}
} else {
chan[c.chan].sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[c.chan].sample=ins->amiga.getSample(c.value);
chan[c.chan].useWave=false;
}
if (c.value!=DIV_NOTE_NULL) {

View File

@ -404,7 +404,7 @@ int DivPlatformAY8910::dispatch(DivCommand c) {
if (chan[c.chan].nextPSGMode.dac) {
if (skipRegisterWrites) break;
if (!parent->song.disableSampleMacro && (ins->type==DIV_INS_AMIGA || ins->amiga.useSample)) {
chan[c.chan].dac.sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[c.chan].dac.sample=ins->amiga.getSample(c.value);
if (chan[c.chan].dac.sample<0 || chan[c.chan].dac.sample>=parent->song.sampleLen) {
chan[c.chan].dac.sample=-1;
if (dumpWrites) addWrite(0xffff0002+(c.chan<<8),0);

View File

@ -405,7 +405,7 @@ int DivPlatformAY8930::dispatch(DivCommand c) {
if (chan[c.chan].nextPSGMode.dac) {
if (skipRegisterWrites) break;
if (ins->type==DIV_INS_AMIGA || ins->amiga.useSample) {
chan[c.chan].dac.sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[c.chan].dac.sample=ins->amiga.getSample(c.value);
if (chan[c.chan].dac.sample<0 || chan[c.chan].dac.sample>=parent->song.sampleLen) {
chan[c.chan].dac.sample=-1;
if (dumpWrites) addWrite(0xffff0002+(c.chan<<8),0);

View File

@ -202,7 +202,7 @@ int DivPlatformGA20::dispatch(DivCommand c) {
case DIV_CMD_NOTE_ON: {
DivInstrument* ins=parent->getIns(chan[c.chan].ins,DIV_INS_AMIGA);
chan[c.chan].macroVolMul=ins->type==DIV_INS_AMIGA?64:255;
chan[c.chan].sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[c.chan].sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) {
chan[c.chan].baseFreq=NOTE_PERIODIC(c.value);
}

View File

@ -346,6 +346,12 @@ void DivPlatformGenesis::tick(bool sysTick) {
chan[i].freqChanged=true;
}
if (i>=5 && chan[i].std.phaseReset.had) {
if (chan[i].std.phaseReset.val==1 && chan[i].furnaceDac) {
chan[i].dacPos=0;
}
}
if (i>=6) continue;
if (chan[i].std.phaseReset.had) {
@ -582,7 +588,7 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
if (c.chan>=5 && chan[c.chan].dacMode) {
if (skipRegisterWrites) break;
if (ins->type==DIV_INS_AMIGA) { // Furnace mode
chan[c.chan].dacSample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[c.chan].dacSample=ins->amiga.getSample(c.value);
if (chan[c.chan].dacSample<0 || chan[c.chan].dacSample>=parent->song.sampleLen) {
chan[c.chan].dacSample=-1;
if (dumpWrites) addWrite(0xffff0002,0);

View File

@ -274,7 +274,7 @@ int DivPlatformK007232::dispatch(DivCommand c) {
case DIV_CMD_NOTE_ON: {
DivInstrument* ins=parent->getIns(chan[c.chan].ins,DIV_INS_AMIGA);
chan[c.chan].macroVolMul=ins->type==DIV_INS_AMIGA?64:15;
chan[c.chan].sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[c.chan].sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) {
chan[c.chan].baseFreq=NOTE_PERIODIC(c.value);
}

View File

@ -264,7 +264,7 @@ int DivPlatformLynx::dispatch(DivCommand c) {
chan[c.chan].baseFreq=NOTE_PERIODIC(c.value);
if (chan[c.chan].pcm) {
chan[c.chan].sampleBaseFreq=NOTE_FREQUENCY(c.value);
chan[c.chan].sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[c.chan].sample=ins->amiga.getSample(c.value);
chan[c.chan].sampleAccum=0;
chan[c.chan].samplePos=0;
}

View File

@ -176,7 +176,7 @@ int DivPlatformMMC5::dispatch(DivCommand c) {
if (c.chan==2) { // PCM
DivInstrument* ins=parent->getIns(chan[c.chan].ins,DIV_INS_STD);
if (ins->type==DIV_INS_AMIGA) {
dacSample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) dacSample=ins->amiga.getSample(c.value);
if (dacSample<0 || dacSample>=parent->song.sampleLen) {
dacSample=-1;
if (dumpWrites) addWrite(0xffff0002,0);

View File

@ -150,7 +150,7 @@ int DivPlatformMSM6258::dispatch(DivCommand c) {
if (!chan[c.chan].std.vol.will) {
chan[c.chan].outVol=chan[c.chan].vol;
}
sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) sample=ins->amiga.getSample(c.value);
samplePos=0;
if (sample>=0 && sample<parent->song.sampleLen) {
//DivSample* s=parent->getSample(chan[c.chan].sample);

View File

@ -139,7 +139,7 @@ int DivPlatformMSM6295::dispatch(DivCommand c) {
if (!chan[c.chan].std.vol.will) {
chan[c.chan].outVol=chan[c.chan].vol;
}
chan[c.chan].sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[c.chan].sample=ins->amiga.getSample(c.value);
if (chan[c.chan].sample>=0 && chan[c.chan].sample<parent->song.sampleLen) {
//DivSample* s=parent->getSample(chan[c.chan].sample);
if (c.value!=DIV_NOTE_NULL) {

View File

@ -360,7 +360,7 @@ int DivPlatformNES::dispatch(DivCommand c) {
if (c.chan==4) { // PCM
DivInstrument* ins=parent->getIns(chan[c.chan].ins,DIV_INS_STD);
if (ins->type==DIV_INS_AMIGA) {
dacSample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) dacSample=ins->amiga.getSample(c.value);
if (dacSample<0 || dacSample>=parent->song.sampleLen) {
dacSample=-1;
if (dumpWrites && !dpcmMode) addWrite(0xffff0002,0);

View File

@ -690,7 +690,7 @@ int DivPlatformOPL::dispatch(DivCommand c) {
chan[c.chan].outVol=chan[c.chan].vol;
immWrite(18,chan[c.chan].outVol);
}
chan[c.chan].sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[c.chan].sample=ins->amiga.getSample(c.value);
if (chan[c.chan].sample>=0 && chan[c.chan].sample<parent->song.sampleLen) {
DivSample* s=parent->getSample(chan[c.chan].sample);
immWrite(8,0);

View File

@ -278,7 +278,7 @@ int DivPlatformPCE::dispatch(DivCommand c) {
if (ins->type==DIV_INS_AMIGA || ins->amiga.useSample) {
chan[c.chan].furnaceDac=true;
if (skipRegisterWrites) break;
chan[c.chan].dacSample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[c.chan].dacSample=ins->amiga.getSample(c.value);
if (chan[c.chan].dacSample<0 || chan[c.chan].dacSample>=parent->song.sampleLen) {
chan[c.chan].dacSample=-1;
if (dumpWrites) addWrite(0xffff0002+(c.chan<<8),0);

View File

@ -250,7 +250,7 @@ int DivPlatformPCMDAC::dispatch(DivCommand c) {
}
}
} else {
chan[0].sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[0].sample=ins->amiga.getSample(c.value);
chan[0].useWave=false;
}
if (c.value!=DIV_NOTE_NULL) {

View File

@ -323,14 +323,14 @@ void DivPlatformQSound::tick(bool sysTick) {
if (i<16) {
qsound_end = offPCM[chan[i].sample] + length + 15;
} else {
qsound_end = offBS[chan[i].sample] + length + 15;
qsound_end = offBS[chan[i].sample] + (length>>1) + 15;
}
qsound_loop = 15;
} else {
if (i<16) {
qsound_end = offPCM[chan[i].sample] + length;
} else {
qsound_end = offBS[chan[i].sample] + length;
qsound_end = offBS[chan[i].sample] + (length>>1);
}
qsound_loop = length - loopStart;
}
@ -428,6 +428,9 @@ void DivPlatformQSound::tick(bool sysTick) {
} else {
rWrite(q1a_vol_map[i-16],0);
rWrite(Q1A_KEYON+(i-16),0);
rWrite(q1a_end_map[i-16], 1);
rWrite(q1a_start_map[i-16], 0);
rWrite(Q1A_KEYON+(i-16),1);
}
} else if (chan[i].active) {
//logV("ch %d frequency set to %04x, off=%f, note=%d, %04x!",i,chan[i].freq,off,chan[i].note,QS_NOTE_FREQUENCY(chan[i].note));
@ -447,7 +450,7 @@ int DivPlatformQSound::dispatch(DivCommand c) {
case DIV_CMD_NOTE_ON: {
DivInstrument* ins=parent->getIns(chan[c.chan].ins,DIV_INS_AMIGA);
chan[c.chan].isNewQSound=(ins->type==DIV_INS_QSOUND);
chan[c.chan].sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[c.chan].sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) {
chan[c.chan].baseFreq=QS_NOTE_FREQUENCY(c.value);
}

View File

@ -180,7 +180,7 @@ int DivPlatformRF5C68::dispatch(DivCommand c) {
case DIV_CMD_NOTE_ON: {
DivInstrument* ins=parent->getIns(chan[c.chan].ins,DIV_INS_AMIGA);
chan[c.chan].macroVolMul=ins->type==DIV_INS_AMIGA?64:255;
chan[c.chan].sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[c.chan].sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) {
chan[c.chan].baseFreq=NOTE_FREQUENCY(c.value);
}

View File

@ -133,9 +133,9 @@ void DivPlatformSegaPCM::tick(bool sysTick) {
chan[i].freq=chan[i].baseFreq+(chan[i].pitch>>1)-64;
if (!parent->song.oldArpStrategy) {
if (chan[i].fixedArp) {
chan[i].freq=(chan[i].baseNoteOverride<<7)+(chan[i].pitch>>1)-64+chan[i].pitch2;
chan[i].freq=(chan[i].baseNoteOverride<<6)+(chan[i].pitch>>1)-64+chan[i].pitch2;
} else {
chan[i].freq+=chan[i].arpOff<<7;
chan[i].freq+=chan[i].arpOff<<6;
}
}
if (chan[i].furnacePCM) {
@ -216,7 +216,7 @@ int DivPlatformSegaPCM::dispatch(DivCommand c) {
if (ins->type==DIV_INS_AMIGA || ins->type==DIV_INS_SEGAPCM) {
chan[c.chan].macroVolMul=(ins->type==DIV_INS_AMIGA)?64:127;
chan[c.chan].isNewSegaPCM=(ins->type==DIV_INS_SEGAPCM);
chan[c.chan].pcm.sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[c.chan].pcm.sample=ins->amiga.getSample(c.value);
if (chan[c.chan].pcm.sample<0 || chan[c.chan].pcm.sample>=parent->song.sampleLen) {
chan[c.chan].pcm.sample=-1;
if (dumpWrites) {

View File

@ -336,7 +336,7 @@ int DivPlatformSNES::dispatch(DivCommand c) {
}
chan[c.chan].ws.init(ins,chan[c.chan].wtLen,15,chan[c.chan].insChanged);
} else {
chan[c.chan].sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[c.chan].sample=ins->amiga.getSample(c.value);
chan[c.chan].useWave=false;
}
if (chan[c.chan].useWave || chan[c.chan].sample<0 || chan[c.chan].sample>=parent->song.sampleLen) {

View File

@ -754,9 +754,15 @@ void namco_audio_device::sound_stream_update(short** outputs, int len)
int cnt;
if (voice->noise_state)
buffer[i]+=noise_data;
else
{
buffer[i]+=noise_data;
voice->last_out=noise_data;
}
else {
buffer[i]+=-noise_data;
voice->last_out=-noise_data;
}
if (hold)
{

View File

@ -234,7 +234,7 @@ int DivPlatformSwan::dispatch(DivCommand c) {
dacPos=0;
dacPeriod=0;
if (ins->type==DIV_INS_AMIGA || ins->amiga.useSample) {
dacSample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) dacSample=ins->amiga.getSample(c.value);
if (dacSample<0 || dacSample>=parent->song.sampleLen) {
dacSample=-1;
if (dumpWrites) addWrite(0xffff0002,0);

View File

@ -235,7 +235,7 @@ int DivPlatformVERA::dispatch(DivCommand c) {
if (c.chan<16) {
rWriteLo(c.chan,2,chan[c.chan].vol);
} else {
chan[16].pcm.sample=parent->getIns(chan[16].ins,DIV_INS_VERA)->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[16].pcm.sample=parent->getIns(chan[16].ins,DIV_INS_VERA)->amiga.getSample(c.value);
if (chan[16].pcm.sample<0 || chan[16].pcm.sample>=parent->song.sampleLen) {
chan[16].pcm.sample=-1;
}

View File

@ -242,7 +242,7 @@ int DivPlatformVRC6::dispatch(DivCommand c) {
if (chan[c.chan].pcm) {
if (skipRegisterWrites) break;
if (ins->type==DIV_INS_AMIGA || ins->amiga.useSample) {
chan[c.chan].dacSample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[c.chan].dacSample=ins->amiga.getSample(c.value);
if (chan[c.chan].dacSample<0 || chan[c.chan].dacSample>=parent->song.sampleLen) {
chan[c.chan].dacSample=-1;
if (dumpWrites) addWrite(0xffff0002+(c.chan<<8),0);

View File

@ -539,7 +539,7 @@ int DivPlatformX1_010::dispatch(DivCommand c) {
if (chan[c.chan].furnacePCM) {
chan[c.chan].pcm=true;
chan[c.chan].macroInit(ins);
chan[c.chan].sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[c.chan].sample=ins->amiga.getSample(c.value);
if (chan[c.chan].sample>=0 && chan[c.chan].sample<parent->song.sampleLen) {
DivSample* s=parent->getSample(chan[c.chan].sample);
if (isBanked) {

View File

@ -449,7 +449,7 @@ void DivPlatformYM2203::tick(bool sysTick) {
if (parent->song.linearPitch==2) {
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,4,chan[i].pitch2,chipClock,CHIP_FREQBASE,11);
} else {
int fNum=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,4,chan[i].pitch2);
int fNum=parent->calcFreq(chan[i].baseFreq&0x7ff,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,4,chan[i].pitch2);
int block=(chan[i].baseFreq&0xf800)>>11;
if (fNum<0) fNum=0;
if (fNum>2047) {

View File

@ -796,7 +796,7 @@ int DivPlatformYM2608::dispatch(DivCommand c) {
chan[c.chan].outVol=chan[c.chan].vol;
immWrite(0x10b,chan[c.chan].outVol);
}
chan[c.chan].sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[c.chan].sample=ins->amiga.getSample(c.value);
if (chan[c.chan].sample>=0 && chan[c.chan].sample<parent->song.sampleLen) {
DivSample* s=parent->getSample(chan[c.chan].sample);
immWrite(0x100,0x01); // reset

View File

@ -731,7 +731,7 @@ int DivPlatformYM2610::dispatch(DivCommand c) {
chan[c.chan].outVol=chan[c.chan].vol;
immWrite(0x1b,chan[c.chan].outVol);
}
chan[c.chan].sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[c.chan].sample=ins->amiga.getSample(c.value);
if (chan[c.chan].sample>=0 && chan[c.chan].sample<parent->song.sampleLen) {
DivSample* s=parent->getSample(chan[c.chan].sample);
immWrite(0x12,(sampleOffB[chan[c.chan].sample]>>8)&0xff);
@ -802,7 +802,7 @@ int DivPlatformYM2610::dispatch(DivCommand c) {
if (!chan[c.chan].std.vol.will) {
chan[c.chan].outVol=chan[c.chan].vol;
}
chan[c.chan].sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[c.chan].sample=ins->amiga.getSample(c.value);
if (chan[c.chan].sample>=0 && chan[c.chan].sample<parent->song.sampleLen) {
DivSample* s=parent->getSample(chan[c.chan].sample);
immWrite(0x110+c.chan-adpcmAChanOffs,(sampleOffA[chan[c.chan].sample]>>8)&0xff);

View File

@ -798,7 +798,7 @@ int DivPlatformYM2610B::dispatch(DivCommand c) {
chan[c.chan].outVol=chan[c.chan].vol;
immWrite(0x1b,chan[c.chan].outVol);
}
chan[c.chan].sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[c.chan].sample=ins->amiga.getSample(c.value);
if (chan[c.chan].sample>=0 && chan[c.chan].sample<parent->song.sampleLen) {
DivSample* s=parent->getSample(chan[c.chan].sample);
immWrite(0x12,(sampleOffB[chan[c.chan].sample]>>8)&0xff);
@ -869,7 +869,7 @@ int DivPlatformYM2610B::dispatch(DivCommand c) {
if (!chan[c.chan].std.vol.will) {
chan[c.chan].outVol=chan[c.chan].vol;
}
chan[c.chan].sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[c.chan].sample=ins->amiga.getSample(c.value);
if (chan[c.chan].sample>=0 && chan[c.chan].sample<parent->song.sampleLen) {
DivSample* s=parent->getSample(chan[c.chan].sample);
immWrite(0x110+c.chan-adpcmAChanOffs,(sampleOffA[chan[c.chan].sample]>>8)&0xff);

View File

@ -212,7 +212,7 @@ int DivPlatformYMZ280B::dispatch(DivCommand c) {
DivInstrument* ins=parent->getIns(chan[c.chan].ins,DIV_INS_AMIGA);
chan[c.chan].isNewYMZ=ins->type==DIV_INS_YMZ280B;
chan[c.chan].macroVolMul=ins->type==DIV_INS_AMIGA?64:255;
chan[c.chan].sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) chan[c.chan].sample=ins->amiga.getSample(c.value);
if (c.value!=DIV_NOTE_NULL) {
chan[c.chan].baseFreq=NOTE_FREQUENCY(c.value);
}

View File

@ -1597,6 +1597,7 @@ void DivEngine::nextBuf(float** in, float** out, int inChans, int outChans, unsi
// logic starts here
for (int i=0; i<song.systemLen; i++) {
// TODO: we may have a problem here
disCont[i].lastAvail=blip_samples_avail(disCont[i].bb[0]);
if (disCont[i].lastAvail>0) {
disCont[i].flush(disCont[i].lastAvail);
@ -1696,6 +1697,10 @@ void DivEngine::nextBuf(float** in, float** out, int inChans, int outChans, unsi
totalProcessed=size-(runLeftG>>MASTER_CLOCK_PREC);
for (int i=0; i<song.systemLen; i++) {
if (size<disCont[i].lastAvail) {
logW("%d: size<lastAvail! %d<%d",i,size,disCont[i].lastAvail);
continue;
}
disCont[i].fillBuf(disCont[i].runtotal,disCont[i].lastAvail,size-disCont[i].lastAvail);
}

View File

@ -88,6 +88,7 @@ const char* aboutLine[]={
"Lunathir",
"LVintageNerd",
"Mahbod Karamoozian",
"Martin Demsky",
"Miker",
"nicco1690",
"<nk>",

View File

@ -5156,6 +5156,7 @@ void FurnaceGUI::drawInsEdit() {
if (ins->type==DIV_INS_ADPCMB) waveMax=0;
if (ins->type==DIV_INS_QSOUND) waveMax=0;
if (ins->type==DIV_INS_YMZ280B) waveMax=0;
if (ins->type==DIV_INS_RF5C68) waveMax=0;
if (ins->type==DIV_INS_MSM5232) waveMax=0;
if (ins->type==DIV_INS_MSM6258) waveMax=0;
if (ins->type==DIV_INS_MSM6295) waveMax=0;