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

* 'master' of https://github.com/tildearrow/furnace: (55 commits)
  GUI: get rid of these stupid icons
  update to-do list
  MSM6258: the final bits
  MSM6258: clock/rate selection
  MSM6258: prepare for rate changing
  Update n163.md
  YM2612: DualPCM per-channel osc
  YM2612: more DualPCM muting fixes
  YM2612: fix DualPCM muting
  GUI: finish the blank ins up
  GUI: add "blank new instrument" option
  GUI: add mono/poly note preview button
  PC speaker: don't use printf/perror
  YM2612: CSM arpeggio and slides
  YM2612: - C   S   M -
  YM2612: half-working CSM
  YM2612: earliest completely untested CSM work
  delay collapse/expand pattern/song feature :<
  GUI: much more stable osc view
  YM2612: fix DAC output not visible in per-chan osc
  ...

# Conflicts:
#	src/engine/platform/genesis.cpp
#	src/engine/platform/genesis.h
#	src/ta-utils.h
This commit is contained in:
cam900 2022-06-26 00:36:36 +09:00
commit 2b5bb91237
3576 changed files with 494153 additions and 375 deletions

View file

@ -828,6 +828,44 @@ bool DivEngine::removeSubSong(int index) {
return true;
}
void DivEngine::moveSubSongUp(size_t index) {
if (index<1 || index>=song.subsong.size()) return;
BUSY_BEGIN;
saveLock.lock();
if (index==curSubSongIndex) {
curSubSongIndex--;
} else if (index-1==curSubSongIndex) {
curSubSongIndex++;
}
DivSubSong* prev=song.subsong[index-1];
song.subsong[index-1]=song.subsong[index];
song.subsong[index]=prev;
saveLock.unlock();
BUSY_END;
}
void DivEngine::moveSubSongDown(size_t index) {
if (index>=song.subsong.size()-1) return;
BUSY_BEGIN;
saveLock.lock();
if (index==curSubSongIndex) {
curSubSongIndex++;
} else if (index+1==curSubSongIndex) {
curSubSongIndex--;
}
DivSubSong* prev=song.subsong[index+1];
song.subsong[index+1]=song.subsong[index];
song.subsong[index]=prev;
saveLock.unlock();
BUSY_END;
}
void DivEngine::clearSubSongs() {
BUSY_BEGIN;
saveLock.lock();
@ -988,6 +1026,9 @@ DivInstrument* DivEngine::getIns(int index, DivInstrumentType fallbackType) {
case DIV_INS_OPL:
return &song.nullInsOPL;
break;
case DIV_INS_OPL_DRUMS:
return &song.nullInsOPLDrums;
break;
default:
break;
}
@ -1695,6 +1736,9 @@ int DivEngine::addInstrument(int refChan) {
case DIV_INS_OPL:
*ins=song.nullInsOPL;
break;
case DIV_INS_OPL_DRUMS:
*ins=song.nullInsOPLDrums;
break;
default:
break;
}
@ -2470,7 +2514,7 @@ void DivEngine::autoNoteOn(int ch, int ins, int note, int vol) {
// 2. find a free channel
do {
if (isViable[finalChan] && chan[finalChan].midiNote==-1 && (insInst->type==DIV_INS_OPL || getChannelType(finalChan)==finalChanType || notInViableChannel)) {
if ((!midiPoly) || (isViable[finalChan] && chan[finalChan].midiNote==-1 && (insInst->type==DIV_INS_OPL || getChannelType(finalChan)==finalChanType || notInViableChannel))) {
chan[finalChan].midiNote=note;
chan[finalChan].midiAge=midiAgeCounter++;
pendingNotes.push(DivNoteEvent(finalChan,ins,note,vol,true));
@ -2526,6 +2570,10 @@ void DivEngine::autoNoteOffAll() {
}
}
void DivEngine::setAutoNotePoly(bool poly) {
midiPoly=poly;
}
void DivEngine::setOrder(unsigned char order) {
BUSY_BEGIN_SOFT;
curOrder=order;