Merge branch 'master' into feature/Moar-patch-bank-support-part3

This commit is contained in:
James Alan Nguyen 2022-05-17 11:36:34 +10:00
commit ec80a2218c
7 changed files with 18 additions and 8 deletions

View file

@ -557,6 +557,11 @@ if (NOT ANDROID)
install(DIRECTORY papers DESTINATION ${CMAKE_INSTALL_DOCDIR}) install(DIRECTORY papers DESTINATION ${CMAKE_INSTALL_DOCDIR})
install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DATADIR}/licenses/furnace) install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DATADIR}/licenses/furnace)
install(DIRECTORY demos DESTINATION ${CMAKE_INSTALL_DATADIR}/furnace) install(DIRECTORY demos DESTINATION ${CMAKE_INSTALL_DATADIR}/furnace)
foreach(num 16 32 64 128 256 512)
set(res ${num}x${num})
install(FILES res/icon.iconset/icon_${res}.png RENAME furnace.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/${res}/apps)
install(FILES res/icon.iconset/icon_${res}@2x.png RENAME furnace.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/${res}@2/apps)
endforeach()
install(FILES res/logo.png RENAME furnace.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/1024x1024/apps) install(FILES res/logo.png RENAME furnace.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/1024x1024/apps)
endif() endif()

View file

@ -660,6 +660,7 @@ void DivPlatformAY8910::setFlags(unsigned int flags) {
break; break;
} }
ay->device_start(); ay->device_start();
ay->device_reset();
stereo=(flags>>6)&1; stereo=(flags>>6)&1;
} }

View file

@ -301,6 +301,7 @@ void DivPlatformOPLL::tick(bool sysTick) {
for (int i=0; i<11; i++) { for (int i=0; i<11; i++) {
if (chan[i].freqChanged) { if (chan[i].freqChanged) {
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,false,octave(chan[i].baseFreq),chan[i].pitch2,chipClock,CHIP_FREQBASE); chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,false,octave(chan[i].baseFreq),chan[i].pitch2,chipClock,CHIP_FREQBASE);
if (chan[i].fixedFreq>0) chan[i].freq=chan[i].fixedFreq;
if (chan[i].freq>262143) chan[i].freq=262143; if (chan[i].freq>262143) chan[i].freq=262143;
int freqt=toFreq(chan[i].freq)+chan[i].pitch2; int freqt=toFreq(chan[i].freq)+chan[i].pitch2;
chan[i].freqL=freqt&0xff; chan[i].freqL=freqt&0xff;
@ -420,15 +421,16 @@ int DivPlatformOPLL::dispatch(DivCommand c) {
if (chan[c.chan].state.opllPreset==16 && chan[c.chan].state.fixedDrums) { if (chan[c.chan].state.opllPreset==16 && chan[c.chan].state.fixedDrums) {
switch (c.chan) { switch (c.chan) {
case 6: case 6:
chan[c.chan].baseFreq=(chan[c.chan].state.kickFreq&511)<<(chan[c.chan].state.kickFreq>>9); chan[c.chan].fixedFreq=(chan[c.chan].state.kickFreq&511)<<(chan[c.chan].state.kickFreq>>9);
break; break;
case 7: case 10: case 7: case 10:
chan[c.chan].baseFreq=(chan[c.chan].state.snareHatFreq&511)<<(chan[c.chan].state.snareHatFreq>>9); chan[c.chan].fixedFreq=(chan[c.chan].state.snareHatFreq&511)<<(chan[c.chan].state.snareHatFreq>>9);
break; break;
case 8: case 9: case 8: case 9:
chan[c.chan].baseFreq=(chan[c.chan].state.tomTopFreq&511)<<(chan[c.chan].state.tomTopFreq>>9); chan[c.chan].fixedFreq=(chan[c.chan].state.tomTopFreq&511)<<(chan[c.chan].state.tomTopFreq>>9);
break; break;
default: default:
chan[c.chan].fixedFreq=0;
chan[c.chan].baseFreq=NOTE_FREQUENCY(c.value); chan[c.chan].baseFreq=NOTE_FREQUENCY(c.value);
break; break;
} }

View file

@ -33,7 +33,7 @@ class DivPlatformOPLL: public DivDispatch {
DivInstrumentFM state; DivInstrumentFM state;
DivMacroInt std; DivMacroInt std;
unsigned char freqH, freqL; unsigned char freqH, freqL;
int freq, baseFreq, pitch, pitch2, note, ins; int freq, baseFreq, pitch, pitch2, note, ins, fixedFreq;
bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, furnaceDac, inPorta; bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, furnaceDac, inPorta;
int vol, outVol; int vol, outVol;
unsigned char pan; unsigned char pan;
@ -50,6 +50,7 @@ class DivPlatformOPLL: public DivDispatch {
pitch2(0), pitch2(0),
note(0), note(0),
ins(-1), ins(-1),
fixedFreq(0),
active(false), active(false),
insChanged(true), insChanged(true),
freqChanged(false), freqChanged(false),

View file

@ -1063,6 +1063,7 @@ void ay8910_device::sound_stream_update(short** outputs, int outLen)
tone = &m_tone[chan]; tone = &m_tone[chan];
const int period = tone->period * (m_step_mul << 1); const int period = tone->period * (m_step_mul << 1);
tone->count += is_expanded_mode() ? 32 : ((m_feature & PSG_HAS_EXPANDED_MODE) ? 1 : 2); tone->count += is_expanded_mode() ? 32 : ((m_feature & PSG_HAS_EXPANDED_MODE) ? 1 : 2);
if (period==0) continue;
while (tone->count >= period) while (tone->count >= period)
{ {
tone->duty_cycle = (tone->duty_cycle - 1) & 0x1f; tone->duty_cycle = (tone->duty_cycle - 1) & 0x1f;

View file

@ -1221,9 +1221,9 @@ void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) {
if (!dirExists(workingDirSong)) workingDirSong=getHomeDir(); if (!dirExists(workingDirSong)) workingDirSong=getHomeDir();
hasOpened=fileDialog->openLoad( hasOpened=fileDialog->openLoad(
"Open File", "Open File",
{"compatible files", "*.fur *.dmf *.mod *.ftm", {"compatible files", "*.fur *.dmf *.mod",
"all files", ".*"}, "all files", ".*"},
"compatible files{.fur,.dmf,.mod,.ftm},.*", "compatible files{.fur,.dmf,.mod},.*",
workingDirSong, workingDirSong,
dpiScale dpiScale
); );
@ -3566,7 +3566,7 @@ bool FurnaceGUI::loop() {
// backup trigger // backup trigger
if (modified) { if (modified) {
if (backupTimer>0) { if (backupTimer>0) {
backupTimer-=ImGui::GetIO().DeltaTime; backupTimer=(backupTimer-ImGui::GetIO().DeltaTime);
if (backupTimer<=0) { if (backupTimer<=0) {
backupTask=std::async(std::launch::async,[this]() -> bool { backupTask=std::async(std::launch::async,[this]() -> bool {
if (backupPath==curFileName) { if (backupPath==curFileName) {

View file

@ -799,7 +799,7 @@ class FurnaceGUI {
double aboutScroll, aboutSin; double aboutScroll, aboutSin;
float aboutHue; float aboutHue;
double backupTimer; std::atomic<double> backupTimer;
std::future<bool> backupTask; std::future<bool> backupTask;
std::mutex backupLock; std::mutex backupLock;
String backupPath; String backupPath;