diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2540f8133..980062769 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ defaults: shell: bash env: - BUILD_TYPE: Release + BUILD_TYPE: Debug jobs: build: diff --git a/demos/multichip/colab.fur b/demos/multichip/colab.fur new file mode 100644 index 000000000..4d104da1a Binary files /dev/null and b/demos/multichip/colab.fur differ diff --git a/demos/x16/dance with me.fur b/demos/x16/dance with me.fur new file mode 100644 index 000000000..7cb53305a Binary files /dev/null and b/demos/x16/dance with me.fur differ diff --git a/src/engine/platform/ay8930.cpp b/src/engine/platform/ay8930.cpp index 50b36a64f..3dc8eedbc 100644 --- a/src/engine/platform/ay8930.cpp +++ b/src/engine/platform/ay8930.cpp @@ -297,7 +297,7 @@ void DivPlatformAY8930::tick(bool sysTick) { } } if (chan[i].std.ex1.had) { // duty - rWrite(0x16+i,chan[i].std.ex1.val); + immWrite(0x16+i,chan[i].std.ex1.val); } if (chan[i].std.ex2.had) { chan[i].envelope.mode=chan[i].std.ex2.val; diff --git a/src/engine/platform/c64.cpp b/src/engine/platform/c64.cpp index 4d1caf9ab..d52a5dd00 100644 --- a/src/engine/platform/c64.cpp +++ b/src/engine/platform/c64.cpp @@ -148,7 +148,7 @@ void DivPlatformC64::tick(bool sysTick) { if (chan[i].std.pitch.had) { if (chan[i].std.pitch.mode) { chan[i].pitch2+=chan[i].std.pitch.val; - CLAMP_VAR(chan[i].pitch2,-32768,32767); + CLAMP_VAR(chan[i].pitch2,-65535,65535); } else { chan[i].pitch2=chan[i].std.pitch.val; } @@ -188,6 +188,7 @@ void DivPlatformC64::tick(bool sysTick) { if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) { chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,8,chan[i].pitch2,chipClock,CHIP_FREQBASE); + if (chan[i].freq<0) chan[i].freq=0; if (chan[i].freq>0xffff) chan[i].freq=0xffff; if (chan[i].keyOn) { rWrite(i*7+5,(chan[i].attack<<4)|(chan[i].decay)); diff --git a/src/engine/platform/lynx.cpp b/src/engine/platform/lynx.cpp index 7ae060b7e..07be2d6f6 100644 --- a/src/engine/platform/lynx.cpp +++ b/src/engine/platform/lynx.cpp @@ -509,12 +509,12 @@ DivPlatformLynx::MikeyFreqDiv::MikeyFreqDiv(int frequency) { if (top>7) { clockDivider=top-7; - backup=frequency>>(top-7); + backup=clamped>>(top-7); } else { clockDivider=0; - backup=frequency; + backup=clamped; } } diff --git a/src/engine/platform/qsound.cpp b/src/engine/platform/qsound.cpp index 299e980a6..57ab138c6 100644 --- a/src/engine/platform/qsound.cpp +++ b/src/engine/platform/qsound.cpp @@ -707,11 +707,11 @@ const void* DivPlatformQSound::getSampleMem(int index) { } size_t DivPlatformQSound::getSampleMemCapacity(int index) { - return (index == 0 || index == 1) ? 16777216 : 0; + return index == 0 ? 16777216 : index == 1 ? MAX(0,16777216 - sampleMemUsage) : 0; } size_t DivPlatformQSound::getSampleMemUsage(int index) { - return index == 0 ? sampleMemLen : index == 1 ? sampleMemLenBS : 0; + return index == 0 ? sampleMemLen : index == 1 ? MAX(0,sampleMemLenBS - sampleMemUsage) : 0; } bool DivPlatformQSound::isSampleLoaded(int index, int sample) { @@ -766,6 +766,7 @@ void DivPlatformQSound::renderSamples(int sysID) { sampleMemLen=memPos+256; memPos=(memPos+0xffff)&0xff0000; + sampleMemUsage=memPos; for (int i=0; isong.sampleLen; i++) { DivSample* s=parent->song.sample[i]; @@ -818,6 +819,7 @@ int DivPlatformQSound::init(DivEngine* p, int channels, int sugRate, const DivCo sampleMem=new unsigned char[getSampleMemCapacity()]; sampleMemLen=0; sampleMemLenBS=0; + sampleMemUsage=0; chip.rom_data=sampleMem; chip.rom_mask=0xffffff; reset(); diff --git a/src/engine/platform/qsound.h b/src/engine/platform/qsound.h index f0b0ed03b..c04514ed8 100644 --- a/src/engine/platform/qsound.h +++ b/src/engine/platform/qsound.h @@ -50,6 +50,7 @@ class DivPlatformQSound: public DivDispatch { unsigned char* sampleMem; size_t sampleMemLen; size_t sampleMemLenBS; + size_t sampleMemUsage; bool sampleLoaded[256]; bool sampleLoadedBS[256]; struct qsound_chip chip; diff --git a/src/engine/platform/x1_010.cpp b/src/engine/platform/x1_010.cpp index 34973a99d..12e6280d9 100644 --- a/src/engine/platform/x1_010.cpp +++ b/src/engine/platform/x1_010.cpp @@ -362,7 +362,7 @@ void DivPlatformX1_010::tick(bool sysTick) { if (chan[i].std.pitch.had) { if (chan[i].std.pitch.mode) { chan[i].pitch2+=chan[i].std.pitch.val; - CLAMP_VAR(chan[i].pitch2,-32768,32767); + CLAMP_VAR(chan[i].pitch2,-65535,65535); } else { chan[i].pitch2=chan[i].std.pitch.val; } @@ -484,6 +484,7 @@ void DivPlatformX1_010::tick(bool sysTick) { if (chan[i].freq>255) chan[i].freq=255; chWrite(i,2,chan[i].freq&0xff); } else { + if (chan[i].freq<0) chan[i].freq=0; if (chan[i].freq>65535) chan[i].freq=65535; chWrite(i,2,chan[i].freq&0xff); chWrite(i,3,(chan[i].freq>>8)&0xff); diff --git a/src/engine/platform/zxbeeper.cpp b/src/engine/platform/zxbeeper.cpp index 7bd992f81..f8762c7f2 100644 --- a/src/engine/platform/zxbeeper.cpp +++ b/src/engine/platform/zxbeeper.cpp @@ -90,7 +90,7 @@ void DivPlatformZXBeeper::tick(bool sysTick) { if (chan[i].std.pitch.had) { if (chan[i].std.pitch.mode) { chan[i].pitch2+=chan[i].std.pitch.val; - CLAMP_VAR(chan[i].pitch2,-32768,32767); + CLAMP_VAR(chan[i].pitch2,-65535,65535); } else { chan[i].pitch2=chan[i].std.pitch.val; } @@ -99,6 +99,7 @@ void DivPlatformZXBeeper::tick(bool sysTick) { if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) { if (chan[i].active) { chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,2,chan[i].pitch2,chipClock,CHIP_FREQBASE); + if (chan[i].freq<0) chan[i].freq=0; if (chan[i].freq>65535) chan[i].freq=65535; } if (chan[i].keyOn) { diff --git a/src/gui/about.cpp b/src/gui/about.cpp index fd229ecf6..532cb6bde 100644 --- a/src/gui/about.cpp +++ b/src/gui/about.cpp @@ -63,6 +63,7 @@ const char* aboutLine[]={ "akumanatt", "AmigaX", "AURORA*FIELDS", + "battybeats", "BlueElectric05", "breakthetargets", "brickblock369",